Fork us on GitHub Follow us on Facebook Follow us on Twitter

Ignore:
Timestamp:
2012-07-20T18:14:55Z (9 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master
Children:
b828907, be67118
Parents:
7030bc9 (diff), 32260a0 (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:

Merge USB branch.

USB should be endian agnostic now.
OHCI and pci work on qemu powerpc, but pci locks up on real hw.
Hopefully no regressions on amd64/ia32.
Tested on qemu and Virtualbox.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/ohci/hw_struct/transfer_descriptor.c

    r7030bc9 r6de2d766  
    3333 */
    3434#include <usb/usb.h>
     35#include <mem.h>
     36#include "../utils/malloc32.h"
    3537#include "transfer_descriptor.h"
    3638
     
    5860        bzero(instance, sizeof(td_t));
    5961        /* Set PID and Error code */
    60         instance->status = 0
    61             | ((dir[direction] & TD_STATUS_DP_MASK) << TD_STATUS_DP_SHIFT)
    62             | ((CC_NOACCESS2 & TD_STATUS_CC_MASK) << TD_STATUS_CC_SHIFT);
     62        OHCI_MEM32_WR(instance->status,
     63            ((dir[direction] & TD_STATUS_DP_MASK) << TD_STATUS_DP_SHIFT)
     64            | ((CC_NOACCESS2 & TD_STATUS_CC_MASK) << TD_STATUS_CC_SHIFT));
    6365
    6466        if (toggle == 0 || toggle == 1) {
    6567                /* Set explicit toggle bit */
    66                 instance->status |= TD_STATUS_T_USE_TD_FLAG;
    67                 instance->status |= toggle ? TD_STATUS_T_FLAG : 0;
     68                OHCI_MEM32_SET(instance->status, TD_STATUS_T_USE_TD_FLAG);
     69                OHCI_MEM32_SET(instance->status, toggle ? TD_STATUS_T_FLAG : 0);
    6870        }
    6971
    7072        /* Alow less data on input. */
    7173        if (dir == USB_DIRECTION_IN) {
    72                 instance->status |= TD_STATUS_ROUND_FLAG;
     74                OHCI_MEM32_SET(instance->status, TD_STATUS_ROUND_FLAG);
    7375        }
    7476
    7577        if (buffer != NULL) {
    7678                assert(size != 0);
    77                 instance->cbp = addr_to_phys(buffer);
    78                 instance->be = addr_to_phys(buffer + size - 1);
     79                OHCI_MEM32_WR(instance->cbp, addr_to_phys(buffer));
     80                OHCI_MEM32_WR(instance->be, addr_to_phys(buffer + size - 1));
    7981        }
    8082
    81         instance->next = addr_to_phys(next) & TD_NEXT_PTR_MASK;
     83        OHCI_MEM32_WR(instance->next, addr_to_phys(next) & TD_NEXT_PTR_MASK);
    8284
    8385}
Note: See TracChangeset for help on using the changeset viewer.