Changeset fb78ae72 in mainline for uspace/drv/uhci-hcd/main.c


Ignore:
Timestamp:
2011-02-19T23:34:48Z (14 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
423e8c81, deece2f
Parents:
b9d910f
Message:

Move interrupt enabling code to pciintel driver

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/uhci-hcd/main.c

    rb9d910f rfb78ae72  
    3434#include <driver.h>
    3535#include <usb_iface.h>
    36 #include <ipc/irc.h>
    37 #include <ipc/ns.h>
    38 #include <ipc/services.h>
    39 #include <sysinfo.h>
     36#include <device/hw_res.h>
    4037
    4138#include <errno.h>
     
    8481        assert(device);
    8582        uhci_t *hc = dev_to_uhci(device);
    86         usb_log_info("LOL HARDWARE INTERRUPT: %p.\n", hc);
    8783        uint16_t status = IPC_GET_ARG1(*call);
    8884        assert(hc);
     
    111107
    112108        CHECK_RET_RETURN(ret,
    113             "Failed(%d) to get I/O registers addresses for device:.\n",
    114             ret, device->handle);
     109            "Failed(%d) to get I/O addresses:.\n", ret, device->handle);
    115110        usb_log_info("I/O regs at 0x%X (size %zu), IRQ %d.\n",
    116111            io_reg_base, io_reg_size, irq);
    117112
    118 
    119   sysarg_t apic;
    120   sysarg_t i8259;
    121         int irc_phone = -1;
    122         int irc_service = 0;
    123 
    124   if ((sysinfo_get_value("apic", &apic) == EOK) && (apic)) {
    125     irc_service = SERVICE_APIC;
    126                 usb_log_debug("SERVICE_APIC\n");
    127         } else if ((sysinfo_get_value("i8259", &i8259) == EOK) && (i8259)) {
    128     irc_service = SERVICE_I8259;
    129                 usb_log_debug("SERVICE_I8259\n");
    130         }
    131 
    132   if (irc_service) {
    133     while (irc_phone < 0)
    134       irc_phone = service_connect_blocking(irc_service, 0, 0);
    135   }
    136         usb_log_debug("Interrupt conttroller phone: %d\n", irc_phone);
    137 
    138         async_msg_1(irc_phone, IRC_ENABLE_INTERRUPT, irq);
    139         async_hangup(irc_phone);
    140 
     113        ret = pci_enable_interrupts(device);
     114        CHECK_RET_RETURN(ret, "Failed(%d) to get enable interrupts:\n", ret);
    141115
    142116        uhci_t *uhci_hc = malloc(sizeof(uhci_t));
Note: See TracChangeset for help on using the changeset viewer.