Changeset 07039850 in mainline
- Timestamp:
- 2025-03-05T21:41:03Z (11 hours ago)
- Branches:
- master
- Parents:
- a64970e1
- Location:
- uspace
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/block/isa-ide/isa-ide.c
ra64970e1 r07039850 101 101 ata_params_t params; 102 102 103 ddf_msg(LVL_DEBUG, "isa_ide_c trl_init()");103 ddf_msg(LVL_DEBUG, "isa_ide_channel_init()"); 104 104 105 105 memset(¶ms, 0, sizeof(params)); … … 135 135 irq_inited = true; 136 136 137 ddf_msg(LVL_DEBUG, "isa_ide_c trl_init(): Initialize IDE channel");137 ddf_msg(LVL_DEBUG, "isa_ide_channel_init(): Initialize IDE channel"); 138 138 139 139 params.arg = (void *)chan; … … 163 163 goto error; 164 164 165 ddf_msg(LVL_DEBUG, "isa_ide_c trl_init: DONE");165 ddf_msg(LVL_DEBUG, "isa_ide_channel_init: DONE"); 166 166 return EOK; 167 167 error: … … 181 181 errno_t rc; 182 182 183 ddf_msg(LVL_DEBUG, ": isa_ide_c trl_remove()");183 ddf_msg(LVL_DEBUG, ": isa_ide_channel_fini()"); 184 184 185 185 fibril_mutex_lock(&chan->lock); … … 196 196 197 197 return EOK; 198 } 199 200 /** Quiesce ISA IDE channel. */ 201 void isa_ide_channel_quiesce(isa_ide_channel_t *chan) 202 { 203 ddf_msg(LVL_DEBUG, ": isa_ide_channel_quiesce()"); 204 205 fibril_mutex_lock(&chan->lock); 206 ata_channel_quiesce(chan->channel); 207 fibril_mutex_unlock(&chan->lock); 198 208 } 199 209 -
uspace/drv/block/isa-ide/isa-ide.h
ra64970e1 r07039850 1 1 /* 2 * Copyright (c) 202 4Jiri Svoboda2 * Copyright (c) 2025 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 104 104 unsigned, isa_ide_hwres_t *); 105 105 extern errno_t isa_ide_channel_fini(isa_ide_channel_t *); 106 extern void isa_ide_channel_quiesce(isa_ide_channel_t *); 106 107 107 108 #endif -
uspace/drv/block/isa-ide/main.c
ra64970e1 r07039850 49 49 static errno_t isa_ide_dev_remove(ddf_dev_t *dev); 50 50 static errno_t isa_ide_dev_gone(ddf_dev_t *dev); 51 static errno_t isa_ide_dev_quiesce(ddf_dev_t *dev); 51 52 static errno_t isa_ide_fun_online(ddf_fun_t *fun); 52 53 static errno_t isa_ide_fun_offline(ddf_fun_t *fun); … … 55 56 56 57 static driver_ops_t driver_ops = { 57 .dev_add = &isa_ide_dev_add, 58 .dev_remove = &isa_ide_dev_remove, 59 .dev_gone = &isa_ide_dev_gone, 60 .fun_online = &isa_ide_fun_online, 61 .fun_offline = &isa_ide_fun_offline 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 62 64 }; 63 65 … … 379 381 } 380 382 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 381 394 static errno_t isa_ide_fun_online(ddf_fun_t *fun) 382 395 { -
uspace/drv/block/pc-floppy/main.c
ra64970e1 r07039850 47 47 static errno_t pc_fdc_dev_remove(ddf_dev_t *dev); 48 48 static errno_t pc_fdc_dev_gone(ddf_dev_t *dev); 49 static errno_t pc_fdc_dev_quiesce(ddf_dev_t *dev); 49 50 static errno_t pc_fdc_fun_online(ddf_fun_t *fun); 50 51 static errno_t pc_fdc_fun_offline(ddf_fun_t *fun); 51 52 52 53 static driver_ops_t driver_ops = { 53 .dev_add = &pc_fdc_dev_add, 54 .dev_remove = &pc_fdc_dev_remove, 55 .dev_gone = &pc_fdc_dev_gone, 56 .fun_online = &pc_fdc_fun_online, 57 .fun_offline = &pc_fdc_fun_offline 54 .dev_add = pc_fdc_dev_add, 55 .dev_remove = pc_fdc_dev_remove, 56 .dev_gone = pc_fdc_dev_gone, 57 .dev_quiesce = pc_fdc_dev_quiesce, 58 .fun_online = pc_fdc_fun_online, 59 .fun_offline = pc_fdc_fun_offline 58 60 }; 59 61 … … 183 185 } 184 186 187 /** Quiesce FDC device. 188 * 189 * @param dev Device 190 * @return EOK on success or an error code 191 */ 192 static errno_t pc_fdc_dev_quiesce(ddf_dev_t *dev) 193 { 194 pc_fdc_t *fdc = (pc_fdc_t *)ddf_dev_data_get(dev); 195 pc_fdc_quiesce(fdc); 196 return EOK; 197 } 198 185 199 /** Online FDC function. 186 200 * -
uspace/drv/block/pc-floppy/pc-floppy.c
ra64970e1 r07039850 1 1 /* 2 * Copyright (c) 202 4Jiri Svoboda2 * Copyright (c) 2025 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 256 256 } 257 257 258 /** Quiesce floppy controller. 259 * 260 * @param fdc Floppy controller 261 */ 262 void pc_fdc_quiesce(pc_fdc_t *fdc) 263 { 264 (void)pc_fdc_reset(fdc); 265 } 266 258 267 /** Enable device I/O. 259 268 * -
uspace/drv/block/pc-floppy/pc-floppy.h
ra64970e1 r07039850 1 1 /* 2 * Copyright (c) 202 4Jiri Svoboda2 * Copyright (c) 2025 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 97 97 98 98 extern errno_t pc_fdc_create(ddf_dev_t *, pc_fdc_hwres_t *, pc_fdc_t **); 99 extern void pc_fdc_quiesce(pc_fdc_t *); 99 100 extern errno_t pc_fdc_destroy(pc_fdc_t *); 100 101 -
uspace/drv/block/pci-ide/main.c
ra64970e1 r07039850 49 49 static errno_t pci_ide_dev_remove(ddf_dev_t *dev); 50 50 static errno_t pci_ide_dev_gone(ddf_dev_t *dev); 51 static errno_t pci_ide_dev_quiesce(ddf_dev_t *dev); 51 52 static errno_t pci_ide_fun_online(ddf_fun_t *fun); 52 53 static errno_t pci_ide_fun_offline(ddf_fun_t *fun); … … 55 56 56 57 static driver_ops_t driver_ops = { 57 .dev_add = &pci_ide_dev_add, 58 .dev_remove = &pci_ide_dev_remove, 59 .dev_gone = &pci_ide_dev_gone, 60 .fun_online = &pci_ide_fun_online, 61 .fun_offline = &pci_ide_fun_offline 58 .dev_add = pci_ide_dev_add, 59 .dev_remove = pci_ide_dev_remove, 60 .dev_gone = pci_ide_dev_gone, 61 .dev_quiesce = pci_ide_dev_quiesce, 62 .fun_online = pci_ide_fun_online, 63 .fun_offline = pci_ide_fun_offline 62 64 }; 63 65 … … 367 369 } 368 370 371 static errno_t pci_ide_dev_quiesce(ddf_dev_t *dev) 372 { 373 pci_ide_ctrl_t *ctrl = (pci_ide_ctrl_t *)ddf_dev_data_get(dev); 374 375 ddf_msg(LVL_DEBUG, "pci_ide_dev_quiesce(%p)", dev); 376 377 pci_ide_channel_quiesce(&ctrl->channel[0]); 378 pci_ide_channel_quiesce(&ctrl->channel[1]); 379 380 return EOK; 381 } 382 369 383 static errno_t pci_ide_fun_online(ddf_fun_t *fun) 370 384 { -
uspace/drv/block/pci-ide/pci-ide.c
ra64970e1 r07039850 331 331 } 332 332 333 /** Quiesce PCI IDE channel. */ 334 void pci_ide_channel_quiesce(pci_ide_channel_t *chan) 335 { 336 ddf_msg(LVL_DEBUG, ": pci_ide_channel_quiesce()"); 337 338 fibril_mutex_lock(&chan->lock); 339 ata_channel_quiesce(chan->channel); 340 fibril_mutex_unlock(&chan->lock); 341 } 342 333 343 /** Enable device I/O. */ 334 344 static errno_t pci_ide_init_io(pci_ide_channel_t *chan) -
uspace/drv/block/pci-ide/pci-ide.h
ra64970e1 r07039850 1 1 /* 2 * Copyright (c) 202 4Jiri Svoboda2 * Copyright (c) 2025 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 129 129 unsigned, pci_ide_hwres_t *); 130 130 extern errno_t pci_ide_channel_fini(pci_ide_channel_t *); 131 extern void pci_ide_channel_quiesce(pci_ide_channel_t *); 131 132 132 133 #endif -
uspace/lib/ata/include/ata/ata.h
ra64970e1 r07039850 1 1 /* 2 * Copyright (c) 202 4Jiri Svoboda2 * Copyright (c) 2025 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 201 201 extern errno_t ata_channel_initialize(ata_channel_t *); 202 202 extern errno_t ata_channel_destroy(ata_channel_t *); 203 extern void ata_channel_quiesce(ata_channel_t *); 203 204 extern void ata_channel_irq(ata_channel_t *, uint8_t); 204 205 extern void ata_connection(ipc_call_t *, ata_device_t *); -
uspace/lib/ata/include/ata/ata_hw.h
ra64970e1 r07039850 1 1 /* 2 * Copyright (c) 202 4Jiri Svoboda2 * Copyright (c) 2025 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 106 106 #define REG_COMMAND offsetof(ata_cmd_t, command) 107 107 #define REG_FEATURES offsetof(ata_cmd_t, features) 108 #define REG_DEVCTL offsetof(ata_ctl_t, device_control) 108 109 109 110 enum devctl_bits { -
uspace/lib/ata/src/ata.c
ra64970e1 r07039850 84 84 static uint8_t ata_read_cmd_8(ata_channel_t *, uint16_t); 85 85 static void ata_write_cmd_8(ata_channel_t *, uint16_t, uint8_t); 86 static void ata_write_ctl_8(ata_channel_t *, uint16_t, uint8_t); 86 87 87 88 static errno_t ata_bd_init_irq(ata_channel_t *); … … 279 280 } 280 281 282 /** Quiesce ATA channel. */ 283 void ata_channel_quiesce(ata_channel_t *chan) 284 { 285 ata_msg_debug(chan, ": ata_channel_quiesce()"); 286 287 fibril_mutex_lock(&chan->lock); 288 ata_write_ctl_8(chan, REG_DEVCTL, DCR_SRST | DCR_nIEN); 289 fibril_mutex_unlock(&chan->lock); 290 } 291 281 292 /** Add ATA device. 282 293 * … … 348 359 { 349 360 return chan->params.write_cmd_8(chan->params.arg, port, value); 361 } 362 363 /** Write 8 bits to 8-bit control port. 364 * 365 * @param chan ATA channel 366 * @param port Port number 367 * @param value Register value 368 */ 369 static void ata_write_ctl_8(ata_channel_t *chan, uint16_t port, uint8_t value) 370 { 371 return chan->params.write_ctl_8(chan->params.arg, port, value); 350 372 } 351 373
Note:
See TracChangeset
for help on using the changeset viewer.