Skip to content

Commit 83ef7c7

Browse files
author
Stefan Richter
committed
tools/firewire: nosy-dump: use linux/firewire-constants.h
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
1 parent 269fe10 commit 83ef7c7

File tree

3 files changed

+11
-31
lines changed

3 files changed

+11
-31
lines changed

tools/firewire/decode-fcp.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
#include <stdlib.h>
1+
#include <linux/firewire-constants.h>
22
#include <stdio.h>
3+
#include <stdlib.h>
4+
35
#include "list.h"
46
#include "nosy-dump.h"
57

@@ -176,7 +178,7 @@ decode_fcp(struct link_transaction *t)
176178
((unsigned long long) t->request->packet.common.offset_high << 32) |
177179
t->request->packet.common.offset_low;
178180

179-
if (t->request->packet.common.tcode != TCODE_WRITE_BLOCK)
181+
if (t->request->packet.common.tcode != TCODE_WRITE_BLOCK_REQUEST)
180182
return 0;
181183

182184
if (offset == CSR_FCP_COMMAND || offset == CSR_FCP_RESPONSE) {

tools/firewire/nosy-dump.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include <byteswap.h>
2121
#include <endian.h>
2222
#include <fcntl.h>
23+
#include <linux/firewire-constants.h>
2324
#include <poll.h>
2425
#include <popt.h>
2526
#include <signal.h>
@@ -522,8 +523,8 @@ handle_request_packet(uint32_t *data, size_t length)
522523

523524
switch (sa->ack) {
524525
case ACK_COMPLETE:
525-
if (p->common.tcode != TCODE_WRITE_QUADLET &&
526-
p->common.tcode != TCODE_WRITE_BLOCK)
526+
if (p->common.tcode != TCODE_WRITE_QUADLET_REQUEST &&
527+
p->common.tcode != TCODE_WRITE_BLOCK_REQUEST)
527528
/* error, unified transactions only allowed for write */;
528529
list_remove(&t->link);
529530
handle_transaction(t);
@@ -967,7 +968,7 @@ int main(int argc, const char *argv[])
967968

968969
filter = ~0;
969970
if (!option_iso)
970-
filter &= ~(1 << TCODE_ISO_DATA);
971+
filter &= ~(1 << TCODE_STREAM_DATA);
971972
if (!option_cycle_start)
972973
filter &= ~(1 << TCODE_CYCLE_START);
973974
if (view == VIEW_STATS)

tools/firewire/nosy-dump.h

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,36 +3,11 @@
33

44
#define array_length(array) (sizeof(array) / sizeof(array[0]))
55

6-
#define TCODE_WRITE_QUADLET 0x0
7-
#define TCODE_WRITE_BLOCK 0x1
8-
#define TCODE_WRITE_RESPONSE 0x2
9-
#define TCODE_READ_QUADLET 0x4
10-
#define TCODE_READ_BLOCK 0x5
11-
#define TCODE_READ_QUADLET_RESPONSE 0x6
12-
#define TCODE_READ_BLOCK_RESPONSE 0x7
13-
#define TCODE_CYCLE_START 0x8
14-
#define TCODE_LOCK_REQUEST 0x9
15-
#define TCODE_ISO_DATA 0xa
16-
#define TCODE_LOCK_RESPONSE 0xb
17-
#define TCODE_PHY_PACKET 0x10
18-
19-
#define ACK_NO_ACK 0x0
20-
#define ACK_COMPLETE 0x1
21-
#define ACK_PENDING 0x2
22-
#define ACK_BUSY_X 0x4
23-
#define ACK_BUSY_A 0x5
24-
#define ACK_BUSY_B 0x6
25-
#define ACK_DATA_ERROR 0xd
26-
#define ACK_TYPE_ERROR 0xe
27-
6+
#define ACK_NO_ACK 0x0
287
#define ACK_DONE(a) ((a >> 2) == 0)
298
#define ACK_BUSY(a) ((a >> 2) == 1)
309
#define ACK_ERROR(a) ((a >> 2) == 3)
3110

32-
#define SPEED_100 0x0
33-
#define SPEED_200 0x1
34-
#define SPEED_400 0x2
35-
3611
#include <stdint.h>
3712

3813
struct phy_packet {
@@ -92,6 +67,8 @@ struct phy_packet {
9267
uint32_t ack;
9368
};
9469

70+
#define TCODE_PHY_PACKET 0x10
71+
9572
#define PHY_PACKET_CONFIGURATION 0x00
9673
#define PHY_PACKET_LINK_ON 0x01
9774
#define PHY_PACKET_SELF_ID 0x02

0 commit comments

Comments
 (0)