head 1.18; access; symbols netbsd-10-0-RELEASE:1.18 netbsd-10-0-RC6:1.18 netbsd-10-0-RC5:1.18 netbsd-10-0-RC4:1.18 netbsd-10-0-RC3:1.18 netbsd-10-0-RC2:1.18 thorpej-ifq:1.18.6.1.0.2 thorpej-ifq-base:1.18.6.1 thorpej-altq-separation:1.18.0.6 thorpej-altq-separation-base:1.18 netbsd-10-0-RC1:1.18 netbsd-10:1.18.0.4 netbsd-10-base:1.18 bouyer-sunxi-drm:1.18.0.2 bouyer-sunxi-drm-base:1.18 netbsd-9-3-RELEASE:1.17 thorpej-i2c-spi-conf2:1.17.0.44 thorpej-i2c-spi-conf2-base:1.17 thorpej-futex2:1.17.0.42 thorpej-futex2-base:1.17 thorpej-cfargs2:1.17.0.40 thorpej-cfargs2-base:1.17 cjep_sun2x-base1:1.17 cjep_sun2x:1.17.0.38 cjep_sun2x-base:1.17 cjep_staticlib_x-base1:1.17 netbsd-9-2-RELEASE:1.17 cjep_staticlib_x:1.17.0.36 cjep_staticlib_x-base:1.17 thorpej-i2c-spi-conf:1.17.0.34 thorpej-i2c-spi-conf-base:1.17 thorpej-cfargs:1.17.0.32 thorpej-cfargs-base:1.17 thorpej-futex:1.17.0.30 thorpej-futex-base:1.17 netbsd-9-1-RELEASE:1.17 bouyer-xenpvh-base2:1.17 phil-wifi-20200421:1.17 bouyer-xenpvh-base1:1.17 phil-wifi-20200411:1.17 bouyer-xenpvh:1.17.0.28 bouyer-xenpvh-base:1.17 is-mlppp:1.17.0.26 is-mlppp-base:1.17 phil-wifi-20200406:1.17 netbsd-8-2-RELEASE:1.17 ad-namecache-base3:1.17 netbsd-9-0-RELEASE:1.17 netbsd-9-0-RC2:1.17 ad-namecache-base2:1.17 ad-namecache-base1:1.17 ad-namecache:1.17.0.24 ad-namecache-base:1.17 netbsd-9-0-RC1:1.17 phil-wifi-20191119:1.17 netbsd-9:1.17.0.22 netbsd-9-base:1.17 phil-wifi-20190609:1.17 netbsd-8-1-RELEASE:1.17 netbsd-8-1-RC1:1.17 isaki-audio2:1.17.0.20 isaki-audio2-base:1.17 pgoyette-compat-merge-20190127:1.17 pgoyette-compat-20190127:1.17 pgoyette-compat-20190118:1.17 pgoyette-compat-1226:1.17 pgoyette-compat-1126:1.17 pgoyette-compat-1020:1.17 pgoyette-compat-0930:1.17 pgoyette-compat-0906:1.17 netbsd-7-2-RELEASE:1.16 pgoyette-compat-0728:1.17 netbsd-8-0-RELEASE:1.17 phil-wifi:1.17.0.18 phil-wifi-base:1.17 pgoyette-compat-0625:1.17 netbsd-8-0-RC2:1.17 pgoyette-compat-0521:1.17 pgoyette-compat-0502:1.17 pgoyette-compat-0422:1.17 netbsd-8-0-RC1:1.17 pgoyette-compat-0415:1.17 pgoyette-compat-0407:1.17 pgoyette-compat-0330:1.17 pgoyette-compat-0322:1.17 pgoyette-compat-0315:1.17 netbsd-7-1-2-RELEASE:1.16 pgoyette-compat:1.17.0.16 pgoyette-compat-base:1.17 netbsd-7-1-1-RELEASE:1.16 tls-maxphys-base-20171202:1.17 matt-nb8-mediatek:1.17.0.14 matt-nb8-mediatek-base:1.17 nick-nhusb-base-20170825:1.17 perseant-stdc-iso10646:1.17.0.12 perseant-stdc-iso10646-base:1.17 netbsd-8:1.17.0.10 netbsd-8-base:1.17 prg-localcount2-base3:1.17 prg-localcount2-base2:1.17 prg-localcount2-base1:1.17 prg-localcount2:1.17.0.8 prg-localcount2-base:1.17 pgoyette-localcount-20170426:1.17 bouyer-socketcan-base1:1.17 jdolecek-ncq:1.17.0.6 jdolecek-ncq-base:1.17 pgoyette-localcount-20170320:1.17 netbsd-7-1:1.16.0.112 netbsd-7-1-RELEASE:1.16 netbsd-7-1-RC2:1.16 nick-nhusb-base-20170204:1.17 netbsd-7-nhusb-base-20170116:1.16 bouyer-socketcan:1.17.0.4 bouyer-socketcan-base:1.17 pgoyette-localcount-20170107:1.17 netbsd-7-1-RC1:1.16 nick-nhusb-base-20161204:1.17 pgoyette-localcount-20161104:1.17 netbsd-7-0-2-RELEASE:1.16 nick-nhusb-base-20161004:1.17 localcount-20160914:1.17 netbsd-7-nhusb:1.16.0.110 netbsd-7-nhusb-base:1.16 pgoyette-localcount-20160806:1.17 pgoyette-localcount-20160726:1.17 pgoyette-localcount:1.17.0.2 pgoyette-localcount-base:1.17 nick-nhusb-base-20160907:1.17 nick-nhusb-base-20160529:1.17 netbsd-7-0-1-RELEASE:1.16 nick-nhusb-base-20160422:1.17 nick-nhusb-base-20160319:1.16 nick-nhusb-base-20151226:1.16 netbsd-7-0:1.16.0.108 netbsd-7-0-RELEASE:1.16 nick-nhusb-base-20150921:1.16 netbsd-7-0-RC3:1.16 netbsd-7-0-RC2:1.16 netbsd-7-0-RC1:1.16 nick-nhusb-base-20150606:1.16 nick-nhusb-base-20150406:1.16 nick-nhusb:1.16.0.106 nick-nhusb-base:1.16 netbsd-5-2-3-RELEASE:1.16 netbsd-5-1-5-RELEASE:1.16 netbsd-6-0-6-RELEASE:1.16 netbsd-6-1-5-RELEASE:1.16 netbsd-7:1.16.0.104 netbsd-7-base:1.16 yamt-pagecache-base9:1.16 yamt-pagecache-tag8:1.16 netbsd-6-1-4-RELEASE:1.16 netbsd-6-0-5-RELEASE:1.16 tls-earlyentropy:1.16.0.102 tls-earlyentropy-base:1.16 riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.16 riastradh-drm2-base3:1.16 netbsd-6-1-3-RELEASE:1.16 netbsd-6-0-4-RELEASE:1.16 netbsd-5-2-2-RELEASE:1.16 netbsd-5-1-4-RELEASE:1.16 netbsd-6-1-2-RELEASE:1.16 netbsd-6-0-3-RELEASE:1.16 netbsd-5-2-1-RELEASE:1.16 netbsd-5-1-3-RELEASE:1.16 rmind-smpnet-nbase:1.16 netbsd-6-1-1-RELEASE:1.16 riastradh-drm2-base2:1.16 riastradh-drm2-base1:1.16 riastradh-drm2:1.16.0.100 riastradh-drm2-base:1.16 rmind-smpnet:1.16.0.92 rmind-smpnet-base:1.16 netbsd-6-1:1.16.0.98 netbsd-6-0-2-RELEASE:1.16 netbsd-6-1-RELEASE:1.16 khorben-n900:1.16.0.96 netbsd-6-1-RC4:1.16 netbsd-6-1-RC3:1.16 agc-symver:1.16.0.94 agc-symver-base:1.16 netbsd-6-1-RC2:1.16 netbsd-6-1-RC1:1.16 yamt-pagecache-base8:1.16 netbsd-5-2:1.16.0.90 netbsd-6-0-1-RELEASE:1.16 yamt-pagecache-base7:1.16 netbsd-5-2-RELEASE:1.16 netbsd-5-2-RC1:1.16 matt-nb6-plus-nbase:1.16 yamt-pagecache-base6:1.16 netbsd-6-0:1.16.0.88 netbsd-6-0-RELEASE:1.16 netbsd-6-0-RC2:1.16 tls-maxphys:1.16.0.86 tls-maxphys-base:1.16 matt-nb6-plus:1.16.0.84 matt-nb6-plus-base:1.16 netbsd-6-0-RC1:1.16 jmcneill-usbmp-base10:1.16 yamt-pagecache-base5:1.16 jmcneill-usbmp-base9:1.16 yamt-pagecache-base4:1.16 jmcneill-usbmp-base8:1.16 jmcneill-usbmp-base7:1.16 jmcneill-usbmp-base6:1.16 jmcneill-usbmp-base5:1.16 jmcneill-usbmp-base4:1.16 jmcneill-usbmp-base3:1.16 jmcneill-usbmp-pre-base2:1.16 jmcneill-usbmp-base2:1.16 netbsd-6:1.16.0.82 netbsd-6-base:1.16 netbsd-5-1-2-RELEASE:1.16 netbsd-5-1-1-RELEASE:1.16 jmcneill-usbmp:1.16.0.80 jmcneill-usbmp-base:1.16 jmcneill-audiomp3:1.16.0.78 jmcneill-audiomp3-base:1.16 yamt-pagecache-base3:1.16 yamt-pagecache-base2:1.16 yamt-pagecache:1.16.0.76 yamt-pagecache-base:1.16 rmind-uvmplock-nbase:1.16 cherry-xenmp:1.16.0.74 cherry-xenmp-base:1.16 bouyer-quota2-nbase:1.16 bouyer-quota2:1.16.0.72 bouyer-quota2-base:1.16 jruoho-x86intr:1.16.0.70 jruoho-x86intr-base:1.16 matt-mips64-premerge-20101231:1.16 matt-nb5-mips64-premerge-20101231:1.16 matt-nb5-pq3:1.16.0.68 matt-nb5-pq3-base:1.16 netbsd-5-1:1.16.0.66 netbsd-5-1-RELEASE:1.16 uebayasi-xip-base4:1.16 uebayasi-xip-base3:1.16 yamt-nfs-mp-base11:1.16 netbsd-5-1-RC4:1.16 matt-nb5-mips64-k15:1.16 uebayasi-xip-base2:1.16 yamt-nfs-mp-base10:1.16 netbsd-5-1-RC3:1.16 netbsd-5-1-RC2:1.16 uebayasi-xip-base1:1.16 netbsd-5-1-RC1:1.16 rmind-uvmplock:1.16.0.64 rmind-uvmplock-base:1.16 yamt-nfs-mp-base9:1.16 uebayasi-xip:1.16.0.62 uebayasi-xip-base:1.16 netbsd-5-0-2-RELEASE:1.16 matt-nb5-mips64-premerge-20091211:1.16 matt-premerge-20091211:1.16 yamt-nfs-mp-base8:1.16 matt-nb5-mips64-u2-k2-k4-k7-k8-k9:1.16 matt-nb4-mips64-k7-u2a-k9b:1.16 matt-nb5-mips64-u1-k1-k5:1.16 yamt-nfs-mp-base7:1.16 matt-nb5-mips64:1.16.0.60 netbsd-5-0-1-RELEASE:1.16 jymxensuspend-base:1.16 yamt-nfs-mp-base6:1.16 yamt-nfs-mp-base5:1.16 yamt-nfs-mp-base4:1.16 jym-xensuspend-nbase:1.16 yamt-nfs-mp-base3:1.16 nick-hppapmap-base4:1.16 nick-hppapmap-base3:1.16 netbsd-5-0:1.16.0.58 netbsd-5-0-RELEASE:1.16 netbsd-5-0-RC4:1.16 netbsd-5-0-RC3:1.16 nick-hppapmap-base2:1.16 netbsd-5-0-RC2:1.16 jym-xensuspend:1.16.0.56 jym-xensuspend-base:1.16 netbsd-5-0-RC1:1.16 haad-dm-base2:1.16 haad-nbase2:1.16 ad-audiomp2:1.16.0.54 ad-audiomp2-base:1.16 netbsd-5:1.16.0.52 netbsd-5-base:1.16 nick-hppapmap:1.16.0.50 nick-hppapmap-base:1.16 matt-mips64-base2:1.16 matt-mips64:1.16.0.48 haad-dm-base1:1.16 wrstuden-revivesa-base-4:1.16 netbsd-4-0-1-RELEASE:1.15 wrstuden-revivesa-base-3:1.16 wrstuden-revivesa-base-2:1.16 wrstuden-fixsa-newbase:1.15 nick-csl-alignment-base5:1.16 haad-dm:1.16.0.46 haad-dm-base:1.16 wrstuden-revivesa-base-1:1.16 simonb-wapbl-nbase:1.16 yamt-pf42-base4:1.16 simonb-wapbl:1.16.0.44 simonb-wapbl-base:1.16 yamt-pf42-base3:1.16 hpcarm-cleanup-nbase:1.16 yamt-pf42-baseX:1.16 yamt-pf42-base2:1.16 yamt-nfs-mp-base2:1.16 wrstuden-revivesa:1.16.0.42 wrstuden-revivesa-base:1.16 yamt-nfs-mp:1.16.0.40 yamt-nfs-mp-base:1.16 yamt-pf42:1.16.0.38 yamt-pf42-base:1.16 ad-socklock-base1:1.16 yamt-lazymbuf-base15:1.16 yamt-lazymbuf-base14:1.16 keiichi-mipv6-nbase:1.16 mjf-devfs2:1.16.0.36 mjf-devfs2-base:1.16 nick-net80211-sync:1.16.0.34 nick-net80211-sync-base:1.16 keiichi-mipv6:1.16.0.32 keiichi-mipv6-base:1.16 ad-audiomp-base-1:1.16 bouyer-xeni386-merge1:1.16 matt-armv6-prevmlocking:1.16 wrstuden-fixsa-base-1:1.15 vmlocking2-base3:1.16 netbsd-4-0:1.15.0.12 netbsd-4-0-RELEASE:1.15 bouyer-xeni386-nbase:1.16 yamt-kmem-base3:1.16 cube-autoconf:1.16.0.30 cube-autoconf-base:1.16 yamt-kmem-base2:1.16 bouyer-xeni386:1.16.0.28 bouyer-xeni386-base:1.16 yamt-kmem:1.16.0.26 yamt-kmem-base:1.16 vmlocking2-base2:1.16 reinoud-bufcleanup-nbase:1.16 vmlocking2:1.16.0.24 vmlocking2-base1:1.16 netbsd-4-0-RC5:1.15 matt-nb4-arm:1.15.0.10 matt-nb4-arm-base:1.15 matt-armv6-nbase:1.16 jmcneill-base:1.16 netbsd-4-0-RC4:1.15 mjf-devfs:1.16.0.22 mjf-devfs-base:1.16 bouyer-xenamd64-base2:1.16 vmlocking-nbase:1.16 yamt-x86pmap-base4:1.16 bouyer-xenamd64:1.16.0.20 bouyer-xenamd64-base:1.16 netbsd-4-0-RC3:1.15 yamt-x86pmap-base3:1.16 yamt-x86pmap-base2:1.16 netbsd-4-0-RC2:1.15 yamt-x86pmap:1.16.0.18 yamt-x86pmap-base:1.16 netbsd-4-0-RC1:1.15 matt-armv6:1.16.0.16 matt-armv6-base:1.16 matt-mips64-base:1.16 jmcneill-pm:1.16.0.14 jmcneill-pm-base:1.16 hpcarm-cleanup:1.16.0.12 hpcarm-cleanup-base:1.16 nick-csl-alignment:1.16.0.10 nick-csl-alignment-base:1.16 netbsd-3-1-1-RELEASE:1.6 netbsd-3-0-3-RELEASE:1.6 yamt-idlelwp-base8:1.16 wrstuden-fixsa:1.15.0.8 wrstuden-fixsa-base:1.15 thorpej-atomic:1.16.0.8 thorpej-atomic-base:1.16 reinoud-bufcleanup:1.16.0.6 reinoud-bufcleanup-base:1.16 mjf-ufs-trans:1.16.0.4 mjf-ufs-trans-base:1.16 vmlocking:1.16.0.2 vmlocking-base:1.16 ad-audiomp:1.15.0.6 ad-audiomp-base:1.15 yamt-idlelwp:1.15.0.4 post-newlock2-merge:1.15 newlock2-nbase:1.15 yamt-splraiseipl-base5:1.15 yamt-splraiseipl-base4:1.15 yamt-splraiseipl-base3:1.15 abandoned-netbsd-4-base:1.11 abandoned-netbsd-4:1.11.0.2 netbsd-3-1:1.6.0.14 netbsd-3-1-RELEASE:1.6 netbsd-3-0-2-RELEASE:1.6 yamt-splraiseipl-base2:1.14 netbsd-3-1-RC4:1.6 yamt-splraiseipl:1.11.0.6 yamt-splraiseipl-base:1.11 netbsd-3-1-RC3:1.6 yamt-pdpolicy-base9:1.11 newlock2:1.11.0.4 newlock2-base:1.15 yamt-pdpolicy-base8:1.11 netbsd-3-1-RC2:1.6 netbsd-3-1-RC1:1.6 yamt-pdpolicy-base7:1.11 netbsd-4:1.15.0.2 netbsd-4-base:1.15 yamt-pdpolicy-base6:1.10 chap-midi-nbase:1.10 netbsd-3-0-1-RELEASE:1.6 gdamore-uart:1.10.0.4 gdamore-uart-base:1.10 simonb-timcounters-final:1.7.6.1 yamt-pdpolicy-base5:1.10 chap-midi:1.10.0.2 chap-midi-base:1.10 yamt-pdpolicy-base4:1.7 yamt-pdpolicy-base3:1.7 peter-altq-base:1.7 peter-altq:1.7.0.12 yamt-pdpolicy-base2:1.7 elad-kernelauth-base:1.8 elad-kernelauth:1.7.0.10 yamt-pdpolicy:1.7.0.8 yamt-pdpolicy-base:1.7 yamt-uio_vmspace-base5:1.7 simonb-timecounters:1.7.0.6 simonb-timecounters-base:1.10 rpaulo-netinet-merge-pcb:1.7.0.4 rpaulo-netinet-merge-pcb-base:1.11 yamt-uio_vmspace:1.7.0.2 netbsd-3-0:1.6.0.12 netbsd-3-0-RELEASE:1.6 netbsd-3-0-RC6:1.6 yamt-readahead-base3:1.6 netbsd-3-0-RC5:1.6 netbsd-3-0-RC4:1.6 netbsd-3-0-RC3:1.6 yamt-readahead-base2:1.6 netbsd-3-0-RC2:1.6 yamt-readahead-pervnode:1.6 yamt-readahead-perfile:1.6 yamt-readahead:1.6.0.10 yamt-readahead-base:1.6 netbsd-3-0-RC1:1.6 yamt-vop-base3:1.6 netbsd-2-0-3-RELEASE:1.5 netbsd-2-1:1.5.0.14 yamt-vop-base2:1.6 thorpej-vnode-attr:1.6.0.8 thorpej-vnode-attr-base:1.6 netbsd-2-1-RELEASE:1.5 yamt-vop:1.6.0.6 yamt-vop-base:1.6 netbsd-2-1-RC6:1.5 netbsd-2-1-RC5:1.5 netbsd-2-1-RC4:1.5 netbsd-2-1-RC3:1.5 netbsd-2-1-RC2:1.5 netbsd-2-1-RC1:1.5 yamt-lazymbuf:1.6.0.4 yamt-km-base4:1.6 netbsd-2-0-2-RELEASE:1.5 yamt-km-base3:1.6 netbsd-3:1.6.0.2 netbsd-3-base:1.6 yamt-km-base2:1.5 yamt-km:1.5.0.10 yamt-km-base:1.5 kent-audio2:1.5.0.8 kent-audio2-base:1.6 netbsd-2-0-1-RELEASE:1.5 kent-audio1-beforemerge:1.5 netbsd-2:1.5.0.6 netbsd-2-base:1.5 kent-audio1:1.5.0.4 kent-audio1-base:1.5 netbsd-2-0-RELEASE:1.5 netbsd-2-0-RC5:1.5 netbsd-2-0-RC4:1.5 netbsd-2-0-RC3:1.5 netbsd-2-0-RC2:1.5 netbsd-2-0-RC1:1.5 netbsd-2-0:1.5.0.2 netbsd-2-0-base:1.5 netbsd-1-6-PATCH002-RELEASE:1.4 netbsd-1-6-PATCH002:1.4 netbsd-1-6-PATCH002-RC4:1.4 netbsd-1-6-PATCH002-RC3:1.4 netbsd-1-6-PATCH002-RC2:1.4 netbsd-1-6-PATCH002-RC1:1.4 ktrace-lwp:1.4.0.16 ktrace-lwp-base:1.6 netbsd-1-6-PATCH001:1.4 netbsd-1-6-PATCH001-RELEASE:1.4 netbsd-1-6-PATCH001-RC3:1.4 netbsd-1-6-PATCH001-RC2:1.4 netbsd-1-6-PATCH001-RC1:1.4 nathanw_sa_end:1.2.4.2 nathanw_sa_before_merge:1.4 fvdl_fs64_base:1.4 gmcgarry_ctxsw:1.4.0.14 gmcgarry_ctxsw_base:1.4 gmcgarry_ucred:1.4.0.12 gmcgarry_ucred_base:1.4 nathanw_sa_base:1.4 kqueue-aftermerge:1.4 kqueue-beforemerge:1.4 netbsd-1-6-RELEASE:1.4 netbsd-1-6-RC3:1.4 netbsd-1-6-RC2:1.4 netbsd-1-6-RC1:1.4 netbsd-1-6:1.4.0.10 netbsd-1-6-base:1.4 gehenna-devsw:1.4.0.8 gehenna-devsw-base:1.4 eeh-devprop:1.4.0.6 eeh-devprop-base:1.4 newlock:1.4.0.4 newlock-base:1.4 ifpoll-base:1.4 thorpej-mips-cache:1.3.0.6 thorpej-mips-cache-base:1.3 thorpej-devvp-base3:1.3 thorpej-devvp-base2:1.3 post-chs-ubcperf:1.3 pre-chs-ubcperf:1.3 thorpej-devvp:1.3.0.4 thorpej-devvp-base:1.3 kqueue:1.3.0.2 kqueue-base:1.4 thorpej_scsipi_beforemerge:1.3 nathanw_sa:1.2.0.4 thorpej_scsipi_nbase:1.3 thorpej_scsipi_base:1.3 thorpej_scsipi:1.2.0.2 kame_15_20001214:1.1.1.1 kame:1.1.1; locks; strict; comment @ * @; 1.18 date 2021.09.21.14.30.15; author christos; state Exp; branches 1.18.6.1; next 1.17; commitid jm7kuiFGDezyAP9D; 1.17 date 2016.04.20.08.58.48; author knakahara; state Exp; branches; next 1.16; 1.16 date 2007.03.04.05.59.01; author christos; state Exp; branches 1.16.86.1 1.16.106.1; next 1.15; 1.15 date 2006.11.16.01.32.37; author christos; state Exp; branches 1.15.4.1; next 1.14; 1.14 date 2006.10.20.21.55.56; author elad; state Exp; branches; next 1.13; 1.13 date 2006.10.12.19.59.08; author peter; state Exp; branches; next 1.12; 1.12 date 2006.10.12.01.30.42; author christos; state Exp; branches; next 1.11; 1.11 date 2006.07.21.16.48.45; author ad; state Exp; branches 1.11.4.1 1.11.6.1; next 1.10; 1.10 date 2006.05.15.00.05.39; author christos; state Exp; branches; next 1.9; 1.9 date 2006.05.14.21.24.49; author elad; state Exp; branches; next 1.8; 1.8 date 2006.04.23.06.46.40; author christos; state Exp; branches; next 1.7; 1.7 date 2005.12.11.12.16.03; author christos; state Exp; branches 1.7.4.1 1.7.6.1 1.7.8.1 1.7.10.1 1.7.12.1; next 1.6; 1.6 date 2005.02.26.23.04.16; author perry; state Exp; branches 1.6.4.1; next 1.5; 1.5 date 2003.11.09.22.11.12; author christos; state Exp; branches 1.5.8.1 1.5.10.1; next 1.4; 1.4 date 2001.11.12.23.14.21; author lukem; state Exp; branches 1.4.16.1; next 1.3; 1.3 date 2001.04.13.23.29.56; author thorpej; state Exp; branches 1.3.2.1 1.3.4.1; next 1.2; 1.2 date 2000.12.14.08.49.50; author thorpej; state Exp; branches 1.2.2.1 1.2.4.1; next 1.1; 1.1 date 2000.12.14.08.42.31; author thorpej; state Exp; branches 1.1.1.1; next ; 1.18.6.1 date 2023.11.11.13.16.30; author thorpej; state Exp; branches; next ; commitid NLzRdyGORahU3cME; 1.16.86.1 date 2017.12.03.11.35.43; author jdolecek; state Exp; branches; next ; commitid XcIYRZTAh1LmerhA; 1.16.106.1 date 2016.04.22.15.44.08; author skrll; state Exp; branches; next ; 1.15.4.1 date 2007.03.12.05.45.02; author rmind; state Exp; branches; next ; 1.11.4.1 date 2006.11.18.21.39.03; author ad; state Exp; branches; next ; 1.11.6.1 date 2006.10.22.06.04.30; author yamt; state Exp; branches; next 1.11.6.2; 1.11.6.2 date 2006.12.10.07.15.44; author yamt; state Exp; branches; next ; 1.7.4.1 date 2006.09.09.02.36.40; author rpaulo; state Exp; branches; next ; 1.7.6.1 date 2006.06.01.22.34.09; author kardel; state Exp; branches; next ; 1.7.8.1 date 2006.05.24.10.56.32; author yamt; state Exp; branches; next 1.7.8.2; 1.7.8.2 date 2006.08.11.15.40.58; author yamt; state Exp; branches; next ; 1.7.10.1 date 2006.03.08.00.23.46; author elad; state Exp; branches; next 1.7.10.2; 1.7.10.2 date 2006.03.10.13.29.35; author elad; state Exp; branches; next 1.7.10.3; 1.7.10.3 date 2006.05.11.23.26.17; author elad; state Exp; branches; next ; 1.7.12.1 date 2006.03.18.12.08.18; author peter; state Exp; branches; next 1.7.12.2; 1.7.12.2 date 2006.06.09.19.52.35; author peter; state Exp; branches; next 1.7.12.3; 1.7.12.3 date 2006.09.25.03.56.59; author peter; state Exp; branches; next ; 1.6.4.1 date 2006.06.21.14.47.46; author yamt; state Exp; branches; next 1.6.4.2; 1.6.4.2 date 2006.12.30.20.45.17; author yamt; state Exp; branches; next 1.6.4.3; 1.6.4.3 date 2007.09.03.14.21.56; author yamt; state Exp; branches; next ; 1.5.8.1 date 2005.04.29.11.27.58; author kent; state Exp; branches; next ; 1.5.10.1 date 2005.03.19.08.32.44; author yamt; state Exp; branches; next ; 1.4.16.1 date 2004.08.03.10.30.47; author skrll; state Exp; branches; next 1.4.16.2; 1.4.16.2 date 2004.08.12.16.15.32; author skrll; state Exp; branches; next 1.4.16.3; 1.4.16.3 date 2004.09.18.14.30.29; author skrll; state Exp; branches; next 1.4.16.4; 1.4.16.4 date 2004.09.21.13.11.19; author skrll; state Exp; branches; next 1.4.16.5; 1.4.16.5 date 2005.03.04.16.38.00; author skrll; state Exp; branches; next ; 1.3.2.1 date 2002.01.10.19.35.56; author thorpej; state Exp; branches; next ; 1.3.4.1 date 2001.10.10.11.55.47; author fvdl; state Exp; branches; next ; 1.2.2.1 date 2000.12.14.08.49.50; author bouyer; state dead; branches; next 1.2.2.2; 1.2.2.2 date 2001.01.05.17.39.36; author bouyer; state Exp; branches; next 1.2.2.3; 1.2.2.3 date 2001.04.21.17.46.11; author bouyer; state Exp; branches; next ; 1.2.4.1 date 2001.06.21.18.12.48; author nathanw; state Exp; branches; next 1.2.4.2; 1.2.4.2 date 2001.11.14.19.12.38; author nathanw; state Exp; branches; next ; 1.1.1.1 date 2000.12.14.08.42.31; author thorpej; state Exp; branches; next ; desc @@ 1.18 log @Remove FreeBSD blocks that did not compile anyway, and use l->l_cred consistently. @ text @/* $NetBSD: altq_fifoq.c,v 1.17 2016/04/20 08:58:48 knakahara Exp $ */ /* $KAME: altq_fifoq.c,v 1.12 2003/07/10 12:07:48 kjc Exp $ */ /* * Copyright (C) 1997-2002 * Sony Computer Science Laboratories Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY SONY CSL AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL SONY CSL OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include __KERNEL_RCSID(0, "$NetBSD: altq_fifoq.c,v 1.17 2016/04/20 08:58:48 knakahara Exp $"); #ifdef _KERNEL_OPT #include "opt_altq.h" #endif #ifdef ALTQ_FIFOQ /* fifoq is enabled by ALTQ_FIFOQ option in opt_altq.h */ /* * FIFOQ is an altq sample implementation. There will be little * need to use FIFOQ as an alternative queueing scheme. * But this code is provided as a template for those who want to * write their own queueing schemes. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef ALTQ3_COMPAT #define FIFOQ_STATS /* collect statistics */ /* fifoq_list keeps all fifoq_state_t's allocated. */ static fifoq_state_t *fifoq_list = NULL; /* internal function prototypes */ static int fifoq_enqueue(struct ifaltq *, struct mbuf *); static struct mbuf *fifoq_dequeue(struct ifaltq *, int); static int fifoq_detach(fifoq_state_t *); static int fifoq_request(struct ifaltq *, int, void *); static void fifoq_purge(fifoq_state_t *); /* * fifoq device interface */ altqdev_decl(fifoq); int fifoqopen(dev_t dev, int flag, int fmt, struct lwp *l) { /* everything will be done when the queueing scheme is attached. */ return 0; } /* * there are 2 ways to act on close. * detach-all-on-close: * use for the daemon style approach. if the daemon dies, all the * resource will be released. * no-action-on-close: * use for the command style approach. (e.g. fifoq on/off) * * note: close is called not on every close but when the last reference * is removed (only once with multiple simultaneous references.) */ int fifoqclose(dev_t dev, int flag, int fmt, struct lwp *l) { fifoq_state_t *q; int err, error = 0; while ((q = fifoq_list) != NULL) { /* destroy all */ err = fifoq_detach(q); if (err != 0 && error == 0) error = err; } return error; } int fifoqioctl(dev_t dev, ioctlcmd_t cmd, void *addr, int flag, struct lwp *l) { fifoq_state_t *q; struct fifoq_interface *ifacep; struct ifnet *ifp; int error = 0; /* check super-user privilege */ switch (cmd) { case FIFOQ_GETSTATS: break; default: if ((error = kauth_authorize_network(l->l_cred, KAUTH_NETWORK_ALTQ, KAUTH_REQ_NETWORK_ALTQ_FIFOQ, NULL, NULL, NULL)) != 0) return (error); break; } switch (cmd) { case FIFOQ_ENABLE: ifacep = (struct fifoq_interface *)addr; if ((q = altq_lookup(ifacep->fifoq_ifname, ALTQT_FIFOQ)) == NULL) { error = EBADF; break; } error = altq_enable(q->q_ifq); break; case FIFOQ_DISABLE: ifacep = (struct fifoq_interface *)addr; if ((q = altq_lookup(ifacep->fifoq_ifname, ALTQT_FIFOQ)) == NULL) { error = EBADF; break; } error = altq_disable(q->q_ifq); break; case FIFOQ_IF_ATTACH: ifp = ifunit(((struct fifoq_interface *)addr)->fifoq_ifname); if (ifp == NULL) { error = ENXIO; break; } /* allocate and initialize fifoq_state_t */ q = malloc(sizeof(fifoq_state_t), M_DEVBUF, M_WAITOK|M_ZERO); if (q == NULL) { error = ENOMEM; break; } q->q_ifq = &ifp->if_snd; q->q_head = q->q_tail = NULL; q->q_len = 0; q->q_limit = FIFOQ_LIMIT; /* * set FIFOQ to this ifnet structure. */ error = altq_attach(q->q_ifq, ALTQT_FIFOQ, q, fifoq_enqueue, fifoq_dequeue, fifoq_request, NULL, NULL); if (error) { free(q, M_DEVBUF); break; } /* add this state to the fifoq list */ q->q_next = fifoq_list; fifoq_list = q; break; case FIFOQ_IF_DETACH: ifacep = (struct fifoq_interface *)addr; if ((q = altq_lookup(ifacep->fifoq_ifname, ALTQT_FIFOQ)) == NULL) { error = EBADF; break; } error = fifoq_detach(q); break; case FIFOQ_GETSTATS: do { struct fifoq_getstats *q_stats; q_stats = (struct fifoq_getstats *)addr; if ((q = altq_lookup(q_stats->iface.fifoq_ifname, ALTQT_FIFOQ)) == NULL) { error = EBADF; break; } q_stats->q_len = q->q_len; q_stats->q_limit = q->q_limit; q_stats->xmit_cnt = q->q_stats.xmit_cnt; q_stats->drop_cnt = q->q_stats.drop_cnt; q_stats->period = q->q_stats.period; } while (/*CONSTCOND*/ 0); break; case FIFOQ_CONFIG: do { struct fifoq_conf *fc; int limit; fc = (struct fifoq_conf *)addr; if ((q = altq_lookup(fc->iface.fifoq_ifname, ALTQT_FIFOQ)) == NULL) { error = EBADF; break; } limit = fc->fifoq_limit; if (limit < 0) limit = 0; q->q_limit = limit; fc->fifoq_limit = limit; } while (/*CONSTCOND*/ 0); break; default: error = EINVAL; break; } return error; } /* * fifoq support routines */ /* * enqueue routine: * * returns: 0 when successfully queued. * ENOBUFS when drop occurs. */ static int fifoq_enqueue(struct ifaltq *ifq, struct mbuf *m) { fifoq_state_t *q = (fifoq_state_t *)ifq->altq_disc; /* if the queue is full, drop the incoming packet(drop-tail) */ if (q->q_len >= q->q_limit) { #ifdef FIFOQ_STATS PKTCNTR_ADD(&q->q_stats.drop_cnt, m_pktlen(m)); #endif m_freem(m); return (ENOBUFS); } /* enqueue the packet at the taile of the queue */ m->m_nextpkt = NULL; if (q->q_tail == NULL) q->q_head = m; else q->q_tail->m_nextpkt = m; q->q_tail = m; q->q_len++; ifq->ifq_len++; return 0; } /* * dequeue routine: * must be called in splnet. * * returns: mbuf dequeued. * NULL when no packet is available in the queue. */ /* * ALTDQ_PEEK is provided for drivers which need to know the next packet * to send in advance. * when ALTDQ_PEEK is specified, the next packet to be dequeued is * returned without dequeueing the packet. * when ALTDQ_DEQUEUE is called *immediately after* an ALTDQ_PEEK * operation, the same packet should be returned. */ static struct mbuf * fifoq_dequeue(struct ifaltq *ifq, int op) { fifoq_state_t *q = (fifoq_state_t *)ifq->altq_disc; struct mbuf *m = NULL; if (op == ALTDQ_POLL) return (q->q_head); if ((m = q->q_head) == NULL) return (NULL); if ((q->q_head = m->m_nextpkt) == NULL) q->q_tail = NULL; m->m_nextpkt = NULL; q->q_len--; ifq->ifq_len--; #ifdef FIFOQ_STATS PKTCNTR_ADD(&q->q_stats.xmit_cnt, m_pktlen(m)); if (q->q_len == 0) q->q_stats.period++; #endif return (m); } static int fifoq_request(struct ifaltq *ifq, int req, void *arg) { fifoq_state_t *q = (fifoq_state_t *)ifq->altq_disc; switch (req) { case ALTRQ_PURGE: fifoq_purge(q); break; } return (0); } static int fifoq_detach(fifoq_state_t *q) { fifoq_state_t *tmp; int error = 0; if (ALTQ_IS_ENABLED(q->q_ifq)) altq_disable(q->q_ifq); fifoq_purge(q); if ((error = altq_detach(q->q_ifq))) return (error); if (fifoq_list == q) fifoq_list = q->q_next; else { for (tmp = fifoq_list; tmp != NULL; tmp = tmp->q_next) if (tmp->q_next == q) { tmp->q_next = q->q_next; break; } if (tmp == NULL) printf("fifoq_detach: no state in fifoq_list!\n"); } free(q, M_DEVBUF); return (error); } /* * fifoq_purge * should be called in splnet or after disabling the fifoq. */ static void fifoq_purge(fifoq_state_t *q) { struct mbuf *m; while ((m = q->q_head) != NULL) { q->q_head = m->m_nextpkt; m_freem(m); } q->q_tail = NULL; q->q_len = 0; if (ALTQ_IS_ENABLED(q->q_ifq)) q->q_ifq->ifq_len = 0; } #ifdef KLD_MODULE static struct altqsw fifoq_sw = {"fifoq", fifoqopen, fifoqclose, fifoqioctl}; ALTQ_MODULE(altq_fifoq, ALTQT_FIFOQ, &fifoq_sw); #endif /* KLD_MODULE */ #endif /* ALTQ3_COMPAT */ #endif /* ALTQ_FIFOQ */ @ 1.18.6.1 log @Mostly de-tangle ifnet::if_snd from ifaltq, in a way that's minimally- invasive to the ALTQ code itself. The point of this is to lay the groundwork for future changes to ifqueue, which among other benefits, will also hide the ALTQ ABI from drivers. @ text @d1 1 a1 1 /* $NetBSD: altq_fifoq.c,v 1.18 2021/09/21 14:30:15 christos Exp $ */ d31 1 a31 1 __KERNEL_RCSID(0, "$NetBSD: altq_fifoq.c,v 1.18 2021/09/21 14:30:15 christos Exp $"); d176 1 a176 1 q->q_ifq = ifp->if_snd.ifq_altq; d284 1 a284 1 ALTQ_INC_LEN(ifq); d319 1 a319 1 ALTQ_DEC_LEN(ifq); d388 1 a388 1 ALTQ_SET_LEN(q->q_ifq, 0); @ 1.17 log @IFQ_ENQUEUE refactor (2/3) : eliminate pktattr argument from altq implemantation @ text @d1 1 a1 1 /* $NetBSD: altq_fifoq.c,v 1.16 2007/03/04 05:59:01 christos Exp $ */ d31 1 a31 1 __KERNEL_RCSID(0, "$NetBSD: altq_fifoq.c,v 1.16 2007/03/04 05:59:01 christos Exp $"); a133 4 #if (__FreeBSD_version > 400000) if ((error = suser(p)) != 0) return (error); #else a137 1 #endif @ 1.16 log @Kill caddr_t; there will be some MI fallout, but it will be fixed shortly. @ text @d1 1 a1 1 /* $NetBSD: altq_fifoq.c,v 1.15 2006/11/16 01:32:37 christos Exp $ */ d31 1 a31 1 __KERNEL_RCSID(0, "$NetBSD: altq_fifoq.c,v 1.15 2006/11/16 01:32:37 christos Exp $"); d73 1 a73 2 static int fifoq_enqueue(struct ifaltq *, struct mbuf *, struct altq_pktattr *); d268 1 a268 2 fifoq_enqueue(struct ifaltq *ifq, struct mbuf *m, struct altq_pktattr *pktattr) @ 1.16.86.1 log @update from HEAD @ text @d1 1 a1 1 /* $NetBSD$ */ d31 1 a31 1 __KERNEL_RCSID(0, "$NetBSD$"); d73 2 a74 1 static int fifoq_enqueue(struct ifaltq *, struct mbuf *); d269 2 a270 1 fifoq_enqueue(struct ifaltq *ifq, struct mbuf *m) @ 1.16.106.1 log @Sync with HEAD @ text @d1 1 a1 1 /* $NetBSD: altq_fifoq.c,v 1.17 2016/04/20 08:58:48 knakahara Exp $ */ d31 1 a31 1 __KERNEL_RCSID(0, "$NetBSD: altq_fifoq.c,v 1.17 2016/04/20 08:58:48 knakahara Exp $"); d73 2 a74 1 static int fifoq_enqueue(struct ifaltq *, struct mbuf *); d269 2 a270 1 fifoq_enqueue(struct ifaltq *ifq, struct mbuf *m) @ 1.15 log @__unused removal on arguments; approved by core. @ text @d1 1 a1 1 /* $NetBSD: altq_fifoq.c,v 1.14 2006/10/20 21:55:56 elad Exp $ */ d31 1 a31 1 __KERNEL_RCSID(0, "$NetBSD: altq_fifoq.c,v 1.14 2006/10/20 21:55:56 elad Exp $"); d122 1 a122 1 fifoqioctl(dev_t dev, ioctlcmd_t cmd, caddr_t addr, int flag, @ 1.15.4.1 log @Sync with HEAD. @ text @d1 1 a1 1 /* $NetBSD: altq_fifoq.c,v 1.15 2006/11/16 01:32:37 christos Exp $ */ d31 1 a31 1 __KERNEL_RCSID(0, "$NetBSD: altq_fifoq.c,v 1.15 2006/11/16 01:32:37 christos Exp $"); d122 1 a122 1 fifoqioctl(dev_t dev, ioctlcmd_t cmd, void *addr, int flag, @ 1.14 log @Kill some KAUTH_GENERIC_ISSUSER. @ text @d1 1 a1 1 /* $NetBSD: altq_fifoq.c,v 1.13 2006/10/12 19:59:08 peter Exp $ */ d31 1 a31 1 __KERNEL_RCSID(0, "$NetBSD: altq_fifoq.c,v 1.13 2006/10/12 19:59:08 peter Exp $"); d86 2 a87 2 fifoqopen(dev_t dev __unused, int flag __unused, int fmt __unused, struct lwp *l __unused) d105 2 a106 2 fifoqclose(dev_t dev __unused, int flag __unused, int fmt __unused, struct lwp *l __unused) d122 1 a122 1 fifoqioctl(dev_t dev __unused, ioctlcmd_t cmd, caddr_t addr, int flag __unused, d270 1 a270 1 struct altq_pktattr *pktattr __unused) d336 1 a336 1 fifoq_request(struct ifaltq *ifq, int req, void *arg __unused) @ 1.13 log @Merge the peter-altq branch. (sync with KAME & add support for using ALTQ with pf(4)). @ text @d1 1 a1 1 /* $NetBSD$ */ d31 1 a31 1 __KERNEL_RCSID(0, "$NetBSD$"); d139 3 a141 2 if ((error = kauth_authorize_generic(l->l_cred, KAUTH_GENERIC_ISSUSER, &l->l_acflag)) != 0) @ 1.12 log @- sprinkle __unused on function decls. - fix a couple of unused bugs - no more -Wno-unused for i386 @ text @d1 2 a2 2 /* $NetBSD: altq_fifoq.c,v 1.11 2006/07/21 16:48:45 ad Exp $ */ /* $KAME: altq_fifoq.c,v 1.7 2000/12/14 08:12:45 thorpej Exp $ */ d5 1 a5 1 * Copyright (C) 1997-2000 d31 1 a31 1 __KERNEL_RCSID(0, "$NetBSD: altq_fifoq.c,v 1.11 2006/07/21 16:48:45 ad Exp $"); d33 1 a33 1 #if defined(__FreeBSD__) || defined(__NetBSD__) d35 2 a36 1 #endif /* __FreeBSD__ || __NetBSD__ */ d65 4 d73 6 a78 6 static int fifoq_enqueue __P((struct ifaltq *, struct mbuf *, struct altq_pktattr *)); static struct mbuf *fifoq_dequeue __P((struct ifaltq *, int)); static int fifoq_detach __P((fifoq_state_t *)); static int fifoq_request __P((struct ifaltq *, int, void *)); static void fifoq_purge __P((fifoq_state_t *)); d228 1 a228 1 } while (0); d247 1 a247 1 } while (0); d310 1 a310 3 fifoq_dequeue(ifq, op) struct ifaltq *ifq; int op; d348 2 a349 2 static int fifoq_detach(q) fifoq_state_t *q; d382 2 a383 2 static void fifoq_purge(q) fifoq_state_t *q; d406 1 @ 1.11 log @- Use the LWP cached credentials where sane. - Minor cosmetic changes. @ text @d1 1 a1 1 /* $NetBSD: altq_fifoq.c,v 1.10 2006/05/15 00:05:39 christos Exp $ */ d31 1 a31 1 __KERNEL_RCSID(0, "$NetBSD: altq_fifoq.c,v 1.10 2006/05/15 00:05:39 christos Exp $"); d81 2 a82 4 fifoqopen(dev, flag, fmt, l) dev_t dev; int flag, fmt; struct lwp *l; d100 2 a101 4 fifoqclose(dev, flag, fmt, l) dev_t dev; int flag, fmt; struct lwp *l; d117 2 a118 6 fifoqioctl(dev, cmd, addr, flag, l) dev_t dev; ioctlcmd_t cmd; caddr_t addr; int flag; struct lwp *l; d263 2 a264 4 fifoq_enqueue(ifq, m, pktattr) struct ifaltq *ifq; struct mbuf *m; struct altq_pktattr *pktattr; d332 1 a332 4 fifoq_request(ifq, req, arg) struct ifaltq *ifq; int req; void *arg; @ 1.11.4.1 log @Sync with head. @ text @d1 2 a2 2 /* $NetBSD: altq_fifoq.c,v 1.15 2006/11/16 01:32:37 christos Exp $ */ /* $KAME: altq_fifoq.c,v 1.12 2003/07/10 12:07:48 kjc Exp $ */ d5 1 a5 1 * Copyright (C) 1997-2002 d31 1 a31 1 __KERNEL_RCSID(0, "$NetBSD: altq_fifoq.c,v 1.15 2006/11/16 01:32:37 christos Exp $"); d33 1 a33 1 #ifdef _KERNEL_OPT d35 1 a35 2 #endif a63 4 #ifdef ALTQ3_COMPAT #define FIFOQ_STATS /* collect statistics */ d68 6 a73 6 static int fifoq_enqueue(struct ifaltq *, struct mbuf *, struct altq_pktattr *); static struct mbuf *fifoq_dequeue(struct ifaltq *, int); static int fifoq_detach(fifoq_state_t *); static int fifoq_request(struct ifaltq *, int, void *); static void fifoq_purge(fifoq_state_t *); d81 4 a84 2 fifoqopen(dev_t dev, int flag, int fmt, struct lwp *l) d102 4 a105 2 fifoqclose(dev_t dev, int flag, int fmt, struct lwp *l) d121 6 a126 2 fifoqioctl(dev_t dev, ioctlcmd_t cmd, caddr_t addr, int flag, struct lwp *l) d142 2 a143 3 if ((error = kauth_authorize_network(l->l_cred, KAUTH_NETWORK_ALTQ, KAUTH_REQ_NETWORK_ALTQ_FIFOQ, NULL, NULL, NULL)) != 0) d231 1 a231 1 } while (/*CONSTCOND*/ 0); d250 1 a250 1 } while (/*CONSTCOND*/ 0); d271 4 a274 2 fifoq_enqueue(struct ifaltq *ifq, struct mbuf *m, struct altq_pktattr *pktattr) d315 3 a317 1 fifoq_dequeue(struct ifaltq *ifq, int op) d342 4 a345 1 fifoq_request(struct ifaltq *ifq, int req, void *arg) d358 2 a359 2 static int fifoq_detach(fifoq_state_t *q) d392 2 a393 2 static void fifoq_purge(fifoq_state_t *q) a415 1 #endif /* ALTQ3_COMPAT */ @ 1.11.6.1 log @sync with head @ text @d1 2 a2 2 /* $NetBSD$ */ /* $KAME: altq_fifoq.c,v 1.12 2003/07/10 12:07:48 kjc Exp $ */ d5 1 a5 1 * Copyright (C) 1997-2002 d31 1 a31 1 __KERNEL_RCSID(0, "$NetBSD: altq_fifoq.c,v 1.11 2006/07/21 16:48:45 ad Exp $"); d33 1 a33 1 #ifdef _KERNEL_OPT d35 1 a35 2 #endif a63 4 #ifdef ALTQ3_COMPAT #define FIFOQ_STATS /* collect statistics */ d68 6 a73 6 static int fifoq_enqueue(struct ifaltq *, struct mbuf *, struct altq_pktattr *); static struct mbuf *fifoq_dequeue(struct ifaltq *, int); static int fifoq_detach(fifoq_state_t *); static int fifoq_request(struct ifaltq *, int, void *); static void fifoq_purge(fifoq_state_t *); d81 4 a84 2 fifoqopen(dev_t dev __unused, int flag __unused, int fmt __unused, struct lwp *l __unused) d102 4 a105 2 fifoqclose(dev_t dev __unused, int flag __unused, int fmt __unused, struct lwp *l __unused) d121 6 a126 2 fifoqioctl(dev_t dev __unused, ioctlcmd_t cmd, caddr_t addr, int flag __unused, struct lwp *l) d142 2 a143 3 if ((error = kauth_authorize_network(l->l_cred, KAUTH_NETWORK_ALTQ, KAUTH_REQ_NETWORK_ALTQ_FIFOQ, NULL, NULL, NULL)) != 0) d231 1 a231 1 } while (/*CONSTCOND*/ 0); d250 1 a250 1 } while (/*CONSTCOND*/ 0); d271 4 a274 2 fifoq_enqueue(struct ifaltq *ifq, struct mbuf *m, struct altq_pktattr *pktattr __unused) d315 3 a317 1 fifoq_dequeue(struct ifaltq *ifq, int op) d342 4 a345 1 fifoq_request(struct ifaltq *ifq, int req, void *arg __unused) d358 2 a359 2 static int fifoq_detach(fifoq_state_t *q) d392 2 a393 2 static void fifoq_purge(fifoq_state_t *q) a415 1 #endif /* ALTQ3_COMPAT */ @ 1.11.6.2 log @sync with head. @ text @d1 1 a1 1 /* $NetBSD: altq_fifoq.c,v 1.11.6.1 2006/10/22 06:04:30 yamt Exp $ */ d31 1 a31 1 __KERNEL_RCSID(0, "$NetBSD: altq_fifoq.c,v 1.11.6.1 2006/10/22 06:04:30 yamt Exp $"); d86 2 a87 2 fifoqopen(dev_t dev, int flag, int fmt, struct lwp *l) d105 2 a106 2 fifoqclose(dev_t dev, int flag, int fmt, struct lwp *l) d122 1 a122 1 fifoqioctl(dev_t dev, ioctlcmd_t cmd, caddr_t addr, int flag, d270 1 a270 1 struct altq_pktattr *pktattr) d336 1 a336 1 fifoq_request(struct ifaltq *ifq, int req, void *arg) @ 1.10 log @kauth fallout @ text @d1 1 a1 1 /* $NetBSD: altq_fifoq.c,v 1.9 2006/05/14 21:24:49 elad Exp $ */ d31 1 a31 1 __KERNEL_RCSID(0, "$NetBSD: altq_fifoq.c,v 1.9 2006/05/14 21:24:49 elad Exp $"); a130 1 struct proc *p = l->l_proc; d142 2 a143 3 if ((error = kauth_authorize_generic(p->p_cred, KAUTH_GENERIC_ISSUSER, &p->p_acflag)) != 0) @ 1.9 log @integrate kauth. @ text @d1 1 a1 1 /* $NetBSD$ */ d31 1 a31 1 __KERNEL_RCSID(0, "$NetBSD$"); d54 1 @ 1.8 log @Use malloc/free instead of MALLOC/FREE and M_ZERO instead of memset. @ text @d1 1 a1 1 /* $NetBSD: altq_fifoq.c,v 1.7 2005/12/11 12:16:03 christos Exp $ */ d31 1 a31 1 __KERNEL_RCSID(0, "$NetBSD: altq_fifoq.c,v 1.7 2005/12/11 12:16:03 christos Exp $"); d142 3 a144 1 if ((error = suser(p->p_ucred, &p->p_acflag)) != 0) @ 1.7 log @merge ktrace-lwp. @ text @d1 1 a1 1 /* $NetBSD: altq_fifoq.c,v 1.4.16.5 2005/03/04 16:38:00 skrll Exp $ */ d31 1 a31 1 __KERNEL_RCSID(0, "$NetBSD: altq_fifoq.c,v 1.4.16.5 2005/03/04 16:38:00 skrll Exp $"); d177 1 a177 2 MALLOC(q, fifoq_state_t *, sizeof(fifoq_state_t), M_DEVBUF, M_WAITOK); a181 1 (void)memset(q, 0, sizeof(fifoq_state_t)); d195 1 a195 1 FREE(q, M_DEVBUF); d383 1 a383 1 FREE(q, M_DEVBUF); @ 1.7.4.1 log @sync with head @ text @d1 1 a1 1 /* $NetBSD: altq_fifoq.c,v 1.11 2006/07/21 16:48:45 ad Exp $ */ d31 1 a31 1 __KERNEL_RCSID(0, "$NetBSD: altq_fifoq.c,v 1.11 2006/07/21 16:48:45 ad Exp $"); a53 1 #include d130 1 d142 1 a142 2 if ((error = kauth_authorize_generic(l->l_cred, KAUTH_GENERIC_ISSUSER, &l->l_acflag)) != 0) d177 2 a178 1 q = malloc(sizeof(fifoq_state_t), M_DEVBUF, M_WAITOK|M_ZERO); d183 1 d197 1 a197 1 free(q, M_DEVBUF); d385 1 a385 1 free(q, M_DEVBUF); @ 1.7.6.1 log @Sync with head. @ text @d1 1 a1 1 /* $NetBSD: altq_fifoq.c,v 1.7 2005/12/11 12:16:03 christos Exp $ */ d31 1 a31 1 __KERNEL_RCSID(0, "$NetBSD: altq_fifoq.c,v 1.7 2005/12/11 12:16:03 christos Exp $"); a53 1 #include d142 1 a142 3 if ((error = kauth_authorize_generic(p->p_cred, KAUTH_GENERIC_ISSUSER, &p->p_acflag)) != 0) d177 2 a178 1 q = malloc(sizeof(fifoq_state_t), M_DEVBUF, M_WAITOK|M_ZERO); d183 1 d197 1 a197 1 free(q, M_DEVBUF); d385 1 a385 1 free(q, M_DEVBUF); @ 1.7.8.1 log @sync with head. @ text @d1 1 a1 1 /* $NetBSD: altq_fifoq.c,v 1.7 2005/12/11 12:16:03 christos Exp $ */ d31 1 a31 1 __KERNEL_RCSID(0, "$NetBSD: altq_fifoq.c,v 1.7 2005/12/11 12:16:03 christos Exp $"); a53 1 #include d142 1 a142 3 if ((error = kauth_authorize_generic(p->p_cred, KAUTH_GENERIC_ISSUSER, &p->p_acflag)) != 0) d177 2 a178 1 q = malloc(sizeof(fifoq_state_t), M_DEVBUF, M_WAITOK|M_ZERO); d183 1 d197 1 a197 1 free(q, M_DEVBUF); d385 1 a385 1 free(q, M_DEVBUF); @ 1.7.8.2 log @sync with head @ text @d1 1 a1 1 /* $NetBSD: altq_fifoq.c,v 1.7.8.1 2006/05/24 10:56:32 yamt Exp $ */ d31 1 a31 1 __KERNEL_RCSID(0, "$NetBSD: altq_fifoq.c,v 1.7.8.1 2006/05/24 10:56:32 yamt Exp $"); d131 1 d143 3 a145 2 if ((error = kauth_authorize_generic(l->l_cred, KAUTH_GENERIC_ISSUSER, &l->l_acflag)) != 0) @ 1.7.12.1 log @Sync with KAME. @ text @d1 2 a2 2 /* $NetBSD$ */ /* $KAME: altq_fifoq.c,v 1.12 2003/07/10 12:07:48 kjc Exp $ */ d5 1 a5 1 * Copyright (C) 1997-2002 d31 1 a31 1 __KERNEL_RCSID(0, "$NetBSD$"); d33 1 a33 1 #ifdef _KERNEL_OPT d35 1 a35 2 #endif a62 4 #ifdef ALTQ3_COMPAT #define FIFOQ_STATS /* collect statistics */ d67 6 a72 6 static int fifoq_enqueue(struct ifaltq *, struct mbuf *, struct altq_pktattr *); static struct mbuf *fifoq_dequeue(struct ifaltq *, int); static int fifoq_detach(fifoq_state_t *); static int fifoq_request(struct ifaltq *, int, void *); static void fifoq_purge(fifoq_state_t *); d232 1 a232 1 } while (/*CONSTCOND*/ 0); d251 1 a251 1 } while (/*CONSTCOND*/ 0); a416 1 #endif /* ALTQ3_COMPAT */ @ 1.7.12.2 log @Merge 2006-05-24 NetBSD-current into the peter-altq branch. @ text @d1 1 a1 1 /* $NetBSD: altq_fifoq.c,v 1.7.12.1 2006/03/18 12:08:18 peter Exp $ */ d31 1 a31 1 __KERNEL_RCSID(0, "$NetBSD: altq_fifoq.c,v 1.7.12.1 2006/03/18 12:08:18 peter Exp $"); a54 1 #include d147 1 a147 2 if ((error = kauth_authorize_generic(p->p_cred, KAUTH_GENERIC_ISSUSER, &p->p_acflag)) != 0) d182 2 a183 1 q = malloc(sizeof(fifoq_state_t), M_DEVBUF, M_WAITOK|M_ZERO); d188 1 d202 1 a202 1 free(q, M_DEVBUF); d390 1 a390 1 free(q, M_DEVBUF); @ 1.7.12.3 log @sync with head. @ text @d1 1 a1 1 /* $NetBSD$ */ d31 1 a31 1 __KERNEL_RCSID(0, "$NetBSD$"); d136 1 d148 2 a149 2 if ((error = kauth_authorize_generic(l->l_cred, KAUTH_GENERIC_ISSUSER, &l->l_acflag)) != 0) @ 1.7.10.1 log @Adapt to kernel authorization KPI. @ text @d1 1 a1 1 /* $NetBSD: altq_fifoq.c,v 1.7 2005/12/11 12:16:03 christos Exp $ */ d31 1 a31 1 __KERNEL_RCSID(0, "$NetBSD: altq_fifoq.c,v 1.7 2005/12/11 12:16:03 christos Exp $"); d142 1 a142 3 if ((error = generic_authorize(p->p_cred, KAUTH_GENERIC_ISSUSER, &p->p_acflag)) != 0) @ 1.7.10.2 log @generic_authorize() -> kauth_authorize_generic(). @ text @d1 1 a1 1 /* $NetBSD: altq_fifoq.c,v 1.7.10.1 2006/03/08 00:23:46 elad Exp $ */ d31 1 a31 1 __KERNEL_RCSID(0, "$NetBSD: altq_fifoq.c,v 1.7.10.1 2006/03/08 00:23:46 elad Exp $"); d142 1 a142 1 if ((error = kauth_authorize_generic(p->p_cred, @ 1.7.10.3 log @sync with head @ text @d1 1 a1 1 /* $NetBSD: altq_fifoq.c,v 1.7.10.2 2006/03/10 13:29:35 elad Exp $ */ d31 1 a31 1 __KERNEL_RCSID(0, "$NetBSD: altq_fifoq.c,v 1.7.10.2 2006/03/10 13:29:35 elad Exp $"); d179 2 a180 1 q = malloc(sizeof(fifoq_state_t), M_DEVBUF, M_WAITOK|M_ZERO); d185 1 d199 1 a199 1 free(q, M_DEVBUF); d387 1 a387 1 free(q, M_DEVBUF); @ 1.6 log @nuke trailing whitespace @ text @d1 1 a1 1 /* $NetBSD: altq_fifoq.c,v 1.5 2003/11/09 22:11:12 christos Exp $ */ d31 1 a31 1 __KERNEL_RCSID(0, "$NetBSD: altq_fifoq.c,v 1.5 2003/11/09 22:11:12 christos Exp $"); d80 1 a80 1 fifoqopen(dev, flag, fmt, p) d83 1 a83 1 struct proc *p; d101 1 a101 1 fifoqclose(dev, flag, fmt, p) d104 1 a104 1 struct proc *p; d120 1 a120 1 fifoqioctl(dev, cmd, addr, flag, p) d125 1 a125 1 struct proc *p; d130 1 @ 1.6.4.1 log @sync with head. @ text @d1 1 a1 1 /* $NetBSD: altq_fifoq.c,v 1.6 2005/02/26 23:04:16 perry Exp $ */ d31 1 a31 1 __KERNEL_RCSID(0, "$NetBSD: altq_fifoq.c,v 1.6 2005/02/26 23:04:16 perry Exp $"); a53 1 #include d80 1 a80 1 fifoqopen(dev, flag, fmt, l) d83 1 a83 1 struct lwp *l; d101 1 a101 1 fifoqclose(dev, flag, fmt, l) d104 1 a104 1 struct lwp *l; d120 1 a120 1 fifoqioctl(dev, cmd, addr, flag, l) d125 1 a125 1 struct lwp *l; a129 1 struct proc *p = l->l_proc; d141 1 a141 3 if ((error = kauth_authorize_generic(p->p_cred, KAUTH_GENERIC_ISSUSER, &p->p_acflag)) != 0) d176 2 a177 1 q = malloc(sizeof(fifoq_state_t), M_DEVBUF, M_WAITOK|M_ZERO); d182 1 d196 1 a196 1 free(q, M_DEVBUF); d384 1 a384 1 free(q, M_DEVBUF); @ 1.6.4.2 log @sync with head. @ text @d1 2 a2 2 /* $NetBSD$ */ /* $KAME: altq_fifoq.c,v 1.12 2003/07/10 12:07:48 kjc Exp $ */ d5 1 a5 1 * Copyright (C) 1997-2002 d31 1 a31 1 __KERNEL_RCSID(0, "$NetBSD: altq_fifoq.c,v 1.6.4.1 2006/06/21 14:47:46 yamt Exp $"); d33 1 a33 1 #ifdef _KERNEL_OPT d35 1 a35 2 #endif a63 4 #ifdef ALTQ3_COMPAT #define FIFOQ_STATS /* collect statistics */ d68 6 a73 6 static int fifoq_enqueue(struct ifaltq *, struct mbuf *, struct altq_pktattr *); static struct mbuf *fifoq_dequeue(struct ifaltq *, int); static int fifoq_detach(fifoq_state_t *); static int fifoq_request(struct ifaltq *, int, void *); static void fifoq_purge(fifoq_state_t *); d81 4 a84 2 fifoqopen(dev_t dev, int flag, int fmt, struct lwp *l) d102 4 a105 2 fifoqclose(dev_t dev, int flag, int fmt, struct lwp *l) d121 6 a126 2 fifoqioctl(dev_t dev, ioctlcmd_t cmd, caddr_t addr, int flag, struct lwp *l) d131 1 d143 3 a145 3 if ((error = kauth_authorize_network(l->l_cred, KAUTH_NETWORK_ALTQ, KAUTH_REQ_NETWORK_ALTQ_FIFOQ, NULL, NULL, NULL)) != 0) d233 1 a233 1 } while (/*CONSTCOND*/ 0); d252 1 a252 1 } while (/*CONSTCOND*/ 0); d273 4 a276 2 fifoq_enqueue(struct ifaltq *ifq, struct mbuf *m, struct altq_pktattr *pktattr) d317 3 a319 1 fifoq_dequeue(struct ifaltq *ifq, int op) d344 4 a347 1 fifoq_request(struct ifaltq *ifq, int req, void *arg) d360 2 a361 2 static int fifoq_detach(fifoq_state_t *q) d394 2 a395 2 static void fifoq_purge(fifoq_state_t *q) a417 1 #endif /* ALTQ3_COMPAT */ @ 1.6.4.3 log @sync with head. @ text @d1 1 a1 1 /* $NetBSD: altq_fifoq.c,v 1.6.4.2 2006/12/30 20:45:17 yamt Exp $ */ d31 1 a31 1 __KERNEL_RCSID(0, "$NetBSD: altq_fifoq.c,v 1.6.4.2 2006/12/30 20:45:17 yamt Exp $"); d122 1 a122 1 fifoqioctl(dev_t dev, ioctlcmd_t cmd, void *addr, int flag, @ 1.5 log @- kill bzero/bcopy - defopt stats and settings, removing their definitions from the files - make code compile by eliminating multicharacter constants!?! and rearranging variable declarations so they are defined before used!?! - help gcc with uninitialized variables @ text @d1 1 a1 1 /* $NetBSD: altq_fifoq.c,v 1.4 2001/11/12 23:14:21 lukem Exp $ */ d31 1 a31 1 __KERNEL_RCSID(0, "$NetBSD: altq_fifoq.c,v 1.4 2001/11/12 23:14:21 lukem Exp $"); d146 1 a146 1 d324 1 a324 1 @ 1.5.8.1 log @sync with -current @ text @d1 1 a1 1 /* $NetBSD: altq_fifoq.c,v 1.6 2005/02/26 23:04:16 perry Exp $ */ d31 1 a31 1 __KERNEL_RCSID(0, "$NetBSD: altq_fifoq.c,v 1.6 2005/02/26 23:04:16 perry Exp $"); d146 1 a146 1 d324 1 a324 1 @ 1.5.10.1 log @sync with head. xen and whitespace. xen part is not finished. @ text @d1 1 a1 1 /* $NetBSD: altq_fifoq.c,v 1.5 2003/11/09 22:11:12 christos Exp $ */ d31 1 a31 1 __KERNEL_RCSID(0, "$NetBSD: altq_fifoq.c,v 1.5 2003/11/09 22:11:12 christos Exp $"); d146 1 a146 1 d324 1 a324 1 @ 1.4 log @add RCSIDs @ text @d1 1 a1 1 /* $NetBSD: altq_fifoq.c,v 1.3 2001/04/13 23:29:56 thorpej Exp $ */ d31 1 a31 1 __KERNEL_RCSID(0, "$NetBSD$"); a62 2 #define FIFOQ_STATS /* collect statistics */ d182 1 a182 1 bzero(q, sizeof(fifoq_state_t)); @ 1.4.16.1 log @Sync with HEAD @ text @d1 1 a1 1 /* $NetBSD: altq_fifoq.c,v 1.5 2003/11/09 22:11:12 christos Exp $ */ d31 1 a31 1 __KERNEL_RCSID(0, "$NetBSD: altq_fifoq.c,v 1.5 2003/11/09 22:11:12 christos Exp $"); d63 2 d184 1 a184 1 (void)memset(q, 0, sizeof(fifoq_state_t)); @ 1.4.16.2 log @Adapt to new world order. @ text @d1 1 a1 1 /* $NetBSD$ */ d31 1 a31 1 __KERNEL_RCSID(0, "$NetBSD$"); d80 1 a80 1 fifoqopen(dev, flag, fmt, l) d83 1 a83 1 struct lwp *l; d101 1 a101 1 fifoqclose(dev, flag, fmt, l) d104 1 a104 1 struct lwp *l; d120 1 a120 1 fifoqioctl(dev, cmd, addr, flag, l) d125 1 a125 1 struct lwp *l; a129 1 struct proc *p = l->l_proc; @ 1.4.16.3 log @Sync with HEAD. @ text @d1 1 a1 1 /* $NetBSD: altq_fifoq.c,v 1.5 2003/11/09 22:11:12 christos Exp $ */ d31 1 a31 1 __KERNEL_RCSID(0, "$NetBSD: altq_fifoq.c,v 1.5 2003/11/09 22:11:12 christos Exp $"); d80 1 a80 1 fifoqopen(dev, flag, fmt, p) d83 1 a83 1 struct proc *p; d101 1 a101 1 fifoqclose(dev, flag, fmt, p) d104 1 a104 1 struct proc *p; d120 1 a120 1 fifoqioctl(dev, cmd, addr, flag, p) d125 1 a125 1 struct proc *p; d130 1 @ 1.4.16.4 log @Fix the sync with head I botched. @ text @d1 1 a1 1 /* $NetBSD: altq_fifoq.c,v 1.4.16.2 2004/08/12 16:15:32 skrll Exp $ */ d31 1 a31 1 __KERNEL_RCSID(0, "$NetBSD: altq_fifoq.c,v 1.4.16.2 2004/08/12 16:15:32 skrll Exp $"); d80 1 a80 1 fifoqopen(dev, flag, fmt, l) d83 1 a83 1 struct lwp *l; d101 1 a101 1 fifoqclose(dev, flag, fmt, l) d104 1 a104 1 struct lwp *l; d120 1 a120 1 fifoqioctl(dev, cmd, addr, flag, l) d125 1 a125 1 struct lwp *l; a129 1 struct proc *p = l->l_proc; @ 1.4.16.5 log @Sync with HEAD. Hi Perry! @ text @d1 1 a1 1 /* $NetBSD: altq_fifoq.c,v 1.4.16.4 2004/09/21 13:11:19 skrll Exp $ */ d31 1 a31 1 __KERNEL_RCSID(0, "$NetBSD: altq_fifoq.c,v 1.4.16.4 2004/09/21 13:11:19 skrll Exp $"); d147 1 a147 1 d325 1 a325 1 @ 1.3 log @Remove the use of splimp() from the NetBSD kernel. splnet() and only splnet() is allowed for the protection of data structures used by network devices. @ text @d1 1 a1 1 /* $NetBSD: altq_fifoq.c,v 1.2 2000/12/14 08:49:50 thorpej Exp $ */ d29 3 @ 1.3.2.1 log @Sync kqueue branch with -current. @ text @d1 1 a1 1 /* $NetBSD: altq_fifoq.c,v 1.4 2001/11/12 23:14:21 lukem Exp $ */ a28 3 #include __KERNEL_RCSID(0, "$NetBSD: altq_fifoq.c,v 1.4 2001/11/12 23:14:21 lukem Exp $"); @ 1.3.4.1 log @Convert all remaining devices. @ text @d1 1 a1 1 /* $NetBSD: altq_fifoq.c,v 1.3 2001/04/13 23:29:56 thorpej Exp $ */ a50 1 #include d79 2 a80 2 fifoqopen(devvp, flag, fmt, p) struct vnode *devvp; d100 2 a101 2 fifoqclose(devvp, flag, fmt, p) struct vnode *devvp; d119 2 a120 2 fifoqioctl(devvp, cmd, addr, flag, p) struct vnode *devvp; @ 1.2 log @Add NetBSD RCS IDs. @ text @d1 1 a1 1 /* $NetBSD$ */ d300 1 a300 1 * must be called in splimp. d389 1 a389 1 * should be called in splimp or after disabling the fifoq. @ 1.2.2.1 log @file altq_fifoq.c was added on branch thorpej_scsipi on 2001-01-05 17:39:36 +0000 @ text @d1 415 @ 1.2.2.2 log @Sync with HEAD @ text @a0 415 /* $NetBSD: altq_fifoq.c,v 1.2.2.1 2001/01/05 17:39:36 bouyer Exp $ */ /* $KAME: altq_fifoq.c,v 1.7 2000/12/14 08:12:45 thorpej Exp $ */ /* * Copyright (C) 1997-2000 * Sony Computer Science Laboratories Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY SONY CSL AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL SONY CSL OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #if defined(__FreeBSD__) || defined(__NetBSD__) #include "opt_altq.h" #endif /* __FreeBSD__ || __NetBSD__ */ #ifdef ALTQ_FIFOQ /* fifoq is enabled by ALTQ_FIFOQ option in opt_altq.h */ /* * FIFOQ is an altq sample implementation. There will be little * need to use FIFOQ as an alternative queueing scheme. * But this code is provided as a template for those who want to * write their own queueing schemes. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define FIFOQ_STATS /* collect statistics */ /* fifoq_list keeps all fifoq_state_t's allocated. */ static fifoq_state_t *fifoq_list = NULL; /* internal function prototypes */ static int fifoq_enqueue __P((struct ifaltq *, struct mbuf *, struct altq_pktattr *)); static struct mbuf *fifoq_dequeue __P((struct ifaltq *, int)); static int fifoq_detach __P((fifoq_state_t *)); static int fifoq_request __P((struct ifaltq *, int, void *)); static void fifoq_purge __P((fifoq_state_t *)); /* * fifoq device interface */ altqdev_decl(fifoq); int fifoqopen(dev, flag, fmt, p) dev_t dev; int flag, fmt; struct proc *p; { /* everything will be done when the queueing scheme is attached. */ return 0; } /* * there are 2 ways to act on close. * detach-all-on-close: * use for the daemon style approach. if the daemon dies, all the * resource will be released. * no-action-on-close: * use for the command style approach. (e.g. fifoq on/off) * * note: close is called not on every close but when the last reference * is removed (only once with multiple simultaneous references.) */ int fifoqclose(dev, flag, fmt, p) dev_t dev; int flag, fmt; struct proc *p; { fifoq_state_t *q; int err, error = 0; while ((q = fifoq_list) != NULL) { /* destroy all */ err = fifoq_detach(q); if (err != 0 && error == 0) error = err; } return error; } int fifoqioctl(dev, cmd, addr, flag, p) dev_t dev; ioctlcmd_t cmd; caddr_t addr; int flag; struct proc *p; { fifoq_state_t *q; struct fifoq_interface *ifacep; struct ifnet *ifp; int error = 0; /* check super-user privilege */ switch (cmd) { case FIFOQ_GETSTATS: break; default: #if (__FreeBSD_version > 400000) if ((error = suser(p)) != 0) return (error); #else if ((error = suser(p->p_ucred, &p->p_acflag)) != 0) return (error); #endif break; } switch (cmd) { case FIFOQ_ENABLE: ifacep = (struct fifoq_interface *)addr; if ((q = altq_lookup(ifacep->fifoq_ifname, ALTQT_FIFOQ)) == NULL) { error = EBADF; break; } error = altq_enable(q->q_ifq); break; case FIFOQ_DISABLE: ifacep = (struct fifoq_interface *)addr; if ((q = altq_lookup(ifacep->fifoq_ifname, ALTQT_FIFOQ)) == NULL) { error = EBADF; break; } error = altq_disable(q->q_ifq); break; case FIFOQ_IF_ATTACH: ifp = ifunit(((struct fifoq_interface *)addr)->fifoq_ifname); if (ifp == NULL) { error = ENXIO; break; } /* allocate and initialize fifoq_state_t */ MALLOC(q, fifoq_state_t *, sizeof(fifoq_state_t), M_DEVBUF, M_WAITOK); if (q == NULL) { error = ENOMEM; break; } bzero(q, sizeof(fifoq_state_t)); q->q_ifq = &ifp->if_snd; q->q_head = q->q_tail = NULL; q->q_len = 0; q->q_limit = FIFOQ_LIMIT; /* * set FIFOQ to this ifnet structure. */ error = altq_attach(q->q_ifq, ALTQT_FIFOQ, q, fifoq_enqueue, fifoq_dequeue, fifoq_request, NULL, NULL); if (error) { FREE(q, M_DEVBUF); break; } /* add this state to the fifoq list */ q->q_next = fifoq_list; fifoq_list = q; break; case FIFOQ_IF_DETACH: ifacep = (struct fifoq_interface *)addr; if ((q = altq_lookup(ifacep->fifoq_ifname, ALTQT_FIFOQ)) == NULL) { error = EBADF; break; } error = fifoq_detach(q); break; case FIFOQ_GETSTATS: do { struct fifoq_getstats *q_stats; q_stats = (struct fifoq_getstats *)addr; if ((q = altq_lookup(q_stats->iface.fifoq_ifname, ALTQT_FIFOQ)) == NULL) { error = EBADF; break; } q_stats->q_len = q->q_len; q_stats->q_limit = q->q_limit; q_stats->xmit_cnt = q->q_stats.xmit_cnt; q_stats->drop_cnt = q->q_stats.drop_cnt; q_stats->period = q->q_stats.period; } while (0); break; case FIFOQ_CONFIG: do { struct fifoq_conf *fc; int limit; fc = (struct fifoq_conf *)addr; if ((q = altq_lookup(fc->iface.fifoq_ifname, ALTQT_FIFOQ)) == NULL) { error = EBADF; break; } limit = fc->fifoq_limit; if (limit < 0) limit = 0; q->q_limit = limit; fc->fifoq_limit = limit; } while (0); break; default: error = EINVAL; break; } return error; } /* * fifoq support routines */ /* * enqueue routine: * * returns: 0 when successfully queued. * ENOBUFS when drop occurs. */ static int fifoq_enqueue(ifq, m, pktattr) struct ifaltq *ifq; struct mbuf *m; struct altq_pktattr *pktattr; { fifoq_state_t *q = (fifoq_state_t *)ifq->altq_disc; /* if the queue is full, drop the incoming packet(drop-tail) */ if (q->q_len >= q->q_limit) { #ifdef FIFOQ_STATS PKTCNTR_ADD(&q->q_stats.drop_cnt, m_pktlen(m)); #endif m_freem(m); return (ENOBUFS); } /* enqueue the packet at the taile of the queue */ m->m_nextpkt = NULL; if (q->q_tail == NULL) q->q_head = m; else q->q_tail->m_nextpkt = m; q->q_tail = m; q->q_len++; ifq->ifq_len++; return 0; } /* * dequeue routine: * must be called in splimp. * * returns: mbuf dequeued. * NULL when no packet is available in the queue. */ /* * ALTDQ_PEEK is provided for drivers which need to know the next packet * to send in advance. * when ALTDQ_PEEK is specified, the next packet to be dequeued is * returned without dequeueing the packet. * when ALTDQ_DEQUEUE is called *immediately after* an ALTDQ_PEEK * operation, the same packet should be returned. */ static struct mbuf * fifoq_dequeue(ifq, op) struct ifaltq *ifq; int op; { fifoq_state_t *q = (fifoq_state_t *)ifq->altq_disc; struct mbuf *m = NULL; if (op == ALTDQ_POLL) return (q->q_head); if ((m = q->q_head) == NULL) return (NULL); if ((q->q_head = m->m_nextpkt) == NULL) q->q_tail = NULL; m->m_nextpkt = NULL; q->q_len--; ifq->ifq_len--; #ifdef FIFOQ_STATS PKTCNTR_ADD(&q->q_stats.xmit_cnt, m_pktlen(m)); if (q->q_len == 0) q->q_stats.period++; #endif return (m); } static int fifoq_request(ifq, req, arg) struct ifaltq *ifq; int req; void *arg; { fifoq_state_t *q = (fifoq_state_t *)ifq->altq_disc; switch (req) { case ALTRQ_PURGE: fifoq_purge(q); break; } return (0); } static int fifoq_detach(q) fifoq_state_t *q; { fifoq_state_t *tmp; int error = 0; if (ALTQ_IS_ENABLED(q->q_ifq)) altq_disable(q->q_ifq); fifoq_purge(q); if ((error = altq_detach(q->q_ifq))) return (error); if (fifoq_list == q) fifoq_list = q->q_next; else { for (tmp = fifoq_list; tmp != NULL; tmp = tmp->q_next) if (tmp->q_next == q) { tmp->q_next = q->q_next; break; } if (tmp == NULL) printf("fifoq_detach: no state in fifoq_list!\n"); } FREE(q, M_DEVBUF); return (error); } /* * fifoq_purge * should be called in splimp or after disabling the fifoq. */ static void fifoq_purge(q) fifoq_state_t *q; { struct mbuf *m; while ((m = q->q_head) != NULL) { q->q_head = m->m_nextpkt; m_freem(m); } q->q_tail = NULL; q->q_len = 0; if (ALTQ_IS_ENABLED(q->q_ifq)) q->q_ifq->ifq_len = 0; } #ifdef KLD_MODULE static struct altqsw fifoq_sw = {"fifoq", fifoqopen, fifoqclose, fifoqioctl}; ALTQ_MODULE(altq_fifoq, ALTQT_FIFOQ, &fifoq_sw); #endif /* KLD_MODULE */ #endif /* ALTQ_FIFOQ */ @ 1.2.2.3 log @Sync with HEAD @ text @d1 1 a1 1 /* $NetBSD: altq_fifoq.c,v 1.2.2.2 2001/04/21 17:46:11 bouyer Exp $ */ d300 1 a300 1 * must be called in splnet. d389 1 a389 1 * should be called in splnet or after disabling the fifoq. @ 1.2.4.1 log @Catch up to -current. @ text @d1 1 a1 1 /* $NetBSD: altq_fifoq.c,v 1.2 2000/12/14 08:49:50 thorpej Exp $ */ d300 1 a300 1 * must be called in splnet. d389 1 a389 1 * should be called in splnet or after disabling the fifoq. @ 1.2.4.2 log @Catch up to -current. @ text @d1 1 a1 1 /* $NetBSD: altq_fifoq.c,v 1.2.4.1 2001/06/21 18:12:48 nathanw Exp $ */ a28 3 #include __KERNEL_RCSID(0, "$NetBSD$"); @ 1.1 log @Initial revision @ text @d1 1 @ 1.1.1.1 log @Import ALTQ from KAME. @ text @@