Changeset 92f924c8 in mainline


Ignore:
Timestamp:
2011-01-07T13:27:58Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
7bd34e5
Parents:
28f660d
Message:

block fibril until address is assigned

Location:
uspace
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/uhci/Makefile

    r28f660d r92f924c8  
    3838        root_hub/port_status.c \
    3939        root_hub/root_hub.c \
    40         uhci.c
     40        uhci.c \
     41        utils/hc_synchronizer.c
    4142
    4243include $(USPACE_PREFIX)/Makefile.common
  • uspace/drv/uhci/root_hub/port.c

    r28f660d r92f924c8  
    11
     2#include <atomic.h>
     3#include <errno.h>
    24#include <usb/devreq.h>
    35#include <usb/usb.h>
    4 #include <errno.h>
    56
    67#include "debug.h"
     
    89#include "port.h"
    910#include "port_status.h"
     11#include "utils/hc_synchronizer.h"
    1012
    1113struct usb_match {
     
    104106        pio_write_16( port->address, port_status.raw_value );
    105107
    106         uhci_print_info( "Enabled port %d.\n", port );
     108        uhci_print_info( "Enabled port %d.\n", port->number );
    107109        return EOK;
    108110}
     
    191193        /* get new address */
    192194        const usb_address_t usb_address =
    193           usb_address_keeping_request( &uhci_instance->address_manager );
     195          usb_address_keeping_request(&uhci_instance->address_manager);
     196
     197        if (usb_address <= 0) {
     198                return usb_address;
     199        }
    194200
    195201        /* assign new address */
    196202        usb_target_t new_device = { USB_ADDRESS_DEFAULT, 0 };
    197         usb_device_request_setup_packet_t data;
     203        usb_device_request_setup_packet_t data =
     204        {
     205                .request_type = 0,
     206                .request = USB_DEVREQ_SET_ADDRESS,
     207                { .value = usb_address },
     208                .index = 0,
     209                .length = 0
     210        };
     211
     212        sync_value_t value;
    198213
    199214        uhci_setup(
    200           hc, new_device, USB_TRANSFER_CONTROL, &data, sizeof(data), NULL, NULL );
    201         uhci_print_verbose( "address assignment sent, waiting to complete.\n" );
    202 
     215          hc, new_device, USB_TRANSFER_CONTROL, &data, sizeof(data),
     216                sync_out_callback, (void*)&value );
     217        uhci_print_verbose("address assignment sent, waiting to complete.\n");
     218
     219//      sync_wait_for(&value);
    203220
    204221        uhci_print_info( "Assigned address %#x.\n", usb_address );
  • uspace/drv/uhci/root_hub/root_hub.c

    r28f660d r92f924c8  
    2626        /* add fibrils for periodic port checks */
    2727        unsigned i = 0;
    28         for (; i< UHCI_ROOT_HUB_PORT_COUNT; ++i) {
     28        for (; i < UHCI_ROOT_HUB_PORT_COUNT; ++i) {
    2929                /* mind pointer arithmetics */
    3030                uhci_port_init(
     
    3737                }
    3838                fibril_add_ready(hub->checker[i]);
     39                uhci_print_verbose(" added fibril for port %d: %p.\n", i, hub->checker[i]);
    3940        }
    4041
  • uspace/drv/uhci/uhci.c

    r28f660d r92f924c8  
    8989            usb_str_transfer_type(transfer_type),
    9090            size);
     91//      callback( dev, USB_OUTCOME_OK, arg );
    9192
    9293        return ENOTSUP;
  • uspace/lib/usb/include/usb/devreq.h

    r28f660d r92f924c8  
    7070        /** Main parameter to the request. */
    7171        union {
     72                uint16_t value;
    7273                /* FIXME: add #ifdefs according to host endianess */
    7374                struct {
     
    7576                        uint8_t value_high;
    7677                };
    77                 uint16_t value;
    7878        };
    7979        /** Auxiliary parameter to the request.
Note: See TracChangeset for help on using the changeset viewer.