[RFC 3/5] Bluetooth: hci_uart: Add HCIUARTSETBAUDRATE ioctl

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This allows user space application to set final speed requested for UART
device. UART port is open at init speed by user space application.

Signed-off-by: Frederic Danis <frederic.danis@xxxxxxxxxxxxxxx>
---
 drivers/bluetooth/hci_ldisc.c | 4 ++++
 drivers/bluetooth/hci_uart.h  | 2 ++
 2 files changed, 6 insertions(+)

diff --git a/drivers/bluetooth/hci_ldisc.c b/drivers/bluetooth/hci_ldisc.c
index e8412f8..4b09369 100644
--- a/drivers/bluetooth/hci_ldisc.c
+++ b/drivers/bluetooth/hci_ldisc.c
@@ -614,6 +614,10 @@ static int hci_uart_tty_ioctl(struct tty_struct *tty, struct file * file,
 	case HCIUARTGETFLAGS:
 		return hu->hdev_flags;
 
+	case HCIUARTSETBAUDRATE:
+		hu->speed = arg;
+		break;
+
 	case HCIUARTSETDEVTYPE:
 		err = hci_tty_ioctl_set_devtype(hu, cmd, arg);
 		if (err)
diff --git a/drivers/bluetooth/hci_uart.h b/drivers/bluetooth/hci_uart.h
index bf6f0e5..dcbedaf 100644
--- a/drivers/bluetooth/hci_uart.h
+++ b/drivers/bluetooth/hci_uart.h
@@ -34,6 +34,7 @@
 #define HCIUARTSETFLAGS		_IOW('U', 203, int)
 #define HCIUARTGETFLAGS		_IOR('U', 204, int)
 #define HCIUARTSETDEVTYPE	_IOW('U', 205, int)
+#define HCIUARTSETBAUDRATE	_IOW('U', 206, int)
 
 /* UART protocols */
 #define HCI_UART_MAX_PROTO	6
@@ -72,6 +73,7 @@ struct hci_uart {
 	unsigned long		flags;
 	unsigned long		hdev_flags;
 	char			dev_type[HCI_UART_DEVTYPE_SIZE];
+	unsigned long		speed;
 
 	struct work_struct	init_ready;
 	struct work_struct	write_work;
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux