Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 203871
b: refs/heads/master
c: 63c7d09
h: refs/heads/master
i:
  203869: 60b6f01
  203867: 4c0af27
  203863: 0475954
  203855: db48468
  203839: 43b93b5
v: v3
  • Loading branch information
Johan Hedberg authored and Marcel Holtmann committed Jul 21, 2010
1 parent 1d3cac2 commit cf91b8d
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 47731de789749c9ed3c54751db28fd9c9eeaf019
refs/heads/master: 63c7d09cd52fe23ad2baee26bcc10a590944cfa4
12 changes: 12 additions & 0 deletions trunk/drivers/bluetooth/hci_ldisc.c
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,9 @@ static int hci_uart_register_dev(struct hci_uart *hu)
if (!reset)
set_bit(HCI_QUIRK_NO_RESET, &hdev->quirks);

if (test_bit(HCI_UART_RAW_DEVICE, &hu->hdev_flags))
set_bit(HCI_QUIRK_RAW_DEVICE, &hdev->quirks);

if (hci_register_dev(hdev) < 0) {
BT_ERR("Can't register HCI device");
hci_free_dev(hdev);
Expand Down Expand Up @@ -475,6 +478,15 @@ static int hci_uart_tty_ioctl(struct tty_struct *tty, struct file * file,
return hu->hdev->id;
return -EUNATCH;

case HCIUARTSETFLAGS:
if (test_bit(HCI_UART_PROTO_SET, &hu->flags))
return -EBUSY;
hu->hdev_flags = arg;
break;

case HCIUARTGETFLAGS:
return hu->hdev_flags;

default:
err = n_tty_ioctl_helper(tty, file, cmd, arg);
break;
Expand Down
7 changes: 6 additions & 1 deletion trunk/drivers/bluetooth/hci_uart.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
#define HCIUARTSETPROTO _IOW('U', 200, int)
#define HCIUARTGETPROTO _IOR('U', 201, int)
#define HCIUARTGETDEVICE _IOR('U', 202, int)
#define HCIUARTSETFLAGS _IOW('U', 203, int)
#define HCIUARTGETFLAGS _IOR('U', 204, int)

/* UART protocols */
#define HCI_UART_MAX_PROTO 5
Expand All @@ -41,6 +43,8 @@
#define HCI_UART_H4DS 3
#define HCI_UART_LL 4

#define HCI_UART_RAW_DEVICE 0

struct hci_uart;

struct hci_uart_proto {
Expand All @@ -57,6 +61,7 @@ struct hci_uart {
struct tty_struct *tty;
struct hci_dev *hdev;
unsigned long flags;
unsigned long hdev_flags;

struct hci_uart_proto *proto;
void *priv;
Expand All @@ -66,7 +71,7 @@ struct hci_uart {
spinlock_t rx_lock;
};

/* HCI_UART flag bits */
/* HCI_UART proto flag bits */
#define HCI_UART_PROTO_SET 0

/* TX states */
Expand Down
2 changes: 2 additions & 0 deletions trunk/fs/compat_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,8 @@ static int ioc_settimeout(unsigned int fd, unsigned int cmd,
#define HCIUARTSETPROTO _IOW('U', 200, int)
#define HCIUARTGETPROTO _IOR('U', 201, int)
#define HCIUARTGETDEVICE _IOR('U', 202, int)
#define HCIUARTSETFLAGS _IOW('U', 203, int)
#define HCIUARTGETFLAGS _IOR('U', 204, int)

#define BNEPCONNADD _IOW('B', 200, int)
#define BNEPCONNDEL _IOW('B', 201, int)
Expand Down

0 comments on commit cf91b8d

Please sign in to comment.