Changeset cbfece7 in mainline for uspace/drv/bus/isa/isa.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/bus/isa/isa.c

    r96e368a rcbfece7  
    5454#include <ipc/irc.h>
    5555#include <ipc/services.h>
    56 #include <sysinfo.h>
    57 #include <ns.h>
    5856#include <sys/stat.h>
    59 #include <ipc/irc.h>
    60 #include <ipc/services.h>
    61 #include <sysinfo.h>
     57#include <irc.h>
    6258#include <ns.h>
    6359
     
    120116        assert(fun);
    121117
    122         sysarg_t apic;
    123         sysarg_t i8259;
    124 
    125         async_sess_t *irc_sess = NULL;
    126 
    127         if (((sysinfo_get_value("apic", &apic) == EOK) && (apic))
    128             || ((sysinfo_get_value("i8259", &i8259) == EOK) && (i8259))) {
    129                 irc_sess = service_connect_blocking(EXCHANGE_SERIALIZE,
    130                     SERVICE_IRC, 0, 0);
    131         }
    132 
    133         if (!irc_sess)
    134                 return false;
    135 
    136118        const hw_resource_list_t *res = &fun->hw_resources;
    137119        assert(res);
    138120        for (size_t i = 0; i < res->count; ++i) {
    139121                if (res->resources[i].type == INTERRUPT) {
    140                         const int irq = res->resources[i].res.interrupt.irq;
    141 
    142                         async_exch_t *exch = async_exchange_begin(irc_sess);
    143                         const int rc =
    144                             async_req_1_0(exch, IRC_ENABLE_INTERRUPT, irq);
    145                         async_exchange_end(exch);
    146 
    147                         if (rc != EOK) {
    148                                 async_hangup(irc_sess);
     122                        int rc = irc_enable_interrupt(
     123                            res->resources[i].res.interrupt.irq);
     124
     125                        if (rc != EOK)
    149126                                return false;
    150                         }
    151                 }
    152         }
    153 
    154         async_hangup(irc_sess);
     127                }
     128        }
     129
    155130        return true;
    156131}
Note: See TracChangeset for help on using the changeset viewer.