Changes in uspace/drv/block/isa-ide/main.c [07039850:443695e] in mainline
- File:
-
- 1 edited
-
uspace/drv/block/isa-ide/main.c (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/block/isa-ide/main.c
r07039850 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 … … 49 48 static errno_t isa_ide_dev_remove(ddf_dev_t *dev); 50 49 static errno_t isa_ide_dev_gone(ddf_dev_t *dev); 51 static errno_t isa_ide_dev_quiesce(ddf_dev_t *dev);52 50 static errno_t isa_ide_fun_online(ddf_fun_t *fun); 53 51 static errno_t isa_ide_fun_offline(ddf_fun_t *fun); … … 56 54 57 55 static driver_ops_t driver_ops = { 58 .dev_add = isa_ide_dev_add, 59 .dev_remove = isa_ide_dev_remove, 60 .dev_gone = isa_ide_dev_gone, 61 .dev_quiesce = isa_ide_dev_quiesce, 62 .fun_online = isa_ide_fun_online, 63 .fun_offline = isa_ide_fun_offline 56 .dev_add = &isa_ide_dev_add, 57 .dev_remove = &isa_ide_dev_remove, 58 .dev_gone = &isa_ide_dev_gone, 59 .fun_online = &isa_ide_fun_online, 60 .fun_offline = &isa_ide_fun_offline 64 61 }; 65 62 … … 73 70 async_sess_t *parent_sess; 74 71 hw_res_list_parsed_t hw_res; 75 hw_res_ claims_t claims;72 hw_res_flags_t flags; 76 73 errno_t rc; 77 74 … … 80 77 return ENOMEM; 81 78 82 rc = hw_res_query_legacy_io(parent_sess, &claims); 83 if (rc != EOK) { 84 ddf_msg(LVL_NOTE, "Error getting HW resource flags."); 85 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; 86 94 } 87 95 88 96 hw_res_list_parsed_init(&hw_res); 89 97 rc = hw_res_get_list_parsed(parent_sess, &hw_res, 0); 90 if (rc != EOK) { 91 ddf_msg(LVL_NOTE, "Error getting HW resource list."); 92 return rc; 93 } 98 if (rc != EOK) 99 return rc; 94 100 95 101 if (hw_res.io_ranges.count != 4) { … … 142 148 } 143 149 144 /*145 * Only attach to legacy ISA IDE register block if it146 * is not claimed by PCI IDE driver.147 */148 if (res->cmd1 == leg_ide_ata_cmd_p &&149 res->cmd2 == leg_ide_ata_cmd_s &&150 (claims & hwc_isa_ide) != 0) {151 ddf_msg(LVL_NOTE, "Will not attach to ISA legacy ports "152 "since they are already handled by PCI.");153 return EBUSY;154 }155 156 150 return EOK; 157 151 error: … … 173 167 rc = isa_ide_get_res(dev, &res); 174 168 if (rc != EOK) { 175 if (rc == EINVAL) 176 ddf_msg(LVL_ERROR, "Invalid HW resource configuration."); 169 ddf_msg(LVL_ERROR, "Invalid HW resource configuration."); 177 170 return EINVAL; 178 171 } … … 381 374 } 382 375 383 static errno_t isa_ide_dev_quiesce(ddf_dev_t *dev)384 {385 isa_ide_ctrl_t *ctrl = (isa_ide_ctrl_t *)ddf_dev_data_get(dev);386 387 ddf_msg(LVL_DEBUG, "isa_ide_dev_quiesce(%p)", dev);388 389 isa_ide_channel_quiesce(&ctrl->channel[0]);390 isa_ide_channel_quiesce(&ctrl->channel[1]);391 return EOK;392 }393 394 376 static errno_t isa_ide_fun_online(ddf_fun_t *fun) 395 377 {
Note:
See TracChangeset
for help on using the changeset viewer.
