aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/uwb
diff options
context:
space:
mode:
authorStefano Panella <stefano.panella@csr.com>2008-11-04 09:06:31 -0500
committerDavid Vrabel <david.vrabel@csr.com>2008-11-04 10:53:29 -0500
commitc5995bd2819dc577d0b32b26be0836d16c977e24 (patch)
tree2cc5122623ace2571b7b3080b1b9a61f8282cfd4 /include/linux/uwb
parentf88518d122f1b007f47a46aff37ca2885126a923 (diff)
uwb: infrastructure for handling Relinquish Request IEs
The structures and event handler needed to handle Relinish Request IEs received from neighbors. Nothing is done with these IEs yet. Signed-off-by: Stefano Panella <stefano.panella@csr.com> Signed-off-by: David Vrabel <david.vrabel@csr.com>
Diffstat (limited to 'include/linux/uwb')
-rw-r--r--include/linux/uwb/spec.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/include/linux/uwb/spec.h b/include/linux/uwb/spec.h
index 198c15f8e251..a30436ea53aa 100644
--- a/include/linux/uwb/spec.h
+++ b/include/linux/uwb/spec.h
@@ -200,6 +200,12 @@ enum uwb_drp_reason {
200 UWB_DRP_REASON_MODIFIED, 200 UWB_DRP_REASON_MODIFIED,
201}; 201};
202 202
203/** Relinquish Request Reason Codes ([ECMA-368] table 113) */
204enum uwb_relinquish_req_reason {
205 UWB_RELINQUISH_REQ_REASON_NON_SPECIFIC = 0,
206 UWB_RELINQUISH_REQ_REASON_OVER_ALLOCATION,
207};
208
203/** 209/**
204 * DRP Notification Reason Codes (WHCI 0.95 [3.1.4.9]) 210 * DRP Notification Reason Codes (WHCI 0.95 [3.1.4.9])
205 */ 211 */
@@ -252,6 +258,7 @@ enum uwb_ie {
252 UWB_APP_SPEC_PROBE_IE = 15, 258 UWB_APP_SPEC_PROBE_IE = 15,
253 UWB_IDENTIFICATION_IE = 19, 259 UWB_IDENTIFICATION_IE = 19,
254 UWB_MASTER_KEY_ID_IE = 20, 260 UWB_MASTER_KEY_ID_IE = 20,
261 UWB_RELINQUISH_REQUEST_IE = 21,
255 UWB_IE_WLP = 250, /* WiMedia Logical Link Control Protocol WLP 0.99 */ 262 UWB_IE_WLP = 250, /* WiMedia Logical Link Control Protocol WLP 0.99 */
256 UWB_APP_SPEC_IE = 255, 263 UWB_APP_SPEC_IE = 255,
257}; 264};
@@ -365,6 +372,27 @@ struct uwb_ie_drp_avail {
365 DECLARE_BITMAP(bmp, UWB_NUM_MAS); 372 DECLARE_BITMAP(bmp, UWB_NUM_MAS);
366} __attribute__((packed)); 373} __attribute__((packed));
367 374
375/* Relinqish Request IE ([ECMA-368] section 16.8.19). */
376struct uwb_relinquish_request_ie {
377 struct uwb_ie_hdr hdr;
378 __le16 relinquish_req_control;
379 struct uwb_dev_addr dev_addr;
380 struct uwb_drp_alloc allocs[];
381} __attribute__((packed));
382
383static inline int uwb_ie_relinquish_req_reason_code(struct uwb_relinquish_request_ie *ie)
384{
385 return (le16_to_cpu(ie->relinquish_req_control) >> 0) & 0xf;
386}
387
388static inline void uwb_ie_relinquish_req_set_reason_code(struct uwb_relinquish_request_ie *ie,
389 int reason_code)
390{
391 u16 ctrl = le16_to_cpu(ie->relinquish_req_control);
392 ctrl = (ctrl & ~(0xf << 0)) | (reason_code << 0);
393 ie->relinquish_req_control = cpu_to_le16(ctrl);
394}
395
368/** 396/**
369 * The Vendor ID is set to an OUI that indicates the vendor of the device. 397 * The Vendor ID is set to an OUI that indicates the vendor of the device.
370 * ECMA-368 [16.8.10] 398 * ECMA-368 [16.8.10]