aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ipw2100.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/ipw2100.c')
-rw-r--r--drivers/net/wireless/ipw2100.c266
1 files changed, 183 insertions, 83 deletions
diff --git a/drivers/net/wireless/ipw2100.c b/drivers/net/wireless/ipw2100.c
index 6290c9f7e939..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 "1.1.3" 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
@@ -1672,6 +1672,18 @@ static int ipw2100_start_scan(struct ipw2100_priv *priv)
1672 return err; 1672 return err;
1673} 1673}
1674 1674
1675static const struct ieee80211_geo ipw_geos[] = {
1676 { /* Restricted */
1677 "---",
1678 .bg_channels = 14,
1679 .bg = {{2412, 1}, {2417, 2}, {2422, 3},
1680 {2427, 4}, {2432, 5}, {2437, 6},
1681 {2442, 7}, {2447, 8}, {2452, 9},
1682 {2457, 10}, {2462, 11}, {2467, 12},
1683 {2472, 13}, {2484, 14}},
1684 },
1685};
1686
1675static int ipw2100_up(struct ipw2100_priv *priv, int deferred) 1687static int ipw2100_up(struct ipw2100_priv *priv, int deferred)
1676{ 1688{
1677 unsigned long flags; 1689 unsigned long flags;
@@ -1727,6 +1739,13 @@ static int ipw2100_up(struct ipw2100_priv *priv, int deferred)
1727 goto exit; 1739 goto exit;
1728 } 1740 }
1729 1741
1742 /* Initialize the geo */
1743 if (ieee80211_set_geo(priv->ieee, &ipw_geos[0])) {
1744 printk(KERN_WARNING DRV_NAME "Could not set geo\n");
1745 return 0;
1746 }
1747 priv->ieee->freq_band = IEEE80211_24GHZ_BAND;
1748
1730 lock = LOCK_NONE; 1749 lock = LOCK_NONE;
1731 if (ipw2100_set_ordinal(priv, IPW_ORD_PERS_DB_LOCK, &lock, &ord_len)) { 1750 if (ipw2100_set_ordinal(priv, IPW_ORD_PERS_DB_LOCK, &lock, &ord_len)) {
1732 printk(KERN_ERR DRV_NAME 1751 printk(KERN_ERR DRV_NAME
@@ -1869,7 +1888,7 @@ static void ipw2100_reset_adapter(struct ipw2100_priv *priv)
1869 priv->status |= STATUS_RESET_PENDING; 1888 priv->status |= STATUS_RESET_PENDING;
1870 spin_unlock_irqrestore(&priv->low_lock, flags); 1889 spin_unlock_irqrestore(&priv->low_lock, flags);
1871 1890
1872 down(&priv->action_sem); 1891 mutex_lock(&priv->action_mutex);
1873 /* stop timed checks so that they don't interfere with reset */ 1892 /* stop timed checks so that they don't interfere with reset */
1874 priv->stop_hang_check = 1; 1893 priv->stop_hang_check = 1;
1875 cancel_delayed_work(&priv->hang_check); 1894 cancel_delayed_work(&priv->hang_check);
@@ -1879,7 +1898,7 @@ static void ipw2100_reset_adapter(struct ipw2100_priv *priv)
1879 wireless_send_event(priv->net_dev, SIOCGIWAP, &wrqu, NULL); 1898 wireless_send_event(priv->net_dev, SIOCGIWAP, &wrqu, NULL);
1880 1899
1881 ipw2100_up(priv, 0); 1900 ipw2100_up(priv, 0);
1882 up(&priv->action_sem); 1901 mutex_unlock(&priv->action_mutex);
1883 1902
1884} 1903}
1885 1904
@@ -2371,15 +2390,6 @@ static void isr_rx(struct ipw2100_priv *priv, int i,
2371 IPW_DEBUG_DROP("Dropping packet while interface is not up.\n"); 2390 IPW_DEBUG_DROP("Dropping packet while interface is not up.\n");
2372 return; 2391 return;
2373 } 2392 }
2374#ifdef CONFIG_IPW2100_MONITOR
2375 if (unlikely(priv->ieee->iw_mode == IW_MODE_MONITOR &&
2376 priv->config & CFG_CRC_CHECK &&
2377 status->flags & IPW_STATUS_FLAG_CRC_ERROR)) {
2378 IPW_DEBUG_RX("CRC error in packet. Dropping.\n");
2379 priv->ieee->stats.rx_errors++;
2380 return;
2381 }
2382#endif
2383 2393
2384 if (unlikely(priv->ieee->iw_mode != IW_MODE_MONITOR && 2394 if (unlikely(priv->ieee->iw_mode != IW_MODE_MONITOR &&
2385 !(priv->status & STATUS_ASSOCIATED))) { 2395 !(priv->status & STATUS_ASSOCIATED))) {
@@ -2427,6 +2437,89 @@ static void isr_rx(struct ipw2100_priv *priv, int i,
2427 priv->rx_queue.drv[i].host_addr = packet->dma_addr; 2437 priv->rx_queue.drv[i].host_addr = packet->dma_addr;
2428} 2438}
2429 2439
2440#ifdef CONFIG_IPW2100_MONITOR
2441
2442static 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
2430static int ipw2100_corruption_check(struct ipw2100_priv *priv, int i) 2523static int ipw2100_corruption_check(struct ipw2100_priv *priv, int i)
2431{ 2524{
2432 struct ipw2100_status *status = &priv->status_queue.drv[i]; 2525 struct ipw2100_status *status = &priv->status_queue.drv[i];
@@ -2558,7 +2651,7 @@ static void __ipw2100_rx_process(struct ipw2100_priv *priv)
2558 case P8023_DATA_VAL: 2651 case P8023_DATA_VAL:
2559#ifdef CONFIG_IPW2100_MONITOR 2652#ifdef CONFIG_IPW2100_MONITOR
2560 if (priv->ieee->iw_mode == IW_MODE_MONITOR) { 2653 if (priv->ieee->iw_mode == IW_MODE_MONITOR) {
2561 isr_rx(priv, i, &stats); 2654 isr_rx_monitor(priv, i, &stats);
2562 break; 2655 break;
2563 } 2656 }
2564#endif 2657#endif
@@ -3750,7 +3843,7 @@ static ssize_t store_memory(struct device *d, struct device_attribute *attr,
3750 struct net_device *dev = priv->net_dev; 3843 struct net_device *dev = priv->net_dev;
3751 const char *p = buf; 3844 const char *p = buf;
3752 3845
3753 (void) dev; /* kill unused-var warning for debug-only code */ 3846 (void)dev; /* kill unused-var warning for debug-only code */
3754 3847
3755 if (count < 1) 3848 if (count < 1)
3756 return count; 3849 return count;
@@ -3863,7 +3956,7 @@ static int ipw2100_switch_mode(struct ipw2100_priv *priv, u32 mode)
3863#ifdef CONFIG_IPW2100_MONITOR 3956#ifdef CONFIG_IPW2100_MONITOR
3864 case IW_MODE_MONITOR: 3957 case IW_MODE_MONITOR:
3865 priv->last_mode = priv->ieee->iw_mode; 3958 priv->last_mode = priv->ieee->iw_mode;
3866 priv->net_dev->type = ARPHRD_IEEE80211; 3959 priv->net_dev->type = ARPHRD_IEEE80211_RADIOTAP;
3867 break; 3960 break;
3868#endif /* CONFIG_IPW2100_MONITOR */ 3961#endif /* CONFIG_IPW2100_MONITOR */
3869 } 3962 }
@@ -4070,7 +4163,7 @@ static ssize_t store_scan_age(struct device *d, struct device_attribute *attr,
4070 unsigned long val; 4163 unsigned long val;
4071 char *p = buffer; 4164 char *p = buffer;
4072 4165
4073 (void) dev; /* kill unused-var warning for debug-only code */ 4166 (void)dev; /* kill unused-var warning for debug-only code */
4074 4167
4075 IPW_DEBUG_INFO("enter\n"); 4168 IPW_DEBUG_INFO("enter\n");
4076 4169
@@ -4119,7 +4212,7 @@ static int ipw_radio_kill_sw(struct ipw2100_priv *priv, int disable_radio)
4119 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",
4120 disable_radio ? "OFF" : "ON"); 4213 disable_radio ? "OFF" : "ON");
4121 4214
4122 down(&priv->action_sem); 4215 mutex_lock(&priv->action_mutex);
4123 4216
4124 if (disable_radio) { 4217 if (disable_radio) {
4125 priv->status |= STATUS_RF_KILL_SW; 4218 priv->status |= STATUS_RF_KILL_SW;
@@ -4137,7 +4230,7 @@ static int ipw_radio_kill_sw(struct ipw2100_priv *priv, int disable_radio)
4137 schedule_reset(priv); 4230 schedule_reset(priv);
4138 } 4231 }
4139 4232
4140 up(&priv->action_sem); 4233 mutex_unlock(&priv->action_mutex);
4141 return 1; 4234 return 1;
4142} 4235}
4143 4236
@@ -5107,12 +5200,13 @@ static int ipw2100_set_tx_power(struct ipw2100_priv *priv, u32 tx_power)
5107 .host_command_length = 4 5200 .host_command_length = 4
5108 }; 5201 };
5109 int err = 0; 5202 int err = 0;
5203 u32 tmp = tx_power;
5110 5204
5111 if (tx_power != IPW_TX_POWER_DEFAULT) 5205 if (tx_power != IPW_TX_POWER_DEFAULT)
5112 tx_power = (tx_power - IPW_TX_POWER_MIN_DBM) * 16 / 5206 tmp = (tx_power - IPW_TX_POWER_MIN_DBM) * 16 /
5113 (IPW_TX_POWER_MAX_DBM - IPW_TX_POWER_MIN_DBM); 5207 (IPW_TX_POWER_MAX_DBM - IPW_TX_POWER_MIN_DBM);
5114 5208
5115 cmd.host_command_parameters[0] = tx_power; 5209 cmd.host_command_parameters[0] = tmp;
5116 5210
5117 if (priv->ieee->iw_mode == IW_MODE_ADHOC) 5211 if (priv->ieee->iw_mode == IW_MODE_ADHOC)
5118 err = ipw2100_hw_send_command(priv, &cmd); 5212 err = ipw2100_hw_send_command(priv, &cmd);
@@ -5365,9 +5459,12 @@ static int ipw2100_configure_security(struct ipw2100_priv *priv, int batch_mode)
5365 SEC_LEVEL_0, 0, 1); 5459 SEC_LEVEL_0, 0, 1);
5366 } else { 5460 } else {
5367 auth_mode = IPW_AUTH_OPEN; 5461 auth_mode = IPW_AUTH_OPEN;
5368 if ((priv->ieee->sec.flags & SEC_AUTH_MODE) && 5462 if (priv->ieee->sec.flags & SEC_AUTH_MODE) {
5369 (priv->ieee->sec.auth_mode == WLAN_AUTH_SHARED_KEY)) 5463 if (priv->ieee->sec.auth_mode == WLAN_AUTH_SHARED_KEY)
5370 auth_mode = IPW_AUTH_SHARED; 5464 auth_mode = IPW_AUTH_SHARED;
5465 else if (priv->ieee->sec.auth_mode == WLAN_AUTH_LEAP)
5466 auth_mode = IPW_AUTH_LEAP_CISCO_ID;
5467 }
5371 5468
5372 sec_level = SEC_LEVEL_0; 5469 sec_level = SEC_LEVEL_0;
5373 if (priv->ieee->sec.flags & SEC_LEVEL) 5470 if (priv->ieee->sec.flags & SEC_LEVEL)
@@ -5437,7 +5534,7 @@ static void shim__set_security(struct net_device *dev,
5437 struct ipw2100_priv *priv = ieee80211_priv(dev); 5534 struct ipw2100_priv *priv = ieee80211_priv(dev);
5438 int i, force_update = 0; 5535 int i, force_update = 0;
5439 5536
5440 down(&priv->action_sem); 5537 mutex_lock(&priv->action_mutex);
5441 if (!(priv->status & STATUS_INITIALIZED)) 5538 if (!(priv->status & STATUS_INITIALIZED))
5442 goto done; 5539 goto done;
5443 5540
@@ -5510,7 +5607,7 @@ static void shim__set_security(struct net_device *dev,
5510 if (!(priv->status & (STATUS_ASSOCIATED | STATUS_ASSOCIATING))) 5607 if (!(priv->status & (STATUS_ASSOCIATED | STATUS_ASSOCIATING)))
5511 ipw2100_configure_security(priv, 0); 5608 ipw2100_configure_security(priv, 0);
5512 done: 5609 done:
5513 up(&priv->action_sem); 5610 mutex_unlock(&priv->action_mutex);
5514} 5611}
5515 5612
5516static int ipw2100_adapter_setup(struct ipw2100_priv *priv) 5613static int ipw2100_adapter_setup(struct ipw2100_priv *priv)
@@ -5634,7 +5731,7 @@ static int ipw2100_set_address(struct net_device *dev, void *p)
5634 if (!is_valid_ether_addr(addr->sa_data)) 5731 if (!is_valid_ether_addr(addr->sa_data))
5635 return -EADDRNOTAVAIL; 5732 return -EADDRNOTAVAIL;
5636 5733
5637 down(&priv->action_sem); 5734 mutex_lock(&priv->action_mutex);
5638 5735
5639 priv->config |= CFG_CUSTOM_MAC; 5736 priv->config |= CFG_CUSTOM_MAC;
5640 memcpy(priv->mac_addr, addr->sa_data, ETH_ALEN); 5737 memcpy(priv->mac_addr, addr->sa_data, ETH_ALEN);
@@ -5644,12 +5741,12 @@ static int ipw2100_set_address(struct net_device *dev, void *p)
5644 goto done; 5741 goto done;
5645 5742
5646 priv->reset_backoff = 0; 5743 priv->reset_backoff = 0;
5647 up(&priv->action_sem); 5744 mutex_unlock(&priv->action_mutex);
5648 ipw2100_reset_adapter(priv); 5745 ipw2100_reset_adapter(priv);
5649 return 0; 5746 return 0;
5650 5747
5651 done: 5748 done:
5652 up(&priv->action_sem); 5749 mutex_unlock(&priv->action_mutex);
5653 return err; 5750 return err;
5654} 5751}
5655 5752
@@ -5760,6 +5857,9 @@ static int ipw2100_wpa_set_auth_algs(struct ipw2100_priv *priv, int value)
5760 } else if (value & IW_AUTH_ALG_OPEN_SYSTEM) { 5857 } else if (value & IW_AUTH_ALG_OPEN_SYSTEM) {
5761 sec.auth_mode = WLAN_AUTH_OPEN; 5858 sec.auth_mode = WLAN_AUTH_OPEN;
5762 ieee->open_wep = 1; 5859 ieee->open_wep = 1;
5860 } else if (value & IW_AUTH_ALG_LEAP) {
5861 sec.auth_mode = WLAN_AUTH_LEAP;
5862 ieee->open_wep = 1;
5763 } else 5863 } else
5764 return -EINVAL; 5864 return -EINVAL;
5765 5865
@@ -5771,8 +5871,8 @@ static int ipw2100_wpa_set_auth_algs(struct ipw2100_priv *priv, int value)
5771 return ret; 5871 return ret;
5772} 5872}
5773 5873
5774void ipw2100_wpa_assoc_frame(struct ipw2100_priv *priv, 5874static void ipw2100_wpa_assoc_frame(struct ipw2100_priv *priv,
5775 char *wpa_ie, int wpa_ie_len) 5875 char *wpa_ie, int wpa_ie_len)
5776{ 5876{
5777 5877
5778 struct ipw2100_wpa_assoc_frame frame; 5878 struct ipw2100_wpa_assoc_frame frame;
@@ -5989,8 +6089,8 @@ static struct net_device *ipw2100_alloc_device(struct pci_dev *pci_dev,
5989 strcpy(priv->nick, "ipw2100"); 6089 strcpy(priv->nick, "ipw2100");
5990 6090
5991 spin_lock_init(&priv->low_lock); 6091 spin_lock_init(&priv->low_lock);
5992 sema_init(&priv->action_sem, 1); 6092 mutex_init(&priv->action_mutex);
5993 sema_init(&priv->adapter_sem, 1); 6093 mutex_init(&priv->adapter_mutex);
5994 6094
5995 init_waitqueue_head(&priv->wait_command_queue); 6095 init_waitqueue_head(&priv->wait_command_queue);
5996 6096
@@ -6155,7 +6255,7 @@ static int ipw2100_pci_init_one(struct pci_dev *pci_dev,
6155 * 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.
6156 * net_dev->init is called after name allocation but before the 6256 * net_dev->init is called after name allocation but before the
6157 * notifier chain is called */ 6257 * notifier chain is called */
6158 down(&priv->action_sem); 6258 mutex_lock(&priv->action_mutex);
6159 err = register_netdev(dev); 6259 err = register_netdev(dev);
6160 if (err) { 6260 if (err) {
6161 printk(KERN_WARNING DRV_NAME 6261 printk(KERN_WARNING DRV_NAME
@@ -6191,12 +6291,12 @@ static int ipw2100_pci_init_one(struct pci_dev *pci_dev,
6191 6291
6192 priv->status |= STATUS_INITIALIZED; 6292 priv->status |= STATUS_INITIALIZED;
6193 6293
6194 up(&priv->action_sem); 6294 mutex_unlock(&priv->action_mutex);
6195 6295
6196 return 0; 6296 return 0;
6197 6297
6198 fail_unlock: 6298 fail_unlock:
6199 up(&priv->action_sem); 6299 mutex_unlock(&priv->action_mutex);
6200 6300
6201 fail: 6301 fail:
6202 if (dev) { 6302 if (dev) {
@@ -6236,7 +6336,7 @@ static void __devexit ipw2100_pci_remove_one(struct pci_dev *pci_dev)
6236 struct net_device *dev; 6336 struct net_device *dev;
6237 6337
6238 if (priv) { 6338 if (priv) {
6239 down(&priv->action_sem); 6339 mutex_lock(&priv->action_mutex);
6240 6340
6241 priv->status &= ~STATUS_INITIALIZED; 6341 priv->status &= ~STATUS_INITIALIZED;
6242 6342
@@ -6251,9 +6351,9 @@ static void __devexit ipw2100_pci_remove_one(struct pci_dev *pci_dev)
6251 /* Take down the hardware */ 6351 /* Take down the hardware */
6252 ipw2100_down(priv); 6352 ipw2100_down(priv);
6253 6353
6254 /* Release the semaphore so that the network subsystem can 6354 /* Release the mutex so that the network subsystem can
6255 * complete any needed calls into the driver... */ 6355 * complete any needed calls into the driver... */
6256 up(&priv->action_sem); 6356 mutex_unlock(&priv->action_mutex);
6257 6357
6258 /* Unregister the device first - this results in close() 6358 /* Unregister the device first - this results in close()
6259 * being called if the device is open. If we free storage 6359 * being called if the device is open. If we free storage
@@ -6292,7 +6392,7 @@ static int ipw2100_suspend(struct pci_dev *pci_dev, pm_message_t state)
6292 6392
6293 IPW_DEBUG_INFO("%s: Going into suspend...\n", dev->name); 6393 IPW_DEBUG_INFO("%s: Going into suspend...\n", dev->name);
6294 6394
6295 down(&priv->action_sem); 6395 mutex_lock(&priv->action_mutex);
6296 if (priv->status & STATUS_INITIALIZED) { 6396 if (priv->status & STATUS_INITIALIZED) {
6297 /* Take down the device; powers it off, etc. */ 6397 /* Take down the device; powers it off, etc. */
6298 ipw2100_down(priv); 6398 ipw2100_down(priv);
@@ -6305,7 +6405,7 @@ static int ipw2100_suspend(struct pci_dev *pci_dev, pm_message_t state)
6305 pci_disable_device(pci_dev); 6405 pci_disable_device(pci_dev);
6306 pci_set_power_state(pci_dev, PCI_D3hot); 6406 pci_set_power_state(pci_dev, PCI_D3hot);
6307 6407
6308 up(&priv->action_sem); 6408 mutex_unlock(&priv->action_mutex);
6309 6409
6310 return 0; 6410 return 0;
6311} 6411}
@@ -6319,7 +6419,7 @@ static int ipw2100_resume(struct pci_dev *pci_dev)
6319 if (IPW2100_PM_DISABLED) 6419 if (IPW2100_PM_DISABLED)
6320 return 0; 6420 return 0;
6321 6421
6322 down(&priv->action_sem); 6422 mutex_lock(&priv->action_mutex);
6323 6423
6324 IPW_DEBUG_INFO("%s: Coming out of suspend...\n", dev->name); 6424 IPW_DEBUG_INFO("%s: Coming out of suspend...\n", dev->name);
6325 6425
@@ -6345,7 +6445,7 @@ static int ipw2100_resume(struct pci_dev *pci_dev)
6345 if (!(priv->status & STATUS_RF_KILL_SW)) 6445 if (!(priv->status & STATUS_RF_KILL_SW))
6346 ipw2100_up(priv, 0); 6446 ipw2100_up(priv, 0);
6347 6447
6348 up(&priv->action_sem); 6448 mutex_unlock(&priv->action_mutex);
6349 6449
6350 return 0; 6450 return 0;
6351} 6451}
@@ -6509,7 +6609,7 @@ static int ipw2100_wx_set_freq(struct net_device *dev,
6509 if (priv->ieee->iw_mode == IW_MODE_INFRA) 6609 if (priv->ieee->iw_mode == IW_MODE_INFRA)
6510 return -EOPNOTSUPP; 6610 return -EOPNOTSUPP;
6511 6611
6512 down(&priv->action_sem); 6612 mutex_lock(&priv->action_mutex);
6513 if (!(priv->status & STATUS_INITIALIZED)) { 6613 if (!(priv->status & STATUS_INITIALIZED)) {
6514 err = -EIO; 6614 err = -EIO;
6515 goto done; 6615 goto done;
@@ -6540,7 +6640,7 @@ static int ipw2100_wx_set_freq(struct net_device *dev,
6540 } 6640 }
6541 6641
6542 done: 6642 done:
6543 up(&priv->action_sem); 6643 mutex_unlock(&priv->action_mutex);
6544 return err; 6644 return err;
6545} 6645}
6546 6646
@@ -6581,7 +6681,7 @@ static int ipw2100_wx_set_mode(struct net_device *dev,
6581 if (wrqu->mode == priv->ieee->iw_mode) 6681 if (wrqu->mode == priv->ieee->iw_mode)
6582 return 0; 6682 return 0;
6583 6683
6584 down(&priv->action_sem); 6684 mutex_lock(&priv->action_mutex);
6585 if (!(priv->status & STATUS_INITIALIZED)) { 6685 if (!(priv->status & STATUS_INITIALIZED)) {
6586 err = -EIO; 6686 err = -EIO;
6587 goto done; 6687 goto done;
@@ -6604,7 +6704,7 @@ static int ipw2100_wx_set_mode(struct net_device *dev,
6604 } 6704 }
6605 6705
6606 done: 6706 done:
6607 up(&priv->action_sem); 6707 mutex_unlock(&priv->action_mutex);
6608 return err; 6708 return err;
6609} 6709}
6610 6710
@@ -6786,7 +6886,7 @@ static int ipw2100_wx_set_wap(struct net_device *dev,
6786 if (wrqu->ap_addr.sa_family != ARPHRD_ETHER) 6886 if (wrqu->ap_addr.sa_family != ARPHRD_ETHER)
6787 return -EINVAL; 6887 return -EINVAL;
6788 6888
6789 down(&priv->action_sem); 6889 mutex_lock(&priv->action_mutex);
6790 if (!(priv->status & STATUS_INITIALIZED)) { 6890 if (!(priv->status & STATUS_INITIALIZED)) {
6791 err = -EIO; 6891 err = -EIO;
6792 goto done; 6892 goto done;
@@ -6815,7 +6915,7 @@ static int ipw2100_wx_set_wap(struct net_device *dev,
6815 wrqu->ap_addr.sa_data[5] & 0xff); 6915 wrqu->ap_addr.sa_data[5] & 0xff);
6816 6916
6817 done: 6917 done:
6818 up(&priv->action_sem); 6918 mutex_unlock(&priv->action_mutex);
6819 return err; 6919 return err;
6820} 6920}
6821 6921
@@ -6851,7 +6951,7 @@ static int ipw2100_wx_set_essid(struct net_device *dev,
6851 int length = 0; 6951 int length = 0;
6852 int err = 0; 6952 int err = 0;
6853 6953
6854 down(&priv->action_sem); 6954 mutex_lock(&priv->action_mutex);
6855 if (!(priv->status & STATUS_INITIALIZED)) { 6955 if (!(priv->status & STATUS_INITIALIZED)) {
6856 err = -EIO; 6956 err = -EIO;
6857 goto done; 6957 goto done;
@@ -6888,7 +6988,7 @@ static int ipw2100_wx_set_essid(struct net_device *dev,
6888 err = ipw2100_set_essid(priv, essid, length, 0); 6988 err = ipw2100_set_essid(priv, essid, length, 0);
6889 6989
6890 done: 6990 done:
6891 up(&priv->action_sem); 6991 mutex_unlock(&priv->action_mutex);
6892 return err; 6992 return err;
6893} 6993}
6894 6994
@@ -6969,7 +7069,7 @@ static int ipw2100_wx_set_rate(struct net_device *dev,
6969 u32 rate; 7069 u32 rate;
6970 int err = 0; 7070 int err = 0;
6971 7071
6972 down(&priv->action_sem); 7072 mutex_lock(&priv->action_mutex);
6973 if (!(priv->status & STATUS_INITIALIZED)) { 7073 if (!(priv->status & STATUS_INITIALIZED)) {
6974 err = -EIO; 7074 err = -EIO;
6975 goto done; 7075 goto done;
@@ -6996,7 +7096,7 @@ static int ipw2100_wx_set_rate(struct net_device *dev,
6996 7096
6997 IPW_DEBUG_WX("SET Rate -> %04X \n", rate); 7097 IPW_DEBUG_WX("SET Rate -> %04X \n", rate);
6998 done: 7098 done:
6999 up(&priv->action_sem); 7099 mutex_unlock(&priv->action_mutex);
7000 return err; 7100 return err;
7001} 7101}
7002 7102
@@ -7016,7 +7116,7 @@ static int ipw2100_wx_get_rate(struct net_device *dev,
7016 return 0; 7116 return 0;
7017 } 7117 }
7018 7118
7019 down(&priv->action_sem); 7119 mutex_lock(&priv->action_mutex);
7020 if (!(priv->status & STATUS_INITIALIZED)) { 7120 if (!(priv->status & STATUS_INITIALIZED)) {
7021 err = -EIO; 7121 err = -EIO;
7022 goto done; 7122 goto done;
@@ -7048,7 +7148,7 @@ static int ipw2100_wx_get_rate(struct net_device *dev,
7048 IPW_DEBUG_WX("GET Rate -> %d \n", wrqu->bitrate.value); 7148 IPW_DEBUG_WX("GET Rate -> %d \n", wrqu->bitrate.value);
7049 7149
7050 done: 7150 done:
7051 up(&priv->action_sem); 7151 mutex_unlock(&priv->action_mutex);
7052 return err; 7152 return err;
7053} 7153}
7054 7154
@@ -7063,7 +7163,7 @@ static int ipw2100_wx_set_rts(struct net_device *dev,
7063 if (wrqu->rts.fixed == 0) 7163 if (wrqu->rts.fixed == 0)
7064 return -EINVAL; 7164 return -EINVAL;
7065 7165
7066 down(&priv->action_sem); 7166 mutex_lock(&priv->action_mutex);
7067 if (!(priv->status & STATUS_INITIALIZED)) { 7167 if (!(priv->status & STATUS_INITIALIZED)) {
7068 err = -EIO; 7168 err = -EIO;
7069 goto done; 7169 goto done;
@@ -7083,7 +7183,7 @@ static int ipw2100_wx_set_rts(struct net_device *dev,
7083 7183
7084 IPW_DEBUG_WX("SET RTS Threshold -> 0x%08X \n", value); 7184 IPW_DEBUG_WX("SET RTS Threshold -> 0x%08X \n", value);
7085 done: 7185 done:
7086 up(&priv->action_sem); 7186 mutex_unlock(&priv->action_mutex);
7087 return err; 7187 return err;
7088} 7188}
7089 7189
@@ -7134,7 +7234,7 @@ static int ipw2100_wx_set_txpow(struct net_device *dev,
7134 value = wrqu->txpower.value; 7234 value = wrqu->txpower.value;
7135 } 7235 }
7136 7236
7137 down(&priv->action_sem); 7237 mutex_lock(&priv->action_mutex);
7138 if (!(priv->status & STATUS_INITIALIZED)) { 7238 if (!(priv->status & STATUS_INITIALIZED)) {
7139 err = -EIO; 7239 err = -EIO;
7140 goto done; 7240 goto done;
@@ -7145,7 +7245,7 @@ static int ipw2100_wx_set_txpow(struct net_device *dev,
7145 IPW_DEBUG_WX("SET TX Power -> %d \n", value); 7245 IPW_DEBUG_WX("SET TX Power -> %d \n", value);
7146 7246
7147 done: 7247 done:
7148 up(&priv->action_sem); 7248 mutex_unlock(&priv->action_mutex);
7149 return err; 7249 return err;
7150} 7250}
7151 7251
@@ -7237,7 +7337,7 @@ static int ipw2100_wx_set_retry(struct net_device *dev,
7237 if (!(wrqu->retry.flags & IW_RETRY_LIMIT)) 7337 if (!(wrqu->retry.flags & IW_RETRY_LIMIT))
7238 return 0; 7338 return 0;
7239 7339
7240 down(&priv->action_sem); 7340 mutex_lock(&priv->action_mutex);
7241 if (!(priv->status & STATUS_INITIALIZED)) { 7341 if (!(priv->status & STATUS_INITIALIZED)) {
7242 err = -EIO; 7342 err = -EIO;
7243 goto done; 7343 goto done;
@@ -7264,7 +7364,7 @@ static int ipw2100_wx_set_retry(struct net_device *dev,
7264 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);
7265 7365
7266 done: 7366 done:
7267 up(&priv->action_sem); 7367 mutex_unlock(&priv->action_mutex);
7268 return err; 7368 return err;
7269} 7369}
7270 7370
@@ -7307,7 +7407,7 @@ static int ipw2100_wx_set_scan(struct net_device *dev,
7307 struct ipw2100_priv *priv = ieee80211_priv(dev); 7407 struct ipw2100_priv *priv = ieee80211_priv(dev);
7308 int err = 0; 7408 int err = 0;
7309 7409
7310 down(&priv->action_sem); 7410 mutex_lock(&priv->action_mutex);
7311 if (!(priv->status & STATUS_INITIALIZED)) { 7411 if (!(priv->status & STATUS_INITIALIZED)) {
7312 err = -EIO; 7412 err = -EIO;
7313 goto done; 7413 goto done;
@@ -7322,7 +7422,7 @@ static int ipw2100_wx_set_scan(struct net_device *dev,
7322 } 7422 }
7323 7423
7324 done: 7424 done:
7325 up(&priv->action_sem); 7425 mutex_unlock(&priv->action_mutex);
7326 return err; 7426 return err;
7327} 7427}
7328 7428
@@ -7372,7 +7472,7 @@ static int ipw2100_wx_set_power(struct net_device *dev,
7372 struct ipw2100_priv *priv = ieee80211_priv(dev); 7472 struct ipw2100_priv *priv = ieee80211_priv(dev);
7373 int err = 0; 7473 int err = 0;
7374 7474
7375 down(&priv->action_sem); 7475 mutex_lock(&priv->action_mutex);
7376 if (!(priv->status & STATUS_INITIALIZED)) { 7476 if (!(priv->status & STATUS_INITIALIZED)) {
7377 err = -EIO; 7477 err = -EIO;
7378 goto done; 7478 goto done;
@@ -7405,7 +7505,7 @@ static int ipw2100_wx_set_power(struct net_device *dev,
7405 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);
7406 7506
7407 done: 7507 done:
7408 up(&priv->action_sem); 7508 mutex_unlock(&priv->action_mutex);
7409 return err; 7509 return err;
7410 7510
7411} 7511}
@@ -7709,7 +7809,7 @@ static int ipw2100_wx_set_promisc(struct net_device *dev,
7709 int enable = (parms[0] > 0); 7809 int enable = (parms[0] > 0);
7710 int err = 0; 7810 int err = 0;
7711 7811
7712 down(&priv->action_sem); 7812 mutex_lock(&priv->action_mutex);
7713 if (!(priv->status & STATUS_INITIALIZED)) { 7813 if (!(priv->status & STATUS_INITIALIZED)) {
7714 err = -EIO; 7814 err = -EIO;
7715 goto done; 7815 goto done;
@@ -7727,7 +7827,7 @@ static int ipw2100_wx_set_promisc(struct net_device *dev,
7727 err = ipw2100_switch_mode(priv, priv->last_mode); 7827 err = ipw2100_switch_mode(priv, priv->last_mode);
7728 } 7828 }
7729 done: 7829 done:
7730 up(&priv->action_sem); 7830 mutex_unlock(&priv->action_mutex);
7731 return err; 7831 return err;
7732} 7832}
7733 7833
@@ -7750,7 +7850,7 @@ static int ipw2100_wx_set_powermode(struct net_device *dev,
7750 struct ipw2100_priv *priv = ieee80211_priv(dev); 7850 struct ipw2100_priv *priv = ieee80211_priv(dev);
7751 int err = 0, mode = *(int *)extra; 7851 int err = 0, mode = *(int *)extra;
7752 7852
7753 down(&priv->action_sem); 7853 mutex_lock(&priv->action_mutex);
7754 if (!(priv->status & STATUS_INITIALIZED)) { 7854 if (!(priv->status & STATUS_INITIALIZED)) {
7755 err = -EIO; 7855 err = -EIO;
7756 goto done; 7856 goto done;
@@ -7762,7 +7862,7 @@ static int ipw2100_wx_set_powermode(struct net_device *dev,
7762 if (priv->power_mode != mode) 7862 if (priv->power_mode != mode)
7763 err = ipw2100_set_power_mode(priv, mode); 7863 err = ipw2100_set_power_mode(priv, mode);
7764 done: 7864 done:
7765 up(&priv->action_sem); 7865 mutex_unlock(&priv->action_mutex);
7766 return err; 7866 return err;
7767} 7867}
7768 7868
@@ -7814,7 +7914,7 @@ static int ipw2100_wx_set_preamble(struct net_device *dev,
7814 struct ipw2100_priv *priv = ieee80211_priv(dev); 7914 struct ipw2100_priv *priv = ieee80211_priv(dev);
7815 int err, mode = *(int *)extra; 7915 int err, mode = *(int *)extra;
7816 7916
7817 down(&priv->action_sem); 7917 mutex_lock(&priv->action_mutex);
7818 if (!(priv->status & STATUS_INITIALIZED)) { 7918 if (!(priv->status & STATUS_INITIALIZED)) {
7819 err = -EIO; 7919 err = -EIO;
7820 goto done; 7920 goto done;
@@ -7832,7 +7932,7 @@ static int ipw2100_wx_set_preamble(struct net_device *dev,
7832 err = ipw2100_system_config(priv, 0); 7932 err = ipw2100_system_config(priv, 0);
7833 7933
7834 done: 7934 done:
7835 up(&priv->action_sem); 7935 mutex_unlock(&priv->action_mutex);
7836 return err; 7936 return err;
7837} 7937}
7838 7938
@@ -7862,7 +7962,7 @@ static int ipw2100_wx_set_crc_check(struct net_device *dev,
7862 struct ipw2100_priv *priv = ieee80211_priv(dev); 7962 struct ipw2100_priv *priv = ieee80211_priv(dev);
7863 int err, mode = *(int *)extra; 7963 int err, mode = *(int *)extra;
7864 7964
7865 down(&priv->action_sem); 7965 mutex_lock(&priv->action_mutex);
7866 if (!(priv->status & STATUS_INITIALIZED)) { 7966 if (!(priv->status & STATUS_INITIALIZED)) {
7867 err = -EIO; 7967 err = -EIO;
7868 goto done; 7968 goto done;
@@ -7879,7 +7979,7 @@ static int ipw2100_wx_set_crc_check(struct net_device *dev,
7879 err = 0; 7979 err = 0;
7880 7980
7881 done: 7981 done:
7882 up(&priv->action_sem); 7982 mutex_unlock(&priv->action_mutex);
7883 return err; 7983 return err;
7884} 7984}
7885 7985
@@ -8184,11 +8284,11 @@ static void ipw2100_wx_event_work(struct ipw2100_priv *priv)
8184 if (priv->status & STATUS_STOPPING) 8284 if (priv->status & STATUS_STOPPING)
8185 return; 8285 return;
8186 8286
8187 down(&priv->action_sem); 8287 mutex_lock(&priv->action_mutex);
8188 8288
8189 IPW_DEBUG_WX("enter\n"); 8289 IPW_DEBUG_WX("enter\n");
8190 8290
8191 up(&priv->action_sem); 8291 mutex_unlock(&priv->action_mutex);
8192 8292
8193 wrqu.ap_addr.sa_family = ARPHRD_ETHER; 8293 wrqu.ap_addr.sa_family = ARPHRD_ETHER;
8194 8294
@@ -8211,7 +8311,7 @@ static void ipw2100_wx_event_work(struct ipw2100_priv *priv)
8211 8311
8212 if (!(priv->status & STATUS_ASSOCIATED)) { 8312 if (!(priv->status & STATUS_ASSOCIATED)) {
8213 IPW_DEBUG_WX("Configuring ESSID\n"); 8313 IPW_DEBUG_WX("Configuring ESSID\n");
8214 down(&priv->action_sem); 8314 mutex_lock(&priv->action_mutex);
8215 /* This is a disassociation event, so kick the firmware to 8315 /* This is a disassociation event, so kick the firmware to
8216 * look for another AP */ 8316 * look for another AP */
8217 if (priv->config & CFG_STATIC_ESSID) 8317 if (priv->config & CFG_STATIC_ESSID)
@@ -8219,7 +8319,7 @@ static void ipw2100_wx_event_work(struct ipw2100_priv *priv)
8219 0); 8319 0);
8220 else 8320 else
8221 ipw2100_set_essid(priv, NULL, 0, 0); 8321 ipw2100_set_essid(priv, NULL, 0, 0);
8222 up(&priv->action_sem); 8322 mutex_unlock(&priv->action_mutex);
8223 } 8323 }
8224 8324
8225 wireless_send_event(priv->net_dev, SIOCGIWAP, &wrqu, NULL); 8325 wireless_send_event(priv->net_dev, SIOCGIWAP, &wrqu, NULL);