Tie ifmedia to the generic framework of new ifnet KPI.
Implementation:
o struct if_media goes opaque into if_media.c
o ifmedia is an optional softc (keyword IF_MEDIA) of an interface.
o if_media.h declares just preprocessor defines to manipulate media
bits. Since a conservative decision was taken in r281236, the media information remains a single 32-bit word. However, to improve type checking it is declared as if_media_t, not a bare integer. if_media.h is now automatically included from if.h
o if_attach() calls ifmedia_alloc(). if_free() calls ifmedia_free().
Driver changes:
o Drivers supply ifop_media_change and ifop_media_status callbacks in
their ifdriver ifops. This were arguments to ifmedia_init() before. The ifop_media_change() callback gets additional argument of the new media, we are trying to swtich to.
o On attach, drivers supply array of supported media words in ifat_mediae,
currently chose media in ifat_media and optional ifat_mediamask. Drivers may change the media array later via if_media_change().
o Drivers don't need to support SIOCSIFMEDIA, SIOCGIFMEDIA. The stack
does now.
o Drivers may call if_media_status() if they are running autonegotiation
and wish to report new status. The function updates link state and baudrate of the interface.
Sponsored by: Netflix
Sponsored by: Nginx, Inc.