Skip to content

Commit

Permalink
Revert "Bluetooth: Add option for disabling legacy ioctl interfaces"
Browse files Browse the repository at this point in the history
This reverts commit dbbccdc.

It turns out that the "legacy" users aren't so legacy at all, and that
turning off the legacy ioctl will break the current Qt bluetooth stack
for bluetooth LE devices that were released just a couple of months ago.

So it's simply not true that this was a legacy interface that hasn't
been needed and is only limited to old legacy BT devices.  Because I
actually read Kconfig help messages, and actively try to turn off
features that I don't need, I turned the option off.

Then I spent _way_ too much time debugging BLE issues until I realized
that it wasn't the Qt and subsurface development that had broken one of
my dive computer BLE downloads, but simply my broken kernel config.

Maybe in a decade it will be true that this is a legacy interface.  And
maybe with a better help-text and correct dependencies, this kind of
legacy removal might be acceptable.  But as things are right now both
the commit message and the Kconfig help text were misleading, and the
Kconfig option had the wrong dependenencies.

There's no reason to keep that broken Kconfig option in the tree.

Cc: Marcel Holtmann <marcel@holtmann.org>
Cc: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Linus Torvalds committed Sep 28, 2017
1 parent 9173583 commit e49aa15
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 16 deletions.
10 changes: 0 additions & 10 deletions net/bluetooth/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,4 @@ config BT_DEBUGFS
Provide extensive information about internal Bluetooth states
in debugfs.

config BT_LEGACY_IOCTL
bool "Enable legacy ioctl interfaces"
depends on BT && BT_BREDR
default y
help
Enable support for legacy ioctl interfaces. This is only needed
for old and deprecated applications using direct ioctl calls for
controller management. Since Linux 3.4 all configuration and
setup is done via mgmt interface and this is no longer needed.

source "drivers/bluetooth/Kconfig"
6 changes: 0 additions & 6 deletions net/bluetooth/hci_sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -878,7 +878,6 @@ static int hci_sock_release(struct socket *sock)
return 0;
}

#ifdef CONFIG_BT_LEGACY_IOCTL
static int hci_sock_blacklist_add(struct hci_dev *hdev, void __user *arg)
{
bdaddr_t bdaddr;
Expand Down Expand Up @@ -1050,7 +1049,6 @@ static int hci_sock_ioctl(struct socket *sock, unsigned int cmd,
release_sock(sk);
return err;
}
#endif

static int hci_sock_bind(struct socket *sock, struct sockaddr *addr,
int addr_len)
Expand Down Expand Up @@ -1971,11 +1969,7 @@ static const struct proto_ops hci_sock_ops = {
.getname = hci_sock_getname,
.sendmsg = hci_sock_sendmsg,
.recvmsg = hci_sock_recvmsg,
#ifdef CONFIG_BT_LEGACY_IOCTL
.ioctl = hci_sock_ioctl,
#else
.ioctl = sock_no_ioctl,
#endif
.poll = datagram_poll,
.listen = sock_no_listen,
.shutdown = sock_no_shutdown,
Expand Down

0 comments on commit e49aa15

Please sign in to comment.