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

Go to the source code of this file.

Functions

void uwb_rc_init (struct uwb_rc *rc)
 
 EXPORT_SYMBOL_GPL (uwb_rc_init)
 
struct uwb_rcuwb_rc_alloc (void)
 
 EXPORT_SYMBOL_GPL (uwb_rc_alloc)
 
int uwb_rc_add (struct uwb_rc *rc, struct device *parent_dev, void *priv)
 
 EXPORT_SYMBOL_GPL (uwb_rc_add)
 
void uwb_rc_rm (struct uwb_rc *rc)
 
 EXPORT_SYMBOL_GPL (uwb_rc_rm)
 
struct uwb_rc__uwb_rc_try_get (struct uwb_rc *target_rc)
 
 EXPORT_SYMBOL_GPL (__uwb_rc_try_get)
 
struct uwb_rcuwb_rc_get_by_grandpa (const struct device *grandpa_dev)
 
 EXPORT_SYMBOL_GPL (uwb_rc_get_by_grandpa)
 
struct uwb_rcuwb_rc_get_by_dev (const struct uwb_dev_addr *addr)
 
 EXPORT_SYMBOL_GPL (uwb_rc_get_by_dev)
 
void uwb_rc_put (struct uwb_rc *rc)
 
 EXPORT_SYMBOL_GPL (uwb_rc_put)
 

Function Documentation

struct uwb_rc* __uwb_rc_try_get ( struct uwb_rc target_rc)
read

Given a radio controller descriptor, validate and refcount it

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

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

EXPORT_SYMBOL_GPL ( uwb_rc_init  )
EXPORT_SYMBOL_GPL ( uwb_rc_alloc  )
EXPORT_SYMBOL_GPL ( uwb_rc_add  )
EXPORT_SYMBOL_GPL ( uwb_rc_rm  )
EXPORT_SYMBOL_GPL ( __uwb_rc_try_get  )
EXPORT_SYMBOL_GPL ( uwb_rc_get_by_grandpa  )
EXPORT_SYMBOL_GPL ( uwb_rc_get_by_dev  )
EXPORT_SYMBOL_GPL ( uwb_rc_put  )
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.

struct uwb_rc* uwb_rc_get_by_dev ( const struct uwb_dev_addr 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.

void uwb_rc_init ( struct uwb_rc rc)

Definition at line 89 of file lc-rc.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_rm ( struct uwb_rc rc)

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