Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: src/sys/net



Module Name:    src
Committed By:   msaitoh
Date:           Thu Nov 28 14:08:22 UTC 2019

Modified Files:
        src/sys/net: if_media.h

Log Message:
 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.


To generate a diff of this commit:
cvs rdiff -u -r1.66 -r1.67 src/sys/net/if_media.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.




Home | Main Index | Thread Index | Old Index