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