Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 31963
b: refs/heads/master
c: 27d3528
h: refs/heads/master
i:
  31961: 898b753
  31959: 3c06bdb
v: v3
  • Loading branch information
Marcel Holtmann authored and David S. Miller committed Jul 4, 2006
1 parent 9a4253c commit 1ff0a96
Show file tree
Hide file tree
Showing 9 changed files with 57 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 04837f6447c7f3ef114cda1ad761822dedbff8cf
refs/heads/master: 27d35284258c596900e0e41c46932ec4abe6a7b1
1 change: 1 addition & 0 deletions trunk/drivers/bluetooth/bluecard_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -739,6 +739,7 @@ static int bluecard_open(bluecard_info_t *info)

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

hdev->open = bluecard_hci_open;
hdev->close = bluecard_hci_close;
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/bluetooth/bt3c_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,7 @@ static int bt3c_open(bt3c_info_t *info)

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

hdev->open = bt3c_hci_open;
hdev->close = bt3c_hci_close;
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/bluetooth/btuart_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,7 @@ static int btuart_open(btuart_info_t *info)

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

hdev->open = btuart_hci_open;
hdev->close = btuart_hci_close;
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/bluetooth/dtl1_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,7 @@ static int dtl1_open(dtl1_info_t *info)

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

hdev->open = dtl1_hci_open;
hdev->close = dtl1_hci_close;
Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/bluetooth/hci_vhci.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,6 @@ static int vhci_open(struct inode *inode, struct file *file)

hdev->type = HCI_VHCI;
hdev->driver_data = vhci;
SET_HCIDEV_DEV(hdev, vhci_miscdev.dev);

hdev->open = vhci_open_dev;
hdev->close = vhci_close_dev;
Expand Down
1 change: 1 addition & 0 deletions trunk/include/net/bluetooth/hci_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ struct hci_dev {

atomic_t promisc;

struct device *dev;
struct class_device class_dev;

struct module *owner;
Expand Down
20 changes: 14 additions & 6 deletions trunk/net/bluetooth/af_bluetooth.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
#define BT_DBG(D...)
#endif

#define VERSION "2.9"
#define VERSION "2.10"

/* Bluetooth sockets */
#define BT_MAX_PROTO 8
Expand Down Expand Up @@ -307,13 +307,21 @@ static struct net_proto_family bt_sock_family_ops = {

static int __init bt_init(void)
{
int err;

BT_INFO("Core ver %s", VERSION);

sock_register(&bt_sock_family_ops);
err = bt_sysfs_init();
if (err < 0)
return err;

BT_INFO("HCI device and connection manager initialized");
err = sock_register(&bt_sock_family_ops);
if (err < 0) {
bt_sysfs_cleanup();
return err;
}

bt_sysfs_init();
BT_INFO("HCI device and connection manager initialized");

hci_sock_init();

Expand All @@ -324,9 +332,9 @@ static void __exit bt_exit(void)
{
hci_sock_cleanup();

bt_sysfs_cleanup();

sock_unregister(PF_BLUETOOTH);

bt_sysfs_cleanup();
}

subsys_initcall(bt_init);
Expand Down
39 changes: 37 additions & 2 deletions trunk/net/bluetooth/hci_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#include <linux/kernel.h>
#include <linux/init.h>

#include <linux/platform_device.h>

#include <net/bluetooth/bluetooth.h>
#include <net/bluetooth/hci_core.h>

Expand Down Expand Up @@ -197,9 +199,14 @@ struct class bt_class = {
.uevent = bt_uevent,
#endif
};

EXPORT_SYMBOL_GPL(bt_class);

static struct bus_type bt_bus = {
.name = "bluetooth",
};

static struct platform_device *bt_platform;

int hci_register_sysfs(struct hci_dev *hdev)
{
struct class_device *cdev = &hdev->class_dev;
Expand All @@ -211,6 +218,11 @@ int hci_register_sysfs(struct hci_dev *hdev)
cdev->class = &bt_class;
class_set_devdata(cdev, hdev);

if (!cdev->dev)
cdev->dev = &bt_platform->dev;

hdev->dev = cdev->dev;

strlcpy(cdev->class_id, hdev->name, BUS_ID_SIZE);
err = class_device_register(cdev);
if (err < 0)
Expand All @@ -233,10 +245,33 @@ void hci_unregister_sysfs(struct hci_dev *hdev)

int __init bt_sysfs_init(void)
{
return class_register(&bt_class);
int err;

bt_platform = platform_device_register_simple("bluetooth", -1, NULL, 0);
if (IS_ERR(bt_platform))
return PTR_ERR(bt_platform);

err = bus_register(&bt_bus);
if (err < 0) {
platform_device_unregister(bt_platform);
return err;
}

err = class_register(&bt_class);
if (err < 0) {
bus_unregister(&bt_bus);
platform_device_unregister(bt_platform);
return err;
}

return 0;
}

void __exit bt_sysfs_cleanup(void)
{
class_unregister(&bt_class);

bus_unregister(&bt_bus);

platform_device_unregister(bt_platform);
}

0 comments on commit 1ff0a96

Please sign in to comment.