Ignore:
Timestamp:
2012-08-12T11:46:44Z (12 years ago)
Author:
Maurizio Lombardi <m.lombardi85@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
41b764b7
Parents:
e1e4192 (diff), 371cb6c (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 mainline changes

File:
1 edited

Legend:

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

    re1e4192 r90478727  
    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.