Changes in / [6610565b:977fcea] in mainline


Ignore:
Location:
uspace
Files:
22 added
1 deleted
9 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/bdsh/cmds/modules/cat/cat.c

    r6610565b r977fcea  
    144144                        return CMD_SUCCESS;
    145145                case 'H':
    146                         printf(cat_oops);
     146                        printf("%s", cat_oops);
    147147                        return CMD_FAILURE;
    148148                case 't':
    149                         printf(cat_oops);
     149                        printf("%s", cat_oops);
    150150                        return CMD_FAILURE;
    151151                case 'b':
    152                         printf(cat_oops);
     152                        printf("%s", cat_oops);
    153153                        break;
    154154                case 'm':
    155                         printf(cat_oops);
     155                        printf("%s", cat_oops);
    156156                        return CMD_FAILURE;
    157157                }
  • uspace/app/bdsh/cmds/modules/rm/rm.c

    r6610565b r977fcea  
    227227                }
    228228                memset(buff, 0, sizeof(buff));
    229                 snprintf(buff, len, argv[i]);
     229                snprintf(buff, len, "%s", argv[i]);
    230230
    231231                scope = rm_scope(buff);
  • uspace/drv/rootvirt/devices.def

    r6610565b r977fcea  
    2323#endif
    2424/* Virtual USB host controller. */
     25/*
    2526{
    2627        .name = "usbhc",
    2728        .match_id = "usb&hc=vhc"
    2829},
     30*/
  • uspace/drv/uhci/Makefile

    r6610565b r977fcea  
    2929USPACE_PREFIX = ../..
    3030LIBS = $(LIBDRV_PREFIX)/libdrv.a $(LIBUSB_PREFIX)/libusb.a
    31 EXTRA_CFLAGS += -I$(LIBDRV_PREFIX)/include -I$(LIBUSB_PREFIX)/include
     31EXTRA_CFLAGS += -I$(LIBDRV_PREFIX)/include -I$(LIBUSB_PREFIX)/include -I.
    3232BINARY = uhci
    3333
    3434SOURCES = \
     35        iface.c \
    3536        main.c \
    36         transfers.c
     37        root_hub/port.c \
     38        root_hub/port_status.c \
     39        root_hub/root_hub.c \
     40        uhci.c \
     41        utils/fibril_semaphore.c \
     42        utils/hc_synchronizer.c \
     43        utils/usb_device.c
    3744
    3845include $(USPACE_PREFIX)/Makefile.common
  • uspace/drv/uhci/main.c

    r6610565b r977fcea  
    11/*
    2  * Copyright (c) 2010 Vojtech Horky
     2 * Copyright (c) 2010 Vojtech Horky, Jan Vesely
    33 * All rights reserved.
    44 *
     
    2828#include <usb/hcdhubd.h>
    2929#include <usb_iface.h>
    30 #include <usb/debug.h>
    3130#include <errno.h>
    32 #include <driver.h>
     31
     32#include "debug.h"
     33#include "iface.h"
     34#include "name.h"
    3335#include "uhci.h"
    3436
     
    5355static int uhci_add_device(device_t *device)
    5456{
    55         usb_dprintf(NAME, 1, "uhci_add_device() called\n");
     57//      usb_dprintf(NAME, DEBUG, "uhci_add_device() called\n");
     58        uhci_print_info( "uhci_add_device() called\n" );
    5659        device->ops = &uhci_ops;
    5760
    58         /*
    59          * We need to announce the presence of our root hub.
    60          */
    61         usb_dprintf(NAME, 2, "adding root hub\n");
    62         usb_hcd_add_root_hub(device);
     61        uhci_init( device, (void*)0xc020 );
    6362
    6463        return EOK;
     
    7978         * Do some global initializations.
    8079         */
    81         sleep(5);
    82         usb_dprintf_enable(NAME, 5);
     80        sleep( 5 );
     81        usb_dprintf_enable(NAME, DEBUG_LEVEL_MAX);
    8382
    8483        return driver_main(&uhci_driver);
  • uspace/drv/uhci/uhci.h

    r6610565b r977fcea  
    11/*
    2  * Copyright (c) 2010 Vojtech Horky
     2 * Copyright (c) 2010 Jan Vesely
    33 * All rights reserved.
    44 *
     
    2626 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2727 */
    28 
    2928/** @addtogroup usb
    3029 * @{
     
    3635#define DRV_UHCI_UHCI_H
    3736
     37#include <fibril.h>
     38
     39#include <usb/addrkeep.h>
     40#include <usb/hcdhubd.h>
    3841#include <usbhc_iface.h>
    3942
    40 #define NAME "uhci"
     43#include "root_hub/root_hub.h"
    4144
    42 usbhc_iface_t uhci_iface;
     45typedef struct uhci_regs {
     46        uint16_t usbcmd;
     47        uint16_t usbsts;
     48        uint16_t usbintr;
     49        uint16_t frnum;
     50        uint32_t flbaseadd;
     51        uint8_t sofmod;
     52} regs_t;
     53
     54typedef struct uhci {
     55        usb_address_keeping_t address_manager;
     56        uhci_root_hub_t root_hub;
     57        volatile regs_t* registers;
     58} uhci_t ;
     59
     60/* init uhci specifics in device.driver_data */
     61int uhci_init( device_t *device, void *regs );
     62
     63int uhci_destroy( device_t *device );
     64
     65int uhci_in(
     66  device_t *dev,
     67        usb_target_t target,
     68        usb_transfer_type_t transfer_type,
     69        void *buffer, size_t size,
     70        usbhc_iface_transfer_in_callback_t callback, void *arg
     71        );
     72
     73int uhci_out(
     74  device_t *dev,
     75        usb_target_t target,
     76  usb_transfer_type_t transfer_type,
     77  void *buffer, size_t size,
     78        usbhc_iface_transfer_out_callback_t callback, void *arg
     79  );
     80
     81int uhci_setup(
     82  device_t *dev,
     83  usb_target_t target,
     84  usb_transfer_type_t transfer_type,
     85  void *buffer, size_t size,
     86  usbhc_iface_transfer_out_callback_t callback, void *arg
     87  );
    4388
    4489#endif
  • uspace/lib/usb/include/usb/devreq.h

    r6610565b r977fcea  
    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.
  • uspace/lib/usb/include/usb/hcd.h

    • Property mode changed from 100644 to 120000
    r6610565b r977fcea  
    1 /*
    2  * Copyright (c) 2010 Vojtech Horky
    3  * All rights reserved.
    4  *
    5  * Redistribution and use in source and binary forms, with or without
    6  * modification, are permitted provided that the following conditions
    7  * are met:
    8  *
    9  * - Redistributions of source code must retain the above copyright
    10  *   notice, this list of conditions and the following disclaimer.
    11  * - Redistributions in binary form must reproduce the above copyright
    12  *   notice, this list of conditions and the following disclaimer in the
    13  *   documentation and/or other materials provided with the distribution.
    14  * - The name of the author may not be used to endorse or promote products
    15  *   derived from this software without specific prior written permission.
    16  *
    17  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
    18  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    19  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
    20  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
    21  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
    22  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    23  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
    24  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    25  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
    26  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    27  */
    28 
    29 /** @addtogroup libusb usb
    30  * @{
    31  */
    32 /** @file
    33  * @brief HC driver.
    34  */
    35 #ifndef LIBUSB_HCD_H_
    36 #define LIBUSB_HCD_H_
    37 
    38 #include <usb/usb.h>
    39 #include <fibril_synch.h>
    40 #include <devman.h>
    41 
    42 /** Info about used address. */
    43 typedef struct {
    44         /** Linked list member. */
    45         link_t link;
    46         /** Address. */
    47         usb_address_t address;
    48         /** Corresponding devman handle. */
    49         devman_handle_t devman_handle;
    50 } usb_address_keeping_used_t;
    51 
    52 /** Structure for keeping track of free and used USB addresses. */
    53 typedef struct {
    54         /** Head of list of used addresses. */
    55         link_t used_addresses;
    56         /** Upper bound for USB addresses. */
    57         usb_address_t max_address;
    58         /** Mutex protecting used address. */
    59         fibril_mutex_t used_addresses_guard;
    60         /** Condition variable for used addresses. */
    61         fibril_condvar_t used_addresses_condvar;
    62 
    63         /** Condition variable mutex for default address. */
    64         fibril_mutex_t default_condvar_guard;
    65         /** Condition variable for default address. */
    66         fibril_condvar_t default_condvar;
    67         /** Whether is default address available. */
    68         bool default_available;
    69 } usb_address_keeping_t;
    70 
    71 void usb_address_keeping_init(usb_address_keeping_t *, usb_address_t);
    72 
    73 void usb_address_keeping_reserve_default(usb_address_keeping_t *);
    74 void usb_address_keeping_release_default(usb_address_keeping_t *);
    75 
    76 usb_address_t usb_address_keeping_request(usb_address_keeping_t *);
    77 int usb_address_keeping_release(usb_address_keeping_t *, usb_address_t);
    78 void usb_address_keeping_devman_bind(usb_address_keeping_t *, usb_address_t,
    79     devman_handle_t);
    80 usb_address_t usb_address_keeping_find(usb_address_keeping_t *,
    81     devman_handle_t);
    82 
    83 
    84 #endif
     1addrkeep.h
  • uspace/lib/usb/src/addrkeep.c

    r6610565b r977fcea  
    3333 * @brief Address keeping.
    3434 */
    35 #include <usb/hcd.h>
     35#include <usb/addrkeep.h>
    3636#include <errno.h>
    3737#include <assert.h>
Note: See TracChangeset for help on using the changeset viewer.