Changeset 2020
- Timestamp:
- 04/02/09 21:21:33 (3 years ago)
- Files:
-
- 1 modified
-
Whitix/trunk/devices/pci/pci_lib.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
Whitix/trunk/devices/pci/pci_lib.c
r1886 r2020 110 110 SYMBOL_EXPORT(PciEnableDevice); 111 111 112 int PciDisableDevice(struct PciDevice* device) 113 { 114 /* Disable BARs */ 115 WORD command; 116 117 if (PciReadConfigWord(device, PCI_COMMAND, &command)) 118 return -EIO; 119 120 command &= ~(PCI_COMMAND_IO | PCI_COMMAND_MEM); 121 122 return PciWriteConfigWord(device, PCI_COMMAND, command); 123 } 124 125 SYMBOL_EXPORT(PciDisableDevice); 126 112 127 int PciSetMaster(struct PciDevice* device) 113 128 { … … 124 139 SYMBOL_EXPORT(PciSetMaster); 125 140 126 int PciRegisterDriver (struct PciDriver* pciDriver)141 int PciRegisterDriverMod(struct Module* module, struct PciDriver* pciDriver) 127 142 { 128 143 /* Add it to the global list of PCI drivers, after checking that it … … 137 152 138 153 ListAddTail(&pciDriver->next, &pciDriverList); 154 155 pciDriver->module = module; 139 156 140 157 extern struct ListHead pciBusList; … … 146 163 } 147 164 148 SYMBOL_EXPORT(PciRegisterDriver); 149 150 unsigned long PciResourceStart(struct PciDevice* device, int index) 151 { 152 if (index < 0 || index >= 6) 153 return -EINVAL; 154 155 return PCI_RES_BEGIN_MASK(device->spaces[index]); 156 } 157 158 SYMBOL_EXPORT(PciResourceStart); 165 SYMBOL_EXPORT(PciRegisterDriverMod);
