Deleted Added
full compact
if_ath.c (156073) if_ath.c (157438)
1/*-
2 * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
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

--- 21 unchanged lines hidden (view full) ---

30 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
32 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
34 * THE POSSIBILITY OF SUCH DAMAGES.
35 */
36
37#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
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

--- 21 unchanged lines hidden (view full) ---

30 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
32 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
34 * THE POSSIBILITY OF SUCH DAMAGES.
35 */
36
37#include <sys/cdefs.h>
38__FBSDID("$FreeBSD: head/sys/dev/ath/if_ath.c 156073 2006-02-27 17:20:23Z sam $");
38__FBSDID("$FreeBSD: head/sys/dev/ath/if_ath.c 157438 2006-04-03 18:14:02Z sam $");
39
40/*
41 * Driver for the Atheros Wireless LAN controller.
42 *
43 * This software is derived from work of Atsushi Onoe; his contribution
44 * is greatly appreciated.
45 */
46
47#include "opt_inet.h"
39
40/*
41 * Driver for the Atheros Wireless LAN controller.
42 *
43 * This software is derived from work of Atsushi Onoe; his contribution
44 * is greatly appreciated.
45 */
46
47#include "opt_inet.h"
48#include "opt_ath.h"
48
49#include <sys/param.h>
50#include <sys/systm.h>
51#include <sys/sysctl.h>
52#include <sys/mbuf.h>
53#include <sys/malloc.h>
54#include <sys/lock.h>
55#include <sys/mutex.h>

--- 21 unchanged lines hidden (view full) ---

77
78#include <net/bpf.h>
79
80#ifdef INET
81#include <netinet/in.h>
82#include <netinet/if_ether.h>
83#endif
84
49
50#include <sys/param.h>
51#include <sys/systm.h>
52#include <sys/sysctl.h>
53#include <sys/mbuf.h>
54#include <sys/malloc.h>
55#include <sys/lock.h>
56#include <sys/mutex.h>

--- 21 unchanged lines hidden (view full) ---

78
79#include <net/bpf.h>
80
81#ifdef INET
82#include <netinet/in.h>
83#include <netinet/if_ether.h>
84#endif
85
85#define AR_DEBUG
86#include <dev/ath/if_athvar.h>
87#include <contrib/dev/ath/ah_desc.h>
88#include <contrib/dev/ath/ah_devid.h> /* XXX for softled */
89
90#ifdef ATH_TX99_DIAG
91#include <dev/ath/ath_tx99/ath_tx99.h>
92#endif
93

--- 117 unchanged lines hidden (view full) ---

211SYSCTL_INT(_hw_ath, OID_AUTO, rxbuf, CTLFLAG_RD, &ath_rxbuf,
212 0, "rx buffers allocated");
213TUNABLE_INT("hw.ath.rxbuf", &ath_rxbuf);
214static int ath_txbuf = ATH_TXBUF; /* # tx buffers to allocate */
215SYSCTL_INT(_hw_ath, OID_AUTO, txbuf, CTLFLAG_RD, &ath_txbuf,
216 0, "tx buffers allocated");
217TUNABLE_INT("hw.ath.txbuf", &ath_txbuf);
218
86#include <dev/ath/if_athvar.h>
87#include <contrib/dev/ath/ah_desc.h>
88#include <contrib/dev/ath/ah_devid.h> /* XXX for softled */
89
90#ifdef ATH_TX99_DIAG
91#include <dev/ath/ath_tx99/ath_tx99.h>
92#endif
93

--- 117 unchanged lines hidden (view full) ---

211SYSCTL_INT(_hw_ath, OID_AUTO, rxbuf, CTLFLAG_RD, &ath_rxbuf,
212 0, "rx buffers allocated");
213TUNABLE_INT("hw.ath.rxbuf", &ath_rxbuf);
214static int ath_txbuf = ATH_TXBUF; /* # tx buffers to allocate */
215SYSCTL_INT(_hw_ath, OID_AUTO, txbuf, CTLFLAG_RD, &ath_txbuf,
216 0, "tx buffers allocated");
217TUNABLE_INT("hw.ath.txbuf", &ath_txbuf);
218
219#ifdef AR_DEBUG
219#ifdef ATH_DEBUG
220static int ath_debug = 0;
221SYSCTL_INT(_hw_ath, OID_AUTO, debug, CTLFLAG_RW, &ath_debug,
222 0, "control debugging printfs");
223TUNABLE_INT("hw.ath.debug", &ath_debug);
224enum {
225 ATH_DEBUG_XMIT = 0x00000001, /* basic xmit operation */
226 ATH_DEBUG_XMIT_DESC = 0x00000002, /* xmit descriptors */
227 ATH_DEBUG_RECV = 0x00000004, /* basic recv operation */

--- 1083 unchanged lines hidden (view full) ---

1311 if (IS_UP(ifp))
1312 ath_init(ifp->if_softc); /* XXX lose error */
1313 error = 0;
1314 }
1315 return error;
1316#undef IS_UP
1317}
1318
220static int ath_debug = 0;
221SYSCTL_INT(_hw_ath, OID_AUTO, debug, CTLFLAG_RW, &ath_debug,
222 0, "control debugging printfs");
223TUNABLE_INT("hw.ath.debug", &ath_debug);
224enum {
225 ATH_DEBUG_XMIT = 0x00000001, /* basic xmit operation */
226 ATH_DEBUG_XMIT_DESC = 0x00000002, /* xmit descriptors */
227 ATH_DEBUG_RECV = 0x00000004, /* basic recv operation */

--- 1083 unchanged lines hidden (view full) ---

1311 if (IS_UP(ifp))
1312 ath_init(ifp->if_softc); /* XXX lose error */
1313 error = 0;
1314 }
1315 return error;
1316#undef IS_UP
1317}
1318
1319#ifdef AR_DEBUG
1319#ifdef ATH_DEBUG
1320static void
1321ath_keyprint(const char *tag, u_int ix,
1322 const HAL_KEYVAL *hk, const u_int8_t mac[IEEE80211_ADDR_LEN])
1323{
1324 static const char *ciphers[] = {
1325 "WEP",
1326 "AES-OCB",
1327 "AES-CCM",

--- 1498 unchanged lines hidden (view full) ---

2826 * hardware is done with a descriptor by checking the
2827 * done bit in the following descriptor and the address
2828 * of the current descriptor the DMA engine is working
2829 * on. All this is necessary because of our use of
2830 * a self-linked list to avoid rx overruns.
2831 */
2832 status = ath_hal_rxprocdesc(ah, ds,
2833 bf->bf_daddr, PA2DESC(sc, ds->ds_link));
1320static void
1321ath_keyprint(const char *tag, u_int ix,
1322 const HAL_KEYVAL *hk, const u_int8_t mac[IEEE80211_ADDR_LEN])
1323{
1324 static const char *ciphers[] = {
1325 "WEP",
1326 "AES-OCB",
1327 "AES-CCM",

--- 1498 unchanged lines hidden (view full) ---

2826 * hardware is done with a descriptor by checking the
2827 * done bit in the following descriptor and the address
2828 * of the current descriptor the DMA engine is working
2829 * on. All this is necessary because of our use of
2830 * a self-linked list to avoid rx overruns.
2831 */
2832 status = ath_hal_rxprocdesc(ah, ds,
2833 bf->bf_daddr, PA2DESC(sc, ds->ds_link));
2834#ifdef AR_DEBUG
2834#ifdef ATH_DEBUG
2835 if (sc->sc_debug & ATH_DEBUG_RECV_DESC)
2836 ath_printrxbuf(bf, 0, status == HAL_OK);
2837#endif
2838 if (status == HAL_EINPROGRESS)
2839 break;
2840 STAILQ_REMOVE_HEAD(&sc->sc_rxbuf, bf_list);
2841 if (ds->ds_rxstat.rs_more) {
2842 /*

--- 933 unchanged lines hidden (view full) ---

3776 bf = STAILQ_FIRST(&txq->axq_q);
3777 if (bf == NULL) {
3778 ATH_TXQ_UNLOCK(txq);
3779 break;
3780 }
3781 ds0 = &bf->bf_desc[0];
3782 ds = &bf->bf_desc[bf->bf_nseg - 1];
3783 status = ath_hal_txprocdesc(ah, ds);
2835 if (sc->sc_debug & ATH_DEBUG_RECV_DESC)
2836 ath_printrxbuf(bf, 0, status == HAL_OK);
2837#endif
2838 if (status == HAL_EINPROGRESS)
2839 break;
2840 STAILQ_REMOVE_HEAD(&sc->sc_rxbuf, bf_list);
2841 if (ds->ds_rxstat.rs_more) {
2842 /*

--- 933 unchanged lines hidden (view full) ---

3776 bf = STAILQ_FIRST(&txq->axq_q);
3777 if (bf == NULL) {
3778 ATH_TXQ_UNLOCK(txq);
3779 break;
3780 }
3781 ds0 = &bf->bf_desc[0];
3782 ds = &bf->bf_desc[bf->bf_nseg - 1];
3783 status = ath_hal_txprocdesc(ah, ds);
3784#ifdef AR_DEBUG
3784#ifdef ATH_DEBUG
3785 if (sc->sc_debug & ATH_DEBUG_XMIT_DESC)
3786 ath_printtxbuf(bf, txq->axq_qnum, 0, status == HAL_OK);
3787#endif
3788 if (status == HAL_EINPROGRESS) {
3789 ATH_TXQ_UNLOCK(txq);
3790 break;
3791 }
3792 ATH_TXQ_REMOVE_HEAD(txq, bf_list);

--- 161 unchanged lines hidden (view full) ---

3954 ath_led_event(sc, ATH_LED_TX);
3955
3956 ath_start(ifp);
3957}
3958
3959static void
3960ath_tx_draintxq(struct ath_softc *sc, struct ath_txq *txq)
3961{
3785 if (sc->sc_debug & ATH_DEBUG_XMIT_DESC)
3786 ath_printtxbuf(bf, txq->axq_qnum, 0, status == HAL_OK);
3787#endif
3788 if (status == HAL_EINPROGRESS) {
3789 ATH_TXQ_UNLOCK(txq);
3790 break;
3791 }
3792 ATH_TXQ_REMOVE_HEAD(txq, bf_list);

--- 161 unchanged lines hidden (view full) ---

3954 ath_led_event(sc, ATH_LED_TX);
3955
3956 ath_start(ifp);
3957}
3958
3959static void
3960ath_tx_draintxq(struct ath_softc *sc, struct ath_txq *txq)
3961{
3962#ifdef AR_DEBUG
3962#ifdef ATH_DEBUG
3963 struct ath_hal *ah = sc->sc_ah;
3964#endif
3965 struct ieee80211_node *ni;
3966 struct ath_buf *bf;
3967 u_int ix;
3968
3969 /*
3970 * NB: this assumes output has been stopped and

--- 4 unchanged lines hidden (view full) ---

3975 bf = STAILQ_FIRST(&txq->axq_q);
3976 if (bf == NULL) {
3977 txq->axq_link = NULL;
3978 ATH_TXQ_UNLOCK(txq);
3979 break;
3980 }
3981 ATH_TXQ_REMOVE_HEAD(txq, bf_list);
3982 ATH_TXQ_UNLOCK(txq);
3963 struct ath_hal *ah = sc->sc_ah;
3964#endif
3965 struct ieee80211_node *ni;
3966 struct ath_buf *bf;
3967 u_int ix;
3968
3969 /*
3970 * NB: this assumes output has been stopped and

--- 4 unchanged lines hidden (view full) ---

3975 bf = STAILQ_FIRST(&txq->axq_q);
3976 if (bf == NULL) {
3977 txq->axq_link = NULL;
3978 ATH_TXQ_UNLOCK(txq);
3979 break;
3980 }
3981 ATH_TXQ_REMOVE_HEAD(txq, bf_list);
3982 ATH_TXQ_UNLOCK(txq);
3983#ifdef AR_DEBUG
3983#ifdef ATH_DEBUG
3984 if (sc->sc_debug & ATH_DEBUG_RESET)
3985 ath_printtxbuf(bf, txq->axq_qnum, ix,
3986 ath_hal_txprocdesc(ah, bf->bf_desc) == HAL_OK);
3984 if (sc->sc_debug & ATH_DEBUG_RESET)
3985 ath_printtxbuf(bf, txq->axq_qnum, ix,
3986 ath_hal_txprocdesc(ah, bf->bf_desc) == HAL_OK);
3987#endif /* AR_DEBUG */
3987#endif /* ATH_DEBUG */
3988 bus_dmamap_unload(sc->sc_dmat, bf->bf_dmamap);
3989 m_freem(bf->bf_m);
3990 bf->bf_m = NULL;
3991 ni = bf->bf_node;
3992 bf->bf_node = NULL;
3993 if (ni != NULL) {
3994 /*
3995 * Reclaim node reference.

--- 56 unchanged lines hidden (view full) ---

4052 ((struct ath_desc *)((caddr_t)(_sc)->sc_rxdma.dd_desc + \
4053 ((_pa) - (_sc)->sc_rxdma.dd_desc_paddr)))
4054 struct ath_hal *ah = sc->sc_ah;
4055
4056 ath_hal_stoppcurecv(ah); /* disable PCU */
4057 ath_hal_setrxfilter(ah, 0); /* clear recv filter */
4058 ath_hal_stopdmarecv(ah); /* disable DMA engine */
4059 DELAY(3000); /* 3ms is long enough for 1 frame */
3988 bus_dmamap_unload(sc->sc_dmat, bf->bf_dmamap);
3989 m_freem(bf->bf_m);
3990 bf->bf_m = NULL;
3991 ni = bf->bf_node;
3992 bf->bf_node = NULL;
3993 if (ni != NULL) {
3994 /*
3995 * Reclaim node reference.

--- 56 unchanged lines hidden (view full) ---

4052 ((struct ath_desc *)((caddr_t)(_sc)->sc_rxdma.dd_desc + \
4053 ((_pa) - (_sc)->sc_rxdma.dd_desc_paddr)))
4054 struct ath_hal *ah = sc->sc_ah;
4055
4056 ath_hal_stoppcurecv(ah); /* disable PCU */
4057 ath_hal_setrxfilter(ah, 0); /* clear recv filter */
4058 ath_hal_stopdmarecv(ah); /* disable DMA engine */
4059 DELAY(3000); /* 3ms is long enough for 1 frame */
4060#ifdef AR_DEBUG
4060#ifdef ATH_DEBUG
4061 if (sc->sc_debug & (ATH_DEBUG_RESET | ATH_DEBUG_FATAL)) {
4062 struct ath_buf *bf;
4063 u_int ix;
4064
4065 printf("%s: rx queue %p, link %p\n", __func__,
4066 (caddr_t)(uintptr_t) ath_hal_getrxbuf(ah), sc->sc_rxlink);
4067 ix = 0;
4068 STAILQ_FOREACH(bf, &sc->sc_rxbuf, bf_list) {

--- 777 unchanged lines hidden (view full) ---

4846 */
4847 /* XXX layering violation */
4848 sc->sc_mcastrix = ath_tx_findrix(rt, sc->sc_ic.ic_mcast_rate);
4849 sc->sc_mcastrate = sc->sc_ic.ic_mcast_rate;
4850 /* NB: caller is responsible for reseting rate control state */
4851#undef N
4852}
4853
4061 if (sc->sc_debug & (ATH_DEBUG_RESET | ATH_DEBUG_FATAL)) {
4062 struct ath_buf *bf;
4063 u_int ix;
4064
4065 printf("%s: rx queue %p, link %p\n", __func__,
4066 (caddr_t)(uintptr_t) ath_hal_getrxbuf(ah), sc->sc_rxlink);
4067 ix = 0;
4068 STAILQ_FOREACH(bf, &sc->sc_rxbuf, bf_list) {

--- 777 unchanged lines hidden (view full) ---

4846 */
4847 /* XXX layering violation */
4848 sc->sc_mcastrix = ath_tx_findrix(rt, sc->sc_ic.ic_mcast_rate);
4849 sc->sc_mcastrate = sc->sc_ic.ic_mcast_rate;
4850 /* NB: caller is responsible for reseting rate control state */
4851#undef N
4852}
4853
4854#ifdef AR_DEBUG
4854#ifdef ATH_DEBUG
4855static void
4856ath_printrxbuf(struct ath_buf *bf, u_int ix, int done)
4857{
4858 struct ath_desc *ds;
4859 int i;
4860
4861 for (i = 0, ds = bf->bf_desc; i < bf->bf_nseg; i++, ds++) {
4862 printf("R[%2u] (DS.V:%p DS.P:%p) L:%08x D:%08x%s\n"

--- 18 unchanged lines hidden (view full) ---

4881 " %08x %08x %08x %08x %08x %08x\n",
4882 ds, (struct ath_desc *)bf->bf_daddr + i,
4883 ds->ds_link, ds->ds_data, bf->bf_flags,
4884 !done ? "" : (ds->ds_txstat.ts_status == 0) ? " *" : " !",
4885 ds->ds_ctl0, ds->ds_ctl1,
4886 ds->ds_hw[0], ds->ds_hw[1], ds->ds_hw[2], ds->ds_hw[3]);
4887 }
4888}
4855static void
4856ath_printrxbuf(struct ath_buf *bf, u_int ix, int done)
4857{
4858 struct ath_desc *ds;
4859 int i;
4860
4861 for (i = 0, ds = bf->bf_desc; i < bf->bf_nseg; i++, ds++) {
4862 printf("R[%2u] (DS.V:%p DS.P:%p) L:%08x D:%08x%s\n"

--- 18 unchanged lines hidden (view full) ---

4881 " %08x %08x %08x %08x %08x %08x\n",
4882 ds, (struct ath_desc *)bf->bf_daddr + i,
4883 ds->ds_link, ds->ds_data, bf->bf_flags,
4884 !done ? "" : (ds->ds_txstat.ts_status == 0) ? " *" : " !",
4885 ds->ds_ctl0, ds->ds_ctl1,
4886 ds->ds_hw[0], ds->ds_hw[1], ds->ds_hw[2], ds->ds_hw[3]);
4887 }
4888}
4889#endif /* AR_DEBUG */
4889#endif /* ATH_DEBUG */
4890
4891static void
4892ath_watchdog(struct ifnet *ifp)
4893{
4894 struct ath_softc *sc = ifp->if_softc;
4895 struct ieee80211com *ic = &sc->sc_ic;
4896
4897 ifp->if_timer = 0;

--- 6 unchanged lines hidden (view full) ---

4904 ifp->if_oerrors++;
4905 sc->sc_stats.ast_watchdog++;
4906 } else
4907 ifp->if_timer = 1;
4908 }
4909 ieee80211_watchdog(ic);
4910}
4911
4890
4891static void
4892ath_watchdog(struct ifnet *ifp)
4893{
4894 struct ath_softc *sc = ifp->if_softc;
4895 struct ieee80211com *ic = &sc->sc_ic;
4896
4897 ifp->if_timer = 0;

--- 6 unchanged lines hidden (view full) ---

4904 ifp->if_oerrors++;
4905 sc->sc_stats.ast_watchdog++;
4906 } else
4907 ifp->if_timer = 1;
4908 }
4909 ieee80211_watchdog(ic);
4910}
4911
4912#ifdef ATH_DIAGAPI
4912/*
4913 * Diagnostic interface to the HAL. This is used by various
4914 * tools to do things like retrieve register contents for
4915 * debugging. The mechanism is intentionally opaque so that
4916 * it can change frequently w/o concern for compatiblity.
4917 */
4918static int
4919ath_ioctl_diag(struct ath_softc *sc, struct ath_diag *ad)

--- 44 unchanged lines hidden (view full) ---

4964 }
4965bad:
4966 if ((ad->ad_id & ATH_DIAG_IN) && indata != NULL)
4967 free(indata, M_TEMP);
4968 if ((ad->ad_id & ATH_DIAG_DYN) && outdata != NULL)
4969 free(outdata, M_TEMP);
4970 return error;
4971}
4913/*
4914 * Diagnostic interface to the HAL. This is used by various
4915 * tools to do things like retrieve register contents for
4916 * debugging. The mechanism is intentionally opaque so that
4917 * it can change frequently w/o concern for compatiblity.
4918 */
4919static int
4920ath_ioctl_diag(struct ath_softc *sc, struct ath_diag *ad)

--- 44 unchanged lines hidden (view full) ---

4965 }
4966bad:
4967 if ((ad->ad_id & ATH_DIAG_IN) && indata != NULL)
4968 free(indata, M_TEMP);
4969 if ((ad->ad_id & ATH_DIAG_DYN) && outdata != NULL)
4970 free(outdata, M_TEMP);
4971 return error;
4972}
4973#endif /* ATH_DIAGAPI */
4972
4973static int
4974ath_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
4975{
4976#define IS_RUNNING(ifp) \
4977 ((ifp->if_flags & IFF_UP) && (ifp->if_drv_flags & IFF_DRV_RUNNING))
4978 struct ath_softc *sc = ifp->if_softc;
4979 struct ieee80211com *ic = &sc->sc_ic;

--- 44 unchanged lines hidden (view full) ---

5024 /*
5025 * NB: Drop the softc lock in case of a page fault;
5026 * we'll accept any potential inconsisentcy in the
5027 * statistics. The alternative is to copy the data
5028 * to a local structure.
5029 */
5030 return copyout(&sc->sc_stats,
5031 ifr->ifr_data, sizeof (sc->sc_stats));
4974
4975static int
4976ath_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
4977{
4978#define IS_RUNNING(ifp) \
4979 ((ifp->if_flags & IFF_UP) && (ifp->if_drv_flags & IFF_DRV_RUNNING))
4980 struct ath_softc *sc = ifp->if_softc;
4981 struct ieee80211com *ic = &sc->sc_ic;

--- 44 unchanged lines hidden (view full) ---

5026 /*
5027 * NB: Drop the softc lock in case of a page fault;
5028 * we'll accept any potential inconsisentcy in the
5029 * statistics. The alternative is to copy the data
5030 * to a local structure.
5031 */
5032 return copyout(&sc->sc_stats,
5033 ifr->ifr_data, sizeof (sc->sc_stats));
5034#ifdef ATH_DIAGAPI
5032 case SIOCGATHDIAG:
5033 ATH_UNLOCK(sc);
5034 error = ath_ioctl_diag(sc, (struct ath_diag *) ifr);
5035 ATH_LOCK(sc);
5036 break;
5035 case SIOCGATHDIAG:
5036 ATH_UNLOCK(sc);
5037 error = ath_ioctl_diag(sc, (struct ath_diag *) ifr);
5038 ATH_LOCK(sc);
5039 break;
5040#endif
5037 default:
5038 error = ieee80211_ioctl(ic, cmd, data);
5039 if (error == ENETRESET) {
5040 if (IS_RUNNING(ifp) &&
5041 ic->ic_roaming != IEEE80211_ROAMING_MANUAL)
5042 ath_init(sc); /* XXX lose error */
5043 error = 0;
5044 }

--- 229 unchanged lines hidden (view full) ---

5274
5275 ath_hal_getcountrycode(sc->sc_ah, &sc->sc_countrycode);
5276 SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO,
5277 "countrycode", CTLFLAG_RD, &sc->sc_countrycode, 0,
5278 "EEPROM country code");
5279 SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO,
5280 "regdomain", CTLTYPE_INT | CTLFLAG_RW, sc, 0,
5281 ath_sysctl_regdomain, "I", "EEPROM regdomain code");
5041 default:
5042 error = ieee80211_ioctl(ic, cmd, data);
5043 if (error == ENETRESET) {
5044 if (IS_RUNNING(ifp) &&
5045 ic->ic_roaming != IEEE80211_ROAMING_MANUAL)
5046 ath_init(sc); /* XXX lose error */
5047 error = 0;
5048 }

--- 229 unchanged lines hidden (view full) ---

5278
5279 ath_hal_getcountrycode(sc->sc_ah, &sc->sc_countrycode);
5280 SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO,
5281 "countrycode", CTLFLAG_RD, &sc->sc_countrycode, 0,
5282 "EEPROM country code");
5283 SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO,
5284 "regdomain", CTLTYPE_INT | CTLFLAG_RW, sc, 0,
5285 ath_sysctl_regdomain, "I", "EEPROM regdomain code");
5282#ifdef AR_DEBUG
5286#ifdef ATH_DEBUG
5283 sc->sc_debug = ath_debug;
5284 SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO,
5285 "debug", CTLFLAG_RW, &sc->sc_debug, 0,
5286 "control debugging printfs");
5287#endif
5288 SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO,
5289 "slottime", CTLTYPE_INT | CTLFLAG_RW, sc, 0,
5290 ath_sysctl_slottime, "I", "802.11 slot time (us)");

--- 141 unchanged lines hidden ---
5287 sc->sc_debug = ath_debug;
5288 SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO,
5289 "debug", CTLFLAG_RW, &sc->sc_debug, 0,
5290 "control debugging printfs");
5291#endif
5292 SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO,
5293 "slottime", CTLTYPE_INT | CTLFLAG_RW, sc, 0,
5294 ath_sysctl_slottime, "I", "802.11 slot time (us)");

--- 141 unchanged lines hidden ---