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;

include/net/bluetooth/hci.h

Lines changed: 0 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,6 @@
3333
#define HCI_MAX_FRAME_SIZE (HCI_MAX_ACL_SIZE + 4)
3434

3535
#define HCI_LINK_KEY_SIZE 16
36-
#define HCI_AMP_LINK_KEY_SIZE (2 * HCI_LINK_KEY_SIZE)
37-
38-
#define HCI_MAX_AMP_ASSOC_SIZE 672
3936

4037
#define HCI_MAX_CPB_DATA_SIZE 252
4138

@@ -71,26 +68,6 @@
7168
#define HCI_SMD 9
7269
#define HCI_VIRTIO 10
7370

74-
/* HCI controller types */
75-
#define HCI_PRIMARY 0x00
76-
#define HCI_AMP 0x01
77-
78-
/* First BR/EDR Controller shall have ID = 0 */
79-
#define AMP_ID_BREDR 0x00
80-
81-
/* AMP controller types */
82-
#define AMP_TYPE_BREDR 0x00
83-
#define AMP_TYPE_80211 0x01
84-
85-
/* AMP controller status */
86-
#define AMP_STATUS_POWERED_DOWN 0x00
87-
#define AMP_STATUS_BLUETOOTH_ONLY 0x01
88-
#define AMP_STATUS_NO_CAPACITY 0x02
89-
#define AMP_STATUS_LOW_CAPACITY 0x03
90-
#define AMP_STATUS_MEDIUM_CAPACITY 0x04
91-
#define AMP_STATUS_HIGH_CAPACITY 0x05
92-
#define AMP_STATUS_FULL_CAPACITY 0x06
93-
9471
/* HCI device quirks */
9572
enum {
9673
/* When this quirk is set, the HCI Reset command is send when
@@ -527,7 +504,6 @@ enum {
527504
#define ESCO_LINK 0x02
528505
/* Low Energy links do not have defined link type. Use invented one */
529506
#define LE_LINK 0x80
530-
#define AMP_LINK 0x81
531507
#define ISO_LINK 0x82
532508
#define INVALID_LINK 0xff
533509

@@ -943,56 +919,6 @@ struct hci_cp_io_capability_neg_reply {
943919
__u8 reason;
944920
} __packed;
945921

946-
#define HCI_OP_CREATE_PHY_LINK 0x0435
947-
struct hci_cp_create_phy_link {
948-
__u8 phy_handle;
949-
__u8 key_len;
950-
__u8 key_type;
951-
__u8 key[HCI_AMP_LINK_KEY_SIZE];
952-
} __packed;
953-
954-
#define HCI_OP_ACCEPT_PHY_LINK 0x0436
955-
struct hci_cp_accept_phy_link {
956-
__u8 phy_handle;
957-
__u8 key_len;
958-
__u8 key_type;
959-
__u8 key[HCI_AMP_LINK_KEY_SIZE];
960-
} __packed;
961-
962-
#define HCI_OP_DISCONN_PHY_LINK 0x0437
963-
struct hci_cp_disconn_phy_link {
964-
__u8 phy_handle;
965-
__u8 reason;
966-
} __packed;
967-
968-
struct ext_flow_spec {
969-
__u8 id;
970-
__u8 stype;
971-
__le16 msdu;
972-
__le32 sdu_itime;
973-
__le32 acc_lat;
974-
__le32 flush_to;
975-
} __packed;
976-
977-
#define HCI_OP_CREATE_LOGICAL_LINK 0x0438
978-
#define HCI_OP_ACCEPT_LOGICAL_LINK 0x0439
979-
struct hci_cp_create_accept_logical_link {
980-
__u8 phy_handle;
981-
struct ext_flow_spec tx_flow_spec;
982-
struct ext_flow_spec rx_flow_spec;
983-
} __packed;
984-
985-
#define HCI_OP_DISCONN_LOGICAL_LINK 0x043a
986-
struct hci_cp_disconn_logical_link {
987-
__le16 log_handle;
988-
} __packed;
989-
990-
#define HCI_OP_LOGICAL_LINK_CANCEL 0x043b
991-
struct hci_cp_logical_link_cancel {
992-
__u8 phy_handle;
993-
__u8 flow_spec_id;
994-
} __packed;
995-
996922
#define HCI_OP_ENHANCED_SETUP_SYNC_CONN 0x043d
997923
struct hci_coding_format {
998924
__u8 id;
@@ -1614,46 +1540,6 @@ struct hci_rp_read_enc_key_size {
16141540
__u8 key_size;
16151541
} __packed;
16161542

1617-
#define HCI_OP_READ_LOCAL_AMP_INFO 0x1409
1618-
struct hci_rp_read_local_amp_info {
1619-
__u8 status;
1620-
__u8 amp_status;
1621-
__le32 total_bw;
1622-
__le32 max_bw;
1623-
__le32 min_latency;
1624-
__le32 max_pdu;
1625-
__u8 amp_type;
1626-
__le16 pal_cap;
1627-
__le16 max_assoc_size;
1628-
__le32 max_flush_to;
1629-
__le32 be_flush_to;
1630-
} __packed;
1631-
1632-
#define HCI_OP_READ_LOCAL_AMP_ASSOC 0x140a
1633-
struct hci_cp_read_local_amp_assoc {
1634-
__u8 phy_handle;
1635-
__le16 len_so_far;
1636-
__le16 max_len;
1637-
} __packed;
1638-
struct hci_rp_read_local_amp_assoc {
1639-
__u8 status;
1640-
__u8 phy_handle;
1641-
__le16 rem_len;
1642-
__u8 frag[];
1643-
} __packed;
1644-
1645-
#define HCI_OP_WRITE_REMOTE_AMP_ASSOC 0x140b
1646-
struct hci_cp_write_remote_amp_assoc {
1647-
__u8 phy_handle;
1648-
__le16 len_so_far;
1649-
__le16 rem_len;
1650-
__u8 frag[];
1651-
} __packed;
1652-
struct hci_rp_write_remote_amp_assoc {
1653-
__u8 status;
1654-
__u8 phy_handle;
1655-
} __packed;
1656-
16571543
#define HCI_OP_GET_MWS_TRANSPORT_CONFIG 0x140c
16581544

16591545
#define HCI_OP_ENABLE_DUT_MODE 0x1803

0 commit comments

Comments
 (0)