Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/ismt/ismt.c
Context not available. | |||||
#define ID_INTEL_S1200_SMT1 0x0c5a8086 | #define ID_INTEL_S1200_SMT1 0x0c5a8086 | ||||
#define ID_INTEL_C2000_SMT 0x1f158086 | #define ID_INTEL_C2000_SMT 0x1f158086 | ||||
static struct ismt_dev { | |||||
uint32_t devid; | |||||
const char *description; | |||||
} ismt_devs[] = { | |||||
{ID_INTEL_S1200_SMT0, "Atom Processor S1200 SMBus 2.0 Controller 0"}, | |||||
{ID_INTEL_S1200_SMT1, "Atom Processor S1200 SMBus 2.0 Controller 1"}, | |||||
{ID_INTEL_C2000_SMT, "Atom Processor C2000 SMBus 2.0"}, | |||||
{0, NULL}, | |||||
}; | |||||
static int | static int | ||||
ismt_probe(device_t dev) | ismt_probe(device_t dev) | ||||
{ | { | ||||
const char *desc; | uint32_t did; | ||||
size_t i; | |||||
switch (pci_get_devid(dev)) { | did = pci_get_devid(dev); | ||||
case ID_INTEL_S1200_SMT0: | const struct ismt_dev *ismtd; | ||||
desc = "Atom Processor S1200 SMBus 2.0 Controller 0"; | for(i=0; i<nitems(ismt_devs) - 1; i++){ | ||||
break; | ismtd = &ismt_devs[i]; | ||||
case ID_INTEL_S1200_SMT1: | if(did == ismtd->devid){ | ||||
desc = "Atom Processor S1200 SMBus 2.0 Controller 1"; | device_set_desc(dev, ismtd->description); | ||||
break; | return (BUS_PROBE_DEFAULT); | ||||
case ID_INTEL_C2000_SMT: | } | ||||
desc = "Atom Processor C2000 SMBus 2.0"; | |||||
break; | |||||
default: | |||||
return (ENXIO); | |||||
} | } | ||||
return (ENXIO); | |||||
device_set_desc(dev, desc); | |||||
return (BUS_PROBE_DEFAULT); | |||||
} | } | ||||
/* Device methods */ | /* Device methods */ | ||||
Context not available. | |||||
static devclass_t ismt_pci_devclass; | static devclass_t ismt_pci_devclass; | ||||
DRIVER_MODULE(ismt, pci, ismt_pci_driver, ismt_pci_devclass, 0, 0); | DRIVER_MODULE(ismt, pci, ismt_pci_driver, ismt_pci_devclass, 0, 0); | ||||
MODULE_PNP_INFO("W32:vendor/device;D:#", pci, ismt, ismt_devs, | |||||
sizeof(ismt_devs[0]), nitems(ismt_devs) - 1); | |||||
DRIVER_MODULE(smbus, ismt, smbus_driver, smbus_devclass, 0, 0); | DRIVER_MODULE(smbus, ismt, smbus_driver, smbus_devclass, 0, 0); | ||||
MODULE_DEPEND(ismt, pci, 1, 1, 1); | MODULE_DEPEND(ismt, pci, 1, 1, 1); | ||||
Context not available. |