diff options
author | John W. Linville <linville@tuxdriver.com> | 2010-06-07 15:13:46 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-06-07 15:13:46 -0400 |
commit | 9d88477c41904127ab9ae1f3b5b4a39bf6474043 (patch) | |
tree | f50d5185ac89a9fd76d7cb087b952d5c55d5063b /drivers | |
parent | 11b7c60988e5fbabb4e150612931cc068559af16 (diff) | |
parent | 35dd0509b21e4b5bab36b9eb80c8dab0322f5007 (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6
Conflicts:
drivers/net/wireless/iwlwifi/iwl-core.h
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/ath/ath5k/base.c | 29 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath5k/phy.c | 7 | ||||
-rw-r--r-- | drivers/net/wireless/hostap/hostap_hw.c | 9 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-3945.c | 1 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn-lib.c | 30 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn.c | 318 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-core.c | 39 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-core.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl3945-base.c | 56 | ||||
-rw-r--r-- | drivers/net/wireless/p54/p54usb.c | 1 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1251_sdio.c | 1 |
11 files changed, 275 insertions, 218 deletions
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c index 0aabfab2770f..9d37c1a43a9d 100644 --- a/drivers/net/wireless/ath/ath5k/base.c +++ b/drivers/net/wireless/ath/ath5k/base.c | |||
@@ -195,7 +195,7 @@ static const struct ieee80211_rate ath5k_rates[] = { | |||
195 | static int __devinit ath5k_pci_probe(struct pci_dev *pdev, | 195 | static int __devinit ath5k_pci_probe(struct pci_dev *pdev, |
196 | const struct pci_device_id *id); | 196 | const struct pci_device_id *id); |
197 | static void __devexit ath5k_pci_remove(struct pci_dev *pdev); | 197 | static void __devexit ath5k_pci_remove(struct pci_dev *pdev); |
198 | #ifdef CONFIG_PM | 198 | #ifdef CONFIG_PM_SLEEP |
199 | static int ath5k_pci_suspend(struct device *dev); | 199 | static int ath5k_pci_suspend(struct device *dev); |
200 | static int ath5k_pci_resume(struct device *dev); | 200 | static int ath5k_pci_resume(struct device *dev); |
201 | 201 | ||
@@ -203,7 +203,7 @@ static SIMPLE_DEV_PM_OPS(ath5k_pm_ops, ath5k_pci_suspend, ath5k_pci_resume); | |||
203 | #define ATH5K_PM_OPS (&ath5k_pm_ops) | 203 | #define ATH5K_PM_OPS (&ath5k_pm_ops) |
204 | #else | 204 | #else |
205 | #define ATH5K_PM_OPS NULL | 205 | #define ATH5K_PM_OPS NULL |
206 | #endif /* CONFIG_PM */ | 206 | #endif /* CONFIG_PM_SLEEP */ |
207 | 207 | ||
208 | static struct pci_driver ath5k_pci_driver = { | 208 | static struct pci_driver ath5k_pci_driver = { |
209 | .name = KBUILD_MODNAME, | 209 | .name = KBUILD_MODNAME, |
@@ -222,7 +222,6 @@ static int ath5k_tx(struct ieee80211_hw *hw, struct sk_buff *skb); | |||
222 | static int ath5k_tx_queue(struct ieee80211_hw *hw, struct sk_buff *skb, | 222 | static int ath5k_tx_queue(struct ieee80211_hw *hw, struct sk_buff *skb, |
223 | struct ath5k_txq *txq); | 223 | struct ath5k_txq *txq); |
224 | static int ath5k_reset(struct ath5k_softc *sc, struct ieee80211_channel *chan); | 224 | static int ath5k_reset(struct ath5k_softc *sc, struct ieee80211_channel *chan); |
225 | static int ath5k_reset_wake(struct ath5k_softc *sc); | ||
226 | static int ath5k_start(struct ieee80211_hw *hw); | 225 | static int ath5k_start(struct ieee80211_hw *hw); |
227 | static void ath5k_stop(struct ieee80211_hw *hw); | 226 | static void ath5k_stop(struct ieee80211_hw *hw); |
228 | static int ath5k_add_interface(struct ieee80211_hw *hw, | 227 | static int ath5k_add_interface(struct ieee80211_hw *hw, |
@@ -708,7 +707,7 @@ ath5k_pci_remove(struct pci_dev *pdev) | |||
708 | ieee80211_free_hw(sc->hw); | 707 | ieee80211_free_hw(sc->hw); |
709 | } | 708 | } |
710 | 709 | ||
711 | #ifdef CONFIG_PM | 710 | #ifdef CONFIG_PM_SLEEP |
712 | static int ath5k_pci_suspend(struct device *dev) | 711 | static int ath5k_pci_suspend(struct device *dev) |
713 | { | 712 | { |
714 | struct ath5k_softc *sc = pci_get_drvdata(to_pci_dev(dev)); | 713 | struct ath5k_softc *sc = pci_get_drvdata(to_pci_dev(dev)); |
@@ -732,7 +731,7 @@ static int ath5k_pci_resume(struct device *dev) | |||
732 | ath5k_led_enable(sc); | 731 | ath5k_led_enable(sc); |
733 | return 0; | 732 | return 0; |
734 | } | 733 | } |
735 | #endif /* CONFIG_PM */ | 734 | #endif /* CONFIG_PM_SLEEP */ |
736 | 735 | ||
737 | 736 | ||
738 | /***********************\ | 737 | /***********************\ |
@@ -2770,7 +2769,7 @@ ath5k_tasklet_reset(unsigned long data) | |||
2770 | { | 2769 | { |
2771 | struct ath5k_softc *sc = (void *)data; | 2770 | struct ath5k_softc *sc = (void *)data; |
2772 | 2771 | ||
2773 | ath5k_reset_wake(sc); | 2772 | ath5k_reset(sc, sc->curchan); |
2774 | } | 2773 | } |
2775 | 2774 | ||
2776 | /* | 2775 | /* |
@@ -2949,23 +2948,13 @@ ath5k_reset(struct ath5k_softc *sc, struct ieee80211_channel *chan) | |||
2949 | ath5k_beacon_config(sc); | 2948 | ath5k_beacon_config(sc); |
2950 | /* intrs are enabled by ath5k_beacon_config */ | 2949 | /* intrs are enabled by ath5k_beacon_config */ |
2951 | 2950 | ||
2951 | ieee80211_wake_queues(sc->hw); | ||
2952 | |||
2952 | return 0; | 2953 | return 0; |
2953 | err: | 2954 | err: |
2954 | return ret; | 2955 | return ret; |
2955 | } | 2956 | } |
2956 | 2957 | ||
2957 | static int | ||
2958 | ath5k_reset_wake(struct ath5k_softc *sc) | ||
2959 | { | ||
2960 | int ret; | ||
2961 | |||
2962 | ret = ath5k_reset(sc, sc->curchan); | ||
2963 | if (!ret) | ||
2964 | ieee80211_wake_queues(sc->hw); | ||
2965 | |||
2966 | return ret; | ||
2967 | } | ||
2968 | |||
2969 | static int ath5k_start(struct ieee80211_hw *hw) | 2958 | static int ath5k_start(struct ieee80211_hw *hw) |
2970 | { | 2959 | { |
2971 | return ath5k_init(hw->priv); | 2960 | return ath5k_init(hw->priv); |
@@ -3159,13 +3148,15 @@ static void ath5k_configure_filter(struct ieee80211_hw *hw, | |||
3159 | 3148 | ||
3160 | if (changed_flags & (FIF_PROMISC_IN_BSS | FIF_OTHER_BSS)) { | 3149 | if (changed_flags & (FIF_PROMISC_IN_BSS | FIF_OTHER_BSS)) { |
3161 | if (*new_flags & FIF_PROMISC_IN_BSS) { | 3150 | if (*new_flags & FIF_PROMISC_IN_BSS) { |
3162 | rfilt |= AR5K_RX_FILTER_PROM; | ||
3163 | __set_bit(ATH_STAT_PROMISC, sc->status); | 3151 | __set_bit(ATH_STAT_PROMISC, sc->status); |
3164 | } else { | 3152 | } else { |
3165 | __clear_bit(ATH_STAT_PROMISC, sc->status); | 3153 | __clear_bit(ATH_STAT_PROMISC, sc->status); |
3166 | } | 3154 | } |
3167 | } | 3155 | } |
3168 | 3156 | ||
3157 | if (test_bit(ATH_STAT_PROMISC, sc->status)) | ||
3158 | rfilt |= AR5K_RX_FILTER_PROM; | ||
3159 | |||
3169 | /* Note, AR5K_RX_FILTER_MCAST is already enabled */ | 3160 | /* Note, AR5K_RX_FILTER_MCAST is already enabled */ |
3170 | if (*new_flags & FIF_ALLMULTI) { | 3161 | if (*new_flags & FIF_ALLMULTI) { |
3171 | mfilt[0] = ~0; | 3162 | mfilt[0] = ~0; |
diff --git a/drivers/net/wireless/ath/ath5k/phy.c b/drivers/net/wireless/ath/ath5k/phy.c index 2b3f7a7aded9..34ba576d2747 100644 --- a/drivers/net/wireless/ath/ath5k/phy.c +++ b/drivers/net/wireless/ath/ath5k/phy.c | |||
@@ -1793,6 +1793,13 @@ ath5k_hw_set_antenna_mode(struct ath5k_hw *ah, u8 ant_mode) | |||
1793 | u8 def_ant, tx_ant, ee_mode; | 1793 | u8 def_ant, tx_ant, ee_mode; |
1794 | u32 sta_id1 = 0; | 1794 | u32 sta_id1 = 0; |
1795 | 1795 | ||
1796 | /* if channel is not initialized yet we can't set the antennas | ||
1797 | * so just store the mode. it will be set on the next reset */ | ||
1798 | if (channel == NULL) { | ||
1799 | ah->ah_ant_mode = ant_mode; | ||
1800 | return; | ||
1801 | } | ||
1802 | |||
1796 | def_ant = ah->ah_def_ant; | 1803 | def_ant = ah->ah_def_ant; |
1797 | 1804 | ||
1798 | switch (channel->hw_value & CHANNEL_MODES) { | 1805 | switch (channel->hw_value & CHANNEL_MODES) { |
diff --git a/drivers/net/wireless/hostap/hostap_hw.c b/drivers/net/wireless/hostap/hostap_hw.c index d70732819423..ff9b5c882184 100644 --- a/drivers/net/wireless/hostap/hostap_hw.c +++ b/drivers/net/wireless/hostap/hostap_hw.c | |||
@@ -2618,15 +2618,6 @@ static irqreturn_t prism2_interrupt(int irq, void *dev_id) | |||
2618 | int events = 0; | 2618 | int events = 0; |
2619 | u16 ev; | 2619 | u16 ev; |
2620 | 2620 | ||
2621 | /* Detect early interrupt before driver is fully configued */ | ||
2622 | if (!dev->base_addr) { | ||
2623 | if (net_ratelimit()) { | ||
2624 | printk(KERN_DEBUG "%s: Interrupt, but dev not configured\n", | ||
2625 | dev->name); | ||
2626 | } | ||
2627 | return IRQ_HANDLED; | ||
2628 | } | ||
2629 | |||
2630 | iface = netdev_priv(dev); | 2621 | iface = netdev_priv(dev); |
2631 | local = iface->local; | 2622 | local = iface->local; |
2632 | 2623 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c index 658c6143f998..0fa1d51c9c5a 100644 --- a/drivers/net/wireless/iwlwifi/iwl-3945.c +++ b/drivers/net/wireless/iwlwifi/iwl-3945.c | |||
@@ -2699,6 +2699,7 @@ static struct iwl_lib_ops iwl3945_lib = { | |||
2699 | .isr = iwl_isr_legacy, | 2699 | .isr = iwl_isr_legacy, |
2700 | .config_ap = iwl3945_config_ap, | 2700 | .config_ap = iwl3945_config_ap, |
2701 | .manage_ibss_station = iwl3945_manage_ibss_station, | 2701 | .manage_ibss_station = iwl3945_manage_ibss_station, |
2702 | .recover_from_tx_stall = iwl_bg_monitor_recover, | ||
2702 | .check_plcp_health = iwl3945_good_plcp_health, | 2703 | .check_plcp_health = iwl3945_good_plcp_health, |
2703 | 2704 | ||
2704 | .debugfs_ops = { | 2705 | .debugfs_ops = { |
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c index 3577c1eeb77b..548f51d92de0 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c | |||
@@ -1030,10 +1030,9 @@ static int iwl_get_single_channel_for_scan(struct iwl_priv *priv, | |||
1030 | struct iwl_scan_channel *scan_ch) | 1030 | struct iwl_scan_channel *scan_ch) |
1031 | { | 1031 | { |
1032 | const struct ieee80211_supported_band *sband; | 1032 | const struct ieee80211_supported_band *sband; |
1033 | const struct iwl_channel_info *ch_info; | ||
1034 | u16 passive_dwell = 0; | 1033 | u16 passive_dwell = 0; |
1035 | u16 active_dwell = 0; | 1034 | u16 active_dwell = 0; |
1036 | int i, added = 0; | 1035 | int added = 0; |
1037 | u16 channel = 0; | 1036 | u16 channel = 0; |
1038 | 1037 | ||
1039 | sband = iwl_get_hw_mode(priv, band); | 1038 | sband = iwl_get_hw_mode(priv, band); |
@@ -1048,32 +1047,7 @@ static int iwl_get_single_channel_for_scan(struct iwl_priv *priv, | |||
1048 | if (passive_dwell <= active_dwell) | 1047 | if (passive_dwell <= active_dwell) |
1049 | passive_dwell = active_dwell + 1; | 1048 | passive_dwell = active_dwell + 1; |
1050 | 1049 | ||
1051 | /* only scan single channel, good enough to reset the RF */ | 1050 | channel = iwl_get_single_channel_number(priv, band); |
1052 | /* pick the first valid not in-use channel */ | ||
1053 | if (band == IEEE80211_BAND_5GHZ) { | ||
1054 | for (i = 14; i < priv->channel_count; i++) { | ||
1055 | if (priv->channel_info[i].channel != | ||
1056 | le16_to_cpu(priv->staging_rxon.channel)) { | ||
1057 | channel = priv->channel_info[i].channel; | ||
1058 | ch_info = iwl_get_channel_info(priv, | ||
1059 | band, channel); | ||
1060 | if (is_channel_valid(ch_info)) | ||
1061 | break; | ||
1062 | } | ||
1063 | } | ||
1064 | } else { | ||
1065 | for (i = 0; i < 14; i++) { | ||
1066 | if (priv->channel_info[i].channel != | ||
1067 | le16_to_cpu(priv->staging_rxon.channel)) { | ||
1068 | channel = | ||
1069 | priv->channel_info[i].channel; | ||
1070 | ch_info = iwl_get_channel_info(priv, | ||
1071 | band, channel); | ||
1072 | if (is_channel_valid(ch_info)) | ||
1073 | break; | ||
1074 | } | ||
1075 | } | ||
1076 | } | ||
1077 | if (channel) { | 1051 | if (channel) { |
1078 | scan_ch->channel = cpu_to_le16(channel); | 1052 | scan_ch->channel = cpu_to_le16(channel); |
1079 | scan_ch->type = SCAN_CHANNEL_TYPE_PASSIVE; | 1053 | scan_ch->type = SCAN_CHANNEL_TYPE_PASSIVE; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c index ac5fade28c8d..69e17d782883 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c | |||
@@ -1497,6 +1497,156 @@ bool iwl_good_ack_health(struct iwl_priv *priv, | |||
1497 | } | 1497 | } |
1498 | 1498 | ||
1499 | 1499 | ||
1500 | /***************************************************************************** | ||
1501 | * | ||
1502 | * sysfs attributes | ||
1503 | * | ||
1504 | *****************************************************************************/ | ||
1505 | |||
1506 | #ifdef CONFIG_IWLWIFI_DEBUG | ||
1507 | |||
1508 | /* | ||
1509 | * The following adds a new attribute to the sysfs representation | ||
1510 | * of this device driver (i.e. a new file in /sys/class/net/wlan0/device/) | ||
1511 | * used for controlling the debug level. | ||
1512 | * | ||
1513 | * See the level definitions in iwl for details. | ||
1514 | * | ||
1515 | * The debug_level being managed using sysfs below is a per device debug | ||
1516 | * level that is used instead of the global debug level if it (the per | ||
1517 | * device debug level) is set. | ||
1518 | */ | ||
1519 | static ssize_t show_debug_level(struct device *d, | ||
1520 | struct device_attribute *attr, char *buf) | ||
1521 | { | ||
1522 | struct iwl_priv *priv = dev_get_drvdata(d); | ||
1523 | return sprintf(buf, "0x%08X\n", iwl_get_debug_level(priv)); | ||
1524 | } | ||
1525 | static ssize_t store_debug_level(struct device *d, | ||
1526 | struct device_attribute *attr, | ||
1527 | const char *buf, size_t count) | ||
1528 | { | ||
1529 | struct iwl_priv *priv = dev_get_drvdata(d); | ||
1530 | unsigned long val; | ||
1531 | int ret; | ||
1532 | |||
1533 | ret = strict_strtoul(buf, 0, &val); | ||
1534 | if (ret) | ||
1535 | IWL_ERR(priv, "%s is not in hex or decimal form.\n", buf); | ||
1536 | else { | ||
1537 | priv->debug_level = val; | ||
1538 | if (iwl_alloc_traffic_mem(priv)) | ||
1539 | IWL_ERR(priv, | ||
1540 | "Not enough memory to generate traffic log\n"); | ||
1541 | } | ||
1542 | return strnlen(buf, count); | ||
1543 | } | ||
1544 | |||
1545 | static DEVICE_ATTR(debug_level, S_IWUSR | S_IRUGO, | ||
1546 | show_debug_level, store_debug_level); | ||
1547 | |||
1548 | |||
1549 | #endif /* CONFIG_IWLWIFI_DEBUG */ | ||
1550 | |||
1551 | |||
1552 | static ssize_t show_temperature(struct device *d, | ||
1553 | struct device_attribute *attr, char *buf) | ||
1554 | { | ||
1555 | struct iwl_priv *priv = dev_get_drvdata(d); | ||
1556 | |||
1557 | if (!iwl_is_alive(priv)) | ||
1558 | return -EAGAIN; | ||
1559 | |||
1560 | return sprintf(buf, "%d\n", priv->temperature); | ||
1561 | } | ||
1562 | |||
1563 | static DEVICE_ATTR(temperature, S_IRUGO, show_temperature, NULL); | ||
1564 | |||
1565 | static ssize_t show_tx_power(struct device *d, | ||
1566 | struct device_attribute *attr, char *buf) | ||
1567 | { | ||
1568 | struct iwl_priv *priv = dev_get_drvdata(d); | ||
1569 | |||
1570 | if (!iwl_is_ready_rf(priv)) | ||
1571 | return sprintf(buf, "off\n"); | ||
1572 | else | ||
1573 | return sprintf(buf, "%d\n", priv->tx_power_user_lmt); | ||
1574 | } | ||
1575 | |||
1576 | static ssize_t store_tx_power(struct device *d, | ||
1577 | struct device_attribute *attr, | ||
1578 | const char *buf, size_t count) | ||
1579 | { | ||
1580 | struct iwl_priv *priv = dev_get_drvdata(d); | ||
1581 | unsigned long val; | ||
1582 | int ret; | ||
1583 | |||
1584 | ret = strict_strtoul(buf, 10, &val); | ||
1585 | if (ret) | ||
1586 | IWL_INFO(priv, "%s is not in decimal form.\n", buf); | ||
1587 | else { | ||
1588 | ret = iwl_set_tx_power(priv, val, false); | ||
1589 | if (ret) | ||
1590 | IWL_ERR(priv, "failed setting tx power (0x%d).\n", | ||
1591 | ret); | ||
1592 | else | ||
1593 | ret = count; | ||
1594 | } | ||
1595 | return ret; | ||
1596 | } | ||
1597 | |||
1598 | static DEVICE_ATTR(tx_power, S_IWUSR | S_IRUGO, show_tx_power, store_tx_power); | ||
1599 | |||
1600 | static ssize_t show_rts_ht_protection(struct device *d, | ||
1601 | struct device_attribute *attr, char *buf) | ||
1602 | { | ||
1603 | struct iwl_priv *priv = dev_get_drvdata(d); | ||
1604 | |||
1605 | return sprintf(buf, "%s\n", | ||
1606 | priv->cfg->use_rts_for_ht ? "RTS/CTS" : "CTS-to-self"); | ||
1607 | } | ||
1608 | |||
1609 | static ssize_t store_rts_ht_protection(struct device *d, | ||
1610 | struct device_attribute *attr, | ||
1611 | const char *buf, size_t count) | ||
1612 | { | ||
1613 | struct iwl_priv *priv = dev_get_drvdata(d); | ||
1614 | unsigned long val; | ||
1615 | int ret; | ||
1616 | |||
1617 | ret = strict_strtoul(buf, 10, &val); | ||
1618 | if (ret) | ||
1619 | IWL_INFO(priv, "Input is not in decimal form.\n"); | ||
1620 | else { | ||
1621 | if (!iwl_is_associated(priv)) | ||
1622 | priv->cfg->use_rts_for_ht = val ? true : false; | ||
1623 | else | ||
1624 | IWL_ERR(priv, "Sta associated with AP - " | ||
1625 | "Change protection mechanism is not allowed\n"); | ||
1626 | ret = count; | ||
1627 | } | ||
1628 | return ret; | ||
1629 | } | ||
1630 | |||
1631 | static DEVICE_ATTR(rts_ht_protection, S_IWUSR | S_IRUGO, | ||
1632 | show_rts_ht_protection, store_rts_ht_protection); | ||
1633 | |||
1634 | |||
1635 | static struct attribute *iwl_sysfs_entries[] = { | ||
1636 | &dev_attr_temperature.attr, | ||
1637 | &dev_attr_tx_power.attr, | ||
1638 | &dev_attr_rts_ht_protection.attr, | ||
1639 | #ifdef CONFIG_IWLWIFI_DEBUG | ||
1640 | &dev_attr_debug_level.attr, | ||
1641 | #endif | ||
1642 | NULL | ||
1643 | }; | ||
1644 | |||
1645 | static struct attribute_group iwl_attribute_group = { | ||
1646 | .name = NULL, /* put in device directory */ | ||
1647 | .attrs = iwl_sysfs_entries, | ||
1648 | }; | ||
1649 | |||
1500 | /****************************************************************************** | 1650 | /****************************************************************************** |
1501 | * | 1651 | * |
1502 | * uCode download functions | 1652 | * uCode download functions |
@@ -2037,6 +2187,13 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context) | |||
2037 | if (err) | 2187 | if (err) |
2038 | IWL_ERR(priv, "failed to create debugfs files. Ignoring error: %d\n", err); | 2188 | IWL_ERR(priv, "failed to create debugfs files. Ignoring error: %d\n", err); |
2039 | 2189 | ||
2190 | err = sysfs_create_group(&priv->pci_dev->dev.kobj, | ||
2191 | &iwl_attribute_group); | ||
2192 | if (err) { | ||
2193 | IWL_ERR(priv, "failed to create sysfs device attributes\n"); | ||
2194 | goto out_unbind; | ||
2195 | } | ||
2196 | |||
2040 | /* We have our copies now, allow OS release its copies */ | 2197 | /* We have our copies now, allow OS release its copies */ |
2041 | release_firmware(ucode_raw); | 2198 | release_firmware(ucode_raw); |
2042 | complete(&priv->_agn.firmware_loading_complete); | 2199 | complete(&priv->_agn.firmware_loading_complete); |
@@ -3427,141 +3584,6 @@ out_exit: | |||
3427 | 3584 | ||
3428 | /***************************************************************************** | 3585 | /***************************************************************************** |
3429 | * | 3586 | * |
3430 | * sysfs attributes | ||
3431 | * | ||
3432 | *****************************************************************************/ | ||
3433 | |||
3434 | #ifdef CONFIG_IWLWIFI_DEBUG | ||
3435 | |||
3436 | /* | ||
3437 | * The following adds a new attribute to the sysfs representation | ||
3438 | * of this device driver (i.e. a new file in /sys/class/net/wlan0/device/) | ||
3439 | * used for controlling the debug level. | ||
3440 | * | ||
3441 | * See the level definitions in iwl for details. | ||
3442 | * | ||
3443 | * The debug_level being managed using sysfs below is a per device debug | ||
3444 | * level that is used instead of the global debug level if it (the per | ||
3445 | * device debug level) is set. | ||
3446 | */ | ||
3447 | static ssize_t show_debug_level(struct device *d, | ||
3448 | struct device_attribute *attr, char *buf) | ||
3449 | { | ||
3450 | struct iwl_priv *priv = dev_get_drvdata(d); | ||
3451 | return sprintf(buf, "0x%08X\n", iwl_get_debug_level(priv)); | ||
3452 | } | ||
3453 | static ssize_t store_debug_level(struct device *d, | ||
3454 | struct device_attribute *attr, | ||
3455 | const char *buf, size_t count) | ||
3456 | { | ||
3457 | struct iwl_priv *priv = dev_get_drvdata(d); | ||
3458 | unsigned long val; | ||
3459 | int ret; | ||
3460 | |||
3461 | ret = strict_strtoul(buf, 0, &val); | ||
3462 | if (ret) | ||
3463 | IWL_ERR(priv, "%s is not in hex or decimal form.\n", buf); | ||
3464 | else { | ||
3465 | priv->debug_level = val; | ||
3466 | if (iwl_alloc_traffic_mem(priv)) | ||
3467 | IWL_ERR(priv, | ||
3468 | "Not enough memory to generate traffic log\n"); | ||
3469 | } | ||
3470 | return strnlen(buf, count); | ||
3471 | } | ||
3472 | |||
3473 | static DEVICE_ATTR(debug_level, S_IWUSR | S_IRUGO, | ||
3474 | show_debug_level, store_debug_level); | ||
3475 | |||
3476 | |||
3477 | #endif /* CONFIG_IWLWIFI_DEBUG */ | ||
3478 | |||
3479 | |||
3480 | static ssize_t show_temperature(struct device *d, | ||
3481 | struct device_attribute *attr, char *buf) | ||
3482 | { | ||
3483 | struct iwl_priv *priv = dev_get_drvdata(d); | ||
3484 | |||
3485 | if (!iwl_is_alive(priv)) | ||
3486 | return -EAGAIN; | ||
3487 | |||
3488 | return sprintf(buf, "%d\n", priv->temperature); | ||
3489 | } | ||
3490 | |||
3491 | static DEVICE_ATTR(temperature, S_IRUGO, show_temperature, NULL); | ||
3492 | |||
3493 | static ssize_t show_tx_power(struct device *d, | ||
3494 | struct device_attribute *attr, char *buf) | ||
3495 | { | ||
3496 | struct iwl_priv *priv = dev_get_drvdata(d); | ||
3497 | |||
3498 | if (!iwl_is_ready_rf(priv)) | ||
3499 | return sprintf(buf, "off\n"); | ||
3500 | else | ||
3501 | return sprintf(buf, "%d\n", priv->tx_power_user_lmt); | ||
3502 | } | ||
3503 | |||
3504 | static ssize_t store_tx_power(struct device *d, | ||
3505 | struct device_attribute *attr, | ||
3506 | const char *buf, size_t count) | ||
3507 | { | ||
3508 | struct iwl_priv *priv = dev_get_drvdata(d); | ||
3509 | unsigned long val; | ||
3510 | int ret; | ||
3511 | |||
3512 | ret = strict_strtoul(buf, 10, &val); | ||
3513 | if (ret) | ||
3514 | IWL_INFO(priv, "%s is not in decimal form.\n", buf); | ||
3515 | else { | ||
3516 | ret = iwl_set_tx_power(priv, val, false); | ||
3517 | if (ret) | ||
3518 | IWL_ERR(priv, "failed setting tx power (0x%d).\n", | ||
3519 | ret); | ||
3520 | else | ||
3521 | ret = count; | ||
3522 | } | ||
3523 | return ret; | ||
3524 | } | ||
3525 | |||
3526 | static DEVICE_ATTR(tx_power, S_IWUSR | S_IRUGO, show_tx_power, store_tx_power); | ||
3527 | |||
3528 | static ssize_t show_rts_ht_protection(struct device *d, | ||
3529 | struct device_attribute *attr, char *buf) | ||
3530 | { | ||
3531 | struct iwl_priv *priv = dev_get_drvdata(d); | ||
3532 | |||
3533 | return sprintf(buf, "%s\n", | ||
3534 | priv->cfg->use_rts_for_ht ? "RTS/CTS" : "CTS-to-self"); | ||
3535 | } | ||
3536 | |||
3537 | static ssize_t store_rts_ht_protection(struct device *d, | ||
3538 | struct device_attribute *attr, | ||
3539 | const char *buf, size_t count) | ||
3540 | { | ||
3541 | struct iwl_priv *priv = dev_get_drvdata(d); | ||
3542 | unsigned long val; | ||
3543 | int ret; | ||
3544 | |||
3545 | ret = strict_strtoul(buf, 10, &val); | ||
3546 | if (ret) | ||
3547 | IWL_INFO(priv, "Input is not in decimal form.\n"); | ||
3548 | else { | ||
3549 | if (!iwl_is_associated(priv)) | ||
3550 | priv->cfg->use_rts_for_ht = val ? true : false; | ||
3551 | else | ||
3552 | IWL_ERR(priv, "Sta associated with AP - " | ||
3553 | "Change protection mechanism is not allowed\n"); | ||
3554 | ret = count; | ||
3555 | } | ||
3556 | return ret; | ||
3557 | } | ||
3558 | |||
3559 | static DEVICE_ATTR(rts_ht_protection, S_IWUSR | S_IRUGO, | ||
3560 | show_rts_ht_protection, store_rts_ht_protection); | ||
3561 | |||
3562 | |||
3563 | /***************************************************************************** | ||
3564 | * | ||
3565 | * driver setup and teardown | 3587 | * driver setup and teardown |
3566 | * | 3588 | * |
3567 | *****************************************************************************/ | 3589 | *****************************************************************************/ |
@@ -3713,21 +3735,6 @@ static void iwl_uninit_drv(struct iwl_priv *priv) | |||
3713 | kfree(priv->scan_cmd); | 3735 | kfree(priv->scan_cmd); |
3714 | } | 3736 | } |
3715 | 3737 | ||
3716 | static struct attribute *iwl_sysfs_entries[] = { | ||
3717 | &dev_attr_temperature.attr, | ||
3718 | &dev_attr_tx_power.attr, | ||
3719 | &dev_attr_rts_ht_protection.attr, | ||
3720 | #ifdef CONFIG_IWLWIFI_DEBUG | ||
3721 | &dev_attr_debug_level.attr, | ||
3722 | #endif | ||
3723 | NULL | ||
3724 | }; | ||
3725 | |||
3726 | static struct attribute_group iwl_attribute_group = { | ||
3727 | .name = NULL, /* put in device directory */ | ||
3728 | .attrs = iwl_sysfs_entries, | ||
3729 | }; | ||
3730 | |||
3731 | static struct ieee80211_ops iwl_hw_ops = { | 3738 | static struct ieee80211_ops iwl_hw_ops = { |
3732 | .tx = iwl_mac_tx, | 3739 | .tx = iwl_mac_tx, |
3733 | .start = iwl_mac_start, | 3740 | .start = iwl_mac_start, |
@@ -3912,11 +3919,6 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
3912 | IWL_ERR(priv, "Error allocating IRQ %d\n", priv->pci_dev->irq); | 3919 | IWL_ERR(priv, "Error allocating IRQ %d\n", priv->pci_dev->irq); |
3913 | goto out_disable_msi; | 3920 | goto out_disable_msi; |
3914 | } | 3921 | } |
3915 | err = sysfs_create_group(&pdev->dev.kobj, &iwl_attribute_group); | ||
3916 | if (err) { | ||
3917 | IWL_ERR(priv, "failed to create sysfs device attributes\n"); | ||
3918 | goto out_free_irq; | ||
3919 | } | ||
3920 | 3922 | ||
3921 | iwl_setup_deferred_work(priv); | 3923 | iwl_setup_deferred_work(priv); |
3922 | iwl_setup_rx_handlers(priv); | 3924 | iwl_setup_rx_handlers(priv); |
@@ -3950,15 +3952,13 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
3950 | 3952 | ||
3951 | err = iwl_request_firmware(priv, true); | 3953 | err = iwl_request_firmware(priv, true); |
3952 | if (err) | 3954 | if (err) |
3953 | goto out_remove_sysfs; | 3955 | goto out_destroy_workqueue; |
3954 | 3956 | ||
3955 | return 0; | 3957 | return 0; |
3956 | 3958 | ||
3957 | out_remove_sysfs: | 3959 | out_destroy_workqueue: |
3958 | destroy_workqueue(priv->workqueue); | 3960 | destroy_workqueue(priv->workqueue); |
3959 | priv->workqueue = NULL; | 3961 | priv->workqueue = NULL; |
3960 | sysfs_remove_group(&pdev->dev.kobj, &iwl_attribute_group); | ||
3961 | out_free_irq: | ||
3962 | free_irq(priv->pci_dev->irq, priv); | 3962 | free_irq(priv->pci_dev->irq, priv); |
3963 | iwl_free_isr_ict(priv); | 3963 | iwl_free_isr_ict(priv); |
3964 | out_disable_msi: | 3964 | out_disable_msi: |
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c index 6cd8d207dd21..62c50bc0089a 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.c +++ b/drivers/net/wireless/iwlwifi/iwl-core.c | |||
@@ -855,6 +855,45 @@ void iwl_set_rxon_chain(struct iwl_priv *priv) | |||
855 | } | 855 | } |
856 | EXPORT_SYMBOL(iwl_set_rxon_chain); | 856 | EXPORT_SYMBOL(iwl_set_rxon_chain); |
857 | 857 | ||
858 | /* Return valid channel */ | ||
859 | u8 iwl_get_single_channel_number(struct iwl_priv *priv, | ||
860 | enum ieee80211_band band) | ||
861 | { | ||
862 | const struct iwl_channel_info *ch_info; | ||
863 | int i; | ||
864 | u8 channel = 0; | ||
865 | |||
866 | /* only scan single channel, good enough to reset the RF */ | ||
867 | /* pick the first valid not in-use channel */ | ||
868 | if (band == IEEE80211_BAND_5GHZ) { | ||
869 | for (i = 14; i < priv->channel_count; i++) { | ||
870 | if (priv->channel_info[i].channel != | ||
871 | le16_to_cpu(priv->staging_rxon.channel)) { | ||
872 | channel = priv->channel_info[i].channel; | ||
873 | ch_info = iwl_get_channel_info(priv, | ||
874 | band, channel); | ||
875 | if (is_channel_valid(ch_info)) | ||
876 | break; | ||
877 | } | ||
878 | } | ||
879 | } else { | ||
880 | for (i = 0; i < 14; i++) { | ||
881 | if (priv->channel_info[i].channel != | ||
882 | le16_to_cpu(priv->staging_rxon.channel)) { | ||
883 | channel = | ||
884 | priv->channel_info[i].channel; | ||
885 | ch_info = iwl_get_channel_info(priv, | ||
886 | band, channel); | ||
887 | if (is_channel_valid(ch_info)) | ||
888 | break; | ||
889 | } | ||
890 | } | ||
891 | } | ||
892 | |||
893 | return channel; | ||
894 | } | ||
895 | EXPORT_SYMBOL(iwl_get_single_channel_number); | ||
896 | |||
858 | /** | 897 | /** |
859 | * iwl_set_rxon_channel - Set the phymode and channel values in staging RXON | 898 | * iwl_set_rxon_channel - Set the phymode and channel values in staging RXON |
860 | * @phymode: MODE_IEEE80211A sets to 5.2GHz; all else set to 2.4GHz | 899 | * @phymode: MODE_IEEE80211A sets to 5.2GHz; all else set to 2.4GHz |
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h index 87dd5731e515..76288c56a7d7 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.h +++ b/drivers/net/wireless/iwlwifi/iwl-core.h | |||
@@ -350,6 +350,8 @@ int iwl_set_rxon_channel(struct iwl_priv *priv, struct ieee80211_channel *ch); | |||
350 | void iwl_set_flags_for_band(struct iwl_priv *priv, | 350 | void iwl_set_flags_for_band(struct iwl_priv *priv, |
351 | enum ieee80211_band band, | 351 | enum ieee80211_band band, |
352 | struct ieee80211_vif *vif); | 352 | struct ieee80211_vif *vif); |
353 | u8 iwl_get_single_channel_number(struct iwl_priv *priv, | ||
354 | enum ieee80211_band band); | ||
353 | void iwl_set_rxon_ht(struct iwl_priv *priv, struct iwl_ht_config *ht_conf); | 355 | void iwl_set_rxon_ht(struct iwl_priv *priv, struct iwl_ht_config *ht_conf); |
354 | u8 iwl_is_ht40_tx_allowed(struct iwl_priv *priv, | 356 | u8 iwl_is_ht40_tx_allowed(struct iwl_priv *priv, |
355 | struct ieee80211_sta_ht_cap *sta_ht_inf); | 357 | struct ieee80211_sta_ht_cap *sta_ht_inf); |
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index c3e9d633194a..0f16c7d518f7 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c | |||
@@ -1782,6 +1782,49 @@ static void iwl3945_irq_tasklet(struct iwl_priv *priv) | |||
1782 | #endif | 1782 | #endif |
1783 | } | 1783 | } |
1784 | 1784 | ||
1785 | static int iwl3945_get_single_channel_for_scan(struct iwl_priv *priv, | ||
1786 | struct ieee80211_vif *vif, | ||
1787 | enum ieee80211_band band, | ||
1788 | struct iwl3945_scan_channel *scan_ch) | ||
1789 | { | ||
1790 | const struct ieee80211_supported_band *sband; | ||
1791 | u16 passive_dwell = 0; | ||
1792 | u16 active_dwell = 0; | ||
1793 | int added = 0; | ||
1794 | u8 channel = 0; | ||
1795 | |||
1796 | sband = iwl_get_hw_mode(priv, band); | ||
1797 | if (!sband) { | ||
1798 | IWL_ERR(priv, "invalid band\n"); | ||
1799 | return added; | ||
1800 | } | ||
1801 | |||
1802 | active_dwell = iwl_get_active_dwell_time(priv, band, 0); | ||
1803 | passive_dwell = iwl_get_passive_dwell_time(priv, band, vif); | ||
1804 | |||
1805 | if (passive_dwell <= active_dwell) | ||
1806 | passive_dwell = active_dwell + 1; | ||
1807 | |||
1808 | |||
1809 | channel = iwl_get_single_channel_number(priv, band); | ||
1810 | |||
1811 | if (channel) { | ||
1812 | scan_ch->channel = channel; | ||
1813 | scan_ch->type = 0; /* passive */ | ||
1814 | scan_ch->active_dwell = cpu_to_le16(active_dwell); | ||
1815 | scan_ch->passive_dwell = cpu_to_le16(passive_dwell); | ||
1816 | /* Set txpower levels to defaults */ | ||
1817 | scan_ch->tpc.dsp_atten = 110; | ||
1818 | if (band == IEEE80211_BAND_5GHZ) | ||
1819 | scan_ch->tpc.tx_gain = ((1 << 5) | (3 << 3)) | 3; | ||
1820 | else | ||
1821 | scan_ch->tpc.tx_gain = ((1 << 5) | (5 << 3)); | ||
1822 | added++; | ||
1823 | } else | ||
1824 | IWL_ERR(priv, "no valid channel found\n"); | ||
1825 | return added; | ||
1826 | } | ||
1827 | |||
1785 | static int iwl3945_get_channels_for_scan(struct iwl_priv *priv, | 1828 | static int iwl3945_get_channels_for_scan(struct iwl_priv *priv, |
1786 | enum ieee80211_band band, | 1829 | enum ieee80211_band band, |
1787 | u8 is_active, u8 n_probes, | 1830 | u8 is_active, u8 n_probes, |
@@ -2932,9 +2975,16 @@ void iwl3945_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif) | |||
2932 | /* select Rx antennas */ | 2975 | /* select Rx antennas */ |
2933 | scan->flags |= iwl3945_get_antenna_flags(priv); | 2976 | scan->flags |= iwl3945_get_antenna_flags(priv); |
2934 | 2977 | ||
2935 | scan->channel_count = | 2978 | if (priv->is_internal_short_scan) { |
2936 | iwl3945_get_channels_for_scan(priv, band, is_active, n_probes, | 2979 | scan->channel_count = |
2937 | (void *)&scan->data[le16_to_cpu(scan->tx_cmd.len)], vif); | 2980 | iwl3945_get_single_channel_for_scan(priv, vif, band, |
2981 | (void *)&scan->data[le16_to_cpu( | ||
2982 | scan->tx_cmd.len)]); | ||
2983 | } else { | ||
2984 | scan->channel_count = | ||
2985 | iwl3945_get_channels_for_scan(priv, band, is_active, n_probes, | ||
2986 | (void *)&scan->data[le16_to_cpu(scan->tx_cmd.len)], vif); | ||
2987 | } | ||
2938 | 2988 | ||
2939 | if (scan->channel_count == 0) { | 2989 | if (scan->channel_count == 0) { |
2940 | IWL_DEBUG_SCAN(priv, "channel count %d\n", scan->channel_count); | 2990 | IWL_DEBUG_SCAN(priv, "channel count %d\n", scan->channel_count); |
diff --git a/drivers/net/wireless/p54/p54usb.c b/drivers/net/wireless/p54/p54usb.c index a06862130703..b0318ea59b7f 100644 --- a/drivers/net/wireless/p54/p54usb.c +++ b/drivers/net/wireless/p54/p54usb.c | |||
@@ -80,6 +80,7 @@ static struct usb_device_id p54u_table[] __devinitdata = { | |||
80 | {USB_DEVICE(0x1413, 0x5400)}, /* Telsey 802.11g USB2.0 Adapter */ | 80 | {USB_DEVICE(0x1413, 0x5400)}, /* Telsey 802.11g USB2.0 Adapter */ |
81 | {USB_DEVICE(0x1435, 0x0427)}, /* Inventel UR054G */ | 81 | {USB_DEVICE(0x1435, 0x0427)}, /* Inventel UR054G */ |
82 | {USB_DEVICE(0x2001, 0x3704)}, /* DLink DWL-G122 rev A2 */ | 82 | {USB_DEVICE(0x2001, 0x3704)}, /* DLink DWL-G122 rev A2 */ |
83 | {USB_DEVICE(0x413c, 0x5513)}, /* Dell WLA3310 USB Wireless Adapter */ | ||
83 | {USB_DEVICE(0x413c, 0x8102)}, /* Spinnaker DUT */ | 84 | {USB_DEVICE(0x413c, 0x8102)}, /* Spinnaker DUT */ |
84 | {USB_DEVICE(0x413c, 0x8104)}, /* Cohiba Proto board */ | 85 | {USB_DEVICE(0x413c, 0x8104)}, /* Cohiba Proto board */ |
85 | {} | 86 | {} |
diff --git a/drivers/net/wireless/wl12xx/wl1251_sdio.c b/drivers/net/wireless/wl12xx/wl1251_sdio.c index d234285c2c81..c561332e7009 100644 --- a/drivers/net/wireless/wl12xx/wl1251_sdio.c +++ b/drivers/net/wireless/wl12xx/wl1251_sdio.c | |||
@@ -259,6 +259,7 @@ disable: | |||
259 | sdio_disable_func(func); | 259 | sdio_disable_func(func); |
260 | release: | 260 | release: |
261 | sdio_release_host(func); | 261 | sdio_release_host(func); |
262 | wl1251_free_hw(wl); | ||
262 | return ret; | 263 | return ret; |
263 | } | 264 | } |
264 | 265 | ||