if_wi.c (160991) | if_wi.c (164033) |
---|---|
1/* $NetBSD: wi.c,v 1.109 2003/01/09 08:52:19 dyoung Exp $ */ 2 3/*- 4 * Copyright (c) 1997, 1998, 1999 5 * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 48 unchanged lines hidden (view full) --- 57 * from the HCF Light code and corresponding documentation. 58 * 59 * This driver supports the ISA, PCMCIA and PCI versions of the Lucent 60 * WaveLan cards (based on the Hermes chipset), as well as the newer 61 * Prism 2 chipsets with firmware from Intersil and Symbol. 62 */ 63 64#include <sys/cdefs.h> | 1/* $NetBSD: wi.c,v 1.109 2003/01/09 08:52:19 dyoung Exp $ */ 2 3/*- 4 * Copyright (c) 1997, 1998, 1999 5 * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 48 unchanged lines hidden (view full) --- 57 * from the HCF Light code and corresponding documentation. 58 * 59 * This driver supports the ISA, PCMCIA and PCI versions of the Lucent 60 * WaveLan cards (based on the Hermes chipset), as well as the newer 61 * Prism 2 chipsets with firmware from Intersil and Symbol. 62 */ 63 64#include <sys/cdefs.h> |
65__FBSDID("$FreeBSD: head/sys/dev/wi/if_wi.c 160991 2006-08-05 04:58:25Z sam $"); | 65__FBSDID("$FreeBSD: head/sys/dev/wi/if_wi.c 164033 2006-11-06 13:42:10Z rwatson $"); |
66 67#define WI_HERMES_AUTOINC_WAR /* Work around data write autoinc bug. */ 68#define WI_HERMES_STATS_WAR /* Work around stats counter bug. */ 69 70#define NBPFILTER 1 71 72#include <sys/param.h> 73#include <sys/systm.h> 74#if __FreeBSD_version >= 500033 75#include <sys/endian.h> 76#endif 77#include <sys/sockio.h> 78#include <sys/mbuf.h> | 66 67#define WI_HERMES_AUTOINC_WAR /* Work around data write autoinc bug. */ 68#define WI_HERMES_STATS_WAR /* Work around stats counter bug. */ 69 70#define NBPFILTER 1 71 72#include <sys/param.h> 73#include <sys/systm.h> 74#if __FreeBSD_version >= 500033 75#include <sys/endian.h> 76#endif 77#include <sys/sockio.h> 78#include <sys/mbuf.h> |
79#include <sys/priv.h> |
|
79#include <sys/proc.h> 80#include <sys/kernel.h> 81#include <sys/socket.h> 82#include <sys/module.h> 83#include <sys/bus.h> 84#include <sys/random.h> 85#include <sys/syslog.h> 86#include <sys/sysctl.h> --- 1181 unchanged lines hidden (view full) --- 1268 WI_UNLOCK(sc); 1269 break; 1270 case SIOCGIFGENERIC: 1271 WI_LOCK(sc); 1272 error = wi_get_cfg(ifp, cmd, data); 1273 WI_UNLOCK(sc); 1274 break; 1275 case SIOCSIFGENERIC: | 80#include <sys/proc.h> 81#include <sys/kernel.h> 82#include <sys/socket.h> 83#include <sys/module.h> 84#include <sys/bus.h> 85#include <sys/random.h> 86#include <sys/syslog.h> 87#include <sys/sysctl.h> --- 1181 unchanged lines hidden (view full) --- 1269 WI_UNLOCK(sc); 1270 break; 1271 case SIOCGIFGENERIC: 1272 WI_LOCK(sc); 1273 error = wi_get_cfg(ifp, cmd, data); 1274 WI_UNLOCK(sc); 1275 break; 1276 case SIOCSIFGENERIC: |
1276 error = suser(td); | 1277 error = priv_check(td, PRIV_DRIVER); |
1277 if (error == 0) 1278 error = wi_set_cfg(ifp, cmd, data); 1279 break; 1280 case SIOCGPRISM2DEBUG: 1281 error = copyin(ifr->ifr_data, &wreq, sizeof(wreq)); 1282 if (error) 1283 break; 1284 if (!(ifp->if_drv_flags & IFF_DRV_RUNNING) || 1285 sc->sc_firmware_type == WI_LUCENT) { 1286 error = EIO; 1287 break; 1288 } 1289 error = wi_get_debug(sc, &wreq); 1290 if (error == 0) 1291 error = copyout(&wreq, ifr->ifr_data, sizeof(wreq)); 1292 break; 1293 case SIOCSPRISM2DEBUG: | 1278 if (error == 0) 1279 error = wi_set_cfg(ifp, cmd, data); 1280 break; 1281 case SIOCGPRISM2DEBUG: 1282 error = copyin(ifr->ifr_data, &wreq, sizeof(wreq)); 1283 if (error) 1284 break; 1285 if (!(ifp->if_drv_flags & IFF_DRV_RUNNING) || 1286 sc->sc_firmware_type == WI_LUCENT) { 1287 error = EIO; 1288 break; 1289 } 1290 error = wi_get_debug(sc, &wreq); 1291 if (error == 0) 1292 error = copyout(&wreq, ifr->ifr_data, sizeof(wreq)); 1293 break; 1294 case SIOCSPRISM2DEBUG: |
1294 if ((error = suser(td))) | 1295 if ((error = priv_check(td, PRIV_DRIVER))) |
1295 return (error); 1296 error = copyin(ifr->ifr_data, &wreq, sizeof(wreq)); 1297 if (error) 1298 break; 1299 WI_LOCK(sc); 1300 error = wi_set_debug(sc, &wreq); 1301 WI_UNLOCK(sc); 1302 break; --- 4 unchanged lines hidden (view full) --- 1307 error = copyout(sc->sc_nodename, ireq->i_data, 1308 ireq->i_len); 1309 break; 1310 } 1311 goto ioctl_common; 1312 case SIOCS80211: 1313 ireq = (struct ieee80211req *) data; 1314 if (ireq->i_type == IEEE80211_IOC_STATIONNAME) { | 1296 return (error); 1297 error = copyin(ifr->ifr_data, &wreq, sizeof(wreq)); 1298 if (error) 1299 break; 1300 WI_LOCK(sc); 1301 error = wi_set_debug(sc, &wreq); 1302 WI_UNLOCK(sc); 1303 break; --- 4 unchanged lines hidden (view full) --- 1308 error = copyout(sc->sc_nodename, ireq->i_data, 1309 ireq->i_len); 1310 break; 1311 } 1312 goto ioctl_common; 1313 case SIOCS80211: 1314 ireq = (struct ieee80211req *) data; 1315 if (ireq->i_type == IEEE80211_IOC_STATIONNAME) { |
1315 error = suser(td); | 1316 error = priv_check(td, PRIV_NET80211_MANAGE); |
1316 if (error) 1317 break; 1318 if (ireq->i_val != 0 || 1319 ireq->i_len > IEEE80211_NWID_LEN) { 1320 error = EINVAL; 1321 break; 1322 } 1323 memset(nodename, 0, IEEE80211_NWID_LEN); --- 2061 unchanged lines hidden --- | 1317 if (error) 1318 break; 1319 if (ireq->i_val != 0 || 1320 ireq->i_len > IEEE80211_NWID_LEN) { 1321 error = EINVAL; 1322 break; 1323 } 1324 memset(nodename, 0, IEEE80211_NWID_LEN); --- 2061 unchanged lines hidden --- |