The NetBSD Project

CVS log for src/sys/compat/common/compat_mod.h

[BACK] Up to [cvs.NetBSD.org] / src / sys / compat / common

Request diff between arbitrary revisions


Default branch: MAIN
Current tag: netbsd-9-2-RELEASE


Revision 1.5 / (download) - annotate - [select for diffs], Fri May 17 07:37:11 2019 UTC (4 years, 11 months ago) by msaitoh
Branch: MAIN
CVS Tags: phil-wifi-20190609, netbsd-9-base, netbsd-9-3-RELEASE, netbsd-9-2-RELEASE, netbsd-9-1-RELEASE, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1, netbsd-9
Changes since 1.4: +3 -1 lines
Diff to previous 1.4 (colored)

 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()

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.




CVSweb <webmaster@jp.NetBSD.org>