Skip to content

Commit

Permalink
Merge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/ker…
Browse files Browse the repository at this point in the history
…nel/git/bluetooth/bluetooth-next

Johan Hedberg says:

====================
pull request: bluetooth-next 2015-11-23

Here's the first bluetooth-next pull request for the 4.5 kernel.

 - Add new Get Advertising Size Information management command
 - Add support for new system note message type on monitor channel
 - Refactor LE scan changes behind separate workqueue to avoid races
 - Fix issue with privacy feature when powering on adapter
 - Various minor fixes & cleanups here and there

Please let me know if there are any issues pulling. Thanks.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Nov 24, 2015
2 parents 73b1c90 + dc4270c commit 54f1aa2
Show file tree
Hide file tree
Showing 37 changed files with 1,378 additions and 1,165 deletions.
9 changes: 5 additions & 4 deletions drivers/bluetooth/bfusb.c
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ static inline int bfusb_recv_block(struct bfusb_data *data, int hdr, unsigned ch
return -ENOMEM;
}

bt_cb(skb)->pkt_type = pkt_type;
hci_skb_pkt_type(skb) = pkt_type;

data->reassembly = skb;
} else {
Expand Down Expand Up @@ -469,9 +469,10 @@ static int bfusb_send_frame(struct hci_dev *hdev, struct sk_buff *skb)
unsigned char buf[3];
int sent = 0, size, count;

BT_DBG("hdev %p skb %p type %d len %d", hdev, skb, bt_cb(skb)->pkt_type, skb->len);
BT_DBG("hdev %p skb %p type %d len %d", hdev, skb,
hci_skb_pkt_type(skb), skb->len);

switch (bt_cb(skb)->pkt_type) {
switch (hci_skb_pkt_type(skb)) {
case HCI_COMMAND_PKT:
hdev->stat.cmd_tx++;
break;
Expand All @@ -484,7 +485,7 @@ static int bfusb_send_frame(struct hci_dev *hdev, struct sk_buff *skb)
}

/* Prepend skb with frame type */
memcpy(skb_push(skb, 1), &bt_cb(skb)->pkt_type, 1);
memcpy(skb_push(skb, 1), &hci_skb_pkt_type(skb), 1);

count = skb->len;

Expand Down
25 changes: 13 additions & 12 deletions drivers/bluetooth/bluecard_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ static void bluecard_write_wakeup(struct bluecard_info *info)
if (!skb)
break;

if (bt_cb(skb)->pkt_type & 0x80) {
if (hci_skb_pkt_type(skb) & 0x80) {
/* Disable RTS */
info->ctrl_reg |= REG_CONTROL_RTS;
outb(info->ctrl_reg, iobase + REG_CONTROL);
Expand All @@ -279,13 +279,13 @@ static void bluecard_write_wakeup(struct bluecard_info *info)
/* Mark the buffer as dirty */
clear_bit(ready_bit, &(info->tx_state));

if (bt_cb(skb)->pkt_type & 0x80) {
if (hci_skb_pkt_type(skb) & 0x80) {
DECLARE_WAIT_QUEUE_HEAD_ONSTACK(wq);
DEFINE_WAIT(wait);

unsigned char baud_reg;

switch (bt_cb(skb)->pkt_type) {
switch (hci_skb_pkt_type(skb)) {
case PKT_BAUD_RATE_460800:
baud_reg = REG_CONTROL_BAUD_RATE_460800;
break;
Expand Down Expand Up @@ -402,9 +402,9 @@ static void bluecard_receive(struct bluecard_info *info,

if (info->rx_state == RECV_WAIT_PACKET_TYPE) {

bt_cb(info->rx_skb)->pkt_type = buf[i];
hci_skb_pkt_type(info->rx_skb) = buf[i];

switch (bt_cb(info->rx_skb)->pkt_type) {
switch (hci_skb_pkt_type(info->rx_skb)) {

case 0x00:
/* init packet */
Expand Down Expand Up @@ -436,7 +436,8 @@ static void bluecard_receive(struct bluecard_info *info,

default:
/* unknown packet */
BT_ERR("Unknown HCI packet with type 0x%02x received", bt_cb(info->rx_skb)->pkt_type);
BT_ERR("Unknown HCI packet with type 0x%02x received",
hci_skb_pkt_type(info->rx_skb));
info->hdev->stat.err_rx++;

kfree_skb(info->rx_skb);
Expand Down Expand Up @@ -578,21 +579,21 @@ static int bluecard_hci_set_baud_rate(struct hci_dev *hdev, int baud)
switch (baud) {
case 460800:
cmd[4] = 0x00;
bt_cb(skb)->pkt_type = PKT_BAUD_RATE_460800;
hci_skb_pkt_type(skb) = PKT_BAUD_RATE_460800;
break;
case 230400:
cmd[4] = 0x01;
bt_cb(skb)->pkt_type = PKT_BAUD_RATE_230400;
hci_skb_pkt_type(skb) = PKT_BAUD_RATE_230400;
break;
case 115200:
cmd[4] = 0x02;
bt_cb(skb)->pkt_type = PKT_BAUD_RATE_115200;
hci_skb_pkt_type(skb) = PKT_BAUD_RATE_115200;
break;
case 57600:
/* Fall through... */
default:
cmd[4] = 0x03;
bt_cb(skb)->pkt_type = PKT_BAUD_RATE_57600;
hci_skb_pkt_type(skb) = PKT_BAUD_RATE_57600;
break;
}

Expand Down Expand Up @@ -660,7 +661,7 @@ static int bluecard_hci_send_frame(struct hci_dev *hdev, struct sk_buff *skb)
{
struct bluecard_info *info = hci_get_drvdata(hdev);

switch (bt_cb(skb)->pkt_type) {
switch (hci_skb_pkt_type(skb)) {
case HCI_COMMAND_PKT:
hdev->stat.cmd_tx++;
break;
Expand All @@ -673,7 +674,7 @@ static int bluecard_hci_send_frame(struct hci_dev *hdev, struct sk_buff *skb)
}

/* Prepend skb with frame type */
memcpy(skb_push(skb, 1), &bt_cb(skb)->pkt_type, 1);
memcpy(skb_push(skb, 1), &hci_skb_pkt_type(skb), 1);
skb_queue_tail(&(info->txq), skb);

bluecard_write_wakeup(info);
Expand Down
4 changes: 2 additions & 2 deletions drivers/bluetooth/bpa10x.c
Original file line number Diff line number Diff line change
Expand Up @@ -295,9 +295,9 @@ static int bpa10x_send_frame(struct hci_dev *hdev, struct sk_buff *skb)
return -ENOMEM;

/* Prepend skb with frame type */
*skb_push(skb, 1) = bt_cb(skb)->pkt_type;
*skb_push(skb, 1) = hci_skb_pkt_type(skb);

switch (bt_cb(skb)->pkt_type) {
switch (hci_skb_pkt_type(skb)) {
case HCI_COMMAND_PKT:
dr = kmalloc(sizeof(*dr), GFP_ATOMIC);
if (!dr) {
Expand Down
11 changes: 6 additions & 5 deletions drivers/bluetooth/bt3c_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,10 +246,10 @@ static void bt3c_receive(struct bt3c_info *info)

if (info->rx_state == RECV_WAIT_PACKET_TYPE) {

bt_cb(info->rx_skb)->pkt_type = inb(iobase + DATA_L);
hci_skb_pkt_type(info->rx_skb) = inb(iobase + DATA_L);
inb(iobase + DATA_H);

switch (bt_cb(info->rx_skb)->pkt_type) {
switch (hci_skb_pkt_type(info->rx_skb)) {

case HCI_EVENT_PKT:
info->rx_state = RECV_WAIT_EVENT_HEADER;
Expand All @@ -268,7 +268,8 @@ static void bt3c_receive(struct bt3c_info *info)

default:
/* Unknown packet */
BT_ERR("Unknown HCI packet with type 0x%02x received", bt_cb(info->rx_skb)->pkt_type);
BT_ERR("Unknown HCI packet with type 0x%02x received",
hci_skb_pkt_type(info->rx_skb));
info->hdev->stat.err_rx++;

kfree_skb(info->rx_skb);
Expand Down Expand Up @@ -411,7 +412,7 @@ static int bt3c_hci_send_frame(struct hci_dev *hdev, struct sk_buff *skb)
struct bt3c_info *info = hci_get_drvdata(hdev);
unsigned long flags;

switch (bt_cb(skb)->pkt_type) {
switch (hci_skb_pkt_type(skb)) {
case HCI_COMMAND_PKT:
hdev->stat.cmd_tx++;
break;
Expand All @@ -424,7 +425,7 @@ static int bt3c_hci_send_frame(struct hci_dev *hdev, struct sk_buff *skb)
}

/* Prepend skb with frame type */
memcpy(skb_push(skb, 1), &bt_cb(skb)->pkt_type, 1);
memcpy(skb_push(skb, 1), &hci_skb_pkt_type(skb), 1);
skb_queue_tail(&(info->txq), skb);

spin_lock_irqsave(&(info->lock), flags);
Expand Down
8 changes: 4 additions & 4 deletions drivers/bluetooth/btmrvl_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ static int btmrvl_send_sync_cmd(struct btmrvl_private *priv, u16 opcode,
if (len)
memcpy(skb_put(skb, len), param, len);

bt_cb(skb)->pkt_type = MRVL_VENDOR_PKT;
hci_skb_pkt_type(skb) = MRVL_VENDOR_PKT;

skb_queue_head(&priv->adapter->tx_queue, skb);

Expand Down Expand Up @@ -387,7 +387,7 @@ static int btmrvl_tx_pkt(struct btmrvl_private *priv, struct sk_buff *skb)
skb->data[0] = (skb->len & 0x0000ff);
skb->data[1] = (skb->len & 0x00ff00) >> 8;
skb->data[2] = (skb->len & 0xff0000) >> 16;
skb->data[3] = bt_cb(skb)->pkt_type;
skb->data[3] = hci_skb_pkt_type(skb);

if (priv->hw_host_to_card)
ret = priv->hw_host_to_card(priv, skb->data, skb->len);
Expand Down Expand Up @@ -434,9 +434,9 @@ static int btmrvl_send_frame(struct hci_dev *hdev, struct sk_buff *skb)
{
struct btmrvl_private *priv = hci_get_drvdata(hdev);

BT_DBG("type=%d, len=%d", skb->pkt_type, skb->len);
BT_DBG("type=%d, len=%d", hci_skb_pkt_type(skb), skb->len);

switch (bt_cb(skb)->pkt_type) {
switch (hci_skb_pkt_type(skb)) {
case HCI_COMMAND_PKT:
hdev->stat.cmd_tx++;
break;
Expand Down
4 changes: 2 additions & 2 deletions drivers/bluetooth/btmrvl_sdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ static int btmrvl_sdio_card_to_host(struct btmrvl_private *priv)
case HCI_ACLDATA_PKT:
case HCI_SCODATA_PKT:
case HCI_EVENT_PKT:
bt_cb(skb)->pkt_type = type;
hci_skb_pkt_type(skb) = type;
skb_put(skb, buf_len);
skb_pull(skb, SDIO_HEADER_LEN);

Expand All @@ -713,7 +713,7 @@ static int btmrvl_sdio_card_to_host(struct btmrvl_private *priv)
break;

case MRVL_VENDOR_PKT:
bt_cb(skb)->pkt_type = HCI_VENDOR_PKT;
hci_skb_pkt_type(skb) = HCI_VENDOR_PKT;
skb_put(skb, buf_len);
skb_pull(skb, SDIO_HEADER_LEN);

Expand Down
6 changes: 3 additions & 3 deletions drivers/bluetooth/btsdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ static int btsdio_tx_packet(struct btsdio_data *data, struct sk_buff *skb)
skb->data[0] = (skb->len & 0x0000ff);
skb->data[1] = (skb->len & 0x00ff00) >> 8;
skb->data[2] = (skb->len & 0xff0000) >> 16;
skb->data[3] = bt_cb(skb)->pkt_type;
skb->data[3] = hci_skb_pkt_type(skb);

err = sdio_writesb(data->func, REG_TDAT, skb->data, skb->len);
if (err < 0) {
Expand Down Expand Up @@ -158,7 +158,7 @@ static int btsdio_rx_packet(struct btsdio_data *data)

data->hdev->stat.byte_rx += len;

bt_cb(skb)->pkt_type = hdr[3];
hci_skb_pkt_type(skb) = hdr[3];

err = hci_recv_frame(data->hdev, skb);
if (err < 0)
Expand Down Expand Up @@ -252,7 +252,7 @@ static int btsdio_send_frame(struct hci_dev *hdev, struct sk_buff *skb)

BT_DBG("%s", hdev->name);

switch (bt_cb(skb)->pkt_type) {
switch (hci_skb_pkt_type(skb)) {
case HCI_COMMAND_PKT:
hdev->stat.cmd_tx++;
break;
Expand Down
11 changes: 6 additions & 5 deletions drivers/bluetooth/btuart_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,9 @@ static void btuart_receive(struct btuart_info *info)

if (info->rx_state == RECV_WAIT_PACKET_TYPE) {

bt_cb(info->rx_skb)->pkt_type = inb(iobase + UART_RX);
hci_skb_pkt_type(info->rx_skb) = inb(iobase + UART_RX);

switch (bt_cb(info->rx_skb)->pkt_type) {
switch (hci_skb_pkt_type(info->rx_skb)) {

case HCI_EVENT_PKT:
info->rx_state = RECV_WAIT_EVENT_HEADER;
Expand All @@ -221,7 +221,8 @@ static void btuart_receive(struct btuart_info *info)

default:
/* Unknown packet */
BT_ERR("Unknown HCI packet with type 0x%02x received", bt_cb(info->rx_skb)->pkt_type);
BT_ERR("Unknown HCI packet with type 0x%02x received",
hci_skb_pkt_type(info->rx_skb));
info->hdev->stat.err_rx++;

kfree_skb(info->rx_skb);
Expand Down Expand Up @@ -424,7 +425,7 @@ static int btuart_hci_send_frame(struct hci_dev *hdev, struct sk_buff *skb)
{
struct btuart_info *info = hci_get_drvdata(hdev);

switch (bt_cb(skb)->pkt_type) {
switch (hci_skb_pkt_type(skb)) {
case HCI_COMMAND_PKT:
hdev->stat.cmd_tx++;
break;
Expand All @@ -437,7 +438,7 @@ static int btuart_hci_send_frame(struct hci_dev *hdev, struct sk_buff *skb)
}

/* Prepend skb with frame type */
memcpy(skb_push(skb, 1), &bt_cb(skb)->pkt_type, 1);
memcpy(skb_push(skb, 1), &hci_skb_pkt_type(skb), 1);
skb_queue_tail(&(info->txq), skb);

btuart_write_wakeup(info);
Expand Down
Loading

0 comments on commit 54f1aa2

Please sign in to comment.