aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorZhu Yi <yi.zhu@intel.com>2006-01-24 03:37:05 -0500
committerJohn W. Linville <linville@tuxdriver.com>2006-01-30 20:35:33 -0500
commitc7b6a6744c3eb878e08ef992d57cd01eed457810 (patch)
treecf3b78c439b0c84f114702be7275280664a5ca9a /drivers/net
parent810dabd466fe70869b66ab64dd326b6153cef645 (diff)
[PATCH] ipw2200: use jiffies_to_msec() wherever possible
This substitutes Linux jiffies_to_msec() wherever there is a computation for determining milliseconds from jiffies, following lead from ieee80211 code. And it does a little cleanup. "it's" == "it is" ... "its" == possessive "it". Indulge me. ;-) Signed-off-by: Cahill, Ben M <ben.m.cahill@intel.com> Signed-off-by: Zhu Yi <yi.zhu@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/ipw2200.c30
-rw-r--r--drivers/net/wireless/ipw2200.h1
2 files changed, 17 insertions, 14 deletions
diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c
index e6a23c2be1af..d3aa59d0461c 100644
--- a/drivers/net/wireless/ipw2200.c
+++ b/drivers/net/wireless/ipw2200.c
@@ -2112,8 +2112,8 @@ static void ipw_scan_check(void *data)
2112 struct ipw_priv *priv = data; 2112 struct ipw_priv *priv = data;
2113 if (priv->status & (STATUS_SCANNING | STATUS_SCAN_ABORTING)) { 2113 if (priv->status & (STATUS_SCANNING | STATUS_SCAN_ABORTING)) {
2114 IPW_DEBUG_SCAN("Scan completion watchdog resetting " 2114 IPW_DEBUG_SCAN("Scan completion watchdog resetting "
2115 "adapter (%dms).\n", 2115 "adapter after (%dms).\n",
2116 IPW_SCAN_CHECK_WATCHDOG / 100); 2116 jiffies_to_msecs(IPW_SCAN_CHECK_WATCHDOG));
2117 queue_work(priv->workqueue, &priv->adapter_restart); 2117 queue_work(priv->workqueue, &priv->adapter_restart);
2118 } 2118 }
2119} 2119}
@@ -2518,7 +2518,7 @@ static void ipw_eeprom_init_sram(struct ipw_priv *priv)
2518 /* 2518 /*
2519 If the data looks correct, then copy it to our private 2519 If the data looks correct, then copy it to our private
2520 copy. Otherwise let the firmware know to perform the operation 2520 copy. Otherwise let the firmware know to perform the operation
2521 on it's own 2521 on its own.
2522 */ 2522 */
2523 if ((priv->eeprom + EEPROM_VERSION) != 0) { 2523 if ((priv->eeprom + EEPROM_VERSION) != 0) {
2524 IPW_DEBUG_INFO("Writing EEPROM data into SRAM\n"); 2524 IPW_DEBUG_INFO("Writing EEPROM data into SRAM\n");
@@ -2836,6 +2836,7 @@ static inline int ipw_alive(struct ipw_priv *priv)
2836 return ipw_read32(priv, 0x90) == 0xd55555d5; 2836 return ipw_read32(priv, 0x90) == 0xd55555d5;
2837} 2837}
2838 2838
2839/* timeout in msec, attempted in 10-msec quanta */
2839static int ipw_poll_bit(struct ipw_priv *priv, u32 addr, u32 mask, 2840static int ipw_poll_bit(struct ipw_priv *priv, u32 addr, u32 mask,
2840 int timeout) 2841 int timeout)
2841{ 2842{
@@ -2864,10 +2865,11 @@ static int ipw_stop_master(struct ipw_priv *priv)
2864 /* stop master. typical delay - 0 */ 2865 /* stop master. typical delay - 0 */
2865 ipw_set_bit(priv, IPW_RESET_REG, IPW_RESET_REG_STOP_MASTER); 2866 ipw_set_bit(priv, IPW_RESET_REG, IPW_RESET_REG_STOP_MASTER);
2866 2867
2868 /* timeout is in msec, polled in 10-msec quanta */
2867 rc = ipw_poll_bit(priv, IPW_RESET_REG, 2869 rc = ipw_poll_bit(priv, IPW_RESET_REG,
2868 IPW_RESET_REG_MASTER_DISABLED, 100); 2870 IPW_RESET_REG_MASTER_DISABLED, 100);
2869 if (rc < 0) { 2871 if (rc < 0) {
2870 IPW_ERROR("stop master failed in 10ms\n"); 2872 IPW_ERROR("wait for stop master failed after 100ms\n");
2871 return -1; 2873 return -1;
2872 } 2874 }
2873 2875
@@ -3100,7 +3102,7 @@ static int ipw_stop_nic(struct ipw_priv *priv)
3100 rc = ipw_poll_bit(priv, IPW_RESET_REG, 3102 rc = ipw_poll_bit(priv, IPW_RESET_REG,
3101 IPW_RESET_REG_MASTER_DISABLED, 500); 3103 IPW_RESET_REG_MASTER_DISABLED, 500);
3102 if (rc < 0) { 3104 if (rc < 0) {
3103 IPW_ERROR("wait for reg master disabled failed\n"); 3105 IPW_ERROR("wait for reg master disabled failed after 500ms\n");
3104 return rc; 3106 return rc;
3105 } 3107 }
3106 3108
@@ -3362,7 +3364,7 @@ static int ipw_load(struct ipw_priv *priv)
3362 /* kick start the device */ 3364 /* kick start the device */
3363 ipw_start_nic(priv); 3365 ipw_start_nic(priv);
3364 3366
3365 /* wait for the device to finish it's initial startup sequence */ 3367 /* wait for the device to finish its initial startup sequence */
3366 rc = ipw_poll_bit(priv, IPW_INTA_RW, 3368 rc = ipw_poll_bit(priv, IPW_INTA_RW,
3367 IPW_INTA_BIT_FW_INITIALIZATION_DONE, 500); 3369 IPW_INTA_BIT_FW_INITIALIZATION_DONE, 500);
3368 if (rc < 0) { 3370 if (rc < 0) {
@@ -3426,7 +3428,7 @@ static int ipw_load(struct ipw_priv *priv)
3426 rc = ipw_poll_bit(priv, IPW_INTA_RW, 3428 rc = ipw_poll_bit(priv, IPW_INTA_RW,
3427 IPW_INTA_BIT_FW_INITIALIZATION_DONE, 500); 3429 IPW_INTA_BIT_FW_INITIALIZATION_DONE, 500);
3428 if (rc < 0) { 3430 if (rc < 0) {
3429 IPW_ERROR("device failed to start after 500ms\n"); 3431 IPW_ERROR("device failed to start within 500ms\n");
3430 goto error; 3432 goto error;
3431 } 3433 }
3432 IPW_DEBUG_INFO("device response after %dms\n", rc); 3434 IPW_DEBUG_INFO("device response after %dms\n", rc);
@@ -4981,7 +4983,7 @@ static void ipw_bg_rx_queue_replenish(void *data)
4981} 4983}
4982 4984
4983/* Assumes that the skb field of the buffers in 'pool' is kept accurate. 4985/* Assumes that the skb field of the buffers in 'pool' is kept accurate.
4984 * If an SKB has been detached, the POOL needs to have it's SKB set to NULL 4986 * If an SKB has been detached, the POOL needs to have its SKB set to NULL
4985 * This free routine walks the list of POOL entries and if SKB is set to 4987 * This free routine walks the list of POOL entries and if SKB is set to
4986 * non NULL it is unmapped and freed 4988 * non NULL it is unmapped and freed
4987 */ 4989 */
@@ -5321,10 +5323,10 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv,
5321 if (priv->ieee->scan_age != 0 && 5323 if (priv->ieee->scan_age != 0 &&
5322 time_after(jiffies, network->last_scanned + priv->ieee->scan_age)) { 5324 time_after(jiffies, network->last_scanned + priv->ieee->scan_age)) {
5323 IPW_DEBUG_MERGE("Network '%s (" MAC_FMT ")' excluded " 5325 IPW_DEBUG_MERGE("Network '%s (" MAC_FMT ")' excluded "
5324 "because of age: %lums.\n", 5326 "because of age: %ums.\n",
5325 escape_essid(network->ssid, network->ssid_len), 5327 escape_essid(network->ssid, network->ssid_len),
5326 MAC_ARG(network->bssid), 5328 MAC_ARG(network->bssid),
5327 1000 * (jiffies - network->last_scanned) / HZ); 5329 jiffies_to_msecs(jiffies - network->last_scanned));
5328 return 0; 5330 return 0;
5329 } 5331 }
5330 5332
@@ -5531,11 +5533,11 @@ static int ipw_best_network(struct ipw_priv *priv,
5531 if (network->last_associate && 5533 if (network->last_associate &&
5532 time_after(network->last_associate + (HZ * 3UL), jiffies)) { 5534 time_after(network->last_associate + (HZ * 3UL), jiffies)) {
5533 IPW_DEBUG_ASSOC("Network '%s (" MAC_FMT ")' excluded " 5535 IPW_DEBUG_ASSOC("Network '%s (" MAC_FMT ")' excluded "
5534 "because of storming (%lus since last " 5536 "because of storming (%ums since last "
5535 "assoc attempt).\n", 5537 "assoc attempt).\n",
5536 escape_essid(network->ssid, network->ssid_len), 5538 escape_essid(network->ssid, network->ssid_len),
5537 MAC_ARG(network->bssid), 5539 MAC_ARG(network->bssid),
5538 (jiffies - network->last_associate) / HZ); 5540 jiffies_to_msecs(jiffies - network->last_associate));
5539 return 0; 5541 return 0;
5540 } 5542 }
5541 5543
@@ -5543,10 +5545,10 @@ static int ipw_best_network(struct ipw_priv *priv,
5543 if (priv->ieee->scan_age != 0 && 5545 if (priv->ieee->scan_age != 0 &&
5544 time_after(jiffies, network->last_scanned + priv->ieee->scan_age)) { 5546 time_after(jiffies, network->last_scanned + priv->ieee->scan_age)) {
5545 IPW_DEBUG_ASSOC("Network '%s (" MAC_FMT ")' excluded " 5547 IPW_DEBUG_ASSOC("Network '%s (" MAC_FMT ")' excluded "
5546 "because of age: %lums.\n", 5548 "because of age: %ums.\n",
5547 escape_essid(network->ssid, network->ssid_len), 5549 escape_essid(network->ssid, network->ssid_len),
5548 MAC_ARG(network->bssid), 5550 MAC_ARG(network->bssid),
5549 1000 * (jiffies - network->last_scanned) / HZ); 5551 jiffies_to_msecs(jiffies - network->last_scanned));
5550 return 0; 5552 return 0;
5551 } 5553 }
5552 5554
diff --git a/drivers/net/wireless/ipw2200.h b/drivers/net/wireless/ipw2200.h
index d6d7d9db0462..04a0c26cab84 100644
--- a/drivers/net/wireless/ipw2200.h
+++ b/drivers/net/wireless/ipw2200.h
@@ -46,6 +46,7 @@
46#include <linux/firmware.h> 46#include <linux/firmware.h>
47#include <linux/wireless.h> 47#include <linux/wireless.h>
48#include <linux/dma-mapping.h> 48#include <linux/dma-mapping.h>
49#include <linux/jiffies.h>
49#include <asm/io.h> 50#include <asm/io.h>
50 51
51#include <net/ieee80211.h> 52#include <net/ieee80211.h>