Changes in uspace/drv/bus/isa/isa.c [832cbe7:3d0fd0d] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/isa/isa.c
r832cbe7 r3d0fd0d 1 1 /* 2 * Copyright (c) 20 25Jiri Svoboda2 * Copyright (c) 2018 Jiri Svoboda 3 3 * Copyright (c) 2010 Lenka Trochtova 4 4 * Copyright (c) 2011 Jan Vesely … … 72 72 #define EBUS_CHILD_FUN_CONF_PATH "/drv/isa/ebus.dev" 73 73 74 #define ISA_MAX_HW_RES 674 #define ISA_MAX_HW_RES 5 75 75 76 76 typedef struct { 77 77 fibril_mutex_t mutex; 78 bool pci_isa_bridge;79 78 uint16_t pci_vendor_id; 80 79 uint16_t pci_device_id; … … 93 92 hw_resource_list_t hw_resources; 94 93 link_t bus_link; 95 isa_bus_t *bus;96 94 } isa_fun_t; 97 95 … … 206 204 } 207 205 208 /** Handle legacy IO availability query from function.209 *210 * @param fnode Function performing the query211 * @param rclaims Place to store the legacy IO claims bitmask212 * @return EOK on success or an error code213 */214 static errno_t isa_fun_query_legacy_io(ddf_fun_t *fnode,215 hw_res_claims_t *rclaims)216 {217 isa_fun_t *fun = isa_fun(fnode);218 hw_res_claims_t claims;219 async_sess_t *sess;220 errno_t rc;221 222 ddf_msg(LVL_DEBUG, "isa_fun_query_legacy_io()");223 224 sess = ddf_dev_parent_sess_get(fun->bus->dev);225 if (sess == NULL) {226 ddf_msg(LVL_ERROR, "isa_dev_add failed to connect to the "227 "parent driver.");228 return ENOENT;229 }230 231 if (!fun->bus->pci_isa_bridge) {232 ddf_msg(LVL_NOTE, "isa_fun_query_legacy_io: classic ISA - "233 "legacy IDE range is available");234 /* Classic ISA, we can be sure IDE is unclaimed by PCI */235 claims = 0;236 } else {237 ddf_msg(LVL_NOTE, "isa_fun_query_legacy_io: ISA bridge - "238 "determine legacy IDE availability from PCI bus driver");239 rc = hw_res_query_legacy_io(sess, &claims);240 if (rc != EOK) {241 ddf_msg(LVL_NOTE, "Error querying legacy IO claims.");242 return rc;243 }244 }245 246 ddf_msg(LVL_DEBUG, "isa_fun_query_legacy_io: returning 0x%x", claims);247 *rclaims = claims;248 return EOK;249 }250 251 206 static hw_res_ops_t isa_fun_hw_res_ops = { 252 207 .get_resource_list = isa_fun_get_resources, … … 256 211 .dma_channel_setup = isa_fun_setup_dma, 257 212 .dma_channel_remain = isa_fun_remain_dma, 258 .query_legacy_io = isa_fun_query_legacy_io259 213 }; 260 214 … … 310 264 fibril_mutex_initialize(&fun->mutex); 311 265 fun->hw_resources.resources = fun->resources; 312 fun->bus = isa;313 266 314 267 fun->fnode = fnode; … … 790 743 if (rc != EOK) { 791 744 ddf_msg(LVL_NOTE, "Cannot read PCI config. Assuming ISA classic."); 792 isa->pci_isa_bridge = false;793 745 isa->pci_vendor_id = 0; 794 746 isa->pci_device_id = 0; 795 747 isa->pci_class = BASE_CLASS_BRIDGE; 796 748 isa->pci_subclass = SUB_CLASS_BRIDGE_ISA; 797 } else {798 ddf_msg(LVL_NOTE, "ISA Bridge");799 isa->pci_isa_bridge = true;800 749 } 801 750
Note:
See TracChangeset
for help on using the changeset viewer.