Changes in uspace/drv/bus/isa/isa.c [3d0fd0d:832cbe7] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/isa/isa.c
r3d0fd0d r832cbe7 1 1 /* 2 * Copyright (c) 20 18Jiri Svoboda2 * Copyright (c) 2025 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 574 #define ISA_MAX_HW_RES 6 75 75 76 76 typedef struct { 77 77 fibril_mutex_t mutex; 78 bool pci_isa_bridge; 78 79 uint16_t pci_vendor_id; 79 80 uint16_t pci_device_id; … … 92 93 hw_resource_list_t hw_resources; 93 94 link_t bus_link; 95 isa_bus_t *bus; 94 96 } isa_fun_t; 95 97 … … 204 206 } 205 207 208 /** Handle legacy IO availability query from function. 209 * 210 * @param fnode Function performing the query 211 * @param rclaims Place to store the legacy IO claims bitmask 212 * @return EOK on success or an error code 213 */ 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 206 251 static hw_res_ops_t isa_fun_hw_res_ops = { 207 252 .get_resource_list = isa_fun_get_resources, … … 211 256 .dma_channel_setup = isa_fun_setup_dma, 212 257 .dma_channel_remain = isa_fun_remain_dma, 258 .query_legacy_io = isa_fun_query_legacy_io 213 259 }; 214 260 … … 264 310 fibril_mutex_initialize(&fun->mutex); 265 311 fun->hw_resources.resources = fun->resources; 312 fun->bus = isa; 266 313 267 314 fun->fnode = fnode; … … 743 790 if (rc != EOK) { 744 791 ddf_msg(LVL_NOTE, "Cannot read PCI config. Assuming ISA classic."); 792 isa->pci_isa_bridge = false; 745 793 isa->pci_vendor_id = 0; 746 794 isa->pci_device_id = 0; 747 795 isa->pci_class = BASE_CLASS_BRIDGE; 748 796 isa->pci_subclass = SUB_CLASS_BRIDGE_ISA; 797 } else { 798 ddf_msg(LVL_NOTE, "ISA Bridge"); 799 isa->pci_isa_bridge = true; 749 800 } 750 801
Note:
See TracChangeset
for help on using the changeset viewer.