Ignore:
Timestamp:
2010-10-22T14:57:03Z (14 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
7a7bfeb3
Parents:
954ea70
Message:

VHCD handles new methods

Not completely, though. Will finish later.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/hw/bus/usb/hcd/virtual/hub.c

    r954ea70 rb8a3cda  
    3737#include <usbvirt/device.h>
    3838#include <errno.h>
     39#include <stdlib.h>
    3940
    4041#include "vhcd.h"
     
    143144hub_device_t hub_dev;
    144145
     146static int send_data(struct usbvirt_device *dev,
     147            usb_endpoint_t endpoint, void *buffer, size_t size)
     148{
     149        usb_target_t target = { dev->address, endpoint };
     150        void *my_buffer = NULL;
     151        if (size > 0) {
     152                my_buffer = malloc(size);
     153                memcpy(my_buffer, buffer, size);
     154        }
     155        hc_fillin_transaction_from_device(target, my_buffer, size);
     156       
     157        return EOK;
     158}
     159
    145160void hub_init(void)
    146161{
     
    155170       
    156171        usbvirt_connect_local(&virthub_dev);
     172        virthub_dev.send_data = send_data;
    157173       
    158174        printf("%s: virtual hub (%d ports) created.\n", NAME, HUB_PORT_COUNT);
Note: See TracChangeset for help on using the changeset viewer.