mac80211: give virtual interface to hw_scan
authorJohannes Berg <johannes@sipsolutions.net>
Tue, 27 Apr 2010 09:59:34 +0000 (11:59 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 27 Apr 2010 20:09:23 +0000 (16:09 -0400)
When scanning, it is somewhat important to scan
on the correct virtual interface. All drivers
that currently implement hw_scan only support a
single virtual interface, but that may change
and then we'd want to be ready.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/at76c50x-usb.c
drivers/net/wireless/iwlwifi/iwl-core.h
drivers/net/wireless/iwlwifi/iwl-scan.c
drivers/net/wireless/mac80211_hwsim.c
drivers/net/wireless/wl12xx/wl1251_main.c
drivers/net/wireless/wl12xx/wl1271_main.c
include/net/mac80211.h
net/mac80211/driver-ops.h
net/mac80211/driver-trace.h
net/mac80211/scan.c

index 0fb419936dfff58e0b8780107c07c70d842d712b..7a626d4e100fe4e03944d0b4f324895f477aa1db 100644 (file)
@@ -1889,6 +1889,7 @@ static void at76_dwork_hw_scan(struct work_struct *work)
 }
 
 static int at76_hw_scan(struct ieee80211_hw *hw,
+                       struct ieee80211_vif *vif,
                        struct cfg80211_scan_request *req)
 {
        struct at76_priv *priv = hw->priv;
index a0cc11ecbe939322450a00072e65403d6ff308c9..7273609448595fba3c4029db1c78def2287388fd 100644 (file)
@@ -512,7 +512,9 @@ static inline __le32 iwl_hw_set_rate_n_flags(u8 rate, u32 flags)
 void iwl_init_scan_params(struct iwl_priv *priv);
 int iwl_scan_cancel(struct iwl_priv *priv);
 int iwl_scan_cancel_timeout(struct iwl_priv *priv, unsigned long ms);
-int iwl_mac_hw_scan(struct ieee80211_hw *hw, struct cfg80211_scan_request *req);
+int iwl_mac_hw_scan(struct ieee80211_hw *hw,
+                   struct ieee80211_vif *vif,
+                   struct cfg80211_scan_request *req);
 void iwl_internal_short_hw_scan(struct iwl_priv *priv);
 int iwl_force_reset(struct iwl_priv *priv, int mode);
 u16 iwl_fill_probe_req(struct iwl_priv *priv, struct ieee80211_mgmt *frame,
index 1bc1d29f2a0739be38e196b1202c774e3124ba13..447c3018296db344ef1ec5c69bcb94c937013d9c 100644 (file)
@@ -312,7 +312,8 @@ static int iwl_scan_initiate(struct iwl_priv *priv)
 }
 
 int iwl_mac_hw_scan(struct ieee80211_hw *hw,
-                    struct cfg80211_scan_request *req)
+                   struct ieee80211_vif *vif,
+                   struct cfg80211_scan_request *req)
 {
        struct iwl_priv *priv = hw->priv;
        int ret;
index 79bb8833ddb941fa72e9dc34bd3a5ae5fba43e9a..d016933d7573971812b45858ea76dc0314a87ac2 100644 (file)
@@ -973,6 +973,7 @@ static void hw_scan_done(struct work_struct *work)
 }
 
 static int mac80211_hwsim_hw_scan(struct ieee80211_hw *hw,
+                                 struct ieee80211_vif *vif,
                                  struct cfg80211_scan_request *req)
 {
        struct hw_scan_done *hsd = kzalloc(sizeof(*hsd), GFP_KERNEL);
index 390cee7e61a11d1b256552ac89641ef4ba9ccdcf..4d3be80c220ea38f3abbd1f7aaae02311c0e19fa 100644 (file)
@@ -856,6 +856,7 @@ out:
 }
 
 static int wl1251_op_hw_scan(struct ieee80211_hw *hw,
+                            struct ieee80211_vif *vif,
                             struct cfg80211_scan_request *req)
 {
        struct wl1251 *wl = hw->priv;
index 283d5dade1ae194fb255c7d8d14a3002d12e004e..08ff6447dcd98599ff6dbdedf0c9d2bfaa476c34 100644 (file)
@@ -1523,6 +1523,7 @@ out:
 }
 
 static int wl1271_op_hw_scan(struct ieee80211_hw *hw,
+                            struct ieee80211_vif *vif,
                             struct cfg80211_scan_request *req)
 {
        struct wl1271 *wl = hw->priv;
index c26de6cb12f8db25effe39849ae77262327c5454..a36e0df5a17c2e5427be3430d5dfa62b79d77c8b 100644 (file)
@@ -1657,7 +1657,7 @@ struct ieee80211_ops {
                                struct ieee80211_key_conf *conf,
                                struct ieee80211_sta *sta,
                                u32 iv32, u16 *phase1key);
-       int (*hw_scan)(struct ieee80211_hw *hw,
+       int (*hw_scan)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
                       struct cfg80211_scan_request *req);
        void (*sw_scan_start)(struct ieee80211_hw *hw);
        void (*sw_scan_complete)(struct ieee80211_hw *hw);
index d1f8a7c2225a50ca2384391ec2cdeadc498420cc..997008e236fff4e162b51907529cf758d00ab984 100644 (file)
@@ -154,14 +154,15 @@ static inline void drv_update_tkip_key(struct ieee80211_local *local,
 }
 
 static inline int drv_hw_scan(struct ieee80211_local *local,
+                             struct ieee80211_sub_if_data *sdata,
                              struct cfg80211_scan_request *req)
 {
        int ret;
 
        might_sleep();
 
-       ret = local->ops->hw_scan(&local->hw, req);
-       trace_drv_hw_scan(local, req, ret);
+       ret = local->ops->hw_scan(&local->hw, &sdata->vif, req);
+       trace_drv_hw_scan(local, sdata, req, ret);
        return ret;
 }
 
index e209cb82ff2984f50da8dea864611636aba53b3b..ce734b58d07ab6b0ac14cbfa88b6f6bb915c6b98 100644 (file)
@@ -363,23 +363,26 @@ TRACE_EVENT(drv_update_tkip_key,
 
 TRACE_EVENT(drv_hw_scan,
        TP_PROTO(struct ieee80211_local *local,
+                struct ieee80211_sub_if_data *sdata,
                 struct cfg80211_scan_request *req, int ret),
 
-       TP_ARGS(local, req, ret),
+       TP_ARGS(local, sdata, req, ret),
 
        TP_STRUCT__entry(
                LOCAL_ENTRY
+               VIF_ENTRY
                __field(int, ret)
        ),
 
        TP_fast_assign(
                LOCAL_ASSIGN;
+               VIF_ASSIGN;
                __entry->ret = ret;
        ),
 
        TP_printk(
-               LOCAL_PR_FMT " ret:%d",
-               LOCAL_PR_ARG, __entry->ret
+               LOCAL_PR_FMT VIF_PR_FMT " ret:%d",
+               LOCAL_PR_ARG,VIF_PR_ARG, __entry->ret
        )
 );
 
index eb86a5f6e6454bbfa0a62d5a2a69527da550db18..2b1f1f3d6a58657a00403183cb0fc0c7b1e09489 100644 (file)
@@ -410,7 +410,7 @@ static int __ieee80211_start_scan(struct ieee80211_sub_if_data *sdata,
 
        if (local->ops->hw_scan) {
                WARN_ON(!ieee80211_prep_hw_scan(local));
-               rc = drv_hw_scan(local, local->hw_scan_req);
+               rc = drv_hw_scan(local, sdata, local->hw_scan_req);
        } else
                rc = ieee80211_start_sw_scan(local);
 
@@ -654,7 +654,7 @@ void ieee80211_scan_work(struct work_struct *work)
        }
 
        if (local->hw_scan_req) {
-               int rc = drv_hw_scan(local, local->hw_scan_req);
+               int rc = drv_hw_scan(local, sdata, local->hw_scan_req);
                mutex_unlock(&local->scan_mtx);
                if (rc)
                        ieee80211_scan_completed(&local->hw, true);