Loading drivers/bluetooth/hci_usb.c +4 −1 Original line number Diff line number Diff line Loading @@ -691,15 +691,18 @@ static void hci_usb_rx_complete(struct urb *urb) urb->iso_frame_desc[i].offset, urb->iso_frame_desc[i].actual_length); if (!urb->iso_frame_desc[i].status) if (!urb->iso_frame_desc[i].status) { husb->hdev->stat.byte_rx += urb->iso_frame_desc[i].actual_length; hci_recv_fragment(husb->hdev, _urb->type, urb->transfer_buffer + urb->iso_frame_desc[i].offset, urb->iso_frame_desc[i].actual_length); } } #else ; #endif } else { husb->hdev->stat.byte_rx += count; err = hci_recv_fragment(husb->hdev, _urb->type, urb->transfer_buffer, count); if (err < 0) { BT_ERR("%s corrupted packet: type %d count %d", Loading net/bluetooth/hci_core.c +3 −5 Original line number Diff line number Diff line Loading @@ -183,6 +183,7 @@ static void hci_init_req(struct hci_dev *hdev, unsigned long opt) { struct sk_buff *skb; __le16 param; __u8 flt_type; BT_DBG("%s %ld", hdev->name, opt); Loading Loading @@ -233,11 +234,8 @@ static void hci_init_req(struct hci_dev *hdev, unsigned long opt) /* Optional initialization */ /* Clear Event Filters */ { struct hci_cp_set_event_flt cp; cp.flt_type = HCI_FLT_CLEAR_ALL; hci_send_cmd(hdev, OGF_HOST_CTL, OCF_SET_EVENT_FLT, sizeof(cp), &cp); } flt_type = HCI_FLT_CLEAR_ALL; hci_send_cmd(hdev, OGF_HOST_CTL, OCF_SET_EVENT_FLT, 1, &flt_type); /* Page timeout ~20 secs */ param = cpu_to_le16(0x8000); Loading net/bluetooth/hci_sock.c +21 −6 Original line number Diff line number Diff line Loading @@ -37,6 +37,7 @@ #include <linux/skbuff.h> #include <linux/workqueue.h> #include <linux/interrupt.h> #include <linux/compat.h> #include <linux/socket.h> #include <linux/ioctl.h> #include <net/sock.h> Loading Loading @@ -70,15 +71,15 @@ static struct hci_sec_filter hci_sec_filter = { { { 0x0 }, /* OGF_LINK_CTL */ { 0xbe000006, 0x00000001, 0x000000, 0x00 }, { 0xbe000006, 0x00000001, 0x00000000, 0x00 }, /* OGF_LINK_POLICY */ { 0x00005200, 0x00000000, 0x000000, 0x00 }, { 0x00005200, 0x00000000, 0x00000000, 0x00 }, /* OGF_HOST_CTL */ { 0xaab00200, 0x2b402aaa, 0x020154, 0x00 }, { 0xaab00200, 0x2b402aaa, 0x05220154, 0x00 }, /* OGF_INFO_PARAM */ { 0x000002be, 0x00000000, 0x000000, 0x00 }, { 0x000002be, 0x00000000, 0x00000000, 0x00 }, /* OGF_STATUS_PARAM */ { 0x000000ea, 0x00000000, 0x000000, 0x00 } { 0x000000ea, 0x00000000, 0x00000000, 0x00 } } }; Loading Loading @@ -342,9 +343,23 @@ static inline void hci_sock_cmsg(struct sock *sk, struct msghdr *msg, struct sk_ if (mask & HCI_CMSG_TSTAMP) { struct timeval tv; void *data; int len; skb_get_timestamp(skb, &tv); put_cmsg(msg, SOL_HCI, HCI_CMSG_TSTAMP, sizeof(tv), &tv); if (msg->msg_flags & MSG_CMSG_COMPAT) { struct compat_timeval ctv; ctv.tv_sec = tv.tv_sec; ctv.tv_usec = tv.tv_usec; data = &ctv; len = sizeof(ctv); } else { data = &tv; len = sizeof(tv); } put_cmsg(msg, SOL_HCI, HCI_CMSG_TSTAMP, len, data); } } Loading Loading
drivers/bluetooth/hci_usb.c +4 −1 Original line number Diff line number Diff line Loading @@ -691,15 +691,18 @@ static void hci_usb_rx_complete(struct urb *urb) urb->iso_frame_desc[i].offset, urb->iso_frame_desc[i].actual_length); if (!urb->iso_frame_desc[i].status) if (!urb->iso_frame_desc[i].status) { husb->hdev->stat.byte_rx += urb->iso_frame_desc[i].actual_length; hci_recv_fragment(husb->hdev, _urb->type, urb->transfer_buffer + urb->iso_frame_desc[i].offset, urb->iso_frame_desc[i].actual_length); } } #else ; #endif } else { husb->hdev->stat.byte_rx += count; err = hci_recv_fragment(husb->hdev, _urb->type, urb->transfer_buffer, count); if (err < 0) { BT_ERR("%s corrupted packet: type %d count %d", Loading
net/bluetooth/hci_core.c +3 −5 Original line number Diff line number Diff line Loading @@ -183,6 +183,7 @@ static void hci_init_req(struct hci_dev *hdev, unsigned long opt) { struct sk_buff *skb; __le16 param; __u8 flt_type; BT_DBG("%s %ld", hdev->name, opt); Loading Loading @@ -233,11 +234,8 @@ static void hci_init_req(struct hci_dev *hdev, unsigned long opt) /* Optional initialization */ /* Clear Event Filters */ { struct hci_cp_set_event_flt cp; cp.flt_type = HCI_FLT_CLEAR_ALL; hci_send_cmd(hdev, OGF_HOST_CTL, OCF_SET_EVENT_FLT, sizeof(cp), &cp); } flt_type = HCI_FLT_CLEAR_ALL; hci_send_cmd(hdev, OGF_HOST_CTL, OCF_SET_EVENT_FLT, 1, &flt_type); /* Page timeout ~20 secs */ param = cpu_to_le16(0x8000); Loading
net/bluetooth/hci_sock.c +21 −6 Original line number Diff line number Diff line Loading @@ -37,6 +37,7 @@ #include <linux/skbuff.h> #include <linux/workqueue.h> #include <linux/interrupt.h> #include <linux/compat.h> #include <linux/socket.h> #include <linux/ioctl.h> #include <net/sock.h> Loading Loading @@ -70,15 +71,15 @@ static struct hci_sec_filter hci_sec_filter = { { { 0x0 }, /* OGF_LINK_CTL */ { 0xbe000006, 0x00000001, 0x000000, 0x00 }, { 0xbe000006, 0x00000001, 0x00000000, 0x00 }, /* OGF_LINK_POLICY */ { 0x00005200, 0x00000000, 0x000000, 0x00 }, { 0x00005200, 0x00000000, 0x00000000, 0x00 }, /* OGF_HOST_CTL */ { 0xaab00200, 0x2b402aaa, 0x020154, 0x00 }, { 0xaab00200, 0x2b402aaa, 0x05220154, 0x00 }, /* OGF_INFO_PARAM */ { 0x000002be, 0x00000000, 0x000000, 0x00 }, { 0x000002be, 0x00000000, 0x00000000, 0x00 }, /* OGF_STATUS_PARAM */ { 0x000000ea, 0x00000000, 0x000000, 0x00 } { 0x000000ea, 0x00000000, 0x00000000, 0x00 } } }; Loading Loading @@ -342,9 +343,23 @@ static inline void hci_sock_cmsg(struct sock *sk, struct msghdr *msg, struct sk_ if (mask & HCI_CMSG_TSTAMP) { struct timeval tv; void *data; int len; skb_get_timestamp(skb, &tv); put_cmsg(msg, SOL_HCI, HCI_CMSG_TSTAMP, sizeof(tv), &tv); if (msg->msg_flags & MSG_CMSG_COMPAT) { struct compat_timeval ctv; ctv.tv_sec = tv.tv_sec; ctv.tv_usec = tv.tv_usec; data = &ctv; len = sizeof(ctv); } else { data = &tv; len = sizeof(tv); } put_cmsg(msg, SOL_HCI, HCI_CMSG_TSTAMP, len, data); } } Loading