Commit 77be2c54 authored by Emmanuel Grumbach's avatar Emmanuel Grumbach Committed by Johannes Berg

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: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
[fix staging rtl8821ae driver]
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 78f22b6a
...@@ -1090,7 +1090,8 @@ static int ar5523_set_rts_threshold(struct ieee80211_hw *hw, u32 value) ...@@ -1090,7 +1090,8 @@ static int ar5523_set_rts_threshold(struct ieee80211_hw *hw, u32 value)
return ret; return ret;
} }
static void ar5523_flush(struct ieee80211_hw *hw, u32 queues, bool drop) static void ar5523_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
u32 queues, bool drop)
{ {
struct ar5523 *ar = hw->priv; struct ar5523 *ar = hw->priv;
......
...@@ -3544,7 +3544,8 @@ static int ath10k_set_frag_threshold(struct ieee80211_hw *hw, u32 value) ...@@ -3544,7 +3544,8 @@ static int ath10k_set_frag_threshold(struct ieee80211_hw *hw, u32 value)
return ret; return ret;
} }
static void ath10k_flush(struct ieee80211_hw *hw, u32 queues, bool drop) static void ath10k_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
u32 queues, bool drop)
{ {
struct ath10k *ar = hw->priv; struct ath10k *ar = hw->priv;
bool skip; bool skip;
......
...@@ -1883,7 +1883,8 @@ static bool ath9k_has_tx_pending(struct ath_softc *sc) ...@@ -1883,7 +1883,8 @@ static bool ath9k_has_tx_pending(struct ath_softc *sc)
return !!npend; return !!npend;
} }
static void ath9k_flush(struct ieee80211_hw *hw, u32 queues, bool drop) static void ath9k_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
u32 queues, bool drop)
{ {
struct ath_softc *sc = hw->priv; struct ath_softc *sc = hw->priv;
struct ath_hw *ah = sc->sc_ah; struct ath_hw *ah = sc->sc_ah;
......
...@@ -1707,7 +1707,9 @@ static int carl9170_op_get_survey(struct ieee80211_hw *hw, int idx, ...@@ -1707,7 +1707,9 @@ static int carl9170_op_get_survey(struct ieee80211_hw *hw, int idx,
return 0; return 0;
} }
static void carl9170_op_flush(struct ieee80211_hw *hw, u32 queues, bool drop) static void carl9170_op_flush(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
u32 queues, bool drop)
{ {
struct ar9170 *ar = hw->priv; struct ar9170 *ar = hw->priv;
unsigned int vid; unsigned int vid;
......
...@@ -897,7 +897,8 @@ static bool brcms_tx_flush_completed(struct brcms_info *wl) ...@@ -897,7 +897,8 @@ static bool brcms_tx_flush_completed(struct brcms_info *wl)
return result; return result;
} }
static void brcms_ops_flush(struct ieee80211_hw *hw, u32 queues, bool drop) static void brcms_ops_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
u32 queues, bool drop)
{ {
struct brcms_info *wl = hw->priv; struct brcms_info *wl = hw->priv;
int ret; int ret;
......
...@@ -936,7 +936,8 @@ static int __cw1200_flush(struct cw1200_common *priv, bool drop) ...@@ -936,7 +936,8 @@ static int __cw1200_flush(struct cw1200_common *priv, bool drop)
return ret; return ret;
} }
void cw1200_flush(struct ieee80211_hw *hw, u32 queues, bool drop) void cw1200_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
u32 queues, bool drop)
{ {
struct cw1200_common *priv = hw->priv; struct cw1200_common *priv = hw->priv;
......
...@@ -40,7 +40,8 @@ int cw1200_set_key(struct ieee80211_hw *dev, enum set_key_cmd cmd, ...@@ -40,7 +40,8 @@ int cw1200_set_key(struct ieee80211_hw *dev, enum set_key_cmd cmd,
int cw1200_set_rts_threshold(struct ieee80211_hw *hw, u32 value); int cw1200_set_rts_threshold(struct ieee80211_hw *hw, u32 value);
void cw1200_flush(struct ieee80211_hw *hw, u32 queues, bool drop); void cw1200_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
u32 queues, bool drop);
u64 cw1200_prepare_multicast(struct ieee80211_hw *hw, u64 cw1200_prepare_multicast(struct ieee80211_hw *hw,
struct netdev_hw_addr_list *mc_list); struct netdev_hw_addr_list *mc_list);
......
...@@ -4755,7 +4755,8 @@ il_mac_change_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif, ...@@ -4755,7 +4755,8 @@ il_mac_change_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
} }
EXPORT_SYMBOL(il_mac_change_interface); EXPORT_SYMBOL(il_mac_change_interface);
void il_mac_flush(struct ieee80211_hw *hw, u32 queues, bool drop) void il_mac_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
u32 queues, bool drop)
{ {
struct il_priv *il = hw->priv; struct il_priv *il = hw->priv;
unsigned long timeout = jiffies + msecs_to_jiffies(500); unsigned long timeout = jiffies + msecs_to_jiffies(500);
......
...@@ -1723,7 +1723,8 @@ void il_mac_remove_interface(struct ieee80211_hw *hw, ...@@ -1723,7 +1723,8 @@ void il_mac_remove_interface(struct ieee80211_hw *hw,
struct ieee80211_vif *vif); struct ieee80211_vif *vif);
int il_mac_change_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif, int il_mac_change_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
enum nl80211_iftype newtype, bool newp2p); enum nl80211_iftype newtype, bool newp2p);
void il_mac_flush(struct ieee80211_hw *hw, u32 queues, bool drop); void il_mac_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
u32 queues, bool drop);
int il_alloc_txq_mem(struct il_priv *il); int il_alloc_txq_mem(struct il_priv *il);
void il_free_txq_mem(struct il_priv *il); void il_free_txq_mem(struct il_priv *il);
......
...@@ -1091,7 +1091,8 @@ static void iwlagn_configure_filter(struct ieee80211_hw *hw, ...@@ -1091,7 +1091,8 @@ static void iwlagn_configure_filter(struct ieee80211_hw *hw,
FIF_BCN_PRBRESP_PROMISC | FIF_CONTROL; FIF_BCN_PRBRESP_PROMISC | FIF_CONTROL;
} }
static void iwlagn_mac_flush(struct ieee80211_hw *hw, u32 queues, bool drop) static void iwlagn_mac_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
u32 queues, bool drop)
{ {
struct iwl_priv *priv = IWL_MAC80211_GET_DVM(hw); struct iwl_priv *priv = IWL_MAC80211_GET_DVM(hw);
......
...@@ -1676,7 +1676,9 @@ static int mac80211_hwsim_ampdu_action(struct ieee80211_hw *hw, ...@@ -1676,7 +1676,9 @@ static int mac80211_hwsim_ampdu_action(struct ieee80211_hw *hw,
return 0; return 0;
} }
static void mac80211_hwsim_flush(struct ieee80211_hw *hw, u32 queues, bool drop) static void mac80211_hwsim_flush(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
u32 queues, bool drop)
{ {
/* Not implemented, queues only on kernel side */ /* Not implemented, queues only on kernel side */
} }
......
...@@ -669,7 +669,8 @@ static unsigned int p54_flush_count(struct p54_common *priv) ...@@ -669,7 +669,8 @@ static unsigned int p54_flush_count(struct p54_common *priv)
return total; return total;
} }
static void p54_flush(struct ieee80211_hw *dev, u32 queues, bool drop) static void p54_flush(struct ieee80211_hw *dev, struct ieee80211_vif *vif,
u32 queues, bool drop)
{ {
struct p54_common *priv = dev->priv; struct p54_common *priv = dev->priv;
unsigned int total, i; unsigned int total, i;
......
...@@ -1448,7 +1448,8 @@ int rt2x00mac_conf_tx(struct ieee80211_hw *hw, ...@@ -1448,7 +1448,8 @@ int rt2x00mac_conf_tx(struct ieee80211_hw *hw,
struct ieee80211_vif *vif, u16 queue, struct ieee80211_vif *vif, u16 queue,
const struct ieee80211_tx_queue_params *params); const struct ieee80211_tx_queue_params *params);
void rt2x00mac_rfkill_poll(struct ieee80211_hw *hw); void rt2x00mac_rfkill_poll(struct ieee80211_hw *hw);
void rt2x00mac_flush(struct ieee80211_hw *hw, u32 queues, bool drop); void rt2x00mac_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
u32 queues, bool drop);
int rt2x00mac_set_antenna(struct ieee80211_hw *hw, u32 tx_ant, u32 rx_ant); int rt2x00mac_set_antenna(struct ieee80211_hw *hw, u32 tx_ant, u32 rx_ant);
int rt2x00mac_get_antenna(struct ieee80211_hw *hw, u32 *tx_ant, u32 *rx_ant); int rt2x00mac_get_antenna(struct ieee80211_hw *hw, u32 *tx_ant, u32 *rx_ant);
void rt2x00mac_get_ringparam(struct ieee80211_hw *hw, void rt2x00mac_get_ringparam(struct ieee80211_hw *hw,
......
...@@ -747,7 +747,8 @@ void rt2x00mac_rfkill_poll(struct ieee80211_hw *hw) ...@@ -747,7 +747,8 @@ void rt2x00mac_rfkill_poll(struct ieee80211_hw *hw)
} }
EXPORT_SYMBOL_GPL(rt2x00mac_rfkill_poll); EXPORT_SYMBOL_GPL(rt2x00mac_rfkill_poll);
void rt2x00mac_flush(struct ieee80211_hw *hw, u32 queues, bool drop) void rt2x00mac_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
u32 queues, bool drop)
{ {
struct rt2x00_dev *rt2x00dev = hw->priv; struct rt2x00_dev *rt2x00dev = hw->priv;
struct data_queue *queue; struct data_queue *queue;
......
...@@ -1387,7 +1387,8 @@ static void rtl_op_rfkill_poll(struct ieee80211_hw *hw) ...@@ -1387,7 +1387,8 @@ static void rtl_op_rfkill_poll(struct ieee80211_hw *hw)
* before switch channel or power save, or tx buffer packet * before switch channel or power save, or tx buffer packet
* maybe send after offchannel or rf sleep, this may cause * maybe send after offchannel or rf sleep, this may cause
* dis-association by AP */ * dis-association by AP */
static void rtl_op_flush(struct ieee80211_hw *hw, u32 queues, bool drop) static void rtl_op_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
u32 queues, bool drop)
{ {
struct rtl_priv *rtlpriv = rtl_priv(hw); struct rtl_priv *rtlpriv = rtl_priv(hw);
......
...@@ -5184,7 +5184,8 @@ static void wl12xx_op_channel_switch(struct ieee80211_hw *hw, ...@@ -5184,7 +5184,8 @@ static void wl12xx_op_channel_switch(struct ieee80211_hw *hw,
mutex_unlock(&wl->mutex); mutex_unlock(&wl->mutex);
} }
static void wlcore_op_flush(struct ieee80211_hw *hw, u32 queues, bool drop) static void wlcore_op_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
u32 queues, bool drop)
{ {
struct wl1271 *wl = hw->priv; struct wl1271 *wl = hw->priv;
......
...@@ -1414,23 +1414,15 @@ static void rtl_op_rfkill_poll(struct ieee80211_hw *hw) ...@@ -1414,23 +1414,15 @@ static void rtl_op_rfkill_poll(struct ieee80211_hw *hw)
* before switch channel or power save, or tx buffer packet * before switch channel or power save, or tx buffer packet
* maybe send after offchannel or rf sleep, this may cause * maybe send after offchannel or rf sleep, this may cause
* dis-association by AP */ * dis-association by AP */
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)) static void rtl_op_flush(struct ieee80211_hw *hw,
static void rtl_op_flush(struct ieee80211_hw *hw, u32 queues, bool drop) struct ieee80211_vif *vif,
u32 queues, bool drop)
{ {
struct rtl_priv *rtlpriv = rtl_priv(hw); struct rtl_priv *rtlpriv = rtl_priv(hw);
if (rtlpriv->intf_ops->flush) if (rtlpriv->intf_ops->flush)
rtlpriv->intf_ops->flush(hw, queues, drop); rtlpriv->intf_ops->flush(hw, queues, drop);
} }
#else
static void rtl_op_flush(struct ieee80211_hw *hw, bool drop)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
if (rtlpriv->intf_ops->flush)
rtlpriv->intf_ops->flush(hw, drop);
}
#endif
const struct ieee80211_ops rtl_ops = { const struct ieee80211_ops rtl_ops = {
.start = rtl_op_start, .start = rtl_op_start,
......
...@@ -2609,6 +2609,7 @@ enum ieee80211_roc_type { ...@@ -2609,6 +2609,7 @@ enum ieee80211_roc_type {
* of queues to flush, which is useful if different virtual interfaces * of queues to flush, which is useful if different virtual interfaces
* use different hardware queues; it may also indicate all queues. * use different hardware queues; it may also indicate all queues.
* If the parameter @drop is set to %true, pending frames may be dropped. * If the parameter @drop is set to %true, pending frames may be dropped.
* Note that vif can be NULL.
* The callback can sleep. * The callback can sleep.
* *
* @channel_switch: Drivers that need (or want) to offload the channel * @channel_switch: Drivers that need (or want) to offload the channel
...@@ -2871,7 +2872,8 @@ struct ieee80211_ops { ...@@ -2871,7 +2872,8 @@ struct ieee80211_ops {
struct netlink_callback *cb, struct netlink_callback *cb,
void *data, int len); void *data, int len);
#endif #endif
void (*flush)(struct ieee80211_hw *hw, u32 queues, bool drop); void (*flush)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
u32 queues, bool drop);
void (*channel_switch)(struct ieee80211_hw *hw, void (*channel_switch)(struct ieee80211_hw *hw,
struct ieee80211_channel_switch *ch_switch); struct ieee80211_channel_switch *ch_switch);
int (*set_antenna)(struct ieee80211_hw *hw, u32 tx_ant, u32 rx_ant); int (*set_antenna)(struct ieee80211_hw *hw, u32 tx_ant, u32 rx_ant);
......
...@@ -726,13 +726,19 @@ static inline void drv_rfkill_poll(struct ieee80211_local *local) ...@@ -726,13 +726,19 @@ static inline void drv_rfkill_poll(struct ieee80211_local *local)
} }
static inline void drv_flush(struct ieee80211_local *local, static inline void drv_flush(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
u32 queues, bool drop) u32 queues, bool drop)
{ {
struct ieee80211_vif *vif = sdata ? &sdata->vif : NULL;
might_sleep(); might_sleep();
if (sdata)
check_sdata_in_driver(sdata);
trace_drv_flush(local, queues, drop); trace_drv_flush(local, queues, drop);
if (local->ops->flush) if (local->ops->flush)
local->ops->flush(&local->hw, queues, drop); local->ops->flush(&local->hw, vif, queues, drop);
trace_drv_return_void(local); trace_drv_return_void(local);
} }
......
...@@ -554,7 +554,7 @@ void ieee80211_flush_queues(struct ieee80211_local *local, ...@@ -554,7 +554,7 @@ void ieee80211_flush_queues(struct ieee80211_local *local,
ieee80211_stop_queues_by_reason(&local->hw, IEEE80211_MAX_QUEUE_MAP, ieee80211_stop_queues_by_reason(&local->hw, IEEE80211_MAX_QUEUE_MAP,
IEEE80211_QUEUE_STOP_REASON_FLUSH); IEEE80211_QUEUE_STOP_REASON_FLUSH);
drv_flush(local, queues, false); drv_flush(local, sdata, queues, false);
ieee80211_wake_queues_by_reason(&local->hw, IEEE80211_MAX_QUEUE_MAP, ieee80211_wake_queues_by_reason(&local->hw, IEEE80211_MAX_QUEUE_MAP,
IEEE80211_QUEUE_STOP_REASON_FLUSH); IEEE80211_QUEUE_STOP_REASON_FLUSH);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment