Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/ath/if_ath_sysctl.c
Show First 20 Lines • Show All 282 Lines • ▼ Show 20 Lines | if (error || !req->newptr) | ||||
return error; | return error; | ||||
return !ath_hal_setdiag(sc->sc_ah, diag) ? EINVAL : 0; | return !ath_hal_setdiag(sc->sc_ah, diag) ? EINVAL : 0; | ||||
} | } | ||||
static int | static int | ||||
ath_sysctl_tpscale(SYSCTL_HANDLER_ARGS) | ath_sysctl_tpscale(SYSCTL_HANDLER_ARGS) | ||||
{ | { | ||||
struct ath_softc *sc = arg1; | struct ath_softc *sc = arg1; | ||||
struct ifnet *ifp = sc->sc_ifp; | |||||
u_int32_t scale; | u_int32_t scale; | ||||
int error; | int error; | ||||
(void) ath_hal_gettpscale(sc->sc_ah, &scale); | (void) ath_hal_gettpscale(sc->sc_ah, &scale); | ||||
error = sysctl_handle_int(oidp, &scale, 0, req); | error = sysctl_handle_int(oidp, &scale, 0, req); | ||||
if (error || !req->newptr) | if (error || !req->newptr) | ||||
return error; | return error; | ||||
return !ath_hal_settpscale(sc->sc_ah, scale) ? EINVAL : | return !ath_hal_settpscale(sc->sc_ah, scale) ? EINVAL : | ||||
(ifp->if_drv_flags & IFF_DRV_RUNNING) ? | (sc->sc_running) ? ath_reset(sc, ATH_RESET_NOLOSS) : 0; | ||||
ath_reset(ifp, ATH_RESET_NOLOSS) : 0; | |||||
} | } | ||||
static int | static int | ||||
ath_sysctl_tpc(SYSCTL_HANDLER_ARGS) | ath_sysctl_tpc(SYSCTL_HANDLER_ARGS) | ||||
{ | { | ||||
struct ath_softc *sc = arg1; | struct ath_softc *sc = arg1; | ||||
u_int tpc = ath_hal_gettpc(sc->sc_ah); | u_int tpc = ath_hal_gettpc(sc->sc_ah); | ||||
int error; | int error; | ||||
error = sysctl_handle_int(oidp, &tpc, 0, req); | error = sysctl_handle_int(oidp, &tpc, 0, req); | ||||
if (error || !req->newptr) | if (error || !req->newptr) | ||||
return error; | return error; | ||||
return !ath_hal_settpc(sc->sc_ah, tpc) ? EINVAL : 0; | return !ath_hal_settpc(sc->sc_ah, tpc) ? EINVAL : 0; | ||||
} | } | ||||
static int | static int | ||||
ath_sysctl_rfkill(SYSCTL_HANDLER_ARGS) | ath_sysctl_rfkill(SYSCTL_HANDLER_ARGS) | ||||
{ | { | ||||
struct ath_softc *sc = arg1; | struct ath_softc *sc = arg1; | ||||
struct ifnet *ifp = sc->sc_ifp; | |||||
struct ath_hal *ah = sc->sc_ah; | struct ath_hal *ah = sc->sc_ah; | ||||
u_int rfkill = ath_hal_getrfkill(ah); | u_int rfkill = ath_hal_getrfkill(ah); | ||||
int error; | int error; | ||||
error = sysctl_handle_int(oidp, &rfkill, 0, req); | error = sysctl_handle_int(oidp, &rfkill, 0, req); | ||||
if (error || !req->newptr) | if (error || !req->newptr) | ||||
return error; | return error; | ||||
if (rfkill == ath_hal_getrfkill(ah)) /* unchanged */ | if (rfkill == ath_hal_getrfkill(ah)) /* unchanged */ | ||||
return 0; | return 0; | ||||
if (!ath_hal_setrfkill(ah, rfkill)) | if (!ath_hal_setrfkill(ah, rfkill)) | ||||
return EINVAL; | return EINVAL; | ||||
return (ifp->if_drv_flags & IFF_DRV_RUNNING) ? | return (sc->sc_running ? ath_reset(sc, ATH_RESET_FULL) : 0); | ||||
ath_reset(ifp, ATH_RESET_FULL) : 0; | |||||
} | } | ||||
static int | static int | ||||
ath_sysctl_txagg(SYSCTL_HANDLER_ARGS) | ath_sysctl_txagg(SYSCTL_HANDLER_ARGS) | ||||
{ | { | ||||
struct ath_softc *sc = arg1; | struct ath_softc *sc = arg1; | ||||
int i, t, param = 0; | int i, t, param = 0; | ||||
int error; | int error; | ||||
▲ Show 20 Lines • Show All 160 Lines • ▼ Show 20 Lines | ath_sysctl_intmit(SYSCTL_HANDLER_ARGS) | ||||
if (! error) | if (! error) | ||||
return EINVAL; | return EINVAL; | ||||
/* | /* | ||||
* Reset the hardware here - disabling ANI in the HAL | * Reset the hardware here - disabling ANI in the HAL | ||||
* doesn't reset ANI related registers, so it'll leave | * doesn't reset ANI related registers, so it'll leave | ||||
* things in an inconsistent state. | * things in an inconsistent state. | ||||
*/ | */ | ||||
if (sc->sc_ifp->if_drv_flags & IFF_DRV_RUNNING) | if (sc->sc_running) | ||||
ath_reset(sc->sc_ifp, ATH_RESET_NOLOSS); | ath_reset(sc, ATH_RESET_NOLOSS); | ||||
return 0; | return 0; | ||||
} | } | ||||
#ifdef IEEE80211_SUPPORT_TDMA | #ifdef IEEE80211_SUPPORT_TDMA | ||||
static int | static int | ||||
ath_sysctl_setcca(SYSCTL_HANDLER_ARGS) | ath_sysctl_setcca(SYSCTL_HANDLER_ARGS) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 647 Lines • Show Last 20 Lines |