Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
authorJohn W. Linville <linville@tuxdriver.com>
Mon, 7 Jun 2010 19:13:46 +0000 (15:13 -0400)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 7 Jun 2010 19:13:46 +0000 (15:13 -0400)
Conflicts:
drivers/net/wireless/iwlwifi/iwl-core.h

13 files changed:
1  2 
drivers/net/wireless/ath/ath5k/base.c
drivers/net/wireless/ath/ath5k/phy.c
drivers/net/wireless/iwlwifi/iwl-3945.c
drivers/net/wireless/iwlwifi/iwl-agn-lib.c
drivers/net/wireless/iwlwifi/iwl-agn.c
drivers/net/wireless/iwlwifi/iwl-core.c
drivers/net/wireless/iwlwifi/iwl-core.h
drivers/net/wireless/iwlwifi/iwl3945-base.c
drivers/net/wireless/p54/p54usb.c
net/mac80211/agg-tx.c
net/mac80211/driver-ops.h
net/mac80211/mlme.c
net/mac80211/rx.c

@@@ -705,13 -705,14 +704,13 @@@ ath5k_pci_remove(struct pci_dev *pdev
        pci_iounmap(pdev, sc->iobase);
        pci_release_region(pdev, 0);
        pci_disable_device(pdev);
 -      ieee80211_free_hw(hw);
 +      ieee80211_free_hw(sc->hw);
  }
  
- #ifdef CONFIG_PM
+ #ifdef CONFIG_PM_SLEEP
  static int ath5k_pci_suspend(struct device *dev)
  {
 -      struct ieee80211_hw *hw = pci_get_drvdata(to_pci_dev(dev));
 -      struct ath5k_softc *sc = hw->priv;
 +      struct ath5k_softc *sc = pci_get_drvdata(to_pci_dev(dev));
  
        ath5k_led_off(sc);
        return 0;
@@@ -1793,8 -1814,17 +1793,15 @@@ ath5k_hw_set_antenna_mode(struct ath5k_
        u8 def_ant, tx_ant, ee_mode;
        u32 sta_id1 = 0;
  
+       /* if channel is not initialized yet we can't set the antennas
+        * so just store the mode. it will be set on the next reset */
+       if (channel == NULL) {
+               ah->ah_ant_mode = ant_mode;
+               return;
+       }
        def_ant = ah->ah_def_ant;
  
 -      ATH5K_TRACE(ah->ah_sc);
 -
        switch (channel->hw_value & CHANNEL_MODES) {
        case CHANNEL_A:
        case CHANNEL_T:
@@@ -3333,235 -3419,8 +3490,100 @@@ static int iwlagn_mac_sta_add(struct ie
        return 0;
  }
  
 +static void iwl_mac_channel_switch(struct ieee80211_hw *hw,
 +                                 struct ieee80211_channel_switch *ch_switch)
 +{
 +      struct iwl_priv *priv = hw->priv;
 +      const struct iwl_channel_info *ch_info;
 +      struct ieee80211_conf *conf = &hw->conf;
 +      struct iwl_ht_config *ht_conf = &priv->current_ht_config;
 +      u16 ch;
 +      unsigned long flags = 0;
 +
 +      IWL_DEBUG_MAC80211(priv, "enter\n");
 +
 +      if (iwl_is_rfkill(priv))
 +              goto out_exit;
 +
 +      if (test_bit(STATUS_EXIT_PENDING, &priv->status) ||
 +          test_bit(STATUS_SCANNING, &priv->status))
 +              goto out_exit;
 +
 +      if (!iwl_is_associated(priv))
 +              goto out_exit;
 +
 +      /* channel switch in progress */
 +      if (priv->switch_rxon.switch_in_progress == true)
 +              goto out_exit;
 +
 +      mutex_lock(&priv->mutex);
 +      if (priv->cfg->ops->lib->set_channel_switch) {
 +
 +              ch = ieee80211_frequency_to_channel(
 +                      ch_switch->channel->center_freq);
 +              if (le16_to_cpu(priv->active_rxon.channel) != ch) {
 +                      ch_info = iwl_get_channel_info(priv,
 +                                                     conf->channel->band,
 +                                                     ch);
 +                      if (!is_channel_valid(ch_info)) {
 +                              IWL_DEBUG_MAC80211(priv, "invalid channel\n");
 +                              goto out;
 +                      }
 +                      spin_lock_irqsave(&priv->lock, flags);
 +
 +                      priv->current_ht_config.smps = conf->smps_mode;
 +
 +                      /* Configure HT40 channels */
 +                      ht_conf->is_ht = conf_is_ht(conf);
 +                      if (ht_conf->is_ht) {
 +                              if (conf_is_ht40_minus(conf)) {
 +                                      ht_conf->extension_chan_offset =
 +                                              IEEE80211_HT_PARAM_CHA_SEC_BELOW;
 +                                      ht_conf->is_40mhz = true;
 +                              } else if (conf_is_ht40_plus(conf)) {
 +                                      ht_conf->extension_chan_offset =
 +                                              IEEE80211_HT_PARAM_CHA_SEC_ABOVE;
 +                                      ht_conf->is_40mhz = true;
 +                              } else {
 +                                      ht_conf->extension_chan_offset =
 +                                              IEEE80211_HT_PARAM_CHA_SEC_NONE;
 +                                      ht_conf->is_40mhz = false;
 +                              }
 +                      } else
 +                              ht_conf->is_40mhz = false;
 +
 +                      /* if we are switching from ht to 2.4 clear flags
 +                       * from any ht related info since 2.4 does not
 +                       * support ht */
 +                      if ((le16_to_cpu(priv->staging_rxon.channel) != ch))
 +                              priv->staging_rxon.flags = 0;
 +
 +                      iwl_set_rxon_channel(priv, conf->channel);
 +                      iwl_set_rxon_ht(priv, ht_conf);
 +                      iwl_set_flags_for_band(priv, conf->channel->band,
 +                                             priv->vif);
 +                      spin_unlock_irqrestore(&priv->lock, flags);
 +
 +                      iwl_set_rate(priv);
 +                      /*
 +                       * at this point, staging_rxon has the
 +                       * configuration for channel switch
 +                       */
 +                      if (priv->cfg->ops->lib->set_channel_switch(priv,
 +                                                                  ch_switch))
 +                              priv->switch_rxon.switch_in_progress = false;
 +              }
 +      }
 +out:
 +      mutex_unlock(&priv->mutex);
 +out_exit:
 +      if (!priv->switch_rxon.switch_in_progress)
 +              ieee80211_chswitch_done(priv->vif, false);
 +      IWL_DEBUG_MAC80211(priv, "leave\n");
 +}
 +
  /*****************************************************************************
   *
-  * sysfs attributes
-  *
-  *****************************************************************************/
- #ifdef CONFIG_IWLWIFI_DEBUG
- /*
-  * The following adds a new attribute to the sysfs representation
-  * of this device driver (i.e. a new file in /sys/class/net/wlan0/device/)
-  * used for controlling the debug level.
-  *
-  * See the level definitions in iwl for details.
-  *
-  * The debug_level being managed using sysfs below is a per device debug
-  * level that is used instead of the global debug level if it (the per
-  * device debug level) is set.
-  */
- static ssize_t show_debug_level(struct device *d,
-                               struct device_attribute *attr, char *buf)
- {
-       struct iwl_priv *priv = dev_get_drvdata(d);
-       return sprintf(buf, "0x%08X\n", iwl_get_debug_level(priv));
- }
- static ssize_t store_debug_level(struct device *d,
-                               struct device_attribute *attr,
-                                const char *buf, size_t count)
- {
-       struct iwl_priv *priv = dev_get_drvdata(d);
-       unsigned long val;
-       int ret;
-       ret = strict_strtoul(buf, 0, &val);
-       if (ret)
-               IWL_ERR(priv, "%s is not in hex or decimal form.\n", buf);
-       else {
-               priv->debug_level = val;
-               if (iwl_alloc_traffic_mem(priv))
-                       IWL_ERR(priv,
-                               "Not enough memory to generate traffic log\n");
-       }
-       return strnlen(buf, count);
- }
- static DEVICE_ATTR(debug_level, S_IWUSR | S_IRUGO,
-                       show_debug_level, store_debug_level);
- #endif /* CONFIG_IWLWIFI_DEBUG */
- static ssize_t show_temperature(struct device *d,
-                               struct device_attribute *attr, char *buf)
- {
-       struct iwl_priv *priv = dev_get_drvdata(d);
-       if (!iwl_is_alive(priv))
-               return -EAGAIN;
-       return sprintf(buf, "%d\n", priv->temperature);
- }
- static DEVICE_ATTR(temperature, S_IRUGO, show_temperature, NULL);
- static ssize_t show_tx_power(struct device *d,
-                            struct device_attribute *attr, char *buf)
- {
-       struct iwl_priv *priv = dev_get_drvdata(d);
-       if (!iwl_is_ready_rf(priv))
-               return sprintf(buf, "off\n");
-       else
-               return sprintf(buf, "%d\n", priv->tx_power_user_lmt);
- }
- static ssize_t store_tx_power(struct device *d,
-                             struct device_attribute *attr,
-                             const char *buf, size_t count)
- {
-       struct iwl_priv *priv = dev_get_drvdata(d);
-       unsigned long val;
-       int ret;
-       ret = strict_strtoul(buf, 10, &val);
-       if (ret)
-               IWL_INFO(priv, "%s is not in decimal form.\n", buf);
-       else {
-               ret = iwl_set_tx_power(priv, val, false);
-               if (ret)
-                       IWL_ERR(priv, "failed setting tx power (0x%d).\n",
-                               ret);
-               else
-                       ret = count;
-       }
-       return ret;
- }
- static DEVICE_ATTR(tx_power, S_IWUSR | S_IRUGO, show_tx_power, store_tx_power);
- static ssize_t show_rts_ht_protection(struct device *d,
-                            struct device_attribute *attr, char *buf)
- {
-       struct iwl_priv *priv = dev_get_drvdata(d);
-       return sprintf(buf, "%s\n",
-               priv->cfg->use_rts_for_ht ? "RTS/CTS" : "CTS-to-self");
- }
- static ssize_t store_rts_ht_protection(struct device *d,
-                             struct device_attribute *attr,
-                             const char *buf, size_t count)
- {
-       struct iwl_priv *priv = dev_get_drvdata(d);
-       unsigned long val;
-       int ret;
-       ret = strict_strtoul(buf, 10, &val);
-       if (ret)
-               IWL_INFO(priv, "Input is not in decimal form.\n");
-       else {
-               if (!iwl_is_associated(priv))
-                       priv->cfg->use_rts_for_ht = val ? true : false;
-               else
-                       IWL_ERR(priv, "Sta associated with AP - "
-                               "Change protection mechanism is not allowed\n");
-               ret = count;
-       }
-       return ret;
- }
- static DEVICE_ATTR(rts_ht_protection, S_IWUSR | S_IRUGO,
-                       show_rts_ht_protection, store_rts_ht_protection);
- /*****************************************************************************
-  *
   * driver setup and teardown
   *
   *****************************************************************************/
@@@ -347,9 -343,8 +347,11 @@@ int iwl_check_rxon_cmd(struct iwl_priv 
  int iwl_full_rxon_required(struct iwl_priv *priv);
  void iwl_set_rxon_chain(struct iwl_priv *priv);
  int iwl_set_rxon_channel(struct iwl_priv *priv, struct ieee80211_channel *ch);
 +void iwl_set_flags_for_band(struct iwl_priv *priv,
 +                          enum ieee80211_band band,
 +                          struct ieee80211_vif *vif);
+ u8 iwl_get_single_channel_number(struct iwl_priv *priv,
+                                 enum ieee80211_band band);
  void iwl_set_rxon_ht(struct iwl_priv *priv, struct iwl_ht_config *ht_conf);
  u8 iwl_is_ht40_tx_allowed(struct iwl_priv *priv,
                         struct ieee80211_sta_ht_cap *sta_ht_inf);
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge