Changeset 832cbe7 in mainline for uspace/drv/block
- Timestamp:
- 2025-02-05T12:30:20Z (8 months 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)
- Location:
- uspace/drv/block
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/block/isa-ide/main.c
r0dab4850 r832cbe7 1 1 /* 2 * Copyright (c) 202 4Jiri Svoboda2 * Copyright (c) 2025 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 43 43 44 44 #include "isa-ide.h" 45 #include "isa-ide_hw.h" 45 46 #include "main.h" 46 47 … … 70 71 async_sess_t *parent_sess; 71 72 hw_res_list_parsed_t hw_res; 72 hw_res_ flags_t flags;73 hw_res_claims_t claims; 73 74 errno_t rc; 74 75 … … 77 78 return ENOMEM; 78 79 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; 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; 94 84 } 95 85 96 86 hw_res_list_parsed_init(&hw_res); 97 87 rc = hw_res_get_list_parsed(parent_sess, &hw_res, 0); 98 if (rc != EOK) 99 return rc; 88 if (rc != EOK) { 89 ddf_msg(LVL_NOTE, "Error getting HW resource list."); 90 return rc; 91 } 100 92 101 93 if (hw_res.io_ranges.count != 4) { … … 148 140 } 149 141 142 /* 143 * Only attach to legacy ISA IDE register block if it 144 * 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 150 154 return EOK; 151 155 error: … … 167 171 rc = isa_ide_get_res(dev, &res); 168 172 if (rc != EOK) { 169 ddf_msg(LVL_ERROR, "Invalid HW resource configuration."); 173 if (rc == EINVAL) 174 ddf_msg(LVL_ERROR, "Invalid HW resource configuration."); 170 175 return EINVAL; 171 176 } -
uspace/drv/block/pc-floppy/main.c
r0dab4850 r832cbe7 1 1 /* 2 * Copyright (c) 202 4Jiri Svoboda2 * Copyright (c) 2025 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 73 73 async_sess_t *parent_sess; 74 74 hw_res_list_parsed_t hw_res; 75 hw_res_flags_t flags;76 75 errno_t rc; 77 76 … … 79 78 if (parent_sess == NULL) 80 79 return ENOMEM; 81 82 rc = hw_res_get_flags(parent_sess, &flags);83 if (rc != EOK)84 return rc;85 80 86 81 hw_res_list_parsed_init(&hw_res); -
uspace/drv/block/pci-ide/main.c
r0dab4850 r832cbe7 1 1 /* 2 * Copyright (c) 202 4Jiri Svoboda2 * Copyright (c) 2025 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 133 133 pci_ide_ctrl_t *ctrl; 134 134 pci_ide_hwres_t res; 135 async_sess_t *parent_sess; 135 136 errno_t rc; 136 137 … … 164 165 if (rc != EOK) { 165 166 ddf_msg(LVL_ERROR, "Failed initializing ATA controller."); 167 rc = EIO; 168 goto error; 169 } 170 171 parent_sess = ddf_dev_parent_sess_get(dev); 172 if (parent_sess == NULL) { 173 rc = ENOMEM; 174 goto error; 175 } 176 177 /* Claim legacy I/O range to prevent ISA IDE from attaching there. */ 178 rc = hw_res_claim_legacy_io(parent_sess, hwc_isa_ide); 179 if (rc != EOK) { 180 ddf_msg(LVL_ERROR, "Failed claiming legacy I/O range."); 166 181 rc = EIO; 167 182 goto error; -
uspace/drv/block/pci-ide/pci-ide.c
r0dab4850 r832cbe7 1 1 /* 2 * Copyright (c) 202 4Jiri Svoboda2 * Copyright (c) 2025 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 189 189 190 190 ddf_msg(LVL_DEBUG, "pci_ide_channel_init()"); 191 192 memset(¶ms, 0, sizeof(params)); 191 193 192 194 chan->ctrl = ctrl;
Note:
See TracChangeset
for help on using the changeset viewer.