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


Ignore:
Timestamp:
2011-02-19T23:02:49Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
fb78ae72
Parents:
6edc69a
Message:

Use properly initialized interrupt code

File:
1 edited

Legend:

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

    r6edc69a rb9d910f  
    3939
    4040#include "uhci.h"
     41static irq_cmd_t uhci_cmds[] = {
     42        {
     43                .cmd = CMD_PIO_READ_16,
     44                .addr = (void*)0xc022,
     45                .dstarg = 1
     46        },
     47        {
     48                .cmd = CMD_PIO_WRITE_16,
     49                .addr = (void*)0xc022,
     50                .value = 0x1f
     51        },
     52        {
     53                .cmd = CMD_ACCEPT
     54        }
     55};
    4156
    4257static int uhci_init_transfer_lists(uhci_t *instance);
     
    101116{
    102117        assert(instance);
     118
     119        /* init interrupt code */
     120        irq_cmd_t *interrupt_commands = malloc(sizeof(uhci_cmds));
     121        if (interrupt_commands == NULL) {
     122                return ENOMEM;
     123        }
     124        memcpy(interrupt_commands, uhci_cmds, sizeof(uhci_cmds));
     125        interrupt_commands[0].addr = (void*)&instance->registers->usbsts;
     126        interrupt_commands[1].addr = (void*)&instance->registers->usbsts;
     127        instance->interrupt_code.cmds = interrupt_commands;
     128        instance->interrupt_code.cmdcount =
     129            sizeof(uhci_cmds) / sizeof(irq_cmd_t);
     130
    103131        /* init transfer lists */
    104132        int ret = uhci_init_transfer_lists(instance);
Note: See TracChangeset for help on using the changeset viewer.