Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 172209
b: refs/heads/master
c: 0bed08d
h: refs/heads/master
i:
  172207: 0b367ad
v: v3
  • Loading branch information
Samuel Ortiz authored and John W. Linville committed Nov 28, 2009
1 parent cb056ce commit 5873e07
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fe19176ea46db572f0dc2df8bfe1dc5d8751ab9e
refs/heads/master: 0bed08de91c41b21447d704995a438d4536586ba
20 changes: 20 additions & 0 deletions trunk/drivers/net/wireless/iwmc3200wifi/eeprom.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,26 @@ int iwm_eeprom_fat_channels(struct iwm_priv *iwm)
return 0;
}

u32 iwm_eeprom_wireless_mode(struct iwm_priv *iwm)
{
u16 sku_cap;
u32 wireless_mode = 0;

sku_cap = *((u16 *)iwm_eeprom_access(iwm, IWM_EEPROM_SKU_CAP));

if (sku_cap & IWM_EEPROM_SKU_CAP_BAND_24GHZ)
wireless_mode |= WIRELESS_MODE_11G;

if (sku_cap & IWM_EEPROM_SKU_CAP_BAND_52GHZ)
wireless_mode |= WIRELESS_MODE_11A;

if (sku_cap & IWM_EEPROM_SKU_CAP_11N_ENABLE)
wireless_mode |= WIRELESS_MODE_11N;

return wireless_mode;
}


int iwm_eeprom_init(struct iwm_priv *iwm)
{
int i, ret = 0;
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/wireless/iwmc3200wifi/eeprom.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,5 +122,6 @@ int iwm_eeprom_init(struct iwm_priv *iwm);
void iwm_eeprom_exit(struct iwm_priv *iwm);
u8 *iwm_eeprom_access(struct iwm_priv *iwm, u8 eeprom_id);
int iwm_eeprom_fat_channels(struct iwm_priv *iwm);
u32 iwm_eeprom_wireless_mode(struct iwm_priv *iwm);

#endif
19 changes: 18 additions & 1 deletion trunk/drivers/net/wireless/iwmc3200wifi/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ static struct iwm_conf def_iwm_conf = {

.assoc_timeout = 2,
.roam_timeout = 10,
.wireless_mode = WIRELESS_MODE_11A | WIRELESS_MODE_11G,
.wireless_mode = WIRELESS_MODE_11A | WIRELESS_MODE_11G |
WIRELESS_MODE_11N,
.coexist_mode = COEX_MODE_CM,

/* IBSS */
Expand Down Expand Up @@ -630,6 +631,7 @@ static int __iwm_up(struct iwm_priv *iwm)
int ret;
struct iwm_notif *notif_reboot, *notif_ack = NULL;
struct wiphy *wiphy = iwm_to_wiphy(iwm);
u32 wireless_mode;

ret = iwm_bus_enable(iwm);
if (ret) {
Expand Down Expand Up @@ -697,6 +699,21 @@ static int __iwm_up(struct iwm_priv *iwm)
goto err_fw;
}

/*
* Read our SKU capabilities.
* If it's valid, we overwrite the wireless mode conf entry and the
* current profile one.
*/
wireless_mode = iwm_eeprom_wireless_mode(iwm);
if (wireless_mode) {
iwm->conf.wireless_mode = wireless_mode;
if (iwm->umac_profile)
iwm->umac_profile->wireless_mode =
iwm->conf.wireless_mode;
} else
IWM_ERR(iwm, "Wrong SKU capabilities: 0x%x\n",
*((u16 *)iwm_eeprom_access(iwm, IWM_EEPROM_SKU_CAP)));

snprintf(wiphy->fw_version, sizeof(wiphy->fw_version), "L%s_U%s",
iwm->lmac_version, iwm->umac_version);

Expand Down

0 comments on commit 5873e07

Please sign in to comment.