aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ipw2200.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/ipw2200.c')
-rw-r--r--drivers/net/wireless/ipw2200.c62
1 files changed, 27 insertions, 35 deletions
diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c
index 7d61257249aa..f793cd8f8d71 100644
--- a/drivers/net/wireless/ipw2200.c
+++ b/drivers/net/wireless/ipw2200.c
@@ -272,7 +272,6 @@ static inline void ipw_write_reg32(struct ipw_priv *a, u32 b, u32 c)
272 IPW_DEBUG_IO("%s %d: write_direct8(0x%08X, 0x%08X)\n", __FILE__, __LINE__, (u32)(ofs), (u32)(val)); \ 272 IPW_DEBUG_IO("%s %d: write_direct8(0x%08X, 0x%08X)\n", __FILE__, __LINE__, (u32)(ofs), (u32)(val)); \
273 _ipw_write8(ipw, ofs, val) 273 _ipw_write8(ipw, ofs, val)
274 274
275
276/* 16-bit direct write (low 4K) */ 275/* 16-bit direct write (low 4K) */
277#define _ipw_write16(ipw, ofs, val) writew((val), (ipw)->hw_base + (ofs)) 276#define _ipw_write16(ipw, ofs, val) writew((val), (ipw)->hw_base + (ofs))
278 277
@@ -281,7 +280,6 @@ static inline void ipw_write_reg32(struct ipw_priv *a, u32 b, u32 c)
281 IPW_DEBUG_IO("%s %d: write_direct16(0x%08X, 0x%08X)\n", __FILE__, __LINE__, (u32)(ofs), (u32)(val)); \ 280 IPW_DEBUG_IO("%s %d: write_direct16(0x%08X, 0x%08X)\n", __FILE__, __LINE__, (u32)(ofs), (u32)(val)); \
282 _ipw_write16(ipw, ofs, val) 281 _ipw_write16(ipw, ofs, val)
283 282
284
285/* 32-bit direct write (low 4K) */ 283/* 32-bit direct write (low 4K) */
286#define _ipw_write32(ipw, ofs, val) writel((val), (ipw)->hw_base + (ofs)) 284#define _ipw_write32(ipw, ofs, val) writel((val), (ipw)->hw_base + (ofs))
287 285
@@ -290,7 +288,6 @@ static inline void ipw_write_reg32(struct ipw_priv *a, u32 b, u32 c)
290 IPW_DEBUG_IO("%s %d: write_direct32(0x%08X, 0x%08X)\n", __FILE__, __LINE__, (u32)(ofs), (u32)(val)); \ 288 IPW_DEBUG_IO("%s %d: write_direct32(0x%08X, 0x%08X)\n", __FILE__, __LINE__, (u32)(ofs), (u32)(val)); \
291 _ipw_write32(ipw, ofs, val) 289 _ipw_write32(ipw, ofs, val)
292 290
293
294/* 8-bit direct read (low 4K) */ 291/* 8-bit direct read (low 4K) */
295#define _ipw_read8(ipw, ofs) readb((ipw)->hw_base + (ofs)) 292#define _ipw_read8(ipw, ofs) readb((ipw)->hw_base + (ofs))
296 293
@@ -304,7 +301,6 @@ static inline u8 __ipw_read8(char *f, u32 l, struct ipw_priv *ipw, u32 ofs)
304/* alias to 8-bit direct read (low 4K of SRAM/regs), with debug wrapper */ 301/* alias to 8-bit direct read (low 4K of SRAM/regs), with debug wrapper */
305#define ipw_read8(ipw, ofs) __ipw_read8(__FILE__, __LINE__, ipw, ofs) 302#define ipw_read8(ipw, ofs) __ipw_read8(__FILE__, __LINE__, ipw, ofs)
306 303
307
308/* 16-bit direct read (low 4K) */ 304/* 16-bit direct read (low 4K) */
309#define _ipw_read16(ipw, ofs) readw((ipw)->hw_base + (ofs)) 305#define _ipw_read16(ipw, ofs) readw((ipw)->hw_base + (ofs))
310 306
@@ -318,7 +314,6 @@ static inline u16 __ipw_read16(char *f, u32 l, struct ipw_priv *ipw, u32 ofs)
318/* alias to 16-bit direct read (low 4K of SRAM/regs), with debug wrapper */ 314/* alias to 16-bit direct read (low 4K of SRAM/regs), with debug wrapper */
319#define ipw_read16(ipw, ofs) __ipw_read16(__FILE__, __LINE__, ipw, ofs) 315#define ipw_read16(ipw, ofs) __ipw_read16(__FILE__, __LINE__, ipw, ofs)
320 316
321
322/* 32-bit direct read (low 4K) */ 317/* 32-bit direct read (low 4K) */
323#define _ipw_read32(ipw, ofs) readl((ipw)->hw_base + (ofs)) 318#define _ipw_read32(ipw, ofs) readl((ipw)->hw_base + (ofs))
324 319
@@ -332,7 +327,6 @@ static inline u32 __ipw_read32(char *f, u32 l, struct ipw_priv *ipw, u32 ofs)
332/* alias to 32-bit direct read (low 4K of SRAM/regs), with debug wrapper */ 327/* alias to 32-bit direct read (low 4K of SRAM/regs), with debug wrapper */
333#define ipw_read32(ipw, ofs) __ipw_read32(__FILE__, __LINE__, ipw, ofs) 328#define ipw_read32(ipw, ofs) __ipw_read32(__FILE__, __LINE__, ipw, ofs)
334 329
335
336/* multi-byte read (above 4K), with debug wrapper */ 330/* multi-byte read (above 4K), with debug wrapper */
337static void _ipw_read_indirect(struct ipw_priv *, u32, u8 *, int); 331static void _ipw_read_indirect(struct ipw_priv *, u32, u8 *, int);
338static inline void __ipw_read_indirect(const char *f, int l, 332static inline void __ipw_read_indirect(const char *f, int l,
@@ -364,7 +358,7 @@ static void _ipw_write_reg32(struct ipw_priv *priv, u32 reg, u32 value)
364/* 8-bit indirect write (above 4K) */ 358/* 8-bit indirect write (above 4K) */
365static void _ipw_write_reg8(struct ipw_priv *priv, u32 reg, u8 value) 359static void _ipw_write_reg8(struct ipw_priv *priv, u32 reg, u8 value)
366{ 360{
367 u32 aligned_addr = reg & IPW_INDIRECT_ADDR_MASK; /* dword align */ 361 u32 aligned_addr = reg & IPW_INDIRECT_ADDR_MASK; /* dword align */
368 u32 dif_len = reg - aligned_addr; 362 u32 dif_len = reg - aligned_addr;
369 363
370 IPW_DEBUG_IO(" reg = 0x%8X : value = 0x%8X\n", reg, value); 364 IPW_DEBUG_IO(" reg = 0x%8X : value = 0x%8X\n", reg, value);
@@ -375,7 +369,7 @@ static void _ipw_write_reg8(struct ipw_priv *priv, u32 reg, u8 value)
375/* 16-bit indirect write (above 4K) */ 369/* 16-bit indirect write (above 4K) */
376static void _ipw_write_reg16(struct ipw_priv *priv, u32 reg, u16 value) 370static void _ipw_write_reg16(struct ipw_priv *priv, u32 reg, u16 value)
377{ 371{
378 u32 aligned_addr = reg & IPW_INDIRECT_ADDR_MASK; /* dword align */ 372 u32 aligned_addr = reg & IPW_INDIRECT_ADDR_MASK; /* dword align */
379 u32 dif_len = (reg - aligned_addr) & (~0x1ul); 373 u32 dif_len = (reg - aligned_addr) & (~0x1ul);
380 374
381 IPW_DEBUG_IO(" reg = 0x%8X : value = 0x%8X\n", reg, value); 375 IPW_DEBUG_IO(" reg = 0x%8X : value = 0x%8X\n", reg, value);
@@ -383,7 +377,6 @@ static void _ipw_write_reg16(struct ipw_priv *priv, u32 reg, u16 value)
383 _ipw_write16(priv, IPW_INDIRECT_DATA + dif_len, value); 377 _ipw_write16(priv, IPW_INDIRECT_DATA + dif_len, value);
384} 378}
385 379
386
387/* 8-bit indirect read (above 4K) */ 380/* 8-bit indirect read (above 4K) */
388static u8 _ipw_read_reg8(struct ipw_priv *priv, u32 reg) 381static u8 _ipw_read_reg8(struct ipw_priv *priv, u32 reg)
389{ 382{
@@ -412,7 +405,7 @@ static u32 _ipw_read_reg32(struct ipw_priv *priv, u32 reg)
412static void _ipw_read_indirect(struct ipw_priv *priv, u32 addr, u8 * buf, 405static void _ipw_read_indirect(struct ipw_priv *priv, u32 addr, u8 * buf,
413 int num) 406 int num)
414{ 407{
415 u32 aligned_addr = addr & IPW_INDIRECT_ADDR_MASK; /* dword align */ 408 u32 aligned_addr = addr & IPW_INDIRECT_ADDR_MASK; /* dword align */
416 u32 dif_len = addr - aligned_addr; 409 u32 dif_len = addr - aligned_addr;
417 u32 i; 410 u32 i;
418 411
@@ -449,7 +442,7 @@ static void _ipw_read_indirect(struct ipw_priv *priv, u32 addr, u8 * buf,
449static void _ipw_write_indirect(struct ipw_priv *priv, u32 addr, u8 * buf, 442static void _ipw_write_indirect(struct ipw_priv *priv, u32 addr, u8 * buf,
450 int num) 443 int num)
451{ 444{
452 u32 aligned_addr = addr & IPW_INDIRECT_ADDR_MASK; /* dword align */ 445 u32 aligned_addr = addr & IPW_INDIRECT_ADDR_MASK; /* dword align */
453 u32 dif_len = addr - aligned_addr; 446 u32 dif_len = addr - aligned_addr;
454 u32 i; 447 u32 i;
455 448
@@ -1964,7 +1957,6 @@ static int __ipw_send_cmd(struct ipw_priv *priv, struct host_cmd *cmd)
1964#endif 1957#endif
1965 printk_buf(IPW_DL_HOST_COMMAND, (u8 *) cmd->param, cmd->len); 1958 printk_buf(IPW_DL_HOST_COMMAND, (u8 *) cmd->param, cmd->len);
1966 1959
1967
1968 rc = ipw_queue_tx_hcmd(priv, cmd->cmd, cmd->param, cmd->len, 0); 1960 rc = ipw_queue_tx_hcmd(priv, cmd->cmd, cmd->param, cmd->len, 0);
1969 if (rc) { 1961 if (rc) {
1970 priv->status &= ~STATUS_HCMD_ACTIVE; 1962 priv->status &= ~STATUS_HCMD_ACTIVE;
@@ -2000,7 +1992,7 @@ static int __ipw_send_cmd(struct ipw_priv *priv, struct host_cmd *cmd)
2000 goto exit; 1992 goto exit;
2001 } 1993 }
2002 1994
2003exit: 1995 exit:
2004 if (priv->cmdlog) { 1996 if (priv->cmdlog) {
2005 priv->cmdlog[priv->cmdlog_pos++].retcode = rc; 1997 priv->cmdlog[priv->cmdlog_pos++].retcode = rc;
2006 priv->cmdlog_pos %= priv->cmdlog_len; 1998 priv->cmdlog_pos %= priv->cmdlog_len;
@@ -2048,7 +2040,7 @@ static int ipw_send_system_config(struct ipw_priv *priv,
2048 } 2040 }
2049 2041
2050 return ipw_send_cmd_pdu(priv, IPW_CMD_SYSTEM_CONFIG, sizeof(*config), 2042 return ipw_send_cmd_pdu(priv, IPW_CMD_SYSTEM_CONFIG, sizeof(*config),
2051 config); 2043 config);
2052} 2044}
2053 2045
2054static int ipw_send_ssid(struct ipw_priv *priv, u8 * ssid, int len) 2046static int ipw_send_ssid(struct ipw_priv *priv, u8 * ssid, int len)
@@ -2059,7 +2051,7 @@ static int ipw_send_ssid(struct ipw_priv *priv, u8 * ssid, int len)
2059 } 2051 }
2060 2052
2061 return ipw_send_cmd_pdu(priv, IPW_CMD_SSID, min(len, IW_ESSID_MAX_SIZE), 2053 return ipw_send_cmd_pdu(priv, IPW_CMD_SSID, min(len, IW_ESSID_MAX_SIZE),
2062 ssid); 2054 ssid);
2063} 2055}
2064 2056
2065static int ipw_send_adapter_address(struct ipw_priv *priv, u8 * mac) 2057static int ipw_send_adapter_address(struct ipw_priv *priv, u8 * mac)
@@ -2072,8 +2064,7 @@ static int ipw_send_adapter_address(struct ipw_priv *priv, u8 * mac)
2072 IPW_DEBUG_INFO("%s: Setting MAC to " MAC_FMT "\n", 2064 IPW_DEBUG_INFO("%s: Setting MAC to " MAC_FMT "\n",
2073 priv->net_dev->name, MAC_ARG(mac)); 2065 priv->net_dev->name, MAC_ARG(mac));
2074 2066
2075 return ipw_send_cmd_pdu(priv, IPW_CMD_ADAPTER_ADDRESS, ETH_ALEN, 2067 return ipw_send_cmd_pdu(priv, IPW_CMD_ADAPTER_ADDRESS, ETH_ALEN, mac);
2076 mac);
2077} 2068}
2078 2069
2079/* 2070/*
@@ -2133,7 +2124,7 @@ static int ipw_send_scan_request_ext(struct ipw_priv *priv,
2133 struct ipw_scan_request_ext *request) 2124 struct ipw_scan_request_ext *request)
2134{ 2125{
2135 return ipw_send_cmd_pdu(priv, IPW_CMD_SCAN_REQUEST_EXT, 2126 return ipw_send_cmd_pdu(priv, IPW_CMD_SCAN_REQUEST_EXT,
2136 sizeof(*request), request); 2127 sizeof(*request), request);
2137} 2128}
2138 2129
2139static int ipw_send_scan_abort(struct ipw_priv *priv) 2130static int ipw_send_scan_abort(struct ipw_priv *priv)
@@ -2153,7 +2144,7 @@ static int ipw_set_sensitivity(struct ipw_priv *priv, u16 sens)
2153 }; 2144 };
2154 2145
2155 return ipw_send_cmd_pdu(priv, IPW_CMD_SENSITIVITY_CALIB, sizeof(calib), 2146 return ipw_send_cmd_pdu(priv, IPW_CMD_SENSITIVITY_CALIB, sizeof(calib),
2156 &calib); 2147 &calib);
2157} 2148}
2158 2149
2159static int ipw_send_associate(struct ipw_priv *priv, 2150static int ipw_send_associate(struct ipw_priv *priv,
@@ -2179,7 +2170,7 @@ static int ipw_send_associate(struct ipw_priv *priv,
2179 tmp_associate.atim_window = cpu_to_le16(tmp_associate.atim_window); 2170 tmp_associate.atim_window = cpu_to_le16(tmp_associate.atim_window);
2180 2171
2181 return ipw_send_cmd_pdu(priv, IPW_CMD_ASSOCIATE, sizeof(tmp_associate), 2172 return ipw_send_cmd_pdu(priv, IPW_CMD_ASSOCIATE, sizeof(tmp_associate),
2182 &tmp_associate); 2173 &tmp_associate);
2183} 2174}
2184 2175
2185static int ipw_send_supported_rates(struct ipw_priv *priv, 2176static int ipw_send_supported_rates(struct ipw_priv *priv,
@@ -2191,7 +2182,7 @@ static int ipw_send_supported_rates(struct ipw_priv *priv,
2191 } 2182 }
2192 2183
2193 return ipw_send_cmd_pdu(priv, IPW_CMD_SUPPORTED_RATES, sizeof(*rates), 2184 return ipw_send_cmd_pdu(priv, IPW_CMD_SUPPORTED_RATES, sizeof(*rates),
2194 rates); 2185 rates);
2195} 2186}
2196 2187
2197static int ipw_set_random_seed(struct ipw_priv *priv) 2188static int ipw_set_random_seed(struct ipw_priv *priv)
@@ -2216,7 +2207,7 @@ static int ipw_send_card_disable(struct ipw_priv *priv, u32 phy_off)
2216 } 2207 }
2217 2208
2218 return ipw_send_cmd_pdu(priv, IPW_CMD_CARD_DISABLE, sizeof(phy_off), 2209 return ipw_send_cmd_pdu(priv, IPW_CMD_CARD_DISABLE, sizeof(phy_off),
2219 &phy_off); 2210 &phy_off);
2220} 2211}
2221 2212
2222static int ipw_send_tx_power(struct ipw_priv *priv, struct ipw_tx_power *power) 2213static int ipw_send_tx_power(struct ipw_priv *priv, struct ipw_tx_power *power)
@@ -2226,8 +2217,7 @@ static int ipw_send_tx_power(struct ipw_priv *priv, struct ipw_tx_power *power)
2226 return -1; 2217 return -1;
2227 } 2218 }
2228 2219
2229 return ipw_send_cmd_pdu(priv, IPW_CMD_TX_POWER, sizeof(*power), 2220 return ipw_send_cmd_pdu(priv, IPW_CMD_TX_POWER, sizeof(*power), power);
2230 power);
2231} 2221}
2232 2222
2233static int ipw_set_tx_power(struct ipw_priv *priv) 2223static int ipw_set_tx_power(struct ipw_priv *priv)
@@ -2328,7 +2318,7 @@ static int ipw_send_power_mode(struct ipw_priv *priv, u32 mode)
2328 } 2318 }
2329 2319
2330 return ipw_send_cmd_pdu(priv, IPW_CMD_POWER_MODE, sizeof(param), 2320 return ipw_send_cmd_pdu(priv, IPW_CMD_POWER_MODE, sizeof(param),
2331 &param); 2321 &param);
2332} 2322}
2333 2323
2334static int ipw_send_retry_limit(struct ipw_priv *priv, u8 slimit, u8 llimit) 2324static int ipw_send_retry_limit(struct ipw_priv *priv, u8 slimit, u8 llimit)
@@ -2344,7 +2334,7 @@ static int ipw_send_retry_limit(struct ipw_priv *priv, u8 slimit, u8 llimit)
2344 } 2334 }
2345 2335
2346 return ipw_send_cmd_pdu(priv, IPW_CMD_RETRY_LIMIT, sizeof(retry_limit), 2336 return ipw_send_cmd_pdu(priv, IPW_CMD_RETRY_LIMIT, sizeof(retry_limit),
2347 &retry_limit); 2337 &retry_limit);
2348} 2338}
2349 2339
2350/* 2340/*
@@ -3326,7 +3316,7 @@ static int ipw_load(struct ipw_priv *priv)
3326#ifdef CONFIG_PM 3316#ifdef CONFIG_PM
3327 } 3317 }
3328#endif 3318#endif
3329 3319
3330 /* DMA the ucode into the device */ 3320 /* DMA the ucode into the device */
3331 rc = ipw_load_ucode(priv, ucode->data + sizeof(struct fw_header), 3321 rc = ipw_load_ucode(priv, ucode->data + sizeof(struct fw_header),
3332 ucode->size - sizeof(struct fw_header)); 3322 ucode->size - sizeof(struct fw_header));
@@ -3356,7 +3346,6 @@ static int ipw_load(struct ipw_priv *priv)
3356 IPW_ERROR("Unable to load firmware: %d\n", rc); 3346 IPW_ERROR("Unable to load firmware: %d\n", rc);
3357 goto error; 3347 goto error;
3358 } 3348 }
3359
3360#ifdef CONFIG_PM 3349#ifdef CONFIG_PM
3361 fw_loaded = 1; 3350 fw_loaded = 1;
3362#endif 3351#endif
@@ -5291,7 +5280,8 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv,
5291 "because of age: %ums.\n", 5280 "because of age: %ums.\n",
5292 escape_essid(network->ssid, network->ssid_len), 5281 escape_essid(network->ssid, network->ssid_len),
5293 MAC_ARG(network->bssid), 5282 MAC_ARG(network->bssid),
5294 jiffies_to_msecs(jiffies - network->last_scanned)); 5283 jiffies_to_msecs(jiffies -
5284 network->last_scanned));
5295 return 0; 5285 return 0;
5296 } 5286 }
5297 5287
@@ -5502,7 +5492,8 @@ static int ipw_best_network(struct ipw_priv *priv,
5502 "assoc attempt).\n", 5492 "assoc attempt).\n",
5503 escape_essid(network->ssid, network->ssid_len), 5493 escape_essid(network->ssid, network->ssid_len),
5504 MAC_ARG(network->bssid), 5494 MAC_ARG(network->bssid),
5505 jiffies_to_msecs(jiffies - network->last_associate)); 5495 jiffies_to_msecs(jiffies -
5496 network->last_associate));
5506 return 0; 5497 return 0;
5507 } 5498 }
5508 5499
@@ -5513,7 +5504,8 @@ static int ipw_best_network(struct ipw_priv *priv,
5513 "because of age: %ums.\n", 5504 "because of age: %ums.\n",
5514 escape_essid(network->ssid, network->ssid_len), 5505 escape_essid(network->ssid, network->ssid_len),
5515 MAC_ARG(network->bssid), 5506 MAC_ARG(network->bssid),
5516 jiffies_to_msecs(jiffies - network->last_scanned)); 5507 jiffies_to_msecs(jiffies -
5508 network->last_scanned));
5517 return 0; 5509 return 0;
5518 } 5510 }
5519 5511
@@ -6243,7 +6235,7 @@ static int ipw_set_rsn_capa(struct ipw_priv *priv,
6243 IPW_DEBUG_HC("HOST_CMD_RSN_CAPABILITIES\n"); 6235 IPW_DEBUG_HC("HOST_CMD_RSN_CAPABILITIES\n");
6244 6236
6245 return ipw_send_cmd_pdu(priv, IPW_CMD_RSN_CAPABILITIES, length, 6237 return ipw_send_cmd_pdu(priv, IPW_CMD_RSN_CAPABILITIES, length,
6246 capabilities); 6238 capabilities);
6247} 6239}
6248 6240
6249/* 6241/*
@@ -10309,14 +10301,14 @@ static int ipw_config(struct ipw_priv *priv)
10309 /* Support Bluetooth if we have BT h/w on board, and user wants to. 10301 /* Support Bluetooth if we have BT h/w on board, and user wants to.
10310 * Does not support BT priority yet (don't abort or defer our Tx) */ 10302 * Does not support BT priority yet (don't abort or defer our Tx) */
10311 if (bt_coexist) { 10303 if (bt_coexist) {
10312 unsigned char bt_caps = priv->eeprom[EEPROM_SKU_CAPABILITY]; 10304 unsigned char bt_caps = priv->eeprom[EEPROM_SKU_CAPABILITY];
10313 10305
10314 if (bt_caps & EEPROM_SKU_CAP_BT_CHANNEL_SIG) 10306 if (bt_caps & EEPROM_SKU_CAP_BT_CHANNEL_SIG)
10315 priv->sys_config.bt_coexistence 10307 priv->sys_config.bt_coexistence
10316 |= CFG_BT_COEXISTENCE_SIGNAL_CHNL; 10308 |= CFG_BT_COEXISTENCE_SIGNAL_CHNL;
10317 if (bt_caps & EEPROM_SKU_CAP_BT_OOB) 10309 if (bt_caps & EEPROM_SKU_CAP_BT_OOB)
10318 priv->sys_config.bt_coexistence 10310 priv->sys_config.bt_coexistence
10319 |= CFG_BT_COEXISTENCE_OOB; 10311 |= CFG_BT_COEXISTENCE_OOB;
10320 } 10312 }
10321 10313
10322 if (priv->ieee->iw_mode == IW_MODE_ADHOC) 10314 if (priv->ieee->iw_mode == IW_MODE_ADHOC)