Lines Matching defs:ifm

71 static struct ifmedia_entry *ifmedia_match(struct ifmedia *ifm,
87 ifmedia_init(struct ifmedia *ifm, int dontcare_mask,
91 LIST_INIT(&ifm->ifm_list);
92 ifm->ifm_cur = NULL;
93 ifm->ifm_media = 0;
94 ifm->ifm_mask = dontcare_mask; /* IF don't-care bits */
95 ifm->ifm_change = change_callback;
96 ifm->ifm_status = status_callback;
100 ifmedia_removeall(struct ifmedia *ifm)
104 while ((entry = LIST_FIRST(&ifm->ifm_list)) != NULL) {
108 ifm->ifm_cur = NULL;
116 ifmedia_add(struct ifmedia *ifm, int mword, int data, void *aux)
122 if (ifm == NULL) {
123 printf("ifmedia_add: null ifm\n");
139 LIST_INSERT_HEAD(&ifm->ifm_list, entry, ifm_list);
147 ifmedia_list_add(struct ifmedia *ifm, struct ifmedia_entry *lp, int count)
152 ifmedia_add(ifm, lp[i].ifm_media, lp[i].ifm_data,
164 ifmedia_set(struct ifmedia *ifm, int target)
168 match = ifmedia_match(ifm, target, ifm->ifm_mask);
172 target, ~ifm->ifm_mask);
175 ifm->ifm_cur = match;
182 ifmedia_printword(ifm->ifm_cur->ifm_media);
206 ifmedia_ioctl(struct ifnet *ifp, struct ifreq *ifr, struct ifmedia *ifm,
213 if (ifp == NULL || ifr == NULL || ifm == NULL)
226 match = ifmedia_match(ifm, newmedia, ifm->ifm_mask);
232 newmedia, ifm->ifm_mask);
245 newmedia == ifm->ifm_media && match == ifm->ifm_cur)
260 oldentry = ifm->ifm_cur;
261 oldmedia = ifm->ifm_media;
262 ifm->ifm_cur = match;
263 ifm->ifm_media = newmedia;
264 error = (*ifm->ifm_change)(ifp);
266 ifm->ifm_cur = oldentry;
267 ifm->ifm_media = oldmedia;
285 ifmr->ifm_active = ifmr->ifm_current = ifm->ifm_cur ?
286 compat_media(ifm->ifm_cur->ifm_media) : IFM_NONE;
288 ifmr->ifm_active = ifmr->ifm_current = ifm->ifm_cur ?
289 ifm->ifm_cur->ifm_media : IFM_NONE;
291 ifmr->ifm_mask = ifm->ifm_mask;
293 (*ifm->ifm_status)(ifp, ifmr);
302 LIST_FOREACH(ep, &ifm->ifm_list, ifm_list) {
325 * Find media entry matching a given ifm word.
329 ifmedia_match(struct ifmedia *ifm, int target, int mask)
336 LIST_FOREACH(next, &ifm->ifm_list, ifm_list) {