if_sbni.c (152315) | if_sbni.c (164033) |
---|---|
1/*- 2 * Copyright (c) 1997-2001 Granch, Ltd. All rights reserved. 3 * Author: Denis I.Timofeev <timofeev@granch.ru> 4 * 5 * Redistributon 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 --- 13 unchanged lines hidden (view full) --- 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEIGENCE 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 */ 28 29#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1997-2001 Granch, Ltd. All rights reserved. 3 * Author: Denis I.Timofeev <timofeev@granch.ru> 4 * 5 * Redistributon 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 --- 13 unchanged lines hidden (view full) --- 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEIGENCE 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 */ 28 29#include <sys/cdefs.h> |
30__FBSDID("$FreeBSD: head/sys/dev/sbni/if_sbni.c 152315 2005-11-11 16:04:59Z ru $"); | 30__FBSDID("$FreeBSD: head/sys/dev/sbni/if_sbni.c 164033 2006-11-06 13:42:10Z rwatson $"); |
31 32/* 33 * Device driver for Granch SBNI12 leased line adapters 34 * 35 * Revision 2.0.0 1997/08/06 36 * Initial revision by Alexey Zverev 37 * 38 * Revision 2.0.1 1997/08/11 --- 23 unchanged lines hidden (view full) --- 62 63 64#include <sys/param.h> 65#include <sys/systm.h> 66#include <sys/socket.h> 67#include <sys/sockio.h> 68#include <sys/mbuf.h> 69#include <sys/kernel.h> | 31 32/* 33 * Device driver for Granch SBNI12 leased line adapters 34 * 35 * Revision 2.0.0 1997/08/06 36 * Initial revision by Alexey Zverev 37 * 38 * Revision 2.0.1 1997/08/11 --- 23 unchanged lines hidden (view full) --- 62 63 64#include <sys/param.h> 65#include <sys/systm.h> 66#include <sys/socket.h> 67#include <sys/sockio.h> 68#include <sys/mbuf.h> 69#include <sys/kernel.h> |
70#include <sys/priv.h> |
|
70#include <sys/proc.h> 71#include <sys/callout.h> 72#include <sys/syslog.h> 73#include <sys/random.h> 74 75#include <machine/bus.h> 76#include <sys/rman.h> 77#include <machine/resource.h> --- 1027 unchanged lines hidden (view full) --- 1105 case SIOCGINSTATS: 1106 in_stats = (struct sbni_in_stats *)ifr->ifr_data; 1107 bcopy((void *)(&(sc->in_stats)), (void *)in_stats, 1108 sizeof(struct sbni_in_stats)); 1109 break; 1110 1111 case SIOCSHWFLAGS: /* set flags */ 1112 /* root only */ | 71#include <sys/proc.h> 72#include <sys/callout.h> 73#include <sys/syslog.h> 74#include <sys/random.h> 75 76#include <machine/bus.h> 77#include <sys/rman.h> 78#include <machine/resource.h> --- 1027 unchanged lines hidden (view full) --- 1106 case SIOCGINSTATS: 1107 in_stats = (struct sbni_in_stats *)ifr->ifr_data; 1108 bcopy((void *)(&(sc->in_stats)), (void *)in_stats, 1109 sizeof(struct sbni_in_stats)); 1110 break; 1111 1112 case SIOCSHWFLAGS: /* set flags */ 1113 /* root only */ |
1113 error = suser(td); | 1114 error = priv_check(td, PRIV_DRIVER); |
1114 if (error) 1115 break; 1116 flags = *(struct sbni_flags*)&ifr->ifr_data; 1117 if (flags.fixed_rxl) { 1118 sc->delta_rxl = 0; 1119 sc->cur_rxl_index = flags.rxl; 1120 } else { 1121 sc->delta_rxl = DEF_RXL_DELTA; --- 5 unchanged lines hidden (view full) --- 1127 bcopy((caddr_t) &flags, 1128 (caddr_t) IF_LLADDR(sc->ifp)+3, 3); 1129 1130 /* Don't be afraid... */ 1131 sbni_outb(sc, CSR1, *(char*)(&sc->csr1) | PR_RES); 1132 break; 1133 1134 case SIOCRINSTATS: | 1115 if (error) 1116 break; 1117 flags = *(struct sbni_flags*)&ifr->ifr_data; 1118 if (flags.fixed_rxl) { 1119 sc->delta_rxl = 0; 1120 sc->cur_rxl_index = flags.rxl; 1121 } else { 1122 sc->delta_rxl = DEF_RXL_DELTA; --- 5 unchanged lines hidden (view full) --- 1128 bcopy((caddr_t) &flags, 1129 (caddr_t) IF_LLADDR(sc->ifp)+3, 3); 1130 1131 /* Don't be afraid... */ 1132 sbni_outb(sc, CSR1, *(char*)(&sc->csr1) | PR_RES); 1133 break; 1134 1135 case SIOCRINSTATS: |
1135 if (!(error = suser(td))) /* root only */ | 1136 if (!(error = priv_check(td, PRIV_DRIVER))) /* root only */ |
1136 bzero(&sc->in_stats, sizeof(struct sbni_in_stats)); 1137 break; 1138 1139 default: 1140 error = ether_ioctl(ifp, command, data); 1141 break; 1142 } 1143 --- 166 unchanged lines hidden --- | 1137 bzero(&sc->in_stats, sizeof(struct sbni_in_stats)); 1138 break; 1139 1140 default: 1141 error = ether_ioctl(ifp, command, data); 1142 break; 1143 } 1144 --- 166 unchanged lines hidden --- |