aboutsummaryrefslogtreecommitdiffstats
path: root/pending
diff options
authorGreg Kroah-Hartman <gregkh@suse.de>2008-10-31 10:38:33 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2008-10-31 10:38:33 -0700
commit4161b03502cdd41d7acfcd3c67ea6cd9c4cd42b9 (patch)
treeddf15bdd3efa6468a6c01113f6b545111d1063c7 /pending
parent0dfc111b80cc9f5fb51a2e560f2485103485e2d5 (diff)
downloadpatches-4161b03502cdd41d7acfcd3c67ea6cd9c4cd42b9.tar.gz
lots more patches
Diffstat (limited to 'pending')
-rw-r--r--pending/bluetooth-class-fun.patch108
1 files changed, 108 insertions, 0 deletions
diff --git a/pending/bluetooth-class-fun.patch b/pending/bluetooth-class-fun.patch
new file mode 100644
index 00000000000000..ebbc1c03d386b7
--- /dev/null
+++ b/pending/bluetooth-class-fun.patch
@@ -0,0 +1,108 @@
+Subject: bluetooth class fun
+
+---
+ include/net/bluetooth/bluetooth.h | 2 ++
+ net/bluetooth/hci_sysfs.c | 10 ++++++++++
+ net/bluetooth/sco.c | 35 +++++++++++++++++++++++++++++++++++
+ 3 files changed, 47 insertions(+)
+
+--- a/include/net/bluetooth/bluetooth.h
++++ b/include/net/bluetooth/bluetooth.h
+@@ -177,4 +177,6 @@ extern void bt_sysfs_cleanup(void);
+
+ extern struct class *bt_class;
+
++extern struct dentry *bt_debug;
++
+ #endif /* __BLUETOOTH_H */
+--- a/net/bluetooth/hci_sysfs.c
++++ b/net/bluetooth/hci_sysfs.c
+@@ -2,6 +2,7 @@
+
+ #include <linux/kernel.h>
+ #include <linux/init.h>
++#include <linux/debugfs.h>
+
+ #include <linux/platform_device.h>
+
+@@ -264,6 +265,9 @@ static struct device_attribute *conn_att
+ struct class *bt_class = NULL;
+ EXPORT_SYMBOL_GPL(bt_class);
+
++struct dentry *bt_debug;
++EXPORT_SYMBOL_GPL(bt_debug);
++
+ static struct bus_type bt_bus = {
+ .name = "bluetooth",
+ };
+@@ -423,6 +427,10 @@ int __init bt_sysfs_init(void)
+ if (err < 0)
+ goto out_bus;
+
++ bt_debug = debugfs_create_dir("bluetooth", NULL);
++ if (!bt_debug)
++ goto out_class;
++
+ bt_class = class_create(THIS_MODULE, "bluetooth");
+ if (IS_ERR(bt_class)) {
+ err = PTR_ERR(bt_class);
+@@ -451,6 +459,8 @@ void bt_sysfs_cleanup(void)
+
+ class_destroy(bt_class);
+
++ debugfs_remove(bt_debug);
++
+ bus_unregister(&bt_bus);
+
+ platform_device_unregister(bt_platform);
+--- a/net/bluetooth/sco.c
++++ b/net/bluetooth/sco.c
+@@ -909,6 +909,38 @@ static ssize_t sco_sysfs_show(struct cla
+
+ static CLASS_ATTR(sco, S_IRUGO, sco_sysfs_show, NULL);
+
++static int sco_open(struct inode *inode, struct file *file)
++{
++ return 0;
++}
++
++static int sco_release(struct inode *inode, struct file *file)
++{
++ return 0;
++}
++
++static ssize_t sco_read(struct file *file, char __user *buf, size_t nbytes, loff_t *ppos)
++{
++ read_lock_bh(&sco_sk_list.lock);
++
++ sk_for_each(sk, node, &sco_sk_list.head) {
++ str += sprintf(str, "%s %s %d\n",
++ batostr(&bt_sk(sk)->src), batostr(&bt_sk(sk)->dst),
++ sk->sk_state);
++ }
++
++ read_unlock_bh(&sco_sk_list.lock);
++}
++
++static const struct file_operations sco_file_ops = {
++ .owner = THIS_MODULE,
++ .open = sco_open,
++ .llseek = no_llseek,
++ .read = sco_read,
++ .release = sco_close,
++};
++
++
+ static const struct proto_ops sco_sock_ops = {
+ .family = PF_BLUETOOTH,
+ .owner = THIS_MODULE,
+@@ -965,6 +997,9 @@ static int __init sco_init(void)
+ goto error;
+ }
+
++ sco_debug = debugfs_create_file("sco", S_IRUGO, bt_debug, NULL,
++ &sco_fops);
++
+ if (class_create_file(bt_class, &class_attr_sco) < 0)
+ BT_ERR("Failed to create SCO info file");
+