diff options
Diffstat (limited to 'drivers/net/wireless/ipw2100.c')
| -rw-r--r-- | drivers/net/wireless/ipw2100.c | 220 |
1 files changed, 147 insertions, 73 deletions
diff --git a/drivers/net/wireless/ipw2100.c b/drivers/net/wireless/ipw2100.c index eb79198ac450..72335c8eb97f 100644 --- a/drivers/net/wireless/ipw2100.c +++ b/drivers/net/wireless/ipw2100.c | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /****************************************************************************** | 1 | /****************************************************************************** |
| 2 | 2 | ||
| 3 | Copyright(c) 2003 - 2005 Intel Corporation. All rights reserved. | 3 | Copyright(c) 2003 - 2006 Intel Corporation. All rights reserved. |
| 4 | 4 | ||
| 5 | This program is free software; you can redistribute it and/or modify it | 5 | This program is free software; you can redistribute it and/or modify it |
| 6 | under the terms of version 2 of the GNU General Public License as | 6 | under the terms of version 2 of the GNU General Public License as |
| @@ -167,12 +167,12 @@ that only one external action is invoked at a time. | |||
| 167 | 167 | ||
| 168 | #include "ipw2100.h" | 168 | #include "ipw2100.h" |
| 169 | 169 | ||
| 170 | #define IPW2100_VERSION "git-1.1.4" | 170 | #define IPW2100_VERSION "git-1.2.2" |
| 171 | 171 | ||
| 172 | #define DRV_NAME "ipw2100" | 172 | #define DRV_NAME "ipw2100" |
| 173 | #define DRV_VERSION IPW2100_VERSION | 173 | #define DRV_VERSION IPW2100_VERSION |
| 174 | #define DRV_DESCRIPTION "Intel(R) PRO/Wireless 2100 Network Driver" | 174 | #define DRV_DESCRIPTION "Intel(R) PRO/Wireless 2100 Network Driver" |
| 175 | #define DRV_COPYRIGHT "Copyright(c) 2003-2005 Intel Corporation" | 175 | #define DRV_COPYRIGHT "Copyright(c) 2003-2006 Intel Corporation" |
| 176 | 176 | ||
| 177 | /* Debugging stuff */ | 177 | /* Debugging stuff */ |
| 178 | #ifdef CONFIG_IPW2100_DEBUG | 178 | #ifdef CONFIG_IPW2100_DEBUG |
| @@ -1418,7 +1418,7 @@ static int ipw2100_enable_adapter(struct ipw2100_priv *priv) | |||
| 1418 | if (priv->status & STATUS_ENABLED) | 1418 | if (priv->status & STATUS_ENABLED) |
| 1419 | return 0; | 1419 | return 0; |
| 1420 | 1420 | ||
| 1421 | down(&priv->adapter_sem); | 1421 | mutex_lock(&priv->adapter_mutex); |
| 1422 | 1422 | ||
| 1423 | if (rf_kill_active(priv)) { | 1423 | if (rf_kill_active(priv)) { |
| 1424 | IPW_DEBUG_HC("Command aborted due to RF kill active.\n"); | 1424 | IPW_DEBUG_HC("Command aborted due to RF kill active.\n"); |
| @@ -1444,7 +1444,7 @@ static int ipw2100_enable_adapter(struct ipw2100_priv *priv) | |||
| 1444 | } | 1444 | } |
| 1445 | 1445 | ||
| 1446 | fail_up: | 1446 | fail_up: |
| 1447 | up(&priv->adapter_sem); | 1447 | mutex_unlock(&priv->adapter_mutex); |
| 1448 | return err; | 1448 | return err; |
| 1449 | } | 1449 | } |
| 1450 | 1450 | ||
| @@ -1576,7 +1576,7 @@ static int ipw2100_disable_adapter(struct ipw2100_priv *priv) | |||
| 1576 | cancel_delayed_work(&priv->hang_check); | 1576 | cancel_delayed_work(&priv->hang_check); |
| 1577 | } | 1577 | } |
| 1578 | 1578 | ||
| 1579 | down(&priv->adapter_sem); | 1579 | mutex_lock(&priv->adapter_mutex); |
| 1580 | 1580 | ||
| 1581 | err = ipw2100_hw_send_command(priv, &cmd); | 1581 | err = ipw2100_hw_send_command(priv, &cmd); |
| 1582 | if (err) { | 1582 | if (err) { |
| @@ -1595,7 +1595,7 @@ static int ipw2100_disable_adapter(struct ipw2100_priv *priv) | |||
| 1595 | IPW_DEBUG_INFO("TODO: implement scan state machine\n"); | 1595 | IPW_DEBUG_INFO("TODO: implement scan state machine\n"); |
| 1596 | 1596 | ||
| 1597 | fail_up: | 1597 | fail_up: |
| 1598 | up(&priv->adapter_sem); | 1598 | mutex_unlock(&priv->adapter_mutex); |
| 1599 | return err; | 1599 | return err; |
| 1600 | } | 1600 | } |
| 1601 | 1601 | ||
| @@ -1888,7 +1888,7 @@ static void ipw2100_reset_adapter(struct ipw2100_priv *priv) | |||
| 1888 | priv->status |= STATUS_RESET_PENDING; | 1888 | priv->status |= STATUS_RESET_PENDING; |
| 1889 | spin_unlock_irqrestore(&priv->low_lock, flags); | 1889 | spin_unlock_irqrestore(&priv->low_lock, flags); |
| 1890 | 1890 | ||
| 1891 | down(&priv->action_sem); | 1891 | mutex_lock(&priv->action_mutex); |
| 1892 | /* stop timed checks so that they don't interfere with reset */ | 1892 | /* stop timed checks so that they don't interfere with reset */ |
| 1893 | priv->stop_hang_check = 1; | 1893 | priv->stop_hang_check = 1; |
| 1894 | cancel_delayed_work(&priv->hang_check); | 1894 | cancel_delayed_work(&priv->hang_check); |
| @@ -1898,7 +1898,7 @@ static void ipw2100_reset_adapter(struct ipw2100_priv *priv) | |||
| 1898 | wireless_send_event(priv->net_dev, SIOCGIWAP, &wrqu, NULL); | 1898 | wireless_send_event(priv->net_dev, SIOCGIWAP, &wrqu, NULL); |
| 1899 | 1899 | ||
| 1900 | ipw2100_up(priv, 0); | 1900 | ipw2100_up(priv, 0); |
| 1901 | up(&priv->action_sem); | 1901 | mutex_unlock(&priv->action_mutex); |
| 1902 | 1902 | ||
| 1903 | } | 1903 | } |
| 1904 | 1904 | ||
| @@ -2390,15 +2390,6 @@ static void isr_rx(struct ipw2100_priv *priv, int i, | |||
| 2390 | IPW_DEBUG_DROP("Dropping packet while interface is not up.\n"); | 2390 | IPW_DEBUG_DROP("Dropping packet while interface is not up.\n"); |
| 2391 | return; | 2391 | return; |
| 2392 | } | 2392 | } |
| 2393 | #ifdef CONFIG_IPW2100_MONITOR | ||
| 2394 | if (unlikely(priv->ieee->iw_mode == IW_MODE_MONITOR && | ||
| 2395 | priv->config & CFG_CRC_CHECK && | ||
| 2396 | status->flags & IPW_STATUS_FLAG_CRC_ERROR)) { | ||
| 2397 | IPW_DEBUG_RX("CRC error in packet. Dropping.\n"); | ||
| 2398 | priv->ieee->stats.rx_errors++; | ||
| 2399 | return; | ||
| 2400 | } | ||
| 2401 | #endif | ||
| 2402 | 2393 | ||
| 2403 | if (unlikely(priv->ieee->iw_mode != IW_MODE_MONITOR && | 2394 | if (unlikely(priv->ieee->iw_mode != IW_MODE_MONITOR && |
| 2404 | !(priv->status & STATUS_ASSOCIATED))) { | 2395 | !(priv->status & STATUS_ASSOCIATED))) { |
| @@ -2446,6 +2437,89 @@ static void isr_rx(struct ipw2100_priv *priv, int i, | |||
| 2446 | priv->rx_queue.drv[i].host_addr = packet->dma_addr; | 2437 | priv->rx_queue.drv[i].host_addr = packet->dma_addr; |
| 2447 | } | 2438 | } |
| 2448 | 2439 | ||
| 2440 | #ifdef CONFIG_IPW2100_MONITOR | ||
| 2441 | |||
| 2442 | static void isr_rx_monitor(struct ipw2100_priv *priv, int i, | ||
| 2443 | struct ieee80211_rx_stats *stats) | ||
| 2444 | { | ||
| 2445 | struct ipw2100_status *status = &priv->status_queue.drv[i]; | ||
| 2446 | struct ipw2100_rx_packet *packet = &priv->rx_buffers[i]; | ||
| 2447 | |||
| 2448 | /* Magic struct that slots into the radiotap header -- no reason | ||
| 2449 | * to build this manually element by element, we can write it much | ||
| 2450 | * more efficiently than we can parse it. ORDER MATTERS HERE */ | ||
| 2451 | struct ipw_rt_hdr { | ||
| 2452 | struct ieee80211_radiotap_header rt_hdr; | ||
| 2453 | s8 rt_dbmsignal; /* signal in dbM, kluged to signed */ | ||
| 2454 | } *ipw_rt; | ||
| 2455 | |||
| 2456 | IPW_DEBUG_RX("Handler...\n"); | ||
| 2457 | |||
| 2458 | if (unlikely(status->frame_size > skb_tailroom(packet->skb) - | ||
| 2459 | sizeof(struct ipw_rt_hdr))) { | ||
| 2460 | IPW_DEBUG_INFO("%s: frame_size (%u) > skb_tailroom (%u)!" | ||
| 2461 | " Dropping.\n", | ||
| 2462 | priv->net_dev->name, | ||
| 2463 | status->frame_size, | ||
| 2464 | skb_tailroom(packet->skb)); | ||
| 2465 | priv->ieee->stats.rx_errors++; | ||
| 2466 | return; | ||
| 2467 | } | ||
| 2468 | |||
| 2469 | if (unlikely(!netif_running(priv->net_dev))) { | ||
| 2470 | priv->ieee->stats.rx_errors++; | ||
| 2471 | priv->wstats.discard.misc++; | ||
| 2472 | IPW_DEBUG_DROP("Dropping packet while interface is not up.\n"); | ||
| 2473 | return; | ||
| 2474 | } | ||
| 2475 | |||
| 2476 | if (unlikely(priv->config & CFG_CRC_CHECK && | ||
| 2477 | status->flags & IPW_STATUS_FLAG_CRC_ERROR)) { | ||
| 2478 | IPW_DEBUG_RX("CRC error in packet. Dropping.\n"); | ||
| 2479 | priv->ieee->stats.rx_errors++; | ||
| 2480 | return; | ||
| 2481 | } | ||
| 2482 | |||
| 2483 | pci_unmap_single(priv->pci_dev, packet->dma_addr, | ||
| 2484 | sizeof(struct ipw2100_rx), PCI_DMA_FROMDEVICE); | ||
| 2485 | memmove(packet->skb->data + sizeof(struct ipw_rt_hdr), | ||
| 2486 | packet->skb->data, status->frame_size); | ||
| 2487 | |||
| 2488 | ipw_rt = (struct ipw_rt_hdr *) packet->skb->data; | ||
| 2489 | |||
| 2490 | ipw_rt->rt_hdr.it_version = PKTHDR_RADIOTAP_VERSION; | ||
| 2491 | ipw_rt->rt_hdr.it_pad = 0; /* always good to zero */ | ||
| 2492 | ipw_rt->rt_hdr.it_len = sizeof(struct ipw_rt_hdr); /* total hdr+data */ | ||
| 2493 | |||
| 2494 | ipw_rt->rt_hdr.it_present = 1 << IEEE80211_RADIOTAP_DBM_ANTSIGNAL; | ||
| 2495 | |||
| 2496 | ipw_rt->rt_dbmsignal = status->rssi + IPW2100_RSSI_TO_DBM; | ||
| 2497 | |||
| 2498 | skb_put(packet->skb, status->frame_size + sizeof(struct ipw_rt_hdr)); | ||
| 2499 | |||
| 2500 | if (!ieee80211_rx(priv->ieee, packet->skb, stats)) { | ||
| 2501 | priv->ieee->stats.rx_errors++; | ||
| 2502 | |||
| 2503 | /* ieee80211_rx failed, so it didn't free the SKB */ | ||
| 2504 | dev_kfree_skb_any(packet->skb); | ||
| 2505 | packet->skb = NULL; | ||
| 2506 | } | ||
| 2507 | |||
| 2508 | /* We need to allocate a new SKB and attach it to the RDB. */ | ||
| 2509 | if (unlikely(ipw2100_alloc_skb(priv, packet))) { | ||
| 2510 | IPW_DEBUG_WARNING( | ||
| 2511 | "%s: Unable to allocate SKB onto RBD ring - disabling " | ||
| 2512 | "adapter.\n", priv->net_dev->name); | ||
| 2513 | /* TODO: schedule adapter shutdown */ | ||
| 2514 | IPW_DEBUG_INFO("TODO: Shutdown adapter...\n"); | ||
| 2515 | } | ||
| 2516 | |||
| 2517 | /* Update the RDB entry */ | ||
| 2518 | priv->rx_queue.drv[i].host_addr = packet->dma_addr; | ||
| 2519 | } | ||
| 2520 | |||
| 2521 | #endif | ||
| 2522 | |||
| 2449 | static int ipw2100_corruption_check(struct ipw2100_priv *priv, int i) | 2523 | static int ipw2100_corruption_check(struct ipw2100_priv *priv, int i) |
| 2450 | { | 2524 | { |
| 2451 | struct ipw2100_status *status = &priv->status_queue.drv[i]; | 2525 | struct ipw2100_status *status = &priv->status_queue.drv[i]; |
| @@ -2577,7 +2651,7 @@ static void __ipw2100_rx_process(struct ipw2100_priv *priv) | |||
| 2577 | case P8023_DATA_VAL: | 2651 | case P8023_DATA_VAL: |
| 2578 | #ifdef CONFIG_IPW2100_MONITOR | 2652 | #ifdef CONFIG_IPW2100_MONITOR |
| 2579 | if (priv->ieee->iw_mode == IW_MODE_MONITOR) { | 2653 | if (priv->ieee->iw_mode == IW_MODE_MONITOR) { |
| 2580 | isr_rx(priv, i, &stats); | 2654 | isr_rx_monitor(priv, i, &stats); |
| 2581 | break; | 2655 | break; |
| 2582 | } | 2656 | } |
| 2583 | #endif | 2657 | #endif |
| @@ -3882,7 +3956,7 @@ static int ipw2100_switch_mode(struct ipw2100_priv *priv, u32 mode) | |||
| 3882 | #ifdef CONFIG_IPW2100_MONITOR | 3956 | #ifdef CONFIG_IPW2100_MONITOR |
| 3883 | case IW_MODE_MONITOR: | 3957 | case IW_MODE_MONITOR: |
| 3884 | priv->last_mode = priv->ieee->iw_mode; | 3958 | priv->last_mode = priv->ieee->iw_mode; |
| 3885 | priv->net_dev->type = ARPHRD_IEEE80211; | 3959 | priv->net_dev->type = ARPHRD_IEEE80211_RADIOTAP; |
| 3886 | break; | 3960 | break; |
| 3887 | #endif /* CONFIG_IPW2100_MONITOR */ | 3961 | #endif /* CONFIG_IPW2100_MONITOR */ |
| 3888 | } | 3962 | } |
| @@ -4138,7 +4212,7 @@ static int ipw_radio_kill_sw(struct ipw2100_priv *priv, int disable_radio) | |||
| 4138 | IPW_DEBUG_RF_KILL("Manual SW RF Kill set to: RADIO %s\n", | 4212 | IPW_DEBUG_RF_KILL("Manual SW RF Kill set to: RADIO %s\n", |
| 4139 | disable_radio ? "OFF" : "ON"); | 4213 | disable_radio ? "OFF" : "ON"); |
| 4140 | 4214 | ||
| 4141 | down(&priv->action_sem); | 4215 | mutex_lock(&priv->action_mutex); |
| 4142 | 4216 | ||
| 4143 | if (disable_radio) { | 4217 | if (disable_radio) { |
| 4144 | priv->status |= STATUS_RF_KILL_SW; | 4218 | priv->status |= STATUS_RF_KILL_SW; |
| @@ -4156,7 +4230,7 @@ static int ipw_radio_kill_sw(struct ipw2100_priv *priv, int disable_radio) | |||
| 4156 | schedule_reset(priv); | 4230 | schedule_reset(priv); |
| 4157 | } | 4231 | } |
| 4158 | 4232 | ||
| 4159 | up(&priv->action_sem); | 4233 | mutex_unlock(&priv->action_mutex); |
| 4160 | return 1; | 4234 | return 1; |
| 4161 | } | 4235 | } |
| 4162 | 4236 | ||
| @@ -5460,7 +5534,7 @@ static void shim__set_security(struct net_device *dev, | |||
| 5460 | struct ipw2100_priv *priv = ieee80211_priv(dev); | 5534 | struct ipw2100_priv *priv = ieee80211_priv(dev); |
| 5461 | int i, force_update = 0; | 5535 | int i, force_update = 0; |
| 5462 | 5536 | ||
| 5463 | down(&priv->action_sem); | 5537 | mutex_lock(&priv->action_mutex); |
| 5464 | if (!(priv->status & STATUS_INITIALIZED)) | 5538 | if (!(priv->status & STATUS_INITIALIZED)) |
| 5465 | goto done; | 5539 | goto done; |
| 5466 | 5540 | ||
| @@ -5533,7 +5607,7 @@ static void shim__set_security(struct net_device *dev, | |||
| 5533 | if (!(priv->status & (STATUS_ASSOCIATED | STATUS_ASSOCIATING))) | 5607 | if (!(priv->status & (STATUS_ASSOCIATED | STATUS_ASSOCIATING))) |
| 5534 | ipw2100_configure_security(priv, 0); | 5608 | ipw2100_configure_security(priv, 0); |
| 5535 | done: | 5609 | done: |
| 5536 | up(&priv->action_sem); | 5610 | mutex_unlock(&priv->action_mutex); |
| 5537 | } | 5611 | } |
| 5538 | 5612 | ||
| 5539 | static int ipw2100_adapter_setup(struct ipw2100_priv *priv) | 5613 | static int ipw2100_adapter_setup(struct ipw2100_priv *priv) |
| @@ -5657,7 +5731,7 @@ static int ipw2100_set_address(struct net_device *dev, void *p) | |||
| 5657 | if (!is_valid_ether_addr(addr->sa_data)) | 5731 | if (!is_valid_ether_addr(addr->sa_data)) |
| 5658 | return -EADDRNOTAVAIL; | 5732 | return -EADDRNOTAVAIL; |
| 5659 | 5733 | ||
| 5660 | down(&priv->action_sem); | 5734 | mutex_lock(&priv->action_mutex); |
| 5661 | 5735 | ||
| 5662 | priv->config |= CFG_CUSTOM_MAC; | 5736 | priv->config |= CFG_CUSTOM_MAC; |
| 5663 | memcpy(priv->mac_addr, addr->sa_data, ETH_ALEN); | 5737 | memcpy(priv->mac_addr, addr->sa_data, ETH_ALEN); |
| @@ -5667,12 +5741,12 @@ static int ipw2100_set_address(struct net_device *dev, void *p) | |||
| 5667 | goto done; | 5741 | goto done; |
| 5668 | 5742 | ||
| 5669 | priv->reset_backoff = 0; | 5743 | priv->reset_backoff = 0; |
| 5670 | up(&priv->action_sem); | 5744 | mutex_unlock(&priv->action_mutex); |
| 5671 | ipw2100_reset_adapter(priv); | 5745 | ipw2100_reset_adapter(priv); |
| 5672 | return 0; | 5746 | return 0; |
| 5673 | 5747 | ||
| 5674 | done: | 5748 | done: |
| 5675 | up(&priv->action_sem); | 5749 | mutex_unlock(&priv->action_mutex); |
| 5676 | return err; | 5750 | return err; |
| 5677 | } | 5751 | } |
| 5678 | 5752 | ||
| @@ -6015,8 +6089,8 @@ static struct net_device *ipw2100_alloc_device(struct pci_dev *pci_dev, | |||
| 6015 | strcpy(priv->nick, "ipw2100"); | 6089 | strcpy(priv->nick, "ipw2100"); |
| 6016 | 6090 | ||
| 6017 | spin_lock_init(&priv->low_lock); | 6091 | spin_lock_init(&priv->low_lock); |
| 6018 | sema_init(&priv->action_sem, 1); | 6092 | mutex_init(&priv->action_mutex); |
| 6019 | sema_init(&priv->adapter_sem, 1); | 6093 | mutex_init(&priv->adapter_mutex); |
| 6020 | 6094 | ||
| 6021 | init_waitqueue_head(&priv->wait_command_queue); | 6095 | init_waitqueue_head(&priv->wait_command_queue); |
| 6022 | 6096 | ||
| @@ -6181,7 +6255,7 @@ static int ipw2100_pci_init_one(struct pci_dev *pci_dev, | |||
| 6181 | * member to call a function that then just turns and calls ipw2100_up. | 6255 | * member to call a function that then just turns and calls ipw2100_up. |
| 6182 | * net_dev->init is called after name allocation but before the | 6256 | * net_dev->init is called after name allocation but before the |
| 6183 | * notifier chain is called */ | 6257 | * notifier chain is called */ |
| 6184 | down(&priv->action_sem); | 6258 | mutex_lock(&priv->action_mutex); |
| 6185 | err = register_netdev(dev); | 6259 | err = register_netdev(dev); |
| 6186 | if (err) { | 6260 | if (err) { |
| 6187 | printk(KERN_WARNING DRV_NAME | 6261 | printk(KERN_WARNING DRV_NAME |
| @@ -6217,12 +6291,12 @@ static int ipw2100_pci_init_one(struct pci_dev *pci_dev, | |||
| 6217 | 6291 | ||
| 6218 | priv->status |= STATUS_INITIALIZED; | 6292 | priv->status |= STATUS_INITIALIZED; |
| 6219 | 6293 | ||
| 6220 | up(&priv->action_sem); | 6294 | mutex_unlock(&priv->action_mutex); |
| 6221 | 6295 | ||
| 6222 | return 0; | 6296 | return 0; |
| 6223 | 6297 | ||
| 6224 | fail_unlock: | 6298 | fail_unlock: |
| 6225 | up(&priv->action_sem); | 6299 | mutex_unlock(&priv->action_mutex); |
| 6226 | 6300 | ||
| 6227 | fail: | 6301 | fail: |
| 6228 | if (dev) { | 6302 | if (dev) { |
| @@ -6262,7 +6336,7 @@ static void __devexit ipw2100_pci_remove_one(struct pci_dev *pci_dev) | |||
| 6262 | struct net_device *dev; | 6336 | struct net_device *dev; |
| 6263 | 6337 | ||
| 6264 | if (priv) { | 6338 | if (priv) { |
| 6265 | down(&priv->action_sem); | 6339 | mutex_lock(&priv->action_mutex); |
| 6266 | 6340 | ||
| 6267 | priv->status &= ~STATUS_INITIALIZED; | 6341 | priv->status &= ~STATUS_INITIALIZED; |
| 6268 | 6342 | ||
| @@ -6277,9 +6351,9 @@ static void __devexit ipw2100_pci_remove_one(struct pci_dev *pci_dev) | |||
| 6277 | /* Take down the hardware */ | 6351 | /* Take down the hardware */ |
| 6278 | ipw2100_down(priv); | 6352 | ipw2100_down(priv); |
| 6279 | 6353 | ||
| 6280 | /* Release the semaphore so that the network subsystem can | 6354 | /* Release the mutex so that the network subsystem can |
| 6281 | * complete any needed calls into the driver... */ | 6355 | * complete any needed calls into the driver... */ |
| 6282 | up(&priv->action_sem); | 6356 | mutex_unlock(&priv->action_mutex); |
| 6283 | 6357 | ||
| 6284 | /* Unregister the device first - this results in close() | 6358 | /* Unregister the device first - this results in close() |
| 6285 | * being called if the device is open. If we free storage | 6359 | * being called if the device is open. If we free storage |
| @@ -6318,7 +6392,7 @@ static int ipw2100_suspend(struct pci_dev *pci_dev, pm_message_t state) | |||
| 6318 | 6392 | ||
| 6319 | IPW_DEBUG_INFO("%s: Going into suspend...\n", dev->name); | 6393 | IPW_DEBUG_INFO("%s: Going into suspend...\n", dev->name); |
| 6320 | 6394 | ||
| 6321 | down(&priv->action_sem); | 6395 | mutex_lock(&priv->action_mutex); |
| 6322 | if (priv->status & STATUS_INITIALIZED) { | 6396 | if (priv->status & STATUS_INITIALIZED) { |
| 6323 | /* Take down the device; powers it off, etc. */ | 6397 | /* Take down the device; powers it off, etc. */ |
| 6324 | ipw2100_down(priv); | 6398 | ipw2100_down(priv); |
| @@ -6331,7 +6405,7 @@ static int ipw2100_suspend(struct pci_dev *pci_dev, pm_message_t state) | |||
| 6331 | pci_disable_device(pci_dev); | 6405 | pci_disable_device(pci_dev); |
| 6332 | pci_set_power_state(pci_dev, PCI_D3hot); | 6406 | pci_set_power_state(pci_dev, PCI_D3hot); |
| 6333 | 6407 | ||
| 6334 | up(&priv->action_sem); | 6408 | mutex_unlock(&priv->action_mutex); |
| 6335 | 6409 | ||
| 6336 | return 0; | 6410 | return 0; |
| 6337 | } | 6411 | } |
| @@ -6345,7 +6419,7 @@ static int ipw2100_resume(struct pci_dev *pci_dev) | |||
| 6345 | if (IPW2100_PM_DISABLED) | 6419 | if (IPW2100_PM_DISABLED) |
| 6346 | return 0; | 6420 | return 0; |
| 6347 | 6421 | ||
| 6348 | down(&priv->action_sem); | 6422 | mutex_lock(&priv->action_mutex); |
| 6349 | 6423 | ||
| 6350 | IPW_DEBUG_INFO("%s: Coming out of suspend...\n", dev->name); | 6424 | IPW_DEBUG_INFO("%s: Coming out of suspend...\n", dev->name); |
| 6351 | 6425 | ||
| @@ -6371,7 +6445,7 @@ static int ipw2100_resume(struct pci_dev *pci_dev) | |||
| 6371 | if (!(priv->status & STATUS_RF_KILL_SW)) | 6445 | if (!(priv->status & STATUS_RF_KILL_SW)) |
| 6372 | ipw2100_up(priv, 0); | 6446 | ipw2100_up(priv, 0); |
| 6373 | 6447 | ||
| 6374 | up(&priv->action_sem); | 6448 | mutex_unlock(&priv->action_mutex); |
| 6375 | 6449 | ||
| 6376 | return 0; | 6450 | return 0; |
| 6377 | } | 6451 | } |
| @@ -6535,7 +6609,7 @@ static int ipw2100_wx_set_freq(struct net_device *dev, | |||
| 6535 | if (priv->ieee->iw_mode == IW_MODE_INFRA) | 6609 | if (priv->ieee->iw_mode == IW_MODE_INFRA) |
| 6536 | return -EOPNOTSUPP; | 6610 | return -EOPNOTSUPP; |
| 6537 | 6611 | ||
| 6538 | down(&priv->action_sem); | 6612 | mutex_lock(&priv->action_mutex); |
| 6539 | if (!(priv->status & STATUS_INITIALIZED)) { | 6613 | if (!(priv->status & STATUS_INITIALIZED)) { |
| 6540 | err = -EIO; | 6614 | err = -EIO; |
| 6541 | goto done; | 6615 | goto done; |
| @@ -6566,7 +6640,7 @@ static int ipw2100_wx_set_freq(struct net_device *dev, | |||
| 6566 | } | 6640 | } |
| 6567 | 6641 | ||
| 6568 | done: | 6642 | done: |
| 6569 | up(&priv->action_sem); | 6643 | mutex_unlock(&priv->action_mutex); |
| 6570 | return err; | 6644 | return err; |
| 6571 | } | 6645 | } |
| 6572 | 6646 | ||
| @@ -6607,7 +6681,7 @@ static int ipw2100_wx_set_mode(struct net_device *dev, | |||
| 6607 | if (wrqu->mode == priv->ieee->iw_mode) | 6681 | if (wrqu->mode == priv->ieee->iw_mode) |
| 6608 | return 0; | 6682 | return 0; |
| 6609 | 6683 | ||
| 6610 | down(&priv->action_sem); | 6684 | mutex_lock(&priv->action_mutex); |
| 6611 | if (!(priv->status & STATUS_INITIALIZED)) { | 6685 | if (!(priv->status & STATUS_INITIALIZED)) { |
| 6612 | err = -EIO; | 6686 | err = -EIO; |
| 6613 | goto done; | 6687 | goto done; |
| @@ -6630,7 +6704,7 @@ static int ipw2100_wx_set_mode(struct net_device *dev, | |||
| 6630 | } | 6704 | } |
| 6631 | 6705 | ||
| 6632 | done: | 6706 | done: |
| 6633 | up(&priv->action_sem); | 6707 | mutex_unlock(&priv->action_mutex); |
| 6634 | return err; | 6708 | return err; |
| 6635 | } | 6709 | } |
| 6636 | 6710 | ||
| @@ -6812,7 +6886,7 @@ static int ipw2100_wx_set_wap(struct net_device *dev, | |||
| 6812 | if (wrqu->ap_addr.sa_family != ARPHRD_ETHER) | 6886 | if (wrqu->ap_addr.sa_family != ARPHRD_ETHER) |
| 6813 | return -EINVAL; | 6887 | return -EINVAL; |
| 6814 | 6888 | ||
| 6815 | down(&priv->action_sem); | 6889 | mutex_lock(&priv->action_mutex); |
| 6816 | if (!(priv->status & STATUS_INITIALIZED)) { | 6890 | if (!(priv->status & STATUS_INITIALIZED)) { |
| 6817 | err = -EIO; | 6891 | err = -EIO; |
| 6818 | goto done; | 6892 | goto done; |
| @@ -6841,7 +6915,7 @@ static int ipw2100_wx_set_wap(struct net_device *dev, | |||
| 6841 | wrqu->ap_addr.sa_data[5] & 0xff); | 6915 | wrqu->ap_addr.sa_data[5] & 0xff); |
| 6842 | 6916 | ||
| 6843 | done: | 6917 | done: |
| 6844 | up(&priv->action_sem); | 6918 | mutex_unlock(&priv->action_mutex); |
| 6845 | return err; | 6919 | return err; |
| 6846 | } | 6920 | } |
| 6847 | 6921 | ||
| @@ -6877,7 +6951,7 @@ static int ipw2100_wx_set_essid(struct net_device *dev, | |||
| 6877 | int length = 0; | 6951 | int length = 0; |
| 6878 | int err = 0; | 6952 | int err = 0; |
| 6879 | 6953 | ||
| 6880 | down(&priv->action_sem); | 6954 | mutex_lock(&priv->action_mutex); |
| 6881 | if (!(priv->status & STATUS_INITIALIZED)) { | 6955 | if (!(priv->status & STATUS_INITIALIZED)) { |
| 6882 | err = -EIO; | 6956 | err = -EIO; |
| 6883 | goto done; | 6957 | goto done; |
| @@ -6914,7 +6988,7 @@ static int ipw2100_wx_set_essid(struct net_device *dev, | |||
| 6914 | err = ipw2100_set_essid(priv, essid, length, 0); | 6988 | err = ipw2100_set_essid(priv, essid, length, 0); |
| 6915 | 6989 | ||
| 6916 | done: | 6990 | done: |
| 6917 | up(&priv->action_sem); | 6991 | mutex_unlock(&priv->action_mutex); |
| 6918 | return err; | 6992 | return err; |
| 6919 | } | 6993 | } |
| 6920 | 6994 | ||
| @@ -6995,7 +7069,7 @@ static int ipw2100_wx_set_rate(struct net_device *dev, | |||
| 6995 | u32 rate; | 7069 | u32 rate; |
| 6996 | int err = 0; | 7070 | int err = 0; |
| 6997 | 7071 | ||
| 6998 | down(&priv->action_sem); | 7072 | mutex_lock(&priv->action_mutex); |
| 6999 | if (!(priv->status & STATUS_INITIALIZED)) { | 7073 | if (!(priv->status & STATUS_INITIALIZED)) { |
| 7000 | err = -EIO; | 7074 | err = -EIO; |
| 7001 | goto done; | 7075 | goto done; |
| @@ -7022,7 +7096,7 @@ static int ipw2100_wx_set_rate(struct net_device *dev, | |||
| 7022 | 7096 | ||
| 7023 | IPW_DEBUG_WX("SET Rate -> %04X \n", rate); | 7097 | IPW_DEBUG_WX("SET Rate -> %04X \n", rate); |
| 7024 | done: | 7098 | done: |
| 7025 | up(&priv->action_sem); | 7099 | mutex_unlock(&priv->action_mutex); |
| 7026 | return err; | 7100 | return err; |
| 7027 | } | 7101 | } |
| 7028 | 7102 | ||
| @@ -7042,7 +7116,7 @@ static int ipw2100_wx_get_rate(struct net_device *dev, | |||
| 7042 | return 0; | 7116 | return 0; |
| 7043 | } | 7117 | } |
| 7044 | 7118 | ||
| 7045 | down(&priv->action_sem); | 7119 | mutex_lock(&priv->action_mutex); |
| 7046 | if (!(priv->status & STATUS_INITIALIZED)) { | 7120 | if (!(priv->status & STATUS_INITIALIZED)) { |
| 7047 | err = -EIO; | 7121 | err = -EIO; |
| 7048 | goto done; | 7122 | goto done; |
| @@ -7074,7 +7148,7 @@ static int ipw2100_wx_get_rate(struct net_device *dev, | |||
| 7074 | IPW_DEBUG_WX("GET Rate -> %d \n", wrqu->bitrate.value); | 7148 | IPW_DEBUG_WX("GET Rate -> %d \n", wrqu->bitrate.value); |
| 7075 | 7149 | ||
| 7076 | done: | 7150 | done: |
| 7077 | up(&priv->action_sem); | 7151 | mutex_unlock(&priv->action_mutex); |
| 7078 | return err; | 7152 | return err; |
| 7079 | } | 7153 | } |
| 7080 | 7154 | ||
| @@ -7089,7 +7163,7 @@ static int ipw2100_wx_set_rts(struct net_device *dev, | |||
| 7089 | if (wrqu->rts.fixed == 0) | 7163 | if (wrqu->rts.fixed == 0) |
| 7090 | return -EINVAL; | 7164 | return -EINVAL; |
| 7091 | 7165 | ||
| 7092 | down(&priv->action_sem); | 7166 | mutex_lock(&priv->action_mutex); |
| 7093 | if (!(priv->status & STATUS_INITIALIZED)) { | 7167 | if (!(priv->status & STATUS_INITIALIZED)) { |
| 7094 | err = -EIO; | 7168 | err = -EIO; |
| 7095 | goto done; | 7169 | goto done; |
| @@ -7109,7 +7183,7 @@ static int ipw2100_wx_set_rts(struct net_device *dev, | |||
| 7109 | 7183 | ||
| 7110 | IPW_DEBUG_WX("SET RTS Threshold -> 0x%08X \n", value); | 7184 | IPW_DEBUG_WX("SET RTS Threshold -> 0x%08X \n", value); |
| 7111 | done: | 7185 | done: |
| 7112 | up(&priv->action_sem); | 7186 | mutex_unlock(&priv->action_mutex); |
| 7113 | return err; | 7187 | return err; |
| 7114 | } | 7188 | } |
| 7115 | 7189 | ||
| @@ -7160,7 +7234,7 @@ static int ipw2100_wx_set_txpow(struct net_device *dev, | |||
| 7160 | value = wrqu->txpower.value; | 7234 | value = wrqu->txpower.value; |
| 7161 | } | 7235 | } |
| 7162 | 7236 | ||
| 7163 | down(&priv->action_sem); | 7237 | mutex_lock(&priv->action_mutex); |
| 7164 | if (!(priv->status & STATUS_INITIALIZED)) { | 7238 | if (!(priv->status & STATUS_INITIALIZED)) { |
| 7165 | err = -EIO; | 7239 | err = -EIO; |
| 7166 | goto done; | 7240 | goto done; |
| @@ -7171,7 +7245,7 @@ static int ipw2100_wx_set_txpow(struct net_device *dev, | |||
| 7171 | IPW_DEBUG_WX("SET TX Power -> %d \n", value); | 7245 | IPW_DEBUG_WX("SET TX Power -> %d \n", value); |
| 7172 | 7246 | ||
| 7173 | done: | 7247 | done: |
| 7174 | up(&priv->action_sem); | 7248 | mutex_unlock(&priv->action_mutex); |
| 7175 | return err; | 7249 | return err; |
| 7176 | } | 7250 | } |
| 7177 | 7251 | ||
| @@ -7263,7 +7337,7 @@ static int ipw2100_wx_set_retry(struct net_device *dev, | |||
| 7263 | if (!(wrqu->retry.flags & IW_RETRY_LIMIT)) | 7337 | if (!(wrqu->retry.flags & IW_RETRY_LIMIT)) |
| 7264 | return 0; | 7338 | return 0; |
| 7265 | 7339 | ||
| 7266 | down(&priv->action_sem); | 7340 | mutex_lock(&priv->action_mutex); |
| 7267 | if (!(priv->status & STATUS_INITIALIZED)) { | 7341 | if (!(priv->status & STATUS_INITIALIZED)) { |
| 7268 | err = -EIO; | 7342 | err = -EIO; |
| 7269 | goto done; | 7343 | goto done; |
| @@ -7290,7 +7364,7 @@ static int ipw2100_wx_set_retry(struct net_device *dev, | |||
| 7290 | IPW_DEBUG_WX("SET Both Retry Limits -> %d \n", wrqu->retry.value); | 7364 | IPW_DEBUG_WX("SET Both Retry Limits -> %d \n", wrqu->retry.value); |
| 7291 | 7365 | ||
| 7292 | done: | 7366 | done: |
| 7293 | up(&priv->action_sem); | 7367 | mutex_unlock(&priv->action_mutex); |
| 7294 | return err; | 7368 | return err; |
| 7295 | } | 7369 | } |
| 7296 | 7370 | ||
| @@ -7333,7 +7407,7 @@ static int ipw2100_wx_set_scan(struct net_device *dev, | |||
| 7333 | struct ipw2100_priv *priv = ieee80211_priv(dev); | 7407 | struct ipw2100_priv *priv = ieee80211_priv(dev); |
| 7334 | int err = 0; | 7408 | int err = 0; |
| 7335 | 7409 | ||
| 7336 | down(&priv->action_sem); | 7410 | mutex_lock(&priv->action_mutex); |
| 7337 | if (!(priv->status & STATUS_INITIALIZED)) { | 7411 | if (!(priv->status & STATUS_INITIALIZED)) { |
| 7338 | err = -EIO; | 7412 | err = -EIO; |
| 7339 | goto done; | 7413 | goto done; |
| @@ -7348,7 +7422,7 @@ static int ipw2100_wx_set_scan(struct net_device *dev, | |||
| 7348 | } | 7422 | } |
| 7349 | 7423 | ||
| 7350 | done: | 7424 | done: |
| 7351 | up(&priv->action_sem); | 7425 | mutex_unlock(&priv->action_mutex); |
| 7352 | return err; | 7426 | return err; |
| 7353 | } | 7427 | } |
| 7354 | 7428 | ||
| @@ -7398,7 +7472,7 @@ static int ipw2100_wx_set_power(struct net_device *dev, | |||
| 7398 | struct ipw2100_priv *priv = ieee80211_priv(dev); | 7472 | struct ipw2100_priv *priv = ieee80211_priv(dev); |
| 7399 | int err = 0; | 7473 | int err = 0; |
| 7400 | 7474 | ||
| 7401 | down(&priv->action_sem); | 7475 | mutex_lock(&priv->action_mutex); |
| 7402 | if (!(priv->status & STATUS_INITIALIZED)) { | 7476 | if (!(priv->status & STATUS_INITIALIZED)) { |
| 7403 | err = -EIO; | 7477 | err = -EIO; |
| 7404 | goto done; | 7478 | goto done; |
| @@ -7431,7 +7505,7 @@ static int ipw2100_wx_set_power(struct net_device *dev, | |||
| 7431 | IPW_DEBUG_WX("SET Power Management Mode -> 0x%02X\n", priv->power_mode); | 7505 | IPW_DEBUG_WX("SET Power Management Mode -> 0x%02X\n", priv->power_mode); |
| 7432 | 7506 | ||
| 7433 | done: | 7507 | done: |
| 7434 | up(&priv->action_sem); | 7508 | mutex_unlock(&priv->action_mutex); |
| 7435 | return err; | 7509 | return err; |
| 7436 | 7510 | ||
| 7437 | } | 7511 | } |
| @@ -7735,7 +7809,7 @@ static int ipw2100_wx_set_promisc(struct net_device *dev, | |||
| 7735 | int enable = (parms[0] > 0); | 7809 | int enable = (parms[0] > 0); |
| 7736 | int err = 0; | 7810 | int err = 0; |
| 7737 | 7811 | ||
| 7738 | down(&priv->action_sem); | 7812 | mutex_lock(&priv->action_mutex); |
| 7739 | if (!(priv->status & STATUS_INITIALIZED)) { | 7813 | if (!(priv->status & STATUS_INITIALIZED)) { |
| 7740 | err = -EIO; | 7814 | err = -EIO; |
| 7741 | goto done; | 7815 | goto done; |
| @@ -7753,7 +7827,7 @@ static int ipw2100_wx_set_promisc(struct net_device *dev, | |||
| 7753 | err = ipw2100_switch_mode(priv, priv->last_mode); | 7827 | err = ipw2100_switch_mode(priv, priv->last_mode); |
| 7754 | } | 7828 | } |
| 7755 | done: | 7829 | done: |
| 7756 | up(&priv->action_sem); | 7830 | mutex_unlock(&priv->action_mutex); |
| 7757 | return err; | 7831 | return err; |
| 7758 | } | 7832 | } |
| 7759 | 7833 | ||
| @@ -7776,7 +7850,7 @@ static int ipw2100_wx_set_powermode(struct net_device *dev, | |||
| 7776 | struct ipw2100_priv *priv = ieee80211_priv(dev); | 7850 | struct ipw2100_priv *priv = ieee80211_priv(dev); |
| 7777 | int err = 0, mode = *(int *)extra; | 7851 | int err = 0, mode = *(int *)extra; |
| 7778 | 7852 | ||
| 7779 | down(&priv->action_sem); | 7853 | mutex_lock(&priv->action_mutex); |
| 7780 | if (!(priv->status & STATUS_INITIALIZED)) { | 7854 | if (!(priv->status & STATUS_INITIALIZED)) { |
| 7781 | err = -EIO; | 7855 | err = -EIO; |
| 7782 | goto done; | 7856 | goto done; |
| @@ -7788,7 +7862,7 @@ static int ipw2100_wx_set_powermode(struct net_device *dev, | |||
| 7788 | if (priv->power_mode != mode) | 7862 | if (priv->power_mode != mode) |
| 7789 | err = ipw2100_set_power_mode(priv, mode); | 7863 | err = ipw2100_set_power_mode(priv, mode); |
| 7790 | done: | 7864 | done: |
| 7791 | up(&priv->action_sem); | 7865 | mutex_unlock(&priv->action_mutex); |
| 7792 | return err; | 7866 | return err; |
| 7793 | } | 7867 | } |
| 7794 | 7868 | ||
| @@ -7840,7 +7914,7 @@ static int ipw2100_wx_set_preamble(struct net_device *dev, | |||
| 7840 | struct ipw2100_priv *priv = ieee80211_priv(dev); | 7914 | struct ipw2100_priv *priv = ieee80211_priv(dev); |
| 7841 | int err, mode = *(int *)extra; | 7915 | int err, mode = *(int *)extra; |
| 7842 | 7916 | ||
| 7843 | down(&priv->action_sem); | 7917 | mutex_lock(&priv->action_mutex); |
| 7844 | if (!(priv->status & STATUS_INITIALIZED)) { | 7918 | if (!(priv->status & STATUS_INITIALIZED)) { |
| 7845 | err = -EIO; | 7919 | err = -EIO; |
| 7846 | goto done; | 7920 | goto done; |
| @@ -7858,7 +7932,7 @@ static int ipw2100_wx_set_preamble(struct net_device *dev, | |||
| 7858 | err = ipw2100_system_config(priv, 0); | 7932 | err = ipw2100_system_config(priv, 0); |
| 7859 | 7933 | ||
| 7860 | done: | 7934 | done: |
| 7861 | up(&priv->action_sem); | 7935 | mutex_unlock(&priv->action_mutex); |
| 7862 | return err; | 7936 | return err; |
| 7863 | } | 7937 | } |
| 7864 | 7938 | ||
| @@ -7888,7 +7962,7 @@ static int ipw2100_wx_set_crc_check(struct net_device *dev, | |||
| 7888 | struct ipw2100_priv *priv = ieee80211_priv(dev); | 7962 | struct ipw2100_priv *priv = ieee80211_priv(dev); |
| 7889 | int err, mode = *(int *)extra; | 7963 | int err, mode = *(int *)extra; |
| 7890 | 7964 | ||
| 7891 | down(&priv->action_sem); | 7965 | mutex_lock(&priv->action_mutex); |
| 7892 | if (!(priv->status & STATUS_INITIALIZED)) { | 7966 | if (!(priv->status & STATUS_INITIALIZED)) { |
| 7893 | err = -EIO; | 7967 | err = -EIO; |
| 7894 | goto done; | 7968 | goto done; |
| @@ -7905,7 +7979,7 @@ static int ipw2100_wx_set_crc_check(struct net_device *dev, | |||
| 7905 | err = 0; | 7979 | err = 0; |
| 7906 | 7980 | ||
| 7907 | done: | 7981 | done: |
| 7908 | up(&priv->action_sem); | 7982 | mutex_unlock(&priv->action_mutex); |
| 7909 | return err; | 7983 | return err; |
| 7910 | } | 7984 | } |
| 7911 | 7985 | ||
| @@ -8210,11 +8284,11 @@ static void ipw2100_wx_event_work(struct ipw2100_priv *priv) | |||
| 8210 | if (priv->status & STATUS_STOPPING) | 8284 | if (priv->status & STATUS_STOPPING) |
| 8211 | return; | 8285 | return; |
| 8212 | 8286 | ||
| 8213 | down(&priv->action_sem); | 8287 | mutex_lock(&priv->action_mutex); |
| 8214 | 8288 | ||
| 8215 | IPW_DEBUG_WX("enter\n"); | 8289 | IPW_DEBUG_WX("enter\n"); |
| 8216 | 8290 | ||
| 8217 | up(&priv->action_sem); | 8291 | mutex_unlock(&priv->action_mutex); |
| 8218 | 8292 | ||
| 8219 | wrqu.ap_addr.sa_family = ARPHRD_ETHER; | 8293 | wrqu.ap_addr.sa_family = ARPHRD_ETHER; |
| 8220 | 8294 | ||
| @@ -8237,7 +8311,7 @@ static void ipw2100_wx_event_work(struct ipw2100_priv *priv) | |||
| 8237 | 8311 | ||
| 8238 | if (!(priv->status & STATUS_ASSOCIATED)) { | 8312 | if (!(priv->status & STATUS_ASSOCIATED)) { |
| 8239 | IPW_DEBUG_WX("Configuring ESSID\n"); | 8313 | IPW_DEBUG_WX("Configuring ESSID\n"); |
| 8240 | down(&priv->action_sem); | 8314 | mutex_lock(&priv->action_mutex); |
| 8241 | /* This is a disassociation event, so kick the firmware to | 8315 | /* This is a disassociation event, so kick the firmware to |
| 8242 | * look for another AP */ | 8316 | * look for another AP */ |
| 8243 | if (priv->config & CFG_STATIC_ESSID) | 8317 | if (priv->config & CFG_STATIC_ESSID) |
| @@ -8245,7 +8319,7 @@ static void ipw2100_wx_event_work(struct ipw2100_priv *priv) | |||
| 8245 | 0); | 8319 | 0); |
| 8246 | else | 8320 | else |
| 8247 | ipw2100_set_essid(priv, NULL, 0, 0); | 8321 | ipw2100_set_essid(priv, NULL, 0, 0); |
| 8248 | up(&priv->action_sem); | 8322 | mutex_unlock(&priv->action_mutex); |
| 8249 | } | 8323 | } |
| 8250 | 8324 | ||
| 8251 | wireless_send_event(priv->net_dev, SIOCGIWAP, &wrqu, NULL); | 8325 | wireless_send_event(priv->net_dev, SIOCGIWAP, &wrqu, NULL); |
