Changes in / [f6309b6:608afb9] in mainline


Ignore:
Location:
uspace
Files:
1 added
10 edited

Legend:

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

    rf6309b6 r608afb9  
    166166    usbhc_iface_transfer_out_callback_t callback, void *arg)
    167167{
    168         usb_log_warning("Using deprecated API %s.\n", __FUNCTION__);
     168        usb_log_warning("Using deprecated API control write setup.\n");
    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__);
    182181        tracker_t *tracker = tracker_get(dev, target, USB_TRANSFER_CONTROL,
    183182            size, FULL_SPEED, data, size, NULL, callback, arg);
     
    191190    usbhc_iface_transfer_in_callback_t callback, void *arg)
    192191{
    193         usb_log_warning("Using deprecated API %s.\n", __FUNCTION__);
    194192        tracker_t *tracker = tracker_get(dev, target, USB_TRANSFER_CONTROL,
    195193            0, FULL_SPEED, NULL, 0, callback, NULL, arg);
     
    204202    usbhc_iface_transfer_out_callback_t callback, void *arg)
    205203{
    206         usb_log_warning("Using deprecated API %s.\n", __FUNCTION__);
     204        usb_log_warning("Using deprecated API control read setup.\n");
    207205        tracker_t *tracker = tracker_get(dev, target, USB_TRANSFER_CONTROL,
    208206            8, FULL_SPEED, data, size, NULL, callback, arg);
     
    217215    usbhc_iface_transfer_in_callback_t callback, void *arg)
    218216{
    219         usb_log_warning("Using deprecated API %s.\n", __FUNCTION__);
    220217        tracker_t *tracker = tracker_get(dev, target, USB_TRANSFER_CONTROL,
    221218            size, FULL_SPEED, data, size, callback, NULL, arg);
     
    229226    usbhc_iface_transfer_out_callback_t callback, void *arg)
    230227{
    231         usb_log_warning("Using deprecated API %s.\n", __FUNCTION__);
    232228        tracker_t *tracker = tracker_get(dev, target, USB_TRANSFER_CONTROL,
    233229            0, FULL_SPEED, NULL, 0, NULL, callback, arg);
  • uspace/drv/uhci-hcd/root_hub.c

    rf6309b6 r608afb9  
    3535#include <errno.h>
    3636#include <stdio.h>
     37
    3738#include <usb_iface.h>
     39
    3840#include <usb/debug.h>
    3941
    4042#include "root_hub.h"
     43/*----------------------------------------------------------------------------*/
     44static int usb_iface_get_hc_handle(device_t *dev, devman_handle_t *handle)
     45{
     46  assert(dev);
     47  assert(dev->parent != NULL);
    4148
    42 extern device_ops_t child_ops;
     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}
    4363/*----------------------------------------------------------------------------*/
     64static usb_iface_t usb_iface = {
     65  .get_hc_handle = usb_iface_get_hc_handle
     66};
     67
     68static device_ops_t rh_ops = {
     69        .interfaces[USB_DEV_IFACE] = &usb_iface
     70};
     71
    4472int setup_root_hub(device_t **device, device_t *hc)
    4573{
     
    80108        hub->name = name;
    81109        hub->parent = hc;
    82         hub->ops = &child_ops;
     110        hub->ops = &rh_ops;
    83111
    84112        *device = hub;
  • uspace/drv/uhci-hcd/tracker.c

    rf6309b6 r608afb9  
    3737
    3838#include "tracker.h"
    39 #include "transfer_list.h"
    4039#include "uhci.h"
    4140#include "utils/malloc32.h"
     
    388387        assert(instance);
    389388        tracker_call_in(instance);
    390         transfer_list_remove_tracker(instance->scheduled_list, instance);
    391389        free32(instance->td);
    392390        free32(instance->packet);
     
    398396        assert(instance);
    399397        tracker_call_out(instance);
    400         assert(instance->scheduled_list);
    401         transfer_list_remove_tracker(instance->scheduled_list, instance);
    402398        free32(instance->td);
    403399        free32(instance->packet);
  • uspace/drv/uhci-hcd/tracker.h

    rf6309b6 r608afb9  
    4747} dev_speed_t;
    4848
    49 struct transfer_list;
    50 
    5149typedef struct tracker
    5250{
     
    7068        void (*next_step)(struct tracker*);
    7169        unsigned toggle:1;
    72 
    73         struct transfer_list *scheduled_list;
    7470} tracker_t;
    7571
  • uspace/drv/uhci-hcd/transfer_list.c

    rf6309b6 r608afb9  
    100100        }
    101101}
    102 /*----------------------------------------------------------------------------*/
    103 void 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 }
    115102/**
    116103 * @}
  • uspace/drv/uhci-hcd/transfer_list.h

    rf6309b6 r608afb9  
    3636
    3737#include "uhci_struct/queue_head.h"
    38 
    3938#include "tracker.h"
    4039
     
    5352void transfer_list_set_next(transfer_list_t *instance, transfer_list_t *next);
    5453
    55 
    5654static inline void transfer_list_fini(transfer_list_t *instance)
    5755{
     
    6058}
    6159
     60
    6261void transfer_list_add_tracker(transfer_list_t *instance, tracker_t *tracker);
    63 
    64 void transfer_list_remove_tracker(transfer_list_t *instance, tracker_t *track);
    6562
    6663#endif
  • uspace/drv/uhci-hcd/uhci.c

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

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

    rf6309b6 r608afb9  
    8080#endif
    8181}
     82
     83static 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}
    82110/*----------------------------------------------------------------------------*/
    83111int transfer_descriptor_status(transfer_descriptor_t *instance)
    84112{
    85113        assert(instance);
    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 
     114        if (convert_outcome(instance->status))
     115                return EINVAL; //TODO: use sane error value here
    105116        return EOK;
    106117}
  • uspace/lib/usb/src/recognise.c

    rf6309b6 r608afb9  
    7070};
    7171
    72 device_ops_t child_ops = {
     72static device_ops_t child_ops = {
    7373        .interfaces[USB_DEV_IFACE] = &usb_iface
    7474};
Note: See TracChangeset for help on using the changeset viewer.