Changes in / [818dc00:aca85e4] in mainline


Ignore:
Files:
7 deleted
14 edited

Legend:

Unmodified
Added
Removed
  • .bzrignore

    r818dc00 raca85e4  
    6262./uspace/app/trace/trace
    6363./uspace/app/usb/usb
    64 ./uspace/app/usbinfo/usbinfo
    6564./uspace/app/virtusbkbd/vuk
    66 ./uspace/dist/app/*
     65./uspace/dist/app/bdsh
     66./uspace/dist/app/edit
     67./uspace/dist/app/getterm
     68./uspace/dist/app/klog
     69./uspace/dist/app/mkfat
     70./uspace/dist/app/netecho
     71./uspace/dist/app/netstart
     72./uspace/dist/app/nettest1
     73./uspace/dist/app/nettest2
     74./uspace/dist/app/ping
     75./uspace/dist/app/redir
     76./uspace/dist/app/sbi
     77./uspace/dist/app/stats
     78./uspace/dist/app/taskdump
     79./uspace/dist/app/tasks
     80./uspace/dist/app/tester
     81./uspace/dist/app/test_serial
     82./uspace/dist/app/tetris
     83./uspace/dist/app/top
     84./uspace/dist/app/trace
     85./uspace/dist/app/usb
     86./uspace/dist/app/vuk
    6787./uspace/dist/cfg/net/general
    6888./uspace/dist/cfg/net/lo
  • boot/Makefile.common

    r818dc00 raca85e4  
    142142        $(USPACE_PATH)/app/ping/ping \
    143143        $(USPACE_PATH)/app/stats/stats \
     144        $(USPACE_PATH)/app/virtusbkbd/vuk \
    144145        $(USPACE_PATH)/app/tasks/tasks \
    145         $(USPACE_PATH)/app/top/top \
    146         $(USPACE_PATH)/app/usbinfo/usbinfo \
    147         $(USPACE_PATH)/app/virtusbkbd/vuk
     146        $(USPACE_PATH)/app/top/top
    148147
    149148ifneq ($(CONFIG_BAREBONE),y)
  • uspace/Makefile

    r818dc00 raca85e4  
    4949        app/trace \
    5050        app/top \
    51         app/usbinfo \
    5251        app/virtusbkbd \
    5352        app/netecho \
  • uspace/drv/uhci/main.c

    r818dc00 raca85e4  
    2727 */
    2828#include <usb/hcdhubd.h>
    29 #include <usb/debug.h>
    3029#include <errno.h>
    3130#include "uhci.h"
     
    3736static int uhci_add_device(device_t *device)
    3837{
    39         usb_dprintf(NAME, 1, "uhci_add_device() called\n");
    4038        device->ops = &uhci_ops;
    4139
     
    4341         * We need to announce the presence of our root hub.
    4442         */
    45         usb_dprintf(NAME, 2, "adding root hub\n");
    4643        usb_hcd_add_root_hub(device);
    4744
     
    6461         */
    6562        sleep(5);
    66         usb_dprintf_enable(NAME, 5);
    6763
    6864        return driver_main(&uhci_driver);
  • uspace/drv/vhc/connhost.c

    r818dc00 raca85e4  
    5858                case USB_DIRECTION_IN:
    5959                        transfer->in_callback(transfer->dev,
    60                             outcome, size,
     60                            size, outcome,
    6161                            transfer->arg);
    6262                        break;
  • uspace/drv/vhc/debug.c

    r818dc00 raca85e4  
    3535#include <stdio.h>
    3636#include <ipc/ipc.h>
    37 #include <usb/debug.h>
    3837
    3938#include "vhcd.h"
    4039
     40/** Current debug level. */
     41int debug_level = 0;
     42
     43/** Debugging printf.
     44 * This function is intended for single-line messages as it
     45 * automatically prints debugging prefix at the beginning of the
     46 * line.
     47 *
     48 * @see printf
     49 * @param level Debugging level.
     50 */
     51void dprintf(int level, const char *format, ...)
     52{
     53        if (level > debug_level) {
     54                return;
     55        }
     56       
     57        printf("%s(%d): ", NAME, level);
     58        va_list args;
     59        va_start(args, format);
     60        vprintf(format, args);
     61        va_end(args);
     62        printf("\n");
     63}
    4164
    4265/** Debug print informing of invalid call.
  • uspace/drv/vhc/hcd.c

    r818dc00 raca85e4  
    111111        printf("%s: virtual USB host controller driver.\n", NAME);
    112112
    113         usb_dprintf_enable(NAME, 10);
     113        debug_level = 10;
    114114
    115115        fid_t fid = fibril_create(hc_manager_fibril, NULL);
  • uspace/drv/vhc/vhcd.h

    r818dc00 raca85e4  
    3636#define VHCD_VHCD_H_
    3737
    38 #include <usb/debug.h>
    39 
    4038#define NAME "vhc"
    4139#define NAME_DEV "hcd-virt-dev"
     
    4543#define DEVMAP_PATH_DEV NAMESPACE "/" NAME_DEV
    4644
    47 #define dprintf(level, format, ...) \
    48         usb_dprintf(NAME, (level), format "\n", ##__VA_ARGS__)
     45extern int debug_level;
     46void dprintf(int, const char *, ...);
    4947void dprintf_inval_call(int, ipc_call_t, ipcarg_t);
    5048
  • uspace/lib/c/include/ipc/dev_iface.h

    r818dc00 raca85e4  
    5454        DEV_IFACE_ID(DEV_FIRST_CUSTOM_METHOD_IDX)
    5555
    56 /*
    57  * The first argument is actually method (as the "real" method is used
    58  * for indexing into interfaces.
    59  */
    60 
    61 #define DEV_IPC_GET_ARG1(call) IPC_GET_ARG2((call))
    62 #define DEV_IPC_GET_ARG2(call) IPC_GET_ARG3((call))
    63 #define DEV_IPC_GET_ARG3(call) IPC_GET_ARG4((call))
    64 #define DEV_IPC_GET_ARG4(call) IPC_GET_ARG5((call))
    65 
    6656
    6757#endif
  • uspace/lib/drv/generic/remote_usbhc.c

    r818dc00 raca85e4  
    108108        }
    109109
    110         devman_handle_t handle = DEV_IPC_GET_ARG1(*call);
     110        devman_handle_t handle = IPC_GET_ARG1(*call);
    111111
    112112        usb_address_t address;
     
    122122    ipc_callid_t callid, ipc_call_t *call)
    123123{
    124         ipcarg_t buffer_hash = DEV_IPC_GET_ARG1(*call);
     124        ipcarg_t buffer_hash = IPC_GET_ARG1(*call);
    125125        async_transaction_t * trans = (async_transaction_t *)buffer_hash;
    126126        if (trans == NULL) {
     
    144144                accepted_size = trans->size;
    145145        }
    146         async_data_read_finalize(cid, trans->buffer, accepted_size);
     146        async_data_read_finalize(callid, trans->buffer, accepted_size);
    147147
    148148        ipc_answer_1(callid, EOK, accepted_size);
     
    211211        }
    212212
    213         usb_address_t address = (usb_address_t) DEV_IPC_GET_ARG1(*call);
    214         devman_handle_t handle = (devman_handle_t) DEV_IPC_GET_ARG2(*call);
     213        usb_address_t address = (usb_address_t) IPC_GET_ARG1(*call);
     214        devman_handle_t handle = (devman_handle_t) IPC_GET_ARG2(*call);
    215215
    216216        int rc = usb_iface->bind_address(device, address, handle);
     
    229229        }
    230230
    231         usb_address_t address = (usb_address_t) DEV_IPC_GET_ARG1(*call);
     231        usb_address_t address = (usb_address_t) IPC_GET_ARG1(*call);
    232232
    233233        int rc = usb_iface->release_address(device, address);
     
    275275        }
    276276
    277         size_t expected_len = DEV_IPC_GET_ARG3(*call);
     277        size_t expected_len = IPC_GET_ARG3(*call);
    278278        usb_target_t target = {
    279                 .address = DEV_IPC_GET_ARG1(*call),
    280                 .endpoint = DEV_IPC_GET_ARG2(*call)
     279                .address = IPC_GET_ARG1(*call),
     280                .endpoint = IPC_GET_ARG2(*call)
    281281        };
    282282
     
    327327        }
    328328
    329         size_t len = DEV_IPC_GET_ARG3(*call);
     329        size_t len = IPC_GET_ARG3(*call);
    330330        usb_target_t target = {
    331                 .address = DEV_IPC_GET_ARG1(*call),
    332                 .endpoint = DEV_IPC_GET_ARG2(*call)
     331                .address = IPC_GET_ARG1(*call),
     332                .endpoint = IPC_GET_ARG2(*call)
    333333        };
    334334
     
    384384
    385385        usb_target_t target = {
    386                 .address = DEV_IPC_GET_ARG1(*call),
    387                 .endpoint = DEV_IPC_GET_ARG2(*call)
     386                .address = IPC_GET_ARG1(*call),
     387                .endpoint = IPC_GET_ARG2(*call)
    388388        };
    389389
  • uspace/lib/usb/Makefile

    r818dc00 raca85e4  
    3434SOURCES = \
    3535        src/addrkeep.c \
    36         src/debug.c \
    37         src/drvpsync.c \
    3836        src/hcdhubd.c \
    3937        src/hcdrv.c \
  • uspace/lib/usb/include/usb/usb.h

    r818dc00 raca85e4  
    7171/** Default USB address. */
    7272#define USB_ADDRESS_DEFAULT 0
    73 /** Maximum address number in USB 1.1. */
    74 #define USB11_ADDRESS_MAX 128
    7573
    7674/** USB endpoint number type.
  • uspace/lib/usb/include/usb/usbdrv.h

    r818dc00 raca85e4  
    3838#include <usb/usb.h>
    3939#include <driver.h>
    40 #include <usb/devreq.h>
    41 #include <usb/descriptor.h>
    4240
    4341int usb_drv_hc_connect(device_t *, unsigned int);
     
    5654    void *, size_t, size_t *, usb_handle_t *);
    5755
    58 int usb_drv_psync_interrupt_out(int, usb_target_t, void *, size_t);
    59 int usb_drv_psync_interrupt_in(int, usb_target_t, void *, size_t, size_t *);
    60 
    61 
    62 
    6356int usb_drv_async_control_write_setup(int, usb_target_t,
    6457    void *, size_t, usb_handle_t *);
     
    6760int usb_drv_async_control_write_status(int, usb_target_t,
    6861    usb_handle_t *);
    69 
    70 int usb_drv_psync_control_write_setup(int, usb_target_t, void *, size_t);
    71 int usb_drv_psync_control_write_data(int, usb_target_t, void *, size_t);
    72 int usb_drv_psync_control_write_status(int, usb_target_t);
    73 
    7462
    7563int usb_drv_async_control_read_setup(int, usb_target_t,
     
    8068    usb_handle_t *);
    8169
    82 int usb_drv_psync_control_read_setup(int, usb_target_t, void *, size_t);
    83 int usb_drv_psync_control_read_data(int, usb_target_t, void *, size_t, size_t *);
    84 int usb_drv_psync_control_read_status(int, usb_target_t);
    85 
    86 
    8770int usb_drv_async_wait_for(usb_handle_t);
    8871
    8972
    9073int usb_drv_req_set_address(int, usb_address_t, usb_address_t);
    91 int usb_drv_req_get_device_descriptor(int, usb_address_t,
    92     usb_standard_device_descriptor_t *);
    9374
    9475#endif
  • uspace/lib/usb/src/usbdrvreq.c

    r818dc00 raca85e4  
    3434 */
    3535#include <usb/usbdrv.h>
     36#include <usb/devreq.h>
    3637#include <errno.h>
    3738
     
    9495}
    9596
    96 /** Retrieve device descriptor of connected USB device.
    97  *
    98  * @param[in] phone Open phone to HC driver.
    99  * @param[in] address Device USB address.
    100  * @param[out] descriptor Storage for the device descriptor.
    101  * @return Error code.
    102  * @retval EBADMEM @p descriptor is NULL.
    103  */
    104 int usb_drv_req_get_device_descriptor(int phone, usb_address_t address,
    105     usb_standard_device_descriptor_t *descriptor)
    106 {
    107         if (descriptor == NULL) {
    108                 return EBADMEM;
    109         }
    110 
    111         /* Prepare the target. */
    112         usb_target_t target = {
    113                 .address = address,
    114                 .endpoint = 0
    115         };
    116 
    117         /* Prepare the setup packet. */
    118         usb_device_request_setup_packet_t setup_packet = {
    119                 .request_type = 128,
    120                 .request = USB_DEVREQ_GET_DESCRIPTOR,
    121                 .index = 0,
    122                 .length = sizeof(usb_standard_device_descriptor_t)
    123         };
    124         setup_packet.value_high = USB_DESCTYPE_DEVICE;
    125         setup_packet.value_low = 0;
    126 
    127         usb_handle_t handle;
    128         int rc;
    129 
    130         /* Start the control read transfer. */
    131         rc = usb_drv_async_control_read_setup(phone, target,
    132             &setup_packet, sizeof(usb_device_request_setup_packet_t), &handle);
    133         if (rc != EOK) {
    134                 return rc;
    135         }
    136         rc = usb_drv_async_wait_for(handle);
    137         if (rc != EOK) {
    138                 return rc;
    139         }
    140 
    141         /* Retrieve the descriptor. */
    142         size_t actually_transferred = 0;
    143         usb_standard_device_descriptor_t descriptor_tmp;
    144         rc = usb_drv_async_control_read_data(phone, target,
    145             &descriptor_tmp, sizeof(usb_standard_device_descriptor_t),
    146             &actually_transferred, &handle);
    147         if (rc != EOK) {
    148                 return rc;
    149         }
    150         rc = usb_drv_async_wait_for(handle);
    151         if (rc != EOK) {
    152                 return rc;
    153         }
    154 
    155         /* Finish the control read transfer. */
    156         rc = usb_drv_async_control_read_status(phone, target, &handle);
    157         if (rc != EOK) {
    158                 return rc;
    159         }
    160         rc = usb_drv_async_wait_for(handle);
    161         if (rc != EOK) {
    162                 return rc;
    163         }
    164 
    165         if (actually_transferred < sizeof(usb_standard_device_descriptor_t)) {
    166                 return ELIMIT;
    167         }
    168 
    169         /*
    170          * Everything is okay, copy the descriptor.
    171          */
    172         memcpy(descriptor, &descriptor_tmp,
    173             sizeof(usb_standard_device_descriptor_t));
    174 
    175         return EOK;
    176 }
    177 
    178 
    179 
    18097/**
    18198 * @}
Note: See TracChangeset for help on using the changeset viewer.