Commit 0d48d939 authored by Marcel Holtmann's avatar Marcel Holtmann Committed by David S. Miller

[Bluetooth]: Move packet type into the SKB control buffer

This patch moves the usage of packet type into the SKB control
buffer. After this patch it is now possible to shrink the sk_buff
structure and redefine its pkt_type.
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2eb25a6c
...@@ -330,7 +330,7 @@ static inline int bfusb_recv_block(struct bfusb *bfusb, int hdr, unsigned char * ...@@ -330,7 +330,7 @@ static inline int bfusb_recv_block(struct bfusb *bfusb, int hdr, unsigned char *
} }
skb->dev = (void *) bfusb->hdev; skb->dev = (void *) bfusb->hdev;
skb->pkt_type = pkt_type; bt_cb(skb)->pkt_type = pkt_type;
bfusb->reassembly = skb; bfusb->reassembly = skb;
} else { } else {
...@@ -485,7 +485,7 @@ static int bfusb_send_frame(struct sk_buff *skb) ...@@ -485,7 +485,7 @@ static int bfusb_send_frame(struct sk_buff *skb)
unsigned char buf[3]; unsigned char buf[3];
int sent = 0, size, count; int sent = 0, size, count;
BT_DBG("hdev %p skb %p type %d len %d", hdev, skb, skb->pkt_type, skb->len); BT_DBG("hdev %p skb %p type %d len %d", hdev, skb, bt_cb(skb)->pkt_type, skb->len);
if (!hdev) { if (!hdev) {
BT_ERR("Frame for unknown HCI device (hdev=NULL)"); BT_ERR("Frame for unknown HCI device (hdev=NULL)");
...@@ -497,7 +497,7 @@ static int bfusb_send_frame(struct sk_buff *skb) ...@@ -497,7 +497,7 @@ static int bfusb_send_frame(struct sk_buff *skb)
bfusb = (struct bfusb *) hdev->driver_data; bfusb = (struct bfusb *) hdev->driver_data;
switch (skb->pkt_type) { switch (bt_cb(skb)->pkt_type) {
case HCI_COMMAND_PKT: case HCI_COMMAND_PKT:
hdev->stat.cmd_tx++; hdev->stat.cmd_tx++;
break; break;
...@@ -510,7 +510,7 @@ static int bfusb_send_frame(struct sk_buff *skb) ...@@ -510,7 +510,7 @@ static int bfusb_send_frame(struct sk_buff *skb)
}; };
/* Prepend skb with frame type */ /* Prepend skb with frame type */
memcpy(skb_push(skb, 1), &(skb->pkt_type), 1); memcpy(skb_push(skb, 1), &bt_cb(skb)->pkt_type, 1);
count = skb->len; count = skb->len;
......
...@@ -270,7 +270,7 @@ static void bluecard_write_wakeup(bluecard_info_t *info) ...@@ -270,7 +270,7 @@ static void bluecard_write_wakeup(bluecard_info_t *info)
if (!(skb = skb_dequeue(&(info->txq)))) if (!(skb = skb_dequeue(&(info->txq))))
break; break;
if (skb->pkt_type & 0x80) { if (bt_cb(skb)->pkt_type & 0x80) {
/* Disable RTS */ /* Disable RTS */
info->ctrl_reg |= REG_CONTROL_RTS; info->ctrl_reg |= REG_CONTROL_RTS;
outb(info->ctrl_reg, iobase + REG_CONTROL); outb(info->ctrl_reg, iobase + REG_CONTROL);
...@@ -288,13 +288,13 @@ static void bluecard_write_wakeup(bluecard_info_t *info) ...@@ -288,13 +288,13 @@ static void bluecard_write_wakeup(bluecard_info_t *info)
/* Mark the buffer as dirty */ /* Mark the buffer as dirty */
clear_bit(ready_bit, &(info->tx_state)); clear_bit(ready_bit, &(info->tx_state));
if (skb->pkt_type & 0x80) { if (bt_cb(skb)->pkt_type & 0x80) {
DECLARE_WAIT_QUEUE_HEAD(wq); DECLARE_WAIT_QUEUE_HEAD(wq);
DEFINE_WAIT(wait); DEFINE_WAIT(wait);
unsigned char baud_reg; unsigned char baud_reg;
switch (skb->pkt_type) { switch (bt_cb(skb)->pkt_type) {
case PKT_BAUD_RATE_460800: case PKT_BAUD_RATE_460800:
baud_reg = REG_CONTROL_BAUD_RATE_460800; baud_reg = REG_CONTROL_BAUD_RATE_460800;
break; break;
...@@ -410,9 +410,9 @@ static void bluecard_receive(bluecard_info_t *info, unsigned int offset) ...@@ -410,9 +410,9 @@ static void bluecard_receive(bluecard_info_t *info, unsigned int offset)
if (info->rx_state == RECV_WAIT_PACKET_TYPE) { if (info->rx_state == RECV_WAIT_PACKET_TYPE) {
info->rx_skb->dev = (void *) info->hdev; info->rx_skb->dev = (void *) info->hdev;
info->rx_skb->pkt_type = buf[i]; bt_cb(info->rx_skb)->pkt_type = buf[i];
switch (info->rx_skb->pkt_type) { switch (bt_cb(info->rx_skb)->pkt_type) {
case 0x00: case 0x00:
/* init packet */ /* init packet */
...@@ -444,7 +444,7 @@ static void bluecard_receive(bluecard_info_t *info, unsigned int offset) ...@@ -444,7 +444,7 @@ static void bluecard_receive(bluecard_info_t *info, unsigned int offset)
default: default:
/* unknown packet */ /* unknown packet */
BT_ERR("Unknown HCI packet with type 0x%02x received", info->rx_skb->pkt_type); BT_ERR("Unknown HCI packet with type 0x%02x received", bt_cb(info->rx_skb)->pkt_type);
info->hdev->stat.err_rx++; info->hdev->stat.err_rx++;
kfree_skb(info->rx_skb); kfree_skb(info->rx_skb);
...@@ -586,21 +586,21 @@ static int bluecard_hci_set_baud_rate(struct hci_dev *hdev, int baud) ...@@ -586,21 +586,21 @@ static int bluecard_hci_set_baud_rate(struct hci_dev *hdev, int baud)
switch (baud) { switch (baud) {
case 460800: case 460800:
cmd[4] = 0x00; cmd[4] = 0x00;
skb->pkt_type = PKT_BAUD_RATE_460800; bt_cb(skb)->pkt_type = PKT_BAUD_RATE_460800;
break; break;
case 230400: case 230400:
cmd[4] = 0x01; cmd[4] = 0x01;
skb->pkt_type = PKT_BAUD_RATE_230400; bt_cb(skb)->pkt_type = PKT_BAUD_RATE_230400;
break; break;
case 115200: case 115200:
cmd[4] = 0x02; cmd[4] = 0x02;
skb->pkt_type = PKT_BAUD_RATE_115200; bt_cb(skb)->pkt_type = PKT_BAUD_RATE_115200;
break; break;
case 57600: case 57600:
/* Fall through... */ /* Fall through... */
default: default:
cmd[4] = 0x03; cmd[4] = 0x03;
skb->pkt_type = PKT_BAUD_RATE_57600; bt_cb(skb)->pkt_type = PKT_BAUD_RATE_57600;
break; break;
} }
...@@ -680,7 +680,7 @@ static int bluecard_hci_send_frame(struct sk_buff *skb) ...@@ -680,7 +680,7 @@ static int bluecard_hci_send_frame(struct sk_buff *skb)
info = (bluecard_info_t *)(hdev->driver_data); info = (bluecard_info_t *)(hdev->driver_data);
switch (skb->pkt_type) { switch (bt_cb(skb)->pkt_type) {
case HCI_COMMAND_PKT: case HCI_COMMAND_PKT:
hdev->stat.cmd_tx++; hdev->stat.cmd_tx++;
break; break;
...@@ -693,7 +693,7 @@ static int bluecard_hci_send_frame(struct sk_buff *skb) ...@@ -693,7 +693,7 @@ static int bluecard_hci_send_frame(struct sk_buff *skb)
}; };
/* Prepend skb with frame type */ /* Prepend skb with frame type */
memcpy(skb_push(skb, 1), &(skb->pkt_type), 1); memcpy(skb_push(skb, 1), &bt_cb(skb)->pkt_type, 1);
skb_queue_tail(&(info->txq), skb); skb_queue_tail(&(info->txq), skb);
bluecard_write_wakeup(info); bluecard_write_wakeup(info);
......
...@@ -105,7 +105,7 @@ static void bpa10x_recv_bulk(struct bpa10x_data *data, unsigned char *buf, int c ...@@ -105,7 +105,7 @@ static void bpa10x_recv_bulk(struct bpa10x_data *data, unsigned char *buf, int c
if (skb) { if (skb) {
memcpy(skb_put(skb, len), buf, len); memcpy(skb_put(skb, len), buf, len);
skb->dev = (void *) data->hdev; skb->dev = (void *) data->hdev;
skb->pkt_type = HCI_ACLDATA_PKT; bt_cb(skb)->pkt_type = HCI_ACLDATA_PKT;
hci_recv_frame(skb); hci_recv_frame(skb);
} }
break; break;
...@@ -117,7 +117,7 @@ static void bpa10x_recv_bulk(struct bpa10x_data *data, unsigned char *buf, int c ...@@ -117,7 +117,7 @@ static void bpa10x_recv_bulk(struct bpa10x_data *data, unsigned char *buf, int c
if (skb) { if (skb) {
memcpy(skb_put(skb, len), buf, len); memcpy(skb_put(skb, len), buf, len);
skb->dev = (void *) data->hdev; skb->dev = (void *) data->hdev;
skb->pkt_type = HCI_SCODATA_PKT; bt_cb(skb)->pkt_type = HCI_SCODATA_PKT;
hci_recv_frame(skb); hci_recv_frame(skb);
} }
break; break;
...@@ -129,7 +129,7 @@ static void bpa10x_recv_bulk(struct bpa10x_data *data, unsigned char *buf, int c ...@@ -129,7 +129,7 @@ static void bpa10x_recv_bulk(struct bpa10x_data *data, unsigned char *buf, int c
if (skb) { if (skb) {
memcpy(skb_put(skb, len), buf, len); memcpy(skb_put(skb, len), buf, len);
skb->dev = (void *) data->hdev; skb->dev = (void *) data->hdev;
skb->pkt_type = HCI_VENDOR_PKT; bt_cb(skb)->pkt_type = HCI_VENDOR_PKT;
hci_recv_frame(skb); hci_recv_frame(skb);
} }
break; break;
...@@ -190,7 +190,7 @@ static int bpa10x_recv_event(struct bpa10x_data *data, unsigned char *buf, int s ...@@ -190,7 +190,7 @@ static int bpa10x_recv_event(struct bpa10x_data *data, unsigned char *buf, int s
} }
skb->dev = (void *) data->hdev; skb->dev = (void *) data->hdev;
skb->pkt_type = pkt_type; bt_cb(skb)->pkt_type = pkt_type;
memcpy(skb_put(skb, size), buf, size); memcpy(skb_put(skb, size), buf, size);
...@@ -488,7 +488,7 @@ static int bpa10x_send_frame(struct sk_buff *skb) ...@@ -488,7 +488,7 @@ static int bpa10x_send_frame(struct sk_buff *skb)
struct hci_dev *hdev = (struct hci_dev *) skb->dev; struct hci_dev *hdev = (struct hci_dev *) skb->dev;
struct bpa10x_data *data; struct bpa10x_data *data;
BT_DBG("hdev %p skb %p type %d len %d", hdev, skb, skb->pkt_type, skb->len); BT_DBG("hdev %p skb %p type %d len %d", hdev, skb, bt_cb(skb)->pkt_type, skb->len);
if (!hdev) { if (!hdev) {
BT_ERR("Frame for unknown HCI device"); BT_ERR("Frame for unknown HCI device");
...@@ -501,9 +501,9 @@ static int bpa10x_send_frame(struct sk_buff *skb) ...@@ -501,9 +501,9 @@ static int bpa10x_send_frame(struct sk_buff *skb)
data = hdev->driver_data; data = hdev->driver_data;
/* Prepend skb with frame type */ /* Prepend skb with frame type */
memcpy(skb_push(skb, 1), &(skb->pkt_type), 1); memcpy(skb_push(skb, 1), &bt_cb(skb)->pkt_type, 1);
switch (skb->pkt_type) { switch (bt_cb(skb)->pkt_type) {
case HCI_COMMAND_PKT: case HCI_COMMAND_PKT:
hdev->stat.cmd_tx++; hdev->stat.cmd_tx++;
skb_queue_tail(&data->cmd_queue, skb); skb_queue_tail(&data->cmd_queue, skb);
......
...@@ -259,11 +259,11 @@ static void bt3c_receive(bt3c_info_t *info) ...@@ -259,11 +259,11 @@ static void bt3c_receive(bt3c_info_t *info)
if (info->rx_state == RECV_WAIT_PACKET_TYPE) { if (info->rx_state == RECV_WAIT_PACKET_TYPE) {
info->rx_skb->dev = (void *) info->hdev; info->rx_skb->dev = (void *) info->hdev;
info->rx_skb->pkt_type = inb(iobase + DATA_L); bt_cb(info->rx_skb)->pkt_type = inb(iobase + DATA_L);
inb(iobase + DATA_H); inb(iobase + DATA_H);
//printk("bt3c: PACKET_TYPE=%02x\n", info->rx_skb->pkt_type); //printk("bt3c: PACKET_TYPE=%02x\n", bt_cb(info->rx_skb)->pkt_type);
switch (info->rx_skb->pkt_type) { switch (bt_cb(info->rx_skb)->pkt_type) {
case HCI_EVENT_PKT: case HCI_EVENT_PKT:
info->rx_state = RECV_WAIT_EVENT_HEADER; info->rx_state = RECV_WAIT_EVENT_HEADER;
...@@ -282,7 +282,7 @@ static void bt3c_receive(bt3c_info_t *info) ...@@ -282,7 +282,7 @@ static void bt3c_receive(bt3c_info_t *info)
default: default:
/* Unknown packet */ /* Unknown packet */
BT_ERR("Unknown HCI packet with type 0x%02x received", info->rx_skb->pkt_type); BT_ERR("Unknown HCI packet with type 0x%02x received", bt_cb(info->rx_skb)->pkt_type);
info->hdev->stat.err_rx++; info->hdev->stat.err_rx++;
clear_bit(HCI_RUNNING, &(info->hdev->flags)); clear_bit(HCI_RUNNING, &(info->hdev->flags));
...@@ -439,7 +439,7 @@ static int bt3c_hci_send_frame(struct sk_buff *skb) ...@@ -439,7 +439,7 @@ static int bt3c_hci_send_frame(struct sk_buff *skb)
info = (bt3c_info_t *) (hdev->driver_data); info = (bt3c_info_t *) (hdev->driver_data);
switch (skb->pkt_type) { switch (bt_cb(skb)->pkt_type) {
case HCI_COMMAND_PKT: case HCI_COMMAND_PKT:
hdev->stat.cmd_tx++; hdev->stat.cmd_tx++;
break; break;
...@@ -452,7 +452,7 @@ static int bt3c_hci_send_frame(struct sk_buff *skb) ...@@ -452,7 +452,7 @@ static int bt3c_hci_send_frame(struct sk_buff *skb)
}; };
/* Prepend skb with frame type */ /* Prepend skb with frame type */
memcpy(skb_push(skb, 1), &(skb->pkt_type), 1); memcpy(skb_push(skb, 1), &bt_cb(skb)->pkt_type, 1);
skb_queue_tail(&(info->txq), skb); skb_queue_tail(&(info->txq), skb);
spin_lock_irqsave(&(info->lock), flags); spin_lock_irqsave(&(info->lock), flags);
......
...@@ -211,9 +211,9 @@ static void btuart_receive(btuart_info_t *info) ...@@ -211,9 +211,9 @@ static void btuart_receive(btuart_info_t *info)
if (info->rx_state == RECV_WAIT_PACKET_TYPE) { if (info->rx_state == RECV_WAIT_PACKET_TYPE) {
info->rx_skb->dev = (void *) info->hdev; info->rx_skb->dev = (void *) info->hdev;
info->rx_skb->pkt_type = inb(iobase + UART_RX); bt_cb(info->rx_skb)->pkt_type = inb(iobase + UART_RX);
switch (info->rx_skb->pkt_type) { switch (bt_cb(info->rx_skb)->pkt_type) {
case HCI_EVENT_PKT: case HCI_EVENT_PKT:
info->rx_state = RECV_WAIT_EVENT_HEADER; info->rx_state = RECV_WAIT_EVENT_HEADER;
...@@ -232,7 +232,7 @@ static void btuart_receive(btuart_info_t *info) ...@@ -232,7 +232,7 @@ static void btuart_receive(btuart_info_t *info)
default: default:
/* Unknown packet */ /* Unknown packet */
BT_ERR("Unknown HCI packet with type 0x%02x received", info->rx_skb->pkt_type); BT_ERR("Unknown HCI packet with type 0x%02x received", bt_cb(info->rx_skb)->pkt_type);
info->hdev->stat.err_rx++; info->hdev->stat.err_rx++;
clear_bit(HCI_RUNNING, &(info->hdev->flags)); clear_bit(HCI_RUNNING, &(info->hdev->flags));
...@@ -447,7 +447,7 @@ static int btuart_hci_send_frame(struct sk_buff *skb) ...@@ -447,7 +447,7 @@ static int btuart_hci_send_frame(struct sk_buff *skb)
info = (btuart_info_t *)(hdev->driver_data); info = (btuart_info_t *)(hdev->driver_data);
switch (skb->pkt_type) { switch (bt_cb(skb)->pkt_type) {
case HCI_COMMAND_PKT: case HCI_COMMAND_PKT:
hdev->stat.cmd_tx++; hdev->stat.cmd_tx++;
break; break;
...@@ -460,7 +460,7 @@ static int btuart_hci_send_frame(struct sk_buff *skb) ...@@ -460,7 +460,7 @@ static int btuart_hci_send_frame(struct sk_buff *skb)
}; };
/* Prepend skb with frame type */ /* Prepend skb with frame type */
memcpy(skb_push(skb, 1), &(skb->pkt_type), 1); memcpy(skb_push(skb, 1), &bt_cb(skb)->pkt_type, 1);
skb_queue_tail(&(info->txq), skb); skb_queue_tail(&(info->txq), skb);
btuart_write_wakeup(info); btuart_write_wakeup(info);
......
...@@ -251,7 +251,7 @@ static void dtl1_receive(dtl1_info_t *info) ...@@ -251,7 +251,7 @@ static void dtl1_receive(dtl1_info_t *info)
info->rx_count = nsh->len + (nsh->len & 0x0001); info->rx_count = nsh->len + (nsh->len & 0x0001);
break; break;
case RECV_WAIT_DATA: case RECV_WAIT_DATA:
info->rx_skb->pkt_type = nsh->type; bt_cb(info->rx_skb)->pkt_type = nsh->type;
/* remove PAD byte if it exists */ /* remove PAD byte if it exists */
if (nsh->len & 0x0001) { if (nsh->len & 0x0001) {
...@@ -262,7 +262,7 @@ static void dtl1_receive(dtl1_info_t *info) ...@@ -262,7 +262,7 @@ static void dtl1_receive(dtl1_info_t *info)
/* remove NSH */ /* remove NSH */
skb_pull(info->rx_skb, NSHL); skb_pull(info->rx_skb, NSHL);
switch (info->rx_skb->pkt_type) { switch (bt_cb(info->rx_skb)->pkt_type) {
case 0x80: case 0x80:
/* control data for the Nokia Card */ /* control data for the Nokia Card */
dtl1_control(info, info->rx_skb); dtl1_control(info, info->rx_skb);
...@@ -272,12 +272,12 @@ static void dtl1_receive(dtl1_info_t *info) ...@@ -272,12 +272,12 @@ static void dtl1_receive(dtl1_info_t *info)
case 0x84: case 0x84:
/* send frame to the HCI layer */ /* send frame to the HCI layer */
info->rx_skb->dev = (void *) info->hdev; info->rx_skb->dev = (void *) info->hdev;
info->rx_skb->pkt_type &= 0x0f; bt_cb(info->rx_skb)->pkt_type &= 0x0f;
hci_recv_frame(info->rx_skb); hci_recv_frame(info->rx_skb);
break; break;
default: default:
/* unknown packet */ /* unknown packet */
BT_ERR("Unknown HCI packet with type 0x%02x received", info->rx_skb->pkt_type); BT_ERR("Unknown HCI packet with type 0x%02x received", bt_cb(info->rx_skb)->pkt_type);
kfree_skb(info->rx_skb); kfree_skb(info->rx_skb);
break; break;
} }
...@@ -410,7 +410,7 @@ static int dtl1_hci_send_frame(struct sk_buff *skb) ...@@ -410,7 +410,7 @@ static int dtl1_hci_send_frame(struct sk_buff *skb)
info = (dtl1_info_t *)(hdev->driver_data); info = (dtl1_info_t *)(hdev->driver_data);
switch (skb->pkt_type) { switch (bt_cb(skb)->pkt_type) {
case HCI_COMMAND_PKT: case HCI_COMMAND_PKT:
hdev->stat.cmd_tx++; hdev->stat.cmd_tx++;
nsh.type = 0x81; nsh.type = 0x81;
......
...@@ -149,7 +149,7 @@ static int bcsp_enqueue(struct hci_uart *hu, struct sk_buff *skb) ...@@ -149,7 +149,7 @@ static int bcsp_enqueue(struct hci_uart *hu, struct sk_buff *skb)
return 0; return 0;
} }
switch (skb->pkt_type) { switch (bt_cb(skb)->pkt_type) {
case HCI_ACLDATA_PKT: case HCI_ACLDATA_PKT:
case HCI_COMMAND_PKT: case HCI_COMMAND_PKT:
skb_queue_tail(&bcsp->rel, skb); skb_queue_tail(&bcsp->rel, skb);
...@@ -227,7 +227,7 @@ static struct sk_buff *bcsp_prepare_pkt(struct bcsp_struct *bcsp, u8 *data, ...@@ -227,7 +227,7 @@ static struct sk_buff *bcsp_prepare_pkt(struct bcsp_struct *bcsp, u8 *data,
if (!nskb) if (!nskb)
return NULL; return NULL;
nskb->pkt_type = pkt_type; bt_cb(nskb)->pkt_type = pkt_type;
bcsp_slip_msgdelim(nskb); bcsp_slip_msgdelim(nskb);
...@@ -286,7 +286,7 @@ static struct sk_buff *bcsp_dequeue(struct hci_uart *hu) ...@@ -286,7 +286,7 @@ static struct sk_buff *bcsp_dequeue(struct hci_uart *hu)
since they have priority */ since they have priority */
if ((skb = skb_dequeue(&bcsp->unrel)) != NULL) { if ((skb = skb_dequeue(&bcsp->unrel)) != NULL) {
struct sk_buff *nskb = bcsp_prepare_pkt(bcsp, skb->data, skb->len, skb->pkt_type); struct sk_buff *nskb = bcsp_prepare_pkt(bcsp, skb->data, skb->len, bt_cb(skb)->pkt_type);
if (nskb) { if (nskb) {
kfree_skb(skb); kfree_skb(skb);
return nskb; return nskb;
...@@ -303,7 +303,7 @@ static struct sk_buff *bcsp_dequeue(struct hci_uart *hu) ...@@ -303,7 +303,7 @@ static struct sk_buff *bcsp_dequeue(struct hci_uart *hu)
spin_lock_irqsave(&bcsp->unack.lock, flags); spin_lock_irqsave(&bcsp->unack.lock, flags);
if (bcsp->unack.qlen < BCSP_TXWINSIZE && (skb = skb_dequeue(&bcsp->rel)) != NULL) { if (bcsp->unack.qlen < BCSP_TXWINSIZE && (skb = skb_dequeue(&bcsp->rel)) != NULL) {
struct sk_buff *nskb = bcsp_prepare_pkt(bcsp, skb->data, skb->len, skb->pkt_type); struct sk_buff *nskb = bcsp_prepare_pkt(bcsp, skb->data, skb->len, bt_cb(skb)->pkt_type);
if (nskb) { if (nskb) {
__skb_queue_tail(&bcsp->unack, skb); __skb_queue_tail(&bcsp->unack, skb);
mod_timer(&bcsp->tbcsp, jiffies + HZ / 4); mod_timer(&bcsp->tbcsp, jiffies + HZ / 4);
...@@ -401,7 +401,7 @@ static void bcsp_handle_le_pkt(struct hci_uart *hu) ...@@ -401,7 +401,7 @@ static void bcsp_handle_le_pkt(struct hci_uart *hu)
if (!nskb) if (!nskb)
return; return;
memcpy(skb_put(nskb, 4), conf_rsp_pkt, 4); memcpy(skb_put(nskb, 4), conf_rsp_pkt, 4);
nskb->pkt_type = BCSP_LE_PKT; bt_cb(nskb)->pkt_type = BCSP_LE_PKT;
skb_queue_head(&bcsp->unrel, nskb); skb_queue_head(&bcsp->unrel, nskb);
hci_uart_tx_wakeup(hu); hci_uart_tx_wakeup(hu);
...@@ -483,14 +483,14 @@ static inline void bcsp_complete_rx_pkt(struct hci_uart *hu) ...@@ -483,14 +483,14 @@ static inline void bcsp_complete_rx_pkt(struct hci_uart *hu)
bcsp_pkt_cull(bcsp); bcsp_pkt_cull(bcsp);
if ((bcsp->rx_skb->data[1] & 0x0f) == 6 && if ((bcsp->rx_skb->data[1] & 0x0f) == 6 &&
bcsp->rx_skb->data[0] & 0x80) { bcsp->rx_skb->data[0] & 0x80) {
bcsp->rx_skb->pkt_type = HCI_ACLDATA_PKT; bt_cb(bcsp->rx_skb)->pkt_type = HCI_ACLDATA_PKT;
pass_up = 1; pass_up = 1;
} else if ((bcsp->rx_skb->data[1] & 0x0f) == 5 && } else if ((bcsp->rx_skb->data[1] & 0x0f) == 5 &&
bcsp->rx_skb->data[0] & 0x80) { bcsp->rx_skb->data[0] & 0x80) {
bcsp->rx_skb->pkt_type = HCI_EVENT_PKT; bt_cb(bcsp->rx_skb)->pkt_type = HCI_EVENT_PKT;
pass_up = 1; pass_up = 1;
} else if ((bcsp->rx_skb->data[1] & 0x0f) == 7) { } else if ((bcsp->rx_skb->data[1] & 0x0f) == 7) {
bcsp->rx_skb->pkt_type = HCI_SCODATA_PKT; bt_cb(bcsp->rx_skb)->pkt_type = HCI_SCODATA_PKT;
pass_up = 1; pass_up = 1;
} else if ((bcsp->rx_skb->data[1] & 0x0f) == 1 && } else if ((bcsp->rx_skb->data[1] & 0x0f) == 1 &&
!(bcsp->rx_skb->data[0] & 0x80)) { !(bcsp->rx_skb->data[0] & 0x80)) {
...@@ -512,7 +512,7 @@ static inline void bcsp_complete_rx_pkt(struct hci_uart *hu) ...@@ -512,7 +512,7 @@ static inline void bcsp_complete_rx_pkt(struct hci_uart *hu)
hdr.evt = 0xff; hdr.evt = 0xff;
hdr.plen = bcsp->rx_skb->len; hdr.plen = bcsp->rx_skb->len;
memcpy(skb_push(bcsp->rx_skb, HCI_EVENT_HDR_SIZE), &hdr, HCI_EVENT_HDR_SIZE); memcpy(skb_push(bcsp->rx_skb, HCI_EVENT_HDR_SIZE), &hdr, HCI_EVENT_HDR_SIZE);
bcsp->rx_skb->pkt_type = HCI_EVENT_PKT; bt_cb(bcsp->rx_skb)->pkt_type = HCI_EVENT_PKT;
hci_recv_frame(bcsp->rx_skb); hci_recv_frame(bcsp->rx_skb);
} else { } else {
......
...@@ -112,7 +112,7 @@ static int h4_enqueue(struct hci_uart *hu, struct sk_buff *skb) ...@@ -112,7 +112,7 @@ static int h4_enqueue(struct hci_uart *hu, struct sk_buff *skb)
BT_DBG("hu %p skb %p", hu, skb); BT_DBG("hu %p skb %p", hu, skb);
/* Prepend skb with frame type */ /* Prepend skb with frame type */
memcpy(skb_push(skb, 1), &skb->pkt_type, 1); memcpy(skb_push(skb, 1), &bt_cb(skb)->pkt_type, 1);
skb_queue_tail(&h4->txq, skb); skb_queue_tail(&h4->txq, skb);
return 0; return 0;
} }
...@@ -239,7 +239,7 @@ static int h4_recv(struct hci_uart *hu, void *data, int count) ...@@ -239,7 +239,7 @@ static int h4_recv(struct hci_uart *hu, void *data, int count)
return 0; return 0;
} }
h4->rx_skb->dev = (void *) hu->hdev; h4->rx_skb->dev = (void *) hu->hdev;
h4->rx_skb->pkt_type = type; bt_cb(h4->rx_skb)->pkt_type = type;
} }
return count; return count;
} }
......
...@@ -153,7 +153,7 @@ int hci_uart_tx_wakeup(struct hci_uart *hu) ...@@ -153,7 +153,7 @@ int hci_uart_tx_wakeup(struct hci_uart *hu)
break; break;
} }
hci_uart_tx_complete(hu, skb->pkt_type); hci_uart_tx_complete(hu, bt_cb(skb)->pkt_type);
kfree_skb(skb); kfree_skb(skb);
} }
...@@ -229,7 +229,7 @@ static int hci_uart_send_frame(struct sk_buff *skb) ...@@ -229,7 +229,7 @@ static int hci_uart_send_frame(struct sk_buff *skb)
hu = (struct hci_uart *) hdev->driver_data; hu = (struct hci_uart *) hdev->driver_data;
tty = hu->tty; tty = hu->tty;
BT_DBG("%s: type %d len %d", hdev->name, skb->pkt_type, skb->len); BT_DBG("%s: type %d len %d", hdev->name, bt_cb(skb)->pkt_type, skb->len);
hu->proto->enqueue(hu, skb); hu->proto->enqueue(hu, skb);
......
...@@ -443,7 +443,7 @@ static int __tx_submit(struct hci_usb *husb, struct _urb *_urb) ...@@ -443,7 +443,7 @@ static int __tx_submit(struct hci_usb *husb, struct _urb *_urb)
static inline int hci_usb_send_ctrl(struct hci_usb *husb, struct sk_buff *skb) static inline int hci_usb_send_ctrl(struct hci_usb *husb, struct sk_buff *skb)
{ {
struct _urb *_urb = __get_completed(husb, skb->pkt_type); struct _urb *_urb = __get_completed(husb, bt_cb(skb)->pkt_type);
struct usb_ctrlrequest *dr; struct usb_ctrlrequest *dr;
struct urb *urb; struct urb *urb;
...@@ -451,7 +451,7 @@ static inline int hci_usb_send_ctrl(struct hci_usb *husb, struct sk_buff *skb) ...@@ -451,7 +451,7 @@ static inline int hci_usb_send_ctrl(struct hci_usb *husb, struct sk_buff *skb)
_urb = _urb_alloc(0, GFP_ATOMIC); _urb = _urb_alloc(0, GFP_ATOMIC);
if (!_urb) if (!_urb)
return -ENOMEM; return -ENOMEM;
_urb->type = skb->pkt_type; _urb->type = bt_cb(skb)->pkt_type;
dr = kmalloc(sizeof(*dr), GFP_ATOMIC); dr = kmalloc(sizeof(*dr), GFP_ATOMIC);
if (!dr) { if (!dr) {
...@@ -479,7 +479,7 @@ static inline int hci_usb_send_ctrl(struct hci_usb *husb, struct sk_buff *skb) ...@@ -479,7 +479,7 @@ static inline int hci_usb_send_ctrl(struct hci_usb *husb, struct sk_buff *skb)
static inline int hci_usb_send_bulk(struct hci_usb *husb, struct sk_buff *skb) static inline int hci_usb_send_bulk(struct hci_usb *husb, struct sk_buff *skb)
{ {
struct _urb *_urb = __get_completed(husb, skb->pkt_type); struct _urb *_urb = __get_completed(husb, bt_cb(skb)->pkt_type);
struct urb *urb; struct urb *urb;
int pipe; int pipe;
...@@ -487,7 +487,7 @@ static inline int hci_usb_send_bulk(struct hci_usb *husb, struct sk_buff *skb) ...@@ -487,7 +487,7 @@ static inline int hci_usb_send_bulk(struct hci_usb *husb, struct sk_buff *skb)
_urb = _urb_alloc(0, GFP_ATOMIC); _urb = _urb_alloc(0, GFP_ATOMIC);
if (!_urb) if (!_urb)
return -ENOMEM; return -ENOMEM;
_urb->type = skb->pkt_type; _urb->type = bt_cb(skb)->pkt_type;
} }
urb = &_urb->urb; urb = &_urb->urb;
...@@ -505,14 +505,14 @@ static inline int hci_usb_send_bulk(struct hci_usb *husb, struct sk_buff *skb) ...@@ -505,14 +505,14 @@ static inline int hci_usb_send_bulk(struct hci_usb *husb, struct sk_buff *skb)
#ifdef CONFIG_BT_HCIUSB_SCO #ifdef CONFIG_BT_HCIUSB_SCO
static inline int hci_usb_send_isoc(struct hci_usb *husb, struct sk_buff *skb) static inline int hci_usb_send_isoc(struct hci_usb *husb, struct sk_buff *skb)
{ {
struct _urb *_urb = __get_completed(husb, skb->pkt_type); struct _urb *_urb = __get_completed(husb, bt_cb(skb)->pkt_type);
struct urb *urb; struct urb *urb;
if (!_urb) { if (!_urb) {
_urb = _urb_alloc(HCI_MAX_ISOC_FRAMES, GFP_ATOMIC); _urb = _urb_alloc(HCI_MAX_ISOC_FRAMES, GFP_ATOMIC);
if (!_urb) if (!_urb)
return -ENOMEM; return -ENOMEM;
_urb->type = skb->pkt_type; _urb->type = bt_cb(skb)->pkt_type;
} }
BT_DBG("%s skb %p len %d", husb->hdev->name, skb, skb->len); BT_DBG("%s skb %p len %d", husb->hdev->name, skb, skb->len);
...@@ -601,11 +601,11 @@ static int hci_usb_send_frame(struct sk_buff *skb) ...@@ -601,11 +601,11 @@ static int hci_usb_send_frame(struct sk_buff *skb)
if (!test_bit(HCI_RUNNING, &hdev->flags)) if (!test_bit(HCI_RUNNING, &hdev->flags))
return -EBUSY; return -EBUSY;
BT_DBG("%s type %d len %d", hdev->name, skb->pkt_type, skb->len); BT_DBG("%s type %d len %d", hdev->name, bt_cb(skb)->pkt_type, skb->len);
husb = (struct hci_usb *) hdev->driver_data; husb = (struct hci_usb *) hdev->driver_data;
switch (skb->pkt_type) { switch (bt_cb(skb)->pkt_type) {
case HCI_COMMAND_PKT: case HCI_COMMAND_PKT:
hdev->stat.cmd_tx++; hdev->stat.cmd_tx++;
break; break;
...@@ -627,7 +627,7 @@ static int hci_usb_send_frame(struct sk_buff *skb) ...@@ -627,7 +627,7 @@ static int hci_usb_send_frame(struct sk_buff *skb)
read_lock(&husb->completion_lock); read_lock(&husb->completion_lock);
skb_queue_tail(__transmit_q(husb, skb->pkt_type), skb); skb_queue_tail(__transmit_q(husb, bt_cb(skb)->pkt_type), skb);
hci_usb_tx_wakeup(husb); hci_usb_tx_wakeup(husb);
read_unlock(&husb->completion_lock); read_unlock(&husb->completion_lock);
...@@ -682,7 +682,7 @@ static inline int __recv_frame(struct hci_usb *husb, int type, void *data, int c ...@@ -682,7 +682,7 @@ static inline int __recv_frame(struct hci_usb *husb, int type, void *data, int c
return -ENOMEM; return -ENOMEM;
} }
skb->dev = (void *) husb->hdev; skb->dev = (void *) husb->hdev;
skb->pkt_type = type; bt_cb(skb)->pkt_type = type;
__reassembly(husb, type) = skb; __reassembly(husb, type) = skb;
...@@ -702,6 +702,7 @@ static inline int __recv_frame(struct hci_usb *husb, int type, void *data, int c ...@@ -702,6 +702,7 @@ static inline int __recv_frame(struct hci_usb *husb, int type, void *data, int c
if (!scb->expect) { if (!scb->expect) {
/* Complete frame */ /* Complete frame */
__reassembly(husb, type) = NULL; __reassembly(husb, type) = NULL;
bt_cb(skb)->pkt_type = type;
hci_recv_frame(skb); hci_recv_frame(skb);
} }
......
...@@ -107,7 +107,7 @@ static int vhci_send_frame(struct sk_buff *skb) ...@@ -107,7 +107,7 @@ static int vhci_send_frame(struct sk_buff *skb)
vhci = hdev->driver_data; vhci = hdev->driver_data;
memcpy(skb_push(skb, 1), &skb->pkt_type, 1); memcpy(skb_push(skb, 1), &bt_cb(skb)->pkt_type, 1);
skb_queue_tail(&vhci->readq, skb); skb_queue_tail(&vhci->readq, skb);
if (vhci->flags & VHCI_FASYNC) if (vhci->flags & VHCI_FASYNC)
...@@ -141,7 +141,7 @@ static inline ssize_t vhci_get_user(struct vhci_data *vhci, ...@@ -141,7 +141,7 @@ static inline ssize_t vhci_get_user(struct vhci_data *vhci,
} }
skb->dev = (void *) vhci->hdev; skb->dev = (void *) vhci->hdev;
skb->pkt_type = *((__u8 *) skb->data); bt_cb(skb)->pkt_type = *((__u8 *) skb->data);
skb_pull(skb, 1); skb_pull(skb, 1);
hci_recv_frame(skb); hci_recv_frame(skb);
...@@ -164,7 +164,7 @@ static inline ssize_t vhci_put_user(struct vhci_data *vhci, ...@@ -164,7 +164,7 @@ static inline ssize_t vhci_put_user(struct vhci_data *vhci,
vhci->hdev->stat.byte_tx += len; vhci->hdev->stat.byte_tx += len;
switch (skb->pkt_type) { switch (bt_cb(skb)->pkt_type) {
case HCI_COMMAND_PKT: case HCI_COMMAND_PKT:
vhci->hdev->stat.cmd_tx++; vhci->hdev->stat.cmd_tx++;
break; break;
......
...@@ -131,7 +131,8 @@ struct sock *bt_accept_dequeue(struct sock *parent, struct socket *newsock); ...@@ -131,7 +131,8 @@ struct sock *bt_accept_dequeue(struct sock *parent, struct socket *newsock);
/* Skb helpers */ /* Skb helpers */
struct bt_skb_cb { struct bt_skb_cb {
int incoming; __u8 pkt_type;
__u8 incoming;
}; };
#define bt_cb(skb) ((struct bt_skb_cb *)(skb->cb)) #define bt_cb(skb) ((struct bt_skb_cb *)(skb->cb))
......
...@@ -191,7 +191,7 @@ static void hci_init_req(struct hci_dev *hdev, unsigned long opt) ...@@ -191,7 +191,7 @@ static void hci_init_req(struct hci_dev *hdev, unsigned long opt)
/* Special commands */ /* Special commands */
while ((skb = skb_dequeue(&hdev->driver_init))) { while ((skb = skb_dequeue(&hdev->driver_init))) {
skb->pkt_type = HCI_COMMAND_PKT; bt_cb(skb)->pkt_type = HCI_COMMAND_PKT;
skb->dev = (void *) hdev; skb->dev = (void *) hdev;
skb_queue_tail(&hdev->cmd_q, skb); skb_queue_tail(&hdev->cmd_q, skb);
hci_sched_cmd(hdev); hci_sched_cmd(hdev);
...@@ -995,7 +995,7 @@ static int hci_send_frame(struct sk_buff *skb) ...@@ -995,7 +995,7 @@ static int hci_send_frame(struct sk_buff *skb)
return -ENODEV; return -ENODEV;
} }
BT_DBG("%s type %d len %d", hdev->name, skb->pkt_type, skb->len); BT_DBG("%s type %d len %d", hdev->name, bt_cb(skb)->pkt_type, skb->len);
if (atomic_read(&hdev->promisc)) { if (atomic_read(&hdev->promisc)) {
/* Time stamp */ /* Time stamp */
...@@ -1034,7 +1034,7 @@ int hci_send_cmd(struct hci_dev *hdev, __u16 ogf, __u16 ocf, __u32 plen, void *p ...@@ -1034,7 +1034,7 @@ int hci_send_cmd(struct hci_dev *hdev, __u16 ogf, __u16 ocf, __u32 plen, void *p
BT_DBG("skb len %d", skb->len); BT_DBG("skb len %d", skb->len);
skb->pkt_type = HCI_COMMAND_PKT; bt_cb(skb)->pkt_type = HCI_COMMAND_PKT;
skb->dev = (void *) hdev; skb->dev = (void *) hdev;
skb_queue_tail(&hdev->cmd_q, skb); skb_queue_tail(&hdev->cmd_q, skb);
hci_sched_cmd(hdev); hci_sched_cmd(hdev);
...@@ -1081,7 +1081,7 @@ int hci_send_acl(struct hci_conn *conn, struct sk_buff *skb, __u16 flags) ...@@ -1081,7 +1081,7 @@ int hci_send_acl(struct hci_conn *conn, struct sk_buff *skb, __u16 flags)
BT_DBG("%s conn %p flags 0x%x", hdev->name, conn, flags); BT_DBG("%s conn %p flags 0x%x", hdev->name, conn, flags);
skb->dev = (void *) hdev; skb->dev = (void *) hdev;
skb->pkt_type = HCI_ACLDATA_PKT; bt_cb(skb)->pkt_type = HCI_ACLDATA_PKT;
hci_add_acl_hdr(skb, conn->handle, flags | ACL_START); hci_add_acl_hdr(skb, conn->handle, flags | ACL_START);
if (!(list = skb_shinfo(skb)->frag_list)) { if (!(list = skb_shinfo(skb)->frag_list)) {
...@@ -1103,7 +1103,7 @@ int hci_send_acl(struct hci_conn *conn, struct sk_buff *skb, __u16 flags) ...@@ -1103,7 +1103,7 @@ int hci_send_acl(struct hci_conn *conn, struct sk_buff *skb, __u16 flags)
skb = list; list = list->next; skb = list; list = list->next;
skb->dev = (void *) hdev; skb->dev = (void *) hdev;
skb->pkt_type = HCI_ACLDATA_PKT; bt_cb(skb)->pkt_type = HCI_ACLDATA_PKT;
hci_add_acl_hdr(skb, conn->handle, flags | ACL_CONT); hci_add_acl_hdr(skb, conn->handle, flags | ACL_CONT);
BT_DBG("%s frag %p len %d", hdev->name, skb, skb->len); BT_DBG("%s frag %p len %d", hdev->name, skb, skb->len);
...@@ -1139,7 +1139,7 @@ int hci_send_sco(struct hci_conn *conn, struct sk_buff *skb) ...@@ -1139,7 +1139,7 @@ int hci_send_sco(struct hci_conn *conn, struct sk_buff *skb)
memcpy(skb->h.raw, &hdr, HCI_SCO_HDR_SIZE); memcpy(skb->h.raw, &hdr, HCI_SCO_HDR_SIZE);
skb->dev = (void *) hdev; skb->dev = (void *) hdev;
skb->pkt_type = HCI_SCODATA_PKT; bt_cb(skb)->pkt_type = HCI_SCODATA_PKT;
skb_queue_tail(&conn->data_q, skb); skb_queue_tail(&conn->data_q, skb);
hci_sched_tx(hdev); hci_sched_tx(hdev);
return 0; return 0;
...@@ -1369,7 +1369,7 @@ void hci_rx_task(unsigned long arg) ...@@ -1369,7 +1369,7 @@ void hci_rx_task(unsigned long arg)
if (test_bit(HCI_INIT, &hdev->flags)) { if (test_bit(HCI_INIT, &hdev->flags)) {
/* Don't process data packets in this states. */ /* Don't process data packets in this states. */
switch (skb->pkt_type) { switch (bt_cb(skb)->pkt_type) {
case HCI_ACLDATA_PKT: case HCI_ACLDATA_PKT:
case HCI_SCODATA_PKT: case HCI_SCODATA_PKT:
kfree_skb(skb); kfree_skb(skb);
...@@ -1378,7 +1378,7 @@ void hci_rx_task(unsigned long arg) ...@@ -1378,7 +1378,7 @@ void hci_rx_task(unsigned long arg)
} }
/* Process frame */ /* Process frame */
switch (skb->pkt_type) { switch (bt_cb(skb)->pkt_type) {
case HCI_EVENT_PKT: case HCI_EVENT_PKT:
hci_event_packet(hdev, skb); hci_event_packet(hdev, skb);
break; break;
......
...@@ -1089,7 +1089,7 @@ void hci_si_event(struct hci_dev *hdev, int type, int dlen, void *data) ...@@ -1089,7 +1089,7 @@ void hci_si_event(struct hci_dev *hdev, int type, int dlen, void *data)
bt_cb(skb)->incoming = 1; bt_cb(skb)->incoming = 1;
do_gettimeofday(&skb->stamp); do_gettimeofday(&skb->stamp);
skb->pkt_type = HCI_EVENT_PKT; bt_cb(skb)->pkt_type = HCI_EVENT_PKT;
skb->dev = (void *) hdev; skb->dev = (void *) hdev;
hci_send_to_sock(hdev, skb); hci_send_to_sock(hdev, skb);
kfree_skb(skb); kfree_skb(skb);
......
...@@ -110,11 +110,11 @@ void hci_send_to_sock(struct hci_dev *hdev, struct sk_buff *skb) ...@@ -110,11 +110,11 @@ void hci_send_to_sock(struct hci_dev *hdev, struct sk_buff *skb)
/* Apply filter */ /* Apply filter */
flt = &hci_pi(sk)->filter; flt = &hci_pi(sk)->filter;
if (!test_bit((skb->pkt_type == HCI_VENDOR_PKT) ? if (!test_bit((bt_cb(skb)->pkt_type == HCI_VENDOR_PKT) ?
0 : (skb->pkt_type & HCI_FLT_TYPE_BITS), &flt->type_mask)) 0 : (bt_cb(skb)->pkt_type & HCI_FLT_TYPE_BITS), &flt->type_mask))
continue; continue;
if (skb->pkt_type == HCI_EVENT_PKT) { if (bt_cb(skb)->pkt_type == HCI_EVENT_PKT) {
register int evt = (*(__u8 *)skb->data & HCI_FLT_EVENT_BITS); register int evt = (*(__u8 *)skb->data & HCI_FLT_EVENT_BITS);
if (!hci_test_bit(evt, &flt->event_mask)) if (!hci_test_bit(evt, &flt->event_mask))
...@@ -131,7 +131,7 @@ void hci_send_to_sock(struct hci_dev *hdev, struct sk_buff *skb) ...@@ -131,7 +131,7 @@ void hci_send_to_sock(struct hci_dev *hdev, struct sk_buff *skb)
continue; continue;
/* Put type byte before the data */ /* Put type byte before the data */
memcpy(skb_push(nskb, 1), &nskb->pkt_type, 1); memcpy(skb_push(nskb, 1), &bt_cb(nskb)->pkt_type, 1);
if (sock_queue_rcv_skb(sk, nskb)) if (sock_queue_rcv_skb(sk, nskb))
kfree_skb(nskb); kfree_skb(nskb);
...@@ -327,8 +327,10 @@ static inline void hci_sock_cmsg(struct sock *sk, struct msghdr *msg, struct sk_ ...@@ -327,8 +327,10 @@ static inline void hci_sock_cmsg(struct sock *sk, struct msghdr *msg, struct sk_
{ {
__u32 mask = hci_pi(sk)->cmsg_mask; __u32 mask = hci_pi(sk)->cmsg_mask;
if (mask & HCI_CMSG_DIR) if (mask & HCI_CMSG_DIR) {
put_cmsg(msg, SOL_HCI, HCI_CMSG_DIR, sizeof(int), &bt_cb(skb)->incoming); int incoming = bt_cb(skb)->incoming;
put_cmsg(msg, SOL_HCI, HCI_CMSG_DIR, sizeof(incoming), &incoming);
}
if (mask & HCI_CMSG_TSTAMP) if (mask & HCI_CMSG_TSTAMP)
put_cmsg(msg, SOL_HCI, HCI_CMSG_TSTAMP, sizeof(skb->stamp), &skb->stamp); put_cmsg(msg, SOL_HCI, HCI_CMSG_TSTAMP, sizeof(skb->stamp), &skb->stamp);
...@@ -405,11 +407,11 @@ static int hci_sock_sendmsg(struct kiocb *iocb, struct socket *sock, ...@@ -405,11 +407,11 @@ static int hci_sock_sendmsg(struct kiocb *iocb, struct socket *sock,
goto drop; goto drop;
} }
skb->pkt_type = *((unsigned char *) skb->data); bt_cb(skb)->pkt_type = *((unsigned char *) skb->data);
skb_pull(skb, 1); skb_pull(skb, 1);
skb->dev = (void *) hdev; skb->dev = (void *) hdev;
if (skb->pkt_type == HCI_COMMAND_PKT) { if (bt_cb(skb)->pkt_type == HCI_COMMAND_PKT) {
u16 opcode = __le16_to_cpu(get_unaligned((u16 *)skb->data)); u16 opcode = __le16_to_cpu(get_unaligned((u16 *)skb->data));
u16 ogf = hci_opcode_ogf(opcode); u16 ogf = hci_opcode_ogf(opcode);
u16 ocf = hci_opcode_ocf(opcode); u16 ocf = hci_opcode_ocf(opcode);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment