diff options
| author | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2017-04-11 15:21:00 -0400 |
|---|---|---|
| committer | Marcel Holtmann <marcel@holtmann.org> | 2017-04-12 16:02:40 -0400 |
| commit | f183e52b8ef3d62c795b0fe2228400ac48f6cae6 (patch) | |
| tree | 31ca69983eec5ebd813ff543eec2a4f592df44e0 /net/bluetooth/6lowpan.c | |
| parent | e1008f95e1e7762fade7ccbc973247a3b32edddb (diff) | |
Bluetooth: 6lowpan: Use netif APIs to flow control
Rely on netif_wake_queue and netif_stop_queue to flow control when
transmit resources are unavailable.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Acked-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/6lowpan.c')
| -rw-r--r-- | net/bluetooth/6lowpan.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/net/bluetooth/6lowpan.c b/net/bluetooth/6lowpan.c index 22bd936ed2ce..dc7fda307b15 100644 --- a/net/bluetooth/6lowpan.c +++ b/net/bluetooth/6lowpan.c | |||
| @@ -867,12 +867,28 @@ static struct sk_buff *chan_alloc_skb_cb(struct l2cap_chan *chan, | |||
| 867 | 867 | ||
| 868 | static void chan_suspend_cb(struct l2cap_chan *chan) | 868 | static void chan_suspend_cb(struct l2cap_chan *chan) |
| 869 | { | 869 | { |
| 870 | struct lowpan_btle_dev *dev; | ||
| 871 | |||
| 870 | BT_DBG("chan %p suspend", chan); | 872 | BT_DBG("chan %p suspend", chan); |
| 873 | |||
| 874 | dev = lookup_dev(chan->conn); | ||
| 875 | if (!dev || !dev->netdev) | ||
| 876 | return; | ||
| 877 | |||
| 878 | netif_stop_queue(dev->netdev); | ||
| 871 | } | 879 | } |
| 872 | 880 | ||
| 873 | static void chan_resume_cb(struct l2cap_chan *chan) | 881 | static void chan_resume_cb(struct l2cap_chan *chan) |
| 874 | { | 882 | { |
| 883 | struct lowpan_btle_dev *dev; | ||
| 884 | |||
| 875 | BT_DBG("chan %p resume", chan); | 885 | BT_DBG("chan %p resume", chan); |
| 886 | |||
| 887 | dev = lookup_dev(chan->conn); | ||
| 888 | if (!dev || !dev->netdev) | ||
| 889 | return; | ||
| 890 | |||
| 891 | netif_wake_queue(dev->netdev); | ||
| 876 | } | 892 | } |
| 877 | 893 | ||
| 878 | static long chan_get_sndtimeo_cb(struct l2cap_chan *chan) | 894 | static long chan_get_sndtimeo_cb(struct l2cap_chan *chan) |
