aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/cfg.c
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2012-06-22 14:39:53 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-06-22 14:39:53 -0400
commit133189a46c2c522eb4ef26b1ede63dd0a9fdc920 (patch)
tree04ab3567c3bea31503c4dfa94909f99dc4b3789f /net/mac80211/cfg.c
parentf761b6947dde42890beea59b020e1be87491809e (diff)
parent0f6b3f597daab2254614e2773e322e73fb1b6f4b (diff)
Merge branch 'for-john' of git://git.sipsolutions.net/mac80211-next
Diffstat (limited to 'net/mac80211/cfg.c')
-rw-r--r--net/mac80211/cfg.c75
1 files changed, 60 insertions, 15 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 85ac364f4636..d197dbeef9ce 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -689,7 +689,8 @@ static int ieee80211_set_channel(struct wiphy *wiphy,
689 case CHAN_MODE_HOPPING: 689 case CHAN_MODE_HOPPING:
690 return -EBUSY; 690 return -EBUSY;
691 case CHAN_MODE_FIXED: 691 case CHAN_MODE_FIXED:
692 if (local->oper_channel != chan) 692 if (local->oper_channel != chan ||
693 (!sdata && local->_oper_channel_type != channel_type))
693 return -EBUSY; 694 return -EBUSY;
694 if (!sdata && local->_oper_channel_type == channel_type) 695 if (!sdata && local->_oper_channel_type == channel_type)
695 return 0; 696 return 0;
@@ -1529,7 +1530,7 @@ static int ieee80211_update_mesh_config(struct wiphy *wiphy,
1529 if (_chg_mesh_attr(NL80211_MESHCONF_TTL, mask)) 1530 if (_chg_mesh_attr(NL80211_MESHCONF_TTL, mask))
1530 conf->dot11MeshTTL = nconf->dot11MeshTTL; 1531 conf->dot11MeshTTL = nconf->dot11MeshTTL;
1531 if (_chg_mesh_attr(NL80211_MESHCONF_ELEMENT_TTL, mask)) 1532 if (_chg_mesh_attr(NL80211_MESHCONF_ELEMENT_TTL, mask))
1532 conf->dot11MeshTTL = nconf->element_ttl; 1533 conf->element_ttl = nconf->element_ttl;
1533 if (_chg_mesh_attr(NL80211_MESHCONF_AUTO_OPEN_PLINKS, mask)) 1534 if (_chg_mesh_attr(NL80211_MESHCONF_AUTO_OPEN_PLINKS, mask))
1534 conf->auto_open_plinks = nconf->auto_open_plinks; 1535 conf->auto_open_plinks = nconf->auto_open_plinks;
1535 if (_chg_mesh_attr(NL80211_MESHCONF_SYNC_OFFSET_MAX_NEIGHBOR, mask)) 1536 if (_chg_mesh_attr(NL80211_MESHCONF_SYNC_OFFSET_MAX_NEIGHBOR, mask))
@@ -1564,17 +1565,16 @@ static int ieee80211_update_mesh_config(struct wiphy *wiphy,
1564 * announcements, so require this ifmsh to also be a root node 1565 * announcements, so require this ifmsh to also be a root node
1565 * */ 1566 * */
1566 if (nconf->dot11MeshGateAnnouncementProtocol && 1567 if (nconf->dot11MeshGateAnnouncementProtocol &&
1567 !conf->dot11MeshHWMPRootMode) { 1568 !(conf->dot11MeshHWMPRootMode > IEEE80211_ROOTMODE_ROOT)) {
1568 conf->dot11MeshHWMPRootMode = 1; 1569 conf->dot11MeshHWMPRootMode = IEEE80211_PROACTIVE_RANN;
1569 ieee80211_mesh_root_setup(ifmsh); 1570 ieee80211_mesh_root_setup(ifmsh);
1570 } 1571 }
1571 conf->dot11MeshGateAnnouncementProtocol = 1572 conf->dot11MeshGateAnnouncementProtocol =
1572 nconf->dot11MeshGateAnnouncementProtocol; 1573 nconf->dot11MeshGateAnnouncementProtocol;
1573 } 1574 }
1574 if (_chg_mesh_attr(NL80211_MESHCONF_HWMP_RANN_INTERVAL, mask)) { 1575 if (_chg_mesh_attr(NL80211_MESHCONF_HWMP_RANN_INTERVAL, mask))
1575 conf->dot11MeshHWMPRannInterval = 1576 conf->dot11MeshHWMPRannInterval =
1576 nconf->dot11MeshHWMPRannInterval; 1577 nconf->dot11MeshHWMPRannInterval;
1577 }
1578 if (_chg_mesh_attr(NL80211_MESHCONF_FORWARDING, mask)) 1578 if (_chg_mesh_attr(NL80211_MESHCONF_FORWARDING, mask))
1579 conf->dot11MeshForwarding = nconf->dot11MeshForwarding; 1579 conf->dot11MeshForwarding = nconf->dot11MeshForwarding;
1580 if (_chg_mesh_attr(NL80211_MESHCONF_RSSI_THRESHOLD, mask)) { 1580 if (_chg_mesh_attr(NL80211_MESHCONF_RSSI_THRESHOLD, mask)) {
@@ -1590,6 +1590,15 @@ static int ieee80211_update_mesh_config(struct wiphy *wiphy,
1590 sdata->vif.bss_conf.ht_operation_mode = nconf->ht_opmode; 1590 sdata->vif.bss_conf.ht_operation_mode = nconf->ht_opmode;
1591 ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_HT); 1591 ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_HT);
1592 } 1592 }
1593 if (_chg_mesh_attr(NL80211_MESHCONF_HWMP_PATH_TO_ROOT_TIMEOUT, mask))
1594 conf->dot11MeshHWMPactivePathToRootTimeout =
1595 nconf->dot11MeshHWMPactivePathToRootTimeout;
1596 if (_chg_mesh_attr(NL80211_MESHCONF_HWMP_ROOT_INTERVAL, mask))
1597 conf->dot11MeshHWMProotInterval =
1598 nconf->dot11MeshHWMProotInterval;
1599 if (_chg_mesh_attr(NL80211_MESHCONF_HWMP_CONFIRMATION_INTERVAL, mask))
1600 conf->dot11MeshHWMPconfirmationInterval =
1601 nconf->dot11MeshHWMPconfirmationInterval;
1593 return 0; 1602 return 0;
1594} 1603}
1595 1604
@@ -2309,6 +2318,21 @@ static int ieee80211_cancel_roc(struct ieee80211_local *local,
2309 2318
2310 mutex_lock(&local->mtx); 2319 mutex_lock(&local->mtx);
2311 list_for_each_entry_safe(roc, tmp, &local->roc_list, list) { 2320 list_for_each_entry_safe(roc, tmp, &local->roc_list, list) {
2321 struct ieee80211_roc_work *dep, *tmp2;
2322
2323 list_for_each_entry_safe(dep, tmp2, &roc->dependents, list) {
2324 if (!mgmt_tx && (unsigned long)dep != cookie)
2325 continue;
2326 else if (mgmt_tx && dep->mgmt_tx_cookie != cookie)
2327 continue;
2328 /* found dependent item -- just remove it */
2329 list_del(&dep->list);
2330 mutex_unlock(&local->mtx);
2331
2332 ieee80211_roc_notify_destroy(dep);
2333 return 0;
2334 }
2335
2312 if (!mgmt_tx && (unsigned long)roc != cookie) 2336 if (!mgmt_tx && (unsigned long)roc != cookie)
2313 continue; 2337 continue;
2314 else if (mgmt_tx && roc->mgmt_tx_cookie != cookie) 2338 else if (mgmt_tx && roc->mgmt_tx_cookie != cookie)
@@ -2323,6 +2347,13 @@ static int ieee80211_cancel_roc(struct ieee80211_local *local,
2323 return -ENOENT; 2347 return -ENOENT;
2324 } 2348 }
2325 2349
2350 /*
2351 * We found the item to cancel, so do that. Note that it
2352 * may have dependents, which we also cancel (and send
2353 * the expired signal for.) Not doing so would be quite
2354 * tricky here, but we may need to fix it later.
2355 */
2356
2326 if (local->ops->remain_on_channel) { 2357 if (local->ops->remain_on_channel) {
2327 if (found->started) { 2358 if (found->started) {
2328 ret = drv_cancel_remain_on_channel(local); 2359 ret = drv_cancel_remain_on_channel(local);
@@ -2334,8 +2365,8 @@ static int ieee80211_cancel_roc(struct ieee80211_local *local,
2334 2365
2335 list_del(&found->list); 2366 list_del(&found->list);
2336 2367
2337 ieee80211_run_deferred_scan(local); 2368 if (found->started)
2338 ieee80211_start_next_roc(local); 2369 ieee80211_start_next_roc(local);
2339 mutex_unlock(&local->mtx); 2370 mutex_unlock(&local->mtx);
2340 2371
2341 ieee80211_roc_notify_destroy(found); 2372 ieee80211_roc_notify_destroy(found);
@@ -2489,16 +2520,30 @@ static void ieee80211_mgmt_frame_register(struct wiphy *wiphy,
2489 u16 frame_type, bool reg) 2520 u16 frame_type, bool reg)
2490{ 2521{
2491 struct ieee80211_local *local = wiphy_priv(wiphy); 2522 struct ieee80211_local *local = wiphy_priv(wiphy);
2523 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
2492 2524
2493 if (frame_type != (IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_PROBE_REQ)) 2525 switch (frame_type) {
2494 return; 2526 case IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_AUTH:
2527 if (sdata->vif.type == NL80211_IFTYPE_ADHOC) {
2528 struct ieee80211_if_ibss *ifibss = &sdata->u.ibss;
2495 2529
2496 if (reg) 2530 if (reg)
2497 local->probe_req_reg++; 2531 ifibss->auth_frame_registrations++;
2498 else 2532 else
2499 local->probe_req_reg--; 2533 ifibss->auth_frame_registrations--;
2534 }
2535 break;
2536 case IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_PROBE_REQ:
2537 if (reg)
2538 local->probe_req_reg++;
2539 else
2540 local->probe_req_reg--;
2500 2541
2501 ieee80211_queue_work(&local->hw, &local->reconfig_filter); 2542 ieee80211_queue_work(&local->hw, &local->reconfig_filter);
2543 break;
2544 default:
2545 break;
2546 }
2502} 2547}
2503 2548
2504static int ieee80211_set_antenna(struct wiphy *wiphy, u32 tx_ant, u32 rx_ant) 2549static int ieee80211_set_antenna(struct wiphy *wiphy, u32 tx_ant, u32 rx_ant)