mac80211: add vif to testmode cmd

Pass the wdev from cfg80211 on to the driver as the vif
if given and it's valid for the driver.

Signed-off-by: David Spinadel <[email protected]>
Signed-off-by: Johannes Berg <[email protected]>
This commit is contained in:
David Spinadel 2013-07-31 18:06:22 +03:00 • committed by Johannes Berg
commit 52981cd794
5 changed files with 19 additions and 6 deletions

View file

@ -2305,11 +2305,20 @@ static int ieee80211_testmode_cmd(struct wiphy *wiphy,
void *data, int len)
{
struct ieee80211_local *local = wiphy_priv(wiphy);
struct ieee80211_vif *vif = NULL;
if (!local->ops->testmode_cmd)
return -EOPNOTSUPP;
return local->ops->testmode_cmd(&local->hw, data, len);
if (wdev) {
struct ieee80211_sub_if_data *sdata;
sdata = IEEE80211_WDEV_TO_SUB_IF(wdev);
if (sdata->flags & IEEE80211_SDATA_IN_DRIVER)
vif = &sdata->vif;
}
return local->ops->testmode_cmd(&local->hw, vif, data, len);
}
static int ieee80211_testmode_dump(struct wiphy *wiphy,