Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Enumerations | Functions
uwb.h File Reference
#include <linux/limits.h>
#include <linux/device.h>
#include <linux/mutex.h>
#include <linux/timer.h>
#include <linux/wait.h>
#include <linux/workqueue.h>
#include <linux/uwb/spec.h>
#include <asm/page.h>

Go to the source code of this file.

Data Structures

struct  uwb_dev
 
struct  uwb_notifs_chain
 
struct  uwb_beca
 
struct  uwbd
 
struct  uwb_mas_bm
 
struct  uwb_rsv_target
 
struct  uwb_rsv_move
 
struct  uwb_rsv
 
struct  uwb_drp_avail
 
struct  uwb_drp_backoff_win
 
struct  uwb_rc
 
struct  uwb_pal
 
struct  uwb_notifs_handler
 
struct  uwb_est_entry
 
struct  edc
 
struct  stats
 

Macros

#define to_uwb_dev(d)   container_of(d, struct uwb_dev, dev)
 
#define UWB_NUM_GLOBAL_STREAMS   1
 

Typedefs

typedef void(* uwb_rsv_cb_f )(struct uwb_rsv *rsv)
 

Enumerations

enum  { UWB_RC_CTX_MAX = 256 }
 
enum  uwb_rsv_state {
  UWB_RSV_STATE_NONE = 0, UWB_RSV_STATE_O_INITIATED, UWB_RSV_STATE_O_PENDING, UWB_RSV_STATE_O_MODIFIED,
  UWB_RSV_STATE_O_ESTABLISHED, UWB_RSV_STATE_O_TO_BE_MOVED, UWB_RSV_STATE_O_MOVE_EXPANDING, UWB_RSV_STATE_O_MOVE_COMBINING,
  UWB_RSV_STATE_O_MOVE_REDUCING, UWB_RSV_STATE_T_ACCEPTED, UWB_RSV_STATE_T_DENIED, UWB_RSV_STATE_T_CONFLICT,
  UWB_RSV_STATE_T_PENDING, UWB_RSV_STATE_T_EXPANDING_ACCEPTED, UWB_RSV_STATE_T_EXPANDING_CONFLICT, UWB_RSV_STATE_T_EXPANDING_PENDING,
  UWB_RSV_STATE_T_EXPANDING_DENIED, UWB_RSV_STATE_T_RESIZED, UWB_RSV_STATE_LAST
}
 
enum  uwb_rsv_target_type { UWB_RSV_TARGET_DEV, UWB_RSV_TARGET_DEVADDR }
 

Functions

const charuwb_rsv_state_str (enum uwb_rsv_state state)
 
const charuwb_rsv_type_str (enum uwb_drp_type type)
 
struct uwb_rsvuwb_rsv_create (struct uwb_rc *rc, uwb_rsv_cb_f cb, void *pal_priv)
 
void uwb_rsv_destroy (struct uwb_rsv *rsv)
 
int uwb_rsv_establish (struct uwb_rsv *rsv)
 
int uwb_rsv_modify (struct uwb_rsv *rsv, int max_mas, int min_mas, int sparsity)
 
void uwb_rsv_terminate (struct uwb_rsv *rsv)
 
void uwb_rsv_accept (struct uwb_rsv *rsv, uwb_rsv_cb_f cb, void *pal_priv)
 
void uwb_rsv_get_usable_mas (struct uwb_rsv *orig_rsv, struct uwb_mas_bm *mas)
 

: descriptive name for this PAL (wusbhc, wlp, etc.).

struct uwb_pal - a UWB PAL

: a device for the PAL. Used to link the PAL and the radio controller in sysfs. : the radio controller the PAL uses. : called when the channel used by the radio changes. A channel of -1 means the channel has been stopped. : called when a peer requests a reservation (may be NULL if the PAL cannot accept reservation requests). : channel being used by the PAL; 0 if the PAL isn't using the radio; -1 if the PAL wishes to use the radio but cannot. : a debugfs directory which the PAL can use for its own debugfs files.

A Protocol Adaptation Layer (PAL) is a user of the WiMedia UWB radio platform (e.g., WUSB, WLP or Bluetooth UWB AMP).

The PALs using a radio controller must register themselves to permit the UWB stack to coordinate usage of the radio between the various PALs or to allow PALs to response to certain requests from peers.

A struct uwb_pal should be embedded in a containing structure belonging to the PAL and initialized with uwb_pal_init()). Fields should be set appropriately by the PAL before registering the PAL with uwb_pal_register().

enum  uwb_notifs { UWB_NOTIF_ONAIR, UWB_NOTIF_OFFAIR }
 
enum  { EDC_MAX_ERRORS = 10, EDC_ERROR_TIMEFRAME = HZ }
 
typedef int(* uwb_dev_for_each_f )(struct device *dev, void *priv)
 
typedef void(* uwb_rc_cmd_cb_f )(struct uwb_rc *rc, void *arg, struct uwb_rceb *reply, ssize_t reply_size)
 
void uwb_pal_init (struct uwb_pal *pal)
 
int uwb_pal_register (struct uwb_pal *pal)
 
void uwb_pal_unregister (struct uwb_pal *pal)
 
int uwb_radio_start (struct uwb_pal *pal)
 
void uwb_radio_stop (struct uwb_pal *pal)
 
struct uwb_devuwb_dev_get_by_devaddr (struct uwb_rc *rc, const struct uwb_dev_addr *devaddr)
 
struct uwb_devuwb_dev_get_by_rc (struct uwb_dev *, struct uwb_rc *)
 
struct uwb_devuwb_dev_try_get (struct uwb_rc *rc, struct uwb_dev *uwb_dev)
 
int uwb_dev_for_each (struct uwb_rc *rc, uwb_dev_for_each_f func, void *priv)
 
struct uwb_rcuwb_rc_alloc (void)
 
struct uwb_rcuwb_rc_get_by_dev (const struct uwb_dev_addr *)
 
struct uwb_rcuwb_rc_get_by_grandpa (const struct device *)
 
void uwb_rc_put (struct uwb_rc *rc)
 
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)
 
ssize_t uwb_rc_cmd (struct uwb_rc *rc, const char *cmd_name, struct uwb_rccb *cmd, size_t cmd_size, struct uwb_rceb *reply, size_t reply_size)
 
ssize_t uwb_rc_vcmd (struct uwb_rc *rc, const char *cmd_name, struct uwb_rccb *cmd, size_t cmd_size, u8 expected_type, u16 expected_event, struct uwb_rceb **preply)
 
size_t __uwb_addr_print (char *, size_t, const unsigned char *, int)
 
int uwb_rc_dev_addr_set (struct uwb_rc *, const struct uwb_dev_addr *)
 
int uwb_rc_dev_addr_get (struct uwb_rc *, struct uwb_dev_addr *)
 
int uwb_rc_mac_addr_set (struct uwb_rc *, const struct uwb_mac_addr *)
 
int uwb_rc_mac_addr_get (struct uwb_rc *, struct uwb_mac_addr *)
 
int __uwb_mac_addr_assigned_check (struct device *, void *)
 
int __uwb_dev_addr_assigned_check (struct device *, void *)
 
void uwb_rc_init (struct uwb_rc *)
 
int uwb_rc_add (struct uwb_rc *, struct device *dev, void *rc_priv)
 
void uwb_rc_rm (struct uwb_rc *)
 
void uwb_rc_neh_grok (struct uwb_rc *, void *, size_t)
 
void uwb_rc_neh_error (struct uwb_rc *, int)
 
void uwb_rc_reset_all (struct uwb_rc *rc)
 
void uwb_rc_pre_reset (struct uwb_rc *rc)
 
int uwb_rc_post_reset (struct uwb_rc *rc)
 
int uwb_notifs_register (struct uwb_rc *, struct uwb_notifs_handler *)
 
int uwb_notifs_deregister (struct uwb_rc *, struct uwb_notifs_handler *)
 
int uwb_est_register (u8 type, u8 code_high, u16 vendor, u16 product, const struct uwb_est_entry *, size_t entries)
 
int uwb_est_unregister (u8 type, u8 code_high, u16 vendor, u16 product, const struct uwb_est_entry *, size_t entries)
 
ssize_t uwb_est_find_size (struct uwb_rc *rc, const struct uwb_rceb *rceb, size_t len)
 
struct uwb_ie_hdruwb_ie_next (void **ptr, size_t *len)
 
int uwb_rc_ie_add (struct uwb_rc *uwb_rc, const struct uwb_ie_hdr *ies, size_t size)
 
int uwb_rc_ie_rm (struct uwb_rc *uwb_rc, enum uwb_ie element_id)
 

Macro Definition Documentation

#define to_uwb_dev (   d)    container_of(d, struct uwb_dev, dev)

Definition at line 73 of file uwb.h.

#define UWB_NUM_GLOBAL_STREAMS   1

Definition at line 193 of file uwb.h.

Typedef Documentation

typedef int(* uwb_dev_for_each_f)(struct device *dev, void *priv)

Callback function for 'uwb_{dev,rc}_foreach()'.

: Linux device instance 'uwb_dev = container_of(dev, struct uwb_dev, dev)' : Data passed by the caller to 'uwb_{dev,rc}_foreach()'.

Returns
: 0 to continue the iterations, any other val to stop iterating and return the value to the caller of _foreach().

Definition at line 503 of file uwb.h.

typedef void(* uwb_rc_cmd_cb_f)(struct uwb_rc *rc, void *arg, struct uwb_rceb *reply, ssize_t reply_size)

Definition at line 511 of file uwb.h.

typedef void(* uwb_rsv_cb_f)(struct uwb_rsv *rsv)

Definition at line 195 of file uwb.h.

Enumeration Type Documentation

anonymous enum

UWB HWA/WHCI Radio Control {Command|Event} Block context IDs

RC[CE]Bs have a 'context ID' field that matches the command with the event received to confirm it.

Maximum number of context IDs

Enumerator:
UWB_RC_CTX_MAX 

Definition at line 83 of file uwb.h.

anonymous enum
Enumerator:
EDC_MAX_ERRORS 
EDC_ERROR_TIMEFRAME 

Definition at line 689 of file uwb.h.

enum uwb_notifs

enum uwb_notifs - UWB events that can be passed to any listeners : a new neighbour has joined the beacon group. : a neighbour has left the beacon group.

Higher layers can register callback functions with the radio controller using uwb_notifs_register(). The radio controller maintains a list of all registered handlers and will notify all nodes when an event occurs.

Enumerator:
UWB_NOTIF_ONAIR 
UWB_NOTIF_OFFAIR 

Definition at line 622 of file uwb.h.

uwb_rsv_state - UWB Reservation state.

NONE - reservation is not active (no DRP IE being transmitted).

Owner reservation states:

INITIATED - owner has sent an initial DRP request. PENDING - target responded with pending Reason Code. MODIFIED - reservation manager is modifying an established reservation with a different MAS allocation. ESTABLISHED - the reservation has been successfully negotiated.

Target reservation states:

DENIED - request is denied. ACCEPTED - request is accepted. PENDING - PAL has yet to make a decision to whether to accept or deny.

FIXME: further target states TBD.

Enumerator:
UWB_RSV_STATE_NONE 
UWB_RSV_STATE_O_INITIATED 
UWB_RSV_STATE_O_PENDING 
UWB_RSV_STATE_O_MODIFIED 
UWB_RSV_STATE_O_ESTABLISHED 
UWB_RSV_STATE_O_TO_BE_MOVED 
UWB_RSV_STATE_O_MOVE_EXPANDING 
UWB_RSV_STATE_O_MOVE_COMBINING 
UWB_RSV_STATE_O_MOVE_REDUCING 
UWB_RSV_STATE_T_ACCEPTED 
UWB_RSV_STATE_T_DENIED 
UWB_RSV_STATE_T_CONFLICT 
UWB_RSV_STATE_T_PENDING 
UWB_RSV_STATE_T_EXPANDING_ACCEPTED 
UWB_RSV_STATE_T_EXPANDING_CONFLICT 
UWB_RSV_STATE_T_EXPANDING_PENDING 
UWB_RSV_STATE_T_EXPANDING_DENIED 
UWB_RSV_STATE_T_RESIZED 
UWB_RSV_STATE_LAST 

Definition at line 141 of file uwb.h.

Enumerator:
UWB_RSV_TARGET_DEV 
UWB_RSV_TARGET_DEVADDR 

Definition at line 164 of file uwb.h.

Function Documentation

size_t __uwb_addr_print ( char buf,
size_t  buf_size,
const unsigned char addr,
int  type 
)

Print to ,

Returns
bytes written

Definition at line 361 of file address.c.

int __uwb_dev_addr_assigned_check ( struct device ,
void  
)

Definition at line 254 of file address.c.

int __uwb_mac_addr_assigned_check ( struct device ,
void  
)

Definition at line 243 of file address.c.

int uwb_dev_for_each ( struct uwb_rc rc,
uwb_dev_for_each_f  function,
void priv 
)

Iterate over the list of UWB devices, calling a on each

See docs for bus_for_each()....

: radio controller for the devices. : function to call. : data to pass to .

Returns
: 0 if no invocation of function() returned a value different to zero. That value otherwise.

Definition at line 476 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_rc ( struct uwb_dev ,
struct uwb_rc  
)
read
struct uwb_dev* uwb_dev_try_get ( struct uwb_rc rc,
struct uwb_dev uwb_dev 
)
read

Given a UWB device descriptor, validate and refcount it

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

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

ssize_t uwb_est_find_size ( struct uwb_rc rc,
const struct uwb_rceb rceb,
size_t  rceb_size 
)

Guesses the size of a WA event

: pointer to the buffer with the event : size of the area pointed to by in bytes.

Returns
: > 0 Size of the event -ENOSPC An area big enough was not provided to look ahead into the event's guts and guess the size. -EINVAL Unknown event code (wEvent).

This will look at the received RCEB and guess what is the total size by checking all the tables registered with uwb_est_register(). For variable sized events, it will look further ahead into their length field to see how much data should be read.

Note this size is not final–the neh (Notification/Event Handle) might specificy an extra size to add or replace.

Definition at line 430 of file est.c.

int uwb_est_register ( u8  type,
u8  event_high,
u16  vendor,
u16  product,
const struct uwb_est_entry entry,
size_t  entries 
)

Register an event size table

Makes room for it if the table is full, and then inserts it in the right position (entries are sorted by type, event_high, vendor and then product).

: vendor code for matching against the device (0x0000 and 0xffff mean any); use 0x0000 to force all to match without checking possible vendor specific ones, 0xfffff to match after checking vendor specific ones.

: product code from that vendor; same matching rules, use 0x0000 for not allowing vendor specific matches, 0xffff for allowing.

This arragement just makes the tables sort differenty. Because the table is sorted by growing type-event_high-vendor-product, a zero vendor will match before than a 0x456a vendor, that will match before a 0xfffff vendor.

Returns
0 if ok, < 0 errno on error (-ENOENT if not found).

Definition at line 256 of file est.c.

int uwb_est_unregister ( u8  type,
u8  event_high,
u16  vendor,
u16  product,
const struct uwb_est_entry entry,
size_t  entries 
)

Unregister an event size table

This just removes the specified entry and moves the ones after it to fill in the gap. This is needed to keep the list sorted; no reallocation is done to reduce the size of the table.

We unregister by all the data we used to register instead of by pointer to the array because we might have used the same table for a bunch of IDs (for example).

Returns
0 if ok, < 0 errno on error (-ENOENT if not found).

Definition at line 307 of file est.c.

struct uwb_ie_hdr* uwb_ie_next ( void **  ptr,
size_t len 
)
read

uwb_ie_next - get the next IE in a buffer : start of the buffer containing the IE data : length of the buffer

Both and are updated so subsequent calls to uwb_ie_next() will get the next IE.

NULL is returned (and and will not be updated) if there are no more IEs in the buffer or the buffer is too short.

Definition at line 42 of file ie.c.

int uwb_notifs_deregister ( struct uwb_rc ,
struct uwb_notifs_handler  
)

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

int uwb_notifs_register ( struct uwb_rc ,
struct uwb_notifs_handler  
)

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

void uwb_pal_init ( struct uwb_pal pal)

uwb_pal_init - initialize a UWB PAL : the PAL to initialize

Definition at line 29 of file pal.c.

int uwb_pal_register ( struct uwb_pal pal)

uwb_pal_register - register a UWB PAL : the PAL

The PAL must be initialized with uwb_pal_init().

Definition at line 41 of file pal.c.

void uwb_pal_unregister ( struct uwb_pal pal)

uwb_pal_register - unregister a UWB PAL : the PAL

Definition at line 73 of file pal.c.

int uwb_radio_start ( struct uwb_pal pal)

uwb_radio_start - request that the radio be started : the PAL making the request.

If the radio is not already active, aa suitable channel is selected and beacons are started.

Definition at line 95 of file radio.c.

void uwb_radio_stop ( struct uwb_pal pal)

uwb_radio_stop - request tha the radio be stopped. : the PAL making the request.

Stops the radio if no other PAL is making use of it.

Definition at line 119 of file radio.c.

int uwb_rc_add ( struct uwb_rc rc,
struct device parent_dev,
void priv 
)

Register a new UWB radio controller

Did you call uwb_rc_init() on your rc?

We assume that this is being called with a > 0 refcount on it [through ops->{get|put}_device(). We'll take our own, though.

is our real device, the one that provides the actual UWB device

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

struct uwb_rc* uwb_rc_alloc ( void  )
read

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

ssize_t uwb_rc_cmd ( struct uwb_rc rc,
const char cmd_name,
struct uwb_rccb cmd,
size_t  cmd_size,
struct uwb_rceb reply,
size_t  reply_size 
)

Generic function for issuing commands to the Radio Control Interface

: UWB Radio Control descriptor : Name of the command being issued (for error messages) : Pointer to rccb structure containing the command; normally you embed this structure as the first member of the full command structure. : Size of the whole command buffer pointed to by . : Pointer to the beginning of the confirmation event buffer. Normally bigger than an 'struct hwarc_rceb'. You need to fill out reply->bEventType and reply->wEvent (in cpu order) as the function will use them to verify the confirmation event. : Size of the reply buffer

The function checks that the length returned in the reply is at least as big as ; if not, it will be deemed an error and -EIO returned.

needs to be referenced

Definition at line 226 of file reset.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_get ( struct uwb_rc rc,
struct uwb_dev_addr addr 
)

Get 's device address to

Definition at line 211 of file address.c.

int uwb_rc_dev_addr_set ( struct uwb_rc rc,
const struct uwb_dev_addr addr 
)

Set 's address to

Definition at line 231 of file address.c.

struct uwb_rc* uwb_rc_get_by_dev ( const struct uwb_dev_addr )
read

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

struct uwb_rc* uwb_rc_get_by_grandpa ( const struct device grandpa_dev)
read

Locate and refcount a radio controller given a common grand-parent

Pointer to the 'grandparent' device structure.

Returns
NULL If the rc does not exist or is quiescing; the ptr to it otherwise, properly referenced.

The Radio Control interface (or the UWB Radio Controller) is always an interface of a device. The parent is the interface, the grandparent is the device that encapsulates the interface.

There is no need to lock around as the "grandpa" would be refcounted by the target, and to remove the referemes, the uwb_rc_class->sem would have to be taken–we hold it, ergo we should be safe.

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

int uwb_rc_ie_add ( struct uwb_rc uwb_rc,
const struct uwb_ie_hdr ies,
size_t  size 
)

uwb_rc_ie_add - add new IEs to the radio controller's beacon : the radio controller. : the buffer containing the new IE or IEs to be added to the device's beacon. : length of all the IEs.

According to WHCI 0.95 [4.13.6] the driver will only receive the RCEB after the device sent the first beacon that includes the IEs specified in the SET IE command. We thus cannot send this command if the device is not beaconing. Instead, a SET IE command will be sent later right after we start beaconing.

Setting an IE on the device will overwrite all current IEs in device. So we take the current IEs being transmitted by the device, insert the new one, and call SET IE with all the IEs needed.

Returns 0 on success; or -ENOMEM.

Definition at line 285 of file ie.c.

int uwb_rc_ie_rm ( struct uwb_rc uwb_rc,
enum uwb_ie  element_id 
)

uwb_rc_ie_rm - remove an IE from the radio controller's beacon : the radio controller. : the element ID of the IE to remove.

Only IEs previously added with uwb_rc_ie_add() may be removed.

Returns 0 on success; or -ve the SET-IE command to the radio controller failed.

Definition at line 365 of file ie.c.

void uwb_rc_init ( struct uwb_rc )

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

int uwb_rc_mac_addr_get ( struct uwb_rc rc,
struct uwb_mac_addr addr 
)

Get 's MAC address to

Definition at line 203 of file address.c.

int uwb_rc_mac_addr_set ( struct uwb_rc rc,
const struct uwb_mac_addr addr 
)

Set 's address to

Definition at line 219 of file address.c.

void uwb_rc_neh_error ( struct uwb_rc rc,
int  error 
)

The entity that reads from the device notification/event channel has detected an error.

: UWB Radio Controller : Errno error code

Definition at line 548 of file neh.c.

void uwb_rc_neh_grok ( struct uwb_rc rc,
void buf,
size_t  buf_size 
)

Given a buffer with one or more UWB RC events/notifications, break them up and dispatch them.

: UWB Radio Controller : Buffer with the stream of notifications/events : Amount of data in the buffer

Note each notification/event starts always with a 'struct uwb_rceb', so the minimum size if 4 bytes.

The device may pass us events formatted differently than expected. These are first filtered, potentially creating a new event in a new memory location. If a new event is created by the filter it is also freed here.

For each notif/event, tries to guess the size looking at the EST tables, then looks for a neh that is waiting for that event and if found, copies the payload to the neh's buffer and calls it back. If not, the data is ignored.

Note that if we can't find a size description in the EST tables, we still might find a size in the 'neh' handle in uwb_rc_neh_lookup().

Assumptions:

->neh_lock is NOT taken

We keep track of various sizes here: size: contains the size of the buffer that is processed for the incoming event. this buffer may contain events that are not formatted as WHCI. real_size: the actual space taken by this event in the buffer. We need to keep track of the real size of an event to be able to advance the buffer correctly. event_size: the size of the event as expected by the core layer [OR] the size of the event after filtering. if the filtering created a new event in a new memory location then this is effectively the size of a new event buffer

Definition at line 480 of file neh.c.

int uwb_rc_post_reset ( struct uwb_rc rc)

Definition at line 376 of file reset.c.

void uwb_rc_pre_reset ( struct uwb_rc rc)

Definition at line 366 of file reset.c.

void uwb_rc_put ( struct uwb_rc rc)

Drop a reference on a radio controller

This is the version that should be done by entities external to the UWB Radio Control stack (ie: clients of the API).

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

void uwb_rc_reset_all ( struct uwb_rc rc)

uwb_rc_reset_all - request a reset of the radio controller and PALs : the radio controller of the hardware device to be reset.

The full hardware reset of the radio controller and all the PALs will be scheduled.

Definition at line 349 of file reset.c.

void uwb_rc_rm ( struct uwb_rc )

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

ssize_t uwb_rc_vcmd ( struct uwb_rc rc,
const char cmd_name,
struct uwb_rccb cmd,
size_t  cmd_size,
u8  expected_type,
u16  expected_event,
struct uwb_rceb **  preply 
)

Generic function for issuing commands to the Radio Control Interface that return an unknown amount of data

: UWB Radio Control descriptor : Name of the command being issued (for error messages) : Pointer to rccb structure containing the command; normally you embed this structure as the first member of the full command structure. : Size of the whole command buffer pointed to by . : Expected type in the return event : Expected event code in the return event : Here a pointer to where the event data is received will be stored. Once done with the data, free with kfree().

The function checks that the length returned in the reply is at least as big as a 'struct uwb_rceb *'; if not, it will be deemed an error and -EIO returned.

needs to be referenced

Definition at line 269 of file reset.c.

void uwb_rsv_accept ( struct uwb_rsv rsv,
uwb_rsv_cb_f  cb,
void pal_priv 
)

uwb_rsv_accept - accept a new reservation from a peer : the reservation : call back for reservation changes : data to be passed in the above call back

Reservation requests from peers are denied unless a PAL accepts it by calling this function.

The PAL call uwb_rsv_destroy() for all accepted reservations before calling uwb_pal_unregister().

Definition at line 693 of file rsv.c.

struct uwb_rsv* uwb_rsv_create ( struct uwb_rc rc,
uwb_rsv_cb_f  cb,
void pal_priv 
)
read

uwb_rsv_create - allocate and initialize a UWB reservation structure : the radio controller : callback to use when the reservation completes or terminates : data private to the PAL to be passed in the callback

The callback is called when the state of the reservation changes from:

  • pending to accepted
  • pending to denined
  • accepted to terminated
  • pending to terminated

Definition at line 489 of file rsv.c.

void uwb_rsv_destroy ( struct uwb_rsv rsv)

uwb_rsv_destroy - free a UWB reservation structure : the reservation to free

The reservation must already be terminated.

Definition at line 532 of file rsv.c.

int uwb_rsv_establish ( struct uwb_rsv rsv)

usb_rsv_establish - start a reservation establishment : the reservation

The PAL should fill in 's owner, target, type, max_mas, min_mas, max_interval and is_multicast fields. If the target is a uwb_dev it must be referenced.

The reservation's callback will be called when the reservation is accepted, denied or times out.

Definition at line 549 of file rsv.c.

void uwb_rsv_get_usable_mas ( struct uwb_rsv rsv,
struct uwb_mas_bm mas 
)

uwb_rsv_get_usable_mas - get the bitmap of the usable MAS of a reservations : the reservation. : returns the available MAS.

The usable MAS of a reservation may be less than the negotiated MAS if alien BPs are present.

Definition at line 789 of file rsv.c.

int uwb_rsv_modify ( struct uwb_rsv rsv,
int  max_mas,
int  min_mas,
int  max_interval 
)

uwb_rsv_modify - modify an already established reservation : the reservation to modify : new maximum MAS to reserve : new minimum MAS to reserve : new max_interval to use

FIXME: implement this once there are PALs that use it.

Definition at line 597 of file rsv.c.

const char* uwb_rsv_state_str ( enum uwb_rsv_state  state)

uwb_rsv_state_str - return a string for a reservation state : the reservation state.

Definition at line 86 of file rsv.c.

void uwb_rsv_terminate ( struct uwb_rsv rsv)

uwb_rsv_terminate - terminate an established reservation : the reservation to terminate

A reservation is terminated by removing the DRP IE from the beacon, the other end will consider the reservation to be terminated when it does not see the DRP IE for at least mMaxLostBeacons.

If applicable, the reference to the target uwb_dev will be released.

Definition at line 668 of file rsv.c.

const char* uwb_rsv_type_str ( enum uwb_drp_type  type)

uwb_rsv_type_str - return a string for a reservation type : the reservation type

Definition at line 98 of file rsv.c.