Skip to content

Commit 84a4bb6

Browse files
committed
Bluetooth: HCI: Remove HCI_AMP support
Since BT_HS has been remove HCI_AMP controllers no longer has any use so remove it along with the capability of creating AMP controllers. Since we no longer need to differentiate between AMP and Primary controllers, as only HCI_PRIMARY is left, this also remove hdev->dev_type altogether. Fixes: e7b0229 ("Bluetooth: Remove BT_HS") Signed-off-by: Luiz Augusto von Dentz <[email protected]>
1 parent a5b862c commit 84a4bb6

File tree

20 files changed

+49
-664
lines changed

20 files changed

+49
-664
lines changed

drivers/bluetooth/btmrvl_main.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -121,13 +121,6 @@ int btmrvl_process_event(struct btmrvl_private *priv, struct sk_buff *skb)
121121
((event->data[2] == MODULE_BROUGHT_UP) ||
122122
(event->data[2] == MODULE_ALREADY_UP)) ?
123123
"Bring-up succeed" : "Bring-up failed");
124-
125-
if (event->length > 3 && event->data[3])
126-
priv->btmrvl_dev.dev_type = HCI_AMP;
127-
else
128-
priv->btmrvl_dev.dev_type = HCI_PRIMARY;
129-
130-
BT_DBG("dev_type: %d", priv->btmrvl_dev.dev_type);
131124
} else if (priv->btmrvl_dev.sendcmdflag &&
132125
event->data[1] == MODULE_SHUTDOWN_REQ) {
133126
BT_DBG("EVENT:%s", (event->data[2]) ?
@@ -686,8 +679,6 @@ int btmrvl_register_hdev(struct btmrvl_private *priv)
686679
hdev->wakeup = btmrvl_wakeup;
687680
SET_HCIDEV_DEV(hdev, &card->func->dev);
688681

689-
hdev->dev_type = priv->btmrvl_dev.dev_type;
690-
691682
ret = hci_register_dev(hdev);
692683
if (ret < 0) {
693684
BT_ERR("Can not register HCI device");

drivers/bluetooth/btrsi.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@ static int rsi_hci_attach(void *priv, struct rsi_proto_ops *ops)
134134
hdev->bus = HCI_USB;
135135

136136
hci_set_drvdata(hdev, h_adapter);
137-
hdev->dev_type = HCI_PRIMARY;
138137
hdev->open = rsi_hci_open;
139138
hdev->close = rsi_hci_close;
140139
hdev->flush = rsi_hci_flush;

drivers/bluetooth/btsdio.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@ static const struct sdio_device_id btsdio_table[] = {
3232
/* Generic Bluetooth Type-B SDIO device */
3333
{ SDIO_DEVICE_CLASS(SDIO_CLASS_BT_B) },
3434

35-
/* Generic Bluetooth AMP controller */
36-
{ SDIO_DEVICE_CLASS(SDIO_CLASS_BT_AMP) },
37-
3835
{ } /* Terminating entry */
3936
};
4037

@@ -319,11 +316,6 @@ static int btsdio_probe(struct sdio_func *func,
319316
hdev->bus = HCI_SDIO;
320317
hci_set_drvdata(hdev, data);
321318

322-
if (id->class == SDIO_CLASS_BT_AMP)
323-
hdev->dev_type = HCI_AMP;
324-
else
325-
hdev->dev_type = HCI_PRIMARY;
326-
327319
data->hdev = hdev;
328320

329321
SET_HCIDEV_DEV(hdev, &func->dev);

drivers/bluetooth/btusb.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4359,11 +4359,6 @@ static int btusb_probe(struct usb_interface *intf,
43594359
hdev->bus = HCI_USB;
43604360
hci_set_drvdata(hdev, data);
43614361

4362-
if (id->driver_info & BTUSB_AMP)
4363-
hdev->dev_type = HCI_AMP;
4364-
else
4365-
hdev->dev_type = HCI_PRIMARY;
4366-
43674362
data->hdev = hdev;
43684363

43694364
SET_HCIDEV_DEV(hdev, &intf->dev);

drivers/bluetooth/hci_bcm4377.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2361,7 +2361,6 @@ static int bcm4377_probe(struct pci_dev *pdev, const struct pci_device_id *id)
23612361
bcm4377->hdev = hdev;
23622362

23632363
hdev->bus = HCI_PCI;
2364-
hdev->dev_type = HCI_PRIMARY;
23652364
hdev->open = bcm4377_hci_open;
23662365
hdev->close = bcm4377_hci_close;
23672366
hdev->send = bcm4377_hci_send_frame;

drivers/bluetooth/hci_ldisc.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -667,11 +667,6 @@ static int hci_uart_register_dev(struct hci_uart *hu)
667667
if (!test_bit(HCI_UART_RESET_ON_INIT, &hu->hdev_flags))
668668
set_bit(HCI_QUIRK_RESET_ON_CLOSE, &hdev->quirks);
669669

670-
if (test_bit(HCI_UART_CREATE_AMP, &hu->hdev_flags))
671-
hdev->dev_type = HCI_AMP;
672-
else
673-
hdev->dev_type = HCI_PRIMARY;
674-
675670
/* Only call open() for the protocol after hdev is fully initialized as
676671
* open() (or a timer/workqueue it starts) may attempt to reference it.
677672
*/
@@ -722,7 +717,6 @@ static int hci_uart_set_flags(struct hci_uart *hu, unsigned long flags)
722717
{
723718
unsigned long valid_flags = BIT(HCI_UART_RAW_DEVICE) |
724719
BIT(HCI_UART_RESET_ON_INIT) |
725-
BIT(HCI_UART_CREATE_AMP) |
726720
BIT(HCI_UART_INIT_PENDING) |
727721
BIT(HCI_UART_EXT_CONFIG) |
728722
BIT(HCI_UART_VND_DETECT);

drivers/bluetooth/hci_serdev.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -366,11 +366,6 @@ int hci_uart_register_device_priv(struct hci_uart *hu,
366366
if (test_bit(HCI_UART_EXT_CONFIG, &hu->hdev_flags))
367367
set_bit(HCI_QUIRK_EXTERNAL_CONFIG, &hdev->quirks);
368368

369-
if (test_bit(HCI_UART_CREATE_AMP, &hu->hdev_flags))
370-
hdev->dev_type = HCI_AMP;
371-
else
372-
hdev->dev_type = HCI_PRIMARY;
373-
374369
if (test_bit(HCI_UART_INIT_PENDING, &hu->hdev_flags))
375370
return 0;
376371

drivers/bluetooth/hci_uart.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737

3838
#define HCI_UART_RAW_DEVICE 0
3939
#define HCI_UART_RESET_ON_INIT 1
40-
#define HCI_UART_CREATE_AMP 2
4140
#define HCI_UART_INIT_PENDING 3
4241
#define HCI_UART_EXT_CONFIG 4
4342
#define HCI_UART_VND_DETECT 5

drivers/bluetooth/hci_vhci.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -384,17 +384,10 @@ static int __vhci_create_device(struct vhci_data *data, __u8 opcode)
384384
{
385385
struct hci_dev *hdev;
386386
struct sk_buff *skb;
387-
__u8 dev_type;
388387

389388
if (data->hdev)
390389
return -EBADFD;
391390

392-
/* bits 0-1 are dev_type (Primary or AMP) */
393-
dev_type = opcode & 0x03;
394-
395-
if (dev_type != HCI_PRIMARY && dev_type != HCI_AMP)
396-
return -EINVAL;
397-
398391
/* bits 2-5 are reserved (must be zero) */
399392
if (opcode & 0x3c)
400393
return -EINVAL;
@@ -412,7 +405,6 @@ static int __vhci_create_device(struct vhci_data *data, __u8 opcode)
412405
data->hdev = hdev;
413406

414407
hdev->bus = HCI_VIRTUAL;
415-
hdev->dev_type = dev_type;
416408
hci_set_drvdata(hdev, data);
417409

418410
hdev->open = vhci_open_dev;
@@ -634,7 +626,7 @@ static void vhci_open_timeout(struct work_struct *work)
634626
struct vhci_data *data = container_of(work, struct vhci_data,
635627
open_timeout.work);
636628

637-
vhci_create_device(data, amp ? HCI_AMP : HCI_PRIMARY);
629+
vhci_create_device(data, 0x00);
638630
}
639631

640632
static int vhci_open(struct inode *inode, struct file *file)

drivers/bluetooth/virtio_bt.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,6 @@ static int virtbt_probe(struct virtio_device *vdev)
274274

275275
switch (type) {
276276
case VIRTIO_BT_CONFIG_TYPE_PRIMARY:
277-
case VIRTIO_BT_CONFIG_TYPE_AMP:
278277
break;
279278
default:
280279
return -EINVAL;
@@ -303,7 +302,6 @@ static int virtbt_probe(struct virtio_device *vdev)
303302
vbt->hdev = hdev;
304303

305304
hdev->bus = HCI_VIRTIO;
306-
hdev->dev_type = type;
307305
hci_set_drvdata(hdev, vbt);
308306

309307
hdev->open = virtbt_open;

0 commit comments

Comments
 (0)