Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
rsv.c File Reference
#include <linux/kernel.h>
#include <linux/uwb.h>
#include <linux/slab.h>
#include <linux/random.h>
#include <linux/export.h>
#include "uwb-internal.h"

Go to the source code of this file.

Functions

bool uwb_rsv_has_two_drp_ies (struct uwb_rsv *rsv)
 
const charuwb_rsv_state_str (enum uwb_rsv_state state)
 
 EXPORT_SYMBOL_GPL (uwb_rsv_state_str)
 
const charuwb_rsv_type_str (enum uwb_drp_type type)
 
 EXPORT_SYMBOL_GPL (uwb_rsv_type_str)
 
void uwb_rsv_dump (char *text, struct uwb_rsv *rsv)
 
void uwb_rsv_get (struct uwb_rsv *rsv)
 
void uwb_rsv_put (struct uwb_rsv *rsv)
 
void uwb_rsv_backoff_win_timer (unsigned long arg)
 
void uwb_rsv_backoff_win_increment (struct uwb_rc *rc)
 
void uwb_rsv_set_state (struct uwb_rsv *rsv, enum uwb_rsv_state new_state)
 
struct uwb_rsvuwb_rsv_create (struct uwb_rc *rc, uwb_rsv_cb_f cb, void *pal_priv)
 
 EXPORT_SYMBOL_GPL (uwb_rsv_create)
 
void uwb_rsv_remove (struct uwb_rsv *rsv)
 
void uwb_rsv_destroy (struct uwb_rsv *rsv)
 
 EXPORT_SYMBOL_GPL (uwb_rsv_destroy)
 
int uwb_rsv_establish (struct uwb_rsv *rsv)
 
 EXPORT_SYMBOL_GPL (uwb_rsv_establish)
 
int uwb_rsv_modify (struct uwb_rsv *rsv, int max_mas, int min_mas, int max_interval)
 
 EXPORT_SYMBOL_GPL (uwb_rsv_modify)
 
int uwb_rsv_try_move (struct uwb_rsv *rsv, struct uwb_mas_bm *available)
 
void uwb_rsv_handle_drp_avail_change (struct uwb_rc *rc)
 
void uwb_rsv_terminate (struct uwb_rsv *rsv)
 
 EXPORT_SYMBOL_GPL (uwb_rsv_terminate)
 
void uwb_rsv_accept (struct uwb_rsv *rsv, uwb_rsv_cb_f cb, void *pal_priv)
 
 EXPORT_SYMBOL_GPL (uwb_rsv_accept)
 
void uwb_rsv_get_usable_mas (struct uwb_rsv *rsv, struct uwb_mas_bm *mas)
 
 EXPORT_SYMBOL_GPL (uwb_rsv_get_usable_mas)
 
struct uwb_rsvuwb_rsv_find (struct uwb_rc *rc, struct uwb_dev *src, struct uwb_ie_drp *drp_ie)
 
void uwb_rsv_queue_update (struct uwb_rc *rc)
 
void uwb_rsv_sched_update (struct uwb_rc *rc)
 
void uwb_rsv_remove_all (struct uwb_rc *rc)
 
void uwb_rsv_init (struct uwb_rc *rc)
 
int uwb_rsv_setup (struct uwb_rc *rc)
 
void uwb_rsv_cleanup (struct uwb_rc *rc)
 

Function Documentation

EXPORT_SYMBOL_GPL ( uwb_rsv_state_str  )
EXPORT_SYMBOL_GPL ( uwb_rsv_type_str  )
EXPORT_SYMBOL_GPL ( uwb_rsv_create  )
EXPORT_SYMBOL_GPL ( uwb_rsv_destroy  )
EXPORT_SYMBOL_GPL ( uwb_rsv_establish  )
EXPORT_SYMBOL_GPL ( uwb_rsv_modify  )
EXPORT_SYMBOL_GPL ( uwb_rsv_terminate  )
EXPORT_SYMBOL_GPL ( uwb_rsv_accept  )
EXPORT_SYMBOL_GPL ( uwb_rsv_get_usable_mas  )
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.

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.

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.

void uwb_rsv_dump ( char text,
struct uwb_rsv rsv 
)

Definition at line 106 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.

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.

void uwb_rsv_get ( struct uwb_rsv rsv)

Definition at line 130 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.

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.

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.

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.

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.

int uwb_rsv_try_move ( struct uwb_rsv rsv,
struct uwb_mas_bm available 
)

Definition at line 607 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.