Revert to Fedora kernel-2.6.17-1.2187_FC5 patched with vs2.0.2.1; there are too many...
[linux-2.6.git] / net / bluetooth / hci_sysfs.c
index df5f11d..0ed3874 100644 (file)
@@ -1,3 +1,5 @@
+/* Bluetooth HCI driver model support. */
+
 #include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
@@ -7,7 +9,7 @@
 
 #ifndef CONFIG_BT_HCI_CORE_DEBUG
 #undef  BT_DBG
-#define BT_DBG( A... )
+#define BT_DBG(D...)
 #endif
 
 static ssize_t show_name(struct class_device *cdev, char *buf)
@@ -46,14 +48,14 @@ static ssize_t show_inquiry_cache(struct class_device *cdev, char *buf)
        hci_dev_lock_bh(hdev);
 
        for (e = cache->list; e; e = e->next) {
-               struct inquiry_info *info = &e->info;
+               struct inquiry_data *data = &e->data;
                bdaddr_t bdaddr;
-               baswap(&bdaddr, &info->bdaddr);
-               n += sprintf(buf + n, "%s %d %d %d 0x%.2x%.2x%.2x 0x%.4x 0x%.2x %u\n",
+               baswap(&bdaddr, &data->bdaddr);
+               n += sprintf(buf + n, "%s %d %d %d 0x%.2x%.2x%.2x 0x%.4x %d %u\n",
                                batostr(&bdaddr),
-                               info->pscan_rep_mode, info->pscan_period_mode, info->pscan_mode,
-                               info->dev_class[2], info->dev_class[1], info->dev_class[0],
-                               info->clock_offset, 0, e->timestamp);
+                               data->pscan_rep_mode, data->pscan_period_mode, data->pscan_mode,
+                               data->dev_class[2], data->dev_class[1], data->dev_class[0],
+                               __le16_to_cpu(data->clock_offset), data->rssi, e->timestamp);
        }
 
        hci_dev_unlock_bh(hdev);
@@ -76,7 +78,7 @@ static struct class_device_attribute *bt_attrs[] = {
 };
 
 #ifdef CONFIG_HOTPLUG
-static int bt_hotplug(struct class_device *cdev, char **envp, int num_envp, char *buf, int size)
+static int bt_uevent(struct class_device *cdev, char **envp, int num_envp, char *buf, int size)
 {
        struct hci_dev *hdev = class_get_devdata(cdev);
        int n, i = 0;
@@ -89,7 +91,7 @@ static int bt_hotplug(struct class_device *cdev, char **envp, int num_envp, char
        if ((size <= 0) || (i >= num_envp))
                return -ENOMEM;
 
-       envp[i] = 0;
+       envp[i] = NULL;
        return 0;
 }
 #endif
@@ -101,18 +103,21 @@ static void bt_release(struct class_device *cdev)
        kfree(hdev);
 }
 
-static struct class bt_class = {
+struct class bt_class = {
        .name           = "bluetooth",
        .release        = bt_release,
 #ifdef CONFIG_HOTPLUG
-       .hotplug        = bt_hotplug,
+       .uevent         = bt_uevent,
 #endif
 };
 
+EXPORT_SYMBOL_GPL(bt_class);
+
 int hci_register_sysfs(struct hci_dev *hdev)
 {
        struct class_device *cdev = &hdev->class_dev;
-       int i, err;
+       unsigned int i;
+       int err;
 
        BT_DBG("%p name %s type %d", hdev, hdev->name, hdev->type);