Changeset 7977fa1 in mainline


Ignore:
Timestamp:
2011-01-25T19:16:03Z (14 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
89a0485a
Parents:
d5f7a8ab
Message:

Add append function, check return value of TD init

Location:
uspace/drv/uhci
Files:
2 edited

Legend:

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

    rd5f7a8ab r7977fa1  
    1010
    1111static int init_tranfer_lists(transfer_list_t list[]);
     12
     13//static int init_transfer();
    1214
    1315int uhci_init(device_t *device, void *regs)
     
    8082            usb_str_transfer_type(transfer_type),
    8183            size);
     84
    8285        if (size >= 1024)
    8386                return ENOTSUP;
     
    104107        CHECK_RET_FREE_JOB(ret, "Failed to allocate tranfer descriptor.\n");
    105108
    106         transfer_descriptor_init(td, 3, size, false, target, USB_PID_IN);
     109        ret = transfer_descriptor_init(td, 3, size, false, target, USB_PID_IN);
     110        if (ret != EOK) {
     111                uhci_print_error("Failed to initialize transfer descriptor.\n");
     112                trans_free(td);
     113                trans_free(job);
     114                return ret;
     115        }
     116        td->callback = job;
    107117
    108118
  • uspace/drv/uhci/uhci_struct/transfer_descriptor.h

    rd5f7a8ab r7977fa1  
    3838#include <usb/usb.h>
    3939
     40#include "translating_malloc.h"
    4041#include "callback.h"
    4142#include "link_pointer.h"
     
    120121}
    121122
     123static inline void transfer_descriptor_append(
     124  transfer_descriptor_t *instance, transfer_descriptor_t *item)
     125{
     126        assert(instance);
     127        instance->next_va = item;
     128        instance->next = (uintptr_t)addr_to_phys( item ) & LINK_POINTER_ADDRESS_MASK;
     129}
     130
    122131#endif
    123132/**
Note: See TracChangeset for help on using the changeset viewer.