Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
[pandora-kernel.git] / drivers / net / wireless / p54 / p54common.c
index 117c7d3..6370c44 100644 (file)
@@ -306,8 +306,8 @@ static int p54_convert_rev1(struct ieee80211_hw *dev,
        return 0;
 }
 
-static const char *p54_rf_chips[] = { "NULL", "Indigo?", "Duette",
-                              "Frisbee", "Xbow", "Longbow" };
+static const char *p54_rf_chips[] = { "NULL", "Duette3", "Duette2",
+                              "Frisbee", "Xbow", "Longbow", "NULL", "NULL" };
 static int p54_init_xbow_synth(struct ieee80211_hw *dev);
 
 static int p54_parse_eeprom(struct ieee80211_hw *dev, void *eeprom, int len)
@@ -319,7 +319,7 @@ static int p54_parse_eeprom(struct ieee80211_hw *dev, void *eeprom, int len)
        void *tmp;
        int err;
        u8 *end = (u8 *)eeprom + len;
-       DECLARE_MAC_BUF(mac);
+       u16 synth = 0;
 
        wrap = (struct eeprom_pda_wrap *) eeprom;
        entry = (void *)wrap->data + le16_to_cpu(wrap->len);
@@ -400,8 +400,8 @@ static int p54_parse_eeprom(struct ieee80211_hw *dev, void *eeprom, int len)
                        tmp = entry->data;
                        while ((u8 *)tmp < entry->data + data_len) {
                                struct bootrec_exp_if *exp_if = tmp;
-                               if (le16_to_cpu(exp_if->if_id) == 0xF)
-                                       priv->rxhw = le16_to_cpu(exp_if->variant) & 0x07;
+                               if (le16_to_cpu(exp_if->if_id) == 0xf)
+                                       synth = le16_to_cpu(exp_if->variant);
                                tmp += sizeof(struct bootrec_exp_if);
                        }
                        break;
@@ -421,28 +421,20 @@ static int p54_parse_eeprom(struct ieee80211_hw *dev, void *eeprom, int len)
                entry = (void *)entry + (entry_len + 1)*2;
        }
 
-       if (!priv->iq_autocal || !priv->output_limit || !priv->curve_data) {
+       if (!synth || !priv->iq_autocal || !priv->output_limit ||
+           !priv->curve_data) {
                printk(KERN_ERR "p54: not all required entries found in eeprom!\n");
                err = -EINVAL;
                goto err;
        }
 
-       switch (priv->rxhw) {
-       case 4: /* XBow */
+       priv->rxhw = synth & 0x07;
+       if (priv->rxhw == 4)
                p54_init_xbow_synth(dev);
-       case 1: /* Indigo? */
-       case 2: /* Duette */
-               dev->wiphy->bands[IEEE80211_BAND_5GHZ] = &band_5GHz;
-       case 3: /* Frisbee */
-       case 5: /* Longbow */
+       if (!(synth & 0x40))
                dev->wiphy->bands[IEEE80211_BAND_2GHZ] = &band_2GHz;
-               break;
-       default:
-               printk(KERN_ERR "%s: unsupported RF-Chip\n",
-                       wiphy_name(dev->wiphy));
-               err = -EINVAL;
-               goto err;
-       }
+       if (!(synth & 0x80))
+               dev->wiphy->bands[IEEE80211_BAND_5GHZ] = &band_5GHz;
 
        if (!is_valid_ether_addr(dev->wiphy->perm_addr)) {
                u8 perm_addr[ETH_ALEN];
@@ -453,9 +445,9 @@ static int p54_parse_eeprom(struct ieee80211_hw *dev, void *eeprom, int len)
                SET_IEEE80211_PERM_ADDR(dev, perm_addr);
        }
 
-       printk(KERN_INFO "%s: hwaddr %s, MAC:isl38%02x RF:%s\n",
+       printk(KERN_INFO "%s: hwaddr %pM, MAC:isl38%02x RF:%s\n",
                wiphy_name(dev->wiphy),
-               print_mac(mac, dev->wiphy->perm_addr),
+               dev->wiphy->perm_addr,
                priv->version, p54_rf_chips[priv->rxhw]);
 
        return 0;