Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d215874460e7657b8e104de024140e0932690450
Commit:     d215874460e7657b8e104de024140e0932690450
Parent:     5be3946647424b08db0f62c545215cf506af8a52
Author:     Marcel Holtmann <[EMAIL PROTECTED]>
AuthorDate: Wed May 9 09:15:35 2007 +0200
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Thu May 10 23:45:04 2007 -0700

    [Bluetooth] Add HCIUARTGETDEVICE support for HCI line discipline
    
    Adding HCIUARTGETDEVICE makes it possible to get the HCI device number
    that is attached to a given serial device. This is required during the
    initialization process of some Bluetooth chips.
    
    Signed-off-by: Ohad Ben-Cohen <[EMAIL PROTECTED]>
    Signed-off-by: Marcel Holtmann <[EMAIL PROTECTED]>
---
 drivers/bluetooth/hci_ldisc.c |    5 +++++
 drivers/bluetooth/hci_uart.h  |    5 +++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/bluetooth/hci_ldisc.c b/drivers/bluetooth/hci_ldisc.c
index 0f4203b..75c1508 100644
--- a/drivers/bluetooth/hci_ldisc.c
+++ b/drivers/bluetooth/hci_ldisc.c
@@ -479,6 +479,11 @@ static int hci_uart_tty_ioctl(struct tty_struct *tty, 
struct file * file,
                        return hu->proto->id;
                return -EUNATCH;
 
+       case HCIUARTGETDEVICE:
+               if (test_bit(HCI_UART_PROTO_SET, &hu->flags))
+                       return hu->hdev->id;
+               return -EUNATCH;
+
        default:
                err = n_tty_ioctl(tty, file, cmd, arg);
                break;
diff --git a/drivers/bluetooth/hci_uart.h b/drivers/bluetooth/hci_uart.h
index b250e67..1097ce7 100644
--- a/drivers/bluetooth/hci_uart.h
+++ b/drivers/bluetooth/hci_uart.h
@@ -28,8 +28,9 @@
 #endif
 
 /* Ioctls */
-#define HCIUARTSETPROTO        _IOW('U', 200, int)
-#define HCIUARTGETPROTO        _IOR('U', 201, int)
+#define HCIUARTSETPROTO                _IOW('U', 200, int)
+#define HCIUARTGETPROTO                _IOR('U', 201, int)
+#define HCIUARTGETDEVICE       _IOR('U', 202, int)
 
 /* UART protocols */
 #define HCI_UART_MAX_PROTO     4
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to