Date: Fri, 6 Dec 2013 15:17:29 +0000 (UTC) From: Kevin Lo <kevlo@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259031 - head/sys/dev/usb/wlan Message-ID: <201312061517.rB6FHTOa007535@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kevlo Date: Fri Dec 6 15:17:28 2013 New Revision: 259031 URL: http://svnweb.freebsd.org/changeset/base/259031 Log: Replace the magic numbers with something more readable. Modified: head/sys/dev/usb/wlan/if_run.c head/sys/dev/usb/wlan/if_runreg.h Modified: head/sys/dev/usb/wlan/if_run.c ============================================================================== --- head/sys/dev/usb/wlan/if_run.c Fri Dec 6 15:15:58 2013 (r259030) +++ head/sys/dev/usb/wlan/if_run.c Fri Dec 6 15:17:28 2013 (r259031) @@ -4530,7 +4530,7 @@ run_rt5390_bbp_init(struct run_softc *sc /* Avoid data lost and CRC error. */ run_bbp_read(sc, 4, &bbp4); - run_bbp_write(sc, 4, bbp4 | 0x40); + run_bbp_write(sc, 4, bbp | RT5390_MAC_IF_CTRL); for (i = 0; i < nitems(rt5390_def_bbp); i++) { run_bbp_write(sc, rt5390_def_bbp[i].reg, @@ -4746,11 +4746,11 @@ run_rt5390_rf_init(struct run_softc *sc) /* Toggle RF R2 to initiate calibration. */ if (sc->mac_ver == 0x5390) { run_rt3070_rf_read(sc, 2, &rf); - run_rt3070_rf_write(sc, 2, rf | 0x80); + run_rt3070_rf_write(sc, 2, rf | RT5390_RESCAL); run_delay(sc, 10); - run_rt3070_rf_write(sc, 2, rf & ~0x80); + run_rt3070_rf_write(sc, 2, rf & ~RT5390_RESCAL); } else { - run_rt3070_rf_write(sc, 2, 0x80); + run_rt3070_rf_write(sc, 2, RT5390_RESCAL); run_delay(sc, 10); } @@ -4889,7 +4889,7 @@ run_rt3070_rf_setup(struct run_softc *sc /* Avoid data lost and CRC error. */ run_bbp_read(sc, 4, &bbp); - run_bbp_write(sc, 4, bbp | 0x40); + run_bbp_write(sc, 4, bbp | RT5390_MAC_IF_CTRL); run_rt3070_rf_read(sc, 30, &rf); rf = (rf & ~0x18) | 0x10; Modified: head/sys/dev/usb/wlan/if_runreg.h ============================================================================== --- head/sys/dev/usb/wlan/if_runreg.h Fri Dec 6 15:15:58 2013 (r259030) +++ head/sys/dev/usb/wlan/if_runreg.h Fri Dec 6 15:17:28 2013 (r259031) @@ -707,6 +707,9 @@ /* possible flags for RT3020 RF register 21 */ #define RT3070_RX_LO2 (1 << 3) +/* Possible flags for RT5390 RF register 2. */ +#define RT5390_RESCAL (1 << 7) + /* Possible flags for RT5390 RF register 3. */ #define RT5390_VCOCAL (1 << 7) @@ -716,6 +719,13 @@ /* Possible flags for RT5390 RF register 39. */ #define RT5390_RX_LO2 (1 << 7) +/* Possible flags for RT5390 BBP register 4. */ +#define RT5390_MAC_IF_CTRL (1 << 6) + +/* Possible flags for RT5390 BBP register 105. */ +#define RT5390_MLD (1 << 2) +#define RT5390_EN_SIG_MODULATION (1 << 3) + /* RT2860 TX descriptor */ struct rt2860_txd { uint32_t sdp0; /* Segment Data Pointer 0 */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201312061517.rB6FHTOa007535>