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/holtmann/bluetooth-next-2.6
  • Loading branch information
davem330 committed Feb 28, 2010
2 parents 024c378 + f6e623a commit 46976c0
Show file tree
Hide file tree
Showing 21 changed files with 131 additions and 63 deletions.
2 changes: 2 additions & 0 deletions drivers/bluetooth/ath3k.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ static int ath3k_probe(struct usb_interface *intf,
usb_set_intfdata(intf, data);
if (ath3k_load_firmware(data, data->fw_data, data->fw_size)) {
usb_set_intfdata(intf, NULL);
kfree(data->fw_data);
kfree(data);
return -EIO;
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/bluetooth/bcm203x.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

#define VERSION "1.2"

static struct usb_device_id bcm203x_table[] = {
static const struct usb_device_id bcm203x_table[] = {
/* Broadcom Blutonium (BCM2033) */
{ USB_DEVICE(0x0a5c, 0x2033) },

Expand Down
2 changes: 1 addition & 1 deletion drivers/bluetooth/bfusb.c
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,7 @@ static int bfusb_probe(struct usb_interface *intf, const struct usb_device_id *i

data->hdev = hdev;

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

Expand Down
2 changes: 1 addition & 1 deletion drivers/bluetooth/bluecard_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,7 @@ static int bluecard_open(bluecard_info_t *info)

info->hdev = hdev;

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

Expand Down
2 changes: 1 addition & 1 deletion drivers/bluetooth/bpa10x.c
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ static int bpa10x_probe(struct usb_interface *intf, const struct usb_device_id *
return -ENOMEM;
}

hdev->type = HCI_USB;
hdev->bus = HCI_USB;
hdev->driver_data = data;

data->hdev = hdev;
Expand Down
2 changes: 1 addition & 1 deletion drivers/bluetooth/bt3c_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ static int bt3c_open(bt3c_info_t *info)

info->hdev = hdev;

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

Expand Down
14 changes: 7 additions & 7 deletions drivers/bluetooth/btmrvl_debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
#include "btmrvl_drv.h"

struct btmrvl_debugfs_data {
struct dentry *root_dir, *config_dir, *status_dir;
struct dentry *config_dir;
struct dentry *status_dir;

/* config */
struct dentry *psmode;
Expand Down Expand Up @@ -363,6 +364,9 @@ void btmrvl_debugfs_init(struct hci_dev *hdev)
struct btmrvl_private *priv = hdev->driver_data;
struct btmrvl_debugfs_data *dbg;

if (!hdev->debugfs)
return;

dbg = kzalloc(sizeof(*dbg), GFP_KERNEL);
priv->debugfs_data = dbg;

Expand All @@ -371,9 +375,7 @@ void btmrvl_debugfs_init(struct hci_dev *hdev)
return;
}

dbg->root_dir = debugfs_create_dir("btmrvl", NULL);

dbg->config_dir = debugfs_create_dir("config", dbg->root_dir);
dbg->config_dir = debugfs_create_dir("config", hdev->debugfs);

dbg->psmode = debugfs_create_file("psmode", 0644, dbg->config_dir,
hdev->driver_data, &btmrvl_psmode_fops);
Expand All @@ -388,7 +390,7 @@ void btmrvl_debugfs_init(struct hci_dev *hdev)
dbg->hscfgcmd = debugfs_create_file("hscfgcmd", 0644, dbg->config_dir,
hdev->driver_data, &btmrvl_hscfgcmd_fops);

dbg->status_dir = debugfs_create_dir("status", dbg->root_dir);
dbg->status_dir = debugfs_create_dir("status", hdev->debugfs);
dbg->curpsmode = debugfs_create_file("curpsmode", 0444,
dbg->status_dir,
hdev->driver_data,
Expand Down Expand Up @@ -425,7 +427,5 @@ void btmrvl_debugfs_remove(struct hci_dev *hdev)
debugfs_remove(dbg->txdnldready);
debugfs_remove(dbg->status_dir);

debugfs_remove(dbg->root_dir);

kfree(dbg);
}
2 changes: 1 addition & 1 deletion drivers/bluetooth/btmrvl_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ struct btmrvl_private *btmrvl_add_card(void *card)

priv->btmrvl_dev.tx_dnld_rdy = true;

hdev->type = HCI_SDIO;
hdev->bus = HCI_SDIO;
hdev->open = btmrvl_open;
hdev->close = btmrvl_close;
hdev->flush = btmrvl_flush;
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 @@ -976,7 +976,7 @@ static struct sdio_driver bt_mrvl_sdio = {
.remove = btmrvl_sdio_remove,
};

static int btmrvl_sdio_init_module(void)
static int __init btmrvl_sdio_init_module(void)
{
if (sdio_register_driver(&bt_mrvl_sdio) != 0) {
BT_ERR("SDIO Driver Registration Failed");
Expand All @@ -989,7 +989,7 @@ static int btmrvl_sdio_init_module(void)
return 0;
}

static void btmrvl_sdio_exit_module(void)
static void __exit btmrvl_sdio_exit_module(void)
{
/* Set the flag as user is removing this module. */
user_rmmod = 1;
Expand Down
2 changes: 1 addition & 1 deletion drivers/bluetooth/btsdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ static int btsdio_probe(struct sdio_func *func,
return -ENOMEM;
}

hdev->type = HCI_SDIO;
hdev->bus = HCI_SDIO;
hdev->driver_data = data;

data->hdev = hdev;
Expand Down
2 changes: 1 addition & 1 deletion drivers/bluetooth/btuart_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ static int btuart_open(btuart_info_t *info)

info->hdev = hdev;

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

Expand Down
2 changes: 1 addition & 1 deletion drivers/bluetooth/btusb.c
Original file line number Diff line number Diff line change
Expand Up @@ -939,7 +939,7 @@ static int btusb_probe(struct usb_interface *intf,
return -ENOMEM;
}

hdev->type = HCI_USB;
hdev->bus = HCI_USB;
hdev->driver_data = data;

data->hdev = hdev;
Expand Down
2 changes: 1 addition & 1 deletion drivers/bluetooth/dtl1_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ static int dtl1_open(dtl1_info_t *info)

info->hdev = hdev;

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

Expand Down
2 changes: 1 addition & 1 deletion drivers/bluetooth/hci_ldisc.c
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ static int hci_uart_register_dev(struct hci_uart *hu)

hu->hdev = hdev;

hdev->type = HCI_UART;
hdev->bus = HCI_UART;
hdev->driver_data = hu;

hdev->open = hci_uart_open;
Expand Down
2 changes: 1 addition & 1 deletion drivers/bluetooth/hci_vhci.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ static int vhci_open(struct inode *inode, struct file *file)

data->hdev = hdev;

hdev->type = HCI_VIRTUAL;
hdev->bus = HCI_VIRTUAL;
hdev->driver_data = data;

hdev->open = vhci_open_dev;
Expand Down
6 changes: 5 additions & 1 deletion include/net/bluetooth/hci.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
#define HCI_NOTIFY_CONN_DEL 2
#define HCI_NOTIFY_VOICE_SETTING 3

/* HCI device types */
/* HCI bus types */
#define HCI_VIRTUAL 0
#define HCI_USB 1
#define HCI_PCCARD 2
Expand All @@ -52,6 +52,10 @@
#define HCI_PCI 5
#define HCI_SDIO 6

/* HCI controller types */
#define HCI_BREDR 0x00
#define HCI_80211 0x01

/* HCI device quirks */
enum {
HCI_QUIRK_NO_RESET,
Expand Down
5 changes: 4 additions & 1 deletion include/net/bluetooth/hci_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ struct hci_dev {
char name[8];
unsigned long flags;
__u16 id;
__u8 type;
__u8 bus;
__u8 dev_type;
bdaddr_t bdaddr;
__u8 dev_name[248];
__u8 dev_class[3];
Expand Down Expand Up @@ -134,6 +135,8 @@ struct hci_dev {

atomic_t promisc;

struct dentry *debugfs;

struct device *parent;
struct device dev;

Expand Down
12 changes: 8 additions & 4 deletions net/bluetooth/hci_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,10 @@ int hci_dev_open(__u16 dev)
if (test_bit(HCI_QUIRK_RAW_DEVICE, &hdev->quirks))
set_bit(HCI_RAW, &hdev->flags);

/* Treat all non BR/EDR controllers as raw devices for now */
if (hdev->dev_type != HCI_BREDR)
set_bit(HCI_RAW, &hdev->flags);

if (hdev->open(hdev)) {
ret = -EIO;
goto done;
Expand Down Expand Up @@ -797,7 +801,7 @@ int hci_get_dev_info(void __user *arg)

strcpy(di.name, hdev->name);
di.bdaddr = hdev->bdaddr;
di.type = hdev->type;
di.type = (hdev->bus & 0x0f) | (hdev->dev_type << 4);
di.flags = hdev->flags;
di.pkt_type = hdev->pkt_type;
di.acl_mtu = hdev->acl_mtu;
Expand Down Expand Up @@ -869,8 +873,8 @@ int hci_register_dev(struct hci_dev *hdev)
struct list_head *head = &hci_dev_list, *p;
int i, id = 0;

BT_DBG("%p name %s type %d owner %p", hdev, hdev->name,
hdev->type, hdev->owner);
BT_DBG("%p name %s bus %d owner %p", hdev, hdev->name,
hdev->bus, hdev->owner);

if (!hdev->open || !hdev->close || !hdev->destruct)
return -EINVAL;
Expand Down Expand Up @@ -946,7 +950,7 @@ int hci_unregister_dev(struct hci_dev *hdev)
{
int i;

BT_DBG("%p name %s type %d", hdev, hdev->name, hdev->type);
BT_DBG("%p name %s bus %d", hdev, hdev->name, hdev->bus);

write_lock_bh(&hci_dev_list_lock);
list_del(&hdev->list);
Expand Down
1 change: 1 addition & 0 deletions net/bluetooth/hci_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -1698,6 +1698,7 @@ static inline void hci_sync_conn_complete_evt(struct hci_dev *hdev, struct sk_bu
hci_conn_add_sysfs(conn);
break;

case 0x11: /* Unsupported Feature or Parameter Value */
case 0x1c: /* SCO interval rejected */
case 0x1a: /* Unsupported Remote Feature */
case 0x1f: /* Unspecified error */
Expand Down
4 changes: 3 additions & 1 deletion net/bluetooth/hci_sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,9 @@ static inline void hci_sock_cmsg(struct sock *sk, struct msghdr *msg, struct sk_
}

if (mask & HCI_CMSG_TSTAMP) {
#ifdef CONFIG_COMPAT
struct compat_timeval ctv;
#endif
struct timeval tv;
void *data;
int len;
Expand All @@ -339,7 +342,6 @@ static inline void hci_sock_cmsg(struct sock *sk, struct msghdr *msg, struct sk_
len = sizeof(tv);
#ifdef CONFIG_COMPAT
if (msg->msg_flags & MSG_CMSG_COMPAT) {
struct compat_timeval ctv;
ctv.tv_sec = tv.tv_sec;
ctv.tv_usec = tv.tv_usec;
data = &ctv;
Expand Down
Loading

0 comments on commit 46976c0

Please sign in to comment.