Add macros which follow the miidevs design pattern to make it easier

to construct tables for mii_phy_match.
This commit is contained in:
Warner Losh 2005-09-30 14:45:10 +00:00
parent 4041bad612
commit a1039f82ae
2 changed files with 6 additions and 8 deletions

View File

@ -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.

View File

@ -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