Some drivers rely on the existence of certain keys. The Atheros 9xxx

driver for example requests the NetCfgInstanceId but doesn't check the
returned status code and will happily access random memory instead.

Submitted by:	Paul B Mahol <onemda at gmail.com>
MFC after:	2 weeks
This commit is contained in:
Bernhard Schmidt 2010-11-29 10:10:56 +00:00
parent b77a4a441b
commit a94ca271e7
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=216049

View File

@ -331,6 +331,16 @@ ndis_create_sysctls(arg)
ndis_add_sysctl(sc, "NdisVersion",
"NDIS API Version", "0x00050001", CTLFLAG_RD);
/*
* Some miniport drivers rely on the existence of the SlotNumber,
* NetCfgInstanceId and DriverDesc keys.
*/
ndis_add_sysctl(sc, "SlotNumber", "Slot Numer", "01", CTLFLAG_RD);
ndis_add_sysctl(sc, "NetCfgInstanceId", "NetCfgInstanceId",
"{12345678-1234-5678-CAFE0-123456789ABC}", CTLFLAG_RD);
ndis_add_sysctl(sc, "DriverDesc", "Driver Description",
"NDIS Network Adapter", CTLFLAG_RD);
/* Bus type (PCI, PCMCIA, etc...) */
sprintf(buf, "%d", (int)sc->ndis_iftype);
ndis_add_sysctl(sc, "BusType", "Bus Type", buf, CTLFLAG_RD);