Deleted Added
full compact
ieee80211.c (295126) ieee80211.c (296114)
1/*-
2 * Copyright (c) 2001 Atsushi Onoe
3 * Copyright (c) 2002-2009 Sam Leffler, Errno Consulting
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:

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

20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2001 Atsushi Onoe
3 * Copyright (c) 2002-2009 Sam Leffler, Errno Consulting
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:

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

20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
28__FBSDID("$FreeBSD: head/sys/net80211/ieee80211.c 295126 2016-02-01 17:41:21Z glebius $");
28__FBSDID("$FreeBSD: head/sys/net80211/ieee80211.c 296114 2016-02-26 20:47:08Z avos $");
29
30/*
31 * IEEE 802.11 generic handler
32 */
33#include "opt_wlan.h"
34
35#include <sys/param.h>
36#include <sys/systm.h>

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

261static LIST_HEAD(, ieee80211com) ic_head = LIST_HEAD_INITIALIZER(ic_head);
262static struct mtx ic_list_mtx;
263MTX_SYSINIT(ic_list, &ic_list_mtx, "ieee80211com list", MTX_DEF);
264
265static int
266sysctl_ieee80211coms(SYSCTL_HANDLER_ARGS)
267{
268 struct ieee80211com *ic;
29
30/*
31 * IEEE 802.11 generic handler
32 */
33#include "opt_wlan.h"
34
35#include <sys/param.h>
36#include <sys/systm.h>

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

261static LIST_HEAD(, ieee80211com) ic_head = LIST_HEAD_INITIALIZER(ic_head);
262static struct mtx ic_list_mtx;
263MTX_SYSINIT(ic_list, &ic_list_mtx, "ieee80211com list", MTX_DEF);
264
265static int
266sysctl_ieee80211coms(SYSCTL_HANDLER_ARGS)
267{
268 struct ieee80211com *ic;
269 struct sbuf *sb;
269 struct sbuf sb;
270 char *sp;
271 int error;
272
270 char *sp;
271 int error;
272
273 sb = sbuf_new_auto();
273 error = sysctl_wire_old_buffer(req, 0);
274 if (error)
275 return (error);
276 sbuf_new_for_sysctl(&sb, NULL, 8, req);
277 sbuf_clear_flags(&sb, SBUF_INCLUDENUL);
274 sp = "";
275 mtx_lock(&ic_list_mtx);
276 LIST_FOREACH(ic, &ic_head, ic_next) {
278 sp = "";
279 mtx_lock(&ic_list_mtx);
280 LIST_FOREACH(ic, &ic_head, ic_next) {
277 sbuf_printf(sb, "%s%s", sp, ic->ic_name);
281 sbuf_printf(&sb, "%s%s", sp, ic->ic_name);
278 sp = " ";
279 }
280 mtx_unlock(&ic_list_mtx);
282 sp = " ";
283 }
284 mtx_unlock(&ic_list_mtx);
281 sbuf_finish(sb);
282 error = SYSCTL_OUT(req, sbuf_data(sb), sbuf_len(sb) + 1);
283 sbuf_delete(sb);
285 error = sbuf_finish(&sb);
286 sbuf_delete(&sb);
284 return (error);
285}
286
287SYSCTL_PROC(_net_wlan, OID_AUTO, devices,
288 CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0,
289 sysctl_ieee80211coms, "A", "names of available 802.11 devices");
290
291/*

--- 1525 unchanged lines hidden ---
287 return (error);
288}
289
290SYSCTL_PROC(_net_wlan, OID_AUTO, devices,
291 CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0,
292 sysctl_ieee80211coms, "A", "names of available 802.11 devices");
293
294/*

--- 1525 unchanged lines hidden ---