Changeset 832cbe7 in mainline for uspace/drv/bus/isa/isa.c
- Timestamp:
- 2025-02-05T12:30:20Z (9 days ago)
- Branches:
- master
- Children:
- accdf882
- Parents:
- 0dab4850
- git-author:
- Jiri Svoboda <jiri@…> (2025-02-04 21:30:06)
- git-committer:
- Jiri Svoboda <jiri@…> (2025-02-05 12:30:20)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/isa/isa.c
r0dab4850 r832cbe7 1 1 /* 2 * Copyright (c) 202 4Jiri Svoboda2 * Copyright (c) 2025 Jiri Svoboda 3 3 * Copyright (c) 2010 Lenka Trochtova 4 4 * Copyright (c) 2011 Jan Vesely … … 206 206 } 207 207 208 static errno_t isa_fun_get_flags(ddf_fun_t *fnode, hw_res_flags_t *rflags) 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) 209 216 { 210 217 isa_fun_t *fun = isa_fun(fnode); 211 hw_res_flags_t flags; 212 213 flags = 0; 214 if (fun->bus->pci_isa_bridge) 215 flags |= hwf_isa_bridge; 216 217 ddf_msg(LVL_NOTE, "isa_fun_get_flags: returning 0x%x", flags); 218 *rflags = flags; 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; 219 248 return EOK; 220 249 } … … 227 256 .dma_channel_setup = isa_fun_setup_dma, 228 257 .dma_channel_remain = isa_fun_remain_dma, 229 . get_flags = isa_fun_get_flags258 .query_legacy_io = isa_fun_query_legacy_io 230 259 }; 231 260
Note:
See TracChangeset
for help on using the changeset viewer.