aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/uwb.h
diff options
context:
space:
mode:
authorDavid Vrabel <david.vrabel@csr.com>2008-11-17 10:53:42 -0500
committerDavid Vrabel <david.vrabel@csr.com>2008-11-19 09:46:33 -0500
commit6fae35f9cea92793a98b2d9ab21235e5ae035581 (patch)
tree82142169ff2ccada8c6c98beb6da59cafe8d913d /include/linux/uwb.h
parente17be2b2a95b43fe0d5878adf330701bb7a77115 (diff)
uwb: add basic radio manager
The UWB radio manager coordinates the use of the radio between the PALs that may be using it. PALs request use of the radio with uwb_radio_start() and the radio manager will start beaconing if its not already doing so. When the last PAL has called uwb_radio_stop() beaconing will be stopped. In the future, the radio manager will have a more sophisticated channel selection algorithm, probably following the Channel Selection Policy from the WiMedia Alliance when it is finalized. For now, channel 9 (BG1, TFC1) is selected. The user may override the channel selected by the radio manager and may force the radio to stop beaconing. The WUSB Host Controller PAL makes use of this and there are two new debug PAL commands that can be used for testing. Signed-off-by: David Vrabel <david.vrabel@csr.com>
Diffstat (limited to 'include/linux/uwb.h')
-rw-r--r--include/linux/uwb.h23
1 files changed, 19 insertions, 4 deletions
diff --git a/include/linux/uwb.h b/include/linux/uwb.h
index effd97998fd1..7d3ebf046f9a 100644
--- a/include/linux/uwb.h
+++ b/include/linux/uwb.h
@@ -355,6 +355,7 @@ struct uwb_rc {
355 u8 ctx_roll; 355 u8 ctx_roll;
356 356
357 int beaconing; /* Beaconing state [channel number] */ 357 int beaconing; /* Beaconing state [channel number] */
358 int beaconing_forced;
358 int scanning; 359 int scanning;
359 enum uwb_scan_type scan_type:3; 360 enum uwb_scan_type scan_type:3;
360 unsigned ready:1; 361 unsigned ready:1;
@@ -373,8 +374,8 @@ struct uwb_rc {
373 struct uwb_rc_cmd_set_ie *ies; 374 struct uwb_rc_cmd_set_ie *ies;
374 size_t ies_capacity; 375 size_t ies_capacity;
375 376
376 spinlock_t pal_lock;
377 struct list_head pals; 377 struct list_head pals;
378 int active_pals;
378 379
379 struct uwb_dbg *dbg; 380 struct uwb_dbg *dbg;
380}; 381};
@@ -382,11 +383,17 @@ struct uwb_rc {
382 383
383/** 384/**
384 * struct uwb_pal - a UWB PAL 385 * struct uwb_pal - a UWB PAL
385 * @name: descriptive name for this PAL (wushc, wlp, etc.). 386 * @name: descriptive name for this PAL (wusbhc, wlp, etc.).
386 * @device: a device for the PAL. Used to link the PAL and the radio 387 * @device: a device for the PAL. Used to link the PAL and the radio
387 * controller in sysfs. 388 * controller in sysfs.
389 * @rc: the radio controller the PAL uses.
390 * @channel_changed: called when the channel used by the radio changes.
391 * A channel of -1 means the channel has been stopped.
388 * @new_rsv: called when a peer requests a reservation (may be NULL if 392 * @new_rsv: called when a peer requests a reservation (may be NULL if
389 * the PAL cannot accept reservation requests). 393 * the PAL cannot accept reservation requests).
394 * @channel: channel being used by the PAL; 0 if the PAL isn't using
395 * the radio; -1 if the PAL wishes to use the radio but
396 * cannot.
390 * 397 *
391 * A Protocol Adaptation Layer (PAL) is a user of the WiMedia UWB 398 * A Protocol Adaptation Layer (PAL) is a user of the WiMedia UWB
392 * radio platform (e.g., WUSB, WLP or Bluetooth UWB AMP). 399 * radio platform (e.g., WUSB, WLP or Bluetooth UWB AMP).
@@ -405,12 +412,20 @@ struct uwb_pal {
405 struct list_head node; 412 struct list_head node;
406 const char *name; 413 const char *name;
407 struct device *device; 414 struct device *device;
415 struct uwb_rc *rc;
416
417 void (*channel_changed)(struct uwb_pal *pal, int channel);
408 void (*new_rsv)(struct uwb_pal *pal, struct uwb_rsv *rsv); 418 void (*new_rsv)(struct uwb_pal *pal, struct uwb_rsv *rsv);
419
420 int channel;
409}; 421};
410 422
411void uwb_pal_init(struct uwb_pal *pal); 423void uwb_pal_init(struct uwb_pal *pal);
412int uwb_pal_register(struct uwb_rc *rc, struct uwb_pal *pal); 424int uwb_pal_register(struct uwb_pal *pal);
413void uwb_pal_unregister(struct uwb_rc *rc, struct uwb_pal *pal); 425void uwb_pal_unregister(struct uwb_pal *pal);
426
427int uwb_radio_start(struct uwb_pal *pal);
428void uwb_radio_stop(struct uwb_pal *pal);
414 429
415/* 430/*
416 * General public API 431 * General public API