Commit a060bbfe authored by Johannes Berg's avatar Johannes Berg Committed by John W. Linville

mac80211: give virtual interface to hw_scan

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: default avatarJohannes Berg <johannes@sipsolutions.net>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 9043f3b8
...@@ -1889,6 +1889,7 @@ static void at76_dwork_hw_scan(struct work_struct *work) ...@@ -1889,6 +1889,7 @@ static void at76_dwork_hw_scan(struct work_struct *work)
} }
static int at76_hw_scan(struct ieee80211_hw *hw, static int at76_hw_scan(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
struct cfg80211_scan_request *req) struct cfg80211_scan_request *req)
{ {
struct at76_priv *priv = hw->priv; struct at76_priv *priv = hw->priv;
......
...@@ -512,7 +512,9 @@ static inline __le32 iwl_hw_set_rate_n_flags(u8 rate, u32 flags) ...@@ -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); void iwl_init_scan_params(struct iwl_priv *priv);
int iwl_scan_cancel(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_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); void iwl_internal_short_hw_scan(struct iwl_priv *priv);
int iwl_force_reset(struct iwl_priv *priv, int mode); int iwl_force_reset(struct iwl_priv *priv, int mode);
u16 iwl_fill_probe_req(struct iwl_priv *priv, struct ieee80211_mgmt *frame, u16 iwl_fill_probe_req(struct iwl_priv *priv, struct ieee80211_mgmt *frame,
......
...@@ -312,7 +312,8 @@ static int iwl_scan_initiate(struct iwl_priv *priv) ...@@ -312,7 +312,8 @@ static int iwl_scan_initiate(struct iwl_priv *priv)
} }
int iwl_mac_hw_scan(struct ieee80211_hw *hw, 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; struct iwl_priv *priv = hw->priv;
int ret; int ret;
......
...@@ -973,6 +973,7 @@ static void hw_scan_done(struct work_struct *work) ...@@ -973,6 +973,7 @@ static void hw_scan_done(struct work_struct *work)
} }
static int mac80211_hwsim_hw_scan(struct ieee80211_hw *hw, static int mac80211_hwsim_hw_scan(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
struct cfg80211_scan_request *req) struct cfg80211_scan_request *req)
{ {
struct hw_scan_done *hsd = kzalloc(sizeof(*hsd), GFP_KERNEL); struct hw_scan_done *hsd = kzalloc(sizeof(*hsd), GFP_KERNEL);
......
...@@ -856,6 +856,7 @@ static int wl1251_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, ...@@ -856,6 +856,7 @@ static int wl1251_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
} }
static int wl1251_op_hw_scan(struct ieee80211_hw *hw, static int wl1251_op_hw_scan(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
struct cfg80211_scan_request *req) struct cfg80211_scan_request *req)
{ {
struct wl1251 *wl = hw->priv; struct wl1251 *wl = hw->priv;
......
...@@ -1523,6 +1523,7 @@ static int wl1271_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, ...@@ -1523,6 +1523,7 @@ static int wl1271_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
} }
static int wl1271_op_hw_scan(struct ieee80211_hw *hw, static int wl1271_op_hw_scan(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
struct cfg80211_scan_request *req) struct cfg80211_scan_request *req)
{ {
struct wl1271 *wl = hw->priv; struct wl1271 *wl = hw->priv;
......
...@@ -1657,7 +1657,7 @@ struct ieee80211_ops { ...@@ -1657,7 +1657,7 @@ struct ieee80211_ops {
struct ieee80211_key_conf *conf, struct ieee80211_key_conf *conf,
struct ieee80211_sta *sta, struct ieee80211_sta *sta,
u32 iv32, u16 *phase1key); 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); struct cfg80211_scan_request *req);
void (*sw_scan_start)(struct ieee80211_hw *hw); void (*sw_scan_start)(struct ieee80211_hw *hw);
void (*sw_scan_complete)(struct ieee80211_hw *hw); void (*sw_scan_complete)(struct ieee80211_hw *hw);
......
...@@ -154,14 +154,15 @@ static inline void drv_update_tkip_key(struct ieee80211_local *local, ...@@ -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, static inline int drv_hw_scan(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
struct cfg80211_scan_request *req) struct cfg80211_scan_request *req)
{ {
int ret; int ret;
might_sleep(); might_sleep();
ret = local->ops->hw_scan(&local->hw, req); ret = local->ops->hw_scan(&local->hw, &sdata->vif, req);
trace_drv_hw_scan(local, req, ret); trace_drv_hw_scan(local, sdata, req, ret);
return ret; return ret;
} }
......
...@@ -363,23 +363,26 @@ TRACE_EVENT(drv_update_tkip_key, ...@@ -363,23 +363,26 @@ TRACE_EVENT(drv_update_tkip_key,
TRACE_EVENT(drv_hw_scan, TRACE_EVENT(drv_hw_scan,
TP_PROTO(struct ieee80211_local *local, TP_PROTO(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
struct cfg80211_scan_request *req, int ret), struct cfg80211_scan_request *req, int ret),
TP_ARGS(local, req, ret), TP_ARGS(local, sdata, req, ret),
TP_STRUCT__entry( TP_STRUCT__entry(
LOCAL_ENTRY LOCAL_ENTRY
VIF_ENTRY
__field(int, ret) __field(int, ret)
), ),
TP_fast_assign( TP_fast_assign(
LOCAL_ASSIGN; LOCAL_ASSIGN;
VIF_ASSIGN;
__entry->ret = ret; __entry->ret = ret;
), ),
TP_printk( TP_printk(
LOCAL_PR_FMT " ret:%d", LOCAL_PR_FMT VIF_PR_FMT " ret:%d",
LOCAL_PR_ARG, __entry->ret LOCAL_PR_ARG,VIF_PR_ARG, __entry->ret
) )
); );
......
...@@ -410,7 +410,7 @@ static int __ieee80211_start_scan(struct ieee80211_sub_if_data *sdata, ...@@ -410,7 +410,7 @@ static int __ieee80211_start_scan(struct ieee80211_sub_if_data *sdata,
if (local->ops->hw_scan) { if (local->ops->hw_scan) {
WARN_ON(!ieee80211_prep_hw_scan(local)); 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 } else
rc = ieee80211_start_sw_scan(local); rc = ieee80211_start_sw_scan(local);
...@@ -654,7 +654,7 @@ void ieee80211_scan_work(struct work_struct *work) ...@@ -654,7 +654,7 @@ void ieee80211_scan_work(struct work_struct *work)
} }
if (local->hw_scan_req) { 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); mutex_unlock(&local->scan_mtx);
if (rc) if (rc)
ieee80211_scan_completed(&local->hw, true); ieee80211_scan_completed(&local->hw, true);
......
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