ieee80211_ioctl.c (148936) | ieee80211_ioctl.c (149028) |
---|---|
1/*- 2 * Copyright (c) 2001 Atsushi Onoe 3 * Copyright (c) 2002-2005 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: --- 17 unchanged lines hidden (view full) --- 26 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 30 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 */ 32 33#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2001 Atsushi Onoe 3 * Copyright (c) 2002-2005 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: --- 17 unchanged lines hidden (view full) --- 26 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 30 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 */ 32 33#include <sys/cdefs.h> |
34__FBSDID("$FreeBSD: head/sys/net80211/ieee80211_ioctl.c 148936 2005-08-10 16:22:30Z sam $"); | 34__FBSDID("$FreeBSD: head/sys/net80211/ieee80211_ioctl.c 149028 2005-08-13 17:31:48Z sam $"); |
35 36/* 37 * IEEE 802.11 ioctl support (FreeBSD-specific) 38 */ 39 40#include "opt_inet.h" 41#include "opt_ipx.h" 42 --- 1194 unchanged lines hidden (view full) --- 1237 case IEEE80211_IOC_WME_ACKPOLICY: /* WME: ACK policy (!bss only)*/ 1238 wmep = &wme->wme_wmeChanParams.cap_wmeParams[ac]; 1239 ireq->i_val = !wmep->wmep_noackPolicy; 1240 break; 1241 } 1242 return 0; 1243} 1244 | 35 36/* 37 * IEEE 802.11 ioctl support (FreeBSD-specific) 38 */ 39 40#include "opt_inet.h" 41#include "opt_ipx.h" 42 --- 1194 unchanged lines hidden (view full) --- 1237 case IEEE80211_IOC_WME_ACKPOLICY: /* WME: ACK policy (!bss only)*/ 1238 wmep = &wme->wme_wmeChanParams.cap_wmeParams[ac]; 1239 ireq->i_val = !wmep->wmep_noackPolicy; 1240 break; 1241 } 1242 return 0; 1243} 1244 |
1245static int 1246ieee80211_ioctl_getmaccmd(struct ieee80211com *ic, struct ieee80211req *ireq) 1247{ 1248 const struct ieee80211_aclator *acl = ic->ic_acl; 1249 1250 return (acl == NULL ? EINVAL : acl->iac_getioctl(ic, ireq)); 1251} 1252 |
|
1245/* 1246 * When building the kernel with -O2 on the i386 architecture, gcc 1247 * seems to want to inline this function into ieee80211_ioctl() 1248 * (which is the only routine that calls it). When this happens, 1249 * ieee80211_ioctl() ends up consuming an additional 2K of stack 1250 * space. (Exactly why it needs so much is unclear.) The problem 1251 * is that it's possible for ieee80211_ioctl() to invoke other 1252 * routines (including driver init functions) which could then find --- 217 unchanged lines hidden (view full) --- 1470 ireq->i_val = ic->ic_bss->ni_intval; 1471 break; 1472 case IEEE80211_IOC_PUREG: 1473 ireq->i_val = (ic->ic_flags & IEEE80211_F_PUREG) != 0; 1474 break; 1475 case IEEE80211_IOC_FRAGTHRESHOLD: 1476 ireq->i_val = ic->ic_fragthreshold; 1477 break; | 1253/* 1254 * When building the kernel with -O2 on the i386 architecture, gcc 1255 * seems to want to inline this function into ieee80211_ioctl() 1256 * (which is the only routine that calls it). When this happens, 1257 * ieee80211_ioctl() ends up consuming an additional 2K of stack 1258 * space. (Exactly why it needs so much is unclear.) The problem 1259 * is that it's possible for ieee80211_ioctl() to invoke other 1260 * routines (including driver init functions) which could then find --- 217 unchanged lines hidden (view full) --- 1478 ireq->i_val = ic->ic_bss->ni_intval; 1479 break; 1480 case IEEE80211_IOC_PUREG: 1481 ireq->i_val = (ic->ic_flags & IEEE80211_F_PUREG) != 0; 1482 break; 1483 case IEEE80211_IOC_FRAGTHRESHOLD: 1484 ireq->i_val = ic->ic_fragthreshold; 1485 break; |
1486 case IEEE80211_IOC_MACCMD: 1487 error = ieee80211_ioctl_getmaccmd(ic, ireq); 1488 break; |
|
1478 default: 1479 error = EINVAL; 1480 break; 1481 } 1482 return error; 1483} 1484 1485static int --- 249 unchanged lines hidden (view full) --- 1735 if (ireq->i_type == IEEE80211_IOC_ADDMAC) 1736 acl->iac_add(ic, mac); 1737 else 1738 acl->iac_remove(ic, mac); 1739 return 0; 1740} 1741 1742static int | 1489 default: 1490 error = EINVAL; 1491 break; 1492 } 1493 return error; 1494} 1495 1496static int --- 249 unchanged lines hidden (view full) --- 1746 if (ireq->i_type == IEEE80211_IOC_ADDMAC) 1747 acl->iac_add(ic, mac); 1748 else 1749 acl->iac_remove(ic, mac); 1750 return 0; 1751} 1752 1753static int |
1743ieee80211_ioctl_maccmd(struct ieee80211com *ic, struct ieee80211req *ireq) | 1754ieee80211_ioctl_setmaccmd(struct ieee80211com *ic, struct ieee80211req *ireq) |
1744{ 1745 const struct ieee80211_aclator *acl = ic->ic_acl; 1746 1747 switch (ireq->i_val) { 1748 case IEEE80211_MACCMD_POLICY_OPEN: 1749 case IEEE80211_MACCMD_POLICY_ALLOW: 1750 case IEEE80211_MACCMD_POLICY_DENY: 1751 if (acl == NULL) { --- 11 unchanged lines hidden (view full) --- 1763 break; 1764 case IEEE80211_MACCMD_DETACH: 1765 if (acl != NULL) { 1766 ic->ic_acl = NULL; 1767 acl->iac_detach(ic); 1768 } 1769 break; 1770 default: | 1755{ 1756 const struct ieee80211_aclator *acl = ic->ic_acl; 1757 1758 switch (ireq->i_val) { 1759 case IEEE80211_MACCMD_POLICY_OPEN: 1760 case IEEE80211_MACCMD_POLICY_ALLOW: 1761 case IEEE80211_MACCMD_POLICY_DENY: 1762 if (acl == NULL) { --- 11 unchanged lines hidden (view full) --- 1774 break; 1775 case IEEE80211_MACCMD_DETACH: 1776 if (acl != NULL) { 1777 ic->ic_acl = NULL; 1778 acl->iac_detach(ic); 1779 } 1780 break; 1781 default: |
1771 return EINVAL; | 1782 if (acl == NULL) 1783 return EINVAL; 1784 else 1785 return acl->iac_setioctl(ic, ireq); |
1772 } 1773 return 0; 1774} 1775 1776static int 1777ieee80211_ioctl_setchanlist(struct ieee80211com *ic, struct ieee80211req *ireq) 1778{ 1779 struct ieee80211req_chanlist list; --- 517 unchanged lines hidden (view full) --- 2297 if (error == 0) /* XXX background scan */ 2298 error = ieee80211_new_state(ic, IEEE80211_S_SCAN, -1); 2299 break; 2300 case IEEE80211_IOC_ADDMAC: 2301 case IEEE80211_IOC_DELMAC: 2302 error = ieee80211_ioctl_macmac(ic, ireq); 2303 break; 2304 case IEEE80211_IOC_MACCMD: | 1786 } 1787 return 0; 1788} 1789 1790static int 1791ieee80211_ioctl_setchanlist(struct ieee80211com *ic, struct ieee80211req *ireq) 1792{ 1793 struct ieee80211req_chanlist list; --- 517 unchanged lines hidden (view full) --- 2311 if (error == 0) /* XXX background scan */ 2312 error = ieee80211_new_state(ic, IEEE80211_S_SCAN, -1); 2313 break; 2314 case IEEE80211_IOC_ADDMAC: 2315 case IEEE80211_IOC_DELMAC: 2316 error = ieee80211_ioctl_macmac(ic, ireq); 2317 break; 2318 case IEEE80211_IOC_MACCMD: |
2305 error = ieee80211_ioctl_maccmd(ic, ireq); | 2319 error = ieee80211_ioctl_setmaccmd(ic, ireq); |
2306 break; 2307 case IEEE80211_IOC_STA_TXPOW: 2308 error = ieee80211_ioctl_setstatxpow(ic, ireq); 2309 break; 2310 case IEEE80211_IOC_WME_CWMIN: /* WME: CWmin */ 2311 case IEEE80211_IOC_WME_CWMAX: /* WME: CWmax */ 2312 case IEEE80211_IOC_WME_AIFS: /* WME: AIFS */ 2313 case IEEE80211_IOC_WME_TXOPLIMIT: /* WME: txops limit */ --- 150 unchanged lines hidden --- | 2320 break; 2321 case IEEE80211_IOC_STA_TXPOW: 2322 error = ieee80211_ioctl_setstatxpow(ic, ireq); 2323 break; 2324 case IEEE80211_IOC_WME_CWMIN: /* WME: CWmin */ 2325 case IEEE80211_IOC_WME_CWMAX: /* WME: CWmax */ 2326 case IEEE80211_IOC_WME_AIFS: /* WME: AIFS */ 2327 case IEEE80211_IOC_WME_TXOPLIMIT: /* WME: txops limit */ --- 150 unchanged lines hidden --- |