if_bwn.c (299792) | if_bwn.c (299793) |
---|---|
1/*- 2 * Copyright (c) 2009-2010 Weongyo Jeong <weongyo@freebsd.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 14 unchanged lines hidden (view full) --- 23 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 25 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 27 * THE POSSIBILITY OF SUCH DAMAGES. 28 */ 29 30#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2009-2010 Weongyo Jeong <weongyo@freebsd.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 14 unchanged lines hidden (view full) --- 23 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 25 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 27 * THE POSSIBILITY OF SUCH DAMAGES. 28 */ 29 30#include <sys/cdefs.h> |
31__FBSDID("$FreeBSD: head/sys/dev/bwn/if_bwn.c 299792 2016-05-14 23:41:28Z adrian $"); | 31__FBSDID("$FreeBSD: head/sys/dev/bwn/if_bwn.c 299793 2016-05-14 23:42:37Z adrian $"); |
32 33/* 34 * The Broadcom Wireless LAN controller driver. 35 */ 36 37#include <sys/param.h> 38#include <sys/systm.h> 39#include <sys/kernel.h> --- 1834 unchanged lines hidden (view full) --- 1874static int 1875bwn_init(struct bwn_softc *sc) 1876{ 1877 struct bwn_mac *mac; 1878 int error; 1879 1880 BWN_ASSERT_LOCKED(sc); 1881 | 32 33/* 34 * The Broadcom Wireless LAN controller driver. 35 */ 36 37#include <sys/param.h> 38#include <sys/systm.h> 39#include <sys/kernel.h> --- 1834 unchanged lines hidden (view full) --- 1874static int 1875bwn_init(struct bwn_softc *sc) 1876{ 1877 struct bwn_mac *mac; 1878 int error; 1879 1880 BWN_ASSERT_LOCKED(sc); 1881 |
1882 DPRINTF(sc, BWN_DEBUG_RESET, "%s: called\n", __func__); 1883 |
|
1882 bzero(sc->sc_bssid, IEEE80211_ADDR_LEN); 1883 sc->sc_flags |= BWN_FLAG_NEED_BEACON_TP; 1884 sc->sc_filters = 0; 1885 bwn_wme_clear(sc); 1886 sc->sc_beacons[0] = sc->sc_beacons[1] = 0; 1887 sc->sc_rf_enabled = 1; 1888 1889 mac = sc->sc_curmac; --- 19 unchanged lines hidden (view full) --- 1909 1910static void 1911bwn_stop(struct bwn_softc *sc) 1912{ 1913 struct bwn_mac *mac = sc->sc_curmac; 1914 1915 BWN_ASSERT_LOCKED(sc); 1916 | 1884 bzero(sc->sc_bssid, IEEE80211_ADDR_LEN); 1885 sc->sc_flags |= BWN_FLAG_NEED_BEACON_TP; 1886 sc->sc_filters = 0; 1887 bwn_wme_clear(sc); 1888 sc->sc_beacons[0] = sc->sc_beacons[1] = 0; 1889 sc->sc_rf_enabled = 1; 1890 1891 mac = sc->sc_curmac; --- 19 unchanged lines hidden (view full) --- 1911 1912static void 1913bwn_stop(struct bwn_softc *sc) 1914{ 1915 struct bwn_mac *mac = sc->sc_curmac; 1916 1917 BWN_ASSERT_LOCKED(sc); 1918 |
1919 DPRINTF(sc, BWN_DEBUG_RESET, "%s: called\n", __func__); 1920 |
|
1917 if (mac->mac_status >= BWN_MAC_STATUS_INITED) { 1918 /* XXX FIXME opmode not based on VAP */ 1919 bwn_set_opmode(mac); 1920 bwn_set_macaddr(mac); 1921 } 1922 1923 if (mac->mac_status >= BWN_MAC_STATUS_STARTED) 1924 bwn_core_stop(mac); --- 2646 unchanged lines hidden (view full) --- 4571 } 4572 if (up_dev == NULL) { 4573 device_printf(sc->sc_dev, "Could not find a device\n"); 4574 return (ENODEV); 4575 } 4576 if (up_dev == sc->sc_curmac && sc->sc_curmac->mac_phy.gmode == gmode) 4577 return (0); 4578 | 1921 if (mac->mac_status >= BWN_MAC_STATUS_INITED) { 1922 /* XXX FIXME opmode not based on VAP */ 1923 bwn_set_opmode(mac); 1924 bwn_set_macaddr(mac); 1925 } 1926 1927 if (mac->mac_status >= BWN_MAC_STATUS_STARTED) 1928 bwn_core_stop(mac); --- 2646 unchanged lines hidden (view full) --- 4575 } 4576 if (up_dev == NULL) { 4577 device_printf(sc->sc_dev, "Could not find a device\n"); 4578 return (ENODEV); 4579 } 4580 if (up_dev == sc->sc_curmac && sc->sc_curmac->mac_phy.gmode == gmode) 4581 return (0); 4582 |
4579 device_printf(sc->sc_dev, "switching to %s-GHz band\n", | 4583 DPRINTF(sc, BWN_DEBUG_RF | BWN_DEBUG_PHY | BWN_DEBUG_RESET, 4584 "switching to %s-GHz band\n", |
4580 IEEE80211_IS_CHAN_2GHZ(chan) ? "2" : "5"); 4581 4582 down_dev = sc->sc_curmac; 4583 status = down_dev->mac_status; 4584 if (status >= BWN_MAC_STATUS_STARTED) 4585 bwn_core_stop(down_dev); 4586 if (status >= BWN_MAC_STATUS_INITED) 4587 bwn_core_exit(down_dev); --- 21 unchanged lines hidden (view full) --- 4609 sc->sc_curmac = NULL; 4610 return (err); 4611} 4612 4613static void 4614bwn_rf_turnon(struct bwn_mac *mac) 4615{ 4616 | 4585 IEEE80211_IS_CHAN_2GHZ(chan) ? "2" : "5"); 4586 4587 down_dev = sc->sc_curmac; 4588 status = down_dev->mac_status; 4589 if (status >= BWN_MAC_STATUS_STARTED) 4590 bwn_core_stop(down_dev); 4591 if (status >= BWN_MAC_STATUS_INITED) 4592 bwn_core_exit(down_dev); --- 21 unchanged lines hidden (view full) --- 4614 sc->sc_curmac = NULL; 4615 return (err); 4616} 4617 4618static void 4619bwn_rf_turnon(struct bwn_mac *mac) 4620{ 4621 |
4622 DPRINTF(mac->mac_sc, BWN_DEBUG_RESET, "%s: called\n", __func__); 4623 |
|
4617 bwn_mac_suspend(mac); 4618 mac->mac_phy.rf_onoff(mac, 1); 4619 mac->mac_phy.rf_on = 1; 4620 bwn_mac_enable(mac); 4621} 4622 4623static void 4624bwn_rf_turnoff(struct bwn_mac *mac) 4625{ 4626 | 4624 bwn_mac_suspend(mac); 4625 mac->mac_phy.rf_onoff(mac, 1); 4626 mac->mac_phy.rf_on = 1; 4627 bwn_mac_enable(mac); 4628} 4629 4630static void 4631bwn_rf_turnoff(struct bwn_mac *mac) 4632{ 4633 |
4634 DPRINTF(mac->mac_sc, BWN_DEBUG_RESET, "%s: called\n", __func__); 4635 |
|
4627 bwn_mac_suspend(mac); 4628 mac->mac_phy.rf_onoff(mac, 0); 4629 mac->mac_phy.rf_on = 0; 4630 bwn_mac_enable(mac); 4631} 4632 4633/* 4634 * SSB PHY reset. --- 2526 unchanged lines hidden --- | 4636 bwn_mac_suspend(mac); 4637 mac->mac_phy.rf_onoff(mac, 0); 4638 mac->mac_phy.rf_on = 0; 4639 bwn_mac_enable(mac); 4640} 4641 4642/* 4643 * SSB PHY reset. --- 2526 unchanged lines hidden --- |