Skip to contentSkip to conversation

Bluetooth: add HCIUARTGETDEVICE to hci line discipline

PATCH New Ohad Ben-Cohen 1 participant 1 message May 6, 2007 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Bluetooth: add HCIUARTGETDEVICE to hci line discipline

From: Ohad Ben-Cohen <[email protected]>

Adding HCIUARTGETDEVICE makes it possible to know the hci device number that is attached to a given serial device.
This is required during the initialization process of some Bluetooth chips.

---
 drivers/bluetooth/hci_ldisc.c |    5 +++++
 drivers/bluetooth/hci_uart.h  |    5 +++--
 2 files changed, 8 insertions(+), 2 deletions(-)
drivers/bluetooth/hci_ldisc.c +5 -0
index 0f4203b..75c1508 100644
@@ -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;
drivers/bluetooth/hci_uart.h +3 -2
index b250e67..1097ce7 100644
@@ -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
Signature · 1 line
1.5.0.6