Changeset e34e77a in mainline for uspace/lib/usb/include


Ignore:
Timestamp:
2011-03-21T14:33:50Z (15 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1387692
Parents:
68b5ed6e
Message:

Formatting and comments

No change in functionality

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usb/include/usb/host/device_keeper.h

    r68b5ed6e re34e77a  
    3131 */
    3232/** @file
    33  * @brief UHCI driver
     33 * Device keeper structure and functions.
     34 *
     35 * Typical USB host controller needs to keep track of various settings for
     36 * each device that is connected to it.
     37 * State of toggle bit, device speed etc. etc.
     38 * This structure shall simplify the management.
    3439 */
    3540#ifndef LIBUSB_HOST_DEVICE_KEEPER_H
     
    3944#include <usb/usb.h>
    4045
     46/** Number of USB address for array dimensions. */
    4147#define USB_ADDRESS_COUNT (USB11_ADDRESS_MAX + 1)
    4248
     49/** Information about attached USB device. */
    4350struct usb_device_info {
    4451        usb_speed_t speed;
     
    4855};
    4956
     57/** Host controller device keeper.
     58 * You shall not access members directly but only using functions below.
     59 */
    5060typedef struct {
    5161        struct usb_device_info devices[USB_ADDRESS_COUNT];
     
    5767void usb_device_keeper_init(usb_device_keeper_t *instance);
    5868
    59 void usb_device_keeper_reserve_default_address(
    60     usb_device_keeper_t *instance, usb_speed_t speed);
     69void usb_device_keeper_reserve_default_address(usb_device_keeper_t *instance,
     70    usb_speed_t speed);
    6171
    6272void usb_device_keeper_release_default_address(usb_device_keeper_t *instance);
    6373
    64 void usb_device_keeper_reset_if_need(
    65     usb_device_keeper_t *instance, usb_target_t target,
    66     const unsigned char *setup_data);
     74void usb_device_keeper_reset_if_need(usb_device_keeper_t *instance,
     75    usb_target_t target,
     76    const uint8_t *setup_data);
    6777
    68 int usb_device_keeper_get_toggle(
    69     usb_device_keeper_t *instance, usb_target_t target, usb_direction_t direction);
     78int usb_device_keeper_get_toggle(usb_device_keeper_t *instance,
     79    usb_target_t target, usb_direction_t direction);
    7080
    7181int usb_device_keeper_set_toggle(usb_device_keeper_t *instance,
    7282    usb_target_t target, usb_direction_t direction, bool toggle);
    7383
    74 usb_address_t device_keeper_get_free_address(
    75     usb_device_keeper_t *instance, usb_speed_t speed);
     84usb_address_t device_keeper_get_free_address(usb_device_keeper_t *instance,
     85    usb_speed_t speed);
    7686
    77 void usb_device_keeper_bind(
    78     usb_device_keeper_t *instance, usb_address_t address, devman_handle_t handle);
     87void usb_device_keeper_bind(usb_device_keeper_t *instance,
     88    usb_address_t address, devman_handle_t handle);
    7989
    80 void usb_device_keeper_release(usb_device_keeper_t *instance, usb_address_t address);
     90void usb_device_keeper_release(usb_device_keeper_t *instance,
     91    usb_address_t address);
    8192
    82 usb_address_t usb_device_keeper_find(
    83     usb_device_keeper_t *instance, devman_handle_t handle);
     93usb_address_t usb_device_keeper_find(usb_device_keeper_t *instance,
     94    devman_handle_t handle);
    8495
    85 usb_speed_t usb_device_keeper_get_speed(
    86     usb_device_keeper_t *instance, usb_address_t address);
     96usb_speed_t usb_device_keeper_get_speed(usb_device_keeper_t *instance,
     97    usb_address_t address);
     98
    8799#endif
    88100/**
Note: See TracChangeset for help on using the changeset viewer.