diff options
author | Samuel Ortiz <sameo@linux.intel.com> | 2009-11-23 22:33:29 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-11-28 15:04:42 -0500 |
commit | 0bed08de91c41b21447d704995a438d4536586ba (patch) | |
tree | 501f281d2023011835d4b74b90b07f371dc66f63 /drivers/net/wireless | |
parent | fe19176ea46db572f0dc2df8bfe1dc5d8751ab9e (diff) |
iwmc3200wifi: Update wireless_mode with eeprom values
The iwmc3200wifi eeprom contains information about the available PHYs on
the chip. We should update our wireless_mode setting and profile according
to it.
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/iwmc3200wifi/eeprom.c | 20 | ||||
-rw-r--r-- | drivers/net/wireless/iwmc3200wifi/eeprom.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/iwmc3200wifi/main.c | 19 |
3 files changed, 39 insertions, 1 deletions
diff --git a/drivers/net/wireless/iwmc3200wifi/eeprom.c b/drivers/net/wireless/iwmc3200wifi/eeprom.c index c574f58dfb20..8091421ee5e5 100644 --- a/drivers/net/wireless/iwmc3200wifi/eeprom.c +++ b/drivers/net/wireless/iwmc3200wifi/eeprom.c | |||
@@ -176,6 +176,26 @@ int iwm_eeprom_fat_channels(struct iwm_priv *iwm) | |||
176 | return 0; | 176 | return 0; |
177 | } | 177 | } |
178 | 178 | ||
179 | u32 iwm_eeprom_wireless_mode(struct iwm_priv *iwm) | ||
180 | { | ||
181 | u16 sku_cap; | ||
182 | u32 wireless_mode = 0; | ||
183 | |||
184 | sku_cap = *((u16 *)iwm_eeprom_access(iwm, IWM_EEPROM_SKU_CAP)); | ||
185 | |||
186 | if (sku_cap & IWM_EEPROM_SKU_CAP_BAND_24GHZ) | ||
187 | wireless_mode |= WIRELESS_MODE_11G; | ||
188 | |||
189 | if (sku_cap & IWM_EEPROM_SKU_CAP_BAND_52GHZ) | ||
190 | wireless_mode |= WIRELESS_MODE_11A; | ||
191 | |||
192 | if (sku_cap & IWM_EEPROM_SKU_CAP_11N_ENABLE) | ||
193 | wireless_mode |= WIRELESS_MODE_11N; | ||
194 | |||
195 | return wireless_mode; | ||
196 | } | ||
197 | |||
198 | |||
179 | int iwm_eeprom_init(struct iwm_priv *iwm) | 199 | int iwm_eeprom_init(struct iwm_priv *iwm) |
180 | { | 200 | { |
181 | int i, ret = 0; | 201 | int i, ret = 0; |
diff --git a/drivers/net/wireless/iwmc3200wifi/eeprom.h b/drivers/net/wireless/iwmc3200wifi/eeprom.h index 0f7f226916cf..4e3a3fdab0d3 100644 --- a/drivers/net/wireless/iwmc3200wifi/eeprom.h +++ b/drivers/net/wireless/iwmc3200wifi/eeprom.h | |||
@@ -122,5 +122,6 @@ int iwm_eeprom_init(struct iwm_priv *iwm); | |||
122 | void iwm_eeprom_exit(struct iwm_priv *iwm); | 122 | void iwm_eeprom_exit(struct iwm_priv *iwm); |
123 | u8 *iwm_eeprom_access(struct iwm_priv *iwm, u8 eeprom_id); | 123 | u8 *iwm_eeprom_access(struct iwm_priv *iwm, u8 eeprom_id); |
124 | int iwm_eeprom_fat_channels(struct iwm_priv *iwm); | 124 | int iwm_eeprom_fat_channels(struct iwm_priv *iwm); |
125 | u32 iwm_eeprom_wireless_mode(struct iwm_priv *iwm); | ||
125 | 126 | ||
126 | #endif | 127 | #endif |
diff --git a/drivers/net/wireless/iwmc3200wifi/main.c b/drivers/net/wireless/iwmc3200wifi/main.c index 365f3fc37d25..e61265af92cd 100644 --- a/drivers/net/wireless/iwmc3200wifi/main.c +++ b/drivers/net/wireless/iwmc3200wifi/main.c | |||
@@ -80,7 +80,8 @@ static struct iwm_conf def_iwm_conf = { | |||
80 | 80 | ||
81 | .assoc_timeout = 2, | 81 | .assoc_timeout = 2, |
82 | .roam_timeout = 10, | 82 | .roam_timeout = 10, |
83 | .wireless_mode = WIRELESS_MODE_11A | WIRELESS_MODE_11G, | 83 | .wireless_mode = WIRELESS_MODE_11A | WIRELESS_MODE_11G | |
84 | WIRELESS_MODE_11N, | ||
84 | .coexist_mode = COEX_MODE_CM, | 85 | .coexist_mode = COEX_MODE_CM, |
85 | 86 | ||
86 | /* IBSS */ | 87 | /* IBSS */ |
@@ -630,6 +631,7 @@ static int __iwm_up(struct iwm_priv *iwm) | |||
630 | int ret; | 631 | int ret; |
631 | struct iwm_notif *notif_reboot, *notif_ack = NULL; | 632 | struct iwm_notif *notif_reboot, *notif_ack = NULL; |
632 | struct wiphy *wiphy = iwm_to_wiphy(iwm); | 633 | struct wiphy *wiphy = iwm_to_wiphy(iwm); |
634 | u32 wireless_mode; | ||
633 | 635 | ||
634 | ret = iwm_bus_enable(iwm); | 636 | ret = iwm_bus_enable(iwm); |
635 | if (ret) { | 637 | if (ret) { |
@@ -697,6 +699,21 @@ static int __iwm_up(struct iwm_priv *iwm) | |||
697 | goto err_fw; | 699 | goto err_fw; |
698 | } | 700 | } |
699 | 701 | ||
702 | /* | ||
703 | * Read our SKU capabilities. | ||
704 | * If it's valid, we overwrite the wireless mode conf entry and the | ||
705 | * current profile one. | ||
706 | */ | ||
707 | wireless_mode = iwm_eeprom_wireless_mode(iwm); | ||
708 | if (wireless_mode) { | ||
709 | iwm->conf.wireless_mode = wireless_mode; | ||
710 | if (iwm->umac_profile) | ||
711 | iwm->umac_profile->wireless_mode = | ||
712 | iwm->conf.wireless_mode; | ||
713 | } else | ||
714 | IWM_ERR(iwm, "Wrong SKU capabilities: 0x%x\n", | ||
715 | *((u16 *)iwm_eeprom_access(iwm, IWM_EEPROM_SKU_CAP))); | ||
716 | |||
700 | snprintf(wiphy->fw_version, sizeof(wiphy->fw_version), "L%s_U%s", | 717 | snprintf(wiphy->fw_version, sizeof(wiphy->fw_version), "L%s_U%s", |
701 | iwm->lmac_version, iwm->umac_version); | 718 | iwm->lmac_version, iwm->umac_version); |
702 | 719 | ||