o check hal ABI version to catch driver-HAL mismatches

o print MAC, PHY, and radio h/w revisions at attach
This commit is contained in:
Sam Leffler 2003-11-01 03:37:33 +00:00
parent d0342231f9
commit 85bdc65a80
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=121840

View file

@ -196,6 +196,22 @@ ath_attach(u_int16_t devid, struct ath_softc *sc)
error = ENXIO;
goto bad;
}
if (ah->ah_abi != HAL_ABI_VERSION) {
if_printf(ifp, "HAL ABI mismatch detected (0x%x != 0x%x)\n",
ah->ah_abi, HAL_ABI_VERSION);
error = ENXIO;
goto bad;
}
if_printf(ifp, "mac %d.%d phy %d.%d",
ah->ah_macVersion, ah->ah_macRev,
ah->ah_phyRev >> 4, ah->ah_phyRev & 0xf);
if (ah->ah_analog5GhzRev)
printf(" 5ghz radio %d.%d",
ah->ah_analog5GhzRev >> 4, ah->ah_analog5GhzRev & 0xf);
if (ah->ah_analog2GhzRev)
printf(" 2ghz radio %d.%d",
ah->ah_analog2GhzRev >> 4, ah->ah_analog2GhzRev & 0xf);
printf("\n");
sc->sc_ah = ah;
sc->sc_invalid = 0; /* ready to go, enable interrupt handling */