if_ndis.c (155311) | if_ndis.c (164033) |
---|---|
1/*- 2 * Copyright (c) 2003 3 * Bill Paul <wpaul@windriver.com>. 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 --- 20 unchanged lines hidden (view full) --- 29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 30 * THE POSSIBILITY OF SUCH DAMAGE. 31 * 32 * WPA support originally contributed by Arvind Srinivasan <arvind@celar.us> 33 * then hacked upon mercilessly by my. 34 */ 35 36#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2003 3 * Bill Paul <wpaul@windriver.com>. 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 --- 20 unchanged lines hidden (view full) --- 29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 30 * THE POSSIBILITY OF SUCH DAMAGE. 31 * 32 * WPA support originally contributed by Arvind Srinivasan <arvind@celar.us> 33 * then hacked upon mercilessly by my. 34 */ 35 36#include <sys/cdefs.h> |
37__FBSDID("$FreeBSD: head/sys/dev/if_ndis/if_ndis.c 155311 2006-02-04 19:42:49Z wpaul $"); | 37__FBSDID("$FreeBSD: head/sys/dev/if_ndis/if_ndis.c 164033 2006-11-06 13:42:10Z rwatson $"); |
38 39#include <sys/param.h> 40#include <sys/systm.h> 41#include <sys/sockio.h> 42#include <sys/mbuf.h> 43#include <sys/malloc.h> | 38 39#include <sys/param.h> 40#include <sys/systm.h> 41#include <sys/sockio.h> 42#include <sys/mbuf.h> 43#include <sys/malloc.h> |
44#include <sys/priv.h> |
|
44#include <sys/kernel.h> 45#include <sys/socket.h> 46#include <sys/queue.h> 47#include <sys/module.h> 48#include <sys/proc.h> 49#if __FreeBSD_version < 502113 50#include <sys/sysctl.h> 51#endif --- 2779 unchanged lines hidden (view full) --- 2831 if (!NDIS_INITIALIZED(sc)) 2832 goto do_80211; 2833 if (sc->ndis_80211) 2834 error = ndis_80211_ioctl_set(ifp, command, data); 2835 else 2836 error = ENOTTY; 2837 break; 2838 case SIOCGDRVSPEC: | 45#include <sys/kernel.h> 46#include <sys/socket.h> 47#include <sys/queue.h> 48#include <sys/module.h> 49#include <sys/proc.h> 50#if __FreeBSD_version < 502113 51#include <sys/sysctl.h> 52#endif --- 2779 unchanged lines hidden (view full) --- 2832 if (!NDIS_INITIALIZED(sc)) 2833 goto do_80211; 2834 if (sc->ndis_80211) 2835 error = ndis_80211_ioctl_set(ifp, command, data); 2836 else 2837 error = ENOTTY; 2838 break; 2839 case SIOCGDRVSPEC: |
2839 if ((error = suser(curthread))) | 2840 if ((error = priv_check(curthread, PRIV_DRIVER))) |
2840 break; 2841 error = copyin(ifr->ifr_data, &oid, sizeof(oid)); 2842 if (error) 2843 break; 2844 oidbuf = malloc(oid.len, M_TEMP, M_NOWAIT|M_ZERO); 2845 if (oidbuf == NULL) { 2846 error = ENOMEM; 2847 break; --- 12 unchanged lines hidden (view full) --- 2860 if (error) { 2861 free(oidbuf, M_TEMP); 2862 break; 2863 } 2864 error = copyout(oidbuf, ifr->ifr_data + sizeof(oid), oid.len); 2865 free(oidbuf, M_TEMP); 2866 break; 2867 case SIOCSDRVSPEC: | 2841 break; 2842 error = copyin(ifr->ifr_data, &oid, sizeof(oid)); 2843 if (error) 2844 break; 2845 oidbuf = malloc(oid.len, M_TEMP, M_NOWAIT|M_ZERO); 2846 if (oidbuf == NULL) { 2847 error = ENOMEM; 2848 break; --- 12 unchanged lines hidden (view full) --- 2861 if (error) { 2862 free(oidbuf, M_TEMP); 2863 break; 2864 } 2865 error = copyout(oidbuf, ifr->ifr_data + sizeof(oid), oid.len); 2866 free(oidbuf, M_TEMP); 2867 break; 2868 case SIOCSDRVSPEC: |
2868 if ((error = suser(curthread))) | 2869 if ((error = priv_check(curthread, PRIV_DRIVER))) |
2869 break; 2870 error = copyin(ifr->ifr_data, &oid, sizeof(oid)); 2871 if (error) 2872 break; 2873 oidbuf = malloc(oid.len, M_TEMP, M_NOWAIT|M_ZERO); 2874 if (oidbuf == NULL) { 2875 error = ENOMEM; 2876 break; --- 12 unchanged lines hidden (view full) --- 2889 if (error) { 2890 free(oidbuf, M_TEMP); 2891 break; 2892 } 2893 error = copyout(oidbuf, ifr->ifr_data + sizeof(oid), oid.len); 2894 free(oidbuf, M_TEMP); 2895 break; 2896 case SIOCGPRIVATE_0: | 2870 break; 2871 error = copyin(ifr->ifr_data, &oid, sizeof(oid)); 2872 if (error) 2873 break; 2874 oidbuf = malloc(oid.len, M_TEMP, M_NOWAIT|M_ZERO); 2875 if (oidbuf == NULL) { 2876 error = ENOMEM; 2877 break; --- 12 unchanged lines hidden (view full) --- 2890 if (error) { 2891 free(oidbuf, M_TEMP); 2892 break; 2893 } 2894 error = copyout(oidbuf, ifr->ifr_data + sizeof(oid), oid.len); 2895 free(oidbuf, M_TEMP); 2896 break; 2897 case SIOCGPRIVATE_0: |
2897 if ((error = suser(curthread))) | 2898 if ((error = priv_check(curthread, PRIV_DRIVER))) |
2898 break; 2899 NDIS_LOCK(sc); 2900 if (sc->ndis_evt[sc->ndis_evtcidx].ne_sts == 0) { 2901 error = ENOENT; 2902 NDIS_UNLOCK(sc); 2903 break; 2904 } 2905 error = copyin(ifr->ifr_data, &evt, sizeof(evt)); --- 151 unchanged lines hidden (view full) --- 3057 caddr_t data; 3058{ 3059 struct wi_req wreq; 3060 struct ifreq *ifr; 3061 struct ndis_softc *sc; 3062 uint32_t foo; 3063 int error, len; 3064 | 2899 break; 2900 NDIS_LOCK(sc); 2901 if (sc->ndis_evt[sc->ndis_evtcidx].ne_sts == 0) { 2902 error = ENOENT; 2903 NDIS_UNLOCK(sc); 2904 break; 2905 } 2906 error = copyin(ifr->ifr_data, &evt, sizeof(evt)); --- 151 unchanged lines hidden (view full) --- 3058 caddr_t data; 3059{ 3060 struct wi_req wreq; 3061 struct ifreq *ifr; 3062 struct ndis_softc *sc; 3063 uint32_t foo; 3064 int error, len; 3065 |
3065 error = suser(curthread); | 3066 error = priv_check(curthread, PRIV_DRIVER); |
3066 if (error) 3067 return (error); 3068 3069 sc = ifp->if_softc; 3070 ifr = (struct ifreq *)data; 3071 error = copyin(ifr->ifr_data, &wreq, sizeof(wreq)); 3072 if (error) 3073 return (error); --- 291 unchanged lines hidden (view full) --- 3365 len = 0; 3366 error = ndis_set_info(sc, OID_802_11_BSSID_LIST_SCAN, 3367 NULL, &len); 3368 tsleep(&error, PPAUSE|PCATCH, "ssidscan", hz * 2); 3369 rt_ieee80211msg(ifp, RTM_IEEE80211_SCAN, NULL, 0); 3370 break; 3371#endif 3372 case IEEE80211_IOC_STATIONNAME: | 3067 if (error) 3068 return (error); 3069 3070 sc = ifp->if_softc; 3071 ifr = (struct ifreq *)data; 3072 error = copyin(ifr->ifr_data, &wreq, sizeof(wreq)); 3073 if (error) 3074 return (error); --- 291 unchanged lines hidden (view full) --- 3366 len = 0; 3367 error = ndis_set_info(sc, OID_802_11_BSSID_LIST_SCAN, 3368 NULL, &len); 3369 tsleep(&error, PPAUSE|PCATCH, "ssidscan", hz * 2); 3370 rt_ieee80211msg(ifp, RTM_IEEE80211_SCAN, NULL, 0); 3371 break; 3372#endif 3373 case IEEE80211_IOC_STATIONNAME: |
3373 error = suser(curthread); | 3374 error = priv_check(curthread, PRIV_NET80211_MANAGE); |
3374 if (error) 3375 break; 3376 if (ireq->i_val != 0 || 3377 ireq->i_len > IEEE80211_NWID_LEN) { 3378 error = EINVAL; 3379 break; 3380 } 3381 as.as_len = as.as_maxlen = ireq->i_len; --- 116 unchanged lines hidden --- | 3375 if (error) 3376 break; 3377 if (ireq->i_val != 0 || 3378 ireq->i_len > IEEE80211_NWID_LEN) { 3379 error = EINVAL; 3380 break; 3381 } 3382 as.as_len = as.as_maxlen = ireq->i_len; --- 116 unchanged lines hidden --- |