Commit 07bc7884 authored by John W. Linville's avatar John W. Linville

Merge branch 'for-upstream' of...

Merge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next
parents 47e4df94 13cac152
...@@ -152,8 +152,8 @@ F: drivers/scsi/53c700* ...@@ -152,8 +152,8 @@ F: drivers/scsi/53c700*
6LOWPAN GENERIC (BTLE/IEEE 802.15.4) 6LOWPAN GENERIC (BTLE/IEEE 802.15.4)
M: Alexander Aring <alex.aring@gmail.com> M: Alexander Aring <alex.aring@gmail.com>
L: linux-zigbee-devel@lists.sourceforge.net (moderated for non-subscribers)
L: linux-bluetooth@vger.kernel.org L: linux-bluetooth@vger.kernel.org
L: linux-wpan@vger.kernel.org
S: Maintained S: Maintained
F: net/6lowpan/ F: net/6lowpan/
F: include/net/6lowpan.h F: include/net/6lowpan.h
...@@ -4580,13 +4580,14 @@ F: drivers/idle/i7300_idle.c ...@@ -4580,13 +4580,14 @@ F: drivers/idle/i7300_idle.c
IEEE 802.15.4 SUBSYSTEM IEEE 802.15.4 SUBSYSTEM
M: Alexander Aring <alex.aring@gmail.com> M: Alexander Aring <alex.aring@gmail.com>
L: linux-zigbee-devel@lists.sourceforge.net (moderated for non-subscribers) L: linux-wpan@vger.kernel.org
W: http://apps.sourceforge.net/trac/linux-zigbee W: https://github.com/linux-wpan
T: git git://git.kernel.org/pub/scm/linux/kernel/git/lowpan/lowpan.git T: git git://github.com/linux-wpan/linux-wpan-next.git
S: Maintained S: Maintained
F: net/ieee802154/ F: net/ieee802154/
F: net/mac802154/ F: net/mac802154/
F: drivers/net/ieee802154/ F: drivers/net/ieee802154/
F: Documentation/networking/ieee802154.txt
IGUANAWORKS USB IR TRANSCEIVER IGUANAWORKS USB IR TRANSCEIVER
M: Sean Young <sean@mess.org> M: Sean Young <sean@mess.org>
......
...@@ -88,6 +88,7 @@ static const struct usb_device_id ath3k_table[] = { ...@@ -88,6 +88,7 @@ static const struct usb_device_id ath3k_table[] = {
{ USB_DEVICE(0x04CA, 0x300b) }, { USB_DEVICE(0x04CA, 0x300b) },
{ USB_DEVICE(0x0930, 0x0219) }, { USB_DEVICE(0x0930, 0x0219) },
{ USB_DEVICE(0x0930, 0x0220) }, { USB_DEVICE(0x0930, 0x0220) },
{ USB_DEVICE(0x0930, 0x0227) },
{ USB_DEVICE(0x0b05, 0x17d0) }, { USB_DEVICE(0x0b05, 0x17d0) },
{ USB_DEVICE(0x0CF3, 0x0036) }, { USB_DEVICE(0x0CF3, 0x0036) },
{ USB_DEVICE(0x0CF3, 0x3004) }, { USB_DEVICE(0x0CF3, 0x3004) },
...@@ -138,6 +139,7 @@ static const struct usb_device_id ath3k_blist_tbl[] = { ...@@ -138,6 +139,7 @@ static const struct usb_device_id ath3k_blist_tbl[] = {
{ USB_DEVICE(0x04ca, 0x300b), .driver_info = BTUSB_ATH3012 }, { USB_DEVICE(0x04ca, 0x300b), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x0930, 0x0219), .driver_info = BTUSB_ATH3012 }, { USB_DEVICE(0x0930, 0x0219), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x0930, 0x0220), .driver_info = BTUSB_ATH3012 }, { USB_DEVICE(0x0930, 0x0220), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x0930, 0x0227), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x0b05, 0x17d0), .driver_info = BTUSB_ATH3012 }, { USB_DEVICE(0x0b05, 0x17d0), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x0CF3, 0x0036), .driver_info = BTUSB_ATH3012 }, { USB_DEVICE(0x0CF3, 0x0036), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x0cf3, 0x3004), .driver_info = BTUSB_ATH3012 }, { USB_DEVICE(0x0cf3, 0x3004), .driver_info = BTUSB_ATH3012 },
......
...@@ -61,7 +61,7 @@ MODULE_LICENSE("GPL"); ...@@ -61,7 +61,7 @@ MODULE_LICENSE("GPL");
/* ======================== Local structures ======================== */ /* ======================== Local structures ======================== */
typedef struct bluecard_info_t { struct bluecard_info {
struct pcmcia_device *p_dev; struct pcmcia_device *p_dev;
struct hci_dev *hdev; struct hci_dev *hdev;
...@@ -78,7 +78,7 @@ typedef struct bluecard_info_t { ...@@ -78,7 +78,7 @@ typedef struct bluecard_info_t {
unsigned char ctrl_reg; unsigned char ctrl_reg;
unsigned long hw_state; /* Status of the hardware and LED control */ unsigned long hw_state; /* Status of the hardware and LED control */
} bluecard_info_t; };
static int bluecard_config(struct pcmcia_device *link); static int bluecard_config(struct pcmcia_device *link);
...@@ -157,7 +157,7 @@ static void bluecard_detach(struct pcmcia_device *p_dev); ...@@ -157,7 +157,7 @@ static void bluecard_detach(struct pcmcia_device *p_dev);
static void bluecard_activity_led_timeout(u_long arg) static void bluecard_activity_led_timeout(u_long arg)
{ {
bluecard_info_t *info = (bluecard_info_t *)arg; struct bluecard_info *info = (struct bluecard_info *)arg;
unsigned int iobase = info->p_dev->resource[0]->start; unsigned int iobase = info->p_dev->resource[0]->start;
if (!test_bit(CARD_HAS_PCCARD_ID, &(info->hw_state))) if (!test_bit(CARD_HAS_PCCARD_ID, &(info->hw_state)))
...@@ -173,7 +173,7 @@ static void bluecard_activity_led_timeout(u_long arg) ...@@ -173,7 +173,7 @@ static void bluecard_activity_led_timeout(u_long arg)
} }
static void bluecard_enable_activity_led(bluecard_info_t *info) static void bluecard_enable_activity_led(struct bluecard_info *info)
{ {
unsigned int iobase = info->p_dev->resource[0]->start; unsigned int iobase = info->p_dev->resource[0]->start;
...@@ -215,7 +215,7 @@ static int bluecard_write(unsigned int iobase, unsigned int offset, __u8 *buf, i ...@@ -215,7 +215,7 @@ static int bluecard_write(unsigned int iobase, unsigned int offset, __u8 *buf, i
} }
static void bluecard_write_wakeup(bluecard_info_t *info) static void bluecard_write_wakeup(struct bluecard_info *info)
{ {
if (!info) { if (!info) {
BT_ERR("Unknown device"); BT_ERR("Unknown device");
...@@ -368,7 +368,8 @@ static int bluecard_read(unsigned int iobase, unsigned int offset, __u8 *buf, in ...@@ -368,7 +368,8 @@ static int bluecard_read(unsigned int iobase, unsigned int offset, __u8 *buf, in
} }
static void bluecard_receive(bluecard_info_t *info, unsigned int offset) static void bluecard_receive(struct bluecard_info *info,
unsigned int offset)
{ {
unsigned int iobase; unsigned int iobase;
unsigned char buf[31]; unsigned char buf[31];
...@@ -497,7 +498,7 @@ static void bluecard_receive(bluecard_info_t *info, unsigned int offset) ...@@ -497,7 +498,7 @@ static void bluecard_receive(bluecard_info_t *info, unsigned int offset)
static irqreturn_t bluecard_interrupt(int irq, void *dev_inst) static irqreturn_t bluecard_interrupt(int irq, void *dev_inst)
{ {
bluecard_info_t *info = dev_inst; struct bluecard_info *info = dev_inst;
unsigned int iobase; unsigned int iobase;
unsigned char reg; unsigned char reg;
...@@ -562,7 +563,7 @@ static irqreturn_t bluecard_interrupt(int irq, void *dev_inst) ...@@ -562,7 +563,7 @@ static irqreturn_t bluecard_interrupt(int irq, void *dev_inst)
static int bluecard_hci_set_baud_rate(struct hci_dev *hdev, int baud) static int bluecard_hci_set_baud_rate(struct hci_dev *hdev, int baud)
{ {
bluecard_info_t *info = hci_get_drvdata(hdev); struct bluecard_info *info = hci_get_drvdata(hdev);
struct sk_buff *skb; struct sk_buff *skb;
/* Ericsson baud rate command */ /* Ericsson baud rate command */
...@@ -611,7 +612,7 @@ static int bluecard_hci_set_baud_rate(struct hci_dev *hdev, int baud) ...@@ -611,7 +612,7 @@ static int bluecard_hci_set_baud_rate(struct hci_dev *hdev, int baud)
static int bluecard_hci_flush(struct hci_dev *hdev) static int bluecard_hci_flush(struct hci_dev *hdev)
{ {
bluecard_info_t *info = hci_get_drvdata(hdev); struct bluecard_info *info = hci_get_drvdata(hdev);
/* Drop TX queue */ /* Drop TX queue */
skb_queue_purge(&(info->txq)); skb_queue_purge(&(info->txq));
...@@ -622,7 +623,7 @@ static int bluecard_hci_flush(struct hci_dev *hdev) ...@@ -622,7 +623,7 @@ static int bluecard_hci_flush(struct hci_dev *hdev)
static int bluecard_hci_open(struct hci_dev *hdev) static int bluecard_hci_open(struct hci_dev *hdev)
{ {
bluecard_info_t *info = hci_get_drvdata(hdev); struct bluecard_info *info = hci_get_drvdata(hdev);
if (test_bit(CARD_HAS_PCCARD_ID, &(info->hw_state))) if (test_bit(CARD_HAS_PCCARD_ID, &(info->hw_state)))
bluecard_hci_set_baud_rate(hdev, DEFAULT_BAUD_RATE); bluecard_hci_set_baud_rate(hdev, DEFAULT_BAUD_RATE);
...@@ -643,7 +644,7 @@ static int bluecard_hci_open(struct hci_dev *hdev) ...@@ -643,7 +644,7 @@ static int bluecard_hci_open(struct hci_dev *hdev)
static int bluecard_hci_close(struct hci_dev *hdev) static int bluecard_hci_close(struct hci_dev *hdev)
{ {
bluecard_info_t *info = hci_get_drvdata(hdev); struct bluecard_info *info = hci_get_drvdata(hdev);
if (!test_and_clear_bit(HCI_RUNNING, &(hdev->flags))) if (!test_and_clear_bit(HCI_RUNNING, &(hdev->flags)))
return 0; return 0;
...@@ -663,7 +664,7 @@ static int bluecard_hci_close(struct hci_dev *hdev) ...@@ -663,7 +664,7 @@ static int bluecard_hci_close(struct hci_dev *hdev)
static int bluecard_hci_send_frame(struct hci_dev *hdev, struct sk_buff *skb) static int bluecard_hci_send_frame(struct hci_dev *hdev, struct sk_buff *skb)
{ {
bluecard_info_t *info = hci_get_drvdata(hdev); struct bluecard_info *info = hci_get_drvdata(hdev);
switch (bt_cb(skb)->pkt_type) { switch (bt_cb(skb)->pkt_type) {
case HCI_COMMAND_PKT: case HCI_COMMAND_PKT:
...@@ -691,7 +692,7 @@ static int bluecard_hci_send_frame(struct hci_dev *hdev, struct sk_buff *skb) ...@@ -691,7 +692,7 @@ static int bluecard_hci_send_frame(struct hci_dev *hdev, struct sk_buff *skb)
/* ======================== Card services HCI interaction ======================== */ /* ======================== Card services HCI interaction ======================== */
static int bluecard_open(bluecard_info_t *info) static int bluecard_open(struct bluecard_info *info)
{ {
unsigned int iobase = info->p_dev->resource[0]->start; unsigned int iobase = info->p_dev->resource[0]->start;
struct hci_dev *hdev; struct hci_dev *hdev;
...@@ -806,7 +807,7 @@ static int bluecard_open(bluecard_info_t *info) ...@@ -806,7 +807,7 @@ static int bluecard_open(bluecard_info_t *info)
} }
static int bluecard_close(bluecard_info_t *info) static int bluecard_close(struct bluecard_info *info)
{ {
unsigned int iobase = info->p_dev->resource[0]->start; unsigned int iobase = info->p_dev->resource[0]->start;
struct hci_dev *hdev = info->hdev; struct hci_dev *hdev = info->hdev;
...@@ -833,7 +834,7 @@ static int bluecard_close(bluecard_info_t *info) ...@@ -833,7 +834,7 @@ static int bluecard_close(bluecard_info_t *info)
static int bluecard_probe(struct pcmcia_device *link) static int bluecard_probe(struct pcmcia_device *link)
{ {
bluecard_info_t *info; struct bluecard_info *info;
/* Create new info device */ /* Create new info device */
info = devm_kzalloc(&link->dev, sizeof(*info), GFP_KERNEL); info = devm_kzalloc(&link->dev, sizeof(*info), GFP_KERNEL);
...@@ -857,7 +858,7 @@ static void bluecard_detach(struct pcmcia_device *link) ...@@ -857,7 +858,7 @@ static void bluecard_detach(struct pcmcia_device *link)
static int bluecard_config(struct pcmcia_device *link) static int bluecard_config(struct pcmcia_device *link)
{ {
bluecard_info_t *info = link->priv; struct bluecard_info *info = link->priv;
int i, n; int i, n;
link->config_index = 0x20; link->config_index = 0x20;
...@@ -897,7 +898,7 @@ static int bluecard_config(struct pcmcia_device *link) ...@@ -897,7 +898,7 @@ static int bluecard_config(struct pcmcia_device *link)
static void bluecard_release(struct pcmcia_device *link) static void bluecard_release(struct pcmcia_device *link)
{ {
bluecard_info_t *info = link->priv; struct bluecard_info *info = link->priv;
bluecard_close(info); bluecard_close(info);
......
...@@ -67,7 +67,7 @@ MODULE_FIRMWARE("BT3CPCC.bin"); ...@@ -67,7 +67,7 @@ MODULE_FIRMWARE("BT3CPCC.bin");
/* ======================== Local structures ======================== */ /* ======================== Local structures ======================== */
typedef struct bt3c_info_t { struct bt3c_info {
struct pcmcia_device *p_dev; struct pcmcia_device *p_dev;
struct hci_dev *hdev; struct hci_dev *hdev;
...@@ -80,7 +80,7 @@ typedef struct bt3c_info_t { ...@@ -80,7 +80,7 @@ typedef struct bt3c_info_t {
unsigned long rx_state; unsigned long rx_state;
unsigned long rx_count; unsigned long rx_count;
struct sk_buff *rx_skb; struct sk_buff *rx_skb;
} bt3c_info_t; };
static int bt3c_config(struct pcmcia_device *link); static int bt3c_config(struct pcmcia_device *link);
...@@ -175,7 +175,7 @@ static int bt3c_write(unsigned int iobase, int fifo_size, __u8 *buf, int len) ...@@ -175,7 +175,7 @@ static int bt3c_write(unsigned int iobase, int fifo_size, __u8 *buf, int len)
} }
static void bt3c_write_wakeup(bt3c_info_t *info) static void bt3c_write_wakeup(struct bt3c_info *info)
{ {
if (!info) { if (!info) {
BT_ERR("Unknown device"); BT_ERR("Unknown device");
...@@ -214,7 +214,7 @@ static void bt3c_write_wakeup(bt3c_info_t *info) ...@@ -214,7 +214,7 @@ static void bt3c_write_wakeup(bt3c_info_t *info)
} }
static void bt3c_receive(bt3c_info_t *info) static void bt3c_receive(struct bt3c_info *info)
{ {
unsigned int iobase; unsigned int iobase;
int size = 0, avail; int size = 0, avail;
...@@ -336,7 +336,7 @@ static void bt3c_receive(bt3c_info_t *info) ...@@ -336,7 +336,7 @@ static void bt3c_receive(bt3c_info_t *info)
static irqreturn_t bt3c_interrupt(int irq, void *dev_inst) static irqreturn_t bt3c_interrupt(int irq, void *dev_inst)
{ {
bt3c_info_t *info = dev_inst; struct bt3c_info *info = dev_inst;
unsigned int iobase; unsigned int iobase;
int iir; int iir;
irqreturn_t r = IRQ_NONE; irqreturn_t r = IRQ_NONE;
...@@ -388,7 +388,7 @@ static irqreturn_t bt3c_interrupt(int irq, void *dev_inst) ...@@ -388,7 +388,7 @@ static irqreturn_t bt3c_interrupt(int irq, void *dev_inst)
static int bt3c_hci_flush(struct hci_dev *hdev) static int bt3c_hci_flush(struct hci_dev *hdev)
{ {
bt3c_info_t *info = hci_get_drvdata(hdev); struct bt3c_info *info = hci_get_drvdata(hdev);
/* Drop TX queue */ /* Drop TX queue */
skb_queue_purge(&(info->txq)); skb_queue_purge(&(info->txq));
...@@ -418,7 +418,7 @@ static int bt3c_hci_close(struct hci_dev *hdev) ...@@ -418,7 +418,7 @@ static int bt3c_hci_close(struct hci_dev *hdev)
static int bt3c_hci_send_frame(struct hci_dev *hdev, struct sk_buff *skb) static int bt3c_hci_send_frame(struct hci_dev *hdev, struct sk_buff *skb)
{ {
bt3c_info_t *info = hci_get_drvdata(hdev); struct bt3c_info *info = hci_get_drvdata(hdev);
unsigned long flags; unsigned long flags;
switch (bt_cb(skb)->pkt_type) { switch (bt_cb(skb)->pkt_type) {
...@@ -451,7 +451,8 @@ static int bt3c_hci_send_frame(struct hci_dev *hdev, struct sk_buff *skb) ...@@ -451,7 +451,8 @@ static int bt3c_hci_send_frame(struct hci_dev *hdev, struct sk_buff *skb)
/* ======================== Card services HCI interaction ======================== */ /* ======================== Card services HCI interaction ======================== */
static int bt3c_load_firmware(bt3c_info_t *info, const unsigned char *firmware, static int bt3c_load_firmware(struct bt3c_info *info,
const unsigned char *firmware,
int count) int count)
{ {
char *ptr = (char *) firmware; char *ptr = (char *) firmware;
...@@ -536,7 +537,7 @@ static int bt3c_load_firmware(bt3c_info_t *info, const unsigned char *firmware, ...@@ -536,7 +537,7 @@ static int bt3c_load_firmware(bt3c_info_t *info, const unsigned char *firmware,
} }
static int bt3c_open(bt3c_info_t *info) static int bt3c_open(struct bt3c_info *info)
{ {
const struct firmware *firmware; const struct firmware *firmware;
struct hci_dev *hdev; struct hci_dev *hdev;
...@@ -603,7 +604,7 @@ static int bt3c_open(bt3c_info_t *info) ...@@ -603,7 +604,7 @@ static int bt3c_open(bt3c_info_t *info)
} }
static int bt3c_close(bt3c_info_t *info) static int bt3c_close(struct bt3c_info *info)
{ {
struct hci_dev *hdev = info->hdev; struct hci_dev *hdev = info->hdev;
...@@ -620,7 +621,7 @@ static int bt3c_close(bt3c_info_t *info) ...@@ -620,7 +621,7 @@ static int bt3c_close(bt3c_info_t *info)
static int bt3c_probe(struct pcmcia_device *link) static int bt3c_probe(struct pcmcia_device *link)
{ {
bt3c_info_t *info; struct bt3c_info *info;
/* Create new info device */ /* Create new info device */
info = devm_kzalloc(&link->dev, sizeof(*info), GFP_KERNEL); info = devm_kzalloc(&link->dev, sizeof(*info), GFP_KERNEL);
...@@ -683,7 +684,7 @@ static int bt3c_check_config_notpicky(struct pcmcia_device *p_dev, ...@@ -683,7 +684,7 @@ static int bt3c_check_config_notpicky(struct pcmcia_device *p_dev,
static int bt3c_config(struct pcmcia_device *link) static int bt3c_config(struct pcmcia_device *link)
{ {
bt3c_info_t *info = link->priv; struct bt3c_info *info = link->priv;
int i; int i;
unsigned long try; unsigned long try;
...@@ -724,7 +725,7 @@ static int bt3c_config(struct pcmcia_device *link) ...@@ -724,7 +725,7 @@ static int bt3c_config(struct pcmcia_device *link)
static void bt3c_release(struct pcmcia_device *link) static void bt3c_release(struct pcmcia_device *link)
{ {
bt3c_info_t *info = link->priv; struct bt3c_info *info = link->priv;
bt3c_close(info); bt3c_close(info);
......
...@@ -62,7 +62,7 @@ MODULE_LICENSE("GPL"); ...@@ -62,7 +62,7 @@ MODULE_LICENSE("GPL");
/* ======================== Local structures ======================== */ /* ======================== Local structures ======================== */
typedef struct btuart_info_t { struct btuart_info {
struct pcmcia_device *p_dev; struct pcmcia_device *p_dev;
struct hci_dev *hdev; struct hci_dev *hdev;
...@@ -75,7 +75,7 @@ typedef struct btuart_info_t { ...@@ -75,7 +75,7 @@ typedef struct btuart_info_t {
unsigned long rx_state; unsigned long rx_state;
unsigned long rx_count; unsigned long rx_count;
struct sk_buff *rx_skb; struct sk_buff *rx_skb;
} btuart_info_t; };
static int btuart_config(struct pcmcia_device *link); static int btuart_config(struct pcmcia_device *link);
...@@ -127,7 +127,7 @@ static int btuart_write(unsigned int iobase, int fifo_size, __u8 *buf, int len) ...@@ -127,7 +127,7 @@ static int btuart_write(unsigned int iobase, int fifo_size, __u8 *buf, int len)
} }
static void btuart_write_wakeup(btuart_info_t *info) static void btuart_write_wakeup(struct btuart_info *info)
{ {
if (!info) { if (!info) {
BT_ERR("Unknown device"); BT_ERR("Unknown device");
...@@ -172,7 +172,7 @@ static void btuart_write_wakeup(btuart_info_t *info) ...@@ -172,7 +172,7 @@ static void btuart_write_wakeup(btuart_info_t *info)
} }
static void btuart_receive(btuart_info_t *info) static void btuart_receive(struct btuart_info *info)
{ {
unsigned int iobase; unsigned int iobase;
int boguscount = 0; int boguscount = 0;
...@@ -286,7 +286,7 @@ static void btuart_receive(btuart_info_t *info) ...@@ -286,7 +286,7 @@ static void btuart_receive(btuart_info_t *info)
static irqreturn_t btuart_interrupt(int irq, void *dev_inst) static irqreturn_t btuart_interrupt(int irq, void *dev_inst)
{ {
btuart_info_t *info = dev_inst; struct btuart_info *info = dev_inst;
unsigned int iobase; unsigned int iobase;
int boguscount = 0; int boguscount = 0;
int iir, lsr; int iir, lsr;
...@@ -340,7 +340,8 @@ static irqreturn_t btuart_interrupt(int irq, void *dev_inst) ...@@ -340,7 +340,8 @@ static irqreturn_t btuart_interrupt(int irq, void *dev_inst)
} }
static void btuart_change_speed(btuart_info_t *info, unsigned int speed) static void btuart_change_speed(struct btuart_info *info,
unsigned int speed)
{ {
unsigned long flags; unsigned long flags;
unsigned int iobase; unsigned int iobase;
...@@ -397,7 +398,7 @@ static void btuart_change_speed(btuart_info_t *info, unsigned int speed) ...@@ -397,7 +398,7 @@ static void btuart_change_speed(btuart_info_t *info, unsigned int speed)
static int btuart_hci_flush(struct hci_dev *hdev) static int btuart_hci_flush(struct hci_dev *hdev)
{ {
btuart_info_t *info = hci_get_drvdata(hdev); struct btuart_info *info = hci_get_drvdata(hdev);
/* Drop TX queue */ /* Drop TX queue */
skb_queue_purge(&(info->txq)); skb_queue_purge(&(info->txq));
...@@ -427,7 +428,7 @@ static int btuart_hci_close(struct hci_dev *hdev) ...@@ -427,7 +428,7 @@ static int btuart_hci_close(struct hci_dev *hdev)
static int btuart_hci_send_frame(struct hci_dev *hdev, struct sk_buff *skb) static int btuart_hci_send_frame(struct hci_dev *hdev, struct sk_buff *skb)
{ {
btuart_info_t *info = hci_get_drvdata(hdev); struct btuart_info *info = hci_get_drvdata(hdev);
switch (bt_cb(skb)->pkt_type) { switch (bt_cb(skb)->pkt_type) {
case HCI_COMMAND_PKT: case HCI_COMMAND_PKT:
...@@ -455,7 +456,7 @@ static int btuart_hci_send_frame(struct hci_dev *hdev, struct sk_buff *skb) ...@@ -455,7 +456,7 @@ static int btuart_hci_send_frame(struct hci_dev *hdev, struct sk_buff *skb)
/* ======================== Card services HCI interaction ======================== */ /* ======================== Card services HCI interaction ======================== */
static int btuart_open(btuart_info_t *info) static int btuart_open(struct btuart_info *info)
{ {
unsigned long flags; unsigned long flags;
unsigned int iobase = info->p_dev->resource[0]->start; unsigned int iobase = info->p_dev->resource[0]->start;
...@@ -521,7 +522,7 @@ static int btuart_open(btuart_info_t *info) ...@@ -521,7 +522,7 @@ static int btuart_open(btuart_info_t *info)
} }
static int btuart_close(btuart_info_t *info) static int btuart_close(struct btuart_info *info)
{ {
unsigned long flags; unsigned long flags;
unsigned int iobase = info->p_dev->resource[0]->start; unsigned int iobase = info->p_dev->resource[0]->start;
...@@ -550,7 +551,7 @@ static int btuart_close(btuart_info_t *info) ...@@ -550,7 +551,7 @@ static int btuart_close(btuart_info_t *info)
static int btuart_probe(struct pcmcia_device *link) static int btuart_probe(struct pcmcia_device *link)
{ {
btuart_info_t *info; struct btuart_info *info;
/* Create new info device */ /* Create new info device */
info = devm_kzalloc(&link->dev, sizeof(*info), GFP_KERNEL); info = devm_kzalloc(&link->dev, sizeof(*info), GFP_KERNEL);
...@@ -613,7 +614,7 @@ static int btuart_check_config_notpicky(struct pcmcia_device *p_dev, ...@@ -613,7 +614,7 @@ static int btuart_check_config_notpicky(struct pcmcia_device *p_dev,
static int btuart_config(struct pcmcia_device *link) static int btuart_config(struct pcmcia_device *link)
{ {
btuart_info_t *info = link->priv; struct btuart_info *info = link->priv;
int i; int i;
int try; int try;
...@@ -654,7 +655,7 @@ static int btuart_config(struct pcmcia_device *link) ...@@ -654,7 +655,7 @@ static int btuart_config(struct pcmcia_device *link)
static void btuart_release(struct pcmcia_device *link) static void btuart_release(struct pcmcia_device *link)
{ {
btuart_info_t *info = link->priv; struct btuart_info *info = link->priv;
btuart_close(info); btuart_close(info);
......
...@@ -165,6 +165,7 @@ static const struct usb_device_id blacklist_table[] = { ...@@ -165,6 +165,7 @@ static const struct usb_device_id blacklist_table[] = {
{ USB_DEVICE(0x04ca, 0x300b), .driver_info = BTUSB_ATH3012 }, { USB_DEVICE(0x04ca, 0x300b), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x0930, 0x0219), .driver_info = BTUSB_ATH3012 }, { USB_DEVICE(0x0930, 0x0219), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x0930, 0x0220), .driver_info = BTUSB_ATH3012 }, { USB_DEVICE(0x0930, 0x0220), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x0930, 0x0227), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x0b05, 0x17d0), .driver_info = BTUSB_ATH3012 }, { USB_DEVICE(0x0b05, 0x17d0), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x0cf3, 0x0036), .driver_info = BTUSB_ATH3012 }, { USB_DEVICE(0x0cf3, 0x0036), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x0cf3, 0x3004), .driver_info = BTUSB_ATH3012 }, { USB_DEVICE(0x0cf3, 0x3004), .driver_info = BTUSB_ATH3012 },
......
...@@ -62,7 +62,7 @@ MODULE_LICENSE("GPL"); ...@@ -62,7 +62,7 @@ MODULE_LICENSE("GPL");
/* ======================== Local structures ======================== */ /* ======================== Local structures ======================== */
typedef struct dtl1_info_t { struct dtl1_info {
struct pcmcia_device *p_dev; struct pcmcia_device *p_dev;
struct hci_dev *hdev; struct hci_dev *hdev;
...@@ -78,7 +78,7 @@ typedef struct dtl1_info_t { ...@@ -78,7 +78,7 @@ typedef struct dtl1_info_t {
unsigned long rx_state; unsigned long rx_state;
unsigned long rx_count; unsigned long rx_count;
struct sk_buff *rx_skb; struct sk_buff *rx_skb;
} dtl1_info_t; };
static int dtl1_config(struct pcmcia_device *link); static int dtl1_config(struct pcmcia_device *link);
...@@ -94,11 +94,11 @@ static int dtl1_config(struct pcmcia_device *link); ...@@ -94,11 +94,11 @@ static int dtl1_config(struct pcmcia_device *link);
#define RECV_WAIT_DATA 1 #define RECV_WAIT_DATA 1
typedef struct { struct nsh {
u8 type; u8 type;
u8 zero; u8 zero;
u16 len; u16 len;
} __packed nsh_t; /* Nokia Specific Header */ } __packed; /* Nokia Specific Header */
#define NSHL 4 /* Nokia Specific Header Length */ #define NSHL 4 /* Nokia Specific Header Length */
...@@ -126,7 +126,7 @@ static int dtl1_write(unsigned int iobase, int fifo_size, __u8 *buf, int len) ...@@ -126,7 +126,7 @@ static int dtl1_write(unsigned int iobase, int fifo_size, __u8 *buf, int len)
} }
static void dtl1_write_wakeup(dtl1_info_t *info) static void dtl1_write_wakeup(struct dtl1_info *info)
{ {
if (!info) { if (!info) {
BT_ERR("Unknown device"); BT_ERR("Unknown device");
...@@ -176,7 +176,7 @@ static void dtl1_write_wakeup(dtl1_info_t *info) ...@@ -176,7 +176,7 @@ static void dtl1_write_wakeup(dtl1_info_t *info)
} }
static void dtl1_control(dtl1_info_t *info, struct sk_buff *skb) static void dtl1_control(struct dtl1_info *info, struct sk_buff *skb)
{ {
u8 flowmask = *(u8 *)skb->data; u8 flowmask = *(u8 *)skb->data;
int i; int i;
...@@ -199,10 +199,10 @@ static void dtl1_control(dtl1_info_t *info, struct sk_buff *skb) ...@@ -199,10 +199,10 @@ static void dtl1_control(dtl1_info_t *info, struct sk_buff *skb)
} }
static void dtl1_receive(dtl1_info_t *info) static void dtl1_receive(struct dtl1_info *info)
{ {
unsigned int iobase; unsigned int iobase;
nsh_t *nsh; struct nsh *nsh;
int boguscount = 0; int boguscount = 0;
if (!info) { if (!info) {
...@@ -227,7 +227,7 @@ static void dtl1_receive(dtl1_info_t *info) ...@@ -227,7 +227,7 @@ static void dtl1_receive(dtl1_info_t *info)
} }
*skb_put(info->rx_skb, 1) = inb(iobase + UART_RX); *skb_put(info->rx_skb, 1) = inb(iobase + UART_RX);
nsh = (nsh_t *)info->rx_skb->data; nsh = (struct nsh *)info->rx_skb->data;
info->rx_count--; info->rx_count--;
...@@ -287,7 +287,7 @@ static void dtl1_receive(dtl1_info_t *info) ...@@ -287,7 +287,7 @@ static void dtl1_receive(dtl1_info_t *info)
static irqreturn_t dtl1_interrupt(int irq, void *dev_inst) static irqreturn_t dtl1_interrupt(int irq, void *dev_inst)
{ {
dtl1_info_t *info = dev_inst; struct dtl1_info *info = dev_inst;
unsigned int iobase; unsigned int iobase;
unsigned char msr; unsigned char msr;
int boguscount = 0; int boguscount = 0;
...@@ -365,7 +365,7 @@ static int dtl1_hci_open(struct hci_dev *hdev) ...@@ -365,7 +365,7 @@ static int dtl1_hci_open(struct hci_dev *hdev)
static int dtl1_hci_flush(struct hci_dev *hdev) static int dtl1_hci_flush(struct hci_dev *hdev)
{ {
dtl1_info_t *info = hci_get_drvdata(hdev); struct dtl1_info *info = hci_get_drvdata(hdev);
/* Drop TX queue */ /* Drop TX queue */
skb_queue_purge(&(info->txq)); skb_queue_purge(&(info->txq));
...@@ -387,9 +387,9 @@ static int dtl1_hci_close(struct hci_dev *hdev) ...@@ -387,9 +387,9 @@ static int dtl1_hci_close(struct hci_dev *hdev)
static int dtl1_hci_send_frame(struct hci_dev *hdev, struct sk_buff *skb) static int dtl1_hci_send_frame(struct hci_dev *hdev, struct sk_buff *skb)
{ {
dtl1_info_t *info = hci_get_drvdata(hdev); struct dtl1_info *info = hci_get_drvdata(hdev);
struct sk_buff *s; struct sk_buff *s;
nsh_t nsh; struct nsh nsh;
switch (bt_cb(skb)->pkt_type) { switch (bt_cb(skb)->pkt_type) {
case HCI_COMMAND_PKT: case HCI_COMMAND_PKT:
...@@ -436,7 +436,7 @@ static int dtl1_hci_send_frame(struct hci_dev *hdev, struct sk_buff *skb) ...@@ -436,7 +436,7 @@ static int dtl1_hci_send_frame(struct hci_dev *hdev, struct sk_buff *skb)
/* ======================== Card services HCI interaction ======================== */ /* ======================== Card services HCI interaction ======================== */
static int dtl1_open(dtl1_info_t *info) static int dtl1_open(struct dtl1_info *info)
{ {
unsigned long flags; unsigned long flags;
unsigned int iobase = info->p_dev->resource[0]->start; unsigned int iobase = info->p_dev->resource[0]->start;
...@@ -505,7 +505,7 @@ static int dtl1_open(dtl1_info_t *info) ...@@ -505,7 +505,7 @@ static int dtl1_open(dtl1_info_t *info)
} }
static int dtl1_close(dtl1_info_t *info) static int dtl1_close(struct dtl1_info *info)
{ {
unsigned long flags; unsigned long flags;
unsigned int iobase = info->p_dev->resource[0]->start; unsigned int iobase = info->p_dev->resource[0]->start;
...@@ -534,7 +534,7 @@ static int dtl1_close(dtl1_info_t *info) ...@@ -534,7 +534,7 @@ static int dtl1_close(dtl1_info_t *info)
static int dtl1_probe(struct pcmcia_device *link) static int dtl1_probe(struct pcmcia_device *link)
{ {
dtl1_info_t *info; struct dtl1_info *info;
/* Create new info device */ /* Create new info device */
info = devm_kzalloc(&link->dev, sizeof(*info), GFP_KERNEL); info = devm_kzalloc(&link->dev, sizeof(*info), GFP_KERNEL);
...@@ -552,7 +552,7 @@ static int dtl1_probe(struct pcmcia_device *link) ...@@ -552,7 +552,7 @@ static int dtl1_probe(struct pcmcia_device *link)
static void dtl1_detach(struct pcmcia_device *link) static void dtl1_detach(struct pcmcia_device *link)
{ {
dtl1_info_t *info = link->priv; struct dtl1_info *info = link->priv;
dtl1_close(info); dtl1_close(info);
pcmcia_disable_device(link); pcmcia_disable_device(link);
...@@ -571,7 +571,7 @@ static int dtl1_confcheck(struct pcmcia_device *p_dev, void *priv_data) ...@@ -571,7 +571,7 @@ static int dtl1_confcheck(struct pcmcia_device *p_dev, void *priv_data)
static int dtl1_config(struct pcmcia_device *link) static int dtl1_config(struct pcmcia_device *link)
{ {
dtl1_info_t *info = link->priv; struct dtl1_info *info = link->priv;
int ret; int ret;
/* Look for a generic full-sized window */ /* Look for a generic full-sized window */
......
...@@ -237,7 +237,7 @@ static void h5_pkt_cull(struct h5 *h5) ...@@ -237,7 +237,7 @@ static void h5_pkt_cull(struct h5 *h5)
break; break;
to_remove--; to_remove--;
seq = (seq - 1) % 8; seq = (seq - 1) & 0x07;
} }
if (seq != h5->rx_ack) if (seq != h5->rx_ack)
......
...@@ -302,7 +302,7 @@ struct hci_dev { ...@@ -302,7 +302,7 @@ struct hci_dev {
__u32 req_status; __u32 req_status;
__u32 req_result; __u32 req_result;
struct crypto_blkcipher *tfm_aes; void *smp_data;
struct discovery_state discovery; struct discovery_state discovery;
struct hci_conn_hash conn_hash; struct hci_conn_hash conn_hash;
...@@ -968,6 +968,9 @@ void hci_conn_del_sysfs(struct hci_conn *conn); ...@@ -968,6 +968,9 @@ void hci_conn_del_sysfs(struct hci_conn *conn);
#define lmp_host_le_capable(dev) (!!((dev)->features[1][0] & LMP_HOST_LE)) #define lmp_host_le_capable(dev) (!!((dev)->features[1][0] & LMP_HOST_LE))
#define lmp_host_le_br_capable(dev) (!!((dev)->features[1][0] & LMP_HOST_LE_BREDR)) #define lmp_host_le_br_capable(dev) (!!((dev)->features[1][0] & LMP_HOST_LE_BREDR))
#define hdev_is_powered(hdev) (test_bit(HCI_UP, &hdev->flags) && \
!test_bit(HCI_AUTO_OFF, &hdev->dev_flags))
/* ----- HCI protocols ----- */ /* ----- HCI protocols ----- */
#define HCI_PROTO_DEFER 0x01 #define HCI_PROTO_DEFER 0x01
...@@ -1256,6 +1259,8 @@ bool hci_req_pending(struct hci_dev *hdev); ...@@ -1256,6 +1259,8 @@ bool hci_req_pending(struct hci_dev *hdev);
void hci_req_add_le_scan_disable(struct hci_request *req); void hci_req_add_le_scan_disable(struct hci_request *req);
void hci_req_add_le_passive_scan(struct hci_request *req); void hci_req_add_le_passive_scan(struct hci_request *req);
void hci_update_page_scan(struct hci_dev *hdev, struct hci_request *req);
struct sk_buff *__hci_cmd_sync(struct hci_dev *hdev, u16 opcode, u32 plen, struct sk_buff *__hci_cmd_sync(struct hci_dev *hdev, u16 opcode, u32 plen,
const void *param, u32 timeout); const void *param, u32 timeout);
struct sk_buff *__hci_cmd_sync_ev(struct hci_dev *hdev, u16 opcode, u32 plen, struct sk_buff *__hci_cmd_sync_ev(struct hci_dev *hdev, u16 opcode, u32 plen,
...@@ -1351,6 +1356,7 @@ void mgmt_device_found(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type, ...@@ -1351,6 +1356,7 @@ void mgmt_device_found(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type,
void mgmt_remote_name(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type, void mgmt_remote_name(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type,
u8 addr_type, s8 rssi, u8 *name, u8 name_len); u8 addr_type, s8 rssi, u8 *name, u8 name_len);
void mgmt_discovering(struct hci_dev *hdev, u8 discovering); void mgmt_discovering(struct hci_dev *hdev, u8 discovering);
bool mgmt_powering_down(struct hci_dev *hdev);
void mgmt_new_ltk(struct hci_dev *hdev, struct smp_ltk *key, bool persistent); void mgmt_new_ltk(struct hci_dev *hdev, struct smp_ltk *key, bool persistent);
void mgmt_new_irk(struct hci_dev *hdev, struct smp_irk *irk); void mgmt_new_irk(struct hci_dev *hdev, struct smp_irk *irk);
void mgmt_new_csrk(struct hci_dev *hdev, struct smp_csrk *csrk, void mgmt_new_csrk(struct hci_dev *hdev, struct smp_csrk *csrk,
......
...@@ -625,6 +625,9 @@ struct l2cap_conn { ...@@ -625,6 +625,9 @@ struct l2cap_conn {
struct delayed_work info_timer; struct delayed_work info_timer;
int disconn_err;
struct work_struct disconn_work;
struct sk_buff *rx_skb; struct sk_buff *rx_skb;
__u32 rx_len; __u32 rx_len;
__u8 tx_ident; __u8 tx_ident;
...@@ -635,8 +638,7 @@ struct l2cap_conn { ...@@ -635,8 +638,7 @@ struct l2cap_conn {
__u8 disc_reason; __u8 disc_reason;
struct delayed_work security_timer; struct l2cap_chan *smp;
struct smp_chan *smp_chan;
struct list_head chan_l; struct list_head chan_l;
struct mutex chan_lock; struct mutex chan_lock;
...@@ -708,6 +710,7 @@ enum { ...@@ -708,6 +710,7 @@ enum {
FLAG_EFS_ENABLE, FLAG_EFS_ENABLE,
FLAG_DEFER_SETUP, FLAG_DEFER_SETUP,
FLAG_LE_CONN_REQ_SENT, FLAG_LE_CONN_REQ_SENT,
FLAG_PENDING_SECURITY,
}; };
enum { enum {
...@@ -837,18 +840,43 @@ static inline struct l2cap_chan *l2cap_chan_no_new_connection(struct l2cap_chan ...@@ -837,18 +840,43 @@ static inline struct l2cap_chan *l2cap_chan_no_new_connection(struct l2cap_chan
return NULL; return NULL;
} }
static inline int l2cap_chan_no_recv(struct l2cap_chan *chan, struct sk_buff *skb)
{
return -ENOSYS;
}
static inline struct sk_buff *l2cap_chan_no_alloc_skb(struct l2cap_chan *chan,
unsigned long hdr_len,
unsigned long len, int nb)
{
return ERR_PTR(-ENOSYS);
}
static inline void l2cap_chan_no_teardown(struct l2cap_chan *chan, int err) static inline void l2cap_chan_no_teardown(struct l2cap_chan *chan, int err)
{ {
} }
static inline void l2cap_chan_no_close(struct l2cap_chan *chan)
{
}
static inline void l2cap_chan_no_ready(struct l2cap_chan *chan) static inline void l2cap_chan_no_ready(struct l2cap_chan *chan)
{ {
} }
static inline void l2cap_chan_no_state_change(struct l2cap_chan *chan,
int state, int err)
{
}
static inline void l2cap_chan_no_defer(struct l2cap_chan *chan) static inline void l2cap_chan_no_defer(struct l2cap_chan *chan)
{ {
} }
static inline void l2cap_chan_no_suspend(struct l2cap_chan *chan)
{
}
static inline void l2cap_chan_no_resume(struct l2cap_chan *chan) static inline void l2cap_chan_no_resume(struct l2cap_chan *chan)
{ {
} }
...@@ -918,6 +946,7 @@ void l2cap_logical_cfm(struct l2cap_chan *chan, struct hci_chan *hchan, ...@@ -918,6 +946,7 @@ void l2cap_logical_cfm(struct l2cap_chan *chan, struct hci_chan *hchan,
u8 status); u8 status);
void __l2cap_physical_cfm(struct l2cap_chan *chan, int result); void __l2cap_physical_cfm(struct l2cap_chan *chan, int result);
void l2cap_conn_shutdown(struct l2cap_conn *conn, int err);
void l2cap_conn_get(struct l2cap_conn *conn); void l2cap_conn_get(struct l2cap_conn *conn);
void l2cap_conn_put(struct l2cap_conn *conn); void l2cap_conn_put(struct l2cap_conn *conn);
......
...@@ -772,16 +772,16 @@ static inline void chan_ready_cb(struct l2cap_chan *chan) ...@@ -772,16 +772,16 @@ static inline void chan_ready_cb(struct l2cap_chan *chan)
ifup(dev->netdev); ifup(dev->netdev);
} }
static inline struct l2cap_chan *chan_new_conn_cb(struct l2cap_chan *chan) static inline struct l2cap_chan *chan_new_conn_cb(struct l2cap_chan *pchan)
{ {
struct l2cap_chan *pchan; struct l2cap_chan *chan;
pchan = chan_open(chan); chan = chan_open(pchan);
pchan->ops = chan->ops; chan->ops = pchan->ops;
BT_DBG("chan %p pchan %p", chan, pchan); BT_DBG("chan %p pchan %p", chan, pchan);
return pchan; return chan;
} }
static void delete_netdev(struct work_struct *work) static void delete_netdev(struct work_struct *work)
......
...@@ -1898,6 +1898,8 @@ static int __hci_init(struct hci_dev *hdev) ...@@ -1898,6 +1898,8 @@ static int __hci_init(struct hci_dev *hdev)
debugfs_create_u16("discov_interleaved_timeout", 0644, debugfs_create_u16("discov_interleaved_timeout", 0644,
hdev->debugfs, hdev->debugfs,
&hdev->discov_interleaved_timeout); &hdev->discov_interleaved_timeout);
smp_register(hdev);
} }
return 0; return 0;
...@@ -3233,7 +3235,7 @@ struct smp_irk *hci_find_irk_by_rpa(struct hci_dev *hdev, bdaddr_t *rpa) ...@@ -3233,7 +3235,7 @@ struct smp_irk *hci_find_irk_by_rpa(struct hci_dev *hdev, bdaddr_t *rpa)
} }
list_for_each_entry(irk, &hdev->identity_resolving_keys, list) { list_for_each_entry(irk, &hdev->identity_resolving_keys, list) {
if (smp_irk_matches(hdev->tfm_aes, irk->val, rpa)) { if (smp_irk_matches(hdev, irk->val, rpa)) {
bacpy(&irk->rpa, rpa); bacpy(&irk->rpa, rpa);
return irk; return irk;
} }
...@@ -3882,7 +3884,7 @@ int hci_update_random_address(struct hci_request *req, bool require_privacy, ...@@ -3882,7 +3884,7 @@ int hci_update_random_address(struct hci_request *req, bool require_privacy,
!bacmp(&hdev->random_addr, &hdev->rpa)) !bacmp(&hdev->random_addr, &hdev->rpa))
return 0; return 0;
err = smp_generate_rpa(hdev->tfm_aes, hdev->irk, &hdev->rpa); err = smp_generate_rpa(hdev, hdev->irk, &hdev->rpa);
if (err < 0) { if (err < 0) {
BT_ERR("%s failed to generate new RPA", hdev->name); BT_ERR("%s failed to generate new RPA", hdev->name);
return err; return err;
...@@ -4090,18 +4092,9 @@ int hci_register_dev(struct hci_dev *hdev) ...@@ -4090,18 +4092,9 @@ int hci_register_dev(struct hci_dev *hdev)
dev_set_name(&hdev->dev, "%s", hdev->name); dev_set_name(&hdev->dev, "%s", hdev->name);
hdev->tfm_aes = crypto_alloc_blkcipher("ecb(aes)", 0,
CRYPTO_ALG_ASYNC);
if (IS_ERR(hdev->tfm_aes)) {
BT_ERR("Unable to create crypto context");
error = PTR_ERR(hdev->tfm_aes);
hdev->tfm_aes = NULL;
goto err_wqueue;
}
error = device_add(&hdev->dev); error = device_add(&hdev->dev);
if (error < 0) if (error < 0)
goto err_tfm; goto err_wqueue;
hdev->rfkill = rfkill_alloc(hdev->name, &hdev->dev, hdev->rfkill = rfkill_alloc(hdev->name, &hdev->dev,
RFKILL_TYPE_BLUETOOTH, &hci_rfkill_ops, RFKILL_TYPE_BLUETOOTH, &hci_rfkill_ops,
...@@ -4143,8 +4136,6 @@ int hci_register_dev(struct hci_dev *hdev) ...@@ -4143,8 +4136,6 @@ int hci_register_dev(struct hci_dev *hdev)
return id; return id;
err_tfm:
crypto_free_blkcipher(hdev->tfm_aes);
err_wqueue: err_wqueue:
destroy_workqueue(hdev->workqueue); destroy_workqueue(hdev->workqueue);
destroy_workqueue(hdev->req_workqueue); destroy_workqueue(hdev->req_workqueue);
...@@ -4196,8 +4187,7 @@ void hci_unregister_dev(struct hci_dev *hdev) ...@@ -4196,8 +4187,7 @@ void hci_unregister_dev(struct hci_dev *hdev)
rfkill_destroy(hdev->rfkill); rfkill_destroy(hdev->rfkill);
} }
if (hdev->tfm_aes) smp_unregister(hdev);
crypto_free_blkcipher(hdev->tfm_aes);
device_del(&hdev->dev); device_del(&hdev->dev);
...@@ -5680,3 +5670,52 @@ void hci_update_background_scan(struct hci_dev *hdev) ...@@ -5680,3 +5670,52 @@ void hci_update_background_scan(struct hci_dev *hdev)
if (err) if (err)
BT_ERR("Failed to run HCI request: err %d", err); BT_ERR("Failed to run HCI request: err %d", err);
} }
static bool disconnected_whitelist_entries(struct hci_dev *hdev)
{
struct bdaddr_list *b;
list_for_each_entry(b, &hdev->whitelist, list) {
struct hci_conn *conn;
conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &b->bdaddr);
if (!conn)
return true;
if (conn->state != BT_CONNECTED && conn->state != BT_CONFIG)
return true;
}
return false;
}
void hci_update_page_scan(struct hci_dev *hdev, struct hci_request *req)
{
u8 scan;
if (!test_bit(HCI_BREDR_ENABLED, &hdev->dev_flags))
return;
if (!hdev_is_powered(hdev))
return;
if (mgmt_powering_down(hdev))
return;
if (test_bit(HCI_CONNECTABLE, &hdev->dev_flags) ||
disconnected_whitelist_entries(hdev))
scan = SCAN_PAGE;
else
scan = SCAN_DISABLED;
if (test_bit(HCI_PSCAN, &hdev->flags) == !!(scan & SCAN_PAGE))
return;
if (test_bit(HCI_DISCOVERABLE, &hdev->dev_flags))
scan |= SCAN_INQUIRY;
if (req)
hci_req_add(req, HCI_OP_WRITE_SCAN_ENABLE, 1, &scan);
else
hci_send_cmd(hdev, HCI_OP_WRITE_SCAN_ENABLE, 1, &scan);
}
...@@ -2071,6 +2071,8 @@ static void hci_conn_complete_evt(struct hci_dev *hdev, struct sk_buff *skb) ...@@ -2071,6 +2071,8 @@ static void hci_conn_complete_evt(struct hci_dev *hdev, struct sk_buff *skb)
cp.handle = ev->handle; cp.handle = ev->handle;
hci_send_cmd(hdev, HCI_OP_READ_REMOTE_FEATURES, hci_send_cmd(hdev, HCI_OP_READ_REMOTE_FEATURES,
sizeof(cp), &cp); sizeof(cp), &cp);
hci_update_page_scan(hdev, NULL);
} }
/* Set packet type for incoming connection */ /* Set packet type for incoming connection */
...@@ -2247,10 +2249,13 @@ static void hci_disconn_complete_evt(struct hci_dev *hdev, struct sk_buff *skb) ...@@ -2247,10 +2249,13 @@ static void hci_disconn_complete_evt(struct hci_dev *hdev, struct sk_buff *skb)
mgmt_device_disconnected(hdev, &conn->dst, conn->type, conn->dst_type, mgmt_device_disconnected(hdev, &conn->dst, conn->type, conn->dst_type,
reason, mgmt_connected); reason, mgmt_connected);
if (conn->type == ACL_LINK && if (conn->type == ACL_LINK) {
test_bit(HCI_CONN_FLUSH_KEY, &conn->flags)) if (test_bit(HCI_CONN_FLUSH_KEY, &conn->flags))
hci_remove_link_key(hdev, &conn->dst); hci_remove_link_key(hdev, &conn->dst);
hci_update_page_scan(hdev, NULL);
}
params = hci_conn_params_lookup(hdev, &conn->dst, conn->dst_type); params = hci_conn_params_lookup(hdev, &conn->dst, conn->dst_type);
if (params) { if (params) {
switch (params->auto_connect) { switch (params->auto_connect) {
......
This diff is collapsed.
...@@ -99,15 +99,6 @@ static int l2cap_sock_bind(struct socket *sock, struct sockaddr *addr, int alen) ...@@ -99,15 +99,6 @@ static int l2cap_sock_bind(struct socket *sock, struct sockaddr *addr, int alen)
if (!bdaddr_type_is_valid(la.l2_bdaddr_type)) if (!bdaddr_type_is_valid(la.l2_bdaddr_type))
return -EINVAL; return -EINVAL;
if (la.l2_cid) {
/* When the socket gets created it defaults to
* CHAN_CONN_ORIENTED, so we need to overwrite the
* default here.
*/
chan->chan_type = L2CAP_CHAN_FIXED;
chan->omtu = L2CAP_DEFAULT_MTU;
}
if (bdaddr_type_is_le(la.l2_bdaddr_type)) { if (bdaddr_type_is_le(la.l2_bdaddr_type)) {
/* We only allow ATT user space socket */ /* We only allow ATT user space socket */
if (la.l2_cid && if (la.l2_cid &&
...@@ -790,6 +781,7 @@ static int l2cap_sock_setsockopt(struct socket *sock, int level, int optname, ...@@ -790,6 +781,7 @@ static int l2cap_sock_setsockopt(struct socket *sock, int level, int optname,
if (chan->scid == L2CAP_CID_ATT) { if (chan->scid == L2CAP_CID_ATT) {
if (smp_conn_security(conn->hcon, sec.level)) if (smp_conn_security(conn->hcon, sec.level))
break; break;
set_bit(FLAG_PENDING_SECURITY, &chan->flags);
sk->sk_state = BT_CONFIG; sk->sk_state = BT_CONFIG;
chan->state = BT_CONFIG; chan->state = BT_CONFIG;
...@@ -1359,6 +1351,11 @@ static void l2cap_sock_resume_cb(struct l2cap_chan *chan) ...@@ -1359,6 +1351,11 @@ static void l2cap_sock_resume_cb(struct l2cap_chan *chan)
{ {
struct sock *sk = chan->data; struct sock *sk = chan->data;
if (test_and_clear_bit(FLAG_PENDING_SECURITY, &chan->flags)) {
sk->sk_state = BT_CONNECTED;
chan->state = BT_CONNECTED;
}
clear_bit(BT_SK_SUSPEND, &bt_sk(sk)->flags); clear_bit(BT_SK_SUSPEND, &bt_sk(sk)->flags);
sk->sk_state_change(sk); sk->sk_state_change(sk);
} }
......
...@@ -129,9 +129,6 @@ static const u16 mgmt_events[] = { ...@@ -129,9 +129,6 @@ static const u16 mgmt_events[] = {
#define CACHE_TIMEOUT msecs_to_jiffies(2 * 1000) #define CACHE_TIMEOUT msecs_to_jiffies(2 * 1000)
#define hdev_is_powered(hdev) (test_bit(HCI_UP, &hdev->flags) && \
!test_bit(HCI_AUTO_OFF, &hdev->dev_flags))
struct pending_cmd { struct pending_cmd {
struct list_head list; struct list_head list;
u16 opcode; u16 opcode;
...@@ -1536,9 +1533,11 @@ static void set_discoverable_complete(struct hci_dev *hdev, u8 status) ...@@ -1536,9 +1533,11 @@ static void set_discoverable_complete(struct hci_dev *hdev, u8 status)
/* When the discoverable mode gets changed, make sure /* When the discoverable mode gets changed, make sure
* that class of device has the limited discoverable * that class of device has the limited discoverable
* bit correctly set. * bit correctly set. Also update page scan based on whitelist
* entries.
*/ */
hci_req_init(&req, hdev); hci_req_init(&req, hdev);
hci_update_page_scan(hdev, &req);
update_class(&req); update_class(&req);
hci_req_run(&req, NULL); hci_req_run(&req, NULL);
...@@ -1785,6 +1784,7 @@ static void set_connectable_complete(struct hci_dev *hdev, u8 status) ...@@ -1785,6 +1784,7 @@ static void set_connectable_complete(struct hci_dev *hdev, u8 status)
if (conn_changed || discov_changed) { if (conn_changed || discov_changed) {
new_settings(hdev, cmd->sk); new_settings(hdev, cmd->sk);
hci_update_page_scan(hdev, NULL);
if (discov_changed) if (discov_changed)
mgmt_update_adv_data(hdev); mgmt_update_adv_data(hdev);
hci_update_background_scan(hdev); hci_update_background_scan(hdev);
...@@ -1818,6 +1818,7 @@ static int set_connectable_update_settings(struct hci_dev *hdev, ...@@ -1818,6 +1818,7 @@ static int set_connectable_update_settings(struct hci_dev *hdev,
return err; return err;
if (changed) { if (changed) {
hci_update_page_scan(hdev, NULL);
hci_update_background_scan(hdev); hci_update_background_scan(hdev);
return new_settings(hdev, sk); return new_settings(hdev, sk);
} }
...@@ -4381,27 +4382,6 @@ static int set_fast_connectable(struct sock *sk, struct hci_dev *hdev, ...@@ -4381,27 +4382,6 @@ static int set_fast_connectable(struct sock *sk, struct hci_dev *hdev,
return err; return err;
} }
static void set_bredr_scan(struct hci_request *req)
{
struct hci_dev *hdev = req->hdev;
u8 scan = 0;
/* Ensure that fast connectable is disabled. This function will
* not do anything if the page scan parameters are already what
* they should be.
*/
write_fast_connectable(req, false);
if (test_bit(HCI_CONNECTABLE, &hdev->dev_flags) ||
!list_empty(&hdev->whitelist))
scan |= SCAN_PAGE;
if (test_bit(HCI_DISCOVERABLE, &hdev->dev_flags))
scan |= SCAN_INQUIRY;
if (scan)
hci_req_add(req, HCI_OP_WRITE_SCAN_ENABLE, 1, &scan);
}
static void set_bredr_complete(struct hci_dev *hdev, u8 status) static void set_bredr_complete(struct hci_dev *hdev, u8 status)
{ {
struct pending_cmd *cmd; struct pending_cmd *cmd;
...@@ -4507,9 +4487,8 @@ static int set_bredr(struct sock *sk, struct hci_dev *hdev, void *data, u16 len) ...@@ -4507,9 +4487,8 @@ static int set_bredr(struct sock *sk, struct hci_dev *hdev, void *data, u16 len)
hci_req_init(&req, hdev); hci_req_init(&req, hdev);
if (test_bit(HCI_CONNECTABLE, &hdev->dev_flags) || write_fast_connectable(&req, false);
!list_empty(&hdev->whitelist)) hci_update_page_scan(hdev, &req);
set_bredr_scan(&req);
/* Since only the advertising data flags will change, there /* Since only the advertising data flags will change, there
* is no need to update the scan response data. * is no need to update the scan response data.
...@@ -5235,27 +5214,6 @@ static int get_clock_info(struct sock *sk, struct hci_dev *hdev, void *data, ...@@ -5235,27 +5214,6 @@ static int get_clock_info(struct sock *sk, struct hci_dev *hdev, void *data,
return err; return err;
} }
/* Helper for Add/Remove Device commands */
static void update_page_scan(struct hci_dev *hdev, u8 scan)
{
if (!test_bit(HCI_BREDR_ENABLED, &hdev->dev_flags))
return;
if (!hdev_is_powered(hdev))
return;
/* If HCI_CONNECTABLE is set then Add/Remove Device should not
* make any changes to page scanning.
*/
if (test_bit(HCI_CONNECTABLE, &hdev->dev_flags))
return;
if (test_bit(HCI_DISCOVERABLE, &hdev->dev_flags))
scan |= SCAN_INQUIRY;
hci_send_cmd(hdev, HCI_OP_WRITE_SCAN_ENABLE, 1, &scan);
}
static void device_added(struct sock *sk, struct hci_dev *hdev, static void device_added(struct sock *sk, struct hci_dev *hdev,
bdaddr_t *bdaddr, u8 type, u8 action) bdaddr_t *bdaddr, u8 type, u8 action)
{ {
...@@ -5291,8 +5249,6 @@ static int add_device(struct sock *sk, struct hci_dev *hdev, ...@@ -5291,8 +5249,6 @@ static int add_device(struct sock *sk, struct hci_dev *hdev,
hci_dev_lock(hdev); hci_dev_lock(hdev);
if (cp->addr.type == BDADDR_BREDR) { if (cp->addr.type == BDADDR_BREDR) {
bool update_scan;
/* Only incoming connections action is supported for now */ /* Only incoming connections action is supported for now */
if (cp->action != 0x01) { if (cp->action != 0x01) {
err = cmd_complete(sk, hdev->id, MGMT_OP_ADD_DEVICE, err = cmd_complete(sk, hdev->id, MGMT_OP_ADD_DEVICE,
...@@ -5301,15 +5257,12 @@ static int add_device(struct sock *sk, struct hci_dev *hdev, ...@@ -5301,15 +5257,12 @@ static int add_device(struct sock *sk, struct hci_dev *hdev,
goto unlock; goto unlock;
} }
update_scan = list_empty(&hdev->whitelist);
err = hci_bdaddr_list_add(&hdev->whitelist, &cp->addr.bdaddr, err = hci_bdaddr_list_add(&hdev->whitelist, &cp->addr.bdaddr,
cp->addr.type); cp->addr.type);
if (err) if (err)
goto unlock; goto unlock;
if (update_scan) hci_update_page_scan(hdev, NULL);
update_page_scan(hdev, SCAN_PAGE);
goto added; goto added;
} }
...@@ -5392,8 +5345,7 @@ static int remove_device(struct sock *sk, struct hci_dev *hdev, ...@@ -5392,8 +5345,7 @@ static int remove_device(struct sock *sk, struct hci_dev *hdev,
goto unlock; goto unlock;
} }
if (list_empty(&hdev->whitelist)) hci_update_page_scan(hdev, NULL);
update_page_scan(hdev, SCAN_DISABLED);
device_removed(sk, hdev, &cp->addr.bdaddr, device_removed(sk, hdev, &cp->addr.bdaddr,
cp->addr.type); cp->addr.type);
...@@ -5444,7 +5396,7 @@ static int remove_device(struct sock *sk, struct hci_dev *hdev, ...@@ -5444,7 +5396,7 @@ static int remove_device(struct sock *sk, struct hci_dev *hdev,
kfree(b); kfree(b);
} }
update_page_scan(hdev, SCAN_DISABLED); hci_update_page_scan(hdev, NULL);
list_for_each_entry_safe(p, tmp, &hdev->le_conn_params, list) { list_for_each_entry_safe(p, tmp, &hdev->le_conn_params, list) {
if (p->auto_connect == HCI_AUTO_CONN_DISABLED) if (p->auto_connect == HCI_AUTO_CONN_DISABLED)
...@@ -5969,8 +5921,8 @@ static int powered_update_hci(struct hci_dev *hdev) ...@@ -5969,8 +5921,8 @@ static int powered_update_hci(struct hci_dev *hdev)
sizeof(link_sec), &link_sec); sizeof(link_sec), &link_sec);
if (lmp_bredr_capable(hdev)) { if (lmp_bredr_capable(hdev)) {
if (test_bit(HCI_BREDR_ENABLED, &hdev->dev_flags)) write_fast_connectable(&req, false);
set_bredr_scan(&req); hci_update_page_scan(hdev, &req);
update_class(&req); update_class(&req);
update_name(&req); update_name(&req);
update_eir(&req); update_eir(&req);
...@@ -6281,26 +6233,36 @@ static void unpair_device_rsp(struct pending_cmd *cmd, void *data) ...@@ -6281,26 +6233,36 @@ static void unpair_device_rsp(struct pending_cmd *cmd, void *data)
mgmt_pending_remove(cmd); mgmt_pending_remove(cmd);
} }
bool mgmt_powering_down(struct hci_dev *hdev)
{
struct pending_cmd *cmd;
struct mgmt_mode *cp;
cmd = mgmt_pending_find(MGMT_OP_SET_POWERED, hdev);
if (!cmd)
return false;
cp = cmd->param;
if (!cp->val)
return true;
return false;
}
void mgmt_device_disconnected(struct hci_dev *hdev, bdaddr_t *bdaddr, void mgmt_device_disconnected(struct hci_dev *hdev, bdaddr_t *bdaddr,
u8 link_type, u8 addr_type, u8 reason, u8 link_type, u8 addr_type, u8 reason,
bool mgmt_connected) bool mgmt_connected)
{ {
struct mgmt_ev_device_disconnected ev; struct mgmt_ev_device_disconnected ev;
struct pending_cmd *power_off;
struct sock *sk = NULL; struct sock *sk = NULL;
power_off = mgmt_pending_find(MGMT_OP_SET_POWERED, hdev);
if (power_off) {
struct mgmt_mode *cp = power_off->param;
/* The connection is still in hci_conn_hash so test for 1 /* The connection is still in hci_conn_hash so test for 1
* instead of 0 to know if this is the last one. * instead of 0 to know if this is the last one.
*/ */
if (!cp->val && hci_conn_count(hdev) == 1) { if (mgmt_powering_down(hdev) && hci_conn_count(hdev) == 1) {
cancel_delayed_work(&hdev->power_off); cancel_delayed_work(&hdev->power_off);
queue_work(hdev->req_workqueue, &hdev->power_off.work); queue_work(hdev->req_workqueue, &hdev->power_off.work);
} }
}
if (!mgmt_connected) if (!mgmt_connected)
return; return;
...@@ -6359,20 +6321,14 @@ void mgmt_connect_failed(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type, ...@@ -6359,20 +6321,14 @@ void mgmt_connect_failed(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type,
u8 addr_type, u8 status) u8 addr_type, u8 status)
{ {
struct mgmt_ev_connect_failed ev; struct mgmt_ev_connect_failed ev;
struct pending_cmd *power_off;
power_off = mgmt_pending_find(MGMT_OP_SET_POWERED, hdev);
if (power_off) {
struct mgmt_mode *cp = power_off->param;
/* The connection is still in hci_conn_hash so test for 1 /* The connection is still in hci_conn_hash so test for 1
* instead of 0 to know if this is the last one. * instead of 0 to know if this is the last one.
*/ */
if (!cp->val && hci_conn_count(hdev) == 1) { if (mgmt_powering_down(hdev) && hci_conn_count(hdev) == 1) {
cancel_delayed_work(&hdev->power_off); cancel_delayed_work(&hdev->power_off);
queue_work(hdev->req_workqueue, &hdev->power_off.work); queue_work(hdev->req_workqueue, &hdev->power_off.work);
} }
}
bacpy(&ev.addr.bdaddr, bdaddr); bacpy(&ev.addr.bdaddr, bdaddr);
ev.addr.type = link_to_bdaddr(link_type, addr_type); ev.addr.type = link_to_bdaddr(link_type, addr_type);
......
This diff is collapsed.
...@@ -126,14 +126,12 @@ enum { ...@@ -126,14 +126,12 @@ enum {
/* SMP Commands */ /* SMP Commands */
bool smp_sufficient_security(struct hci_conn *hcon, u8 sec_level); bool smp_sufficient_security(struct hci_conn *hcon, u8 sec_level);
int smp_conn_security(struct hci_conn *hcon, __u8 sec_level); int smp_conn_security(struct hci_conn *hcon, __u8 sec_level);
int smp_sig_channel(struct l2cap_conn *conn, struct sk_buff *skb);
int smp_distribute_keys(struct l2cap_conn *conn);
int smp_user_confirm_reply(struct hci_conn *conn, u16 mgmt_op, __le32 passkey); int smp_user_confirm_reply(struct hci_conn *conn, u16 mgmt_op, __le32 passkey);
void smp_chan_destroy(struct l2cap_conn *conn); bool smp_irk_matches(struct hci_dev *hdev, u8 irk[16], bdaddr_t *bdaddr);
int smp_generate_rpa(struct hci_dev *hdev, u8 irk[16], bdaddr_t *rpa);
bool smp_irk_matches(struct crypto_blkcipher *tfm, u8 irk[16], int smp_register(struct hci_dev *hdev);
bdaddr_t *bdaddr); void smp_unregister(struct hci_dev *hdev);
int smp_generate_rpa(struct crypto_blkcipher *tfm, u8 irk[16], bdaddr_t *rpa);
#endif /* __SMP_H */ #endif /* __SMP_H */
...@@ -77,14 +77,6 @@ lowpan_dev_info *lowpan_dev_info(const struct net_device *dev) ...@@ -77,14 +77,6 @@ lowpan_dev_info *lowpan_dev_info(const struct net_device *dev)
return netdev_priv(dev); return netdev_priv(dev);
} }
static inline void lowpan_address_flip(u8 *src, u8 *dest)
{
int i;
for (i = 0; i < IEEE802154_ADDR_LEN; i++)
(dest)[IEEE802154_ADDR_LEN - i - 1] = (src)[i];
}
static int lowpan_header_create(struct sk_buff *skb, struct net_device *dev, static int lowpan_header_create(struct sk_buff *skb, struct net_device *dev,
unsigned short type, const void *_daddr, unsigned short type, const void *_daddr,
const void *_saddr, unsigned int len) const void *_saddr, unsigned int len)
......
...@@ -86,9 +86,8 @@ mac802154_subif_rx(struct ieee802154_dev *hw, struct sk_buff *skb, u8 lqi) ...@@ -86,9 +86,8 @@ mac802154_subif_rx(struct ieee802154_dev *hw, struct sk_buff *skb, u8 lqi)
static void mac802154_rx_worker(struct work_struct *work) static void mac802154_rx_worker(struct work_struct *work)
{ {
struct rx_work *rw = container_of(work, struct rx_work, work); struct rx_work *rw = container_of(work, struct rx_work, work);
struct sk_buff *skb = rw->skb;
mac802154_subif_rx(rw->dev, skb, rw->lqi); mac802154_subif_rx(rw->dev, rw->skb, rw->lqi);
kfree(rw); kfree(rw);
} }
...@@ -101,7 +100,7 @@ ieee802154_rx_irqsafe(struct ieee802154_dev *dev, struct sk_buff *skb, u8 lqi) ...@@ -101,7 +100,7 @@ ieee802154_rx_irqsafe(struct ieee802154_dev *dev, struct sk_buff *skb, u8 lqi)
if (!skb) if (!skb)
return; return;
work = kzalloc(sizeof(struct rx_work), GFP_ATOMIC); work = kzalloc(sizeof(*work), GFP_ATOMIC);
if (!work) if (!work)
return; return;
......
...@@ -89,8 +89,7 @@ netdev_tx_t mac802154_tx(struct mac802154_priv *priv, struct sk_buff *skb, ...@@ -89,8 +89,7 @@ netdev_tx_t mac802154_tx(struct mac802154_priv *priv, struct sk_buff *skb,
if (!(priv->phy->channels_supported[page] & (1 << chan))) { if (!(priv->phy->channels_supported[page] & (1 << chan))) {
WARN_ON(1); WARN_ON(1);
kfree_skb(skb); goto err_tx;
return NETDEV_TX_OK;
} }
mac802154_monitors_rx(mac802154_to_priv(&priv->hw), skb); mac802154_monitors_rx(mac802154_to_priv(&priv->hw), skb);
...@@ -103,12 +102,10 @@ netdev_tx_t mac802154_tx(struct mac802154_priv *priv, struct sk_buff *skb, ...@@ -103,12 +102,10 @@ netdev_tx_t mac802154_tx(struct mac802154_priv *priv, struct sk_buff *skb,
data[1] = crc >> 8; data[1] = crc >> 8;
} }
if (skb_cow_head(skb, priv->hw.extra_tx_headroom)) { if (skb_cow_head(skb, priv->hw.extra_tx_headroom))
kfree_skb(skb); goto err_tx;
return NETDEV_TX_OK;
}
work = kzalloc(sizeof(struct xmit_work), GFP_ATOMIC); work = kzalloc(sizeof(*work), GFP_ATOMIC);
if (!work) { if (!work) {
kfree_skb(skb); kfree_skb(skb);
return NETDEV_TX_BUSY; return NETDEV_TX_BUSY;
...@@ -129,4 +126,8 @@ netdev_tx_t mac802154_tx(struct mac802154_priv *priv, struct sk_buff *skb, ...@@ -129,4 +126,8 @@ netdev_tx_t mac802154_tx(struct mac802154_priv *priv, struct sk_buff *skb,
queue_work(priv->dev_workqueue, &work->work); queue_work(priv->dev_workqueue, &work->work);
return NETDEV_TX_OK; return NETDEV_TX_OK;
err_tx:
kfree_skb(skb);
return NETDEV_TX_OK;
} }
...@@ -472,8 +472,7 @@ mac802154_subif_frame(struct mac802154_sub_if_data *sdata, struct sk_buff *skb, ...@@ -472,8 +472,7 @@ mac802154_subif_frame(struct mac802154_sub_if_data *sdata, struct sk_buff *skb,
rc = mac802154_llsec_decrypt(&sdata->sec, skb); rc = mac802154_llsec_decrypt(&sdata->sec, skb);
if (rc) { if (rc) {
pr_debug("decryption failed: %i\n", rc); pr_debug("decryption failed: %i\n", rc);
kfree_skb(skb); goto fail;
return NET_RX_DROP;
} }
sdata->dev->stats.rx_packets++; sdata->dev->stats.rx_packets++;
...@@ -485,9 +484,12 @@ mac802154_subif_frame(struct mac802154_sub_if_data *sdata, struct sk_buff *skb, ...@@ -485,9 +484,12 @@ mac802154_subif_frame(struct mac802154_sub_if_data *sdata, struct sk_buff *skb,
default: default:
pr_warn("ieee802154: bad frame received (type = %d)\n", pr_warn("ieee802154: bad frame received (type = %d)\n",
mac_cb(skb)->type); mac_cb(skb)->type);
goto fail;
}
fail:
kfree_skb(skb); kfree_skb(skb);
return NET_RX_DROP; return NET_RX_DROP;
}
} }
static void mac802154_print_addr(const char *name, static void mac802154_print_addr(const char *name,
......
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