aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@pobox.com>2005-08-25 20:31:13 -0400
committerJeff Garzik <jgarzik@pobox.com>2005-08-25 20:31:13 -0400
commitb4bf343093e81e33d75bede45896eda52cd5f2b4 (patch)
tree7fd5ce5f428995e6d612014e3ca7ad3f917fcf65
parent343b0597297c3190647854881c087c01faf40a6f (diff)
parent099c5bb169e9816a7761336f668b63010762807b (diff)
/spare/repo/netdev-2.6 branch 'ieee80211'
-rw-r--r--drivers/net/wireless/Kconfig2
-rw-r--r--drivers/net/wireless/atmel.c8
-rw-r--r--drivers/net/wireless/ipw2100.c256
-rw-r--r--drivers/net/wireless/ipw2100.h28
-rw-r--r--drivers/net/wireless/ipw2200.c10
-rw-r--r--drivers/net/wireless/ipw2200.h30
-rw-r--r--include/net/ieee80211.h214
-rw-r--r--net/ieee80211/ieee80211_module.c26
-rw-r--r--net/ieee80211/ieee80211_rx.c16
-rw-r--r--net/ieee80211/ieee80211_tx.c2
10 files changed, 317 insertions, 275 deletions
diff --git a/drivers/net/wireless/Kconfig b/drivers/net/wireless/Kconfig
index 5d814dfc8bc0..dd7dbf7b14d4 100644
--- a/drivers/net/wireless/Kconfig
+++ b/drivers/net/wireless/Kconfig
@@ -164,7 +164,7 @@ config IPW2100
164 say M here and read <file:Documentation/modules.txt>. The module 164 say M here and read <file:Documentation/modules.txt>. The module
165 will be called ipw2100.ko. 165 will be called ipw2100.ko.
166 166
167config IPW2100_PROMISC 167config IPW2100_MONITOR
168 bool "Enable promiscuous mode" 168 bool "Enable promiscuous mode"
169 depends on IPW2100 169 depends on IPW2100
170 ---help--- 170 ---help---
diff --git a/drivers/net/wireless/atmel.c b/drivers/net/wireless/atmel.c
index bed160a25cab..f48a6e729224 100644
--- a/drivers/net/wireless/atmel.c
+++ b/drivers/net/wireless/atmel.c
@@ -867,7 +867,7 @@ static int start_tx (struct sk_buff *skb, struct net_device *dev)
867 header.duration_id = 0; 867 header.duration_id = 0;
868 header.seq_ctl = 0; 868 header.seq_ctl = 0;
869 if (priv->wep_is_on) 869 if (priv->wep_is_on)
870 frame_ctl |= IEEE80211_FCTL_WEP; 870 frame_ctl |= IEEE80211_FCTL_PROTECTED;
871 if (priv->operating_mode == IW_MODE_ADHOC) { 871 if (priv->operating_mode == IW_MODE_ADHOC) {
872 memcpy(&header.addr1, skb->data, 6); 872 memcpy(&header.addr1, skb->data, 6);
873 memcpy(&header.addr2, dev->dev_addr, 6); 873 memcpy(&header.addr2, dev->dev_addr, 6);
@@ -1117,7 +1117,7 @@ static void rx_done_irq(struct atmel_private *priv)
1117 /* probe for CRC use here if needed once five packets have arrived with 1117 /* probe for CRC use here if needed once five packets have arrived with
1118 the same crc status, we assume we know what's happening and stop probing */ 1118 the same crc status, we assume we know what's happening and stop probing */
1119 if (priv->probe_crc) { 1119 if (priv->probe_crc) {
1120 if (!priv->wep_is_on || !(frame_ctl & IEEE80211_FCTL_WEP)) { 1120 if (!priv->wep_is_on || !(frame_ctl & IEEE80211_FCTL_PROTECTED)) {
1121 priv->do_rx_crc = probe_crc(priv, rx_packet_loc, msdu_size); 1121 priv->do_rx_crc = probe_crc(priv, rx_packet_loc, msdu_size);
1122 } else { 1122 } else {
1123 priv->do_rx_crc = probe_crc(priv, rx_packet_loc + 24, msdu_size - 24); 1123 priv->do_rx_crc = probe_crc(priv, rx_packet_loc + 24, msdu_size - 24);
@@ -1132,7 +1132,7 @@ static void rx_done_irq(struct atmel_private *priv)
1132 } 1132 }
1133 1133
1134 /* don't CRC header when WEP in use */ 1134 /* don't CRC header when WEP in use */
1135 if (priv->do_rx_crc && (!priv->wep_is_on || !(frame_ctl & IEEE80211_FCTL_WEP))) { 1135 if (priv->do_rx_crc && (!priv->wep_is_on || !(frame_ctl & IEEE80211_FCTL_PROTECTED))) {
1136 crc = crc32_le(0xffffffff, (unsigned char *)&header, 24); 1136 crc = crc32_le(0xffffffff, (unsigned char *)&header, 24);
1137 } 1137 }
1138 msdu_size -= 24; /* header */ 1138 msdu_size -= 24; /* header */
@@ -2677,7 +2677,7 @@ static void send_authentication_request(struct atmel_private *priv, u8 *challeng
2677 auth.alg = cpu_to_le16(C80211_MGMT_AAN_SHAREDKEY); 2677 auth.alg = cpu_to_le16(C80211_MGMT_AAN_SHAREDKEY);
2678 /* no WEP for authentication frames with TrSeqNo 1 */ 2678 /* no WEP for authentication frames with TrSeqNo 1 */
2679 if (priv->CurrentAuthentTransactionSeqNum != 1) 2679 if (priv->CurrentAuthentTransactionSeqNum != 1)
2680 header.frame_ctl |= cpu_to_le16(IEEE80211_FCTL_WEP); 2680 header.frame_ctl |= cpu_to_le16(IEEE80211_FCTL_PROTECTED);
2681 } else { 2681 } else {
2682 auth.alg = cpu_to_le16(C80211_MGMT_AAN_OPENSYSTEM); 2682 auth.alg = cpu_to_le16(C80211_MGMT_AAN_OPENSYSTEM);
2683 } 2683 }
diff --git a/drivers/net/wireless/ipw2100.c b/drivers/net/wireless/ipw2100.c
index 189ad7b2cec9..a47fce4beadf 100644
--- a/drivers/net/wireless/ipw2100.c
+++ b/drivers/net/wireless/ipw2100.c
@@ -106,7 +106,7 @@ that protects the following:
106 106
107 tx_pend_list : Holds used Tx buffers waiting to go into the TBD ring 107 tx_pend_list : Holds used Tx buffers waiting to go into the TBD ring
108 TAIL modified ipw2100_tx() 108 TAIL modified ipw2100_tx()
109 HEAD modified by X__ipw2100_tx_send_data() 109 HEAD modified by ipw2100_tx_send_data()
110 110
111 msg_free_list : Holds pre-allocated Msg (Command) buffers 111 msg_free_list : Holds pre-allocated Msg (Command) buffers
112 TAIL modified in __ipw2100_tx_process() 112 TAIL modified in __ipw2100_tx_process()
@@ -114,7 +114,7 @@ that protects the following:
114 114
115 msg_pend_list : Holds used Msg buffers waiting to go into the TBD ring 115 msg_pend_list : Holds used Msg buffers waiting to go into the TBD ring
116 TAIL modified in ipw2100_hw_send_command() 116 TAIL modified in ipw2100_hw_send_command()
117 HEAD modified in X__ipw2100_tx_send_commands() 117 HEAD modified in ipw2100_tx_send_commands()
118 118
119 The flow of data on the TX side is as follows: 119 The flow of data on the TX side is as follows:
120 120
@@ -207,7 +207,20 @@ MODULE_PARM_DESC(channel, "channel");
207MODULE_PARM_DESC(associate, "auto associate when scanning (default on)"); 207MODULE_PARM_DESC(associate, "auto associate when scanning (default on)");
208MODULE_PARM_DESC(disable, "manually disable the radio (default 0 [radio on])"); 208MODULE_PARM_DESC(disable, "manually disable the radio (default 0 [radio on])");
209 209
210u32 ipw2100_debug_level = IPW_DL_NONE; 210static u32 ipw2100_debug_level = IPW_DL_NONE;
211
212#ifdef CONFIG_IPW_DEBUG
213#define IPW_DEBUG(level, message...) \
214do { \
215 if (ipw2100_debug_level & (level)) { \
216 printk(KERN_DEBUG "ipw2100: %c %s ", \
217 in_interrupt() ? 'I' : 'U', __FUNCTION__); \
218 printk(message); \
219 } \
220} while (0)
221#else
222#define IPW_DEBUG(level, message...) do {} while (0)
223#endif /* CONFIG_IPW_DEBUG */
211 224
212#ifdef CONFIG_IPW_DEBUG 225#ifdef CONFIG_IPW_DEBUG
213static const char *command_types[] = { 226static const char *command_types[] = {
@@ -287,14 +300,30 @@ static const char *command_types[] = {
287 300
288 301
289/* Pre-decl until we get the code solid and then we can clean it up */ 302/* Pre-decl until we get the code solid and then we can clean it up */
290static void X__ipw2100_tx_send_commands(struct ipw2100_priv *priv); 303static void ipw2100_tx_send_commands(struct ipw2100_priv *priv);
291static void X__ipw2100_tx_send_data(struct ipw2100_priv *priv); 304static void ipw2100_tx_send_data(struct ipw2100_priv *priv);
292static int ipw2100_adapter_setup(struct ipw2100_priv *priv); 305static int ipw2100_adapter_setup(struct ipw2100_priv *priv);
293 306
294static void ipw2100_queues_initialize(struct ipw2100_priv *priv); 307static void ipw2100_queues_initialize(struct ipw2100_priv *priv);
295static void ipw2100_queues_free(struct ipw2100_priv *priv); 308static void ipw2100_queues_free(struct ipw2100_priv *priv);
296static int ipw2100_queues_allocate(struct ipw2100_priv *priv); 309static int ipw2100_queues_allocate(struct ipw2100_priv *priv);
297 310
311static int ipw2100_fw_download(struct ipw2100_priv *priv,
312 struct ipw2100_fw *fw);
313static int ipw2100_get_firmware(struct ipw2100_priv *priv,
314 struct ipw2100_fw *fw);
315static int ipw2100_get_fwversion(struct ipw2100_priv *priv, char *buf,
316 size_t max);
317static int ipw2100_get_ucodeversion(struct ipw2100_priv *priv, char *buf,
318 size_t max);
319static void ipw2100_release_firmware(struct ipw2100_priv *priv,
320 struct ipw2100_fw *fw);
321static int ipw2100_ucode_download(struct ipw2100_priv *priv,
322 struct ipw2100_fw *fw);
323static void ipw2100_wx_event_work(struct ipw2100_priv *priv);
324static struct iw_statistics *ipw2100_wx_wireless_stats(struct net_device * dev);
325static struct iw_handler_def ipw2100_wx_handler_def;
326
298 327
299static inline void read_register(struct net_device *dev, u32 reg, u32 *val) 328static inline void read_register(struct net_device *dev, u32 reg, u32 *val)
300{ 329{
@@ -473,8 +502,8 @@ static inline int ipw2100_hw_is_adapter_in_system(struct net_device *dev)
473 == IPW_DATA_DOA_DEBUG_VALUE)); 502 == IPW_DATA_DOA_DEBUG_VALUE));
474} 503}
475 504
476int ipw2100_get_ordinal(struct ipw2100_priv *priv, u32 ord, 505static int ipw2100_get_ordinal(struct ipw2100_priv *priv, u32 ord,
477 void *val, u32 *len) 506 void *val, u32 *len)
478{ 507{
479 struct ipw2100_ordinals *ordinals = &priv->ordinals; 508 struct ipw2100_ordinals *ordinals = &priv->ordinals;
480 u32 addr; 509 u32 addr;
@@ -484,7 +513,7 @@ int ipw2100_get_ordinal(struct ipw2100_priv *priv, u32 ord,
484 u32 total_length; 513 u32 total_length;
485 514
486 if (ordinals->table1_addr == 0) { 515 if (ordinals->table1_addr == 0) {
487 IPW_DEBUG_WARNING(DRV_NAME ": attempt to use fw ordinals " 516 printk(KERN_WARNING DRV_NAME ": attempt to use fw ordinals "
488 "before they have been loaded.\n"); 517 "before they have been loaded.\n");
489 return -EINVAL; 518 return -EINVAL;
490 } 519 }
@@ -493,7 +522,7 @@ int ipw2100_get_ordinal(struct ipw2100_priv *priv, u32 ord,
493 if (*len < IPW_ORD_TAB_1_ENTRY_SIZE) { 522 if (*len < IPW_ORD_TAB_1_ENTRY_SIZE) {
494 *len = IPW_ORD_TAB_1_ENTRY_SIZE; 523 *len = IPW_ORD_TAB_1_ENTRY_SIZE;
495 524
496 IPW_DEBUG_WARNING(DRV_NAME 525 printk(KERN_WARNING DRV_NAME
497 ": ordinal buffer length too small, need %zd\n", 526 ": ordinal buffer length too small, need %zd\n",
498 IPW_ORD_TAB_1_ENTRY_SIZE); 527 IPW_ORD_TAB_1_ENTRY_SIZE);
499 528
@@ -546,7 +575,7 @@ int ipw2100_get_ordinal(struct ipw2100_priv *priv, u32 ord,
546 return 0; 575 return 0;
547 } 576 }
548 577
549 IPW_DEBUG_WARNING(DRV_NAME ": ordinal %d neither in table 1 nor " 578 printk(KERN_WARNING DRV_NAME ": ordinal %d neither in table 1 nor "
550 "in table 2\n", ord); 579 "in table 2\n", ord);
551 580
552 return -EINVAL; 581 return -EINVAL;
@@ -736,8 +765,8 @@ static int ipw2100_hw_send_command(struct ipw2100_priv *priv,
736 list_add_tail(element, &priv->msg_pend_list); 765 list_add_tail(element, &priv->msg_pend_list);
737 INC_STAT(&priv->msg_pend_stat); 766 INC_STAT(&priv->msg_pend_stat);
738 767
739 X__ipw2100_tx_send_commands(priv); 768 ipw2100_tx_send_commands(priv);
740 X__ipw2100_tx_send_data(priv); 769 ipw2100_tx_send_data(priv);
741 770
742 spin_unlock_irqrestore(&priv->low_lock, flags); 771 spin_unlock_irqrestore(&priv->low_lock, flags);
743 772
@@ -761,7 +790,7 @@ static int ipw2100_hw_send_command(struct ipw2100_priv *priv,
761 } 790 }
762 791
763 if (priv->fatal_error) { 792 if (priv->fatal_error) {
764 IPW_DEBUG_WARNING("%s: firmware fatal error\n", 793 printk(KERN_WARNING DRV_NAME ": %s: firmware fatal error\n",
765 priv->net_dev->name); 794 priv->net_dev->name);
766 return -EIO; 795 return -EIO;
767 } 796 }
@@ -999,7 +1028,7 @@ static int ipw2100_download_firmware(struct ipw2100_priv *priv)
999 /* load microcode */ 1028 /* load microcode */
1000 err = ipw2100_ucode_download(priv, &ipw2100_firmware); 1029 err = ipw2100_ucode_download(priv, &ipw2100_firmware);
1001 if (err) { 1030 if (err) {
1002 IPW_DEBUG_ERROR("%s: Error loading microcode: %d\n", 1031 printk(KERN_ERR DRV_NAME ": %s: Error loading microcode: %d\n",
1003 priv->net_dev->name, err); 1032 priv->net_dev->name, err);
1004 goto fail; 1033 goto fail;
1005 } 1034 }
@@ -1012,7 +1041,7 @@ static int ipw2100_download_firmware(struct ipw2100_priv *priv)
1012 /* s/w reset and clock stabilization (again!!!) */ 1041 /* s/w reset and clock stabilization (again!!!) */
1013 err = sw_reset_and_clock(priv); 1042 err = sw_reset_and_clock(priv);
1014 if (err) { 1043 if (err) {
1015 IPW_DEBUG_ERROR("%s: sw_reset_and_clock failed: %d\n", 1044 printk(KERN_ERR DRV_NAME ": %s: sw_reset_and_clock failed: %d\n",
1016 priv->net_dev->name, err); 1045 priv->net_dev->name, err);
1017 goto fail; 1046 goto fail;
1018 } 1047 }
@@ -1206,7 +1235,7 @@ static int ipw2100_start_adapter(struct ipw2100_priv *priv)
1206 * fw & dino ucode 1235 * fw & dino ucode
1207 */ 1236 */
1208 if (ipw2100_download_firmware(priv)) { 1237 if (ipw2100_download_firmware(priv)) {
1209 IPW_DEBUG_ERROR("%s: Failed to power on the adapter.\n", 1238 printk(KERN_ERR DRV_NAME ": %s: Failed to power on the adapter.\n",
1210 priv->net_dev->name); 1239 priv->net_dev->name);
1211 return -EIO; 1240 return -EIO;
1212 } 1241 }
@@ -1266,7 +1295,7 @@ static int ipw2100_start_adapter(struct ipw2100_priv *priv)
1266 i ? "SUCCESS" : "FAILED"); 1295 i ? "SUCCESS" : "FAILED");
1267 1296
1268 if (!i) { 1297 if (!i) {
1269 IPW_DEBUG_WARNING("%s: Firmware did not initialize.\n", 1298 printk(KERN_WARNING DRV_NAME ": %s: Firmware did not initialize.\n",
1270 priv->net_dev->name); 1299 priv->net_dev->name);
1271 return -EIO; 1300 return -EIO;
1272 } 1301 }
@@ -1462,7 +1491,7 @@ static int ipw2100_hw_stop_adapter(struct ipw2100_priv *priv)
1462 1491
1463 err = ipw2100_hw_phy_off(priv); 1492 err = ipw2100_hw_phy_off(priv);
1464 if (err) 1493 if (err)
1465 IPW_DEBUG_WARNING("Error disabling radio %d\n", err); 1494 printk(KERN_WARNING DRV_NAME ": Error disabling radio %d\n", err);
1466 1495
1467 /* 1496 /*
1468 * If in D0-standby mode going directly to D3 may cause a 1497 * If in D0-standby mode going directly to D3 may cause a
@@ -1488,7 +1517,7 @@ static int ipw2100_hw_stop_adapter(struct ipw2100_priv *priv)
1488 1517
1489 err = ipw2100_hw_send_command(priv, &cmd); 1518 err = ipw2100_hw_send_command(priv, &cmd);
1490 if (err) 1519 if (err)
1491 IPW_DEBUG_WARNING( 1520 printk(KERN_WARNING DRV_NAME ": "
1492 "%s: Power down command failed: Error %d\n", 1521 "%s: Power down command failed: Error %d\n",
1493 priv->net_dev->name, err); 1522 priv->net_dev->name, err);
1494 else { 1523 else {
@@ -1529,7 +1558,7 @@ static int ipw2100_hw_stop_adapter(struct ipw2100_priv *priv)
1529 } 1558 }
1530 1559
1531 if (i == 0) 1560 if (i == 0)
1532 IPW_DEBUG_WARNING(DRV_NAME 1561 printk(KERN_WARNING DRV_NAME
1533 ": %s: Could now power down adapter.\n", 1562 ": %s: Could now power down adapter.\n",
1534 priv->net_dev->name); 1563 priv->net_dev->name);
1535 1564
@@ -1569,13 +1598,13 @@ static int ipw2100_disable_adapter(struct ipw2100_priv *priv)
1569 1598
1570 err = ipw2100_hw_send_command(priv, &cmd); 1599 err = ipw2100_hw_send_command(priv, &cmd);
1571 if (err) { 1600 if (err) {
1572 IPW_DEBUG_WARNING("exit - failed to send CARD_DISABLE command\n"); 1601 printk(KERN_WARNING DRV_NAME ": exit - failed to send CARD_DISABLE command\n");
1573 goto fail_up; 1602 goto fail_up;
1574 } 1603 }
1575 1604
1576 err = ipw2100_wait_for_card_state(priv, IPW_HW_STATE_DISABLED); 1605 err = ipw2100_wait_for_card_state(priv, IPW_HW_STATE_DISABLED);
1577 if (err) { 1606 if (err) {
1578 IPW_DEBUG_WARNING("exit - card failed to change to DISABLED\n"); 1607 printk(KERN_WARNING DRV_NAME ": exit - card failed to change to DISABLED\n");
1579 goto fail_up; 1608 goto fail_up;
1580 } 1609 }
1581 1610
@@ -1586,7 +1615,7 @@ fail_up:
1586 return err; 1615 return err;
1587} 1616}
1588 1617
1589int ipw2100_set_scan_options(struct ipw2100_priv *priv) 1618static int ipw2100_set_scan_options(struct ipw2100_priv *priv)
1590{ 1619{
1591 struct host_command cmd = { 1620 struct host_command cmd = {
1592 .host_command = SET_SCAN_OPTIONS, 1621 .host_command = SET_SCAN_OPTIONS,
@@ -1618,7 +1647,7 @@ int ipw2100_set_scan_options(struct ipw2100_priv *priv)
1618 return err; 1647 return err;
1619} 1648}
1620 1649
1621int ipw2100_start_scan(struct ipw2100_priv *priv) 1650static int ipw2100_start_scan(struct ipw2100_priv *priv)
1622{ 1651{
1623 struct host_command cmd = { 1652 struct host_command cmd = {
1624 .host_command = BROADCAST_SCAN, 1653 .host_command = BROADCAST_SCAN,
@@ -1685,7 +1714,7 @@ static int ipw2100_up(struct ipw2100_priv *priv, int deferred)
1685 (priv->status & STATUS_RESET_PENDING)) { 1714 (priv->status & STATUS_RESET_PENDING)) {
1686 /* Power cycle the card ... */ 1715 /* Power cycle the card ... */
1687 if (ipw2100_power_cycle_adapter(priv)) { 1716 if (ipw2100_power_cycle_adapter(priv)) {
1688 IPW_DEBUG_WARNING("%s: Could not cycle adapter.\n", 1717 printk(KERN_WARNING DRV_NAME ": %s: Could not cycle adapter.\n",
1689 priv->net_dev->name); 1718 priv->net_dev->name);
1690 rc = 1; 1719 rc = 1;
1691 goto exit; 1720 goto exit;
@@ -1695,7 +1724,7 @@ static int ipw2100_up(struct ipw2100_priv *priv, int deferred)
1695 1724
1696 /* Load the firmware, start the clocks, etc. */ 1725 /* Load the firmware, start the clocks, etc. */
1697 if (ipw2100_start_adapter(priv)) { 1726 if (ipw2100_start_adapter(priv)) {
1698 IPW_DEBUG_ERROR("%s: Failed to start the firmware.\n", 1727 printk(KERN_ERR DRV_NAME ": %s: Failed to start the firmware.\n",
1699 priv->net_dev->name); 1728 priv->net_dev->name);
1700 rc = 1; 1729 rc = 1;
1701 goto exit; 1730 goto exit;
@@ -1705,7 +1734,7 @@ static int ipw2100_up(struct ipw2100_priv *priv, int deferred)
1705 1734
1706 /* Determine capabilities of this particular HW configuration */ 1735 /* Determine capabilities of this particular HW configuration */
1707 if (ipw2100_get_hw_features(priv)) { 1736 if (ipw2100_get_hw_features(priv)) {
1708 IPW_DEBUG_ERROR("%s: Failed to determine HW features.\n", 1737 printk(KERN_ERR DRV_NAME ": %s: Failed to determine HW features.\n",
1709 priv->net_dev->name); 1738 priv->net_dev->name);
1710 rc = 1; 1739 rc = 1;
1711 goto exit; 1740 goto exit;
@@ -1713,7 +1742,7 @@ static int ipw2100_up(struct ipw2100_priv *priv, int deferred)
1713 1742
1714 lock = LOCK_NONE; 1743 lock = LOCK_NONE;
1715 if (ipw2100_set_ordinal(priv, IPW_ORD_PERS_DB_LOCK, &lock, &ord_len)) { 1744 if (ipw2100_set_ordinal(priv, IPW_ORD_PERS_DB_LOCK, &lock, &ord_len)) {
1716 IPW_DEBUG_ERROR("%s: Failed to clear ordinal lock.\n", 1745 printk(KERN_ERR DRV_NAME ": %s: Failed to clear ordinal lock.\n",
1717 priv->net_dev->name); 1746 priv->net_dev->name);
1718 rc = 1; 1747 rc = 1;
1719 goto exit; 1748 goto exit;
@@ -1739,7 +1768,7 @@ static int ipw2100_up(struct ipw2100_priv *priv, int deferred)
1739 /* Send all of the commands that must be sent prior to 1768 /* Send all of the commands that must be sent prior to
1740 * HOST_COMPLETE */ 1769 * HOST_COMPLETE */
1741 if (ipw2100_adapter_setup(priv)) { 1770 if (ipw2100_adapter_setup(priv)) {
1742 IPW_DEBUG_ERROR("%s: Failed to start the card.\n", 1771 printk(KERN_ERR DRV_NAME ": %s: Failed to start the card.\n",
1743 priv->net_dev->name); 1772 priv->net_dev->name);
1744 rc = 1; 1773 rc = 1;
1745 goto exit; 1774 goto exit;
@@ -1748,7 +1777,7 @@ static int ipw2100_up(struct ipw2100_priv *priv, int deferred)
1748 if (!deferred) { 1777 if (!deferred) {
1749 /* Enable the adapter - sends HOST_COMPLETE */ 1778 /* Enable the adapter - sends HOST_COMPLETE */
1750 if (ipw2100_enable_adapter(priv)) { 1779 if (ipw2100_enable_adapter(priv)) {
1751 IPW_DEBUG_ERROR( 1780 printk(KERN_ERR DRV_NAME ": "
1752 "%s: failed in call to enable adapter.\n", 1781 "%s: failed in call to enable adapter.\n",
1753 priv->net_dev->name); 1782 priv->net_dev->name);
1754 ipw2100_hw_stop_adapter(priv); 1783 ipw2100_hw_stop_adapter(priv);
@@ -1806,7 +1835,7 @@ static void ipw2100_down(struct ipw2100_priv *priv)
1806 spin_unlock_irqrestore(&priv->low_lock, flags); 1835 spin_unlock_irqrestore(&priv->low_lock, flags);
1807 1836
1808 if (ipw2100_hw_stop_adapter(priv)) 1837 if (ipw2100_hw_stop_adapter(priv))
1809 IPW_DEBUG_ERROR("%s: Error stopping adapter.\n", 1838 printk(KERN_ERR DRV_NAME ": %s: Error stopping adapter.\n",
1810 priv->net_dev->name); 1839 priv->net_dev->name);
1811 1840
1812 /* Do not disable the interrupt until _after_ we disable 1841 /* Do not disable the interrupt until _after_ we disable
@@ -1833,7 +1862,7 @@ static void ipw2100_down(struct ipw2100_priv *priv)
1833 netif_stop_queue(priv->net_dev); 1862 netif_stop_queue(priv->net_dev);
1834} 1863}
1835 1864
1836void ipw2100_reset_adapter(struct ipw2100_priv *priv) 1865static void ipw2100_reset_adapter(struct ipw2100_priv *priv)
1837{ 1866{
1838 unsigned long flags; 1867 unsigned long flags;
1839 union iwreq_data wrqu = { 1868 union iwreq_data wrqu = {
@@ -1963,8 +1992,8 @@ static void isr_indicate_associated(struct ipw2100_priv *priv, u32 status)
1963} 1992}
1964 1993
1965 1994
1966int ipw2100_set_essid(struct ipw2100_priv *priv, char *essid, 1995static int ipw2100_set_essid(struct ipw2100_priv *priv, char *essid,
1967 int length, int batch_mode) 1996 int length, int batch_mode)
1968{ 1997{
1969 int ssid_len = min(length, IW_ESSID_MAX_SIZE); 1998 int ssid_len = min(length, IW_ESSID_MAX_SIZE);
1970 struct host_command cmd = { 1999 struct host_command cmd = {
@@ -2095,7 +2124,7 @@ static void isr_indicate_scanning(struct ipw2100_priv *priv, u32 status)
2095 priv->status |= STATUS_SCANNING; 2124 priv->status |= STATUS_SCANNING;
2096} 2125}
2097 2126
2098const struct ipw2100_status_indicator status_handlers[] = { 2127static const struct ipw2100_status_indicator status_handlers[] = {
2099 IPW2100_HANDLER(IPW_STATE_INITIALIZED, 0), 2128 IPW2100_HANDLER(IPW_STATE_INITIALIZED, 0),
2100 IPW2100_HANDLER(IPW_STATE_COUNTRY_FOUND, 0), 2129 IPW2100_HANDLER(IPW_STATE_COUNTRY_FOUND, 0),
2101 IPW2100_HANDLER(IPW_STATE_ASSOCIATED, isr_indicate_associated), 2130 IPW2100_HANDLER(IPW_STATE_ASSOCIATED, isr_indicate_associated),
@@ -2163,7 +2192,7 @@ static void isr_rx_complete_command(
2163} 2192}
2164 2193
2165#ifdef CONFIG_IPW_DEBUG 2194#ifdef CONFIG_IPW_DEBUG
2166const char *frame_types[] = { 2195static const char *frame_types[] = {
2167 "COMMAND_STATUS_VAL", 2196 "COMMAND_STATUS_VAL",
2168 "STATUS_CHANGE_VAL", 2197 "STATUS_CHANGE_VAL",
2169 "P80211_DATA_VAL", 2198 "P80211_DATA_VAL",
@@ -2283,7 +2312,7 @@ static inline u32 ipw2100_match_buf(struct ipw2100_priv *priv, u8 *in_buf,
2283 * 2312 *
2284 */ 2313 */
2285#ifdef CONFIG_IPW2100_RX_DEBUG 2314#ifdef CONFIG_IPW2100_RX_DEBUG
2286u8 packet_data[IPW_RX_NIC_BUFFER_LENGTH]; 2315static u8 packet_data[IPW_RX_NIC_BUFFER_LENGTH];
2287#endif 2316#endif
2288 2317
2289static inline void ipw2100_corruption_detected(struct ipw2100_priv *priv, 2318static inline void ipw2100_corruption_detected(struct ipw2100_priv *priv,
@@ -2413,7 +2442,7 @@ static inline void isr_rx(struct ipw2100_priv *priv, int i,
2413 2442
2414 /* We need to allocate a new SKB and attach it to the RDB. */ 2443 /* We need to allocate a new SKB and attach it to the RDB. */
2415 if (unlikely(ipw2100_alloc_skb(priv, packet))) { 2444 if (unlikely(ipw2100_alloc_skb(priv, packet))) {
2416 IPW_DEBUG_WARNING( 2445 printk(KERN_WARNING DRV_NAME ": "
2417 "%s: Unable to allocate SKB onto RBD ring - disabling " 2446 "%s: Unable to allocate SKB onto RBD ring - disabling "
2418 "adapter.\n", priv->net_dev->name); 2447 "adapter.\n", priv->net_dev->name);
2419 /* TODO: schedule adapter shutdown */ 2448 /* TODO: schedule adapter shutdown */
@@ -2675,7 +2704,7 @@ static inline int __ipw2100_tx_process(struct ipw2100_priv *priv)
2675 break; 2704 break;
2676 2705
2677 default: 2706 default:
2678 IPW_DEBUG_WARNING("%s: Bad fw_pend_list entry!\n", 2707 printk(KERN_WARNING DRV_NAME ": %s: Bad fw_pend_list entry!\n",
2679 priv->net_dev->name); 2708 priv->net_dev->name);
2680 return 0; 2709 return 0;
2681 } 2710 }
@@ -2689,7 +2718,7 @@ static inline int __ipw2100_tx_process(struct ipw2100_priv *priv)
2689 read_register(priv->net_dev, IPW_MEM_HOST_SHARED_TX_QUEUE_WRITE_INDEX, 2718 read_register(priv->net_dev, IPW_MEM_HOST_SHARED_TX_QUEUE_WRITE_INDEX,
2690 &w); 2719 &w);
2691 if (w != txq->next) 2720 if (w != txq->next)
2692 IPW_DEBUG_WARNING("%s: write index mismatch\n", 2721 printk(KERN_WARNING DRV_NAME ": %s: write index mismatch\n",
2693 priv->net_dev->name); 2722 priv->net_dev->name);
2694 2723
2695 /* 2724 /*
@@ -2750,7 +2779,7 @@ static inline int __ipw2100_tx_process(struct ipw2100_priv *priv)
2750 switch (packet->type) { 2779 switch (packet->type) {
2751 case DATA: 2780 case DATA:
2752 if (txq->drv[txq->oldest].status.info.fields.txType != 0) 2781 if (txq->drv[txq->oldest].status.info.fields.txType != 0)
2753 IPW_DEBUG_WARNING("%s: Queue mismatch. " 2782 printk(KERN_WARNING DRV_NAME ": %s: Queue mismatch. "
2754 "Expecting DATA TBD but pulled " 2783 "Expecting DATA TBD but pulled "
2755 "something else: ids %d=%d.\n", 2784 "something else: ids %d=%d.\n",
2756 priv->net_dev->name, txq->oldest, packet->index); 2785 priv->net_dev->name, txq->oldest, packet->index);
@@ -2797,7 +2826,7 @@ static inline int __ipw2100_tx_process(struct ipw2100_priv *priv)
2797 2826
2798 case COMMAND: 2827 case COMMAND:
2799 if (txq->drv[txq->oldest].status.info.fields.txType != 1) 2828 if (txq->drv[txq->oldest].status.info.fields.txType != 1)
2800 IPW_DEBUG_WARNING("%s: Queue mismatch. " 2829 printk(KERN_WARNING DRV_NAME ": %s: Queue mismatch. "
2801 "Expecting COMMAND TBD but pulled " 2830 "Expecting COMMAND TBD but pulled "
2802 "something else: ids %d=%d.\n", 2831 "something else: ids %d=%d.\n",
2803 priv->net_dev->name, txq->oldest, packet->index); 2832 priv->net_dev->name, txq->oldest, packet->index);
@@ -2837,14 +2866,14 @@ static inline void __ipw2100_tx_complete(struct ipw2100_priv *priv)
2837 while (__ipw2100_tx_process(priv) && i < 200) i++; 2866 while (__ipw2100_tx_process(priv) && i < 200) i++;
2838 2867
2839 if (i == 200) { 2868 if (i == 200) {
2840 IPW_DEBUG_WARNING( 2869 printk(KERN_WARNING DRV_NAME ": "
2841 "%s: Driver is running slow (%d iters).\n", 2870 "%s: Driver is running slow (%d iters).\n",
2842 priv->net_dev->name, i); 2871 priv->net_dev->name, i);
2843 } 2872 }
2844} 2873}
2845 2874
2846 2875
2847static void X__ipw2100_tx_send_commands(struct ipw2100_priv *priv) 2876static void ipw2100_tx_send_commands(struct ipw2100_priv *priv)
2848{ 2877{
2849 struct list_head *element; 2878 struct list_head *element;
2850 struct ipw2100_tx_packet *packet; 2879 struct ipw2100_tx_packet *packet;
@@ -2912,10 +2941,10 @@ static void X__ipw2100_tx_send_commands(struct ipw2100_priv *priv)
2912 2941
2913 2942
2914/* 2943/*
2915 * X__ipw2100_tx_send_data 2944 * ipw2100_tx_send_data
2916 * 2945 *
2917 */ 2946 */
2918static void X__ipw2100_tx_send_data(struct ipw2100_priv *priv) 2947static void ipw2100_tx_send_data(struct ipw2100_priv *priv)
2919{ 2948{
2920 struct list_head *element; 2949 struct list_head *element;
2921 struct ipw2100_tx_packet *packet; 2950 struct ipw2100_tx_packet *packet;
@@ -3081,7 +3110,7 @@ static void ipw2100_irq_tasklet(struct ipw2100_priv *priv)
3081 (unsigned long)inta & IPW_INTERRUPT_MASK); 3110 (unsigned long)inta & IPW_INTERRUPT_MASK);
3082 3111
3083 if (inta & IPW2100_INTA_FATAL_ERROR) { 3112 if (inta & IPW2100_INTA_FATAL_ERROR) {
3084 IPW_DEBUG_WARNING(DRV_NAME 3113 printk(KERN_WARNING DRV_NAME
3085 ": Fatal interrupt. Scheduling firmware restart.\n"); 3114 ": Fatal interrupt. Scheduling firmware restart.\n");
3086 priv->inta_other++; 3115 priv->inta_other++;
3087 write_register( 3116 write_register(
@@ -3101,7 +3130,7 @@ static void ipw2100_irq_tasklet(struct ipw2100_priv *priv)
3101 } 3130 }
3102 3131
3103 if (inta & IPW2100_INTA_PARITY_ERROR) { 3132 if (inta & IPW2100_INTA_PARITY_ERROR) {
3104 IPW_DEBUG_ERROR("***** PARITY ERROR INTERRUPT !!!! \n"); 3133 printk(KERN_ERR DRV_NAME ": ***** PARITY ERROR INTERRUPT !!!! \n");
3105 priv->inta_other++; 3134 priv->inta_other++;
3106 write_register( 3135 write_register(
3107 dev, IPW_REG_INTA, 3136 dev, IPW_REG_INTA,
@@ -3130,8 +3159,8 @@ static void ipw2100_irq_tasklet(struct ipw2100_priv *priv)
3130 IPW2100_INTA_TX_TRANSFER); 3159 IPW2100_INTA_TX_TRANSFER);
3131 3160
3132 __ipw2100_tx_complete(priv); 3161 __ipw2100_tx_complete(priv);
3133 X__ipw2100_tx_send_commands(priv); 3162 ipw2100_tx_send_commands(priv);
3134 X__ipw2100_tx_send_data(priv); 3163 ipw2100_tx_send_data(priv);
3135 } 3164 }
3136 3165
3137 if (inta & IPW2100_INTA_TX_COMPLETE) { 3166 if (inta & IPW2100_INTA_TX_COMPLETE) {
@@ -3219,7 +3248,7 @@ static irqreturn_t ipw2100_interrupt(int irq, void *data,
3219 3248
3220 if (inta == 0xFFFFFFFF) { 3249 if (inta == 0xFFFFFFFF) {
3221 /* Hardware disappeared */ 3250 /* Hardware disappeared */
3222 IPW_DEBUG_WARNING("IRQ INTA == 0xFFFFFFFF\n"); 3251 printk(KERN_WARNING DRV_NAME ": IRQ INTA == 0xFFFFFFFF\n");
3223 goto none; 3252 goto none;
3224 } 3253 }
3225 3254
@@ -3282,7 +3311,7 @@ static int ipw2100_tx(struct ieee80211_txb *txb, struct net_device *dev)
3282 list_add_tail(element, &priv->tx_pend_list); 3311 list_add_tail(element, &priv->tx_pend_list);
3283 INC_STAT(&priv->tx_pend_stat); 3312 INC_STAT(&priv->tx_pend_stat);
3284 3313
3285 X__ipw2100_tx_send_data(priv); 3314 ipw2100_tx_send_data(priv);
3286 3315
3287 spin_unlock_irqrestore(&priv->low_lock, flags); 3316 spin_unlock_irqrestore(&priv->low_lock, flags);
3288 return 0; 3317 return 0;
@@ -3304,7 +3333,7 @@ static int ipw2100_msg_allocate(struct ipw2100_priv *priv)
3304 IPW_COMMAND_POOL_SIZE * sizeof(struct ipw2100_tx_packet), 3333 IPW_COMMAND_POOL_SIZE * sizeof(struct ipw2100_tx_packet),
3305 GFP_KERNEL); 3334 GFP_KERNEL);
3306 if (!priv->msg_buffers) { 3335 if (!priv->msg_buffers) {
3307 IPW_DEBUG_ERROR("%s: PCI alloc failed for msg " 3336 printk(KERN_ERR DRV_NAME ": %s: PCI alloc failed for msg "
3308 "buffers.\n", priv->net_dev->name); 3337 "buffers.\n", priv->net_dev->name);
3309 return -ENOMEM; 3338 return -ENOMEM;
3310 } 3339 }
@@ -3315,7 +3344,7 @@ static int ipw2100_msg_allocate(struct ipw2100_priv *priv)
3315 sizeof(struct ipw2100_cmd_header), 3344 sizeof(struct ipw2100_cmd_header),
3316 &p); 3345 &p);
3317 if (!v) { 3346 if (!v) {
3318 IPW_DEBUG_ERROR( 3347 printk(KERN_ERR DRV_NAME ": "
3319 "%s: PCI alloc failed for msg " 3348 "%s: PCI alloc failed for msg "
3320 "buffers.\n", 3349 "buffers.\n",
3321 priv->net_dev->name); 3350 priv->net_dev->name);
@@ -3427,7 +3456,7 @@ static DEVICE_ATTR(capability, S_IRUGO, show_capability, NULL);
3427 3456
3428 3457
3429#define IPW2100_REG(x) { IPW_ ##x, #x } 3458#define IPW2100_REG(x) { IPW_ ##x, #x }
3430const struct { 3459static const struct {
3431 u32 addr; 3460 u32 addr;
3432 const char *name; 3461 const char *name;
3433} hw_data[] = { 3462} hw_data[] = {
@@ -3438,7 +3467,7 @@ const struct {
3438 IPW2100_REG(REG_RESET_REG), 3467 IPW2100_REG(REG_RESET_REG),
3439}; 3468};
3440#define IPW2100_NIC(x, s) { x, #x, s } 3469#define IPW2100_NIC(x, s) { x, #x, s }
3441const struct { 3470static const struct {
3442 u32 addr; 3471 u32 addr;
3443 const char *name; 3472 const char *name;
3444 size_t size; 3473 size_t size;
@@ -3448,7 +3477,7 @@ const struct {
3448 IPW2100_NIC(0x210000, 1), 3477 IPW2100_NIC(0x210000, 1),
3449}; 3478};
3450#define IPW2100_ORD(x, d) { IPW_ORD_ ##x, #x, d } 3479#define IPW2100_ORD(x, d) { IPW_ORD_ ##x, #x, d }
3451const struct { 3480static const struct {
3452 u8 index; 3481 u8 index;
3453 const char *name; 3482 const char *name;
3454 const char *desc; 3483 const char *desc;
@@ -3813,7 +3842,7 @@ static ssize_t show_stats(struct device *d, struct device_attribute *attr,
3813static DEVICE_ATTR(stats, S_IRUGO, show_stats, NULL); 3842static DEVICE_ATTR(stats, S_IRUGO, show_stats, NULL);
3814 3843
3815 3844
3816int ipw2100_switch_mode(struct ipw2100_priv *priv, u32 mode) 3845static int ipw2100_switch_mode(struct ipw2100_priv *priv, u32 mode)
3817{ 3846{
3818 int err; 3847 int err;
3819 3848
@@ -3822,7 +3851,7 @@ int ipw2100_switch_mode(struct ipw2100_priv *priv, u32 mode)
3822 3851
3823 err = ipw2100_disable_adapter(priv); 3852 err = ipw2100_disable_adapter(priv);
3824 if (err) { 3853 if (err) {
3825 IPW_DEBUG_ERROR("%s: Could not disable adapter %d\n", 3854 printk(KERN_ERR DRV_NAME ": %s: Could not disable adapter %d\n",
3826 priv->net_dev->name, err); 3855 priv->net_dev->name, err);
3827 return err; 3856 return err;
3828 } 3857 }
@@ -4268,7 +4297,7 @@ static int ipw2100_tx_allocate(struct ipw2100_priv *priv)
4268 TX_PENDED_QUEUE_LENGTH * sizeof(struct ipw2100_tx_packet), 4297 TX_PENDED_QUEUE_LENGTH * sizeof(struct ipw2100_tx_packet),
4269 GFP_ATOMIC); 4298 GFP_ATOMIC);
4270 if (!priv->tx_buffers) { 4299 if (!priv->tx_buffers) {
4271 IPW_DEBUG_ERROR("%s: alloc failed form tx buffers.\n", 4300 printk(KERN_ERR DRV_NAME ": %s: alloc failed form tx buffers.\n",
4272 priv->net_dev->name); 4301 priv->net_dev->name);
4273 bd_queue_free(priv, &priv->tx_queue); 4302 bd_queue_free(priv, &priv->tx_queue);
4274 return -ENOMEM; 4303 return -ENOMEM;
@@ -4278,7 +4307,7 @@ static int ipw2100_tx_allocate(struct ipw2100_priv *priv)
4278 v = pci_alloc_consistent( 4307 v = pci_alloc_consistent(
4279 priv->pci_dev, sizeof(struct ipw2100_data_header), &p); 4308 priv->pci_dev, sizeof(struct ipw2100_data_header), &p);
4280 if (!v) { 4309 if (!v) {
4281 IPW_DEBUG_ERROR("%s: PCI alloc failed for tx " 4310 printk(KERN_ERR DRV_NAME ": %s: PCI alloc failed for tx "
4282 "buffers.\n", priv->net_dev->name); 4311 "buffers.\n", priv->net_dev->name);
4283 err = -ENOMEM; 4312 err = -ENOMEM;
4284 break; 4313 break;
@@ -4537,7 +4566,7 @@ static int ipw2100_read_mac_address(struct ipw2100_priv *priv)
4537 * 4566 *
4538 ********************************************************************/ 4567 ********************************************************************/
4539 4568
4540int ipw2100_set_mac_address(struct ipw2100_priv *priv, int batch_mode) 4569static int ipw2100_set_mac_address(struct ipw2100_priv *priv, int batch_mode)
4541{ 4570{
4542 struct host_command cmd = { 4571 struct host_command cmd = {
4543 .host_command = ADAPTER_ADDRESS, 4572 .host_command = ADAPTER_ADDRESS,
@@ -4564,7 +4593,7 @@ int ipw2100_set_mac_address(struct ipw2100_priv *priv, int batch_mode)
4564 return err; 4593 return err;
4565} 4594}
4566 4595
4567int ipw2100_set_port_type(struct ipw2100_priv *priv, u32 port_type, 4596static int ipw2100_set_port_type(struct ipw2100_priv *priv, u32 port_type,
4568 int batch_mode) 4597 int batch_mode)
4569{ 4598{
4570 struct host_command cmd = { 4599 struct host_command cmd = {
@@ -4589,7 +4618,7 @@ int ipw2100_set_port_type(struct ipw2100_priv *priv, u32 port_type,
4589 if (!batch_mode) { 4618 if (!batch_mode) {
4590 err = ipw2100_disable_adapter(priv); 4619 err = ipw2100_disable_adapter(priv);
4591 if (err) { 4620 if (err) {
4592 IPW_DEBUG_ERROR("%s: Could not disable adapter %d\n", 4621 printk(KERN_ERR DRV_NAME ": %s: Could not disable adapter %d\n",
4593 priv->net_dev->name, err); 4622 priv->net_dev->name, err);
4594 return err; 4623 return err;
4595 } 4624 }
@@ -4605,7 +4634,8 @@ int ipw2100_set_port_type(struct ipw2100_priv *priv, u32 port_type,
4605} 4634}
4606 4635
4607 4636
4608int ipw2100_set_channel(struct ipw2100_priv *priv, u32 channel, int batch_mode) 4637static int ipw2100_set_channel(struct ipw2100_priv *priv, u32 channel,
4638 int batch_mode)
4609{ 4639{
4610 struct host_command cmd = { 4640 struct host_command cmd = {
4611 .host_command = CHANNEL, 4641 .host_command = CHANNEL,
@@ -4655,7 +4685,7 @@ int ipw2100_set_channel(struct ipw2100_priv *priv, u32 channel, int batch_mode)
4655 return 0; 4685 return 0;
4656} 4686}
4657 4687
4658int ipw2100_system_config(struct ipw2100_priv *priv, int batch_mode) 4688static int ipw2100_system_config(struct ipw2100_priv *priv, int batch_mode)
4659{ 4689{
4660 struct host_command cmd = { 4690 struct host_command cmd = {
4661 .host_command = SYSTEM_CONFIG, 4691 .host_command = SYSTEM_CONFIG,
@@ -4717,7 +4747,8 @@ int ipw2100_system_config(struct ipw2100_priv *priv, int batch_mode)
4717 return 0; 4747 return 0;
4718} 4748}
4719 4749
4720int ipw2100_set_tx_rates(struct ipw2100_priv *priv, u32 rate, int batch_mode) 4750static int ipw2100_set_tx_rates(struct ipw2100_priv *priv, u32 rate,
4751 int batch_mode)
4721{ 4752{
4722 struct host_command cmd = { 4753 struct host_command cmd = {
4723 .host_command = BASIC_TX_RATES, 4754 .host_command = BASIC_TX_RATES,
@@ -4756,8 +4787,8 @@ int ipw2100_set_tx_rates(struct ipw2100_priv *priv, u32 rate, int batch_mode)
4756 return 0; 4787 return 0;
4757} 4788}
4758 4789
4759int ipw2100_set_power_mode(struct ipw2100_priv *priv, 4790static int ipw2100_set_power_mode(struct ipw2100_priv *priv,
4760 int power_level) 4791 int power_level)
4761{ 4792{
4762 struct host_command cmd = { 4793 struct host_command cmd = {
4763 .host_command = POWER_MODE, 4794 .host_command = POWER_MODE,
@@ -4794,7 +4825,7 @@ int ipw2100_set_power_mode(struct ipw2100_priv *priv,
4794} 4825}
4795 4826
4796 4827
4797int ipw2100_set_rts_threshold(struct ipw2100_priv *priv, u32 threshold) 4828static int ipw2100_set_rts_threshold(struct ipw2100_priv *priv, u32 threshold)
4798{ 4829{
4799 struct host_command cmd = { 4830 struct host_command cmd = {
4800 .host_command = RTS_THRESHOLD, 4831 .host_command = RTS_THRESHOLD,
@@ -4858,7 +4889,7 @@ int ipw2100_set_fragmentation_threshold(struct ipw2100_priv *priv,
4858} 4889}
4859#endif 4890#endif
4860 4891
4861int ipw2100_set_short_retry(struct ipw2100_priv *priv, u32 retry) 4892static int ipw2100_set_short_retry(struct ipw2100_priv *priv, u32 retry)
4862{ 4893{
4863 struct host_command cmd = { 4894 struct host_command cmd = {
4864 .host_command = SHORT_RETRY_LIMIT, 4895 .host_command = SHORT_RETRY_LIMIT,
@@ -4878,7 +4909,7 @@ int ipw2100_set_short_retry(struct ipw2100_priv *priv, u32 retry)
4878 return 0; 4909 return 0;
4879} 4910}
4880 4911
4881int ipw2100_set_long_retry(struct ipw2100_priv *priv, u32 retry) 4912static int ipw2100_set_long_retry(struct ipw2100_priv *priv, u32 retry)
4882{ 4913{
4883 struct host_command cmd = { 4914 struct host_command cmd = {
4884 .host_command = LONG_RETRY_LIMIT, 4915 .host_command = LONG_RETRY_LIMIT,
@@ -4899,8 +4930,8 @@ int ipw2100_set_long_retry(struct ipw2100_priv *priv, u32 retry)
4899} 4930}
4900 4931
4901 4932
4902int ipw2100_set_mandatory_bssid(struct ipw2100_priv *priv, u8 *bssid, 4933static int ipw2100_set_mandatory_bssid(struct ipw2100_priv *priv, u8 *bssid,
4903 int batch_mode) 4934 int batch_mode)
4904{ 4935{
4905 struct host_command cmd = { 4936 struct host_command cmd = {
4906 .host_command = MANDATORY_BSSID, 4937 .host_command = MANDATORY_BSSID,
@@ -5037,11 +5068,11 @@ struct security_info_params {
5037 u8 unicast_using_group; 5068 u8 unicast_using_group;
5038} __attribute__ ((packed)); 5069} __attribute__ ((packed));
5039 5070
5040int ipw2100_set_security_information(struct ipw2100_priv *priv, 5071static int ipw2100_set_security_information(struct ipw2100_priv *priv,
5041 int auth_mode, 5072 int auth_mode,
5042 int security_level, 5073 int security_level,
5043 int unicast_using_group, 5074 int unicast_using_group,
5044 int batch_mode) 5075 int batch_mode)
5045{ 5076{
5046 struct host_command cmd = { 5077 struct host_command cmd = {
5047 .host_command = SET_SECURITY_INFORMATION, 5078 .host_command = SET_SECURITY_INFORMATION,
@@ -5103,8 +5134,8 @@ int ipw2100_set_security_information(struct ipw2100_priv *priv,
5103 return err; 5134 return err;
5104} 5135}
5105 5136
5106int ipw2100_set_tx_power(struct ipw2100_priv *priv, 5137static int ipw2100_set_tx_power(struct ipw2100_priv *priv,
5107 u32 tx_power) 5138 u32 tx_power)
5108{ 5139{
5109 struct host_command cmd = { 5140 struct host_command cmd = {
5110 .host_command = TX_POWER_INDEX, 5141 .host_command = TX_POWER_INDEX,
@@ -5123,8 +5154,8 @@ int ipw2100_set_tx_power(struct ipw2100_priv *priv,
5123 return 0; 5154 return 0;
5124} 5155}
5125 5156
5126int ipw2100_set_ibss_beacon_interval(struct ipw2100_priv *priv, 5157static int ipw2100_set_ibss_beacon_interval(struct ipw2100_priv *priv,
5127 u32 interval, int batch_mode) 5158 u32 interval, int batch_mode)
5128{ 5159{
5129 struct host_command cmd = { 5160 struct host_command cmd = {
5130 .host_command = BEACON_INTERVAL, 5161 .host_command = BEACON_INTERVAL,
@@ -5208,7 +5239,7 @@ static int ipw2100_set_wep_flags(struct ipw2100_priv *priv, u32 flags,
5208 if (!batch_mode) { 5239 if (!batch_mode) {
5209 err = ipw2100_disable_adapter(priv); 5240 err = ipw2100_disable_adapter(priv);
5210 if (err) { 5241 if (err) {
5211 IPW_DEBUG_ERROR("%s: Could not disable adapter %d\n", 5242 printk(KERN_ERR DRV_NAME ": %s: Could not disable adapter %d\n",
5212 priv->net_dev->name, err); 5243 priv->net_dev->name, err);
5213 return err; 5244 return err;
5214 } 5245 }
@@ -5296,7 +5327,7 @@ static int ipw2100_set_key(struct ipw2100_priv *priv,
5296 err = ipw2100_disable_adapter(priv); 5327 err = ipw2100_disable_adapter(priv);
5297 /* FIXME: IPG: shouldn't this prink be in _disable_adapter()? */ 5328 /* FIXME: IPG: shouldn't this prink be in _disable_adapter()? */
5298 if (err) { 5329 if (err) {
5299 IPW_DEBUG_ERROR("%s: Could not disable adapter %d\n", 5330 printk(KERN_ERR DRV_NAME ": %s: Could not disable adapter %d\n",
5300 priv->net_dev->name, err); 5331 priv->net_dev->name, err);
5301 return err; 5332 return err;
5302 } 5333 }
@@ -5332,7 +5363,7 @@ static int ipw2100_set_key_index(struct ipw2100_priv *priv,
5332 if (!batch_mode) { 5363 if (!batch_mode) {
5333 err = ipw2100_disable_adapter(priv); 5364 err = ipw2100_disable_adapter(priv);
5334 if (err) { 5365 if (err) {
5335 IPW_DEBUG_ERROR("%s: Could not disable adapter %d\n", 5366 printk(KERN_ERR DRV_NAME ": %s: Could not disable adapter %d\n",
5336 priv->net_dev->name, err); 5367 priv->net_dev->name, err);
5337 return err; 5368 return err;
5338 } 5369 }
@@ -5654,8 +5685,10 @@ static int ipw2100_open(struct net_device *dev)
5654 IPW_DEBUG_INFO("dev->open\n"); 5685 IPW_DEBUG_INFO("dev->open\n");
5655 5686
5656 spin_lock_irqsave(&priv->low_lock, flags); 5687 spin_lock_irqsave(&priv->low_lock, flags);
5657 if (priv->status & STATUS_ASSOCIATED) 5688 if (priv->status & STATUS_ASSOCIATED) {
5689 netif_carrier_on(dev);
5658 netif_start_queue(dev); 5690 netif_start_queue(dev);
5691 }
5659 spin_unlock_irqrestore(&priv->low_lock, flags); 5692 spin_unlock_irqrestore(&priv->low_lock, flags);
5660 5693
5661 return 0; 5694 return 0;
@@ -5880,7 +5913,7 @@ static int ipw2100_wpa_set_param(struct net_device *dev, u8 name, u32 value){
5880 break; 5913 break;
5881 5914
5882 default: 5915 default:
5883 IPW_DEBUG_ERROR("%s: Unknown WPA param: %d\n", 5916 printk(KERN_ERR DRV_NAME ": %s: Unknown WPA param: %d\n",
5884 dev->name, name); 5917 dev->name, name);
5885 ret = -EOPNOTSUPP; 5918 ret = -EOPNOTSUPP;
5886 } 5919 }
@@ -5903,7 +5936,7 @@ static int ipw2100_wpa_mlme(struct net_device *dev, int command, int reason){
5903 break; 5936 break;
5904 5937
5905 default: 5938 default:
5906 IPW_DEBUG_ERROR("%s: Unknown MLME request: %d\n", 5939 printk(KERN_ERR DRV_NAME ": %s: Unknown MLME request: %d\n",
5907 dev->name, command); 5940 dev->name, command);
5908 ret = -EOPNOTSUPP; 5941 ret = -EOPNOTSUPP;
5909 } 5942 }
@@ -6153,7 +6186,7 @@ static int ipw2100_wpa_supplicant(struct net_device *dev, struct iw_point *p){
6153 break; 6186 break;
6154 6187
6155 default: 6188 default:
6156 IPW_DEBUG_ERROR("%s: Unknown WPA supplicant request: %d\n", 6189 printk(KERN_ERR DRV_NAME ": %s: Unknown WPA supplicant request: %d\n",
6157 dev->name, param->cmd); 6190 dev->name, param->cmd);
6158 ret = -EOPNOTSUPP; 6191 ret = -EOPNOTSUPP;
6159 6192
@@ -6883,7 +6916,7 @@ module_exit(ipw2100_exit);
6883 6916
6884#define WEXT_USECHANNELS 1 6917#define WEXT_USECHANNELS 1
6885 6918
6886const long ipw2100_frequencies[] = { 6919static const long ipw2100_frequencies[] = {
6887 2412, 2417, 2422, 2427, 6920 2412, 2417, 2422, 2427,
6888 2432, 2437, 2442, 2447, 6921 2432, 2437, 2442, 2447,
6889 2452, 2457, 2462, 2467, 6922 2452, 2457, 2462, 2467,
@@ -6893,7 +6926,7 @@ const long ipw2100_frequencies[] = {
6893#define FREQ_COUNT (sizeof(ipw2100_frequencies) / \ 6926#define FREQ_COUNT (sizeof(ipw2100_frequencies) / \
6894 sizeof(ipw2100_frequencies[0])) 6927 sizeof(ipw2100_frequencies[0]))
6895 6928
6896const long ipw2100_rates_11b[] = { 6929static const long ipw2100_rates_11b[] = {
6897 1000000, 6930 1000000,
6898 2000000, 6931 2000000,
6899 5500000, 6932 5500000,
@@ -7052,7 +7085,7 @@ static int ipw2100_wx_get_mode(struct net_device *dev,
7052#define POWER_MODES 5 7085#define POWER_MODES 5
7053 7086
7054/* Values are in microsecond */ 7087/* Values are in microsecond */
7055const s32 timeout_duration[POWER_MODES] = { 7088static const s32 timeout_duration[POWER_MODES] = {
7056 350000, 7089 350000,
7057 250000, 7090 250000,
7058 75000, 7091 75000,
@@ -7060,7 +7093,7 @@ const s32 timeout_duration[POWER_MODES] = {
7060 25000, 7093 25000,
7061}; 7094};
7062 7095
7063const s32 period_duration[POWER_MODES] = { 7096static const s32 period_duration[POWER_MODES] = {
7064 400000, 7097 400000,
7065 700000, 7098 700000,
7066 1000000, 7099 1000000,
@@ -8125,7 +8158,7 @@ static iw_handler ipw2100_private_handler[] = {
8125 ipw2100_wx_get_preamble, 8158 ipw2100_wx_get_preamble,
8126}; 8159};
8127 8160
8128struct iw_handler_def ipw2100_wx_handler_def = 8161static struct iw_handler_def ipw2100_wx_handler_def =
8129{ 8162{
8130 .standard = ipw2100_wx_handlers, 8163 .standard = ipw2100_wx_handlers,
8131 .num_standard = sizeof(ipw2100_wx_handlers) / sizeof(iw_handler), 8164 .num_standard = sizeof(ipw2100_wx_handlers) / sizeof(iw_handler),
@@ -8141,7 +8174,7 @@ struct iw_handler_def ipw2100_wx_handler_def =
8141 * Called by /proc/net/wireless 8174 * Called by /proc/net/wireless
8142 * Also called by SIOCGIWSTATS 8175 * Also called by SIOCGIWSTATS
8143 */ 8176 */
8144struct iw_statistics *ipw2100_wx_wireless_stats(struct net_device * dev) 8177static struct iw_statistics *ipw2100_wx_wireless_stats(struct net_device * dev)
8145{ 8178{
8146 enum { 8179 enum {
8147 POOR = 30, 8180 POOR = 30,
@@ -8277,7 +8310,7 @@ struct iw_statistics *ipw2100_wx_wireless_stats(struct net_device * dev)
8277 return (struct iw_statistics *) NULL; 8310 return (struct iw_statistics *) NULL;
8278} 8311}
8279 8312
8280void ipw2100_wx_event_work(struct ipw2100_priv *priv) 8313static void ipw2100_wx_event_work(struct ipw2100_priv *priv)
8281{ 8314{
8282 union iwreq_data wrqu; 8315 union iwreq_data wrqu;
8283 int len = ETH_ALEN; 8316 int len = ETH_ALEN;
@@ -8375,7 +8408,7 @@ static int ipw2100_mod_firmware_load(struct ipw2100_fw *fw)
8375 (struct ipw2100_fw_header *)fw->fw_entry->data; 8408 (struct ipw2100_fw_header *)fw->fw_entry->data;
8376 8409
8377 if (IPW2100_FW_MAJOR(h->version) != IPW2100_FW_MAJOR_VERSION) { 8410 if (IPW2100_FW_MAJOR(h->version) != IPW2100_FW_MAJOR_VERSION) {
8378 IPW_DEBUG_WARNING("Firmware image not compatible " 8411 printk(KERN_WARNING DRV_NAME ": Firmware image not compatible "
8379 "(detected version id of %u). " 8412 "(detected version id of %u). "
8380 "See Documentation/networking/README.ipw2100\n", 8413 "See Documentation/networking/README.ipw2100\n",
8381 h->version); 8414 h->version);
@@ -8392,7 +8425,8 @@ static int ipw2100_mod_firmware_load(struct ipw2100_fw *fw)
8392} 8425}
8393 8426
8394 8427
8395int ipw2100_get_firmware(struct ipw2100_priv *priv, struct ipw2100_fw *fw) 8428static int ipw2100_get_firmware(struct ipw2100_priv *priv,
8429 struct ipw2100_fw *fw)
8396{ 8430{
8397 char *fw_name; 8431 char *fw_name;
8398 int rc; 8432 int rc;
@@ -8418,7 +8452,7 @@ int ipw2100_get_firmware(struct ipw2100_priv *priv, struct ipw2100_fw *fw)
8418 rc = request_firmware(&fw->fw_entry, fw_name, &priv->pci_dev->dev); 8452 rc = request_firmware(&fw->fw_entry, fw_name, &priv->pci_dev->dev);
8419 8453
8420 if (rc < 0) { 8454 if (rc < 0) {
8421 IPW_DEBUG_ERROR( 8455 printk(KERN_ERR DRV_NAME ": "
8422 "%s: Firmware '%s' not available or load failed.\n", 8456 "%s: Firmware '%s' not available or load failed.\n",
8423 priv->net_dev->name, fw_name); 8457 priv->net_dev->name, fw_name);
8424 return rc; 8458 return rc;
@@ -8431,8 +8465,8 @@ int ipw2100_get_firmware(struct ipw2100_priv *priv, struct ipw2100_fw *fw)
8431 return 0; 8465 return 0;
8432} 8466}
8433 8467
8434void ipw2100_release_firmware(struct ipw2100_priv *priv, 8468static void ipw2100_release_firmware(struct ipw2100_priv *priv,
8435 struct ipw2100_fw *fw) 8469 struct ipw2100_fw *fw)
8436{ 8470{
8437 fw->version = 0; 8471 fw->version = 0;
8438 if (fw->fw_entry) 8472 if (fw->fw_entry)
@@ -8441,7 +8475,8 @@ void ipw2100_release_firmware(struct ipw2100_priv *priv,
8441} 8475}
8442 8476
8443 8477
8444int ipw2100_get_fwversion(struct ipw2100_priv *priv, char *buf, size_t max) 8478static int ipw2100_get_fwversion(struct ipw2100_priv *priv, char *buf,
8479 size_t max)
8445{ 8480{
8446 char ver[MAX_FW_VERSION_LEN]; 8481 char ver[MAX_FW_VERSION_LEN];
8447 u32 len = MAX_FW_VERSION_LEN; 8482 u32 len = MAX_FW_VERSION_LEN;
@@ -8460,7 +8495,8 @@ int ipw2100_get_fwversion(struct ipw2100_priv *priv, char *buf, size_t max)
8460 return tmp; 8495 return tmp;
8461} 8496}
8462 8497
8463int ipw2100_get_ucodeversion(struct ipw2100_priv *priv, char *buf, size_t max) 8498static int ipw2100_get_ucodeversion(struct ipw2100_priv *priv, char *buf,
8499 size_t max)
8464{ 8500{
8465 u32 ver; 8501 u32 ver;
8466 u32 len = sizeof(ver); 8502 u32 len = sizeof(ver);
@@ -8474,7 +8510,8 @@ int ipw2100_get_ucodeversion(struct ipw2100_priv *priv, char *buf, size_t max)
8474/* 8510/*
8475 * On exit, the firmware will have been freed from the fw list 8511 * On exit, the firmware will have been freed from the fw list
8476 */ 8512 */
8477int ipw2100_fw_download(struct ipw2100_priv *priv, struct ipw2100_fw *fw) 8513static int ipw2100_fw_download(struct ipw2100_priv *priv,
8514 struct ipw2100_fw *fw)
8478{ 8515{
8479 /* firmware is constructed of N contiguous entries, each entry is 8516 /* firmware is constructed of N contiguous entries, each entry is
8480 * structured as: 8517 * structured as:
@@ -8500,7 +8537,7 @@ int ipw2100_fw_download(struct ipw2100_priv *priv, struct ipw2100_fw *fw)
8500 firmware_data_left -= 2; 8537 firmware_data_left -= 2;
8501 8538
8502 if (len > 32) { 8539 if (len > 32) {
8503 IPW_DEBUG_ERROR( 8540 printk(KERN_ERR DRV_NAME ": "
8504 "Invalid firmware run-length of %d bytes\n", 8541 "Invalid firmware run-length of %d bytes\n",
8505 len); 8542 len);
8506 return -EINVAL; 8543 return -EINVAL;
@@ -8531,7 +8568,8 @@ struct symbol_alive_response {
8531 u8 ucode_valid; 8568 u8 ucode_valid;
8532}; 8569};
8533 8570
8534int ipw2100_ucode_download(struct ipw2100_priv *priv, struct ipw2100_fw *fw) 8571static int ipw2100_ucode_download(struct ipw2100_priv *priv,
8572 struct ipw2100_fw *fw)
8535{ 8573{
8536 struct net_device *dev = priv->net_dev; 8574 struct net_device *dev = priv->net_dev;
8537 const unsigned char *microcode_data = fw->uc.data; 8575 const unsigned char *microcode_data = fw->uc.data;
@@ -8610,7 +8648,7 @@ int ipw2100_ucode_download(struct ipw2100_priv *priv, struct ipw2100_fw *fw)
8610 } 8648 }
8611 8649
8612 if (i == 10) { 8650 if (i == 10) {
8613 IPW_DEBUG_ERROR("%s: Error initializing Symbol\n", 8651 printk(KERN_ERR DRV_NAME ": %s: Error initializing Symbol\n",
8614 dev->name); 8652 dev->name);
8615 return -EIO; 8653 return -EIO;
8616 } 8654 }
@@ -8631,7 +8669,7 @@ int ipw2100_ucode_download(struct ipw2100_priv *priv, struct ipw2100_fw *fw)
8631 } 8669 }
8632 8670
8633 if (i == 30) { 8671 if (i == 30) {
8634 IPW_DEBUG_ERROR("%s: No response from Symbol - hw not alive\n", 8672 printk(KERN_ERR DRV_NAME ": %s: No response from Symbol - hw not alive\n",
8635 dev->name); 8673 dev->name);
8636 printk_buf(IPW_DL_ERROR, (u8*)&response, sizeof(response)); 8674 printk_buf(IPW_DL_ERROR, (u8*)&response, sizeof(response));
8637 return -EIO; 8675 return -EIO;
diff --git a/drivers/net/wireless/ipw2100.h b/drivers/net/wireless/ipw2100.h
index 95a05b554c1a..2a3cdbd50168 100644
--- a/drivers/net/wireless/ipw2100.h
+++ b/drivers/net/wireless/ipw2100.h
@@ -48,22 +48,6 @@ struct ipw2100_priv;
48struct ipw2100_tx_packet; 48struct ipw2100_tx_packet;
49struct ipw2100_rx_packet; 49struct ipw2100_rx_packet;
50 50
51#ifdef CONFIG_IPW_DEBUG
52enum { IPW_DEBUG_ENABLED = 1 };
53extern u32 ipw2100_debug_level;
54#define IPW_DEBUG(level, message...) \
55do { \
56 if (ipw2100_debug_level & (level)) { \
57 printk(KERN_DEBUG "ipw2100: %c %s ", \
58 in_interrupt() ? 'I' : 'U', __FUNCTION__); \
59 printk(message); \
60 } \
61} while (0)
62#else
63enum { IPW_DEBUG_ENABLED = 0 };
64#define IPW_DEBUG(level, message...) do {} while (0)
65#endif /* CONFIG_IPW_DEBUG */
66
67#define IPW_DL_UNINIT 0x80000000 51#define IPW_DL_UNINIT 0x80000000
68#define IPW_DL_NONE 0x00000000 52#define IPW_DL_NONE 0x00000000
69#define IPW_DL_ALL 0x7FFFFFFF 53#define IPW_DL_ALL 0x7FFFFFFF
@@ -1144,10 +1128,6 @@ typedef enum _ORDINAL_TABLE_2 { // NS - means Not Supported by FW
1144#define WIRELESS_SPY // enable iwspy support 1128#define WIRELESS_SPY // enable iwspy support
1145#endif 1129#endif
1146 1130
1147extern struct iw_handler_def ipw2100_wx_handler_def;
1148extern struct iw_statistics *ipw2100_wx_wireless_stats(struct net_device * dev);
1149extern void ipw2100_wx_event_work(struct ipw2100_priv *priv);
1150
1151#define IPW_HOST_FW_SHARED_AREA0 0x0002f200 1131#define IPW_HOST_FW_SHARED_AREA0 0x0002f200
1152#define IPW_HOST_FW_SHARED_AREA0_END 0x0002f510 // 0x310 bytes 1132#define IPW_HOST_FW_SHARED_AREA0_END 0x0002f510 // 0x310 bytes
1153 1133
@@ -1182,14 +1162,6 @@ struct ipw2100_fw {
1182 const struct firmware *fw_entry; 1162 const struct firmware *fw_entry;
1183}; 1163};
1184 1164
1185int ipw2100_get_firmware(struct ipw2100_priv *priv, struct ipw2100_fw *fw);
1186void ipw2100_release_firmware(struct ipw2100_priv *priv, struct ipw2100_fw *fw);
1187int ipw2100_fw_download(struct ipw2100_priv *priv, struct ipw2100_fw *fw);
1188int ipw2100_ucode_download(struct ipw2100_priv *priv, struct ipw2100_fw *fw);
1189
1190#define MAX_FW_VERSION_LEN 14 1165#define MAX_FW_VERSION_LEN 14
1191 1166
1192int ipw2100_get_fwversion(struct ipw2100_priv *priv, char *buf, size_t max);
1193int ipw2100_get_ucodeversion(struct ipw2100_priv *priv, char *buf, size_t max);
1194
1195#endif /* _IPW2100_H */ 1167#endif /* _IPW2100_H */
diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c
index 6211438058de..6d0b6b1df4ca 100644
--- a/drivers/net/wireless/ipw2200.c
+++ b/drivers/net/wireless/ipw2200.c
@@ -4485,7 +4485,7 @@ static void ipw_debug_config(struct ipw_priv *priv)
4485 IPW_DEBUG_INFO("RATE MASK: 0x%08X\n", priv->rates_mask); 4485 IPW_DEBUG_INFO("RATE MASK: 0x%08X\n", priv->rates_mask);
4486} 4486}
4487#else 4487#else
4488#define ipw_debug_config(x) do {} while (0); 4488#define ipw_debug_config(x) do {} while (0)
4489#endif 4489#endif
4490 4490
4491static inline void ipw_set_fixed_rate(struct ipw_priv *priv, 4491static inline void ipw_set_fixed_rate(struct ipw_priv *priv,
@@ -6617,11 +6617,7 @@ static int ipw_setup_deferred_work(struct ipw_priv *priv)
6617{ 6617{
6618 int ret = 0; 6618 int ret = 0;
6619 6619
6620#ifdef CONFIG_SOFTWARE_SUSPEND2
6621 priv->workqueue = create_workqueue(DRV_NAME, 0);
6622#else
6623 priv->workqueue = create_workqueue(DRV_NAME); 6620 priv->workqueue = create_workqueue(DRV_NAME);
6624#endif
6625 init_waitqueue_head(&priv->wait_command_queue); 6621 init_waitqueue_head(&priv->wait_command_queue);
6626 6622
6627 INIT_WORK(&priv->adhoc_check, ipw_adhoc_check, priv); 6623 INIT_WORK(&priv->adhoc_check, ipw_adhoc_check, priv);
@@ -7242,11 +7238,7 @@ static int ipw_pci_suspend(struct pci_dev *pdev, u32 state)
7242 /* Remove the PRESENT state of the device */ 7238 /* Remove the PRESENT state of the device */
7243 netif_device_detach(dev); 7239 netif_device_detach(dev);
7244 7240
7245#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10)
7246 pci_save_state(pdev, priv->pm_state);
7247#else
7248 pci_save_state(pdev); 7241 pci_save_state(pdev);
7249#endif
7250 pci_disable_device(pdev); 7242 pci_disable_device(pdev);
7251 pci_set_power_state(pdev, state); 7243 pci_set_power_state(pdev, state);
7252 7244
diff --git a/drivers/net/wireless/ipw2200.h b/drivers/net/wireless/ipw2200.h
index 78b5f444271d..3bff09d93154 100644
--- a/drivers/net/wireless/ipw2200.h
+++ b/drivers/net/wireless/ipw2200.h
@@ -53,26 +53,6 @@
53 53
54#include <linux/workqueue.h> 54#include <linux/workqueue.h>
55 55
56#ifndef IRQ_NONE
57typedef void irqreturn_t;
58#define IRQ_NONE
59#define IRQ_HANDLED
60#define IRQ_RETVAL(x)
61#endif
62
63#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,9) )
64#define __iomem
65#endif
66
67#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,5) )
68#define pci_dma_sync_single_for_cpu pci_dma_sync_single
69#define pci_dma_sync_single_for_device pci_dma_sync_single
70#endif
71
72#ifndef HAVE_FREE_NETDEV
73#define free_netdev(x) kfree(x)
74#endif
75
76/* Authentication and Association States */ 56/* Authentication and Association States */
77enum connection_manager_assoc_states 57enum connection_manager_assoc_states
78{ 58{
@@ -93,8 +73,6 @@ enum connection_manager_assoc_states
93}; 73};
94 74
95 75
96#define IPW_NORMAL 0
97#define IPW_NOWAIT 0
98#define IPW_WAIT (1<<0) 76#define IPW_WAIT (1<<0)
99#define IPW_QUIET (1<<1) 77#define IPW_QUIET (1<<1)
100#define IPW_ROAMING (1<<2) 78#define IPW_ROAMING (1<<2)
@@ -200,7 +178,7 @@ enum connection_manager_assoc_states
200 178
201/* even if MAC WEP set (allows pre-encrypt) */ 179/* even if MAC WEP set (allows pre-encrypt) */
202#define DCT_FLAG_NO_WEP 0x20 180#define DCT_FLAG_NO_WEP 0x20
203#define IPW_ 181
204/* overwrite TSF field */ 182/* overwrite TSF field */
205#define DCT_FLAG_TSF_REQD 0x40 183#define DCT_FLAG_TSF_REQD 0x40
206 184
@@ -533,12 +511,6 @@ struct notif_authenticate {
533 u16 status; 511 u16 status;
534} __attribute__ ((packed)); 512} __attribute__ ((packed));
535 513
536struct temperature
537{
538 s32 measured;
539 s32 active;
540} __attribute__ ((packed));
541
542struct notif_calibration { 514struct notif_calibration {
543 u8 data[104]; 515 u8 data[104];
544} __attribute__ ((packed)); 516} __attribute__ ((packed));
diff --git a/include/net/ieee80211.h b/include/net/ieee80211.h
index 51a20b5f3b5d..8bc126938cd4 100644
--- a/include/net/ieee80211.h
+++ b/include/net/ieee80211.h
@@ -47,22 +47,22 @@
47#define IEEE80211_FRAME_LEN (IEEE80211_DATA_LEN + IEEE80211_HLEN) 47#define IEEE80211_FRAME_LEN (IEEE80211_DATA_LEN + IEEE80211_HLEN)
48 48
49struct ieee80211_hdr { 49struct ieee80211_hdr {
50 u16 frame_ctl; 50 __le16 frame_ctl;
51 u16 duration_id; 51 __le16 duration_id;
52 u8 addr1[ETH_ALEN]; 52 u8 addr1[ETH_ALEN];
53 u8 addr2[ETH_ALEN]; 53 u8 addr2[ETH_ALEN];
54 u8 addr3[ETH_ALEN]; 54 u8 addr3[ETH_ALEN];
55 u16 seq_ctl; 55 __le16 seq_ctl;
56 u8 addr4[ETH_ALEN]; 56 u8 addr4[ETH_ALEN];
57} __attribute__ ((packed)); 57} __attribute__ ((packed));
58 58
59struct ieee80211_hdr_3addr { 59struct ieee80211_hdr_3addr {
60 u16 frame_ctl; 60 __le16 frame_ctl;
61 u16 duration_id; 61 __le16 duration_id;
62 u8 addr1[ETH_ALEN]; 62 u8 addr1[ETH_ALEN];
63 u8 addr2[ETH_ALEN]; 63 u8 addr2[ETH_ALEN];
64 u8 addr3[ETH_ALEN]; 64 u8 addr3[ETH_ALEN];
65 u16 seq_ctl; 65 __le16 seq_ctl;
66} __attribute__ ((packed)); 66} __attribute__ ((packed));
67 67
68enum eap_type { 68enum eap_type {
@@ -88,10 +88,10 @@ static inline const char *eap_get_type(int type)
88 88
89struct eapol { 89struct eapol {
90 u8 snap[6]; 90 u8 snap[6];
91 u16 ethertype; 91 __be16 ethertype;
92 u8 version; 92 u8 version;
93 u8 type; 93 u8 type;
94 u16 length; 94 __be16 length;
95} __attribute__ ((packed)); 95} __attribute__ ((packed));
96 96
97#define IEEE80211_1ADDR_LEN 10 97#define IEEE80211_1ADDR_LEN 10
@@ -112,8 +112,8 @@ struct eapol {
112#define IEEE80211_FCTL_MOREFRAGS 0x0400 112#define IEEE80211_FCTL_MOREFRAGS 0x0400
113#define IEEE80211_FCTL_RETRY 0x0800 113#define IEEE80211_FCTL_RETRY 0x0800
114#define IEEE80211_FCTL_PM 0x1000 114#define IEEE80211_FCTL_PM 0x1000
115#define IEEE80211_FCTL_MOREDATA 0x2000 115#define IEEE80211_FCTL_MOREDATA 0x2000
116#define IEEE80211_FCTL_WEP 0x4000 116#define IEEE80211_FCTL_PROTECTED 0x4000
117#define IEEE80211_FCTL_ORDER 0x8000 117#define IEEE80211_FCTL_ORDER 0x8000
118 118
119#define IEEE80211_FTYPE_MGMT 0x0000 119#define IEEE80211_FTYPE_MGMT 0x0000
@@ -132,6 +132,7 @@ struct eapol {
132#define IEEE80211_STYPE_DISASSOC 0x00A0 132#define IEEE80211_STYPE_DISASSOC 0x00A0
133#define IEEE80211_STYPE_AUTH 0x00B0 133#define IEEE80211_STYPE_AUTH 0x00B0
134#define IEEE80211_STYPE_DEAUTH 0x00C0 134#define IEEE80211_STYPE_DEAUTH 0x00C0
135#define IEEE80211_STYPE_ACTION 0x00D0
135 136
136/* control */ 137/* control */
137#define IEEE80211_STYPE_PSPOLL 0x00A0 138#define IEEE80211_STYPE_PSPOLL 0x00A0
@@ -167,8 +168,19 @@ do { if (ieee80211_debug_level & (level)) \
167#define IEEE80211_DEBUG(level, fmt, args...) do {} while (0) 168#define IEEE80211_DEBUG(level, fmt, args...) do {} while (0)
168#endif /* CONFIG_IEEE80211_DEBUG */ 169#endif /* CONFIG_IEEE80211_DEBUG */
169 170
171
172/* debug macros not dependent on CONFIG_IEEE80211_DEBUG */
173
174#define MAC_FMT "%02x:%02x:%02x:%02x:%02x:%02x"
175#define MAC_ARG(x) ((u8*)(x))[0],((u8*)(x))[1],((u8*)(x))[2],((u8*)(x))[3],((u8*)(x))[4],((u8*)(x))[5]
176
177/* escape_essid() is intended to be used in debug (and possibly error)
178 * messages. It should never be used for passing essid to user space. */
179const char *escape_essid(const char *essid, u8 essid_len);
180
181
170/* 182/*
171 * To use the debug system; 183 * To use the debug system:
172 * 184 *
173 * If you are defining a new debug classification, simply add it to the #define 185 * If you are defining a new debug classification, simply add it to the #define
174 * list here in the form of: 186 * list here in the form of:
@@ -223,9 +235,9 @@ do { if (ieee80211_debug_level & (level)) \
223#include <linux/if_arp.h> /* ARPHRD_ETHER */ 235#include <linux/if_arp.h> /* ARPHRD_ETHER */
224 236
225#ifndef WIRELESS_SPY 237#ifndef WIRELESS_SPY
226#define WIRELESS_SPY // enable iwspy support 238#define WIRELESS_SPY /* enable iwspy support */
227#endif 239#endif
228#include <net/iw_handler.h> // new driver API 240#include <net/iw_handler.h> /* new driver API */
229 241
230#ifndef ETH_P_PAE 242#ifndef ETH_P_PAE
231#define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */ 243#define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */
@@ -252,6 +264,7 @@ struct ieee80211_snap_hdr {
252 264
253#define SNAP_SIZE sizeof(struct ieee80211_snap_hdr) 265#define SNAP_SIZE sizeof(struct ieee80211_snap_hdr)
254 266
267#define WLAN_FC_GET_VERS(fc) ((fc) & IEEE80211_FCTL_VERS)
255#define WLAN_FC_GET_TYPE(fc) ((fc) & IEEE80211_FCTL_FTYPE) 268#define WLAN_FC_GET_TYPE(fc) ((fc) & IEEE80211_FCTL_FTYPE)
256#define WLAN_FC_GET_STYPE(fc) ((fc) & IEEE80211_FCTL_STYPE) 269#define WLAN_FC_GET_STYPE(fc) ((fc) & IEEE80211_FCTL_STYPE)
257 270
@@ -272,34 +285,72 @@ struct ieee80211_snap_hdr {
272#define WLAN_CAPABILITY_SHORT_PREAMBLE (1<<5) 285#define WLAN_CAPABILITY_SHORT_PREAMBLE (1<<5)
273#define WLAN_CAPABILITY_PBCC (1<<6) 286#define WLAN_CAPABILITY_PBCC (1<<6)
274#define WLAN_CAPABILITY_CHANNEL_AGILITY (1<<7) 287#define WLAN_CAPABILITY_CHANNEL_AGILITY (1<<7)
288#define WLAN_CAPABILITY_SPECTRUM_MGMT (1<<8)
289#define WLAN_CAPABILITY_SHORT_SLOT_TIME (1<<10)
290#define WLAN_CAPABILITY_OSSS_OFDM (1<<13)
275 291
276/* Status codes */ 292/* Status codes */
277#define WLAN_STATUS_SUCCESS 0 293enum ieee80211_statuscode {
278#define WLAN_STATUS_UNSPECIFIED_FAILURE 1 294 WLAN_STATUS_SUCCESS = 0,
279#define WLAN_STATUS_CAPS_UNSUPPORTED 10 295 WLAN_STATUS_UNSPECIFIED_FAILURE = 1,
280#define WLAN_STATUS_REASSOC_NO_ASSOC 11 296 WLAN_STATUS_CAPS_UNSUPPORTED = 10,
281#define WLAN_STATUS_ASSOC_DENIED_UNSPEC 12 297 WLAN_STATUS_REASSOC_NO_ASSOC = 11,
282#define WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG 13 298 WLAN_STATUS_ASSOC_DENIED_UNSPEC = 12,
283#define WLAN_STATUS_UNKNOWN_AUTH_TRANSACTION 14 299 WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG = 13,
284#define WLAN_STATUS_CHALLENGE_FAIL 15 300 WLAN_STATUS_UNKNOWN_AUTH_TRANSACTION = 14,
285#define WLAN_STATUS_AUTH_TIMEOUT 16 301 WLAN_STATUS_CHALLENGE_FAIL = 15,
286#define WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA 17 302 WLAN_STATUS_AUTH_TIMEOUT = 16,
287#define WLAN_STATUS_ASSOC_DENIED_RATES 18 303 WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA = 17,
288/* 802.11b */ 304 WLAN_STATUS_ASSOC_DENIED_RATES = 18,
289#define WLAN_STATUS_ASSOC_DENIED_NOSHORT 19 305 /* 802.11b */
290#define WLAN_STATUS_ASSOC_DENIED_NOPBCC 20 306 WLAN_STATUS_ASSOC_DENIED_NOSHORTPREAMBLE = 19,
291#define WLAN_STATUS_ASSOC_DENIED_NOAGILITY 21 307 WLAN_STATUS_ASSOC_DENIED_NOPBCC = 20,
308 WLAN_STATUS_ASSOC_DENIED_NOAGILITY = 21,
309 /* 802.11h */
310 WLAN_STATUS_ASSOC_DENIED_NOSPECTRUM = 22,
311 WLAN_STATUS_ASSOC_REJECTED_BAD_POWER = 23,
312 WLAN_STATUS_ASSOC_REJECTED_BAD_SUPP_CHAN = 24,
313 /* 802.11g */
314 WLAN_STATUS_ASSOC_DENIED_NOSHORTTIME = 25,
315 WLAN_STATUS_ASSOC_DENIED_NODSSSOFDM = 26,
316 /* 802.11i */
317 WLAN_STATUS_INVALID_IE = 40,
318 WLAN_STATUS_INVALID_GROUP_CIPHER = 41,
319 WLAN_STATUS_INVALID_PAIRWISE_CIPHER = 42,
320 WLAN_STATUS_INVALID_AKMP = 43,
321 WLAN_STATUS_UNSUPP_RSN_VERSION = 44,
322 WLAN_STATUS_INVALID_RSN_IE_CAP = 45,
323 WLAN_STATUS_CIPHER_SUITE_REJECTED = 46,
324};
292 325
293/* Reason codes */ 326/* Reason codes */
294#define WLAN_REASON_UNSPECIFIED 1 327enum ieee80211_reasoncode {
295#define WLAN_REASON_PREV_AUTH_NOT_VALID 2 328 WLAN_REASON_UNSPECIFIED = 1,
296#define WLAN_REASON_DEAUTH_LEAVING 3 329 WLAN_REASON_PREV_AUTH_NOT_VALID = 2,
297#define WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY 4 330 WLAN_REASON_DEAUTH_LEAVING = 3,
298#define WLAN_REASON_DISASSOC_AP_BUSY 5 331 WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY = 4,
299#define WLAN_REASON_CLASS2_FRAME_FROM_NONAUTH_STA 6 332 WLAN_REASON_DISASSOC_AP_BUSY = 5,
300#define WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA 7 333 WLAN_REASON_CLASS2_FRAME_FROM_NONAUTH_STA = 6,
301#define WLAN_REASON_DISASSOC_STA_HAS_LEFT 8 334 WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA = 7,
302#define WLAN_REASON_STA_REQ_ASSOC_WITHOUT_AUTH 9 335 WLAN_REASON_DISASSOC_STA_HAS_LEFT = 8,
336 WLAN_REASON_STA_REQ_ASSOC_WITHOUT_AUTH = 9,
337 /* 802.11h */
338 WLAN_REASON_DISASSOC_BAD_POWER = 10,
339 WLAN_REASON_DISASSOC_BAD_SUPP_CHAN = 11,
340 /* 802.11i */
341 WLAN_REASON_INVALID_IE = 13,
342 WLAN_REASON_MIC_FAILURE = 14,
343 WLAN_REASON_4WAY_HANDSHAKE_TIMEOUT = 15,
344 WLAN_REASON_GROUP_KEY_HANDSHAKE_TIMEOUT = 16,
345 WLAN_REASON_IE_DIFFERENT = 17,
346 WLAN_REASON_INVALID_GROUP_CIPHER = 18,
347 WLAN_REASON_INVALID_PAIRWISE_CIPHER = 19,
348 WLAN_REASON_INVALID_AKMP = 20,
349 WLAN_REASON_UNSUPP_RSN_VERSION = 21,
350 WLAN_REASON_INVALID_RSN_IE_CAP = 22,
351 WLAN_REASON_IEEE8021X_FAILED = 23,
352 WLAN_REASON_CIPHER_SUITE_REJECTED = 24,
353};
303 354
304 355
305#define IEEE80211_STATMASK_SIGNAL (1<<0) 356#define IEEE80211_STATMASK_SIGNAL (1<<0)
@@ -478,17 +529,34 @@ Total: 28-2340 bytes
478#define BEACON_PROBE_SSID_ID_POSITION 12 529#define BEACON_PROBE_SSID_ID_POSITION 12
479 530
480/* Management Frame Information Element Types */ 531/* Management Frame Information Element Types */
481#define MFIE_TYPE_SSID 0 532enum ieee80211_mfie {
482#define MFIE_TYPE_RATES 1 533 MFIE_TYPE_SSID = 0,
483#define MFIE_TYPE_FH_SET 2 534 MFIE_TYPE_RATES = 1,
484#define MFIE_TYPE_DS_SET 3 535 MFIE_TYPE_FH_SET = 2,
485#define MFIE_TYPE_CF_SET 4 536 MFIE_TYPE_DS_SET = 3,
486#define MFIE_TYPE_TIM 5 537 MFIE_TYPE_CF_SET = 4,
487#define MFIE_TYPE_IBSS_SET 6 538 MFIE_TYPE_TIM = 5,
488#define MFIE_TYPE_CHALLENGE 16 539 MFIE_TYPE_IBSS_SET = 6,
489#define MFIE_TYPE_RSN 48 540 MFIE_TYPE_COUNTRY = 7,
490#define MFIE_TYPE_RATES_EX 50 541 MFIE_TYPE_HOP_PARAMS = 8,
491#define MFIE_TYPE_GENERIC 221 542 MFIE_TYPE_HOP_TABLE = 9,
543 MFIE_TYPE_REQUEST = 10,
544 MFIE_TYPE_CHALLENGE = 16,
545 MFIE_TYPE_POWER_CONSTRAINT = 32,
546 MFIE_TYPE_POWER_CAPABILITY = 33,
547 MFIE_TYPE_TPC_REQUEST = 34,
548 MFIE_TYPE_TPC_REPORT = 35,
549 MFIE_TYPE_SUPP_CHANNELS = 36,
550 MFIE_TYPE_CSA = 37,
551 MFIE_TYPE_MEASURE_REQUEST = 38,
552 MFIE_TYPE_MEASURE_REPORT = 39,
553 MFIE_TYPE_QUIET = 40,
554 MFIE_TYPE_IBSS_DFS = 41,
555 MFIE_TYPE_ERP_INFO = 42,
556 MFIE_TYPE_RSN = 48,
557 MFIE_TYPE_RATES_EX = 50,
558 MFIE_TYPE_GENERIC = 221,
559};
492 560
493struct ieee80211_info_element_hdr { 561struct ieee80211_info_element_hdr {
494 u8 id; 562 u8 id;
@@ -520,9 +588,9 @@ struct ieee80211_info_element {
520 588
521struct ieee80211_authentication { 589struct ieee80211_authentication {
522 struct ieee80211_hdr_3addr header; 590 struct ieee80211_hdr_3addr header;
523 u16 algorithm; 591 __le16 algorithm;
524 u16 transaction; 592 __le16 transaction;
525 u16 status; 593 __le16 status;
526 struct ieee80211_info_element info_element; 594 struct ieee80211_info_element info_element;
527} __attribute__ ((packed)); 595} __attribute__ ((packed));
528 596
@@ -530,23 +598,23 @@ struct ieee80211_authentication {
530struct ieee80211_probe_response { 598struct ieee80211_probe_response {
531 struct ieee80211_hdr_3addr header; 599 struct ieee80211_hdr_3addr header;
532 u32 time_stamp[2]; 600 u32 time_stamp[2];
533 u16 beacon_interval; 601 __le16 beacon_interval;
534 u16 capability; 602 __le16 capability;
535 struct ieee80211_info_element info_element; 603 struct ieee80211_info_element info_element;
536} __attribute__ ((packed)); 604} __attribute__ ((packed));
537 605
538struct ieee80211_assoc_request_frame { 606struct ieee80211_assoc_request_frame {
539 u16 capability; 607 __le16 capability;
540 u16 listen_interval; 608 __le16 listen_interval;
541 u8 current_ap[ETH_ALEN]; 609 u8 current_ap[ETH_ALEN];
542 struct ieee80211_info_element info_element; 610 struct ieee80211_info_element info_element;
543} __attribute__ ((packed)); 611} __attribute__ ((packed));
544 612
545struct ieee80211_assoc_response_frame { 613struct ieee80211_assoc_response_frame {
546 struct ieee80211_hdr_3addr header; 614 struct ieee80211_hdr_3addr header;
547 u16 capability; 615 __le16 capability;
548 u16 status; 616 __le16 status;
549 u16 aid; 617 __le16 aid;
550 struct ieee80211_info_element info_element; /* supported rates */ 618 struct ieee80211_info_element info_element; /* supported rates */
551} __attribute__ ((packed)); 619} __attribute__ ((packed));
552 620
@@ -561,7 +629,7 @@ struct ieee80211_txb {
561}; 629};
562 630
563 631
564/* SWEEP TABLE ENTRIES NUMBER*/ 632/* SWEEP TABLE ENTRIES NUMBER */
565#define MAX_SWEEP_TAB_ENTRIES 42 633#define MAX_SWEEP_TAB_ENTRIES 42
566#define MAX_SWEEP_TAB_ENTRIES_PER_PACKET 7 634#define MAX_SWEEP_TAB_ENTRIES_PER_PACKET 7
567/* MAX_RATES_LENGTH needs to be 12. The spec says 8, and many APs 635/* MAX_RATES_LENGTH needs to be 12. The spec says 8, and many APs
@@ -622,8 +690,6 @@ enum ieee80211_state {
622 690
623#define DEFAULT_MAX_SCAN_AGE (15 * HZ) 691#define DEFAULT_MAX_SCAN_AGE (15 * HZ)
624#define DEFAULT_FTS 2346 692#define DEFAULT_FTS 2346
625#define MAC_FMT "%02x:%02x:%02x:%02x:%02x:%02x"
626#define MAC_ARG(x) ((u8*)(x))[0],((u8*)(x))[1],((u8*)(x))[2],((u8*)(x))[3],((u8*)(x))[4],((u8*)(x))[5]
627 693
628 694
629#define CFG_IEEE80211_RESERVE_FCS (1<<0) 695#define CFG_IEEE80211_RESERVE_FCS (1<<0)
@@ -791,8 +857,6 @@ extern struct net_device *alloc_ieee80211(int sizeof_priv);
791extern int ieee80211_set_encryption(struct ieee80211_device *ieee); 857extern int ieee80211_set_encryption(struct ieee80211_device *ieee);
792 858
793/* ieee80211_tx.c */ 859/* ieee80211_tx.c */
794
795
796extern int ieee80211_xmit(struct sk_buff *skb, 860extern int ieee80211_xmit(struct sk_buff *skb,
797 struct net_device *dev); 861 struct net_device *dev);
798extern void ieee80211_txb_free(struct ieee80211_txb *); 862extern void ieee80211_txb_free(struct ieee80211_txb *);
@@ -805,7 +869,7 @@ extern void ieee80211_rx_mgt(struct ieee80211_device *ieee,
805 struct ieee80211_hdr *header, 869 struct ieee80211_hdr *header,
806 struct ieee80211_rx_stats *stats); 870 struct ieee80211_rx_stats *stats);
807 871
808/* iee80211_wx.c */ 872/* ieee80211_wx.c */
809extern int ieee80211_wx_get_scan(struct ieee80211_device *ieee, 873extern int ieee80211_wx_get_scan(struct ieee80211_device *ieee,
810 struct iw_request_info *info, 874 struct iw_request_info *info,
811 union iwreq_data *wrqu, char *key); 875 union iwreq_data *wrqu, char *key);
@@ -827,27 +891,5 @@ extern inline int ieee80211_get_scans(struct ieee80211_device *ieee)
827 return ieee->scans; 891 return ieee->scans;
828} 892}
829 893
830static inline const char *escape_essid(const char *essid, u8 essid_len) {
831 static char escaped[IW_ESSID_MAX_SIZE * 2 + 1];
832 const char *s = essid;
833 char *d = escaped;
834
835 if (ieee80211_is_empty_essid(essid, essid_len)) {
836 memcpy(escaped, "<hidden>", sizeof("<hidden>"));
837 return escaped;
838 }
839 894
840 essid_len = min(essid_len, (u8)IW_ESSID_MAX_SIZE);
841 while (essid_len--) {
842 if (*s == '\0') {
843 *d++ = '\\';
844 *d++ = '0';
845 s++;
846 } else {
847 *d++ = *s++;
848 }
849 }
850 *d = '\0';
851 return escaped;
852}
853#endif /* IEEE80211_H */ 895#endif /* IEEE80211_H */
diff --git a/net/ieee80211/ieee80211_module.c b/net/ieee80211/ieee80211_module.c
index e0802b8755a0..553acb2e93d5 100644
--- a/net/ieee80211/ieee80211_module.c
+++ b/net/ieee80211/ieee80211_module.c
@@ -269,5 +269,31 @@ module_exit(ieee80211_exit);
269module_init(ieee80211_init); 269module_init(ieee80211_init);
270#endif 270#endif
271 271
272
273const char *escape_essid(const char *essid, u8 essid_len) {
274 static char escaped[IW_ESSID_MAX_SIZE * 2 + 1];
275 const char *s = essid;
276 char *d = escaped;
277
278 if (ieee80211_is_empty_essid(essid, essid_len)) {
279 memcpy(escaped, "<hidden>", sizeof("<hidden>"));
280 return escaped;
281 }
282
283 essid_len = min(essid_len, (u8)IW_ESSID_MAX_SIZE);
284 while (essid_len--) {
285 if (*s == '\0') {
286 *d++ = '\\';
287 *d++ = '0';
288 s++;
289 } else {
290 *d++ = *s++;
291 }
292 }
293 *d = '\0';
294 return escaped;
295}
296
272EXPORT_SYMBOL(alloc_ieee80211); 297EXPORT_SYMBOL(alloc_ieee80211);
273EXPORT_SYMBOL(free_ieee80211); 298EXPORT_SYMBOL(free_ieee80211);
299EXPORT_SYMBOL(escape_essid);
diff --git a/net/ieee80211/ieee80211_rx.c b/net/ieee80211/ieee80211_rx.c
index 0dd102993ef4..9505f3167aeb 100644
--- a/net/ieee80211/ieee80211_rx.c
+++ b/net/ieee80211/ieee80211_rx.c
@@ -439,7 +439,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
439 crypt->ops->decrypt_mpdu == NULL)) 439 crypt->ops->decrypt_mpdu == NULL))
440 crypt = NULL; 440 crypt = NULL;
441 441
442 if (!crypt && (fc & IEEE80211_FCTL_WEP)) { 442 if (!crypt && (fc & IEEE80211_FCTL_PROTECTED)) {
443 /* This seems to be triggered by some (multicast?) 443 /* This seems to be triggered by some (multicast?)
444 * frames from other than current BSS, so just drop the 444 * frames from other than current BSS, so just drop the
445 * frames silently instead of filling system log with 445 * frames silently instead of filling system log with
@@ -455,7 +455,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
455#ifdef NOT_YET 455#ifdef NOT_YET
456 if (type != WLAN_FC_TYPE_DATA) { 456 if (type != WLAN_FC_TYPE_DATA) {
457 if (type == WLAN_FC_TYPE_MGMT && stype == WLAN_FC_STYPE_AUTH && 457 if (type == WLAN_FC_TYPE_MGMT && stype == WLAN_FC_STYPE_AUTH &&
458 fc & IEEE80211_FCTL_WEP && ieee->host_decrypt && 458 fc & IEEE80211_FCTL_PROTECTED && ieee->host_decrypt &&
459 (keyidx = hostap_rx_frame_decrypt(ieee, skb, crypt)) < 0) 459 (keyidx = hostap_rx_frame_decrypt(ieee, skb, crypt)) < 0)
460 { 460 {
461 printk(KERN_DEBUG "%s: failed to decrypt mgmt::auth " 461 printk(KERN_DEBUG "%s: failed to decrypt mgmt::auth "
@@ -556,7 +556,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
556 556
557 /* skb: hdr + (possibly fragmented, possibly encrypted) payload */ 557 /* skb: hdr + (possibly fragmented, possibly encrypted) payload */
558 558
559 if (ieee->host_decrypt && (fc & IEEE80211_FCTL_WEP) && 559 if (ieee->host_decrypt && (fc & IEEE80211_FCTL_PROTECTED) &&
560 (keyidx = ieee80211_rx_frame_decrypt(ieee, skb, crypt)) < 0) 560 (keyidx = ieee80211_rx_frame_decrypt(ieee, skb, crypt)) < 0)
561 goto rx_dropped; 561 goto rx_dropped;
562 562
@@ -564,7 +564,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
564 564
565 /* skb: hdr + (possibly fragmented) plaintext payload */ 565 /* skb: hdr + (possibly fragmented) plaintext payload */
566 // PR: FIXME: hostap has additional conditions in the "if" below: 566 // PR: FIXME: hostap has additional conditions in the "if" below:
567 // ieee->host_decrypt && (fc & IEEE80211_FCTL_WEP) && 567 // ieee->host_decrypt && (fc & IEEE80211_FCTL_PROTECTED) &&
568 if ((frag != 0 || (fc & IEEE80211_FCTL_MOREFRAGS))) { 568 if ((frag != 0 || (fc & IEEE80211_FCTL_MOREFRAGS))) {
569 int flen; 569 int flen;
570 struct sk_buff *frag_skb = ieee80211_frag_cache_get(ieee, hdr); 570 struct sk_buff *frag_skb = ieee80211_frag_cache_get(ieee, hdr);
@@ -620,12 +620,12 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
620 620
621 /* skb: hdr + (possible reassembled) full MSDU payload; possibly still 621 /* skb: hdr + (possible reassembled) full MSDU payload; possibly still
622 * encrypted/authenticated */ 622 * encrypted/authenticated */
623 if (ieee->host_decrypt && (fc & IEEE80211_FCTL_WEP) && 623 if (ieee->host_decrypt && (fc & IEEE80211_FCTL_PROTECTED) &&
624 ieee80211_rx_frame_decrypt_msdu(ieee, skb, keyidx, crypt)) 624 ieee80211_rx_frame_decrypt_msdu(ieee, skb, keyidx, crypt))
625 goto rx_dropped; 625 goto rx_dropped;
626 626
627 hdr = (struct ieee80211_hdr *) skb->data; 627 hdr = (struct ieee80211_hdr *) skb->data;
628 if (crypt && !(fc & IEEE80211_FCTL_WEP) && !ieee->open_wep) { 628 if (crypt && !(fc & IEEE80211_FCTL_PROTECTED) && !ieee->open_wep) {
629 if (/*ieee->ieee802_1x &&*/ 629 if (/*ieee->ieee802_1x &&*/
630 ieee80211_is_eapol_frame(ieee, skb)) { 630 ieee80211_is_eapol_frame(ieee, skb)) {
631#ifdef CONFIG_IEEE80211_DEBUG 631#ifdef CONFIG_IEEE80211_DEBUG
@@ -646,7 +646,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
646 } 646 }
647 647
648#ifdef CONFIG_IEEE80211_DEBUG 648#ifdef CONFIG_IEEE80211_DEBUG
649 if (crypt && !(fc & IEEE80211_FCTL_WEP) && 649 if (crypt && !(fc & IEEE80211_FCTL_PROTECTED) &&
650 ieee80211_is_eapol_frame(ieee, skb)) { 650 ieee80211_is_eapol_frame(ieee, skb)) {
651 struct eapol *eap = (struct eapol *)(skb->data + 651 struct eapol *eap = (struct eapol *)(skb->data +
652 24); 652 24);
@@ -655,7 +655,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
655 } 655 }
656#endif 656#endif
657 657
658 if (crypt && !(fc & IEEE80211_FCTL_WEP) && !ieee->open_wep && 658 if (crypt && !(fc & IEEE80211_FCTL_PROTECTED) && !ieee->open_wep &&
659 !ieee80211_is_eapol_frame(ieee, skb)) { 659 !ieee80211_is_eapol_frame(ieee, skb)) {
660 IEEE80211_DEBUG_DROP( 660 IEEE80211_DEBUG_DROP(
661 "dropped unencrypted RX data " 661 "dropped unencrypted RX data "
diff --git a/net/ieee80211/ieee80211_tx.c b/net/ieee80211/ieee80211_tx.c
index d1049edcd14d..071d093f2989 100644
--- a/net/ieee80211/ieee80211_tx.c
+++ b/net/ieee80211/ieee80211_tx.c
@@ -313,7 +313,7 @@ int ieee80211_xmit(struct sk_buff *skb,
313 313
314 if (encrypt) 314 if (encrypt)
315 fc = IEEE80211_FTYPE_DATA | IEEE80211_STYPE_DATA | 315 fc = IEEE80211_FTYPE_DATA | IEEE80211_STYPE_DATA |
316 IEEE80211_FCTL_WEP; 316 IEEE80211_FCTL_PROTECTED;
317 else 317 else
318 fc = IEEE80211_FTYPE_DATA | IEEE80211_STYPE_DATA; 318 fc = IEEE80211_FTYPE_DATA | IEEE80211_STYPE_DATA;
319 319