diff options
Diffstat (limited to 'net/mac80211/mesh_plink.c')
| -rw-r--r-- | net/mac80211/mesh_plink.c | 130 |
1 files changed, 82 insertions, 48 deletions
diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c index ea13a80a476c..f4adc0917888 100644 --- a/net/mac80211/mesh_plink.c +++ b/net/mac80211/mesh_plink.c | |||
| @@ -43,7 +43,7 @@ | |||
| 43 | #define dot11MeshMaxPeerLinks(s) (s->u.mesh.mshcfg.dot11MeshMaxPeerLinks) | 43 | #define dot11MeshMaxPeerLinks(s) (s->u.mesh.mshcfg.dot11MeshMaxPeerLinks) |
| 44 | 44 | ||
| 45 | enum plink_frame_type { | 45 | enum plink_frame_type { |
| 46 | PLINK_OPEN = 0, | 46 | PLINK_OPEN = 1, |
| 47 | PLINK_CONFIRM, | 47 | PLINK_CONFIRM, |
| 48 | PLINK_CLOSE | 48 | PLINK_CLOSE |
| 49 | }; | 49 | }; |
| @@ -83,7 +83,7 @@ void mesh_plink_dec_estab_count(struct ieee80211_sub_if_data *sdata) | |||
| 83 | */ | 83 | */ |
| 84 | static inline void mesh_plink_fsm_restart(struct sta_info *sta) | 84 | static inline void mesh_plink_fsm_restart(struct sta_info *sta) |
| 85 | { | 85 | { |
| 86 | sta->plink_state = PLINK_LISTEN; | 86 | sta->plink_state = NL80211_PLINK_LISTEN; |
| 87 | sta->llid = sta->plid = sta->reason = 0; | 87 | sta->llid = sta->plid = sta->reason = 0; |
| 88 | sta->plink_retries = 0; | 88 | sta->plink_retries = 0; |
| 89 | } | 89 | } |
| @@ -105,7 +105,7 @@ static struct sta_info *mesh_plink_alloc(struct ieee80211_sub_if_data *sdata, | |||
| 105 | if (!sta) | 105 | if (!sta) |
| 106 | return NULL; | 106 | return NULL; |
| 107 | 107 | ||
| 108 | sta->flags = WLAN_STA_AUTHORIZED; | 108 | sta->flags = WLAN_STA_AUTHORIZED | WLAN_STA_AUTH; |
| 109 | sta->sta.supp_rates[local->hw.conf.channel->band] = rates; | 109 | sta->sta.supp_rates[local->hw.conf.channel->band] = rates; |
| 110 | rate_control_rate_init(sta); | 110 | rate_control_rate_init(sta); |
| 111 | 111 | ||
| @@ -126,11 +126,11 @@ static bool __mesh_plink_deactivate(struct sta_info *sta) | |||
| 126 | struct ieee80211_sub_if_data *sdata = sta->sdata; | 126 | struct ieee80211_sub_if_data *sdata = sta->sdata; |
| 127 | bool deactivated = false; | 127 | bool deactivated = false; |
| 128 | 128 | ||
| 129 | if (sta->plink_state == PLINK_ESTAB) { | 129 | if (sta->plink_state == NL80211_PLINK_ESTAB) { |
| 130 | mesh_plink_dec_estab_count(sdata); | 130 | mesh_plink_dec_estab_count(sdata); |
| 131 | deactivated = true; | 131 | deactivated = true; |
| 132 | } | 132 | } |
| 133 | sta->plink_state = PLINK_BLOCKED; | 133 | sta->plink_state = NL80211_PLINK_BLOCKED; |
| 134 | mesh_path_flush_by_nexthop(sta); | 134 | mesh_path_flush_by_nexthop(sta); |
| 135 | 135 | ||
| 136 | return deactivated; | 136 | return deactivated; |
| @@ -160,7 +160,8 @@ static int mesh_plink_frame_tx(struct ieee80211_sub_if_data *sdata, | |||
| 160 | enum plink_frame_type action, u8 *da, __le16 llid, __le16 plid, | 160 | enum plink_frame_type action, u8 *da, __le16 llid, __le16 plid, |
| 161 | __le16 reason) { | 161 | __le16 reason) { |
| 162 | struct ieee80211_local *local = sdata->local; | 162 | struct ieee80211_local *local = sdata->local; |
| 163 | struct sk_buff *skb = dev_alloc_skb(local->hw.extra_tx_headroom + 400); | 163 | struct sk_buff *skb = dev_alloc_skb(local->hw.extra_tx_headroom + 400 + |
| 164 | sdata->u.mesh.ie_len); | ||
| 164 | struct ieee80211_mgmt *mgmt; | 165 | struct ieee80211_mgmt *mgmt; |
| 165 | bool include_plid = false; | 166 | bool include_plid = false; |
| 166 | static const u8 meshpeeringproto[] = { 0x00, 0x0F, 0xAC, 0x2A }; | 167 | static const u8 meshpeeringproto[] = { 0x00, 0x0F, 0xAC, 0x2A }; |
| @@ -180,8 +181,8 @@ static int mesh_plink_frame_tx(struct ieee80211_sub_if_data *sdata, | |||
| 180 | IEEE80211_STYPE_ACTION); | 181 | IEEE80211_STYPE_ACTION); |
| 181 | memcpy(mgmt->da, da, ETH_ALEN); | 182 | memcpy(mgmt->da, da, ETH_ALEN); |
| 182 | memcpy(mgmt->sa, sdata->vif.addr, ETH_ALEN); | 183 | memcpy(mgmt->sa, sdata->vif.addr, ETH_ALEN); |
| 183 | /* BSSID is left zeroed, wildcard value */ | 184 | memcpy(mgmt->bssid, sdata->vif.addr, ETH_ALEN); |
| 184 | mgmt->u.action.category = WLAN_CATEGORY_MESH_PLINK; | 185 | mgmt->u.action.category = WLAN_CATEGORY_MESH_ACTION; |
| 185 | mgmt->u.action.u.plink_action.action_code = action; | 186 | mgmt->u.action.u.plink_action.action_code = action; |
| 186 | 187 | ||
| 187 | if (action == PLINK_CLOSE) | 188 | if (action == PLINK_CLOSE) |
| @@ -236,8 +237,9 @@ static int mesh_plink_frame_tx(struct ieee80211_sub_if_data *sdata, | |||
| 236 | return 0; | 237 | return 0; |
| 237 | } | 238 | } |
| 238 | 239 | ||
| 239 | void mesh_neighbour_update(u8 *hw_addr, u32 rates, struct ieee80211_sub_if_data *sdata, | 240 | void mesh_neighbour_update(u8 *hw_addr, u32 rates, |
| 240 | bool peer_accepting_plinks) | 241 | struct ieee80211_sub_if_data *sdata, |
| 242 | struct ieee802_11_elems *elems) | ||
| 241 | { | 243 | { |
| 242 | struct ieee80211_local *local = sdata->local; | 244 | struct ieee80211_local *local = sdata->local; |
| 243 | struct sta_info *sta; | 245 | struct sta_info *sta; |
| @@ -247,8 +249,14 @@ void mesh_neighbour_update(u8 *hw_addr, u32 rates, struct ieee80211_sub_if_data | |||
| 247 | sta = sta_info_get(sdata, hw_addr); | 249 | sta = sta_info_get(sdata, hw_addr); |
| 248 | if (!sta) { | 250 | if (!sta) { |
| 249 | rcu_read_unlock(); | 251 | rcu_read_unlock(); |
| 250 | 252 | /* Userspace handles peer allocation when security is enabled | |
| 251 | sta = mesh_plink_alloc(sdata, hw_addr, rates); | 253 | * */ |
| 254 | if (sdata->u.mesh.security & IEEE80211_MESH_SEC_AUTHED) | ||
| 255 | cfg80211_notify_new_peer_candidate(sdata->dev, hw_addr, | ||
| 256 | elems->ie_start, elems->total_len, | ||
| 257 | GFP_KERNEL); | ||
| 258 | else | ||
| 259 | sta = mesh_plink_alloc(sdata, hw_addr, rates); | ||
| 252 | if (!sta) | 260 | if (!sta) |
| 253 | return; | 261 | return; |
| 254 | if (sta_info_insert_rcu(sta)) { | 262 | if (sta_info_insert_rcu(sta)) { |
| @@ -259,7 +267,8 @@ void mesh_neighbour_update(u8 *hw_addr, u32 rates, struct ieee80211_sub_if_data | |||
| 259 | 267 | ||
| 260 | sta->last_rx = jiffies; | 268 | sta->last_rx = jiffies; |
| 261 | sta->sta.supp_rates[local->hw.conf.channel->band] = rates; | 269 | sta->sta.supp_rates[local->hw.conf.channel->band] = rates; |
| 262 | if (peer_accepting_plinks && sta->plink_state == PLINK_LISTEN && | 270 | if (mesh_peer_accepts_plinks(elems) && |
| 271 | sta->plink_state == NL80211_PLINK_LISTEN && | ||
| 263 | sdata->u.mesh.accepting_plinks && | 272 | sdata->u.mesh.accepting_plinks && |
| 264 | sdata->u.mesh.mshcfg.auto_open_plinks) | 273 | sdata->u.mesh.mshcfg.auto_open_plinks) |
| 265 | mesh_plink_open(sta); | 274 | mesh_plink_open(sta); |
| @@ -299,8 +308,8 @@ static void mesh_plink_timer(unsigned long data) | |||
| 299 | sdata = sta->sdata; | 308 | sdata = sta->sdata; |
| 300 | 309 | ||
| 301 | switch (sta->plink_state) { | 310 | switch (sta->plink_state) { |
| 302 | case PLINK_OPN_RCVD: | 311 | case NL80211_PLINK_OPN_RCVD: |
| 303 | case PLINK_OPN_SNT: | 312 | case NL80211_PLINK_OPN_SNT: |
| 304 | /* retry timer */ | 313 | /* retry timer */ |
| 305 | if (sta->plink_retries < dot11MeshMaxRetries(sdata)) { | 314 | if (sta->plink_retries < dot11MeshMaxRetries(sdata)) { |
| 306 | u32 rand; | 315 | u32 rand; |
| @@ -319,17 +328,17 @@ static void mesh_plink_timer(unsigned long data) | |||
| 319 | } | 328 | } |
| 320 | reason = cpu_to_le16(MESH_MAX_RETRIES); | 329 | reason = cpu_to_le16(MESH_MAX_RETRIES); |
| 321 | /* fall through on else */ | 330 | /* fall through on else */ |
| 322 | case PLINK_CNF_RCVD: | 331 | case NL80211_PLINK_CNF_RCVD: |
| 323 | /* confirm timer */ | 332 | /* confirm timer */ |
| 324 | if (!reason) | 333 | if (!reason) |
| 325 | reason = cpu_to_le16(MESH_CONFIRM_TIMEOUT); | 334 | reason = cpu_to_le16(MESH_CONFIRM_TIMEOUT); |
| 326 | sta->plink_state = PLINK_HOLDING; | 335 | sta->plink_state = NL80211_PLINK_HOLDING; |
| 327 | mod_plink_timer(sta, dot11MeshHoldingTimeout(sdata)); | 336 | mod_plink_timer(sta, dot11MeshHoldingTimeout(sdata)); |
| 328 | spin_unlock_bh(&sta->lock); | 337 | spin_unlock_bh(&sta->lock); |
| 329 | mesh_plink_frame_tx(sdata, PLINK_CLOSE, sta->sta.addr, llid, plid, | 338 | mesh_plink_frame_tx(sdata, PLINK_CLOSE, sta->sta.addr, llid, plid, |
| 330 | reason); | 339 | reason); |
| 331 | break; | 340 | break; |
| 332 | case PLINK_HOLDING: | 341 | case NL80211_PLINK_HOLDING: |
| 333 | /* holding timer */ | 342 | /* holding timer */ |
| 334 | del_timer(&sta->plink_timer); | 343 | del_timer(&sta->plink_timer); |
| 335 | mesh_plink_fsm_restart(sta); | 344 | mesh_plink_fsm_restart(sta); |
| @@ -371,14 +380,17 @@ int mesh_plink_open(struct sta_info *sta) | |||
| 371 | __le16 llid; | 380 | __le16 llid; |
| 372 | struct ieee80211_sub_if_data *sdata = sta->sdata; | 381 | struct ieee80211_sub_if_data *sdata = sta->sdata; |
| 373 | 382 | ||
| 383 | if (!test_sta_flags(sta, WLAN_STA_AUTH)) | ||
| 384 | return -EPERM; | ||
| 385 | |||
| 374 | spin_lock_bh(&sta->lock); | 386 | spin_lock_bh(&sta->lock); |
| 375 | get_random_bytes(&llid, 2); | 387 | get_random_bytes(&llid, 2); |
| 376 | sta->llid = llid; | 388 | sta->llid = llid; |
| 377 | if (sta->plink_state != PLINK_LISTEN) { | 389 | if (sta->plink_state != NL80211_PLINK_LISTEN) { |
| 378 | spin_unlock_bh(&sta->lock); | 390 | spin_unlock_bh(&sta->lock); |
| 379 | return -EBUSY; | 391 | return -EBUSY; |
| 380 | } | 392 | } |
| 381 | sta->plink_state = PLINK_OPN_SNT; | 393 | sta->plink_state = NL80211_PLINK_OPN_SNT; |
| 382 | mesh_plink_timer_set(sta, dot11MeshRetryTimeout(sdata)); | 394 | mesh_plink_timer_set(sta, dot11MeshRetryTimeout(sdata)); |
| 383 | spin_unlock_bh(&sta->lock); | 395 | spin_unlock_bh(&sta->lock); |
| 384 | mpl_dbg("Mesh plink: starting establishment with %pM\n", | 396 | mpl_dbg("Mesh plink: starting establishment with %pM\n", |
| @@ -395,7 +407,7 @@ void mesh_plink_block(struct sta_info *sta) | |||
| 395 | 407 | ||
| 396 | spin_lock_bh(&sta->lock); | 408 | spin_lock_bh(&sta->lock); |
| 397 | deactivated = __mesh_plink_deactivate(sta); | 409 | deactivated = __mesh_plink_deactivate(sta); |
| 398 | sta->plink_state = PLINK_BLOCKED; | 410 | sta->plink_state = NL80211_PLINK_BLOCKED; |
| 399 | spin_unlock_bh(&sta->lock); | 411 | spin_unlock_bh(&sta->lock); |
| 400 | 412 | ||
| 401 | if (deactivated) | 413 | if (deactivated) |
| @@ -412,19 +424,19 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m | |||
| 412 | enum plink_event event; | 424 | enum plink_event event; |
| 413 | enum plink_frame_type ftype; | 425 | enum plink_frame_type ftype; |
| 414 | size_t baselen; | 426 | size_t baselen; |
| 415 | bool deactivated; | 427 | bool deactivated, matches_local = true; |
| 416 | u8 ie_len; | 428 | u8 ie_len; |
| 417 | u8 *baseaddr; | 429 | u8 *baseaddr; |
| 418 | __le16 plid, llid, reason; | 430 | __le16 plid, llid, reason; |
| 419 | #ifdef CONFIG_MAC80211_VERBOSE_MPL_DEBUG | 431 | #ifdef CONFIG_MAC80211_VERBOSE_MPL_DEBUG |
| 420 | static const char *mplstates[] = { | 432 | static const char *mplstates[] = { |
| 421 | [PLINK_LISTEN] = "LISTEN", | 433 | [NL80211_PLINK_LISTEN] = "LISTEN", |
| 422 | [PLINK_OPN_SNT] = "OPN-SNT", | 434 | [NL80211_PLINK_OPN_SNT] = "OPN-SNT", |
| 423 | [PLINK_OPN_RCVD] = "OPN-RCVD", | 435 | [NL80211_PLINK_OPN_RCVD] = "OPN-RCVD", |
| 424 | [PLINK_CNF_RCVD] = "CNF_RCVD", | 436 | [NL80211_PLINK_CNF_RCVD] = "CNF_RCVD", |
| 425 | [PLINK_ESTAB] = "ESTAB", | 437 | [NL80211_PLINK_ESTAB] = "ESTAB", |
| 426 | [PLINK_HOLDING] = "HOLDING", | 438 | [NL80211_PLINK_HOLDING] = "HOLDING", |
| 427 | [PLINK_BLOCKED] = "BLOCKED" | 439 | [NL80211_PLINK_BLOCKED] = "BLOCKED" |
| 428 | }; | 440 | }; |
| 429 | #endif | 441 | #endif |
| 430 | 442 | ||
| @@ -448,6 +460,11 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m | |||
| 448 | mpl_dbg("Mesh plink: missing necessary peer link ie\n"); | 460 | mpl_dbg("Mesh plink: missing necessary peer link ie\n"); |
| 449 | return; | 461 | return; |
| 450 | } | 462 | } |
| 463 | if (elems.rsn_len && | ||
| 464 | sdata->u.mesh.security == IEEE80211_MESH_SEC_NONE) { | ||
| 465 | mpl_dbg("Mesh plink: can't establish link with secure peer\n"); | ||
| 466 | return; | ||
| 467 | } | ||
| 451 | 468 | ||
| 452 | ftype = mgmt->u.action.u.plink_action.action_code; | 469 | ftype = mgmt->u.action.u.plink_action.action_code; |
| 453 | ie_len = elems.peer_link_len; | 470 | ie_len = elems.peer_link_len; |
| @@ -479,7 +496,13 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m | |||
| 479 | return; | 496 | return; |
| 480 | } | 497 | } |
| 481 | 498 | ||
| 482 | if (sta && sta->plink_state == PLINK_BLOCKED) { | 499 | if (sta && !test_sta_flags(sta, WLAN_STA_AUTH)) { |
| 500 | mpl_dbg("Mesh plink: Action frame from non-authed peer\n"); | ||
| 501 | rcu_read_unlock(); | ||
| 502 | return; | ||
| 503 | } | ||
| 504 | |||
| 505 | if (sta && sta->plink_state == NL80211_PLINK_BLOCKED) { | ||
| 483 | rcu_read_unlock(); | 506 | rcu_read_unlock(); |
| 484 | return; | 507 | return; |
| 485 | } | 508 | } |
| @@ -487,6 +510,7 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m | |||
| 487 | /* Now we will figure out the appropriate event... */ | 510 | /* Now we will figure out the appropriate event... */ |
| 488 | event = PLINK_UNDEFINED; | 511 | event = PLINK_UNDEFINED; |
| 489 | if (ftype != PLINK_CLOSE && (!mesh_matches_local(&elems, sdata))) { | 512 | if (ftype != PLINK_CLOSE && (!mesh_matches_local(&elems, sdata))) { |
| 513 | matches_local = false; | ||
| 490 | switch (ftype) { | 514 | switch (ftype) { |
| 491 | case PLINK_OPEN: | 515 | case PLINK_OPEN: |
| 492 | event = OPN_RJCT; | 516 | event = OPN_RJCT; |
| @@ -498,7 +522,15 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m | |||
| 498 | /* avoid warning */ | 522 | /* avoid warning */ |
| 499 | break; | 523 | break; |
| 500 | } | 524 | } |
| 501 | spin_lock_bh(&sta->lock); | 525 | } |
| 526 | |||
| 527 | if (!sta && !matches_local) { | ||
| 528 | rcu_read_unlock(); | ||
| 529 | reason = cpu_to_le16(MESH_CAPABILITY_POLICY_VIOLATION); | ||
| 530 | llid = 0; | ||
| 531 | mesh_plink_frame_tx(sdata, PLINK_CLOSE, mgmt->sa, llid, | ||
| 532 | plid, reason); | ||
| 533 | return; | ||
| 502 | } else if (!sta) { | 534 | } else if (!sta) { |
| 503 | /* ftype == PLINK_OPEN */ | 535 | /* ftype == PLINK_OPEN */ |
| 504 | u32 rates; | 536 | u32 rates; |
| @@ -522,7 +554,7 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m | |||
| 522 | } | 554 | } |
| 523 | event = OPN_ACPT; | 555 | event = OPN_ACPT; |
| 524 | spin_lock_bh(&sta->lock); | 556 | spin_lock_bh(&sta->lock); |
| 525 | } else { | 557 | } else if (matches_local) { |
| 526 | spin_lock_bh(&sta->lock); | 558 | spin_lock_bh(&sta->lock); |
| 527 | switch (ftype) { | 559 | switch (ftype) { |
| 528 | case PLINK_OPEN: | 560 | case PLINK_OPEN: |
| @@ -540,7 +572,7 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m | |||
| 540 | event = CNF_ACPT; | 572 | event = CNF_ACPT; |
| 541 | break; | 573 | break; |
| 542 | case PLINK_CLOSE: | 574 | case PLINK_CLOSE: |
| 543 | if (sta->plink_state == PLINK_ESTAB) | 575 | if (sta->plink_state == NL80211_PLINK_ESTAB) |
| 544 | /* Do not check for llid or plid. This does not | 576 | /* Do not check for llid or plid. This does not |
| 545 | * follow the standard but since multiple plinks | 577 | * follow the standard but since multiple plinks |
| 546 | * per sta are not supported, it is necessary in | 578 | * per sta are not supported, it is necessary in |
| @@ -564,6 +596,8 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m | |||
| 564 | rcu_read_unlock(); | 596 | rcu_read_unlock(); |
| 565 | return; | 597 | return; |
| 566 | } | 598 | } |
| 599 | } else { | ||
| 600 | spin_lock_bh(&sta->lock); | ||
| 567 | } | 601 | } |
| 568 | 602 | ||
| 569 | mpl_dbg("Mesh plink (peer, state, llid, plid, event): %pM %s %d %d %d\n", | 603 | mpl_dbg("Mesh plink (peer, state, llid, plid, event): %pM %s %d %d %d\n", |
| @@ -573,14 +607,14 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m | |||
| 573 | reason = 0; | 607 | reason = 0; |
| 574 | switch (sta->plink_state) { | 608 | switch (sta->plink_state) { |
| 575 | /* spin_unlock as soon as state is updated at each case */ | 609 | /* spin_unlock as soon as state is updated at each case */ |
| 576 | case PLINK_LISTEN: | 610 | case NL80211_PLINK_LISTEN: |
| 577 | switch (event) { | 611 | switch (event) { |
| 578 | case CLS_ACPT: | 612 | case CLS_ACPT: |
| 579 | mesh_plink_fsm_restart(sta); | 613 | mesh_plink_fsm_restart(sta); |
| 580 | spin_unlock_bh(&sta->lock); | 614 | spin_unlock_bh(&sta->lock); |
| 581 | break; | 615 | break; |
| 582 | case OPN_ACPT: | 616 | case OPN_ACPT: |
| 583 | sta->plink_state = PLINK_OPN_RCVD; | 617 | sta->plink_state = NL80211_PLINK_OPN_RCVD; |
| 584 | sta->plid = plid; | 618 | sta->plid = plid; |
| 585 | get_random_bytes(&llid, 2); | 619 | get_random_bytes(&llid, 2); |
| 586 | sta->llid = llid; | 620 | sta->llid = llid; |
| @@ -597,7 +631,7 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m | |||
| 597 | } | 631 | } |
| 598 | break; | 632 | break; |
| 599 | 633 | ||
| 600 | case PLINK_OPN_SNT: | 634 | case NL80211_PLINK_OPN_SNT: |
| 601 | switch (event) { | 635 | switch (event) { |
| 602 | case OPN_RJCT: | 636 | case OPN_RJCT: |
| 603 | case CNF_RJCT: | 637 | case CNF_RJCT: |
| @@ -606,7 +640,7 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m | |||
| 606 | if (!reason) | 640 | if (!reason) |
| 607 | reason = cpu_to_le16(MESH_CLOSE_RCVD); | 641 | reason = cpu_to_le16(MESH_CLOSE_RCVD); |
| 608 | sta->reason = reason; | 642 | sta->reason = reason; |
| 609 | sta->plink_state = PLINK_HOLDING; | 643 | sta->plink_state = NL80211_PLINK_HOLDING; |
| 610 | if (!mod_plink_timer(sta, | 644 | if (!mod_plink_timer(sta, |
| 611 | dot11MeshHoldingTimeout(sdata))) | 645 | dot11MeshHoldingTimeout(sdata))) |
| 612 | sta->ignore_plink_timer = true; | 646 | sta->ignore_plink_timer = true; |
| @@ -618,7 +652,7 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m | |||
| 618 | break; | 652 | break; |
| 619 | case OPN_ACPT: | 653 | case OPN_ACPT: |
| 620 | /* retry timer is left untouched */ | 654 | /* retry timer is left untouched */ |
| 621 | sta->plink_state = PLINK_OPN_RCVD; | 655 | sta->plink_state = NL80211_PLINK_OPN_RCVD; |
| 622 | sta->plid = plid; | 656 | sta->plid = plid; |
| 623 | llid = sta->llid; | 657 | llid = sta->llid; |
| 624 | spin_unlock_bh(&sta->lock); | 658 | spin_unlock_bh(&sta->lock); |
| @@ -626,7 +660,7 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m | |||
| 626 | plid, 0); | 660 | plid, 0); |
| 627 | break; | 661 | break; |
| 628 | case CNF_ACPT: | 662 | case CNF_ACPT: |
| 629 | sta->plink_state = PLINK_CNF_RCVD; | 663 | sta->plink_state = NL80211_PLINK_CNF_RCVD; |
| 630 | if (!mod_plink_timer(sta, | 664 | if (!mod_plink_timer(sta, |
| 631 | dot11MeshConfirmTimeout(sdata))) | 665 | dot11MeshConfirmTimeout(sdata))) |
| 632 | sta->ignore_plink_timer = true; | 666 | sta->ignore_plink_timer = true; |
| @@ -639,7 +673,7 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m | |||
| 639 | } | 673 | } |
| 640 | break; | 674 | break; |
| 641 | 675 | ||
| 642 | case PLINK_OPN_RCVD: | 676 | case NL80211_PLINK_OPN_RCVD: |
| 643 | switch (event) { | 677 | switch (event) { |
| 644 | case OPN_RJCT: | 678 | case OPN_RJCT: |
| 645 | case CNF_RJCT: | 679 | case CNF_RJCT: |
| @@ -648,7 +682,7 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m | |||
| 648 | if (!reason) | 682 | if (!reason) |
| 649 | reason = cpu_to_le16(MESH_CLOSE_RCVD); | 683 | reason = cpu_to_le16(MESH_CLOSE_RCVD); |
| 650 | sta->reason = reason; | 684 | sta->reason = reason; |
| 651 | sta->plink_state = PLINK_HOLDING; | 685 | sta->plink_state = NL80211_PLINK_HOLDING; |
| 652 | if (!mod_plink_timer(sta, | 686 | if (!mod_plink_timer(sta, |
| 653 | dot11MeshHoldingTimeout(sdata))) | 687 | dot11MeshHoldingTimeout(sdata))) |
| 654 | sta->ignore_plink_timer = true; | 688 | sta->ignore_plink_timer = true; |
| @@ -666,7 +700,7 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m | |||
| 666 | break; | 700 | break; |
| 667 | case CNF_ACPT: | 701 | case CNF_ACPT: |
| 668 | del_timer(&sta->plink_timer); | 702 | del_timer(&sta->plink_timer); |
| 669 | sta->plink_state = PLINK_ESTAB; | 703 | sta->plink_state = NL80211_PLINK_ESTAB; |
| 670 | spin_unlock_bh(&sta->lock); | 704 | spin_unlock_bh(&sta->lock); |
| 671 | mesh_plink_inc_estab_count(sdata); | 705 | mesh_plink_inc_estab_count(sdata); |
| 672 | ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BEACON); | 706 | ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BEACON); |
| @@ -679,7 +713,7 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m | |||
| 679 | } | 713 | } |
| 680 | break; | 714 | break; |
| 681 | 715 | ||
| 682 | case PLINK_CNF_RCVD: | 716 | case NL80211_PLINK_CNF_RCVD: |
| 683 | switch (event) { | 717 | switch (event) { |
| 684 | case OPN_RJCT: | 718 | case OPN_RJCT: |
| 685 | case CNF_RJCT: | 719 | case CNF_RJCT: |
| @@ -688,7 +722,7 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m | |||
| 688 | if (!reason) | 722 | if (!reason) |
| 689 | reason = cpu_to_le16(MESH_CLOSE_RCVD); | 723 | reason = cpu_to_le16(MESH_CLOSE_RCVD); |
| 690 | sta->reason = reason; | 724 | sta->reason = reason; |
| 691 | sta->plink_state = PLINK_HOLDING; | 725 | sta->plink_state = NL80211_PLINK_HOLDING; |
| 692 | if (!mod_plink_timer(sta, | 726 | if (!mod_plink_timer(sta, |
| 693 | dot11MeshHoldingTimeout(sdata))) | 727 | dot11MeshHoldingTimeout(sdata))) |
| 694 | sta->ignore_plink_timer = true; | 728 | sta->ignore_plink_timer = true; |
| @@ -700,7 +734,7 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m | |||
| 700 | break; | 734 | break; |
| 701 | case OPN_ACPT: | 735 | case OPN_ACPT: |
| 702 | del_timer(&sta->plink_timer); | 736 | del_timer(&sta->plink_timer); |
| 703 | sta->plink_state = PLINK_ESTAB; | 737 | sta->plink_state = NL80211_PLINK_ESTAB; |
| 704 | spin_unlock_bh(&sta->lock); | 738 | spin_unlock_bh(&sta->lock); |
| 705 | mesh_plink_inc_estab_count(sdata); | 739 | mesh_plink_inc_estab_count(sdata); |
| 706 | ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BEACON); | 740 | ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BEACON); |
| @@ -715,13 +749,13 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m | |||
| 715 | } | 749 | } |
| 716 | break; | 750 | break; |
| 717 | 751 | ||
| 718 | case PLINK_ESTAB: | 752 | case NL80211_PLINK_ESTAB: |
| 719 | switch (event) { | 753 | switch (event) { |
| 720 | case CLS_ACPT: | 754 | case CLS_ACPT: |
| 721 | reason = cpu_to_le16(MESH_CLOSE_RCVD); | 755 | reason = cpu_to_le16(MESH_CLOSE_RCVD); |
| 722 | sta->reason = reason; | 756 | sta->reason = reason; |
| 723 | deactivated = __mesh_plink_deactivate(sta); | 757 | deactivated = __mesh_plink_deactivate(sta); |
| 724 | sta->plink_state = PLINK_HOLDING; | 758 | sta->plink_state = NL80211_PLINK_HOLDING; |
| 725 | llid = sta->llid; | 759 | llid = sta->llid; |
| 726 | mod_plink_timer(sta, dot11MeshHoldingTimeout(sdata)); | 760 | mod_plink_timer(sta, dot11MeshHoldingTimeout(sdata)); |
| 727 | spin_unlock_bh(&sta->lock); | 761 | spin_unlock_bh(&sta->lock); |
| @@ -741,7 +775,7 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m | |||
| 741 | break; | 775 | break; |
| 742 | } | 776 | } |
| 743 | break; | 777 | break; |
| 744 | case PLINK_HOLDING: | 778 | case NL80211_PLINK_HOLDING: |
| 745 | switch (event) { | 779 | switch (event) { |
| 746 | case CLS_ACPT: | 780 | case CLS_ACPT: |
| 747 | if (del_timer(&sta->plink_timer)) | 781 | if (del_timer(&sta->plink_timer)) |
