if_uath.c (190744) | if_uath.c (191746) |
---|---|
1/*- 2 * Copyright (c) 2006 Sam Leffler, Errno Consulting 3 * Copyright (c) 2008-2009 Weongyo Jeong <weongyo@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: --- 35 unchanged lines hidden (view full) --- 44 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 45 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 46 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 47 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 48 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 49 */ 50 51#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2006 Sam Leffler, Errno Consulting 3 * Copyright (c) 2008-2009 Weongyo Jeong <weongyo@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: --- 35 unchanged lines hidden (view full) --- 44 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 45 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 46 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 47 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 48 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 49 */ 50 51#include <sys/cdefs.h> |
52__FBSDID("$FreeBSD: head/sys/dev/usb/wlan/if_uath.c 190744 2009-04-05 18:26:19Z thompsa $"); | 52__FBSDID("$FreeBSD: head/sys/dev/usb/wlan/if_uath.c 191746 2009-05-02 15:14:18Z thompsa $"); |
53 54/*- 55 * Driver for Atheros AR5523 USB parts. 56 * 57 * The driver requires firmware to be loaded into the device. This 58 * is done on device discovery from a user application (uathload) 59 * that is launched by devd when a device with suitable product ID 60 * is recognized. Once firmware has been loaded the device will --- 1536 unchanged lines hidden (view full) --- 1597} 1598 1599static int 1600uath_tx_start(struct uath_softc *sc, struct mbuf *m0, struct ieee80211_node *ni, 1601 struct uath_data *data) 1602{ 1603 struct ifnet *ifp = sc->sc_ifp; 1604 struct ieee80211com *ic = ifp->if_l2com; | 53 54/*- 55 * Driver for Atheros AR5523 USB parts. 56 * 57 * The driver requires firmware to be loaded into the device. This 58 * is done on device discovery from a user application (uathload) 59 * that is launched by devd when a device with suitable product ID 60 * is recognized. Once firmware has been loaded the device will --- 1536 unchanged lines hidden (view full) --- 1597} 1598 1599static int 1600uath_tx_start(struct uath_softc *sc, struct mbuf *m0, struct ieee80211_node *ni, 1601 struct uath_data *data) 1602{ 1603 struct ifnet *ifp = sc->sc_ifp; 1604 struct ieee80211com *ic = ifp->if_l2com; |
1605 struct ieee80211vap *vap = ni->ni_vap; |
|
1605 struct uath_chunk *chunk; 1606 struct uath_tx_desc *desc; 1607 const struct ieee80211_frame *wh; 1608 struct ieee80211_key *k; 1609 int framelen, msglen; 1610 1611 UATH_ASSERT_LOCKED(sc); 1612 --- 59 unchanged lines hidden (view full) --- 1672 desc->txqid = htobe32(M_WME_GETAC(m0)); 1673 break; 1674 default: 1675 device_printf(sc->sc_dev, "bogus frame type 0x%x (%s)\n", 1676 wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK, __func__); 1677 m_freem(m0); 1678 return (EIO); 1679 } | 1606 struct uath_chunk *chunk; 1607 struct uath_tx_desc *desc; 1608 const struct ieee80211_frame *wh; 1609 struct ieee80211_key *k; 1610 int framelen, msglen; 1611 1612 UATH_ASSERT_LOCKED(sc); 1613 --- 59 unchanged lines hidden (view full) --- 1673 desc->txqid = htobe32(M_WME_GETAC(m0)); 1674 break; 1675 default: 1676 device_printf(sc->sc_dev, "bogus frame type 0x%x (%s)\n", 1677 wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK, __func__); 1678 m_freem(m0); 1679 return (EIO); 1680 } |
1680 if (sc->sc_state == IEEE80211_S_AUTH || 1681 sc->sc_state == IEEE80211_S_ASSOC || 1682 sc->sc_state == IEEE80211_S_RUN) | 1681 if (vap->iv_state == IEEE80211_S_AUTH || 1682 vap->iv_state == IEEE80211_S_ASSOC || 1683 vap->iv_state == IEEE80211_S_RUN) |
1683 desc->connid = htobe32(UATH_ID_BSS); 1684 else 1685 desc->connid = htobe32(UATH_ID_INVALID); 1686 desc->flags = htobe32(0 /* no UATH_TX_NOTIFY */); 1687 desc->buflen = htobe32(m0->m_pkthdr.len); 1688 1689#ifdef UATH_DEBUG 1690 DPRINTF(sc, UATH_DEBUG_XMIT, --- 365 unchanged lines hidden (view full) --- 2056 struct ieee80211com *ic = vap->iv_ic; 2057 struct uath_softc *sc = ic->ic_ifp->if_softc; 2058 struct uath_vap *uvp = UATH_VAP(vap); 2059 2060 DPRINTF(sc, UATH_DEBUG_STATE, 2061 "%s: %s -> %s\n", __func__, ieee80211_state_name[vap->iv_state], 2062 ieee80211_state_name[nstate]); 2063 | 1684 desc->connid = htobe32(UATH_ID_BSS); 1685 else 1686 desc->connid = htobe32(UATH_ID_INVALID); 1687 desc->flags = htobe32(0 /* no UATH_TX_NOTIFY */); 1688 desc->buflen = htobe32(m0->m_pkthdr.len); 1689 1690#ifdef UATH_DEBUG 1691 DPRINTF(sc, UATH_DEBUG_XMIT, --- 365 unchanged lines hidden (view full) --- 2057 struct ieee80211com *ic = vap->iv_ic; 2058 struct uath_softc *sc = ic->ic_ifp->if_softc; 2059 struct uath_vap *uvp = UATH_VAP(vap); 2060 2061 DPRINTF(sc, UATH_DEBUG_STATE, 2062 "%s: %s -> %s\n", __func__, ieee80211_state_name[vap->iv_state], 2063 ieee80211_state_name[nstate]); 2064 |
2065 IEEE80211_UNLOCK(ic); |
|
2064 UATH_LOCK(sc); | 2066 UATH_LOCK(sc); |
2065 | |
2066 callout_stop(&sc->stat_ch); 2067 callout_stop(&sc->watchdog_ch); | 2067 callout_stop(&sc->stat_ch); 2068 callout_stop(&sc->watchdog_ch); |
2068 sc->sc_state = nstate; | |
2069 2070 switch (nstate) { 2071 case IEEE80211_S_INIT: 2072 if (ostate == IEEE80211_S_RUN) { 2073 /* turn link and activity LEDs off */ 2074 uath_set_ledstate(sc, 0); 2075 } 2076 break; --- 57 unchanged lines hidden (view full) --- 2134 2135 /* start statistics timer */ 2136 callout_reset(&sc->stat_ch, hz, uath_stat, sc); 2137 break; 2138 default: 2139 break; 2140 } 2141 UATH_UNLOCK(sc); | 2069 2070 switch (nstate) { 2071 case IEEE80211_S_INIT: 2072 if (ostate == IEEE80211_S_RUN) { 2073 /* turn link and activity LEDs off */ 2074 uath_set_ledstate(sc, 0); 2075 } 2076 break; --- 57 unchanged lines hidden (view full) --- 2134 2135 /* start statistics timer */ 2136 callout_reset(&sc->stat_ch, hz, uath_stat, sc); 2137 break; 2138 default: 2139 break; 2140 } 2141 UATH_UNLOCK(sc); |
2142 | |
2143 IEEE80211_LOCK(ic); | 2142 IEEE80211_LOCK(ic); |
2144 uvp->newstate(vap, nstate, arg); 2145 if (vap->iv_newstate_cb != NULL) 2146 vap->iv_newstate_cb(vap, nstate, arg); 2147 IEEE80211_UNLOCK(ic); 2148 2149 return (0); | 2143 return (uvp->newstate(vap, nstate, arg)); |
2150} 2151 2152static int 2153uath_set_key(struct uath_softc *sc, const struct ieee80211_key *wk, 2154 int index) 2155{ 2156#if 0 2157 struct uath_cmd_crypto crypto; --- 705 unchanged lines hidden --- | 2144} 2145 2146static int 2147uath_set_key(struct uath_softc *sc, const struct ieee80211_key *wk, 2148 int index) 2149{ 2150#if 0 2151 struct uath_cmd_crypto crypto; --- 705 unchanged lines hidden --- |