From: bluhm Date: Sun, 10 Jul 2022 21:13:41 +0000 (+0000) Subject: Add _cb suffix to callback fields in struct ifmedia. Makes code X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=77574026dba4970f125a32f7493e09fdc191efac;p=openbsd Add _cb suffix to callback fields in struct ifmedia. Makes code easier to read and grep as ifm_status was used in both structs ifmediareq and ifmedia with different meaning. OK mvs@ --- diff --git a/sys/dev/pci/if_pcn.c b/sys/dev/pci/if_pcn.c index 5db8af9da3f..f5661f45ef9 100644 --- a/sys/dev/pci/if_pcn.c +++ b/sys/dev/pci/if_pcn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_pcn.c,v 1.47 2022/03/11 18:00:48 mpi Exp $ */ +/* $OpenBSD: if_pcn.c,v 1.48 2022/07/10 21:13:41 bluhm Exp $ */ /* $NetBSD: if_pcn.c,v 1.26 2005/05/07 09:15:44 is Exp $ */ /* @@ -1622,7 +1622,7 @@ pcn_init(struct ifnet *ifp) } /* Set the media. */ - (void) (*sc->sc_mii.mii_media.ifm_change)(ifp); + (void) (*sc->sc_mii.mii_media.ifm_change_cb)(ifp); /* Enable interrupts and external activity (and ACK IDON). */ pcn_csr_write(sc, LE_CSR0, LE_C0_INEA|LE_C0_STRT|LE_C0_IDON); diff --git a/sys/dev/usb/if_athn_usb.c b/sys/dev/usb/if_athn_usb.c index 68407480a67..49d5c06cf2d 100644 --- a/sys/dev/usb/if_athn_usb.c +++ b/sys/dev/usb/if_athn_usb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_athn_usb.c,v 1.64 2022/04/21 21:03:03 stsp Exp $ */ +/* $OpenBSD: if_athn_usb.c,v 1.65 2022/07/10 21:13:41 bluhm Exp $ */ /*- * Copyright (c) 2011 Damien Bergamini @@ -354,7 +354,7 @@ athn_usb_attachhook(struct device *self) ic->ic_ampdu_tx_stop = athn_usb_ampdu_tx_stop; #endif ic->ic_newstate = athn_usb_newstate; - ic->ic_media.ifm_change = athn_usb_media_change; + ic->ic_media.ifm_change_cb = athn_usb_media_change; timeout_set(&sc->scan_to, athn_usb_next_scan, usc); ops->rx_enable = athn_usb_rx_enable; diff --git a/sys/net/if_media.c b/sys/net/if_media.c index 3bb13177032..3173bda4696 100644 --- a/sys/net/if_media.c +++ b/sys/net/if_media.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_media.c,v 1.32 2022/04/07 16:41:13 naddy Exp $ */ +/* $OpenBSD: if_media.c,v 1.33 2022/07/10 21:13:41 bluhm Exp $ */ /* $NetBSD: if_media.c,v 1.10 2000/03/13 23:52:39 soren Exp $ */ /*- @@ -113,8 +113,8 @@ ifmedia_init(struct ifmedia *ifm, uint64_t dontcare_mask, ifm->ifm_cur = NULL; ifm->ifm_media = 0; ifm->ifm_mask = dontcare_mask; /* IF don't-care bits */ - ifm->ifm_change = change_callback; - ifm->ifm_status = status_callback; + ifm->ifm_change_cb = change_callback; + ifm->ifm_status_cb = status_callback; } /* @@ -276,7 +276,7 @@ ifmedia_ioctl(struct ifnet *ifp, struct ifreq *ifr, struct ifmedia *ifm, oldmedia = ifm->ifm_media; ifm->ifm_cur = match; ifm->ifm_media = newmedia; - error = (*ifm->ifm_change)(ifp); + error = (*ifm->ifm_change_cb)(ifp); if (error && error != ENETRESET) { ifm->ifm_cur = oldentry; ifm->ifm_media = oldmedia; @@ -300,7 +300,7 @@ ifmedia_ioctl(struct ifnet *ifp, struct ifreq *ifr, struct ifmedia *ifm, ifm->ifm_cur->ifm_media : IFM_NONE; ifmr->ifm_mask = ifm->ifm_mask; ifmr->ifm_status = 0; - (*ifm->ifm_status)(ifp, ifmr); + (*ifm->ifm_status_cb)(ifp, ifmr); /* * Count them so we know a-priori how much is the max we'll diff --git a/sys/net/if_media.h b/sys/net/if_media.h index e39e3dc8638..74278b0e1cf 100644 --- a/sys/net/if_media.h +++ b/sys/net/if_media.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if_media.h,v 1.42 2021/11/10 04:46:25 dlg Exp $ */ +/* $OpenBSD: if_media.h,v 1.43 2022/07/10 21:13:41 bluhm Exp $ */ /* $NetBSD: if_media.h,v 1.22 2000/02/17 21:53:16 sommerfeld Exp $ */ /*- @@ -98,8 +98,8 @@ struct ifmedia { uint64_t ifm_media; /* current user-set media word */ struct ifmedia_entry *ifm_cur; /* currently 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 */ + ifm_change_cb_t ifm_change_cb; /* media change driver callback */ + ifm_stat_cb_t ifm_status_cb; /* media status driver callback */ }; /* Initialize an interface's struct if_media field. */