Linux Kernel
3.7.1
|
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 } |
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 |
#define UWB_RC_CMD_TIMEOUT_MS 1000 /* ms */ |
Definition at line 86 of file uwb-internal.h.
enum uwb_event_message |
enum uwb_event_message - an event for a message for asynchronous processing
UWB_EVT_MSG_RESET - reset the radio controller and all PAL hardware.
Definition at line 209 of file uwb-internal.h.
enum uwb_event_type |
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.
Definition at line 188 of file uwb-internal.h.
enum uwb_rsv_mas_status |
Definition at line 130 of file uwb-internal.h.
Definition at line 125 of file uwb-internal.h.
uwb_dbg_add_rc - add a debug interface for a radio controller : the radio controller
Definition at line 313 of file uwb-debug.c.
uwb_dbg_create_pal_dir - create a debugfs directory for a PAL : The PAL.
Definition at line 392 of file uwb-debug.c.
uwb_dbg_del_rc - remove a radio controller's debug interface : the radio controller
Definition at line 350 of file uwb-debug.c.
uwb_dbg_exit - clean-up the debug interface sub-module
Definition at line 383 of file uwb-debug.c.
uwb_dbg_exit - initialize the debug interface sub-module
Definition at line 375 of file uwb-debug.c.
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.
|
read |
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_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.
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:
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.
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.
|
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
Creates a neh and adds it to the list of those waiting for an event. A context ID will be assigned to the command.
void uwb_rc_neh_arm | ( | struct uwb_rc * | rc, |
struct uwb_rc_neh * | neh | ||
) |
void uwb_rc_neh_put | ( | struct uwb_rc_neh * | neh | ) |
void uwb_rc_neh_rm | ( | struct uwb_rc * | rc, |
struct uwb_rc_neh * | neh | ||
) |
Reset a UWB Host Controller (and all radio settings)
: Host Controller descriptor
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.
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)
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.
Construct and send the SET DRP IE
: UWB Host controller
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.
int uwb_rc_set_ie | ( | struct uwb_rc * | rc, |
struct uwb_rc_cmd_set_ie * | cmd | ||
) |
|
read |
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.
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.
void uwb_rsv_set_state | ( | struct uwb_rsv * | rsv, |
enum uwb_rsv_state | new_state | ||
) |
int uwb_rsv_try_move | ( | struct uwb_rsv * | rsv, |
struct uwb_mas_bm * | available | ||
) |
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!
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
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.
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).
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.
Process an incoming DRP Availability notification.
: Event information (packs the actual event data, which radio controller it came to, etc).
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.
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.
struct device_attribute dev_attr_beacon |
struct device_attribute dev_attr_mac_address |
struct device_attribute dev_attr_scan |