p54: enable 2.4/5GHz spectrum by eeprom bits.

Badness at /home/proski/src/linux-2.6/net/mac80211/rx.c:2200
NIP: c02bc850 LR: c02ab268 CTR: 00000000
REGS: ef01fcc0 TRAP: 0700 Tainted: G W (2.6.27-wl)
MSR: 00029032 <EE,ME,IR,DR> CR: 22004084 XER: 20000000
TASK = c1a58800[1778] 'p54pci' THREAD: ef01e000
[...]
NIP [c02bc850] __ieee80211_rx+0x17c/0x638
LR [c02ab268] ieee80211_tasklet_handler+0x104/0x120
Call Trace:
[ef01fd70] [c1a0c020] 0xc1a0c020 (unreliable)
[ef01fdb0] [c02ab268] ieee80211_tasklet_handler+0x104/0x120
[...]

the problem was that some older cards are mis-identified and didn't support
5GHz rates, while they have the right MAC & Synth chip.

This patch changes the way how p54 decides if it should enable 11a channels
or not.

Reported-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>

authored by

Christian Lamparter and committed by
John W. Linville
4cc683c9 70458259

+10 -18
+10 -18
drivers/net/wireless/p54/p54common.c
··· 306 306 return 0; 307 307 } 308 308 309 - static const char *p54_rf_chips[] = { "NULL", "Indigo?", "Duette", 310 - "Frisbee", "Xbow", "Longbow" }; 309 + static const char *p54_rf_chips[] = { "NULL", "Duette3", "Duette2", 310 + "Frisbee", "Xbow", "Longbow", "NULL", "NULL" }; 311 311 static int p54_init_xbow_synth(struct ieee80211_hw *dev); 312 312 313 313 static int p54_parse_eeprom(struct ieee80211_hw *dev, void *eeprom, int len) ··· 319 319 void *tmp; 320 320 int err; 321 321 u8 *end = (u8 *)eeprom + len; 322 + u16 synth; 322 323 DECLARE_MAC_BUF(mac); 323 324 324 325 wrap = (struct eeprom_pda_wrap *) eeprom; ··· 401 400 tmp = entry->data; 402 401 while ((u8 *)tmp < entry->data + data_len) { 403 402 struct bootrec_exp_if *exp_if = tmp; 404 - if (le16_to_cpu(exp_if->if_id) == 0xF) 405 - priv->rxhw = le16_to_cpu(exp_if->variant) & 0x07; 403 + if (le16_to_cpu(exp_if->if_id) == 0xf) 404 + synth = le16_to_cpu(exp_if->variant); 406 405 tmp += sizeof(struct bootrec_exp_if); 407 406 } 408 407 break; ··· 428 427 goto err; 429 428 } 430 429 431 - switch (priv->rxhw) { 432 - case 4: /* XBow */ 430 + priv->rxhw = synth & 0x07; 431 + if (priv->rxhw == 4) 433 432 p54_init_xbow_synth(dev); 434 - case 1: /* Indigo? */ 435 - case 2: /* Duette */ 436 - dev->wiphy->bands[IEEE80211_BAND_5GHZ] = &band_5GHz; 437 - case 3: /* Frisbee */ 438 - case 5: /* Longbow */ 433 + if (!(synth & 0x40)) 439 434 dev->wiphy->bands[IEEE80211_BAND_2GHZ] = &band_2GHz; 440 - break; 441 - default: 442 - printk(KERN_ERR "%s: unsupported RF-Chip\n", 443 - wiphy_name(dev->wiphy)); 444 - err = -EINVAL; 445 - goto err; 446 - } 435 + if (!(synth & 0x80)) 436 + dev->wiphy->bands[IEEE80211_BAND_5GHZ] = &band_5GHz; 447 437 448 438 if (!is_valid_ether_addr(dev->wiphy->perm_addr)) { 449 439 u8 perm_addr[ETH_ALEN];