diff options
Diffstat (limited to 'net/ieee80211/softmac/ieee80211softmac_assoc.c')
| -rw-r--r-- | net/ieee80211/softmac/ieee80211softmac_assoc.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/net/ieee80211/softmac/ieee80211softmac_assoc.c b/net/ieee80211/softmac/ieee80211softmac_assoc.c index fb79ce7d6439..57ea9f6f465c 100644 --- a/net/ieee80211/softmac/ieee80211softmac_assoc.c +++ b/net/ieee80211/softmac/ieee80211softmac_assoc.c | |||
| @@ -51,11 +51,12 @@ ieee80211softmac_assoc(struct ieee80211softmac_device *mac, struct ieee80211soft | |||
| 51 | spin_lock_irqsave(&mac->lock, flags); | 51 | spin_lock_irqsave(&mac->lock, flags); |
| 52 | mac->associnfo.associating = 1; | 52 | mac->associnfo.associating = 1; |
| 53 | mac->associated = 0; /* just to make sure */ | 53 | mac->associated = 0; /* just to make sure */ |
| 54 | spin_unlock_irqrestore(&mac->lock, flags); | ||
| 55 | 54 | ||
| 56 | /* Set a timer for timeout */ | 55 | /* Set a timer for timeout */ |
| 57 | /* FIXME: make timeout configurable */ | 56 | /* FIXME: make timeout configurable */ |
| 58 | schedule_delayed_work(&mac->associnfo.timeout, 5 * HZ); | 57 | if (likely(mac->running)) |
| 58 | schedule_delayed_work(&mac->associnfo.timeout, 5 * HZ); | ||
| 59 | spin_unlock_irqrestore(&mac->lock, flags); | ||
| 59 | } | 60 | } |
| 60 | 61 | ||
| 61 | void | 62 | void |
| @@ -319,6 +320,9 @@ ieee80211softmac_handle_assoc_response(struct net_device * dev, | |||
| 319 | u16 status = le16_to_cpup(&resp->status); | 320 | u16 status = le16_to_cpup(&resp->status); |
| 320 | struct ieee80211softmac_network *network = NULL; | 321 | struct ieee80211softmac_network *network = NULL; |
| 321 | unsigned long flags; | 322 | unsigned long flags; |
| 323 | |||
| 324 | if (unlikely(!mac->running)) | ||
| 325 | return -ENODEV; | ||
| 322 | 326 | ||
| 323 | spin_lock_irqsave(&mac->lock, flags); | 327 | spin_lock_irqsave(&mac->lock, flags); |
| 324 | 328 | ||
| @@ -377,10 +381,16 @@ ieee80211softmac_handle_disassoc(struct net_device * dev, | |||
| 377 | { | 381 | { |
| 378 | struct ieee80211softmac_device *mac = ieee80211_priv(dev); | 382 | struct ieee80211softmac_device *mac = ieee80211_priv(dev); |
| 379 | unsigned long flags; | 383 | unsigned long flags; |
| 384 | |||
| 385 | if (unlikely(!mac->running)) | ||
| 386 | return -ENODEV; | ||
| 387 | |||
| 380 | if (memcmp(disassoc->header.addr2, mac->associnfo.bssid, ETH_ALEN)) | 388 | if (memcmp(disassoc->header.addr2, mac->associnfo.bssid, ETH_ALEN)) |
| 381 | return 0; | 389 | return 0; |
| 390 | |||
| 382 | if (memcmp(disassoc->header.addr1, mac->dev->dev_addr, ETH_ALEN)) | 391 | if (memcmp(disassoc->header.addr1, mac->dev->dev_addr, ETH_ALEN)) |
| 383 | return 0; | 392 | return 0; |
| 393 | |||
| 384 | dprintk(KERN_INFO PFX "got disassoc frame\n"); | 394 | dprintk(KERN_INFO PFX "got disassoc frame\n"); |
| 385 | netif_carrier_off(dev); | 395 | netif_carrier_off(dev); |
| 386 | spin_lock_irqsave(&mac->lock, flags); | 396 | spin_lock_irqsave(&mac->lock, flags); |
| @@ -400,6 +410,9 @@ ieee80211softmac_handle_reassoc_req(struct net_device * dev, | |||
| 400 | struct ieee80211softmac_device *mac = ieee80211_priv(dev); | 410 | struct ieee80211softmac_device *mac = ieee80211_priv(dev); |
| 401 | struct ieee80211softmac_network *network; | 411 | struct ieee80211softmac_network *network; |
| 402 | 412 | ||
| 413 | if (unlikely(!mac->running)) | ||
| 414 | return -ENODEV; | ||
| 415 | |||
| 403 | network = ieee80211softmac_get_network_by_bssid(mac, resp->header.addr3); | 416 | network = ieee80211softmac_get_network_by_bssid(mac, resp->header.addr3); |
| 404 | if (!network) { | 417 | if (!network) { |
| 405 | dprintkl(KERN_INFO PFX "reassoc request from unknown network\n"); | 418 | dprintkl(KERN_INFO PFX "reassoc request from unknown network\n"); |
