Lines Matching +full:local +full:- +full:timer +full:- +full:stop

1 // SPDX-License-Identifier: GPL-2.0-only
11 #include "driver-ops.h"
17 * ieee802154_wake_queue - wake ieee802154 queue
22 * one frame at a time for each phy, which means we had to stop the queue to
28 struct ieee802154_local *local = hw_to_local(hw); in ieee802154_wake_queue() local
32 clear_bit(WPAN_PHY_FLAG_STATE_QUEUE_STOPPED, &local->phy->flags); in ieee802154_wake_queue()
33 list_for_each_entry_rcu(sdata, &local->interfaces, list) { in ieee802154_wake_queue()
34 if (!sdata->dev) in ieee802154_wake_queue()
37 netif_wake_queue(sdata->dev); in ieee802154_wake_queue()
43 * ieee802154_stop_queue - stop ieee802154 queue
49 * stop giving us new skbs while we are busy with the transmitted one. The queue
54 struct ieee802154_local *local = hw_to_local(hw); in ieee802154_stop_queue() local
58 list_for_each_entry_rcu(sdata, &local->interfaces, list) { in ieee802154_stop_queue()
59 if (!sdata->dev) in ieee802154_stop_queue()
62 netif_stop_queue(sdata->dev); in ieee802154_stop_queue()
67 void ieee802154_hold_queue(struct ieee802154_local *local) in ieee802154_hold_queue() argument
71 spin_lock_irqsave(&local->phy->queue_lock, flags); in ieee802154_hold_queue()
72 if (!atomic_fetch_inc(&local->phy->hold_txs)) in ieee802154_hold_queue()
73 ieee802154_stop_queue(&local->hw); in ieee802154_hold_queue()
74 spin_unlock_irqrestore(&local->phy->queue_lock, flags); in ieee802154_hold_queue()
77 void ieee802154_release_queue(struct ieee802154_local *local) in ieee802154_release_queue() argument
81 spin_lock_irqsave(&local->phy->queue_lock, flags); in ieee802154_release_queue()
82 if (atomic_dec_and_test(&local->phy->hold_txs)) in ieee802154_release_queue()
83 ieee802154_wake_queue(&local->hw); in ieee802154_release_queue()
84 spin_unlock_irqrestore(&local->phy->queue_lock, flags); in ieee802154_release_queue()
87 void ieee802154_disable_queue(struct ieee802154_local *local) in ieee802154_disable_queue() argument
92 list_for_each_entry_rcu(sdata, &local->interfaces, list) { in ieee802154_disable_queue()
93 if (!sdata->dev) in ieee802154_disable_queue()
96 netif_tx_disable(sdata->dev); in ieee802154_disable_queue()
101 enum hrtimer_restart ieee802154_xmit_ifs_timer(struct hrtimer *timer) in ieee802154_xmit_ifs_timer() argument
103 struct ieee802154_local *local = in ieee802154_xmit_ifs_timer() local
104 container_of(timer, struct ieee802154_local, ifs_timer); in ieee802154_xmit_ifs_timer()
106 ieee802154_release_queue(local); in ieee802154_xmit_ifs_timer()
114 struct ieee802154_local *local = hw_to_local(hw); in ieee802154_xmit_complete() local
116 local->tx_result = IEEE802154_SUCCESS; in ieee802154_xmit_complete()
123 * part of skb->len. in ieee802154_xmit_complete()
125 if (hw->flags & IEEE802154_HW_TX_OMIT_CKSUM) in ieee802154_xmit_complete()
126 max_sifs_size = IEEE802154_MAX_SIFS_FRAME_SIZE - in ieee802154_xmit_complete()
131 if (skb->len > max_sifs_size) in ieee802154_xmit_complete()
132 hrtimer_start(&local->ifs_timer, in ieee802154_xmit_complete()
133 hw->phy->lifs_period * NSEC_PER_USEC, in ieee802154_xmit_complete()
136 hrtimer_start(&local->ifs_timer, in ieee802154_xmit_complete()
137 hw->phy->sifs_period * NSEC_PER_USEC, in ieee802154_xmit_complete()
140 ieee802154_release_queue(local); in ieee802154_xmit_complete()
144 if (atomic_dec_and_test(&hw->phy->ongoing_txs)) in ieee802154_xmit_complete()
145 wake_up(&hw->phy->sync_txq); in ieee802154_xmit_complete()
152 struct ieee802154_local *local = hw_to_local(hw); in ieee802154_xmit_error() local
154 local->tx_result = reason; in ieee802154_xmit_error()
155 ieee802154_release_queue(local); in ieee802154_xmit_error()
157 if (atomic_dec_and_test(&hw->phy->ongoing_txs)) in ieee802154_xmit_error()
158 wake_up(&hw->phy->sync_txq); in ieee802154_xmit_error()
168 void ieee802154_stop_device(struct ieee802154_local *local) in ieee802154_stop_device() argument
170 flush_workqueue(local->workqueue); in ieee802154_stop_device()
171 hrtimer_cancel(&local->ifs_timer); in ieee802154_stop_device()
172 drv_stop(local); in ieee802154_stop_device()