aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl3945-base.c
diff options
context:
space:
mode:
authorKolekar, Abhijeet <abhijeet.kolekar@intel.com>2008-12-18 21:37:36 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-01-29 15:59:19 -0500
commit775a6e27bfca9d19f3ea6006a7e60a4a54aaf69c (patch)
tree8063ebed0ceff02ddd3fdd368dd7039c564e58ba /drivers/net/wireless/iwlwifi/iwl3945-base.c
parentdf878d8f0156ec2b41da5ae9c70af4a27cb2eb0a (diff)
iwl3945: cleanup and remove duplicate code
The patch removes the following duplicate structures: iwl3945_is_alive iwl3945_is_ready iwl3945_is_init iwl3945_is_rfkill_sw iwl3945_is_rfkill iwl3945_reset_qos Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com> Signed-off-by: Zhu Yi <yi.zhu@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl3945-base.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl3945-base.c204
1 files changed, 34 insertions, 170 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index d057ab3022aa..52c03cf29089 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -432,51 +432,6 @@ u8 iwl3945_add_station(struct iwl_priv *priv, const u8 *addr, int is_ap, u8 flag
432 432
433} 433}
434 434
435/*************** DRIVER STATUS FUNCTIONS *****/
436
437static inline int iwl3945_is_ready(struct iwl_priv *priv)
438{
439 /* The adapter is 'ready' if READY and GEO_CONFIGURED bits are
440 * set but EXIT_PENDING is not */
441 return test_bit(STATUS_READY, &priv->status) &&
442 test_bit(STATUS_GEO_CONFIGURED, &priv->status) &&
443 !test_bit(STATUS_EXIT_PENDING, &priv->status);
444}
445
446static inline int iwl3945_is_alive(struct iwl_priv *priv)
447{
448 return test_bit(STATUS_ALIVE, &priv->status);
449}
450
451static inline int iwl3945_is_init(struct iwl_priv *priv)
452{
453 return test_bit(STATUS_INIT, &priv->status);
454}
455
456static inline int iwl3945_is_rfkill_sw(struct iwl_priv *priv)
457{
458 return test_bit(STATUS_RF_KILL_SW, &priv->status);
459}
460
461static inline int iwl3945_is_rfkill_hw(struct iwl_priv *priv)
462{
463 return test_bit(STATUS_RF_KILL_HW, &priv->status);
464}
465
466static inline int iwl3945_is_rfkill(struct iwl_priv *priv)
467{
468 return iwl3945_is_rfkill_hw(priv) ||
469 iwl3945_is_rfkill_sw(priv);
470}
471
472static inline int iwl3945_is_ready_rf(struct iwl_priv *priv)
473{
474
475 if (iwl3945_is_rfkill(priv))
476 return 0;
477
478 return iwl3945_is_ready(priv);
479}
480 435
481/*************** HOST COMMAND QUEUE FUNCTIONS *****/ 436/*************** HOST COMMAND QUEUE FUNCTIONS *****/
482 437
@@ -514,7 +469,7 @@ static int iwl3945_enqueue_hcmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
514 !(cmd->meta.flags & CMD_SIZE_HUGE)); 469 !(cmd->meta.flags & CMD_SIZE_HUGE));
515 470
516 471
517 if (iwl3945_is_rfkill(priv)) { 472 if (iwl_is_rfkill(priv)) {
518 IWL_DEBUG_INFO("Not sending command - RF KILL"); 473 IWL_DEBUG_INFO("Not sending command - RF KILL");
519 return -EIO; 474 return -EIO;
520 } 475 }
@@ -941,7 +896,7 @@ static int iwl3945_commit_rxon(struct iwl_priv *priv)
941 struct iwl3945_rxon_cmd *active_rxon = (void *)&priv->active39_rxon; 896 struct iwl3945_rxon_cmd *active_rxon = (void *)&priv->active39_rxon;
942 int rc = 0; 897 int rc = 0;
943 898
944 if (!iwl3945_is_alive(priv)) 899 if (!iwl_is_alive(priv))
945 return -1; 900 return -1;
946 901
947 /* always get timestamp with Rx frame */ 902 /* always get timestamp with Rx frame */
@@ -1596,97 +1551,6 @@ static int iwl3945_send_qos_params_command(struct iwl_priv *priv,
1596 sizeof(struct iwl_qosparam_cmd), qos); 1551 sizeof(struct iwl_qosparam_cmd), qos);
1597} 1552}
1598 1553
1599static void iwl3945_reset_qos(struct iwl_priv *priv)
1600{
1601 u16 cw_min = 15;
1602 u16 cw_max = 1023;
1603 u8 aifs = 2;
1604 u8 is_legacy = 0;
1605 unsigned long flags;
1606 int i;
1607
1608 spin_lock_irqsave(&priv->lock, flags);
1609 priv->qos_data.qos_active = 0;
1610
1611 /* QoS always active in AP and ADHOC mode
1612 * In STA mode wait for association
1613 */
1614 if (priv->iw_mode == NL80211_IFTYPE_ADHOC ||
1615 priv->iw_mode == NL80211_IFTYPE_AP)
1616 priv->qos_data.qos_active = 1;
1617 else
1618 priv->qos_data.qos_active = 0;
1619
1620
1621 /* check for legacy mode */
1622 if ((priv->iw_mode == NL80211_IFTYPE_ADHOC &&
1623 (priv->active_rate & IWL_OFDM_RATES_MASK) == 0) ||
1624 (priv->iw_mode == NL80211_IFTYPE_STATION &&
1625 (priv->staging39_rxon.flags & RXON_FLG_SHORT_SLOT_MSK) == 0)) {
1626 cw_min = 31;
1627 is_legacy = 1;
1628 }
1629
1630 if (priv->qos_data.qos_active)
1631 aifs = 3;
1632
1633 priv->qos_data.def_qos_parm.ac[0].cw_min = cpu_to_le16(cw_min);
1634 priv->qos_data.def_qos_parm.ac[0].cw_max = cpu_to_le16(cw_max);
1635 priv->qos_data.def_qos_parm.ac[0].aifsn = aifs;
1636 priv->qos_data.def_qos_parm.ac[0].edca_txop = 0;
1637 priv->qos_data.def_qos_parm.ac[0].reserved1 = 0;
1638
1639 if (priv->qos_data.qos_active) {
1640 i = 1;
1641 priv->qos_data.def_qos_parm.ac[i].cw_min = cpu_to_le16(cw_min);
1642 priv->qos_data.def_qos_parm.ac[i].cw_max = cpu_to_le16(cw_max);
1643 priv->qos_data.def_qos_parm.ac[i].aifsn = 7;
1644 priv->qos_data.def_qos_parm.ac[i].edca_txop = 0;
1645 priv->qos_data.def_qos_parm.ac[i].reserved1 = 0;
1646
1647 i = 2;
1648 priv->qos_data.def_qos_parm.ac[i].cw_min =
1649 cpu_to_le16((cw_min + 1) / 2 - 1);
1650 priv->qos_data.def_qos_parm.ac[i].cw_max =
1651 cpu_to_le16(cw_max);
1652 priv->qos_data.def_qos_parm.ac[i].aifsn = 2;
1653 if (is_legacy)
1654 priv->qos_data.def_qos_parm.ac[i].edca_txop =
1655 cpu_to_le16(6016);
1656 else
1657 priv->qos_data.def_qos_parm.ac[i].edca_txop =
1658 cpu_to_le16(3008);
1659 priv->qos_data.def_qos_parm.ac[i].reserved1 = 0;
1660
1661 i = 3;
1662 priv->qos_data.def_qos_parm.ac[i].cw_min =
1663 cpu_to_le16((cw_min + 1) / 4 - 1);
1664 priv->qos_data.def_qos_parm.ac[i].cw_max =
1665 cpu_to_le16((cw_max + 1) / 2 - 1);
1666 priv->qos_data.def_qos_parm.ac[i].aifsn = 2;
1667 priv->qos_data.def_qos_parm.ac[i].reserved1 = 0;
1668 if (is_legacy)
1669 priv->qos_data.def_qos_parm.ac[i].edca_txop =
1670 cpu_to_le16(3264);
1671 else
1672 priv->qos_data.def_qos_parm.ac[i].edca_txop =
1673 cpu_to_le16(1504);
1674 } else {
1675 for (i = 1; i < 4; i++) {
1676 priv->qos_data.def_qos_parm.ac[i].cw_min =
1677 cpu_to_le16(cw_min);
1678 priv->qos_data.def_qos_parm.ac[i].cw_max =
1679 cpu_to_le16(cw_max);
1680 priv->qos_data.def_qos_parm.ac[i].aifsn = aifs;
1681 priv->qos_data.def_qos_parm.ac[i].edca_txop = 0;
1682 priv->qos_data.def_qos_parm.ac[i].reserved1 = 0;
1683 }
1684 }
1685 IWL_DEBUG_QOS("set QoS to default \n");
1686
1687 spin_unlock_irqrestore(&priv->lock, flags);
1688}
1689
1690static void iwl3945_activate_qos(struct iwl_priv *priv, u8 force) 1554static void iwl3945_activate_qos(struct iwl_priv *priv, u8 force)
1691{ 1555{
1692 unsigned long flags; 1556 unsigned long flags;
@@ -2018,7 +1882,7 @@ static void iwl3945_setup_rxon_timing(struct iwl_priv *priv)
2018 1882
2019static int iwl3945_scan_initiate(struct iwl_priv *priv) 1883static int iwl3945_scan_initiate(struct iwl_priv *priv)
2020{ 1884{
2021 if (!iwl3945_is_ready_rf(priv)) { 1885 if (!iwl_is_ready_rf(priv)) {
2022 IWL_DEBUG_SCAN("Aborting scan due to not ready.\n"); 1886 IWL_DEBUG_SCAN("Aborting scan due to not ready.\n");
2023 return -EIO; 1887 return -EIO;
2024 } 1888 }
@@ -2179,7 +2043,7 @@ static int iwl3945_set_mode(struct iwl_priv *priv, int mode)
2179 iwl3945_clear_stations_table(priv); 2043 iwl3945_clear_stations_table(priv);
2180 2044
2181 /* don't commit rxon if rf-kill is on*/ 2045 /* don't commit rxon if rf-kill is on*/
2182 if (!iwl3945_is_ready_rf(priv)) 2046 if (!iwl_is_ready_rf(priv))
2183 return -EAGAIN; 2047 return -EAGAIN;
2184 2048
2185 cancel_delayed_work(&priv->scan_check); 2049 cancel_delayed_work(&priv->scan_check);
@@ -2394,7 +2258,7 @@ static int iwl3945_tx_skb(struct iwl_priv *priv, struct sk_buff *skb)
2394 int rc; 2258 int rc;
2395 2259
2396 spin_lock_irqsave(&priv->lock, flags); 2260 spin_lock_irqsave(&priv->lock, flags);
2397 if (iwl3945_is_rfkill(priv)) { 2261 if (iwl_is_rfkill(priv)) {
2398 IWL_DEBUG_DROP("Dropping - RF KILL\n"); 2262 IWL_DEBUG_DROP("Dropping - RF KILL\n");
2399 goto drop_unlock; 2263 goto drop_unlock;
2400 } 2264 }
@@ -5614,7 +5478,7 @@ static void iwl3945_alive_start(struct iwl_priv *priv)
5614 /* Clear out the uCode error bit if it is set */ 5478 /* Clear out the uCode error bit if it is set */
5615 clear_bit(STATUS_FW_ERROR, &priv->status); 5479 clear_bit(STATUS_FW_ERROR, &priv->status);
5616 5480
5617 if (iwl3945_is_rfkill(priv)) 5481 if (iwl_is_rfkill(priv))
5618 return; 5482 return;
5619 5483
5620 ieee80211_wake_queues(priv->hw); 5484 ieee80211_wake_queues(priv->hw);
@@ -5708,7 +5572,7 @@ static void __iwl3945_down(struct iwl_priv *priv)
5708 5572
5709 /* If we have not previously called iwl3945_init() then 5573 /* If we have not previously called iwl3945_init() then
5710 * clear all bits but the RF Kill and SUSPEND bits and return */ 5574 * clear all bits but the RF Kill and SUSPEND bits and return */
5711 if (!iwl3945_is_init(priv)) { 5575 if (!iwl_is_init(priv)) {
5712 priv->status = test_bit(STATUS_RF_KILL_HW, &priv->status) << 5576 priv->status = test_bit(STATUS_RF_KILL_HW, &priv->status) <<
5713 STATUS_RF_KILL_HW | 5577 STATUS_RF_KILL_HW |
5714 test_bit(STATUS_RF_KILL_SW, &priv->status) << 5578 test_bit(STATUS_RF_KILL_SW, &priv->status) <<
@@ -5920,7 +5784,7 @@ static void iwl3945_bg_rf_kill(struct work_struct *work)
5920 5784
5921 mutex_lock(&priv->mutex); 5785 mutex_lock(&priv->mutex);
5922 5786
5923 if (!iwl3945_is_rfkill(priv)) { 5787 if (!iwl_is_rfkill(priv)) {
5924 IWL_DEBUG(IWL_DL_INFO | IWL_DL_RF_KILL, 5788 IWL_DEBUG(IWL_DL_INFO | IWL_DL_RF_KILL,
5925 "HW and/or SW RF Kill no longer active, restarting " 5789 "HW and/or SW RF Kill no longer active, restarting "
5926 "device\n"); 5790 "device\n");
@@ -5984,7 +5848,7 @@ static void iwl3945_bg_request_scan(struct work_struct *data)
5984 5848
5985 mutex_lock(&priv->mutex); 5849 mutex_lock(&priv->mutex);
5986 5850
5987 if (!iwl3945_is_ready(priv)) { 5851 if (!iwl_is_ready(priv)) {
5988 IWL_WARN(priv, "request scan called when driver not ready.\n"); 5852 IWL_WARN(priv, "request scan called when driver not ready.\n");
5989 goto done; 5853 goto done;
5990 } 5854 }
@@ -6013,7 +5877,7 @@ static void iwl3945_bg_request_scan(struct work_struct *data)
6013 goto done; 5877 goto done;
6014 } 5878 }
6015 5879
6016 if (iwl3945_is_rfkill(priv)) { 5880 if (iwl_is_rfkill(priv)) {
6017 IWL_DEBUG_HC("Aborting scan due to RF Kill activation\n"); 5881 IWL_DEBUG_HC("Aborting scan due to RF Kill activation\n");
6018 goto done; 5882 goto done;
6019 } 5883 }
@@ -6293,7 +6157,7 @@ static void iwl3945_bg_abort_scan(struct work_struct *work)
6293{ 6157{
6294 struct iwl_priv *priv = container_of(work, struct iwl_priv, abort_scan); 6158 struct iwl_priv *priv = container_of(work, struct iwl_priv, abort_scan);
6295 6159
6296 if (!iwl3945_is_ready(priv)) 6160 if (!iwl_is_ready(priv))
6297 return; 6161 return;
6298 6162
6299 mutex_lock(&priv->mutex); 6163 mutex_lock(&priv->mutex);
@@ -6429,7 +6293,7 @@ static void iwl3945_mac_stop(struct ieee80211_hw *hw)
6429 6293
6430 priv->is_open = 0; 6294 priv->is_open = 0;
6431 6295
6432 if (iwl3945_is_ready_rf(priv)) { 6296 if (iwl_is_ready_rf(priv)) {
6433 /* stop mac, cancel any scan request and clear 6297 /* stop mac, cancel any scan request and clear
6434 * RXON_FILTER_ASSOC_MSK BIT 6298 * RXON_FILTER_ASSOC_MSK BIT
6435 */ 6299 */
@@ -6491,7 +6355,7 @@ static int iwl3945_mac_add_interface(struct ieee80211_hw *hw,
6491 memcpy(priv->mac_addr, conf->mac_addr, ETH_ALEN); 6355 memcpy(priv->mac_addr, conf->mac_addr, ETH_ALEN);
6492 } 6356 }
6493 6357
6494 if (iwl3945_is_ready(priv)) 6358 if (iwl_is_ready(priv))
6495 iwl3945_set_mode(priv, conf->type); 6359 iwl3945_set_mode(priv, conf->type);
6496 6360
6497 mutex_unlock(&priv->mutex); 6361 mutex_unlock(&priv->mutex);
@@ -6518,7 +6382,7 @@ static int iwl3945_mac_config(struct ieee80211_hw *hw, u32 changed)
6518 mutex_lock(&priv->mutex); 6382 mutex_lock(&priv->mutex);
6519 IWL_DEBUG_MAC80211("enter to channel %d\n", conf->channel->hw_value); 6383 IWL_DEBUG_MAC80211("enter to channel %d\n", conf->channel->hw_value);
6520 6384
6521 if (!iwl3945_is_ready(priv)) { 6385 if (!iwl_is_ready(priv)) {
6522 IWL_DEBUG_MAC80211("leave - not ready\n"); 6386 IWL_DEBUG_MAC80211("leave - not ready\n");
6523 ret = -EIO; 6387 ret = -EIO;
6524 goto out; 6388 goto out;
@@ -6570,7 +6434,7 @@ static int iwl3945_mac_config(struct ieee80211_hw *hw, u32 changed)
6570 goto out; 6434 goto out;
6571 } 6435 }
6572 6436
6573 if (iwl3945_is_rfkill(priv)) { 6437 if (iwl_is_rfkill(priv)) {
6574 IWL_DEBUG_MAC80211("leave - RF kill\n"); 6438 IWL_DEBUG_MAC80211("leave - RF kill\n");
6575 ret = -EIO; 6439 ret = -EIO;
6576 goto out; 6440 goto out;
@@ -6677,7 +6541,7 @@ static int iwl3945_mac_config_interface(struct ieee80211_hw *hw,
6677 return rc; 6541 return rc;
6678 } 6542 }
6679 6543
6680 if (!iwl3945_is_alive(priv)) 6544 if (!iwl_is_alive(priv))
6681 return -EAGAIN; 6545 return -EAGAIN;
6682 6546
6683 mutex_lock(&priv->mutex); 6547 mutex_lock(&priv->mutex);
@@ -6705,7 +6569,7 @@ static int iwl3945_mac_config_interface(struct ieee80211_hw *hw,
6705 priv->ibss_beacon = ieee80211_beacon_get(hw, vif); 6569 priv->ibss_beacon = ieee80211_beacon_get(hw, vif);
6706 } 6570 }
6707 6571
6708 if (iwl3945_is_rfkill(priv)) 6572 if (iwl_is_rfkill(priv))
6709 goto done; 6573 goto done;
6710 6574
6711 if (conf->bssid && !is_zero_ether_addr(conf->bssid) && 6575 if (conf->bssid && !is_zero_ether_addr(conf->bssid) &&
@@ -6804,7 +6668,7 @@ static void iwl3945_mac_remove_interface(struct ieee80211_hw *hw,
6804 6668
6805 mutex_lock(&priv->mutex); 6669 mutex_lock(&priv->mutex);
6806 6670
6807 if (iwl3945_is_ready_rf(priv)) { 6671 if (iwl_is_ready_rf(priv)) {
6808 iwl3945_scan_cancel_timeout(priv, 100); 6672 iwl3945_scan_cancel_timeout(priv, 100);
6809 priv->staging39_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK; 6673 priv->staging39_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
6810 iwl3945_commit_rxon(priv); 6674 iwl3945_commit_rxon(priv);
@@ -6885,7 +6749,7 @@ static int iwl3945_mac_hw_scan(struct ieee80211_hw *hw, u8 *ssid, size_t len)
6885 mutex_lock(&priv->mutex); 6749 mutex_lock(&priv->mutex);
6886 spin_lock_irqsave(&priv->lock, flags); 6750 spin_lock_irqsave(&priv->lock, flags);
6887 6751
6888 if (!iwl3945_is_ready_rf(priv)) { 6752 if (!iwl_is_ready_rf(priv)) {
6889 rc = -EIO; 6753 rc = -EIO;
6890 IWL_DEBUG_MAC80211("leave - not ready or exit pending\n"); 6754 IWL_DEBUG_MAC80211("leave - not ready or exit pending\n");
6891 goto out_unlock; 6755 goto out_unlock;
@@ -6994,7 +6858,7 @@ static int iwl3945_mac_conf_tx(struct ieee80211_hw *hw, u16 queue,
6994 6858
6995 IWL_DEBUG_MAC80211("enter\n"); 6859 IWL_DEBUG_MAC80211("enter\n");
6996 6860
6997 if (!iwl3945_is_ready_rf(priv)) { 6861 if (!iwl_is_ready_rf(priv)) {
6998 IWL_DEBUG_MAC80211("leave - RF not ready\n"); 6862 IWL_DEBUG_MAC80211("leave - RF not ready\n");
6999 return -EIO; 6863 return -EIO;
7000 } 6864 }
@@ -7042,7 +6906,7 @@ static int iwl3945_mac_get_tx_stats(struct ieee80211_hw *hw,
7042 6906
7043 IWL_DEBUG_MAC80211("enter\n"); 6907 IWL_DEBUG_MAC80211("enter\n");
7044 6908
7045 if (!iwl3945_is_ready_rf(priv)) { 6909 if (!iwl_is_ready_rf(priv)) {
7046 IWL_DEBUG_MAC80211("leave - RF not ready\n"); 6910 IWL_DEBUG_MAC80211("leave - RF not ready\n");
7047 return -EIO; 6911 return -EIO;
7048 } 6912 }
@@ -7074,7 +6938,7 @@ static void iwl3945_mac_reset_tsf(struct ieee80211_hw *hw)
7074 mutex_lock(&priv->mutex); 6938 mutex_lock(&priv->mutex);
7075 IWL_DEBUG_MAC80211("enter\n"); 6939 IWL_DEBUG_MAC80211("enter\n");
7076 6940
7077 iwl3945_reset_qos(priv); 6941 iwl_reset_qos(priv);
7078 6942
7079 spin_lock_irqsave(&priv->lock, flags); 6943 spin_lock_irqsave(&priv->lock, flags);
7080 priv->assoc_id = 0; 6944 priv->assoc_id = 0;
@@ -7094,7 +6958,7 @@ static void iwl3945_mac_reset_tsf(struct ieee80211_hw *hw)
7094 6958
7095 spin_unlock_irqrestore(&priv->lock, flags); 6959 spin_unlock_irqrestore(&priv->lock, flags);
7096 6960
7097 if (!iwl3945_is_ready_rf(priv)) { 6961 if (!iwl_is_ready_rf(priv)) {
7098 IWL_DEBUG_MAC80211("leave - not ready\n"); 6962 IWL_DEBUG_MAC80211("leave - not ready\n");
7099 mutex_unlock(&priv->mutex); 6963 mutex_unlock(&priv->mutex);
7100 return; 6964 return;
@@ -7132,7 +6996,7 @@ static int iwl3945_mac_beacon_update(struct ieee80211_hw *hw, struct sk_buff *sk
7132 6996
7133 IWL_DEBUG_MAC80211("enter\n"); 6997 IWL_DEBUG_MAC80211("enter\n");
7134 6998
7135 if (!iwl3945_is_ready_rf(priv)) { 6999 if (!iwl_is_ready_rf(priv)) {
7136 IWL_DEBUG_MAC80211("leave - RF not ready\n"); 7000 IWL_DEBUG_MAC80211("leave - RF not ready\n");
7137 return -EIO; 7001 return -EIO;
7138 } 7002 }
@@ -7154,7 +7018,7 @@ static int iwl3945_mac_beacon_update(struct ieee80211_hw *hw, struct sk_buff *sk
7154 IWL_DEBUG_MAC80211("leave\n"); 7018 IWL_DEBUG_MAC80211("leave\n");
7155 spin_unlock_irqrestore(&priv->lock, flags); 7019 spin_unlock_irqrestore(&priv->lock, flags);
7156 7020
7157 iwl3945_reset_qos(priv); 7021 iwl_reset_qos(priv);
7158 7022
7159 iwl3945_post_associate(priv); 7023 iwl3945_post_associate(priv);
7160 7024
@@ -7211,7 +7075,7 @@ static ssize_t show_temperature(struct device *d,
7211{ 7075{
7212 struct iwl_priv *priv = (struct iwl_priv *)d->driver_data; 7076 struct iwl_priv *priv = (struct iwl_priv *)d->driver_data;
7213 7077
7214 if (!iwl3945_is_alive(priv)) 7078 if (!iwl_is_alive(priv))
7215 return -EAGAIN; 7079 return -EAGAIN;
7216 7080
7217 return sprintf(buf, "%d\n", iwl3945_hw_get_temperature(priv)); 7081 return sprintf(buf, "%d\n", iwl3945_hw_get_temperature(priv));
@@ -7423,7 +7287,7 @@ static ssize_t store_power_level(struct device *d,
7423 mode = simple_strtoul(buf, NULL, 0); 7287 mode = simple_strtoul(buf, NULL, 0);
7424 mutex_lock(&priv->mutex); 7288 mutex_lock(&priv->mutex);
7425 7289
7426 if (!iwl3945_is_ready(priv)) { 7290 if (!iwl_is_ready(priv)) {
7427 rc = -EAGAIN; 7291 rc = -EAGAIN;
7428 goto out; 7292 goto out;
7429 } 7293 }
@@ -7521,7 +7385,7 @@ static ssize_t show_statistics(struct device *d,
7521 u8 *data = (u8 *)&priv->statistics_39; 7385 u8 *data = (u8 *)&priv->statistics_39;
7522 int rc = 0; 7386 int rc = 0;
7523 7387
7524 if (!iwl3945_is_alive(priv)) 7388 if (!iwl_is_alive(priv))
7525 return -EAGAIN; 7389 return -EAGAIN;
7526 7390
7527 mutex_lock(&priv->mutex); 7391 mutex_lock(&priv->mutex);
@@ -7555,7 +7419,7 @@ static ssize_t show_antenna(struct device *d,
7555{ 7419{
7556 struct iwl_priv *priv = dev_get_drvdata(d); 7420 struct iwl_priv *priv = dev_get_drvdata(d);
7557 7421
7558 if (!iwl3945_is_alive(priv)) 7422 if (!iwl_is_alive(priv))
7559 return -EAGAIN; 7423 return -EAGAIN;
7560 7424
7561 return sprintf(buf, "%d\n", priv->antenna); 7425 return sprintf(buf, "%d\n", priv->antenna);
@@ -7592,7 +7456,7 @@ static ssize_t show_status(struct device *d,
7592 struct device_attribute *attr, char *buf) 7456 struct device_attribute *attr, char *buf)
7593{ 7457{
7594 struct iwl_priv *priv = (struct iwl_priv *)d->driver_data; 7458 struct iwl_priv *priv = (struct iwl_priv *)d->driver_data;
7595 if (!iwl3945_is_alive(priv)) 7459 if (!iwl_is_alive(priv))
7596 return -EAGAIN; 7460 return -EAGAIN;
7597 return sprintf(buf, "0x%08x\n", (int)priv->status); 7461 return sprintf(buf, "0x%08x\n", (int)priv->status);
7598} 7462}
@@ -7878,7 +7742,7 @@ static int iwl3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e
7878 7742
7879 priv->iw_mode = NL80211_IFTYPE_STATION; 7743 priv->iw_mode = NL80211_IFTYPE_STATION;
7880 7744
7881 iwl3945_reset_qos(priv); 7745 iwl_reset_qos(priv);
7882 7746
7883 priv->qos_data.qos_active = 0; 7747 priv->qos_data.qos_active = 0;
7884 priv->qos_data.qos_cap.val = 0; 7748 priv->qos_data.qos_cap.val = 0;
@@ -8099,7 +7963,7 @@ static int iwl3945_rfkill_soft_rf_kill(void *data, enum rfkill_state state)
8099 7963
8100 switch (state) { 7964 switch (state) {
8101 case RFKILL_STATE_UNBLOCKED: 7965 case RFKILL_STATE_UNBLOCKED:
8102 if (iwl3945_is_rfkill_hw(priv)) { 7966 if (iwl_is_rfkill_hw(priv)) {
8103 err = -EBUSY; 7967 err = -EBUSY;
8104 goto out_unlock; 7968 goto out_unlock;
8105 } 7969 }
@@ -8176,12 +8040,12 @@ void iwl3945_rfkill_set_hw_state(struct iwl_priv *priv)
8176 if (!priv->rfkill) 8040 if (!priv->rfkill)
8177 return; 8041 return;
8178 8042
8179 if (iwl3945_is_rfkill_hw(priv)) { 8043 if (iwl_is_rfkill_hw(priv)) {
8180 rfkill_force_state(priv->rfkill, RFKILL_STATE_HARD_BLOCKED); 8044 rfkill_force_state(priv->rfkill, RFKILL_STATE_HARD_BLOCKED);
8181 return; 8045 return;
8182 } 8046 }
8183 8047
8184 if (!iwl3945_is_rfkill_sw(priv)) 8048 if (!iwl_is_rfkill_sw(priv))
8185 rfkill_force_state(priv->rfkill, RFKILL_STATE_UNBLOCKED); 8049 rfkill_force_state(priv->rfkill, RFKILL_STATE_UNBLOCKED);
8186 else 8050 else
8187 rfkill_force_state(priv->rfkill, RFKILL_STATE_SOFT_BLOCKED); 8051 rfkill_force_state(priv->rfkill, RFKILL_STATE_SOFT_BLOCKED);