if_bwn_phy_common.c (299984) | if_bwn_phy_common.c (300186) |
---|---|
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 299984 2016-05-16 22:56:45Z adrian $"); | 32__FBSDID("$FreeBSD: head/sys/dev/bwn/if_bwn_phy_common.c 300186 2016-05-19 04:22:58Z adrian $"); |
33 34#include "opt_bwn.h" 35#include "opt_wlan.h" 36 37/* 38 * The Broadcom Wireless LAN controller driver. 39 */ 40 --- 140 unchanged lines hidden (view full) --- 181{ 182 struct bwn_softc *sc = mac->mac_sc; 183 uint32_t val; 184 185 /* XXX bhnd bus */ 186 if (bwn_is_bus_siba(mac)) { 187 val = siba_read_4(sc->sc_dev, SIBA_TGSLOW); 188 if (enabled) | 33 34#include "opt_bwn.h" 35#include "opt_wlan.h" 36 37/* 38 * The Broadcom Wireless LAN controller driver. 39 */ 40 --- 140 unchanged lines hidden (view full) --- 181{ 182 struct bwn_softc *sc = mac->mac_sc; 183 uint32_t val; 184 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_TMSLOW_MACPHYCLKEN; | 189 val |= BWN_TGSLOW_MACPHYCLKEN; |
190 else | 190 else |
191 val &= ~BWN_TMSLOW_MACPHYCLKEN; | 191 val &= ~BWN_TGSLOW_MACPHYCLKEN; |
192 siba_write_4(sc->sc_dev, SIBA_TGSLOW, val); 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); 208 } 209} | 192 siba_write_4(sc->sc_dev, SIBA_TGSLOW, val); 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); 208 } 209} |