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

Go to the source code of this file.

Functions

int uwb_notifs_register (struct uwb_rc *rc, struct uwb_notifs_handler *new)
 
 EXPORT_SYMBOL_GPL (uwb_notifs_register)
 
int uwb_notifs_deregister (struct uwb_rc *rc, struct uwb_notifs_handler *entry)
 
 EXPORT_SYMBOL_GPL (uwb_notifs_deregister)
 
void uwb_notify (struct uwb_rc *rc, struct uwb_dev *uwb_dev, enum uwb_notifs event)
 
void uwb_dev_init (struct uwb_dev *uwb_dev)
 
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)
 
struct uwb_devuwb_dev_try_get (struct uwb_rc *rc, struct uwb_dev *uwb_dev)
 
 EXPORT_SYMBOL_GPL (uwb_dev_try_get)
 
int __uwb_dev_offair (struct uwb_dev *uwb_dev, struct uwb_rc *rc)
 
void uwbd_dev_offair (struct uwb_beca_e *bce)
 
void uwbd_dev_onair (struct uwb_rc *rc, struct uwb_beca_e *bce)
 
int uwb_dev_for_each (struct uwb_rc *rc, uwb_dev_for_each_f function, void *priv)
 
 EXPORT_SYMBOL_GPL (uwb_dev_for_each)
 

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.

EXPORT_SYMBOL_GPL ( uwb_notifs_register  )
EXPORT_SYMBOL_GPL ( uwb_notifs_deregister  )
EXPORT_SYMBOL_GPL ( uwb_dev_try_get  )
EXPORT_SYMBOL_GPL ( uwb_dev_for_each  )
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.

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.

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.

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.

int uwb_notifs_deregister ( struct uwb_rc rc,
struct uwb_notifs_handler entry 
)

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

int uwb_notifs_register ( struct uwb_rc rc,
struct uwb_notifs_handler new 
)

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

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.

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.