Changeset 49f2f29 in mainline


Ignore:
Timestamp:
2013-02-08T20:47:19Z (11 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
86a01cc
Parents:
c5f4e6a
Message:

libusbvirt: Drop port_count param.

Use library provided macro to compute additional space.

Location:
uspace
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/uhci/uhci_rh.c

    rc5f4e6a r49f2f29  
    3030#include <macros.h>
    3131#include <usb/debug.h>
     32#include <usb/classes/hub.h>
    3233#include <ddi.h>
    3334
     
    3637enum {
    3738        UHCI_RH_PORT_COUNT = 2,
    38         /* 1 byte for hub status bit and 2 port status bits */
    39         UHCI_PORT_BYTES = (1 + UHCI_RH_PORT_COUNT + 7) / 8,
     39        UHCI_PORT_BYTES = STATUS_BYTES(UHCI_RH_PORT_COUNT),
    4040};
    4141
     
    7878        instance->reset_changed[1] = false;
    7979        return virthub_base_init(&instance->base, name, &ops, instance,
    80             NULL, &hub_descriptor.header, HUB_STATUS_CHANGE_PIPE, 2);
     80            NULL, &hub_descriptor.header, HUB_STATUS_CHANGE_PIPE);
    8181}
    8282
  • uspace/lib/usbvirt/include/usbvirt/virthub_base.h

    rc5f4e6a r49f2f29  
    5959    const char *name, usbvirt_device_ops_t *ops, void *data,
    6060    const usb_standard_device_descriptor_t *device_desc,
    61     const usb_hub_descriptor_header_t *hub_desc,
    62     usb_endpoint_t ep, unsigned port_count);
     61    const usb_hub_descriptor_header_t *hub_desc, usb_endpoint_t ep);
    6362
    6463usb_address_t virthub_base_get_address(virthub_base_t *instance);
  • uspace/lib/usbvirt/src/virthub_base.c

    rc5f4e6a r49f2f29  
    3737#include <macros.h>
    3838#include <str.h>
     39#include <usb/classes/hub.h>
    3940
    4041#include "virthub_base.h"
     
    5657    usbvirt_device_ops_t *ops, void *data,
    5758    const usb_standard_device_descriptor_t *device_desc,
    58     const usb_hub_descriptor_header_t *hub_desc,
    59     usb_endpoint_t ep, unsigned port_count)
     59    const usb_hub_descriptor_header_t *hub_desc, usb_endpoint_t ep)
    6060{
    6161        assert(instance);
    6262        assert(hub_desc);
    6363        assert(name);
    64        
     64
    6565        if (!usb_endpoint_is_valid(ep) || (ep == USB_ENDPOINT_DEFAULT_CONTROL))
    6666                return EINVAL;
     
    7373        instance->endpoint_descriptor.endpoint_address = 128 | ep;
    7474        instance->endpoint_descriptor.max_packet_size =
    75             (1 + port_count + 7) / 8;
     75            STATUS_BYTES(hub_desc->port_count);
    7676
    7777        instance->descriptors.device =
Note: See TracChangeset for help on using the changeset viewer.