57 * Number of MAS in a zone. |
57 * Number of MAS in a zone. |
58 */ |
58 */ |
59 #define UWB_MAS_PER_ZONE (UWB_NUM_MAS / UWB_NUM_ZONES) |
59 #define UWB_MAS_PER_ZONE (UWB_NUM_MAS / UWB_NUM_ZONES) |
60 |
60 |
61 /* |
61 /* |
|
62 * Number of MAS required before a row can be considered available. |
|
63 */ |
|
64 #define UWB_USABLE_MAS_PER_ROW (UWB_NUM_ZONES - 1) |
|
65 |
|
66 /* |
62 * Number of streams per DRP reservation between a pair of devices. |
67 * Number of streams per DRP reservation between a pair of devices. |
63 * |
68 * |
64 * [ECMA-368] section 16.8.6. |
69 * [ECMA-368] section 16.8.6. |
65 */ |
70 */ |
66 enum { UWB_NUM_STREAMS = 8 }; |
71 enum { UWB_NUM_STREAMS = 8 }; |
90 * device can be considered as unreachable. |
95 * device can be considered as unreachable. |
91 * |
96 * |
92 * [ECMA-368] section 17.16 |
97 * [ECMA-368] section 17.16 |
93 */ |
98 */ |
94 enum { UWB_MAX_LOST_BEACONS = 3 }; |
99 enum { UWB_MAX_LOST_BEACONS = 3 }; |
|
100 |
|
101 /* |
|
102 * mDRPBackOffWinMin |
|
103 * |
|
104 * The minimum number of superframes to wait before trying to reserve |
|
105 * extra MAS. |
|
106 * |
|
107 * [ECMA-368] section 17.16 |
|
108 */ |
|
109 enum { UWB_DRP_BACKOFF_WIN_MIN = 2 }; |
|
110 |
|
111 /* |
|
112 * mDRPBackOffWinMax |
|
113 * |
|
114 * The maximum number of superframes to wait before trying to reserve |
|
115 * extra MAS. |
|
116 * |
|
117 * [ECMA-368] section 17.16 |
|
118 */ |
|
119 enum { UWB_DRP_BACKOFF_WIN_MAX = 16 }; |
95 |
120 |
96 /* |
121 /* |
97 * Length of a superframe in microseconds. |
122 * Length of a superframe in microseconds. |
98 */ |
123 */ |
99 #define UWB_SUPERFRAME_LENGTH_US (UWB_MAS_LENGTH_US * UWB_NUM_MAS) |
124 #define UWB_SUPERFRAME_LENGTH_US (UWB_MAS_LENGTH_US * UWB_NUM_MAS) |
198 UWB_DRP_REASON_PENDING, |
223 UWB_DRP_REASON_PENDING, |
199 UWB_DRP_REASON_DENIED, |
224 UWB_DRP_REASON_DENIED, |
200 UWB_DRP_REASON_MODIFIED, |
225 UWB_DRP_REASON_MODIFIED, |
201 }; |
226 }; |
202 |
227 |
|
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, |
|
232 }; |
|
233 |
203 /** |
234 /** |
204 * DRP Notification Reason Codes (WHCI 0.95 [3.1.4.9]) |
235 * DRP Notification Reason Codes (WHCI 0.95 [3.1.4.9]) |
205 */ |
236 */ |
206 enum uwb_drp_notif_reason { |
237 enum uwb_drp_notif_reason { |
207 UWB_DRP_NOTIF_DRP_IE_RCVD = 0, |
238 UWB_DRP_NOTIF_DRP_IE_RCVD = 0, |
250 UWB_MAC_CAPABILITIES_IE = 12, |
281 UWB_MAC_CAPABILITIES_IE = 12, |
251 UWB_PHY_CAPABILITIES_IE = 13, |
282 UWB_PHY_CAPABILITIES_IE = 13, |
252 UWB_APP_SPEC_PROBE_IE = 15, |
283 UWB_APP_SPEC_PROBE_IE = 15, |
253 UWB_IDENTIFICATION_IE = 19, |
284 UWB_IDENTIFICATION_IE = 19, |
254 UWB_MASTER_KEY_ID_IE = 20, |
285 UWB_MASTER_KEY_ID_IE = 20, |
|
286 UWB_RELINQUISH_REQUEST_IE = 21, |
255 UWB_IE_WLP = 250, /* WiMedia Logical Link Control Protocol WLP 0.99 */ |
287 UWB_IE_WLP = 250, /* WiMedia Logical Link Control Protocol WLP 0.99 */ |
256 UWB_APP_SPEC_IE = 255, |
288 UWB_APP_SPEC_IE = 255, |
257 }; |
289 }; |
258 |
290 |
259 |
291 |
362 /** Dynamic Reservation Protocol IE (MBOA MAC[7.8.7]) */ |
394 /** Dynamic Reservation Protocol IE (MBOA MAC[7.8.7]) */ |
363 struct uwb_ie_drp_avail { |
395 struct uwb_ie_drp_avail { |
364 struct uwb_ie_hdr hdr; |
396 struct uwb_ie_hdr hdr; |
365 DECLARE_BITMAP(bmp, UWB_NUM_MAS); |
397 DECLARE_BITMAP(bmp, UWB_NUM_MAS); |
366 } __attribute__((packed)); |
398 } __attribute__((packed)); |
|
399 |
|
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)); |
|
407 |
|
408 static inline int uwb_ie_relinquish_req_reason_code(struct uwb_relinquish_request_ie *ie) |
|
409 { |
|
410 return (le16_to_cpu(ie->relinquish_req_control) >> 0) & 0xf; |
|
411 } |
|
412 |
|
413 static inline void uwb_ie_relinquish_req_set_reason_code(struct uwb_relinquish_request_ie *ie, |
|
414 int reason_code) |
|
415 { |
|
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); |
|
419 } |
367 |
420 |
368 /** |
421 /** |
369 * The Vendor ID is set to an OUI that indicates the vendor of the device. |
422 * The Vendor ID is set to an OUI that indicates the vendor of the device. |
370 * ECMA-368 [16.8.10] |
423 * ECMA-368 [16.8.10] |
371 */ |
424 */ |