]> err.no Git - linux-2.6/blobdiff - drivers/net/wireless/bcm43xx/bcm43xx_phy.c
[PATCH] bcm43xx: heavily increase mac_suspend timeout.
[linux-2.6] / drivers / net / wireless / bcm43xx / bcm43xx_phy.c
index 41b9cd7fc9e27c144147d73549d1073fe70c1cf1..d3c2fc1df375c8b7c991929a139f78a9dc41acf7 100644 (file)
@@ -947,7 +947,7 @@ static void bcm43xx_phy_initb6(struct bcm43xx_private *bcm)
        bcm43xx_radio_write16(bcm, 0x0050, 0x0020);
        if ((bcm->current_core->radio->manufact == 0x17F) &&
            (bcm->current_core->radio->version == 0x2050) &&
-           (bcm->current_core->radio->revision == 2)) {
+           (bcm->current_core->radio->revision <= 2)) {
                bcm43xx_radio_write16(bcm, 0x0050, 0x0020);
                bcm43xx_radio_write16(bcm, 0x005A, 0x0070);
                bcm43xx_radio_write16(bcm, 0x005B, 0x007B);
@@ -984,10 +984,15 @@ static void bcm43xx_phy_initb6(struct bcm43xx_private *bcm)
                bcm43xx_write16(bcm, 0x03E4, 0x0009);
        if (phy->type == BCM43xx_PHYTYPE_B) {
                bcm43xx_write16(bcm, 0x03E6, 0x8140);
-               bcm43xx_phy_write(bcm, 0x0016, 0x5410);
-               bcm43xx_phy_write(bcm, 0x0017, 0xA820);
-               bcm43xx_phy_write(bcm, 0x0007, 0x0062);
-               TODO();//TODO: calibrate stuff.
+               bcm43xx_phy_write(bcm, 0x0016, 0x0410);
+               bcm43xx_phy_write(bcm, 0x0017, 0x0820);
+               bcm43xx_phy_write(bcm, 0x0062, 0x0007);
+               (void) bcm43xx_radio_calibrationvalue(bcm);
+               bcm43xx_phy_lo_b_measure(bcm);
+               if (bcm->sprom.boardflags & BCM43xx_BFL_RSSI) {
+                       bcm43xx_calc_nrssi_slope(bcm);
+                       bcm43xx_calc_nrssi_threshold(bcm);
+               }
                bcm43xx_phy_init_pctl(bcm);
        } else
                bcm43xx_write16(bcm, 0x03E6, 0x0);
@@ -1161,7 +1166,7 @@ void bcm43xx_phy_lo_b_measure(struct bcm43xx_private *bcm)
        phy->minlowsigpos[1] += 0x0101;
 
        bcm43xx_phy_write(bcm, 0x002F, phy->minlowsigpos[1]);
-       if (radio->version == 2053) {
+       if (radio->version == 0x2053) {
                bcm43xx_phy_write(bcm, 0x000A, regstack[2]);
                bcm43xx_phy_write(bcm, 0x002A, regstack[3]);
                bcm43xx_phy_write(bcm, 0x0035, regstack[4]);
@@ -1763,14 +1768,9 @@ void bcm43xx_phy_xmitpower(struct bcm43xx_private *bcm)
                        where REG is the max power as per the regulatory domain
                */
 
-               /*TODO: Get desired_pwr from wx_handlers or the stack
-               limit_value(desired_pwr, 0, max_pwr);
-               */
-
-               desired_pwr = max_pwr; /* remove this when we have a real desired_pwr */
-
+               desired_pwr = limit_value(radio->txpower_desired, 0, max_pwr);
+               /* Check if we need to adjust the current power. */
                pwr_adjust = desired_pwr - estimated_pwr;
-
                radio_att_delta = -(pwr_adjust + 7) >> 3;
                baseband_att_delta = -(pwr_adjust >> 1) - (4 * radio_att_delta);
                if ((radio_att_delta == 0) && (baseband_att_delta == 0)) {