Skip to contentSkip to conversation

ar9170: use eeprom's frequency calibration values

RFT Christian Lamparter 3 participants 7 messages Aug 21, 2009 – Aug 29, 2009

lore
Share & tools
lore
#0 lore raw

This patch adds some more bits from the vendor driver, which are supposed to help users with the one-stage/openfw firmwares.

Unfortunately, my device (WNDA3100) still doesn't work properly with either version at phy-rates beyond the magic 18MBit barrier.
---
Johannes, in phy.c (now at line) line 429

int ar9170_init_phy(struct ar9170 *ar, enum ieee80211_band band) {
[...]

        /* XXX: use EEPROM data here! */

        err = ar9170_init_power_cal(ar);
        if (err)

[...]
}

do you still know what EEPROM data is missing here?
---

drivers/net/wireless/ath/ar9170/eeprom.h +2 -1
index d2c8cc8..b6af8b4 100644
@@ -150,7 +150,8 @@ struct ar9170_eeprom {
 	u8	cal_freq_pier_2G[AR5416_NUM_2G_CAL_PIERS];
 
 	struct ar9170_calibration_data_per_freq
-		cal_pier_data_5G[AR5416_MAX_CHAINS][AR5416_NUM_5G_CAL_PIERS],
+		cal_pier_data_5G[AR5416_MAX_CHAINS][AR5416_NUM_5G_CAL_PIERS];
+	struct ar9170_calibration_data_per_freq
 		cal_pier_data_2G[AR5416_MAX_CHAINS][AR5416_NUM_2G_CAL_PIERS];
 
 	/* power calibration data */
drivers/net/wireless/ath/ar9170/main.c +1 -0
index 658b323..ecdf1b9 100644
@@ -1387,6 +1387,7 @@ static int ar9170_tx_prepare(struct ar9170 *ar, struct sk_buff *skb)
 
 	txc->mac_control = cpu_to_le16(AR9170_TX_MAC_HW_DURATION |
 				       AR9170_TX_MAC_BACKOFF);
+
 	txc->mac_control |= cpu_to_le16(ar9170_qos_hwmap[queue] <<
 					AR9170_TX_MAC_QOS_SHIFT);
 	txc->mac_control |= cpu_to_le16(keytype);
drivers/net/wireless/ath/ar9170/phy.c +107 -2

133 lines not on this page · raw message

#1 lore raw
Quoted 2 lines · Christian Lamparter

This patch adds some more bits from the vendor driver, which are supposed to help users with the one-stage/openfw firmwares.

The otus driver sets phy registers 672-703 only for the one-stage firmware - hal/hpmain.c, line 3445:

        #ifndef ZM_OTUS_LINUX_PHASE_2
        reg_write(regAddr + i, val);  /* CR672 */
        #endif

Are you sure it doesn't hurt with the two-stage firmware?

Jörg

#2 lore raw
Quoted 4 lines · On Saturday 22 August 2009 01:36:17 Joerg Albert wrote:
Quoted 2 lines · Christian Lamparter

This patch adds some more bits from the vendor driver, which are supposed to help users with the one-stage/openfw firmwares.

Quoted 8 lines

The otus driver sets phy registers 672-703 only for the one-stage firmware - hal/hpmain.c, line 3445:

        #ifndef ZM_OTUS_LINUX_PHASE_2
        reg_write(regAddr + i, val);  /* CR672 */
        #endif

Are you sure it doesn't hurt with the two-stage firmware?

no idea, that's why I ask requested input, instead of posting a patch + sob right away.

so far, I haven't heard of or experienced any regressions or anomalies. Do you already have comments or complains? :)

Regards,
Chr

#3 lore raw
Quoted 11 lines · Christian Lamparter
Quoted 10 lines · On Saturday 22 August 2009 01:36:17 Joerg Albert wrote:
Quoted 2 lines · Christian Lamparter

This patch adds some more bits from the vendor driver, which are supposed to help users with the one-stage/openfw firmwares.

The otus driver sets phy registers 672-703 only for the one-stage firmware - hal/hpmain.c, line 3445:

        #ifndef ZM_OTUS_LINUX_PHASE_2
        reg_write(regAddr + i, val);  /* CR672 */
        #endif
Quoted 6 lines
Quoted 1 line

Are you sure it doesn't hurt with the two-stage firmware?

no idea, that's why I ask requested input, instead of posting a patch + sob right away.

so far, I haven't heard of or experienced any regressions or anomalies. Do you already have comments or complains? :)

Your patch works fine here with a WNDA3100, using the two-stage firmware, against a 802.11g AP. After "iwconfig wlan1 rate 54M" I get approx. 22 MBit/s throughput with iperf, same as without the patch.

Quoted 2 lines

Unfortunately, my device (WNDA3100) still doesn't work properly with either version at phy-rates beyond the magic 18MBit barrier.

Strange, same device here (or another hw version? FCC ID: PY307300073) and I see packets @ 54M from the dev in the sniffer. But it also has the invalid regdomain 0x8000 in the eeprom ...

With the one-stage firmware and without your patch my device doesn't associate with the AP, seems like no packets are sent. So I can't test your patch with the one-stage fw. Same result with a AVM Fritz stick.
I'll look into bisecting.

Regards,
Joerg.

#4 lore raw
Quoted 16 lines · On Saturday 22 August 2009 23:03:39 Joerg Albert wrote:
Quoted 15 lines · Christian Lamparter
Quoted 11 lines · On Saturday 22 August 2009 01:36:17 Joerg Albert wrote:
Quoted 2 lines · Christian Lamparter

This patch adds some more bits from the vendor driver, which are supposed to help users with the one-stage/openfw firmwares.

The otus driver sets phy registers 672-703 only for the one-stage firmware - hal/hpmain.c, line 3445:

        #ifndef ZM_OTUS_LINUX_PHASE_2
        reg_write(regAddr + i, val);  /* CR672 */
        #endif

Are you sure it doesn't hurt with the two-stage firmware?

no idea, that's why I ask requested input, instead of posting a patch + sob right away.

Quoted 6 lines
Quoted 2 lines

so far, I haven't heard of or experienced any regressions or anomalies. Do you already have comments or complains? :)

Your patch works fine here with a WNDA3100, using the two-stage firmware, against a 802.11g AP. After "iwconfig wlan1 rate 54M" I get approx. 22 MBit/s throughput with iperf, same as without the patch.

same here... and not really surprising. According to my sources, the two-stage firmware is capable of doing calibration without extra help from the host.

Quoted 6 lines
Quoted 2 lines

Unfortunately, my device (WNDA3100) still doesn't work properly with either version at phy-rates beyond the magic 18MBit barrier.

Strange, same device here (or another hw version? FCC ID: PY307300073) and I see packets @ 54M from the dev in the sniffer. But it also has the invalid regdomain 0x8000 in the eeprom ...

that comment about "18mbit barrier" is only true for the one-stage fw. I've no problem getting up and slightly above 80mbits with the original two-stage fw.

Regards,
Chr

#5 lore raw
In reply to Christian Lamparter
Quoted 5 lines · Christian Lamparter

Johannes, in phy.c (now at line) line 429

int ar9170_init_phy(struct ar9170 *ar, enum ieee80211_band band) {
[...]

Quoted 8 lines
        /* XXX: use EEPROM data here! */

        err = ar9170_init_power_cal(ar);
        if (err)

[...]
}

do you still know what EEPROM data is missing here?

Sorry, no, I don't remember, and can't seem to find it either in otus right now.

johannes

#6 lore raw
Quoted 14 lines · Johannes Berg
Quoted 12 lines · Christian Lamparter

Johannes, in phy.c (now at line) line 429

int ar9170_init_phy(struct ar9170 *ar, enum ieee80211_band band) {
[...]

        /* XXX: use EEPROM data here! */

        err = ar9170_init_power_cal(ar);
        if (err)

[...]
}

Quoted 4 lines
Quoted 1 line

do you still know what EEPROM data is missing here?

Sorry, no, I don't remember, and can't seem to find it either in otus right now.

Maybe this refers to the values in eepromBoardData initialized from the eeprom in otus/hal/hpmain.c, lines 522 ff. and written into the registers in line 828?

I guess they should come from the modal_header[] in struct ar9170_eeprom, but I cannot map the offset in hpmain.c for hpPriv->eepromImage[] into the modal_header's members.

Regards,
Joerg