aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-agn.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-agn.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c59
1 files changed, 21 insertions, 38 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 0a5507cbeb3f..a5637c4aa85d 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -188,7 +188,7 @@ int iwl_commit_rxon(struct iwl_priv *priv)
188 memcpy(active_rxon, &priv->staging_rxon, sizeof(*active_rxon)); 188 memcpy(active_rxon, &priv->staging_rxon, sizeof(*active_rxon));
189 } 189 }
190 190
191 priv->cfg->ops->smgmt->clear_station_table(priv); 191 iwl_clear_stations_table(priv);
192 192
193 priv->start_calib = 0; 193 priv->start_calib = 0;
194 194
@@ -737,19 +737,13 @@ static void iwl_rx_card_state_notif(struct iwl_priv *priv,
737 clear_bit(STATUS_RF_KILL_HW, &priv->status); 737 clear_bit(STATUS_RF_KILL_HW, &priv->status);
738 738
739 739
740 if (flags & SW_CARD_DISABLED)
741 set_bit(STATUS_RF_KILL_SW, &priv->status);
742 else
743 clear_bit(STATUS_RF_KILL_SW, &priv->status);
744
745 if (!(flags & RXON_CARD_DISABLED)) 740 if (!(flags & RXON_CARD_DISABLED))
746 iwl_scan_cancel(priv); 741 iwl_scan_cancel(priv);
747 742
748 if ((test_bit(STATUS_RF_KILL_HW, &status) != 743 if ((test_bit(STATUS_RF_KILL_HW, &status) !=
749 test_bit(STATUS_RF_KILL_HW, &priv->status)) || 744 test_bit(STATUS_RF_KILL_HW, &priv->status)))
750 (test_bit(STATUS_RF_KILL_SW, &status) != 745 wiphy_rfkill_set_hw_state(priv->hw->wiphy,
751 test_bit(STATUS_RF_KILL_SW, &priv->status))) 746 test_bit(STATUS_RF_KILL_HW, &priv->status));
752 queue_work(priv->workqueue, &priv->rf_kill);
753 else 747 else
754 wake_up_interruptible(&priv->wait_command_queue); 748 wake_up_interruptible(&priv->wait_command_queue);
755} 749}
@@ -1045,7 +1039,7 @@ static void iwl_irq_tasklet_legacy(struct iwl_priv *priv)
1045 set_bit(STATUS_RF_KILL_HW, &priv->status); 1039 set_bit(STATUS_RF_KILL_HW, &priv->status);
1046 else 1040 else
1047 clear_bit(STATUS_RF_KILL_HW, &priv->status); 1041 clear_bit(STATUS_RF_KILL_HW, &priv->status);
1048 queue_work(priv->workqueue, &priv->rf_kill); 1042 wiphy_rfkill_set_hw_state(priv->hw->wiphy, hw_rf_kill);
1049 } 1043 }
1050 1044
1051 handled |= CSR_INT_BIT_RF_KILL; 1045 handled |= CSR_INT_BIT_RF_KILL;
@@ -1218,7 +1212,7 @@ static void iwl_irq_tasklet(struct iwl_priv *priv)
1218 set_bit(STATUS_RF_KILL_HW, &priv->status); 1212 set_bit(STATUS_RF_KILL_HW, &priv->status);
1219 else 1213 else
1220 clear_bit(STATUS_RF_KILL_HW, &priv->status); 1214 clear_bit(STATUS_RF_KILL_HW, &priv->status);
1221 queue_work(priv->workqueue, &priv->rf_kill); 1215 wiphy_rfkill_set_hw_state(priv->hw->wiphy, hw_rf_kill);
1222 } 1216 }
1223 1217
1224 handled |= CSR_INT_BIT_RF_KILL; 1218 handled |= CSR_INT_BIT_RF_KILL;
@@ -1617,7 +1611,7 @@ static void iwl_alive_start(struct iwl_priv *priv)
1617 goto restart; 1611 goto restart;
1618 } 1612 }
1619 1613
1620 priv->cfg->ops->smgmt->clear_station_table(priv); 1614 iwl_clear_stations_table(priv);
1621 ret = priv->cfg->ops->lib->alive_notify(priv); 1615 ret = priv->cfg->ops->lib->alive_notify(priv);
1622 if (ret) { 1616 if (ret) {
1623 IWL_WARN(priv, 1617 IWL_WARN(priv,
@@ -1703,7 +1697,7 @@ static void __iwl_down(struct iwl_priv *priv)
1703 1697
1704 iwl_leds_unregister(priv); 1698 iwl_leds_unregister(priv);
1705 1699
1706 priv->cfg->ops->smgmt->clear_station_table(priv); 1700 iwl_clear_stations_table(priv);
1707 1701
1708 /* Unblock any waiting calls */ 1702 /* Unblock any waiting calls */
1709 wake_up_interruptible_all(&priv->wait_command_queue); 1703 wake_up_interruptible_all(&priv->wait_command_queue);
@@ -1726,12 +1720,10 @@ static void __iwl_down(struct iwl_priv *priv)
1726 ieee80211_stop_queues(priv->hw); 1720 ieee80211_stop_queues(priv->hw);
1727 1721
1728 /* If we have not previously called iwl_init() then 1722 /* If we have not previously called iwl_init() then
1729 * clear all bits but the RF Kill bits and return */ 1723 * clear all bits but the RF Kill bit and return */
1730 if (!iwl_is_init(priv)) { 1724 if (!iwl_is_init(priv)) {
1731 priv->status = test_bit(STATUS_RF_KILL_HW, &priv->status) << 1725 priv->status = test_bit(STATUS_RF_KILL_HW, &priv->status) <<
1732 STATUS_RF_KILL_HW | 1726 STATUS_RF_KILL_HW |
1733 test_bit(STATUS_RF_KILL_SW, &priv->status) <<
1734 STATUS_RF_KILL_SW |
1735 test_bit(STATUS_GEO_CONFIGURED, &priv->status) << 1727 test_bit(STATUS_GEO_CONFIGURED, &priv->status) <<
1736 STATUS_GEO_CONFIGURED | 1728 STATUS_GEO_CONFIGURED |
1737 test_bit(STATUS_EXIT_PENDING, &priv->status) << 1729 test_bit(STATUS_EXIT_PENDING, &priv->status) <<
@@ -1740,11 +1732,9 @@ static void __iwl_down(struct iwl_priv *priv)
1740 } 1732 }
1741 1733
1742 /* ...otherwise clear out all the status bits but the RF Kill 1734 /* ...otherwise clear out all the status bits but the RF Kill
1743 * bits and continue taking the NIC down. */ 1735 * bit and continue taking the NIC down. */
1744 priv->status &= test_bit(STATUS_RF_KILL_HW, &priv->status) << 1736 priv->status &= test_bit(STATUS_RF_KILL_HW, &priv->status) <<
1745 STATUS_RF_KILL_HW | 1737 STATUS_RF_KILL_HW |
1746 test_bit(STATUS_RF_KILL_SW, &priv->status) <<
1747 STATUS_RF_KILL_SW |
1748 test_bit(STATUS_GEO_CONFIGURED, &priv->status) << 1738 test_bit(STATUS_GEO_CONFIGURED, &priv->status) <<
1749 STATUS_GEO_CONFIGURED | 1739 STATUS_GEO_CONFIGURED |
1750 test_bit(STATUS_FW_ERROR, &priv->status) << 1740 test_bit(STATUS_FW_ERROR, &priv->status) <<
@@ -1866,9 +1856,10 @@ static int __iwl_up(struct iwl_priv *priv)
1866 set_bit(STATUS_RF_KILL_HW, &priv->status); 1856 set_bit(STATUS_RF_KILL_HW, &priv->status);
1867 1857
1868 if (iwl_is_rfkill(priv)) { 1858 if (iwl_is_rfkill(priv)) {
1859 wiphy_rfkill_set_hw_state(priv->hw->wiphy, true);
1860
1869 iwl_enable_interrupts(priv); 1861 iwl_enable_interrupts(priv);
1870 IWL_WARN(priv, "Radio disabled by %s RF Kill switch\n", 1862 IWL_WARN(priv, "Radio disabled by HW RF Kill switch\n");
1871 test_bit(STATUS_RF_KILL_HW, &priv->status) ? "HW" : "SW");
1872 return 0; 1863 return 0;
1873 } 1864 }
1874 1865
@@ -1887,8 +1878,6 @@ static int __iwl_up(struct iwl_priv *priv)
1887 1878
1888 /* clear (again), then enable host interrupts */ 1879 /* clear (again), then enable host interrupts */
1889 iwl_write32(priv, CSR_INT, 0xFFFFFFFF); 1880 iwl_write32(priv, CSR_INT, 0xFFFFFFFF);
1890 /* enable dram interrupt */
1891 iwl_reset_ict(priv);
1892 iwl_enable_interrupts(priv); 1881 iwl_enable_interrupts(priv);
1893 1882
1894 /* really make sure rfkill handshake bits are cleared */ 1883 /* really make sure rfkill handshake bits are cleared */
@@ -1903,7 +1892,7 @@ static int __iwl_up(struct iwl_priv *priv)
1903 1892
1904 for (i = 0; i < MAX_HW_RESTARTS; i++) { 1893 for (i = 0; i < MAX_HW_RESTARTS; i++) {
1905 1894
1906 priv->cfg->ops->smgmt->clear_station_table(priv); 1895 iwl_clear_stations_table(priv);
1907 1896
1908 /* load bootstrap state machine, 1897 /* load bootstrap state machine,
1909 * load bootstrap program into processor's memory, 1898 * load bootstrap program into processor's memory,
@@ -1962,6 +1951,9 @@ static void iwl_bg_alive_start(struct work_struct *data)
1962 if (test_bit(STATUS_EXIT_PENDING, &priv->status)) 1951 if (test_bit(STATUS_EXIT_PENDING, &priv->status))
1963 return; 1952 return;
1964 1953
1954 /* enable dram interrupt */
1955 iwl_reset_ict(priv);
1956
1965 mutex_lock(&priv->mutex); 1957 mutex_lock(&priv->mutex);
1966 iwl_alive_start(priv); 1958 iwl_alive_start(priv);
1967 mutex_unlock(&priv->mutex); 1959 mutex_unlock(&priv->mutex);
@@ -2000,7 +1992,6 @@ static void iwl_bg_up(struct work_struct *data)
2000 mutex_lock(&priv->mutex); 1992 mutex_lock(&priv->mutex);
2001 __iwl_up(priv); 1993 __iwl_up(priv);
2002 mutex_unlock(&priv->mutex); 1994 mutex_unlock(&priv->mutex);
2003 iwl_rfkill_set_hw_state(priv);
2004} 1995}
2005 1996
2006static void iwl_bg_restart(struct work_struct *data) 1997static void iwl_bg_restart(struct work_struct *data)
@@ -2178,8 +2169,6 @@ static int iwl_mac_start(struct ieee80211_hw *hw)
2178 2169
2179 mutex_unlock(&priv->mutex); 2170 mutex_unlock(&priv->mutex);
2180 2171
2181 iwl_rfkill_set_hw_state(priv);
2182
2183 if (ret) 2172 if (ret)
2184 return ret; 2173 return ret;
2185 2174
@@ -2348,7 +2337,7 @@ static int iwl_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
2348 return -EOPNOTSUPP; 2337 return -EOPNOTSUPP;
2349 } 2338 }
2350 addr = sta ? sta->addr : iwl_bcast_addr; 2339 addr = sta ? sta->addr : iwl_bcast_addr;
2351 sta_id = priv->cfg->ops->smgmt->find_station(priv, addr); 2340 sta_id = iwl_find_station(priv, addr);
2352 if (sta_id == IWL_INVALID_STATION) { 2341 if (sta_id == IWL_INVALID_STATION) {
2353 IWL_DEBUG_MAC80211(priv, "leave - %pM not in station map.\n", 2342 IWL_DEBUG_MAC80211(priv, "leave - %pM not in station map.\n",
2354 addr); 2343 addr);
@@ -2774,7 +2763,6 @@ static void iwl_setup_deferred_work(struct iwl_priv *priv)
2774 INIT_WORK(&priv->up, iwl_bg_up); 2763 INIT_WORK(&priv->up, iwl_bg_up);
2775 INIT_WORK(&priv->restart, iwl_bg_restart); 2764 INIT_WORK(&priv->restart, iwl_bg_restart);
2776 INIT_WORK(&priv->rx_replenish, iwl_bg_rx_replenish); 2765 INIT_WORK(&priv->rx_replenish, iwl_bg_rx_replenish);
2777 INIT_WORK(&priv->rf_kill, iwl_bg_rf_kill);
2778 INIT_WORK(&priv->beacon_update, iwl_bg_beacon_update); 2766 INIT_WORK(&priv->beacon_update, iwl_bg_beacon_update);
2779 INIT_WORK(&priv->run_time_calib_work, iwl_bg_run_time_calib_work); 2767 INIT_WORK(&priv->run_time_calib_work, iwl_bg_run_time_calib_work);
2780 INIT_DELAYED_WORK(&priv->init_alive_start, iwl_bg_init_alive_start); 2768 INIT_DELAYED_WORK(&priv->init_alive_start, iwl_bg_init_alive_start);
@@ -3045,12 +3033,8 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
3045 else 3033 else
3046 set_bit(STATUS_RF_KILL_HW, &priv->status); 3034 set_bit(STATUS_RF_KILL_HW, &priv->status);
3047 3035
3048 err = iwl_rfkill_init(priv); 3036 wiphy_rfkill_set_hw_state(priv->hw->wiphy,
3049 if (err) 3037 test_bit(STATUS_RF_KILL_HW, &priv->status));
3050 IWL_ERR(priv, "Unable to initialize RFKILL system. "
3051 "Ignoring error: %d\n", err);
3052 else
3053 iwl_rfkill_set_hw_state(priv);
3054 3038
3055 iwl_power_initialize(priv); 3039 iwl_power_initialize(priv);
3056 return 0; 3040 return 0;
@@ -3114,14 +3098,13 @@ static void __devexit iwl_pci_remove(struct pci_dev *pdev)
3114 3098
3115 iwl_synchronize_irq(priv); 3099 iwl_synchronize_irq(priv);
3116 3100
3117 iwl_rfkill_unregister(priv);
3118 iwl_dealloc_ucode_pci(priv); 3101 iwl_dealloc_ucode_pci(priv);
3119 3102
3120 if (priv->rxq.bd) 3103 if (priv->rxq.bd)
3121 iwl_rx_queue_free(priv, &priv->rxq); 3104 iwl_rx_queue_free(priv, &priv->rxq);
3122 iwl_hw_txq_ctx_free(priv); 3105 iwl_hw_txq_ctx_free(priv);
3123 3106
3124 priv->cfg->ops->smgmt->clear_station_table(priv); 3107 iwl_clear_stations_table(priv);
3125 iwl_eeprom_free(priv); 3108 iwl_eeprom_free(priv);
3126 3109
3127 3110