freebsd-dev/sbin/ifconfig
Doug Ambrisko 499e862cae Change the ifr_media operation to only get its value and only set
its value once per ifconfig run.  Use Sam's new callback
operation to set it when everything is done.

The purpose for this is that if you did something like
	ifconfig bge0 media 100baseTX mediaopt full-duplex
multiple times it would end up causing the PHY to re-sync
since it would send the IOCTLs:
	ifconfig bge0 media 100baseTX -mediaopt full-duplex
	ifconfig bge0 media 100baseTX mediaopt full-duplex
This would cause the PHY to be updated twice even though
there really wasn't any change since the check in
sys/net/if_media.c would always fail.

Caveat is that this doesn't fix the case of:
	ifconfig bge0 media autoselect
etc. since in sys/net/if_media.c it forces an autoselect to go through
the entire process in ifmedia_ioctl :-( :
          /*
           * If no change, we're done.
           * XXX Automedia may invole software intervention.
           *     Keep going in case the the connected media changed.
           *     Similarly, if best match changed (kernel debugger?).
           */
           if ((IFM_SUBTYPE(newmedia) != IFM_AUTO) &&
                (newmedia == ifm->ifm_media) &&
                (match == ifm->ifm_cur))
                     return 0;

Briefly looked at by:	sam
2005-01-27 16:40:12 +00:00
..
af_atalk.c Overhaul to cleanup some of the tangled logic that's grown over the years. 2004-12-08 19:18:07 +00:00
af_inet6.c Overhaul to cleanup some of the tangled logic that's grown over the years. 2004-12-08 19:18:07 +00:00
af_inet.c Overhaul to cleanup some of the tangled logic that's grown over the years. 2004-12-08 19:18:07 +00:00
af_ipx.c Overhaul to cleanup some of the tangled logic that's grown over the years. 2004-12-08 19:18:07 +00:00
af_link.c Fix special status reporting. Prior to the reorg there was 2004-12-31 19:46:27 +00:00
ifclone.c Overhaul to cleanup some of the tangled logic that's grown over the years. 2004-12-08 19:18:07 +00:00
ifconfig.8 Sort sections. 2005-01-18 10:09:38 +00:00
ifconfig.c Fix special status reporting. Prior to the reorg there was 2004-12-31 19:46:27 +00:00
ifconfig.h Fix special status reporting. Prior to the reorg there was 2004-12-31 19:46:27 +00:00
ifieee80211.c Fix special status reporting. Prior to the reorg there was 2004-12-31 19:46:27 +00:00
ifmac.c Fix special status reporting. Prior to the reorg there was 2004-12-31 19:46:27 +00:00
ifmedia.c Change the ifr_media operation to only get its value and only set 2005-01-27 16:40:12 +00:00
ifvlan.c Fix special status reporting. Prior to the reorg there was 2004-12-31 19:46:27 +00:00
Makefile Overhaul to cleanup some of the tangled logic that's grown over the years. 2004-12-08 19:18:07 +00:00