Changes in uspace/drv/bus/pci/pciintel/pci.c [832cbe7:7acd787] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/pci/pciintel/pci.c
r832cbe7 r7acd787 1 1 /* 2 * Copyright (c) 20 25Jiri Svoboda2 * Copyright (c) 2019 Jiri Svoboda 3 3 * Copyright (c) 2010 Lenka Trochtova 4 4 * All rights reserved. … … 143 143 } 144 144 145 /** Handle legacy IO availability query from function.146 *147 * @param fnode Function performing the query148 * @param rclaims Place to store the legacy IO claims bitmask149 * @return EOK on success or an error code150 */151 static errno_t pciintel_query_legacy_io(ddf_fun_t *fnode,152 hw_res_claims_t *rclaims)153 {154 pci_fun_t *fun = pci_fun(fnode);155 pci_bus_t *bus = fun->busptr;156 pci_fun_t *f;157 hw_res_claims_t claims;158 159 /*160 * We need to wait for enumeration to complete so that we give161 * the PCI IDE driver a chance to claim the legacy ISA IDE162 * ranges.163 */164 ddf_msg(LVL_DEBUG, "pciintel_query_legacy_io");165 166 fun->querying = true;167 168 fibril_mutex_lock(&bus->enum_done_lock);169 while (!bus->enum_done)170 fibril_condvar_wait(&bus->enum_done_cv, &bus->enum_done_lock);171 fibril_mutex_unlock(&bus->enum_done_lock);172 173 ddf_msg(LVL_DEBUG, "Wait for PCI devices to stabilize");174 175 f = pci_fun_first(bus);176 while (f != NULL) {177 if (!f->querying)178 ddf_fun_wait_stable(f->fnode);179 f = pci_fun_next(f);180 }181 182 /* Devices are stable. Now we can determine if ISA IDE was claimed. */183 184 claims = 0;185 186 ddf_msg(LVL_DEBUG, "PCI devices stabilized, leg_ide_claimed=%d\n",187 (int)bus->leg_ide_claimed);188 if (bus->leg_ide_claimed != false) {189 ddf_msg(LVL_NOTE, "Legacy IDE I/O ports claimed by PCI driver.");190 claims |= hwc_isa_ide;191 }192 193 fun->querying = false;194 *rclaims = claims;195 return EOK;196 }197 198 /** Handle legacy IO claim from function.199 *200 * @param fnode Function claiming the legacy I/O ports201 * @param claims Bitmask of claimed I/O202 * @return EOK on success or an error code203 */204 static errno_t pciintel_claim_legacy_io(ddf_fun_t *fnode,205 hw_res_claims_t claims)206 {207 pci_fun_t *fun = pci_fun(fnode);208 pci_bus_t *bus = fun->busptr;209 210 ddf_msg(LVL_DEBUG, "pciintel_claim_legacy_io() claims=%x", claims);211 if ((claims & hwc_isa_ide) != 0)212 bus->leg_ide_claimed = true;213 214 return EOK;215 }216 217 145 static pio_window_t *pciintel_get_pio_window(ddf_fun_t *fnode) 218 146 { … … 283 211 .disable_interrupt = &pciintel_disable_interrupt, 284 212 .clear_interrupt = &pciintel_clear_interrupt, 285 .query_legacy_io = &pciintel_query_legacy_io,286 .claim_legacy_io = &pciintel_claim_legacy_io287 213 }; 288 214 … … 829 755 list_initialize(&bus->funs); 830 756 fibril_mutex_initialize(&bus->conf_mutex); 831 fibril_mutex_initialize(&bus->enum_done_lock);832 fibril_condvar_initialize(&bus->enum_done_cv);833 757 834 758 bus->dnode = dnode; … … 939 863 hw_res_clean_resource_list(&hw_resources); 940 864 941 ddf_msg(LVL_DEBUG, "Bus enumeration done.");942 943 fibril_mutex_lock(&bus->enum_done_lock);944 bus->enum_done = true;945 fibril_mutex_unlock(&bus->enum_done_lock);946 fibril_condvar_broadcast(&bus->enum_done_cv);947 948 865 return EOK; 866 949 867 fail: 950 868 if (got_res)
Note:
See TracChangeset
for help on using the changeset viewer.