Changes in uspace/drv/block/isa-ide/main.c [832cbe7:443695e] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/block/isa-ide/main.c
r832cbe7 r443695e 1 1 /* 2 * Copyright (c) 202 5Jiri Svoboda2 * Copyright (c) 2024 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 43 43 44 44 #include "isa-ide.h" 45 #include "isa-ide_hw.h"46 45 #include "main.h" 47 46 … … 71 70 async_sess_t *parent_sess; 72 71 hw_res_list_parsed_t hw_res; 73 hw_res_ claims_t claims;72 hw_res_flags_t flags; 74 73 errno_t rc; 75 74 … … 78 77 return ENOMEM; 79 78 80 rc = hw_res_query_legacy_io(parent_sess, &claims); 81 if (rc != EOK) { 82 ddf_msg(LVL_NOTE, "Error getting HW resource flags."); 83 return rc; 79 rc = hw_res_get_flags(parent_sess, &flags); 80 if (rc != EOK) 81 return rc; 82 83 /* 84 * Prevent attaching to the legacy ISA IDE register block 85 * on a system with PCI not to conflict with PCI IDE. 86 * 87 * XXX This is a simplification. If we had a PCI-based system without 88 * PCI-IDE or with PCI-IDE disabled and would still like to use 89 * an ISA IDE controller, this would prevent us from doing so. 90 */ 91 if (flags & hwf_isa_bridge) { 92 ddf_msg(LVL_NOTE, "Will not attach to PCI/ISA bridge."); 93 return EIO; 84 94 } 85 95 86 96 hw_res_list_parsed_init(&hw_res); 87 97 rc = hw_res_get_list_parsed(parent_sess, &hw_res, 0); 88 if (rc != EOK) { 89 ddf_msg(LVL_NOTE, "Error getting HW resource list."); 90 return rc; 91 } 98 if (rc != EOK) 99 return rc; 92 100 93 101 if (hw_res.io_ranges.count != 4) { … … 140 148 } 141 149 142 /*143 * Only attach to legacy ISA IDE register block if it144 * is not claimed by PCI IDE driver.145 */146 if (res->cmd1 == leg_ide_ata_cmd_p &&147 res->cmd2 == leg_ide_ata_cmd_s &&148 (claims & hwc_isa_ide) != 0) {149 ddf_msg(LVL_NOTE, "Will not attach to ISA legacy ports "150 "since they are already handled by PCI.");151 return EBUSY;152 }153 154 150 return EOK; 155 151 error: … … 171 167 rc = isa_ide_get_res(dev, &res); 172 168 if (rc != EOK) { 173 if (rc == EINVAL) 174 ddf_msg(LVL_ERROR, "Invalid HW resource configuration."); 169 ddf_msg(LVL_ERROR, "Invalid HW resource configuration."); 175 170 return EINVAL; 176 171 }
Note:
See TracChangeset
for help on using the changeset viewer.