aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-agn.c
diff options
context:
space:
mode:
authorAbhijeet Kolekar <abhijeet.kolekar@intel.com>2009-04-08 14:26:48 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-04-22 16:54:43 -0400
commit4808368dad3263ac46e71f037c0dcd2dcf082525 (patch)
tree23ade76011df676aca0925fd025c313bfa5c4055 /drivers/net/wireless/iwlwifi/iwl-agn.c
parentd8052319f2a7d1ee86248df00193110ad1946a33 (diff)
iwl3945: use iwl_mac_config from iwlwifi
3945 can now use iwl_mac_config from iwlwifi Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-agn.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c133
1 files changed, 0 insertions, 133 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 5cc30a223cf0..4640996aa298 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -2036,139 +2036,6 @@ static int iwl_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
2036 return NETDEV_TX_OK; 2036 return NETDEV_TX_OK;
2037} 2037}
2038 2038
2039/**
2040 * iwl_mac_config - mac80211 config callback
2041 *
2042 * We ignore conf->flags & IEEE80211_CONF_SHORT_SLOT_TIME since it seems to
2043 * be set inappropriately and the driver currently sets the hardware up to
2044 * use it whenever needed.
2045 */
2046static int iwl_mac_config(struct ieee80211_hw *hw, u32 changed)
2047{
2048 struct iwl_priv *priv = hw->priv;
2049 const struct iwl_channel_info *ch_info;
2050 struct ieee80211_conf *conf = &hw->conf;
2051 unsigned long flags = 0;
2052 int ret = 0;
2053 u16 ch;
2054 int scan_active = 0;
2055
2056 mutex_lock(&priv->mutex);
2057 IWL_DEBUG_MAC80211(priv, "enter to channel %d changed 0x%X\n",
2058 conf->channel->hw_value, changed);
2059
2060 if (unlikely(!priv->cfg->mod_params->disable_hw_scan &&
2061 test_bit(STATUS_SCANNING, &priv->status))) {
2062 scan_active = 1;
2063 IWL_DEBUG_MAC80211(priv, "leave - scanning\n");
2064 }
2065
2066
2067 /* during scanning mac80211 will delay channel setting until
2068 * scan finish with changed = 0
2069 */
2070 if (!changed || (changed & IEEE80211_CONF_CHANGE_CHANNEL)) {
2071 if (scan_active)
2072 goto set_ch_out;
2073
2074 ch = ieee80211_frequency_to_channel(conf->channel->center_freq);
2075 ch_info = iwl_get_channel_info(priv, conf->channel->band, ch);
2076 if (!is_channel_valid(ch_info)) {
2077 IWL_DEBUG_MAC80211(priv, "leave - invalid channel\n");
2078 ret = -EINVAL;
2079 goto set_ch_out;
2080 }
2081
2082 if (priv->iw_mode == NL80211_IFTYPE_ADHOC &&
2083 !is_channel_ibss(ch_info)) {
2084 IWL_ERR(priv, "channel %d in band %d not "
2085 "IBSS channel\n",
2086 conf->channel->hw_value, conf->channel->band);
2087 ret = -EINVAL;
2088 goto set_ch_out;
2089 }
2090
2091 priv->current_ht_config.is_ht = conf_is_ht(conf);
2092
2093 spin_lock_irqsave(&priv->lock, flags);
2094
2095
2096 /* if we are switching from ht to 2.4 clear flags
2097 * from any ht related info since 2.4 does not
2098 * support ht */
2099 if ((le16_to_cpu(priv->staging_rxon.channel) != ch))
2100 priv->staging_rxon.flags = 0;
2101
2102 iwl_set_rxon_channel(priv, conf->channel);
2103
2104 iwl_set_flags_for_band(priv, conf->channel->band);
2105 spin_unlock_irqrestore(&priv->lock, flags);
2106 set_ch_out:
2107 /* The list of supported rates and rate mask can be different
2108 * for each band; since the band may have changed, reset
2109 * the rate mask to what mac80211 lists */
2110 iwl_set_rate(priv);
2111 }
2112
2113 if (changed & IEEE80211_CONF_CHANGE_PS) {
2114 if (conf->flags & IEEE80211_CONF_PS)
2115 ret = iwl_power_set_user_mode(priv, IWL_POWER_INDEX_3);
2116 else
2117 ret = iwl_power_set_user_mode(priv, IWL_POWER_MODE_CAM);
2118 if (ret)
2119 IWL_DEBUG_MAC80211(priv, "Error setting power level\n");
2120
2121 }
2122
2123 if (changed & IEEE80211_CONF_CHANGE_POWER) {
2124 IWL_DEBUG_MAC80211(priv, "TX Power old=%d new=%d\n",
2125 priv->tx_power_user_lmt, conf->power_level);
2126
2127 iwl_set_tx_power(priv, conf->power_level, false);
2128 }
2129
2130 /* call to ensure that 4965 rx_chain is set properly in monitor mode */
2131 if (priv->cfg->ops->hcmd->set_rxon_chain)
2132 priv->cfg->ops->hcmd->set_rxon_chain(priv);
2133
2134 if (changed & IEEE80211_CONF_CHANGE_RADIO_ENABLED) {
2135 if (conf->radio_enabled &&
2136 iwl_radio_kill_sw_enable_radio(priv)) {
2137 IWL_DEBUG_MAC80211(priv, "leave - RF-KILL - "
2138 "waiting for uCode\n");
2139 goto out;
2140 }
2141
2142 if (!conf->radio_enabled)
2143 iwl_radio_kill_sw_disable_radio(priv);
2144 }
2145
2146 if (!conf->radio_enabled) {
2147 IWL_DEBUG_MAC80211(priv, "leave - radio disabled\n");
2148 goto out;
2149 }
2150
2151 if (!iwl_is_ready(priv)) {
2152 IWL_DEBUG_MAC80211(priv, "leave - not ready\n");
2153 goto out;
2154 }
2155
2156 if (scan_active)
2157 goto out;
2158
2159 if (memcmp(&priv->active_rxon,
2160 &priv->staging_rxon, sizeof(priv->staging_rxon)))
2161 iwlcore_commit_rxon(priv);
2162 else
2163 IWL_DEBUG_INFO(priv, "No re-sending same RXON configuration.\n");
2164
2165
2166out:
2167 IWL_DEBUG_MAC80211(priv, "leave\n");
2168 mutex_unlock(&priv->mutex);
2169 return ret;
2170}
2171
2172static void iwl_config_ap(struct iwl_priv *priv) 2039static void iwl_config_ap(struct iwl_priv *priv)
2173{ 2040{
2174 int ret = 0; 2041 int ret = 0;