Root/drivers/staging/csr/csr_wifi_router_prim.h

1/*****************************************************************************
2
3            (c) Cambridge Silicon Radio Limited 2011
4            All rights reserved and confidential information of CSR
5
6            Refer to LICENSE.txt included with this source for details
7            on the license terms.
8
9*****************************************************************************/
10
11/* Note: this is an auto-generated file. */
12
13#ifndef CSR_WIFI_ROUTER_PRIM_H__
14#define CSR_WIFI_ROUTER_PRIM_H__
15
16#include <linux/types.h>
17#include "csr_prim_defs.h"
18#include "csr_sched.h"
19#include "csr_wifi_common.h"
20#include "csr_result.h"
21#include "csr_wifi_fsm_event.h"
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
27#define CSR_WIFI_ROUTER_PRIM (0x0400)
28
29typedef CsrPrim CsrWifiRouterPrim;
30
31typedef void (*CsrWifiRouterFrameFreeFunction)(void *frame);
32
33/*******************************************************************************
34
35  NAME
36    CsrWifiRouterAppType
37
38  DESCRIPTION
39
40 VALUES
41    CSR_WIFI_ROUTER_APP_TYPE_SME -
42    CSR_WIFI_ROUTER_APP_TYPE_PAL -
43    CSR_WIFI_ROUTER_APP_TYPE_NME -
44    CSR_WIFI_ROUTER_APP_TYPE_OTHER -
45
46*******************************************************************************/
47typedef u8 CsrWifiRouterAppType;
48#define CSR_WIFI_ROUTER_APP_TYPE_SME ((CsrWifiRouterAppType) 0x0)
49#define CSR_WIFI_ROUTER_APP_TYPE_PAL ((CsrWifiRouterAppType) 0x1)
50#define CSR_WIFI_ROUTER_APP_TYPE_NME ((CsrWifiRouterAppType) 0x2)
51#define CSR_WIFI_ROUTER_APP_TYPE_OTHER ((CsrWifiRouterAppType) 0x3)
52
53/*******************************************************************************
54
55  NAME
56    CsrWifiRouterEncapsulation
57
58  DESCRIPTION
59    Indicates the type of encapsulation used for the subscription
60
61 VALUES
62    CSR_WIFI_ROUTER_ENCAPSULATION_ETHERNET
63                   - Ethernet encapsulation
64    CSR_WIFI_ROUTER_ENCAPSULATION_LLC_SNAP
65                   - LLC/SNAP encapsulation
66
67*******************************************************************************/
68typedef u8 CsrWifiRouterEncapsulation;
69#define CSR_WIFI_ROUTER_ENCAPSULATION_ETHERNET ((CsrWifiRouterEncapsulation) 0x00)
70#define CSR_WIFI_ROUTER_ENCAPSULATION_LLC_SNAP ((CsrWifiRouterEncapsulation) 0x01)
71
72/*******************************************************************************
73
74  NAME
75    CsrWifiRouterOui
76
77  DESCRIPTION
78
79 VALUES
80    CSR_WIFI_ROUTER_OUI_RFC_1042 -
81    CSR_WIFI_ROUTER_OUI_BT -
82
83*******************************************************************************/
84typedef u32 CsrWifiRouterOui;
85#define CSR_WIFI_ROUTER_OUI_RFC_1042 ((CsrWifiRouterOui) 0x000000)
86#define CSR_WIFI_ROUTER_OUI_BT ((CsrWifiRouterOui) 0x001958)
87
88/*******************************************************************************
89
90  NAME
91    CsrWifiRouterPriority
92
93  DESCRIPTION
94    As defined in the IEEE 802.11 standards
95
96 VALUES
97    CSR_WIFI_ROUTER_PRIORITY_QOS_UP0
98                   - See IEEE 802.11 Standard
99    CSR_WIFI_ROUTER_PRIORITY_QOS_UP1
100                   - See IEEE 802.11 Standard
101    CSR_WIFI_ROUTER_PRIORITY_QOS_UP2
102                   - See IEEE 802.11 Standard
103    CSR_WIFI_ROUTER_PRIORITY_QOS_UP3
104                   - See IEEE 802.11 Standard
105    CSR_WIFI_ROUTER_PRIORITY_QOS_UP4
106                   - See IEEE 802.11 Standard
107    CSR_WIFI_ROUTER_PRIORITY_QOS_UP5
108                   - See IEEE 802.11 Standard
109    CSR_WIFI_ROUTER_PRIORITY_QOS_UP6
110                   - See IEEE 802.11 Standard
111    CSR_WIFI_ROUTER_PRIORITY_QOS_UP7
112                   - See IEEE 802.11 Standard
113    CSR_WIFI_ROUTER_PRIORITY_CONTENTION
114                   - See IEEE 802.11 Standard
115    CSR_WIFI_ROUTER_PRIORITY_MANAGEMENT
116                   - See IEEE 802.11 Standard
117
118*******************************************************************************/
119typedef u16 CsrWifiRouterPriority;
120#define CSR_WIFI_ROUTER_PRIORITY_QOS_UP0 ((CsrWifiRouterPriority) 0x0000)
121#define CSR_WIFI_ROUTER_PRIORITY_QOS_UP1 ((CsrWifiRouterPriority) 0x0001)
122#define CSR_WIFI_ROUTER_PRIORITY_QOS_UP2 ((CsrWifiRouterPriority) 0x0002)
123#define CSR_WIFI_ROUTER_PRIORITY_QOS_UP3 ((CsrWifiRouterPriority) 0x0003)
124#define CSR_WIFI_ROUTER_PRIORITY_QOS_UP4 ((CsrWifiRouterPriority) 0x0004)
125#define CSR_WIFI_ROUTER_PRIORITY_QOS_UP5 ((CsrWifiRouterPriority) 0x0005)
126#define CSR_WIFI_ROUTER_PRIORITY_QOS_UP6 ((CsrWifiRouterPriority) 0x0006)
127#define CSR_WIFI_ROUTER_PRIORITY_QOS_UP7 ((CsrWifiRouterPriority) 0x0007)
128#define CSR_WIFI_ROUTER_PRIORITY_CONTENTION ((CsrWifiRouterPriority) 0x8000)
129#define CSR_WIFI_ROUTER_PRIORITY_MANAGEMENT ((CsrWifiRouterPriority) 0x8010)
130
131
132/* Downstream */
133#define CSR_WIFI_ROUTER_PRIM_DOWNSTREAM_LOWEST (0x0000)
134
135#define CSR_WIFI_ROUTER_MA_PACKET_SUBSCRIBE_REQ ((CsrWifiRouterPrim) (0x0000 + CSR_WIFI_ROUTER_PRIM_DOWNSTREAM_LOWEST))
136#define CSR_WIFI_ROUTER_MA_PACKET_UNSUBSCRIBE_REQ ((CsrWifiRouterPrim) (0x0001 + CSR_WIFI_ROUTER_PRIM_DOWNSTREAM_LOWEST))
137#define CSR_WIFI_ROUTER_MA_PACKET_REQ ((CsrWifiRouterPrim) (0x0002 + CSR_WIFI_ROUTER_PRIM_DOWNSTREAM_LOWEST))
138#define CSR_WIFI_ROUTER_MA_PACKET_RES ((CsrWifiRouterPrim) (0x0003 + CSR_WIFI_ROUTER_PRIM_DOWNSTREAM_LOWEST))
139#define CSR_WIFI_ROUTER_MA_PACKET_CANCEL_REQ ((CsrWifiRouterPrim) (0x0004 + CSR_WIFI_ROUTER_PRIM_DOWNSTREAM_LOWEST))
140
141
142#define CSR_WIFI_ROUTER_PRIM_DOWNSTREAM_HIGHEST (0x0004 + CSR_WIFI_ROUTER_PRIM_DOWNSTREAM_LOWEST)
143
144/* Upstream */
145#define CSR_WIFI_ROUTER_PRIM_UPSTREAM_LOWEST (0x0000 + CSR_PRIM_UPSTREAM)
146
147#define CSR_WIFI_ROUTER_MA_PACKET_SUBSCRIBE_CFM ((CsrWifiRouterPrim)(0x0000 + CSR_WIFI_ROUTER_PRIM_UPSTREAM_LOWEST))
148#define CSR_WIFI_ROUTER_MA_PACKET_UNSUBSCRIBE_CFM ((CsrWifiRouterPrim)(0x0001 + CSR_WIFI_ROUTER_PRIM_UPSTREAM_LOWEST))
149#define CSR_WIFI_ROUTER_MA_PACKET_CFM ((CsrWifiRouterPrim)(0x0002 + CSR_WIFI_ROUTER_PRIM_UPSTREAM_LOWEST))
150#define CSR_WIFI_ROUTER_MA_PACKET_IND ((CsrWifiRouterPrim)(0x0003 + CSR_WIFI_ROUTER_PRIM_UPSTREAM_LOWEST))
151
152#define CSR_WIFI_ROUTER_PRIM_UPSTREAM_HIGHEST (0x0003 + CSR_WIFI_ROUTER_PRIM_UPSTREAM_LOWEST)
153
154#define CSR_WIFI_ROUTER_PRIM_DOWNSTREAM_COUNT (CSR_WIFI_ROUTER_PRIM_DOWNSTREAM_HIGHEST + 1 - CSR_WIFI_ROUTER_PRIM_DOWNSTREAM_LOWEST)
155#define CSR_WIFI_ROUTER_PRIM_UPSTREAM_COUNT (CSR_WIFI_ROUTER_PRIM_UPSTREAM_HIGHEST + 1 - CSR_WIFI_ROUTER_PRIM_UPSTREAM_LOWEST)
156
157/*******************************************************************************
158
159  NAME
160    CsrWifiRouterMaPacketSubscribeReq
161
162  DESCRIPTION
163    A task can use this primitive to subscribe for a particular OUI/protocol
164    and transmit and receive frames matching the subscription.
165    NOTE: Multiple subscriptions for a given protocol and OUI will result in
166    the first subscription receiving the data and not the subsequent
167    subscriptions.
168
169  MEMBERS
170    common - Common header for use with the CsrWifiFsm Module
171    interfaceTag - Interface Identifier; unique identifier of an interface
172    encapsulation - Specifies the encapsulation type, which will be used for the
173                    subscription
174    protocol - Together with the OUI, specifies the protocol, which a task
175                    wants to subscribe to
176    oui - Specifies the OUI for the protocol, which a task wants to
177                    subscribe to
178
179*******************************************************************************/
180typedef struct
181{
182    CsrWifiFsmEvent common;
183    u16 interfaceTag;
184    CsrWifiRouterEncapsulation encapsulation;
185    u16 protocol;
186    u32 oui;
187} CsrWifiRouterMaPacketSubscribeReq;
188
189/*******************************************************************************
190
191  NAME
192    CsrWifiRouterMaPacketUnsubscribeReq
193
194  DESCRIPTION
195    A task sends this primitive to unsubscribe a subscription
196
197  MEMBERS
198    common - Common header for use with the CsrWifiFsm Module
199    interfaceTag - Interface Identifier; unique identifier of an interface
200    subscriptionHandle - The handle of the subscription
201
202*******************************************************************************/
203typedef struct
204{
205    CsrWifiFsmEvent common;
206    u16 interfaceTag;
207    u8 subscriptionHandle;
208} CsrWifiRouterMaPacketUnsubscribeReq;
209
210/*******************************************************************************
211
212  NAME
213    CsrWifiRouterMaPacketReq
214
215  DESCRIPTION
216    A task sends this primitive to transmit a frame.
217
218  MEMBERS
219    common - Common header for use with the CsrWifiFsm Module
220    interfaceTag - Interface Identifier; unique identifier of an interface
221    subscriptionHandle - The handle of the subscription
222    frameLength - Length of the frame to be sent in bytes
223    frame - Pointer to the frame to be sent
224    freeFunction - Pointer to function to be used to free the frame
225    priority - Priority of the frame, which should be sent
226    hostTag - An application shall set the bits b31..b28 using one of
227                         the CSR_WIFI_ROUTER_APP_TYPE_* masks. Bits b0..b27 can
228                         be used by the requestor without any restrictions, but
229                         the hostTag shall be unique so the hostTag for
230                         CSR_WIFI_ROUTER_APP _TYPE_OTHER should be constructured
231                         in the following way [ CSR_WIFI_ROUTER_APP_TYPE_OTHER
232                         (4 bits) | SubscriptionHandle (8 bits) | Sequence no.
233                         (20 bits) ]. If the hostTag is not unique, the
234                         behaviour of the system is unpredicatable with respect
235                         to data/management frame transfer.
236    cfmRequested - Indicates if the requestor needs a confirm for packet
237                         requests sent under this subscription. If set to TRUE,
238                         the router will send a confirm, else it will not send
239                         any confirm
240
241*******************************************************************************/
242typedef struct
243{
244    CsrWifiFsmEvent common;
245    u16 interfaceTag;
246    u8 subscriptionHandle;
247    u16 frameLength;
248    u8 *frame;
249    CsrWifiRouterFrameFreeFunction freeFunction;
250    CsrWifiRouterPriority priority;
251    u32 hostTag;
252    u8 cfmRequested;
253} CsrWifiRouterMaPacketReq;
254
255/*******************************************************************************
256
257  NAME
258    CsrWifiRouterMaPacketRes
259
260  DESCRIPTION
261    A task send this primitive to confirm the reception of the received
262    frame.
263
264  MEMBERS
265    common - Common header for use with the CsrWifiFsm Module
266    interfaceTag - Interface Identifier; unique identifier of an interface
267    subscriptionHandle - The handle of the subscription
268    result - Status of the operation
269
270*******************************************************************************/
271typedef struct
272{
273    CsrWifiFsmEvent common;
274    u16 interfaceTag;
275    u8 subscriptionHandle;
276    CsrResult result;
277} CsrWifiRouterMaPacketRes;
278
279/*******************************************************************************
280
281  NAME
282    CsrWifiRouterMaPacketCancelReq
283
284  DESCRIPTION
285    This primitive is used to request cancellation of a previously send
286    CsrWifiRouterMaPacketReq.
287    The frame may already have been transmitted so there is no guarantees
288    that the CsrWifiRouterMaPacketCancelReq actually cancels the transmission
289    of the frame in question.
290    If the cancellation fails, the Router will send, if required,
291    CsrWifiRouterMaPacketCfm.
292    If the cancellation succeeds, the Router will not send
293    CsrWifiRouterMaPacketCfm.
294
295  MEMBERS
296    common - Common header for use with the CsrWifiFsm Module
297    interfaceTag - Interface Identifier; unique identifier of an interface
298    hostTag - The hostTag for the frame, which should be cancelled.
299    priority - Priority of the frame, which should be cancelled
300    peerMacAddress - Destination MAC address of the frame, which should be
301                     cancelled
302
303*******************************************************************************/
304typedef struct
305{
306    CsrWifiFsmEvent common;
307    u16 interfaceTag;
308    u32 hostTag;
309    CsrWifiRouterPriority priority;
310    CsrWifiMacAddress peerMacAddress;
311} CsrWifiRouterMaPacketCancelReq;
312
313/*******************************************************************************
314
315  NAME
316    CsrWifiRouterMaPacketSubscribeCfm
317
318  DESCRIPTION
319    The router sends this primitive to confirm the result of the
320    subscription.
321
322  MEMBERS
323    common - Common header for use with the CsrWifiFsm Module
324    interfaceTag - Interface Identifier; unique identifier of an interface
325    subscriptionHandle - Handle to the subscription
326                         This handle must be used in all subsequent requests
327    status - Status of the operation
328    allocOffset - Size of the offset for the frames of the subscription
329
330*******************************************************************************/
331typedef struct
332{
333    CsrWifiFsmEvent common;
334    u16 interfaceTag;
335    u8 subscriptionHandle;
336    CsrResult status;
337    u16 allocOffset;
338} CsrWifiRouterMaPacketSubscribeCfm;
339
340/*******************************************************************************
341
342  NAME
343    CsrWifiRouterMaPacketUnsubscribeCfm
344
345  DESCRIPTION
346    The router sends this primitive to confirm the result of the
347    unsubscription.
348
349  MEMBERS
350    common - Common header for use with the CsrWifiFsm Module
351    interfaceTag - Interface Identifier; unique identifier of an interface
352    status - Status of the operation
353
354*******************************************************************************/
355typedef struct
356{
357    CsrWifiFsmEvent common;
358    u16 interfaceTag;
359    CsrResult status;
360} CsrWifiRouterMaPacketUnsubscribeCfm;
361
362/*******************************************************************************
363
364  NAME
365    CsrWifiRouterMaPacketCfm
366
367  DESCRIPTION
368    The router sends the primitive to confirm the result of the transmission
369    of the packet of the corresponding CSR_WIFI_ROUTER MA_PACKET_REQ request.
370
371  MEMBERS
372    common - Common header for use with the CsrWifiFsm Module
373    interfaceTag - Interface Identifier; unique identifier of an interface
374    result - Status of the operation
375    hostTag - The hostTrag will match the hostTag sent in the request.
376    rate - Transmission/Reception rate
377
378*******************************************************************************/
379typedef struct
380{
381    CsrWifiFsmEvent common;
382    u16 interfaceTag;
383    CsrResult result;
384    u32 hostTag;
385    u16 rate;
386} CsrWifiRouterMaPacketCfm;
387
388/*******************************************************************************
389
390  NAME
391    CsrWifiRouterMaPacketInd
392
393  DESCRIPTION
394    The router sends the primitive to a subscribed task when it receives a
395    frame matching the subscription.
396
397  MEMBERS
398    common - Common header for use with the CsrWifiFsm Module
399    interfaceTag - Interface Identifier; unique identifier of an interface
400    subscriptionHandle - The handle of the subscription
401    result - Status of the operation
402    frameLength - Length of the received frame in bytes
403    frame - Pointer to the received frame
404    freeFunction - Pointer to function to be used to free the frame
405    rssi - Received signal strength indication in dBm
406    snr - Signal to Noise Ratio
407    rate - Transmission/Reception rate
408
409*******************************************************************************/
410typedef struct
411{
412    CsrWifiFsmEvent common;
413    u16 interfaceTag;
414    u8 subscriptionHandle;
415    CsrResult result;
416    u16 frameLength;
417    u8 *frame;
418    CsrWifiRouterFrameFreeFunction freeFunction;
419    s16 rssi;
420    s16 snr;
421    u16 rate;
422} CsrWifiRouterMaPacketInd;
423
424
425#ifdef __cplusplus
426}
427#endif
428
429#endif /* CSR_WIFI_ROUTER_PRIM_H__ */
430
431

Archive Download this file



interactive