Linux Kernel
3.7.1
|
#include <linux/kernel.h>
#include <linux/timer.h>
#include <linux/slab.h>
#include <linux/err.h>
#include <linux/export.h>
#include "uwb-internal.h"
Go to the source code of this file.
Data Structures | |
struct | uwb_rc_neh |
Functions | |
void | uwb_rc_neh_put (struct uwb_rc_neh *neh) |
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) |
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_grok (struct uwb_rc *rc, void *buf, size_t buf_size) |
EXPORT_SYMBOL_GPL (uwb_rc_neh_grok) | |
void | uwb_rc_neh_error (struct uwb_rc *rc, int error) |
EXPORT_SYMBOL_GPL (uwb_rc_neh_error) | |
void | uwb_rc_neh_create (struct uwb_rc *rc) |
void | uwb_rc_neh_destroy (struct uwb_rc *rc) |
EXPORT_SYMBOL_GPL | ( | uwb_rc_neh_grok | ) |
EXPORT_SYMBOL_GPL | ( | uwb_rc_neh_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 | ||
) |
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
void uwb_rc_neh_put | ( | struct uwb_rc_neh * | neh | ) |