mac80211/iwlwifi: move virtual A-MDPU queue bookkeeping to iwlwifi
This patch removes all the virtual A-MPDU-queue bookkeeping from mac80211. Curiously, iwlwifi already does its own bookkeeping, so it doesn't require much changes except where it needs to handle starting and stopping the queues in mac80211. To handle the queue stop/wake properly, we rewrite the software queue number for aggregation frames and internally to iwlwifi keep track of the queues that map into the same AC queue, and only talk to mac80211 about the AC queue. The implementation requires calling two new functions, iwl_stop_queue and iwl_wake_queue instead of the mac80211 counterparts. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Cc: Reinette Chattre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
committed by
John W. Linville
parent
cd8ffc800c
commit
e4e72fb4de
@@ -93,4 +93,56 @@ static inline int iwl_alloc_fw_desc(struct pci_dev *pci_dev,
|
||||
return (desc->v_addr != NULL) ? 0 : -ENOMEM;
|
||||
}
|
||||
|
||||
/*
|
||||
* we have 8 bits used like this:
|
||||
*
|
||||
* 7 6 5 4 3 2 1 0
|
||||
* | | | | | | | |
|
||||
* | | | | | | +-+-------- AC queue (0-3)
|
||||
* | | | | | |
|
||||
* | +-+-+-+-+------------ HW A-MPDU queue
|
||||
* |
|
||||
* +---------------------- indicates agg queue
|
||||
*/
|
||||
static inline u8 iwl_virtual_agg_queue_num(u8 ac, u8 hwq)
|
||||
{
|
||||
BUG_ON(ac > 3); /* only have 2 bits */
|
||||
BUG_ON(hwq > 31); /* only have 5 bits */
|
||||
|
||||
return 0x80 | (hwq << 2) | ac;
|
||||
}
|
||||
|
||||
static inline void iwl_wake_queue(struct iwl_priv *priv, u8 queue)
|
||||
{
|
||||
u8 ac = queue;
|
||||
u8 hwq = queue;
|
||||
|
||||
if (queue & 0x80) {
|
||||
ac = queue & 3;
|
||||
hwq = (queue >> 2) & 0x1f;
|
||||
}
|
||||
|
||||
if (test_and_clear_bit(hwq, priv->queue_stopped))
|
||||
if (atomic_dec_return(&priv->queue_stop_count[ac]) <= 0)
|
||||
ieee80211_wake_queue(priv->hw, ac);
|
||||
}
|
||||
|
||||
static inline void iwl_stop_queue(struct iwl_priv *priv, u8 queue)
|
||||
{
|
||||
u8 ac = queue;
|
||||
u8 hwq = queue;
|
||||
|
||||
if (queue & 0x80) {
|
||||
ac = queue & 3;
|
||||
hwq = (queue >> 2) & 0x1f;
|
||||
}
|
||||
|
||||
if (!test_and_set_bit(hwq, priv->queue_stopped))
|
||||
if (atomic_inc_return(&priv->queue_stop_count[ac]) > 0)
|
||||
ieee80211_stop_queue(priv->hw, ac);
|
||||
}
|
||||
|
||||
#define ieee80211_stop_queue DO_NOT_USE_ieee80211_stop_queue
|
||||
#define ieee80211_wake_queue DO_NOT_USE_ieee80211_wake_queue
|
||||
|
||||
#endif /* __iwl_helpers_h__ */
|
||||
|
Reference in New Issue
Block a user