Changes in uspace/drv/ohci/hc.c [3e4f2e0:c8eddf4] in mainline


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/ohci/hc.c

    r3e4f2e0 rc8eddf4  
    4040#include <usb/usb.h>
    4141#include <usb/ddfiface.h>
     42#include <usb/usbdevice.h>
    4243
    4344#include "hc.h"
     
    4849static int interrupt_emulator(hc_t *instance);
    4950static void hc_gain_control(hc_t *instance);
     51static void hc_init_hw(hc_t *instance);
    5052static int hc_init_transfer_lists(hc_t *instance);
    5153static int hc_init_memory(hc_t *instance);
     
    9092                usb_log_error("Failed add root hub match-id.\n");
    9193        }
    92         ret = ddf_fun_bind(hub_fun);
    9394        return ret;
    9495}
    9596/*----------------------------------------------------------------------------*/
    96 int hc_init(hc_t *instance, uintptr_t regs, size_t reg_size, bool interrupts)
     97int hc_init(hc_t *instance, ddf_fun_t *fun, ddf_dev_t *dev,
     98    uintptr_t regs, size_t reg_size, bool interrupts)
    9799{
    98100        assert(instance);
     
    109111            ret, str_error(ret));
    110112
    111         list_initialize(&instance->pending_batches);
    112113        usb_device_keeper_init(&instance->manager);
    113114        ret = usb_endpoint_manager_init(&instance->ep_manager,
     
    116117            str_error(ret));
    117118
     119        hc_gain_control(instance);
    118120        ret = hc_init_memory(instance);
    119121        CHECK_RET_RETURN(ret, "Failed to create OHCI memory structures: %s.\n",
    120122            str_error(ret));
    121 #undef CHECK_RET_RETURN
    122 
    123 
    124 //      hc_init_hw(instance);
    125         hc_gain_control(instance);
     123        hc_init_hw(instance);
    126124        fibril_mutex_initialize(&instance->guard);
    127125
     
    134132        }
    135133
     134        list_initialize(&instance->pending_batches);
     135#undef CHECK_RET_RETURN
    136136        return EOK;
    137137}
     
    287287{
    288288        assert(instance);
    289         usb_log_debug("OHCI(%p) interrupt: %x.\n", instance, status);
     289        usb_log_debug("OHCI interrupt: %x.\n", status);
    290290        if ((status & ~I_SF) == 0) /* ignore sof status */
    291291                return;
     
    339339            (uint32_t*)((char*)instance->registers + 0x100);
    340340        usb_log_debug("OHCI legacy register %p: %x.\n",
    341             ohci_emulation_reg, *ohci_emulation_reg);
    342         /* Do not change A20 state */
    343         *ohci_emulation_reg &= 0x100;
    344         usb_log_debug("OHCI legacy register %p: %x.\n",
    345             ohci_emulation_reg, *ohci_emulation_reg);
     341                ohci_emulation_reg, *ohci_emulation_reg);
     342        *ohci_emulation_reg &= ~0x1;
    346343
    347344        /* Interrupt routing enabled => smm driver is active */
     
    353350                }
    354351                usb_log_info("SMM driver: Ownership taken.\n");
    355                 instance->registers->control &= (C_HCFS_RESET << C_HCFS_SHIFT);
    356                 async_usleep(50000);
    357352                return;
    358353        }
     
    380375}
    381376/*----------------------------------------------------------------------------*/
    382 void hc_start_hw(hc_t *instance)
     377void hc_init_hw(hc_t *instance)
    383378{
    384379        /* OHCI guide page 42 */
     
    479474{
    480475        assert(instance);
    481 
    482         bzero(&instance->rh, sizeof(instance->rh));
    483476        /* Init queues */
    484477        hc_init_transfer_lists(instance);
Note: See TracChangeset for help on using the changeset viewer.