linux/drivers/bluetooth/hci_bcsp.c
<<
>>
Prefs
   1/*
   2 *
   3 *  Bluetooth HCI UART driver
   4 *
   5 *  Copyright (C) 2002-2003  Fabrizio Gennari <fabrizio.gennari@philips.com>
   6 *  Copyright (C) 2004-2005  Marcel Holtmann <marcel@holtmann.org>
   7 *
   8 *
   9 *  This program is free software; you can redistribute it and/or modify
  10 *  it under the terms of the GNU General Public License as published by
  11 *  the Free Software Foundation; either version 2 of the License, or
  12 *  (at your option) any later version.
  13 *
  14 *  This program is distributed in the hope that it will be useful,
  15 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  16 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  17 *  GNU General Public License for more details.
  18 *
  19 *  You should have received a copy of the GNU General Public License
  20 *  along with this program; if not, write to the Free Software
  21 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  22 *
  23 */
  24
  25#include <linux/module.h>
  26
  27#include <linux/kernel.h>
  28#include <linux/init.h>
  29#include <linux/types.h>
  30#include <linux/fcntl.h>
  31#include <linux/interrupt.h>
  32#include <linux/ptrace.h>
  33#include <linux/poll.h>
  34
  35#include <linux/slab.h>
  36#include <linux/tty.h>
  37#include <linux/errno.h>
  38#include <linux/string.h>
  39#include <linux/signal.h>
  40#include <linux/ioctl.h>
  41#include <linux/skbuff.h>
  42#include <linux/bitrev.h>
  43#include <asm/unaligned.h>
  44
  45#include <net/bluetooth/bluetooth.h>
  46#include <net/bluetooth/hci_core.h>
  47
  48#include "hci_uart.h"
  49
  50#define VERSION "0.3"
  51
  52static bool txcrc = 1;
  53static bool hciextn = 1;
  54
  55#define BCSP_TXWINSIZE  4
  56
  57#define BCSP_ACK_PKT    0x05
  58#define BCSP_LE_PKT     0x06
  59
  60struct bcsp_struct {
  61        struct sk_buff_head unack;      /* Unack'ed packets queue */
  62        struct sk_buff_head rel;        /* Reliable packets queue */
  63        struct sk_buff_head unrel;      /* Unreliable packets queue */
  64
  65        unsigned long rx_count;
  66        struct  sk_buff *rx_skb;
  67        u8      rxseq_txack;            /* rxseq == txack. */
  68        u8      rxack;                  /* Last packet sent by us that the peer ack'ed */
  69        struct  timer_list tbcsp;
  70
  71        enum {
  72                BCSP_W4_PKT_DELIMITER,
  73                BCSP_W4_PKT_START,
  74                BCSP_W4_BCSP_HDR,
  75                BCSP_W4_DATA,
  76                BCSP_W4_CRC
  77        } rx_state;
  78
  79        enum {
  80                BCSP_ESCSTATE_NOESC,
  81                BCSP_ESCSTATE_ESC
  82        } rx_esc_state;
  83
  84        u8      use_crc;
  85        u16     message_crc;
  86        u8      txack_req;              /* Do we need to send ack's to the peer? */
  87
  88        /* Reliable packet sequence number - used to assign seq to each rel pkt. */
  89        u8      msgq_txseq;
  90};
  91
  92/* ---- BCSP CRC calculation ---- */
  93
  94/* Table for calculating CRC for polynomial 0x1021, LSB processed first,
  95initial value 0xffff, bits shifted in reverse order. */
  96
  97static const u16 crc_table[] = {
  98        0x0000, 0x1081, 0x2102, 0x3183,
  99        0x4204, 0x5285, 0x6306, 0x7387,
 100        0x8408, 0x9489, 0xa50a, 0xb58b,
 101        0xc60c, 0xd68d, 0xe70e, 0xf78f
 102};
 103
 104/* Initialise the crc calculator */
 105#define BCSP_CRC_INIT(x) x = 0xffff
 106
 107/*
 108   Update crc with next data byte
 109
 110   Implementation note
 111        The data byte is treated as two nibbles.  The crc is generated
 112        in reverse, i.e., bits are fed into the register from the top.
 113*/
 114static void bcsp_crc_update(u16 *crc, u8 d)
 115{
 116        u16 reg = *crc;
 117
 118        reg = (reg >> 4) ^ crc_table[(reg ^ d) & 0x000f];
 119        reg = (reg >> 4) ^ crc_table[(reg ^ (d >> 4)) & 0x000f];
 120
 121        *crc = reg;
 122}
 123
 124/* ---- BCSP core ---- */
 125
 126static void bcsp_slip_msgdelim(struct sk_buff *skb)
 127{
 128        const char pkt_delim = 0xc0;
 129
 130        memcpy(skb_put(skb, 1), &pkt_delim, 1);
 131}
 132
 133static void bcsp_slip_one_byte(struct sk_buff *skb, u8 c)
 134{
 135        const char esc_c0[2] = { 0xdb, 0xdc };
 136        const char esc_db[2] = { 0xdb, 0xdd };
 137
 138        switch (c) {
 139        case 0xc0:
 140                memcpy(skb_put(skb, 2), &esc_c0, 2);
 141                break;
 142        case 0xdb:
 143                memcpy(skb_put(skb, 2), &esc_db, 2);
 144                break;
 145        default:
 146                memcpy(skb_put(skb, 1), &c, 1);
 147        }
 148}
 149
 150static int bcsp_enqueue(struct hci_uart *hu, struct sk_buff *skb)
 151{
 152        struct bcsp_struct *bcsp = hu->priv;
 153
 154        if (skb->len > 0xFFF) {
 155                BT_ERR("Packet too long");
 156                kfree_skb(skb);
 157                return 0;
 158        }
 159
 160        switch (bt_cb(skb)->pkt_type) {
 161        case HCI_ACLDATA_PKT:
 162        case HCI_COMMAND_PKT:
 163                skb_queue_tail(&bcsp->rel, skb);
 164                break;
 165
 166        case HCI_SCODATA_PKT:
 167                skb_queue_tail(&bcsp->unrel, skb);
 168                break;
 169
 170        default:
 171                BT_ERR("Unknown packet type");
 172                kfree_skb(skb);
 173                break;
 174        }
 175
 176        return 0;
 177}
 178
 179static struct sk_buff *bcsp_prepare_pkt(struct bcsp_struct *bcsp, u8 *data,
 180                int len, int pkt_type)
 181{
 182        struct sk_buff *nskb;
 183        u8 hdr[4], chan;
 184        u16 BCSP_CRC_INIT(bcsp_txmsg_crc);
 185        int rel, i;
 186
 187        switch (pkt_type) {
 188        case HCI_ACLDATA_PKT:
 189                chan = 6;       /* BCSP ACL channel */
 190                rel = 1;        /* reliable channel */
 191                break;
 192        case HCI_COMMAND_PKT:
 193                chan = 5;       /* BCSP cmd/evt channel */
 194                rel = 1;        /* reliable channel */
 195                break;
 196        case HCI_SCODATA_PKT:
 197                chan = 7;       /* BCSP SCO channel */
 198                rel = 0;        /* unreliable channel */
 199                break;
 200        case BCSP_LE_PKT:
 201                chan = 1;       /* BCSP LE channel */
 202                rel = 0;        /* unreliable channel */
 203                break;
 204        case BCSP_ACK_PKT:
 205                chan = 0;       /* BCSP internal channel */
 206                rel = 0;        /* unreliable channel */
 207                break;
 208        default:
 209                BT_ERR("Unknown packet type");
 210                return NULL;
 211        }
 212
 213        if (hciextn && chan == 5) {
 214                __le16 opcode = ((struct hci_command_hdr *)data)->opcode;
 215
 216                /* Vendor specific commands */
 217                if (hci_opcode_ogf(__le16_to_cpu(opcode)) == 0x3f) {
 218                        u8 desc = *(data + HCI_COMMAND_HDR_SIZE);
 219                        if ((desc & 0xf0) == 0xc0) {
 220                                data += HCI_COMMAND_HDR_SIZE + 1;
 221                                len  -= HCI_COMMAND_HDR_SIZE + 1;
 222                                chan = desc & 0x0f;
 223                        }
 224                }
 225        }
 226
 227        /* Max len of packet: (original len +4(bcsp hdr) +2(crc))*2
 228           (because bytes 0xc0 and 0xdb are escaped, worst case is
 229           when the packet is all made of 0xc0 and 0xdb :) )
 230           + 2 (0xc0 delimiters at start and end). */
 231
 232        nskb = alloc_skb((len + 6) * 2 + 2, GFP_ATOMIC);
 233        if (!nskb)
 234                return NULL;
 235
 236        bt_cb(nskb)->pkt_type = pkt_type;
 237
 238        bcsp_slip_msgdelim(nskb);
 239
 240        hdr[0] = bcsp->rxseq_txack << 3;
 241        bcsp->txack_req = 0;
 242        BT_DBG("We request packet no %u to card", bcsp->rxseq_txack);
 243
 244        if (rel) {
 245                hdr[0] |= 0x80 + bcsp->msgq_txseq;
 246                BT_DBG("Sending packet with seqno %u", bcsp->msgq_txseq);
 247                bcsp->msgq_txseq = (bcsp->msgq_txseq + 1) & 0x07;
 248        }
 249
 250        if (bcsp->use_crc)
 251                hdr[0] |= 0x40;
 252
 253        hdr[1] = ((len << 4) & 0xff) | chan;
 254        hdr[2] = len >> 4;
 255        hdr[3] = ~(hdr[0] + hdr[1] + hdr[2]);
 256
 257        /* Put BCSP header */
 258        for (i = 0; i < 4; i++) {
 259                bcsp_slip_one_byte(nskb, hdr[i]);
 260
 261                if (bcsp->use_crc)
 262                        bcsp_crc_update(&bcsp_txmsg_crc, hdr[i]);
 263        }
 264
 265        /* Put payload */
 266        for (i = 0; i < len; i++) {
 267                bcsp_slip_one_byte(nskb, data[i]);
 268
 269                if (bcsp->use_crc)
 270                        bcsp_crc_update(&bcsp_txmsg_crc, data[i]);
 271        }
 272
 273        /* Put CRC */
 274        if (bcsp->use_crc) {
 275                bcsp_txmsg_crc = bitrev16(bcsp_txmsg_crc);
 276                bcsp_slip_one_byte(nskb, (u8) ((bcsp_txmsg_crc >> 8) & 0x00ff));
 277                bcsp_slip_one_byte(nskb, (u8) (bcsp_txmsg_crc & 0x00ff));
 278        }
 279
 280        bcsp_slip_msgdelim(nskb);
 281        return nskb;
 282}
 283
 284/* This is a rewrite of pkt_avail in ABCSP */
 285static struct sk_buff *bcsp_dequeue(struct hci_uart *hu)
 286{
 287        struct bcsp_struct *bcsp = hu->priv;
 288        unsigned long flags;
 289        struct sk_buff *skb;
 290        
 291        /* First of all, check for unreliable messages in the queue,
 292           since they have priority */
 293
 294        if ((skb = skb_dequeue(&bcsp->unrel)) != NULL) {
 295                struct sk_buff *nskb = bcsp_prepare_pkt(bcsp, skb->data, skb->len, bt_cb(skb)->pkt_type);
 296                if (nskb) {
 297                        kfree_skb(skb);
 298                        return nskb;
 299                } else {
 300                        skb_queue_head(&bcsp->unrel, skb);
 301                        BT_ERR("Could not dequeue pkt because alloc_skb failed");
 302                }
 303        }
 304
 305        /* Now, try to send a reliable pkt. We can only send a
 306           reliable packet if the number of packets sent but not yet ack'ed
 307           is < than the winsize */
 308
 309        spin_lock_irqsave_nested(&bcsp->unack.lock, flags, SINGLE_DEPTH_NESTING);
 310
 311        if (bcsp->unack.qlen < BCSP_TXWINSIZE && (skb = skb_dequeue(&bcsp->rel)) != NULL) {
 312                struct sk_buff *nskb = bcsp_prepare_pkt(bcsp, skb->data, skb->len, bt_cb(skb)->pkt_type);
 313                if (nskb) {
 314                        __skb_queue_tail(&bcsp->unack, skb);
 315                        mod_timer(&bcsp->tbcsp, jiffies + HZ / 4);
 316                        spin_unlock_irqrestore(&bcsp->unack.lock, flags);
 317                        return nskb;
 318                } else {
 319                        skb_queue_head(&bcsp->rel, skb);
 320                        BT_ERR("Could not dequeue pkt because alloc_skb failed");
 321                }
 322        }
 323
 324        spin_unlock_irqrestore(&bcsp->unack.lock, flags);
 325
 326        /* We could not send a reliable packet, either because there are
 327           none or because there are too many unack'ed pkts. Did we receive
 328           any packets we have not acknowledged yet ? */
 329
 330        if (bcsp->txack_req) {
 331                /* if so, craft an empty ACK pkt and send it on BCSP unreliable
 332                   channel 0 */
 333                struct sk_buff *nskb = bcsp_prepare_pkt(bcsp, NULL, 0, BCSP_ACK_PKT);
 334                return nskb;
 335        }
 336
 337        /* We have nothing to send */
 338        return NULL;
 339}
 340
 341static int bcsp_flush(struct hci_uart *hu)
 342{
 343        BT_DBG("hu %p", hu);
 344        return 0;
 345}
 346
 347/* Remove ack'ed packets */
 348static void bcsp_pkt_cull(struct bcsp_struct *bcsp)
 349{
 350        struct sk_buff *skb, *tmp;
 351        unsigned long flags;
 352        int i, pkts_to_be_removed;
 353        u8 seqno;
 354
 355        spin_lock_irqsave(&bcsp->unack.lock, flags);
 356
 357        pkts_to_be_removed = skb_queue_len(&bcsp->unack);
 358        seqno = bcsp->msgq_txseq;
 359
 360        while (pkts_to_be_removed) {
 361                if (bcsp->rxack == seqno)
 362                        break;
 363                pkts_to_be_removed--;
 364                seqno = (seqno - 1) & 0x07;
 365        }
 366
 2 (bcsp->rxack == seqno)
 2636/a>                BT_ERR("CoPeerck&# loinvalipackets uot;);
 2636/a>
 2737/a>        BT_DBG("humove g to37;u tots_t ouof al37;u t, upo sendo %u",  2737/a>                i href="+code=pkts_to_be_removed" class="sref">pkts_to_be_removed--skb_queue_len(&bcsp->unack);
 2737/a>                 a href="+code=seqno" class="sref">seqno - 1) & 0x07;

 2737/a>
 2737/a>        i = 0;  2737/a>        skb_deeue_lewalk_saf a>(&bcsp->unack);skb);tmp;
{
 273                i <pkts_to_be_removed) {a href="drivers/bluetooth/hci_bcsp.c#L361" id="L367" class="line" name="L273"> 273                 2737/a>                i++)  273
 2838/a>                   href="+code=reskb_quunne" class="sref">unskb_quunne" a>(skb);bcsp->unack);
 2838/a>                kfree_skb(skb);
 2838/a>        }
 283
 2838/a>        if (skb_deeue_lepty Aa>(&bcsp->unack);
{a href="drivers/bluetooth/hci_bcsp.c#L361" id="L283" class="line" name="L283"> 2838/a>                modelimer" a>(&bcsp->tbcsp, 
 2838/a>
 2838/a>        spin_unlock_irqrestore(&bcsp->unack.lock, flags);
 2838/a>
 283        st (i &l pkts_to_be_removed) {a href="drivers/bluetooth/hci_bcsp.c#L361" id="L293" class="line" name="L293"> 2939/a>                   href="+code=re_ERR" class="sref">BT_ERR("Comove adnly se37;u toouof al37;u tots_tuot;, i, pkts_to_be_removed;

 293   2939/a>
 293
/* ReHandleCSP unne" -torablishnt">ackets *. Wn thw/span>
 2939/a>/*   detect a uot;
/*   dwe dothing to :) (yet)
bcsp_prehndleC_lkt" c>(struct hci_uart *hu)
bcsp_struct *bcsp = hu->priv;
u8 bcsconft" c> u8 bcsconftrpkt_cu> u8 bcsnyntt_cu> /* Putspotuot;
bcsp->kfrrxb" c>->data[bcsp->kfrrxb" c>->data[tmpqemc c>(&bcsp->kfrrxb" c>->data[bcsconft" c> sk_buff *nskb = nskoc_skb fa>(&am4a href="+code=pktGFP_ATOMIClass="sref">nskGFP_ATOMIC>;

BT_DBG("humFoua relLE conf " cot;);
nskb) {
 href="drivers/bluetooth/hci_bcsp.c#L3214 id="L3104 class="line" name="L3104> 31041a>                        skbqemcpc>(bcsn c_puu>(nskb, (bcsconftrpkt_cu> bt_cb(nskb) {
t;pkt_type);
BCSP_ACKLET" c>;
skb_queue_head(&bcsp->unrel, nskb);
bcs_uart" c_tx_wakeuc>(hu);
/* We Spotuot;
bcsp->kfrrxb" c>->data[bcsp->kfrrxb" c>->data[tmpqemc c>(&bcsp->kfrrxb" c>->data[bcsnyntt_cu> BT_ERR("ComFoua relLE nyntck. , cardve s tor eot;);
i    d bcsp_sliunp_one_byte" c>(struct bcsp_struct *bcsp = ,signed lonchar href="+code=bcsp" class="sref">bcsp" c>(st
 href="drivers/bluetooth/hci_bcsp.c#L3214 id="L3254 class="line" name="L3254> 3254/a>
u8 u8);
kfrdb>);
bcsp->bcsrxbesc_tic c>(st
BCSP_ACKESCSTATE_NOESC>   : href="drivers/bluetooth/hci_bcsp.c#L3614 id="L3304 class="line" name="L3304> 33043a>                   uwitcha href="+code=bcsp" class="sref">bcsp" c>(st
bcsp->bcsrxbesc_tic c>(stBCSP_ACKESCSTATE_ESC>   a href="drivers/bluetooth/hci_bcsp.c#L3214 id="L3334 class="line" name="L3334> 3334/a>                strrrrrrrrrak;
skbqemcpc>(bcsn c_puu>(bcsp->kfrrxb" c>-&g, 1)amp;bcsp" c>(st, 1)a href="drivers/bluetooth/hci_bcsp.c#L3634 id="L3164 class="line" name="L3364> 33643a>                        bcsp->kfrrxb" c>->data[bcsp->bcsrxbtic c>(st<BCSP_ACKW4_CRC>(st
 href="drivers/bluetooth/hci_bcsp.c#L3214 id="L3384 class="line" name="L3384> 33843a>                        ret     brehref="+code=bcsp" ccbcsp" cc(&bcsp->bcssages ic" c>, bcsp" c>(st
a href="drivers/bluetooth/hci_bcsp.c#L3634 id="L3194 class="line" name="L3394> 33943a>                        bcsp->bcsrxbcouau>->BCSP_ACKESCSTATE_ESC>   : href="drivers/bluetooth/hci_bcsp.c#L3614 id="L3444 class="line" name="L3444> 34444a>                retuwitcha href="+code=bcsp" class="sref">bcsp" c>(st
skbqemcpc>(bcsn c_puu>(bcsp->kfrrxb" c>-&g, 1)amp;u8);
, 1)a href="drivers/bluetooth/hci_bcsp.c#L3634 id="L3474 class="line" name="L3474> 34744a>                bcsp->kfrrxb" c>->data[bcsp->bcsrxbtic c>(st<BCSP_ACKW4_CRC>(st
 href="drivers/bluetooth/hci_bcsp.c#L3214 id="L3494 class="line" name="L3494> 34944a>                        bcsp" cc(&bcsp->bcssages ic" c>, bcsp->bcsrxbesc_tic c>(stBCSP_ACKESCSTATE_NOESC>   a href="drivers/bluetooth/hci_bcsp.c#L3634 id="L3414 class="line" name="L3514> 35145a>                        bcsp->bcsrxbcouau>->skbqemcpc>(bcsn c_puu>(bcsp->kfrrxb" c>-&g, 1)amp;kfrdb>);
, 1)a href="drivers/bluetooth/hci_bcsp.c#L3634 id="L3564 class="line" name="L3564> 35645a>                        bcsp->kfrrxb" c>->data[bcsp->bcsrxbtic c>(st<BCSP_ACKW4_CRC>(st
a href="drivers/bluetooth/hci_bcsp.c#L2914 id="L3484 class="line" name="L3584> 35845a>                        ret     brehref="+code=bcsp" ccbcsp" cc(&bcsp->bcssages ic" c>, bcsp->bcsrxbesc_tic c>(stBCSP_ACKESCSTATE_NOESC>   a href="drivers/bluetooth/hci_bcsp.c#L3634 id="L3604 class="line" name="L3604> 36046a>                        bcsp->bcsrxbcouau>->BT_ERR("ComIvalipacp" c37;u t02x after esccp" cot;, bcsp" c>(st
a href="drivers/bluetooth/hci_bcsp.c#L3634 id="L3654 class="line" name="L3654> 36546a>                        kfree_skb(bcsp->kfrrxb" c>-&g
a href="drivers/bluetooth/hci_bcsp.c#L3634 id="L3564 class="line" name="L3664> 36646a>                        bcsp->kfrrxb" c>-&gNULL;
                bcsp->bcsrxbtic c>(stBT_E_ACKW4_PKT_DELIMITEc>;
bcsp->bcsrxbcouau>-&g0; bcsp_precomplete_rxb" c>(hci_uart *hu)
bcsp_struct *bcsp = hu->priv;
bcsp="l_uc>;
bcsp->kfrrxb" c>->data[/* We iable pack_t
BT_DBG("humovve, bcsp->rxackdo _tk" c>-&g
a href="drivers/bluetooth/hci_bcsp.c#L3634 id="L2834 class="line" name="L2834> 2834/a>                   href="+code=resp" class="sref">bcsp->rxackdo _tk" c>-&g bcsp->rxackdo _tk" c>-&g37;u&qa 0x8a href="drivers/bluetooth/hci_bcsp.c#L3634 id="L3624 class="line" name="L2834> 28348a>                strhref="+code=bcsp" class="sref">bcsp->txack_req) { str= 1a href="drivers/bluetooth/hci_bcsp.c#L3634 id="L2734 class="line" name="L2834> 2834/a>
/* We If needed, transmin emp_reck_t
bcs_uart" c_tx_wakeuc>(hu);
bcsp->rxack == bcsp->kfrrxb" c>->data[BT_DBG("humovquest forck_t<7;u&qu from cardot;, bcsp->rxack ==bcsp_pkt_cull(strhref="+code=hu p" class="sref">bcsp-&gbcsp->kfrrxb" c>->data[bcsp->kfrrxb" c>->data[bt_cb(bcsp->kfrrxb" c>-&g
t;pkt_type);
BCSHCI_ACLDATAT" c>;
bcsp="l_uc>;
bcsp->kfrrxb" c>->data[bcsp->kfrrxb" c>->data[bt_cb(bcsp->kfrrxb" c>-&g
t;pkt_type);
BCSHCI_EVENTT" c>;
bcsp="l_uc>;
bcsp->kfrrxb" c>->data[bt_cb(bcsp->kfrrxb" c>-&g
t;pkt_type);
BCSHCI_SCODATAT" c>;
bcsp="l_uc>;
bcsp->kfrrxb" c>->data[bcsp->kfrrxb" c>->data[bcsp_prehndleC_lkt" c>(strhref="+code=skb class="sref">hu);
bcsp="l_uc>;
bcsp="l_uc>;
bcsp="l_uc>;
<) { href="drivers/bluetooth/hci_bcsp.c#L3485 id="L3115 class="line" name="L3115> 31151a>                mod_uarevent_hdc>    href="+code=bcs_dclass="sref">mod_dc>   a href="drivers/bluetooth/hci_bcsp.c#L3245 id="L3125 class="line" name="L3125> 3125/a>                strhref="+code=bcs class="sref">u8 bcsdesc> == bcsp->kfrrxb" c>->data[bcsdesc> == bcsdesc> == skb_bcextc>;
<) { href="drivers/bluetooth/hci_bcsp.c#L3485 id="L3065 class="line" name="L3165> 31651a>                        bcsdesc> == |a 0xcbcsn c_pu c>(bcsp->kfrrxb" c>-&g,;
skbqemcpc>(bcsn c_push>(bcsp->kfrrxb" c>-&g,;1)amp;bcsdesc> ==, 1)a href="drivers/bluetooth/hci_bcsp.c#L3635 id="L3195 class="line" name="L3195> 31951a>
mod_dc>    href="+code=locevclass="sref">bcsevc>;
mod_dc>    href="+code=locp" class="sref">skbp(&abcsp->kfrrxb" c>->skb(&aa href="drivers/bluetooth/hci_bcsp.c#L3635 id="L3125 class="line" name="L3225> 32252a>                        bre     brehref="+code=bcsqemcpclass="sref">skbqemcpc>(bcsn c_push>(bcsp->kfrrxb" c>-&g,;href="+code=bcsHCI_EVENTTHDR_SIZElass="sref">BCSHCI_EVENTTHDR_SIZE>;
<)amp;mod_dc>   ,;href="+code=bcsHCI_EVENTTHDR_SIZElass="sref">BCSHCI_EVENTTHDR_SIZE>;
<)a href="drivers/bluetooth/hci_bcsp.c#L3635 3d="L3005 class="line" name="L3235> 32352a>                strrrrrrrrr     brehref="+code=bcspb" class="sref">bt_cb(bcsp->kfrrxb" c>-&g
t;pkt_type);
BCSHCI_EVENTT" c>;
mod_uarrecv_fr="L>(bcsp->kfrrxb" c>-&g
a href="drivers/bluetooth/hci_bcsp.c#L2885 id="L3065 class="line" name="L3265> 32652a>                        BT_ERR("ComPet, e forcunknownnchannel (7;u&qu 7;u&qs)ot;, bcsp->kfrrxb" c>->data[bcsp->kfrrxb" c>->data["Comiable paot;, < : hn class="string">"Comel, <
a href="drivers/bluetooth/hci_bcsp.c#L2885 id="L3315 class="line" name="L3315> 3315/a>                kfree_skb(bcsp->kfrrxb" c>-&g
a href="drivers/bluetooth/hci_bcsp.c#L3635 id="L3225 class="line" name="L3325> 33253a>                        brea href="drivers/bluetooth/hci_bcsp.c#L3235 id="L3335 class="line" name="L3335> 3335/a>                stra e {
 href="drivers/bluetooth/hci_bcsp.c#L3245 id="L3345 class="line" name="L3345> 3345/a>                ret     kfree_skb(bcsp->kfrrxb" c>-&g
a href="drivers/bluetooth/hci_bcsp.c#L3635 5d="L3045 class="line" name="L3355> 33553a>           a e {
<{ href="drivers/bluetooth/hci_bcsp.c#L3485 id="L3165 class="line" name="L3365> 33653a>                   hn class="comment">/* We Pullouof P unn_dc
bcsn c_pu c>(bcsp->kfrrxb" c>-&g,;
mod_uarrecv_fr="L>(bcsp->kfrrxb" c>-&g
a href="drivers/bluetooth/hci_bcsp.c#L2885 id="L3405 class="line" name="L3405> 34054a>           a href="drivers/bluetooth/hci_bcsp.c#L3235 id="L3415 class="line" name="L3415> 34154a>    href="drivers/bluetooth/hci_bcsp.c#L3235 id="L3225 class="line" name="L3425> 34254a>           href="+code=skbp" class="sref">bcsp->bcsrxbtic c>(stBT_E_ACKW4_PKT_DELIMITEc>;
bcsp->kfrrxb" c>-&gNULL;
u8    href="+code=skbpscp_getc" class="sref">bcspscp_getc" c>(bcsp_struct *bcsp = a href="drivers/bluetooth/hci_bcsp.c#L3425 id="L3475 class="line" name="L3475> 34754a>   a href="drivers/bluetooth/hci_bcsp.c#L3615 id="L3485 class="line" name="L3485> 34854a>           urn 0; href="+code=bcsgetcunaled lo_be class="linf">u8(bcsp->kfrrxb" c>->data[bcsp->kfrrxb" c>->skb(&a - 2]
a href="drivers/bluetooth/hci_bcsp.c#L2885 id="L3195 class="line" name="L3495> 34954a>   a href="drivers/bluetooth/hci_bcsp.c#L3235 id="L3505 class="line" name="L3505> 35055a>
/* We Recv a
bcsp_strrecv>(hci_uart *hu)
<,id data[bcscouau>-&ga href="drivers/bluetooth/hci_bcsp.c#L3425 id="L3535 class="line" name="L3535> 35355a>
bcsp_struct *bcsp = hu->priv;
modptc>;
BT_DBG("humhu 7;u&qp couau 7;u&qd rxbtic c 7;u&qd rxbcouau 7;u&qldot;, hu)
<,ihref="+code=i" couaulass="sref">bcscouau>-&ga href="+code=hu p" class="sref">bcsp->bcsrxbtic c>(sta href="+code=hu p" class="sref">bcsp->bcsrxbcouau>-&g
a href="drivers/bluetooth/hci_bcsp.c#L2885 id="L3495 class="line" name="L3595> 35955a>
modptc>;
<data[bcscouau>-&ga<{ href="drivers/bluetooth/hci_bcsp.c#L3485 id="L3625 class="line" name="L3625> 36256a>                   (bcsp->bcsrxbcouau>-&g
<{ href="drivers/bluetooth/hci_bcsp.c#L3485 id="L3535 class="line" name="L3635> 3635/a>                modptc>;
<BT_ERR("ComShorf P unnpet, eot;, <
a href="drivers/bluetooth/hci_bcsp.c#L2885 id="L3655 class="line" name="L3655> 36556a>                        kfree_skb(bcsp->kfrrxb" c>-&g
a href="drivers/bluetooth/hci_bcsp.c#L3635 id="L3565 class="line" name="L3665> 36656a>                        bcsp->bcsrxbtic c>(stBCSP_ACKW4_PKT_STARc>[                bcsp->bcsrxbcouau>-&g0; bcsp_sliunp_one_byte" c>(strhref="+code=bcsp" class="sref">bcsp-&g,  href="+code=bcsptclass="sref">modptc>;
<
a href="drivers/bluetooth/hci_bcsp.c#L3635 id="L2735 class="line" name="L2735> 27357a>
modptc>;
<++bcscouau>->bcsp->bcsrxbtic c>(st)<{ href="drivers/bluetooth/hci_bcsp.c#L3485 id="L2735 class="line" name="L2735> 27357a>                   ca{
BT_E_ACKW4_P_ACKHDc>   : href="drivers/bluetooth/hci_bcsp.c#L3615 id="L3675 class="line" name="L2735> 27357a>                u8 bcsp->kfrrxb" c>->data[bcsp->kfrrxb" c>->data[bcsp->kfrrxb" c>->data[bcsp->kfrrxb" c>->data[BT_ERR("ComError in P unn_dc, <
a href="drivers/bluetooth/hci_bcsp.c#L2885 id="L2835 class="line" name="L2835> 2835/a>                        bre     kfree_skb(bcsp->kfrrxb" c>-&g
a href="drivers/bluetooth/hci_bcsp.c#L3635 id="L2835 class="line" name="L2835> 2835/a>                bcsp->bcsrxbtic c>(stBT_E_ACKW4_PKT_DELIMITEc>;
bcsp->bcsrxbcouau>-&g0; bcsp->kfrrxb" c>->data[/* We iable pack_t
bcsp->kfrrxb" c>->data[bcsp->rxackdo _tk" c>-&g
<{ href="drivers/bluetooth/hci_bcsp.c#L3485 id="L2835 class="line" name="L2835> 28358a>                BT_ERR("ComOut-of-ordernpet, e arers/d, got<7;u&qu expected<7;u", bcsp->kfrrxb" c>->data[bcsp->rxackdo _tk" c>-&g
a href="drivers/bluetooth/hci_bcsp.c#L3635 id="L2835 class="line" name="L2835> 28358a>
kfree_skb(bcsp->kfrrxb" c>-&g
a href="drivers/bluetooth/hci_bcsp.c#L3635 id="L2935 class="line" name="L2935> 29359a>                bcsp->bcsrxbtic c>(stBT_E_ACKW4_PKT_DELIMITEc>;
bcsp->bcsrxbcouau>-&g0; bcsp->bcsrxbtic c>(stBT_E_ACKW4_DATA>;
bcsp->bcsrxbcouau>-&g0;  href="+code=bcsp" class="sref">bcsp->kfrrxb" c>->data[bcsp->kfrrxb" c>->data[/* We May be 0
BT_E_ACKW4_DATA>;
<: href="drivers/bluetooth/hci_bcsp.c#L3616 1d="L3006 class="line" name="L2936> 30160a>                bcsp->kfrrxb" c>->data[/* We k_t
bcsp->bcsrxbtic c>(stBCSP_ACKW4_CRC>(sta href="drivers/bluetooth/hci_bcsp.c#L3646 3d="L3006 class="line" name="L2936> 30360a>                strrrrrrrrr     brehref="+code=bcsp" class="sref">bcsp->bcsrxbcouau>-&g0; 2a href="drivers/bluetooth/hci_bcsp.c#L3646 4d="L3006 class="line" name="L2936> 30460a>                bcsp_precomplete_rxb" c>(hu);
BCSP_ACKW4_CRC>(st: href="drivers/bluetooth/hci_bcsp.c#L3616 9d="L3076 class="line" name="L2996> 30960a>                        bre(u8(bcsp->bcssages ic" c>, <)<bcspscp_getc" c>(bcsp-&g)) { href="drivers/bluetooth/hci_bcsp.c#L3486 id="L3106 class="line" name="L3106> 31061a>                        bre     BT_ERR("ComChecksum failed: computed<7;u&q04x rvve, u8(bcsp->bcssages ic" c>, <)a href="drivers/bluetooth/hci_bcsp.c#L3486 2d="L3006 class="line" name="L3126> 3126/a>                str        rrrrrrrr     brehref="+code=bcspscp_getc" class="sref">bcspscp_getc" c>(bcsp-&g))a href="drivers/bluetooth/hci_bcsp.c#L3646 3d="L3006 class="line" name="L3136> 31361a>
kfree_skb(bcsp->kfrrxb" c>-&g
a href="drivers/bluetooth/hci_bcsp.c#L3636 5d="L3046 class="line" name="L3156> 3156/a>                                brehref="+code=bcsp" class="sref">bcsp->bcsrxbtic c>(stBT_E_ACKW4_PKT_DELIMITEc>;
bcsp->bcsrxbcouau>-&g0; bcsn c_ng"m>(bcsp->kfrrxb" c>-&ga href="+code=hu p" class="sref">bcsp->kfrrxb" c>->skb(&a - 2
a href="drivers/bluetooth/hci_bcsp.c#L3636 id="L3206 class="line" name="L3206> 3206/a>                        rethref="+code=bcsp" ctcomplete_rxb" class="sref">bcsp_precomplete_rxb" c>(hu);
BT_E_ACKW4_PKT_DELIMITEc>;
<: href="drivers/bluetooth/hci_bcsp.c#L3616 id="L3246 class="line" name="L3246> 32462a>                   rrrrrrrruwitcha  href="+code=bcsptclass="sref">modptc>;
<
 { href="drivers/bluetooth/hci_bcsp.c#L3486 5d="L3046 class="line" name="L3256> 32562a>                           ca{
<0xc<: href="drivers/bluetooth/hci_bcsp.c#L3616 id="L3066 class="line" name="L3266> 32662a>                        bcsp->bcsrxbtic c>(stBCSP_ACKW4_PKT_STARc>[/* WeERR& e" cn7;u&q02xot;
modptc>;
<++bcscouau>->BCSP_ACKW4_PKT_STARc>[modptc>;
<
 { href="drivers/bluetooth/hci_bcsp.c#L3486 id="L3376 class="line" name="L3376> 33763a>                modptc>;
<++bcscouau>->bcsp->bcsrxbtic c>(stBT_E_ACKW4_P_ACKHDc>   a href="drivers/bluetooth/hci_bcsp.c#L2886 id="L3336 class="line" name="L3436> 34364a>                strrrrrrrrr     brehref="+code=bcsp" class="sref">bcsp->bcsrxbcouau>-&g0; 4a href="drivers/bluetooth/hci_bcsp.c#L2886 id="L3246 class="line" name="L3446> 34464a>                   rrrrrrrr     brehref="+code=bcsp" class="sref">bcsp->bcsrxbescbtic c>(stBT_E_ACKESCSTATE_NOESC>   a href="drivers/bluetooth/hci_bcsp.c#L2886 5d="L3046 class="line" name="L3456> 34564a>                                brehref="+code=bcsE_ACKCRC_INIclass="sref">BCSP_ACKCRC_INIc>(bcsp->bcssages ic" c>, <)a href="drivers/bluetooth/hci_bcsp.c#L2886 id="L3166 class="line" name="L3466> 34664a>    href="drivers/bluetooth/hci_bcsp.c#L2886 id="L3476 class="line" name="L3476> 34764a>                /* We Do not incret">/ ptc or decret">/ couau>-n>
/*              
/*              
bcsp->kfrrxb" c>-&gbcsptb" c_alloc>(BT_GFP_ATOMIC>, <)a href="drivers/bluetooth/hci_bcsp.c#L2886 id="L3526 class="line" name="L3526> 35265a>                strrrrrrrrrrrrrrrrr(bcsp->kfrrxb" c>-&g
 { href="drivers/bluetooth/hci_bcsp.c#L3486 id="L3536 class="line" name="L3536> 35365a>                strrrrrrrrr     bre     BT_ERR("ComCan't allocc c mem forcnewnpet, eot;, <
a href="drivers/bluetooth/hci_bcsp.c#L2886 id="L3546 class="line" name="L3546> 35465a>                   rrrrrrrr     bre     bcsp->bcsrxbtic c>(stBT_E_ACKW4_PKT_DELIMITEc>;
bcsp->bcsrxbcouau>-&g0; bcsp->kfrrxb" c>->priaec>-&g0; (d hu->prihaec>-&ga href="drivers/bluetooth/hci_bcsp.c#L3246 id="L3196 class="line" name="L3596> 35965a>                        str     bcscouau>-&ga href="drivers/bluetooth/hci_bcsp.c#L2886 id="L3556 class="line" name="L3656> 36566a>   a href="drivers/bluetooth/hci_bcsp.c#L3646 id="L3166 class="line" name="L3666> 36666a>    href="drivers/bluetooth/hci_bcsp.c#L2886 id="L3476 class="line" name="L2636seq"366a>           hn class="comment">/* We Arrange to urnransmit all sages is in the iabq.
bcsp_pretimedrevent>(bcsarg>-&g
 href="drivers/bluetooth/hci_bcsp.c#L3486 id="L3196 class="line" name="L2636> 26366a>   { href="drivers/bluetooth/hci_bcsp.c#L3486 id="L2736 class="line" name="L2736> 27367a>           uct hci_uart *hu)
<0; (uct hci_uart *bcsarg>-&ga href="drivers/bluetooth/hci_bcsp.c#L2886 id="L3616 class="line" name="L2736> 27367a>           uct bcsp_struct *bcsp = hu->priv;
bcsn _buff> *kfr" c>-&ga href="drivers/bluetooth/hci_bcsp.c#L2886 id="L3536 class="line" name="L2736> 27367a>           igned lonlong href="+code=bcsflagslass="sref">kfrflags>-&ga href="drivers/bluetooth/hci_bcsp.c#L2886 id="L3546 class="line" name="L2736> 27367a>    href="drivers/bluetooth/hci_bcsp.c#L2886 id="L3656 class="line" name="L2736> 27367a>           href="+code=spiERR" class="sref">BT_DBG("humhu 7;u&qp urnransmitt">& 7;u&qu pktsot;, hu-&ga href="+code=hu p" class="sref">bcsp->rxaun" c>-&g href="+code=locq" class="sref">skbq(&a
a href="drivers/bluetooth/hci_bcsp.c#L2886 id="L2736 class="line" name="L2736> 27367a>    href="drivers/bluetooth/hci_bcsp.c#L2886 id="L3676 class="line" name="L2736> 27367a>           href="+code=bcsspin_lock_irqsave_nestedlass="sref">kfr"pin_lock_irqsave_nested>(bcsp->rxaun" c>-&g href="+code=loclocklass="sref">skb-&ga href="+code=hu flagslass="sref">kfrflags>-&ga href="+code=hu SINGLE_DEPTH_NESTINGlass="sref">kfrSINGLE_DEPTH_NESTING>(&a
a href="drivers/bluetooth/hci_bcsp.c#L2886 id="L3486 class="line" name="L2736> 27367a>
kfr" c>-&gbcs_b" c_dequeue_taic>(bcsp->rxaun" c>-&g))<NULL;
<
 { href="drivers/bluetooth/hci_bcsp.c#L3486 id="L2836 class="line" name="L2836> 2836/a>                   href="+code=skbp" class="sref">bcsp->bcsssg _tkseq>)
<0; (href="+code=skbp" class="sref">bcsp->bcsssg _tkseq>)
<0- 1)mp; 0x07;07a href="drivers/bluetooth/hci_bcsp.c#L2886 id="L2836 class="line" name="L2836> 2836/a>                kfr" c_queue_head>(bcsp->kfrrel>-&ga href="+code=hu " class="sref">kfr" c>-&g
a href="drivers/bluetooth/hci_bcsp.c#L2886 id="L3626 class="line" name="L2836> 28368a>           a href="drivers/bluetooth/hci_bcsp.c#L3646 id="L2736 class="line" name="L2836> 28368a>
bcsspin_unlock_irqrestorc>(bcsp->rxaun" c>-&g href="+code=loclocklass="sref">skb-&ga href="+code=hu flagslass="sref">kfrflags>-&g
a href="drivers/bluetooth/hci_bcsp.c#L2886 id="L3656 class="line" name="L2836> 28368a>    href="drivers/bluetooth/hci_bcsp.c#L3236 id="L2736 class="line" name="L2836> 28368a>           href="+code=bcs_uart" c_tk_wakeuclass="sref">bcs_uart" c_tk_wakeuc>(hu);
skbp_strop c>(hci_uart *hu)
<
 href="drivers/bluetooth/hci_bcsp.c#L3486 id="L2936 class="line" name="L2936> 29369a>   { href="drivers/bluetooth/hci_bcsp.c#L3486 id="L2936 class="line" name="L2936> 29369a>           uct bcsp_struct *bcsp = a href="drivers/bluetooth/hci_bcsp.c#L3446 id="L3626 class="line" name="L2936> 29369a>
BT_DBG("humhu 7;u&qpot;, hu-&gbcsp = bcskzalloc>(bcsp = )a href="+code=hu GFP_KERNEclass="sref">NULGFP_KERNEc>-&gbcsp-&g
 href="drivers/bluetooth/hci_bcsp.c#L3486 id="L2836 class="line" name="L2976> 29769a>                bcsENOMEM> = a href="drivers/bluetooth/hci_bcsp.c#L3446 id="L3486 class="line" name="L2986> 29869a>
hu->priv;
<bcsp = a href="drivers/bluetooth/hci_bcsp.c#L3447 id="L3007 class="line" name="L3007> 30070a>           href="+code=skb" c_queue_head_iniclass="sref">bcs" c_queue_head_inic>(bcsp->rxaun" c>-&g)a href="drivers/bluetooth/hci_bcsp.c#L3447 1d="L3007 class="line" name="L2937> 30170a>           href="+code=skb" c_queue_head_iniclass="sref">bcs" c_queue_head_inic>(bcsp->kfrrel>-&g)a href="drivers/bluetooth/hci_bcsp.c#L3447 2d="L3007 class="line" name="L2937> 30270a>           href="+code=skb" c_queue_head_iniclass="sref">bcs" c_queue_head_inic>(bcsp->kfruniab>-&g)a href="drivers/bluetooth/hci_bcsp.c#L3447 3d="L3007 class="line" name="L2937> 30370a>
modinicetimec>(bcsp->bcstp-&g
a href="drivers/bluetooth/hci_bcsp.c#L3447 5d="L3007 class="line" name="L2957> 30570a>           href="+code=spip" class="sref">bcsp = t;bcstp-&g href="+code=locfunctioclass="sref">skbfunctioc>;
<bcsp_pretimedrevent>(bcsp = t;bcstp-&g href="+code=loca" class="sref">data[kfru_long>;
<
 href="+code=bcs_class="sref">hu-&ga href="drivers/bluetooth/hci_bcsp.c#L3447 7d="L3007 class="line" name="L2977> 30770a>bcsp->bcsrxbtic c>(stBT_E_ACKW4_PKT_DELIMITEc>;
bcstx" c>-&g
 href="drivers/bluetooth/hci_bcsp.c#L3487 id="L3117 class="line" name="L3117> 31171a>                bcsp->bcsusic" c>(st   hnlDELIMITEc7;
skbp_strop c>(hci_uart *bcsp_struct *bcsp = hu->hu->rxaunu->hu7;
BT_DBG("humhu 7;u&qpot;, bcs" c_queue_head_inic>(bcsp->DELIMITEc7;
<: href="drivers/bluet7oth/h72_bcsp.c#L2836 id="L2836 class     hrefpurg 28368a>              hrefpurg kb" c_queue_head_iniclass="sref">bcs" c_queue_head_inic>(bcsp->modptc>;7<
 { href="drivers/bluet7oth/h72_bcsp.c#L3447 5d="L3007 clas      hrefpurg 28368a>              hrefpurg kb" c_queue_head_iniclass="sref">bcs" c_queue_head_inic>(bcsp->    ca{
<7xc<: href="drivers/bluet7oth/h72_bcsp.c#L3447 6d="L3007 clasdeline" name="L2937> 304deline" n     href="+code=bcsinicetimeclass="sref">modinicetimec>(bcsp->PKT_STARc7[P        7ult: href="drivers/bluet7oth/h7i_bcsp.c#L3616 3d="L3007 class="line" name="L3137> 31371a>      ptc);/spa7>
 28368a>           hrprotobcsp.f="+code=bcsp_struct" class="sref">bcsp_struc.c#L3486 id="L2936 class="line" name="L297cscouau>-7gt->        HCI_UARTa hreef">rc#L3486 id="L2936 class="line" name="L297cELIMITEc7eaka href="drivers/bluet7oth/h734bcsp.c#L3646/a> = t; 28368tic voi #L3487 id="-> = t; = t;-> = t;-> = t; = t;-> 30270a>     _ode=skb" /a>-> 30270a>     line"L293=bcs_6 idhci_uart * 28368a>           hrregister_proto     href="+code=bcsinicetimeclass="sref">modiniceti a>->ATE_NOESC7   a href="drivers/bluet7oth/h74_bcsp.c#L3647 5d="L30476ef="+1ic cl714a>   hnles ic" c>7 <)a href="drivers/bluet7oth/h74_bcsp.c#L3446 id="L2736 class="liername="L2937> 304ernp_sthci_uart *"ComCan't allocc c mem forcnewnpet, e7/ couau>-7>
BT"string">"ComCan't allocc c mem forcnewnpet, e7" c)
-7g
 { href="drivers/bluet7oth/h75_bcsp.c#L3447 3d="L3007 class="line" name="L29t;7 <
a href="drivers/bluet7oth/h7i_bcsp6 id="L2836 class="_"ex937> 30270a>     _oex93kb" /a>-> 30270a>     line"deL293=bcs_6 idhci_uart *gister_proto36> 28368a>           href">gister_proto     href="+code=bcsinicetimeclass="sref">modiniceti a>->     urn 7; prihaec7-&ga href="drivers/bluet7oth/h7i_bcsp"+code=bcsinicemodule_para1961a>          module_para1=bcs_uart" c_tk_wakeine" name="L3107> 31071a>    tsot;,      bcsrxbescbtic c>MODULE_PARM_D">b=bcs_uart" c_tk_wakeine" name="L3107> 31071a>    tso       CRCa>["ComCan't allocc c mem forcnewnpet, e7         7          module_para1=bcs_uart" c_tk_wakee" extme="L2836> 28368e" extm    tsot;,  rxb" c>-7   a href="drivers/bluet7oth/h7i_bcspot;, bcsrxbescbtic c>MODULE_PARM_D">b=bcs_uart" c_tk_wakee" extme="L2836> 28368e" extm    tso    "ComCan't allocc c mem forcnewnpet, e7 ;7   a href="drivers/bluet7oth/h7i_bcsp


The original LXR software bys="coomCan'http://sourceforge.net/projects/lxr">LXR ass=u293y tsthis experi="lial allocstrbysomCan'mf">to:lxr@driux.no">lxr@driux.no .
lxr.driux.no kindly ho_locrbysomCan'http://www.redpill-dripro.no">Redpill Lripro AS tsprovider Lriuxs="lsul(and operabcsts services since 1995.