diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/bluetooth/hci_event.c | 47 |
1 files changed, 29 insertions, 18 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index 48796832fdf0..fc5338fc2a6e 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c | |||
@@ -2273,28 +2273,39 @@ static inline void hci_num_comp_pkts_evt(struct hci_dev *hdev, struct sk_buff *s | |||
2273 | count = get_unaligned_le16(ptr++); | 2273 | count = get_unaligned_le16(ptr++); |
2274 | 2274 | ||
2275 | conn = hci_conn_hash_lookup_handle(hdev, handle); | 2275 | conn = hci_conn_hash_lookup_handle(hdev, handle); |
2276 | if (conn) { | 2276 | if (!conn) |
2277 | conn->sent -= count; | 2277 | continue; |
2278 | 2278 | ||
2279 | if (conn->type == ACL_LINK) { | 2279 | conn->sent -= count; |
2280 | |||
2281 | switch (conn->type) { | ||
2282 | case ACL_LINK: | ||
2283 | hdev->acl_cnt += count; | ||
2284 | if (hdev->acl_cnt > hdev->acl_pkts) | ||
2285 | hdev->acl_cnt = hdev->acl_pkts; | ||
2286 | break; | ||
2287 | |||
2288 | case LE_LINK: | ||
2289 | if (hdev->le_pkts) { | ||
2290 | hdev->le_cnt += count; | ||
2291 | if (hdev->le_cnt > hdev->le_pkts) | ||
2292 | hdev->le_cnt = hdev->le_pkts; | ||
2293 | } else { | ||
2280 | hdev->acl_cnt += count; | 2294 | hdev->acl_cnt += count; |
2281 | if (hdev->acl_cnt > hdev->acl_pkts) | 2295 | if (hdev->acl_cnt > hdev->acl_pkts) |
2282 | hdev->acl_cnt = hdev->acl_pkts; | 2296 | hdev->acl_cnt = hdev->acl_pkts; |
2283 | } else if (conn->type == LE_LINK) { | ||
2284 | if (hdev->le_pkts) { | ||
2285 | hdev->le_cnt += count; | ||
2286 | if (hdev->le_cnt > hdev->le_pkts) | ||
2287 | hdev->le_cnt = hdev->le_pkts; | ||
2288 | } else { | ||
2289 | hdev->acl_cnt += count; | ||
2290 | if (hdev->acl_cnt > hdev->acl_pkts) | ||
2291 | hdev->acl_cnt = hdev->acl_pkts; | ||
2292 | } | ||
2293 | } else { | ||
2294 | hdev->sco_cnt += count; | ||
2295 | if (hdev->sco_cnt > hdev->sco_pkts) | ||
2296 | hdev->sco_cnt = hdev->sco_pkts; | ||
2297 | } | 2297 | } |
2298 | break; | ||
2299 | |||
2300 | case SCO_LINK: | ||
2301 | hdev->sco_cnt += count; | ||
2302 | if (hdev->sco_cnt > hdev->sco_pkts) | ||
2303 | hdev->sco_cnt = hdev->sco_pkts; | ||
2304 | break; | ||
2305 | |||
2306 | default: | ||
2307 | BT_ERR("Unknown type %d conn %p", conn->type, conn); | ||
2308 | break; | ||
2298 | } | 2309 | } |
2299 | } | 2310 | } |
2300 | 2311 | ||