Changeset d321cd7 in mainline


Ignore:
Timestamp:
2011-02-11T18:12:59Z (13 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1824609b, edfed73
Parents:
4e8e1f5 (diff), 8f198c9 (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 development/ changes

Location:
uspace
Files:
10 edited

Legend:

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

    r4e8e1f5 rd321cd7  
    166166    usbhc_iface_transfer_out_callback_t callback, void *arg)
    167167{
    168         usb_log_warning("Using deprecated API control write setup.\n");
     168        usb_log_warning("Using deprecated API %s.\n", __FUNCTION__);
    169169        tracker_t *tracker = tracker_get(dev, target, USB_TRANSFER_CONTROL,
    170170            8, FULL_SPEED, data, size, NULL, callback, arg);
     
    179179    usbhc_iface_transfer_out_callback_t callback, void *arg)
    180180{
     181        usb_log_warning("Using deprecated API %s.\n", __FUNCTION__);
    181182        tracker_t *tracker = tracker_get(dev, target, USB_TRANSFER_CONTROL,
    182183            size, FULL_SPEED, data, size, NULL, callback, arg);
     
    190191    usbhc_iface_transfer_in_callback_t callback, void *arg)
    191192{
     193        usb_log_warning("Using deprecated API %s.\n", __FUNCTION__);
    192194        tracker_t *tracker = tracker_get(dev, target, USB_TRANSFER_CONTROL,
    193195            0, FULL_SPEED, NULL, 0, callback, NULL, arg);
     
    202204    usbhc_iface_transfer_out_callback_t callback, void *arg)
    203205{
    204         usb_log_warning("Using deprecated API control read setup.\n");
     206        usb_log_warning("Using deprecated API %s.\n", __FUNCTION__);
    205207        tracker_t *tracker = tracker_get(dev, target, USB_TRANSFER_CONTROL,
    206208            8, FULL_SPEED, data, size, NULL, callback, arg);
     
    215217    usbhc_iface_transfer_in_callback_t callback, void *arg)
    216218{
     219        usb_log_warning("Using deprecated API %s.\n", __FUNCTION__);
    217220        tracker_t *tracker = tracker_get(dev, target, USB_TRANSFER_CONTROL,
    218221            size, FULL_SPEED, data, size, callback, NULL, arg);
     
    226229    usbhc_iface_transfer_out_callback_t callback, void *arg)
    227230{
     231        usb_log_warning("Using deprecated API %s.\n", __FUNCTION__);
    228232        tracker_t *tracker = tracker_get(dev, target, USB_TRANSFER_CONTROL,
    229233            0, FULL_SPEED, NULL, 0, NULL, callback, arg);
  • uspace/drv/uhci-hcd/root_hub.c

    r4e8e1f5 rd321cd7  
    3535#include <errno.h>
    3636#include <stdio.h>
    37 
    3837#include <usb_iface.h>
    39 
    4038#include <usb/debug.h>
    4139
    4240#include "root_hub.h"
     41
     42extern device_ops_t child_ops;
    4343/*----------------------------------------------------------------------------*/
    44 static int usb_iface_get_hc_handle(device_t *dev, devman_handle_t *handle)
    45 {
    46   assert(dev);
    47   assert(dev->parent != NULL);
    48 
    49   device_t *parent = dev->parent;
    50 
    51   if (parent->ops && parent->ops->interfaces[USB_DEV_IFACE]) {
    52     usb_iface_t *usb_iface
    53         = (usb_iface_t *) parent->ops->interfaces[USB_DEV_IFACE];
    54     assert(usb_iface != NULL);
    55     if (usb_iface->get_hc_handle) {
    56       int rc = usb_iface->get_hc_handle(parent, handle);
    57       return rc;
    58     }
    59   }
    60 
    61   return ENOTSUP;
    62 }
    63 /*----------------------------------------------------------------------------*/
    64 static usb_iface_t usb_iface = {
    65   .get_hc_handle = usb_iface_get_hc_handle
    66 };
    67 
    68 static device_ops_t rh_ops = {
    69         .interfaces[USB_DEV_IFACE] = &usb_iface
    70 };
    71 
    7244int setup_root_hub(device_t **device, device_t *hc)
    7345{
     
    10880        hub->name = name;
    10981        hub->parent = hc;
    110         hub->ops = &rh_ops;
     82        hub->ops = &child_ops;
    11183
    11284        *device = hub;
  • uspace/drv/uhci-hcd/tracker.c

    r4e8e1f5 rd321cd7  
    3737
    3838#include "tracker.h"
     39#include "transfer_list.h"
    3940#include "uhci.h"
    4041#include "utils/malloc32.h"
     
    387388        assert(instance);
    388389        tracker_call_in(instance);
     390        transfer_list_remove_tracker(instance->scheduled_list, instance);
    389391        free32(instance->td);
    390392        free32(instance->packet);
     
    396398        assert(instance);
    397399        tracker_call_out(instance);
     400        assert(instance->scheduled_list);
     401        transfer_list_remove_tracker(instance->scheduled_list, instance);
    398402        free32(instance->td);
    399403        free32(instance->packet);
  • uspace/drv/uhci-hcd/tracker.h

    r4e8e1f5 rd321cd7  
    4747} dev_speed_t;
    4848
     49struct transfer_list;
     50
    4951typedef struct tracker
    5052{
     
    6870        void (*next_step)(struct tracker*);
    6971        unsigned toggle:1;
     72
     73        struct transfer_list *scheduled_list;
    7074} tracker_t;
    7175
  • uspace/drv/uhci-hcd/transfer_list.c

    r4e8e1f5 rd321cd7  
    100100        }
    101101}
     102/*----------------------------------------------------------------------------*/
     103void transfer_list_remove_tracker(transfer_list_t *instance, tracker_t *tracker)
     104{
     105        assert(instance);
     106        assert(tracker);
     107        assert(instance->queue_head);
     108        assert(tracker->td);
     109
     110        uint32_t pa = (uintptr_t)addr_to_phys(tracker->td);
     111        if ((instance->queue_head->element & LINK_POINTER_ADDRESS_MASK) == pa) {
     112                instance->queue_head->element = tracker->td->next;
     113        }
     114}
    102115/**
    103116 * @}
  • uspace/drv/uhci-hcd/transfer_list.h

    r4e8e1f5 rd321cd7  
    3636
    3737#include "uhci_struct/queue_head.h"
     38
    3839#include "tracker.h"
    3940
     
    5253void transfer_list_set_next(transfer_list_t *instance, transfer_list_t *next);
    5354
     55
    5456static inline void transfer_list_fini(transfer_list_t *instance)
    5557{
     
    5860}
    5961
     62void transfer_list_add_tracker(transfer_list_t *instance, tracker_t *tracker);
    6063
    61 void transfer_list_add_tracker(transfer_list_t *instance, tracker_t *tracker);
     64void transfer_list_remove_tracker(transfer_list_t *instance, tracker_t *track);
    6265
    6366#endif
  • uspace/drv/uhci-hcd/uhci.c

    r4e8e1f5 rd321cd7  
    178178        list_append(&tracker->link, &instance->tracker_list);
    179179
     180        tracker->scheduled_list = list;
     181
    180182        usb_log_debug2("Scheduler(%d) releasing tracker list mutex.\n",
    181183            fibril_get_id());
  • uspace/drv/uhci-hcd/uhci.h

    r4e8e1f5 rd321cd7  
    7272
    7373#define UHCI_FRAME_LIST_COUNT 1024
    74 #define UHCI_CLEANER_TIMEOUT 10000
     74#define UHCI_CLEANER_TIMEOUT 1000
    7575#define UHCI_DEBUGER_TIMEOUT 5000000
    7676
  • uspace/drv/uhci-hcd/uhci_struct/transfer_descriptor.c

    r4e8e1f5 rd321cd7  
    8080#endif
    8181}
    82 
    83 static inline usb_transaction_outcome_t convert_outcome(uint32_t status)
    84 {
    85         /*TODO: refactor into something sane */
    86         /*TODO: add additional usb_errors to usb_outcome_t */
    87 
    88         if (status & TD_STATUS_ERROR_STALLED)
    89                 return USB_OUTCOME_CRCERROR;
    90 
    91         if (status & TD_STATUS_ERROR_BUFFER)
    92                 return USB_OUTCOME_CRCERROR;
    93 
    94         if (status & TD_STATUS_ERROR_BABBLE)
    95                 return USB_OUTCOME_BABBLE;
    96 
    97         if (status & TD_STATUS_ERROR_NAK)
    98                 return USB_OUTCOME_CRCERROR;
    99 
    100   if (status & TD_STATUS_ERROR_CRC)
    101                 return USB_OUTCOME_CRCERROR;
    102 
    103         if (status & TD_STATUS_ERROR_BIT_STUFF)
    104                 return USB_OUTCOME_CRCERROR;
    105 
    106 //      assert((((status >> TD_STATUS_ERROR_POS) & TD_STATUS_ERROR_MASK)
    107 //      | TD_STATUS_ERROR_RESERVED) == TD_STATUS_ERROR_RESERVED);
    108         return USB_OUTCOME_OK;
    109 }
    11082/*----------------------------------------------------------------------------*/
    11183int transfer_descriptor_status(transfer_descriptor_t *instance)
    11284{
    11385        assert(instance);
    114         if (convert_outcome(instance->status))
    115                 return EINVAL; //TODO: use sane error value here
     86
     87        if ((instance->status & TD_STATUS_ERROR_STALLED) != 0)
     88                return EIO;
     89
     90        if ((instance->status & TD_STATUS_ERROR_CRC) != 0)
     91                return EAGAIN;
     92
     93        if ((instance->status & TD_STATUS_ERROR_BUFFER) != 0)
     94                return EAGAIN;
     95
     96        if ((instance->status & TD_STATUS_ERROR_BABBLE) != 0)
     97                return EIO;
     98
     99        if ((instance->status & TD_STATUS_ERROR_NAK) != 0)
     100                return EAGAIN;
     101
     102        if ((instance->status & TD_STATUS_ERROR_BIT_STUFF) != 0)
     103                return EAGAIN;
     104
    116105        return EOK;
    117106}
  • uspace/lib/usb/src/recognise.c

    r4e8e1f5 rd321cd7  
    7676};
    7777
    78 static device_ops_t child_ops = {
     78device_ops_t child_ops = {
    7979        .interfaces[USB_DEV_IFACE] = &usb_iface
    8080};
Note: See TracChangeset for help on using the changeset viewer.