Changes in / [af28af6:88cbc66] in mainline
- Location:
- uspace
- Files:
-
- 27 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/block/isa-ide/isa-ide.c
raf28af6 r88cbc66 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
raf28af6 r88cbc66 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
raf28af6 r88cbc66 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
raf28af6 r88cbc66 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
raf28af6 r88cbc66 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
raf28af6 r88cbc66 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
raf28af6 r88cbc66 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
raf28af6 r88cbc66 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
raf28af6 r88cbc66 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/drv/bus/usb/ohci/hw_struct/completion_codes.h
raf28af6 r88cbc66 1 1 /* 2 * Copyright (c) 2025 Jiri Svoboda 2 3 * Copyright (c) 2011 Jan Vesely 3 4 * All rights reserved. … … 54 55 }; 55 56 56 inline staticerrno_t cc_to_rc(unsigned int cc)57 static inline errno_t cc_to_rc(unsigned int cc) 57 58 { 58 59 switch (cc) { -
uspace/drv/bus/usb/ohci/hw_struct/transfer_descriptor.h
raf28af6 r88cbc66 1 1 /* 2 * Copyright (c) 2025 Jiri Svoboda 2 3 * Copyright (c) 2011 Jan Vesely 3 4 * All rights reserved. … … 103 104 * @return true if the TD was accessed and processed by hw, false otherwise. 104 105 */ 105 inline staticbool td_is_finished(const td_t *instance)106 static inline bool td_is_finished(const td_t *instance) 106 107 { 107 108 assert(instance); -
uspace/drv/char/i8042/i8042.c
raf28af6 r88cbc66 1 1 /* 2 * Copyright (c) 2025 Jiri Svoboda 2 3 * Copyright (c) 2001-2004 Jakub Jermar 3 4 * Copyright (c) 2006 Josef Cejka 4 * Copyright (c) 2021 Jiri Svoboda5 5 * Copyright (c) 2011 Jan Vesely 6 6 * All rights reserved. … … 346 346 } 347 347 348 /** Quiesce i8042. 349 * 350 * @param dev i8042 instance. 351 */ 352 void i8042_quiesce(i8042_t *dev) 353 { 354 /* Disable port interrupts. */ 355 wait_ready(dev); 356 pio_write_8(&dev->regs->status, i8042_CMD_WRITE_CMDB); 357 wait_ready(dev); 358 pio_write_8(&dev->regs->data, i8042_KBD_TRANSLATE); 359 } 360 348 361 /** Write data to i8042 port. 349 362 * -
uspace/drv/char/i8042/i8042.h
raf28af6 r88cbc66 1 1 /* 2 * Copyright (c) 202 4Jiri Svoboda2 * Copyright (c) 2025 Jiri Svoboda 3 3 * Copyright (c) 2006 Josef Cejka 4 4 * Copyright (c) 2011 Jan Vesely … … 95 95 96 96 extern errno_t i8042_init(i8042_t *, addr_range_t *, int, int, ddf_dev_t *); 97 extern void i8042_quiesce(i8042_t *); 97 98 98 99 #endif -
uspace/drv/char/i8042/main.c
raf28af6 r88cbc66 1 1 /* 2 * Copyright (c) 2025 Jiri Svoboda 2 3 * Copyright (c) 2011 Jan Vesely 3 4 * All rights reserved. … … 135 136 } 136 137 138 /** Initialize a new ddf driver instance of i8042 driver 139 * 140 * @param[in] device DDF instance of the device to initialize. 141 * 142 * @return Error code. 143 * 144 */ 145 static errno_t i8042_dev_quiesce(ddf_dev_t *device) 146 { 147 i8042_t *i8042; 148 149 ddf_msg(LVL_DEBUG, "i8042_dev_quiesce()"); 150 151 i8042 = (i8042_t *)ddf_dev_data_get(device); 152 i8042_quiesce(i8042); 153 return EOK; 154 } 155 137 156 /** DDF driver operations. */ 138 157 static driver_ops_t i8042_driver_ops = { 139 158 .dev_add = i8042_dev_add, 159 .dev_quiesce = i8042_dev_quiesce 140 160 }; 141 161 -
uspace/drv/char/ns8250/ns8250.c
raf28af6 r88cbc66 1 1 /* 2 * Copyright (c) 2025 Jiri Svoboda 2 3 * Copyright (c) 2010 Lenka Trochtova 3 * Copyright (c) 2017 Jiri Svoboda4 4 * All rights reserved. 5 5 * … … 327 327 328 328 static errno_t ns8250_dev_add(ddf_dev_t *dev); 329 static errno_t ns8250_dev_quiesce(ddf_dev_t *dev); 329 330 static errno_t ns8250_dev_remove(ddf_dev_t *dev); 330 331 … … 332 333 static driver_ops_t ns8250_ops = { 333 334 .dev_add = &ns8250_dev_add, 334 .dev_remove = &ns8250_dev_remove 335 .dev_remove = &ns8250_dev_remove, 336 .dev_quiesce = &ns8250_dev_quiesce 335 337 }; 336 338 … … 966 968 } 967 969 970 static errno_t ns8250_dev_quiesce(ddf_dev_t *dev) 971 { 972 ns8250_t *ns = dev_ns8250(dev); 973 974 ns8250_port_interrupts_disable(ns->regs); 975 return EOK; 976 } 977 968 978 /** Open the device. 969 979 * -
uspace/drv/char/pc-lpt/main.c
raf28af6 r88cbc66 1 1 /* 2 * Copyright (c) 20 18Jiri Svoboda2 * Copyright (c) 2025 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 46 46 static errno_t pc_lpt_dev_remove(ddf_dev_t *dev); 47 47 static errno_t pc_lpt_dev_gone(ddf_dev_t *dev); 48 static errno_t pc_lpt_dev_quiesce(ddf_dev_t *dev); 48 49 static errno_t pc_lpt_fun_online(ddf_fun_t *fun); 49 50 static errno_t pc_lpt_fun_offline(ddf_fun_t *fun); … … 53 54 .dev_remove = pc_lpt_dev_remove, 54 55 .dev_gone = pc_lpt_dev_gone, 56 .dev_quiesce = pc_lpt_dev_quiesce, 55 57 .fun_online = pc_lpt_fun_online, 56 58 .fun_offline = pc_lpt_fun_offline … … 140 142 } 141 143 144 static errno_t pc_lpt_dev_quiesce(ddf_dev_t *dev) 145 { 146 pc_lpt_t *pc_lpt = (pc_lpt_t *)ddf_dev_data_get(dev); 147 148 ddf_msg(LVL_DEBUG, "pc_lpt_dev_quiesce(%p)", dev); 149 150 pc_lpt_quiesce(pc_lpt); 151 return EOK; 152 } 153 142 154 static errno_t pc_lpt_fun_online(ddf_fun_t *fun) 143 155 { -
uspace/drv/char/pc-lpt/pc-lpt.c
raf28af6 r88cbc66 1 1 /* 2 * Copyright (c) 20 18Jiri Svoboda2 * Copyright (c) 2025 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 196 196 } 197 197 198 /** Quiesce pc-lpt device */ 199 void pc_lpt_quiesce(pc_lpt_t *lpt) 200 { 201 uint8_t control; 202 203 control = 0; /* nINIT=0, IRQ_ENABLE=0 */ 204 pio_write_8(&lpt->regs->control, control); 205 } 206 198 207 /** Write a single byte to the parallel port. 199 208 * -
uspace/drv/char/pc-lpt/pc-lpt.h
raf28af6 r88cbc66 1 1 /* 2 * Copyright (c) 20 18Jiri Svoboda2 * Copyright (c) 2025 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 74 74 extern errno_t pc_lpt_remove(pc_lpt_t *); 75 75 extern errno_t pc_lpt_gone(pc_lpt_t *); 76 extern void pc_lpt_quiesce(pc_lpt_t *); 76 77 77 78 #endif -
uspace/drv/nic/e1k/e1k.c
raf28af6 r88cbc66 1272 1272 * 1273 1273 */ 1274 inlinestatic errno_t e1000_register_int_handler(nic_t *nic,1274 static errno_t e1000_register_int_handler(nic_t *nic, 1275 1275 cap_irq_handle_t *handle) 1276 1276 { … … 1921 1921 * 1922 1922 */ 1923 inlinestatic void e1000_delete_dev_data(ddf_dev_t *dev)1923 static void e1000_delete_dev_data(ddf_dev_t *dev) 1924 1924 { 1925 1925 assert(dev); -
uspace/drv/nic/ne2k/dp8390.c
raf28af6 r88cbc66 1 1 /* 2 * Copyright (c) 2025 Jiri Svoboda 2 3 * Copyright (c) 2009 Lukas Mejdrech 3 4 * Copyright (c) 2011 Martin Decky … … 182 183 break; 183 184 } 185 } 186 187 /** Quiesce NE2000. 188 * 189 * @param ne2k NE2000 190 */ 191 void ne2k_quiesce(ne2k_t *ne2k) 192 { 193 ne2k_init(ne2k); 184 194 } 185 195 -
uspace/drv/nic/ne2k/dp8390.h
raf28af6 r88cbc66 1 1 /* 2 * Copyright (c) 2025 Jiri Svoboda 2 3 * Copyright (c) 2009 Lukas Mejdrech 3 4 * Copyright (c) 2011 Martin Decky … … 267 268 extern errno_t ne2k_probe(ne2k_t *); 268 269 extern errno_t ne2k_up(ne2k_t *); 270 extern void ne2k_quiesce(ne2k_t *); 269 271 extern void ne2k_down(ne2k_t *); 270 272 extern void ne2k_send(nic_t *, void *, size_t); -
uspace/drv/nic/ne2k/ne2k.c
raf28af6 r88cbc66 1 1 /* 2 * Copyright (c) 2025 Jiri Svoboda 2 3 * Copyright (c) 2011 Martin Decky 3 4 * Copyright (c) 2011 Radim Vansa … … 459 460 } 460 461 462 static errno_t ne2k_dev_quiesce(ddf_dev_t *dev) 463 { 464 nic_t *nic; 465 ne2k_t *ne2k; 466 467 nic = nic_get_from_ddf_dev(dev); 468 469 ne2k = (ne2k_t *)nic_get_specific(nic); 470 ne2k_quiesce(ne2k); 471 472 return EOK; 473 } 474 461 475 static nic_iface_t ne2k_nic_iface = { 462 476 .set_address = ne2k_set_address, … … 467 481 468 482 static driver_ops_t ne2k_driver_ops = { 469 .dev_add = ne2k_dev_add 483 .dev_add = ne2k_dev_add, 484 .dev_quiesce = ne2k_dev_quiesce 470 485 }; 471 486 -
uspace/drv/nic/rtl8139/driver.c
raf28af6 r88cbc66 1 1 /* 2 * Copyright (c) 2025 Jiri Svoboda 2 3 * Copyright (c) 2011 Jiri Michalec 3 4 * All rights reserved. … … 74 75 * 75 76 */ 76 inlinestatic void rtl8139_lock_all(rtl8139_t *rtl8139)77 static void rtl8139_lock_all(rtl8139_t *rtl8139) 77 78 { 78 79 assert(rtl8139); … … 86 87 * 87 88 */ 88 inlinestatic void rtl8139_unlock_all(rtl8139_t *rtl8139)89 static void rtl8139_unlock_all(rtl8139_t *rtl8139) 89 90 { 90 91 assert(rtl8139); … … 127 128 * @param rtl8139 The card private structure 128 129 */ 129 inlinestatic void rtl8139_hw_int_set(rtl8139_t *rtl8139)130 static void rtl8139_hw_int_set(rtl8139_t *rtl8139) 130 131 { 131 132 pio_write_16(rtl8139->io_port + IMR, rtl8139->int_mask); … … 138 139 * @return Nonzero if empty, zero otherwise 139 140 */ 140 inlinestatic int rtl8139_hw_buffer_empty(rtl8139_t *rtl8139)141 static int rtl8139_hw_buffer_empty(rtl8139_t *rtl8139) 141 142 { 142 143 return pio_read_16(rtl8139->io_port + CR) & CR_BUFE; … … 166 167 * @param mask The mask to set 167 168 */ 168 inlinestatic void rtl8139_hw_set_mcast_mask(rtl8139_t *rtl8139,169 static void rtl8139_hw_set_mcast_mask(rtl8139_t *rtl8139, 169 170 uint64_t mask) 170 171 { … … 180 181 * @param bit_val If bit_val is zero pmen is set to 0, otherwise pmen is set to 1 181 182 */ 182 inlinestatic void rtl8139_hw_pmen_set(rtl8139_t *rtl8139, uint8_t bit_val)183 static void rtl8139_hw_pmen_set(rtl8139_t *rtl8139, uint8_t bit_val) 183 184 { 184 185 uint8_t config1 = pio_read_8(rtl8139->io_port + CONFIG1); … … 222 223 * @return EOK if succeed, error code otherwise 223 224 */ 224 inlinestatic void rtl8139_hw_get_addr(rtl8139_t *rtl8139,225 static void rtl8139_hw_get_addr(rtl8139_t *rtl8139, 225 226 nic_address_t *addr) 226 227 { … … 261 262 * @param bits_add The value to or 262 263 */ 263 inlinestatic void rtl8139_hw_reg_add_8(rtl8139_t *rtl8139, size_t reg_offset,264 static void rtl8139_hw_reg_add_8(rtl8139_t *rtl8139, size_t reg_offset, 264 265 uint8_t bits_add) 265 266 { … … 275 276 * @param bits_add The mask of bits to remove 276 277 */ 277 inlinestatic void rtl8139_hw_reg_rem_8(rtl8139_t *rtl8139, size_t reg_offset,278 static void rtl8139_hw_reg_rem_8(rtl8139_t *rtl8139, size_t reg_offset, 278 279 uint8_t bits_add) 279 280 { … … 338 339 339 340 static errno_t rtl8139_dev_add(ddf_dev_t *dev); 341 static errno_t rtl8139_dev_quiesce(ddf_dev_t *dev); 340 342 341 343 /** Basic driver operations for RTL8139 driver */ 342 344 static driver_ops_t rtl8139_driver_ops = { 343 345 .dev_add = &rtl8139_dev_add, 346 .dev_quiesce = &rtl8139_dev_quiesce 344 347 }; 345 348 … … 432 435 * @param io_base The address of the i/o port mapping start 433 436 */ 434 inlinestatic void rtl8139_hw_soft_reset(void *io_base)437 static void rtl8139_hw_soft_reset(void *io_base) 435 438 { 436 439 pio_write_8(io_base + CR, CR_RST); … … 845 848 * @return An error code otherwise. 846 849 */ 847 inlinestatic errno_t rtl8139_register_int_handler(nic_t *nic_data,850 static errno_t rtl8139_register_int_handler(nic_t *nic_data, 848 851 cap_irq_handle_t *handle) 849 852 { … … 872 875 * @param rtl8139 The card private data 873 876 */ 874 inlinestatic void rtl8139_card_up(rtl8139_t *rtl8139)877 static void rtl8139_card_up(rtl8139_t *rtl8139) 875 878 { 876 879 void *io_base = rtl8139->io_port; … … 1245 1248 } 1246 1249 } 1250 } 1251 1252 static void rtl8139_quiesce(rtl8139_t *rtl8139) 1253 { 1254 rtl8139_hw_soft_reset(rtl8139->io_port); 1247 1255 } 1248 1256 … … 1328 1336 rtl8139_dev_cleanup(dev); 1329 1337 return rc; 1338 } 1339 1340 /** Quiesce RTL8139. 1341 * 1342 * @param dev RTL8139 device. 1343 * @return EOK on sucess, or an error code. 1344 */ 1345 errno_t rtl8139_dev_quiesce(ddf_dev_t *dev) 1346 { 1347 nic_t *nic; 1348 rtl8139_t *rtl8139; 1349 1350 ddf_msg(LVL_NOTE, "RTL8139_dev_quiesce %s (handle = %zu)", 1351 ddf_dev_get_name(dev), ddf_dev_get_handle(dev)); 1352 1353 nic = nic_get_from_ddf_dev(dev); 1354 rtl8139 = nic_get_specific(nic); 1355 1356 rtl8139_quiesce(rtl8139); 1357 return EOK; 1330 1358 } 1331 1359 … … 1766 1794 * @param was_promisc Sign if the promiscuous mode was active before disabling 1767 1795 */ 1768 inlinestatic void rtl8139_rcx_promics_rem(nic_t *nic_data,1796 static void rtl8139_rcx_promics_rem(nic_t *nic_data, 1769 1797 nic_multicast_mode_t mcast_mode, uint8_t was_promisc) 1770 1798 { -
uspace/drv/nic/rtl8169/driver.c
raf28af6 r88cbc66 1 1 /* 2 * Copyright (c) 2025 Jiri Svoboda 2 3 * Copyright (c) 2014 Agnieszka Tabaka 3 4 * All rights reserved. … … 164 165 165 166 static errno_t rtl8169_dev_add(ddf_dev_t *dev); 167 static errno_t rtl8169_dev_quiesce(ddf_dev_t *dev); 166 168 167 169 /** Basic driver operations for RTL8169 driver */ 168 170 static driver_ops_t rtl8169_driver_ops = { 169 171 .dev_add = &rtl8169_dev_add, 172 .dev_quiesce = &rtl8169_dev_quiesce 170 173 }; 171 174 … … 362 365 } 363 366 364 inlinestatic errno_t rtl8169_register_int_handler(nic_t *nic_data,367 static errno_t rtl8169_register_int_handler(nic_t *nic_data, 365 368 cap_irq_handle_t *handle) 366 369 { … … 484 487 } 485 488 489 static errno_t rtl8169_dev_quiesce(ddf_dev_t *dev) 490 { 491 nic_t *nic; 492 rtl8169_t *rtl8169; 493 494 ddf_msg(LVL_NOTE, "RTL8169_dev_quiesce %s (handle = %zu)", 495 ddf_dev_get_name(dev), ddf_dev_get_handle(dev)); 496 497 nic = nic_get_from_ddf_dev(dev); 498 rtl8169 = nic_get_specific(nic); 499 500 /* Reset card */ 501 pio_write_8(rtl8169->regs + CONFIG0, 0); 502 rtl8169_reset(rtl8169); 503 504 return EOK; 505 } 506 486 507 static errno_t rtl8169_set_addr(ddf_fun_t *fun, const nic_address_t *addr) 487 508 { … … 762 783 } 763 784 764 inlinestatic void rtl8169_reset(rtl8169_t *rtl8169)785 static void rtl8169_reset(rtl8169_t *rtl8169) 765 786 { 766 787 pio_write_8(rtl8169->regs + CR, CR_RST); … … 807 828 * @param was_promisc Sign if the promiscuous mode was active before disabling 808 829 */ 809 inlinestatic void rtl8169_rcx_promics_rem(nic_t *nic_data,830 static void rtl8169_rcx_promics_rem(nic_t *nic_data, 810 831 nic_multicast_mode_t mcast_mode, uint8_t was_promisc) 811 832 { -
uspace/lib/ata/include/ata/ata.h
raf28af6 r88cbc66 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
raf28af6 r88cbc66 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
raf28af6 r88cbc66 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.