-static void wlan_cab_flush_queue(void)
-{
- struct dma_desc *desc;
- uint8_t *_ie;
- struct ieee80211_tim_ie *ie;
-
- /*
- * This prevents the code from sending new BC/MC frames
- * which were queued after the previous buffered traffic
- * has been sent out... They will have to wait until the
- * next DTIM beacon comes along.
- */
- if (unlikely(fw.wlan.cab_flush_trigger == CARL9170_CAB_TRIGGER_DEFER))
- return ;
-
- _ie = beacon_find_ie(WLAN_EID_TIM);
- if (unlikely(!_ie))
- return ;
-
- ie = (struct ieee80211_tim_ie *) &_ie[2];
-
- /* Ideally, check here for == AR9170_CAB_TRIGGER_ARMED */
- if (fw.wlan.cab_flush_trigger) {
- /* move queued frames into the main tx queues */
- for_each_desc(desc, &fw.wlan.cab_queue) {
- struct carl9170_tx_superframe *super = get_super(desc);
-
- if (!queue_empty(&fw.wlan.cab_queue)) {
- /*
- * Set MOREDATA flag for all,
- * but the last queued frame.
- * see: 802.11-2007 11.2.1.5 f)
- *
- * This is actually the reason to why
- * we need to prevent the reentry.
- */
-
- super->f.data.i3e.frame_control |=
- cpu_to_le16(IEEE80211_FCTL_MOREDATA);
- } else {
- super->f.data.i3e.frame_control &=
- cpu_to_le16(~IEEE80211_FCTL_MOREDATA);
- }
-
- /* ready to roll! */
- _wlan_tx(desc);
- }
- }
-
- /* Transfer finished - waiting for tx status */
- fw.wlan.cab_flush_trigger = CARL9170_CAB_TRIGGER_DEFER;
-}
-
-static void wlan_cab_modify_dtim_beacon(void)