Skip to content

Commit

Permalink
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/gi…
Browse files Browse the repository at this point in the history
…t/padovan/bluetooth-next
  • Loading branch information
David S. Miller committed Mar 8, 2012
2 parents e427bab + fdde0a2 commit 0111ad8
Show file tree
Hide file tree
Showing 41 changed files with 4,327 additions and 2,332 deletions.
3 changes: 3 additions & 0 deletions drivers/bluetooth/ath3k.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,14 @@ static struct usb_device_id ath3k_table[] = {
{ USB_DEVICE(0x0CF3, 0x3002) },
{ USB_DEVICE(0x13d3, 0x3304) },
{ USB_DEVICE(0x0930, 0x0215) },
{ USB_DEVICE(0x0489, 0xE03D) },

/* Atheros AR9285 Malbec with sflash firmware */
{ USB_DEVICE(0x03F0, 0x311D) },

/* Atheros AR3012 with sflash firmware*/
{ USB_DEVICE(0x0CF3, 0x3004) },
{ USB_DEVICE(0x13d3, 0x3375) },

/* Atheros AR5BBU12 with sflash firmware */
{ USB_DEVICE(0x0489, 0xE02C) },
Expand All @@ -87,6 +89,7 @@ static struct usb_device_id ath3k_blist_tbl[] = {

/* Atheros AR3012 with sflash firmware*/
{ USB_DEVICE(0x0cf3, 0x3004), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x13d3, 0x3375), .driver_info = BTUSB_ATH3012 },

{ } /* Terminating entry */
};
Expand Down
23 changes: 6 additions & 17 deletions drivers/bluetooth/bfusb.c
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ static void bfusb_rx_complete(struct urb *urb)

static int bfusb_open(struct hci_dev *hdev)
{
struct bfusb_data *data = hdev->driver_data;
struct bfusb_data *data = hci_get_drvdata(hdev);
unsigned long flags;
int i, err;

Expand All @@ -437,7 +437,7 @@ static int bfusb_open(struct hci_dev *hdev)

static int bfusb_flush(struct hci_dev *hdev)
{
struct bfusb_data *data = hdev->driver_data;
struct bfusb_data *data = hci_get_drvdata(hdev);

BT_DBG("hdev %p bfusb %p", hdev, data);

Expand All @@ -448,7 +448,7 @@ static int bfusb_flush(struct hci_dev *hdev)

static int bfusb_close(struct hci_dev *hdev)
{
struct bfusb_data *data = hdev->driver_data;
struct bfusb_data *data = hci_get_drvdata(hdev);
unsigned long flags;

BT_DBG("hdev %p bfusb %p", hdev, data);
Expand Down Expand Up @@ -483,7 +483,7 @@ static int bfusb_send_frame(struct sk_buff *skb)
if (!test_bit(HCI_RUNNING, &hdev->flags))
return -EBUSY;

data = hdev->driver_data;
data = hci_get_drvdata(hdev);

switch (bt_cb(skb)->pkt_type) {
case HCI_COMMAND_PKT:
Expand Down Expand Up @@ -544,15 +544,6 @@ static int bfusb_send_frame(struct sk_buff *skb)
return 0;
}

static void bfusb_destruct(struct hci_dev *hdev)
{
struct bfusb_data *data = hdev->driver_data;

BT_DBG("hdev %p bfusb %p", hdev, data);

kfree(data);
}

static int bfusb_ioctl(struct hci_dev *hdev, unsigned int cmd, unsigned long arg)
{
return -ENOIOCTLCMD;
Expand Down Expand Up @@ -705,18 +696,15 @@ static int bfusb_probe(struct usb_interface *intf, const struct usb_device_id *i
data->hdev = hdev;

hdev->bus = HCI_USB;
hdev->driver_data = data;
hci_set_drvdata(hdev, data);
SET_HCIDEV_DEV(hdev, &intf->dev);

hdev->open = bfusb_open;
hdev->close = bfusb_close;
hdev->flush = bfusb_flush;
hdev->send = bfusb_send_frame;
hdev->destruct = bfusb_destruct;
hdev->ioctl = bfusb_ioctl;

hdev->owner = THIS_MODULE;

if (hci_register_dev(hdev) < 0) {
BT_ERR("Can't register HCI device");
hci_free_dev(hdev);
Expand Down Expand Up @@ -753,6 +741,7 @@ static void bfusb_disconnect(struct usb_interface *intf)

hci_unregister_dev(hdev);
hci_free_dev(hdev);
kfree(data);
}

static struct usb_driver bfusb_driver = {
Expand Down
20 changes: 6 additions & 14 deletions drivers/bluetooth/bluecard_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ static irqreturn_t bluecard_interrupt(int irq, void *dev_inst)

static int bluecard_hci_set_baud_rate(struct hci_dev *hdev, int baud)
{
bluecard_info_t *info = (bluecard_info_t *)(hdev->driver_data);
bluecard_info_t *info = hci_get_drvdata(hdev);
struct sk_buff *skb;

/* Ericsson baud rate command */
Expand Down Expand Up @@ -609,7 +609,7 @@ static int bluecard_hci_set_baud_rate(struct hci_dev *hdev, int baud)

static int bluecard_hci_flush(struct hci_dev *hdev)
{
bluecard_info_t *info = (bluecard_info_t *)(hdev->driver_data);
bluecard_info_t *info = hci_get_drvdata(hdev);

/* Drop TX queue */
skb_queue_purge(&(info->txq));
Expand All @@ -620,7 +620,7 @@ static int bluecard_hci_flush(struct hci_dev *hdev)

static int bluecard_hci_open(struct hci_dev *hdev)
{
bluecard_info_t *info = (bluecard_info_t *)(hdev->driver_data);
bluecard_info_t *info = hci_get_drvdata(hdev);
unsigned int iobase = info->p_dev->resource[0]->start;

if (test_bit(CARD_HAS_PCCARD_ID, &(info->hw_state)))
Expand All @@ -640,7 +640,7 @@ static int bluecard_hci_open(struct hci_dev *hdev)

static int bluecard_hci_close(struct hci_dev *hdev)
{
bluecard_info_t *info = (bluecard_info_t *)(hdev->driver_data);
bluecard_info_t *info = hci_get_drvdata(hdev);
unsigned int iobase = info->p_dev->resource[0]->start;

if (!test_and_clear_bit(HCI_RUNNING, &(hdev->flags)))
Expand All @@ -667,7 +667,7 @@ static int bluecard_hci_send_frame(struct sk_buff *skb)
return -ENODEV;
}

info = (bluecard_info_t *)(hdev->driver_data);
info = hci_get_drvdata(hdev);

switch (bt_cb(skb)->pkt_type) {
case HCI_COMMAND_PKT:
Expand All @@ -691,11 +691,6 @@ static int bluecard_hci_send_frame(struct sk_buff *skb)
}


static void bluecard_hci_destruct(struct hci_dev *hdev)
{
}


static int bluecard_hci_ioctl(struct hci_dev *hdev, unsigned int cmd, unsigned long arg)
{
return -ENOIOCTLCMD;
Expand Down Expand Up @@ -734,18 +729,15 @@ static int bluecard_open(bluecard_info_t *info)
info->hdev = hdev;

hdev->bus = HCI_PCCARD;
hdev->driver_data = info;
hci_set_drvdata(hdev, info);
SET_HCIDEV_DEV(hdev, &info->p_dev->dev);

hdev->open = bluecard_hci_open;
hdev->close = bluecard_hci_close;
hdev->flush = bluecard_hci_flush;
hdev->send = bluecard_hci_send_frame;
hdev->destruct = bluecard_hci_destruct;
hdev->ioctl = bluecard_hci_ioctl;

hdev->owner = THIS_MODULE;

id = inb(iobase + 0x30);

if ((id & 0x0f) == 0x02)
Expand Down
35 changes: 12 additions & 23 deletions drivers/bluetooth/bpa10x.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ struct hci_vendor_hdr {

static int bpa10x_recv(struct hci_dev *hdev, int queue, void *buf, int count)
{
struct bpa10x_data *data = hdev->driver_data;
struct bpa10x_data *data = hci_get_drvdata(hdev);

BT_DBG("%s queue %d buffer %p count %d", hdev->name,
queue, buf, count);
Expand Down Expand Up @@ -189,7 +189,7 @@ static void bpa10x_tx_complete(struct urb *urb)
static void bpa10x_rx_complete(struct urb *urb)
{
struct hci_dev *hdev = urb->context;
struct bpa10x_data *data = hdev->driver_data;
struct bpa10x_data *data = hci_get_drvdata(hdev);
int err;

BT_DBG("%s urb %p status %d count %d", hdev->name,
Expand Down Expand Up @@ -219,7 +219,7 @@ static void bpa10x_rx_complete(struct urb *urb)

static inline int bpa10x_submit_intr_urb(struct hci_dev *hdev)
{
struct bpa10x_data *data = hdev->driver_data;
struct bpa10x_data *data = hci_get_drvdata(hdev);
struct urb *urb;
unsigned char *buf;
unsigned int pipe;
Expand Down Expand Up @@ -260,7 +260,7 @@ static inline int bpa10x_submit_intr_urb(struct hci_dev *hdev)

static inline int bpa10x_submit_bulk_urb(struct hci_dev *hdev)
{
struct bpa10x_data *data = hdev->driver_data;
struct bpa10x_data *data = hci_get_drvdata(hdev);
struct urb *urb;
unsigned char *buf;
unsigned int pipe;
Expand Down Expand Up @@ -301,7 +301,7 @@ static inline int bpa10x_submit_bulk_urb(struct hci_dev *hdev)

static int bpa10x_open(struct hci_dev *hdev)
{
struct bpa10x_data *data = hdev->driver_data;
struct bpa10x_data *data = hci_get_drvdata(hdev);
int err;

BT_DBG("%s", hdev->name);
Expand Down Expand Up @@ -329,7 +329,7 @@ static int bpa10x_open(struct hci_dev *hdev)

static int bpa10x_close(struct hci_dev *hdev)
{
struct bpa10x_data *data = hdev->driver_data;
struct bpa10x_data *data = hci_get_drvdata(hdev);

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

Expand All @@ -343,7 +343,7 @@ static int bpa10x_close(struct hci_dev *hdev)

static int bpa10x_flush(struct hci_dev *hdev)
{
struct bpa10x_data *data = hdev->driver_data;
struct bpa10x_data *data = hci_get_drvdata(hdev);

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

Expand All @@ -355,7 +355,7 @@ static int bpa10x_flush(struct hci_dev *hdev)
static int bpa10x_send_frame(struct sk_buff *skb)
{
struct hci_dev *hdev = (struct hci_dev *) skb->dev;
struct bpa10x_data *data = hdev->driver_data;
struct bpa10x_data *data = hci_get_drvdata(hdev);
struct usb_ctrlrequest *dr;
struct urb *urb;
unsigned int pipe;
Expand Down Expand Up @@ -432,17 +432,6 @@ static int bpa10x_send_frame(struct sk_buff *skb)
return 0;
}

static void bpa10x_destruct(struct hci_dev *hdev)
{
struct bpa10x_data *data = hdev->driver_data;

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

kfree_skb(data->rx_skb[0]);
kfree_skb(data->rx_skb[1]);
kfree(data);
}

static int bpa10x_probe(struct usb_interface *intf, const struct usb_device_id *id)
{
struct bpa10x_data *data;
Expand Down Expand Up @@ -470,7 +459,7 @@ static int bpa10x_probe(struct usb_interface *intf, const struct usb_device_id *
}

hdev->bus = HCI_USB;
hdev->driver_data = data;
hci_set_drvdata(hdev, data);

data->hdev = hdev;

Expand All @@ -480,9 +469,6 @@ static int bpa10x_probe(struct usb_interface *intf, const struct usb_device_id *
hdev->close = bpa10x_close;
hdev->flush = bpa10x_flush;
hdev->send = bpa10x_send_frame;
hdev->destruct = bpa10x_destruct;

hdev->owner = THIS_MODULE;

set_bit(HCI_QUIRK_NO_RESET, &hdev->quirks);

Expand Down Expand Up @@ -512,6 +498,9 @@ static void bpa10x_disconnect(struct usb_interface *intf)
hci_unregister_dev(data->hdev);

hci_free_dev(data->hdev);
kfree_skb(data->rx_skb[0]);
kfree_skb(data->rx_skb[1]);
kfree(data);
}

static struct usb_driver bpa10x_driver = {
Expand Down
14 changes: 3 additions & 11 deletions drivers/bluetooth/bt3c_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ static irqreturn_t bt3c_interrupt(int irq, void *dev_inst)

static int bt3c_hci_flush(struct hci_dev *hdev)
{
bt3c_info_t *info = (bt3c_info_t *)(hdev->driver_data);
bt3c_info_t *info = hci_get_drvdata(hdev);

/* Drop TX queue */
skb_queue_purge(&(info->txq));
Expand Down Expand Up @@ -428,7 +428,7 @@ static int bt3c_hci_send_frame(struct sk_buff *skb)
return -ENODEV;
}

info = (bt3c_info_t *) (hdev->driver_data);
info = hci_get_drvdata(hdev);

switch (bt_cb(skb)->pkt_type) {
case HCI_COMMAND_PKT:
Expand Down Expand Up @@ -456,11 +456,6 @@ static int bt3c_hci_send_frame(struct sk_buff *skb)
}


static void bt3c_hci_destruct(struct hci_dev *hdev)
{
}


static int bt3c_hci_ioctl(struct hci_dev *hdev, unsigned int cmd, unsigned long arg)
{
return -ENOIOCTLCMD;
Expand Down Expand Up @@ -580,18 +575,15 @@ static int bt3c_open(bt3c_info_t *info)
info->hdev = hdev;

hdev->bus = HCI_PCCARD;
hdev->driver_data = info;
hci_set_drvdata(hdev, info);
SET_HCIDEV_DEV(hdev, &info->p_dev->dev);

hdev->open = bt3c_hci_open;
hdev->close = bt3c_hci_close;
hdev->flush = bt3c_hci_flush;
hdev->send = bt3c_hci_send_frame;
hdev->destruct = bt3c_hci_destruct;
hdev->ioctl = bt3c_hci_ioctl;

hdev->owner = THIS_MODULE;

/* Load firmware */
err = request_firmware(&firmware, "BT3CPCC.bin", &info->p_dev->dev);
if (err < 0) {
Expand Down
Loading

0 comments on commit 0111ad8

Please sign in to comment.