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

Conflicts:
	net/bluetooth/l2cap_sock.c
	net/bluetooth/mgmt.c
  • Loading branch information
John W. Linville committed Nov 9, 2011
2 parents 5e81905 + 2aeabcb commit 312fef7
Show file tree
Hide file tree
Showing 27 changed files with 2,291 additions and 972 deletions.
15 changes: 11 additions & 4 deletions drivers/bluetooth/ath3k.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include <net/bluetooth/bluetooth.h>

#define VERSION "1.0"
#define ATH3K_FIRMWARE "ath3k-1.fw"

#define ATH3K_DNLOAD 0x01
#define ATH3K_GETSTATE 0x05
Expand Down Expand Up @@ -400,9 +401,15 @@ static int ath3k_probe(struct usb_interface *intf,
return 0;
}

if (request_firmware(&firmware, "ath3k-1.fw", &udev->dev) < 0) {
BT_ERR("Error loading firmware");
return -EIO;
ret = request_firmware(&firmware, ATH3K_FIRMWARE, &udev->dev);
if (ret < 0) {
if (ret == -ENOENT)
BT_ERR("Firmware file \"%s\" not found",
ATH3K_FIRMWARE);
else
BT_ERR("Firmware file \"%s\" request failed (err=%d)",
ATH3K_FIRMWARE, ret);
return ret;
}

ret = ath3k_load_firmware(udev, firmware);
Expand Down Expand Up @@ -441,4 +448,4 @@ MODULE_AUTHOR("Atheros Communications");
MODULE_DESCRIPTION("Atheros AR30xx firmware driver");
MODULE_VERSION(VERSION);
MODULE_LICENSE("GPL");
MODULE_FIRMWARE("ath3k-1.fw");
MODULE_FIRMWARE(ATH3K_FIRMWARE);
4 changes: 1 addition & 3 deletions drivers/bluetooth/bfusb.c
Original file line number Diff line number Diff line change
Expand Up @@ -751,9 +751,7 @@ static void bfusb_disconnect(struct usb_interface *intf)

bfusb_close(hdev);

if (hci_unregister_dev(hdev) < 0)
BT_ERR("Can't unregister HCI device %s", hdev->name);

hci_unregister_dev(hdev);
hci_free_dev(hdev);
}

Expand Down
4 changes: 1 addition & 3 deletions drivers/bluetooth/bluecard_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -844,9 +844,7 @@ static int bluecard_close(bluecard_info_t *info)
/* Turn FPGA off */
outb(0x80, iobase + 0x30);

if (hci_unregister_dev(hdev) < 0)
BT_ERR("Can't unregister HCI device %s", hdev->name);

hci_unregister_dev(hdev);
hci_free_dev(hdev);

return 0;
Expand Down
4 changes: 1 addition & 3 deletions drivers/bluetooth/bt3c_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -636,9 +636,7 @@ static int bt3c_close(bt3c_info_t *info)

bt3c_hci_close(hdev);

if (hci_unregister_dev(hdev) < 0)
BT_ERR("Can't unregister HCI device %s", hdev->name);

hci_unregister_dev(hdev);
hci_free_dev(hdev);

return 0;
Expand Down
4 changes: 1 addition & 3 deletions drivers/bluetooth/btuart_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -565,9 +565,7 @@ static int btuart_close(btuart_info_t *info)

spin_unlock_irqrestore(&(info->lock), flags);

if (hci_unregister_dev(hdev) < 0)
BT_ERR("Can't unregister HCI device %s", hdev->name);

hci_unregister_dev(hdev);
hci_free_dev(hdev);

return 0;
Expand Down
16 changes: 12 additions & 4 deletions drivers/bluetooth/btusb.c
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,8 @@ static int btusb_submit_intr_urb(struct hci_dev *hdev, gfp_t mem_flags)

err = usb_submit_urb(urb, mem_flags);
if (err < 0) {
BT_ERR("%s urb %p submission failed (%d)",
if (err != -EPERM && err != -ENODEV)
BT_ERR("%s urb %p submission failed (%d)",
hdev->name, urb, -err);
usb_unanchor_urb(urb);
}
Expand Down Expand Up @@ -400,7 +401,8 @@ static int btusb_submit_bulk_urb(struct hci_dev *hdev, gfp_t mem_flags)

err = usb_submit_urb(urb, mem_flags);
if (err < 0) {
BT_ERR("%s urb %p submission failed (%d)",
if (err != -EPERM && err != -ENODEV)
BT_ERR("%s urb %p submission failed (%d)",
hdev->name, urb, -err);
usb_unanchor_urb(urb);
}
Expand Down Expand Up @@ -523,7 +525,8 @@ static int btusb_submit_isoc_urb(struct hci_dev *hdev, gfp_t mem_flags)

err = usb_submit_urb(urb, mem_flags);
if (err < 0) {
BT_ERR("%s urb %p submission failed (%d)",
if (err != -EPERM && err != -ENODEV)
BT_ERR("%s urb %p submission failed (%d)",
hdev->name, urb, -err);
usb_unanchor_urb(urb);
}
Expand Down Expand Up @@ -727,6 +730,9 @@ static int btusb_send_frame(struct sk_buff *skb)
usb_fill_bulk_urb(urb, data->udev, pipe,
skb->data, skb->len, btusb_tx_complete, skb);

if (skb->priority >= HCI_PRIO_MAX - 1)
urb->transfer_flags = URB_ISO_ASAP;

hdev->stat.acl_tx++;
break;

Expand Down Expand Up @@ -770,7 +776,9 @@ static int btusb_send_frame(struct sk_buff *skb)

err = usb_submit_urb(urb, GFP_ATOMIC);
if (err < 0) {
BT_ERR("%s urb %p submission failed", hdev->name, urb);
if (err != -EPERM && err != -ENODEV)
BT_ERR("%s urb %p submission failed (%d)",
hdev->name, urb, -err);
kfree(urb->setup_packet);
usb_unanchor_urb(urb);
} else {
Expand Down
4 changes: 1 addition & 3 deletions drivers/bluetooth/dtl1_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -551,9 +551,7 @@ static int dtl1_close(dtl1_info_t *info)

spin_unlock_irqrestore(&(info->lock), flags);

if (hci_unregister_dev(hdev) < 0)
BT_ERR("Can't unregister HCI device %s", hdev->name);

hci_unregister_dev(hdev);
hci_free_dev(hdev);

return 0;
Expand Down
5 changes: 1 addition & 4 deletions drivers/bluetooth/hci_vhci.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,10 +264,7 @@ static int vhci_release(struct inode *inode, struct file *file)
struct vhci_data *data = file->private_data;
struct hci_dev *hdev = data->hdev;

if (hci_unregister_dev(hdev) < 0) {
BT_ERR("Can't unregister HCI device %s", hdev->name);
}

hci_unregister_dev(hdev);
hci_free_dev(hdev);

file->private_data = NULL;
Expand Down
29 changes: 28 additions & 1 deletion include/net/bluetooth/bluetooth.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,33 @@ struct bt_power {
#define BT_POWER_FORCE_ACTIVE_OFF 0
#define BT_POWER_FORCE_ACTIVE_ON 1

#define BT_CHANNEL_POLICY 10

/* BR/EDR only (default policy)
* AMP controllers cannot be used.
* Channel move requests from the remote device are denied.
* If the L2CAP channel is currently using AMP, move the channel to BR/EDR.
*/
#define BT_CHANNEL_POLICY_BREDR_ONLY 0

/* BR/EDR Preferred
* Allow use of AMP controllers.
* If the L2CAP channel is currently on AMP, move it to BR/EDR.
* Channel move requests from the remote device are allowed.
*/
#define BT_CHANNEL_POLICY_BREDR_PREFERRED 1

/* AMP Preferred
* Allow use of AMP controllers
* If the L2CAP channel is currently on BR/EDR and AMP controller
* resources are available, initiate a channel move to AMP.
* Channel move requests from the remote device are allowed.
* If the L2CAP socket has not been connected yet, try to create
* and configure the channel directly on an AMP controller rather
* than BR/EDR.
*/
#define BT_CHANNEL_POLICY_AMP_PREFERRED 2

__attribute__((format (printf, 2, 3)))
int bt_printk(const char *level, const char *fmt, ...);

Expand Down Expand Up @@ -158,7 +185,7 @@ struct bt_skb_cb {
__u8 pkt_type;
__u8 incoming;
__u16 expect;
__u8 tx_seq;
__u16 tx_seq;
__u8 retries;
__u8 sar;
unsigned short channel;
Expand Down
22 changes: 22 additions & 0 deletions include/net/bluetooth/hci.h
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,13 @@ enum {
#define HCI_LK_SMP_IRK 0x82
#define HCI_LK_SMP_CSRK 0x83

/* ---- HCI Error Codes ---- */
#define HCI_ERROR_AUTH_FAILURE 0x05
#define HCI_ERROR_REJ_BAD_ADDR 0x0f
#define HCI_ERROR_REMOTE_USER_TERM 0x13
#define HCI_ERROR_LOCAL_HOST_TERM 0x16
#define HCI_ERROR_PAIRING_NOT_ALLOWED 0x18

/* ----- HCI Commands ---- */
#define HCI_OP_NOP 0x0000

Expand Down Expand Up @@ -726,6 +733,21 @@ struct hci_cp_write_page_scan_activity {
#define PAGE_SCAN_TYPE_STANDARD 0x00
#define PAGE_SCAN_TYPE_INTERLACED 0x01

#define HCI_OP_READ_LOCAL_AMP_INFO 0x1409
struct hci_rp_read_local_amp_info {
__u8 status;
__u8 amp_status;
__le32 total_bw;
__le32 max_bw;
__le32 min_latency;
__le32 max_pdu;
__u8 amp_type;
__le16 pal_cap;
__le16 max_assoc_size;
__le32 max_flush_to;
__le32 be_flush_to;
} __packed;

#define HCI_OP_LE_SET_EVENT_MASK 0x2001
struct hci_cp_le_set_event_mask {
__u8 mask[8];
Expand Down
Loading

0 comments on commit 312fef7

Please sign in to comment.