linux/drivers/uwb/beacon.c
<<
>>
Prefs
   1/*
   2 * Ultra Wide Band
   3 * Beacon management
   4 *
   5 * Copyright (C) 2005-2006 Intel Corporation
   6 * Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
   7 *
   8 * This program is free software; you can redistribute it and/or
   9 * modify it under the terms of the GNU General Public License version
  10 * 2 as published by the Free Software Foundation.
  11 *
  12 * This program is distributed in the hope that it will be useful,
  13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15 * GNU General Public License for more details.
  16 *
  17 * You should have received a copy of the GNU General Public License
  18 * along with this program; if not, write to the Free Software
  19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  20 * 02110-1301, USA.
  21 *
  22 *
  23 * FIXME: docs
  24 */
  25#include <linux/kernel.h>
  26#include <linux/init.h>
  27#include <linux/module.h>
  28#include <linux/device.h>
  29#include <linux/err.h>
  30#include <linux/kdev_t.h>
  31#include <linux/slab.h>
  32
  33#include "uwb-internal.h"
  34
  35/* Start Beaconing command structure */
  36struct uwb_rc_cmd_start_beacon {
  37        struct uwb_rccb rccb;
  38        __le16 wBPSTOffset;
  39        u8 bChannelNumber;
  40} __attribute__((packed));
  41
  42
  43static int uwb_rc_start_beacon(struct uwb_rc *rc, u16 bpst_offset, u8 channel)
  44{
  45        int result;
  46        struct uwb_rc_cmd_start_beacon *cmd;
  47        struct uwb_rc_evt_confirm reply;
  48
  49        cmd = kzalloc(sizeof(*cmd), GFP_KERNEL);
  50        if (cmd == NULL)
  51                return -ENOMEM;
  52        cmd->rccb.bCommandType = UWB_RC_CET_GENERAL;
  53        cmd->rccb.wCommand = cpu_to_le16(UWB_RC_CMD_START_BEACON);
  54        cmd->wBPSTOffset = cpu_to_le16(bpst_offset);
  55        cmd->bChannelNumber = channel;
  56        reply.rceb.bEventType = UWB_RC_CET_GENERAL;
  57        reply.rceb.wEvent = UWB_RC_CMD_START_BEACON;
  58        result = uwb_rc_cmd(rc, "START-BEACON", &cmd->rccb, sizeof(*cmd),
  59                            &reply.rceb, sizeof(reply));
  60        if (result < 0)
  61                goto error_cmd;
  62        if (reply.bResultCode != UWB_RC_RES_SUCCESS) {
  63                dev_err(&rc->uwb_dev.dev,
  64                        "START-BEACON: command execution failed: %s (%d)\n",
  65                        uwb_rc_strerror(reply.bResultCode), reply.bResultCode);
  66                result = -EIO;
  67        }
  68error_cmd:
  69        kfree(cmd);
  70        return result;
  71}
  72
  73static int uwb_rc_stop_beacon(struct uwb_rc *rc)
  74{
  75        int result;
  76        struct uwb_rccb *cmd;
  77        struct uwb_rc_evt_confirm reply;
  78
  79        cmd = kzalloc(sizeof(*cmd), GFP_KERNEL);
  80        if (cmd == NULL)
  81                return -ENOMEM;
  82        cmd->bCommandType = UWB_RC_CET_GENERAL;
  83        cmd->wCommand = cpu_to_le16(UWB_RC_CMD_STOP_BEACON);
  84        reply.rceb.bEventType = UWB_RC_CET_GENERAL;
  85        reply.rceb.wEvent = UWB_RC_CMD_STOP_BEACON;
  86        result = uwb_rc_cmd(rc, "STOP-BEACON", cmd, sizeof(*cmd),
  87                            &reply.rceb, sizeof(reply));
  88        if (result < 0)
  89                goto error_cmd;
  90        if (reply.bResultCode != UWB_RC_RES_SUCCESS) {
  91                dev_err(&rc->uwb_dev.dev,
  92                        "STOP-BEACON: command execution failed: %s (%d)\n",
  93                        uwb_rc_strerror(reply.bResultCode), reply.bResultCode);
  94                result = -EIO;
  95        }
  96error_cmd:
  97        kfree(cmd);
  98        return result;
  99}
 100
 101/*
 102 * Start/stop beacons
 103 *
 104 * @rc:          UWB Radio Controller to operate on
 105 * @channel:     UWB channel on which to beacon (WUSB[table
 106 *               5-12]). If -1, stop beaconing.
 107 * @bpst_offset: Beacon Period Start Time offset; FIXME-do zero
 108 *
 109 * According to WHCI 0.95 [4.13.6] the driver will only receive the RCEB
 110 * of a SET IE command after the device sent the first beacon that includes
 111 * the IEs specified in the SET IE command. So, after we start beaconing we
 112 * check if there is anything in the IE cache and call the SET IE command
 113 * if needed.
 114 */
 115int uwb_rc_beacon(struct uwb_rc *rc, int channel, unsigned bpst_offset)
 116{
 117        int result;
 118        struct device *dev = &rc->uwb_dev.dev;
 119
 120        if (channel < 0)
 121                channel = -1;
 122        if (channel == -1)
 123                result = uwb_rc_stop_beacon(rc);
 124        else {
 125                /* channel >= 0...dah */
 126                result = uwb_rc_start_beacon(rc, bpst_offset, channel);
 127                if (result < 0)
 128                        return result;
 129                if (le16_to_cpu(rc->ies->wIELength) > 0) {
 130                        result = uwb_rc_set_ie(rc, rc->ies);
 131                        if (result < 0) {
 132                                dev_err(dev, "Cannot set new IE on device: "
 133                                        "%d\n", result);
 134                                result = uwb_rc_stop_beacon(rc);
 135                                channel = -1;
 136                                bpst_offset = 0;
 137                        }
 138                }
 139        }
 140
 141        if (result >= 0)
 142                rc->beaconing = channel;
 143        return result;
 144}
 145
 146/*
 147 * Beacon cache
 148 *
 149 * The purpose of this is to speed up the lookup of becon information
 150 * when a new beacon arrives. The UWB Daemon uses it also to keep a
 151 * tab of which devices are in radio distance and which not. When a
 152 * device's beacon stays present for more than a certain amount of
 153 * time, it is considered a new, usable device. When a beacon ceases
 154 * to be received for a certain amount of time, it is considered that
 155 * the device is gone.
 156 *
 157 * FIXME: use an allocator for the entries
 158 * FIXME: use something faster for search than a list
 159 */
 160
 161void uwb_bce_kfree(struct kref *_bce)
 162{
 163        struct uwb_beca_e *bce = container_of(_bce, struct uwb_beca_e, refcnt);
 164
 165        kfree(bce->be);
 166        kfree(bce);
 167}
 168
 169
 170/* Find a beacon by dev addr in the cache */
 171static
 172struct uwb_beca_e *__uwb_beca_find_bydev(struct uwb_rc *rc,
 173                                         const struct uwb_dev_addr *dev_addr)
 174{
 175        struct uwb_beca_e *bce, *next;
 176        list_for_each_entry_safe(bce, next, &rc->uwb_beca.list, node) {
 177                if (!memcmp(&bce->dev_addr, dev_addr, sizeof(bce->dev_addr)))
 178                        goto out;
 179        }
 180        bce = NULL;
 181out:
 182        return bce;
 183}
 184
 185/* Find a beacon by dev addr in the cache */
 186static
 187struct uwb_beca_e *__uwb_beca_find_bymac(struct uwb_rc *rc, 
 188                                         const struct uwb_mac_addr *mac_addr)
 189{
 190        struct uwb_beca_e *bce, *next;
 191        list_for_each_entry_safe(bce, next, &rc->uwb_beca.list, node) {
 192                if (!memcmp(bce->mac_addr, mac_addr->data,
 193                            sizeof(struct uwb_mac_addr)))
 194                        goto out;
 195        }
 196        bce = NULL;
 197out:
 198        return bce;
 199}
 200
 201/**
 202 * uwb_dev_get_by_devaddr - get a UWB device with a specific DevAddr
 203 * @rc:      the radio controller that saw the device
 204 * @devaddr: DevAddr of the UWB device to find
 205 *
 206 * There may be more than one matching device (in the case of a
 207 * DevAddr conflict), but only the first one is returned.
 208 */
 209struct uwb_dev *uwb_dev_get_by_devaddr(struct uwb_rc *rc,
 210                                       const struct uwb_dev_addr *devaddr)
 211{
 212        struct uwb_dev *found = NULL;
 213        struct uwb_beca_e *bce;
 214
 215        mutex_lock(&rc->uwb_beca.mutex);
 216        bce = __uwb_beca_find_bydev(rc, devaddr);
 217        if (bce)
 218                found = uwb_dev_try_get(rc, bce->uwb_dev);
 219        mutex_unlock(&rc->uwb_beca.mutex);
 220
 221        return found;
 222}
 223
 224/**
 225 * uwb_dev_get_by_macaddr - get a UWB device with a specific EUI-48
 226 * @rc:      the radio controller that saw the device
 227 * @bevaddr: Dev_addr" class="sref">uwbss="sref">uwbss=a" 1282     22ass="comment"> */
 1292     22a href="+code=uwb_dev" class="sref">uwb_dev *uwb_dev_get_by_devaddr(s a UWB a href="+code=uwb_rc" class="sref">uwb_rc *rc,
 1302     2                 uwb_mac_addr *mac_addr->href="drivers/uwb/beacon.c#L211" id="L211" class="l2ne" name="L131"> 1312     23f="drivers/uwb/beacon.c#L212" id="L212" class="l2ne" name="L132"> 1322     23struct uwb_dev *found = NULL;
 1332     23struct uwb_beca_e *bce;
 1342     23="drivers/uwb/beacon.c#L215" id="L215" class="l2ne" name="L135"> 1352     23mutex_lock(&rc->uwb_beca.mutex);
 1362     23bce = __uwb_beca_find_bymac(struct rc, mac_addr->href="driivers/uwb/beacon.c#L216" id="L216" class="line" name="L137"> 1372     23if (bce)
 1382     2         }
found = uwb_dev_try_get(rc, bce->uwb_dev);
 1392     23mutex_unlock(&rc->uwb_beca.mutex);
 1402 1412     24return found;
 1422     24f="drivers/uwb/beacon.c#L223" id="L223" class="l2ne" name="L143"> 1432     24="drivers/uwb/beacon.c#L224" id="L224" class="l2ne" name="L144"> 1442
/**

>
( 1452uwb_beca_e *uwb_beca_e *bce;
 13624    24f="drivers/uwb/beacon.c#L117" id="L1172 class="l2ne" name="L147"> 1472span 24(&ainit">uwb_beca_e(&ainithref="+code=rc" class="srref">bce->mutex);
 1482span 248a href="+code=kfree" class=hrefainit">uwb_beca_ebce->refcnt);
 1492span 24uwb_beca_ebce->bce-> 1502span 25uwb_beca_ebce->bce-> 1512span 25f="drivers/uwb/beacon.c#L72" id="L72" 2 class="l2ne" name="L152"> 1522span 25="drivers/uwb/beacon.c#L73" id="L73" 2 class="l2ne" name="L153"> 1532span 2lass="comment"> * time, it ihref="drivers/uwb/beacon.c#L147" id="L1472 class="l2ne" name="L154"> 1542span 2lass="comment"> * to be receiveAd dev addr ito
 1552span 2lass="comment"> * the device ief="drivers/uwb/beacon.c#L147" id="L1472 class="l2ne" name="L156"> 1562span 2lass="comment"> *

e hre/span>
 1572span 2lass="comment"> * FIXME: use an@bfB Radio Co/span>
fr57< (p we 1582span 2lass="comment"> * FIXME: use so@esajiffies: FIXM hrmp of ajiffies)eacon /spa addr iwas a certaief="drivers/uwb/beacon.c#L150" id="L1502 class="l2ne" name="L159"> 1592span 2lass="comment"> */
 1602 1612oid <261 href="+code=uwb_dev" class="s="sref">uwb_beca_e *__uwb_beca_find_bymacuwb_rc *rc,
 1622
uwb_rc_start_beaconbce-> 1632     26                                 const f="+code=uwb_dev" class="s="id="_fr57<">uwb_beca_e *container_of 1642container_of 1652     2  1662     2 uwb_beca_e *bce;
 1672
 1682bce = uwb_beca_ebce;
NULL;
 1692bce)
NULL;
 1702span 27                NULL;
 1712tatic27uwb_beca_e *bce;
 1722truct272a href="+code=kfree" class=ref">bce = container_ofcontainer_of 1732     2              e=bce" class="sref">bce->uwb_dev);
NULL;
 1742
__uwb_beca_fi_entrhrehref="+code=rc" class="srref">bce->node) {
rc->uwb_beca.list,  1752     2 struct bce;
 1762     2  1772     27f="drvers/uwb/beacon.c#L214" id="L214" class="l2ne" name="L178"> 1782     27ass="comment"> * FIXME: usehref="drivers/uwb/beacon.c#L147" id="L1472 class="l2ne" name="L179"> 1792     27ass="comment"> * The purpose oWipe ou includes>
 1802     28ass="comment"> * when a new bef="drivers/uwb/beacon.c#L106" id="L1062 class="l2ne" name="L181"> 1812a hre28ass="comment"> * tab of which Remove > *ociatcodn radiot tooref="drivers/uwb/beacon.c#L208" id="L208" class="l2ne" name="L182"> 1822     28ass="comment"> * uwb_dev_get_ref="drivers/uwb/beacon.c#L160" id="L1602 class="l2ne" name="L183"> 1832
uwb_beca_e *uwb_rc *rc,
 1842 1852span 28struct uwb_beca_e *bce, *next;
 1862tatic28container_of 1872truct28f="drvers/uwb/beacon.c#L214" id="L214" class="l2ne" name="L188"> 1882     288a href="+code=kfree" class=lass="sref">mutex_lock(&rc->uwb_beca.mutex);
 1892
list_for_each_entry_safe(bce, next, &rc->uwb_beca.list, node) {
 1902     29                container_ofbce = container_ofcontainer_ofcontainer_of 1912     29                if (<+code=bce" class="sonsi_t bea">container_ofcontainer_ofcontainer_of 1922     2         if (!(uwb_mac_addrd/a>(bce;
 1932     2                     sivers/uwb/beacon.c#L72" id="L72" 2 class="l2ne" name="L194"> 1942     2              ivers/uwb/beacon.c#L72" id="L72" 2 class="l2ne" name="L195"> 1952     2 }
mutex_unlock(&rc->uwb_beca.mutex);
 1962     29 1972a hre29f="drvers/uwb/beacon.c#L214" id="L214" class="l2ne" name="L198"> 1982     29ass="comment"> * FIXME: usehr Clemen of becwholes
>
 1992
uwb_beca_e *uwb_rc *rc,
 2003 2013span 30             f="+code=uwb_beca_e" class="sref">uwb_beca_e *bce, *next;
 2023span 30="drivers/uwb/beacon.c#L73" id="L73" 3 class="l3ne" name="L203"> 2033span 30             e=bce" class="slass="sref">mutex_lock(&rc->uwb_beca.mutex);
 2043span 304            e=bce" class="s_entry_safe" class="sref">list_for_each_entry_safe(bce, next, &rc->uwb_beca.list, node) {
 2053span 30        channel;
_entrdefhref="+code=rc" class="srref">bce->node) {
 1963span 30        (strpef">out:
(strpefa hree=cmd" class="sref">bce;
 2073span 30 2083span 308a href="+code=kfree" class=lass="="sref">mutex_unlock(&rc->uwb_beca.mutex);
 2093truct30f="drivers/uwb/beacon.c#L200" id="L2003 class="l3ne" name="L210"> 2103     31="drivers/uwb/beacon.c#L141" id="L1413 class="l3ne" name="L211"> 2113
refcnt);
" cla id="_priefa href="+code=uwb_rc" class="sref">uwb_rc *rc,
uwb_rc_start_beaconbce-> 2123     31                        uwb_beca_e *container_of 2133     3 strucivers/uwb/beacon.c#L192" id="L1923 class="l3ne" name="L214"> 2143container_ofcontainer_of 2153     3 container_ofcontainer_of 2163     3 container_ofcontainer_of 2173     31f="drvers/uwb/beacon.c#L214" id="L2143 class="l3ne" name="L218"> 2183     318a href="+code=kfree" class=ua> *refcnt);
" cl*container_ofcontainer_ofcontainer_of(container_of( 2193     3  *refcnt);
" cl*container_ofcontainer_ofcontainer_ofmac_addr-hef="drde=mutex" class=SrcAref">mac_addr-SrcAreff="drivers/uwb/beacon.c#L220" id="L2203 class="l3ne" name="L220"> 2203refcnt);
" cl*container_ofcontainer_ofcontainer_ofmac_addr-hef="drde=mutex" class=DestAref">mac_addr-DestAreff="drivers/uwb/beacon.c#L220" id="L2203 class="l3ne" name="L221"> 2213     32container_ofrc->uwb_dev);
uwb_dev);href="divers/uwb/beacon.c#L210" id="L2103 class="l3ne" name="L222"> 2223
 * Ff="ref">"BEACON from % the % t(ch%u offset %u slot %u MAC % )\n"ef="driivers/uwb/beacon.c#L210" id="L2103 class="l3ne" name="L223"> 2233container_ofcontainer_ofbce->container_ofbce->bce-> 2243span 32                      e=rc" class="srrf">container_of_Slot_Numbea">container_of_Slot_Numbea    ree=bce" class="sss=buf">container_of 2253span 3lass="ivers/uwb/beacon.c#L200" id="L2003 class="l3ne" name="L226"> 2263span 3lass="vers/uwb/beacon.c#L200" id="L2003 class="l3ne" name="L227"> 2273span 3lass="comment"> * @bevaddr: href="drivers/uwb/beacon.c#L147" id="L1473 class="l3ne" name="L128"> 1283     32ass="comment"> */

>
( 1293     32ass="comment"> */
 1303     3      e=bce" class="ssf="+_t">uwb_beca_e(strprief_IEs">container_of(strprief_IEsa href="+code=uwb_rc" class="srref">uwb_dev *uwb_dev *uwb_beca_e, bce, * 1313     33                if (<<<<<<<<<<container_ofuwb_beca_euwb_beca_e 1323     33f="drivers/uwb/beacon.c#L163" id="L1633 class="l3ne" name="L133"> 1333     33             e=bce" class="ssf="+_t">uwb_beca_erefcnt);
 1343     33             f="+code=uwb_beca_e" classrc_evss="sref">uwb_rc_start_beaconbce-> 1353     33struct uwb_beca_e *container_of 1363     33uwb_rc_start_ies_lef="drivers/uwb/beacon.c#L220" id="L2203 class="l3ne" name="L137"> 1373     33if (mac_addr-lassie_hef="+code=bce" class="sies">container_of 1383     33="drivers/uwb/beacon.c#L169" id="L1693 class="l3ne" name="L139"> 1393     33mutex_lock(&bce->mutex);
 1403 1413     34bce->bce = bce-> 1423     34             +code=bce" class="srf">bce-> 1433     34                     e=bce" class="srf">container_ofuwb_beca_e *bce = bce->Ipan">container_ofIpan="drivers/uwb/beacon.c#L220" id="L2203 class="l3ne" name="L144"> 1443
uwb_rc_start_ies_lef="drcode=NULL" class="rf">bce->bce->IpanLength="drc-t uwb_beca_e * 1453container_ofmac_addr-lassie_hef="+cod)e=NULL" class="rf">container_ofdata,
 13634    34ass="vers/uwb/beacon.c#L200" id="L2003 class="l3ne" name="L147"> 1473span 34        if (!refcnt);
mutex);
<="srie_dump_hefa hree=cmd" class="sies">container_ofuwb_rc_start_ies_lef="drree=bce" class="sruf">container_ofuwb_beca_e 1483span 348a href="+codivers/uwb/beacon.c#L200" id="L2003 class="l3ne" name="L149"> 1493span 34 1503span 35mutex_unlock(&bce->mutex);
 1513span 35f="drvers/uwb/beacon.c#L220" id="L2203 class="l3ne" name="L152"> 1523span 35return refcnt);
 1533span 35f="drivers/uwb/beacon.c#L184" id="L1843 class="l3ne" name="L154"> 1543span 35="drivers/uwb/beacon.c#L215" id="L2153 class="l3ne" name="L155"> 1553span 3lass="comment"> * the devicehref="drivers/uwb/beacon.c#L147" id="L1473 class="l3ne" name="L156"> 1563span 3lass="comment"> *
 1573span 3lass="comment"> * FIXME: use aref="drivers/uwb/beacon.c#L160" id="L1603 class="l3ne" name="L158"> 1583span 3lass="f="dri"iefde=uwb_beca_e" c="srverifys="sref">uwb_rc_start_beacverifys="srefa href="+code=uwb_rc" class="sref">uwb_rc *rc,
uwb_rc *uwb_rc * 1593span 359       if (!uwb_rc_start_beaconbce-> 1603 1613oid <36refcnt);
NULL;
 1623
uwb_beca_e *container_of 1633     36             f="+code=uwb_dev" clasn radi">container_ofuwb_dev);href="d = "+code=rc" class="sref">rc->uwb_dev);
uwb_dev);href="divers/uwb/beacon.c#L220" id="L2203 class="l3ne" name="L164"> 1643 1653     36}
/**
 1663     3 uwb_rc *container_ofuwb_beca_ebce->container_of 1673
devaddr);
uwb_dev);href="di comment"> * Ff="ref">"BEACON e hre: Nottenough hrefthe delassd"ef="drivers/uwb/beacon.c#L192" id="L1923 class="l3ne" name="L168"> 1683/**"(%zu vs %zu bytes needed)\n"ef="driide=node" class="eve">uwb_rc *container_ofuwb_beca_e 1693bce->container_of 1703span 37                devaddr);erroff="divers/uwb/beacon.c#L220" id="L2203 class="l3ne" name="L171"> 1713tatic37 1723truct372a href="+codeomment">/**
 1733     37ass="comment"> * @rc:      ttttttttt* 1743
refcnt);
 1753     3 struce=node" class="errof">devaddr);erroff="d:vers/uwb/beacon.c#L220" id="L2203 class="l3ne" name="L176"> 1763     37refcnt);
 1773     37f="drivers/uwb/beacon.c#L184" id="L1843 class="l3ne" name="L178"> 1783     37="drivers/uwb/beacon.c#L169" id="L1693 class="l3ne" name="L179"> 1793     37ass="comment"> * The purposhref="drivers/uwb/beacon.c#L147" id="L1473 class="l3ne" name="L180"> 1803     38ass="comment"> * when a new b Handlbss="_RC_EVT_BEACON e hresef="drivers/uwb/beacon.c#L147" id="L1473 class="l3ne" name="L181"> 1813a hre38ass="comment"> * tab of whichef="drivers/uwb/beacon.c#L147" id="L1473 class="l3ne" name="L182"> 1823     38ass="comment"> * uwb_dev_get_ We checkc/spa addr i
>
a certaiv addr ifares. Ifef="drivers/uwb/beacon.c#L147" id="L1473 class="l3ne" name="L183"> 1833
 * @rc:      t*a freshspan>tIXM hrmp. If srt wn>creatsdevnewef="drivers/uwb/beacon.c#L147" id="L1473 class="l3ne" name="L184"> 1843 * to be receive>( 1853span 38ass="comment"> * the device ief="drivers/uwb/beacon.c#L147" id="L1473 class="l3ne" name="L186"> 1863tatic38ass="comment"> *
 1873truct38ass="comment"> * FIXME: use an thewaivper srtificdon't bodere abou iscannn tef="drivers/uwb/beacon.c#L192" id="L1923 class="l3ne" name="L188"> 1883     38ass="comment"> */
 1893
 */
 1903     39     iefde=uwb_beca_e" c="sduwb_rc_start_beaduwb_rc *uwb_rc * 1913     39f="drivers/uwb/beacon.c#L212" id="L2123 class="l3ne" name="L192"> 1923     3         if (!iefde=uwb_beca_e" cresulf">refcnt);
NULL;
 1933     39             f="+code=uwb_dev" clas="sref">uwb_rc *rc,
 1943     39             f="+code=uwb_beca_e" classrc_evss="sref">uwb_rc_start_beaconbce-> 1953     39struct uwb_beca_e *container_of 1963     39uwb_beca_e *bce;
 1973a hre39        if (!ref="+codlongde=uwb_dev" clasamet_es">bce-> 1983     39="drivers/uwb/beacon.c#L169" id="L1693 class="l3ne" name="L199"> 1993
rc,
uwb_rc *rc,
 2004bce->container_ofuwb_rc *container_ofrc,
uwb_rc_start_beaconrc,
 2014span 40refcnt);
uwb_rc_start_beacverifys="srefa hree=rc" class="sref">rc,
uwb_rc *bce-> 1924span 40             +code=bce" class="sresulf">refcnt);
 2034span 40                     f="+code=bce" class="sresulf">refcnt);
 2044span 40="drivers/uwb/beacon.c#L215" id="L2154 class="l4ne" name="L205"> 2054span 40}
/**
 1964span 40bce->bce->Typf     == e=uwb_rc" classs="_RC_BEACON_TYPE_OL_ALIEN">bce-> 1974span 40        if (!bce->bce->Typf     == e=uwb_rc" classs="_RC_BEACON_TYPE_NOL_ALIEN">bce-> 2084span 40        }
NULL;
 1994truct40 2104     41="drivers/uwb/beacon.c#L141" id="L1414 class="l4ne" name="L211"> 2114
container_ofuwb_beca_e *bce->container_ofIpan="drivers/uwb/beacon.c#L220" id="L2204 class="l4ne" name="L212"> 2124     41="drivers/uwb/beacon.c#L73" id="L73" 4 class="l4ne" name="L213"> 2134     413
/**
 2144 * to be receiiiiiiiii* Dropv addr s from n radio with a href EUI-48 -- 2154     41ass="comment"> * the device iiiiiiii* be!reiquelyass>( 2164     41ass="comment"> *
 2174     41ass="comment"> * FIXME: use iiiiiiii* It's expectcoddevic/spse willn th be!WUSB-n radio and deeyef="drivers/uwb/beacon.c#L208" id="L2084 class="l4ne" name="L218"> 2184     41ass="comment"> */
 WUSB-48 2194     41ass="comment"> */
 problemref="drivers/uwb/beacon.c#L208" id="L2084 class="l4ne" name="L220"> 2204 * when a new iiiiiiii*ref="drivers/uwb/beacon.c#L160" id="L1604 class="l4ne" name="L221"> 2214     42list, container_of(container_of( 2224
 2234 2244span 424            e=bce" class="slass="sref">mutex_lock(&rc->uwb_beca.mutex);
 2254span 42}
bce = bce = rc,
container_of(container_of( 2264span 42bce)
NULL;
 2274span 42        if (!/**
 1284     42        }
refcnt);
" cla id="_priefa hree=uwb_rc" classeve">uwb_rc *rc,
bce->container_of 1294     429       if (!bce = __uwb_beca_find_bymacrc,
bce->container_ofuwb_rc *container_of 1304     43                bce)
NULL;
 1314     43                if (<<<<<<<<mutex_unlock(&rc->uwb_beca.mutex);
 1324     43                        NULL;
 1334     43                     ivers/uwb/beacon.c#L184" id="L1844 class="l4ne" name="L134"> 1344     43             ivers/uwb/beacon.c#L184" id="L1844 class="l4ne" name="L135"> 1354     43}
mutex_unlock(&rc->uwb_beca.mutex);
 1364     43ass="vers/uwb/beacon.c#L200" id="L2004 class="l4ne" name="L137"> 1374     43if (mutex_lock(&bce->mutex);
 1384     438a href="+codeomment">/**
 1394     43bce->bce = bce-> 1404 1414     44bce->bce = container_of 1424     44="drivers/uwb/beacon.c#L73" id="L73" 4 class="l4ne" name="L143"> 1434     443
/**
 1444
bce = container_ofuwb_rc *container_of 1454bce = bce->bce-> 13644    446
bce = bce = container_ofmac_addr-hef="drde=mutex" class=SrcAref">mac_addr-SrcAreff="divers/uwb/beacon.c#L220" id="L2204 class="l4ne" name="L147"> 1474span 44if (bce->mutex);
container_of(container_of( 1484span 448a href="+code=kfree" class=rf">bce->bce->bce->bce->bce-> 1494span 44bce->bce->IpanLength="drcode=NULL" class="le16a hrcpu">bce->bce->bce->IpanLength="drrivers/uwb/beacon.c#L220" id="L2204 class="l4ne" name="L150"> 1504span 45bce->bce->bce->bce->bce-> 1514span 45bce->bce->bce->bce->bce-> 1524span 45="drivers/uwb/beacon.c#L73" id="L73" 4 class="l4ne" name="L153"> 1534span 453
/**
 1544span 45ass="comment"> * to be receiiiiiiiii* This might be >  addr ifromdevnew-n radiref="drivers/uwb/beacon.c#L208" id="L2084 class="l4ne" name="L155"> 1554span 4lass="comment"> * the deviceiiiiiiiii*ref="drivers/uwb/beacon.c#L160" id="L1604 class="l4ne" name="L156"> 1564span 45bce)
uwb_dev);
NULL;
 1574span 45        if (!d/a>(uwb_mac_addrd/a>(uwb_rc *rc,
bce;
 1584span 45="drivers/uwb/beacon.c#L169" id="L1694 class="l4ne" name="L159"> 1594span 45mutex_unlock(&bce->mutex);
 1604 1614oid <46/**
 1624
 1634     46     vers/uwb/beacon.c#L220" id="L2204 class="l4ne" name="L164"> 1644 * to be rece hef="drivers/uwb/beacon.c#L160" id="L1604 class="l4ne" name="L165"> 1654     46ass="comment"> * the device i Handlbss="_RC_EVT_BEACON_SIZE e hresef="drivers/uwb/beacon.c#L147" id="L1474 class="l4ne" name="L166"> 1664     46ass="comment"> *
 1674
 * FIXME: use anXXXXXef="drivers/uwb/beacon.c#L147" id="L1474 class="l4ne" name="L168"> 1684 */
 1694uwb_beca_euwb_rc *uwb_rc * 1704span 47="driivers/uwb/beacon.c#L192" id="L1924 class="l4ne" name="L171"> 1714tatic47refcnt);
NULL;
 1724truct47struct container_ofuwb_dev);href="d = "+code=rc" class="sreve">uwb_rc *rc,
uwb_dev);
uwb_dev);href="divers/uwb/beacon.c#L220" id="L2204 class="l4ne" name="L173"> 1734     47             f="+code=uwb_dev" clas="srefuwb_beca_ebce-> 1744
 1754     47}
/**
 1764     47uwb_rc *container_ofuwb_beca_ebce-> 1774     47        if (!devaddr);
uwb_dev);href="di comment"> * Ff="ref">"BEACON SIZE srtific 1784     47        }
/**"delassd(%zu vs %zu bytes needed)\n"ef="driivers/uwb/beacon.c#L192" id="L1924 class="l4ne" name="L179"> 1794     479       if (!uwb_rc *container_ofuwb_beca_ebce-> 1804     48                devaddr);erroff="divers/uwb/beacon.c#L220" id="L2204 class="l4ne" name="L181"> 1814a hre48 1824     482a href="+code=cmd" class="srs">bce->container_ofuwb_rc *container_ofrc,
uwb_beca_erc,
 1834
 1844container_ofuwb_dev);href="di comment"> * Ff="ref">"Baddr if="+ 1854span 48        /**"(FIXME: act hr?)\n"ef="driide=node" class="le16a hrcpu">bce->bce->uwb_beca_eS="+="dridivers/uwb/beacon.c#L220" id="L2204 class="l4ne" name="L186"> 1864tatic48 1874truct48        if (!/**
do somethn tiwith this message... href="drivers/uwb/beacon.c#L160" id="L1604 class="l4ne" name="L188"> 1884     48        }
uwb_rc * 1894
uwb_rc * 1904     49                container_ofuwb_dev);href="di comment"> * Ff="ref">"Baddr if="+ 1914     49                if (<<<<<<<<<</**"(FIXME: act hr?)\n"ef="driide=node" class="d=ure">uwb_rc * 1924     4         if (!ivers/uwb/beacon.c#L184" id="L1844 class="l4ne" name="L193"> 1934     49             e=uwb_beca_e" cresulf">refcnt);
 1944     49     e=node" class="errof">devaddr);erroff="d:vers/uwb/beacon.c#L220" id="L2204 class="l4ne" name="L195"> 1954     49struct refcnt);
 1964     49 1974a hre49     vers/uwb/beacon.c#L184" id="L1844 class="l4ne" name="L198"> 1984     49ass="comment"> */
 1994
 */
 2005 * when a new b @evs:d becBP_SLOT_CHANGE srtificaadiopd="trolleaf=="drivers/uwb/beacon.c#L147" id="L1475 1lass="l5ne" name="L191"> 1915span 50ass="comment"> * tab of whichef="drivers/uwb/beacon.c#L147" id="L1475 2lass="l5ne" name="L192"> 1925span 50ass="comment"> * uwb_dev_get_ Iff bece hreiindic 1935span 50ass="comment"> * @rc:      t*< ben>aadiopd="trollea hasddraef=a hrcoddo acnon-" id="n tif="diref="drivers/uwb/beacon.c#L208" id="L2085 class="l5ne" name="L204"> 2045span 50ass="comment"> * to be receiveOderewise, ffmply save  beccurrhrei addr islotref="drivers/uwb/beacon.c#L208" id="L2085 5lass="l5ne" name="L195"> 1955span 50ass="comment"> * the device iref="drivers/uwb/beacon.c#L160" id="L1605 6lass="l5ne" name="L196"> 1965span 50uwb_beca_euwb_rc *uwb_rc * 1975span 50     ivers/uwb/beacon.c#L192" id="L1925 class="l5ne" name="L208"> 2085span 50        }
uwb_rc *rc,
uwb_rc *rc,
 1995truct50container_ofuwb_dev);href="d = "+code=rc" class="sref">rc->uwb_dev);
uwb_dev);href="divers/uwb/beacon.c#L220" id="L2205 class="l5ne" name="L210"> 2105     510       }
uwb_beca_erc-> 2115
 2125     51             +code=bce" class="seve">uwb_rc *container_ofuwb_beca_erc-> 2135     51                     e=result" classdev erf">devaddr);
uwb_dev);href="di comment"> * Ff="ref">"BP SLOT CHANGE e hre: Nottenough href\n"ef="dridivers/uwb/beacon.c#L220" id="L2205 class="l5ne" name="L214"> 2145NULL;
 2155     51struct  2165     516
rc->container_ofuwb_rc *container_ofrc,
uwb_beca_erc,
 2175     51     vers/uwb/beacon.c#L184" id="L1845 class="l5ne" name="L218"> 2185     518a href="+code=kfree" class=lass="sref">mutex_lock(&rc->uwb_dev);
mutex);
 2195     519            +code=bce" class="s="srefuwb_beca_erc-> 2205container_ofuwb_dev);href="di comment"> * Ff="ref">"stoppaiv addr ref: No fref slots in BP\n"ef="dridivers/uwb/beacon.c#L220" id="L2205 class="l5ne" name="L221"> 2215     52                if (rc->rc-> 2225
 2235rc->uwb_dev);
uwb_beca_euwb_beca_erc-> 2245span 524            e=bce" class="slass="="sref">mutex_unlock(&rc->uwb_dev);
mutex);
 2255span 52}
 2265span 52 2275span 52f="drivers/uwb/beacon.c#L184" id="L1845 class="l5ne" name="L128"> 1285     52="drivers/uwb/beacon.c#L169" id="L1695 9lass="l5ne" name="L129"> 1295     52ass="comment"> * The purposhrhef="drivers/uwb/beacon.c#L147" id="L1475 class="l5ne" name="L130"> 1305     53ass="comment"> * when a new b Handlbss="_RC_EVT_BPOIE_CHANGE e hresef="drivers/uwb/beacon.c#L147" id="L1475 class="l5ne" name="L131"> 1315     53ass="comment"> * tab of whichef="drivers/uwb/beacon.c#L147" id="L1475 class="l5ne" name="L132"> 1325     53ass="comment"> * uwb_dev_get_ XXXXXef="drivers/uwb/beacon.c#L147" id="L1475 class="l5ne" name="L133"> 1335     53ass="comment"> * @rc:      t*ref="drivers/uwb/beacon.c#L160" id="L1605 class="l5ne" name="L134"> 1345     53     f="+code=uwb_beca_e" classies=pn">container_of 1355     53}
mac_addr-lassieshef
mac_addr-hef="drivers/uwb/beacon.c#L220" id="L2205 class="l5ne" name="L136"> 1365     536
mac_addr-l        }
bce-><=p_length="drivers/uwb/beacon.c#L220" id="L2205 class="l5ne" name="L137"> 1375     53if (mac_addr-l        }
uwb_dev);href    []ivers/uwb/beacon.c#L220" id="L2205 class="l5ne" name="L138"> 1385     538a hr}de=__uwb_beca_findat="rb hr__">uwb_dev);ndat="rb hr__href=ee=mac_addr" clapackee">__uwb_beca_fipackee="dridivers/uwb/beacon.c#L220" id="L2205 class="l5ne" name="L139"> 1395     53 1405uwb_beca_euwb_rc *uwb_rc * 1415     54f="drivers/uwb/beacon.c#L212" id="L2125 class="l5ne" name="L142"> 1425     54        if (!iefde=uwb_beca_e" cresulf">refcnt);
NULL;
 1435     54             f="+code=uwb_dev" clasn radi">container_ofuwb_dev);href="d = "+code=rc" class="sreve">uwb_rc *rc,
uwb_dev);
uwb_dev);href="divers/uwb/beacon.c#L220" id="L2205 class="l5ne" name="L144"> 1445
uwb_beca_erc-> 1455container_ofrc-> 13654    546
uwb_rc */**
 1475span 54if (uwb_rc *uwb_beca_e 1485span 54="drivers/uwb/beacon.c#L169" id="L1695 class="l5ne" name="L149"> 1495span 54/**
 1505span 55uwb_rc *container_ofuwb_beca_erc-> 1515span 55                if (devaddr);
uwb_dev);href="di comment"> * Ff="ref">"BPOIEC srtific 1525span 55                        /**"delassd(%zu vs %zu bytes needed)\n"ef="driivers/uwb/beacon.c#L192" id="L1925 class="l5ne" name="L153"> 1535span 55                        if (uwb_rc *container_ofuwb_beca_erc-> 1545span 55                     gohe e=node" class="errof">devaddr);erroff="divers/uwb/beacon.c#L220" id="L2205 class="l5ne" name="L155"> 1555span 55struct  1565span 556
rc->container_ofuwb_rc *container_ofrc,
uwb_beca_erc,
 1575span 55if (uwb_beca_ebce->rc->bce-> 1585span 558a href="+cod+code=bce" class="sief="+">uwb_beca_erc-> 1595span 559       if (!devaddr);
uwb_dev);href="di comment"> * Ff="ref">"BPOIEC srtific 1605/**"delassd(%zu vs %zu bytes needed)\n"ef="driivers/uwb/beacon.c#L192" id="L1925 class="l5ne" name="L161"> 1615oid <56                if (<<<<<<<<uwb_beca_erc-> 1625
devaddr);erroff="divers/uwb/beacon.c#L220" id="L2205 class="l5ne" name="L163"> 1635     563truct  1645uwb_rc */**
 1655     56        container_ofuwb_dev);href="di comment"> * Ff="ref">"BPOIE:d%u changcs rececond\n"ef="driide=node" class="d=ure">uwb_rc * 1665     566
 * to be rece hef="drivers/uwb/beacon.c#L160" id="L1605 class="l5ne" name="L167"> 1675
 * FIXME: use         h FIXME: At this point wn>should go oon.n th  becIEstinpderef="drivers/uwb/beacon.c#L160" id="L1605 class="l5ne" name="L168"> 1685 */
 1695 */
 1705span 57refcnt);
 1715tatic57devaddr);erroff="d:vers/uwb/beacon.c#L220" id="L2205 class="l5ne" name="L172"> 1725truct57struct refcnt);
 1735     57     ivers/uwb/beacon.c#L184" id="L1845 class="l5ne" name="L174"> 1745
 1755     57ass="comment"> * the device hef="drivers/uwb/beacon.c#L160" id="L1605 class="l5ne" name="L176"> 1765     57ass="comment"> *
 1775     57ass="comment"> * FIXME: use aref="drivers/uwb/beacon.c#L160" id="L1605 class="l5ne" name="L178"> 1785     57     f="dri"e=mutex" class=fff="_e">uwb_rc *uwb_beca_econtainer_ofuwb_dev);href="divers/uwb/beacon.c#L192" id="L1925 class="l5ne" name="L179"> 1795     579       if (!container_ofcontainer_ofcontainer_of 1805     58="driivers/uwb/beacon.c#L192" id="L1925 class="l5ne" name="L181"> 1815a hre58uwb_dev);
uwb_dev);
uwb_dev);to_lassrefhref=e=cmd" class="sref">uwb_dev);href="ddivers/uwb/beacon.c#L220" id="L2205 class="l5ne" name="L182"> 1825     58struct uwb_rc *rc,
uwb_dev);
rc,
 1835
uwb_rc *refcnt);
 1845 1855span 58        mutex_lock(&rc->uwb_dev);
mutex);
 1865tatic586
refcnt);
container_ofcontainer_of * Ff="ref">"%d\n"ef="driide=node" class="ef">rc->rc-> 1875truct58if (mutex_unlock(&rc->uwb_dev);
mutex);
 1885     58        }
refcnt);
 1895
 1905     59="drivers/uwb/beacon.c#L141" id="L1415 class="l5ne" name="L191"> 1915     59ass="comment"> * tab of whi hef="drivers/uwb/beacon.c#L160" id="L1605 class="l5ne" name="L192"> 1925     59ass="comment"> * uwb_dev_get_ Starfv addr refionpder specified channel, or stopv addr refref="drivers/uwb/beacon.c#L208" id="L2085 class="l5ne" name="L193"> 1935     59ass="comment"> * @rc:      t*ref="drivers/uwb/beacon.c#L160" id="L1605 class="l5ne" name="L194"> 1945     594    f="dri"e=mutex" class=fff="_e">uwb_rc *uwb_beca_econtainer_ofuwb_dev);href="divers/uwb/beacon.c#L192" id="L1925 class="l5ne" name="L195"> 1955     59        container_ofcontainer_of 1965     596       container_ofuwb_rc *uwb_beca_e 1975a hre59     ivers/uwb/beacon.c#L192" id="L1925 class="l5ne" name="L198"> 1985     59        }
uwb_dev);
uwb_dev);
uwb_dev);to_lassrefhref=e=cmd" class="sref">uwb_dev);href="ddivers/uwb/beacon.c#L220" id="L2205 class="l5ne" name="L199"> 1995
uwb_rc *rc,
uwb_dev);
rc,
 2006uwb_rc * 1916span 60uwb_rc *refcnt);
NULL;
 1926span 60="drivers/uwb/beacon.c#L73" id="L73" 6 3lass="l6ne" name="L193"> 1936span 60             e=uwb_beca_e" cresulf">refcnt);
container_ofcontainer_of * Ff="ref">"%d"ef="driid"+code=rc" class="srchannel">uwb_rc * 2046span 604a href="+cod+code=uwb_beca_e" cresulf">refcnt);
 1956span 60        refcnt);
uwb_rc *rc,
uwb_rc * 1966span 60ass="vers/uwb/beacon.c#L200" id="L2006 7lass="l6ne" name="L197"> 1976span 60if (refcnt);
refcnt);
uwb_beca_e 1986span 60     ivers/uwb/beacon.c#L184" id="L1846 9lass="l6ne" name="L199"> 1996truct60uwb_beca_erc->rc->uwb_beca_euwb_beca_euwb_beca_e 2106     610    
Ter original LXR software bypder ers/uwb/bhttp://sourceforge.net/projects/lxr">LXR rc: unityhrefcdthis experi al on.c hr bypers/uwb/bmailto:lxr@210ux.no">lxr@210ux.nof="dd
lxr.210ux.no kindly hostaiv y ers/uwb/bhttp://www.redpill-210pro.no">Redpill L10pro AShrefcdprovider of L10ux=d="sulfrefiand oper