Date: Fri, 6 Nov 2015 11:29:24 +0000 (UTC) From: Andriy Voskoboinyk <avos@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290439 - head/sys/dev/usb/wlan Message-ID: <201511061129.tA6BTOiB081087@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: avos Date: Fri Nov 6 11:29:24 2015 New Revision: 290439 URL: https://svnweb.freebsd.org/changeset/base/290439 Log: urtwn(4): simplify urtwn_tsf_sync_enable(). - Drop TSF initialization; device can discover it without our help. - Do not touch R92C_BCN_CTRL_EN_BCN bit in STA mode. - Add 'static' keyword for function definition. Tested with RTL8188EU, STA mode. Reviewed by: kevlo Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D3801 Modified: head/sys/dev/usb/wlan/if_urtwn.c Modified: head/sys/dev/usb/wlan/if_urtwn.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtwn.c Fri Nov 6 11:17:23 2015 (r290438) +++ head/sys/dev/usb/wlan/if_urtwn.c Fri Nov 6 11:29:24 2015 (r290439) @@ -1473,32 +1473,11 @@ urtwn_ra_init(struct urtwn_softc *sc) return (0); } -void +static void urtwn_tsf_sync_enable(struct urtwn_softc *sc) { - struct ieee80211com *ic = &sc->sc_ic; - struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); - struct ieee80211_node *ni = vap->iv_bss; - - uint64_t tsf; - - /* Enable TSF synchronization. */ urtwn_write_1(sc, R92C_BCN_CTRL, urtwn_read_1(sc, R92C_BCN_CTRL) & ~R92C_BCN_CTRL_DIS_TSF_UDT0); - - urtwn_write_1(sc, R92C_BCN_CTRL, - urtwn_read_1(sc, R92C_BCN_CTRL) & ~R92C_BCN_CTRL_EN_BCN); - - /* Set initial TSF. */ - memcpy(&tsf, ni->ni_tstamp.data, 8); - tsf = le64toh(tsf); - tsf = tsf - (tsf % (vap->iv_bss->ni_intval * IEEE80211_DUR_TU)); - tsf -= IEEE80211_DUR_TU; - urtwn_write_4(sc, R92C_TSFTR + 0, tsf); - urtwn_write_4(sc, R92C_TSFTR + 4, tsf >> 32); - - urtwn_write_1(sc, R92C_BCN_CTRL, - urtwn_read_1(sc, R92C_BCN_CTRL) | R92C_BCN_CTRL_EN_BCN); } static void
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201511061129.tA6BTOiB081087>