Deleted Added
full compact
ifieee80211.c (149029) ifieee80211.c (150708)
1/*
2 * Copyright 2001 The Aerospace Corporation. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.

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

19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 *
1/*
2 * Copyright 2001 The Aerospace Corporation. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.

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

19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 *
27 * $FreeBSD: head/sbin/ifconfig/ifieee80211.c 149029 2005-08-13 17:38:09Z sam $
27 * $FreeBSD: head/sbin/ifconfig/ifieee80211.c 150708 2005-09-29 13:09:04Z ru $
28 */
29
30/*-
31 * Copyright (c) 1997, 1998, 2000 The NetBSD Foundation, Inc.
32 * All rights reserved.
33 *
34 * This code is derived from software contributed to The NetBSD Foundation
35 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,

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

192 mode = IEEE80211_AUTH_OPEN;
193 } else if (strcasecmp(val, "shared") == 0) {
194 mode = IEEE80211_AUTH_SHARED;
195 } else if (strcasecmp(val, "8021x") == 0) {
196 mode = IEEE80211_AUTH_8021X;
197 } else if (strcasecmp(val, "wpa") == 0) {
198 mode = IEEE80211_AUTH_WPA;
199 } else {
28 */
29
30/*-
31 * Copyright (c) 1997, 1998, 2000 The NetBSD Foundation, Inc.
32 * All rights reserved.
33 *
34 * This code is derived from software contributed to The NetBSD Foundation
35 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,

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

192 mode = IEEE80211_AUTH_OPEN;
193 } else if (strcasecmp(val, "shared") == 0) {
194 mode = IEEE80211_AUTH_SHARED;
195 } else if (strcasecmp(val, "8021x") == 0) {
196 mode = IEEE80211_AUTH_8021X;
197 } else if (strcasecmp(val, "wpa") == 0) {
198 mode = IEEE80211_AUTH_WPA;
199 } else {
200 err(1, "unknown authmode");
200 errx(1, "unknown authmode");
201 }
202
203 set80211(s, IEEE80211_IOC_AUTHMODE, mode, 0, NULL);
204}
205
206static void
207set80211powersavemode(const char *val, int d, int s, const struct afswtch *rafp)
208{

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

214 mode = IEEE80211_POWERSAVE_ON;
215 } else if (strcasecmp(val, "cam") == 0) {
216 mode = IEEE80211_POWERSAVE_CAM;
217 } else if (strcasecmp(val, "psp") == 0) {
218 mode = IEEE80211_POWERSAVE_PSP;
219 } else if (strcasecmp(val, "psp-cam") == 0) {
220 mode = IEEE80211_POWERSAVE_PSP_CAM;
221 } else {
201 }
202
203 set80211(s, IEEE80211_IOC_AUTHMODE, mode, 0, NULL);
204}
205
206static void
207set80211powersavemode(const char *val, int d, int s, const struct afswtch *rafp)
208{

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

214 mode = IEEE80211_POWERSAVE_ON;
215 } else if (strcasecmp(val, "cam") == 0) {
216 mode = IEEE80211_POWERSAVE_CAM;
217 } else if (strcasecmp(val, "psp") == 0) {
218 mode = IEEE80211_POWERSAVE_PSP;
219 } else if (strcasecmp(val, "psp-cam") == 0) {
220 mode = IEEE80211_POWERSAVE_PSP_CAM;
221 } else {
222 err(1, "unknown powersavemode");
222 errx(1, "unknown powersavemode");
223 }
224
225 set80211(s, IEEE80211_IOC_POWERSAVE, mode, 0, NULL);
226}
227
228static void
229set80211powersave(const char *val, int d, int s, const struct afswtch *rafp)
230{

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

249
250 if (strcasecmp(val, "off") == 0) {
251 mode = IEEE80211_WEP_OFF;
252 } else if (strcasecmp(val, "on") == 0) {
253 mode = IEEE80211_WEP_ON;
254 } else if (strcasecmp(val, "mixed") == 0) {
255 mode = IEEE80211_WEP_MIXED;
256 } else {
223 }
224
225 set80211(s, IEEE80211_IOC_POWERSAVE, mode, 0, NULL);
226}
227
228static void
229set80211powersave(const char *val, int d, int s, const struct afswtch *rafp)
230{

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

249
250 if (strcasecmp(val, "off") == 0) {
251 mode = IEEE80211_WEP_OFF;
252 } else if (strcasecmp(val, "on") == 0) {
253 mode = IEEE80211_WEP_ON;
254 } else if (strcasecmp(val, "mixed") == 0) {
255 mode = IEEE80211_WEP_MIXED;
256 } else {
257 err(1, "unknown wep mode");
257 errx(1, "unknown wep mode");
258 }
259
260 set80211(s, IEEE80211_IOC_WEP, mode, 0, NULL);
261}
262
263static void
264set80211wep(const char *val, int d, int s, const struct afswtch *rafp)
265{

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

355
356 if (strcasecmp(val, "off") == 0) {
357 mode = IEEE80211_PROTMODE_OFF;
358 } else if (strcasecmp(val, "cts") == 0) {
359 mode = IEEE80211_PROTMODE_CTS;
360 } else if (strcasecmp(val, "rtscts") == 0) {
361 mode = IEEE80211_PROTMODE_RTSCTS;
362 } else {
258 }
259
260 set80211(s, IEEE80211_IOC_WEP, mode, 0, NULL);
261}
262
263static void
264set80211wep(const char *val, int d, int s, const struct afswtch *rafp)
265{

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

355
356 if (strcasecmp(val, "off") == 0) {
357 mode = IEEE80211_PROTMODE_OFF;
358 } else if (strcasecmp(val, "cts") == 0) {
359 mode = IEEE80211_PROTMODE_CTS;
360 } else if (strcasecmp(val, "rtscts") == 0) {
361 mode = IEEE80211_PROTMODE_RTSCTS;
362 } else {
363 err(1, "unknown protection mode");
363 errx(1, "unknown protection mode");
364 }
365
366 set80211(s, IEEE80211_IOC_PROTMODE, mode, 0, NULL);
367}
368
369static void
370set80211txpower(const char *val, int d, int s, const struct afswtch *rafp)
371{

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

383
384 if (strcasecmp(val, "device") == 0) {
385 mode = IEEE80211_ROAMING_DEVICE;
386 } else if (strcasecmp(val, "auto") == 0) {
387 mode = IEEE80211_ROAMING_AUTO;
388 } else if (strcasecmp(val, "manual") == 0) {
389 mode = IEEE80211_ROAMING_MANUAL;
390 } else {
364 }
365
366 set80211(s, IEEE80211_IOC_PROTMODE, mode, 0, NULL);
367}
368
369static void
370set80211txpower(const char *val, int d, int s, const struct afswtch *rafp)
371{

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

383
384 if (strcasecmp(val, "device") == 0) {
385 mode = IEEE80211_ROAMING_DEVICE;
386 } else if (strcasecmp(val, "auto") == 0) {
387 mode = IEEE80211_ROAMING_AUTO;
388 } else if (strcasecmp(val, "manual") == 0) {
389 mode = IEEE80211_ROAMING_MANUAL;
390 } else {
391 err(1, "unknown roaming mode");
391 errx(1, "unknown roaming mode");
392 }
393 set80211(s, IEEE80211_IOC_ROAMING, mode, 0, NULL);
394}
395
396static void
397set80211wme(const char *val, int d, int s, const struct afswtch *rafp)
398{
399 set80211(s, IEEE80211_IOC_WME, d, 0, NULL);

--- 1532 unchanged lines hidden ---
392 }
393 set80211(s, IEEE80211_IOC_ROAMING, mode, 0, NULL);
394}
395
396static void
397set80211wme(const char *val, int d, int s, const struct afswtch *rafp)
398{
399 set80211(s, IEEE80211_IOC_WME, d, 0, NULL);

--- 1532 unchanged lines hidden ---