Commit d2158744 authored by Marcel Holtmann's avatar Marcel Holtmann Committed by David S. Miller

[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: default avatarOhad Ben-Cohen <ohad@bencohen.org>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent 5be39466
...@@ -479,6 +479,11 @@ static int hci_uart_tty_ioctl(struct tty_struct *tty, struct file * file, ...@@ -479,6 +479,11 @@ static int hci_uart_tty_ioctl(struct tty_struct *tty, struct file * file,
return hu->proto->id; return hu->proto->id;
return -EUNATCH; return -EUNATCH;
case HCIUARTGETDEVICE:
if (test_bit(HCI_UART_PROTO_SET, &hu->flags))
return hu->hdev->id;
return -EUNATCH;
default: default:
err = n_tty_ioctl(tty, file, cmd, arg); err = n_tty_ioctl(tty, file, cmd, arg);
break; break;
......
...@@ -28,8 +28,9 @@ ...@@ -28,8 +28,9 @@
#endif #endif
/* Ioctls */ /* Ioctls */
#define HCIUARTSETPROTO _IOW('U', 200, int) #define HCIUARTSETPROTO _IOW('U', 200, int)
#define HCIUARTGETPROTO _IOR('U', 201, int) #define HCIUARTGETPROTO _IOR('U', 201, int)
#define HCIUARTGETDEVICE _IOR('U', 202, int)
/* UART protocols */ /* UART protocols */
#define HCI_UART_MAX_PROTO 4 #define HCI_UART_MAX_PROTO 4
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment