diff options
| author | dyoung <dyoung@NetBSD.org> | 2008-02-07 01:21:52 +0000 |
|---|---|---|
| committer | dyoung <dyoung@NetBSD.org> | 2008-02-07 01:21:52 +0000 |
| commit | 2ccede0a9c78ce5a2ea80ccfebc140e543a8679c (patch) | |
| tree | e75d5563bc5787696ff61b7cfdaf95c6ba77e6be /sys/dev/usb | |
| parent | 809c851d23f2ba54b7b479f2d05f03ee6c7994b7 (diff) | |
Start patching up the kernel so that a network driver always has
the opportunity to handle an ioctl before generic ifioctl handling
occurs. This will ease extending the kernel and sharing of code
between drivers.
First steps: Make the signature of ifioctl_common() match struct
ifinet->if_ioctl. Convert SIOCSIFCAP and SIOCSIFMTU to the new
ifioctl() regime, throughout the kernel.
Diffstat (limited to 'sys/dev/usb')
| -rw-r--r-- | sys/dev/usb/if_aue.c | 10 | ||||
| -rw-r--r-- | sys/dev/usb/if_axe.c | 10 | ||||
| -rw-r--r-- | sys/dev/usb/if_cdce.c | 10 | ||||
| -rw-r--r-- | sys/dev/usb/if_cue.c | 10 | ||||
| -rw-r--r-- | sys/dev/usb/if_kue.c | 10 | ||||
| -rw-r--r-- | sys/dev/usb/if_upl.c | 8 |
6 files changed, 29 insertions, 29 deletions
diff --git a/sys/dev/usb/if_aue.c b/sys/dev/usb/if_aue.c index a3155b641ea..fbfff47f432 100644 --- a/sys/dev/usb/if_aue.c +++ b/sys/dev/usb/if_aue.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_aue.c,v 1.109 2008/01/19 22:10:20 dyoung Exp $ */ +/* $NetBSD: if_aue.c,v 1.110 2008/02/07 01:21:58 dyoung Exp $ */ /* * Copyright (c) 1997, 1998, 1999, 2000 * Bill Paul <wpaul@ee.columbia.edu>. All rights reserved. @@ -77,7 +77,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_aue.c,v 1.109 2008/01/19 22:10:20 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_aue.c,v 1.110 2008/02/07 01:21:58 dyoung Exp $"); #if defined(__NetBSD__) #include "opt_inet.h" @@ -1607,10 +1607,10 @@ aue_ioctl(struct ifnet *ifp, u_long command, void *data) break; case SIOCSIFMTU: - if (ifr->ifr_mtu > ETHERMTU) + if (ifr->ifr_mtu < ETHERMIN || ifr->ifr_mtu > ETHERMTU) error = EINVAL; - else - ifp->if_mtu = ifr->ifr_mtu; + else if ((error = ifioctl_common(ifp, command, data)) == ENETRESET) + error = 0; break; case SIOCSIFFLAGS: diff --git a/sys/dev/usb/if_axe.c b/sys/dev/usb/if_axe.c index fe53e31252f..4ecdac05e91 100644 --- a/sys/dev/usb/if_axe.c +++ b/sys/dev/usb/if_axe.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_axe.c,v 1.22 2008/01/19 22:10:20 dyoung Exp $ */ +/* $NetBSD: if_axe.c,v 1.23 2008/02/07 01:21:58 dyoung Exp $ */ /* * Copyright (c) 1997, 1998, 1999, 2000-2003 @@ -73,7 +73,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1.22 2008/01/19 22:10:20 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1.23 2008/02/07 01:21:58 dyoung Exp $"); #if defined(__NetBSD__) #include "opt_inet.h" @@ -1155,10 +1155,10 @@ axe_ioctl(struct ifnet *ifp, u_long cmd, void *data) break; case SIOCSIFMTU: - if (ifr->ifr_mtu > ETHERMTU) + if (ifr->ifr_mtu < ETHERMIN || ifr->ifr_mtu > ETHERMTU) error = EINVAL; - else - ifp->if_mtu = ifr->ifr_mtu; + else if ((error = ifioctl_common(ifp, cmd, data)) == ENETRESET) + error = 0; break; case SIOCSIFFLAGS: diff --git a/sys/dev/usb/if_cdce.c b/sys/dev/usb/if_cdce.c index 92e2ef94bfb..beb11f01e79 100644 --- a/sys/dev/usb/if_cdce.c +++ b/sys/dev/usb/if_cdce.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_cdce.c,v 1.14 2007/03/13 13:51:54 drochner Exp $ */ +/* $NetBSD: if_cdce.c,v 1.15 2008/02/07 01:21:59 dyoung Exp $ */ /* * Copyright (c) 1997, 1998, 1999, 2000-2003 Bill Paul <wpaul@windriver.com> @@ -41,7 +41,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_cdce.c,v 1.14 2007/03/13 13:51:54 drochner Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_cdce.c,v 1.15 2008/02/07 01:21:59 dyoung Exp $"); #include "bpfilter.h" #include <sys/param.h> @@ -466,10 +466,10 @@ cdce_ioctl(struct ifnet *ifp, u_long command, void *data) break; case SIOCSIFMTU: - if (ifr->ifr_mtu > ETHERMTU) + if (ifr->ifr_mtu < ETHERMIN || ifr->ifr_mtu > ETHERMTU) error = EINVAL; - else - ifp->if_mtu = ifr->ifr_mtu; + else if ((error = ifioctl_common(ifp, command, data)) == ENETRESET) + error = 0; break; case SIOCSIFFLAGS: diff --git a/sys/dev/usb/if_cue.c b/sys/dev/usb/if_cue.c index f1290c87966..efca313cc00 100644 --- a/sys/dev/usb/if_cue.c +++ b/sys/dev/usb/if_cue.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_cue.c,v 1.51 2007/08/29 22:33:43 dyoung Exp $ */ +/* $NetBSD: if_cue.c,v 1.52 2008/02/07 01:21:59 dyoung Exp $ */ /* * Copyright (c) 1997, 1998, 1999, 2000 * Bill Paul <wpaul@ee.columbia.edu>. All rights reserved. @@ -56,7 +56,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_cue.c,v 1.51 2007/08/29 22:33:43 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_cue.c,v 1.52 2008/02/07 01:21:59 dyoung Exp $"); #if defined(__NetBSD__) #include "opt_inet.h" @@ -1183,10 +1183,10 @@ cue_ioctl(struct ifnet *ifp, u_long command, void *data) break; case SIOCSIFMTU: - if (ifr->ifr_mtu > ETHERMTU) + if (ifr->ifr_mtu < ETHERMIN || ifr->ifr_mtu > ETHERMTU) error = EINVAL; - else - ifp->if_mtu = ifr->ifr_mtu; + else if ((error = ifioctl_common(ifp, command, data)) == ENETRESET) + error = 0; break; case SIOCSIFFLAGS: diff --git a/sys/dev/usb/if_kue.c b/sys/dev/usb/if_kue.c index a0434c07253..5ae9bf8c6b5 100644 --- a/sys/dev/usb/if_kue.c +++ b/sys/dev/usb/if_kue.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_kue.c,v 1.61 2007/12/20 21:08:19 dyoung Exp $ */ +/* $NetBSD: if_kue.c,v 1.62 2008/02/07 01:21:59 dyoung Exp $ */ /* * Copyright (c) 1997, 1998, 1999, 2000 * Bill Paul <wpaul@ee.columbia.edu>. All rights reserved. @@ -70,7 +70,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_kue.c,v 1.61 2007/12/20 21:08:19 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_kue.c,v 1.62 2008/02/07 01:21:59 dyoung Exp $"); #if defined(__NetBSD__) #include "opt_inet.h" @@ -1091,10 +1091,10 @@ kue_ioctl(struct ifnet *ifp, u_long command, void *data) break; case SIOCSIFMTU: - if (ifr->ifr_mtu > ETHERMTU) + if (ifr->ifr_mtu < ETHERMIN || ifr->ifr_mtu > ETHERMTU) error = EINVAL; - else - ifp->if_mtu = ifr->ifr_mtu; + else if ((error = ifioctl_common(ifp, command, data)) == ENETRESET) + error = 0; break; case SIOCSIFFLAGS: diff --git a/sys/dev/usb/if_upl.c b/sys/dev/usb/if_upl.c index bcac8679321..6426c188ea1 100644 --- a/sys/dev/usb/if_upl.c +++ b/sys/dev/usb/if_upl.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_upl.c,v 1.29 2007/03/13 13:51:54 drochner Exp $ */ +/* $NetBSD: if_upl.c,v 1.30 2008/02/07 01:21:59 dyoung Exp $ */ /* * Copyright (c) 2000 The NetBSD Foundation, Inc. * All rights reserved. @@ -41,7 +41,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_upl.c,v 1.29 2007/03/13 13:51:54 drochner Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_upl.c,v 1.30 2008/02/07 01:21:59 dyoung Exp $"); #include "opt_inet.h" #include "bpfilter.h" @@ -880,8 +880,8 @@ upl_ioctl(struct ifnet *ifp, u_long command, void *data) case SIOCSIFMTU: if (ifr->ifr_mtu > UPL_BUFSZ) error = EINVAL; - else - ifp->if_mtu = ifr->ifr_mtu; + else if ((error = ifioctl_common(ifp, command, data)) == ENETRESET) + error = 0; break; case SIOCSIFFLAGS: |
