Commit 887da917 authored by Emmanuel Grumbach's avatar Emmanuel Grumbach Committed by Johannes Berg

mac80211: provide the vif in rssi_callback

Since drivers can support several BSS / P2P Client
interfaces, the rssi callback needs to inform the driver
about the interface teh rssi event relates to.
Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent a65240c1
...@@ -1156,6 +1156,7 @@ static int iwlagn_mac_cancel_remain_on_channel(struct ieee80211_hw *hw) ...@@ -1156,6 +1156,7 @@ static int iwlagn_mac_cancel_remain_on_channel(struct ieee80211_hw *hw)
} }
static void iwlagn_mac_rssi_callback(struct ieee80211_hw *hw, static void iwlagn_mac_rssi_callback(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
enum ieee80211_rssi_event rssi_event) enum ieee80211_rssi_event rssi_event)
{ {
struct iwl_priv *priv = IWL_MAC80211_GET_DVM(hw); struct iwl_priv *priv = IWL_MAC80211_GET_DVM(hw);
......
...@@ -2633,6 +2633,7 @@ struct ieee80211_ops { ...@@ -2633,6 +2633,7 @@ struct ieee80211_ops {
int (*set_bitrate_mask)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, int (*set_bitrate_mask)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
const struct cfg80211_bitrate_mask *mask); const struct cfg80211_bitrate_mask *mask);
void (*rssi_callback)(struct ieee80211_hw *hw, void (*rssi_callback)(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
enum ieee80211_rssi_event rssi_event); enum ieee80211_rssi_event rssi_event);
void (*allow_buffered_frames)(struct ieee80211_hw *hw, void (*allow_buffered_frames)(struct ieee80211_hw *hw,
......
...@@ -845,11 +845,12 @@ static inline void drv_set_rekey_data(struct ieee80211_local *local, ...@@ -845,11 +845,12 @@ static inline void drv_set_rekey_data(struct ieee80211_local *local,
} }
static inline void drv_rssi_callback(struct ieee80211_local *local, static inline void drv_rssi_callback(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
const enum ieee80211_rssi_event event) const enum ieee80211_rssi_event event)
{ {
trace_drv_rssi_callback(local, event); trace_drv_rssi_callback(local, sdata, event);
if (local->ops->rssi_callback) if (local->ops->rssi_callback)
local->ops->rssi_callback(&local->hw, event); local->ops->rssi_callback(&local->hw, &sdata->vif, event);
trace_drv_return_void(local); trace_drv_return_void(local);
} }
......
...@@ -2604,12 +2604,12 @@ static void ieee80211_rx_mgmt_beacon(struct ieee80211_sub_if_data *sdata, ...@@ -2604,12 +2604,12 @@ static void ieee80211_rx_mgmt_beacon(struct ieee80211_sub_if_data *sdata,
if (sig > ifmgd->rssi_max_thold && if (sig > ifmgd->rssi_max_thold &&
(last_sig <= ifmgd->rssi_min_thold || last_sig == 0)) { (last_sig <= ifmgd->rssi_min_thold || last_sig == 0)) {
ifmgd->last_ave_beacon_signal = sig; ifmgd->last_ave_beacon_signal = sig;
drv_rssi_callback(local, RSSI_EVENT_HIGH); drv_rssi_callback(local, sdata, RSSI_EVENT_HIGH);
} else if (sig < ifmgd->rssi_min_thold && } else if (sig < ifmgd->rssi_min_thold &&
(last_sig >= ifmgd->rssi_max_thold || (last_sig >= ifmgd->rssi_max_thold ||
last_sig == 0)) { last_sig == 0)) {
ifmgd->last_ave_beacon_signal = sig; ifmgd->last_ave_beacon_signal = sig;
drv_rssi_callback(local, RSSI_EVENT_LOW); drv_rssi_callback(local, sdata, RSSI_EVENT_LOW);
} }
} }
......
...@@ -1189,23 +1189,26 @@ TRACE_EVENT(drv_set_rekey_data, ...@@ -1189,23 +1189,26 @@ TRACE_EVENT(drv_set_rekey_data,
TRACE_EVENT(drv_rssi_callback, TRACE_EVENT(drv_rssi_callback,
TP_PROTO(struct ieee80211_local *local, TP_PROTO(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
enum ieee80211_rssi_event rssi_event), enum ieee80211_rssi_event rssi_event),
TP_ARGS(local, rssi_event), TP_ARGS(local, sdata, rssi_event),
TP_STRUCT__entry( TP_STRUCT__entry(
LOCAL_ENTRY LOCAL_ENTRY
VIF_ENTRY
__field(u32, rssi_event) __field(u32, rssi_event)
), ),
TP_fast_assign( TP_fast_assign(
LOCAL_ASSIGN; LOCAL_ASSIGN;
VIF_ASSIGN;
__entry->rssi_event = rssi_event; __entry->rssi_event = rssi_event;
), ),
TP_printk( TP_printk(
LOCAL_PR_FMT " rssi_event:%d", LOCAL_PR_FMT VIF_PR_FMT " rssi_event:%d",
LOCAL_PR_ARG, __entry->rssi_event LOCAL_PR_ARG, VIF_PR_ARG, __entry->rssi_event
) )
); );
......
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