GUI: Fix Tomato RAF theme for all builds. Compilation typo.
[tomato.git] / release / src-rt-6.x.4708 / linux / linux-2.6.36 / include / linux / uwb / spec.h
blobf0c032abf2c077098ff2be107ac74d3dfbac94c4
1 /*
2 * Ultra Wide Band
3 * UWB Standard definitions
5 * Copyright (C) 2005-2006 Intel Corporation
6 * Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License version
10 * 2 as published by the Free Software Foundation.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20 * 02110-1301, USA.
23 * All these definitions are based on the ECMA-368 standard.
25 * Note all definitions are Little Endian in the wire, and we will
26 * convert them to host order before operating on the bitfields (that
27 * yes, we use extensively).
30 #ifndef __LINUX__UWB_SPEC_H__
31 #define __LINUX__UWB_SPEC_H__
33 #include <linux/types.h>
34 #include <linux/bitmap.h>
36 #define i1480_FW 0x00000303
37 /* #define i1480_FW 0x00000302 */
39 /**
40 * Number of Medium Access Slots in a superframe.
42 * UWB divides time in SuperFrames, each one divided in 256 pieces, or
43 * Medium Access Slots. See MBOA MAC[5.4.5] for details. The MAS is the
44 * basic bandwidth allocation unit in UWB.
46 enum { UWB_NUM_MAS = 256 };
48 /**
49 * Number of Zones in superframe.
51 * UWB divides the superframe into zones with numbering starting from BPST.
52 * See MBOA MAC[16.8.6]
54 enum { UWB_NUM_ZONES = 16 };
57 * Number of MAS in a zone.
59 #define UWB_MAS_PER_ZONE (UWB_NUM_MAS / UWB_NUM_ZONES)
62 * Number of MAS required before a row can be considered available.
64 #define UWB_USABLE_MAS_PER_ROW (UWB_NUM_ZONES - 1)
67 * Number of streams per DRP reservation between a pair of devices.
69 * [ECMA-368] section 16.8.6.
71 enum { UWB_NUM_STREAMS = 8 };
74 * mMasLength
76 * The length of a MAS in microseconds.
78 * [ECMA-368] section 17.16.
80 enum { UWB_MAS_LENGTH_US = 256 };
83 * mBeaconSlotLength
85 * The length of the beacon slot in microseconds.
87 * [ECMA-368] section 17.16
89 enum { UWB_BEACON_SLOT_LENGTH_US = 85 };
92 * mMaxLostBeacons
94 * The number beacons missing in consecutive superframes before a
95 * device can be considered as unreachable.
97 * [ECMA-368] section 17.16
99 enum { UWB_MAX_LOST_BEACONS = 3 };
102 * mDRPBackOffWinMin
104 * The minimum number of superframes to wait before trying to reserve
105 * extra MAS.
107 * [ECMA-368] section 17.16
109 enum { UWB_DRP_BACKOFF_WIN_MIN = 2 };
112 * mDRPBackOffWinMax
114 * The maximum number of superframes to wait before trying to reserve
115 * extra MAS.
117 * [ECMA-368] section 17.16
119 enum { UWB_DRP_BACKOFF_WIN_MAX = 16 };
122 * Length of a superframe in microseconds.
124 #define UWB_SUPERFRAME_LENGTH_US (UWB_MAS_LENGTH_US * UWB_NUM_MAS)
127 * UWB MAC address
129 * It is *imperative* that this struct is exactly 6 packed bytes (as
130 * it is also used to define headers sent down and up the wire/radio).
132 struct uwb_mac_addr {
133 u8 data[6];
134 } __attribute__((packed));
138 * UWB device address
140 * It is *imperative* that this struct is exactly 6 packed bytes (as
141 * it is also used to define headers sent down and up the wire/radio).
143 struct uwb_dev_addr {
144 u8 data[2];
145 } __attribute__((packed));
149 * Types of UWB addresses
151 * Order matters (by size).
153 enum uwb_addr_type {
154 UWB_ADDR_DEV = 0,
155 UWB_ADDR_MAC = 1,
159 /** Size of a char buffer for printing a MAC/device address */
160 enum { UWB_ADDR_STRSIZE = 32 };
163 /** UWB WiMedia protocol IDs. */
164 enum uwb_prid {
165 UWB_PRID_WLP_RESERVED = 0x0000,
166 UWB_PRID_WLP = 0x0001,
167 UWB_PRID_WUSB_BOT = 0x0010,
168 UWB_PRID_WUSB = 0x0010,
169 UWB_PRID_WUSB_TOP = 0x001F,
173 /** PHY Rate (MBOA MAC[7.8.12, Table 61]) */
174 enum uwb_phy_rate {
175 UWB_PHY_RATE_53 = 0,
176 UWB_PHY_RATE_80,
177 UWB_PHY_RATE_106,
178 UWB_PHY_RATE_160,
179 UWB_PHY_RATE_200,
180 UWB_PHY_RATE_320,
181 UWB_PHY_RATE_400,
182 UWB_PHY_RATE_480,
183 UWB_PHY_RATE_INVALID
188 * Different ways to scan (MBOA MAC[6.2.2, Table 8], WUSB[Table 8-78])
190 enum uwb_scan_type {
191 UWB_SCAN_ONLY = 0,
192 UWB_SCAN_OUTSIDE_BP,
193 UWB_SCAN_WHILE_INACTIVE,
194 UWB_SCAN_DISABLED,
195 UWB_SCAN_ONLY_STARTTIME,
196 UWB_SCAN_TOP
200 /** ACK Policy types (MBOA MAC[7.2.1.3]) */
201 enum uwb_ack_pol {
202 UWB_ACK_NO = 0,
203 UWB_ACK_INM = 1,
204 UWB_ACK_B = 2,
205 UWB_ACK_B_REQ = 3,
209 /** DRP reservation types ([ECMA-368 table 106) */
210 enum uwb_drp_type {
211 UWB_DRP_TYPE_ALIEN_BP = 0,
212 UWB_DRP_TYPE_HARD,
213 UWB_DRP_TYPE_SOFT,
214 UWB_DRP_TYPE_PRIVATE,
215 UWB_DRP_TYPE_PCA,
219 /** DRP Reason Codes ([ECMA-368] table 107) */
220 enum uwb_drp_reason {
221 UWB_DRP_REASON_ACCEPTED = 0,
222 UWB_DRP_REASON_CONFLICT,
223 UWB_DRP_REASON_PENDING,
224 UWB_DRP_REASON_DENIED,
225 UWB_DRP_REASON_MODIFIED,
228 /** Relinquish Request Reason Codes ([ECMA-368] table 113) */
229 enum uwb_relinquish_req_reason {
230 UWB_RELINQUISH_REQ_REASON_NON_SPECIFIC = 0,
231 UWB_RELINQUISH_REQ_REASON_OVER_ALLOCATION,
235 * DRP Notification Reason Codes (WHCI 0.95 [3.1.4.9])
237 enum uwb_drp_notif_reason {
238 UWB_DRP_NOTIF_DRP_IE_RCVD = 0,
239 UWB_DRP_NOTIF_CONFLICT,
240 UWB_DRP_NOTIF_TERMINATE,
244 /** Allocation of MAS slots in a DRP request MBOA MAC[7.8.7] */
245 struct uwb_drp_alloc {
246 __le16 zone_bm;
247 __le16 mas_bm;
248 } __attribute__((packed));
251 /** General MAC Header format (ECMA-368[16.2]) */
252 struct uwb_mac_frame_hdr {
253 __le16 Frame_Control;
254 struct uwb_dev_addr DestAddr;
255 struct uwb_dev_addr SrcAddr;
256 __le16 Sequence_Control;
257 __le16 Access_Information;
258 } __attribute__((packed));
262 * uwb_beacon_frame - a beacon frame including MAC headers
264 * [ECMA] section 16.3.
266 struct uwb_beacon_frame {
267 struct uwb_mac_frame_hdr hdr;
268 struct uwb_mac_addr Device_Identifier; /* may be a NULL EUI-48 */
269 u8 Beacon_Slot_Number;
270 u8 Device_Control;
271 u8 IEData[];
272 } __attribute__((packed));
275 /** Information Element codes (MBOA MAC[T54]) */
276 enum uwb_ie {
277 UWB_PCA_AVAILABILITY = 2,
278 UWB_IE_DRP_AVAILABILITY = 8,
279 UWB_IE_DRP = 9,
280 UWB_BP_SWITCH_IE = 11,
281 UWB_MAC_CAPABILITIES_IE = 12,
282 UWB_PHY_CAPABILITIES_IE = 13,
283 UWB_APP_SPEC_PROBE_IE = 15,
284 UWB_IDENTIFICATION_IE = 19,
285 UWB_MASTER_KEY_ID_IE = 20,
286 UWB_RELINQUISH_REQUEST_IE = 21,
287 UWB_IE_WLP = 250, /* WiMedia Logical Link Control Protocol WLP 0.99 */
288 UWB_APP_SPEC_IE = 255,
293 * Header common to all Information Elements (IEs)
295 struct uwb_ie_hdr {
296 u8 element_id; /* enum uwb_ie */
297 u8 length;
298 } __attribute__((packed));
301 /** Dynamic Reservation Protocol IE (MBOA MAC[7.8.6]) */
302 struct uwb_ie_drp {
303 struct uwb_ie_hdr hdr;
304 __le16 drp_control;
305 struct uwb_dev_addr dev_addr;
306 struct uwb_drp_alloc allocs[];
307 } __attribute__((packed));
309 static inline int uwb_ie_drp_type(struct uwb_ie_drp *ie)
311 return (le16_to_cpu(ie->drp_control) >> 0) & 0x7;
314 static inline int uwb_ie_drp_stream_index(struct uwb_ie_drp *ie)
316 return (le16_to_cpu(ie->drp_control) >> 3) & 0x7;
319 static inline int uwb_ie_drp_reason_code(struct uwb_ie_drp *ie)
321 return (le16_to_cpu(ie->drp_control) >> 6) & 0x7;
324 static inline int uwb_ie_drp_status(struct uwb_ie_drp *ie)
326 return (le16_to_cpu(ie->drp_control) >> 9) & 0x1;
329 static inline int uwb_ie_drp_owner(struct uwb_ie_drp *ie)
331 return (le16_to_cpu(ie->drp_control) >> 10) & 0x1;
334 static inline int uwb_ie_drp_tiebreaker(struct uwb_ie_drp *ie)
336 return (le16_to_cpu(ie->drp_control) >> 11) & 0x1;
339 static inline int uwb_ie_drp_unsafe(struct uwb_ie_drp *ie)
341 return (le16_to_cpu(ie->drp_control) >> 12) & 0x1;
344 static inline void uwb_ie_drp_set_type(struct uwb_ie_drp *ie, enum uwb_drp_type type)
346 u16 drp_control = le16_to_cpu(ie->drp_control);
347 drp_control = (drp_control & ~(0x7 << 0)) | (type << 0);
348 ie->drp_control = cpu_to_le16(drp_control);
351 static inline void uwb_ie_drp_set_stream_index(struct uwb_ie_drp *ie, int stream_index)
353 u16 drp_control = le16_to_cpu(ie->drp_control);
354 drp_control = (drp_control & ~(0x7 << 3)) | (stream_index << 3);
355 ie->drp_control = cpu_to_le16(drp_control);
358 static inline void uwb_ie_drp_set_reason_code(struct uwb_ie_drp *ie,
359 enum uwb_drp_reason reason_code)
361 u16 drp_control = le16_to_cpu(ie->drp_control);
362 drp_control = (ie->drp_control & ~(0x7 << 6)) | (reason_code << 6);
363 ie->drp_control = cpu_to_le16(drp_control);
366 static inline void uwb_ie_drp_set_status(struct uwb_ie_drp *ie, int status)
368 u16 drp_control = le16_to_cpu(ie->drp_control);
369 drp_control = (drp_control & ~(0x1 << 9)) | (status << 9);
370 ie->drp_control = cpu_to_le16(drp_control);
373 static inline void uwb_ie_drp_set_owner(struct uwb_ie_drp *ie, int owner)
375 u16 drp_control = le16_to_cpu(ie->drp_control);
376 drp_control = (drp_control & ~(0x1 << 10)) | (owner << 10);
377 ie->drp_control = cpu_to_le16(drp_control);
380 static inline void uwb_ie_drp_set_tiebreaker(struct uwb_ie_drp *ie, int tiebreaker)
382 u16 drp_control = le16_to_cpu(ie->drp_control);
383 drp_control = (drp_control & ~(0x1 << 11)) | (tiebreaker << 11);
384 ie->drp_control = cpu_to_le16(drp_control);
387 static inline void uwb_ie_drp_set_unsafe(struct uwb_ie_drp *ie, int unsafe)
389 u16 drp_control = le16_to_cpu(ie->drp_control);
390 drp_control = (drp_control & ~(0x1 << 12)) | (unsafe << 12);
391 ie->drp_control = cpu_to_le16(drp_control);
394 /** Dynamic Reservation Protocol IE (MBOA MAC[7.8.7]) */
395 struct uwb_ie_drp_avail {
396 struct uwb_ie_hdr hdr;
397 DECLARE_BITMAP(bmp, UWB_NUM_MAS);
398 } __attribute__((packed));
400 /* Relinqish Request IE ([ECMA-368] section 16.8.19). */
401 struct uwb_relinquish_request_ie {
402 struct uwb_ie_hdr hdr;
403 __le16 relinquish_req_control;
404 struct uwb_dev_addr dev_addr;
405 struct uwb_drp_alloc allocs[];
406 } __attribute__((packed));
408 static inline int uwb_ie_relinquish_req_reason_code(struct uwb_relinquish_request_ie *ie)
410 return (le16_to_cpu(ie->relinquish_req_control) >> 0) & 0xf;
413 static inline void uwb_ie_relinquish_req_set_reason_code(struct uwb_relinquish_request_ie *ie,
414 int reason_code)
416 u16 ctrl = le16_to_cpu(ie->relinquish_req_control);
417 ctrl = (ctrl & ~(0xf << 0)) | (reason_code << 0);
418 ie->relinquish_req_control = cpu_to_le16(ctrl);
422 * The Vendor ID is set to an OUI that indicates the vendor of the device.
423 * ECMA-368 [16.8.10]
425 struct uwb_vendor_id {
426 u8 data[3];
427 } __attribute__((packed));
429 struct uwb_device_type_id {
430 u8 data[3];
431 } __attribute__((packed));
435 * UWB device information types
436 * ECMA-368 [16.8.10]
438 enum uwb_dev_info_type {
439 UWB_DEV_INFO_VENDOR_ID = 0,
440 UWB_DEV_INFO_VENDOR_TYPE,
441 UWB_DEV_INFO_NAME,
445 * UWB device information found in Identification IE
446 * ECMA-368 [16.8.10]
448 struct uwb_dev_info {
449 u8 type; /* enum uwb_dev_info_type */
450 u8 length;
451 u8 data[];
452 } __attribute__((packed));
455 * UWB Identification IE
456 * ECMA-368 [16.8.10]
458 struct uwb_identification_ie {
459 struct uwb_ie_hdr hdr;
460 struct uwb_dev_info info[];
461 } __attribute__((packed));
464 * UWB Radio Controller
466 * These definitions are common to the Radio Control layers as
467 * exported by the WUSB1.0 HWA and WHCI interfaces.
470 /** Radio Control Command Block (WUSB1.0[Table 8-65] and WHCI 0.95) */
471 struct uwb_rccb {
472 u8 bCommandType; /* enum hwa_cet */
473 __le16 wCommand; /* Command code */
474 u8 bCommandContext; /* Context ID */
475 } __attribute__((packed));
478 /** Radio Control Event Block (WUSB[table 8-66], WHCI 0.95) */
479 struct uwb_rceb {
480 u8 bEventType; /* enum hwa_cet */
481 __le16 wEvent; /* Event code */
482 u8 bEventContext; /* Context ID */
483 } __attribute__((packed));
486 enum {
487 UWB_RC_CET_GENERAL = 0, /* General Command/Event type */
488 UWB_RC_CET_EX_TYPE_1 = 1, /* Extended Type 1 Command/Event type */
491 /* Commands to the radio controller */
492 enum uwb_rc_cmd {
493 UWB_RC_CMD_CHANNEL_CHANGE = 16,
494 UWB_RC_CMD_DEV_ADDR_MGMT = 17, /* Device Address Management */
495 UWB_RC_CMD_GET_IE = 18, /* GET Information Elements */
496 UWB_RC_CMD_RESET = 19,
497 UWB_RC_CMD_SCAN = 20, /* Scan management */
498 UWB_RC_CMD_SET_BEACON_FILTER = 21,
499 UWB_RC_CMD_SET_DRP_IE = 22, /* Dynamic Reservation Protocol IEs */
500 UWB_RC_CMD_SET_IE = 23, /* Information Element management */
501 UWB_RC_CMD_SET_NOTIFICATION_FILTER = 24,
502 UWB_RC_CMD_SET_TX_POWER = 25,
503 UWB_RC_CMD_SLEEP = 26,
504 UWB_RC_CMD_START_BEACON = 27,
505 UWB_RC_CMD_STOP_BEACON = 28,
506 UWB_RC_CMD_BP_MERGE = 29,
507 UWB_RC_CMD_SEND_COMMAND_FRAME = 30,
508 UWB_RC_CMD_SET_ASIE_NOTIF = 31,
511 /* Notifications from the radio controller */
512 enum uwb_rc_evt {
513 UWB_RC_EVT_IE_RCV = 0,
514 UWB_RC_EVT_BEACON = 1,
515 UWB_RC_EVT_BEACON_SIZE = 2,
516 UWB_RC_EVT_BPOIE_CHANGE = 3,
517 UWB_RC_EVT_BP_SLOT_CHANGE = 4,
518 UWB_RC_EVT_BP_SWITCH_IE_RCV = 5,
519 UWB_RC_EVT_DEV_ADDR_CONFLICT = 6,
520 UWB_RC_EVT_DRP_AVAIL = 7,
521 UWB_RC_EVT_DRP = 8,
522 UWB_RC_EVT_BP_SWITCH_STATUS = 9,
523 UWB_RC_EVT_CMD_FRAME_RCV = 10,
524 UWB_RC_EVT_CHANNEL_CHANGE_IE_RCV = 11,
525 /* Events (command responses) use the same code as the command */
526 UWB_RC_EVT_UNKNOWN_CMD_RCV = 65535,
529 enum uwb_rc_extended_type_1_cmd {
530 UWB_RC_SET_DAA_ENERGY_MASK = 32,
531 UWB_RC_SET_NOTIFICATION_FILTER_EX = 33,
534 enum uwb_rc_extended_type_1_evt {
535 UWB_RC_DAA_ENERGY_DETECTED = 0,
538 /* Radio Control Result Code. [WHCI] table 3-3. */
539 enum {
540 UWB_RC_RES_SUCCESS = 0,
541 UWB_RC_RES_FAIL,
542 UWB_RC_RES_FAIL_HARDWARE,
543 UWB_RC_RES_FAIL_NO_SLOTS,
544 UWB_RC_RES_FAIL_BEACON_TOO_LARGE,
545 UWB_RC_RES_FAIL_INVALID_PARAMETER,
546 UWB_RC_RES_FAIL_UNSUPPORTED_PWR_LEVEL,
547 UWB_RC_RES_FAIL_INVALID_IE_DATA,
548 UWB_RC_RES_FAIL_BEACON_SIZE_EXCEEDED,
549 UWB_RC_RES_FAIL_CANCELLED,
550 UWB_RC_RES_FAIL_INVALID_STATE,
551 UWB_RC_RES_FAIL_INVALID_SIZE,
552 UWB_RC_RES_FAIL_ACK_NOT_RECEIVED,
553 UWB_RC_RES_FAIL_NO_MORE_ASIE_NOTIF,
554 UWB_RC_RES_FAIL_TIME_OUT = 255,
557 /* Confirm event. [WHCI] section 3.1.3.1 etc. */
558 struct uwb_rc_evt_confirm {
559 struct uwb_rceb rceb;
560 u8 bResultCode;
561 } __attribute__((packed));
563 /* Device Address Management event. [WHCI] section 3.1.3.2. */
564 struct uwb_rc_evt_dev_addr_mgmt {
565 struct uwb_rceb rceb;
566 u8 baAddr[6];
567 u8 bResultCode;
568 } __attribute__((packed));
571 /* Get IE Event. [WHCI] section 3.1.3.3. */
572 struct uwb_rc_evt_get_ie {
573 struct uwb_rceb rceb;
574 __le16 wIELength;
575 u8 IEData[];
576 } __attribute__((packed));
578 /* Set DRP IE Event. [WHCI] section 3.1.3.7. */
579 struct uwb_rc_evt_set_drp_ie {
580 struct uwb_rceb rceb;
581 __le16 wRemainingSpace;
582 u8 bResultCode;
583 } __attribute__((packed));
585 /* Set IE Event. [WHCI] section 3.1.3.8. */
586 struct uwb_rc_evt_set_ie {
587 struct uwb_rceb rceb;
588 __le16 RemainingSpace;
589 u8 bResultCode;
590 } __attribute__((packed));
592 /* Scan command. [WHCI] 3.1.3.5. */
593 struct uwb_rc_cmd_scan {
594 struct uwb_rccb rccb;
595 u8 bChannelNumber;
596 u8 bScanState;
597 __le16 wStartTime;
598 } __attribute__((packed));
600 /* Set DRP IE command. [WHCI] section 3.1.3.7. */
601 struct uwb_rc_cmd_set_drp_ie {
602 struct uwb_rccb rccb;
603 __le16 wIELength;
604 struct uwb_ie_drp IEData[];
605 } __attribute__((packed));
607 /* Set IE command. [WHCI] section 3.1.3.8. */
608 struct uwb_rc_cmd_set_ie {
609 struct uwb_rccb rccb;
610 __le16 wIELength;
611 u8 IEData[];
612 } __attribute__((packed));
614 /* Set DAA Energy Mask event. [WHCI 0.96] section 3.1.3.17. */
615 struct uwb_rc_evt_set_daa_energy_mask {
616 struct uwb_rceb rceb;
617 __le16 wLength;
618 u8 result;
619 } __attribute__((packed));
621 /* Set Notification Filter Extended event. [WHCI 0.96] section 3.1.3.18. */
622 struct uwb_rc_evt_set_notification_filter_ex {
623 struct uwb_rceb rceb;
624 __le16 wLength;
625 u8 result;
626 } __attribute__((packed));
628 /* IE Received notification. [WHCI] section 3.1.4.1. */
629 struct uwb_rc_evt_ie_rcv {
630 struct uwb_rceb rceb;
631 struct uwb_dev_addr SrcAddr;
632 __le16 wIELength;
633 u8 IEData[];
634 } __attribute__((packed));
636 /* Type of the received beacon. [WHCI] section 3.1.4.2. */
637 enum uwb_rc_beacon_type {
638 UWB_RC_BEACON_TYPE_SCAN = 0,
639 UWB_RC_BEACON_TYPE_NEIGHBOR,
640 UWB_RC_BEACON_TYPE_OL_ALIEN,
641 UWB_RC_BEACON_TYPE_NOL_ALIEN,
644 /* Beacon received notification. [WHCI] 3.1.4.2. */
645 struct uwb_rc_evt_beacon {
646 struct uwb_rceb rceb;
647 u8 bChannelNumber;
648 u8 bBeaconType;
649 __le16 wBPSTOffset;
650 u8 bLQI;
651 u8 bRSSI;
652 __le16 wBeaconInfoLength;
653 u8 BeaconInfo[];
654 } __attribute__((packed));
657 /* Beacon Size Change notification. [WHCI] section 3.1.4.3 */
658 struct uwb_rc_evt_beacon_size {
659 struct uwb_rceb rceb;
660 __le16 wNewBeaconSize;
661 } __attribute__((packed));
664 /* BPOIE Change notification. [WHCI] section 3.1.4.4. */
665 struct uwb_rc_evt_bpoie_change {
666 struct uwb_rceb rceb;
667 __le16 wBPOIELength;
668 u8 BPOIE[];
669 } __attribute__((packed));
672 /* Beacon Slot Change notification. [WHCI] section 3.1.4.5. */
673 struct uwb_rc_evt_bp_slot_change {
674 struct uwb_rceb rceb;
675 u8 slot_info;
676 } __attribute__((packed));
678 static inline int uwb_rc_evt_bp_slot_change_slot_num(
679 const struct uwb_rc_evt_bp_slot_change *evt)
681 return evt->slot_info & 0x7f;
684 static inline int uwb_rc_evt_bp_slot_change_no_slot(
685 const struct uwb_rc_evt_bp_slot_change *evt)
687 return (evt->slot_info & 0x80) >> 7;
690 /* BP Switch IE Received notification. [WHCI] section 3.1.4.6. */
691 struct uwb_rc_evt_bp_switch_ie_rcv {
692 struct uwb_rceb rceb;
693 struct uwb_dev_addr wSrcAddr;
694 __le16 wIELength;
695 u8 IEData[];
696 } __attribute__((packed));
698 /* DevAddr Conflict notification. [WHCI] section 3.1.4.7. */
699 struct uwb_rc_evt_dev_addr_conflict {
700 struct uwb_rceb rceb;
701 } __attribute__((packed));
703 /* DRP notification. [WHCI] section 3.1.4.9. */
704 struct uwb_rc_evt_drp {
705 struct uwb_rceb rceb;
706 struct uwb_dev_addr src_addr;
707 u8 reason;
708 u8 beacon_slot_number;
709 __le16 ie_length;
710 u8 ie_data[];
711 } __attribute__((packed));
713 static inline enum uwb_drp_notif_reason uwb_rc_evt_drp_reason(struct uwb_rc_evt_drp *evt)
715 return evt->reason & 0x0f;
719 /* DRP Availability Change notification. [WHCI] section 3.1.4.8. */
720 struct uwb_rc_evt_drp_avail {
721 struct uwb_rceb rceb;
722 DECLARE_BITMAP(bmp, UWB_NUM_MAS);
723 } __attribute__((packed));
725 /* BP switch status notification. [WHCI] section 3.1.4.10. */
726 struct uwb_rc_evt_bp_switch_status {
727 struct uwb_rceb rceb;
728 u8 status;
729 u8 slot_offset;
730 __le16 bpst_offset;
731 u8 move_countdown;
732 } __attribute__((packed));
734 /* Command Frame Received notification. [WHCI] section 3.1.4.11. */
735 struct uwb_rc_evt_cmd_frame_rcv {
736 struct uwb_rceb rceb;
737 __le16 receive_time;
738 struct uwb_dev_addr wSrcAddr;
739 struct uwb_dev_addr wDstAddr;
740 __le16 control;
741 __le16 reserved;
742 __le16 dataLength;
743 u8 data[];
744 } __attribute__((packed));
746 /* Channel Change IE Received notification. [WHCI] section 3.1.4.12. */
747 struct uwb_rc_evt_channel_change_ie_rcv {
748 struct uwb_rceb rceb;
749 struct uwb_dev_addr wSrcAddr;
750 __le16 wIELength;
751 u8 IEData[];
752 } __attribute__((packed));
754 /* DAA Energy Detected notification. [WHCI 0.96] section 3.1.4.14. */
755 struct uwb_rc_evt_daa_energy_detected {
756 struct uwb_rceb rceb;
757 __le16 wLength;
758 u8 bandID;
759 u8 reserved;
760 u8 toneBmp[16];
761 } __attribute__((packed));
765 * Radio Control Interface Class Descriptor
767 * WUSB 1.0 [8.6.1.2]
769 struct uwb_rc_control_intf_class_desc {
770 u8 bLength;
771 u8 bDescriptorType;
772 __le16 bcdRCIVersion;
773 } __attribute__((packed));
775 #endif /* #ifndef __LINUX__UWB_SPEC_H__ */