From 9f6d3c4b76314c40c866a935d78c80fd284768bd Mon Sep 17 00:00:00 2001 From: Stefan Richter Date: Thu, 22 Jul 2010 11:58:05 +0200 Subject: tools/firewire: add userspace front-end of nosy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This adds nosy-dump, the userspace part of nosy, the IEEE 1394 traffic sniffer for Texas Instruments PCILynx/ PCILynx2 based cards. Author is Kristian Høgsberg. The files added here are taken from git://anongit.freedesktop.org/~krh/nosy commit ee29be97 (2009-11-10) with the following changes by Stefan Richter: - Parts pertaining to the kernel module removed from Makefile. - dist target removed from the Makefile. - Mentioned nosy-dump in the Kconfig help to nosy's kernel component. - Add copyright notice to nosy-dump.c. This is a duplicate of the respective notice in the kernel component nosy.c except for a time span of 2002 - 2006, according to Kristian's git log. "git shortlog decode-fcp.c list.h nosy-dump.[ch]" from nosy's git repository: Jonathan Woithe (1): Save logs on Ctrl-C Kristian Høgsberg (11): Pull over nosy from mercurial repo. Remove some fields from default view, add logging feature. Use infinite time out for poll(), mark more detail fields. Fix byte ordering macro. Add decoding of iso data and lock packets. Add flag to indicate data length field. Add cycle start packet decoding, add --iso and --cycle-start flags. Distinguish between phy-packets and 0-length iso data. Fix transaction and stats view. Add simple AV/C decoder. Don't break down on big payloads. Signed-off-by: Stefan Richter Acked-by: Kristian Høgsberg --- tools/firewire/nosy-dump.h | 292 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 292 insertions(+) create mode 100644 tools/firewire/nosy-dump.h (limited to 'tools/firewire/nosy-dump.h') diff --git a/tools/firewire/nosy-dump.h b/tools/firewire/nosy-dump.h new file mode 100644 index 0000000..d8bcb61 --- /dev/null +++ b/tools/firewire/nosy-dump.h @@ -0,0 +1,292 @@ +#ifndef __nosy_dump_h__ +#define __nosy_dump_h__ + +#define array_length(array) (sizeof(array) / sizeof(array[0])) + +#define TCODE_WRITE_QUADLET 0x0 +#define TCODE_WRITE_BLOCK 0x1 +#define TCODE_WRITE_RESPONSE 0x2 +#define TCODE_READ_QUADLET 0x4 +#define TCODE_READ_BLOCK 0x5 +#define TCODE_READ_QUADLET_RESPONSE 0x6 +#define TCODE_READ_BLOCK_RESPONSE 0x7 +#define TCODE_CYCLE_START 0x8 +#define TCODE_LOCK_REQUEST 0x9 +#define TCODE_ISO_DATA 0xa +#define TCODE_LOCK_RESPONSE 0xb +#define TCODE_PHY_PACKET 0x10 + +#define ACK_NO_ACK 0x0 +#define ACK_COMPLETE 0x1 +#define ACK_PENDING 0x2 +#define ACK_BUSY_X 0x4 +#define ACK_BUSY_A 0x5 +#define ACK_BUSY_B 0x6 +#define ACK_DATA_ERROR 0xd +#define ACK_TYPE_ERROR 0xe + +#define ACK_DONE(a) ((a >> 2) == 0) +#define ACK_BUSY(a) ((a >> 2) == 1) +#define ACK_ERROR(a) ((a >> 2) == 3) + +#define SPEED_100 0x0 +#define SPEED_200 0x1 +#define SPEED_400 0x2 + +struct phy_packet { + unsigned long timestamp; + + union { + struct { + unsigned int zero : 24; + unsigned int phy_id : 6; + unsigned int identifier : 2; + } common, link_on; + struct { + unsigned int zero : 16; + unsigned int gap_count : 6; + unsigned int set_gap_count : 1; + unsigned int set_root : 1; + unsigned int root_id : 6; + unsigned int identifier : 2; + } phy_config; + struct { + unsigned int more_packets : 1; + unsigned int initiated_reset : 1; + unsigned int port2 : 2; + unsigned int port1 : 2; + unsigned int port0 : 2; + unsigned int power_class : 3; + unsigned int contender : 1; + unsigned int phy_delay : 2; + unsigned int phy_speed : 2; + unsigned int gap_count : 6; + unsigned int link_active : 1; + unsigned int extended : 1; + unsigned int phy_id : 6; + unsigned int identifier : 2; + } self_id; + + struct { + unsigned int more_packets : 1; + unsigned int reserved1 : 1; + unsigned int porth : 2; + unsigned int portg : 2; + unsigned int portf : 2; + unsigned int porte : 2; + unsigned int portd : 2; + unsigned int portc : 2; + unsigned int portb : 2; + unsigned int porta : 2; + unsigned int reserved0 : 2; + unsigned int sequence : 3; + unsigned int extended : 1; + unsigned int phy_id : 6; + unsigned int identifier : 2; + } ext_self_id; + }; + + unsigned long inverted; + unsigned long ack; +}; + +#define PHY_PACKET_CONFIGURATION 0x00 +#define PHY_PACKET_LINK_ON 0x01 +#define PHY_PACKET_SELF_ID 0x02 + +struct link_packet { + unsigned long timestamp; + + union { + struct { + unsigned int priority : 4; + unsigned int tcode : 4; + unsigned int rt : 2; + unsigned int tlabel : 6; + unsigned int destination : 16; + + unsigned int offset_high : 16; + unsigned int source : 16; + + unsigned long offset_low; + } common; + + struct { + unsigned int priority : 4; + unsigned int tcode : 4; + unsigned int rt : 2; + unsigned int tlabel : 6; + unsigned int destination : 16; + + unsigned int offset_high : 16; + unsigned int source : 16; + + unsigned long offset_low; + + unsigned long crc; + } read_quadlet; + + struct { + unsigned int priority : 4; + unsigned int tcode : 4; + unsigned int rt : 2; + unsigned int tlabel : 6; + unsigned int destination : 16; + + unsigned int reserved0 : 12; + unsigned int rcode : 4; + unsigned int source : 16; + + unsigned long reserved1; + + unsigned long data; + + unsigned long crc; + } read_quadlet_response; + + struct { + unsigned int priority : 4; + unsigned int tcode : 4; + unsigned int rt : 2; + unsigned int tlabel : 6; + unsigned int destination : 16; + + unsigned int offset_high : 16; + unsigned int source : 16; + + unsigned long offset_low; + + unsigned int extended_tcode : 16; + unsigned int data_length : 16; + + unsigned long crc; + } read_block; + + struct { + unsigned int priority : 4; + unsigned int tcode : 4; + unsigned int rt : 2; + unsigned int tlabel : 6; + unsigned int destination : 16; + + unsigned int reserved0 : 12; + unsigned int rcode : 4; + unsigned int source : 16; + + unsigned long reserved1; + + unsigned int extended_tcode : 16; + unsigned int data_length : 16; + + unsigned long crc; + + unsigned long data[0]; + + /* crc and ack follows. */ + + } read_block_response; + + struct { + unsigned int priority : 4; + unsigned int tcode : 4; + unsigned int rt : 2; + unsigned int tlabel : 6; + unsigned int destination : 16; + + unsigned int offset_high : 16; + unsigned int source : 16; + + unsigned long offset_low; + + unsigned long data; + + unsigned long crc; + + } write_quadlet; + + struct { + unsigned int priority : 4; + unsigned int tcode : 4; + unsigned int rt : 2; + unsigned int tlabel : 6; + unsigned int destination : 16; + + unsigned int offset_high : 16; + unsigned int source : 16; + + unsigned int offset_low : 32; + + unsigned int extended_tcode : 16; + unsigned int data_length : 16; + + unsigned long crc; + unsigned long data[0]; + + /* crc and ack follows. */ + + } write_block; + + struct { + unsigned int priority : 4; + unsigned int tcode : 4; + unsigned int rt : 2; + unsigned int tlabel : 6; + unsigned int destination : 16; + + unsigned int reserved0 : 12; + unsigned int rcode : 4; + unsigned int source : 16; + + unsigned long reserved1; + + unsigned long crc; + } write_response; + + struct { + unsigned int priority : 4; + unsigned int tcode : 4; + unsigned int rt : 2; + unsigned int tlabel : 6; + unsigned int destination : 16; + + unsigned int offset_high : 16; + unsigned int source : 16; + + unsigned long offset_low; + + unsigned long data; + + unsigned long crc; + } cycle_start; + + struct { + unsigned int sy : 4; + unsigned int tcode : 4; + unsigned int channel : 6; + unsigned int tag : 2; + unsigned int data_length : 16; + + unsigned long crc; + } iso_data; + + }; + +}; + +struct subaction { + unsigned long ack; + size_t length; + struct list link; + struct link_packet packet; +}; + +struct link_transaction { + int request_node, response_node, tlabel; + struct subaction *request, *response; + struct list request_list, response_list; + struct list link; +}; + +int decode_fcp(struct link_transaction *t); + +#endif /* __nosy_dump_h__ */ -- cgit v1.1 From 1bcc69fb6a48edb3ddf2e8c42f1d1c242196bf74 Mon Sep 17 00:00:00 2001 From: Stefan Richter Date: Thu, 22 Jul 2010 11:58:05 +0200 Subject: tools/firewire: nosy-dump: fix it on x86-64 Replace 'unsigned long' and the (unaffected) 'unsigned int' by uint32_t if they represent quadlets. Signed-off-by: Stefan Richter --- tools/firewire/nosy-dump.h | 272 +++++++++++++++------------------------------ 1 file changed, 88 insertions(+), 184 deletions(-) (limited to 'tools/firewire/nosy-dump.h') diff --git a/tools/firewire/nosy-dump.h b/tools/firewire/nosy-dump.h index d8bcb61..60cf556 100644 --- a/tools/firewire/nosy-dump.h +++ b/tools/firewire/nosy-dump.h @@ -33,61 +33,63 @@ #define SPEED_200 0x1 #define SPEED_400 0x2 -struct phy_packet { - unsigned long timestamp; +#include +struct phy_packet { + uint32_t timestamp; union { struct { - unsigned int zero : 24; - unsigned int phy_id : 6; - unsigned int identifier : 2; + uint32_t zero:24; + uint32_t phy_id:6; + uint32_t identifier:2; } common, link_on; + struct { - unsigned int zero : 16; - unsigned int gap_count : 6; - unsigned int set_gap_count : 1; - unsigned int set_root : 1; - unsigned int root_id : 6; - unsigned int identifier : 2; + uint32_t zero:16; + uint32_t gap_count:6; + uint32_t set_gap_count:1; + uint32_t set_root:1; + uint32_t root_id:6; + uint32_t identifier:2; } phy_config; + struct { - unsigned int more_packets : 1; - unsigned int initiated_reset : 1; - unsigned int port2 : 2; - unsigned int port1 : 2; - unsigned int port0 : 2; - unsigned int power_class : 3; - unsigned int contender : 1; - unsigned int phy_delay : 2; - unsigned int phy_speed : 2; - unsigned int gap_count : 6; - unsigned int link_active : 1; - unsigned int extended : 1; - unsigned int phy_id : 6; - unsigned int identifier : 2; + uint32_t more_packets:1; + uint32_t initiated_reset:1; + uint32_t port2:2; + uint32_t port1:2; + uint32_t port0:2; + uint32_t power_class:3; + uint32_t contender:1; + uint32_t phy_delay:2; + uint32_t phy_speed:2; + uint32_t gap_count:6; + uint32_t link_active:1; + uint32_t extended:1; + uint32_t phy_id:6; + uint32_t identifier:2; } self_id; struct { - unsigned int more_packets : 1; - unsigned int reserved1 : 1; - unsigned int porth : 2; - unsigned int portg : 2; - unsigned int portf : 2; - unsigned int porte : 2; - unsigned int portd : 2; - unsigned int portc : 2; - unsigned int portb : 2; - unsigned int porta : 2; - unsigned int reserved0 : 2; - unsigned int sequence : 3; - unsigned int extended : 1; - unsigned int phy_id : 6; - unsigned int identifier : 2; + uint32_t more_packets:1; + uint32_t reserved1:1; + uint32_t porth:2; + uint32_t portg:2; + uint32_t portf:2; + uint32_t porte:2; + uint32_t portd:2; + uint32_t portc:2; + uint32_t portb:2; + uint32_t porta:2; + uint32_t reserved0:2; + uint32_t sequence:3; + uint32_t extended:1; + uint32_t phy_id:6; + uint32_t identifier:2; } ext_self_id; }; - - unsigned long inverted; - unsigned long ack; + uint32_t inverted; + uint32_t ack; }; #define PHY_PACKET_CONFIGURATION 0x00 @@ -95,186 +97,88 @@ struct phy_packet { #define PHY_PACKET_SELF_ID 0x02 struct link_packet { - unsigned long timestamp; - + uint32_t timestamp; union { struct { - unsigned int priority : 4; - unsigned int tcode : 4; - unsigned int rt : 2; - unsigned int tlabel : 6; - unsigned int destination : 16; + uint32_t priority:4; + uint32_t tcode:4; + uint32_t rt:2; + uint32_t tlabel:6; + uint32_t destination:16; - unsigned int offset_high : 16; - unsigned int source : 16; + uint32_t offset_high:16; + uint32_t source:16; - unsigned long offset_low; + uint32_t offset_low; } common; struct { - unsigned int priority : 4; - unsigned int tcode : 4; - unsigned int rt : 2; - unsigned int tlabel : 6; - unsigned int destination : 16; - - unsigned int offset_high : 16; - unsigned int source : 16; - - unsigned long offset_low; - - unsigned long crc; + uint32_t common[3]; + uint32_t crc; } read_quadlet; struct { - unsigned int priority : 4; - unsigned int tcode : 4; - unsigned int rt : 2; - unsigned int tlabel : 6; - unsigned int destination : 16; - - unsigned int reserved0 : 12; - unsigned int rcode : 4; - unsigned int source : 16; - - unsigned long reserved1; - - unsigned long data; - - unsigned long crc; + uint32_t common[3]; + uint32_t data; + uint32_t crc; } read_quadlet_response; struct { - unsigned int priority : 4; - unsigned int tcode : 4; - unsigned int rt : 2; - unsigned int tlabel : 6; - unsigned int destination : 16; - - unsigned int offset_high : 16; - unsigned int source : 16; - - unsigned long offset_low; - - unsigned int extended_tcode : 16; - unsigned int data_length : 16; - - unsigned long crc; + uint32_t common[3]; + uint32_t extended_tcode:16; + uint32_t data_length:16; + uint32_t crc; } read_block; struct { - unsigned int priority : 4; - unsigned int tcode : 4; - unsigned int rt : 2; - unsigned int tlabel : 6; - unsigned int destination : 16; - - unsigned int reserved0 : 12; - unsigned int rcode : 4; - unsigned int source : 16; - - unsigned long reserved1; - - unsigned int extended_tcode : 16; - unsigned int data_length : 16; - - unsigned long crc; - - unsigned long data[0]; - + uint32_t common[3]; + uint32_t extended_tcode:16; + uint32_t data_length:16; + uint32_t crc; + uint32_t data[0]; /* crc and ack follows. */ - } read_block_response; struct { - unsigned int priority : 4; - unsigned int tcode : 4; - unsigned int rt : 2; - unsigned int tlabel : 6; - unsigned int destination : 16; - - unsigned int offset_high : 16; - unsigned int source : 16; - - unsigned long offset_low; - - unsigned long data; - - unsigned long crc; - + uint32_t common[3]; + uint32_t data; + uint32_t crc; } write_quadlet; struct { - unsigned int priority : 4; - unsigned int tcode : 4; - unsigned int rt : 2; - unsigned int tlabel : 6; - unsigned int destination : 16; - - unsigned int offset_high : 16; - unsigned int source : 16; - - unsigned int offset_low : 32; - - unsigned int extended_tcode : 16; - unsigned int data_length : 16; - - unsigned long crc; - unsigned long data[0]; - + uint32_t common[3]; + uint32_t extended_tcode:16; + uint32_t data_length:16; + uint32_t crc; + uint32_t data[0]; /* crc and ack follows. */ - } write_block; struct { - unsigned int priority : 4; - unsigned int tcode : 4; - unsigned int rt : 2; - unsigned int tlabel : 6; - unsigned int destination : 16; - - unsigned int reserved0 : 12; - unsigned int rcode : 4; - unsigned int source : 16; - - unsigned long reserved1; - - unsigned long crc; + uint32_t common[3]; + uint32_t crc; } write_response; struct { - unsigned int priority : 4; - unsigned int tcode : 4; - unsigned int rt : 2; - unsigned int tlabel : 6; - unsigned int destination : 16; - - unsigned int offset_high : 16; - unsigned int source : 16; - - unsigned long offset_low; - - unsigned long data; - - unsigned long crc; + uint32_t common[3]; + uint32_t data; + uint32_t crc; } cycle_start; struct { - unsigned int sy : 4; - unsigned int tcode : 4; - unsigned int channel : 6; - unsigned int tag : 2; - unsigned int data_length : 16; + uint32_t sy:4; + uint32_t tcode:4; + uint32_t channel:6; + uint32_t tag:2; + uint32_t data_length:16; - unsigned long crc; + uint32_t crc; } iso_data; - }; - }; struct subaction { - unsigned long ack; + uint32_t ack; size_t length; struct list link; struct link_packet packet; -- cgit v1.1 From 92c16f7e9c65f9a271c6bd5020279b3e37989672 Mon Sep 17 00:00:00 2001 From: Stefan Richter Date: Thu, 22 Jul 2010 11:58:05 +0200 Subject: tools/firewire: nosy-dump: change to kernel coding style This changes only - whitespace - C99 initializers - comment style - order of #includes - if { } else { } bracing Signed-off-by: Stefan Richter --- tools/firewire/nosy-dump.h | 280 ++++++++++++++++++++++----------------------- 1 file changed, 140 insertions(+), 140 deletions(-) (limited to 'tools/firewire/nosy-dump.h') diff --git a/tools/firewire/nosy-dump.h b/tools/firewire/nosy-dump.h index 60cf556..fe8be63 100644 --- a/tools/firewire/nosy-dump.h +++ b/tools/firewire/nosy-dump.h @@ -36,60 +36,60 @@ #include struct phy_packet { - uint32_t timestamp; - union { - struct { - uint32_t zero:24; - uint32_t phy_id:6; - uint32_t identifier:2; - } common, link_on; - - struct { - uint32_t zero:16; - uint32_t gap_count:6; - uint32_t set_gap_count:1; - uint32_t set_root:1; - uint32_t root_id:6; - uint32_t identifier:2; - } phy_config; - - struct { - uint32_t more_packets:1; - uint32_t initiated_reset:1; - uint32_t port2:2; - uint32_t port1:2; - uint32_t port0:2; - uint32_t power_class:3; - uint32_t contender:1; - uint32_t phy_delay:2; - uint32_t phy_speed:2; - uint32_t gap_count:6; - uint32_t link_active:1; - uint32_t extended:1; - uint32_t phy_id:6; - uint32_t identifier:2; - } self_id; - - struct { - uint32_t more_packets:1; - uint32_t reserved1:1; - uint32_t porth:2; - uint32_t portg:2; - uint32_t portf:2; - uint32_t porte:2; - uint32_t portd:2; - uint32_t portc:2; - uint32_t portb:2; - uint32_t porta:2; - uint32_t reserved0:2; - uint32_t sequence:3; - uint32_t extended:1; - uint32_t phy_id:6; - uint32_t identifier:2; - } ext_self_id; - }; - uint32_t inverted; - uint32_t ack; + uint32_t timestamp; + union { + struct { + uint32_t zero:24; + uint32_t phy_id:6; + uint32_t identifier:2; + } common, link_on; + + struct { + uint32_t zero:16; + uint32_t gap_count:6; + uint32_t set_gap_count:1; + uint32_t set_root:1; + uint32_t root_id:6; + uint32_t identifier:2; + } phy_config; + + struct { + uint32_t more_packets:1; + uint32_t initiated_reset:1; + uint32_t port2:2; + uint32_t port1:2; + uint32_t port0:2; + uint32_t power_class:3; + uint32_t contender:1; + uint32_t phy_delay:2; + uint32_t phy_speed:2; + uint32_t gap_count:6; + uint32_t link_active:1; + uint32_t extended:1; + uint32_t phy_id:6; + uint32_t identifier:2; + } self_id; + + struct { + uint32_t more_packets:1; + uint32_t reserved1:1; + uint32_t porth:2; + uint32_t portg:2; + uint32_t portf:2; + uint32_t porte:2; + uint32_t portd:2; + uint32_t portc:2; + uint32_t portb:2; + uint32_t porta:2; + uint32_t reserved0:2; + uint32_t sequence:3; + uint32_t extended:1; + uint32_t phy_id:6; + uint32_t identifier:2; + } ext_self_id; + }; + uint32_t inverted; + uint32_t ack; }; #define PHY_PACKET_CONFIGURATION 0x00 @@ -97,98 +97,98 @@ struct phy_packet { #define PHY_PACKET_SELF_ID 0x02 struct link_packet { - uint32_t timestamp; - union { - struct { - uint32_t priority:4; - uint32_t tcode:4; - uint32_t rt:2; - uint32_t tlabel:6; - uint32_t destination:16; - - uint32_t offset_high:16; - uint32_t source:16; - - uint32_t offset_low; - } common; - - struct { - uint32_t common[3]; - uint32_t crc; - } read_quadlet; - - struct { - uint32_t common[3]; - uint32_t data; - uint32_t crc; - } read_quadlet_response; - - struct { - uint32_t common[3]; - uint32_t extended_tcode:16; - uint32_t data_length:16; - uint32_t crc; - } read_block; - - struct { - uint32_t common[3]; - uint32_t extended_tcode:16; - uint32_t data_length:16; - uint32_t crc; - uint32_t data[0]; - /* crc and ack follows. */ - } read_block_response; - - struct { - uint32_t common[3]; - uint32_t data; - uint32_t crc; - } write_quadlet; - - struct { - uint32_t common[3]; - uint32_t extended_tcode:16; - uint32_t data_length:16; - uint32_t crc; - uint32_t data[0]; - /* crc and ack follows. */ - } write_block; - - struct { - uint32_t common[3]; - uint32_t crc; - } write_response; - - struct { - uint32_t common[3]; - uint32_t data; - uint32_t crc; - } cycle_start; - - struct { - uint32_t sy:4; - uint32_t tcode:4; - uint32_t channel:6; - uint32_t tag:2; - uint32_t data_length:16; - - uint32_t crc; - } iso_data; - }; + uint32_t timestamp; + union { + struct { + uint32_t priority:4; + uint32_t tcode:4; + uint32_t rt:2; + uint32_t tlabel:6; + uint32_t destination:16; + + uint32_t offset_high:16; + uint32_t source:16; + + uint32_t offset_low; + } common; + + struct { + uint32_t common[3]; + uint32_t crc; + } read_quadlet; + + struct { + uint32_t common[3]; + uint32_t data; + uint32_t crc; + } read_quadlet_response; + + struct { + uint32_t common[3]; + uint32_t extended_tcode:16; + uint32_t data_length:16; + uint32_t crc; + } read_block; + + struct { + uint32_t common[3]; + uint32_t extended_tcode:16; + uint32_t data_length:16; + uint32_t crc; + uint32_t data[0]; + /* crc and ack follows. */ + } read_block_response; + + struct { + uint32_t common[3]; + uint32_t data; + uint32_t crc; + } write_quadlet; + + struct { + uint32_t common[3]; + uint32_t extended_tcode:16; + uint32_t data_length:16; + uint32_t crc; + uint32_t data[0]; + /* crc and ack follows. */ + } write_block; + + struct { + uint32_t common[3]; + uint32_t crc; + } write_response; + + struct { + uint32_t common[3]; + uint32_t data; + uint32_t crc; + } cycle_start; + + struct { + uint32_t sy:4; + uint32_t tcode:4; + uint32_t channel:6; + uint32_t tag:2; + uint32_t data_length:16; + + uint32_t crc; + } iso_data; + }; }; struct subaction { - uint32_t ack; - size_t length; - struct list link; - struct link_packet packet; + uint32_t ack; + size_t length; + struct list link; + struct link_packet packet; }; struct link_transaction { - int request_node, response_node, tlabel; - struct subaction *request, *response; - struct list request_list, response_list; - struct list link; + int request_node, response_node, tlabel; + struct subaction *request, *response; + struct list request_list, response_list; + struct list link; }; int decode_fcp(struct link_transaction *t); -- cgit v1.1 From 83ef7c75939f45f8da46976cdca4db0727276a2d Mon Sep 17 00:00:00 2001 From: Stefan Richter Date: Thu, 22 Jul 2010 11:58:05 +0200 Subject: tools/firewire: nosy-dump: use linux/firewire-constants.h Signed-off-by: Stefan Richter --- tools/firewire/nosy-dump.h | 29 +++-------------------------- 1 file changed, 3 insertions(+), 26 deletions(-) (limited to 'tools/firewire/nosy-dump.h') diff --git a/tools/firewire/nosy-dump.h b/tools/firewire/nosy-dump.h index fe8be63..3a4b5b33 100644 --- a/tools/firewire/nosy-dump.h +++ b/tools/firewire/nosy-dump.h @@ -3,36 +3,11 @@ #define array_length(array) (sizeof(array) / sizeof(array[0])) -#define TCODE_WRITE_QUADLET 0x0 -#define TCODE_WRITE_BLOCK 0x1 -#define TCODE_WRITE_RESPONSE 0x2 -#define TCODE_READ_QUADLET 0x4 -#define TCODE_READ_BLOCK 0x5 -#define TCODE_READ_QUADLET_RESPONSE 0x6 -#define TCODE_READ_BLOCK_RESPONSE 0x7 -#define TCODE_CYCLE_START 0x8 -#define TCODE_LOCK_REQUEST 0x9 -#define TCODE_ISO_DATA 0xa -#define TCODE_LOCK_RESPONSE 0xb -#define TCODE_PHY_PACKET 0x10 - -#define ACK_NO_ACK 0x0 -#define ACK_COMPLETE 0x1 -#define ACK_PENDING 0x2 -#define ACK_BUSY_X 0x4 -#define ACK_BUSY_A 0x5 -#define ACK_BUSY_B 0x6 -#define ACK_DATA_ERROR 0xd -#define ACK_TYPE_ERROR 0xe - +#define ACK_NO_ACK 0x0 #define ACK_DONE(a) ((a >> 2) == 0) #define ACK_BUSY(a) ((a >> 2) == 1) #define ACK_ERROR(a) ((a >> 2) == 3) -#define SPEED_100 0x0 -#define SPEED_200 0x1 -#define SPEED_400 0x2 - #include struct phy_packet { @@ -92,6 +67,8 @@ struct phy_packet { uint32_t ack; }; +#define TCODE_PHY_PACKET 0x10 + #define PHY_PACKET_CONFIGURATION 0x00 #define PHY_PACKET_LINK_ON 0x01 #define PHY_PACKET_SELF_ID 0x02 -- cgit v1.1