Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usb/src/hc.c

    r77ad86c r6df2202  
    2727 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2828 */
    29 
    3029/** @addtogroup libusb
    3130 * @{
     
    3433 * General communication with host controller driver (implementation).
    3534 */
    36 
    3735#include <usb/debug.h>
    3836
     
    4644{
    4745        assert(connection);
    48        
    4946        fibril_mutex_lock(&connection->guard);
    5047        if (connection->ref_count == 0) {
     
    5855                }
    5956        }
    60        
    6157        ++connection->ref_count;
    6258        fibril_mutex_unlock(&connection->guard);
    6359        return EOK;
    6460}
    65 
     61/*----------------------------------------------------------------------------*/
    6662static int usb_hc_connection_del_ref(usb_hc_connection_t *connection)
    6763{
    6864        assert(connection);
    69        
    7065        fibril_mutex_lock(&connection->guard);
    7166        if (connection->ref_count == 0) {
     
    7570                return EOK;
    7671        }
    77        
    7872        --connection->ref_count;
    7973        int ret = EOK;
     
    131125        return rc;
    132126}
    133 
     127/*----------------------------------------------------------------------------*/
    134128void usb_hc_connection_deinitialize(usb_hc_connection_t *connection)
    135129{
     
    146140        fibril_mutex_unlock(&connection->guard);
    147141}
    148 
     142/*----------------------------------------------------------------------------*/
    149143/** Open connection to host controller.
    150144 *
     
    156150        return usb_hc_connection_add_ref(connection);
    157151}
    158 
     152/*----------------------------------------------------------------------------*/
    159153/** Close connection to the host controller.
    160154 *
     
    166160        return usb_hc_connection_del_ref(connection);
    167161}
    168 
     162/*----------------------------------------------------------------------------*/
    169163/** Ask host controller for free address assignment.
    170164 *
     
    188182        return ret == EOK ? address : ret;
    189183}
    190 
     184/*----------------------------------------------------------------------------*/
    191185int usb_hc_bind_address(usb_hc_connection_t * connection,
    192186    usb_address_t address, devman_handle_t handle)
     
    200194        return ret;
    201195}
    202 
     196/*----------------------------------------------------------------------------*/
    203197/** Get handle of USB device with given address.
    204198 *
     
    219213        return ret;
    220214}
    221 
     215/*----------------------------------------------------------------------------*/
    222216int usb_hc_release_address(usb_hc_connection_t *connection,
    223217    usb_address_t address)
     
    231225        return ret;
    232226}
    233 
     227/*----------------------------------------------------------------------------*/
    234228int usb_hc_register_endpoint(usb_hc_connection_t *connection,
    235229    usb_address_t address, usb_endpoint_t endpoint, usb_transfer_type_t type,
     
    245239        return ret;
    246240}
    247 
     241/*----------------------------------------------------------------------------*/
    248242int usb_hc_unregister_endpoint(usb_hc_connection_t *connection,
    249243    usb_address_t address, usb_endpoint_t endpoint, usb_direction_t direction)
     
    258252        return ret;
    259253}
    260 
     254/*----------------------------------------------------------------------------*/
    261255int usb_hc_read(usb_hc_connection_t *connection, usb_address_t address,
    262256    usb_endpoint_t endpoint, uint64_t setup, void *data, size_t size,
     
    272266        return ret;
    273267}
    274 
     268/*----------------------------------------------------------------------------*/
    275269int usb_hc_write(usb_hc_connection_t *connection, usb_address_t address,
    276270    usb_endpoint_t endpoint, uint64_t setup, const void *data, size_t size)
Note: See TracChangeset for help on using the changeset viewer.