Changeset 30ec5ea in mainline


Ignore:
Timestamp:
2011-12-12T15:30:03Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c59dbdd5
Parents:
3538b0e
Message:

libusb: Rename read/write functions. Make del_ref function more robust.

Add doxygen.

Location:
uspace/lib/usb
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usb/include/usb/hc.h

    r3538b0e r30ec5ea  
    3131 */
    3232/** @file
    33  * General communication with host controller driver.
     33 * General communication with host controller.
    3434 */
    3535#ifndef LIBUSB_HC_H_
     
    4242#include <usb/usb.h>
    4343
    44 /** Connection to the host controller driver. */
     44/** Connection to the host controller driver.
     45 *
     46 * This is a high level IPC communication wrapper. After the structure has been
     47 * initialized using devman handle of an USB host controller, it
     48 * will manage all communication to that host controller, including session
     49 * creation/destruction and proper IPC protocol.
     50 */
    4551typedef struct {
    4652        /** Devman handle of the host controller. */
     
    8894    usb_endpoint_t, usb_direction_t);
    8995
    90 int usb_hc_control_read(usb_hc_connection_t *, usb_address_t, usb_endpoint_t,
     96int usb_hc_read(usb_hc_connection_t *, usb_address_t, usb_endpoint_t,
    9197    uint64_t, void *, size_t, size_t *);
    92 int usb_hc_control_write(usb_hc_connection_t *, usb_address_t, usb_endpoint_t,
     98int usb_hc_write(usb_hc_connection_t *, usb_address_t, usb_endpoint_t,
    9399    uint64_t, const void *, size_t);
    94100
  • uspace/lib/usb/src/hc.c

    r3538b0e r30ec5ea  
    6464        assert(connection);
    6565        fibril_mutex_lock(&connection->guard);
     66        if (connection->ref_count == 0) {
     67                /* Closing already closed connection... */
     68                assert(connection->hc_sess = NULL);
     69                fibril_mutex_unlock(&connection->guard);
     70                return EOK;
     71        }
    6672        --connection->ref_count;
    6773        int ret = EOK;
     
    232238}
    233239/*----------------------------------------------------------------------------*/
    234 int usb_hc_control_read(usb_hc_connection_t *connection, usb_address_t address,
     240int usb_hc_read(usb_hc_connection_t *connection, usb_address_t address,
    235241    usb_endpoint_t endpoint, uint64_t setup, void *data, size_t size,
    236242    size_t *real_size)
     
    246252}
    247253/*----------------------------------------------------------------------------*/
    248 int usb_hc_control_write(usb_hc_connection_t *connection, usb_address_t address,
     254int usb_hc_write(usb_hc_connection_t *connection, usb_address_t address,
    249255    usb_endpoint_t endpoint, uint64_t setup, const void *data, size_t size)
    250256{
Note: See TracChangeset for help on using the changeset viewer.