| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: if_media.h,v 1.67 2019/11/28 14:08:22 msaitoh Exp $ */ | | 1 | /* $NetBSD: if_media.h,v 1.68 2019/12/05 05:29:27 msaitoh Exp $ */ |
2 | | | 2 | |
3 | /*- | | 3 | /*- |
4 | * Copyright (c) 1998, 2000, 2001 The NetBSD Foundation, Inc. | | 4 | * Copyright (c) 1998, 2000, 2001 The NetBSD Foundation, Inc. |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * This code is derived from software contributed to The NetBSD Foundation | | 7 | * This code is derived from software contributed to The NetBSD Foundation |
8 | * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility, | | 8 | * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility, |
9 | * NASA Ames Research Center. | | 9 | * NASA Ames Research Center. |
10 | * | | 10 | * |
11 | * Redistribution and use in source and binary forms, with or without | | 11 | * Redistribution and use in source and binary forms, with or without |
12 | * modification, are permitted provided that the following conditions | | 12 | * modification, are permitted provided that the following conditions |
13 | * are met: | | 13 | * are met: |
14 | * 1. Redistributions of source code must retain the above copyright | | 14 | * 1. Redistributions of source code must retain the above copyright |
| @@ -873,28 +873,35 @@ typedef void (*ifm_stat_cb_t)(struct ifn | | | @@ -873,28 +873,35 @@ typedef void (*ifm_stat_cb_t)(struct ifn |
873 | struct ifmedia_entry { | | 873 | struct ifmedia_entry { |
874 | TAILQ_ENTRY(ifmedia_entry) ifm_list; | | 874 | TAILQ_ENTRY(ifmedia_entry) ifm_list; |
875 | u_int ifm_media; /* IFMWD: description of this media */ | | 875 | u_int ifm_media; /* IFMWD: description of this media */ |
876 | u_int ifm_data; /* for driver-specific use */ | | 876 | u_int ifm_data; /* for driver-specific use */ |
877 | void *ifm_aux; /* for driver-specific use */ | | 877 | void *ifm_aux; /* for driver-specific use */ |
878 | }; | | 878 | }; |
879 | | | 879 | |
880 | /* | | 880 | /* |
881 | * One of these goes into a network interface's softc structure. | | 881 | * One of these goes into a network interface's softc structure. |
882 | * It is used to keep general media state. | | 882 | * It is used to keep general media state. |
883 | */ | | 883 | */ |
884 | struct ifmedia { | | 884 | struct ifmedia { |
885 | u_int ifm_mask; /* IFMWD: mask of changes we don't care */ | | 885 | u_int ifm_mask; /* IFMWD: mask of changes we don't care */ |
886 | u_int ifm_media; /* IFMWD: current active media word */ | | 886 | u_int ifm_media; /* |
887 | struct ifmedia_entry *ifm_cur; /* current user-selected media */ | | 887 | * IFMWD: current use-set media word. |
| | | 888 | * |
| | | 889 | * XXX some drivers misuse this entry as |
| | | 890 | * current active media word. Don't use this |
| | | 891 | * entry as this purpose but use driver |
| | | 892 | * specific entry if you don't use mii(4). |
| | | 893 | */ |
| | | 894 | struct ifmedia_entry *ifm_cur; /* current user-selected media entry */ |
888 | TAILQ_HEAD(, ifmedia_entry) ifm_list; /* list of all supported media */ | | 895 | TAILQ_HEAD(, ifmedia_entry) ifm_list; /* list of all supported media */ |
889 | ifm_change_cb_t ifm_change; /* media change driver callback */ | | 896 | ifm_change_cb_t ifm_change; /* media change driver callback */ |
890 | ifm_stat_cb_t ifm_status; /* media status driver callback */ | | 897 | ifm_stat_cb_t ifm_status; /* media status driver callback */ |
891 | }; | | 898 | }; |
892 | | | 899 | |
893 | /* Initialize an interface's struct if_media field. */ | | 900 | /* Initialize an interface's struct if_media field. */ |
894 | void ifmedia_init(struct ifmedia *, int, ifm_change_cb_t, ifm_stat_cb_t); | | 901 | void ifmedia_init(struct ifmedia *, int, ifm_change_cb_t, ifm_stat_cb_t); |
895 | | | 902 | |
896 | int ifmedia_change(struct ifmedia *, struct ifnet *); | | 903 | int ifmedia_change(struct ifmedia *, struct ifnet *); |
897 | | | 904 | |
898 | /* Add one supported medium to a struct ifmedia. */ | | 905 | /* Add one supported medium to a struct ifmedia. */ |
899 | void ifmedia_add(struct ifmedia *, int, int, void *); | | 906 | void ifmedia_add(struct ifmedia *, int, int, void *); |
900 | | | 907 | |