aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/cfg.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211/cfg.c')
-rw-r--r--net/mac80211/cfg.c31
1 files changed, 28 insertions, 3 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index a1a1344c5c4b..c8d969be440b 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -1176,11 +1176,16 @@ static int ieee80211_set_channel(struct wiphy *wiphy,
1176 return ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_CHANNEL); 1176 return ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_CHANNEL);
1177} 1177}
1178 1178
1179static int set_mgmt_extra_ie_sta(struct ieee80211_if_sta *ifsta, u8 subtype, 1179static int set_mgmt_extra_ie_sta(struct ieee80211_sub_if_data *sdata,
1180 u8 *ies, size_t ies_len) 1180 u8 subtype, u8 *ies, size_t ies_len)
1181{ 1181{
1182 struct ieee80211_local *local = sdata->local;
1183 struct ieee80211_if_sta *ifsta = &sdata->u.sta;
1184
1182 switch (subtype) { 1185 switch (subtype) {
1183 case IEEE80211_STYPE_PROBE_REQ >> 4: 1186 case IEEE80211_STYPE_PROBE_REQ >> 4:
1187 if (local->ops->hw_scan)
1188 break;
1184 kfree(ifsta->ie_probereq); 1189 kfree(ifsta->ie_probereq);
1185 ifsta->ie_probereq = ies; 1190 ifsta->ie_probereq = ies;
1186 ifsta->ie_probereq_len = ies_len; 1191 ifsta->ie_probereq_len = ies_len;
@@ -1244,7 +1249,7 @@ static int ieee80211_set_mgmt_extra_ie(struct wiphy *wiphy,
1244 switch (sdata->vif.type) { 1249 switch (sdata->vif.type) {
1245 case NL80211_IFTYPE_STATION: 1250 case NL80211_IFTYPE_STATION:
1246 case NL80211_IFTYPE_ADHOC: 1251 case NL80211_IFTYPE_ADHOC:
1247 ret = set_mgmt_extra_ie_sta(&sdata->u.sta, params->subtype, 1252 ret = set_mgmt_extra_ie_sta(sdata, params->subtype,
1248 ies, ies_len); 1253 ies, ies_len);
1249 break; 1254 break;
1250 default: 1255 default:
@@ -1272,6 +1277,25 @@ static int ieee80211_resume(struct wiphy *wiphy)
1272#define ieee80211_resume NULL 1277#define ieee80211_resume NULL
1273#endif 1278#endif
1274 1279
1280static int ieee80211_scan(struct wiphy *wiphy,
1281 struct net_device *dev,
1282 struct cfg80211_scan_request *req)
1283{
1284 struct ieee80211_sub_if_data *sdata;
1285
1286 if (!netif_running(dev))
1287 return -ENETDOWN;
1288
1289 sdata = IEEE80211_DEV_TO_SUB_IF(dev);
1290
1291 if (sdata->vif.type != NL80211_IFTYPE_STATION &&
1292 sdata->vif.type != NL80211_IFTYPE_ADHOC &&
1293 sdata->vif.type != NL80211_IFTYPE_MESH_POINT)
1294 return -EOPNOTSUPP;
1295
1296 return ieee80211_request_scan(sdata, req);
1297}
1298
1275struct cfg80211_ops mac80211_config_ops = { 1299struct cfg80211_ops mac80211_config_ops = {
1276 .add_virtual_intf = ieee80211_add_iface, 1300 .add_virtual_intf = ieee80211_add_iface,
1277 .del_virtual_intf = ieee80211_del_iface, 1301 .del_virtual_intf = ieee80211_del_iface,
@@ -1304,4 +1328,5 @@ struct cfg80211_ops mac80211_config_ops = {
1304 .set_mgmt_extra_ie = ieee80211_set_mgmt_extra_ie, 1328 .set_mgmt_extra_ie = ieee80211_set_mgmt_extra_ie,
1305 .suspend = ieee80211_suspend, 1329 .suspend = ieee80211_suspend,
1306 .resume = ieee80211_resume, 1330 .resume = ieee80211_resume,
1331 .scan = ieee80211_scan,
1307}; 1332};