Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mac80211: add vif to flush call

This will allow the low level driver to make decision based
on the vif such as queues etc...
Since the vif might be NULL, we can't add it to the tracing
functions.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
[fix staging rtl8821ae driver]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

authored by

Emmanuel Grumbach and committed by
Johannes Berg
77be2c54 78f22b6a

+48 -30
+2 -1
drivers/net/wireless/ath/ar5523/ar5523.c
··· 1090 1090 return ret; 1091 1091 } 1092 1092 1093 - static void ar5523_flush(struct ieee80211_hw *hw, u32 queues, bool drop) 1093 + static void ar5523_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 1094 + u32 queues, bool drop) 1094 1095 { 1095 1096 struct ar5523 *ar = hw->priv; 1096 1097
+2 -1
drivers/net/wireless/ath/ath10k/mac.c
··· 3544 3544 return ret; 3545 3545 } 3546 3546 3547 - static void ath10k_flush(struct ieee80211_hw *hw, u32 queues, bool drop) 3547 + static void ath10k_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 3548 + u32 queues, bool drop) 3548 3549 { 3549 3550 struct ath10k *ar = hw->priv; 3550 3551 bool skip;
+2 -1
drivers/net/wireless/ath/ath9k/main.c
··· 1883 1883 return !!npend; 1884 1884 } 1885 1885 1886 - static void ath9k_flush(struct ieee80211_hw *hw, u32 queues, bool drop) 1886 + static void ath9k_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 1887 + u32 queues, bool drop) 1887 1888 { 1888 1889 struct ath_softc *sc = hw->priv; 1889 1890 struct ath_hw *ah = sc->sc_ah;
+3 -1
drivers/net/wireless/ath/carl9170/main.c
··· 1707 1707 return 0; 1708 1708 } 1709 1709 1710 - static void carl9170_op_flush(struct ieee80211_hw *hw, u32 queues, bool drop) 1710 + static void carl9170_op_flush(struct ieee80211_hw *hw, 1711 + struct ieee80211_vif *vif, 1712 + u32 queues, bool drop) 1711 1713 { 1712 1714 struct ar9170 *ar = hw->priv; 1713 1715 unsigned int vid;
+2 -1
drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c
··· 897 897 return result; 898 898 } 899 899 900 - static void brcms_ops_flush(struct ieee80211_hw *hw, u32 queues, bool drop) 900 + static void brcms_ops_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 901 + u32 queues, bool drop) 901 902 { 902 903 struct brcms_info *wl = hw->priv; 903 904 int ret;
+2 -1
drivers/net/wireless/cw1200/sta.c
··· 936 936 return ret; 937 937 } 938 938 939 - void cw1200_flush(struct ieee80211_hw *hw, u32 queues, bool drop) 939 + void cw1200_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 940 + u32 queues, bool drop) 940 941 { 941 942 struct cw1200_common *priv = hw->priv; 942 943
+2 -1
drivers/net/wireless/cw1200/sta.h
··· 40 40 41 41 int cw1200_set_rts_threshold(struct ieee80211_hw *hw, u32 value); 42 42 43 - void cw1200_flush(struct ieee80211_hw *hw, u32 queues, bool drop); 43 + void cw1200_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 44 + u32 queues, bool drop); 44 45 45 46 u64 cw1200_prepare_multicast(struct ieee80211_hw *hw, 46 47 struct netdev_hw_addr_list *mc_list);
+2 -1
drivers/net/wireless/iwlegacy/common.c
··· 4755 4755 } 4756 4756 EXPORT_SYMBOL(il_mac_change_interface); 4757 4757 4758 - void il_mac_flush(struct ieee80211_hw *hw, u32 queues, bool drop) 4758 + void il_mac_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 4759 + u32 queues, bool drop) 4759 4760 { 4760 4761 struct il_priv *il = hw->priv; 4761 4762 unsigned long timeout = jiffies + msecs_to_jiffies(500);
+2 -1
drivers/net/wireless/iwlegacy/common.h
··· 1723 1723 struct ieee80211_vif *vif); 1724 1724 int il_mac_change_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 1725 1725 enum nl80211_iftype newtype, bool newp2p); 1726 - void il_mac_flush(struct ieee80211_hw *hw, u32 queues, bool drop); 1726 + void il_mac_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 1727 + u32 queues, bool drop); 1727 1728 int il_alloc_txq_mem(struct il_priv *il); 1728 1729 void il_free_txq_mem(struct il_priv *il); 1729 1730
+2 -1
drivers/net/wireless/iwlwifi/dvm/mac80211.c
··· 1091 1091 FIF_BCN_PRBRESP_PROMISC | FIF_CONTROL; 1092 1092 } 1093 1093 1094 - static void iwlagn_mac_flush(struct ieee80211_hw *hw, u32 queues, bool drop) 1094 + static void iwlagn_mac_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 1095 + u32 queues, bool drop) 1095 1096 { 1096 1097 struct iwl_priv *priv = IWL_MAC80211_GET_DVM(hw); 1097 1098
+3 -1
drivers/net/wireless/mac80211_hwsim.c
··· 1676 1676 return 0; 1677 1677 } 1678 1678 1679 - static void mac80211_hwsim_flush(struct ieee80211_hw *hw, u32 queues, bool drop) 1679 + static void mac80211_hwsim_flush(struct ieee80211_hw *hw, 1680 + struct ieee80211_vif *vif, 1681 + u32 queues, bool drop) 1680 1682 { 1681 1683 /* Not implemented, queues only on kernel side */ 1682 1684 }
+2 -1
drivers/net/wireless/p54/main.c
··· 669 669 return total; 670 670 } 671 671 672 - static void p54_flush(struct ieee80211_hw *dev, u32 queues, bool drop) 672 + static void p54_flush(struct ieee80211_hw *dev, struct ieee80211_vif *vif, 673 + u32 queues, bool drop) 673 674 { 674 675 struct p54_common *priv = dev->priv; 675 676 unsigned int total, i;
+2 -1
drivers/net/wireless/rt2x00/rt2x00.h
··· 1448 1448 struct ieee80211_vif *vif, u16 queue, 1449 1449 const struct ieee80211_tx_queue_params *params); 1450 1450 void rt2x00mac_rfkill_poll(struct ieee80211_hw *hw); 1451 - void rt2x00mac_flush(struct ieee80211_hw *hw, u32 queues, bool drop); 1451 + void rt2x00mac_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 1452 + u32 queues, bool drop); 1452 1453 int rt2x00mac_set_antenna(struct ieee80211_hw *hw, u32 tx_ant, u32 rx_ant); 1453 1454 int rt2x00mac_get_antenna(struct ieee80211_hw *hw, u32 *tx_ant, u32 *rx_ant); 1454 1455 void rt2x00mac_get_ringparam(struct ieee80211_hw *hw,
+2 -1
drivers/net/wireless/rt2x00/rt2x00mac.c
··· 747 747 } 748 748 EXPORT_SYMBOL_GPL(rt2x00mac_rfkill_poll); 749 749 750 - void rt2x00mac_flush(struct ieee80211_hw *hw, u32 queues, bool drop) 750 + void rt2x00mac_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 751 + u32 queues, bool drop) 751 752 { 752 753 struct rt2x00_dev *rt2x00dev = hw->priv; 753 754 struct data_queue *queue;
+2 -1
drivers/net/wireless/rtlwifi/core.c
··· 1387 1387 * before switch channel or power save, or tx buffer packet 1388 1388 * maybe send after offchannel or rf sleep, this may cause 1389 1389 * dis-association by AP */ 1390 - static void rtl_op_flush(struct ieee80211_hw *hw, u32 queues, bool drop) 1390 + static void rtl_op_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 1391 + u32 queues, bool drop) 1391 1392 { 1392 1393 struct rtl_priv *rtlpriv = rtl_priv(hw); 1393 1394
+2 -1
drivers/net/wireless/ti/wlcore/main.c
··· 5184 5184 mutex_unlock(&wl->mutex); 5185 5185 } 5186 5186 5187 - static void wlcore_op_flush(struct ieee80211_hw *hw, u32 queues, bool drop) 5187 + static void wlcore_op_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 5188 + u32 queues, bool drop) 5188 5189 { 5189 5190 struct wl1271 *wl = hw->priv; 5190 5191
+3 -11
drivers/staging/rtl8821ae/core.c
··· 1414 1414 * before switch channel or power save, or tx buffer packet 1415 1415 * maybe send after offchannel or rf sleep, this may cause 1416 1416 * dis-association by AP */ 1417 - #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)) 1418 - static void rtl_op_flush(struct ieee80211_hw *hw, u32 queues, bool drop) 1417 + static void rtl_op_flush(struct ieee80211_hw *hw, 1418 + struct ieee80211_vif *vif, 1419 + u32 queues, bool drop) 1419 1420 { 1420 1421 struct rtl_priv *rtlpriv = rtl_priv(hw); 1421 1422 1422 1423 if (rtlpriv->intf_ops->flush) 1423 1424 rtlpriv->intf_ops->flush(hw, queues, drop); 1424 1425 } 1425 - #else 1426 - static void rtl_op_flush(struct ieee80211_hw *hw, bool drop) 1427 - { 1428 - struct rtl_priv *rtlpriv = rtl_priv(hw); 1429 - 1430 - if (rtlpriv->intf_ops->flush) 1431 - rtlpriv->intf_ops->flush(hw, drop); 1432 - } 1433 - #endif 1434 1426 1435 1427 const struct ieee80211_ops rtl_ops = { 1436 1428 .start = rtl_op_start,
+3 -1
include/net/mac80211.h
··· 2609 2609 * of queues to flush, which is useful if different virtual interfaces 2610 2610 * use different hardware queues; it may also indicate all queues. 2611 2611 * If the parameter @drop is set to %true, pending frames may be dropped. 2612 + * Note that vif can be NULL. 2612 2613 * The callback can sleep. 2613 2614 * 2614 2615 * @channel_switch: Drivers that need (or want) to offload the channel ··· 2872 2871 struct netlink_callback *cb, 2873 2872 void *data, int len); 2874 2873 #endif 2875 - void (*flush)(struct ieee80211_hw *hw, u32 queues, bool drop); 2874 + void (*flush)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 2875 + u32 queues, bool drop); 2876 2876 void (*channel_switch)(struct ieee80211_hw *hw, 2877 2877 struct ieee80211_channel_switch *ch_switch); 2878 2878 int (*set_antenna)(struct ieee80211_hw *hw, u32 tx_ant, u32 rx_ant);
+7 -1
net/mac80211/driver-ops.h
··· 726 726 } 727 727 728 728 static inline void drv_flush(struct ieee80211_local *local, 729 + struct ieee80211_sub_if_data *sdata, 729 730 u32 queues, bool drop) 730 731 { 732 + struct ieee80211_vif *vif = sdata ? &sdata->vif : NULL; 733 + 731 734 might_sleep(); 735 + 736 + if (sdata) 737 + check_sdata_in_driver(sdata); 732 738 733 739 trace_drv_flush(local, queues, drop); 734 740 if (local->ops->flush) 735 - local->ops->flush(&local->hw, queues, drop); 741 + local->ops->flush(&local->hw, vif, queues, drop); 736 742 trace_drv_return_void(local); 737 743 } 738 744
+1 -1
net/mac80211/util.c
··· 554 554 ieee80211_stop_queues_by_reason(&local->hw, IEEE80211_MAX_QUEUE_MAP, 555 555 IEEE80211_QUEUE_STOP_REASON_FLUSH); 556 556 557 - drv_flush(local, queues, false); 557 + drv_flush(local, sdata, queues, false); 558 558 559 559 ieee80211_wake_queues_by_reason(&local->hw, IEEE80211_MAX_QUEUE_MAP, 560 560 IEEE80211_QUEUE_STOP_REASON_FLUSH);