Changes in / [af28af6:88cbc66] in mainline


Ignore:
Location:
uspace
Files:
27 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/block/isa-ide/isa-ide.c

    raf28af6 r88cbc66  
    101101        ata_params_t params;
    102102
    103         ddf_msg(LVL_DEBUG, "isa_ide_ctrl_init()");
     103        ddf_msg(LVL_DEBUG, "isa_ide_channel_init()");
    104104
    105105        memset(&params, 0, sizeof(params));
     
    135135        irq_inited = true;
    136136
    137         ddf_msg(LVL_DEBUG, "isa_ide_ctrl_init(): Initialize IDE channel");
     137        ddf_msg(LVL_DEBUG, "isa_ide_channel_init(): Initialize IDE channel");
    138138
    139139        params.arg = (void *)chan;
     
    163163                goto error;
    164164
    165         ddf_msg(LVL_DEBUG, "isa_ide_ctrl_init: DONE");
     165        ddf_msg(LVL_DEBUG, "isa_ide_channel_init: DONE");
    166166        return EOK;
    167167error:
     
    181181        errno_t rc;
    182182
    183         ddf_msg(LVL_DEBUG, ": isa_ide_ctrl_remove()");
     183        ddf_msg(LVL_DEBUG, ": isa_ide_channel_fini()");
    184184
    185185        fibril_mutex_lock(&chan->lock);
     
    196196
    197197        return EOK;
     198}
     199
     200/** Quiesce ISA IDE channel. */
     201void 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);
    198208}
    199209
  • uspace/drv/block/isa-ide/isa-ide.h

    raf28af6 r88cbc66  
    11/*
    2  * Copyright (c) 2024 Jiri Svoboda
     2 * Copyright (c) 2025 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    104104    unsigned, isa_ide_hwres_t *);
    105105extern errno_t isa_ide_channel_fini(isa_ide_channel_t *);
     106extern void isa_ide_channel_quiesce(isa_ide_channel_t *);
    106107
    107108#endif
  • uspace/drv/block/isa-ide/main.c

    raf28af6 r88cbc66  
    4949static errno_t isa_ide_dev_remove(ddf_dev_t *dev);
    5050static errno_t isa_ide_dev_gone(ddf_dev_t *dev);
     51static errno_t isa_ide_dev_quiesce(ddf_dev_t *dev);
    5152static errno_t isa_ide_fun_online(ddf_fun_t *fun);
    5253static errno_t isa_ide_fun_offline(ddf_fun_t *fun);
     
    5556
    5657static 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
    6264};
    6365
     
    379381}
    380382
     383static 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
    381394static errno_t isa_ide_fun_online(ddf_fun_t *fun)
    382395{
  • uspace/drv/block/pc-floppy/main.c

    raf28af6 r88cbc66  
    4747static errno_t pc_fdc_dev_remove(ddf_dev_t *dev);
    4848static errno_t pc_fdc_dev_gone(ddf_dev_t *dev);
     49static errno_t pc_fdc_dev_quiesce(ddf_dev_t *dev);
    4950static errno_t pc_fdc_fun_online(ddf_fun_t *fun);
    5051static errno_t pc_fdc_fun_offline(ddf_fun_t *fun);
    5152
    5253static 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
    5860};
    5961
     
    183185}
    184186
     187/** Quiesce FDC device.
     188 *
     189 * @param dev Device
     190 * @return EOK on success or an error code
     191 */
     192static 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
    185199/** Online FDC function.
    186200 *
  • uspace/drv/block/pc-floppy/pc-floppy.c

    raf28af6 r88cbc66  
    11/*
    2  * Copyright (c) 2024 Jiri Svoboda
     2 * Copyright (c) 2025 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    256256}
    257257
     258/** Quiesce floppy controller.
     259 *
     260 * @param fdc Floppy controller
     261 */
     262void pc_fdc_quiesce(pc_fdc_t *fdc)
     263{
     264        (void)pc_fdc_reset(fdc);
     265}
     266
    258267/** Enable device I/O.
    259268 *
  • uspace/drv/block/pc-floppy/pc-floppy.h

    raf28af6 r88cbc66  
    11/*
    2  * Copyright (c) 2024 Jiri Svoboda
     2 * Copyright (c) 2025 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    9797
    9898extern errno_t pc_fdc_create(ddf_dev_t *, pc_fdc_hwres_t *, pc_fdc_t **);
     99extern void pc_fdc_quiesce(pc_fdc_t *);
    99100extern errno_t pc_fdc_destroy(pc_fdc_t *);
    100101
  • uspace/drv/block/pci-ide/main.c

    raf28af6 r88cbc66  
    4949static errno_t pci_ide_dev_remove(ddf_dev_t *dev);
    5050static errno_t pci_ide_dev_gone(ddf_dev_t *dev);
     51static errno_t pci_ide_dev_quiesce(ddf_dev_t *dev);
    5152static errno_t pci_ide_fun_online(ddf_fun_t *fun);
    5253static errno_t pci_ide_fun_offline(ddf_fun_t *fun);
     
    5556
    5657static 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
    6264};
    6365
     
    367369}
    368370
     371static 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
    369383static errno_t pci_ide_fun_online(ddf_fun_t *fun)
    370384{
  • uspace/drv/block/pci-ide/pci-ide.c

    raf28af6 r88cbc66  
    331331}
    332332
     333/** Quiesce PCI IDE channel. */
     334void 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
    333343/** Enable device I/O. */
    334344static errno_t pci_ide_init_io(pci_ide_channel_t *chan)
  • uspace/drv/block/pci-ide/pci-ide.h

    raf28af6 r88cbc66  
    11/*
    2  * Copyright (c) 2024 Jiri Svoboda
     2 * Copyright (c) 2025 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    129129    unsigned, pci_ide_hwres_t *);
    130130extern errno_t pci_ide_channel_fini(pci_ide_channel_t *);
     131extern void pci_ide_channel_quiesce(pci_ide_channel_t *);
    131132
    132133#endif
  • uspace/drv/bus/usb/ohci/hw_struct/completion_codes.h

    raf28af6 r88cbc66  
    11/*
     2 * Copyright (c) 2025 Jiri Svoboda
    23 * Copyright (c) 2011 Jan Vesely
    34 * All rights reserved.
     
    5455};
    5556
    56 inline static errno_t cc_to_rc(unsigned int cc)
     57static inline errno_t cc_to_rc(unsigned int cc)
    5758{
    5859        switch (cc) {
  • uspace/drv/bus/usb/ohci/hw_struct/transfer_descriptor.h

    raf28af6 r88cbc66  
    11/*
     2 * Copyright (c) 2025 Jiri Svoboda
    23 * Copyright (c) 2011 Jan Vesely
    34 * All rights reserved.
     
    103104 * @return true if the TD was accessed and processed by hw, false otherwise.
    104105 */
    105 inline static bool td_is_finished(const td_t *instance)
     106static inline bool td_is_finished(const td_t *instance)
    106107{
    107108        assert(instance);
  • uspace/drv/char/i8042/i8042.c

    raf28af6 r88cbc66  
    11/*
     2 * Copyright (c) 2025 Jiri Svoboda
    23 * Copyright (c) 2001-2004 Jakub Jermar
    34 * Copyright (c) 2006 Josef Cejka
    4  * Copyright (c) 2021 Jiri Svoboda
    55 * Copyright (c) 2011 Jan Vesely
    66 * All rights reserved.
     
    346346}
    347347
     348/** Quiesce i8042.
     349 *
     350 * @param dev i8042 instance.
     351 */
     352void 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
    348361/** Write data to i8042 port.
    349362 *
  • uspace/drv/char/i8042/i8042.h

    raf28af6 r88cbc66  
    11/*
    2  * Copyright (c) 2024 Jiri Svoboda
     2 * Copyright (c) 2025 Jiri Svoboda
    33 * Copyright (c) 2006 Josef Cejka
    44 * Copyright (c) 2011 Jan Vesely
     
    9595
    9696extern errno_t i8042_init(i8042_t *, addr_range_t *, int, int, ddf_dev_t *);
     97extern void i8042_quiesce(i8042_t *);
    9798
    9899#endif
  • uspace/drv/char/i8042/main.c

    raf28af6 r88cbc66  
    11/*
     2 * Copyright (c) 2025 Jiri Svoboda
    23 * Copyright (c) 2011 Jan Vesely
    34 * All rights reserved.
     
    135136}
    136137
     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 */
     145static 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
    137156/** DDF driver operations. */
    138157static driver_ops_t i8042_driver_ops = {
    139158        .dev_add = i8042_dev_add,
     159        .dev_quiesce = i8042_dev_quiesce
    140160};
    141161
  • uspace/drv/char/ns8250/ns8250.c

    raf28af6 r88cbc66  
    11/*
     2 * Copyright (c) 2025 Jiri Svoboda
    23 * Copyright (c) 2010 Lenka Trochtova
    3  * Copyright (c) 2017 Jiri Svoboda
    44 * All rights reserved.
    55 *
     
    327327
    328328static errno_t ns8250_dev_add(ddf_dev_t *dev);
     329static errno_t ns8250_dev_quiesce(ddf_dev_t *dev);
    329330static errno_t ns8250_dev_remove(ddf_dev_t *dev);
    330331
     
    332333static driver_ops_t ns8250_ops = {
    333334        .dev_add = &ns8250_dev_add,
    334         .dev_remove = &ns8250_dev_remove
     335        .dev_remove = &ns8250_dev_remove,
     336        .dev_quiesce = &ns8250_dev_quiesce
    335337};
    336338
     
    966968}
    967969
     970static 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
    968978/** Open the device.
    969979 *
  • uspace/drv/char/pc-lpt/main.c

    raf28af6 r88cbc66  
    11/*
    2  * Copyright (c) 2018 Jiri Svoboda
     2 * Copyright (c) 2025 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    4646static errno_t pc_lpt_dev_remove(ddf_dev_t *dev);
    4747static errno_t pc_lpt_dev_gone(ddf_dev_t *dev);
     48static errno_t pc_lpt_dev_quiesce(ddf_dev_t *dev);
    4849static errno_t pc_lpt_fun_online(ddf_fun_t *fun);
    4950static errno_t pc_lpt_fun_offline(ddf_fun_t *fun);
     
    5354        .dev_remove = pc_lpt_dev_remove,
    5455        .dev_gone = pc_lpt_dev_gone,
     56        .dev_quiesce = pc_lpt_dev_quiesce,
    5557        .fun_online = pc_lpt_fun_online,
    5658        .fun_offline = pc_lpt_fun_offline
     
    140142}
    141143
     144static 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
    142154static errno_t pc_lpt_fun_online(ddf_fun_t *fun)
    143155{
  • uspace/drv/char/pc-lpt/pc-lpt.c

    raf28af6 r88cbc66  
    11/*
    2  * Copyright (c) 2018 Jiri Svoboda
     2 * Copyright (c) 2025 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    196196}
    197197
     198/** Quiesce pc-lpt device */
     199void 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
    198207/** Write a single byte to the parallel port.
    199208 *
  • uspace/drv/char/pc-lpt/pc-lpt.h

    raf28af6 r88cbc66  
    11/*
    2  * Copyright (c) 2018 Jiri Svoboda
     2 * Copyright (c) 2025 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    7474extern errno_t pc_lpt_remove(pc_lpt_t *);
    7575extern errno_t pc_lpt_gone(pc_lpt_t *);
     76extern void pc_lpt_quiesce(pc_lpt_t *);
    7677
    7778#endif
  • uspace/drv/nic/e1k/e1k.c

    raf28af6 r88cbc66  
    12721272 *
    12731273 */
    1274 inline static errno_t e1000_register_int_handler(nic_t *nic,
     1274static errno_t e1000_register_int_handler(nic_t *nic,
    12751275    cap_irq_handle_t *handle)
    12761276{
     
    19211921 *
    19221922 */
    1923 inline static void e1000_delete_dev_data(ddf_dev_t *dev)
     1923static void e1000_delete_dev_data(ddf_dev_t *dev)
    19241924{
    19251925        assert(dev);
  • uspace/drv/nic/ne2k/dp8390.c

    raf28af6 r88cbc66  
    11/*
     2 * Copyright (c) 2025 Jiri Svoboda
    23 * Copyright (c) 2009 Lukas Mejdrech
    34 * Copyright (c) 2011 Martin Decky
     
    182183                        break;
    183184        }
     185}
     186
     187/** Quiesce NE2000.
     188 *
     189 * @param ne2k NE2000
     190 */
     191void ne2k_quiesce(ne2k_t *ne2k)
     192{
     193        ne2k_init(ne2k);
    184194}
    185195
  • uspace/drv/nic/ne2k/dp8390.h

    raf28af6 r88cbc66  
    11/*
     2 * Copyright (c) 2025 Jiri Svoboda
    23 * Copyright (c) 2009 Lukas Mejdrech
    34 * Copyright (c) 2011 Martin Decky
     
    267268extern errno_t ne2k_probe(ne2k_t *);
    268269extern errno_t ne2k_up(ne2k_t *);
     270extern void ne2k_quiesce(ne2k_t *);
    269271extern void ne2k_down(ne2k_t *);
    270272extern void ne2k_send(nic_t *, void *, size_t);
  • uspace/drv/nic/ne2k/ne2k.c

    raf28af6 r88cbc66  
    11/*
     2 * Copyright (c) 2025 Jiri Svoboda
    23 * Copyright (c) 2011 Martin Decky
    34 * Copyright (c) 2011 Radim Vansa
     
    459460}
    460461
     462static 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
    461475static nic_iface_t ne2k_nic_iface = {
    462476        .set_address = ne2k_set_address,
     
    467481
    468482static driver_ops_t ne2k_driver_ops = {
    469         .dev_add = ne2k_dev_add
     483        .dev_add = ne2k_dev_add,
     484        .dev_quiesce = ne2k_dev_quiesce
    470485};
    471486
  • uspace/drv/nic/rtl8139/driver.c

    raf28af6 r88cbc66  
    11/*
     2 * Copyright (c) 2025 Jiri Svoboda
    23 * Copyright (c) 2011 Jiri Michalec
    34 * All rights reserved.
     
    7475 *
    7576 */
    76 inline static void rtl8139_lock_all(rtl8139_t *rtl8139)
     77static void rtl8139_lock_all(rtl8139_t *rtl8139)
    7778{
    7879        assert(rtl8139);
     
    8687 *
    8788 */
    88 inline static void rtl8139_unlock_all(rtl8139_t *rtl8139)
     89static void rtl8139_unlock_all(rtl8139_t *rtl8139)
    8990{
    9091        assert(rtl8139);
     
    127128 *  @param rtl8139  The card private structure
    128129 */
    129 inline static void rtl8139_hw_int_set(rtl8139_t *rtl8139)
     130static void rtl8139_hw_int_set(rtl8139_t *rtl8139)
    130131{
    131132        pio_write_16(rtl8139->io_port + IMR, rtl8139->int_mask);
     
    138139 *  @return Nonzero if empty, zero otherwise
    139140 */
    140 inline static int rtl8139_hw_buffer_empty(rtl8139_t *rtl8139)
     141static int rtl8139_hw_buffer_empty(rtl8139_t *rtl8139)
    141142{
    142143        return pio_read_16(rtl8139->io_port + CR) & CR_BUFE;
     
    166167 *  @param mask     The mask to set
    167168 */
    168 inline static void rtl8139_hw_set_mcast_mask(rtl8139_t *rtl8139,
     169static void rtl8139_hw_set_mcast_mask(rtl8139_t *rtl8139,
    169170    uint64_t mask)
    170171{
     
    180181 *  @param bit_val  If bit_val is zero pmen is set to 0, otherwise pmen is set to 1
    181182 */
    182 inline static void rtl8139_hw_pmen_set(rtl8139_t *rtl8139, uint8_t bit_val)
     183static void rtl8139_hw_pmen_set(rtl8139_t *rtl8139, uint8_t bit_val)
    183184{
    184185        uint8_t config1 = pio_read_8(rtl8139->io_port + CONFIG1);
     
    222223 *  @return EOK if succeed, error code otherwise
    223224 */
    224 inline static void rtl8139_hw_get_addr(rtl8139_t *rtl8139,
     225static void rtl8139_hw_get_addr(rtl8139_t *rtl8139,
    225226    nic_address_t *addr)
    226227{
     
    261262 *   @param bits_add    The value to or
    262263 */
    263 inline static void rtl8139_hw_reg_add_8(rtl8139_t *rtl8139, size_t reg_offset,
     264static void rtl8139_hw_reg_add_8(rtl8139_t *rtl8139, size_t reg_offset,
    264265    uint8_t bits_add)
    265266{
     
    275276 *   @param bits_add    The mask of bits to remove
    276277 */
    277 inline static void rtl8139_hw_reg_rem_8(rtl8139_t *rtl8139, size_t reg_offset,
     278static void rtl8139_hw_reg_rem_8(rtl8139_t *rtl8139, size_t reg_offset,
    278279    uint8_t bits_add)
    279280{
     
    338339
    339340static errno_t rtl8139_dev_add(ddf_dev_t *dev);
     341static errno_t rtl8139_dev_quiesce(ddf_dev_t *dev);
    340342
    341343/** Basic driver operations for RTL8139 driver */
    342344static driver_ops_t rtl8139_driver_ops = {
    343345        .dev_add = &rtl8139_dev_add,
     346        .dev_quiesce = &rtl8139_dev_quiesce
    344347};
    345348
     
    432435 *  @param io_base  The address of the i/o port mapping start
    433436 */
    434 inline static void rtl8139_hw_soft_reset(void *io_base)
     437static void rtl8139_hw_soft_reset(void *io_base)
    435438{
    436439        pio_write_8(io_base + CR, CR_RST);
     
    845848 *  @return An error code otherwise.
    846849 */
    847 inline static errno_t rtl8139_register_int_handler(nic_t *nic_data,
     850static errno_t rtl8139_register_int_handler(nic_t *nic_data,
    848851    cap_irq_handle_t *handle)
    849852{
     
    872875 * @param rtl8139  The card private data
    873876 */
    874 inline static void rtl8139_card_up(rtl8139_t *rtl8139)
     877static void rtl8139_card_up(rtl8139_t *rtl8139)
    875878{
    876879        void *io_base = rtl8139->io_port;
     
    12451248                }
    12461249        }
     1250}
     1251
     1252static void rtl8139_quiesce(rtl8139_t *rtl8139)
     1253{
     1254        rtl8139_hw_soft_reset(rtl8139->io_port);
    12471255}
    12481256
     
    13281336        rtl8139_dev_cleanup(dev);
    13291337        return rc;
     1338}
     1339
     1340/** Quiesce RTL8139.
     1341 *
     1342 * @param dev RTL8139 device.
     1343 * @return EOK on sucess, or an error code.
     1344 */
     1345errno_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;
    13301358}
    13311359
     
    17661794 *  @param was_promisc  Sign if the promiscuous mode was active before disabling
    17671795 */
    1768 inline static void rtl8139_rcx_promics_rem(nic_t *nic_data,
     1796static void rtl8139_rcx_promics_rem(nic_t *nic_data,
    17691797    nic_multicast_mode_t mcast_mode, uint8_t was_promisc)
    17701798{
  • uspace/drv/nic/rtl8169/driver.c

    raf28af6 r88cbc66  
    11/*
     2 * Copyright (c) 2025 Jiri Svoboda
    23 * Copyright (c) 2014 Agnieszka Tabaka
    34 * All rights reserved.
     
    164165
    165166static errno_t rtl8169_dev_add(ddf_dev_t *dev);
     167static errno_t rtl8169_dev_quiesce(ddf_dev_t *dev);
    166168
    167169/** Basic driver operations for RTL8169 driver */
    168170static driver_ops_t rtl8169_driver_ops = {
    169171        .dev_add = &rtl8169_dev_add,
     172        .dev_quiesce = &rtl8169_dev_quiesce
    170173};
    171174
     
    362365}
    363366
    364 inline static errno_t rtl8169_register_int_handler(nic_t *nic_data,
     367static errno_t rtl8169_register_int_handler(nic_t *nic_data,
    365368    cap_irq_handle_t *handle)
    366369{
     
    484487}
    485488
     489static 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
    486507static errno_t rtl8169_set_addr(ddf_fun_t *fun, const nic_address_t *addr)
    487508{
     
    762783}
    763784
    764 inline static void rtl8169_reset(rtl8169_t *rtl8169)
     785static void rtl8169_reset(rtl8169_t *rtl8169)
    765786{
    766787        pio_write_8(rtl8169->regs + CR, CR_RST);
     
    807828 *  @param was_promisc  Sign if the promiscuous mode was active before disabling
    808829 */
    809 inline static void rtl8169_rcx_promics_rem(nic_t *nic_data,
     830static void rtl8169_rcx_promics_rem(nic_t *nic_data,
    810831    nic_multicast_mode_t mcast_mode, uint8_t was_promisc)
    811832{
  • uspace/lib/ata/include/ata/ata.h

    raf28af6 r88cbc66  
    11/*
    2  * Copyright (c) 2024 Jiri Svoboda
     2 * Copyright (c) 2025 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    201201extern errno_t ata_channel_initialize(ata_channel_t *);
    202202extern errno_t ata_channel_destroy(ata_channel_t *);
     203extern void ata_channel_quiesce(ata_channel_t *);
    203204extern void ata_channel_irq(ata_channel_t *, uint8_t);
    204205extern void ata_connection(ipc_call_t *, ata_device_t *);
  • uspace/lib/ata/include/ata/ata_hw.h

    raf28af6 r88cbc66  
    11/*
    2  * Copyright (c) 2024 Jiri Svoboda
     2 * Copyright (c) 2025 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    106106#define REG_COMMAND offsetof(ata_cmd_t, command)
    107107#define REG_FEATURES offsetof(ata_cmd_t, features)
     108#define REG_DEVCTL offsetof(ata_ctl_t, device_control)
    108109
    109110enum devctl_bits {
  • uspace/lib/ata/src/ata.c

    raf28af6 r88cbc66  
    8484static uint8_t ata_read_cmd_8(ata_channel_t *, uint16_t);
    8585static void ata_write_cmd_8(ata_channel_t *, uint16_t, uint8_t);
     86static void ata_write_ctl_8(ata_channel_t *, uint16_t, uint8_t);
    8687
    8788static errno_t ata_bd_init_irq(ata_channel_t *);
     
    279280}
    280281
     282/** Quiesce ATA channel. */
     283void 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
    281292/** Add ATA device.
    282293 *
     
    348359{
    349360        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 */
     369static 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);
    350372}
    351373
Note: See TracChangeset for help on using the changeset viewer.