Changeset cbfece7 in mainline for uspace/drv/char/ns8250/ns8250.c


Ignore:
Timestamp:
2014-07-21T22:10:18Z (10 years ago)
Author:
Agnieszka Tabaka <nufcia@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1f1fa64
Parents:
96e368a (diff), 54a1ca7 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:
  • Merged mainline changes
  • Refactored rtl8169 driver to work with recent driver framework changes
  • Fixed speed selection in rtl8169 (disables autonegotiation first)
  • Added support for restarting autonegotiation
  • Added new switch to 'nic' utility which restarts autonegotiation
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/char/ns8250/ns8250.c

    r96e368a rcbfece7  
    5757#include <ops/char_dev.h>
    5858
    59 #include <ns.h>
    60 #include <ipc/services.h>
    61 #include <ipc/irc.h>
     59#include <irc.h>
    6260#include <device/hw_res.h>
    6361#include <ipc/serial_ctl.h>
     
    488486static int ns8250_interrupt_enable(ns8250_t *ns)
    489487{
    490         /*
    491          * Enable interrupt using IRC service.
    492          * TODO: This is a temporary solution until the device framework
    493          * takes care of this itself.
    494          */
    495         async_sess_t *irc_sess = service_connect_blocking(EXCHANGE_SERIALIZE,
    496             SERVICE_IRC, 0, 0);
    497         if (!irc_sess) {
     488        /* Enable interrupt using IRC service. */
     489        int rc = irc_enable_interrupt(ns->irq);
     490        if (rc != EOK)
    498491                return EIO;
    499         }
    500 
    501         async_exch_t *exch = async_exchange_begin(irc_sess);
    502         if (!exch) {
    503                 return EIO;
    504         }
    505         async_msg_1(exch, IRC_ENABLE_INTERRUPT, ns->irq);
    506         async_exchange_end(exch);
    507 
     492       
    508493        /* Read LSR to clear possible previous LSR interrupt */
    509494        pio_read_8(&ns->regs->lsr);
    510 
     495       
    511496        /* Enable interrupt on the serial port. */
    512497        ns8250_port_interrupts_enable(ns->regs);
Note: See TracChangeset for help on using the changeset viewer.