From 7860c0c3843dbb1cf8f4f2c20ee526e8dd2661da Mon Sep 17 00:00:00 2001 From: Adrian Chadd Date: Tue, 3 May 2016 03:31:16 +0000 Subject: [bwn] update bwn_dummy_transmission(). This is based on the b43 code. It'll be used by the upcoming 11n phy. Obtained from: Linux b43 (concept) --- sys/dev/bwn/if_bwn.c | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'sys/dev') diff --git a/sys/dev/bwn/if_bwn.c b/sys/dev/bwn/if_bwn.c index b6928c4b247c..de1bf71f2a56 100644 --- a/sys/dev/bwn/if_bwn.c +++ b/sys/dev/bwn/if_bwn.c @@ -3540,9 +3540,12 @@ bwn_dummy_transmission(struct bwn_mac *mac, int ofdm, int paon) BWN_WRITE_2(mac, 0x0568, 0x0000); BWN_WRITE_2(mac, 0x07c0, (siba_get_revid(sc->sc_dev) < 11) ? 0x0000 : 0x0100); - value = ((phy->type == BWN_PHYTYPE_A) ? 0x41 : 0x40); + + value = (ofdm ? 0x41 : 0x40); BWN_WRITE_2(mac, 0x050c, value); - if (phy->type == BWN_PHYTYPE_LP) + + if (phy->type == BWN_PHYTYPE_N || phy->type == BWN_PHYTYPE_LP || + phy->type == BWN_PHYTYPE_LCN) BWN_WRITE_2(mac, 0x0514, 0x1a02); BWN_WRITE_2(mac, 0x0508, 0x0000); BWN_WRITE_2(mac, 0x050a, 0x0000); @@ -3550,10 +3553,24 @@ bwn_dummy_transmission(struct bwn_mac *mac, int ofdm, int paon) BWN_WRITE_2(mac, 0x056a, 0x0014); BWN_WRITE_2(mac, 0x0568, 0x0826); BWN_WRITE_2(mac, 0x0500, 0x0000); - if (phy->type == BWN_PHYTYPE_LP) + + /* XXX TODO: n phy pa override? */ + + switch (phy->type) { + case BWN_PHYTYPE_N: + case BWN_PHYTYPE_LCN: + BWN_WRITE_2(mac, 0x0502, 0x00d0); + break; + case BWN_PHYTYPE_LP: BWN_WRITE_2(mac, 0x0502, 0x0050); - else + break; + default: BWN_WRITE_2(mac, 0x0502, 0x0030); + break; + } + + /* flush */ + BWN_READ_2(mac, 0x0502); if (phy->rf_ver == 0x2050 && phy->rf_rev <= 0x5) BWN_RF_WRITE(mac, 0x0051, 0x0017); -- cgit v1.2.3