Changes in / [41b70d30:d37b235] in mainline


Ignore:
Location:
uspace
Files:
5 added
22 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/usbinfo/info.c

    r41b70d30 rd37b235  
    3737#include <str_error.h>
    3838#include <errno.h>
     39#include <usb/usbdrv.h>
    3940#include <usb/pipes.h>
    4041#include <usb/recognise.h>
  • uspace/app/usbinfo/main.c

    r41b70d30 rd37b235  
    4343#include <devman.h>
    4444#include <devmap.h>
     45#include <usb/usbdrv.h>
    4546#include "usbinfo.h"
    4647
  • uspace/drv/uhci-rhd/root_hub.c

    r41b70d30 rd37b235  
    3535#include <stdint.h>
    3636
     37#include <usb/usbdrv.h>
    3738#include <usb/debug.h>
    3839
  • uspace/drv/usbhid/main.c

    r41b70d30 rd37b235  
    3636 */
    3737
     38#include <usb/usbdrv.h>
    3839#include <driver.h>
    3940#include <ipc/driver.h>
  • uspace/drv/usbhub/main.c

    r41b70d30 rd37b235  
    3434#include <errno.h>
    3535#include <async.h>
     36
     37#include <usb/usbdrv.h>
     38
    3639
    3740#include "usbhub.h"
  • uspace/drv/usbhub/port_status.h

    r41b70d30 rd37b235  
    3535#include <bool.h>
    3636#include <sys/types.h>
    37 #include <usb/request.h>
     37#include <usb/devreq.h>
    3838#include "usbhub_private.h"
    3939
  • uspace/drv/usbhub/usbhub.c

    r41b70d30 rd37b235  
    4040#include <usb_iface.h>
    4141#include <usb/ddfiface.h>
     42#include <usb/usbdrv.h>
    4243#include <usb/descriptor.h>
    4344#include <usb/recognise.h>
     45#include <usb/devreq.h>
    4446#include <usb/request.h>
    4547#include <usb/classes/hub.h>
     
    228230//
    229231//*********************************************
     232
     233/**
     234 * Convenience function for releasing default address and writing debug info
     235 * (these few lines are used too often to be written again and again).
     236 * @param hc
     237 * @return
     238 */
     239inline static int usb_hub_release_default_address(int hc){
     240        int opResult;
     241        dprintf(USB_LOG_LEVEL_INFO, "releasing default address");
     242        opResult = usb_drv_release_default_address(hc);
     243        if (opResult != EOK) {
     244                dprintf(USB_LOG_LEVEL_WARNING, "failed to release default address");
     245        }
     246        return opResult;
     247}
    230248
    231249/**
  • uspace/drv/usbhub/usbhub.h

    r41b70d30 rd37b235  
    4242#define NAME "usbhub"
    4343
     44//#include "usb/hcdhubd.h"
     45#include <usb/usbdrv.h>
    4446#include <usb/hub.h>
    4547
  • uspace/drv/usbhub/usbhub_private.h

    r41b70d30 rd37b235  
    4747#include <usb/classes/hub.h>
    4848#include <usb/usb.h>
     49#include <usb/usbdrv.h>
     50
     51//#include <usb/devreq.h>
    4952#include <usb/debug.h>
    50 #include <usb/request.h>
    5153
    5254//************
  • uspace/drv/usbhub/utils.c

    r41b70d30 rd37b235  
    3838
    3939#include <usbhc_iface.h>
     40#include <usb/usbdrv.h>
    4041#include <usb/descriptor.h>
     42#include <usb/devreq.h>
    4143#include <usb/classes/hub.h>
    4244
  • uspace/drv/vhc/hub.c

    r41b70d30 rd37b235  
    4040#include <stdlib.h>
    4141#include <driver.h>
    42 #include <usb/hub.h>
     42#include <usb/usbdrv.h>
    4343#include <usb/recognise.h>
    4444
     
    7171}
    7272
    73 static int pretend_port_rest(int unused, void *unused2)
    74 {
    75         return EOK;
    76 }
    77 
    7873/** Register root hub in devman.
    7974 *
     
    8580        device_t *hc_dev = (device_t *) arg;
    8681
    87         /*
    88          * Wait until parent device is properly initialized.
    89          */
    90         int phone;
     82        int hc;
    9183        do {
    92                 phone = devman_device_connect(hc_dev->handle, 0);
    93         } while (phone < 0);
    94         async_hangup(phone);
     84                hc = usb_drv_hc_connect(hc_dev, hc_dev->handle,
     85                    IPC_FLAG_BLOCKING);
     86        } while (hc < 0);
    9587
    96         usb_hc_connection_t hc_conn;
    97         usb_hc_connection_initialize(&hc_conn, hc_dev->handle);
     88        usb_drv_reserve_default_address(hc);
    9889
    99         usb_hc_connection_open(&hc_conn);
     90        usb_address_t hub_address = usb_drv_request_address(hc);
     91        usb_drv_req_set_address(hc, USB_ADDRESS_DEFAULT, hub_address);
    10092
    101         int rc = usb_hc_new_device_wrapper(hc_dev, &hc_conn, USB_SPEED_FULL,
    102             pretend_port_rest, 0, NULL,
    103             NULL, NULL);
    104         if (rc != EOK) {
    105                 usb_log_fatal("Failed to create root hub: %s.\n",
    106                     str_error(rc));
    107         }
     93        usb_drv_release_default_address(hc);
    10894
    109         usb_hc_connection_close(&hc_conn);
     95        devman_handle_t hub_handle;
     96        usb_device_register_child_in_devman(hub_address, hc_dev->handle,
     97            hc_dev, &hub_handle);
     98        //usb_drv_register_child_in_devman(hc, hc_dev, hub_address, &hub_handle);
     99        usb_drv_bind_address(hc, hub_address, hub_handle);
    110100
    111         return 0;
     101        return EOK;
    112102}
    113103       
  • uspace/drv/vhc/hub/hub.c

    r41b70d30 rd37b235  
    4040#include <stdlib.h>
    4141#include <driver.h>
     42#include <usb/usbdrv.h>
    4243
    4344#include "hub.h"
  • uspace/drv/vhc/hub/virthub.c

    r41b70d30 rd37b235  
    4141#include <stdlib.h>
    4242#include <driver.h>
     43#include <usb/usbdrv.h>
    4344
    4445#include "virthub.h"
  • uspace/lib/usb/Makefile

    r41b70d30 rd37b235  
    3838        src/debug.c \
    3939        src/dp.c \
     40        src/drvpsync.c \
    4041        src/dump.c \
    4142        src/hidparser.c \
     
    4849        src/usb.c \
    4950        src/usbdevice.c \
     51        src/usbdrvreq.c \
     52        src/usbdrv.c \
    5053        src/usbmem.c
    5154
  • uspace/lib/usb/include/usb/recognise.h

    r41b70d30 rd37b235  
    4141#include <ipc/devman.h>
    4242
    43 int usb_device_create_match_ids_from_device_descriptor(
    44     const usb_standard_device_descriptor_t *, match_id_list_t *);
    45 
    4643int usb_device_create_match_ids_from_interface(
    4744    const usb_standard_device_descriptor_t *,
  • uspace/lib/usb/include/usb/request.h

    r41b70d30 rd37b235  
    4141#include <usb/descriptor.h>
    4242
    43 /** Standard device request. */
    44 typedef enum {
    45         USB_DEVREQ_GET_STATUS = 0,
    46         USB_DEVREQ_CLEAR_FEATURE = 1,
    47         USB_DEVREQ_SET_FEATURE = 3,
    48         USB_DEVREQ_SET_ADDRESS = 5,
    49         USB_DEVREQ_GET_DESCRIPTOR = 6,
    50         USB_DEVREQ_SET_DESCRIPTOR = 7,
    51         USB_DEVREQ_GET_CONFIGURATION = 8,
    52         USB_DEVREQ_SET_CONFIGURATION = 9,
    53         USB_DEVREQ_GET_INTERFACE = 10,
    54         USB_DEVREQ_SET_INTERFACE = 11,
    55         USB_DEVREQ_SYNCH_FRAME = 12,
    56         USB_DEVREQ_LAST_STD
    57 } usb_stddevreq_t;
    58 
    59 /** Device request setup packet.
    60  * The setup packet describes the request.
    61  */
    62 typedef struct {
    63         /** Request type.
    64          * The type combines transfer direction, request type and
    65          * intended recipient.
    66          */
    67         uint8_t request_type;
    68         /** Request identification. */
    69         uint8_t request;
    70         /** Main parameter to the request. */
    71         union {
    72                 uint16_t value;
    73                 /* FIXME: add #ifdefs according to host endianess */
    74                 struct {
    75                         uint8_t value_low;
    76                         uint8_t value_high;
    77                 };
    78         };
    79         /** Auxiliary parameter to the request.
    80          * Typically, it is offset to something.
    81          */
    82         uint16_t index;
    83         /** Length of extra data. */
    84         uint16_t length;
    85 } __attribute__ ((packed)) usb_device_request_setup_packet_t;
    86 
    8743int usb_control_request_set(usb_endpoint_pipe_t *,
    8844    usb_request_type_t, usb_request_recipient_t, uint8_t,
  • uspace/lib/usb/src/dp.c

    r41b70d30 rd37b235  
    3737#include <str_error.h>
    3838#include <errno.h>
    39 #include <assert.h>
     39#include <usb/usbdrv.h>
    4040#include <bool.h>
    4141#include <usb/dp.h>
  • uspace/lib/usb/src/recognise.c

    r41b70d30 rd37b235  
    3434 */
    3535#include <sys/types.h>
     36#include <usb/usbdrv.h>
    3637#include <usb/pipes.h>
    3738#include <usb/recognise.h>
     
    240241 * @return Error code.
    241242 */
    242 int usb_device_create_match_ids_from_device_descriptor(
    243     const usb_standard_device_descriptor_t *device_descriptor,
    244     match_id_list_t *matches)
     243int usb_drv_create_match_ids_from_device_descriptor(
     244    match_id_list_t *matches,
     245    const usb_standard_device_descriptor_t *device_descriptor)
    245246{
    246247        /*
     
    302303        }
    303304
    304         rc = usb_device_create_match_ids_from_device_descriptor(
    305             &device_descriptor, matches);
     305        rc = usb_drv_create_match_ids_from_device_descriptor(matches,
     306            &device_descriptor);
    306307        if (rc != EOK) {
    307308                return rc;
  • uspace/lib/usb/src/request.c

    r41b70d30 rd37b235  
    3434 */
    3535#include <usb/request.h>
     36#include <usb/devreq.h>
    3637#include <errno.h>
    3738
  • uspace/lib/usbvirt/Makefile

    r41b70d30 rd37b235  
    3030LIBRARY = libusbvirt
    3131
    32 EXTRA_CFLAGS = -I$(LIBUSB_PREFIX)/include -I$(LIBDRV_PREFIX)/include -Iinclude
     32EXTRA_CFLAGS = -I$(LIBUSB_PREFIX)/include -Iinclude
    3333
    3434SOURCES = \
  • uspace/lib/usbvirt/include/usbvirt/device.h

    r41b70d30 rd37b235  
    3737
    3838#include <usb/usb.h>
    39 #include <usb/request.h>
    4039#include <usb/descriptor.h>
     40#include <usb/devreq.h>
    4141
    4242/** Request type of a control transfer. */
  • uspace/lib/usbvirt/src/stdreq.c

    r41b70d30 rd37b235  
    3636#include <stdlib.h>
    3737#include <mem.h>
    38 #include <usb/request.h>
     38#include <usb/devreq.h>
    3939
    4040#include "private.h"
Note: See TracChangeset for help on using the changeset viewer.