Deleted Added
full compact
if_ath_sysctl.c (227868) if_ath_sysctl.c (228888)
1/*-
2 * Copyright (c) 2002-2009 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

--- 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) 2002-2009 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

--- 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/ath/if_ath_sysctl.c 227868 2011-11-23 05:00:25Z adrian $");
31__FBSDID("$FreeBSD: head/sys/dev/ath/if_ath_sysctl.c 228888 2011-12-26 05:46:22Z adrian $");
32
33/*
34 * Driver for the Atheros Wireless LAN controller.
35 *
36 * This software is derived from work of Atsushi Onoe; his contribution
37 * is greatly appreciated.
38 */
39

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

85#include <netinet/if_ether.h>
86#endif
87
88#include <dev/ath/if_athvar.h>
89#include <dev/ath/ath_hal/ah_devid.h> /* XXX for softled */
90#include <dev/ath/ath_hal/ah_diagcodes.h>
91
92#include <dev/ath/if_ath_debug.h>
32
33/*
34 * Driver for the Atheros Wireless LAN controller.
35 *
36 * This software is derived from work of Atsushi Onoe; his contribution
37 * is greatly appreciated.
38 */
39

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

85#include <netinet/if_ether.h>
86#endif
87
88#include <dev/ath/if_athvar.h>
89#include <dev/ath/ath_hal/ah_devid.h> /* XXX for softled */
90#include <dev/ath/ath_hal/ah_diagcodes.h>
91
92#include <dev/ath/if_ath_debug.h>
93#include <dev/ath/if_ath_led.h>
93#include <dev/ath/if_ath_misc.h>
94#include <dev/ath/if_ath_tx.h>
95#include <dev/ath/if_ath_sysctl.h>
96
97#ifdef ATH_TX99_DIAG
98#include <dev/ath/ath_tx99/ath_tx99.h>
99#endif
100

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

146
147 error = sysctl_handle_int(oidp, &softled, 0, req);
148 if (error || !req->newptr)
149 return error;
150 softled = (softled != 0);
151 if (softled != sc->sc_softled) {
152 if (softled) {
153 /* NB: handle any sc_ledpin change */
94#include <dev/ath/if_ath_misc.h>
95#include <dev/ath/if_ath_tx.h>
96#include <dev/ath/if_ath_sysctl.h>
97
98#ifdef ATH_TX99_DIAG
99#include <dev/ath/ath_tx99/ath_tx99.h>
100#endif
101

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

147
148 error = sysctl_handle_int(oidp, &softled, 0, req);
149 if (error || !req->newptr)
150 return error;
151 softled = (softled != 0);
152 if (softled != sc->sc_softled) {
153 if (softled) {
154 /* NB: handle any sc_ledpin change */
154 ath_hal_gpioCfgOutput(sc->sc_ah, sc->sc_ledpin,
155 HAL_GPIO_MUX_MAC_NETWORK_LED);
156 ath_hal_gpioset(sc->sc_ah, sc->sc_ledpin,
157 !sc->sc_ledon);
155 ath_led_config(sc);
158 }
159 sc->sc_softled = softled;
160 }
161 return 0;
162}
163
164static int
165ath_sysctl_ledpin(SYSCTL_HANDLER_ARGS)
166{
167 struct ath_softc *sc = arg1;
168 int ledpin = sc->sc_ledpin;
169 int error;
170
171 error = sysctl_handle_int(oidp, &ledpin, 0, req);
172 if (error || !req->newptr)
173 return error;
174 if (ledpin != sc->sc_ledpin) {
175 sc->sc_ledpin = ledpin;
176 if (sc->sc_softled) {
156 }
157 sc->sc_softled = softled;
158 }
159 return 0;
160}
161
162static int
163ath_sysctl_ledpin(SYSCTL_HANDLER_ARGS)
164{
165 struct ath_softc *sc = arg1;
166 int ledpin = sc->sc_ledpin;
167 int error;
168
169 error = sysctl_handle_int(oidp, &ledpin, 0, req);
170 if (error || !req->newptr)
171 return error;
172 if (ledpin != sc->sc_ledpin) {
173 sc->sc_ledpin = ledpin;
174 if (sc->sc_softled) {
177 ath_hal_gpioCfgOutput(sc->sc_ah, sc->sc_ledpin,
178 HAL_GPIO_MUX_MAC_NETWORK_LED);
179 ath_hal_gpioset(sc->sc_ah, sc->sc_ledpin,
180 !sc->sc_ledon);
175 ath_led_config(sc);
181 }
182 }
183 return 0;
184}
185
186static int
187ath_sysctl_txantenna(SYSCTL_HANDLER_ARGS)
188{

--- 726 unchanged lines hidden ---
176 }
177 }
178 return 0;
179}
180
181static int
182ath_sysctl_txantenna(SYSCTL_HANDLER_ARGS)
183{

--- 726 unchanged lines hidden ---