Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions drivers/bluetooth/btmtk.c
Original file line number Diff line number Diff line change
Expand Up @@ -1534,6 +1534,28 @@ int btmtk_usb_shutdown(struct hci_dev *hdev)
return 0;
}
EXPORT_SYMBOL_GPL(btmtk_usb_shutdown);

int btmtk_recv_event(struct hci_dev *hdev, struct sk_buff *skb)
{
struct hci_event_hdr *hdr = (void *)skb->data;

if (hdr->evt == HCI_EV_CMD_COMPLETE) {
struct hci_ev_cmd_complete *ec;
u16 opcode;

ec = (void *)(skb->data + HCI_EVENT_HDR_SIZE);
opcode = __le16_to_cpu(ec->opcode);

/* Filter vendor opcode */
if (opcode == 0xfc5d) {
kfree_skb(skb);
return 0;
}
}

return hci_recv_frame(hdev, skb);
}
EXPORT_SYMBOL_GPL(btmtk_recv_event);
#endif

MODULE_AUTHOR("Sean Wang <sean.wang@mediatek.com>");
Expand Down
7 changes: 7 additions & 0 deletions drivers/bluetooth/btmtk.h
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,8 @@ int btmtk_usb_suspend(struct hci_dev *hdev);
int btmtk_usb_setup(struct hci_dev *hdev);

int btmtk_usb_shutdown(struct hci_dev *hdev);

int btmtk_recv_event(struct hci_dev *hdev, struct sk_buff *skb);
#else

static inline int btmtk_set_bdaddr(struct hci_dev *hdev,
Expand Down Expand Up @@ -299,4 +301,9 @@ static inline int btmtk_usb_shutdown(struct hci_dev *hdev)
{
return -EOPNOTSUPP;
}

static inline int btmtk_recv_event(struct hci_dev *hdev, struct sk_buff *skb)
{
return -EOPNOTSUPP;
}
#endif
2 changes: 2 additions & 0 deletions drivers/bluetooth/btusb.c
Original file line number Diff line number Diff line change
Expand Up @@ -4132,6 +4132,8 @@ static int btusb_probe(struct usb_interface *intf,
} else if (id->driver_info & BTUSB_MEDIATEK) {
/* Allocate extra space for Mediatek device */
priv_size += sizeof(struct btmtk_data);

data->recv_event = btmtk_recv_event;
}

data->recv_acl = hci_recv_frame;
Expand Down
Loading