Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
nosy-dump.h
Go to the documentation of this file.
1 #ifndef __nosy_dump_h__
2 #define __nosy_dump_h__
3 
4 #define array_length(array) (sizeof(array) / sizeof(array[0]))
5 
6 #define ACK_NO_ACK 0x0
7 #define ACK_DONE(a) ((a >> 2) == 0)
8 #define ACK_BUSY(a) ((a >> 2) == 1)
9 #define ACK_ERROR(a) ((a >> 2) == 3)
10 
11 #include <stdint.h>
12 
13 struct phy_packet {
15  union {
16  struct {
20  } common, link_on;
21 
22  struct {
23  uint32_t zero:16;
29  } phy_config;
30 
31  struct {
44  uint32_t phy_id:6;
46  } self_id;
47 
48  struct {
62  uint32_t phy_id:6;
64  } ext_self_id;
65  };
68 };
69 
70 #define TCODE_PHY_PACKET 0x10
71 
72 #define PHY_PACKET_CONFIGURATION 0x00
73 #define PHY_PACKET_LINK_ON 0x01
74 #define PHY_PACKET_SELF_ID 0x02
75 
76 struct link_packet {
78  union {
79  struct {
85 
88 
90  } common;
91 
92  struct {
95  } read_quadlet;
96 
97  struct {
98  uint32_t common[3];
100  uint32_t crc;
102 
103  struct {
104  uint32_t common[3];
107  uint32_t crc;
108  } read_block;
109 
110  struct {
111  uint32_t common[3];
114  uint32_t crc;
115  uint32_t data[0];
116  /* crc and ack follows. */
118 
119  struct {
120  uint32_t common[3];
121  uint32_t data;
122  uint32_t crc;
123  } write_quadlet;
124 
125  struct {
126  uint32_t common[3];
129  uint32_t crc;
130  uint32_t data[0];
131  /* crc and ack follows. */
132  } write_block;
133 
134  struct {
135  uint32_t common[3];
136  uint32_t crc;
137  } write_response;
138 
139  struct {
140  uint32_t common[3];
141  uint32_t data;
142  uint32_t crc;
143  } cycle_start;
144 
145  struct {
147  uint32_t tcode:4;
151 
152  uint32_t crc;
153  } iso_data;
154  };
155 };
156 
157 struct subaction {
159  size_t length;
160  struct list link;
162 };
163 
167  struct list request_list, response_list;
168  struct list link;
169 };
170 
171 int decode_fcp(struct link_transaction *t);
172 
173 #endif /* __nosy_dump_h__ */