Changeset aca85e4 in mainline


Ignore:
Timestamp:
2010-12-05T10:19:28Z (14 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
818dc00
Parents:
35537a7 (diff), f995350 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge with vojtechhorky/

Location:
uspace
Files:
5 added
1 deleted
9 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/tester/Makefile

    r35537a7 raca85e4  
    3131BINARY = tester
    3232
     33LIBS += $(LIBUSB_PREFIX)/libusb.a
     34EXTRA_CFLAGS += -I$(LIBUSB_PREFIX)/include
     35
    3336SOURCES = \
    3437        tester.c \
     38        adt/usbaddrkeep.c \
    3539        thread/thread1.c \
    3640        print/print1.c \
  • uspace/app/tester/tester.c

    r35537a7 raca85e4  
    6565#include "mm/malloc1.def"
    6666#include "hw/serial/serial1.def"
     67#include "adt/usbaddrkeep.def"
    6768        {NULL, NULL, NULL, false}
    6869};
  • uspace/app/tester/tester.h

    r35537a7 raca85e4  
    8282extern const char *test_malloc1(void);
    8383extern const char *test_serial1(void);
     84extern const char *test_usbaddrkeep(void);
    8485
    8586extern test_t tests[];
  • uspace/drv/vhc/Makefile

    r35537a7 raca85e4  
    3939
    4040SOURCES = \
    41         addrmgm.c \
    4241        conndev.c \
    4342        connhost.c \
  • uspace/drv/vhc/conn.h

    r35537a7 raca85e4  
    4848
    4949void address_init(void);
    50 int reserve_default_address(device_t *);
    51 int release_default_address(device_t *);
    52 int request_address(device_t *, usb_address_t *);
    53 int release_address(device_t *, usb_address_t);
    54 int bind_address(device_t *, usb_address_t, devman_handle_t);
    5550
    56 int tell_address(device_t *, devman_handle_t, usb_address_t *);
    5751
    5852void default_connection_handler(device_t *, ipc_callid_t, ipc_call_t *);
  • uspace/drv/vhc/connhost.c

    r35537a7 raca85e4  
    3636#include <errno.h>
    3737#include <usb/usb.h>
     38#include <usb/hcd.h>
    3839
    3940#include "vhcd.h"
     
    218219}
    219220
     221static usb_address_keeping_t addresses;
     222
     223
     224static int reserve_default_address(device_t *dev)
     225{
     226        usb_address_keeping_reserve_default(&addresses);
     227        return EOK;
     228}
     229
     230static int release_default_address(device_t *dev)
     231{
     232        usb_address_keeping_release_default(&addresses);
     233        return EOK;
     234}
     235
     236static int request_address(device_t *dev, usb_address_t *address)
     237{
     238        usb_address_t addr = usb_address_keeping_request(&addresses);
     239        if (addr < 0) {
     240                return (int)addr;
     241        }
     242
     243        *address = addr;
     244        return EOK;
     245}
     246
     247static int release_address(device_t *dev, usb_address_t address)
     248{
     249        return usb_address_keeping_release(&addresses, address);
     250}
     251
     252static int bind_address(device_t *dev, usb_address_t address,
     253    devman_handle_t handle)
     254{
     255        usb_address_keeping_devman_bind(&addresses, address, handle);
     256        return EOK;
     257}
     258
     259static int tell_address(device_t *dev, devman_handle_t handle,
     260    usb_address_t *address)
     261{
     262        usb_address_t addr = usb_address_keeping_find(&addresses, handle);
     263        if (addr < 0) {
     264                return addr;
     265        }
     266
     267        *address = addr;
     268        return EOK;
     269}
     270
     271void address_init(void)
     272{
     273        usb_address_keeping_init(&addresses, 50);
     274}
    220275
    221276usbhc_iface_t vhc_iface = {
  • uspace/lib/usb/Makefile

    r35537a7 raca85e4  
    3333
    3434SOURCES = \
     35        src/addrkeep.c \
    3536        src/hcdhubd.c \
    3637        src/hcdrv.c \
     
    3839        src/remotedrv.c \
    3940        src/usb.c \
     41        src/usbdrvreq.c \
    4042        src/usbdrv.c
    4143
  • uspace/lib/usb/include/usb/usb.h

    r35537a7 raca85e4  
    6969typedef int usb_address_t;
    7070
     71/** Default USB address. */
     72#define USB_ADDRESS_DEFAULT 0
     73
    7174/** USB endpoint number type.
    7275 * Negative values could be used to indicate error.
  • uspace/lib/usb/include/usb/usbdrv.h

    r35537a7 raca85e4  
    3636#define LIBUSB_USBDRV_H_
    3737
    38 #include "usb.h"
     38#include <usb/usb.h>
    3939#include <driver.h>
    4040
     
    7070int usb_drv_async_wait_for(usb_handle_t);
    7171
     72
     73int usb_drv_req_set_address(int, usb_address_t, usb_address_t);
     74
    7275#endif
    7376/**
Note: See TracChangeset for help on using the changeset viewer.