Deleted Added
full compact
ifieee80211.c (299921) ifieee80211.c (300738)
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 299921 2016-05-16 08:07:32Z truckman $
27 * $FreeBSD: head/sbin/ifconfig/ifieee80211.c 300738 2016-05-26 13:14:08Z avos $
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,

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

5136 printf("%.*s", len, buf);
5137 } else {
5138 printf("0x");
5139 for (i = 0; i < len; i++)
5140 printf("%02x", buf[i]);
5141 }
5142}
5143
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,

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

5136 printf("%.*s", len, buf);
5137 } else {
5138 printf("0x");
5139 for (i = 0; i < len; i++)
5140 printf("%02x", buf[i]);
5141 }
5142}
5143
5144static void
5145setdefregdomain(int s)
5146{
5147 struct regdata *rdp = getregdata();
5148 const struct regdomain *rd;
5149
5150 /* Check if regdomain/country was already set by a previous call. */
5151 /* XXX is it possible? */
5152 if (regdomain.regdomain != 0 ||
5153 regdomain.country != CTRY_DEFAULT)
5154 return;
5155
5156 getregdomain(s);
5157
5158 /* Check if it was already set by the driver. */
5159 if (regdomain.regdomain != 0 ||
5160 regdomain.country != CTRY_DEFAULT)
5161 return;
5162
5163 /* Set FCC/US as default. */
5164 rd = lib80211_regdomain_findbysku(rdp, SKU_FCC);
5165 if (rd == NULL)
5166 errx(1, "FCC regdomain was not found");
5167
5168 regdomain.regdomain = rd->sku;
5169 if (rd->cc != NULL)
5170 defaultcountry(rd);
5171
5172 /* Send changes to net80211. */
5173 setregdomain_cb(s, &regdomain);
5174
5175 /* Cleanup (so it can be overriden by subsequent parameters). */
5176 regdomain.regdomain = 0;
5177 regdomain.country = CTRY_DEFAULT;
5178 regdomain.isocc[0] = 0;
5179 regdomain.isocc[1] = 0;
5180}
5181
5144/*
5145 * Virtual AP cloning support.
5146 */
5147static struct ieee80211_clone_params params = {
5148 .icp_opmode = IEEE80211_M_STA, /* default to station mode */
5149};
5150
5151static void

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

5157 errx(1, "must specify a parent device (wlandev) when creating "
5158 "a wlan device");
5159 if (params.icp_opmode == IEEE80211_M_WDS &&
5160 memcmp(params.icp_bssid, zerobssid, sizeof(zerobssid)) == 0)
5161 errx(1, "no bssid specified for WDS (use wlanbssid)");
5162 ifr->ifr_data = (caddr_t) &params;
5163 if (ioctl(s, SIOCIFCREATE2, ifr) < 0)
5164 err(1, "SIOCIFCREATE2");
5182/*
5183 * Virtual AP cloning support.
5184 */
5185static struct ieee80211_clone_params params = {
5186 .icp_opmode = IEEE80211_M_STA, /* default to station mode */
5187};
5188
5189static void

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

5195 errx(1, "must specify a parent device (wlandev) when creating "
5196 "a wlan device");
5197 if (params.icp_opmode == IEEE80211_M_WDS &&
5198 memcmp(params.icp_bssid, zerobssid, sizeof(zerobssid)) == 0)
5199 errx(1, "no bssid specified for WDS (use wlanbssid)");
5200 ifr->ifr_data = (caddr_t) &params;
5201 if (ioctl(s, SIOCIFCREATE2, ifr) < 0)
5202 err(1, "SIOCIFCREATE2");
5203
5204 setdefregdomain(s);
5165}
5166
5167static
5168DECL_CMD_FUNC(set80211clone_wlandev, arg, d)
5169{
5170 strlcpy(params.icp_parent, arg, IFNAMSIZ);
5171}
5172

--- 277 unchanged lines hidden ---
5205}
5206
5207static
5208DECL_CMD_FUNC(set80211clone_wlandev, arg, d)
5209{
5210 strlcpy(params.icp_parent, arg, IFNAMSIZ);
5211}
5212

--- 277 unchanged lines hidden ---