Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
uwb-internal.h File Reference
#include <linux/kernel.h>
#include <linux/device.h>
#include <linux/uwb.h>
#include <linux/mutex.h>

Go to the source code of this file.

Data Structures

struct  uwb_cnflt_alien
 
struct  uwb_rsv_col_set_info
 
struct  uwb_rsv_col_info
 
struct  uwb_rsv_row_info
 
struct  uwb_rsv_alloc_info
 
struct  uwb_event_notif
 
struct  uwb_event
 
struct  uwb_beca_e
 

Macros

#define UWB_RC_CMD_TIMEOUT_MS   1000 /* ms */
 

Enumerations

enum  uwb_uwb_rsv_alloc_result { UWB_RSV_ALLOC_FOUND = 0, UWB_RSV_ALLOC_NOT_FOUND }
 
enum  uwb_rsv_mas_status { UWB_RSV_MAS_NOT_AVAIL = 1, UWB_RSV_MAS_SAFE, UWB_RSV_MAS_UNSAFE }
 
enum  uwb_event_type { UWB_EVT_TYPE_NOTIF, UWB_EVT_TYPE_MSG }
 
enum  uwb_event_message { UWB_EVT_MSG_RESET }
 

Functions

void uwb_dev_init (struct uwb_dev *uwb_dev)
 
int __uwb_dev_offair (struct uwb_dev *, struct uwb_rc *)
 
int uwb_dev_add (struct uwb_dev *uwb_dev, struct device *parent_dev, struct uwb_rc *parent_rc)
 
void uwb_dev_rm (struct uwb_dev *uwb_dev)
 
void uwbd_dev_onair (struct uwb_rc *, struct uwb_beca_e *)
 
void uwbd_dev_offair (struct uwb_beca_e *)
 
void uwb_notify (struct uwb_rc *rc, struct uwb_dev *uwb_dev, enum uwb_notifs event)
 
struct uwb_rc__uwb_rc_try_get (struct uwb_rc *)
 
int uwb_rc_reset (struct uwb_rc *rc)
 
int uwb_rc_beacon (struct uwb_rc *rc, int channel, unsigned bpst_offset)
 
int uwb_rc_scan (struct uwb_rc *rc, unsigned channel, enum uwb_scan_type type, unsigned bpst_offset)
 
int uwb_rc_send_all_drp_ie (struct uwb_rc *rc)
 
void uwb_rc_ie_init (struct uwb_rc *)
 
int uwb_rc_ie_setup (struct uwb_rc *)
 
void uwb_rc_ie_release (struct uwb_rc *)
 
int uwb_ie_dump_hex (const struct uwb_ie_hdr *ies, size_t len, char *buf, size_t size)
 
int uwb_rc_set_ie (struct uwb_rc *, struct uwb_rc_cmd_set_ie *)
 
const charuwb_rc_strerror (unsigned code)
 
int uwb_rc_cmd_async (struct uwb_rc *rc, const char *cmd_name, struct uwb_rccb *cmd, size_t cmd_size, u8 expected_type, u16 expected_event, uwb_rc_cmd_cb_f cb, void *arg)
 
void uwb_rc_neh_create (struct uwb_rc *rc)
 
void uwb_rc_neh_destroy (struct uwb_rc *rc)
 
struct uwb_rc_nehuwb_rc_neh_add (struct uwb_rc *rc, struct uwb_rccb *cmd, u8 expected_type, u16 expected_event, uwb_rc_cmd_cb_f cb, void *arg)
 
void uwb_rc_neh_rm (struct uwb_rc *rc, struct uwb_rc_neh *neh)
 
void uwb_rc_neh_arm (struct uwb_rc *rc, struct uwb_rc_neh *neh)
 
void uwb_rc_neh_put (struct uwb_rc_neh *neh)
 
int uwb_est_create (void)
 
void uwb_est_destroy (void)
 
int uwb_rsv_find_best_allocation (struct uwb_rsv *rsv, struct uwb_mas_bm *available, struct uwb_mas_bm *result)
 
void uwb_rsv_handle_drp_avail_change (struct uwb_rc *rc)
 
void uwbd_start (struct uwb_rc *rc)
 
void uwbd_stop (struct uwb_rc *rc)
 
struct uwb_eventuwb_event_alloc (size_t, gfp_t gfp_mask)
 
void uwbd_event_queue (struct uwb_event *)
 
void uwbd_flush (struct uwb_rc *rc)
 
int uwbd_evt_handle_rc_ie_rcv (struct uwb_event *)
 
int uwbd_evt_handle_rc_beacon (struct uwb_event *)
 
int uwbd_evt_handle_rc_beacon_size (struct uwb_event *)
 
int uwbd_evt_handle_rc_bpoie_change (struct uwb_event *)
 
int uwbd_evt_handle_rc_bp_slot_change (struct uwb_event *)
 
int uwbd_evt_handle_rc_drp (struct uwb_event *)
 
int uwbd_evt_handle_rc_drp_avail (struct uwb_event *)
 
int uwbd_msg_handle_reset (struct uwb_event *evt)
 
int uwb_rc_dev_addr_assign (struct uwb_rc *rc)
 
int uwbd_evt_handle_rc_dev_addr_conflict (struct uwb_event *evt)
 
ssize_t uwb_bce_print_IEs (struct uwb_dev *, struct uwb_beca_e *, char *, size_t)
 
void uwb_bce_kfree (struct kref *_bce)
 
void uwb_beca_purge (struct uwb_rc *rc)
 
void uwb_beca_release (struct uwb_rc *rc)
 
struct uwb_devuwb_dev_get_by_devaddr (struct uwb_rc *rc, const struct uwb_dev_addr *devaddr)
 
struct uwb_devuwb_dev_get_by_macaddr (struct uwb_rc *rc, const struct uwb_mac_addr *macaddr)
 
int uwb_radio_setup (struct uwb_rc *rc)
 
void uwb_radio_reset_state (struct uwb_rc *rc)
 
void uwb_radio_shutdown (struct uwb_rc *rc)
 
int uwb_radio_force_channel (struct uwb_rc *rc, int channel)
 
void uwb_rsv_init (struct uwb_rc *rc)
 
int uwb_rsv_setup (struct uwb_rc *rc)
 
void uwb_rsv_cleanup (struct uwb_rc *rc)
 
void uwb_rsv_remove_all (struct uwb_rc *rc)
 
void uwb_rsv_get (struct uwb_rsv *rsv)
 
void uwb_rsv_put (struct uwb_rsv *rsv)
 
bool uwb_rsv_has_two_drp_ies (struct uwb_rsv *rsv)
 
void uwb_rsv_dump (char *text, struct uwb_rsv *rsv)
 
int uwb_rsv_try_move (struct uwb_rsv *rsv, struct uwb_mas_bm *available)
 
void uwb_rsv_backoff_win_timer (unsigned long arg)
 
void uwb_rsv_backoff_win_increment (struct uwb_rc *rc)
 
int uwb_rsv_status (struct uwb_rsv *rsv)
 
int uwb_rsv_companion_status (struct uwb_rsv *rsv)
 
void uwb_rsv_set_state (struct uwb_rsv *rsv, enum uwb_rsv_state new_state)
 
void uwb_rsv_remove (struct uwb_rsv *rsv)
 
struct uwb_rsvuwb_rsv_find (struct uwb_rc *rc, struct uwb_dev *src, struct uwb_ie_drp *drp_ie)
 
void uwb_rsv_sched_update (struct uwb_rc *rc)
 
void uwb_rsv_queue_update (struct uwb_rc *rc)
 
int uwb_drp_ie_update (struct uwb_rsv *rsv)
 
void uwb_drp_ie_to_bm (struct uwb_mas_bm *bm, const struct uwb_ie_drp *drp_ie)
 
void uwb_drp_avail_init (struct uwb_rc *rc)
 
void uwb_drp_available (struct uwb_rc *rc, struct uwb_mas_bm *avail)
 
int uwb_drp_avail_reserve_pending (struct uwb_rc *rc, struct uwb_mas_bm *mas)
 
void uwb_drp_avail_reserve (struct uwb_rc *rc, struct uwb_mas_bm *mas)
 
void uwb_drp_avail_release (struct uwb_rc *rc, struct uwb_mas_bm *mas)
 
void uwb_drp_avail_ie_update (struct uwb_rc *rc)
 
void uwb_rc_pal_init (struct uwb_rc *rc)
 
ssize_t uwb_mac_frame_hdr_print (char *, size_t, const struct uwb_mac_frame_hdr *)
 
void uwb_dbg_init (void)
 
void uwb_dbg_exit (void)
 
void uwb_dbg_add_rc (struct uwb_rc *rc)
 
void uwb_dbg_del_rc (struct uwb_rc *rc)
 
struct dentryuwb_dbg_create_pal_dir (struct uwb_pal *pal)
 

Variables

unsigned long beacon_timeout_ms
 
struct class uwb_rc_class
 
struct device_attribute dev_attr_mac_address
 
struct device_attribute dev_attr_beacon
 
struct device_attribute dev_attr_scan
 

Macro Definition Documentation

#define UWB_RC_CMD_TIMEOUT_MS   1000 /* ms */

Definition at line 86 of file uwb-internal.h.

Enumeration Type Documentation

enum uwb_event_message - an event for a message for asynchronous processing

UWB_EVT_MSG_RESET - reset the radio controller and all PAL hardware.

Enumerator:
UWB_EVT_MSG_RESET 

Definition at line 209 of file uwb-internal.h.

enum uwb_event_type - types of UWB management daemon events

The UWB management daemon (uwbd) can receive two types of events: UWB_EVT_TYPE_NOTIF - notification from the radio controller. UWB_EVT_TYPE_MSG - a simple message.

Enumerator:
UWB_EVT_TYPE_NOTIF 
UWB_EVT_TYPE_MSG 

Definition at line 188 of file uwb-internal.h.

Enumerator:
UWB_RSV_MAS_NOT_AVAIL 
UWB_RSV_MAS_SAFE 
UWB_RSV_MAS_UNSAFE 

Definition at line 130 of file uwb-internal.h.

Enumerator:
UWB_RSV_ALLOC_FOUND 
UWB_RSV_ALLOC_NOT_FOUND 

Definition at line 125 of file uwb-internal.h.

Function Documentation

int __uwb_dev_offair ( struct uwb_dev uwb_dev,
struct uwb_rc rc 
)

Remove a device from the system [grunt for other functions]

Definition at line 369 of file lc-dev.c.

struct uwb_rc* __uwb_rc_try_get ( struct uwb_rc target_rc)
read

Given a radio controller descriptor, validate and refcount it

Returns
NULL if the rc does not exist or is quiescing; the ptr to it otherwise.

Definition at line 361 of file lc-rc.c.

void uwb_bce_kfree ( struct kref _bce)

Definition at line 161 of file beacon.c.

ssize_t uwb_bce_print_IEs ( struct uwb_dev ,
struct uwb_beca_e ,
char ,
size_t   
)

Definition at line 330 of file beacon.c.

void uwb_beca_purge ( struct uwb_rc rc)

Definition at line 283 of file beacon.c.

void uwb_beca_release ( struct uwb_rc rc)

Definition at line 299 of file beacon.c.

void uwb_dbg_add_rc ( struct uwb_rc rc)

uwb_dbg_add_rc - add a debug interface for a radio controller : the radio controller

Definition at line 313 of file uwb-debug.c.

struct dentry* uwb_dbg_create_pal_dir ( struct uwb_pal pal)
read

uwb_dbg_create_pal_dir - create a debugfs directory for a PAL : The PAL.

Definition at line 392 of file uwb-debug.c.

void uwb_dbg_del_rc ( struct uwb_rc rc)

uwb_dbg_del_rc - remove a radio controller's debug interface : the radio controller

Definition at line 350 of file uwb-debug.c.

void uwb_dbg_exit ( void  )

uwb_dbg_exit - clean-up the debug interface sub-module

Definition at line 383 of file uwb-debug.c.

void uwb_dbg_init ( void  )

uwb_dbg_exit - initialize the debug interface sub-module

Definition at line 375 of file uwb-debug.c.

int uwb_dev_add ( struct uwb_dev uwb_dev,
struct device parent_dev,
struct uwb_rc parent_rc 
)

Register and initialize a new UWB device

Did you call uwb_dev_init() on it?

: is the parent radio controller who has the link to the device. When registering the UWB device that is a UWB Radio Controller, we point back to it.

If registering the device that is part of a radio, caller has set rc->uwb_dev->dev. Otherwise it is to be left NULL–a new one will be allocated.

Definition at line 307 of file lc-dev.c.

struct uwb_dev* uwb_dev_get_by_devaddr ( struct uwb_rc rc,
const struct uwb_dev_addr devaddr 
)
read

uwb_dev_get_by_devaddr - get a UWB device with a specific DevAddr : the radio controller that saw the device : DevAddr of the UWB device to find

There may be more than one matching device (in the case of a DevAddr conflict), but only the first one is returned.

Definition at line 209 of file beacon.c.

struct uwb_dev* uwb_dev_get_by_macaddr ( struct uwb_rc rc,
const struct uwb_mac_addr macaddr 
)
read

uwb_dev_get_by_macaddr - get a UWB device with a specific EUI-48 : the radio controller that saw the device : EUI-48 of the UWB device to find

Definition at line 229 of file beacon.c.

void uwb_dev_init ( struct uwb_dev uwb_dev)

Definition at line 115 of file lc-dev.c.

void uwb_dev_rm ( struct uwb_dev uwb_dev)

Definition at line 329 of file lc-dev.c.

void uwb_drp_avail_ie_update ( struct uwb_rc rc)

uwb_drp_avail_ie_update - update the DRP Availability IE : the radio controller

avail = global & local

Definition at line 117 of file drp-avail.c.

void uwb_drp_avail_init ( struct uwb_rc rc)

uwb_drp_avail_init - initialize an RC's MAS availability

All MAS are available initially. The RC will inform use which slots are used for the BP (it may change in size).

Definition at line 49 of file drp-avail.c.

void uwb_drp_avail_release ( struct uwb_rc rc,
struct uwb_mas_bm mas 
)

uwb_drp_avail_release - release MAS from a pending or established reservation : the radio controller : the MAS to release

Definition at line 103 of file drp-avail.c.

void uwb_drp_avail_reserve ( struct uwb_rc rc,
struct uwb_mas_bm mas 
)

uwb_drp_avail_reserve - reserve MAS for an established reservation : the radio controller : the MAS to reserve

Definition at line 91 of file drp-avail.c.

int uwb_drp_avail_reserve_pending ( struct uwb_rc rc,
struct uwb_mas_bm mas 
)

uwb_drp_avail_reserve_pending - reserve MAS for a new reservation : the radio controller : the MAS to reserve

Returns 0 on success, or -EBUSY if the MAS requested aren't available.

Definition at line 74 of file drp-avail.c.

void uwb_drp_available ( struct uwb_rc rc,
struct uwb_mas_bm avail 
)

Definition at line 61 of file drp-avail.c.

void uwb_drp_ie_to_bm ( struct uwb_mas_bm bm,
const struct uwb_ie_drp drp_ie 
)

uwb_drp_ie_zones_to_bm - convert DRP allocation fields to a bitmap : MAS bitmap that will be populated to correspond to the allocation fields in the DRP IE : the DRP IE that contains the allocation fields.

The input format is an array of MAS allocation fields (16 bit Zone bitmap, 16 bit MAS bitmap) as described in [ECMA-368] section 16.8.6. The output is a full 256 bit MAS bitmap.

We go over all the allocation fields, for each allocation field we know which zones are impacted. We iterate over all the zones impacted and call a function that will set the correct MAS bits in each zone.

Definition at line 296 of file drp-ie.c.

int uwb_drp_ie_update ( struct uwb_rsv rsv)

uwb_drp_ie_update - update a reservation's DRP IE : the reservation

Definition at line 191 of file drp-ie.c.

int uwb_est_create ( void  )

Initialize the EST subsystem

Register the standard tables also.

FIXME: tag init

Definition at line 181 of file est.c.

void uwb_est_destroy ( void  )

Clean it up

Definition at line 203 of file est.c.

struct uwb_event* uwb_event_alloc ( size_t  ,
gfp_t  gfp_mask 
)
read
int uwb_ie_dump_hex ( const struct uwb_ie_hdr ies,
size_t  len,
char buf,
size_t  size 
)

uwb_ie_dump_hex - print IEs to a character buffer : the IEs to print. : length of all the IEs. : the destination buffer. : size of .

Returns the number of characters written.

Definition at line 72 of file ie.c.

ssize_t uwb_mac_frame_hdr_print ( char ,
size_t  ,
const struct uwb_mac_frame_hdr  
)
void uwb_notify ( struct uwb_rc rc,
struct uwb_dev uwb_dev,
enum uwb_notifs  event 
)

Definition at line 85 of file lc-dev.c.

int uwb_radio_force_channel ( struct uwb_rc rc,
int  channel 
)

Definition at line 141 of file radio.c.

void uwb_radio_reset_state ( struct uwb_rc rc)

Definition at line 173 of file radio.c.

int uwb_radio_setup ( struct uwb_rc rc)

Definition at line 161 of file radio.c.

void uwb_radio_shutdown ( struct uwb_rc rc)

Definition at line 199 of file radio.c.

int uwb_rc_beacon ( struct uwb_rc rc,
int  channel,
unsigned  bpst_offset 
)

Definition at line 115 of file beacon.c.

int uwb_rc_cmd_async ( struct uwb_rc rc,
const char cmd_name,
struct uwb_rccb cmd,
size_t  cmd_size,
u8  expected_type,
u16  expected_event,
uwb_rc_cmd_cb_f  cb,
void arg 
)

Definition at line 71 of file reset.c.

int uwb_rc_dev_addr_assign ( struct uwb_rc rc)

uwb_dev_addr_assign - assigned a generated DevAddr to a radio controller : the (local) radio controller device requiring a new DevAddr

A new DevAddr is required when:

  • first setting up a radio controller
  • if the hardware reports a DevAddr conflict

The DevAddr is randomly generated in the generated DevAddr range [0x100, 0xfeff]. The number of devices in a beacon group is limited by mMaxBPLength (96) so this address space will never be exhausted.

[ECMA-368] 17.1.1, 17.16.

Definition at line 277 of file address.c.

void uwb_rc_ie_init ( struct uwb_rc )

Definition at line 184 of file ie.c.

void uwb_rc_ie_release ( struct uwb_rc )

Definition at line 223 of file ie.c.

int uwb_rc_ie_setup ( struct uwb_rc uwb_rc)

uwb_rc_ie_setup - setup a radio controller's IE manager : the radio controller.

The current set of IEs are obtained from the hardware with a GET-IE command (since the radio controller is not yet beaconing this will be just the hardware's MAC and PHY Capability IEs).

Returns 0 on success; -ve on an error.

Definition at line 200 of file ie.c.

struct uwb_rc_neh* uwb_rc_neh_add ( struct uwb_rc rc,
struct uwb_rccb cmd,
u8  expected_type,
u16  expected_event,
uwb_rc_cmd_cb_f  cb,
void arg 
)
read

uwb_rc_neh_add - add a neh for a radio controller command : the radio controller : the radio controller command : the type of the expected response event : the expected event ID : callback for when the event is received

  • : argument for the callback

Creates a neh and adds it to the list of those waiting for an event. A context ID will be assigned to the command.

Definition at line 209 of file neh.c.

void uwb_rc_neh_arm ( struct uwb_rc rc,
struct uwb_rc_neh neh 
)

uwb_rc_neh_arm - arm an event handler timeout timer

: UWB Radio Controller : Notification/event handler for

The timer is only armed if the neh is active.

Definition at line 290 of file neh.c.

void uwb_rc_neh_create ( struct uwb_rc rc)

Initializes the 's neh subsystem

Definition at line 593 of file neh.c.

void uwb_rc_neh_destroy ( struct uwb_rc rc)

Release's the 's neh subsystem

Definition at line 604 of file neh.c.

void uwb_rc_neh_put ( struct uwb_rc_neh neh)

uwb_rc_neh_put - release reference to a neh : the neh

Definition at line 136 of file neh.c.

void uwb_rc_neh_rm ( struct uwb_rc rc,
struct uwb_rc_neh neh 
)

uwb_rc_neh_rm - remove a neh. : the radio controller : the neh to remove

Remove an active neh immediately instead of waiting for the event (or a time out).

Definition at line 270 of file neh.c.

void uwb_rc_pal_init ( struct uwb_rc rc)

uwb_rc_pal_init - initialize the PAL related parts of a radio controller : the radio controller

Definition at line 96 of file pal.c.

int uwb_rc_reset ( struct uwb_rc rc)

Reset a UWB Host Controller (and all radio settings)

: Host Controller descriptor

Returns
: 0 if ok, < 0 errno code on error

We put the command on kmalloc'ed memory as some arches cannot do USB from the stack. The reply event is copied from an stage buffer, so it can be in the stack. See WUSB1.0[8.6.2.4] for more details.

Definition at line 290 of file reset.c.

int uwb_rc_scan ( struct uwb_rc rc,
unsigned  channel,
enum uwb_scan_type  type,
unsigned  bpst_offset 
)

Start/stop scanning in a radio controller

: UWB Radio Controller : Channel to scan; encodings in WUSB1.0[Table 5.12] : Type of scanning to do. : value at which to start scanning (if type == UWB_SCAN_ONLY_STARTTIME)

Returns
: 0 if ok, < 0 errno code on error

We put the command on kmalloc'ed memory as some arches cannot do USB from the stack. The reply event is copied from an stage buffer, so it can be in the stack. See WUSB1.0[8.6.2.4] for more details.

Definition at line 57 of file scan.c.

int uwb_rc_send_all_drp_ie ( struct uwb_rc rc)

Construct and send the SET DRP IE

: UWB Host controller

Returns
: >= 0 number of bytes still available in the beacon < 0 errno code on error.

See WUSB[8.6.2.7]: The host must set all the DRP IEs that it wants the device to include in its beacon at the same time. We thus have to traverse all reservations and include the DRP IEs of all PENDING and NEGOTIATED reservations in a SET DRP command for transmission.

A DRP Availability IE is appended.

rc->rsvs_mutex is held

FIXME We currently ignore the returned value indicating the remaining space in beacon. This could be used to deny reservation requests earlier if determined that they would cause the beacon space to be exceeded.

Definition at line 100 of file drp.c.

int uwb_rc_set_ie ( struct uwb_rc rc,
struct uwb_rc_cmd_set_ie cmd 
)

Replace all IEs currently being transmitted by a device

: pointer to the SET-IE command with the IEs to set : size of

Definition at line 155 of file ie.c.

const char* uwb_rc_strerror ( unsigned  code)

Return a string matching the given error code

Definition at line 62 of file reset.c.

void uwb_rsv_backoff_win_increment ( struct uwb_rc rc)

Definition at line 220 of file rsv.c.

void uwb_rsv_backoff_win_timer ( unsigned long  arg)

Definition at line 199 of file rsv.c.

void uwb_rsv_cleanup ( struct uwb_rc rc)

Definition at line 996 of file rsv.c.

int uwb_rsv_companion_status ( struct uwb_rsv rsv)

Definition at line 103 of file drp-ie.c.

void uwb_rsv_dump ( char text,
struct uwb_rsv rsv 
)

Definition at line 106 of file rsv.c.

struct uwb_rsv* uwb_rsv_find ( struct uwb_rc rc,
struct uwb_dev src,
struct uwb_ie_drp drp_ie 
)
read

uwb_rsv_find - find a reservation for a received DRP IE. : the radio controller : source of the DRP IE : the DRP IE

If the reservation cannot be found and the DRP IE is from a peer attempting to establish a new reservation, create a new reservation and add it to the list.

Definition at line 806 of file rsv.c.

int uwb_rsv_find_best_allocation ( struct uwb_rsv rsv,
struct uwb_mas_bm available,
struct uwb_mas_bm result 
)

Definition at line 321 of file allocator.c.

void uwb_rsv_get ( struct uwb_rsv rsv)

Definition at line 130 of file rsv.c.

void uwb_rsv_handle_drp_avail_change ( struct uwb_rc rc)

Definition at line 638 of file rsv.c.

bool uwb_rsv_has_two_drp_ies ( struct uwb_rsv rsv)

Definition at line 57 of file rsv.c.

void uwb_rsv_init ( struct uwb_rc rc)

Definition at line 966 of file rsv.c.

void uwb_rsv_put ( struct uwb_rsv rsv)

Definition at line 135 of file rsv.c.

void uwb_rsv_queue_update ( struct uwb_rc rc)

Definition at line 844 of file rsv.c.

void uwb_rsv_remove ( struct uwb_rsv rsv)

Definition at line 504 of file rsv.c.

void uwb_rsv_remove_all ( struct uwb_rc rc)

uwb_rsv_remove_all - remove all reservations : the radio controller

A DRP IE update is not done.

Definition at line 942 of file rsv.c.

void uwb_rsv_sched_update ( struct uwb_rc rc)

uwb_rsv_sched_update - schedule an update of the DRP IEs : the radio controller.

To improve performance and ensure correctness with [ECMA-368] the number of SET-DRP-IE commands that are done are limited.

DRP IEs update come from two sources: DRP events from the hardware which all occur at the beginning of the superframe ('syncronous' events) and reservation establishment/termination requests from PALs or timers ('asynchronous' events).

A delayed work ensures that all the synchronous events result in one SET-DRP-IE command.

Additional logic (the set_drp_ie_pending and rsv_updated_postponed flags) will prevent an asynchrous event starting a SET-DRP-IE command if one is currently awaiting a response.

FIXME: this does leave a window where an asynchrous event can delay the SET-DRP-IE for a synchronous event by one superframe.

Definition at line 873 of file rsv.c.

void uwb_rsv_set_state ( struct uwb_rsv rsv,
enum uwb_rsv_state  new_state 
)

Definition at line 296 of file rsv.c.

int uwb_rsv_setup ( struct uwb_rc rc)

Definition at line 984 of file rsv.c.

int uwb_rsv_status ( struct uwb_rsv rsv)

Definition at line 74 of file drp-ie.c.

int uwb_rsv_try_move ( struct uwb_rsv rsv,
struct uwb_mas_bm available 
)

Definition at line 607 of file rsv.c.

void uwbd_dev_offair ( struct uwb_beca_e bce)

A device went off the air, clean up after it!

This is called by the UWB Daemon (through the beacon purge function uwb_bcn_cache_purge) when it is detected that a device has been in radio silence for a while.

If this device is actually a local radio controller we don't need to go through the offair process, as it is not registered as that.

NOTE: uwb_bcn_cache.mutex is held!

Definition at line 401 of file lc-dev.c.

void uwbd_dev_onair ( struct uwb_rc rc,
struct uwb_beca_e bce 
)

A device went on the air, start it up!

This is called by the UWB Daemon when it is detected that a device has popped up in the radio range of the radio controller.

It will just create the freaking device, register the beacon and stuff and yatla, done.

NOTE: uwb_beca.mutex is held, bce->mutex is held

Definition at line 425 of file lc-dev.c.

void uwbd_event_queue ( struct uwb_event )

Definition at line 333 of file uwbd.c.

int uwbd_evt_handle_rc_beacon ( struct uwb_event )

Definition at line 390 of file beacon.c.

int uwbd_evt_handle_rc_beacon_size ( struct uwb_event )

Definition at line 469 of file beacon.c.

int uwbd_evt_handle_rc_bp_slot_change ( struct uwb_event evt)

uwbd_evt_handle_rc_bp_slot_change - handle a BP_SLOT_CHANGE event : the BP_SLOT_CHANGE notification from the radio controller

If the event indicates that no beacon period slots were available then radio controller has transitioned to a non-beaconing state. Otherwise, simply save the current beacon slot.

Definition at line 506 of file beacon.c.

int uwbd_evt_handle_rc_bpoie_change ( struct uwb_event )

Definition at line 540 of file beacon.c.

int uwbd_evt_handle_rc_dev_addr_conflict ( struct uwb_event evt)

uwbd_evt_handle_rc_dev_addr_conflict - handle a DEV_ADDR_CONFLICT event : the DEV_ADDR_CONFLICT notification from the radio controller

A new (non-conflicting) DevAddr is assigned to the radio controller.

[ECMA-368] 17.1.1.1.

Definition at line 297 of file address.c.

int uwbd_evt_handle_rc_drp ( struct uwb_event evt)

uwbd_evt_handle_rc_drp - handle a DRP_IE event : the DRP_IE event from the radio controller

This processes DRP notifications from the radio controller, either initiating a new reservation or transitioning an existing reservation into a different state.

DRP notifications can occur for three different reasons:

  • UWB_DRP_NOTIF_DRP_IE_RECVD: one or more DRP IEs with the RC as the target or source have been received.

    These DRP IEs could be new or for an existing reservation.

    If the DRP IE for an existing reservation ceases to be to received for at least mMaxLostBeacons, the reservation should be considered to be terminated. Note that the TERMINATE reason (see below) may not always be signalled (e.g., the remote device has two or more reservations established with the RC).

  • UWB_DRP_NOTIF_CONFLICT: DRP IEs from any device in the beacon group conflict with the RC's reservations.
  • UWB_DRP_NOTIF_TERMINATE: DRP IEs are no longer being received from a device (i.e., it's terminated all reservations).

Only the software state of the reservations is changed; the setting of the radio controller's DRP IEs is done after all the events in an event buffer are processed. This saves waiting multiple times for the SET_DRP_IE command to complete.

Definition at line 765 of file drp.c.

int uwbd_evt_handle_rc_drp_avail ( struct uwb_event evt)

Process an incoming DRP Availability notification.

: Event information (packs the actual event data, which radio controller it came to, etc).

Returns
: 0 on success (so uwbd() frees the event buffer), < 0 on error.

According to ECMA-368 1.0 [16.8.7], bits set to ONE indicate that the MAS slot is available, bits set to ZERO indicate that the slot is busy.

So we clear available slots, we set used slots :)

The notification only marks non-availability based on the BP and received DRP IEs that are not for this radio controller. A copy of this bitmap is needed to generate the real availability (which includes local and pending reservations).

The DRP Availability IE that this radio controller emits will need to be updated.

Definition at line 271 of file drp-avail.c.

int uwbd_evt_handle_rc_ie_rcv ( struct uwb_event )

Definition at line 29 of file ie-rcv.c.

void uwbd_flush ( struct uwb_rc rc)

Definition at line 352 of file uwbd.c.

int uwbd_msg_handle_reset ( struct uwb_event evt)

Definition at line 322 of file reset.c.

void uwbd_start ( struct uwb_rc rc)

Start the UWB daemon

Definition at line 304 of file uwbd.c.

void uwbd_stop ( struct uwb_rc rc)

Definition at line 315 of file uwbd.c.

Variable Documentation

unsigned long beacon_timeout_ms

If a beacon disappears for longer than this, then we consider the device who was represented by that beacon to be gone.

ECMA-368[17.2.3, last para] establishes that a device must not consider a device to be its neighbour if he doesn't receive a beacon for more than mMaxLostBeacons. mMaxLostBeacons is defined in ECMA-368[17.16] as 3; because we can get only one beacon per superframe, that'd be 3 * 65ms = 195 ~ 200 ms. Let's give it time for jitter and stuff and make it 500 ms.

Definition at line 74 of file driver.c.

struct device_attribute dev_attr_beacon
struct device_attribute dev_attr_mac_address
struct device_attribute dev_attr_scan
struct class uwb_rc_class

Device model classes

Definition at line 105 of file driver.c.