aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth
diff options
context:
space:
mode:
authorAndrei Emeltchenko <andrei.emeltchenko@intel.com>2012-10-10 10:38:30 -0400
committerGustavo Padovan <gustavo.padovan@collabora.co.uk>2012-10-11 02:34:24 -0400
commitbd1eb66ba4eee21de3be24212b135f57101ad930 (patch)
tree37b3c0f63a3487429ce735c56f80968b6b198444 /net/bluetooth
parent76ef7cf7722331097f5f47d23342128b1b5d072d (diff)
Bluetooth: AMP: Handle AMP_LINK connection
AMP_LINK represents physical link between AMP controllers. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Diffstat (limited to 'net/bluetooth')
-rw-r--r--net/bluetooth/hci_core.c22
-rw-r--r--net/bluetooth/hci_event.c1
2 files changed, 20 insertions, 3 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index bd26cb52aaa9..2e72c410fb47 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -2379,6 +2379,9 @@ static struct hci_chan *hci_chan_sent(struct hci_dev *hdev, __u8 type,
2379 case ACL_LINK: 2379 case ACL_LINK:
2380 cnt = hdev->acl_cnt; 2380 cnt = hdev->acl_cnt;
2381 break; 2381 break;
2382 case AMP_LINK:
2383 cnt = hdev->block_cnt;
2384 break;
2382 case SCO_LINK: 2385 case SCO_LINK:
2383 case ESCO_LINK: 2386 case ESCO_LINK:
2384 cnt = hdev->sco_cnt; 2387 cnt = hdev->sco_cnt;
@@ -2508,11 +2511,19 @@ static void hci_sched_acl_blk(struct hci_dev *hdev)
2508 struct hci_chan *chan; 2511 struct hci_chan *chan;
2509 struct sk_buff *skb; 2512 struct sk_buff *skb;
2510 int quote; 2513 int quote;
2514 u8 type;
2511 2515
2512 __check_timeout(hdev, cnt); 2516 __check_timeout(hdev, cnt);
2513 2517
2518 BT_DBG("%s", hdev->name);
2519
2520 if (hdev->dev_type == HCI_AMP)
2521 type = AMP_LINK;
2522 else
2523 type = ACL_LINK;
2524
2514 while (hdev->block_cnt > 0 && 2525 while (hdev->block_cnt > 0 &&
2515 (chan = hci_chan_sent(hdev, ACL_LINK, &quote))) { 2526 (chan = hci_chan_sent(hdev, type, &quote))) {
2516 u32 priority = (skb_peek(&chan->data_q))->priority; 2527 u32 priority = (skb_peek(&chan->data_q))->priority;
2517 while (quote > 0 && (skb = skb_peek(&chan->data_q))) { 2528 while (quote > 0 && (skb = skb_peek(&chan->data_q))) {
2518 int blocks; 2529 int blocks;
@@ -2545,14 +2556,19 @@ static void hci_sched_acl_blk(struct hci_dev *hdev)
2545 } 2556 }
2546 2557
2547 if (cnt != hdev->block_cnt) 2558 if (cnt != hdev->block_cnt)
2548 hci_prio_recalculate(hdev, ACL_LINK); 2559 hci_prio_recalculate(hdev, type);
2549} 2560}
2550 2561
2551static void hci_sched_acl(struct hci_dev *hdev) 2562static void hci_sched_acl(struct hci_dev *hdev)
2552{ 2563{
2553 BT_DBG("%s", hdev->name); 2564 BT_DBG("%s", hdev->name);
2554 2565
2555 if (!hci_conn_num(hdev, ACL_LINK)) 2566 /* No ACL link over BR/EDR controller */
2567 if (!hci_conn_num(hdev, ACL_LINK) && hdev->dev_type == HCI_BREDR)
2568 return;
2569
2570 /* No AMP link over AMP controller */
2571 if (!hci_conn_num(hdev, AMP_LINK) && hdev->dev_type == HCI_AMP)
2556 return; 2572 return;
2557 2573
2558 switch (hdev->flow_ctl_mode) { 2574 switch (hdev->flow_ctl_mode) {
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 5c0b6c161a01..0383635f91fb 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -2733,6 +2733,7 @@ static void hci_num_comp_blocks_evt(struct hci_dev *hdev, struct sk_buff *skb)
2733 2733
2734 switch (conn->type) { 2734 switch (conn->type) {
2735 case ACL_LINK: 2735 case ACL_LINK:
2736 case AMP_LINK:
2736 hdev->block_cnt += block_count; 2737 hdev->block_cnt += block_count;
2737 if (hdev->block_cnt > hdev->num_blocks) 2738 if (hdev->block_cnt > hdev->num_blocks)
2738 hdev->block_cnt = hdev->num_blocks; 2739 hdev->block_cnt = hdev->num_blocks;