From: Luiz Augusto von Dentz Date: Tue, 11 Apr 2017 19:21:00 +0000 (+0300) Subject: Bluetooth: 6lowpan: Use netif APIs to flow control X-Git-Tag: v4.14-rc1~1025^2~175^2~17 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f183e52b8ef3d62c795b0fe2228400ac48f6cae6;p=platform%2Fkernel%2Flinux-rpi.git 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 Acked-by: Jukka Rissanen Signed-off-by: Marcel Holtmann --- diff --git a/net/bluetooth/6lowpan.c b/net/bluetooth/6lowpan.c index 22bd936..dc7fda3 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, static void chan_suspend_cb(struct l2cap_chan *chan) { + struct lowpan_btle_dev *dev; + BT_DBG("chan %p suspend", chan); + + dev = lookup_dev(chan->conn); + if (!dev || !dev->netdev) + return; + + netif_stop_queue(dev->netdev); } static void chan_resume_cb(struct l2cap_chan *chan) { + struct lowpan_btle_dev *dev; + BT_DBG("chan %p resume", chan); + + dev = lookup_dev(chan->conn); + if (!dev || !dev->netdev) + return; + + netif_wake_queue(dev->netdev); } static long chan_get_sndtimeo_cb(struct l2cap_chan *chan)