aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl4965-base.c
diff options
context:
space:
mode:
authorTomas Winkler <tomas.winkler@intel.com>2008-02-05 19:37:18 -0500
committerJohn W. Linville <linville@tuxdriver.com>2008-02-29 15:37:01 -0500
commit78330fddec4e326af5e6aede0fc97824c690ba1d (patch)
tree9786f968f45b35340432d9ee159dda4ca36a95fc /drivers/net/wireless/iwlwifi/iwl4965-base.c
parentb86af631b8482b908979b61d06ae7d14e5966885 (diff)
iwlwifi: Fix HT compilation breakage caused by cfg80211 API for channels/bitrates patch
This patch fixes compilation breakage caused by 'cfg80211 API for channels/bitrates' patch. however it doesn't fix the driver's functional problems caused by that patch. Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl4965-base.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl4965-base.c83
1 files changed, 31 insertions, 52 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c
index 933e0d44f69f..d0e385aa59e8 100644
--- a/drivers/net/wireless/iwlwifi/iwl4965-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c
@@ -1893,24 +1893,20 @@ static u16 iwl4965_supported_rate_to_ie(u8 *ie, u16 supported_rate,
1893 return ret_rates; 1893 return ret_rates;
1894} 1894}
1895 1895
1896#ifdef CONFIG_IWL4965_HT
1897void static iwl4965_set_ht_capab(struct ieee80211_hw *hw,
1898 struct ieee80211_ht_cap *ht_cap,
1899 u8 use_current_config);
1900#endif
1901
1902/** 1896/**
1903 * iwl4965_fill_probe_req - fill in all required fields and IE for probe request 1897 * iwl4965_fill_probe_req - fill in all required fields and IE for probe request
1904 */ 1898 */
1905static u16 iwl4965_fill_probe_req(struct iwl4965_priv *priv, 1899static u16 iwl4965_fill_probe_req(struct iwl4965_priv *priv,
1906 struct ieee80211_mgmt *frame, 1900 enum ieee80211_band band,
1907 int left, int is_direct) 1901 struct ieee80211_mgmt *frame,
1902 int left, int is_direct)
1908{ 1903{
1909 int len = 0; 1904 int len = 0;
1910 u8 *pos = NULL; 1905 u8 *pos = NULL;
1911 u16 active_rates, ret_rates, cck_rates, active_rate_basic; 1906 u16 active_rates, ret_rates, cck_rates, active_rate_basic;
1912#ifdef CONFIG_IWL4965_HT 1907#ifdef CONFIG_IWL4965_HT
1913 struct ieee80211_hw_mode *mode; 1908 const struct ieee80211_supported_band *sband =
1909 iwl4965_get_hw_mode(priv, band);
1914#endif /* CONFIG_IWL4965_HT */ 1910#endif /* CONFIG_IWL4965_HT */
1915 1911
1916 /* Make sure there is enough space for the probe request, 1912 /* Make sure there is enough space for the probe request,
@@ -1995,13 +1991,18 @@ static u16 iwl4965_fill_probe_req(struct iwl4965_priv *priv,
1995 len += 2 + *pos; 1991 len += 2 + *pos;
1996 1992
1997#ifdef CONFIG_IWL4965_HT 1993#ifdef CONFIG_IWL4965_HT
1998 mode = priv->hw->conf.mode; 1994 if (sband && sband->ht_info.ht_supported) {
1999 if (mode->ht_info.ht_supported) { 1995 struct ieee80211_ht_cap *ht_cap;
2000 pos += (*pos) + 1; 1996 pos += (*pos) + 1;
2001 *pos++ = WLAN_EID_HT_CAPABILITY; 1997 *pos++ = WLAN_EID_HT_CAPABILITY;
2002 *pos++ = sizeof(struct ieee80211_ht_cap); 1998 *pos++ = sizeof(struct ieee80211_ht_cap);
2003 iwl4965_set_ht_capab(priv->hw, 1999 ht_cap = (struct ieee80211_ht_cap *)pos;
2004 (struct ieee80211_ht_cap *)pos, 0); 2000 ht_cap->cap_info = cpu_to_le16(sband->ht_info.cap);
2001 memcpy(ht_cap->supp_mcs_set, sband->ht_info.supp_mcs_set, 16);
2002 ht_cap->ampdu_params_info =(sband->ht_info.ampdu_factor &
2003 IEEE80211_HT_CAP_AMPDU_FACTOR) |
2004 ((sband->ht_info.ampdu_density << 2) &
2005 IEEE80211_HT_CAP_AMPDU_DENSITY);
2005 len += 2 + sizeof(struct ieee80211_ht_cap); 2006 len += 2 + sizeof(struct ieee80211_ht_cap);
2006 } 2007 }
2007#endif /*CONFIG_IWL4965_HT */ 2008#endif /*CONFIG_IWL4965_HT */
@@ -3592,8 +3593,9 @@ static int iwl4965_tx_status_reply_tx(struct iwl4965_priv *priv,
3592 tx_status->control.flags &= ~IEEE80211_TXCTL_AMPDU; 3593 tx_status->control.flags &= ~IEEE80211_TXCTL_AMPDU;
3593 tx_status->flags = iwl4965_is_tx_success(status)? 3594 tx_status->flags = iwl4965_is_tx_success(status)?
3594 IEEE80211_TX_STATUS_ACK : 0; 3595 IEEE80211_TX_STATUS_ACK : 0;
3596 /* FIXME Wrong Rate
3595 tx_status->control.tx_rate = 3597 tx_status->control.tx_rate =
3596 iwl4965_hw_get_rate_n_flags(tx_resp->rate_n_flags); 3598 iwl4965_hw_get_rate_n_flags(tx_resp->rate_n_flags); */
3597 /* FIXME: code repetition end */ 3599 /* FIXME: code repetition end */
3598 3600
3599 IWL_DEBUG_TX_REPLY("1 Frame 0x%x failure :%d\n", 3601 IWL_DEBUG_TX_REPLY("1 Frame 0x%x failure :%d\n",
@@ -5775,22 +5777,20 @@ static int iwl4965_init_geos(struct iwl4965_priv *priv)
5775 } 5777 }
5776 5778
5777 /* 5.2GHz channels start after the 2.4GHz channels */ 5779 /* 5.2GHz channels start after the 2.4GHz channels */
5778#ifdef CONFIG_IWL4965_HT
5779 iwl4965_init_ht_hw_capab(&modes[A].ht_info, MODE_IEEE80211A);
5780#endif
5781#ifdef CONFIG_IWL4965_HT
5782 iwl4965_init_ht_hw_capab(&modes[G].ht_info, MODE_IEEE80211G);
5783#endif
5784 band = &priv->bands[IEEE80211_BAND_5GHZ]; 5780 band = &priv->bands[IEEE80211_BAND_5GHZ];
5785 band->channels = &channels[ARRAY_SIZE(iwl4965_eeprom_band_1)]; 5781 band->channels = &channels[ARRAY_SIZE(iwl4965_eeprom_band_1)];
5786 band->bitrates = &rates[4]; 5782 band->bitrates = &rates[4];
5787 band->n_bitrates = 8; /* just OFDM */ 5783 band->n_bitrates = 8; /* just OFDM */
5788 5784
5785 iwl4965_init_ht_hw_capab(&band->ht_info, IEEE80211_BAND_5GHZ);
5786
5789 band = &priv->bands[IEEE80211_BAND_2GHZ]; 5787 band = &priv->bands[IEEE80211_BAND_2GHZ];
5790 band->channels = channels; 5788 band->channels = channels;
5791 band->bitrates = rates; 5789 band->bitrates = rates;
5792 band->n_bitrates = 12; /* OFDM & CCK */ 5790 band->n_bitrates = 12; /* OFDM & CCK */
5793 5791
5792 iwl4965_init_ht_hw_capab(&band->ht_info, IEEE80211_BAND_2GHZ);
5793
5794 priv->ieee_channels = channels; 5794 priv->ieee_channels = channels;
5795 priv->ieee_rates = rates; 5795 priv->ieee_rates = rates;
5796 5796
@@ -6860,8 +6860,9 @@ static void iwl4965_bg_request_scan(struct work_struct *data)
6860 int rc = 0; 6860 int rc = 0;
6861 struct iwl4965_scan_cmd *scan; 6861 struct iwl4965_scan_cmd *scan;
6862 struct ieee80211_conf *conf = NULL; 6862 struct ieee80211_conf *conf = NULL;
6863 u8 direct_mask; 6863 u16 cmd_len;
6864 enum ieee80211_band band; 6864 enum ieee80211_band band;
6865 u8 direct_mask;
6865 6866
6866 conf = ieee80211_get_hw_conf(priv->hw); 6867 conf = ieee80211_get_hw_conf(priv->hw);
6867 6868
@@ -6970,18 +6971,10 @@ static void iwl4965_bg_request_scan(struct work_struct *data)
6970 } else 6971 } else
6971 direct_mask = 0; 6972 direct_mask = 0;
6972 6973
6973 /* We don't build a direct scan probe request; the uCode will do
6974 * that based on the direct_mask added to each channel entry */
6975 scan->tx_cmd.len = cpu_to_le16(
6976 iwl4965_fill_probe_req(priv, (struct ieee80211_mgmt *)scan->data,
6977 IWL_MAX_SCAN_SIZE - sizeof(*scan), 0));
6978 scan->tx_cmd.tx_flags = TX_CMD_FLG_SEQ_CTL_MSK; 6974 scan->tx_cmd.tx_flags = TX_CMD_FLG_SEQ_CTL_MSK;
6979 scan->tx_cmd.sta_id = priv->hw_setting.bcast_sta_id; 6975 scan->tx_cmd.sta_id = priv->hw_setting.bcast_sta_id;
6980 scan->tx_cmd.stop_time.life_time = TX_CMD_LIFE_TIME_INFINITE; 6976 scan->tx_cmd.stop_time.life_time = TX_CMD_LIFE_TIME_INFINITE;
6981 6977
6982 /* flags + rate selection */
6983
6984 scan->tx_cmd.tx_flags |= cpu_to_le32(0x200);
6985 6978
6986 switch (priv->scan_bands) { 6979 switch (priv->scan_bands) {
6987 case 2: 6980 case 2:
@@ -7007,6 +7000,13 @@ static void iwl4965_bg_request_scan(struct work_struct *data)
7007 goto done; 7000 goto done;
7008 } 7001 }
7009 7002
7003 /* We don't build a direct scan probe request; the uCode will do
7004 * that based on the direct_mask added to each channel entry */
7005 cmd_len = iwl4965_fill_probe_req(priv, band,
7006 (struct ieee80211_mgmt *)scan->data,
7007 IWL_MAX_SCAN_SIZE - sizeof(*scan), 0);
7008
7009 scan->tx_cmd.len = cpu_to_le16(cmd_len);
7010 /* select Rx chains */ 7010 /* select Rx chains */
7011 7011
7012 /* Force use of chains B and C (0x6) for scan Rx. 7012 /* Force use of chains B and C (0x6) for scan Rx.
@@ -7468,10 +7468,10 @@ static int iwl4965_mac_config(struct ieee80211_hw *hw, struct ieee80211_conf *co
7468 } 7468 }
7469 7469
7470#ifdef CONFIG_IWL4965_HT 7470#ifdef CONFIG_IWL4965_HT
7471 /* if we are switching fron ht to 2.4 clear flags 7471 /* if we are switching from ht to 2.4 clear flags
7472 * from any ht related info since 2.4 does not 7472 * from any ht related info since 2.4 does not
7473 * support ht */ 7473 * support ht */
7474 if ((le16_to_cpu(priv->staging_rxon.channel) != conf->channel) 7474 if ((le16_to_cpu(priv->staging_rxon.channel) != conf->channel->hw_value)
7475#ifdef IEEE80211_CONF_CHANNEL_SWITCH 7475#ifdef IEEE80211_CONF_CHANNEL_SWITCH
7476 && !(conf->flags & IEEE80211_CONF_CHANNEL_SWITCH) 7476 && !(conf->flags & IEEE80211_CONF_CHANNEL_SWITCH)
7477#endif 7477#endif
@@ -8188,27 +8188,6 @@ static int iwl4965_mac_conf_ht(struct ieee80211_hw *hw,
8188 return 0; 8188 return 0;
8189} 8189}
8190 8190
8191static void iwl4965_set_ht_capab(struct ieee80211_hw *hw,
8192 struct ieee80211_ht_cap *ht_cap,
8193 u8 use_current_config)
8194{
8195 struct ieee80211_conf *conf = &hw->conf;
8196
8197 if (use_current_config) {
8198 ht_cap->cap_info = cpu_to_le16(conf->ht_conf.cap);
8199 memcpy(ht_cap->supp_mcs_set,
8200 conf->ht_conf.supp_mcs_set, 16);
8201 } else {
8202 ht_cap->cap_info = cpu_to_le16(mode->ht_info.cap);
8203 memcpy(ht_cap->supp_mcs_set,
8204 mode->ht_info.supp_mcs_set, 16);
8205 }
8206 ht_cap->ampdu_params_info =
8207 (mode->ht_info.ampdu_factor & IEEE80211_HT_CAP_AMPDU_FACTOR) |
8208 ((mode->ht_info.ampdu_density << 2) &
8209 IEEE80211_HT_CAP_AMPDU_DENSITY);
8210}
8211
8212#endif /*CONFIG_IWL4965_HT*/ 8191#endif /*CONFIG_IWL4965_HT*/
8213 8192
8214/***************************************************************************** 8193/*****************************************************************************