aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/bluetooth/hci_ldisc.c5
-rw-r--r--drivers/bluetooth/hci_uart.h5
2 files changed, 8 insertions, 2 deletions
diff --git a/drivers/bluetooth/hci_ldisc.c b/drivers/bluetooth/hci_ldisc.c
index 0f4203b499af..75c15085f81f 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,
479 return hu->proto->id; 479 return hu->proto->id;
480 return -EUNATCH; 480 return -EUNATCH;
481 481
482 case HCIUARTGETDEVICE:
483 if (test_bit(HCI_UART_PROTO_SET, &hu->flags))
484 return hu->hdev->id;
485 return -EUNATCH;
486
482 default: 487 default:
483 err = n_tty_ioctl(tty, file, cmd, arg); 488 err = n_tty_ioctl(tty, file, cmd, arg);
484 break; 489 break;
diff --git a/drivers/bluetooth/hci_uart.h b/drivers/bluetooth/hci_uart.h
index b250e6789dee..1097ce72393f 100644
--- a/drivers/bluetooth/hci_uart.h
+++ b/drivers/bluetooth/hci_uart.h
@@ -28,8 +28,9 @@
28#endif 28#endif
29 29
30/* Ioctls */ 30/* Ioctls */
31#define HCIUARTSETPROTO _IOW('U', 200, int) 31#define HCIUARTSETPROTO _IOW('U', 200, int)
32#define HCIUARTGETPROTO _IOR('U', 201, int) 32#define HCIUARTGETPROTO _IOR('U', 201, int)
33#define HCIUARTGETDEVICE _IOR('U', 202, int)
33 34
34/* UART protocols */ 35/* UART protocols */
35#define HCI_UART_MAX_PROTO 4 36#define HCI_UART_MAX_PROTO 4