diff options
Diffstat (limited to 'net/mac80211/ibss.c')
-rw-r--r-- | net/mac80211/ibss.c | 127 |
1 files changed, 68 insertions, 59 deletions
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c index 1f2db647bb5c..f3e942486749 100644 --- a/net/mac80211/ibss.c +++ b/net/mac80211/ibss.c | |||
@@ -117,7 +117,7 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata, | |||
117 | mgmt->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT | | 117 | mgmt->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT | |
118 | IEEE80211_STYPE_PROBE_RESP); | 118 | IEEE80211_STYPE_PROBE_RESP); |
119 | memset(mgmt->da, 0xff, ETH_ALEN); | 119 | memset(mgmt->da, 0xff, ETH_ALEN); |
120 | memcpy(mgmt->sa, sdata->dev->dev_addr, ETH_ALEN); | 120 | memcpy(mgmt->sa, sdata->vif.addr, ETH_ALEN); |
121 | memcpy(mgmt->bssid, ifibss->bssid, ETH_ALEN); | 121 | memcpy(mgmt->bssid, ifibss->bssid, ETH_ALEN); |
122 | mgmt->u.beacon.beacon_int = cpu_to_le16(beacon_int); | 122 | mgmt->u.beacon.beacon_int = cpu_to_le16(beacon_int); |
123 | mgmt->u.beacon.timestamp = cpu_to_le64(tsf); | 123 | mgmt->u.beacon.timestamp = cpu_to_le64(tsf); |
@@ -187,15 +187,17 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata, | |||
187 | static void ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata, | 187 | static void ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata, |
188 | struct ieee80211_bss *bss) | 188 | struct ieee80211_bss *bss) |
189 | { | 189 | { |
190 | struct cfg80211_bss *cbss = | ||
191 | container_of((void *)bss, struct cfg80211_bss, priv); | ||
190 | struct ieee80211_supported_band *sband; | 192 | struct ieee80211_supported_band *sband; |
191 | u32 basic_rates; | 193 | u32 basic_rates; |
192 | int i, j; | 194 | int i, j; |
193 | u16 beacon_int = bss->cbss.beacon_interval; | 195 | u16 beacon_int = cbss->beacon_interval; |
194 | 196 | ||
195 | if (beacon_int < 10) | 197 | if (beacon_int < 10) |
196 | beacon_int = 10; | 198 | beacon_int = 10; |
197 | 199 | ||
198 | sband = sdata->local->hw.wiphy->bands[bss->cbss.channel->band]; | 200 | sband = sdata->local->hw.wiphy->bands[cbss->channel->band]; |
199 | 201 | ||
200 | basic_rates = 0; | 202 | basic_rates = 0; |
201 | 203 | ||
@@ -212,12 +214,12 @@ static void ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata, | |||
212 | } | 214 | } |
213 | } | 215 | } |
214 | 216 | ||
215 | __ieee80211_sta_join_ibss(sdata, bss->cbss.bssid, | 217 | __ieee80211_sta_join_ibss(sdata, cbss->bssid, |
216 | beacon_int, | 218 | beacon_int, |
217 | bss->cbss.channel, | 219 | cbss->channel, |
218 | basic_rates, | 220 | basic_rates, |
219 | bss->cbss.capability, | 221 | cbss->capability, |
220 | bss->cbss.tsf); | 222 | cbss->tsf); |
221 | } | 223 | } |
222 | 224 | ||
223 | static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata, | 225 | static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata, |
@@ -229,6 +231,7 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata, | |||
229 | { | 231 | { |
230 | struct ieee80211_local *local = sdata->local; | 232 | struct ieee80211_local *local = sdata->local; |
231 | int freq; | 233 | int freq; |
234 | struct cfg80211_bss *cbss; | ||
232 | struct ieee80211_bss *bss; | 235 | struct ieee80211_bss *bss; |
233 | struct sta_info *sta; | 236 | struct sta_info *sta; |
234 | struct ieee80211_channel *channel; | 237 | struct ieee80211_channel *channel; |
@@ -252,7 +255,7 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata, | |||
252 | 255 | ||
253 | rcu_read_lock(); | 256 | rcu_read_lock(); |
254 | 257 | ||
255 | sta = sta_info_get(local, mgmt->sa); | 258 | sta = sta_info_get(sdata, mgmt->sa); |
256 | if (sta) { | 259 | if (sta) { |
257 | u32 prev_rates; | 260 | u32 prev_rates; |
258 | 261 | ||
@@ -266,16 +269,18 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata, | |||
266 | printk(KERN_DEBUG "%s: updated supp_rates set " | 269 | printk(KERN_DEBUG "%s: updated supp_rates set " |
267 | "for %pM based on beacon info (0x%llx | " | 270 | "for %pM based on beacon info (0x%llx | " |
268 | "0x%llx -> 0x%llx)\n", | 271 | "0x%llx -> 0x%llx)\n", |
269 | sdata->dev->name, | 272 | sdata->name, |
270 | sta->sta.addr, | 273 | sta->sta.addr, |
271 | (unsigned long long) prev_rates, | 274 | (unsigned long long) prev_rates, |
272 | (unsigned long long) supp_rates, | 275 | (unsigned long long) supp_rates, |
273 | (unsigned long long) sta->sta.supp_rates[band]); | 276 | (unsigned long long) sta->sta.supp_rates[band]); |
274 | #endif | 277 | #endif |
275 | } else | 278 | rcu_read_unlock(); |
276 | ieee80211_ibss_add_sta(sdata, mgmt->bssid, mgmt->sa, supp_rates); | 279 | } else { |
277 | 280 | rcu_read_unlock(); | |
278 | rcu_read_unlock(); | 281 | ieee80211_ibss_add_sta(sdata, mgmt->bssid, mgmt->sa, |
282 | supp_rates, GFP_KERNEL); | ||
283 | } | ||
279 | } | 284 | } |
280 | 285 | ||
281 | bss = ieee80211_bss_info_update(local, rx_status, mgmt, len, elems, | 286 | bss = ieee80211_bss_info_update(local, rx_status, mgmt, len, elems, |
@@ -283,25 +288,23 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata, | |||
283 | if (!bss) | 288 | if (!bss) |
284 | return; | 289 | return; |
285 | 290 | ||
291 | cbss = container_of((void *)bss, struct cfg80211_bss, priv); | ||
292 | |||
286 | /* was just updated in ieee80211_bss_info_update */ | 293 | /* was just updated in ieee80211_bss_info_update */ |
287 | beacon_timestamp = bss->cbss.tsf; | 294 | beacon_timestamp = cbss->tsf; |
288 | 295 | ||
289 | /* check if we need to merge IBSS */ | 296 | /* check if we need to merge IBSS */ |
290 | 297 | ||
291 | /* merge only on beacons (???) */ | ||
292 | if (!beacon) | ||
293 | goto put_bss; | ||
294 | |||
295 | /* we use a fixed BSSID */ | 298 | /* we use a fixed BSSID */ |
296 | if (sdata->u.ibss.bssid) | 299 | if (sdata->u.ibss.fixed_bssid) |
297 | goto put_bss; | 300 | goto put_bss; |
298 | 301 | ||
299 | /* not an IBSS */ | 302 | /* not an IBSS */ |
300 | if (!(bss->cbss.capability & WLAN_CAPABILITY_IBSS)) | 303 | if (!(cbss->capability & WLAN_CAPABILITY_IBSS)) |
301 | goto put_bss; | 304 | goto put_bss; |
302 | 305 | ||
303 | /* different channel */ | 306 | /* different channel */ |
304 | if (bss->cbss.channel != local->oper_channel) | 307 | if (cbss->channel != local->oper_channel) |
305 | goto put_bss; | 308 | goto put_bss; |
306 | 309 | ||
307 | /* different SSID */ | 310 | /* different SSID */ |
@@ -311,7 +314,7 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata, | |||
311 | goto put_bss; | 314 | goto put_bss; |
312 | 315 | ||
313 | /* same BSSID */ | 316 | /* same BSSID */ |
314 | if (memcmp(bss->cbss.bssid, sdata->u.ibss.bssid, ETH_ALEN) == 0) | 317 | if (memcmp(cbss->bssid, sdata->u.ibss.bssid, ETH_ALEN) == 0) |
315 | goto put_bss; | 318 | goto put_bss; |
316 | 319 | ||
317 | if (rx_status->flag & RX_FLAG_TSFT) { | 320 | if (rx_status->flag & RX_FLAG_TSFT) { |
@@ -364,10 +367,11 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata, | |||
364 | #ifdef CONFIG_MAC80211_IBSS_DEBUG | 367 | #ifdef CONFIG_MAC80211_IBSS_DEBUG |
365 | printk(KERN_DEBUG "%s: beacon TSF higher than " | 368 | printk(KERN_DEBUG "%s: beacon TSF higher than " |
366 | "local TSF - IBSS merge with BSSID %pM\n", | 369 | "local TSF - IBSS merge with BSSID %pM\n", |
367 | sdata->dev->name, mgmt->bssid); | 370 | sdata->name, mgmt->bssid); |
368 | #endif | 371 | #endif |
369 | ieee80211_sta_join_ibss(sdata, bss); | 372 | ieee80211_sta_join_ibss(sdata, bss); |
370 | ieee80211_ibss_add_sta(sdata, mgmt->bssid, mgmt->sa, supp_rates); | 373 | ieee80211_ibss_add_sta(sdata, mgmt->bssid, mgmt->sa, |
374 | supp_rates, GFP_KERNEL); | ||
371 | } | 375 | } |
372 | 376 | ||
373 | put_bss: | 377 | put_bss: |
@@ -380,7 +384,8 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata, | |||
380 | * must be callable in atomic context. | 384 | * must be callable in atomic context. |
381 | */ | 385 | */ |
382 | struct sta_info *ieee80211_ibss_add_sta(struct ieee80211_sub_if_data *sdata, | 386 | struct sta_info *ieee80211_ibss_add_sta(struct ieee80211_sub_if_data *sdata, |
383 | u8 *bssid,u8 *addr, u32 supp_rates) | 387 | u8 *bssid,u8 *addr, u32 supp_rates, |
388 | gfp_t gfp) | ||
384 | { | 389 | { |
385 | struct ieee80211_if_ibss *ifibss = &sdata->u.ibss; | 390 | struct ieee80211_if_ibss *ifibss = &sdata->u.ibss; |
386 | struct ieee80211_local *local = sdata->local; | 391 | struct ieee80211_local *local = sdata->local; |
@@ -394,7 +399,7 @@ struct sta_info *ieee80211_ibss_add_sta(struct ieee80211_sub_if_data *sdata, | |||
394 | if (local->num_sta >= IEEE80211_IBSS_MAX_STA_ENTRIES) { | 399 | if (local->num_sta >= IEEE80211_IBSS_MAX_STA_ENTRIES) { |
395 | if (net_ratelimit()) | 400 | if (net_ratelimit()) |
396 | printk(KERN_DEBUG "%s: No room for a new IBSS STA entry %pM\n", | 401 | printk(KERN_DEBUG "%s: No room for a new IBSS STA entry %pM\n", |
397 | sdata->dev->name, addr); | 402 | sdata->name, addr); |
398 | return NULL; | 403 | return NULL; |
399 | } | 404 | } |
400 | 405 | ||
@@ -406,10 +411,10 @@ struct sta_info *ieee80211_ibss_add_sta(struct ieee80211_sub_if_data *sdata, | |||
406 | 411 | ||
407 | #ifdef CONFIG_MAC80211_VERBOSE_DEBUG | 412 | #ifdef CONFIG_MAC80211_VERBOSE_DEBUG |
408 | printk(KERN_DEBUG "%s: Adding new IBSS station %pM (dev=%s)\n", | 413 | printk(KERN_DEBUG "%s: Adding new IBSS station %pM (dev=%s)\n", |
409 | wiphy_name(local->hw.wiphy), addr, sdata->dev->name); | 414 | wiphy_name(local->hw.wiphy), addr, sdata->name); |
410 | #endif | 415 | #endif |
411 | 416 | ||
412 | sta = sta_info_alloc(sdata, addr, GFP_ATOMIC); | 417 | sta = sta_info_alloc(sdata, addr, gfp); |
413 | if (!sta) | 418 | if (!sta) |
414 | return NULL; | 419 | return NULL; |
415 | 420 | ||
@@ -421,9 +426,9 @@ struct sta_info *ieee80211_ibss_add_sta(struct ieee80211_sub_if_data *sdata, | |||
421 | 426 | ||
422 | rate_control_rate_init(sta); | 427 | rate_control_rate_init(sta); |
423 | 428 | ||
429 | /* If it fails, maybe we raced another insertion? */ | ||
424 | if (sta_info_insert(sta)) | 430 | if (sta_info_insert(sta)) |
425 | return NULL; | 431 | return sta_info_get(sdata, addr); |
426 | |||
427 | return sta; | 432 | return sta; |
428 | } | 433 | } |
429 | 434 | ||
@@ -449,6 +454,9 @@ static int ieee80211_sta_active_ibss(struct ieee80211_sub_if_data *sdata) | |||
449 | return active; | 454 | return active; |
450 | } | 455 | } |
451 | 456 | ||
457 | /* | ||
458 | * This function is called with state == IEEE80211_IBSS_MLME_JOINED | ||
459 | */ | ||
452 | 460 | ||
453 | static void ieee80211_sta_merge_ibss(struct ieee80211_sub_if_data *sdata) | 461 | static void ieee80211_sta_merge_ibss(struct ieee80211_sub_if_data *sdata) |
454 | { | 462 | { |
@@ -470,7 +478,7 @@ static void ieee80211_sta_merge_ibss(struct ieee80211_sub_if_data *sdata) | |||
470 | return; | 478 | return; |
471 | 479 | ||
472 | printk(KERN_DEBUG "%s: No active IBSS STAs - trying to scan for other " | 480 | printk(KERN_DEBUG "%s: No active IBSS STAs - trying to scan for other " |
473 | "IBSS networks with same SSID (merge)\n", sdata->dev->name); | 481 | "IBSS networks with same SSID (merge)\n", sdata->name); |
474 | 482 | ||
475 | ieee80211_request_internal_scan(sdata, ifibss->ssid, ifibss->ssid_len); | 483 | ieee80211_request_internal_scan(sdata, ifibss->ssid, ifibss->ssid_len); |
476 | } | 484 | } |
@@ -492,13 +500,13 @@ static void ieee80211_sta_create_ibss(struct ieee80211_sub_if_data *sdata) | |||
492 | * random number generator get different BSSID. */ | 500 | * random number generator get different BSSID. */ |
493 | get_random_bytes(bssid, ETH_ALEN); | 501 | get_random_bytes(bssid, ETH_ALEN); |
494 | for (i = 0; i < ETH_ALEN; i++) | 502 | for (i = 0; i < ETH_ALEN; i++) |
495 | bssid[i] ^= sdata->dev->dev_addr[i]; | 503 | bssid[i] ^= sdata->vif.addr[i]; |
496 | bssid[0] &= ~0x01; | 504 | bssid[0] &= ~0x01; |
497 | bssid[0] |= 0x02; | 505 | bssid[0] |= 0x02; |
498 | } | 506 | } |
499 | 507 | ||
500 | printk(KERN_DEBUG "%s: Creating new IBSS network, BSSID %pM\n", | 508 | printk(KERN_DEBUG "%s: Creating new IBSS network, BSSID %pM\n", |
501 | sdata->dev->name, bssid); | 509 | sdata->name, bssid); |
502 | 510 | ||
503 | sband = local->hw.wiphy->bands[ifibss->channel->band]; | 511 | sband = local->hw.wiphy->bands[ifibss->channel->band]; |
504 | 512 | ||
@@ -514,11 +522,15 @@ static void ieee80211_sta_create_ibss(struct ieee80211_sub_if_data *sdata) | |||
514 | capability, 0); | 522 | capability, 0); |
515 | } | 523 | } |
516 | 524 | ||
525 | /* | ||
526 | * This function is called with state == IEEE80211_IBSS_MLME_SEARCH | ||
527 | */ | ||
528 | |||
517 | static void ieee80211_sta_find_ibss(struct ieee80211_sub_if_data *sdata) | 529 | static void ieee80211_sta_find_ibss(struct ieee80211_sub_if_data *sdata) |
518 | { | 530 | { |
519 | struct ieee80211_if_ibss *ifibss = &sdata->u.ibss; | 531 | struct ieee80211_if_ibss *ifibss = &sdata->u.ibss; |
520 | struct ieee80211_local *local = sdata->local; | 532 | struct ieee80211_local *local = sdata->local; |
521 | struct ieee80211_bss *bss; | 533 | struct cfg80211_bss *cbss; |
522 | struct ieee80211_channel *chan = NULL; | 534 | struct ieee80211_channel *chan = NULL; |
523 | const u8 *bssid = NULL; | 535 | const u8 *bssid = NULL; |
524 | int active_ibss; | 536 | int active_ibss; |
@@ -527,7 +539,7 @@ static void ieee80211_sta_find_ibss(struct ieee80211_sub_if_data *sdata) | |||
527 | active_ibss = ieee80211_sta_active_ibss(sdata); | 539 | active_ibss = ieee80211_sta_active_ibss(sdata); |
528 | #ifdef CONFIG_MAC80211_IBSS_DEBUG | 540 | #ifdef CONFIG_MAC80211_IBSS_DEBUG |
529 | printk(KERN_DEBUG "%s: sta_find_ibss (active_ibss=%d)\n", | 541 | printk(KERN_DEBUG "%s: sta_find_ibss (active_ibss=%d)\n", |
530 | sdata->dev->name, active_ibss); | 542 | sdata->name, active_ibss); |
531 | #endif /* CONFIG_MAC80211_IBSS_DEBUG */ | 543 | #endif /* CONFIG_MAC80211_IBSS_DEBUG */ |
532 | 544 | ||
533 | if (active_ibss) | 545 | if (active_ibss) |
@@ -542,21 +554,23 @@ static void ieee80211_sta_find_ibss(struct ieee80211_sub_if_data *sdata) | |||
542 | chan = ifibss->channel; | 554 | chan = ifibss->channel; |
543 | if (!is_zero_ether_addr(ifibss->bssid)) | 555 | if (!is_zero_ether_addr(ifibss->bssid)) |
544 | bssid = ifibss->bssid; | 556 | bssid = ifibss->bssid; |
545 | bss = (void *)cfg80211_get_bss(local->hw.wiphy, chan, bssid, | 557 | cbss = cfg80211_get_bss(local->hw.wiphy, chan, bssid, |
546 | ifibss->ssid, ifibss->ssid_len, | 558 | ifibss->ssid, ifibss->ssid_len, |
547 | WLAN_CAPABILITY_IBSS | | 559 | WLAN_CAPABILITY_IBSS | WLAN_CAPABILITY_PRIVACY, |
548 | WLAN_CAPABILITY_PRIVACY, | 560 | capability); |
549 | capability); | 561 | |
562 | if (cbss) { | ||
563 | struct ieee80211_bss *bss; | ||
550 | 564 | ||
551 | if (bss) { | 565 | bss = (void *)cbss->priv; |
552 | #ifdef CONFIG_MAC80211_IBSS_DEBUG | 566 | #ifdef CONFIG_MAC80211_IBSS_DEBUG |
553 | printk(KERN_DEBUG " sta_find_ibss: selected %pM current " | 567 | printk(KERN_DEBUG " sta_find_ibss: selected %pM current " |
554 | "%pM\n", bss->cbss.bssid, ifibss->bssid); | 568 | "%pM\n", cbss->bssid, ifibss->bssid); |
555 | #endif /* CONFIG_MAC80211_IBSS_DEBUG */ | 569 | #endif /* CONFIG_MAC80211_IBSS_DEBUG */ |
556 | 570 | ||
557 | printk(KERN_DEBUG "%s: Selected IBSS BSSID %pM" | 571 | printk(KERN_DEBUG "%s: Selected IBSS BSSID %pM" |
558 | " based on configured SSID\n", | 572 | " based on configured SSID\n", |
559 | sdata->dev->name, bss->cbss.bssid); | 573 | sdata->name, cbss->bssid); |
560 | 574 | ||
561 | ieee80211_sta_join_ibss(sdata, bss); | 575 | ieee80211_sta_join_ibss(sdata, bss); |
562 | ieee80211_rx_bss_put(local, bss); | 576 | ieee80211_rx_bss_put(local, bss); |
@@ -568,18 +582,14 @@ static void ieee80211_sta_find_ibss(struct ieee80211_sub_if_data *sdata) | |||
568 | #endif /* CONFIG_MAC80211_IBSS_DEBUG */ | 582 | #endif /* CONFIG_MAC80211_IBSS_DEBUG */ |
569 | 583 | ||
570 | /* Selected IBSS not found in current scan results - try to scan */ | 584 | /* Selected IBSS not found in current scan results - try to scan */ |
571 | if (ifibss->state == IEEE80211_IBSS_MLME_JOINED && | 585 | if (time_after(jiffies, ifibss->last_scan_completed + |
572 | !ieee80211_sta_active_ibss(sdata)) { | ||
573 | mod_timer(&ifibss->timer, | ||
574 | round_jiffies(jiffies + IEEE80211_IBSS_MERGE_INTERVAL)); | ||
575 | } else if (time_after(jiffies, ifibss->last_scan_completed + | ||
576 | IEEE80211_SCAN_INTERVAL)) { | 586 | IEEE80211_SCAN_INTERVAL)) { |
577 | printk(KERN_DEBUG "%s: Trigger new scan to find an IBSS to " | 587 | printk(KERN_DEBUG "%s: Trigger new scan to find an IBSS to " |
578 | "join\n", sdata->dev->name); | 588 | "join\n", sdata->name); |
579 | 589 | ||
580 | ieee80211_request_internal_scan(sdata, ifibss->ssid, | 590 | ieee80211_request_internal_scan(sdata, ifibss->ssid, |
581 | ifibss->ssid_len); | 591 | ifibss->ssid_len); |
582 | } else if (ifibss->state != IEEE80211_IBSS_MLME_JOINED) { | 592 | } else { |
583 | int interval = IEEE80211_SCAN_INTERVAL; | 593 | int interval = IEEE80211_SCAN_INTERVAL; |
584 | 594 | ||
585 | if (time_after(jiffies, ifibss->ibss_join_req + | 595 | if (time_after(jiffies, ifibss->ibss_join_req + |
@@ -589,7 +599,7 @@ static void ieee80211_sta_find_ibss(struct ieee80211_sub_if_data *sdata) | |||
589 | return; | 599 | return; |
590 | } | 600 | } |
591 | printk(KERN_DEBUG "%s: IBSS not allowed on" | 601 | printk(KERN_DEBUG "%s: IBSS not allowed on" |
592 | " %d MHz\n", sdata->dev->name, | 602 | " %d MHz\n", sdata->name, |
593 | local->hw.conf.channel->center_freq); | 603 | local->hw.conf.channel->center_freq); |
594 | 604 | ||
595 | /* No IBSS found - decrease scan interval and continue | 605 | /* No IBSS found - decrease scan interval and continue |
@@ -597,7 +607,6 @@ static void ieee80211_sta_find_ibss(struct ieee80211_sub_if_data *sdata) | |||
597 | interval = IEEE80211_SCAN_INTERVAL_SLOW; | 607 | interval = IEEE80211_SCAN_INTERVAL_SLOW; |
598 | } | 608 | } |
599 | 609 | ||
600 | ifibss->state = IEEE80211_IBSS_MLME_SEARCH; | ||
601 | mod_timer(&ifibss->timer, | 610 | mod_timer(&ifibss->timer, |
602 | round_jiffies(jiffies + interval)); | 611 | round_jiffies(jiffies + interval)); |
603 | } | 612 | } |
@@ -623,7 +632,7 @@ static void ieee80211_rx_mgmt_probe_req(struct ieee80211_sub_if_data *sdata, | |||
623 | #ifdef CONFIG_MAC80211_IBSS_DEBUG | 632 | #ifdef CONFIG_MAC80211_IBSS_DEBUG |
624 | printk(KERN_DEBUG "%s: RX ProbeReq SA=%pM DA=%pM BSSID=%pM" | 633 | printk(KERN_DEBUG "%s: RX ProbeReq SA=%pM DA=%pM BSSID=%pM" |
625 | " (tx_last_beacon=%d)\n", | 634 | " (tx_last_beacon=%d)\n", |
626 | sdata->dev->name, mgmt->sa, mgmt->da, | 635 | sdata->name, mgmt->sa, mgmt->da, |
627 | mgmt->bssid, tx_last_beacon); | 636 | mgmt->bssid, tx_last_beacon); |
628 | #endif /* CONFIG_MAC80211_IBSS_DEBUG */ | 637 | #endif /* CONFIG_MAC80211_IBSS_DEBUG */ |
629 | 638 | ||
@@ -641,13 +650,13 @@ static void ieee80211_rx_mgmt_probe_req(struct ieee80211_sub_if_data *sdata, | |||
641 | #ifdef CONFIG_MAC80211_IBSS_DEBUG | 650 | #ifdef CONFIG_MAC80211_IBSS_DEBUG |
642 | printk(KERN_DEBUG "%s: Invalid SSID IE in ProbeReq " | 651 | printk(KERN_DEBUG "%s: Invalid SSID IE in ProbeReq " |
643 | "from %pM\n", | 652 | "from %pM\n", |
644 | sdata->dev->name, mgmt->sa); | 653 | sdata->name, mgmt->sa); |
645 | #endif | 654 | #endif |
646 | return; | 655 | return; |
647 | } | 656 | } |
648 | if (pos[1] != 0 && | 657 | if (pos[1] != 0 && |
649 | (pos[1] != ifibss->ssid_len || | 658 | (pos[1] != ifibss->ssid_len || |
650 | !memcmp(pos + 2, ifibss->ssid, ifibss->ssid_len))) { | 659 | memcmp(pos + 2, ifibss->ssid, ifibss->ssid_len))) { |
651 | /* Ignore ProbeReq for foreign SSID */ | 660 | /* Ignore ProbeReq for foreign SSID */ |
652 | return; | 661 | return; |
653 | } | 662 | } |
@@ -661,7 +670,7 @@ static void ieee80211_rx_mgmt_probe_req(struct ieee80211_sub_if_data *sdata, | |||
661 | memcpy(resp->da, mgmt->sa, ETH_ALEN); | 670 | memcpy(resp->da, mgmt->sa, ETH_ALEN); |
662 | #ifdef CONFIG_MAC80211_IBSS_DEBUG | 671 | #ifdef CONFIG_MAC80211_IBSS_DEBUG |
663 | printk(KERN_DEBUG "%s: Sending ProbeResp to %pM\n", | 672 | printk(KERN_DEBUG "%s: Sending ProbeResp to %pM\n", |
664 | sdata->dev->name, resp->da); | 673 | sdata->name, resp->da); |
665 | #endif /* CONFIG_MAC80211_IBSS_DEBUG */ | 674 | #endif /* CONFIG_MAC80211_IBSS_DEBUG */ |
666 | IEEE80211_SKB_CB(skb)->flags |= IEEE80211_TX_INTFL_DONT_ENCRYPT; | 675 | IEEE80211_SKB_CB(skb)->flags |= IEEE80211_TX_INTFL_DONT_ENCRYPT; |
667 | ieee80211_tx_skb(sdata, skb); | 676 | ieee80211_tx_skb(sdata, skb); |
@@ -675,7 +684,7 @@ static void ieee80211_rx_mgmt_probe_resp(struct ieee80211_sub_if_data *sdata, | |||
675 | size_t baselen; | 684 | size_t baselen; |
676 | struct ieee802_11_elems elems; | 685 | struct ieee802_11_elems elems; |
677 | 686 | ||
678 | if (memcmp(mgmt->da, sdata->dev->dev_addr, ETH_ALEN)) | 687 | if (memcmp(mgmt->da, sdata->vif.addr, ETH_ALEN)) |
679 | return; /* ignore ProbeResp to foreign address */ | 688 | return; /* ignore ProbeResp to foreign address */ |
680 | 689 | ||
681 | baselen = (u8 *) mgmt->u.probe_resp.variable - (u8 *) mgmt; | 690 | baselen = (u8 *) mgmt->u.probe_resp.variable - (u8 *) mgmt; |
@@ -748,7 +757,7 @@ static void ieee80211_ibss_work(struct work_struct *work) | |||
748 | if (WARN_ON(local->suspended)) | 757 | if (WARN_ON(local->suspended)) |
749 | return; | 758 | return; |
750 | 759 | ||
751 | if (!netif_running(sdata->dev)) | 760 | if (!ieee80211_sdata_running(sdata)) |
752 | return; | 761 | return; |
753 | 762 | ||
754 | if (local->scanning) | 763 | if (local->scanning) |
@@ -831,7 +840,7 @@ void ieee80211_ibss_notify_scan_completed(struct ieee80211_local *local) | |||
831 | 840 | ||
832 | mutex_lock(&local->iflist_mtx); | 841 | mutex_lock(&local->iflist_mtx); |
833 | list_for_each_entry(sdata, &local->interfaces, list) { | 842 | list_for_each_entry(sdata, &local->interfaces, list) { |
834 | if (!netif_running(sdata->dev)) | 843 | if (!ieee80211_sdata_running(sdata)) |
835 | continue; | 844 | continue; |
836 | if (sdata->vif.type != NL80211_IFTYPE_ADHOC) | 845 | if (sdata->vif.type != NL80211_IFTYPE_ADHOC) |
837 | continue; | 846 | continue; |