mac80211: provide the vif in rssi_callback
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Sun, 20 Jan 2013 15:32:41 +0000 (17:32 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Thu, 24 Jan 2013 14:41:29 +0000 (15:41 +0100)
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: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/iwlwifi/dvm/mac80211.c
include/net/mac80211.h
net/mac80211/driver-ops.h
net/mac80211/mlme.c
net/mac80211/trace.h

index 02fdcea76b212dca9633facf76f10fabbb53c621..f16b81d625ad24b2862d600c71a0f5b586ff96be 100644 (file)
@@ -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,
+                                    struct ieee80211_vif *vif,
                                     enum ieee80211_rssi_event rssi_event)
 {
        struct iwl_priv *priv = IWL_MAC80211_GET_DVM(hw);
index ece5733d113dd33aa005d0c5ba4df8a184c4b89f..5c98d654fc75ba3f3d0974f0f16cc5e9b10d9c99 100644 (file)
@@ -2633,6 +2633,7 @@ struct ieee80211_ops {
        int (*set_bitrate_mask)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
                                const struct cfg80211_bitrate_mask *mask);
        void (*rssi_callback)(struct ieee80211_hw *hw,
+                             struct ieee80211_vif *vif,
                              enum ieee80211_rssi_event rssi_event);
 
        void (*allow_buffered_frames)(struct ieee80211_hw *hw,
index d51afbd614d356ddcde3f9101ab922c7f05ae8b5..e75f5b9eb24f55c177e402dfc7b3c0045f2ffe86 100644 (file)
@@ -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,
+                                    struct ieee80211_sub_if_data *sdata,
                                     const enum ieee80211_rssi_event event)
 {
-       trace_drv_rssi_callback(local, event);
+       trace_drv_rssi_callback(local, sdata, event);
        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);
 }
 
index 2d9ef20cd38d059fd27be3815a7af496dc22a287..344ef7d47c1a3b7b641238c65ac134336481a700 100644 (file)
@@ -2604,12 +2604,12 @@ static void ieee80211_rx_mgmt_beacon(struct ieee80211_sub_if_data *sdata,
                if (sig > ifmgd->rssi_max_thold &&
                    (last_sig <= ifmgd->rssi_min_thold || last_sig == 0)) {
                        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 &&
                           (last_sig >= ifmgd->rssi_max_thold ||
                           last_sig == 0)) {
                        ifmgd->last_ave_beacon_signal = sig;
-                       drv_rssi_callback(local, RSSI_EVENT_LOW);
+                       drv_rssi_callback(local, sdata, RSSI_EVENT_LOW);
                }
        }
 
index 2a2c2e20307d73d73055a397ecbe911416c808ac..6ca53d64cb28ad67ee9f47a3341f4d7c362720c0 100644 (file)
@@ -1189,23 +1189,26 @@ TRACE_EVENT(drv_set_rekey_data,
 
 TRACE_EVENT(drv_rssi_callback,
        TP_PROTO(struct ieee80211_local *local,
+                struct ieee80211_sub_if_data *sdata,
                 enum ieee80211_rssi_event rssi_event),
 
-       TP_ARGS(local, rssi_event),
+       TP_ARGS(local, sdata, rssi_event),
 
        TP_STRUCT__entry(
                LOCAL_ENTRY
+               VIF_ENTRY
                __field(u32, rssi_event)
        ),
 
        TP_fast_assign(
                LOCAL_ASSIGN;
+               VIF_ASSIGN;
                __entry->rssi_event = rssi_event;
        ),
 
        TP_printk(
-               LOCAL_PR_FMT " rssi_event:%d",
-               LOCAL_PR_ARG, __entry->rssi_event
+               LOCAL_PR_FMT VIF_PR_FMT " rssi_event:%d",
+               LOCAL_PR_ARG, VIF_PR_ARG, __entry->rssi_event
        )
 );