head 1.71; access; symbols netbsd-10-0-RELEASE:1.71 netbsd-10-0-RC6:1.71 netbsd-10-0-RC5:1.71 netbsd-10-0-RC4:1.71 netbsd-10-0-RC3:1.71 netbsd-10-0-RC2:1.71 thorpej-ifq:1.71.0.28 thorpej-ifq-base:1.71 thorpej-altq-separation:1.71.0.26 thorpej-altq-separation-base:1.71 netbsd-10-0-RC1:1.71 netbsd-10:1.71.0.24 netbsd-10-base:1.71 bouyer-sunxi-drm:1.71.0.22 bouyer-sunxi-drm-base:1.71 netbsd-9-3-RELEASE:1.65.2.2 thorpej-i2c-spi-conf2:1.71.0.20 thorpej-i2c-spi-conf2-base:1.71 thorpej-futex2:1.71.0.18 thorpej-futex2-base:1.71 thorpej-cfargs2:1.71.0.16 thorpej-cfargs2-base:1.71 cjep_sun2x-base1:1.71 cjep_sun2x:1.71.0.14 cjep_sun2x-base:1.71 cjep_staticlib_x-base1:1.71 netbsd-9-2-RELEASE:1.65.2.2 cjep_staticlib_x:1.71.0.12 cjep_staticlib_x-base:1.71 thorpej-i2c-spi-conf:1.71.0.10 thorpej-i2c-spi-conf-base:1.71 thorpej-cfargs:1.71.0.8 thorpej-cfargs-base:1.71 thorpej-futex:1.71.0.6 thorpej-futex-base:1.71 netbsd-9-1-RELEASE:1.65.2.2 bouyer-xenpvh-base2:1.71 phil-wifi-20200421:1.71 bouyer-xenpvh-base1:1.71 phil-wifi-20200411:1.71 bouyer-xenpvh:1.71.0.4 bouyer-xenpvh-base:1.71 is-mlppp:1.71.0.2 is-mlppp-base:1.71 phil-wifi-20200406:1.71 netbsd-8-2-RELEASE:1.57.8.2 ad-namecache-base3:1.70 netbsd-9-0-RELEASE:1.65 netbsd-9-0-RC2:1.65 ad-namecache-base2:1.68 ad-namecache-base1:1.68 ad-namecache:1.68.0.2 ad-namecache-base:1.68 netbsd-9-0-RC1:1.65 phil-wifi-20191119:1.66 netbsd-9:1.65.0.2 netbsd-9-base:1.65 phil-wifi-20190609:1.65 netbsd-8-1-RELEASE:1.57.8.2 netbsd-8-1-RC1:1.57.8.2 isaki-audio2:1.62.0.2 isaki-audio2-base:1.62 pgoyette-compat-merge-20190127:1.61 pgoyette-compat-20190127:1.61 pgoyette-compat-20190118:1.61 pgoyette-compat-1226:1.61 pgoyette-compat-1126:1.61 pgoyette-compat-1020:1.61 pgoyette-compat-0930:1.61 pgoyette-compat-0906:1.61 netbsd-7-2-RELEASE:1.56 pgoyette-compat-0728:1.61 netbsd-8-0-RELEASE:1.57.8.2 phil-wifi:1.61.0.4 phil-wifi-base:1.61 pgoyette-compat-0625:1.61 netbsd-8-0-RC2:1.57.8.2 pgoyette-compat-0521:1.61 pgoyette-compat-0502:1.61 pgoyette-compat-0422:1.61 netbsd-8-0-RC1:1.57.8.2 pgoyette-compat-0415:1.61 pgoyette-compat-0407:1.61 pgoyette-compat-0330:1.61 pgoyette-compat-0322:1.61 pgoyette-compat-0315:1.61 netbsd-7-1-2-RELEASE:1.56 pgoyette-compat:1.61.0.2 pgoyette-compat-base:1.61 netbsd-7-1-1-RELEASE:1.56 tls-maxphys-base-20171202:1.61 matt-nb8-mediatek:1.57.8.1.0.2 matt-nb8-mediatek-base:1.57.8.1 nick-nhusb-base-20170825:1.59 perseant-stdc-iso10646:1.59.0.2 perseant-stdc-iso10646-base:1.59 netbsd-8:1.57.0.8 netbsd-8-base:1.57 prg-localcount2-base3:1.57 prg-localcount2-base2:1.57 prg-localcount2-base1:1.57 prg-localcount2:1.57.0.6 prg-localcount2-base:1.57 pgoyette-localcount-20170426:1.57 bouyer-socketcan-base1:1.57 jdolecek-ncq:1.57.0.4 jdolecek-ncq-base:1.57 pgoyette-localcount-20170320:1.57 netbsd-7-1:1.56.0.22 netbsd-7-1-RELEASE:1.56 netbsd-7-1-RC2:1.56 nick-nhusb-base-20170204:1.57 netbsd-7-nhusb-base-20170116:1.56 bouyer-socketcan:1.57.0.2 bouyer-socketcan-base:1.57 pgoyette-localcount-20170107:1.57 netbsd-7-1-RC1:1.56 nick-nhusb-base-20161204:1.57 pgoyette-localcount-20161104:1.57 netbsd-7-0-2-RELEASE:1.56 nick-nhusb-base-20161004:1.57 localcount-20160914:1.56 netbsd-7-nhusb:1.56.0.20 netbsd-7-nhusb-base:1.56 pgoyette-localcount-20160806:1.56 pgoyette-localcount-20160726:1.56 pgoyette-localcount:1.56.0.18 pgoyette-localcount-base:1.56 nick-nhusb-base-20160907:1.56 nick-nhusb-base-20160529:1.56 netbsd-7-0-1-RELEASE:1.56 nick-nhusb-base-20160422:1.56 nick-nhusb-base-20160319:1.56 nick-nhusb-base-20151226:1.56 netbsd-7-0:1.56.0.16 netbsd-7-0-RELEASE:1.56 nick-nhusb-base-20150921:1.56 netbsd-7-0-RC3:1.56 netbsd-7-0-RC2:1.56 netbsd-7-0-RC1:1.56 nick-nhusb-base-20150606:1.56 nick-nhusb-base-20150406:1.56 nick-nhusb:1.56.0.14 nick-nhusb-base:1.56 netbsd-5-2-3-RELEASE:1.51 netbsd-5-1-5-RELEASE:1.51 netbsd-6-0-6-RELEASE:1.55 netbsd-6-1-5-RELEASE:1.55 netbsd-7:1.56.0.12 netbsd-7-base:1.56 yamt-pagecache-base9:1.56 yamt-pagecache-tag8:1.55.4.1 netbsd-6-1-4-RELEASE:1.55 netbsd-6-0-5-RELEASE:1.55 tls-earlyentropy:1.56.0.10 tls-earlyentropy-base:1.56 riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.56 riastradh-drm2-base3:1.56 netbsd-6-1-3-RELEASE:1.55 netbsd-6-0-4-RELEASE:1.55 netbsd-5-2-2-RELEASE:1.51 netbsd-5-1-4-RELEASE:1.51 netbsd-6-1-2-RELEASE:1.55 netbsd-6-0-3-RELEASE:1.55 netbsd-5-2-1-RELEASE:1.51 netbsd-5-1-3-RELEASE:1.51 rmind-smpnet-nbase:1.56 netbsd-6-1-1-RELEASE:1.55 riastradh-drm2-base2:1.56 riastradh-drm2-base1:1.56 riastradh-drm2:1.56.0.8 riastradh-drm2-base:1.56 rmind-smpnet:1.56.0.2 rmind-smpnet-base:1.56 netbsd-6-1:1.55.0.18 netbsd-6-0-2-RELEASE:1.55 netbsd-6-1-RELEASE:1.55 khorben-n900:1.56.0.6 netbsd-6-1-RC4:1.55 netbsd-6-1-RC3:1.55 agc-symver:1.56.0.4 agc-symver-base:1.56 netbsd-6-1-RC2:1.55 netbsd-6-1-RC1:1.55 yamt-pagecache-base8:1.56 netbsd-5-2:1.51.0.18 netbsd-6-0-1-RELEASE:1.55 yamt-pagecache-base7:1.56 netbsd-5-2-RELEASE:1.51 netbsd-5-2-RC1:1.51 matt-nb6-plus-nbase:1.55 yamt-pagecache-base6:1.56 netbsd-6-0:1.55.0.16 netbsd-6-0-RELEASE:1.55 netbsd-6-0-RC2:1.55 tls-maxphys:1.55.0.14 tls-maxphys-base:1.56 matt-nb6-plus:1.55.0.12 matt-nb6-plus-base:1.55 netbsd-6-0-RC1:1.55 jmcneill-usbmp-base10:1.55 yamt-pagecache-base5:1.55 jmcneill-usbmp-base9:1.55 yamt-pagecache-base4:1.55 jmcneill-usbmp-base8:1.55 jmcneill-usbmp-base7:1.55 jmcneill-usbmp-base6:1.55 jmcneill-usbmp-base5:1.55 jmcneill-usbmp-base4:1.55 jmcneill-usbmp-base3:1.55 jmcneill-usbmp-pre-base2:1.55 jmcneill-usbmp-base2:1.55 netbsd-6:1.55.0.10 netbsd-6-base:1.55 netbsd-5-1-2-RELEASE:1.51 netbsd-5-1-1-RELEASE:1.51 jmcneill-usbmp:1.55.0.8 jmcneill-usbmp-base:1.55 jmcneill-audiomp3:1.55.0.6 jmcneill-audiomp3-base:1.55 yamt-pagecache-base3:1.55 yamt-pagecache-base2:1.55 yamt-pagecache:1.55.0.4 yamt-pagecache-base:1.55 rmind-uvmplock-nbase:1.55 cherry-xenmp:1.55.0.2 cherry-xenmp-base:1.55 bouyer-quota2-nbase:1.55 bouyer-quota2:1.53.0.8 bouyer-quota2-base:1.54 jruoho-x86intr:1.53.0.6 jruoho-x86intr-base:1.53 matt-mips64-premerge-20101231:1.53 matt-nb5-mips64-premerge-20101231:1.51 matt-nb5-pq3:1.51.0.16 matt-nb5-pq3-base:1.51 netbsd-5-1:1.51.0.14 netbsd-5-1-RELEASE:1.51 uebayasi-xip-base4:1.53 uebayasi-xip-base3:1.53 yamt-nfs-mp-base11:1.53 netbsd-5-1-RC4:1.51 matt-nb5-mips64-k15:1.51 uebayasi-xip-base2:1.53 yamt-nfs-mp-base10:1.53 netbsd-5-1-RC3:1.51 netbsd-5-1-RC2:1.51 uebayasi-xip-base1:1.53 netbsd-5-1-RC1:1.51 rmind-uvmplock:1.53.0.4 rmind-uvmplock-base:1.55 yamt-nfs-mp-base9:1.53 uebayasi-xip:1.53.0.2 uebayasi-xip-base:1.53 netbsd-5-0-2-RELEASE:1.51 matt-nb5-mips64-premerge-20091211:1.51 matt-premerge-20091211:1.53 yamt-nfs-mp-base8:1.52 matt-nb5-mips64-u2-k2-k4-k7-k8-k9:1.51 matt-nb4-mips64-k7-u2a-k9b:1.51 matt-nb5-mips64-u1-k1-k5:1.51 yamt-nfs-mp-base7:1.52 matt-nb5-mips64:1.51.0.12 netbsd-5-0-1-RELEASE:1.51 jymxensuspend-base:1.51 yamt-nfs-mp-base6:1.51 yamt-nfs-mp-base5:1.51 yamt-nfs-mp-base4:1.51 jym-xensuspend-nbase:1.53 yamt-nfs-mp-base3:1.51 nick-hppapmap-base4:1.51 nick-hppapmap-base3:1.51 netbsd-5-0:1.51.0.10 netbsd-5-0-RELEASE:1.51 netbsd-5-0-RC4:1.51 netbsd-5-0-RC3:1.51 nick-hppapmap-base2:1.51 netbsd-5-0-RC2:1.51 jym-xensuspend:1.51.0.8 jym-xensuspend-base:1.51 netbsd-5-0-RC1:1.51 haad-dm-base2:1.51 haad-nbase2:1.51 ad-audiomp2:1.51.0.6 ad-audiomp2-base:1.51 netbsd-5:1.51.0.4 netbsd-5-base:1.51 nick-hppapmap:1.51.0.2 nick-hppapmap-base:1.51 matt-mips64-base2:1.51 matt-mips64:1.46.0.52 haad-dm-base1:1.51 wrstuden-revivesa-base-4:1.51 netbsd-4-0-1-RELEASE:1.46 wrstuden-revivesa-base-3:1.51 wrstuden-revivesa-base-2:1.50 wrstuden-fixsa-newbase:1.46 nick-csl-alignment-base5:1.46 haad-dm:1.50.0.2 haad-dm-base:1.51 wrstuden-revivesa-base-1:1.50 simonb-wapbl-nbase:1.50 yamt-pf42-base4:1.50 simonb-wapbl:1.49.0.4 simonb-wapbl-base:1.50 yamt-pf42-base3:1.49 hpcarm-cleanup-nbase:1.49 yamt-pf42-baseX:1.48 yamt-pf42-base2:1.49 yamt-nfs-mp-base2:1.49 wrstuden-revivesa:1.49.0.2 wrstuden-revivesa-base:1.50 yamt-nfs-mp:1.48.0.10 yamt-nfs-mp-base:1.48 yamt-pf42:1.48.0.8 yamt-pf42-base:1.48 ad-socklock-base1:1.48 yamt-lazymbuf-base15:1.48 yamt-lazymbuf-base14:1.48 keiichi-mipv6-nbase:1.48 mjf-devfs2:1.48.0.6 mjf-devfs2-base:1.51 nick-net80211-sync:1.48.0.4 nick-net80211-sync-base:1.48 keiichi-mipv6:1.48.0.2 keiichi-mipv6-base:1.48 bouyer-xeni386-merge1:1.46.46.1 matt-armv6-prevmlocking:1.46 wrstuden-fixsa-base-1:1.46 vmlocking2-base3:1.46 netbsd-4-0:1.46.0.50 netbsd-4-0-RELEASE:1.46 bouyer-xeni386-nbase:1.47 yamt-kmem-base3:1.46 cube-autoconf:1.46.0.48 cube-autoconf-base:1.46 yamt-kmem-base2:1.46 bouyer-xeni386:1.46.0.46 bouyer-xeni386-base:1.47 yamt-kmem:1.46.0.44 yamt-kmem-base:1.46 vmlocking2-base2:1.46 reinoud-bufcleanup-nbase:1.46 vmlocking2:1.46.0.42 vmlocking2-base1:1.46 netbsd-4-0-RC5:1.46 matt-nb4-arm:1.46.0.40 matt-nb4-arm-base:1.46 matt-armv6-nbase:1.48 jmcneill-base:1.46 netbsd-4-0-RC4:1.46 mjf-devfs:1.46.0.38 mjf-devfs-base:1.48 bouyer-xenamd64-base2:1.46 vmlocking-nbase:1.46 yamt-x86pmap-base4:1.46 bouyer-xenamd64:1.46.0.36 bouyer-xenamd64-base:1.46 netbsd-4-0-RC3:1.46 yamt-x86pmap-base3:1.46 yamt-x86pmap-base2:1.46 netbsd-4-0-RC2:1.46 yamt-x86pmap:1.46.0.34 yamt-x86pmap-base:1.46 netbsd-4-0-RC1:1.46 matt-armv6:1.46.0.32 matt-armv6-base:1.46 matt-mips64-base:1.46 jmcneill-pm:1.46.0.30 jmcneill-pm-base:1.46 hpcarm-cleanup:1.46.0.28 hpcarm-cleanup-base:1.48 nick-csl-alignment:1.46.0.26 nick-csl-alignment-base:1.46 netbsd-3-1-1-RELEASE:1.42 netbsd-3-0-3-RELEASE:1.42 yamt-idlelwp-base8:1.46 wrstuden-fixsa:1.46.0.24 wrstuden-fixsa-base:1.46 thorpej-atomic:1.46.0.22 thorpej-atomic-base:1.46 reinoud-bufcleanup:1.46.0.20 reinoud-bufcleanup-base:1.46 mjf-ufs-trans:1.46.0.18 mjf-ufs-trans-base:1.46 vmlocking:1.46.0.16 vmlocking-base:1.46 ad-audiomp:1.46.0.14 ad-audiomp-base:1.46 yamt-idlelwp:1.46.0.12 post-newlock2-merge:1.46 newlock2-nbase:1.46 yamt-splraiseipl-base5:1.46 yamt-splraiseipl-base4:1.46 yamt-splraiseipl-base3:1.46 abandoned-netbsd-4-base:1.46 abandoned-netbsd-4:1.46.0.4 netbsd-3-1:1.42.0.22 netbsd-3-1-RELEASE:1.42 netbsd-3-0-2-RELEASE:1.42 yamt-splraiseipl-base2:1.46 netbsd-3-1-RC4:1.42 yamt-splraiseipl:1.46.0.8 yamt-splraiseipl-base:1.46 netbsd-3-1-RC3:1.42 yamt-pdpolicy-base9:1.46 newlock2:1.46.0.6 newlock2-base:1.46 yamt-pdpolicy-base8:1.46 netbsd-3-1-RC2:1.42 netbsd-3-1-RC1:1.42 yamt-pdpolicy-base7:1.46 netbsd-4:1.46.0.10 netbsd-4-base:1.46 yamt-pdpolicy-base6:1.46 chap-midi-nbase:1.46 netbsd-3-0-1-RELEASE:1.42 gdamore-uart:1.46.0.2 gdamore-uart-base:1.46 simonb-timcounters-final:1.43.6.3 yamt-pdpolicy-base5:1.45 chap-midi:1.45.0.2 chap-midi-base:1.46 yamt-pdpolicy-base4:1.44 yamt-pdpolicy-base3:1.44 peter-altq-base:1.44 peter-altq:1.44.0.2 yamt-pdpolicy-base2:1.44 elad-kernelauth-base:1.44 elad-kernelauth:1.43.0.10 yamt-pdpolicy:1.43.0.8 yamt-pdpolicy-base:1.43 yamt-uio_vmspace-base5:1.43 simonb-timecounters:1.43.0.6 simonb-timecounters-base:1.46 rpaulo-netinet-merge-pcb:1.43.0.4 rpaulo-netinet-merge-pcb-base:1.46 yamt-uio_vmspace:1.43.0.2 netbsd-3-0:1.42.0.20 netbsd-3-0-RELEASE:1.42 netbsd-3-0-RC6:1.42 yamt-readahead-base3:1.42 netbsd-3-0-RC5:1.42 netbsd-3-0-RC4:1.42 netbsd-3-0-RC3:1.42 yamt-readahead-base2:1.42 netbsd-3-0-RC2:1.42 yamt-readahead-pervnode:1.42 yamt-readahead-perfile:1.42 yamt-readahead:1.42.0.18 yamt-readahead-base:1.42 netbsd-3-0-RC1:1.42 yamt-vop-base3:1.42 netbsd-2-0-3-RELEASE:1.38 netbsd-2-1:1.38.4.1.0.2 yamt-vop-base2:1.42 thorpej-vnode-attr:1.42.0.16 thorpej-vnode-attr-base:1.42 netbsd-2-1-RELEASE:1.38.4.1 yamt-vop:1.42.0.14 yamt-vop-base:1.42 netbsd-2-1-RC6:1.38.4.1 netbsd-2-1-RC5:1.38.4.1 netbsd-2-1-RC4:1.38.4.1 netbsd-2-1-RC3:1.38.4.1 netbsd-2-1-RC2:1.38.4.1 netbsd-2-1-RC1:1.38.4.1 yamt-lazymbuf:1.42.0.12 yamt-km-base4:1.42 netbsd-2-0-2-RELEASE:1.38 yamt-km-base3:1.42 netbsd-3:1.42.0.10 netbsd-3-base:1.42 yamt-km-base2:1.42 yamt-km:1.42.0.6 yamt-km-base:1.42 kent-audio2:1.42.0.4 kent-audio2-base:1.42 netbsd-2-0-1-RELEASE:1.38 kent-audio1-beforemerge:1.42 netbsd-2:1.38.0.4 netbsd-2-base:1.38 kent-audio1:1.42.0.2 kent-audio1-base:1.42 netbsd-2-0-RELEASE:1.38 netbsd-2-0-RC5:1.38 netbsd-2-0-RC4:1.38 netbsd-2-0-RC3:1.38 netbsd-2-0-RC2:1.38 netbsd-2-0-RC1:1.38 netbsd-2-0:1.38.0.2 netbsd-2-0-base:1.38 netbsd-1-6-PATCH002-RELEASE:1.26 netbsd-1-6-PATCH002:1.26 netbsd-1-6-PATCH002-RC4:1.26 netbsd-1-6-PATCH002-RC3:1.26 netbsd-1-6-PATCH002-RC2:1.26 netbsd-1-6-PATCH002-RC1:1.26 ktrace-lwp:1.34.0.2 ktrace-lwp-base:1.43 netbsd-1-6-PATCH001:1.26 netbsd-1-6-PATCH001-RELEASE:1.26 netbsd-1-6-PATCH001-RC3:1.26 netbsd-1-6-PATCH001-RC2:1.26 netbsd-1-6-PATCH001-RC1:1.26 nathanw_sa_end:1.23.6.6 nathanw_sa_before_merge:1.32 fvdl_fs64_base:1.32 gmcgarry_ctxsw:1.32.0.4 gmcgarry_ctxsw_base:1.32 gmcgarry_ucred:1.32.0.2 gmcgarry_ucred_base:1.32 nathanw_sa_base:1.32 kqueue-aftermerge:1.29 kqueue-beforemerge:1.29 netbsd-1-6-RELEASE:1.26 netbsd-1-6-RC3:1.26 netbsd-1-6-RC2:1.26 netbsd-1-6-RC1:1.26 netbsd-1-6:1.26.0.16 netbsd-1-6-base:1.26 gehenna-devsw:1.26.0.14 gehenna-devsw-base:1.28 netbsd-1-5-PATCH003:1.23 eeh-devprop:1.26.0.12 eeh-devprop-base:1.26 newlock:1.26.0.10 newlock-base:1.26 ifpoll-base:1.26 thorpej-mips-cache:1.26.0.6 thorpej-mips-cache-base:1.26 thorpej-devvp-base3:1.26 thorpej-devvp-base2:1.26 post-chs-ubcperf:1.26 pre-chs-ubcperf:1.26 thorpej-devvp:1.26.0.4 thorpej-devvp-base:1.26 netbsd-1-5-PATCH002:1.23 kqueue:1.26.0.2 kqueue-base:1.29 netbsd-1-5-PATCH001:1.23 thorpej_scsipi_beforemerge:1.23 nathanw_sa:1.23.0.6 thorpej_scsipi_nbase:1.23 netbsd-1-5-RELEASE:1.23 netbsd-1-5-BETA2:1.23 netbsd-1-5-BETA:1.23 netbsd-1-4-PATCH003:1.13.2.1 netbsd-1-5-ALPHA2:1.23 netbsd-1-5:1.23.0.4 netbsd-1-5-base:1.23 minoura-xpg4dl-base:1.23 minoura-xpg4dl:1.23.0.2 netbsd-1-4-PATCH002:1.13 chs-ubc2-newbase:1.20 wrstuden-devbsize-19991221:1.15 wrstuden-devbsize:1.13.0.12 wrstuden-devbsize-base:1.15 kame_141_19991130:1.13 comdex-fall-1999:1.14.0.2 comdex-fall-1999-base:1.14 fvdl-softdep:1.13.0.10 fvdl-softdep-base:1.15 thorpej_scsipi:1.13.0.8 thorpej_scsipi_base:1.23 netbsd-1-4-PATCH001:1.13 kame_14_19990705:1.13 kame_14_19990628:1.13 kame:1.13.0.6 chs-ubc2:1.13.0.4 chs-ubc2-base:1.13 netbsd-1-4-RELEASE:1.13 netbsd-1-4:1.13.0.2 netbsd-1-4-base:1.13 netbsd-1-3-PATCH003:1.3 netbsd-1-3-PATCH003-CANDIDATE2:1.3 kenh-if-detach:1.12.0.4 kenh-if-detach-base:1.12 netbsd-1-3-PATCH003-CANDIDATE1:1.3 netbsd-1-3-PATCH003-CANDIDATE0:1.3 chs-ubc:1.12.0.2 chs-ubc-base:1.12 eeh-paddr_t:1.5.0.2 eeh-paddr_t-base:1.5 netbsd-1-3-PATCH002:1.3 netbsd-1-3-PATCH001:1.3 netbsd-1-3-RELEASE:1.3 netbsd-1-3-BETA:1.3 netbsd-1-3:1.3.0.8 netbsd-1-3-base:1.3 thorpej-signal:1.3.0.6 thorpej-signal-base:1.3 marc-pcmcia:1.3.0.4 marc-pcmcia-bp:1.3 marc-pcmcia-base:1.3 bouyer-scsipi:1.3.0.2; locks; strict; comment @ * @; 1.71 date 2020.03.15.23.04.51; author thorpej; state Exp; branches; next 1.70; commitid R0dFG2H87iZWgy0C; 1.70 date 2020.02.17.15.51.25; author msaitoh; state Exp; branches; next 1.69; commitid jsktqu9Si0nkK2XB; 1.69 date 2020.02.01.20.56.16; author thorpej; state Exp; branches; next 1.68; commitid mCpgkK9QPJMPW0VB; 1.68 date 2019.12.05.05.29.27; author msaitoh; state Exp; branches 1.68.2.1; next 1.67; commitid ctZ6RsurfsbaGtNB; 1.67 date 2019.11.28.14.08.22; author msaitoh; state Exp; branches; next 1.66; commitid MUaE4x5KIvr7MCMB; 1.66 date 2019.10.03.14.41.14; author jmcneill; state Exp; branches; next 1.65; commitid ihCTjVqkphWkLqFB; 1.65 date 2019.05.17.07.37.12; author msaitoh; state Exp; branches 1.65.2.1; next 1.64; commitid XYuCMLR1eE4pSwnB; 1.64 date 2019.05.10.06.33.14; author msaitoh; state Exp; branches; next 1.63; commitid wXj8MdX8O8VEKCmB; 1.63 date 2019.04.24.05.07.20; author msaitoh; state Exp; branches; next 1.62; commitid QmLhQtSR0ib6NykB; 1.62 date 2019.04.17.07.04.03; author msaitoh; state Exp; branches; next 1.61; commitid 3ulW1jYqV7tgFFjB; 1.61 date 2017.10.04.07.08.01; author msaitoh; state Exp; branches 1.61.4.1; next 1.60; commitid zxT0I3g95uGCGH9A; 1.60 date 2017.10.04.07.07.16; author msaitoh; state Exp; branches; next 1.59; commitid sSmuoyJFXe5hGH9A; 1.59 date 2017.06.08.02.27.30; author msaitoh; state Exp; branches; next 1.58; 1.58 date 2017.06.05.08.50.07; author msaitoh; state Exp; branches; next 1.57; 1.57 date 2016.09.14.11.43.08; author roy; state Exp; branches 1.57.8.1; next 1.56; 1.56 date 2012.10.25.10.59.43; author msaitoh; state Exp; branches 1.56.14.1 1.56.18.1; next 1.55; 1.55 date 2011.02.20.13.51.17; author cegger; state Exp; branches 1.55.4.1 1.55.14.1; next 1.54; 1.54 date 2011.01.26.00.57.47; author dyoung; state Exp; branches; next 1.53; 1.53 date 2009.10.05.21.27.36; author dyoung; state Exp; branches 1.53.4.1 1.53.6.1 1.53.8.1; next 1.52; 1.52 date 2009.08.12.11.17.17; author msaitoh; state Exp; branches; next 1.51; 1.51 date 2008.09.09.20.12.18; author mhitch; state Exp; branches; next 1.50; 1.50 date 2008.06.15.16.33.58; author christos; state Exp; branches 1.50.2.1; next 1.49; 1.49 date 2008.04.28.20.24.09; author martin; state Exp; branches 1.49.2.1 1.49.4.1; next 1.48; 1.48 date 2008.02.13.09.25.24; author skrll; state Exp; branches 1.48.4.1 1.48.6.1 1.48.8.1 1.48.10.1; next 1.47; 1.47 date 2008.01.10.08.00.22; author dyoung; state Exp; branches; next 1.46; 1.46 date 2006.06.03.12.43.28; author ragge; state Exp; branches 1.46.32.1 1.46.38.1 1.46.46.1; next 1.45; 1.45 date 2006.05.18.09.05.51; author liamjfoy; state Exp; branches 1.45.2.1; next 1.44; 1.44 date 2006.03.08.23.46.27; author lukem; state Exp; branches 1.44.2.1; next 1.43; 1.43 date 2005.12.10.23.21.38; author elad; state Exp; branches 1.43.4.1 1.43.6.1 1.43.8.1 1.43.10.1; next 1.42; 1.42 date 2004.11.11.20.34.30; author dsl; state Exp; branches 1.42.12.1; next 1.41; 1.41 date 2004.10.16.11.11.04; author dsl; state Exp; branches; next 1.40; 1.40 date 2004.04.09.20.44.57; author thorpej; state Exp; branches; next 1.39; 1.39 date 2004.04.09.20.30.28; author thorpej; state Exp; branches; next 1.38; 1.38 date 2004.03.10.14.42.10; author keihan; state Exp; branches 1.38.4.1; next 1.37; 1.37 date 2004.02.19.11.58.30; author ragge; state Exp; branches; next 1.36; 1.36 date 2003.10.13.05.06.44; author dyoung; state Exp; branches; next 1.35; 1.35 date 2003.07.08.07.13.51; author itojun; state Exp; branches; next 1.34; 1.34 date 2003.04.23.23.16.43; author bjh21; state Exp; branches 1.34.2.1; next 1.33; 1.33 date 2003.02.25.01.57.36; author dyoung; state Exp; branches; next 1.32; 1.32 date 2002.11.07.08.00.47; author thorpej; state Exp; branches; next 1.31; 1.31 date 2002.11.07.07.53.37; author thorpej; state Exp; branches; next 1.30; 1.30 date 2002.11.07.07.42.24; author thorpej; state Exp; branches; next 1.29; 1.29 date 2002.09.27.05.27.20; author onoe; state Exp; branches; next 1.28; 1.28 date 2002.08.21.03.22.04; author onoe; state Exp; branches; next 1.27; 1.27 date 2002.08.10.23.21.58; author thorpej; state Exp; branches; next 1.26; 1.26 date 2001.06.30.21.23.39; author kleink; state Exp; branches 1.26.2.1 1.26.14.1; next 1.25; 1.25 date 2001.06.30.17.53.59; author bjh21; state Exp; branches; next 1.24; 1.24 date 2001.05.31.16.30.04; author thorpej; state Exp; branches; next 1.23; 1.23 date 2000.03.06.20.50.29; author thorpej; state Exp; branches 1.23.6.1; next 1.22; 1.22 date 2000.02.17.21.53.16; author sommerfeld; state Exp; branches; next 1.21; 1.21 date 2000.02.16.18.03.14; author thorpej; state Exp; branches; next 1.20; 1.20 date 2000.01.26.21.58.18; author thorpej; state Exp; branches; next 1.19; 1.19 date 2000.01.25.20.18.52; author thorpej; state Exp; branches; next 1.18; 1.18 date 2000.01.25.00.58.59; author thorpej; state Exp; branches; next 1.17; 1.17 date 2000.01.24.01.20.21; author augustss; state Exp; branches; next 1.16; 1.16 date 2000.01.23.23.49.48; author chopps; state Exp; branches; next 1.15; 1.15 date 99.11.03.23.06.35; author thorpej; state Exp; branches; next 1.14; 1.14 date 99.10.27.17.59.24; author thorpej; state Exp; branches; next 1.13; 1.13 date 99.03.23.21.46.47; author thorpej; state Exp; branches 1.13.2.1 1.13.8.1 1.13.10.1 1.13.12.1; next 1.12; 1.12 date 98.11.02.22.10.26; author thorpej; state Exp; branches; next 1.11; 1.11 date 98.08.12.23.23.29; author thorpej; state Exp; branches; next 1.10; 1.10 date 98.08.08.22.12.30; author thorpej; state Exp; branches; next 1.9; 1.9 date 98.08.06.19.16.37; author thorpej; state Exp; branches; next 1.8; 1.8 date 98.08.06.02.38.19; author thorpej; state Exp; branches; next 1.7; 1.7 date 98.08.06.02.19.34; author thorpej; state Exp; branches; next 1.6; 1.6 date 98.08.03.12.42.26; author thorpej; state Exp; branches; next 1.5; 1.5 date 98.01.30.08.37.41; author jtc; state Exp; branches; next 1.4; 1.4 date 98.01.30.01.24.40; author thorpej; state Exp; branches; next 1.3; 1.3 date 97.03.26.01.19.27; author thorpej; state Exp; branches; next 1.2; 1.2 date 97.03.24.06.57.31; author thorpej; state Exp; branches; next 1.1; 1.1 date 97.03.17.02.55.17; author thorpej; state Exp; branches; next ; 1.68.2.1 date 2020.02.29.20.21.06; author ad; state Exp; branches; next ; commitid OjSb8ro7YQETQBYB; 1.65.2.1 date 2020.02.25.18.40.43; author martin; state Exp; branches; next 1.65.2.2; commitid WD2OQVIkhvFwq5YB; 1.65.2.2 date 2020.03.19.19.18.27; author martin; state Exp; branches; next ; commitid ZGhbfxtHDikDT21C; 1.61.4.1 date 2018.07.12.16.35.34; author phil; state Exp; branches; next 1.61.4.2; commitid US0n8axK0fqSKRJA; 1.61.4.2 date 2019.06.10.22.09.45; author christos; state Exp; branches; next 1.61.4.3; commitid jtc8rnCzWiEEHGqB; 1.61.4.3 date 2020.04.08.14.08.57; author martin; state Exp; branches; next 1.61.4.4; commitid Qli2aW9E74UFuA3C; 1.61.4.4 date 2020.04.13.08.05.15; author martin; state Exp; branches; next ; commitid X01YhRUPVUDaec4C; 1.57.8.1 date 2017.07.04.16.13.58; author martin; state Exp; branches; next 1.57.8.2; 1.57.8.2 date 2017.11.21.15.06.27; author martin; state Exp; branches; next ; commitid 0sGz4eaqQqS9NUfA; 1.56.14.1 date 2016.10.05.20.56.08; author skrll; state Exp; branches; next 1.56.14.2; 1.56.14.2 date 2017.08.28.17.53.11; author skrll; state Exp; branches; next ; commitid UQQpnjvcNkUZn05A; 1.56.18.1 date 2016.11.04.14.49.20; author pgoyette; state Exp; branches; next ; 1.55.4.1 date 2012.10.30.17.22.43; author yamt; state Exp; branches; next ; 1.55.14.1 date 2012.11.20.03.02.47; author tls; state Exp; branches; next 1.55.14.2; 1.55.14.2 date 2017.12.03.11.39.02; author jdolecek; state Exp; branches; next ; commitid XcIYRZTAh1LmerhA; 1.53.4.1 date 2011.03.05.20.55.51; author rmind; state Exp; branches; next ; 1.53.6.1 date 2011.06.06.09.09.52; author jruoho; state Exp; branches; next ; 1.53.8.1 date 2011.02.08.16.20.01; author bouyer; state Exp; branches; next 1.53.8.2; 1.53.8.2 date 2011.03.05.15.10.47; author bouyer; state Exp; branches; next ; 1.50.2.1 date 2008.10.19.22.17.41; author haad; state Exp; branches; next ; 1.49.2.1 date 2008.06.23.04.31.58; author wrstuden; state Exp; branches; next 1.49.2.2; 1.49.2.2 date 2008.09.24.16.38.58; author wrstuden; state Exp; branches; next ; 1.49.4.1 date 2008.06.18.16.33.50; author simonb; state Exp; branches; next ; 1.48.4.1 date 2008.02.23.12.58.39; author skrll; state Exp; branches; next ; 1.48.6.1 date 2008.06.02.13.24.22; author mjf; state Exp; branches; next 1.48.6.2; 1.48.6.2 date 2008.06.29.09.33.18; author mjf; state Exp; branches; next 1.48.6.3; 1.48.6.3 date 2008.09.28.10.40.56; author mjf; state Exp; branches; next ; 1.48.8.1 date 2008.05.18.12.35.27; author yamt; state Exp; branches; next 1.48.8.2; 1.48.8.2 date 2008.06.17.09.15.13; author yamt; state Exp; branches; next ; 1.48.10.1 date 2008.05.16.02.25.40; author yamt; state Exp; branches; next 1.48.10.2; 1.48.10.2 date 2009.05.04.08.14.15; author yamt; state Exp; branches; next 1.48.10.3; 1.48.10.3 date 2009.08.19.18.48.23; author yamt; state Exp; branches; next 1.48.10.4; 1.48.10.4 date 2010.03.11.15.04.27; author yamt; state Exp; branches; next ; 1.46.32.1 date 2008.03.23.02.05.05; author matt; state Exp; branches; next ; 1.46.38.1 date 2008.02.18.21.07.01; author mjf; state Exp; branches; next ; 1.46.46.1 date 2008.01.10.23.44.35; author bouyer; state Exp; branches; next ; 1.45.2.1 date 2006.06.19.04.09.12; author chap; state Exp; branches; next ; 1.44.2.1 date 2006.05.24.15.50.43; author tron; state Exp; branches; next ; 1.43.4.1 date 2006.09.09.02.58.06; author rpaulo; state Exp; branches; next ; 1.43.6.1 date 2006.04.22.11.40.06; author simonb; state Exp; branches; next 1.43.6.2; 1.43.6.2 date 2006.06.01.22.38.37; author kardel; state Exp; branches; next 1.43.6.3; 1.43.6.3 date 2006.06.03.19.44.04; author kardel; state Exp; branches; next ; 1.43.8.1 date 2006.03.13.09.07.39; author yamt; state Exp; branches; next 1.43.8.2; 1.43.8.2 date 2006.05.24.10.58.56; author yamt; state Exp; branches; next 1.43.8.3; 1.43.8.3 date 2006.06.26.12.53.39; author yamt; state Exp; branches; next ; 1.43.10.1 date 2006.04.19.04.46.10; author elad; state Exp; branches; next ; 1.42.12.1 date 2006.06.21.15.10.27; author yamt; state Exp; branches; next 1.42.12.2; 1.42.12.2 date 2008.01.21.09.47.05; author yamt; state Exp; branches; next 1.42.12.3; 1.42.12.3 date 2008.02.27.08.37.00; author yamt; state Exp; branches; next ; 1.38.4.1 date 2005.07.24.01.52.51; author snj; state Exp; branches; next ; 1.34.2.1 date 2004.08.03.10.54.15; author skrll; state Exp; branches; next 1.34.2.2; 1.34.2.2 date 2004.09.18.14.54.16; author skrll; state Exp; branches; next 1.34.2.3; 1.34.2.3 date 2004.09.21.13.36.38; author skrll; state Exp; branches; next 1.34.2.4; 1.34.2.4 date 2004.10.19.15.58.10; author skrll; state Exp; branches; next 1.34.2.5; 1.34.2.5 date 2004.11.14.08.16.13; author skrll; state Exp; branches; next 1.34.2.6; 1.34.2.6 date 2005.12.11.10.29.19; author christos; state Exp; branches; next ; 1.26.2.1 date 2002.09.06.08.48.54; author jdolecek; state Exp; branches; next 1.26.2.2; 1.26.2.2 date 2002.10.10.18.43.44; author jdolecek; state Exp; branches; next ; 1.26.14.1 date 2002.08.29.00.56.42; author gehenna; state Exp; branches; next ; 1.23.6.1 date 2001.06.21.20.08.08; author nathanw; state Exp; branches; next 1.23.6.2; 1.23.6.2 date 2001.08.24.00.12.12; author nathanw; state Exp; branches; next 1.23.6.3; 1.23.6.3 date 2002.08.13.02.20.14; author nathanw; state Exp; branches; next 1.23.6.4; 1.23.6.4 date 2002.08.27.23.47.53; author nathanw; state Exp; branches; next 1.23.6.5; 1.23.6.5 date 2002.10.18.02.45.12; author nathanw; state Exp; branches; next 1.23.6.6; 1.23.6.6 date 2002.11.11.22.15.01; author nathanw; state Exp; branches; next ; 1.13.2.1 date 2000.05.11.09.15.57; author he; state Exp; branches; next ; 1.13.8.1 date 2000.11.20.18.10.04; author bouyer; state Exp; branches; next ; 1.13.10.1 date 99.11.15.00.42.13; author fvdl; state Exp; branches; next ; 1.13.12.1 date 99.12.27.18.36.10; author wrstuden; state Exp; branches; next ; desc @@ 1.71 log @Define and implement a locking protocol for the ifmedia / mii layers: - MP-safe drivers provide a mutex to ifmedia that is used to serialize access to media-related structures / hardware regsiters. Converted drivers use the new ifmedia_init_with_lock() function for this. The new name is provided to ease the transition. - Un-converted drivers continue to call ifmedia_init(), which will supply a compatibility lock to be used instead. Several media-related entry points must be aware of this compatibility lock, and are able to acquire it recursively a limited number of times, if needed. This is a SPIN mutex with priority IPL_NET. - This same lock is used to serialize access to PHY registers and other MII-related data structures. The PHY drivers are modified to acquire and release the lock, as needed, and assert the lock is held as a diagnostic aid. The "usbnet" framework has had an overhaul of its internal locking protocols to fit in with the media / mii changes, and the drivers adapted. USB wifi drivers have been changed to provide their own adaptive mutex to the ifmedia later via a new ieee80211_media_init_with_lock() function. This is required because the USB drivers need an adaptive mutex. Besised "usbnet", a few other drivers are converted: vmx, wm, ixgbe / ixv. mcx also now calls ifmedia_init_with_lock() because it needs to also use an adaptive mutex. The mcx driver still needs to be fully converted to NET_MPSAFE. @ text @/* $NetBSD: if_media.h,v 1.70 2020/02/17 15:51:25 msaitoh Exp $ */ /*- * Copyright (c) 1998, 2000, 2001, 2020 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility, * NASA Ames Research Center. * * 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 THE NETBSD FOUNDATION, INC. 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 THE FOUNDATION 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. */ /* * Copyright (c) 1997 * Jonathan Stone and Jason R. Thorpe. All rights reserved. * * This software is derived from information provided by Matt Thomas. * * 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. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by Jonathan Stone * and Jason R. Thorpe for the NetBSD Project. * 4. The names of the authors may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 THE AUTHOR 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. */ #ifndef _NET_IF_MEDIA_H_ #define _NET_IF_MEDIA_H_ /* * Prototypes and definitions for BSD/OS-compatible network interface * media selection. * * Where it is safe to do so, this code strays slightly from the BSD/OS * design. Software which uses the API (device drivers, basically) * shouldn't notice any difference. * * Many thanks to Matt Thomas for providing the information necessary * to implement this interface. */ /* * Status bits. THIS IS NOT A MEDIA WORD. */ #define IFM_AVALID 0x00000001 /* Active bit valid */ #define IFM_ACTIVE 0x00000002 /* Interface attached to working net */ /* * if_media Options word: * Bits Use * ---- ------- * 0-4 Media subtype MAX SUBTYPE == 255 for ETH and 31 for others * See below (IFM_ETHER part) for the detail. * 5-7 Media type * 8-15 Type specific options * 16-18 Mode (for multi-mode devices) * 19 (Reserved for Future Use) * 20-27 Shared (global) options * 28-31 Instance * * 3 2 1 * 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 * +-------+---------------+-+-----+---------------+-----+---------+ * | | |R| | | | | * | IMASK | GMASK |F|MMASK+-----+ OMASK |NMASK| TMASK | * | | |U| |XTMSK| | | | * +-------+---------------+-+-----+-----+---------+-----+---------+ * <-----> <---> <---> * IFM_INST() IFM_MODE() IFM_TYPE() * * IFM_SUBTYPE(other than ETH)<-------> * * <---> IFM_SUBTYPE(ETH)<-------> * * * <-------------> <-------------> * IFM_OPTIONS() */ /* * Masks */ #define IFM_NMASK 0x000000e0 /* Network type */ #define IFM_TMASK 0x0000001f /* Media sub-type */ #define IFM_IMASK 0xf0000000 /* Instance */ #define IFM_ISHIFT 28 /* Instance shift */ #define IFM_OMASK 0x0000ff00 /* Type specific options */ #define IFM_MMASK 0x00070000 /* Mode */ #define IFM_MSHIFT 16 /* Mode shift */ #define IFM_GMASK 0x0ff00000 /* Global options */ /* * Macros to extract various bits of information from the media word. */ #define IFM_TYPE(x) ((x) & IFM_NMASK) #define IFM_SUBTYPE(x) (IFM_TYPE(x) == IFM_ETHER ? \ IFM_ETHER_SUBTYPE_GET(x) : ((x) & IFM_TMASK)) #define IFM_TYPE_MATCH(dt, t) \ (IFM_TYPE(dt) == 0 || IFM_TYPE(dt) == IFM_TYPE(t)) #define IFM_TYPE_SUBTYPE_MATCH(dt, t) \ (IFM_TYPE(dt) == IFM_TYPE(t) && IFM_SUBTYPE(dt) == IFM_SUBTYPE(t)) #define IFM_INST(x) (((x) & IFM_IMASK) >> IFM_ISHIFT) #define IFM_OPTIONS(x) ((x) & (IFM_OMASK | IFM_GMASK)) #define IFM_MODE(x) ((x) & IFM_MMASK) #define IFM_INST_MAX IFM_INST(IFM_IMASK) #define IFM_INST_ANY ((u_int) -1) /* Mask of "status valid" bits, for ifconfig(8). */ #define IFM_STATUS_VALID IFM_AVALID /* List of "status valid" bits, for ifconfig(8). */ #define IFM_STATUS_VALID_LIST { \ IFM_AVALID, \ 0, \ } /* * Macro to create a media word. */ #define IFM_MAKEWORD(type, subtype, options, instance) \ ((type) | (subtype) | (options) | ((instance) << IFM_ISHIFT)) #define IFM_MAKEMODE(mode) \ (((mode) << IFM_MSHIFT) & IFM_MMASK) /* * Media type (IFM_NMASK). */ #define IFM_GENERIC 0x00000000 /* Only used for link status reporting */ #define IFM_ETHER 0x00000020 #define IFM_TOKEN 0x00000040 #define IFM_FDDI 0x00000060 #define IFM_IEEE80211 0x00000080 #define IFM_CARP 0x000000c0 /* Common Address Redundancy Protocol */ #define IFM_NMIN IFM_ETHER /* lowest Network type */ #define IFM_NMAX IFM_NMASK /* highest Network type */ /* * Shared media sub-types (IFM_TMASK) */ #define IFM_AUTO 0 /* Autoselect best media */ #define IFM_MANUAL 1 /* Jumper/dipswitch selects media */ #define IFM_NONE 2 /* Deselect all media */ /* * Shared (global) options (IFM_GMASK) */ #define IFM_FDX 0x00100000 /* Force full duplex */ #define IFM_HDX 0x00200000 /* Force half duplex */ #define IFM_FLOW 0x00400000 /* enable hardware flow control */ #define IFM_FLAG0 0x01000000 /* Driver defined flag */ #define IFM_FLAG1 0x02000000 /* Driver defined flag */ #define IFM_FLAG2 0x04000000 /* Driver defined flag */ #define IFM_LOOP 0x08000000 /* Put hardware in loopback */ /* * 0: Generic (IFM_GENERIC). Only used for link status reporting. * No any media specific flag. */ /* * 1: Ethernet (IFM_ETHER) * * In order to use more than 31 subtypes, Ethernet uses some of the option * bits as part of the subtype field. See the options section below for * relevant definitions. */ #define IFM_ETHER_SUBTYPE(x) (((x) & IFM_TMASK) | \ (((x) & (_IFM_ETH_XTMASK >> IFM_ETH_XSHIFT)) << IFM_ETH_XSHIFT)) #define IFM_ETHER_SUBTYPE_GET(x) ((x) & (IFM_TMASK | _IFM_ETH_XTMASK)) #define _IFM_EX(x) IFM_ETHER_SUBTYPE(x) /* internal shorthand */ #define IFM_10_T 3 /* 10BaseT - RJ45 */ #define IFM_10_2 4 /* 10Base2 - Thinnet */ #define IFM_10_5 5 /* 10Base5 - AUI */ #define IFM_100_TX 6 /* 100BaseTX - RJ45 */ #define IFM_100_FX 7 /* 100BaseFX - Fiber */ #define IFM_100_T4 8 /* 100BaseT4 - 4 pair cat 3 */ #define IFM_100_VG 9 /* 100VG-AnyLAN */ #define IFM_100_T2 10 /* 100BaseT2 */ #define IFM_1000_SX 11 /* 1000BaseSX - multi-mode fiber */ #define IFM_10_STP 12 /* 10BaseT over shielded TP */ #define IFM_10_FL 13 /* 10BaseFL - Fiber */ #define IFM_1000_LX 14 /* 1000baseLX - single-mode fiber */ #define IFM_1000_CX 15 /* 1000baseCX - 150ohm STP */ #define IFM_1000_T 16 /* 1000baseT - 4 pair cat 5 */ #define IFM_HPNA_1 17 /* HomePNA 1.0 (1Mb/s) */ #define IFM_10G_LR 18 /* 10GbaseLR - single-mode fiber */ #define IFM_10G_SR 19 /* 10GBase-SR 850nm Multi-mode */ #define IFM_10G_CX4 20 /* 10GBase CX4 copper */ #define IFM_2500_SX 21 /* 2500baseSX - multi-mode fiber */ #define IFM_1000_BX10 22 /* 1000base-BX10 */ #define IFM_10G_TWINAX 23 /* 10GBase Twinax copper */ #define IFM_10G_TWINAX_LONG 24 /* 10GBase Twinax Long copper */ #define IFM_10G_LRM 25 /* 10GBase-LRM 850nm Multi-mode */ #define IFM_10G_T 26 /* 10GBase-T - RJ45 */ #define IFM_1000_KX 27 /* 1000base-KX backplane */ #define IFM_2500_KX 28 /* 2500base-KX backplane */ #define IFM_2500_T 29 /* 2500base-T - RJ45 */ #define IFM_5000_T 30 /* 5Gbase-T - RJ45 */ #define IFM_OTHER 31 /* * This number indicates "Not listed". * and also used for backward * compatibility. */ #define IFM_1000_SGMII _IFM_EX(32) /* 1G SGMII */ #define IFM_5000_KR _IFM_EX(33) /* 5GBASE-KR backplane */ #define IFM_10G_AOC _IFM_EX(34) /* 10G active optical cable */ #define IFM_10G_CR1 _IFM_EX(35) /* 10GBASE-CR1 Twinax splitter */ #define IFM_10G_ER _IFM_EX(36) /* 10GBASE-ER */ #define IFM_10G_KR _IFM_EX(37) /* 10GBASE-KR backplane */ #define IFM_10G_KX4 _IFM_EX(38) /* 10GBASE-KX4 backplane */ #define IFM_10G_LX4 _IFM_EX(39) /* 10GBASE-LX4 */ #define IFM_10G_SFI _IFM_EX(40) /* 10G SFI */ #define IFM_10G_ZR _IFM_EX(41) /* 10GBASE-ZR */ #define IFM_20G_KR2 _IFM_EX(42) /* 20GBASE-KR2 backplane */ #define IFM_25G_AOC _IFM_EX(43) /* 25G active optical cable */ #define IFM_25G_AUI _IFM_EX(44) /* 25G-AUI-C2C (chip to chip) */ #define IFM_25G_CR _IFM_EX(45) /* 25GBASE-CR (twinax) */ #define IFM_25G_ACC _IFM_EX(46) /* 25GBASE-ACC */ #define IFM_25G_CR_S _IFM_EX(47) /* 25GBASE-CR-S (CR short) */ #define IFM_25G_ER _IFM_EX(48) /* 25GBASE-ER */ #define IFM_25G_KR _IFM_EX(49) /* 25GBASE-KR */ #define IFM_25G_KR_S _IFM_EX(50) /* 25GBASE-KR-S (KR short) */ #define IFM_25G_LR _IFM_EX(51) /* 25GBASE-LR */ #define IFM_25G_SR _IFM_EX(52) /* 25GBASE-SR */ #define IFM_25G_T _IFM_EX(53) /* 25GBASE-T - RJ45 */ #define IFM_40G_AOC _IFM_EX(54) /* 40G Active Optical Cable */ #define IFM_40G_CR4 _IFM_EX(55) /* 40GBASE-CR4 */ #define IFM_40G_ER4 _IFM_EX(56) /* 40GBASE-ER4 */ #define IFM_40G_FR _IFM_EX(57) /* 40GBASE-FR */ #define IFM_40G_KR4 _IFM_EX(58) /* 40GBASE-KR4 */ #define IFM_40G_LR4 _IFM_EX(59) /* 40GBASE-LR4 */ #define IFM_40G_SR4 _IFM_EX(60) /* 40GBASE-SR4 */ #define IFM_40G_T _IFM_EX(61) /* 40GBASE-T */ #define IFM_40G_XLPPI _IFM_EX(62) /* 40G XLPPI */ #define IFM_50G_AUI1 _IFM_EX(63) /* 50GAUI-1 */ #define IFM_50G_AUI2 _IFM_EX(64) /* 50GAUI-2 */ #define IFM_50G_CR _IFM_EX(65) /* 50GBASE-CR */ #define IFM_50G_CR2 _IFM_EX(66) /* 50GBASE-CR2 */ #define IFM_50G_FR _IFM_EX(67) /* 50GBASE-FR */ #define IFM_50G_KR _IFM_EX(68) /* 50GBASE-KR */ #define IFM_50G_KR2 _IFM_EX(69) /* 50GBASE-KR2 */ #define IFM_50G_LAUI2 _IFM_EX(70) /* 50GLAUI-2 */ #define IFM_50G_LR _IFM_EX(71) /* 50GBASE-LR */ /* _IFM_EX(72) Not defined yet */ #define IFM_50G_SR _IFM_EX(73) /* 50GBASE-SR */ #define IFM_50G_SR2 _IFM_EX(74) /* 50GBASE-SR2 */ #define IFM_56G_R4 _IFM_EX(75) /* 56GBASE-R4 */ #define IFM_100G_CR2 _IFM_EX(76) /* 100GBASE-CR2 (CP2?) */ #define IFM_100G_CR4 _IFM_EX(77) /* 100GBASE-CR4 */ #define IFM_100G_CR10 _IFM_EX(78) /* 100GBASE-CR10 */ #define IFM_100G_DR _IFM_EX(79) /* 100GBASE-DR */ #define IFM_100G_ER4 _IFM_EX(80) /* 100GBASE-ER4 */ #define IFM_100G_KP4 _IFM_EX(81) /* 100GBASE-KP4 */ #define IFM_100G_KR2 _IFM_EX(82) /* 100GBASE-KR2 */ #define IFM_100G_KR4 _IFM_EX(83) /* 100GBASE-KR4 */ #define IFM_100G_LR4 _IFM_EX(84) /* 100GBASE-LR4 */ #define IFM_100G_SR2 _IFM_EX(85) /* 100GBASE-SR2 */ #define IFM_100G_SR4 _IFM_EX(86) /* 100GBASE-SR4 */ #define IFM_100G_SR10 _IFM_EX(87) /* 100GBASE-SR10 */ #define IFM_200G_CR2 _IFM_EX(88) /* 200GBASE-CR2 */ #define IFM_200G_CR4 _IFM_EX(89) /* 200GBASE-CR4 */ #define IFM_200G_DR4 _IFM_EX(90) /* 200GBASE-DR4 */ #define IFM_200G_FR4 _IFM_EX(91) /* 200GBASE-FR4 */ #define IFM_200G_KR2 _IFM_EX(92) /* 200GBASE-KR2 */ #define IFM_200G_KR4 _IFM_EX(93) /* 200GBASE-KR4 */ #define IFM_200G_LR4 _IFM_EX(94) /* 200GBASE-LR4 */ #define IFM_200G_SR4 _IFM_EX(95) /* 200GBASE-SR4 */ #define IFM_400G_CR4 _IFM_EX(96) /* 400GBASE-CR4 */ #define IFM_400G_DR4 _IFM_EX(97) /* 400GBASE-DR4 */ #define IFM_400G_FR8 _IFM_EX(98) /* 400GBASE-FR8 */ #define IFM_400G_KR4 _IFM_EX(99) /* 400GBASE-KR4 */ #define IFM_400G_LR8 _IFM_EX(100) /* 400GBASE-LR8 */ #define IFM_400G_SR16 _IFM_EX(101) /* 400GBASE-SR16 */ #define IFM_100G_ACC _IFM_EX(102) /* 100GBASE-ACC */ #define IFM_100G_AOC _IFM_EX(103) /* 100GBASE-AOC */ #define IFM_100G_FR _IFM_EX(104) /* 100GBASE-FR */ #define IFM_100G_LR _IFM_EX(105) /* 100GBASE-LR */ #define IFM_200G_ER4 _IFM_EX(106) /* 200GBASE-ER4 */ #define IFM_400G_ER8 _IFM_EX(107) /* 400GBASE-ER8 */ #define IFM_400G_FR4 _IFM_EX(108) /* 400GBASE-FR4 */ #define IFM_400G_LR4 _IFM_EX(109) /* 400GBASE-LR4 */ #define IFM_400G_SR4_2 _IFM_EX(110) /* 400GBASE-SR4.2 */ #define IFM_400G_SR8 _IFM_EX(111) /* 400GBASE-SR8 */ /* IFM_OMASK bits */ #define IFM_ETH_MASTER 0x00000100 /* master mode (1000baseT) */ #define IFM_ETH_RXPAUSE 0x00000200 /* receive PAUSE frames */ #define IFM_ETH_TXPAUSE 0x00000400 /* transmit PAUSE frames */ #define _IFM_ETH_XTMASK 0x0000e000 /* Media sub-type (MSB) */ #define IFM_ETH_XSHIFT (13 - 5) /* shift XTYPE next to TMASK */ /* Ethernet flow control mask */ #define IFM_ETH_FMASK (IFM_FLOW | IFM_ETH_RXPAUSE | IFM_ETH_TXPAUSE) /* * 2: Token ring (IFM_TOKEN) */ #define IFM_TOK_STP4 3 /* Shielded twisted pair 4m - DB9 */ #define IFM_TOK_STP16 4 /* Shielded twisted pair 16m - DB9 */ #define IFM_TOK_UTP4 5 /* Unshielded twisted pair 4m - RJ45 */ #define IFM_TOK_UTP16 6 /* Unshielded twisted pair 16m - RJ45 */ /* IFM_OMASK bits */ #define IFM_TOK_ETR 0x00000200 /* Early token release */ #define IFM_TOK_SRCRT 0x00000400 /* Enable source routing features */ #define IFM_TOK_ALLR 0x00000800 /* All routes / Single route bcast */ /* * 3: FDDI (IFM_FDDI) */ #define IFM_FDDI_SMF 3 /* Single-mode fiber */ #define IFM_FDDI_MMF 4 /* Multi-mode fiber */ #define IFM_FDDI_UTP 5 /* CDDI / UTP */ #define IFM_FDDI_DA 0x00000100 /* Dual attach / single attach */ /* * 4: IEEE 802.11 Wireless (IFM_IEEE80211) */ #define IFM_IEEE80211_FH1 3 /* Frequency Hopping 1Mbps */ #define IFM_IEEE80211_FH2 4 /* Frequency Hopping 2Mbps */ #define IFM_IEEE80211_DS2 5 /* Direct Sequence 2Mbps */ #define IFM_IEEE80211_DS5 6 /* Direct Sequence 5Mbps*/ #define IFM_IEEE80211_DS11 7 /* Direct Sequence 11Mbps*/ #define IFM_IEEE80211_DS1 8 /* Direct Sequence 1Mbps */ #define IFM_IEEE80211_DS22 9 /* Direct Sequence 22Mbps */ #define IFM_IEEE80211_OFDM6 10 /* OFDM 6Mbps */ #define IFM_IEEE80211_OFDM9 11 /* OFDM 9Mbps */ #define IFM_IEEE80211_OFDM12 12 /* OFDM 12Mbps */ #define IFM_IEEE80211_OFDM18 13 /* OFDM 18Mbps */ #define IFM_IEEE80211_OFDM24 14 /* OFDM 24Mbps */ #define IFM_IEEE80211_OFDM36 15 /* OFDM 36Mbps */ #define IFM_IEEE80211_OFDM48 16 /* OFDM 48Mbps */ #define IFM_IEEE80211_OFDM54 17 /* OFDM 54Mbps */ #define IFM_IEEE80211_OFDM72 18 /* OFDM 72Mbps */ #define IFM_IEEE80211_DS354k 19 /* Direct Sequence 354Kbps */ #define IFM_IEEE80211_DS512k 20 /* Direct Sequence 512Kbps */ #define IFM_IEEE80211_OFDM3 21 /* OFDM 3Mbps */ #define IFM_IEEE80211_OFDM4 22 /* OFDM 4.5Mbps */ #define IFM_IEEE80211_OFDM27 23 /* OFDM 27Mbps */ /* NB: not enough bits to express MCS fully */ #define IFM_IEEE80211_MCS 24 /* HT MCS rate */ #define IFM_IEEE80211_VHT 25 /* VHT MCS rate */ /* IFM_OMASK bits */ #define IFM_IEEE80211_ADHOC 0x00000100 /* Operate in Adhoc mode */ #define IFM_IEEE80211_HOSTAP 0x00000200 /* Operate in Host AP mode */ #define IFM_IEEE80211_MONITOR 0x00000400 /* Operate in Monitor mode */ #define IFM_IEEE80211_TURBO 0x00000800 /* Operate in Turbo mode */ #define IFM_IEEE80211_IBSS 0x00001000 /* Operate in IBSS mode */ #define IFM_IEEE80211_WDS 0x00002000 /* Operate as an WDS master */ #define IFM_IEEE80211_MBSS 0x00004000 /* Operate in MBSS mode */ /* Operating mode (IFM_MMASK) for multi-mode devices */ #define IFM_IEEE80211_11A 0x00010000 /* 5 GHz, OFDM mode */ #define IFM_IEEE80211_11B 0x00020000 /* Direct Sequence mode */ #define IFM_IEEE80211_11G 0x00030000 /* 2 GHz, CCK mode */ #define IFM_IEEE80211_FH 0x00040000 /* 2 GHz, GFSK mode */ #define IFM_IEEE80211_11NA 0x00050000 /* 5Ghz, HT mode */ #define IFM_IEEE80211_11NG 0x00060000 /* 2Ghz, HT mode */ #define IFM_IEEE80211_11AC 0x00070000 /* 2Ghz/5Ghz, VHT mode */ /* * 6: Common Address Redundancy Protocol (IFM_CARP) * No any media specific flag. */ /* * NetBSD extension not defined in the BSDI API. This is used in various * places to get the canonical description for a given type/subtype. * * In the subtype and mediaopt descriptions, the valid TYPE bits are OR'd * in to indicate which TYPE the subtype/option corresponds to. If no * TYPE is present, it is a shared media/mediaopt. * * Note that these are parsed case-insensitive. * * Order is important. The first matching entry is the canonical name * for a media type; subsequent matches are aliases. */ struct ifmedia_description { int ifmt_word; /* word value; may be masked */ const char *ifmt_string; /* description */ }; #define IFM_TYPE_DESCRIPTIONS { \ { IFM_ETHER, "Ethernet" }, \ { IFM_ETHER, "ether" }, \ { IFM_TOKEN, "TokenRing" }, \ { IFM_TOKEN, "token" }, \ { IFM_FDDI, "FDDI" }, \ { IFM_IEEE80211, "IEEE802.11" }, \ { IFM_CARP, "CARP" }, \ { 0, NULL }, \ } #define IFM_SUBTYPE_DESCRIPTIONS { \ { IFM_AUTO, "autoselect" }, \ { IFM_AUTO, "auto" }, \ { IFM_MANUAL, "manual" }, \ { IFM_NONE, "none" }, \ \ { IFM_ETHER | IFM_10_T, "10baseT" }, \ { IFM_ETHER | IFM_10_T, "10baseT/UTP" }, \ { IFM_ETHER | IFM_10_T, "UTP" }, \ { IFM_ETHER | IFM_10_T, "10UTP" }, \ { IFM_ETHER | IFM_10_T, "10BASE-T" }, \ { IFM_ETHER | IFM_10_2, "10base2" }, \ { IFM_ETHER | IFM_10_2, "10base2/BNC" }, \ { IFM_ETHER | IFM_10_2, "BNC" }, \ { IFM_ETHER | IFM_10_2, "10BNC" }, \ { IFM_ETHER | IFM_10_2, "10BASE2" }, \ { IFM_ETHER | IFM_10_5, "10base5" }, \ { IFM_ETHER | IFM_10_5, "10base5/AUI" }, \ { IFM_ETHER | IFM_10_5, "AUI" }, \ { IFM_ETHER | IFM_10_5, "10AUI" }, \ { IFM_ETHER | IFM_10_5, "10BASE5" }, \ { IFM_ETHER | IFM_100_TX, "100baseTX" }, \ { IFM_ETHER | IFM_100_TX, "100TX" }, \ { IFM_ETHER | IFM_100_TX, "100BASE-TX" }, \ { IFM_ETHER | IFM_100_FX, "100baseFX" }, \ { IFM_ETHER | IFM_100_FX, "100FX" }, \ { IFM_ETHER | IFM_100_FX, "100BASE-FX" }, \ { IFM_ETHER | IFM_100_T4, "100baseT4" }, \ { IFM_ETHER | IFM_100_T4, "100T4" }, \ { IFM_ETHER | IFM_100_T4, "100BASE-T4" }, \ { IFM_ETHER | IFM_100_VG, "100baseVG" }, \ { IFM_ETHER | IFM_100_VG, "100VG" }, \ { IFM_ETHER | IFM_100_VG, "100VG-AnyLAN" }, \ { IFM_ETHER | IFM_100_T2, "100baseT2" }, \ { IFM_ETHER | IFM_100_T2, "100T2" }, \ { IFM_ETHER | IFM_100_T2, "100BASE-T2" }, \ { IFM_ETHER | IFM_1000_SX, "1000baseSX" }, \ { IFM_ETHER | IFM_1000_SX, "1000SX" }, \ { IFM_ETHER | IFM_1000_SX, "1000BASE-SX" }, \ { IFM_ETHER | IFM_10_STP, "10baseSTP" }, \ { IFM_ETHER | IFM_10_STP, "STP" }, \ { IFM_ETHER | IFM_10_STP, "10STP" }, \ { IFM_ETHER | IFM_10_STP, "10BASE-STP" }, \ { IFM_ETHER | IFM_10_FL, "10baseFL" }, \ { IFM_ETHER | IFM_10_FL, "FL" }, \ { IFM_ETHER | IFM_10_FL, "10FL" }, \ { IFM_ETHER | IFM_10_FL, "10BASE-FL" }, \ { IFM_ETHER | IFM_1000_LX, "1000baseLX" }, \ { IFM_ETHER | IFM_1000_LX, "1000LX" }, \ { IFM_ETHER | IFM_1000_LX, "1000BASE-LX" }, \ { IFM_ETHER | IFM_1000_CX, "1000baseCX" }, \ { IFM_ETHER | IFM_1000_CX, "1000CX" }, \ { IFM_ETHER | IFM_1000_CX, "1000BASE-CX" }, \ { IFM_ETHER | IFM_1000_BX10, "1000BASE-BX10" }, \ { IFM_ETHER | IFM_1000_KX, "1000BASE-KX" }, \ { IFM_ETHER | IFM_1000_KX, "1000baseKX" }, \ { IFM_ETHER | IFM_1000_T, "1000baseT" }, \ { IFM_ETHER | IFM_1000_T, "1000T" }, \ { IFM_ETHER | IFM_1000_T, "1000BASE-T" }, \ { IFM_ETHER | IFM_HPNA_1, "HomePNA1" }, \ { IFM_ETHER | IFM_HPNA_1, "HPNA1" }, \ { IFM_ETHER | IFM_2500_KX | IFM_FDX, "2500BASE-KX" }, \ { IFM_ETHER | IFM_2500_KX | IFM_FDX, "2500baseKX" }, \ { IFM_ETHER | IFM_2500_T | IFM_FDX, "2.5GBASE-T" }, \ { IFM_ETHER | IFM_2500_T | IFM_FDX, "2500baseT" }, \ { IFM_ETHER | IFM_5000_T | IFM_FDX, "5GBASE-T" }, \ { IFM_ETHER | IFM_5000_T | IFM_FDX, "5GbaseT" }, \ { IFM_ETHER | IFM_OTHER, "Other" }, \ { IFM_ETHER | IFM_10G_LR | IFM_FDX, "10GbaseLR" }, \ { IFM_ETHER | IFM_10G_LR | IFM_FDX, "10GLR" }, \ { IFM_ETHER | IFM_10G_LR | IFM_FDX, "10GBASE-LR" }, \ { IFM_ETHER | IFM_10G_SR | IFM_FDX, "10GbaseSR" }, \ { IFM_ETHER | IFM_10G_SR | IFM_FDX, "10GSR" }, \ { IFM_ETHER | IFM_10G_SR | IFM_FDX, "10GBASE-SR" }, \ { IFM_ETHER | IFM_10G_LRM | IFM_FDX, "10Gbase-LRM" }, \ { IFM_ETHER | IFM_10G_TWINAX | IFM_FDX, "10Gbase-Twinax" }, \ { IFM_ETHER | IFM_10G_TWINAX_LONG | IFM_FDX, "10Gbase-Twinax-Long" },\ { IFM_ETHER | IFM_10G_T | IFM_FDX, "10Gbase-T" }, \ { IFM_ETHER | IFM_10G_CX4 | IFM_FDX, "10GbaseCX4" }, \ { IFM_ETHER | IFM_10G_CX4 | IFM_FDX, "10GCX4" }, \ { IFM_ETHER | IFM_10G_CX4 | IFM_FDX, "10GBASE-CX4" }, \ { IFM_ETHER | IFM_2500_SX | IFM_FDX, "2500baseSX" }, \ { IFM_ETHER | IFM_2500_SX | IFM_FDX, "2500SX" }, \ { IFM_ETHER | IFM_1000_SGMII | IFM_FDX, "1000BASE-SGMII" }, \ { IFM_ETHER | IFM_5000_KR | IFM_FDX, "5GBASE-KR" }, \ { IFM_ETHER | IFM_10G_AOC | IFM_FDX, "10GBASE-AOC" }, \ { IFM_ETHER | IFM_10G_CR1 | IFM_FDX, "10GBASE-CR1" }, \ { IFM_ETHER | IFM_10G_ER | IFM_FDX, "10GBASE-ER" }, \ { IFM_ETHER | IFM_10G_KR | IFM_FDX, "10GBASE-KR" }, \ { IFM_ETHER | IFM_10G_KX4 | IFM_FDX, "10GBASE-KX4" }, \ { IFM_ETHER | IFM_10G_LX4 | IFM_FDX, "10GBASE-LX4" }, \ { IFM_ETHER | IFM_10G_SFI | IFM_FDX, "10GBASE-SFI" }, \ { IFM_ETHER | IFM_10G_ZR | IFM_FDX, "10GBASE-ZR" }, \ { IFM_ETHER | IFM_20G_KR2 | IFM_FDX, "20GBASE-KR2" }, \ { IFM_ETHER | IFM_25G_ACC | IFM_FDX, "25GBASE-ACC" }, \ { IFM_ETHER | IFM_25G_AOC | IFM_FDX, "25GBASE-AOC" }, \ { IFM_ETHER | IFM_25G_AUI | IFM_FDX, "25G-AUI" }, \ { IFM_ETHER | IFM_25G_CR | IFM_FDX, "25GBASE-CR" }, \ { IFM_ETHER | IFM_25G_CR_S | IFM_FDX, "25GBASE-CR-S" }, \ { IFM_ETHER | IFM_25G_ER | IFM_FDX, "25GBASE-ER" }, \ { IFM_ETHER | IFM_25G_KR | IFM_FDX, "25GBASE-KR" }, \ { IFM_ETHER | IFM_25G_KR_S | IFM_FDX, "25GBASE-KR-S" }, \ { IFM_ETHER | IFM_25G_LR | IFM_FDX, "25GBASE-LR" }, \ { IFM_ETHER | IFM_25G_SR | IFM_FDX, "25GBASE-SR" }, \ { IFM_ETHER | IFM_25G_T | IFM_FDX, "25GBASE-T" }, \ { IFM_ETHER | IFM_40G_AOC | IFM_FDX, "40GBASE-AOC" }, \ { IFM_ETHER | IFM_40G_CR4 | IFM_FDX, "40GBASE-CR4" }, \ { IFM_ETHER | IFM_40G_ER4 | IFM_FDX, "40GBASE-ER4" }, \ { IFM_ETHER | IFM_40G_FR | IFM_FDX, "40GBASE-FR" }, \ { IFM_ETHER | IFM_40G_KR4 | IFM_FDX, "40GBASE-KR4" }, \ { IFM_ETHER | IFM_40G_LR4 | IFM_FDX, "40GBASE-LR4" }, \ { IFM_ETHER | IFM_40G_SR4 | IFM_FDX, "40GBASE-SR4" }, \ { IFM_ETHER | IFM_40G_T | IFM_FDX, "40GBASE-T" }, \ { IFM_ETHER | IFM_40G_XLPPI | IFM_FDX, "40G-XLPPI" }, \ { IFM_ETHER | IFM_50G_AUI1 | IFM_FDX, "50GAUI-1" }, \ { IFM_ETHER | IFM_50G_AUI2 | IFM_FDX, "50GAUI-2" }, \ { IFM_ETHER | IFM_50G_CR | IFM_FDX, "50GBASE-CR" }, \ { IFM_ETHER | IFM_50G_CR2 | IFM_FDX, "50GBASE-CR2" }, \ { IFM_ETHER | IFM_50G_FR | IFM_FDX, "50GBASE-FR" }, \ { IFM_ETHER | IFM_50G_KR | IFM_FDX, "50GBASE-KR" }, \ { IFM_ETHER | IFM_50G_KR2 | IFM_FDX, "50GBASE-KR2" }, \ { IFM_ETHER | IFM_50G_LAUI2 | IFM_FDX, "50GLAUI-2" }, \ { IFM_ETHER | IFM_50G_LR | IFM_FDX, "50GBASE-LR" }, \ { IFM_ETHER | IFM_50G_SR | IFM_FDX, "50GBASE-SR" }, \ { IFM_ETHER | IFM_50G_SR2 | IFM_FDX, "50GBASE-SR2" }, \ { IFM_ETHER | IFM_56G_R4 | IFM_FDX, "56GBASE-R4" }, \ { IFM_ETHER | IFM_100G_ACC | IFM_FDX, "100GBASE-ACC" }, \ { IFM_ETHER | IFM_100G_AOC | IFM_FDX, "100GBASE-AOC" }, \ { IFM_ETHER | IFM_100G_CR2 | IFM_FDX, "100GBASE-CR2" }, \ { IFM_ETHER | IFM_100G_CR4 | IFM_FDX, "100GBASE-CR4" }, \ { IFM_ETHER | IFM_100G_CR10 | IFM_FDX, "100GBASE-CR10" }, \ { IFM_ETHER | IFM_100G_DR | IFM_FDX, "100GBASE-DR" }, \ { IFM_ETHER | IFM_100G_ER4 | IFM_FDX, "100GBASE-ER4" }, \ { IFM_ETHER | IFM_100G_FR | IFM_FDX, "100GBASE-FR" }, \ { IFM_ETHER | IFM_100G_KP4 | IFM_FDX, "100GBASE-KP4" }, \ { IFM_ETHER | IFM_100G_KR2 | IFM_FDX, "100GBASE-KR2" }, \ { IFM_ETHER | IFM_100G_KR4 | IFM_FDX, "100GBASE-KR4" }, \ { IFM_ETHER | IFM_100G_LR | IFM_FDX, "100GBASE-LR" }, \ { IFM_ETHER | IFM_100G_LR4 | IFM_FDX, "100GBASE-LR4" }, \ { IFM_ETHER | IFM_100G_SR2 | IFM_FDX, "100GBASE-SR2" }, \ { IFM_ETHER | IFM_100G_SR4 | IFM_FDX, "100GBASE-SR4" }, \ { IFM_ETHER | IFM_100G_SR10 | IFM_FDX, "100GBASE-SR10" }, \ { IFM_ETHER | IFM_200G_CR2 | IFM_FDX, "200GBASE-CR2" }, \ { IFM_ETHER | IFM_200G_CR4 | IFM_FDX, "200GBASE-CR4" }, \ { IFM_ETHER | IFM_200G_DR4 | IFM_FDX, "200GBASE-DR4" }, \ { IFM_ETHER | IFM_200G_ER4 | IFM_FDX, "200GBASE-ER4" }, \ { IFM_ETHER | IFM_200G_FR4 | IFM_FDX, "200GBASE-FR4" }, \ { IFM_ETHER | IFM_200G_KR2 | IFM_FDX, "200GBASE-KR2" }, \ { IFM_ETHER | IFM_200G_KR4 | IFM_FDX, "200GBASE-KR4" }, \ { IFM_ETHER | IFM_200G_LR4 | IFM_FDX, "200GBASE-LR4" }, \ { IFM_ETHER | IFM_200G_SR4 | IFM_FDX, "200GBASE-SR4" }, \ { IFM_ETHER | IFM_400G_CR4 | IFM_FDX, "400GBASE-CR4" }, \ { IFM_ETHER | IFM_400G_DR4 | IFM_FDX, "400GBASE-DR4" }, \ { IFM_ETHER | IFM_400G_ER8 | IFM_FDX, "400GBASE-ER8" }, \ { IFM_ETHER | IFM_400G_FR4 | IFM_FDX, "400GBASE-FR4" }, \ { IFM_ETHER | IFM_400G_FR8 | IFM_FDX, "400GBASE-FR8" }, \ { IFM_ETHER | IFM_400G_KR4 | IFM_FDX, "400GBASE-KR4" }, \ { IFM_ETHER | IFM_400G_LR4 | IFM_FDX, "400GBASE-LR4" }, \ { IFM_ETHER | IFM_400G_LR8 | IFM_FDX, "400GBASE-LR8" }, \ { IFM_ETHER | IFM_400G_SR4_2 | IFM_FDX, "400GBASE-SR4.2" }, \ { IFM_ETHER | IFM_400G_SR8 | IFM_FDX, "400GBASE-SR8" }, \ { IFM_ETHER | IFM_400G_SR16 | IFM_FDX, "400GBASE-SR16" }, \ \ { IFM_TOKEN | IFM_TOK_STP4, "DB9/4Mbit" }, \ { IFM_TOKEN | IFM_TOK_STP4, "4STP" }, \ { IFM_TOKEN | IFM_TOK_STP16, "DB9/16Mbit" }, \ { IFM_TOKEN | IFM_TOK_STP16, "16STP" }, \ { IFM_TOKEN | IFM_TOK_UTP4, "UTP/4Mbit" }, \ { IFM_TOKEN | IFM_TOK_UTP4, "4UTP" }, \ { IFM_TOKEN | IFM_TOK_UTP16, "UTP/16Mbit" }, \ { IFM_TOKEN | IFM_TOK_UTP16, "16UTP" }, \ \ { IFM_FDDI | IFM_FDDI_SMF, "Single-mode" }, \ { IFM_FDDI | IFM_FDDI_SMF, "SMF" }, \ { IFM_FDDI | IFM_FDDI_MMF, "Multi-mode" }, \ { IFM_FDDI | IFM_FDDI_MMF, "MMF" }, \ { IFM_FDDI | IFM_FDDI_UTP, "UTP" }, \ { IFM_FDDI | IFM_FDDI_UTP, "CDDI" }, \ \ /* \ * Short-hand for common media+option combos. \ */ \ { IFM_ETHER | IFM_10_T | IFM_FDX, "10baseT-FDX" }, \ { IFM_ETHER | IFM_10_T | IFM_FDX, "10BASE-T-FDX" }, \ { IFM_ETHER | IFM_100_TX | IFM_FDX, "100baseTX-FDX" }, \ { IFM_ETHER | IFM_100_TX | IFM_FDX, "100BASE-TX-FDX" }, \ { IFM_ETHER | IFM_1000_T | IFM_FDX, "1000baseT-FDX" }, \ \ /* \ * IEEE 802.11 \ */ \ { IFM_IEEE80211 | IFM_IEEE80211_FH1, "FH1" }, \ { IFM_IEEE80211 | IFM_IEEE80211_FH2, "FH2" }, \ { IFM_IEEE80211 | IFM_IEEE80211_DS1, "DS1" }, \ { IFM_IEEE80211 | IFM_IEEE80211_DS2, "DS2" }, \ { IFM_IEEE80211 | IFM_IEEE80211_DS5, "DS5" }, \ { IFM_IEEE80211 | IFM_IEEE80211_DS11, "DS11" }, \ { IFM_IEEE80211 | IFM_IEEE80211_DS22, "DS22" }, \ { IFM_IEEE80211 | IFM_IEEE80211_OFDM6, "OFDM6" }, \ { IFM_IEEE80211 | IFM_IEEE80211_OFDM9, "OFDM9" }, \ { IFM_IEEE80211 | IFM_IEEE80211_OFDM12, "OFDM12" }, \ { IFM_IEEE80211 | IFM_IEEE80211_OFDM18, "OFDM18" }, \ { IFM_IEEE80211 | IFM_IEEE80211_OFDM24, "OFDM24" }, \ { IFM_IEEE80211 | IFM_IEEE80211_OFDM36, "OFDM36" }, \ { IFM_IEEE80211 | IFM_IEEE80211_OFDM48, "OFDM48" }, \ { IFM_IEEE80211 | IFM_IEEE80211_OFDM54, "OFDM54" }, \ { IFM_IEEE80211 | IFM_IEEE80211_OFDM72, "OFDM72" }, \ { IFM_IEEE80211 | IFM_IEEE80211_DS354k, "DS/354Kbps" }, \ { IFM_IEEE80211 | IFM_IEEE80211_DS512k, "DS/512Kbps" }, \ { IFM_IEEE80211 | IFM_IEEE80211_OFDM3, "OFDM/3Mbps" }, \ { IFM_IEEE80211 | IFM_IEEE80211_OFDM4, "OFDM/4.5Mbps" }, \ { IFM_IEEE80211 | IFM_IEEE80211_OFDM27, "OFDM/27Mbps" }, \ { IFM_IEEE80211 | IFM_IEEE80211_MCS, "HT" }, \ { IFM_IEEE80211 | IFM_IEEE80211_VHT, "VHT" }, \ \ { 0, NULL }, \ } #define IFM_MODE_DESCRIPTIONS { \ { IFM_AUTO, "autoselect" }, \ { IFM_AUTO, "auto" }, \ { IFM_IEEE80211 | IFM_IEEE80211_11A, "11a" }, \ { IFM_IEEE80211 | IFM_IEEE80211_11B, "11b" }, \ { IFM_IEEE80211 | IFM_IEEE80211_11G, "11g" }, \ { IFM_IEEE80211 | IFM_IEEE80211_FH, "fh" }, \ { IFM_IEEE80211 | IFM_IEEE80211_11NA, "11na" }, \ { IFM_IEEE80211 | IFM_IEEE80211_11NG, "11ng" }, \ { IFM_IEEE80211 | IFM_IEEE80211_11AC, "11ac" }, \ { 0, NULL }, \ } #define IFM_OPTION_DESCRIPTIONS { \ { IFM_FDX, "full-duplex" }, \ { IFM_FDX, "fdx" }, \ { IFM_HDX, "half-duplex" }, \ { IFM_HDX, "hdx" }, \ { IFM_FLOW, "flowcontrol" }, \ { IFM_FLOW, "flow" }, \ { IFM_FLAG0, "flag0" }, \ { IFM_FLAG1, "flag1" }, \ { IFM_FLAG2, "flag2" }, \ { IFM_LOOP, "loopback" }, \ { IFM_LOOP, "hw-loopback"}, \ { IFM_LOOP, "loop" }, \ \ { IFM_ETHER | IFM_ETH_MASTER, "master" }, \ { IFM_ETHER | IFM_ETH_RXPAUSE, "rxpause" }, \ { IFM_ETHER | IFM_ETH_TXPAUSE, "txpause" }, \ \ { IFM_TOKEN | IFM_TOK_ETR, "EarlyTokenRelease" }, \ { IFM_TOKEN | IFM_TOK_ETR, "ETR" }, \ { IFM_TOKEN | IFM_TOK_SRCRT, "SourceRouting" }, \ { IFM_TOKEN | IFM_TOK_SRCRT, "SRCRT" }, \ { IFM_TOKEN | IFM_TOK_ALLR, "AllRoutes" }, \ { IFM_TOKEN | IFM_TOK_ALLR, "ALLR" }, \ \ { IFM_FDDI | IFM_FDDI_DA, "dual-attach" }, \ { IFM_FDDI | IFM_FDDI_DA, "das" }, \ \ { IFM_IEEE80211 | IFM_IEEE80211_ADHOC, "adhoc" }, \ { IFM_IEEE80211 | IFM_IEEE80211_HOSTAP, "hostap" }, \ { IFM_IEEE80211 | IFM_IEEE80211_MONITOR,"monitor" }, \ { IFM_IEEE80211 | IFM_IEEE80211_TURBO, "turbo" }, \ { IFM_IEEE80211 | IFM_IEEE80211_IBSS, "ibss" }, \ { IFM_IEEE80211 | IFM_IEEE80211_WDS, "wds" }, \ { IFM_IEEE80211 | IFM_IEEE80211_MBSS, "mesh" }, \ \ { 0, NULL }, \ } /* * Baudrate descriptions for the various media types. */ struct ifmedia_baudrate { int ifmb_word; /* media word */ uint64_t ifmb_baudrate; /* corresponding baudrate */ }; #define IFM_BAUDRATE_DESCRIPTIONS { \ { IFM_ETHER | IFM_10_T, IF_Mbps(10) }, \ { IFM_ETHER | IFM_10_2, IF_Mbps(10) }, \ { IFM_ETHER | IFM_10_5, IF_Mbps(10) }, \ { IFM_ETHER | IFM_100_TX, IF_Mbps(100) }, \ { IFM_ETHER | IFM_100_FX, IF_Mbps(100) }, \ { IFM_ETHER | IFM_100_T4, IF_Mbps(100) }, \ { IFM_ETHER | IFM_100_VG, IF_Mbps(100) }, \ { IFM_ETHER | IFM_100_T2, IF_Mbps(100) }, \ { IFM_ETHER | IFM_1000_SX, IF_Mbps(1000) }, \ { IFM_ETHER | IFM_10_STP, IF_Mbps(10) }, \ { IFM_ETHER | IFM_10_FL, IF_Mbps(10) }, \ { IFM_ETHER | IFM_1000_LX, IF_Mbps(1000) }, \ { IFM_ETHER | IFM_1000_CX, IF_Mbps(1000) }, \ { IFM_ETHER | IFM_1000_T, IF_Mbps(1000) }, \ { IFM_ETHER | IFM_HPNA_1, IF_Mbps(1) }, \ { IFM_ETHER | IFM_10G_LR, IF_Gbps(10ULL) }, \ { IFM_ETHER | IFM_10G_SR, IF_Gbps(10ULL) }, \ { IFM_ETHER | IFM_10G_CX4, IF_Gbps(10ULL) }, \ { IFM_ETHER | IFM_2500_SX, IF_Mbps(2500ULL) }, \ { IFM_ETHER | IFM_1000_BX10, IF_Mbps(1000ULL) }, \ { IFM_ETHER | IFM_10G_TWINAX, IF_Gbps(10) }, \ { IFM_ETHER | IFM_10G_TWINAX_LONG, IF_Gbps(10) }, \ { IFM_ETHER | IFM_10G_LRM, IF_Gbps(10) }, \ { IFM_ETHER | IFM_10G_T, IF_Gbps(10) }, \ { IFM_ETHER | IFM_1000_KX, IF_Mbps(1000ULL) }, \ { IFM_ETHER | IFM_2500_KX, IF_Mbps(2500ULL) }, \ { IFM_ETHER | IFM_2500_T, IF_Mbps(2500ULL) }, \ { IFM_ETHER | IFM_5000_T, IF_Gbps(5) }, \ { IFM_ETHER | IFM_1000_SGMII, IF_Gbps(1) }, \ { IFM_ETHER | IFM_5000_KR, IF_Gbps(5) }, \ { IFM_ETHER | IFM_10G_AOC, IF_Gbps(10) }, \ { IFM_ETHER | IFM_10G_CR1, IF_Gbps(10) }, \ { IFM_ETHER | IFM_10G_ER, IF_Gbps(10) }, \ { IFM_ETHER | IFM_10G_KR, IF_Gbps(10) }, \ { IFM_ETHER | IFM_10G_KX4, IF_Gbps(10) }, \ { IFM_ETHER | IFM_10G_LX4, IF_Gbps(10) }, \ { IFM_ETHER | IFM_10G_SFI, IF_Gbps(10) }, \ { IFM_ETHER | IFM_10G_ZR, IF_Gbps(10) }, \ { IFM_ETHER | IFM_20G_KR2, IF_Gbps(20) }, \ { IFM_ETHER | IFM_25G_ACC, IF_Gbps(25) }, \ { IFM_ETHER | IFM_25G_AOC, IF_Gbps(25) }, \ { IFM_ETHER | IFM_25G_AUI, IF_Gbps(25) }, \ { IFM_ETHER | IFM_25G_CR, IF_Gbps(25) }, \ { IFM_ETHER | IFM_25G_CR_S, IF_Gbps(25) }, \ { IFM_ETHER | IFM_25G_ER, IF_Gbps(25) }, \ { IFM_ETHER | IFM_25G_KR, IF_Gbps(25) }, \ { IFM_ETHER | IFM_25G_KR_S, IF_Gbps(25) }, \ { IFM_ETHER | IFM_25G_LR, IF_Gbps(25) }, \ { IFM_ETHER | IFM_25G_SR, IF_Gbps(25) }, \ { IFM_ETHER | IFM_25G_T, IF_Gbps(25) }, \ { IFM_ETHER | IFM_40G_AOC, IF_Gbps(40) }, \ { IFM_ETHER | IFM_40G_CR4, IF_Gbps(40) }, \ { IFM_ETHER | IFM_40G_ER4, IF_Gbps(40) }, \ { IFM_ETHER | IFM_40G_FR, IF_Gbps(40) }, \ { IFM_ETHER | IFM_40G_KR4, IF_Gbps(40) }, \ { IFM_ETHER | IFM_40G_LR4, IF_Gbps(40) }, \ { IFM_ETHER | IFM_40G_SR4, IF_Gbps(40) }, \ { IFM_ETHER | IFM_40G_T, IF_Gbps(40) }, \ { IFM_ETHER | IFM_40G_XLPPI, IF_Gbps(40) }, \ { IFM_ETHER | IFM_50G_AUI1, IF_Gbps(50) }, \ { IFM_ETHER | IFM_50G_AUI2, IF_Gbps(50) }, \ { IFM_ETHER | IFM_50G_CR, IF_Gbps(50) }, \ { IFM_ETHER | IFM_50G_CR2, IF_Gbps(50) }, \ { IFM_ETHER | IFM_50G_FR, IF_Gbps(50) }, \ { IFM_ETHER | IFM_50G_KR, IF_Gbps(50) }, \ { IFM_ETHER | IFM_50G_KR2, IF_Gbps(50) }, \ { IFM_ETHER | IFM_50G_LAUI2, IF_Gbps(50) }, \ { IFM_ETHER | IFM_50G_LR, IF_Gbps(50) }, \ { IFM_ETHER | IFM_50G_SR, IF_Gbps(50) }, \ { IFM_ETHER | IFM_50G_SR2, IF_Gbps(50) }, \ { IFM_ETHER | IFM_56G_R4, IF_Gbps(56) }, \ { IFM_ETHER | IFM_100G_ACC, IF_Gbps(100) }, \ { IFM_ETHER | IFM_100G_AOC, IF_Gbps(100) }, \ { IFM_ETHER | IFM_100G_CR2, IF_Gbps(100) }, \ { IFM_ETHER | IFM_100G_CR4, IF_Gbps(100) }, \ { IFM_ETHER | IFM_100G_CR10, IF_Gbps(100) }, \ { IFM_ETHER | IFM_100G_DR, IF_Gbps(100) }, \ { IFM_ETHER | IFM_100G_ER4, IF_Gbps(100) }, \ { IFM_ETHER | IFM_100G_FR, IF_Gbps(100) }, \ { IFM_ETHER | IFM_100G_KP4, IF_Gbps(100) }, \ { IFM_ETHER | IFM_100G_KR2, IF_Gbps(100) }, \ { IFM_ETHER | IFM_100G_KR4, IF_Gbps(100) }, \ { IFM_ETHER | IFM_100G_LR, IF_Gbps(100) }, \ { IFM_ETHER | IFM_100G_LR4, IF_Gbps(100) }, \ { IFM_ETHER | IFM_100G_SR2, IF_Gbps(100) }, \ { IFM_ETHER | IFM_100G_SR4, IF_Gbps(100) }, \ { IFM_ETHER | IFM_100G_SR10, IF_Gbps(100) }, \ { IFM_ETHER | IFM_200G_CR2, IF_Gbps(200) }, \ { IFM_ETHER | IFM_200G_CR4, IF_Gbps(200) }, \ { IFM_ETHER | IFM_200G_DR4, IF_Gbps(200) }, \ { IFM_ETHER | IFM_200G_ER4, IF_Gbps(200) }, \ { IFM_ETHER | IFM_200G_FR4, IF_Gbps(200) }, \ { IFM_ETHER | IFM_200G_KR2, IF_Gbps(200) }, \ { IFM_ETHER | IFM_200G_KR4, IF_Gbps(200) }, \ { IFM_ETHER | IFM_200G_LR4, IF_Gbps(200) }, \ { IFM_ETHER | IFM_200G_SR4, IF_Gbps(200) }, \ { IFM_ETHER | IFM_400G_CR4, IF_Gbps(400) }, \ { IFM_ETHER | IFM_400G_DR4, IF_Gbps(400) }, \ { IFM_ETHER | IFM_400G_ER8, IF_Gbps(400) }, \ { IFM_ETHER | IFM_400G_FR4, IF_Gbps(400) }, \ { IFM_ETHER | IFM_400G_FR8, IF_Gbps(400) }, \ { IFM_ETHER | IFM_400G_KR4, IF_Gbps(400) }, \ { IFM_ETHER | IFM_400G_LR4, IF_Gbps(400) }, \ { IFM_ETHER | IFM_400G_LR8, IF_Gbps(400) }, \ { IFM_ETHER | IFM_400G_SR4_2, IF_Gbps(400) }, \ { IFM_ETHER | IFM_400G_SR8, IF_Gbps(400) }, \ { IFM_ETHER | IFM_400G_SR16, IF_Gbps(400) }, \ \ { IFM_TOKEN | IFM_TOK_STP4, IF_Mbps(4) }, \ { IFM_TOKEN | IFM_TOK_STP16, IF_Mbps(16) }, \ { IFM_TOKEN | IFM_TOK_UTP4, IF_Mbps(4) }, \ { IFM_TOKEN | IFM_TOK_UTP16, IF_Mbps(16) }, \ \ { IFM_FDDI | IFM_FDDI_SMF, IF_Mbps(100) }, \ { IFM_FDDI | IFM_FDDI_MMF, IF_Mbps(100) }, \ { IFM_FDDI | IFM_FDDI_UTP, IF_Mbps(100) }, \ \ { IFM_IEEE80211 | IFM_IEEE80211_FH1, IF_Mbps(1) }, \ { IFM_IEEE80211 | IFM_IEEE80211_FH2, IF_Mbps(2) }, \ { IFM_IEEE80211 | IFM_IEEE80211_DS2, IF_Mbps(2) }, \ { IFM_IEEE80211 | IFM_IEEE80211_DS5, IF_Kbps(5500) }, \ { IFM_IEEE80211 | IFM_IEEE80211_DS11, IF_Mbps(11) }, \ { IFM_IEEE80211 | IFM_IEEE80211_DS1, IF_Mbps(1) }, \ { IFM_IEEE80211 | IFM_IEEE80211_DS22, IF_Mbps(22) }, \ { IFM_IEEE80211 | IFM_IEEE80211_OFDM6, IF_Mbps(6) }, \ { IFM_IEEE80211 | IFM_IEEE80211_OFDM9, IF_Mbps(9) }, \ { IFM_IEEE80211 | IFM_IEEE80211_OFDM12, IF_Mbps(12) }, \ { IFM_IEEE80211 | IFM_IEEE80211_OFDM18, IF_Mbps(18) }, \ { IFM_IEEE80211 | IFM_IEEE80211_OFDM24, IF_Mbps(24) }, \ { IFM_IEEE80211 | IFM_IEEE80211_OFDM36, IF_Mbps(36) }, \ { IFM_IEEE80211 | IFM_IEEE80211_OFDM48, IF_Mbps(48) }, \ { IFM_IEEE80211 | IFM_IEEE80211_OFDM54, IF_Mbps(54) }, \ { IFM_IEEE80211 | IFM_IEEE80211_OFDM72, IF_Mbps(72) }, \ \ { 0, 0 }, \ } /* * Status bit descriptions for the various media types. */ struct ifmedia_status_description { int ifms_type; int ifms_valid; int ifms_bit; const char *ifms_string[2]; }; #define IFM_STATUS_DESC(ifms, bit) \ (ifms)->ifms_string[((ifms)->ifms_bit & (bit)) ? 1 : 0] #define IFM_STATUS_DESCRIPTIONS { \ { IFM_GENERIC, IFM_AVALID, IFM_ACTIVE, \ { "no network", "active" } }, \ \ { IFM_ETHER, IFM_AVALID, IFM_ACTIVE, \ { "no carrier", "active" } }, \ \ { IFM_FDDI, IFM_AVALID, IFM_ACTIVE, \ { "no ring", "inserted" } }, \ \ { IFM_TOKEN, IFM_AVALID, IFM_ACTIVE, \ { "no ring", "inserted" } }, \ \ { IFM_IEEE80211, IFM_AVALID, IFM_ACTIVE, \ { "no network", "active" } }, \ \ { IFM_CARP, IFM_AVALID, IFM_ACTIVE, \ { "backup", "master" } }, \ \ { 0, 0, 0, \ { NULL, NULL } }, \ } #ifdef _KERNEL #include #include /* * Driver callbacks for media status and change requests. */ typedef int (*ifm_change_cb_t)(struct ifnet *); typedef void (*ifm_stat_cb_t)(struct ifnet *, struct ifmediareq *); /* * In-kernel representation of a single supported media type. */ struct ifmedia_entry { TAILQ_ENTRY(ifmedia_entry) ifm_list; u_int ifm_media; /* IFMWD: description of this media */ u_int ifm_data; /* for driver-specific use */ void *ifm_aux; /* for driver-specific use */ }; /* * One of these goes into a network interface's softc structure. * It is used to keep general media state. * * LOCKING * ======= * The ifmedia is protected by a lock provided by the interface * driver. All ifmedia API entry points (with the exception of one) * are expect to be called with this mutex NOT HELD. * * ifmedia_ioctl() is called with the interface's if_ioctl_lock held, * and thus the locking order is: * * IFNET_LOCK -> ifm_lock * * Driver callbacks (ifm_change / ifm_status) are called with ifm_lock HELD. * * Field markings and the corresponding locks: * * m: ifm_lock * :: unlocked, stable */ struct ifmedia { kmutex_t *ifm_lock; /* :: mutex (provided by interface driver) */ u_int ifm_mask; /* :: IFMWD: mask of changes we don't care */ u_int ifm_media; /* * m: IFMWD: current user-set media word. * * XXX some drivers misuse this entry as * current active media word. Don't use this * entry as this purpose but use driver * specific entry if you don't use mii(4). */ struct ifmedia_entry *ifm_cur; /* * m: entry corresponding to * ifm_media */ TAILQ_HEAD(, ifmedia_entry) ifm_list; /* * m: list of all supported * media */ ifm_change_cb_t ifm_change; /* :: media change driver callback */ ifm_stat_cb_t ifm_status; /* :: media status driver callback */ uintptr_t ifm_legacy; /* m: legacy driver handling */ }; #define ifmedia_lock(ifm) mutex_enter((ifm)->ifm_lock) #define ifmedia_unlock(ifm) mutex_exit((ifm)->ifm_lock) #define ifmedia_locked(ifm) mutex_owned((ifm)->ifm_lock) #ifdef __IFMEDIA_PRIVATE #define ifmedia_islegacy(ifm) ((ifm)->ifm_legacy) void ifmedia_lock_for_legacy(struct ifmedia *); void ifmedia_unlock_for_legacy(struct ifmedia *); #define IFMEDIA_LOCK_FOR_LEGACY(ifm) \ do { \ if (ifmedia_islegacy(ifm)) \ ifmedia_lock_for_legacy(ifm); \ } while (/*CONSTCOND*/0) #define IFMEDIA_UNLOCK_FOR_LEGACY(ifm) \ do { \ if (ifmedia_islegacy(ifm)) \ ifmedia_unlock_for_legacy(ifm); \ } while (/*CONSTCOND*/0) #endif /* __IFMEDIA_PRIVATE */ /* Initialize an interface's struct if_media field. */ void ifmedia_init(struct ifmedia *, int, ifm_change_cb_t, ifm_stat_cb_t); void ifmedia_init_with_lock(struct ifmedia *, int, ifm_change_cb_t, ifm_stat_cb_t, kmutex_t *); /* Release resourecs associated with an ifmedia. */ void ifmedia_fini(struct ifmedia *); /* Add one supported medium to a struct ifmedia. */ void ifmedia_add(struct ifmedia *, int, int, void *); /* Add an array (of ifmedia_entry) media to a struct ifmedia. */ void ifmedia_list_add(struct ifmedia *, struct ifmedia_entry *, int); /* Set default media type on initialization. */ void ifmedia_set(struct ifmedia *ifm, int mword); /* Common ioctl function for getting/setting media, called by driver. */ int ifmedia_ioctl(struct ifnet *, struct ifreq *, struct ifmedia *, u_long); /* Look up a media entry. */ struct ifmedia_entry *ifmedia_match(struct ifmedia *, u_int, u_int); /* Delete all media for a given media instance */ void ifmedia_delete_instance(struct ifmedia *, u_int); /* Remove all media */ void ifmedia_removeall(struct ifmedia *); /* Compute baudrate for a given media. */ uint64_t ifmedia_baudrate(int); /* * This is a thin wrapper around the ifmedia "change" callback that * is available to drivers to use within their own initialization * routines. * * IFMEDIA must be LOCKED. */ int ifmedia_change(struct ifmedia *, struct ifnet *); #else /* Functions for converting media to/from strings, in libutil/if_media.c */ const char *get_media_type_string(int); const char *get_media_subtype_string(int); const char *get_media_mode_string(int); const char *get_media_option_string(int *); int get_media_mode(int, const char *); int get_media_subtype(int, const char *); int get_media_options(int, const char *, char **); int lookup_media_word(struct ifmedia_description *, int, const char *); #endif /* _KERNEL */ #endif /* !_NET_IF_MEDIA_H_ */ @ 1.70 log @- Remove 50GBASE-LR10. - Add the following medias: - 25GBASE-ACC - 100GBASE-ACC - 100GBASE-AOC - 100GBASE-FR - 100GBASE-LR - 200GBASE-ER4 - 400GBASE-ER8 - 400GBASE-FR4 - 400GBASE-LR4 - 400GBASE-SR4.2 - 400GBASE-SR8 @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.69 2020/02/01 20:56:16 thorpej Exp $ */ d4 1 a4 1 * Copyright (c) 1998, 2000, 2001 The NetBSD Foundation, Inc. a81 4 #ifdef _KERNEL #include #endif /*_KERNEL */ d892 3 d914 18 d934 2 a935 1 u_int ifm_mask; /* IFMWD: mask of changes we don't care */ d937 1 a937 1 * IFMWD: current use-set media word. d944 11 a954 4 struct ifmedia_entry *ifm_cur; /* current user-selected media entry */ TAILQ_HEAD(, ifmedia_entry) ifm_list; /* list of all supported media */ ifm_change_cb_t ifm_change; /* media change driver callback */ ifm_stat_cb_t ifm_status; /* media status driver callback */ d957 22 d981 2 a986 1 int ifmedia_change(struct ifmedia *, struct ifnet *); d1006 3 d1012 8 a1019 2 /* Remove all media */ void ifmedia_removeall(struct ifmedia *); @ 1.69 log @- Add an ifmedia_fini() routine, to free resources assocated with an ifmedia. Currently calls ifmedia_removeall(). All drivers that call ifmedia_init() and support detach should call this routine. - In ifmedia_delete_instance(), set ifm->ifm_cur to NULL and ifm->ifm_media to IFM_NONE when removing / freeing that entry, not simply when we've been asked to delete every media instance. @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.68 2019/12/05 05:29:27 msaitoh Exp $ */ d265 1 d290 2 a291 2 #define IFM_50G_LR _IFM_EX(71) /* 50GBASE-LR (2Km) */ #define IFM_50G_LR10 _IFM_EX(72) /* 50GBASE-LR10 (10Km) */ d321 11 d537 1 a565 1 { IFM_ETHER | IFM_50G_LR10 | IFM_FDX, "50GBASE-LR10" }, \ d569 2 d576 1 d580 1 d588 1 d596 2 d600 1 d602 2 d761 1 a789 1 { IFM_ETHER | IFM_50G_LR10, IF_Gbps(50) }, \ d793 2 d800 1 d804 1 d812 1 d820 2 d824 1 d826 2 @ 1.68 log @Fix previous comment change for ifm_media. It was correct. The real problem is that some driver misuse ifm_media as the current active media. struct mii_data has the current active media(mii_media_active). If a driver use mii(4), it can be use mii->mii_media_active for this purpose. struct ifmedia has no entry for this purpose. Some drivers have an entry in their own softc to keep the value, but some other's don't have it and they mistakenly use ifm_media. We might add a new entry to struct ifmedia in future to avoid this confusion and for simplify. @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.67 2019/11/28 14:08:22 msaitoh Exp $ */ d903 3 @ 1.68.2.1 log @Sync with head. @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.70 2020/02/17 15:51:25 msaitoh Exp $ */ a264 1 #define IFM_25G_ACC _IFM_EX(46) /* 25GBASE-ACC */ d289 2 a290 2 #define IFM_50G_LR _IFM_EX(71) /* 50GBASE-LR */ /* _IFM_EX(72) Not defined yet */ a319 11 #define IFM_100G_ACC _IFM_EX(102) /* 100GBASE-ACC */ #define IFM_100G_AOC _IFM_EX(103) /* 100GBASE-AOC */ #define IFM_100G_FR _IFM_EX(104) /* 100GBASE-FR */ #define IFM_100G_LR _IFM_EX(105) /* 100GBASE-LR */ #define IFM_200G_ER4 _IFM_EX(106) /* 200GBASE-ER4 */ #define IFM_400G_ER8 _IFM_EX(107) /* 400GBASE-ER8 */ #define IFM_400G_FR4 _IFM_EX(108) /* 400GBASE-FR4 */ #define IFM_400G_LR4 _IFM_EX(109) /* 400GBASE-LR4 */ #define IFM_400G_SR4_2 _IFM_EX(110) /* 400GBASE-SR4.2 */ #define IFM_400G_SR8 _IFM_EX(111) /* 400GBASE-SR8 */ a524 1 { IFM_ETHER | IFM_25G_ACC | IFM_FDX, "25GBASE-ACC" }, \ d553 1 a556 2 { IFM_ETHER | IFM_100G_ACC | IFM_FDX, "100GBASE-ACC" }, \ { IFM_ETHER | IFM_100G_AOC | IFM_FDX, "100GBASE-AOC" }, \ a561 1 { IFM_ETHER | IFM_100G_FR | IFM_FDX, "100GBASE-FR" }, \ a564 1 { IFM_ETHER | IFM_100G_LR | IFM_FDX, "100GBASE-LR" }, \ a571 1 { IFM_ETHER | IFM_200G_ER4 | IFM_FDX, "200GBASE-ER4" }, \ a578 2 { IFM_ETHER | IFM_400G_ER8 | IFM_FDX, "400GBASE-ER8" }, \ { IFM_ETHER | IFM_400G_FR4 | IFM_FDX, "400GBASE-FR4" }, \ a580 1 { IFM_ETHER | IFM_400G_LR4 | IFM_FDX, "400GBASE-LR4" }, \ a581 2 { IFM_ETHER | IFM_400G_SR4_2 | IFM_FDX, "400GBASE-SR4.2" }, \ { IFM_ETHER | IFM_400G_SR8 | IFM_FDX, "400GBASE-SR8" }, \ a738 1 { IFM_ETHER | IFM_25G_ACC, IF_Gbps(25) }, \ d767 1 a770 2 { IFM_ETHER | IFM_100G_ACC, IF_Gbps(100) }, \ { IFM_ETHER | IFM_100G_AOC, IF_Gbps(100) }, \ a775 1 { IFM_ETHER | IFM_100G_FR, IF_Gbps(100) }, \ a778 1 { IFM_ETHER | IFM_100G_LR, IF_Gbps(100) }, \ a785 1 { IFM_ETHER | IFM_200G_ER4, IF_Gbps(200) }, \ a792 2 { IFM_ETHER | IFM_400G_ER8, IF_Gbps(400) }, \ { IFM_ETHER | IFM_400G_FR4, IF_Gbps(400) }, \ a794 1 { IFM_ETHER | IFM_400G_LR4, IF_Gbps(400) }, \ a795 2 { IFM_ETHER | IFM_400G_SR4_2, IF_Gbps(400) }, \ { IFM_ETHER | IFM_400G_SR8, IF_Gbps(400) }, \ a902 3 /* Release resourecs associated with an ifmedia. */ void ifmedia_fini(struct ifmedia *); @ 1.67 log @ Fix comment. The ifm_media member of struct ifmedia is NOT user-set media word but the current "active" media. The user-set media word is one of the ifmedia_entry's ifm_media(A) that ifm_cur points to (e.g. IFM_AUTO). It can be taken as ifmediareq's ifm_current entry. The current active media word is the ifm_media(B) entry of struct ifmedia (e.g 1000baseTX-FDX as the result of auto negotiation). It can be taken as ifmediareq's ifm_active entry. struct ifmedia_entry { TAILQ_ENTRY(ifmedia_entry) ifm_list; u_int ifm_media; /* IFMWD: description of this media */ /* A */ u_int ifm_data; /* for driver-specific use */ void *ifm_aux; /* for driver-specific use */ }; struct ifmedia { u_int ifm_mask; /* IFMWD: mask of changes we don't care */ u_int ifm_media; /* IFMWD: current active media word */ /* B */ struct ifmedia_entry *ifm_cur; /* current user-selected media */ TAILQ_HEAD(, ifmedia_entry) ifm_list; /* list of all supported media */ ifm_change_cb_t ifm_change; /* media change driver callback */ ifm_stat_cb_t ifm_status; /* media status driver callback */ }; So: in kernel SIOCGIFMEDIA(ifmediareq) ----------------------------------------------------------------- user-setting: ifm->ifm_cur->ifm_media ifm_current current active: ifm->ifm_media ifm_active It would be good to rename some members to make those meaning clear. @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.66 2019/10/03 14:41:14 jmcneill Exp $ */ d886 9 a894 2 u_int ifm_media; /* IFMWD: current active media word */ struct ifmedia_entry *ifm_cur; /* current user-selected media */ @ 1.66 log @Add IFM_IEEE80211_VHT subtype, IFM_IEEE80211_11AC operating mode, and missing descriptions @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.65 2019/05/17 07:37:12 msaitoh Exp $ */ d875 1 a875 1 u_int ifm_media; /* description of this media attachment */ d885 3 a887 3 u_int ifm_mask; /* mask of changes we don't care about */ u_int ifm_media; /* current user-set media word */ struct ifmedia_entry *ifm_cur; /* currently selected media */ @ 1.65 log @ The max subtype of the ifmedia word is 31. It's too small for Ethernet now. We currently use use it up to 30. We should extend the limit to be able to use more than 10Gbps speeds. Our ifmedia(4) is inconvenience and have some problem so we should redesign the interface, but it's too late for netbsd-9 to do it. So, we keep the data structure size and modify the structure a bit. The strategy is almost the same as FreeBSD. Many bits of IFM_OMASK for Ethernet have not used, so use some of them for Ethernet's subtype. The differences against FreeBSD are: - We use NetBSD style compat code (i.e. no SIOCGIFXMEDIA). - FreeBSD's IFM_ETH_XTYPE's bit location is from 11 to "14" even though IFM_OMASK is from 8 to "15". We use _IFM_ETH_XTMASK from bit 13 to "15". - FreeBSD changed the meaning of IFM_TYPE_MATCH(). I think we should not do it. We keep it not changing and added new IFM_TYPE_SUBTYPE_MATCH() macro for matching both TYPE and SUBTYPE. - Added up to 400GBASE-SR16. New layout of the media word is as follows (from ifmedia_h): * if_media Options word: * Bits Use * ---- ------- * 0-4 Media subtype MAX SUBTYPE == 255 for ETH and 31 for others * 5-7 Media type * 8-15 Type specific options * 16-18 Mode (for multi-mode devices) * 19 (Reserved for Future Use) * 20-27 Shared (global) options * 28-31 Instance * * 3 2 1 * 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 * +-------+---------------+-+-----+---------------+-----+---------+ * | | |R| | | | | * | IMASK | GMASK |F|MMASK+-----+ OMASK |NMASK| TMASK | * | | |U| |XTMSK| | | | * +-------+---------------+-+-----+-----+---------+-----+---------+ * <-----> <---> <---> * IFM_INST() IFM_MODE() IFM_TYPE() * * IFM_SUBTYPE(other than ETH)<-------> * * <---> IFM_SUBTYPE(ETH)<-------> * * * <-------------> <-------------> * IFM_OPTIONS() @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.64 2019/05/10 06:33:14 msaitoh Exp $ */ d376 1 d394 1 d633 2 d648 1 @ 1.65.2.1 log @Pull up following revision(s) (requested by mrg in ticket #717): sys/dev/fdt/dwcmmc_fdt.c 1.11 sys/dev/ic/bwfm.c 1.15-1.18 sys/dev/ic/bwfmreg.h 1.4-1.6 sys/dev/ic/bwfmvar.h 1.4,1.5 sys/dev/ic/dwc_mmc.c 1.21,1.22 sys/dev/ic/dwc_mmc_reg.h 1.8,1.9,1.12,1.13 sys/dev/pcmcia/pcmciareg.h 1.11 sys/dev/sdmmc/if_bwfm_sdio.c 1.4,1.6-1.12 sys/dev/sdmmc/if_bwfm_sdio.h 1.1,1.2 sys/dev/sdmmc/sdhc.c 1.105,1.106 sys/dev/sdmmc/sdmmc.c 1.37,1.39 sys/dev/sdmmc/sdmmc_cis.c 1.6,1.8 sys/dev/sdmmc/sdmmc_io.c 1.15-1.19 sys/dev/sdmmc/sdmmc_ioreg.h 1.4,1.5 sys/dev/sdmmc/sdmmc_mem.c 1.69-1.71 sys/dev/sdmmc/sdmmcdevs 1.5-1.8 sys/dev/sdmmc/sdmmcvar.h 1.31,1.33,1.34 sys/net/if_media.h 1.66 Add Broadcom devices - Fix typo - add PCMCIA_CISTPL_SDIO definition. - From OpenBSD: - move event handling to workqueue - check for save/restore capability - Tag work queue as MPsafe and increase length. - Juse use bpf_mtap(), the 802.11 encapsulation is handled by firmware. - From OpenBSD: - support block length per function - add functions to read/write regions - Decode (but not use) SDIO tuple in CIS. - Fix locking. - Add more SDIO defines (partially from version 3.0). - From OpenBSD: - All the missing pieces (firmware load, chip setup, protocol handling) TX queue and interrupt handling via sdmmc_task. - Fix locking. - Fix packet parsing. - Add parser for original firmware config files. - tagging work queue as MPSAFE was premature. Revert. - SD_IO_RW_EXTENDED is a data transfer command, so set ADTC flag instead of AC Use correct function to verify if a task has been queued. Avoids race that can corrupt the task queue. - More register definitions. - Add IFM_IEEE80211_VHT subtype, IFM_IEEE80211_11AC operating mode, and missing descriptions - If firmware is connected in HT or VHT mode, report it to SIOCGIFMEDIA - white space police. Skip setting power when the voltage doesn't change. Also increase some timeouts. - Add and use sdmmc_pause to avoid long-term busy waits. - Add sdio abort function. - Additional error messages. - Print parameters for SDIO devices. - Minor cosmetics. - Simplyfy sdmmc_io_set_blocklen function signature by dropping the extra softc pointer. Aligns with OpenBSD. - Missing commit for sdio abort function. - More code from OpenBSD - no need to splnet() when enqueing packets - explicit structure padding - make internal functions static - also prepare for GPIO interrupts. - Avoid warnings for tautological shifts as sole conditional. - Follow the Linux driver an use the FDT "compatible" property to build a filename for the nvram config file, fall back to the standard filename. E.g. [Caching 123 nodes and 1093 properties] compatible 73696e6f 766f6970 2c627069 2d6d322d "sinovoip,bpi-m2- 0010: 7a65726f 00...... ........ ........ zero" 0015: 616c6c77 696e6e65 722c7375 6e38692d "allwinner,sun8i- 0025: 68322d70 6c757300 ........ ........ h2-plus" interrupt-parent 00000001 ........ ........ ........ .... model 42616e61 6e612050 69204250 492d4d32 "Banana Pi BPI-M2 0010: 2d5a6572 6f00.... ........ ........ -Zero" name 00...... ........ ........ ........ "" serial-number 30326330 30303432 65636431 36376566 02c00042ecd167ef 0010: 00...... ........ ........ ........ . -rw-r--r-- 1 root wheel 875 Nov 2 12:06 brcmfmac43430-sdio.AP6212.txt lrwxr-xr-x 1 root wheel 29 Dec 30 16:19 brcmfmac43430-sdio.sinovoip,bpi-m2-zero.txt -> brcmfmac43430-sdio.AP6212.txt -rw-r--r-- 1 root wheel 874 Jun 30 2019 brcmfmac43430-sdio.raspberrypi,3-model-b.txt -rw-r--r-- 1 root wheel 1864 Jun 30 2019 brcmfmac43455-sdio.raspberrypi,3-model-b-plus.txt lrwxr-xr-x 1 root wheel 29 Dec 30 11:24 brcmfmac43455-sdio.raspberrypi,4-model-b-plus.txt -> brcmfmac43455-sdio.raspberrypi,3-model-b-plus.txt - Add product ID for Broadcom BCM43455 - Use correct firmware for BCM43456 - size check was backwards. - Be less noisy for some commands. - Fix DWC_MMC_INT_SDIO_INT bit - dwc_mmc fixes: - Rockchip uses a different SDIO int bit, so take this into consideration - Avoid unnecessary resets and always wait for resets to complete - kpause instead of delay while holding spinlock - Do not attempt autostop for SD_IO_RW_EXTENDED commands - Allow for sub-blklen byte counts for single block transfers - More SDIO stability and performance fixes @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.65 2019/05/17 07:37:12 msaitoh Exp $ */ a375 1 #define IFM_IEEE80211_VHT 25 /* VHT MCS rate */ a392 1 #define IFM_IEEE80211_11AC 0x00070000 /* 2Ghz/5Ghz, VHT mode */ a630 2 { IFM_IEEE80211 | IFM_IEEE80211_MCS, "HT" }, \ { IFM_IEEE80211 | IFM_IEEE80211_VHT, "VHT" }, \ a643 1 { IFM_IEEE80211 | IFM_IEEE80211_11AC, "11ac" }, \ @ 1.65.2.2 log @Pull up following revision(s) (requested by msaitoh in ticket #785): sys/net/if_media.h: revision 1.70 - Remove 50GBASE-LR10. - Add the following medias: - 25GBASE-ACC - 100GBASE-ACC - 100GBASE-AOC - 100GBASE-FR - 100GBASE-LR - 200GBASE-ER4 - 400GBASE-ER8 - 400GBASE-FR4 - 400GBASE-LR4 - 400GBASE-SR4.2 - 400GBASE-SR8 @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.65.2.1 2020/02/25 18:40:43 martin Exp $ */ a264 1 #define IFM_25G_ACC _IFM_EX(46) /* 25GBASE-ACC */ d289 2 a290 2 #define IFM_50G_LR _IFM_EX(71) /* 50GBASE-LR */ /* _IFM_EX(72) Not defined yet */ a319 11 #define IFM_100G_ACC _IFM_EX(102) /* 100GBASE-ACC */ #define IFM_100G_AOC _IFM_EX(103) /* 100GBASE-AOC */ #define IFM_100G_FR _IFM_EX(104) /* 100GBASE-FR */ #define IFM_100G_LR _IFM_EX(105) /* 100GBASE-LR */ #define IFM_200G_ER4 _IFM_EX(106) /* 200GBASE-ER4 */ #define IFM_400G_ER8 _IFM_EX(107) /* 400GBASE-ER8 */ #define IFM_400G_FR4 _IFM_EX(108) /* 400GBASE-FR4 */ #define IFM_400G_LR4 _IFM_EX(109) /* 400GBASE-LR4 */ #define IFM_400G_SR4_2 _IFM_EX(110) /* 400GBASE-SR4.2 */ #define IFM_400G_SR8 _IFM_EX(111) /* 400GBASE-SR8 */ a524 1 { IFM_ETHER | IFM_25G_ACC | IFM_FDX, "25GBASE-ACC" }, \ d553 1 a556 2 { IFM_ETHER | IFM_100G_ACC | IFM_FDX, "100GBASE-ACC" }, \ { IFM_ETHER | IFM_100G_AOC | IFM_FDX, "100GBASE-AOC" }, \ a561 1 { IFM_ETHER | IFM_100G_FR | IFM_FDX, "100GBASE-FR" }, \ a564 1 { IFM_ETHER | IFM_100G_LR | IFM_FDX, "100GBASE-LR" }, \ a571 1 { IFM_ETHER | IFM_200G_ER4 | IFM_FDX, "200GBASE-ER4" }, \ a578 2 { IFM_ETHER | IFM_400G_ER8 | IFM_FDX, "400GBASE-ER8" }, \ { IFM_ETHER | IFM_400G_FR4 | IFM_FDX, "400GBASE-FR4" }, \ a580 1 { IFM_ETHER | IFM_400G_LR4 | IFM_FDX, "400GBASE-LR4" }, \ a581 2 { IFM_ETHER | IFM_400G_SR4_2 | IFM_FDX, "400GBASE-SR4.2" }, \ { IFM_ETHER | IFM_400G_SR8 | IFM_FDX, "400GBASE-SR8" }, \ a738 1 { IFM_ETHER | IFM_25G_ACC, IF_Gbps(25) }, \ d767 1 a770 2 { IFM_ETHER | IFM_100G_ACC, IF_Gbps(100) }, \ { IFM_ETHER | IFM_100G_AOC, IF_Gbps(100) }, \ a775 1 { IFM_ETHER | IFM_100G_FR, IF_Gbps(100) }, \ a778 1 { IFM_ETHER | IFM_100G_LR, IF_Gbps(100) }, \ a785 1 { IFM_ETHER | IFM_200G_ER4, IF_Gbps(200) }, \ a792 2 { IFM_ETHER | IFM_400G_ER8, IF_Gbps(400) }, \ { IFM_ETHER | IFM_400G_FR4, IF_Gbps(400) }, \ a794 1 { IFM_ETHER | IFM_400G_LR4, IF_Gbps(400) }, \ a795 2 { IFM_ETHER | IFM_400G_SR4_2, IF_Gbps(400) }, \ { IFM_ETHER | IFM_400G_SR8, IF_Gbps(400) }, \ @ 1.64 log @Remove extra parenthesis. @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.63 2019/04/24 05:07:20 msaitoh Exp $ */ d96 2 a97 1 * 0-4 Media subtype MAX SUBTYPE == 31! d109 3 a111 3 * | IMASK | GMASK |F|MMASK| OMASK |NMASK| TMASK | * | | |U| | | | | * +-------+---------------+-+-----+---------------+-----+---------+ d115 7 a121 2 * <-------------> <-------------> <-------> * IFM_OPTIONS() IFM_SUBTYPE() d140 6 a145 1 #define IFM_SUBTYPE(x) ((x) & IFM_TMASK) a149 3 #define IFM_TYPE_MATCH(dt, t) \ (IFM_TYPE(dt) == 0 || IFM_TYPE(dt) == IFM_TYPE(t)) d208 10 a217 1 */ d246 74 d324 2 d496 1 d512 69 d722 70 a791 1 { IFM_ETHER | IFM_5000_T, IF_Mbps(5000ULL) }, \ @ 1.63 log @No functional change: - IFM_AVALID and IFM_ACTIVE are NOT for the media word. Fix comment. - RFU stands for Reserved for Future Use. @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.62 2019/04/17 07:04:03 msaitoh Exp $ */ d140 1 a140 1 (IFM_TYPE((dt)) == 0 || IFM_TYPE((dt)) == IFM_TYPE((t))) @ 1.62 log @ Tabify. No functional change. @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.61 2017/10/04 07:08:01 msaitoh Exp $ */ d87 6 d100 1 a100 1 * 19 RFU (not used) d107 3 a109 3 * | | |R| | | | |STA| * | IMASK | GMASK |F|MMASK| OMASK |NMASK| +---| * | | |U| | | | TMASK | a182 6 * Status bits (IFM_TMASK) */ #define IFM_AVALID 0x00000001 /* Active bit valid */ #define IFM_ACTIVE 0x00000002 /* Interface attached to working net */ /* @ 1.61 log @ Add 2.5GBASE-T and 5GBASE-T. @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.59 2017/06/08 02:27:30 msaitoh Exp $ */ d410 1 a410 1 { IFM_ETHER | IFM_10G_TWINAX | IFM_FDX, "10Gbase-Twinax" }, \ d415 1 a415 1 { IFM_ETHER | IFM_10G_CX4 | IFM_FDX, "10GBASE-CX4" }, \ d463 5 a467 5 { IFM_IEEE80211 | IFM_IEEE80211_DS354k, "DS/354Kbps" }, \ { IFM_IEEE80211 | IFM_IEEE80211_DS512k, "DS/512Kbps" }, \ { IFM_IEEE80211 | IFM_IEEE80211_OFDM3, "OFDM/3Mbps" }, \ { IFM_IEEE80211 | IFM_IEEE80211_OFDM4, "OFDM/4.5Mbps" }, \ { IFM_IEEE80211 | IFM_IEEE80211_OFDM27, "OFDM/27Mbps" }, \ d517 1 a517 1 { IFM_IEEE80211 | IFM_IEEE80211_WDS, "wds" }, \ @ 1.61.4.1 log @State save. New kernel config for this brach only. TESTWIFI does produce a kernel. It is not working. athn files not compiling yet and commented out of the TESTWIFI kernel, which only has urtwn 802.11 driver enabled. ieee80211_alq.c and ieee80211_ddb.c not compiling yet. @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.61 2017/10/04 07:08:01 msaitoh Exp $ */ a282 1 #define IFM_IEEE80211_VHT 25 /* VHT MCS rate */ a299 2 #define IFM_IEEE80211_VHT5G 0x00070000 /* 5Ghz, VHT mode */ #define IFM_IEEE80211_VHT2G 0x00080000 /* 2Ghz, VHT mode */ a480 2 { IFM_IEEE80211 | IFM_IEEE80211_VHT5G, "11ac" }, \ { IFM_IEEE80211 | IFM_IEEE80211_VHT2G, "11ac2" }, \ @ 1.61.4.2 log @Sync with HEAD @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.65 2019/05/17 07:37:12 msaitoh Exp $ */ a86 6 * Status bits. THIS IS NOT A MEDIA WORD. */ #define IFM_AVALID 0x00000001 /* Active bit valid */ #define IFM_ACTIVE 0x00000002 /* Interface attached to working net */ /* d90 1 a90 2 * 0-4 Media subtype MAX SUBTYPE == 255 for ETH and 31 for others * See below (IFM_ETHER part) for the detail. d94 1 a94 1 * 19 (Reserved for Future Use) d101 4 a104 4 * | | |R| | | | | * | IMASK | GMASK |F|MMASK+-----+ OMASK |NMASK| TMASK | * | | |U| |XTMSK| | | | * +-------+---------------+-+-----+-----+---------+-----+---------+ d108 2 a109 7 * IFM_SUBTYPE(other than ETH)<-------> * * <---> IFM_SUBTYPE(ETH)<-------> * * * <-------------> <-------------> * IFM_OPTIONS() d128 1 a128 6 #define IFM_SUBTYPE(x) (IFM_TYPE(x) == IFM_ETHER ? \ IFM_ETHER_SUBTYPE_GET(x) : ((x) & IFM_TMASK)) #define IFM_TYPE_MATCH(dt, t) \ (IFM_TYPE(dt) == 0 || IFM_TYPE(dt) == IFM_TYPE(t)) #define IFM_TYPE_SUBTYPE_MATCH(dt, t) \ (IFM_TYPE(dt) == IFM_TYPE(t) && IFM_SUBTYPE(dt) == IFM_SUBTYPE(t)) d133 3 d177 6 d200 1 a200 10 * * In order to use more than 31 subtypes, Ethernet uses some of the option * bits as part of the subtype field. See the options section below for * relevant definitions. */ #define IFM_ETHER_SUBTYPE(x) (((x) & IFM_TMASK) | \ (((x) & (_IFM_ETH_XTMASK >> IFM_ETH_XSHIFT)) << IFM_ETH_XSHIFT)) #define IFM_ETHER_SUBTYPE_GET(x) ((x) & (IFM_TMASK | _IFM_ETH_XTMASK)) #define _IFM_EX(x) IFM_ETHER_SUBTYPE(x) /* internal shorthand */ a228 74 #define IFM_OTHER 31 /* * This number indicates "Not listed". * and also used for backward * compatibility. */ #define IFM_1000_SGMII _IFM_EX(32) /* 1G SGMII */ #define IFM_5000_KR _IFM_EX(33) /* 5GBASE-KR backplane */ #define IFM_10G_AOC _IFM_EX(34) /* 10G active optical cable */ #define IFM_10G_CR1 _IFM_EX(35) /* 10GBASE-CR1 Twinax splitter */ #define IFM_10G_ER _IFM_EX(36) /* 10GBASE-ER */ #define IFM_10G_KR _IFM_EX(37) /* 10GBASE-KR backplane */ #define IFM_10G_KX4 _IFM_EX(38) /* 10GBASE-KX4 backplane */ #define IFM_10G_LX4 _IFM_EX(39) /* 10GBASE-LX4 */ #define IFM_10G_SFI _IFM_EX(40) /* 10G SFI */ #define IFM_10G_ZR _IFM_EX(41) /* 10GBASE-ZR */ #define IFM_20G_KR2 _IFM_EX(42) /* 20GBASE-KR2 backplane */ #define IFM_25G_AOC _IFM_EX(43) /* 25G active optical cable */ #define IFM_25G_AUI _IFM_EX(44) /* 25G-AUI-C2C (chip to chip) */ #define IFM_25G_CR _IFM_EX(45) /* 25GBASE-CR (twinax) */ #define IFM_25G_CR_S _IFM_EX(47) /* 25GBASE-CR-S (CR short) */ #define IFM_25G_ER _IFM_EX(48) /* 25GBASE-ER */ #define IFM_25G_KR _IFM_EX(49) /* 25GBASE-KR */ #define IFM_25G_KR_S _IFM_EX(50) /* 25GBASE-KR-S (KR short) */ #define IFM_25G_LR _IFM_EX(51) /* 25GBASE-LR */ #define IFM_25G_SR _IFM_EX(52) /* 25GBASE-SR */ #define IFM_25G_T _IFM_EX(53) /* 25GBASE-T - RJ45 */ #define IFM_40G_AOC _IFM_EX(54) /* 40G Active Optical Cable */ #define IFM_40G_CR4 _IFM_EX(55) /* 40GBASE-CR4 */ #define IFM_40G_ER4 _IFM_EX(56) /* 40GBASE-ER4 */ #define IFM_40G_FR _IFM_EX(57) /* 40GBASE-FR */ #define IFM_40G_KR4 _IFM_EX(58) /* 40GBASE-KR4 */ #define IFM_40G_LR4 _IFM_EX(59) /* 40GBASE-LR4 */ #define IFM_40G_SR4 _IFM_EX(60) /* 40GBASE-SR4 */ #define IFM_40G_T _IFM_EX(61) /* 40GBASE-T */ #define IFM_40G_XLPPI _IFM_EX(62) /* 40G XLPPI */ #define IFM_50G_AUI1 _IFM_EX(63) /* 50GAUI-1 */ #define IFM_50G_AUI2 _IFM_EX(64) /* 50GAUI-2 */ #define IFM_50G_CR _IFM_EX(65) /* 50GBASE-CR */ #define IFM_50G_CR2 _IFM_EX(66) /* 50GBASE-CR2 */ #define IFM_50G_FR _IFM_EX(67) /* 50GBASE-FR */ #define IFM_50G_KR _IFM_EX(68) /* 50GBASE-KR */ #define IFM_50G_KR2 _IFM_EX(69) /* 50GBASE-KR2 */ #define IFM_50G_LAUI2 _IFM_EX(70) /* 50GLAUI-2 */ #define IFM_50G_LR _IFM_EX(71) /* 50GBASE-LR (2Km) */ #define IFM_50G_LR10 _IFM_EX(72) /* 50GBASE-LR10 (10Km) */ #define IFM_50G_SR _IFM_EX(73) /* 50GBASE-SR */ #define IFM_50G_SR2 _IFM_EX(74) /* 50GBASE-SR2 */ #define IFM_56G_R4 _IFM_EX(75) /* 56GBASE-R4 */ #define IFM_100G_CR2 _IFM_EX(76) /* 100GBASE-CR2 (CP2?) */ #define IFM_100G_CR4 _IFM_EX(77) /* 100GBASE-CR4 */ #define IFM_100G_CR10 _IFM_EX(78) /* 100GBASE-CR10 */ #define IFM_100G_DR _IFM_EX(79) /* 100GBASE-DR */ #define IFM_100G_ER4 _IFM_EX(80) /* 100GBASE-ER4 */ #define IFM_100G_KP4 _IFM_EX(81) /* 100GBASE-KP4 */ #define IFM_100G_KR2 _IFM_EX(82) /* 100GBASE-KR2 */ #define IFM_100G_KR4 _IFM_EX(83) /* 100GBASE-KR4 */ #define IFM_100G_LR4 _IFM_EX(84) /* 100GBASE-LR4 */ #define IFM_100G_SR2 _IFM_EX(85) /* 100GBASE-SR2 */ #define IFM_100G_SR4 _IFM_EX(86) /* 100GBASE-SR4 */ #define IFM_100G_SR10 _IFM_EX(87) /* 100GBASE-SR10 */ #define IFM_200G_CR2 _IFM_EX(88) /* 200GBASE-CR2 */ #define IFM_200G_CR4 _IFM_EX(89) /* 200GBASE-CR4 */ #define IFM_200G_DR4 _IFM_EX(90) /* 200GBASE-DR4 */ #define IFM_200G_FR4 _IFM_EX(91) /* 200GBASE-FR4 */ #define IFM_200G_KR2 _IFM_EX(92) /* 200GBASE-KR2 */ #define IFM_200G_KR4 _IFM_EX(93) /* 200GBASE-KR4 */ #define IFM_200G_LR4 _IFM_EX(94) /* 200GBASE-LR4 */ #define IFM_200G_SR4 _IFM_EX(95) /* 200GBASE-SR4 */ #define IFM_400G_CR4 _IFM_EX(96) /* 400GBASE-CR4 */ #define IFM_400G_DR4 _IFM_EX(97) /* 400GBASE-DR4 */ #define IFM_400G_FR8 _IFM_EX(98) /* 400GBASE-FR8 */ #define IFM_400G_KR4 _IFM_EX(99) /* 400GBASE-KR4 */ #define IFM_400G_LR8 _IFM_EX(100) /* 400GBASE-LR8 */ #define IFM_400G_SR16 _IFM_EX(101) /* 400GBASE-SR16 */ a232 2 #define _IFM_ETH_XTMASK 0x0000e000 /* Media sub-type (MSB) */ #define IFM_ETH_XSHIFT (13 - 5) /* shift XTYPE next to TMASK */ a405 1 { IFM_ETHER | IFM_OTHER, "Other" }, \ d413 1 a413 1 { IFM_ETHER | IFM_10G_TWINAX | IFM_FDX, "10Gbase-Twinax" }, \ d418 1 a418 1 { IFM_ETHER | IFM_10G_CX4 | IFM_FDX, "10GBASE-CX4" }, \ a420 69 { IFM_ETHER | IFM_1000_SGMII | IFM_FDX, "1000BASE-SGMII" }, \ { IFM_ETHER | IFM_5000_KR | IFM_FDX, "5GBASE-KR" }, \ { IFM_ETHER | IFM_10G_AOC | IFM_FDX, "10GBASE-AOC" }, \ { IFM_ETHER | IFM_10G_CR1 | IFM_FDX, "10GBASE-CR1" }, \ { IFM_ETHER | IFM_10G_ER | IFM_FDX, "10GBASE-ER" }, \ { IFM_ETHER | IFM_10G_KR | IFM_FDX, "10GBASE-KR" }, \ { IFM_ETHER | IFM_10G_KX4 | IFM_FDX, "10GBASE-KX4" }, \ { IFM_ETHER | IFM_10G_LX4 | IFM_FDX, "10GBASE-LX4" }, \ { IFM_ETHER | IFM_10G_SFI | IFM_FDX, "10GBASE-SFI" }, \ { IFM_ETHER | IFM_10G_ZR | IFM_FDX, "10GBASE-ZR" }, \ { IFM_ETHER | IFM_20G_KR2 | IFM_FDX, "20GBASE-KR2" }, \ { IFM_ETHER | IFM_25G_AOC | IFM_FDX, "25GBASE-AOC" }, \ { IFM_ETHER | IFM_25G_AUI | IFM_FDX, "25G-AUI" }, \ { IFM_ETHER | IFM_25G_CR | IFM_FDX, "25GBASE-CR" }, \ { IFM_ETHER | IFM_25G_CR_S | IFM_FDX, "25GBASE-CR-S" }, \ { IFM_ETHER | IFM_25G_ER | IFM_FDX, "25GBASE-ER" }, \ { IFM_ETHER | IFM_25G_KR | IFM_FDX, "25GBASE-KR" }, \ { IFM_ETHER | IFM_25G_KR_S | IFM_FDX, "25GBASE-KR-S" }, \ { IFM_ETHER | IFM_25G_LR | IFM_FDX, "25GBASE-LR" }, \ { IFM_ETHER | IFM_25G_SR | IFM_FDX, "25GBASE-SR" }, \ { IFM_ETHER | IFM_25G_T | IFM_FDX, "25GBASE-T" }, \ { IFM_ETHER | IFM_40G_AOC | IFM_FDX, "40GBASE-AOC" }, \ { IFM_ETHER | IFM_40G_CR4 | IFM_FDX, "40GBASE-CR4" }, \ { IFM_ETHER | IFM_40G_ER4 | IFM_FDX, "40GBASE-ER4" }, \ { IFM_ETHER | IFM_40G_FR | IFM_FDX, "40GBASE-FR" }, \ { IFM_ETHER | IFM_40G_KR4 | IFM_FDX, "40GBASE-KR4" }, \ { IFM_ETHER | IFM_40G_LR4 | IFM_FDX, "40GBASE-LR4" }, \ { IFM_ETHER | IFM_40G_SR4 | IFM_FDX, "40GBASE-SR4" }, \ { IFM_ETHER | IFM_40G_T | IFM_FDX, "40GBASE-T" }, \ { IFM_ETHER | IFM_40G_XLPPI | IFM_FDX, "40G-XLPPI" }, \ { IFM_ETHER | IFM_50G_AUI1 | IFM_FDX, "50GAUI-1" }, \ { IFM_ETHER | IFM_50G_AUI2 | IFM_FDX, "50GAUI-2" }, \ { IFM_ETHER | IFM_50G_CR | IFM_FDX, "50GBASE-CR" }, \ { IFM_ETHER | IFM_50G_CR2 | IFM_FDX, "50GBASE-CR2" }, \ { IFM_ETHER | IFM_50G_FR | IFM_FDX, "50GBASE-FR" }, \ { IFM_ETHER | IFM_50G_KR | IFM_FDX, "50GBASE-KR" }, \ { IFM_ETHER | IFM_50G_KR2 | IFM_FDX, "50GBASE-KR2" }, \ { IFM_ETHER | IFM_50G_LAUI2 | IFM_FDX, "50GLAUI-2" }, \ { IFM_ETHER | IFM_50G_LR | IFM_FDX, "50GBASE-LR" }, \ { IFM_ETHER | IFM_50G_LR10 | IFM_FDX, "50GBASE-LR10" }, \ { IFM_ETHER | IFM_50G_SR | IFM_FDX, "50GBASE-SR" }, \ { IFM_ETHER | IFM_50G_SR2 | IFM_FDX, "50GBASE-SR2" }, \ { IFM_ETHER | IFM_56G_R4 | IFM_FDX, "56GBASE-R4" }, \ { IFM_ETHER | IFM_100G_CR2 | IFM_FDX, "100GBASE-CR2" }, \ { IFM_ETHER | IFM_100G_CR4 | IFM_FDX, "100GBASE-CR4" }, \ { IFM_ETHER | IFM_100G_CR10 | IFM_FDX, "100GBASE-CR10" }, \ { IFM_ETHER | IFM_100G_DR | IFM_FDX, "100GBASE-DR" }, \ { IFM_ETHER | IFM_100G_ER4 | IFM_FDX, "100GBASE-ER4" }, \ { IFM_ETHER | IFM_100G_KP4 | IFM_FDX, "100GBASE-KP4" }, \ { IFM_ETHER | IFM_100G_KR2 | IFM_FDX, "100GBASE-KR2" }, \ { IFM_ETHER | IFM_100G_KR4 | IFM_FDX, "100GBASE-KR4" }, \ { IFM_ETHER | IFM_100G_LR4 | IFM_FDX, "100GBASE-LR4" }, \ { IFM_ETHER | IFM_100G_SR2 | IFM_FDX, "100GBASE-SR2" }, \ { IFM_ETHER | IFM_100G_SR4 | IFM_FDX, "100GBASE-SR4" }, \ { IFM_ETHER | IFM_100G_SR10 | IFM_FDX, "100GBASE-SR10" }, \ { IFM_ETHER | IFM_200G_CR2 | IFM_FDX, "200GBASE-CR2" }, \ { IFM_ETHER | IFM_200G_CR4 | IFM_FDX, "200GBASE-CR4" }, \ { IFM_ETHER | IFM_200G_DR4 | IFM_FDX, "200GBASE-DR4" }, \ { IFM_ETHER | IFM_200G_FR4 | IFM_FDX, "200GBASE-FR4" }, \ { IFM_ETHER | IFM_200G_KR2 | IFM_FDX, "200GBASE-KR2" }, \ { IFM_ETHER | IFM_200G_KR4 | IFM_FDX, "200GBASE-KR4" }, \ { IFM_ETHER | IFM_200G_LR4 | IFM_FDX, "200GBASE-LR4" }, \ { IFM_ETHER | IFM_200G_SR4 | IFM_FDX, "200GBASE-SR4" }, \ { IFM_ETHER | IFM_400G_CR4 | IFM_FDX, "400GBASE-CR4" }, \ { IFM_ETHER | IFM_400G_DR4 | IFM_FDX, "400GBASE-DR4" }, \ { IFM_ETHER | IFM_400G_FR8 | IFM_FDX, "400GBASE-FR8" }, \ { IFM_ETHER | IFM_400G_KR4 | IFM_FDX, "400GBASE-KR4" }, \ { IFM_ETHER | IFM_400G_LR8 | IFM_FDX, "400GBASE-LR8" }, \ { IFM_ETHER | IFM_400G_SR16 | IFM_FDX, "400GBASE-SR16" }, \ d466 5 a470 5 { IFM_IEEE80211 | IFM_IEEE80211_DS354k, "DS/354Kbps" }, \ { IFM_IEEE80211 | IFM_IEEE80211_DS512k, "DS/512Kbps" }, \ { IFM_IEEE80211 | IFM_IEEE80211_OFDM3, "OFDM/3Mbps" }, \ { IFM_IEEE80211 | IFM_IEEE80211_OFDM4, "OFDM/4.5Mbps" }, \ { IFM_IEEE80211 | IFM_IEEE80211_OFDM27, "OFDM/27Mbps" }, \ d522 1 a522 1 { IFM_IEEE80211 | IFM_IEEE80211_WDS, "wds" }, \ d564 1 a564 70 { IFM_ETHER | IFM_5000_T, IF_Gbps(5) }, \ { IFM_ETHER | IFM_1000_SGMII, IF_Gbps(1) }, \ { IFM_ETHER | IFM_5000_KR, IF_Gbps(5) }, \ { IFM_ETHER | IFM_10G_AOC, IF_Gbps(10) }, \ { IFM_ETHER | IFM_10G_CR1, IF_Gbps(10) }, \ { IFM_ETHER | IFM_10G_ER, IF_Gbps(10) }, \ { IFM_ETHER | IFM_10G_KR, IF_Gbps(10) }, \ { IFM_ETHER | IFM_10G_KX4, IF_Gbps(10) }, \ { IFM_ETHER | IFM_10G_LX4, IF_Gbps(10) }, \ { IFM_ETHER | IFM_10G_SFI, IF_Gbps(10) }, \ { IFM_ETHER | IFM_10G_ZR, IF_Gbps(10) }, \ { IFM_ETHER | IFM_20G_KR2, IF_Gbps(20) }, \ { IFM_ETHER | IFM_25G_AOC, IF_Gbps(25) }, \ { IFM_ETHER | IFM_25G_AUI, IF_Gbps(25) }, \ { IFM_ETHER | IFM_25G_CR, IF_Gbps(25) }, \ { IFM_ETHER | IFM_25G_CR_S, IF_Gbps(25) }, \ { IFM_ETHER | IFM_25G_ER, IF_Gbps(25) }, \ { IFM_ETHER | IFM_25G_KR, IF_Gbps(25) }, \ { IFM_ETHER | IFM_25G_KR_S, IF_Gbps(25) }, \ { IFM_ETHER | IFM_25G_LR, IF_Gbps(25) }, \ { IFM_ETHER | IFM_25G_SR, IF_Gbps(25) }, \ { IFM_ETHER | IFM_25G_T, IF_Gbps(25) }, \ { IFM_ETHER | IFM_40G_AOC, IF_Gbps(40) }, \ { IFM_ETHER | IFM_40G_CR4, IF_Gbps(40) }, \ { IFM_ETHER | IFM_40G_ER4, IF_Gbps(40) }, \ { IFM_ETHER | IFM_40G_FR, IF_Gbps(40) }, \ { IFM_ETHER | IFM_40G_KR4, IF_Gbps(40) }, \ { IFM_ETHER | IFM_40G_LR4, IF_Gbps(40) }, \ { IFM_ETHER | IFM_40G_SR4, IF_Gbps(40) }, \ { IFM_ETHER | IFM_40G_T, IF_Gbps(40) }, \ { IFM_ETHER | IFM_40G_XLPPI, IF_Gbps(40) }, \ { IFM_ETHER | IFM_50G_AUI1, IF_Gbps(50) }, \ { IFM_ETHER | IFM_50G_AUI2, IF_Gbps(50) }, \ { IFM_ETHER | IFM_50G_CR, IF_Gbps(50) }, \ { IFM_ETHER | IFM_50G_CR2, IF_Gbps(50) }, \ { IFM_ETHER | IFM_50G_FR, IF_Gbps(50) }, \ { IFM_ETHER | IFM_50G_KR, IF_Gbps(50) }, \ { IFM_ETHER | IFM_50G_KR2, IF_Gbps(50) }, \ { IFM_ETHER | IFM_50G_LAUI2, IF_Gbps(50) }, \ { IFM_ETHER | IFM_50G_LR, IF_Gbps(50) }, \ { IFM_ETHER | IFM_50G_LR10, IF_Gbps(50) }, \ { IFM_ETHER | IFM_50G_SR, IF_Gbps(50) }, \ { IFM_ETHER | IFM_50G_SR2, IF_Gbps(50) }, \ { IFM_ETHER | IFM_56G_R4, IF_Gbps(56) }, \ { IFM_ETHER | IFM_100G_CR2, IF_Gbps(100) }, \ { IFM_ETHER | IFM_100G_CR4, IF_Gbps(100) }, \ { IFM_ETHER | IFM_100G_CR10, IF_Gbps(100) }, \ { IFM_ETHER | IFM_100G_DR, IF_Gbps(100) }, \ { IFM_ETHER | IFM_100G_ER4, IF_Gbps(100) }, \ { IFM_ETHER | IFM_100G_KP4, IF_Gbps(100) }, \ { IFM_ETHER | IFM_100G_KR2, IF_Gbps(100) }, \ { IFM_ETHER | IFM_100G_KR4, IF_Gbps(100) }, \ { IFM_ETHER | IFM_100G_LR4, IF_Gbps(100) }, \ { IFM_ETHER | IFM_100G_SR2, IF_Gbps(100) }, \ { IFM_ETHER | IFM_100G_SR4, IF_Gbps(100) }, \ { IFM_ETHER | IFM_100G_SR10, IF_Gbps(100) }, \ { IFM_ETHER | IFM_200G_CR2, IF_Gbps(200) }, \ { IFM_ETHER | IFM_200G_CR4, IF_Gbps(200) }, \ { IFM_ETHER | IFM_200G_DR4, IF_Gbps(200) }, \ { IFM_ETHER | IFM_200G_FR4, IF_Gbps(200) }, \ { IFM_ETHER | IFM_200G_KR2, IF_Gbps(200) }, \ { IFM_ETHER | IFM_200G_KR4, IF_Gbps(200) }, \ { IFM_ETHER | IFM_200G_LR4, IF_Gbps(200) }, \ { IFM_ETHER | IFM_200G_SR4, IF_Gbps(200) }, \ { IFM_ETHER | IFM_400G_CR4, IF_Gbps(400) }, \ { IFM_ETHER | IFM_400G_DR4, IF_Gbps(400) }, \ { IFM_ETHER | IFM_400G_FR8, IF_Gbps(400) }, \ { IFM_ETHER | IFM_400G_KR4, IF_Gbps(400) }, \ { IFM_ETHER | IFM_400G_LR8, IF_Gbps(400) }, \ { IFM_ETHER | IFM_400G_SR16, IF_Gbps(400) }, \ @ 1.61.4.3 log @Merge changes from current as of 20200406 @ text @d1 1 a1 1 /* $NetBSD$ */ d4 1 a4 1 * Copyright (c) 1998, 2000, 2001, 2020 The NetBSD Foundation, Inc. d82 4 a264 1 #define IFM_25G_ACC _IFM_EX(46) /* 25GBASE-ACC */ d289 2 a290 2 #define IFM_50G_LR _IFM_EX(71) /* 50GBASE-LR */ /* _IFM_EX(72) Not defined yet */ a319 11 #define IFM_100G_ACC _IFM_EX(102) /* 100GBASE-ACC */ #define IFM_100G_AOC _IFM_EX(103) /* 100GBASE-AOC */ #define IFM_100G_FR _IFM_EX(104) /* 100GBASE-FR */ #define IFM_100G_LR _IFM_EX(105) /* 100GBASE-LR */ #define IFM_200G_ER4 _IFM_EX(106) /* 200GBASE-ER4 */ #define IFM_400G_ER8 _IFM_EX(107) /* 400GBASE-ER8 */ #define IFM_400G_FR4 _IFM_EX(108) /* 400GBASE-FR4 */ #define IFM_400G_LR4 _IFM_EX(109) /* 400GBASE-LR4 */ #define IFM_400G_SR4_2 _IFM_EX(110) /* 400GBASE-SR4.2 */ #define IFM_400G_SR8 _IFM_EX(111) /* 400GBASE-SR8 */ a525 1 { IFM_ETHER | IFM_25G_ACC | IFM_FDX, "25GBASE-ACC" }, \ d554 1 a557 2 { IFM_ETHER | IFM_100G_ACC | IFM_FDX, "100GBASE-ACC" }, \ { IFM_ETHER | IFM_100G_AOC | IFM_FDX, "100GBASE-AOC" }, \ a562 1 { IFM_ETHER | IFM_100G_FR | IFM_FDX, "100GBASE-FR" }, \ a565 1 { IFM_ETHER | IFM_100G_LR | IFM_FDX, "100GBASE-LR" }, \ a572 1 { IFM_ETHER | IFM_200G_ER4 | IFM_FDX, "200GBASE-ER4" }, \ a579 2 { IFM_ETHER | IFM_400G_ER8 | IFM_FDX, "400GBASE-ER8" }, \ { IFM_ETHER | IFM_400G_FR4 | IFM_FDX, "400GBASE-FR4" }, \ a581 1 { IFM_ETHER | IFM_400G_LR4 | IFM_FDX, "400GBASE-LR4" }, \ a582 2 { IFM_ETHER | IFM_400G_SR4_2 | IFM_FDX, "400GBASE-SR4.2" }, \ { IFM_ETHER | IFM_400G_SR8 | IFM_FDX, "400GBASE-SR8" }, \ a738 1 { IFM_ETHER | IFM_25G_ACC, IF_Gbps(25) }, \ d767 1 a770 2 { IFM_ETHER | IFM_100G_ACC, IF_Gbps(100) }, \ { IFM_ETHER | IFM_100G_AOC, IF_Gbps(100) }, \ a775 1 { IFM_ETHER | IFM_100G_FR, IF_Gbps(100) }, \ a778 1 { IFM_ETHER | IFM_100G_LR, IF_Gbps(100) }, \ a785 1 { IFM_ETHER | IFM_200G_ER4, IF_Gbps(200) }, \ a792 2 { IFM_ETHER | IFM_400G_ER8, IF_Gbps(400) }, \ { IFM_ETHER | IFM_400G_FR4, IF_Gbps(400) }, \ a794 1 { IFM_ETHER | IFM_400G_LR4, IF_Gbps(400) }, \ a795 2 { IFM_ETHER | IFM_400G_SR4_2, IF_Gbps(400) }, \ { IFM_ETHER | IFM_400G_SR8, IF_Gbps(400) }, \ a863 3 #include #include d875 1 a875 1 u_int ifm_media; /* IFMWD: description of this media */ a882 18 * * LOCKING * ======= * The ifmedia is protected by a lock provided by the interface * driver. All ifmedia API entry points (with the exception of one) * are expect to be called with this mutex NOT HELD. * * ifmedia_ioctl() is called with the interface's if_ioctl_lock held, * and thus the locking order is: * * IFNET_LOCK -> ifm_lock * * Driver callbacks (ifm_change / ifm_status) are called with ifm_lock HELD. * * Field markings and the corresponding locks: * * m: ifm_lock * :: unlocked, stable d885 6 a890 21 kmutex_t *ifm_lock; /* :: mutex (provided by interface driver) */ u_int ifm_mask; /* :: IFMWD: mask of changes we don't care */ u_int ifm_media; /* * m: IFMWD: current user-set media word. * * XXX some drivers misuse this entry as * current active media word. Don't use this * entry as this purpose but use driver * specific entry if you don't use mii(4). */ struct ifmedia_entry *ifm_cur; /* * m: entry corresponding to * ifm_media */ TAILQ_HEAD(, ifmedia_entry) ifm_list; /* * m: list of all supported * media */ ifm_change_cb_t ifm_change; /* :: media change driver callback */ ifm_stat_cb_t ifm_status; /* :: media status driver callback */ uintptr_t ifm_legacy; /* m: legacy driver handling */ a892 22 #define ifmedia_lock(ifm) mutex_enter((ifm)->ifm_lock) #define ifmedia_unlock(ifm) mutex_exit((ifm)->ifm_lock) #define ifmedia_locked(ifm) mutex_owned((ifm)->ifm_lock) #ifdef __IFMEDIA_PRIVATE #define ifmedia_islegacy(ifm) ((ifm)->ifm_legacy) void ifmedia_lock_for_legacy(struct ifmedia *); void ifmedia_unlock_for_legacy(struct ifmedia *); #define IFMEDIA_LOCK_FOR_LEGACY(ifm) \ do { \ if (ifmedia_islegacy(ifm)) \ ifmedia_lock_for_legacy(ifm); \ } while (/*CONSTCOND*/0) #define IFMEDIA_UNLOCK_FOR_LEGACY(ifm) \ do { \ if (ifmedia_islegacy(ifm)) \ ifmedia_unlock_for_legacy(ifm); \ } while (/*CONSTCOND*/0) #endif /* __IFMEDIA_PRIVATE */ a894 5 void ifmedia_init_with_lock(struct ifmedia *, int, ifm_change_cb_t, ifm_stat_cb_t, kmutex_t *); /* Release resourecs associated with an ifmedia. */ void ifmedia_fini(struct ifmedia *); d896 1 a915 3 /* Remove all media */ void ifmedia_removeall(struct ifmedia *); d919 2 a920 8 /* * This is a thin wrapper around the ifmedia "change" callback that * is available to drivers to use within their own initialization * routines. * * IFMEDIA must be LOCKED. */ int ifmedia_change(struct ifmedia *, struct ifnet *); @ 1.61.4.4 log @Mostly merge changes from HEAD upto 20200411 @ text @d384 1 a384 1 #define IFM_IEEE80211_VHT 25 /* VHT MCS rate */ d402 2 a403 3 #define IFM_IEEE80211_VHT5G 0x00070000 /* 5Ghz, VHT mode */ #define IFM_IEEE80211_VHT2G 0x00080000 /* 2Ghz, VHT mode */ #define IFM_IEEE80211_11AC 0x00070000 /* 2Ghz/5Ghz, VHT mode */ a651 2 { IFM_IEEE80211 | IFM_IEEE80211_MCS, "HT" }, \ { IFM_IEEE80211 | IFM_IEEE80211_VHT, "VHT" }, \ a666 1 { IFM_IEEE80211 | IFM_IEEE80211_11AC, "11ac" }, \ @ 1.60 log @ All Ethernet media more than 1000Mbps don't support half duplex. For the convinience, ifconfig without "mediaopt fullduplex" sets IFM_FDX automatically for those medias. Without this change, "ifconfig xxN mediaopt 10Gbase-T" (without "mediaopt fullduplex") returns EINVAL if a driver doesn't call ifmedia_add() without IFM_FDX because ifmedia_match() returns NULL. @ text @d227 2 d399 4 d558 2 @ 1.59 log @- Add some missing baudrate entries - Add 1000BASE-KX and 2500BASE-KX @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.58 2017/06/05 08:50:07 msaitoh Exp $ */ d395 17 a411 17 { IFM_ETHER | IFM_2500_KX, "2500BASE-KX" }, \ { IFM_ETHER | IFM_2500_KX, "2500baseKX" }, \ { IFM_ETHER | IFM_10G_LR, "10GbaseLR" }, \ { IFM_ETHER | IFM_10G_LR, "10GLR" }, \ { IFM_ETHER | IFM_10G_LR, "10GBASE-LR" }, \ { IFM_ETHER | IFM_10G_SR, "10GbaseSR" }, \ { IFM_ETHER | IFM_10G_SR, "10GSR" }, \ { IFM_ETHER | IFM_10G_SR, "10GBASE-SR" }, \ { IFM_ETHER | IFM_10G_LRM, "10Gbase-LRM" }, \ { IFM_ETHER | IFM_10G_TWINAX, "10Gbase-Twinax" }, \ { IFM_ETHER | IFM_10G_TWINAX_LONG, "10Gbase-Twinax-Long" },\ { IFM_ETHER | IFM_10G_T, "10Gbase-T" }, \ { IFM_ETHER | IFM_10G_CX4, "10GbaseCX4" }, \ { IFM_ETHER | IFM_10G_CX4, "10GCX4" }, \ { IFM_ETHER | IFM_10G_CX4, "10GBASE-CX4" }, \ { IFM_ETHER | IFM_2500_SX, "2500baseSX" }, \ { IFM_ETHER | IFM_2500_SX, "2500SX" }, \ @ 1.58 log @No functional change: - Relocate definitions in the following order to be easy to understand. 0) IFM_*MASK 1) macros to extract various bits of information from the media word. 2) Media type. 3) Shared media sub-type. 4) Status bits. 5) Shared (global) options 6) Media dependent definitions. 7) kernel function declarations. 7) userland function declarations. - Add comments. This change makes me realize that: 0) RFU bit have never used. 1) bit 1..0 are shared between Shared media sub-type and Status bits. It's little dangerous. 2) No. 5 of Media type is not used (hole). 3) Only IEEE80211 uses IFM_MMASK(IFM_MODE()) bits. 4) IFM_TOKEN's OMASK bits doesn't start from 0x00000100 but starts from 0x00000200. Is this for BSD/OS compatibility? @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.57 2016/09/14 11:43:08 roy Exp $ */ d225 2 d388 2 d395 2 d545 7 @ 1.57 log @Introduce IFM_GENERIC. This allows use of the media interface, but without media as such. It's sole purpose is to facilitate the reporting of the link status. @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.56 2012/10/25 10:59:43 msaitoh Exp $ */ a82 1 d84 1 d87 23 a109 1 * Driver callbacks for media status and change requests. a110 2 typedef int (*ifm_change_cb_t)(struct ifnet *); typedef void (*ifm_stat_cb_t)(struct ifnet *, struct ifmediareq *); d113 1 a113 1 * In-kernel representation of a single supported media type. d115 8 a122 6 struct ifmedia_entry { TAILQ_ENTRY(ifmedia_entry) ifm_list; u_int ifm_media; /* description of this media attachment */ u_int ifm_data; /* for driver-specific use */ void *ifm_aux; /* for driver-specific use */ }; d125 1 a125 2 * One of these goes into a network interface's softc structure. * It is used to keep general media state. d127 5 a131 8 struct ifmedia { u_int ifm_mask; /* mask of changes we don't care about */ u_int ifm_media; /* current user-set media word */ struct ifmedia_entry *ifm_cur; /* currently selected media */ TAILQ_HEAD(, ifmedia_entry) ifm_list; /* list of all supported media */ ifm_change_cb_t ifm_change; /* media change driver callback */ ifm_stat_cb_t ifm_status; /* media status driver callback */ }; d133 2 a134 2 /* Initialize an interface's struct if_media field. */ void ifmedia_init(struct ifmedia *, int, ifm_change_cb_t, ifm_stat_cb_t); d136 2 a137 1 int ifmedia_change(struct ifmedia *, struct ifnet *); d139 2 a140 2 /* Add one supported medium to a struct ifmedia. */ void ifmedia_add(struct ifmedia *, int, int, void *); d142 5 a146 2 /* Add an array (of ifmedia_entry) media to a struct ifmedia. */ void ifmedia_list_add(struct ifmedia *, struct ifmedia_entry *, int); d148 7 a154 2 /* Set default media type on initialization. */ void ifmedia_set(struct ifmedia *ifm, int mword); d156 9 a164 2 /* Common ioctl function for getting/setting media, called by driver. */ int ifmedia_ioctl(struct ifnet *, struct ifreq *, struct ifmedia *, u_long); d166 2 a167 2 /* Look up a media entry. */ struct ifmedia_entry *ifmedia_match(struct ifmedia *, u_int, u_int); d169 6 a174 2 /* Delete all media for a given media instance */ void ifmedia_delete_instance(struct ifmedia *, u_int); d176 5 a180 7 /* Compute baudrate for a given media. */ uint64_t ifmedia_baudrate(int); /* Remove all media */ void ifmedia_removeall(struct ifmedia *); #endif /*_KERNEL */ d183 1 a183 10 * if_media Options word: * Bits Use * ---- ------- * 0-4 Media subtype MAX SUBTYPE == 31! * 5-7 Media type * 8-15 Type specific options * 16-18 Mode (for multi-mode devices) * 19 RFU * 20-27 Shared (global) options * 28-31 Instance d185 7 d194 2 a195 1 * Generic, only used for link status reporting. a196 1 #define IFM_GENERIC 0x00000000 d199 1 a199 1 * Ethernet a200 1 #define IFM_ETHER 0x00000020 d225 1 a225 1 d230 3 d234 1 a234 1 * Token ring a235 1 #define IFM_TOKEN 0x00000040 d240 1 d246 1 a246 1 * FDDI a247 1 #define IFM_FDDI 0x00000060 d254 1 a254 1 * IEEE 802.11 Wireless a255 1 #define IFM_IEEE80211 0x00000080 d280 1 d289 1 a289 1 /* operating mode for multi-mode devices */ d299 2 a300 1 * Common Address Redundancy Protocol a301 72 #define IFM_CARP 0x000000c0 /* * Shared media sub-types */ #define IFM_AUTO 0 /* Autoselect best media */ #define IFM_MANUAL 1 /* Jumper/dipswitch selects media */ #define IFM_NONE 2 /* Deselect all media */ /* * Shared options */ #define IFM_FDX 0x00100000 /* Force full duplex */ #define IFM_HDX 0x00200000 /* Force half duplex */ #define IFM_FLOW 0x00400000 /* enable hardware flow control */ #define IFM_FLAG0 0x01000000 /* Driver defined flag */ #define IFM_FLAG1 0x02000000 /* Driver defined flag */ #define IFM_FLAG2 0x04000000 /* Driver defined flag */ #define IFM_LOOP 0x08000000 /* Put hardware in loopback */ /* * Masks */ #define IFM_NMASK 0x000000e0 /* Network type */ #define IFM_TMASK 0x0000001f /* Media sub-type */ #define IFM_IMASK 0xf0000000 /* Instance */ #define IFM_ISHIFT 28 /* Instance shift */ #define IFM_OMASK 0x0000ff00 /* Type specific options */ #define IFM_MMASK 0x00070000 /* Mode */ #define IFM_MSHIFT 16 /* Mode shift */ #define IFM_GMASK 0x0ff00000 /* Global options */ /* Ethernet flow control mask */ #define IFM_ETH_FMASK (IFM_FLOW | IFM_ETH_RXPAUSE | IFM_ETH_TXPAUSE) #define IFM_NMIN IFM_ETHER /* lowest Network type */ #define IFM_NMAX IFM_NMASK /* highest Network type */ /* * Status bits */ #define IFM_AVALID 0x00000001 /* Active bit valid */ #define IFM_ACTIVE 0x00000002 /* Interface attached to working net */ /* Mask of "status valid" bits, for ifconfig(8). */ #define IFM_STATUS_VALID IFM_AVALID /* List of "status valid" bits, for ifconfig(8). */ #define IFM_STATUS_VALID_LIST { \ IFM_AVALID, \ 0, \ } /* * Macros to extract various bits of information from the media word. */ #define IFM_TYPE(x) ((x) & IFM_NMASK) #define IFM_SUBTYPE(x) ((x) & IFM_TMASK) #define IFM_INST(x) (((x) & IFM_IMASK) >> IFM_ISHIFT) #define IFM_OPTIONS(x) ((x) & (IFM_OMASK | IFM_GMASK)) #define IFM_MODE(x) ((x) & IFM_MMASK) #define IFM_INST_MAX IFM_INST(IFM_IMASK) #define IFM_INST_ANY ((u_int) -1) /* * Macro to create a media word. */ #define IFM_MAKEWORD(type, subtype, options, instance) \ ((type) | (subtype) | (options) | ((instance) << IFM_ISHIFT)) #define IFM_MAKEMODE(mode) \ (((mode) << IFM_MSHIFT) & IFM_MMASK) a331 3 #define IFM_TYPE_MATCH(dt, t) \ (IFM_TYPE((dt)) == 0 || IFM_TYPE((dt)) == IFM_TYPE((t))) d605 60 a664 1 #ifndef _KERNEL d670 4 a673 4 int get_media_mode(int, const char *); int get_media_subtype(int, const char *); int get_media_options(int, const char *, char **); int lookup_media_word(struct ifmedia_description *, int, const char *); @ 1.57.8.1 log @Pull up following revision(s) (requested by msaitoh in ticket #82): sys/net/if_media.h: revision 1.58 sys/net/if_media.h: revision 1.59 No functional change: - Relocate definitions in the following order to be easy to understand. 0) IFM_*MASK 1) macros to extract various bits of information from the media word. 2) Media type. 3) Shared media sub-type. 4) Status bits. 5) Shared (global) options 6) Media dependent definitions. 7) kernel function declarations. 7) userland function declarations. - Add comments. This change makes me realize that: 0) RFU bit have never used. 1) bit 1..0 are shared between Shared media sub-type and Status bits. It's little dangerous. 2) No. 5 of Media type is not used (hole). 3) Only IEEE80211 uses IFM_MMASK(IFM_MODE()) bits. 4) IFM_TOKEN's OMASK bits doesn't start from 0x00000100 but starts from 0x00000200. Is this for BSD/OS compatibility? - Add some missing baudrate entries - Add 1000BASE-KX and 2500BASE-KX @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.57 2016/09/14 11:43:08 roy Exp $ */ d83 1 a84 1 #endif /*_KERNEL */ d87 1 a87 23 * if_media Options word: * Bits Use * ---- ------- * 0-4 Media subtype MAX SUBTYPE == 31! * 5-7 Media type * 8-15 Type specific options * 16-18 Mode (for multi-mode devices) * 19 RFU (not used) * 20-27 Shared (global) options * 28-31 Instance * * 3 2 1 * 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 * +-------+---------------+-+-----+---------------+-----+---------+ * | | |R| | | | |STA| * | IMASK | GMASK |F|MMASK| OMASK |NMASK| +---| * | | |U| | | | TMASK | * +-------+---------------+-+-----+---------------+-----+---------+ * <-----> <---> <---> * IFM_INST() IFM_MODE() IFM_TYPE() * * <-------------> <-------------> <-------> * IFM_OPTIONS() IFM_SUBTYPE() d89 2 d93 1 a93 1 * Masks d95 6 a100 8 #define IFM_NMASK 0x000000e0 /* Network type */ #define IFM_TMASK 0x0000001f /* Media sub-type */ #define IFM_IMASK 0xf0000000 /* Instance */ #define IFM_ISHIFT 28 /* Instance shift */ #define IFM_OMASK 0x0000ff00 /* Type specific options */ #define IFM_MMASK 0x00070000 /* Mode */ #define IFM_MSHIFT 16 /* Mode shift */ #define IFM_GMASK 0x0ff00000 /* Global options */ d103 2 a104 1 * Macros to extract various bits of information from the media word. d106 13 a118 5 #define IFM_TYPE(x) ((x) & IFM_NMASK) #define IFM_SUBTYPE(x) ((x) & IFM_TMASK) #define IFM_INST(x) (((x) & IFM_IMASK) >> IFM_ISHIFT) #define IFM_OPTIONS(x) ((x) & (IFM_OMASK | IFM_GMASK)) #define IFM_MODE(x) ((x) & IFM_MMASK) d120 2 a121 2 #define IFM_TYPE_MATCH(dt, t) \ (IFM_TYPE((dt)) == 0 || IFM_TYPE((dt)) == IFM_TYPE((t))) d123 2 a124 2 #define IFM_INST_MAX IFM_INST(IFM_IMASK) #define IFM_INST_ANY ((u_int) -1) d126 2 a127 2 /* Mask of "status valid" bits, for ifconfig(8). */ #define IFM_STATUS_VALID IFM_AVALID d129 2 a130 5 /* List of "status valid" bits, for ifconfig(8). */ #define IFM_STATUS_VALID_LIST { \ IFM_AVALID, \ 0, \ } d132 2 a133 7 /* * Macro to create a media word. */ #define IFM_MAKEWORD(type, subtype, options, instance) \ ((type) | (subtype) | (options) | ((instance) << IFM_ISHIFT)) #define IFM_MAKEMODE(mode) \ (((mode) << IFM_MSHIFT) & IFM_MMASK) d135 2 a136 9 /* * Media type (IFM_NMASK). */ #define IFM_GENERIC 0x00000000 /* Only used for link status reporting */ #define IFM_ETHER 0x00000020 #define IFM_TOKEN 0x00000040 #define IFM_FDDI 0x00000060 #define IFM_IEEE80211 0x00000080 #define IFM_CARP 0x000000c0 /* Common Address Redundancy Protocol */ d138 2 a139 2 #define IFM_NMIN IFM_ETHER /* lowest Network type */ #define IFM_NMAX IFM_NMASK /* highest Network type */ d141 2 a142 6 /* * Shared media sub-types (IFM_TMASK) */ #define IFM_AUTO 0 /* Autoselect best media */ #define IFM_MANUAL 1 /* Jumper/dipswitch selects media */ #define IFM_NONE 2 /* Deselect all media */ d144 1 a144 5 /* * Status bits (IFM_TMASK) */ #define IFM_AVALID 0x00000001 /* Active bit valid */ #define IFM_ACTIVE 0x00000002 /* Interface attached to working net */ d147 10 a156 1 * Shared (global) options (IFM_GMASK) a157 7 #define IFM_FDX 0x00100000 /* Force full duplex */ #define IFM_HDX 0x00200000 /* Force half duplex */ #define IFM_FLOW 0x00400000 /* enable hardware flow control */ #define IFM_FLAG0 0x01000000 /* Driver defined flag */ #define IFM_FLAG1 0x02000000 /* Driver defined flag */ #define IFM_FLAG2 0x04000000 /* Driver defined flag */ #define IFM_LOOP 0x08000000 /* Put hardware in loopback */ d160 1 a160 2 * 0: Generic (IFM_GENERIC). Only used for link status reporting. * No any media specific flag. d162 1 d165 1 a165 1 * 1: Ethernet (IFM_ETHER) d167 1 d192 1 a192 3 #define IFM_1000_KX 27 /* 1000base-KX backplane */ #define IFM_2500_KX 28 /* 2500base-KX backplane */ /* IFM_OMASK bits */ a196 3 /* Ethernet flow control mask */ #define IFM_ETH_FMASK (IFM_FLOW | IFM_ETH_RXPAUSE | IFM_ETH_TXPAUSE) d198 1 a198 1 * 2: Token ring (IFM_TOKEN) d200 1 a204 1 /* IFM_OMASK bits */ d210 1 a210 1 * 3: FDDI (IFM_FDDI) d212 1 d219 1 a219 1 * 4: IEEE 802.11 Wireless (IFM_IEEE80211) d221 1 a245 1 /* IFM_OMASK bits */ d254 1 a254 1 /* Operating mode (IFM_MMASK) for multi-mode devices */ d264 1 a264 2 * 6: Common Address Redundancy Protocol (IFM_CARP) * No any media specific flag. d266 72 d368 3 a424 2 { IFM_ETHER | IFM_1000_KX, "1000BASE-KX" }, \ { IFM_ETHER | IFM_1000_KX, "1000baseKX" }, \ a429 2 { IFM_ETHER | IFM_2500_KX, "2500BASE-KX" }, \ { IFM_ETHER | IFM_2500_KX, "2500baseKX" }, \ a577 7 { IFM_ETHER | IFM_1000_BX10, IF_Mbps(1000ULL) }, \ { IFM_ETHER | IFM_10G_TWINAX, IF_Gbps(10) }, \ { IFM_ETHER | IFM_10G_TWINAX_LONG, IF_Gbps(10) }, \ { IFM_ETHER | IFM_10G_LRM, IF_Gbps(10) }, \ { IFM_ETHER | IFM_10G_T, IF_Gbps(10) }, \ { IFM_ETHER | IFM_1000_KX, IF_Mbps(1000ULL) }, \ { IFM_ETHER | IFM_2500_KX, IF_Mbps(2500ULL) }, \ d644 1 a644 60 #ifdef _KERNEL /* * Driver callbacks for media status and change requests. */ typedef int (*ifm_change_cb_t)(struct ifnet *); typedef void (*ifm_stat_cb_t)(struct ifnet *, struct ifmediareq *); /* * In-kernel representation of a single supported media type. */ struct ifmedia_entry { TAILQ_ENTRY(ifmedia_entry) ifm_list; u_int ifm_media; /* description of this media attachment */ u_int ifm_data; /* for driver-specific use */ void *ifm_aux; /* for driver-specific use */ }; /* * One of these goes into a network interface's softc structure. * It is used to keep general media state. */ struct ifmedia { u_int ifm_mask; /* mask of changes we don't care about */ u_int ifm_media; /* current user-set media word */ struct ifmedia_entry *ifm_cur; /* currently selected media */ TAILQ_HEAD(, ifmedia_entry) ifm_list; /* list of all supported media */ ifm_change_cb_t ifm_change; /* media change driver callback */ ifm_stat_cb_t ifm_status; /* media status driver callback */ }; /* Initialize an interface's struct if_media field. */ void ifmedia_init(struct ifmedia *, int, ifm_change_cb_t, ifm_stat_cb_t); int ifmedia_change(struct ifmedia *, struct ifnet *); /* Add one supported medium to a struct ifmedia. */ void ifmedia_add(struct ifmedia *, int, int, void *); /* Add an array (of ifmedia_entry) media to a struct ifmedia. */ void ifmedia_list_add(struct ifmedia *, struct ifmedia_entry *, int); /* Set default media type on initialization. */ void ifmedia_set(struct ifmedia *ifm, int mword); /* Common ioctl function for getting/setting media, called by driver. */ int ifmedia_ioctl(struct ifnet *, struct ifreq *, struct ifmedia *, u_long); /* Look up a media entry. */ struct ifmedia_entry *ifmedia_match(struct ifmedia *, u_int, u_int); /* Delete all media for a given media instance */ void ifmedia_delete_instance(struct ifmedia *, u_int); /* Compute baudrate for a given media. */ uint64_t ifmedia_baudrate(int); /* Remove all media */ void ifmedia_removeall(struct ifmedia *); #else d650 4 a653 4 int get_media_mode(int, const char *); int get_media_subtype(int, const char *); int get_media_options(int, const char *, char **); int lookup_media_word(struct ifmedia_description *, int, const char *); @ 1.57.8.2 log @Pull up following revision(s) (requested by msaitoh in ticket #366): sys/net/if_media.h: revision 1.60 sys/net/if_media.h: revision 1.61 All Ethernet media more than 1000Mbps don't support half duplex. For the convinience, ifconfig without "mediaopt fullduplex" sets IFM_FDX automatically for those medias. Without this change, "ifconfig xxN mediaopt 10Gbase-T" (without "mediaopt fullduplex") returns EINVAL if a driver doesn't call ifmedia_add() without IFM_FDX because ifmedia_match() returns NULL. Add 2.5GBASE-T and 5GBASE-T. @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.57.8.1 2017/07/04 16:13:58 martin Exp $ */ a226 2 #define IFM_2500_T 29 /* 2500base-T - RJ45 */ #define IFM_5000_T 30 /* 5Gbase-T - RJ45 */ d395 17 a411 21 { IFM_ETHER | IFM_2500_KX | IFM_FDX, "2500BASE-KX" }, \ { IFM_ETHER | IFM_2500_KX | IFM_FDX, "2500baseKX" }, \ { IFM_ETHER | IFM_2500_T | IFM_FDX, "2.5GBASE-T" }, \ { IFM_ETHER | IFM_2500_T | IFM_FDX, "2500baseT" }, \ { IFM_ETHER | IFM_5000_T | IFM_FDX, "5GBASE-T" }, \ { IFM_ETHER | IFM_5000_T | IFM_FDX, "5GbaseT" }, \ { IFM_ETHER | IFM_10G_LR | IFM_FDX, "10GbaseLR" }, \ { IFM_ETHER | IFM_10G_LR | IFM_FDX, "10GLR" }, \ { IFM_ETHER | IFM_10G_LR | IFM_FDX, "10GBASE-LR" }, \ { IFM_ETHER | IFM_10G_SR | IFM_FDX, "10GbaseSR" }, \ { IFM_ETHER | IFM_10G_SR | IFM_FDX, "10GSR" }, \ { IFM_ETHER | IFM_10G_SR | IFM_FDX, "10GBASE-SR" }, \ { IFM_ETHER | IFM_10G_LRM | IFM_FDX, "10Gbase-LRM" }, \ { IFM_ETHER | IFM_10G_TWINAX | IFM_FDX, "10Gbase-Twinax" }, \ { IFM_ETHER | IFM_10G_TWINAX_LONG | IFM_FDX, "10Gbase-Twinax-Long" },\ { IFM_ETHER | IFM_10G_T | IFM_FDX, "10Gbase-T" }, \ { IFM_ETHER | IFM_10G_CX4 | IFM_FDX, "10GbaseCX4" }, \ { IFM_ETHER | IFM_10G_CX4 | IFM_FDX, "10GCX4" }, \ { IFM_ETHER | IFM_10G_CX4 | IFM_FDX, "10GBASE-CX4" }, \ { IFM_ETHER | IFM_2500_SX | IFM_FDX, "2500baseSX" }, \ { IFM_ETHER | IFM_2500_SX | IFM_FDX, "2500SX" }, \ a551 2 { IFM_ETHER | IFM_2500_T, IF_Mbps(2500ULL) }, \ { IFM_ETHER | IFM_5000_T, IF_Mbps(5000ULL) }, \ @ 1.56 log @Add 1000baseT-FDX. @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.55 2011/02/20 13:51:17 cegger Exp $ */ d160 5 d622 3 @ 1.56.18.1 log @Sync with HEAD @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.57 2016/09/14 11:43:08 roy Exp $ */ a159 5 * Generic, only used for link status reporting. */ #define IFM_GENERIC 0x00000000 /* a616 3 { IFM_GENERIC, IFM_AVALID, IFM_ACTIVE, \ { "no network", "active" } }, \ \ @ 1.56.14.1 log @Sync with HEAD @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.57 2016/09/14 11:43:08 roy Exp $ */ a159 5 * Generic, only used for link status reporting. */ #define IFM_GENERIC 0x00000000 /* a616 3 { IFM_GENERIC, IFM_AVALID, IFM_ACTIVE, \ { "no network", "active" } }, \ \ @ 1.56.14.2 log @Sync with HEAD @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.56.14.1 2016/10/05 20:56:08 skrll Exp $ */ d83 1 a84 1 #endif /*_KERNEL */ d87 1 a87 23 * if_media Options word: * Bits Use * ---- ------- * 0-4 Media subtype MAX SUBTYPE == 31! * 5-7 Media type * 8-15 Type specific options * 16-18 Mode (for multi-mode devices) * 19 RFU (not used) * 20-27 Shared (global) options * 28-31 Instance * * 3 2 1 * 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 * +-------+---------------+-+-----+---------------+-----+---------+ * | | |R| | | | |STA| * | IMASK | GMASK |F|MMASK| OMASK |NMASK| +---| * | | |U| | | | TMASK | * +-------+---------------+-+-----+---------------+-----+---------+ * <-----> <---> <---> * IFM_INST() IFM_MODE() IFM_TYPE() * * <-------------> <-------------> <-------> * IFM_OPTIONS() IFM_SUBTYPE() d89 2 d93 1 a93 1 * Masks d95 6 a100 8 #define IFM_NMASK 0x000000e0 /* Network type */ #define IFM_TMASK 0x0000001f /* Media sub-type */ #define IFM_IMASK 0xf0000000 /* Instance */ #define IFM_ISHIFT 28 /* Instance shift */ #define IFM_OMASK 0x0000ff00 /* Type specific options */ #define IFM_MMASK 0x00070000 /* Mode */ #define IFM_MSHIFT 16 /* Mode shift */ #define IFM_GMASK 0x0ff00000 /* Global options */ d103 2 a104 1 * Macros to extract various bits of information from the media word. d106 13 a118 5 #define IFM_TYPE(x) ((x) & IFM_NMASK) #define IFM_SUBTYPE(x) ((x) & IFM_TMASK) #define IFM_INST(x) (((x) & IFM_IMASK) >> IFM_ISHIFT) #define IFM_OPTIONS(x) ((x) & (IFM_OMASK | IFM_GMASK)) #define IFM_MODE(x) ((x) & IFM_MMASK) d120 2 a121 2 #define IFM_TYPE_MATCH(dt, t) \ (IFM_TYPE((dt)) == 0 || IFM_TYPE((dt)) == IFM_TYPE((t))) d123 2 a124 2 #define IFM_INST_MAX IFM_INST(IFM_IMASK) #define IFM_INST_ANY ((u_int) -1) d126 2 a127 2 /* Mask of "status valid" bits, for ifconfig(8). */ #define IFM_STATUS_VALID IFM_AVALID d129 2 a130 5 /* List of "status valid" bits, for ifconfig(8). */ #define IFM_STATUS_VALID_LIST { \ IFM_AVALID, \ 0, \ } d132 2 a133 7 /* * Macro to create a media word. */ #define IFM_MAKEWORD(type, subtype, options, instance) \ ((type) | (subtype) | (options) | ((instance) << IFM_ISHIFT)) #define IFM_MAKEMODE(mode) \ (((mode) << IFM_MSHIFT) & IFM_MMASK) d135 2 a136 9 /* * Media type (IFM_NMASK). */ #define IFM_GENERIC 0x00000000 /* Only used for link status reporting */ #define IFM_ETHER 0x00000020 #define IFM_TOKEN 0x00000040 #define IFM_FDDI 0x00000060 #define IFM_IEEE80211 0x00000080 #define IFM_CARP 0x000000c0 /* Common Address Redundancy Protocol */ d138 2 a139 2 #define IFM_NMIN IFM_ETHER /* lowest Network type */ #define IFM_NMAX IFM_NMASK /* highest Network type */ d141 2 a142 6 /* * Shared media sub-types (IFM_TMASK) */ #define IFM_AUTO 0 /* Autoselect best media */ #define IFM_MANUAL 1 /* Jumper/dipswitch selects media */ #define IFM_NONE 2 /* Deselect all media */ d144 1 a144 5 /* * Status bits (IFM_TMASK) */ #define IFM_AVALID 0x00000001 /* Active bit valid */ #define IFM_ACTIVE 0x00000002 /* Interface attached to working net */ d147 10 a156 1 * Shared (global) options (IFM_GMASK) a157 7 #define IFM_FDX 0x00100000 /* Force full duplex */ #define IFM_HDX 0x00200000 /* Force half duplex */ #define IFM_FLOW 0x00400000 /* enable hardware flow control */ #define IFM_FLAG0 0x01000000 /* Driver defined flag */ #define IFM_FLAG1 0x02000000 /* Driver defined flag */ #define IFM_FLAG2 0x04000000 /* Driver defined flag */ #define IFM_LOOP 0x08000000 /* Put hardware in loopback */ d160 1 a160 2 * 0: Generic (IFM_GENERIC). Only used for link status reporting. * No any media specific flag. d162 1 d165 1 a165 1 * 1: Ethernet (IFM_ETHER) d167 1 d192 1 a192 3 #define IFM_1000_KX 27 /* 1000base-KX backplane */ #define IFM_2500_KX 28 /* 2500base-KX backplane */ /* IFM_OMASK bits */ a196 3 /* Ethernet flow control mask */ #define IFM_ETH_FMASK (IFM_FLOW | IFM_ETH_RXPAUSE | IFM_ETH_TXPAUSE) d198 1 a198 1 * 2: Token ring (IFM_TOKEN) d200 1 a204 1 /* IFM_OMASK bits */ d210 1 a210 1 * 3: FDDI (IFM_FDDI) d212 1 d219 1 a219 1 * 4: IEEE 802.11 Wireless (IFM_IEEE80211) d221 1 a245 1 /* IFM_OMASK bits */ d254 1 a254 1 /* Operating mode (IFM_MMASK) for multi-mode devices */ d264 1 a264 2 * 6: Common Address Redundancy Protocol (IFM_CARP) * No any media specific flag. d266 72 d368 3 a424 2 { IFM_ETHER | IFM_1000_KX, "1000BASE-KX" }, \ { IFM_ETHER | IFM_1000_KX, "1000baseKX" }, \ a429 2 { IFM_ETHER | IFM_2500_KX, "2500BASE-KX" }, \ { IFM_ETHER | IFM_2500_KX, "2500baseKX" }, \ a577 7 { IFM_ETHER | IFM_1000_BX10, IF_Mbps(1000ULL) }, \ { IFM_ETHER | IFM_10G_TWINAX, IF_Gbps(10) }, \ { IFM_ETHER | IFM_10G_TWINAX_LONG, IF_Gbps(10) }, \ { IFM_ETHER | IFM_10G_LRM, IF_Gbps(10) }, \ { IFM_ETHER | IFM_10G_T, IF_Gbps(10) }, \ { IFM_ETHER | IFM_1000_KX, IF_Mbps(1000ULL) }, \ { IFM_ETHER | IFM_2500_KX, IF_Mbps(2500ULL) }, \ d644 1 a644 60 #ifdef _KERNEL /* * Driver callbacks for media status and change requests. */ typedef int (*ifm_change_cb_t)(struct ifnet *); typedef void (*ifm_stat_cb_t)(struct ifnet *, struct ifmediareq *); /* * In-kernel representation of a single supported media type. */ struct ifmedia_entry { TAILQ_ENTRY(ifmedia_entry) ifm_list; u_int ifm_media; /* description of this media attachment */ u_int ifm_data; /* for driver-specific use */ void *ifm_aux; /* for driver-specific use */ }; /* * One of these goes into a network interface's softc structure. * It is used to keep general media state. */ struct ifmedia { u_int ifm_mask; /* mask of changes we don't care about */ u_int ifm_media; /* current user-set media word */ struct ifmedia_entry *ifm_cur; /* currently selected media */ TAILQ_HEAD(, ifmedia_entry) ifm_list; /* list of all supported media */ ifm_change_cb_t ifm_change; /* media change driver callback */ ifm_stat_cb_t ifm_status; /* media status driver callback */ }; /* Initialize an interface's struct if_media field. */ void ifmedia_init(struct ifmedia *, int, ifm_change_cb_t, ifm_stat_cb_t); int ifmedia_change(struct ifmedia *, struct ifnet *); /* Add one supported medium to a struct ifmedia. */ void ifmedia_add(struct ifmedia *, int, int, void *); /* Add an array (of ifmedia_entry) media to a struct ifmedia. */ void ifmedia_list_add(struct ifmedia *, struct ifmedia_entry *, int); /* Set default media type on initialization. */ void ifmedia_set(struct ifmedia *ifm, int mword); /* Common ioctl function for getting/setting media, called by driver. */ int ifmedia_ioctl(struct ifnet *, struct ifreq *, struct ifmedia *, u_long); /* Look up a media entry. */ struct ifmedia_entry *ifmedia_match(struct ifmedia *, u_int, u_int); /* Delete all media for a given media instance */ void ifmedia_delete_instance(struct ifmedia *, u_int); /* Compute baudrate for a given media. */ uint64_t ifmedia_baudrate(int); /* Remove all media */ void ifmedia_removeall(struct ifmedia *); #else d650 4 a653 4 int get_media_mode(int, const char *); int get_media_subtype(int, const char *); int get_media_options(int, const char *, char **); int lookup_media_word(struct ifmedia_description *, int, const char *); @ 1.55 log @add MBSS. From FreeBSD. @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.54 2011/01/26 00:57:47 dyoung Exp $ */ d464 1 @ 1.55.14.1 log @Resync to 2012-11-19 00:00:00 UTC @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.56 2012/10/25 10:59:43 msaitoh Exp $ */ a463 1 { IFM_ETHER | IFM_1000_T | IFM_FDX, "1000baseT-FDX" }, \ @ 1.55.14.2 log @update from HEAD @ text @d1 1 a1 1 /* $NetBSD$ */ d83 1 a84 1 #endif /*_KERNEL */ d87 1 a87 23 * if_media Options word: * Bits Use * ---- ------- * 0-4 Media subtype MAX SUBTYPE == 31! * 5-7 Media type * 8-15 Type specific options * 16-18 Mode (for multi-mode devices) * 19 RFU (not used) * 20-27 Shared (global) options * 28-31 Instance * * 3 2 1 * 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 * +-------+---------------+-+-----+---------------+-----+---------+ * | | |R| | | | |STA| * | IMASK | GMASK |F|MMASK| OMASK |NMASK| +---| * | | |U| | | | TMASK | * +-------+---------------+-+-----+---------------+-----+---------+ * <-----> <---> <---> * IFM_INST() IFM_MODE() IFM_TYPE() * * <-------------> <-------------> <-------> * IFM_OPTIONS() IFM_SUBTYPE() d89 2 d93 1 a93 1 * Masks d95 6 a100 8 #define IFM_NMASK 0x000000e0 /* Network type */ #define IFM_TMASK 0x0000001f /* Media sub-type */ #define IFM_IMASK 0xf0000000 /* Instance */ #define IFM_ISHIFT 28 /* Instance shift */ #define IFM_OMASK 0x0000ff00 /* Type specific options */ #define IFM_MMASK 0x00070000 /* Mode */ #define IFM_MSHIFT 16 /* Mode shift */ #define IFM_GMASK 0x0ff00000 /* Global options */ d103 2 a104 1 * Macros to extract various bits of information from the media word. d106 11 a116 5 #define IFM_TYPE(x) ((x) & IFM_NMASK) #define IFM_SUBTYPE(x) ((x) & IFM_TMASK) #define IFM_INST(x) (((x) & IFM_IMASK) >> IFM_ISHIFT) #define IFM_OPTIONS(x) ((x) & (IFM_OMASK | IFM_GMASK)) #define IFM_MODE(x) ((x) & IFM_MMASK) d118 1 a118 2 #define IFM_TYPE_MATCH(dt, t) \ (IFM_TYPE((dt)) == 0 || IFM_TYPE((dt)) == IFM_TYPE((t))) d120 2 a121 2 #define IFM_INST_MAX IFM_INST(IFM_IMASK) #define IFM_INST_ANY ((u_int) -1) d123 2 a124 2 /* Mask of "status valid" bits, for ifconfig(8). */ #define IFM_STATUS_VALID IFM_AVALID d126 2 a127 5 /* List of "status valid" bits, for ifconfig(8). */ #define IFM_STATUS_VALID_LIST { \ IFM_AVALID, \ 0, \ } d129 2 a130 7 /* * Macro to create a media word. */ #define IFM_MAKEWORD(type, subtype, options, instance) \ ((type) | (subtype) | (options) | ((instance) << IFM_ISHIFT)) #define IFM_MAKEMODE(mode) \ (((mode) << IFM_MSHIFT) & IFM_MMASK) d132 2 a133 9 /* * Media type (IFM_NMASK). */ #define IFM_GENERIC 0x00000000 /* Only used for link status reporting */ #define IFM_ETHER 0x00000020 #define IFM_TOKEN 0x00000040 #define IFM_FDDI 0x00000060 #define IFM_IEEE80211 0x00000080 #define IFM_CARP 0x000000c0 /* Common Address Redundancy Protocol */ d135 2 a136 2 #define IFM_NMIN IFM_ETHER /* lowest Network type */ #define IFM_NMAX IFM_NMASK /* highest Network type */ d138 2 a139 6 /* * Shared media sub-types (IFM_TMASK) */ #define IFM_AUTO 0 /* Autoselect best media */ #define IFM_MANUAL 1 /* Jumper/dipswitch selects media */ #define IFM_NONE 2 /* Deselect all media */ d141 2 a142 5 /* * Status bits (IFM_TMASK) */ #define IFM_AVALID 0x00000001 /* Active bit valid */ #define IFM_ACTIVE 0x00000002 /* Interface attached to working net */ d144 1 a144 10 /* * Shared (global) options (IFM_GMASK) */ #define IFM_FDX 0x00100000 /* Force full duplex */ #define IFM_HDX 0x00200000 /* Force half duplex */ #define IFM_FLOW 0x00400000 /* enable hardware flow control */ #define IFM_FLAG0 0x01000000 /* Driver defined flag */ #define IFM_FLAG1 0x02000000 /* Driver defined flag */ #define IFM_FLAG2 0x04000000 /* Driver defined flag */ #define IFM_LOOP 0x08000000 /* Put hardware in loopback */ d147 10 a156 2 * 0: Generic (IFM_GENERIC). Only used for link status reporting. * No any media specific flag. d160 1 a160 1 * 1: Ethernet (IFM_ETHER) d162 1 d187 1 a187 5 #define IFM_1000_KX 27 /* 1000base-KX backplane */ #define IFM_2500_KX 28 /* 2500base-KX backplane */ #define IFM_2500_T 29 /* 2500base-T - RJ45 */ #define IFM_5000_T 30 /* 5Gbase-T - RJ45 */ /* IFM_OMASK bits */ a191 3 /* Ethernet flow control mask */ #define IFM_ETH_FMASK (IFM_FLOW | IFM_ETH_RXPAUSE | IFM_ETH_TXPAUSE) d193 1 a193 1 * 2: Token ring (IFM_TOKEN) d195 1 a199 1 /* IFM_OMASK bits */ d205 1 a205 1 * 3: FDDI (IFM_FDDI) d207 1 d214 1 a214 1 * 4: IEEE 802.11 Wireless (IFM_IEEE80211) d216 1 a240 1 /* IFM_OMASK bits */ d249 1 a249 1 /* Operating mode (IFM_MMASK) for multi-mode devices */ d259 57 a315 2 * 6: Common Address Redundancy Protocol (IFM_CARP) * No any media specific flag. d317 16 d363 3 a419 2 { IFM_ETHER | IFM_1000_KX, "1000BASE-KX" }, \ { IFM_ETHER | IFM_1000_KX, "1000baseKX" }, \ d425 15 a439 21 { IFM_ETHER | IFM_2500_KX | IFM_FDX, "2500BASE-KX" }, \ { IFM_ETHER | IFM_2500_KX | IFM_FDX, "2500baseKX" }, \ { IFM_ETHER | IFM_2500_T | IFM_FDX, "2.5GBASE-T" }, \ { IFM_ETHER | IFM_2500_T | IFM_FDX, "2500baseT" }, \ { IFM_ETHER | IFM_5000_T | IFM_FDX, "5GBASE-T" }, \ { IFM_ETHER | IFM_5000_T | IFM_FDX, "5GbaseT" }, \ { IFM_ETHER | IFM_10G_LR | IFM_FDX, "10GbaseLR" }, \ { IFM_ETHER | IFM_10G_LR | IFM_FDX, "10GLR" }, \ { IFM_ETHER | IFM_10G_LR | IFM_FDX, "10GBASE-LR" }, \ { IFM_ETHER | IFM_10G_SR | IFM_FDX, "10GbaseSR" }, \ { IFM_ETHER | IFM_10G_SR | IFM_FDX, "10GSR" }, \ { IFM_ETHER | IFM_10G_SR | IFM_FDX, "10GBASE-SR" }, \ { IFM_ETHER | IFM_10G_LRM | IFM_FDX, "10Gbase-LRM" }, \ { IFM_ETHER | IFM_10G_TWINAX | IFM_FDX, "10Gbase-Twinax" }, \ { IFM_ETHER | IFM_10G_TWINAX_LONG | IFM_FDX, "10Gbase-Twinax-Long" },\ { IFM_ETHER | IFM_10G_T | IFM_FDX, "10Gbase-T" }, \ { IFM_ETHER | IFM_10G_CX4 | IFM_FDX, "10GbaseCX4" }, \ { IFM_ETHER | IFM_10G_CX4 | IFM_FDX, "10GCX4" }, \ { IFM_ETHER | IFM_10G_CX4 | IFM_FDX, "10GBASE-CX4" }, \ { IFM_ETHER | IFM_2500_SX | IFM_FDX, "2500baseSX" }, \ { IFM_ETHER | IFM_2500_SX | IFM_FDX, "2500SX" }, \ a572 9 { IFM_ETHER | IFM_1000_BX10, IF_Mbps(1000ULL) }, \ { IFM_ETHER | IFM_10G_TWINAX, IF_Gbps(10) }, \ { IFM_ETHER | IFM_10G_TWINAX_LONG, IF_Gbps(10) }, \ { IFM_ETHER | IFM_10G_LRM, IF_Gbps(10) }, \ { IFM_ETHER | IFM_10G_T, IF_Gbps(10) }, \ { IFM_ETHER | IFM_1000_KX, IF_Mbps(1000ULL) }, \ { IFM_ETHER | IFM_2500_KX, IF_Mbps(2500ULL) }, \ { IFM_ETHER | IFM_2500_T, IF_Mbps(2500ULL) }, \ { IFM_ETHER | IFM_5000_T, IF_Mbps(5000ULL) }, \ a616 3 { IFM_GENERIC, IFM_AVALID, IFM_ACTIVE, \ { "no network", "active" } }, \ \ d636 1 a636 60 #ifdef _KERNEL /* * Driver callbacks for media status and change requests. */ typedef int (*ifm_change_cb_t)(struct ifnet *); typedef void (*ifm_stat_cb_t)(struct ifnet *, struct ifmediareq *); /* * In-kernel representation of a single supported media type. */ struct ifmedia_entry { TAILQ_ENTRY(ifmedia_entry) ifm_list; u_int ifm_media; /* description of this media attachment */ u_int ifm_data; /* for driver-specific use */ void *ifm_aux; /* for driver-specific use */ }; /* * One of these goes into a network interface's softc structure. * It is used to keep general media state. */ struct ifmedia { u_int ifm_mask; /* mask of changes we don't care about */ u_int ifm_media; /* current user-set media word */ struct ifmedia_entry *ifm_cur; /* currently selected media */ TAILQ_HEAD(, ifmedia_entry) ifm_list; /* list of all supported media */ ifm_change_cb_t ifm_change; /* media change driver callback */ ifm_stat_cb_t ifm_status; /* media status driver callback */ }; /* Initialize an interface's struct if_media field. */ void ifmedia_init(struct ifmedia *, int, ifm_change_cb_t, ifm_stat_cb_t); int ifmedia_change(struct ifmedia *, struct ifnet *); /* Add one supported medium to a struct ifmedia. */ void ifmedia_add(struct ifmedia *, int, int, void *); /* Add an array (of ifmedia_entry) media to a struct ifmedia. */ void ifmedia_list_add(struct ifmedia *, struct ifmedia_entry *, int); /* Set default media type on initialization. */ void ifmedia_set(struct ifmedia *ifm, int mword); /* Common ioctl function for getting/setting media, called by driver. */ int ifmedia_ioctl(struct ifnet *, struct ifreq *, struct ifmedia *, u_long); /* Look up a media entry. */ struct ifmedia_entry *ifmedia_match(struct ifmedia *, u_int, u_int); /* Delete all media for a given media instance */ void ifmedia_delete_instance(struct ifmedia *, u_int); /* Compute baudrate for a given media. */ uint64_t ifmedia_baudrate(int); /* Remove all media */ void ifmedia_removeall(struct ifmedia *); #else d642 4 a645 4 int get_media_mode(int, const char *); int get_media_subtype(int, const char *); int get_media_options(int, const char *, char **); int lookup_media_word(struct ifmedia_description *, int, const char *); @ 1.55.4.1 log @sync with head @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.55 2011/02/20 13:51:17 cegger Exp $ */ a463 1 { IFM_ETHER | IFM_1000_T | IFM_FDX, "1000baseT-FDX" }, \ @ 1.54 log @Add some 10-gigabit media words used by Intel 82599. @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.53 2009/10/05 21:27:36 dyoung Exp $ */ d247 1 d539 1 @ 1.53 log @Replace u_quad_t with uint64_t. u_quad_t is just a typedef for uint64_t, so no ABI/API breakage will result from this change. @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.52 2009/08/12 11:17:17 msaitoh Exp $ */ d183 4 d430 4 @ 1.53.6.1 log @Sync with HEAD. @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.55 2011/02/20 13:51:17 cegger Exp $ */ a182 4 #define IFM_10G_TWINAX 23 /* 10GBase Twinax copper */ #define IFM_10G_TWINAX_LONG 24 /* 10GBase Twinax Long copper */ #define IFM_10G_LRM 25 /* 10GBase-LRM 850nm Multi-mode */ #define IFM_10G_T 26 /* 10GBase-T - RJ45 */ a242 1 #define IFM_IEEE80211_MBSS 0x00004000 /* Operate in MBSS mode */ a425 4 { IFM_ETHER | IFM_10G_LRM, "10Gbase-LRM" }, \ { IFM_ETHER | IFM_10G_TWINAX, "10Gbase-Twinax" }, \ { IFM_ETHER | IFM_10G_TWINAX_LONG, "10Gbase-Twinax-Long" },\ { IFM_ETHER | IFM_10G_T, "10Gbase-T" }, \ a529 1 { IFM_IEEE80211 | IFM_IEEE80211_MBSS, "mesh" }, \ @ 1.53.4.1 log @sync with head @ text @d1 1 a1 1 /* $NetBSD$ */ a182 4 #define IFM_10G_TWINAX 23 /* 10GBase Twinax copper */ #define IFM_10G_TWINAX_LONG 24 /* 10GBase Twinax Long copper */ #define IFM_10G_LRM 25 /* 10GBase-LRM 850nm Multi-mode */ #define IFM_10G_T 26 /* 10GBase-T - RJ45 */ a242 1 #define IFM_IEEE80211_MBSS 0x00004000 /* Operate in MBSS mode */ a425 4 { IFM_ETHER | IFM_10G_LRM, "10Gbase-LRM" }, \ { IFM_ETHER | IFM_10G_TWINAX, "10Gbase-Twinax" }, \ { IFM_ETHER | IFM_10G_TWINAX_LONG, "10Gbase-Twinax-Long" },\ { IFM_ETHER | IFM_10G_T, "10Gbase-T" }, \ a529 1 { IFM_IEEE80211 | IFM_IEEE80211_MBSS, "mesh" }, \ @ 1.53.8.1 log @Sync with HEAD @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.54 2011/01/26 00:57:47 dyoung Exp $ */ a182 4 #define IFM_10G_TWINAX 23 /* 10GBase Twinax copper */ #define IFM_10G_TWINAX_LONG 24 /* 10GBase Twinax Long copper */ #define IFM_10G_LRM 25 /* 10GBase-LRM 850nm Multi-mode */ #define IFM_10G_T 26 /* 10GBase-T - RJ45 */ a425 4 { IFM_ETHER | IFM_10G_LRM, "10Gbase-LRM" }, \ { IFM_ETHER | IFM_10G_TWINAX, "10Gbase-Twinax" }, \ { IFM_ETHER | IFM_10G_TWINAX_LONG, "10Gbase-Twinax-Long" },\ { IFM_ETHER | IFM_10G_T, "10Gbase-T" }, \ @ 1.53.8.2 log @Sync with HEAD @ text @d1 1 a1 1 /* $NetBSD$ */ a246 1 #define IFM_IEEE80211_MBSS 0x00004000 /* Operate in MBSS mode */ a537 1 { IFM_IEEE80211 | IFM_IEEE80211_MBSS, "mesh" }, \ @ 1.52 log @Add 1000BASE-BX10. @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.51 2008/09/09 20:12:18 mhitch Exp $ */ d139 1 a139 1 u_quad_t ifmedia_baudrate(int); d539 1 a539 1 u_quad_t ifmb_baudrate; /* corresponding baudrate */ @ 1.51 log @Add support for SerDes controllers; from the OpenBSD driver. Tested on a Dell Blade server by me, and an HP Blade server by Havard. @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.50 2008/06/15 16:33:58 christos Exp $ */ d182 1 d414 1 @ 1.50 log @- Add more definitions from FreeBSD - Add ifmedia_removeall from FreeBSD @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.49 2008/04/28 20:24:09 martin Exp $ */ d181 1 d427 2 d559 1 @ 1.50.2.1 log @Sync with HEAD. @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.51 2008/09/09 20:12:18 mhitch Exp $ */ a180 1 #define IFM_2500_SX 21 /* 2500baseSX - multi-mode fiber */ a425 2 { IFM_ETHER | IFM_2500_SX, "2500baseSX" }, \ { IFM_ETHER | IFM_2500_SX, "2500SX" }, \ a555 1 { IFM_ETHER | IFM_2500_SX, IF_Mbps(2500ULL) }, \ @ 1.49 log @Remove clause 3 and 4 from TNF licenses @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.48 2008/02/13 09:25:24 skrll Exp $ */ d141 3 d162 1 a162 1 #define IFM_ETHER 0x00000020 d204 2 a205 2 #define IFM_FDDI_UTP 5 /* CDDI / UTP */ #define IFM_FDDI_DA 0x00000100 /* Dual attach / single attach */ d227 14 a240 5 #define IFM_IEEE80211_ADHOC 0x00000100 /* Operate in Adhoc mode */ #define IFM_IEEE80211_HOSTAP 0x00000200 /* Operate in Host AP mode */ #define IFM_IEEE80211_MONITOR 0x00000400 /* Operate in Monitor mode */ #define IFM_IEEE80211_TURBO 0x00000800 /* Operate in Turbo mode */ d247 3 d266 1 a266 1 #define IFM_FDX 0x00100000 /* Force full duplex */ d269 3 a271 3 #define IFM_FLAG0 0x01000000 /* Driver defined flag */ #define IFM_FLAG1 0x02000000 /* Driver defined flag */ #define IFM_FLAG2 0x04000000 /* Driver defined flag */ d470 5 d486 2 a519 1 { IFM_IEEE80211 | IFM_IEEE80211_ADHOC, "ibss" }, \ d523 2 @ 1.49.2.1 log @Sync w/ -current. 34 merge conflicts to follow. @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.49 2008/04/28 20:24:09 martin Exp $ */ a140 3 /* Remove all media */ void ifmedia_removeall(struct ifmedia *); d159 1 a159 1 #define IFM_ETHER 0x00000020 d201 2 a202 2 #define IFM_FDDI_UTP 5 /* CDDI / UTP */ #define IFM_FDDI_DA 0x00000100 /* Dual attach / single attach */ d224 5 a228 14 #define IFM_IEEE80211_DS354k 19 /* Direct Sequence 354Kbps */ #define IFM_IEEE80211_DS512k 20 /* Direct Sequence 512Kbps */ #define IFM_IEEE80211_OFDM3 21 /* OFDM 3Mbps */ #define IFM_IEEE80211_OFDM4 22 /* OFDM 4.5Mbps */ #define IFM_IEEE80211_OFDM27 23 /* OFDM 27Mbps */ /* NB: not enough bits to express MCS fully */ #define IFM_IEEE80211_MCS 24 /* HT MCS rate */ #define IFM_IEEE80211_ADHOC 0x00000100 /* Operate in Adhoc mode */ #define IFM_IEEE80211_HOSTAP 0x00000200 /* Operate in Host AP mode */ #define IFM_IEEE80211_MONITOR 0x00000400 /* Operate in Monitor mode */ #define IFM_IEEE80211_TURBO 0x00000800 /* Operate in Turbo mode */ #define IFM_IEEE80211_IBSS 0x00001000 /* Operate in IBSS mode */ #define IFM_IEEE80211_WDS 0x00002000 /* Operate as an WDS master */ a234 3 #define IFM_IEEE80211_11NA 0x00050000 /* 5Ghz, HT mode */ #define IFM_IEEE80211_11NG 0x00060000 /* 2Ghz, HT mode */ d251 1 a251 1 #define IFM_FDX 0x00100000 /* Force full duplex */ d254 3 a256 3 #define IFM_FLAG0 0x01000000 /* Driver defined flag */ #define IFM_FLAG1 0x02000000 /* Driver defined flag */ #define IFM_FLAG2 0x04000000 /* Driver defined flag */ a454 5 { IFM_IEEE80211 | IFM_IEEE80211_DS354k, "DS/354Kbps" }, \ { IFM_IEEE80211 | IFM_IEEE80211_DS512k, "DS/512Kbps" }, \ { IFM_IEEE80211 | IFM_IEEE80211_OFDM3, "OFDM/3Mbps" }, \ { IFM_IEEE80211 | IFM_IEEE80211_OFDM4, "OFDM/4.5Mbps" }, \ { IFM_IEEE80211 | IFM_IEEE80211_OFDM27, "OFDM/27Mbps" }, \ a465 2 { IFM_IEEE80211 | IFM_IEEE80211_11NA, "11na" }, \ { IFM_IEEE80211 | IFM_IEEE80211_11NG, "11ng" }, \ d498 1 a501 2 { IFM_IEEE80211 | IFM_IEEE80211_IBSS, "ibss" }, \ { IFM_IEEE80211 | IFM_IEEE80211_WDS, "wds" }, \ @ 1.49.2.2 log @Merge in changes between wrstuden-revivesa-base-2 and wrstuden-revivesa-base-3. @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.49.2.1 2008/06/23 04:31:58 wrstuden Exp $ */ a180 1 #define IFM_2500_SX 21 /* 2500baseSX - multi-mode fiber */ a425 2 { IFM_ETHER | IFM_2500_SX, "2500baseSX" }, \ { IFM_ETHER | IFM_2500_SX, "2500SX" }, \ a555 1 { IFM_ETHER | IFM_2500_SX, IF_Mbps(2500ULL) }, \ @ 1.49.4.1 log @Sync with head. @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.50 2008/06/15 16:33:58 christos Exp $ */ a140 3 /* Remove all media */ void ifmedia_removeall(struct ifmedia *); d159 1 a159 1 #define IFM_ETHER 0x00000020 d201 2 a202 2 #define IFM_FDDI_UTP 5 /* CDDI / UTP */ #define IFM_FDDI_DA 0x00000100 /* Dual attach / single attach */ d224 5 a228 14 #define IFM_IEEE80211_DS354k 19 /* Direct Sequence 354Kbps */ #define IFM_IEEE80211_DS512k 20 /* Direct Sequence 512Kbps */ #define IFM_IEEE80211_OFDM3 21 /* OFDM 3Mbps */ #define IFM_IEEE80211_OFDM4 22 /* OFDM 4.5Mbps */ #define IFM_IEEE80211_OFDM27 23 /* OFDM 27Mbps */ /* NB: not enough bits to express MCS fully */ #define IFM_IEEE80211_MCS 24 /* HT MCS rate */ #define IFM_IEEE80211_ADHOC 0x00000100 /* Operate in Adhoc mode */ #define IFM_IEEE80211_HOSTAP 0x00000200 /* Operate in Host AP mode */ #define IFM_IEEE80211_MONITOR 0x00000400 /* Operate in Monitor mode */ #define IFM_IEEE80211_TURBO 0x00000800 /* Operate in Turbo mode */ #define IFM_IEEE80211_IBSS 0x00001000 /* Operate in IBSS mode */ #define IFM_IEEE80211_WDS 0x00002000 /* Operate as an WDS master */ a234 3 #define IFM_IEEE80211_11NA 0x00050000 /* 5Ghz, HT mode */ #define IFM_IEEE80211_11NG 0x00060000 /* 2Ghz, HT mode */ d251 1 a251 1 #define IFM_FDX 0x00100000 /* Force full duplex */ d254 3 a256 3 #define IFM_FLAG0 0x01000000 /* Driver defined flag */ #define IFM_FLAG1 0x02000000 /* Driver defined flag */ #define IFM_FLAG2 0x04000000 /* Driver defined flag */ a454 5 { IFM_IEEE80211 | IFM_IEEE80211_DS354k, "DS/354Kbps" }, \ { IFM_IEEE80211 | IFM_IEEE80211_DS512k, "DS/512Kbps" }, \ { IFM_IEEE80211 | IFM_IEEE80211_OFDM3, "OFDM/3Mbps" }, \ { IFM_IEEE80211 | IFM_IEEE80211_OFDM4, "OFDM/4.5Mbps" }, \ { IFM_IEEE80211 | IFM_IEEE80211_OFDM27, "OFDM/27Mbps" }, \ a465 2 { IFM_IEEE80211 | IFM_IEEE80211_11NA, "11na" }, \ { IFM_IEEE80211 | IFM_IEEE80211_11NG, "11ng" }, \ d498 1 a501 2 { IFM_IEEE80211 | IFM_IEEE80211_IBSS, "ibss" }, \ { IFM_IEEE80211 | IFM_IEEE80211_WDS, "wds" }, \ @ 1.48 log @CARP is Common *Address* Redundancy Protocol @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.47 2008/01/10 08:00:22 dyoung Exp $ */ a18 7 * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the NetBSD * Foundation, Inc. and its contributors. * 4. Neither the name of The NetBSD Foundation nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. @ 1.48.6.1 log @Sync with HEAD. @ text @d1 1 a1 1 /* $NetBSD$ */ d19 7 @ 1.48.6.2 log @Sync with HEAD. @ text @a140 3 /* Remove all media */ void ifmedia_removeall(struct ifmedia *); d159 1 a159 1 #define IFM_ETHER 0x00000020 d201 2 a202 2 #define IFM_FDDI_UTP 5 /* CDDI / UTP */ #define IFM_FDDI_DA 0x00000100 /* Dual attach / single attach */ d224 5 a228 14 #define IFM_IEEE80211_DS354k 19 /* Direct Sequence 354Kbps */ #define IFM_IEEE80211_DS512k 20 /* Direct Sequence 512Kbps */ #define IFM_IEEE80211_OFDM3 21 /* OFDM 3Mbps */ #define IFM_IEEE80211_OFDM4 22 /* OFDM 4.5Mbps */ #define IFM_IEEE80211_OFDM27 23 /* OFDM 27Mbps */ /* NB: not enough bits to express MCS fully */ #define IFM_IEEE80211_MCS 24 /* HT MCS rate */ #define IFM_IEEE80211_ADHOC 0x00000100 /* Operate in Adhoc mode */ #define IFM_IEEE80211_HOSTAP 0x00000200 /* Operate in Host AP mode */ #define IFM_IEEE80211_MONITOR 0x00000400 /* Operate in Monitor mode */ #define IFM_IEEE80211_TURBO 0x00000800 /* Operate in Turbo mode */ #define IFM_IEEE80211_IBSS 0x00001000 /* Operate in IBSS mode */ #define IFM_IEEE80211_WDS 0x00002000 /* Operate as an WDS master */ a234 3 #define IFM_IEEE80211_11NA 0x00050000 /* 5Ghz, HT mode */ #define IFM_IEEE80211_11NG 0x00060000 /* 2Ghz, HT mode */ d251 1 a251 1 #define IFM_FDX 0x00100000 /* Force full duplex */ d254 3 a256 3 #define IFM_FLAG0 0x01000000 /* Driver defined flag */ #define IFM_FLAG1 0x02000000 /* Driver defined flag */ #define IFM_FLAG2 0x04000000 /* Driver defined flag */ a454 5 { IFM_IEEE80211 | IFM_IEEE80211_DS354k, "DS/354Kbps" }, \ { IFM_IEEE80211 | IFM_IEEE80211_DS512k, "DS/512Kbps" }, \ { IFM_IEEE80211 | IFM_IEEE80211_OFDM3, "OFDM/3Mbps" }, \ { IFM_IEEE80211 | IFM_IEEE80211_OFDM4, "OFDM/4.5Mbps" }, \ { IFM_IEEE80211 | IFM_IEEE80211_OFDM27, "OFDM/27Mbps" }, \ a465 2 { IFM_IEEE80211 | IFM_IEEE80211_11NA, "11na" }, \ { IFM_IEEE80211 | IFM_IEEE80211_11NG, "11ng" }, \ d498 1 a501 2 { IFM_IEEE80211 | IFM_IEEE80211_IBSS, "ibss" }, \ { IFM_IEEE80211 | IFM_IEEE80211_WDS, "wds" }, \ @ 1.48.6.3 log @Sync with HEAD. @ text @a180 1 #define IFM_2500_SX 21 /* 2500baseSX - multi-mode fiber */ a425 2 { IFM_ETHER | IFM_2500_SX, "2500baseSX" }, \ { IFM_ETHER | IFM_2500_SX, "2500SX" }, \ a555 1 { IFM_ETHER | IFM_2500_SX, IF_Mbps(2500ULL) }, \ @ 1.48.8.1 log @sync with head. @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.48 2008/02/13 09:25:24 skrll Exp $ */ d19 7 @ 1.48.8.2 log @sync with head. @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.48.8.1 2008/05/18 12:35:27 yamt Exp $ */ a140 3 /* Remove all media */ void ifmedia_removeall(struct ifmedia *); d159 1 a159 1 #define IFM_ETHER 0x00000020 d201 2 a202 2 #define IFM_FDDI_UTP 5 /* CDDI / UTP */ #define IFM_FDDI_DA 0x00000100 /* Dual attach / single attach */ d224 5 a228 14 #define IFM_IEEE80211_DS354k 19 /* Direct Sequence 354Kbps */ #define IFM_IEEE80211_DS512k 20 /* Direct Sequence 512Kbps */ #define IFM_IEEE80211_OFDM3 21 /* OFDM 3Mbps */ #define IFM_IEEE80211_OFDM4 22 /* OFDM 4.5Mbps */ #define IFM_IEEE80211_OFDM27 23 /* OFDM 27Mbps */ /* NB: not enough bits to express MCS fully */ #define IFM_IEEE80211_MCS 24 /* HT MCS rate */ #define IFM_IEEE80211_ADHOC 0x00000100 /* Operate in Adhoc mode */ #define IFM_IEEE80211_HOSTAP 0x00000200 /* Operate in Host AP mode */ #define IFM_IEEE80211_MONITOR 0x00000400 /* Operate in Monitor mode */ #define IFM_IEEE80211_TURBO 0x00000800 /* Operate in Turbo mode */ #define IFM_IEEE80211_IBSS 0x00001000 /* Operate in IBSS mode */ #define IFM_IEEE80211_WDS 0x00002000 /* Operate as an WDS master */ a234 3 #define IFM_IEEE80211_11NA 0x00050000 /* 5Ghz, HT mode */ #define IFM_IEEE80211_11NG 0x00060000 /* 2Ghz, HT mode */ d251 1 a251 1 #define IFM_FDX 0x00100000 /* Force full duplex */ d254 3 a256 3 #define IFM_FLAG0 0x01000000 /* Driver defined flag */ #define IFM_FLAG1 0x02000000 /* Driver defined flag */ #define IFM_FLAG2 0x04000000 /* Driver defined flag */ a454 5 { IFM_IEEE80211 | IFM_IEEE80211_DS354k, "DS/354Kbps" }, \ { IFM_IEEE80211 | IFM_IEEE80211_DS512k, "DS/512Kbps" }, \ { IFM_IEEE80211 | IFM_IEEE80211_OFDM3, "OFDM/3Mbps" }, \ { IFM_IEEE80211 | IFM_IEEE80211_OFDM4, "OFDM/4.5Mbps" }, \ { IFM_IEEE80211 | IFM_IEEE80211_OFDM27, "OFDM/27Mbps" }, \ a465 2 { IFM_IEEE80211 | IFM_IEEE80211_11NA, "11na" }, \ { IFM_IEEE80211 | IFM_IEEE80211_11NG, "11ng" }, \ d498 1 a501 2 { IFM_IEEE80211 | IFM_IEEE80211_IBSS, "ibss" }, \ { IFM_IEEE80211 | IFM_IEEE80211_WDS, "wds" }, \ @ 1.48.10.1 log @sync with head. @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.48 2008/02/13 09:25:24 skrll Exp $ */ d19 7 @ 1.48.10.2 log @sync with head. @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.48.10.1 2008/05/16 02:25:40 yamt Exp $ */ a140 3 /* Remove all media */ void ifmedia_removeall(struct ifmedia *); d159 1 a159 1 #define IFM_ETHER 0x00000020 a177 1 #define IFM_2500_SX 21 /* 2500baseSX - multi-mode fiber */ d201 2 a202 2 #define IFM_FDDI_UTP 5 /* CDDI / UTP */ #define IFM_FDDI_DA 0x00000100 /* Dual attach / single attach */ d224 5 a228 14 #define IFM_IEEE80211_DS354k 19 /* Direct Sequence 354Kbps */ #define IFM_IEEE80211_DS512k 20 /* Direct Sequence 512Kbps */ #define IFM_IEEE80211_OFDM3 21 /* OFDM 3Mbps */ #define IFM_IEEE80211_OFDM4 22 /* OFDM 4.5Mbps */ #define IFM_IEEE80211_OFDM27 23 /* OFDM 27Mbps */ /* NB: not enough bits to express MCS fully */ #define IFM_IEEE80211_MCS 24 /* HT MCS rate */ #define IFM_IEEE80211_ADHOC 0x00000100 /* Operate in Adhoc mode */ #define IFM_IEEE80211_HOSTAP 0x00000200 /* Operate in Host AP mode */ #define IFM_IEEE80211_MONITOR 0x00000400 /* Operate in Monitor mode */ #define IFM_IEEE80211_TURBO 0x00000800 /* Operate in Turbo mode */ #define IFM_IEEE80211_IBSS 0x00001000 /* Operate in IBSS mode */ #define IFM_IEEE80211_WDS 0x00002000 /* Operate as an WDS master */ a234 3 #define IFM_IEEE80211_11NA 0x00050000 /* 5Ghz, HT mode */ #define IFM_IEEE80211_11NG 0x00060000 /* 2Ghz, HT mode */ d251 1 a251 1 #define IFM_FDX 0x00100000 /* Force full duplex */ d254 3 a256 3 #define IFM_FLAG0 0x01000000 /* Driver defined flag */ #define IFM_FLAG1 0x02000000 /* Driver defined flag */ #define IFM_FLAG2 0x04000000 /* Driver defined flag */ a410 2 { IFM_ETHER | IFM_2500_SX, "2500baseSX" }, \ { IFM_ETHER | IFM_2500_SX, "2500SX" }, \ a454 5 { IFM_IEEE80211 | IFM_IEEE80211_DS354k, "DS/354Kbps" }, \ { IFM_IEEE80211 | IFM_IEEE80211_DS512k, "DS/512Kbps" }, \ { IFM_IEEE80211 | IFM_IEEE80211_OFDM3, "OFDM/3Mbps" }, \ { IFM_IEEE80211 | IFM_IEEE80211_OFDM4, "OFDM/4.5Mbps" }, \ { IFM_IEEE80211 | IFM_IEEE80211_OFDM27, "OFDM/27Mbps" }, \ a465 2 { IFM_IEEE80211 | IFM_IEEE80211_11NA, "11na" }, \ { IFM_IEEE80211 | IFM_IEEE80211_11NG, "11ng" }, \ d498 1 a501 2 { IFM_IEEE80211 | IFM_IEEE80211_IBSS, "ibss" }, \ { IFM_IEEE80211 | IFM_IEEE80211_WDS, "wds" }, \ a532 1 { IFM_ETHER | IFM_2500_SX, IF_Mbps(2500ULL) }, \ @ 1.48.10.3 log @sync with head. @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.48.10.2 2009/05/04 08:14:15 yamt Exp $ */ a181 1 #define IFM_1000_BX10 22 /* 1000base-BX10 */ a412 1 { IFM_ETHER | IFM_1000_BX10, "1000BASE-BX10" }, \ @ 1.48.10.4 log @sync with head @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.48.10.3 2009/08/19 18:48:23 yamt Exp $ */ d139 1 a139 1 uint64_t ifmedia_baudrate(int); d539 1 a539 1 uint64_t ifmb_baudrate; /* corresponding baudrate */ @ 1.48.4.1 log @Merge from FreeBSD. @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.46 2006/06/03 12:43:28 ragge Exp $ */ a214 1 /* NB: 0,1,2 are auto, manual, none defined below */ d217 4 a220 4 #define IFM_IEEE80211_DS1 5 /* Direct Sequence 1Mbps */ #define IFM_IEEE80211_DS2 6 /* Direct Sequence 2Mbps */ #define IFM_IEEE80211_DS5 7 /* Direct Sequence 5.5Mbps */ #define IFM_IEEE80211_DS11 8 /* Direct Sequence 11Mbps */ a230 7 #define IFM_IEEE80211_DS354k 19 /* Direct Sequence 354Kbps */ #define IFM_IEEE80211_DS512k 20 /* Direct Sequence 512Kbps */ #define IFM_IEEE80211_OFDM3 21 /* OFDM 3Mbps */ #define IFM_IEEE80211_OFDM4 22 /* OFDM 4.5Mbps */ #define IFM_IEEE80211_OFDM27 23 /* OFDM 27Mbps */ /* NB: not enough bits to express MCS fully */ #define IFM_IEEE80211_MCS 24 /* HT MCS rate */ d234 2 a235 4 #define IFM_IEEE80211_IBSS 0x00000400 /* Operate in IBSS mode */ #define IFM_IEEE80211_IBSSMASTER 0x00000800 /* Operate as an IBSS master */ #define IFM_IEEE80211_TURBO 0x00001000 /* Operate in turbo mode */ #define IFM_IEEE80211_MONITOR 0x00002000 /* Operate in monitor mode */ d238 1 a238 1 #define IFM_IEEE80211_11A 0x00010000 /* 5Ghz, OFDM mode */ d240 2 a241 4 #define IFM_IEEE80211_11G 0x00030000 /* 2Ghz, CCK mode */ #define IFM_IEEE80211_FH 0x00040000 /* 2Ghz, GFSK mode */ #define IFM_IEEE80211_11NA 0x00050000 /* 5Ghz, HT mode */ #define IFM_IEEE80211_11NG 0x00060000 /* 2Ghz, HT mode */ @ 1.47 log @Add a helper subroutine for ethernet drivers, ifmedia_change(). @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.46 2006/06/03 12:43:28 ragge Exp $ */ d244 1 a244 1 * Common Access Redundancy Protocol @ 1.46 log @Add IFM_10G_SR and IFM_10G_CX4, to keep in sync with FreeBSD. Kindly requested by Gleb Smirnoff at FreeBSD. @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.45 2006/05/18 09:05:51 liamjfoy Exp $ */ d125 2 @ 1.46.32.1 log @sync with HEAD @ text @d1 1 a1 1 /* if_media.h,v 1.46 2006/06/03 12:43:28 ragge Exp */ a124 2 int ifmedia_change(struct ifmedia *, struct ifnet *); d242 1 a242 1 * Common Address Redundancy Protocol @ 1.46.38.1 log @Sync with HEAD. @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.48 2008/02/13 09:25:24 skrll Exp $ */ a124 2 int ifmedia_change(struct ifmedia *, struct ifnet *); d242 1 a242 1 * Common Address Redundancy Protocol @ 1.46.46.1 log @Sync with HEAD @ text @d1 1 a1 1 /* $NetBSD$ */ a124 2 int ifmedia_change(struct ifmedia *, struct ifnet *); @ 1.45 log @Integrate Common Address Redundancy Procotol (CARP) from OpenBSD 'pseudo-device carp' Thanks to: joerg@@ christos@@ riz@@ and others who tested Ok: core@@ @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.44 2006/03/08 23:46:27 lukem Exp $ */ d181 2 d410 6 d536 2 @ 1.45.2.1 log @Sync with head. @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.46 2006/06/03 12:43:28 ragge Exp $ */ a180 2 #define IFM_10G_SR 19 /* 10GBase-SR 850nm Multi-mode */ #define IFM_10G_CX4 20 /* 10GBase CX4 copper */ a407 6 { IFM_ETHER | IFM_10G_SR, "10GbaseSR" }, \ { IFM_ETHER | IFM_10G_SR, "10GSR" }, \ { IFM_ETHER | IFM_10G_SR, "10GBASE-SR" }, \ { IFM_ETHER | IFM_10G_CX4, "10GbaseCX4" }, \ { IFM_ETHER | IFM_10G_CX4, "10GCX4" }, \ { IFM_ETHER | IFM_10G_CX4, "10GBASE-CX4" }, \ a527 2 { IFM_ETHER | IFM_10G_SR, IF_Gbps(10ULL) }, \ { IFM_ETHER | IFM_10G_CX4, IF_Gbps(10ULL) }, \ @ 1.44 log @Use the SI capitalization for "Hz", "kHz", and "MHz" in comments and strings. Add a space between numbers and Hz unit. @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.43 2005/12/10 23:21:38 elad Exp $ */ d240 5 d340 1 d584 3 @ 1.44.2.1 log @Merge 2006-05-24 NetBSD-current into the "peter-altq" branch. @ text @d1 1 a1 1 /* $NetBSD$ */ a239 5 * Common Access Redundancy Protocol */ #define IFM_CARP 0x000000c0 /* a334 1 { IFM_CARP, "CARP" }, \ a577 3 { IFM_CARP, IFM_AVALID, IFM_ACTIVE, \ { "backup", "master" } }, \ \ @ 1.43 log @Multiple inclusion protection, as suggested by christos@@ on tech-kern@@ few days ago. @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.42 2004/11/11 20:34:30 dsl Exp $ */ d234 1 a234 1 #define IFM_IEEE80211_11A 0x00010000 /* 5Ghz, OFDM mode */ d236 2 a237 2 #define IFM_IEEE80211_11G 0x00030000 /* 2Ghz, CCK mode */ #define IFM_IEEE80211_FH 0x00040000 /* 2Ghz, GFSK mode */ @ 1.43.4.1 log @sync with head @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.46 2006/06/03 12:43:28 ragge Exp $ */ a180 2 #define IFM_10G_SR 19 /* 10GBase-SR 850nm Multi-mode */ #define IFM_10G_CX4 20 /* 10GBase CX4 copper */ d234 1 a234 1 #define IFM_IEEE80211_11A 0x00010000 /* 5 GHz, OFDM mode */ d236 2 a237 7 #define IFM_IEEE80211_11G 0x00030000 /* 2 GHz, CCK mode */ #define IFM_IEEE80211_FH 0x00040000 /* 2 GHz, GFSK mode */ /* * Common Access Redundancy Protocol */ #define IFM_CARP 0x000000c0 a334 1 { IFM_CARP, "CARP" }, \ a401 6 { IFM_ETHER | IFM_10G_SR, "10GbaseSR" }, \ { IFM_ETHER | IFM_10G_SR, "10GSR" }, \ { IFM_ETHER | IFM_10G_SR, "10GBASE-SR" }, \ { IFM_ETHER | IFM_10G_CX4, "10GbaseCX4" }, \ { IFM_ETHER | IFM_10G_CX4, "10GCX4" }, \ { IFM_ETHER | IFM_10G_CX4, "10GBASE-CX4" }, \ a521 2 { IFM_ETHER | IFM_10G_SR, IF_Gbps(10ULL) }, \ { IFM_ETHER | IFM_10G_CX4, IF_Gbps(10ULL) }, \ a577 3 { IFM_CARP, IFM_AVALID, IFM_ACTIVE, \ { "backup", "master" } }, \ \ @ 1.43.6.1 log @Sync with head. @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.44 2006/03/08 23:46:27 lukem Exp $ */ d234 1 a234 1 #define IFM_IEEE80211_11A 0x00010000 /* 5 GHz, OFDM mode */ d236 2 a237 2 #define IFM_IEEE80211_11G 0x00030000 /* 2 GHz, CCK mode */ #define IFM_IEEE80211_FH 0x00040000 /* 2 GHz, GFSK mode */ @ 1.43.6.2 log @Sync with head. @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.43.6.1 2006/04/22 11:40:06 simonb Exp $ */ a239 5 * Common Access Redundancy Protocol */ #define IFM_CARP 0x000000c0 /* a334 1 { IFM_CARP, "CARP" }, \ a577 3 { IFM_CARP, IFM_AVALID, IFM_ACTIVE, \ { "backup", "master" } }, \ \ @ 1.43.6.3 log @Sync with head. @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.43.6.2 2006/06/01 22:38:37 kardel Exp $ */ a180 2 #define IFM_10G_SR 19 /* 10GBase-SR 850nm Multi-mode */ #define IFM_10G_CX4 20 /* 10GBase CX4 copper */ a407 6 { IFM_ETHER | IFM_10G_SR, "10GbaseSR" }, \ { IFM_ETHER | IFM_10G_SR, "10GSR" }, \ { IFM_ETHER | IFM_10G_SR, "10GBASE-SR" }, \ { IFM_ETHER | IFM_10G_CX4, "10GbaseCX4" }, \ { IFM_ETHER | IFM_10G_CX4, "10GCX4" }, \ { IFM_ETHER | IFM_10G_CX4, "10GBASE-CX4" }, \ a527 2 { IFM_ETHER | IFM_10G_SR, IF_Gbps(10ULL) }, \ { IFM_ETHER | IFM_10G_CX4, IF_Gbps(10ULL) }, \ @ 1.43.10.1 log @sync with head. @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.44 2006/03/08 23:46:27 lukem Exp $ */ d234 1 a234 1 #define IFM_IEEE80211_11A 0x00010000 /* 5 GHz, OFDM mode */ d236 2 a237 2 #define IFM_IEEE80211_11G 0x00030000 /* 2 GHz, CCK mode */ #define IFM_IEEE80211_FH 0x00040000 /* 2 GHz, GFSK mode */ @ 1.43.8.1 log @sync with head. @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.43 2005/12/10 23:21:38 elad Exp $ */ d234 1 a234 1 #define IFM_IEEE80211_11A 0x00010000 /* 5 GHz, OFDM mode */ d236 2 a237 2 #define IFM_IEEE80211_11G 0x00030000 /* 2 GHz, CCK mode */ #define IFM_IEEE80211_FH 0x00040000 /* 2 GHz, GFSK mode */ @ 1.43.8.2 log @sync with head. @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.43.8.1 2006/03/13 09:07:39 yamt Exp $ */ a239 5 * Common Access Redundancy Protocol */ #define IFM_CARP 0x000000c0 /* a334 1 { IFM_CARP, "CARP" }, \ a577 3 { IFM_CARP, IFM_AVALID, IFM_ACTIVE, \ { "backup", "master" } }, \ \ @ 1.43.8.3 log @sync with head. @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.43.8.2 2006/05/24 10:58:56 yamt Exp $ */ a180 2 #define IFM_10G_SR 19 /* 10GBase-SR 850nm Multi-mode */ #define IFM_10G_CX4 20 /* 10GBase CX4 copper */ a407 6 { IFM_ETHER | IFM_10G_SR, "10GbaseSR" }, \ { IFM_ETHER | IFM_10G_SR, "10GSR" }, \ { IFM_ETHER | IFM_10G_SR, "10GBASE-SR" }, \ { IFM_ETHER | IFM_10G_CX4, "10GbaseCX4" }, \ { IFM_ETHER | IFM_10G_CX4, "10GCX4" }, \ { IFM_ETHER | IFM_10G_CX4, "10GBASE-CX4" }, \ a527 2 { IFM_ETHER | IFM_10G_SR, IF_Gbps(10ULL) }, \ { IFM_ETHER | IFM_10G_CX4, IF_Gbps(10ULL) }, \ @ 1.42 log @Add prototypes for functions that convert media to/from strings. In libutil/if_media.c (moved from ifconfig.c so that they can be shared in crunched binaries) @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.41 2004/10/16 11:11:04 dsl Exp $ */ d594 1 a594 1 #endif /* _NET_IF_MEDIA_H_ */ @ 1.42.12.1 log @sync with head. @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.42 2004/11/11 20:34:30 dsl Exp $ */ a180 2 #define IFM_10G_SR 19 /* 10GBase-SR 850nm Multi-mode */ #define IFM_10G_CX4 20 /* 10GBase CX4 copper */ d234 1 a234 1 #define IFM_IEEE80211_11A 0x00010000 /* 5 GHz, OFDM mode */ d236 2 a237 7 #define IFM_IEEE80211_11G 0x00030000 /* 2 GHz, CCK mode */ #define IFM_IEEE80211_FH 0x00040000 /* 2 GHz, GFSK mode */ /* * Common Access Redundancy Protocol */ #define IFM_CARP 0x000000c0 a334 1 { IFM_CARP, "CARP" }, \ a401 6 { IFM_ETHER | IFM_10G_SR, "10GbaseSR" }, \ { IFM_ETHER | IFM_10G_SR, "10GSR" }, \ { IFM_ETHER | IFM_10G_SR, "10GBASE-SR" }, \ { IFM_ETHER | IFM_10G_CX4, "10GbaseCX4" }, \ { IFM_ETHER | IFM_10G_CX4, "10GCX4" }, \ { IFM_ETHER | IFM_10G_CX4, "10GBASE-CX4" }, \ a521 2 { IFM_ETHER | IFM_10G_SR, IF_Gbps(10ULL) }, \ { IFM_ETHER | IFM_10G_CX4, IF_Gbps(10ULL) }, \ a577 3 { IFM_CARP, IFM_AVALID, IFM_ACTIVE, \ { "backup", "master" } }, \ \ d594 1 a594 1 #endif /* !_NET_IF_MEDIA_H_ */ @ 1.42.12.2 log @sync with head @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.42.12.1 2006/06/21 15:10:27 yamt Exp $ */ a124 2 int ifmedia_change(struct ifmedia *, struct ifnet *); @ 1.42.12.3 log @sync with head. @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.42.12.2 2008/01/21 09:47:05 yamt Exp $ */ d244 1 a244 1 * Common Address Redundancy Protocol @ 1.41 log @Put spaces either side of '|' for clarity ('|' looks too much like 'I' or 'l') @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.40 2004/04/09 20:44:57 thorpej Exp $ */ d145 1 d582 12 @ 1.40 log @De-__P'ify. @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.39 2004/04/09 20:30:28 thorpej Exp $ */ d269 1 a269 1 #define IFM_ETH_FMASK (IFM_FLOW|IFM_ETH_RXPAUSE|IFM_ETH_TXPAUSE) d295 1 a295 1 #define IFM_OPTIONS(x) ((x) & (IFM_OMASK|IFM_GMASK)) d346 71 a416 71 { IFM_ETHER|IFM_10_T, "10baseT" }, \ { IFM_ETHER|IFM_10_T, "10baseT/UTP" }, \ { IFM_ETHER|IFM_10_T, "UTP" }, \ { IFM_ETHER|IFM_10_T, "10UTP" }, \ { IFM_ETHER|IFM_10_T, "10BASE-T" }, \ { IFM_ETHER|IFM_10_2, "10base2" }, \ { IFM_ETHER|IFM_10_2, "10base2/BNC" }, \ { IFM_ETHER|IFM_10_2, "BNC" }, \ { IFM_ETHER|IFM_10_2, "10BNC" }, \ { IFM_ETHER|IFM_10_2, "10BASE2" }, \ { IFM_ETHER|IFM_10_5, "10base5" }, \ { IFM_ETHER|IFM_10_5, "10base5/AUI" }, \ { IFM_ETHER|IFM_10_5, "AUI" }, \ { IFM_ETHER|IFM_10_5, "10AUI" }, \ { IFM_ETHER|IFM_10_5, "10BASE5" }, \ { IFM_ETHER|IFM_100_TX, "100baseTX" }, \ { IFM_ETHER|IFM_100_TX, "100TX" }, \ { IFM_ETHER|IFM_100_TX, "100BASE-TX" }, \ { IFM_ETHER|IFM_100_FX, "100baseFX" }, \ { IFM_ETHER|IFM_100_FX, "100FX" }, \ { IFM_ETHER|IFM_100_FX, "100BASE-FX" }, \ { IFM_ETHER|IFM_100_T4, "100baseT4" }, \ { IFM_ETHER|IFM_100_T4, "100T4" }, \ { IFM_ETHER|IFM_100_T4, "100BASE-T4" }, \ { IFM_ETHER|IFM_100_VG, "100baseVG" }, \ { IFM_ETHER|IFM_100_VG, "100VG" }, \ { IFM_ETHER|IFM_100_VG, "100VG-AnyLAN" }, \ { IFM_ETHER|IFM_100_T2, "100baseT2" }, \ { IFM_ETHER|IFM_100_T2, "100T2" }, \ { IFM_ETHER|IFM_100_T2, "100BASE-T2" }, \ { IFM_ETHER|IFM_1000_SX, "1000baseSX" }, \ { IFM_ETHER|IFM_1000_SX, "1000SX" }, \ { IFM_ETHER|IFM_1000_SX, "1000BASE-SX" }, \ { IFM_ETHER|IFM_10_STP, "10baseSTP" }, \ { IFM_ETHER|IFM_10_STP, "STP" }, \ { IFM_ETHER|IFM_10_STP, "10STP" }, \ { IFM_ETHER|IFM_10_STP, "10BASE-STP" }, \ { IFM_ETHER|IFM_10_FL, "10baseFL" }, \ { IFM_ETHER|IFM_10_FL, "FL" }, \ { IFM_ETHER|IFM_10_FL, "10FL" }, \ { IFM_ETHER|IFM_10_FL, "10BASE-FL" }, \ { IFM_ETHER|IFM_1000_LX, "1000baseLX" }, \ { IFM_ETHER|IFM_1000_LX, "1000LX" }, \ { IFM_ETHER|IFM_1000_LX, "1000BASE-LX" }, \ { IFM_ETHER|IFM_1000_CX, "1000baseCX" }, \ { IFM_ETHER|IFM_1000_CX, "1000CX" }, \ { IFM_ETHER|IFM_1000_CX, "1000BASE-CX" }, \ { IFM_ETHER|IFM_1000_T, "1000baseT" }, \ { IFM_ETHER|IFM_1000_T, "1000T" }, \ { IFM_ETHER|IFM_1000_T, "1000BASE-T" }, \ { IFM_ETHER|IFM_HPNA_1, "HomePNA1" }, \ { IFM_ETHER|IFM_HPNA_1, "HPNA1" }, \ { IFM_ETHER|IFM_10G_LR, "10GbaseLR" }, \ { IFM_ETHER|IFM_10G_LR, "10GLR" }, \ { IFM_ETHER|IFM_10G_LR, "10GBASE-LR" }, \ \ { IFM_TOKEN|IFM_TOK_STP4, "DB9/4Mbit" }, \ { IFM_TOKEN|IFM_TOK_STP4, "4STP" }, \ { IFM_TOKEN|IFM_TOK_STP16, "DB9/16Mbit" }, \ { IFM_TOKEN|IFM_TOK_STP16, "16STP" }, \ { IFM_TOKEN|IFM_TOK_UTP4, "UTP/4Mbit" }, \ { IFM_TOKEN|IFM_TOK_UTP4, "4UTP" }, \ { IFM_TOKEN|IFM_TOK_UTP16, "UTP/16Mbit" }, \ { IFM_TOKEN|IFM_TOK_UTP16, "16UTP" }, \ \ { IFM_FDDI|IFM_FDDI_SMF, "Single-mode" }, \ { IFM_FDDI|IFM_FDDI_SMF, "SMF" }, \ { IFM_FDDI|IFM_FDDI_MMF, "Multi-mode" }, \ { IFM_FDDI|IFM_FDDI_MMF, "MMF" }, \ { IFM_FDDI|IFM_FDDI_UTP, "UTP" }, \ { IFM_FDDI|IFM_FDDI_UTP, "CDDI" }, \ d421 4 a424 4 { IFM_ETHER|IFM_10_T|IFM_FDX, "10baseT-FDX" }, \ { IFM_ETHER|IFM_10_T|IFM_FDX, "10BASE-T-FDX" }, \ { IFM_ETHER|IFM_100_TX|IFM_FDX, "100baseTX-FDX" }, \ { IFM_ETHER|IFM_100_TX|IFM_FDX, "100BASE-TX-FDX" }, \ d429 16 a444 16 { IFM_IEEE80211|IFM_IEEE80211_FH1, "FH1" }, \ { IFM_IEEE80211|IFM_IEEE80211_FH2, "FH2" }, \ { IFM_IEEE80211|IFM_IEEE80211_DS1, "DS1" }, \ { IFM_IEEE80211|IFM_IEEE80211_DS2, "DS2" }, \ { IFM_IEEE80211|IFM_IEEE80211_DS5, "DS5" }, \ { IFM_IEEE80211|IFM_IEEE80211_DS11, "DS11" }, \ { IFM_IEEE80211|IFM_IEEE80211_DS22, "DS22" }, \ { IFM_IEEE80211|IFM_IEEE80211_OFDM6, "OFDM6" }, \ { IFM_IEEE80211|IFM_IEEE80211_OFDM9, "OFDM9" }, \ { IFM_IEEE80211|IFM_IEEE80211_OFDM12, "OFDM12" }, \ { IFM_IEEE80211|IFM_IEEE80211_OFDM18, "OFDM18" }, \ { IFM_IEEE80211|IFM_IEEE80211_OFDM24, "OFDM24" }, \ { IFM_IEEE80211|IFM_IEEE80211_OFDM36, "OFDM36" }, \ { IFM_IEEE80211|IFM_IEEE80211_OFDM48, "OFDM48" }, \ { IFM_IEEE80211|IFM_IEEE80211_OFDM54, "OFDM54" }, \ { IFM_IEEE80211|IFM_IEEE80211_OFDM72, "OFDM72" }, \ d452 4 a455 4 { IFM_IEEE80211|IFM_IEEE80211_11A, "11a" }, \ { IFM_IEEE80211|IFM_IEEE80211_11B, "11b" }, \ { IFM_IEEE80211|IFM_IEEE80211_11G, "11g" }, \ { IFM_IEEE80211|IFM_IEEE80211_FH, "fh" }, \ d473 19 a491 19 { IFM_ETHER|IFM_ETH_MASTER, "master" }, \ { IFM_ETHER|IFM_ETH_RXPAUSE, "rxpause" }, \ { IFM_ETHER|IFM_ETH_TXPAUSE, "txpause" }, \ \ { IFM_TOKEN|IFM_TOK_ETR, "EarlyTokenRelease" }, \ { IFM_TOKEN|IFM_TOK_ETR, "ETR" }, \ { IFM_TOKEN|IFM_TOK_SRCRT, "SourceRouting" }, \ { IFM_TOKEN|IFM_TOK_SRCRT, "SRCRT" }, \ { IFM_TOKEN|IFM_TOK_ALLR, "AllRoutes" }, \ { IFM_TOKEN|IFM_TOK_ALLR, "ALLR" }, \ \ { IFM_FDDI|IFM_FDDI_DA, "dual-attach" }, \ { IFM_FDDI|IFM_FDDI_DA, "das" }, \ \ { IFM_IEEE80211|IFM_IEEE80211_ADHOC, "adhoc" }, \ { IFM_IEEE80211|IFM_IEEE80211_ADHOC, "ibss" }, \ { IFM_IEEE80211|IFM_IEEE80211_HOSTAP, "hostap" }, \ { IFM_IEEE80211|IFM_IEEE80211_MONITOR, "monitor" }, \ { IFM_IEEE80211|IFM_IEEE80211_TURBO, "turbo" }, \ d505 42 a546 42 { IFM_ETHER|IFM_10_T, IF_Mbps(10) }, \ { IFM_ETHER|IFM_10_2, IF_Mbps(10) }, \ { IFM_ETHER|IFM_10_5, IF_Mbps(10) }, \ { IFM_ETHER|IFM_100_TX, IF_Mbps(100) }, \ { IFM_ETHER|IFM_100_FX, IF_Mbps(100) }, \ { IFM_ETHER|IFM_100_T4, IF_Mbps(100) }, \ { IFM_ETHER|IFM_100_VG, IF_Mbps(100) }, \ { IFM_ETHER|IFM_100_T2, IF_Mbps(100) }, \ { IFM_ETHER|IFM_1000_SX, IF_Mbps(1000) }, \ { IFM_ETHER|IFM_10_STP, IF_Mbps(10) }, \ { IFM_ETHER|IFM_10_FL, IF_Mbps(10) }, \ { IFM_ETHER|IFM_1000_LX, IF_Mbps(1000) }, \ { IFM_ETHER|IFM_1000_CX, IF_Mbps(1000) }, \ { IFM_ETHER|IFM_1000_T, IF_Mbps(1000) }, \ { IFM_ETHER|IFM_HPNA_1, IF_Mbps(1) }, \ { IFM_ETHER|IFM_10G_LR, IF_Gbps(10ULL) }, \ \ { IFM_TOKEN|IFM_TOK_STP4, IF_Mbps(4) }, \ { IFM_TOKEN|IFM_TOK_STP16, IF_Mbps(16) }, \ { IFM_TOKEN|IFM_TOK_UTP4, IF_Mbps(4) }, \ { IFM_TOKEN|IFM_TOK_UTP16, IF_Mbps(16) }, \ \ { IFM_FDDI|IFM_FDDI_SMF, IF_Mbps(100) }, \ { IFM_FDDI|IFM_FDDI_MMF, IF_Mbps(100) }, \ { IFM_FDDI|IFM_FDDI_UTP, IF_Mbps(100) }, \ \ { IFM_IEEE80211|IFM_IEEE80211_FH1, IF_Mbps(1) }, \ { IFM_IEEE80211|IFM_IEEE80211_FH2, IF_Mbps(2) }, \ { IFM_IEEE80211|IFM_IEEE80211_DS2, IF_Mbps(2) }, \ { IFM_IEEE80211|IFM_IEEE80211_DS5, IF_Kbps(5500) }, \ { IFM_IEEE80211|IFM_IEEE80211_DS11, IF_Mbps(11) }, \ { IFM_IEEE80211|IFM_IEEE80211_DS1, IF_Mbps(1) }, \ { IFM_IEEE80211|IFM_IEEE80211_DS22, IF_Mbps(22) }, \ { IFM_IEEE80211|IFM_IEEE80211_OFDM6, IF_Mbps(6) }, \ { IFM_IEEE80211|IFM_IEEE80211_OFDM9, IF_Mbps(9) }, \ { IFM_IEEE80211|IFM_IEEE80211_OFDM12, IF_Mbps(12) }, \ { IFM_IEEE80211|IFM_IEEE80211_OFDM18, IF_Mbps(18) }, \ { IFM_IEEE80211|IFM_IEEE80211_OFDM24, IF_Mbps(24) }, \ { IFM_IEEE80211|IFM_IEEE80211_OFDM36, IF_Mbps(36) }, \ { IFM_IEEE80211|IFM_IEEE80211_OFDM48, IF_Mbps(48) }, \ { IFM_IEEE80211|IFM_IEEE80211_OFDM54, IF_Mbps(54) }, \ { IFM_IEEE80211|IFM_IEEE80211_OFDM72, IF_Mbps(72) }, \ @ 1.39 log @Add flow control-related media bits / descriptions. From HITOSHI Osada. @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.38 2004/03/10 14:42:10 keihan Exp $ */ d96 2 a97 2 typedef int (*ifm_change_cb_t) __P((struct ifnet *)); typedef void (*ifm_stat_cb_t) __P((struct ifnet *, struct ifmediareq *)); d123 1 a123 2 void ifmedia_init __P((struct ifmedia *, int, ifm_change_cb_t, ifm_stat_cb_t)); d126 1 a126 1 void ifmedia_add __P((struct ifmedia *, int, int, void *)); d132 1 a132 1 void ifmedia_set __P((struct ifmedia *ifm, int mword)); d135 1 a135 2 int ifmedia_ioctl __P((struct ifnet *, struct ifreq *, struct ifmedia *, u_long)); d138 1 a138 1 struct ifmedia_entry *ifmedia_match __P((struct ifmedia *, u_int, u_int)); d141 1 a141 1 void ifmedia_delete_instance __P((struct ifmedia *, u_int)); @ 1.38 log @Add 10GBASE-LR to IFM_10G_LR. @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.37 2004/02/19 11:58:30 ragge Exp $ */ d184 2 d270 3 d466 2 d476 2 d522 1 a522 1 { IFM_ETHER|IFM_10G_LR, IF_Gbps(10ULL) }, \ @ 1.38.4.1 log @Pull up revision 1.42 (requested by riz in ticket #5518): Add prototypes for functions that convert media to/from strings. In libutil/if_media.c (moved from ifconfig.c so that they can be shared in crunched binaries) @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.38 2004/03/10 14:42:10 keihan Exp $ */ a146 1 a573 12 #ifndef _KERNEL /* Functions for converting media to/from strings, in libutil/if_media.c */ const char *get_media_type_string(int); const char *get_media_subtype_string(int); const char *get_media_mode_string(int); const char *get_media_option_string(int *); int get_media_mode(int, const char *); int get_media_subtype(int, const char *); int get_media_options(int, const char *, char **); int lookup_media_word(struct ifmedia_description *, int, const char *); #endif /* _KERNEL */ @ 1.37 log @Add media type 10GbaseLR. Change ifmb_baudrate and ifmedia_baudrate() to u_quad_t instead of int (common speed today exceeds 2Gbit). @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.36 2003/10/13 05:06:44 dyoung Exp $ */ d397 1 @ 1.36 log @Add constants and strings for 802.11 radios with OFDM PHY (802.11a, 802.11g). Add constants and strings for multi-mode devices (a/b/g). From FreeBSD/Sam Leffler. @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.35 2003/07/08 07:13:51 itojun Exp $ */ d146 1 a146 1 int ifmedia_baudrate __P((int)); d181 1 d395 2 d493 1 a493 1 int ifmb_baudrate; /* corresponding baudrate */ d512 1 @ 1.35 log @prototype must not have variable name @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.34 2003/04/23 23:16:43 bjh21 Exp $ */ d156 2 a157 1 * 16-19 RFU d215 10 d229 7 d263 2 d292 1 d302 2 d422 16 a437 6 { IFM_IEEE80211|IFM_IEEE80211_FH1, "FH1" }, \ { IFM_IEEE80211|IFM_IEEE80211_FH2, "FH2" }, \ { IFM_IEEE80211|IFM_IEEE80211_DS1, "DS1" }, \ { IFM_IEEE80211|IFM_IEEE80211_DS2, "DS2" }, \ { IFM_IEEE80211|IFM_IEEE80211_DS5, "DS5" }, \ { IFM_IEEE80211|IFM_IEEE80211_DS11, "DS11" }, \ d442 10 d480 1 d519 16 a534 6 { IFM_IEEE80211|IFM_IEEE80211_FH1, IF_Mbps(1) }, \ { IFM_IEEE80211|IFM_IEEE80211_FH2, IF_Mbps(2) }, \ { IFM_IEEE80211|IFM_IEEE80211_DS2, IF_Mbps(2) }, \ { IFM_IEEE80211|IFM_IEEE80211_DS5, IF_Kbps(5500) }, \ { IFM_IEEE80211|IFM_IEEE80211_DS11, IF_Mbps(11) }, \ { IFM_IEEE80211|IFM_IEEE80211_DS1, IF_Mbps(1) }, \ @ 1.34 log @Accept standard IEEE 802.3 names for Ethernet medium types. Suggested by Christos, IIRC. @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.33 2003/02/25 01:57:36 dyoung Exp $ */ d96 2 a97 2 typedef int (*ifm_change_cb_t) __P((struct ifnet *ifp)); typedef void (*ifm_stat_cb_t) __P((struct ifnet *ifp, struct ifmediareq *req)); d123 2 a124 2 void ifmedia_init __P((struct ifmedia *ifm, int dontcare_mask, ifm_change_cb_t change_callback, ifm_stat_cb_t status_callback)); d127 1 a127 1 void ifmedia_add __P((struct ifmedia *ifm, int mword, int data, void *aux)); d130 1 a130 2 void ifmedia_list_add(struct ifmedia *mp, struct ifmedia_entry *lp, int count); d136 2 a137 2 int ifmedia_ioctl __P((struct ifnet *ifp, struct ifreq *ifr, struct ifmedia *ifm, u_long cmd)); d140 1 a140 1 struct ifmedia_entry *ifmedia_match __P((struct ifmedia *ifm, u_int, u_int)); @ 1.34.2.1 log @Sync with HEAD @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.40 2004/04/09 20:44:57 thorpej Exp $ */ d96 2 a97 2 typedef int (*ifm_change_cb_t)(struct ifnet *); typedef void (*ifm_stat_cb_t)(struct ifnet *, struct ifmediareq *); d123 2 a124 1 void ifmedia_init(struct ifmedia *, int, ifm_change_cb_t, ifm_stat_cb_t); d127 1 a127 1 void ifmedia_add(struct ifmedia *, int, int, void *); d130 2 a131 1 void ifmedia_list_add(struct ifmedia *, struct ifmedia_entry *, int); d134 1 a134 1 void ifmedia_set(struct ifmedia *ifm, int mword); d137 2 a138 1 int ifmedia_ioctl(struct ifnet *, struct ifreq *, struct ifmedia *, u_long); d141 1 a141 1 struct ifmedia_entry *ifmedia_match(struct ifmedia *, u_int, u_int); d144 1 a144 1 void ifmedia_delete_instance(struct ifmedia *, u_int); d147 1 a147 1 u_quad_t ifmedia_baudrate(int); d157 1 a157 2 * 16-18 Mode (for multi-mode devices) * 19 RFU a180 1 #define IFM_10G_LR 18 /* 10GbaseLR - single-mode fiber */ a182 2 #define IFM_ETH_RXPAUSE 0x00000200 /* receive PAUSE frames */ #define IFM_ETH_TXPAUSE 0x00000400 /* transmit PAUSE frames */ a214 10 #define IFM_IEEE80211_DS22 9 /* Direct Sequence 22Mbps */ #define IFM_IEEE80211_OFDM6 10 /* OFDM 6Mbps */ #define IFM_IEEE80211_OFDM9 11 /* OFDM 9Mbps */ #define IFM_IEEE80211_OFDM12 12 /* OFDM 12Mbps */ #define IFM_IEEE80211_OFDM18 13 /* OFDM 18Mbps */ #define IFM_IEEE80211_OFDM24 14 /* OFDM 24Mbps */ #define IFM_IEEE80211_OFDM36 15 /* OFDM 36Mbps */ #define IFM_IEEE80211_OFDM48 16 /* OFDM 48Mbps */ #define IFM_IEEE80211_OFDM54 17 /* OFDM 54Mbps */ #define IFM_IEEE80211_OFDM72 18 /* OFDM 72Mbps */ a218 7 #define IFM_IEEE80211_TURBO 0x00000800 /* Operate in Turbo mode */ /* operating mode for multi-mode devices */ #define IFM_IEEE80211_11A 0x00010000 /* 5Ghz, OFDM mode */ #define IFM_IEEE80211_11B 0x00020000 /* Direct Sequence mode */ #define IFM_IEEE80211_11G 0x00030000 /* 2Ghz, CCK mode */ #define IFM_IEEE80211_FH 0x00040000 /* 2Ghz, GFSK mode */ a245 2 #define IFM_MMASK 0x00070000 /* Mode */ #define IFM_MSHIFT 16 /* Mode shift */ a247 3 /* Ethernet flow control mask */ #define IFM_ETH_FMASK (IFM_FLOW|IFM_ETH_RXPAUSE|IFM_ETH_TXPAUSE) a272 1 #define IFM_MODE(x) ((x) & IFM_MMASK) a281 2 #define IFM_MAKEMODE(mode) \ (((mode) << IFM_MSHIFT) & IFM_MMASK) a371 3 { IFM_ETHER|IFM_10G_LR, "10GbaseLR" }, \ { IFM_ETHER|IFM_10G_LR, "10GLR" }, \ { IFM_ETHER|IFM_10G_LR, "10GBASE-LR" }, \ d400 6 a405 16 { IFM_IEEE80211|IFM_IEEE80211_FH1, "FH1" }, \ { IFM_IEEE80211|IFM_IEEE80211_FH2, "FH2" }, \ { IFM_IEEE80211|IFM_IEEE80211_DS1, "DS1" }, \ { IFM_IEEE80211|IFM_IEEE80211_DS2, "DS2" }, \ { IFM_IEEE80211|IFM_IEEE80211_DS5, "DS5" }, \ { IFM_IEEE80211|IFM_IEEE80211_DS11, "DS11" }, \ { IFM_IEEE80211|IFM_IEEE80211_DS22, "DS22" }, \ { IFM_IEEE80211|IFM_IEEE80211_OFDM6, "OFDM6" }, \ { IFM_IEEE80211|IFM_IEEE80211_OFDM9, "OFDM9" }, \ { IFM_IEEE80211|IFM_IEEE80211_OFDM12, "OFDM12" }, \ { IFM_IEEE80211|IFM_IEEE80211_OFDM18, "OFDM18" }, \ { IFM_IEEE80211|IFM_IEEE80211_OFDM24, "OFDM24" }, \ { IFM_IEEE80211|IFM_IEEE80211_OFDM36, "OFDM36" }, \ { IFM_IEEE80211|IFM_IEEE80211_OFDM48, "OFDM48" }, \ { IFM_IEEE80211|IFM_IEEE80211_OFDM54, "OFDM54" }, \ { IFM_IEEE80211|IFM_IEEE80211_OFDM72, "OFDM72" }, \ a409 10 #define IFM_MODE_DESCRIPTIONS { \ { IFM_AUTO, "autoselect" }, \ { IFM_AUTO, "auto" }, \ { IFM_IEEE80211|IFM_IEEE80211_11A, "11a" }, \ { IFM_IEEE80211|IFM_IEEE80211_11B, "11b" }, \ { IFM_IEEE80211|IFM_IEEE80211_11G, "11g" }, \ { IFM_IEEE80211|IFM_IEEE80211_FH, "fh" }, \ { 0, NULL }, \ } a414 2 { IFM_FLOW, "flowcontrol" }, \ { IFM_FLOW, "flow" }, \ a422 2 { IFM_ETHER|IFM_ETH_RXPAUSE, "rxpause" }, \ { IFM_ETHER|IFM_ETH_TXPAUSE, "txpause" }, \ a437 1 { IFM_IEEE80211|IFM_IEEE80211_TURBO, "turbo" }, \ d447 1 a447 1 u_quad_t ifmb_baudrate; /* corresponding baudrate */ a465 1 { IFM_ETHER|IFM_10G_LR, IF_Gbps(10ULL) }, \ d476 6 a481 16 { IFM_IEEE80211|IFM_IEEE80211_FH1, IF_Mbps(1) }, \ { IFM_IEEE80211|IFM_IEEE80211_FH2, IF_Mbps(2) }, \ { IFM_IEEE80211|IFM_IEEE80211_DS2, IF_Mbps(2) }, \ { IFM_IEEE80211|IFM_IEEE80211_DS5, IF_Kbps(5500) }, \ { IFM_IEEE80211|IFM_IEEE80211_DS11, IF_Mbps(11) }, \ { IFM_IEEE80211|IFM_IEEE80211_DS1, IF_Mbps(1) }, \ { IFM_IEEE80211|IFM_IEEE80211_DS22, IF_Mbps(22) }, \ { IFM_IEEE80211|IFM_IEEE80211_OFDM6, IF_Mbps(6) }, \ { IFM_IEEE80211|IFM_IEEE80211_OFDM9, IF_Mbps(9) }, \ { IFM_IEEE80211|IFM_IEEE80211_OFDM12, IF_Mbps(12) }, \ { IFM_IEEE80211|IFM_IEEE80211_OFDM18, IF_Mbps(18) }, \ { IFM_IEEE80211|IFM_IEEE80211_OFDM24, IF_Mbps(24) }, \ { IFM_IEEE80211|IFM_IEEE80211_OFDM36, IF_Mbps(36) }, \ { IFM_IEEE80211|IFM_IEEE80211_OFDM48, IF_Mbps(48) }, \ { IFM_IEEE80211|IFM_IEEE80211_OFDM54, IF_Mbps(54) }, \ { IFM_IEEE80211|IFM_IEEE80211_OFDM72, IF_Mbps(72) }, \ @ 1.34.2.2 log @Sync with HEAD. @ text @@ 1.34.2.3 log @Fix the sync with head I botched. @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.34.2.1 2004/08/03 10:54:15 skrll Exp $ */ @ 1.34.2.4 log @Sync with HEAD @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.34.2.3 2004/09/21 13:36:38 skrll Exp $ */ d269 1 a269 1 #define IFM_ETH_FMASK (IFM_FLOW | IFM_ETH_RXPAUSE | IFM_ETH_TXPAUSE) d295 1 a295 1 #define IFM_OPTIONS(x) ((x) & (IFM_OMASK | IFM_GMASK)) d346 71 a416 71 { IFM_ETHER | IFM_10_T, "10baseT" }, \ { IFM_ETHER | IFM_10_T, "10baseT/UTP" }, \ { IFM_ETHER | IFM_10_T, "UTP" }, \ { IFM_ETHER | IFM_10_T, "10UTP" }, \ { IFM_ETHER | IFM_10_T, "10BASE-T" }, \ { IFM_ETHER | IFM_10_2, "10base2" }, \ { IFM_ETHER | IFM_10_2, "10base2/BNC" }, \ { IFM_ETHER | IFM_10_2, "BNC" }, \ { IFM_ETHER | IFM_10_2, "10BNC" }, \ { IFM_ETHER | IFM_10_2, "10BASE2" }, \ { IFM_ETHER | IFM_10_5, "10base5" }, \ { IFM_ETHER | IFM_10_5, "10base5/AUI" }, \ { IFM_ETHER | IFM_10_5, "AUI" }, \ { IFM_ETHER | IFM_10_5, "10AUI" }, \ { IFM_ETHER | IFM_10_5, "10BASE5" }, \ { IFM_ETHER | IFM_100_TX, "100baseTX" }, \ { IFM_ETHER | IFM_100_TX, "100TX" }, \ { IFM_ETHER | IFM_100_TX, "100BASE-TX" }, \ { IFM_ETHER | IFM_100_FX, "100baseFX" }, \ { IFM_ETHER | IFM_100_FX, "100FX" }, \ { IFM_ETHER | IFM_100_FX, "100BASE-FX" }, \ { IFM_ETHER | IFM_100_T4, "100baseT4" }, \ { IFM_ETHER | IFM_100_T4, "100T4" }, \ { IFM_ETHER | IFM_100_T4, "100BASE-T4" }, \ { IFM_ETHER | IFM_100_VG, "100baseVG" }, \ { IFM_ETHER | IFM_100_VG, "100VG" }, \ { IFM_ETHER | IFM_100_VG, "100VG-AnyLAN" }, \ { IFM_ETHER | IFM_100_T2, "100baseT2" }, \ { IFM_ETHER | IFM_100_T2, "100T2" }, \ { IFM_ETHER | IFM_100_T2, "100BASE-T2" }, \ { IFM_ETHER | IFM_1000_SX, "1000baseSX" }, \ { IFM_ETHER | IFM_1000_SX, "1000SX" }, \ { IFM_ETHER | IFM_1000_SX, "1000BASE-SX" }, \ { IFM_ETHER | IFM_10_STP, "10baseSTP" }, \ { IFM_ETHER | IFM_10_STP, "STP" }, \ { IFM_ETHER | IFM_10_STP, "10STP" }, \ { IFM_ETHER | IFM_10_STP, "10BASE-STP" }, \ { IFM_ETHER | IFM_10_FL, "10baseFL" }, \ { IFM_ETHER | IFM_10_FL, "FL" }, \ { IFM_ETHER | IFM_10_FL, "10FL" }, \ { IFM_ETHER | IFM_10_FL, "10BASE-FL" }, \ { IFM_ETHER | IFM_1000_LX, "1000baseLX" }, \ { IFM_ETHER | IFM_1000_LX, "1000LX" }, \ { IFM_ETHER | IFM_1000_LX, "1000BASE-LX" }, \ { IFM_ETHER | IFM_1000_CX, "1000baseCX" }, \ { IFM_ETHER | IFM_1000_CX, "1000CX" }, \ { IFM_ETHER | IFM_1000_CX, "1000BASE-CX" }, \ { IFM_ETHER | IFM_1000_T, "1000baseT" }, \ { IFM_ETHER | IFM_1000_T, "1000T" }, \ { IFM_ETHER | IFM_1000_T, "1000BASE-T" }, \ { IFM_ETHER | IFM_HPNA_1, "HomePNA1" }, \ { IFM_ETHER | IFM_HPNA_1, "HPNA1" }, \ { IFM_ETHER | IFM_10G_LR, "10GbaseLR" }, \ { IFM_ETHER | IFM_10G_LR, "10GLR" }, \ { IFM_ETHER | IFM_10G_LR, "10GBASE-LR" }, \ \ { IFM_TOKEN | IFM_TOK_STP4, "DB9/4Mbit" }, \ { IFM_TOKEN | IFM_TOK_STP4, "4STP" }, \ { IFM_TOKEN | IFM_TOK_STP16, "DB9/16Mbit" }, \ { IFM_TOKEN | IFM_TOK_STP16, "16STP" }, \ { IFM_TOKEN | IFM_TOK_UTP4, "UTP/4Mbit" }, \ { IFM_TOKEN | IFM_TOK_UTP4, "4UTP" }, \ { IFM_TOKEN | IFM_TOK_UTP16, "UTP/16Mbit" }, \ { IFM_TOKEN | IFM_TOK_UTP16, "16UTP" }, \ \ { IFM_FDDI | IFM_FDDI_SMF, "Single-mode" }, \ { IFM_FDDI | IFM_FDDI_SMF, "SMF" }, \ { IFM_FDDI | IFM_FDDI_MMF, "Multi-mode" }, \ { IFM_FDDI | IFM_FDDI_MMF, "MMF" }, \ { IFM_FDDI | IFM_FDDI_UTP, "UTP" }, \ { IFM_FDDI | IFM_FDDI_UTP, "CDDI" }, \ d421 4 a424 4 { IFM_ETHER | IFM_10_T | IFM_FDX, "10baseT-FDX" }, \ { IFM_ETHER | IFM_10_T | IFM_FDX, "10BASE-T-FDX" }, \ { IFM_ETHER | IFM_100_TX | IFM_FDX, "100baseTX-FDX" }, \ { IFM_ETHER | IFM_100_TX | IFM_FDX, "100BASE-TX-FDX" }, \ d429 16 a444 16 { IFM_IEEE80211 | IFM_IEEE80211_FH1, "FH1" }, \ { IFM_IEEE80211 | IFM_IEEE80211_FH2, "FH2" }, \ { IFM_IEEE80211 | IFM_IEEE80211_DS1, "DS1" }, \ { IFM_IEEE80211 | IFM_IEEE80211_DS2, "DS2" }, \ { IFM_IEEE80211 | IFM_IEEE80211_DS5, "DS5" }, \ { IFM_IEEE80211 | IFM_IEEE80211_DS11, "DS11" }, \ { IFM_IEEE80211 | IFM_IEEE80211_DS22, "DS22" }, \ { IFM_IEEE80211 | IFM_IEEE80211_OFDM6, "OFDM6" }, \ { IFM_IEEE80211 | IFM_IEEE80211_OFDM9, "OFDM9" }, \ { IFM_IEEE80211 | IFM_IEEE80211_OFDM12, "OFDM12" }, \ { IFM_IEEE80211 | IFM_IEEE80211_OFDM18, "OFDM18" }, \ { IFM_IEEE80211 | IFM_IEEE80211_OFDM24, "OFDM24" }, \ { IFM_IEEE80211 | IFM_IEEE80211_OFDM36, "OFDM36" }, \ { IFM_IEEE80211 | IFM_IEEE80211_OFDM48, "OFDM48" }, \ { IFM_IEEE80211 | IFM_IEEE80211_OFDM54, "OFDM54" }, \ { IFM_IEEE80211 | IFM_IEEE80211_OFDM72, "OFDM72" }, \ d452 4 a455 4 { IFM_IEEE80211 | IFM_IEEE80211_11A, "11a" }, \ { IFM_IEEE80211 | IFM_IEEE80211_11B, "11b" }, \ { IFM_IEEE80211 | IFM_IEEE80211_11G, "11g" }, \ { IFM_IEEE80211 | IFM_IEEE80211_FH, "fh" }, \ d473 19 a491 19 { IFM_ETHER | IFM_ETH_MASTER, "master" }, \ { IFM_ETHER | IFM_ETH_RXPAUSE, "rxpause" }, \ { IFM_ETHER | IFM_ETH_TXPAUSE, "txpause" }, \ \ { IFM_TOKEN | IFM_TOK_ETR, "EarlyTokenRelease" }, \ { IFM_TOKEN | IFM_TOK_ETR, "ETR" }, \ { IFM_TOKEN | IFM_TOK_SRCRT, "SourceRouting" }, \ { IFM_TOKEN | IFM_TOK_SRCRT, "SRCRT" }, \ { IFM_TOKEN | IFM_TOK_ALLR, "AllRoutes" }, \ { IFM_TOKEN | IFM_TOK_ALLR, "ALLR" }, \ \ { IFM_FDDI | IFM_FDDI_DA, "dual-attach" }, \ { IFM_FDDI | IFM_FDDI_DA, "das" }, \ \ { IFM_IEEE80211 | IFM_IEEE80211_ADHOC, "adhoc" }, \ { IFM_IEEE80211 | IFM_IEEE80211_ADHOC, "ibss" }, \ { IFM_IEEE80211 | IFM_IEEE80211_HOSTAP, "hostap" }, \ { IFM_IEEE80211 | IFM_IEEE80211_MONITOR,"monitor" }, \ { IFM_IEEE80211 | IFM_IEEE80211_TURBO, "turbo" }, \ d505 42 a546 42 { IFM_ETHER | IFM_10_T, IF_Mbps(10) }, \ { IFM_ETHER | IFM_10_2, IF_Mbps(10) }, \ { IFM_ETHER | IFM_10_5, IF_Mbps(10) }, \ { IFM_ETHER | IFM_100_TX, IF_Mbps(100) }, \ { IFM_ETHER | IFM_100_FX, IF_Mbps(100) }, \ { IFM_ETHER | IFM_100_T4, IF_Mbps(100) }, \ { IFM_ETHER | IFM_100_VG, IF_Mbps(100) }, \ { IFM_ETHER | IFM_100_T2, IF_Mbps(100) }, \ { IFM_ETHER | IFM_1000_SX, IF_Mbps(1000) }, \ { IFM_ETHER | IFM_10_STP, IF_Mbps(10) }, \ { IFM_ETHER | IFM_10_FL, IF_Mbps(10) }, \ { IFM_ETHER | IFM_1000_LX, IF_Mbps(1000) }, \ { IFM_ETHER | IFM_1000_CX, IF_Mbps(1000) }, \ { IFM_ETHER | IFM_1000_T, IF_Mbps(1000) }, \ { IFM_ETHER | IFM_HPNA_1, IF_Mbps(1) }, \ { IFM_ETHER | IFM_10G_LR, IF_Gbps(10ULL) }, \ \ { IFM_TOKEN | IFM_TOK_STP4, IF_Mbps(4) }, \ { IFM_TOKEN | IFM_TOK_STP16, IF_Mbps(16) }, \ { IFM_TOKEN | IFM_TOK_UTP4, IF_Mbps(4) }, \ { IFM_TOKEN | IFM_TOK_UTP16, IF_Mbps(16) }, \ \ { IFM_FDDI | IFM_FDDI_SMF, IF_Mbps(100) }, \ { IFM_FDDI | IFM_FDDI_MMF, IF_Mbps(100) }, \ { IFM_FDDI | IFM_FDDI_UTP, IF_Mbps(100) }, \ \ { IFM_IEEE80211 | IFM_IEEE80211_FH1, IF_Mbps(1) }, \ { IFM_IEEE80211 | IFM_IEEE80211_FH2, IF_Mbps(2) }, \ { IFM_IEEE80211 | IFM_IEEE80211_DS2, IF_Mbps(2) }, \ { IFM_IEEE80211 | IFM_IEEE80211_DS5, IF_Kbps(5500) }, \ { IFM_IEEE80211 | IFM_IEEE80211_DS11, IF_Mbps(11) }, \ { IFM_IEEE80211 | IFM_IEEE80211_DS1, IF_Mbps(1) }, \ { IFM_IEEE80211 | IFM_IEEE80211_DS22, IF_Mbps(22) }, \ { IFM_IEEE80211 | IFM_IEEE80211_OFDM6, IF_Mbps(6) }, \ { IFM_IEEE80211 | IFM_IEEE80211_OFDM9, IF_Mbps(9) }, \ { IFM_IEEE80211 | IFM_IEEE80211_OFDM12, IF_Mbps(12) }, \ { IFM_IEEE80211 | IFM_IEEE80211_OFDM18, IF_Mbps(18) }, \ { IFM_IEEE80211 | IFM_IEEE80211_OFDM24, IF_Mbps(24) }, \ { IFM_IEEE80211 | IFM_IEEE80211_OFDM36, IF_Mbps(36) }, \ { IFM_IEEE80211 | IFM_IEEE80211_OFDM48, IF_Mbps(48) }, \ { IFM_IEEE80211 | IFM_IEEE80211_OFDM54, IF_Mbps(54) }, \ { IFM_IEEE80211 | IFM_IEEE80211_OFDM72, IF_Mbps(72) }, \ @ 1.34.2.5 log @Sync with HEAD. @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.34.2.4 2004/10/19 15:58:10 skrll Exp $ */ a144 1 a580 12 #ifndef _KERNEL /* Functions for converting media to/from strings, in libutil/if_media.c */ const char *get_media_type_string(int); const char *get_media_subtype_string(int); const char *get_media_mode_string(int); const char *get_media_option_string(int *); int get_media_mode(int, const char *); int get_media_subtype(int, const char *); int get_media_options(int, const char *, char **); int lookup_media_word(struct ifmedia_description *, int, const char *); #endif /* _KERNEL */ @ 1.34.2.6 log @Sync with head. @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.43 2005/12/10 23:21:38 elad Exp $ */ d594 1 a594 1 #endif /* !_NET_IF_MEDIA_H_ */ @ 1.33 log @Add support for Prism monitor mode. From Kevin Lahey . This patch does NOT add monitor mode support for the Lucent radios. awi(4) was only modified for compatibility with the new mediaopt. It does NOT support monitor mode. Tested by Kevin, Daniel Carosone, and I. @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.32 2002/11/07 08:00:47 thorpej Exp $ */ d324 1 d329 1 d334 1 d337 1 d340 1 d343 1 d346 1 d349 1 d352 1 d356 1 d360 1 d363 1 d366 1 d369 1 d393 1 d395 1 @ 1.32 log @Fix more signed/unsigned comparison warnings. @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.31 2002/11/07 07:53:37 thorpej Exp $ */ d218 1 d421 1 @ 1.31 log @Make ifm_data unsigned. @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.30 2002/11/07 07:42:24 thorpej Exp $ */ d141 1 a141 2 struct ifmedia_entry *ifmedia_match __P((struct ifmedia *ifm, int flags, int mask)); d144 1 a144 1 void ifmedia_delete_instance __P((struct ifmedia *, int)); d274 1 a274 1 #define IFM_INST_ANY -1 @ 1.30 log @Make media and mask unsigned. @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.29 2002/09/27 05:27:20 onoe Exp $ */ d105 1 a105 1 int ifm_data; /* for driver-specific use */ @ 1.29 log @Change ifmb_baudrate for IFM_IEEE80211_DS5: 5Mbps -> 5.5Mbps @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.28 2002/08/21 03:22:04 onoe Exp $ */ d104 1 a104 1 int ifm_media; /* description of this media attachment */ d114 2 a115 2 int ifm_mask; /* mask of changes we don't care about */ int ifm_media; /* current user-set media word */ @ 1.28 log @Delete IFM_IEEE80211_IBSS [ibss] and IFM_IEEE80211_IBSSMASTER [ibss-master] from media options, since IEEE80211_ADHOC [adhoc] is already defined for IBSS. Instead, [ibss] is assigned as an alias for IEEE80211_ADHOC. @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.27 2002/08/10 23:21:58 thorpej Exp $ */ d462 1 a462 1 { IFM_IEEE80211|IFM_IEEE80211_DS5, IF_Mbps(5) }, \ @ 1.27 log @Add "hostap", "ibss", and "ibss-master" 802.11 media options. From OpenBSD. @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.26 2001/06/30 21:23:39 kleink Exp $ */ a218 2 #define IFM_IEEE80211_IBSS 0x00000400 /* Operate in IBSS mode */ #define IFM_IEEE80211_IBSSMASTER 0x00000800 /* Operate as an IBSS master */ d419 1 a420 2 { IFM_IEEE80211|IFM_IEEE80211_IBSS, "ibss" }, \ { IFM_IEEE80211|IFM_IEEE80211_IBSSMASTER,"ibss-master" }, \ @ 1.26 log @Rename an IFM_1000_TX occurrence missed in previous. @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.25 2001/06/30 17:53:59 bjh21 Exp $ */ d217 4 a220 1 #define IFM_IEEE80211_ADHOC 0x00000100 /* Operate in Adhoc mode */ d421 3 @ 1.26.2.1 log @sync kqueue branch with HEAD @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.26 2001/06/30 21:23:39 kleink Exp $ */ d217 1 a217 2 #define IFM_IEEE80211_ADHOC 0x00000100 /* Operate in Adhoc mode */ #define IFM_IEEE80211_HOSTAP 0x00000200 /* Operate in Host AP mode */ a417 2 { IFM_IEEE80211|IFM_IEEE80211_ADHOC, "ibss" }, \ { IFM_IEEE80211|IFM_IEEE80211_HOSTAP, "hostap" }, \ @ 1.26.2.2 log @sync kqueue with -current; this includes merge of gehenna-devsw branch, merge of i386 MP branch, and part of autoconf rototil work @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.26.2.1 2002/09/06 08:48:54 jdolecek Exp $ */ d462 1 a462 1 { IFM_IEEE80211|IFM_IEEE80211_DS5, IF_Kbps(5500) }, \ @ 1.26.14.1 log @catch up with -current. @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.28 2002/08/21 03:22:04 onoe Exp $ */ d217 1 a217 2 #define IFM_IEEE80211_ADHOC 0x00000100 /* Operate in Adhoc mode */ #define IFM_IEEE80211_HOSTAP 0x00000200 /* Operate in Host AP mode */ a417 2 { IFM_IEEE80211|IFM_IEEE80211_ADHOC, "ibss" }, \ { IFM_IEEE80211|IFM_IEEE80211_HOSTAP, "hostap" }, \ @ 1.25 log @IFM_1000_TX -> IFM_1000_T, as (breifly) discussed on tech-net. @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.24 2001/05/31 16:30:04 thorpej Exp $ */ d444 1 a444 1 { IFM_ETHER|IFM_1000_TX, IF_Mbps(1000) }, \ @ 1.24 log @Add an Ethernet option bit for master mode (for 1000baseTX, the link master provides the clock -- this is normally the switch, but if you are doing back-to-back NICs, you need to tell one side to be the master). @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.23 2000/03/06 20:50:29 thorpej Exp $ */ d180 1 a180 1 #define IFM_1000_TX 16 /* 1000baseTX - 4 pair cat 5 */ d183 1 a183 1 #define IFM_ETH_MASTER 0x00000100 /* master mode (1000baseTX) */ d353 2 a354 2 { IFM_ETHER|IFM_1000_TX, "1000baseTX" }, \ { IFM_ETHER|IFM_1000_TX, "1000TX" }, \ @ 1.23 log @Add ifmedia_baudrate(), which returns a value suitable for ifi_baudrate given a media word, or 0 for unknown. @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.22 2000/02/17 21:53:16 sommerfeld Exp $ */ d4 1 a4 1 * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc. d183 2 d404 2 @ 1.23.6.1 log @Catch up to -current. @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.23 2000/03/06 20:50:29 thorpej Exp $ */ d4 1 a4 1 * Copyright (c) 1998, 2000, 2001 The NetBSD Foundation, Inc. a182 2 #define IFM_ETH_MASTER 0x00000100 /* master mode (1000baseTX) */ a401 2 \ { IFM_ETHER|IFM_ETH_MASTER, "master" }, \ @ 1.23.6.2 log @Catch up with -current. @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.23.6.1 2001/06/21 20:08:08 nathanw Exp $ */ d180 1 a180 1 #define IFM_1000_T 16 /* 1000baseT - 4 pair cat 5 */ d183 1 a183 1 #define IFM_ETH_MASTER 0x00000100 /* master mode (1000baseT) */ d353 2 a354 2 { IFM_ETHER|IFM_1000_T, "1000baseT" }, \ { IFM_ETHER|IFM_1000_T, "1000T" }, \ d444 1 a444 1 { IFM_ETHER|IFM_1000_T, IF_Mbps(1000) }, \ @ 1.23.6.3 log @Catch up to -current. @ text @d1 1 a1 1 /* $NetBSD$ */ d217 1 a217 4 #define IFM_IEEE80211_ADHOC 0x00000100 /* Operate in Adhoc mode */ #define IFM_IEEE80211_HOSTAP 0x00000200 /* Operate in Host AP mode */ #define IFM_IEEE80211_IBSS 0x00000400 /* Operate in IBSS mode */ #define IFM_IEEE80211_IBSSMASTER 0x00000800 /* Operate as an IBSS master */ a417 3 { IFM_IEEE80211|IFM_IEEE80211_HOSTAP, "hostap" }, \ { IFM_IEEE80211|IFM_IEEE80211_IBSS, "ibss" }, \ { IFM_IEEE80211|IFM_IEEE80211_IBSSMASTER,"ibss-master" }, \ @ 1.23.6.4 log @Catch up to -current. @ text @d219 2 a420 1 { IFM_IEEE80211|IFM_IEEE80211_ADHOC, "ibss" }, \ d422 2 @ 1.23.6.5 log @Catch up to -current. @ text @d462 1 a462 1 { IFM_IEEE80211|IFM_IEEE80211_DS5, IF_Kbps(5500) }, \ @ 1.23.6.6 log @Catch up to -current @ text @d104 2 a105 2 u_int ifm_media; /* description of this media attachment */ u_int ifm_data; /* for driver-specific use */ d114 2 a115 2 u_int ifm_mask; /* mask of changes we don't care about */ u_int ifm_media; /* current user-set media word */ d141 2 a142 1 struct ifmedia_entry *ifmedia_match __P((struct ifmedia *ifm, u_int, u_int)); d145 1 a145 1 void ifmedia_delete_instance __P((struct ifmedia *, u_int)); d275 1 a275 1 #define IFM_INST_ANY ((u_int) -1) @ 1.22 log @More 802.11 subtypes: there's also 1MB/s DS (the BayStack 660 firmware claims to support it). @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.21 2000/02/16 18:03:14 thorpej Exp $ */ d147 2 d416 44 @ 1.21 log @Fix TMASK to use all 5 lower bits of the media word, and add HomePNA 1.0. @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.20 2000/01/26 21:58:18 thorpej Exp $ */ d211 2 d381 1 @ 1.20 log @Add a way to delete all media for a specified instance. @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.19 2000/01/25 20:18:52 thorpej Exp $ */ d153 1 a153 2 * 0-3 Media variant * 4 RFU d179 1 d235 1 a235 1 #define IFM_TMASK 0x0000000f /* Media sub-type */ d349 2 @ 1.19 log @IFM_1000_FX -> IFM_1000_SX, like it's supposed to be, and add a few more gigabit Ethernet tyes from FreeBSD. @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.18 2000/01/25 00:58:59 thorpej Exp $ */ d144 3 d268 1 @ 1.18 log @Define some convenience information and tables related to ifmedia status bits for ifconfig(8). @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.17 2000/01/24 01:20:21 augustss Exp $ */ d171 1 a171 1 #define IFM_1000_FX 11 /* 1000BaseFX - gigabit over fiber */ d174 3 d331 2 a332 2 { IFM_ETHER|IFM_1000_FX, "1000baseFX" }, \ { IFM_ETHER|IFM_1000_FX, "1000FX" }, \ d339 6 @ 1.17 log @Fix a typo. @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.16 2000/01/23 23:49:48 chopps Exp $ */ d4 1 a4 1 * Copyright (c) 1998 The NetBSD Foundation, Inc. d244 9 d396 30 @ 1.16 log @add 802.11 media types @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.15 1999/11/03 23:06:35 thorpej Exp $ */ d200 1 a200 1 #define IFM_IEEE80211_FH1 3 /* Frequency Hopping 2Mbps */ @ 1.15 log @Make the ifmedia_entry list a TAILQ. This is pretty much for cosmetics (media added to tail, so that when e.g. the list is run to print out what media exist, they appear in-order). @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.14 1999/10/27 17:59:24 thorpej Exp $ */ d197 11 d284 1 d350 9 d383 2 @ 1.14 log @Expose the ifmedia_match() function. @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.13 1999/03/23 21:46:47 thorpej Exp $ */ d103 1 a103 1 LIST_ENTRY(ifmedia_entry) ifm_list; d117 1 a117 1 LIST_HEAD(, ifmedia_entry) ifm_list; /* list of all supported media */ @ 1.13 log @Add a new shared media option, IFM_FLOW, used to enable link-level flow control. IEEE 802.3x is in mind, but this could be generally useful for different types of media. @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.12 1998/11/02 22:10:26 thorpej Exp $ */ d139 4 @ 1.13.8.1 log @Update thorpej_scsipi to -current as of a month ago @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.23 2000/03/06 20:50:29 thorpej Exp $ */ d4 1 a4 1 * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc. d103 1 a103 1 TAILQ_ENTRY(ifmedia_entry) ifm_list; d117 1 a117 1 TAILQ_HEAD(, ifmedia_entry) ifm_list; /* list of all supported media */ a139 9 /* Look up a media entry. */ struct ifmedia_entry *ifmedia_match __P((struct ifmedia *ifm, int flags, int mask)); /* Delete all media for a given media instance */ void ifmedia_delete_instance __P((struct ifmedia *, int)); /* Compute baudrate for a given media. */ int ifmedia_baudrate __P((int)); d146 2 a147 1 * 0-4 Media subtype MAX SUBTYPE == 31! d167 1 a167 1 #define IFM_1000_SX 11 /* 1000BaseSX - multi-mode fiber */ a169 4 #define IFM_1000_LX 14 /* 1000baseLX - single-mode fiber */ #define IFM_1000_CX 15 /* 1000baseCX - 150ohm STP */ #define IFM_1000_TX 16 /* 1000baseTX - 4 pair cat 5 */ #define IFM_HPNA_1 17 /* HomePNA 1.0 (1Mb/s) */ a192 13 * IEEE 802.11 Wireless */ #define IFM_IEEE80211 0x00000080 #define IFM_IEEE80211_FH1 3 /* Frequency Hopping 1Mbps */ #define IFM_IEEE80211_FH2 4 /* Frequency Hopping 2Mbps */ #define IFM_IEEE80211_DS2 5 /* Direct Sequence 2Mbps */ #define IFM_IEEE80211_DS5 6 /* Direct Sequence 5Mbps*/ #define IFM_IEEE80211_DS11 7 /* Direct Sequence 11Mbps*/ #define IFM_IEEE80211_DS1 8 /* Direct Sequence 1Mbps */ #define IFM_IEEE80211_ADHOC 0x00000100 /* Operate in Adhoc mode */ /* d214 1 a214 1 #define IFM_TMASK 0x0000001f /* Media sub-type */ a228 9 /* Mask of "status valid" bits, for ifconfig(8). */ #define IFM_STATUS_VALID IFM_AVALID /* List of "status valid" bits, for ifconfig(8). */ #define IFM_STATUS_VALID_LIST { \ IFM_AVALID, \ 0, \ } a237 1 #define IFM_INST_ANY -1 a268 1 { IFM_IEEE80211, "IEEE802.11" }, \ d303 2 a304 2 { IFM_ETHER|IFM_1000_SX, "1000baseSX" }, \ { IFM_ETHER|IFM_1000_SX, "1000SX" }, \ a310 8 { IFM_ETHER|IFM_1000_LX, "1000baseLX" }, \ { IFM_ETHER|IFM_1000_LX, "1000LX" }, \ { IFM_ETHER|IFM_1000_CX, "1000baseCX" }, \ { IFM_ETHER|IFM_1000_CX, "1000CX" }, \ { IFM_ETHER|IFM_1000_TX, "1000baseTX" }, \ { IFM_ETHER|IFM_1000_TX, "1000TX" }, \ { IFM_ETHER|IFM_HPNA_1, "HomePNA1" }, \ { IFM_ETHER|IFM_HPNA_1, "HPNA1" }, \ a333 10 /* \ * IEEE 802.11 \ */ \ { IFM_IEEE80211|IFM_IEEE80211_FH1, "FH1" }, \ { IFM_IEEE80211|IFM_IEEE80211_FH2, "FH2" }, \ { IFM_IEEE80211|IFM_IEEE80211_DS1, "DS1" }, \ { IFM_IEEE80211|IFM_IEEE80211_DS2, "DS2" }, \ { IFM_IEEE80211|IFM_IEEE80211_DS5, "DS5" }, \ { IFM_IEEE80211|IFM_IEEE80211_DS11, "DS11" }, \ \ a358 2 { IFM_IEEE80211|IFM_IEEE80211_ADHOC, "adhoc" }, \ \ a359 74 } /* * Baudrate descriptions for the various media types. */ struct ifmedia_baudrate { int ifmb_word; /* media word */ int ifmb_baudrate; /* corresponding baudrate */ }; #define IFM_BAUDRATE_DESCRIPTIONS { \ { IFM_ETHER|IFM_10_T, IF_Mbps(10) }, \ { IFM_ETHER|IFM_10_2, IF_Mbps(10) }, \ { IFM_ETHER|IFM_10_5, IF_Mbps(10) }, \ { IFM_ETHER|IFM_100_TX, IF_Mbps(100) }, \ { IFM_ETHER|IFM_100_FX, IF_Mbps(100) }, \ { IFM_ETHER|IFM_100_T4, IF_Mbps(100) }, \ { IFM_ETHER|IFM_100_VG, IF_Mbps(100) }, \ { IFM_ETHER|IFM_100_T2, IF_Mbps(100) }, \ { IFM_ETHER|IFM_1000_SX, IF_Mbps(1000) }, \ { IFM_ETHER|IFM_10_STP, IF_Mbps(10) }, \ { IFM_ETHER|IFM_10_FL, IF_Mbps(10) }, \ { IFM_ETHER|IFM_1000_LX, IF_Mbps(1000) }, \ { IFM_ETHER|IFM_1000_CX, IF_Mbps(1000) }, \ { IFM_ETHER|IFM_1000_TX, IF_Mbps(1000) }, \ { IFM_ETHER|IFM_HPNA_1, IF_Mbps(1) }, \ \ { IFM_TOKEN|IFM_TOK_STP4, IF_Mbps(4) }, \ { IFM_TOKEN|IFM_TOK_STP16, IF_Mbps(16) }, \ { IFM_TOKEN|IFM_TOK_UTP4, IF_Mbps(4) }, \ { IFM_TOKEN|IFM_TOK_UTP16, IF_Mbps(16) }, \ \ { IFM_FDDI|IFM_FDDI_SMF, IF_Mbps(100) }, \ { IFM_FDDI|IFM_FDDI_MMF, IF_Mbps(100) }, \ { IFM_FDDI|IFM_FDDI_UTP, IF_Mbps(100) }, \ \ { IFM_IEEE80211|IFM_IEEE80211_FH1, IF_Mbps(1) }, \ { IFM_IEEE80211|IFM_IEEE80211_FH2, IF_Mbps(2) }, \ { IFM_IEEE80211|IFM_IEEE80211_DS2, IF_Mbps(2) }, \ { IFM_IEEE80211|IFM_IEEE80211_DS5, IF_Mbps(5) }, \ { IFM_IEEE80211|IFM_IEEE80211_DS11, IF_Mbps(11) }, \ { IFM_IEEE80211|IFM_IEEE80211_DS1, IF_Mbps(1) }, \ \ { 0, 0 }, \ } /* * Status bit descriptions for the various media types. */ struct ifmedia_status_description { int ifms_type; int ifms_valid; int ifms_bit; const char *ifms_string[2]; }; #define IFM_STATUS_DESC(ifms, bit) \ (ifms)->ifms_string[((ifms)->ifms_bit & (bit)) ? 1 : 0] #define IFM_STATUS_DESCRIPTIONS { \ { IFM_ETHER, IFM_AVALID, IFM_ACTIVE, \ { "no carrier", "active" } }, \ \ { IFM_FDDI, IFM_AVALID, IFM_ACTIVE, \ { "no ring", "inserted" } }, \ \ { IFM_TOKEN, IFM_AVALID, IFM_ACTIVE, \ { "no ring", "inserted" } }, \ \ { IFM_IEEE80211, IFM_AVALID, IFM_ACTIVE, \ { "no network", "active" } }, \ \ { 0, 0, 0, \ { NULL, NULL } }, \ @ 1.13.2.1 log @Pull up revisions 1.16-1.17,1.19,1.21-1.23 (requested by jhawk): Add a driver for ``wi'', Lucent "Orinoco"/Wavelan. @ text @d1 1 a1 1 /* $NetBSD$ */ a139 2 /* Compute baudrate for a given media. */ int ifmedia_baudrate __P((int)); d146 2 a147 1 * 0-4 Media subtype MAX SUBTYPE == 31! d167 1 a167 1 #define IFM_1000_SX 11 /* 1000BaseSX - multi-mode fiber */ a169 4 #define IFM_1000_LX 14 /* 1000baseLX - single-mode fiber */ #define IFM_1000_CX 15 /* 1000baseCX - 150ohm STP */ #define IFM_1000_TX 16 /* 1000baseTX - 4 pair cat 5 */ #define IFM_HPNA_1 17 /* HomePNA 1.0 (1Mb/s) */ a192 13 * IEEE 802.11 Wireless */ #define IFM_IEEE80211 0x00000080 #define IFM_IEEE80211_FH1 3 /* Frequency Hopping 1Mbps */ #define IFM_IEEE80211_FH2 4 /* Frequency Hopping 2Mbps */ #define IFM_IEEE80211_DS2 5 /* Direct Sequence 2Mbps */ #define IFM_IEEE80211_DS5 6 /* Direct Sequence 5Mbps*/ #define IFM_IEEE80211_DS11 7 /* Direct Sequence 11Mbps*/ #define IFM_IEEE80211_DS1 8 /* Direct Sequence 1Mbps */ #define IFM_IEEE80211_ADHOC 0x00000100 /* Operate in Adhoc mode */ /* d214 1 a214 1 #define IFM_TMASK 0x0000001f /* Media sub-type */ a268 1 { IFM_IEEE80211, "IEEE802.11" }, \ d303 2 a304 2 { IFM_ETHER|IFM_1000_SX, "1000baseSX" }, \ { IFM_ETHER|IFM_1000_SX, "1000SX" }, \ a310 8 { IFM_ETHER|IFM_1000_LX, "1000baseLX" }, \ { IFM_ETHER|IFM_1000_LX, "1000LX" }, \ { IFM_ETHER|IFM_1000_CX, "1000baseCX" }, \ { IFM_ETHER|IFM_1000_CX, "1000CX" }, \ { IFM_ETHER|IFM_1000_TX, "1000baseTX" }, \ { IFM_ETHER|IFM_1000_TX, "1000TX" }, \ { IFM_ETHER|IFM_HPNA_1, "HomePNA1" }, \ { IFM_ETHER|IFM_HPNA_1, "HPNA1" }, \ a333 10 /* \ * IEEE 802.11 \ */ \ { IFM_IEEE80211|IFM_IEEE80211_FH1, "FH1" }, \ { IFM_IEEE80211|IFM_IEEE80211_FH2, "FH2" }, \ { IFM_IEEE80211|IFM_IEEE80211_DS1, "DS1" }, \ { IFM_IEEE80211|IFM_IEEE80211_DS2, "DS2" }, \ { IFM_IEEE80211|IFM_IEEE80211_DS5, "DS5" }, \ { IFM_IEEE80211|IFM_IEEE80211_DS11, "DS11" }, \ \ a358 2 { IFM_IEEE80211|IFM_IEEE80211_ADHOC, "adhoc" }, \ \ a359 44 } /* * Baudrate descriptions for the various media types. */ struct ifmedia_baudrate { int ifmb_word; /* media word */ int ifmb_baudrate; /* corresponding baudrate */ }; #define IFM_BAUDRATE_DESCRIPTIONS { \ { IFM_ETHER|IFM_10_T, IF_Mbps(10) }, \ { IFM_ETHER|IFM_10_2, IF_Mbps(10) }, \ { IFM_ETHER|IFM_10_5, IF_Mbps(10) }, \ { IFM_ETHER|IFM_100_TX, IF_Mbps(100) }, \ { IFM_ETHER|IFM_100_FX, IF_Mbps(100) }, \ { IFM_ETHER|IFM_100_T4, IF_Mbps(100) }, \ { IFM_ETHER|IFM_100_VG, IF_Mbps(100) }, \ { IFM_ETHER|IFM_100_T2, IF_Mbps(100) }, \ { IFM_ETHER|IFM_1000_SX, IF_Mbps(1000) }, \ { IFM_ETHER|IFM_10_STP, IF_Mbps(10) }, \ { IFM_ETHER|IFM_10_FL, IF_Mbps(10) }, \ { IFM_ETHER|IFM_1000_LX, IF_Mbps(1000) }, \ { IFM_ETHER|IFM_1000_CX, IF_Mbps(1000) }, \ { IFM_ETHER|IFM_1000_TX, IF_Mbps(1000) }, \ { IFM_ETHER|IFM_HPNA_1, IF_Mbps(1) }, \ \ { IFM_TOKEN|IFM_TOK_STP4, IF_Mbps(4) }, \ { IFM_TOKEN|IFM_TOK_STP16, IF_Mbps(16) }, \ { IFM_TOKEN|IFM_TOK_UTP4, IF_Mbps(4) }, \ { IFM_TOKEN|IFM_TOK_UTP16, IF_Mbps(16) }, \ \ { IFM_FDDI|IFM_FDDI_SMF, IF_Mbps(100) }, \ { IFM_FDDI|IFM_FDDI_MMF, IF_Mbps(100) }, \ { IFM_FDDI|IFM_FDDI_UTP, IF_Mbps(100) }, \ \ { IFM_IEEE80211|IFM_IEEE80211_FH1, IF_Mbps(1) }, \ { IFM_IEEE80211|IFM_IEEE80211_FH2, IF_Mbps(2) }, \ { IFM_IEEE80211|IFM_IEEE80211_DS2, IF_Mbps(2) }, \ { IFM_IEEE80211|IFM_IEEE80211_DS5, IF_Mbps(5) }, \ { IFM_IEEE80211|IFM_IEEE80211_DS11, IF_Mbps(11) }, \ { IFM_IEEE80211|IFM_IEEE80211_DS1, IF_Mbps(1) }, \ \ { 0, 0 }, \ @ 1.13.12.1 log @Pull up to last week's -current. @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.15 1999/11/03 23:06:35 thorpej Exp $ */ d103 1 a103 1 TAILQ_ENTRY(ifmedia_entry) ifm_list; d117 1 a117 1 TAILQ_HEAD(, ifmedia_entry) ifm_list; /* list of all supported media */ a138 4 /* Look up a media entry. */ struct ifmedia_entry *ifmedia_match __P((struct ifmedia *ifm, int flags, int mask)); @ 1.13.10.1 log @Sync with -current @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.15 1999/11/03 23:06:35 thorpej Exp $ */ d103 1 a103 1 TAILQ_ENTRY(ifmedia_entry) ifm_list; d117 1 a117 1 TAILQ_HEAD(, ifmedia_entry) ifm_list; /* list of all supported media */ a138 4 /* Look up a media entry. */ struct ifmedia_entry *ifmedia_match __P((struct ifmedia *ifm, int flags, int mask)); @ 1.12 log @Add "10baseT-FDX" and "100baseTX-FDX" aliases to the end of the subtype table. These are actually subtype+option combos, but these are the strings displayed by the MII code to indicate 10Mbps full-duplex and 100Mbps full-duplex respectively, and it's Nice that ifconfig(8) can grok them. @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.11 1998/08/12 23:23:29 thorpej Exp $ */ d204 1 @ 1.11 log @Oops, I forgot aliases for some old names (10baseT/UTP, 10base2/BNC, and 10base5/AUI). @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.10 1998/08/08 22:12:30 thorpej Exp $ */ d326 6 @ 1.10 log @Define IFM_INST_MAX, the largest possible "instance" value. @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.9 1998/08/06 19:16:37 thorpej Exp $ */ d281 1 d285 1 d289 1 @ 1.9 log @Define the minimum and maximum "network type" values. These values are incremented by the minimum to interate through them. @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.8 1998/08/06 02:38:19 thorpej Exp $ */ d235 2 @ 1.8 log @Add a macro to create a media word from type, subtype, options, and instance. @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.7 1998/08/06 02:19:34 thorpej Exp $ */ d218 3 @ 1.7 log @Completely rewrite the way media descriptions are represented. The same data structure is used, but a much saner matching mechanism is used, one which allows greater ease in adding new types. @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.6 1998/08/03 12:42:26 thorpej Exp $ */ d232 6 @ 1.6 log @Add IFM_10_FL - 10baseFL (fiber) @ text @d1 38 a38 1 /* $NetBSD: if_media.h,v 1.5 1998/01/30 08:37:41 jtc Exp $ */ d231 1 d237 8 a244 2 * NOTE: all but the top-level type descriptions must contain NO whitespace! * Otherwise, parsing these in ifconfig(8) would be a nightmare. d252 86 a337 104 { IFM_ETHER, "Ethernet" }, \ { IFM_TOKEN, "Token ring" }, \ { IFM_FDDI, "FDDI" }, \ { 0, NULL }, \ } #define IFM_SUBTYPE_ETHERNET_DESCRIPTIONS { \ { IFM_10_T, "10baseT/UTP" }, \ { IFM_10_2, "10base2/BNC" }, \ { IFM_10_5, "10base5/AUI" }, \ { IFM_100_TX, "100baseTX" }, \ { IFM_100_FX, "100baseFX" }, \ { IFM_100_T4, "100baseT4" }, \ { IFM_100_VG, "100baseVG" }, \ { IFM_100_T2, "100baseT2" }, \ { IFM_1000_FX, "1000baseFX" }, \ { IFM_10_STP, "10baseT/STP" }, \ { IFM_10_FL, "10baseFL" }, \ { 0, NULL }, \ } #define IFM_SUBTYPE_ETHERNET_ALIASES { \ { IFM_10_T, "UTP" }, \ { IFM_10_T, "10UTP" }, \ { IFM_10_2, "BNC" }, \ { IFM_10_2, "10BNC" }, \ { IFM_10_5, "AUI" }, \ { IFM_10_5, "10AUI" }, \ { IFM_100_TX, "100TX" }, \ { IFM_100_FX, "100FX" }, \ { IFM_100_T4, "100T4" }, \ { IFM_100_VG, "100VG" }, \ { IFM_100_T2, "100T2" }, \ { IFM_1000_FX, "1000FX" }, \ { IFM_10_STP, "STP" }, \ { IFM_10_FL, "10FL" }, \ { 0, NULL }, \ } #define IFM_SUBTYPE_ETHERNET_OPTION_DESCRIPTIONS { \ { 0, NULL }, \ } #define IFM_SUBTYPE_TOKENRING_DESCRIPTIONS { \ { IFM_TOK_STP4, "DB9/4Mbit" }, \ { IFM_TOK_STP16, "DB9/16Mbit" }, \ { IFM_TOK_UTP4, "UTP/4Mbit" }, \ { IFM_TOK_UTP16, "UTP/16Mbit" }, \ { 0, NULL }, \ } #define IFM_SUBTYPE_TOKENRING_ALIASES { \ { IFM_TOK_STP4, "4STP" }, \ { IFM_TOK_STP16, "16STP" }, \ { IFM_TOK_UTP4, "4UTP" }, \ { IFM_TOK_UTP16, "16UTP" }, \ { 0, NULL }, \ } #define IFM_SUBTYPE_TOKENRING_OPTION_DESCRIPTIONS { \ { IFM_TOK_ETR, "EarlyTokenRelease" }, \ { IFM_TOK_SRCRT, "SourceRouting" }, \ { IFM_TOK_ALLR, "AllRoutes" }, \ { 0, NULL }, \ } #define IFM_SUBTYPE_FDDI_DESCRIPTIONS { \ { IFM_FDDI_SMF, "Single-mode" }, \ { IFM_FDDI_MMF, "Multi-mode" }, \ { IFM_FDDI_UTP, "UTP" }, \ { 0, NULL }, \ } #define IFM_SUBTYPE_FDDI_ALIASES { \ { IFM_FDDI_SMF, "SMF" }, \ { IFM_FDDI_MMF, "MMF" }, \ { IFM_FDDI_UTP, "CDDI" }, \ { 0, NULL }, \ } #define IFM_SUBTYPE_FDDI_OPTION_DESCRIPTIONS { \ { IFM_FDDI_DA, "Dual-attach" }, \ { 0, NULL }, \ } #define IFM_SUBTYPE_SHARED_DESCRIPTIONS { \ { IFM_AUTO, "autoselect" }, \ { IFM_MANUAL, "manual" }, \ { IFM_NONE, "none" }, \ { 0, NULL }, \ } #define IFM_SUBTYPE_SHARED_ALIASES { \ { IFM_AUTO, "auto" }, \ { 0, NULL }, \ } #define IFM_SHARED_OPTION_DESCRIPTIONS { \ { IFM_FDX, "full-duplex" }, \ { IFM_HDX, "half-duplex" }, \ { IFM_FLAG0, "flag0" }, \ { IFM_FLAG1, "flag1" }, \ { IFM_FLAG2, "flag2" }, \ { IFM_LOOP, "hw-loopback" }, \ @ 1.5 log @Fix tipo @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.4 1998/01/30 01:24:40 thorpej Exp $ */ d132 1 d225 1 d243 1 @ 1.4 log @Add 1000baseFX and 10baseT/STP Ethernet media types. @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.3 1997/03/26 01:19:27 thorpej Exp $ */ d240 1 a240 1 { IFM_10_STP, "STP", } \ @ 1.3 log @Back out the previous change (add IFM_10_EXT) after some dicussion w/ BSDI and Matt Thomas. @ text @d1 1 a1 1 /* $NetBSD: if_media.h,v 1.1 1997/03/17 02:55:17 thorpej Exp $ */ d130 2 d222 2 d239 2 @ 1.2 log @Add the IFM_10_EXT ("external") ethernet subtype, to accomodate cards that have the notion of an "external media port". Suggested by Matt Thomas . @ text @a115 2 * * NOTE: If you add a media subtype, always add it to the end! a129 1 #define IFM_10_EXT 11 /* misc. "external" port */ a219 1 { IFM_10_EXT, "external" }, \ a234 1 { IFM_10_EXT, "ext" }, \ @ 1.1 log @BSD/OS-style network interface media selection, implemented by Jonathan Stone and myself. Many thanks to Matt Thomas for providing the information necessary to implement this interface, and for helping to shake out the bugs. @ text @d1 1 a1 1 /* $NetBSD$ */ d116 2 d132 1 d223 1 d239 1 @