if_bwn_phy_common.c (300186) | if_bwn_phy_common.c (300549) |
---|---|
1/*- 2 * Copyright (c) 2009-2010 Weongyo Jeong <weongyo@freebsd.org> 3 * Copyright (c) 2016 Adrian Chadd <adrian@freebsd.org> 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 15 unchanged lines hidden (view full) --- 24 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 26 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 28 * THE POSSIBILITY OF SUCH DAMAGES. 29 */ 30 31#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2009-2010 Weongyo Jeong <weongyo@freebsd.org> 3 * Copyright (c) 2016 Adrian Chadd <adrian@freebsd.org> 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 15 unchanged lines hidden (view full) --- 24 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 26 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 28 * THE POSSIBILITY OF SUCH DAMAGES. 29 */ 30 31#include <sys/cdefs.h> |
32__FBSDID("$FreeBSD: head/sys/dev/bwn/if_bwn_phy_common.c 300186 2016-05-19 04:22:58Z adrian $"); | 32__FBSDID("$FreeBSD: head/sys/dev/bwn/if_bwn_phy_common.c 300549 2016-05-24 01:20:30Z adrian $"); |
33 34#include "opt_bwn.h" 35#include "opt_wlan.h" 36 37/* 38 * The Broadcom Wireless LAN controller driver. 39 */ 40 --- 111 unchanged lines hidden (view full) --- 152 /* XXX bhnd bus */ 153 if (bwn_is_bus_siba(mac)) { 154 tmp = siba_read_4(sc->sc_dev, SIBA_TGSLOW); 155 if (force) 156 tmp |= SIBA_TGSLOW_FGC; 157 else 158 tmp &= ~SIBA_TGSLOW_FGC; 159 siba_write_4(sc->sc_dev, SIBA_TGSLOW, tmp); | 33 34#include "opt_bwn.h" 35#include "opt_wlan.h" 36 37/* 38 * The Broadcom Wireless LAN controller driver. 39 */ 40 --- 111 unchanged lines hidden (view full) --- 152 /* XXX bhnd bus */ 153 if (bwn_is_bus_siba(mac)) { 154 tmp = siba_read_4(sc->sc_dev, SIBA_TGSLOW); 155 if (force) 156 tmp |= SIBA_TGSLOW_FGC; 157 else 158 tmp &= ~SIBA_TGSLOW_FGC; 159 siba_write_4(sc->sc_dev, SIBA_TGSLOW, tmp); |
160 } else { 161 BWN_ERRPRINTF(sc, "%s: unknown bus!\n", __func__); |
|
160 } 161} 162 163int 164bwn_radio_wait_value(struct bwn_mac *mac, uint16_t offset, uint16_t mask, 165 uint16_t value, int delay, int timeout) 166{ 167 uint16_t val; --- 17 unchanged lines hidden (view full) --- 185 /* XXX bhnd bus */ 186 if (bwn_is_bus_siba(mac)) { 187 val = siba_read_4(sc->sc_dev, SIBA_TGSLOW); 188 if (enabled) 189 val |= BWN_TGSLOW_MACPHYCLKEN; 190 else 191 val &= ~BWN_TGSLOW_MACPHYCLKEN; 192 siba_write_4(sc->sc_dev, SIBA_TGSLOW, val); | 162 } 163} 164 165int 166bwn_radio_wait_value(struct bwn_mac *mac, uint16_t offset, uint16_t mask, 167 uint16_t value, int delay, int timeout) 168{ 169 uint16_t val; --- 17 unchanged lines hidden (view full) --- 187 /* XXX bhnd bus */ 188 if (bwn_is_bus_siba(mac)) { 189 val = siba_read_4(sc->sc_dev, SIBA_TGSLOW); 190 if (enabled) 191 val |= BWN_TGSLOW_MACPHYCLKEN; 192 else 193 val &= ~BWN_TGSLOW_MACPHYCLKEN; 194 siba_write_4(sc->sc_dev, SIBA_TGSLOW, val); |
195 } else { 196 BWN_ERRPRINTF(sc, "%s: unknown bus!\n", __func__); |
|
193 } 194} 195 196/* http://bcm-v4.sipsolutions.net/802.11/PHY/BmacCorePllReset */ 197void 198bwn_wireless_core_phy_pll_reset(struct bwn_mac *mac) 199{ 200 struct bwn_softc *sc = mac->mac_sc; 201 202 /* XXX bhnd bus */ 203 if (bwn_is_bus_siba(mac)) { 204 siba_cc_write32(sc->sc_dev, SIBA_CC_CHIPCTL_ADDR, 0); 205 siba_cc_mask32(sc->sc_dev, SIBA_CC_CHIPCTL_DATA, ~0x4); 206 siba_cc_set32(sc->sc_dev, SIBA_CC_CHIPCTL_DATA, 0x4); 207 siba_cc_mask32(sc->sc_dev, SIBA_CC_CHIPCTL_DATA, ~0x4); | 197 } 198} 199 200/* http://bcm-v4.sipsolutions.net/802.11/PHY/BmacCorePllReset */ 201void 202bwn_wireless_core_phy_pll_reset(struct bwn_mac *mac) 203{ 204 struct bwn_softc *sc = mac->mac_sc; 205 206 /* XXX bhnd bus */ 207 if (bwn_is_bus_siba(mac)) { 208 siba_cc_write32(sc->sc_dev, SIBA_CC_CHIPCTL_ADDR, 0); 209 siba_cc_mask32(sc->sc_dev, SIBA_CC_CHIPCTL_DATA, ~0x4); 210 siba_cc_set32(sc->sc_dev, SIBA_CC_CHIPCTL_DATA, 0x4); 211 siba_cc_mask32(sc->sc_dev, SIBA_CC_CHIPCTL_DATA, ~0x4); |
212 } else { 213 BWN_ERRPRINTF(sc, "%s: unknown bus!\n", __func__); |
|
208 } 209} | 214 } 215} |