*/
#include <udi.h>
#include <udi_physio.h>
+#include <udi_pci.h>
#include <acess.h>
#include <drv_pci.h> // acess
Uint16 ven, dev;
Uint32 class;
PCI_GetDeviceInfo(rdata->cur_iter, &ven, &dev, &class);
-
+ Uint8 revision;
+ PCI_GetDeviceVersion(rdata->cur_iter, &revision);
+ Uint16 sven, sdev;
+ PCI_GetDeviceSubsys(rdata->cur_iter, &sven, &sdev);
+
+ udi_strcpy(attr_list->attr_name, "identifier");
+ attr_list->attr_length = snprintf(attr_list->attr_value,
+ "%04x%04x%02x%04x%04x",
+ ven, dev, revision, sven, sdev);
+ attr_list ++;
DPT_SET_ATTR_STRING(attr_list, "bus_type", "pci", 3);
attr_list ++;
DPT_SET_ATTR32(attr_list, "pci_vendor_id", ven);
}
void pci_bind_req(udi_bus_bind_cb_t *cb)
{
+ // TODO: "Lock" PCI device
+
// TODO: DMA constraints
udi_bus_bind_ack(cb, 0, UDI_DMA_LITTLE_ENDIAN, UDI_OK);
}
udi_instance_attr_type_t type;
type = udi_instance_attr_get_internal(gcb, "bus_type", 0, bus_type, sizeof(bus_type), NULL);
if(type != UDI_ATTR_STRING) {
- callback(gcb, UDI_NULL_HANDLE);
+ callback(gcb, UDI_NULL_PIO_HANDLE);
return ;
}
}
else {
// Oops, unknown
- callback(gcb, UDI_NULL_HANDLE);
+ callback(gcb, UDI_NULL_PIO_HANDLE);
return ;
}
}