1 #ifndef _HAVE_PROTOCOL_H
2 #define _HAVE_PROTOCOL_H
6 #define P54U_NR_CHANNELS 14
7 #define P54U_CHANNEL_DEFS 8
8 /* this seems to be present
10 received on data and mgmt pipes */
16 /* this can be p54u_mgmt_tx2 */
17 } __attribute__((packed
));
22 /* until i sort out what this means... */
23 #define P54U_TX_MAGIC1_CHANNEL 0x00020200
24 #define P54U_TX_MAGIC1_FILTER 0x00020200
25 #define P54U_TX_MAGIC1_80211 0x0002076c
29 /* this can be p54u_mgmt_tx */
30 } __attribute__((packed
));
33 /* outgoing mgmt readback frames */
35 /* len is the length of the _next_ (tx2) data sent */
36 struct p54u_mgmt_tx1
{
38 #define P54U_TX1_MAGIC_1 0x02066c
41 #define P54U_TX1_MAGIC_2 0x2
44 } __attribute__ ((packed
));
46 /* len is the length of the frame, including the
47 sub_pos and sub_len fields below, which i believe
48 are part of the lower-level frame */
49 /* this comes as payload of p54u_tx or p54u_rx */
50 struct p54u_mgmt_tx2
{
52 #define P54U_TX2_MAGIC_1 0x8000
55 //#define P54U_TX2_MAGIC_2_EVEN 0x81306510
56 //#define P54U_TX2_MAGIC_2_ODD 0x812f1130
57 #define P54U_TX2_MAGIC_2_EVEN 0x81288290
58 #define P54U_TX2_MAGIC_2_ODD 0x81328030
61 #define P54U_TX2_MAGIC_3 0xc
65 } __attribute__ ((packed
));
68 /* incoming mgmt readback frame */
69 struct p54u_freq_struct1
71 u16 freq
; /* in MHz */
73 } __attribute__ ((packed
));
75 struct p54u_freq_substruct1
79 } __attribute__ ((packed
));
81 struct p54u_freq_struct2
84 struct p54u_freq_substruct1 data
[P54U_CHANNEL_DEFS
];
85 } __attribute__ ((packed
));
87 struct p54u_freq_struct3
91 } __attribute__ ((packed
));
93 /* this is payload for p54u_mgmt_tx2 */
94 struct p54u_mgmt_rx_header
98 u16 preamble_length
; /* this is null for linksys devices, but is not null for SMC dongles, for instance */
100 } __attribute__ ((packed
));
102 struct p54u_mgmt_rx_frame
107 struct p54u_freq_struct1 l1
[P54U_NR_CHANNELS
];
109 struct p54u_freq_struct2 l2
[P54U_NR_CHANNELS
];
111 struct p54u_freq_struct3 l3
[P54U_NR_CHANNELS
];
114 } __attribute__ ((packed
));
118 * protocol definitions, data frames
121 /* this is payload of p54u_tx */
122 struct p54u_tx_control
125 /* response triggers a response on the management pipe */
126 #define P54U_TX_CONTROL_NORESPONSE 0x8001
127 #define P54U_TX_CONTROL_RESPONSE 0x8010
132 } __attribute__ ((packed
));
135 struct p54u_freq_substruct2
140 u8 padding
; /* zero */
141 } __attribute__ ((packed
));
143 /* this comes as the payload of p54u_tx_control */
144 struct p54u_tx_control_channel
147 #define P54U_TX_CONTROL_CHANNEL_MAGIC1_SCAN 0x00780002
148 #define P54U_TX_CONTROL_CHANNEL_MAGIC1_DEFAULT 0x00280006
150 struct p54u_freq_struct3 freq
; /* directly from l3 */
151 u16 unknown1
; /* field unknown, the only one !*/
152 u8 l1data
[4]; /* filled with values from l1 */
153 struct p54u_freq_substruct2 str
[P54U_CHANNEL_DEFS
]; /* filled with values from p54u_freq_struct1 from l2 */
154 u32 padding
; /* filled with 0 in old firmware, nothing in new */
155 } __attribute__ ((packed
));
157 #define FULL_TX_CONTROL_CHANNEL sizeof(struct p54u_tx) - sizeof(void*) + sizeof(struct p54u_tx_control) - sizeof(void*) + sizeof(struct p54u_tx_control_channel)
159 #define FULL_TX_CONTROL_FILTER 0x44
160 /* this also comes as the payload of p54u_tx_control */
161 struct p54u_tx_control_filter
164 u8 destination
[ETH_ALEN
];
166 /* I can see the breakup but can't tell what it means */
168 } __attribute__ ((packed
));
171 #endif /* _HAVE_PROTOCOL_H */