diff --git a/sys/dev/mii/miivar.h b/sys/dev/mii/miivar.h index f6c759c40e93..f1d16f705a88 100644 --- a/sys/dev/mii/miivar.h +++ b/sys/dev/mii/miivar.h @@ -161,6 +161,9 @@ struct mii_phydesc { u_int32_t mpd_model; /* the PHY's model */ const char *mpd_name; /* the PHY's name */ }; +#define MII_PHY_DESC(a, b) { MII_OUI_ ## a, MII_MODEL_ ## a ## _ ## b, \ + MII_STR_ ## a ## _ ## b } +#define MII_PHY_END { 0, 0, NULL } /* * An array of these structures map MII media types to BMCR/ANAR settings. diff --git a/sys/dev/mii/nsgphy.c b/sys/dev/mii/nsgphy.c index 259739e15a81..625b2e628e85 100644 --- a/sys/dev/mii/nsgphy.c +++ b/sys/dev/mii/nsgphy.c @@ -101,14 +101,9 @@ static int nsgphy_service(struct mii_softc *, struct mii_data *,int); static void nsgphy_status(struct mii_softc *); const struct mii_phydesc gphyters[] = { - { MII_OUI_NATSEMI, MII_MODEL_NATSEMI_DP83861, - MII_STR_NATSEMI_DP83861 }, - - { MII_OUI_NATSEMI, MII_MODEL_NATSEMI_DP83891, - MII_STR_NATSEMI_DP83891 }, - - { 0, 0, - NULL }, + MII_PHY_DESC(NATSEMI, DP83861), + MII_PHY_DESC(NATSEMI, DP83891), + MII_PHY_END }; static int