Changeset 69df9373 in mainline


Ignore:
Timestamp:
2011-04-07T12:14:21Z (13 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a82889e, c1b1944
Parents:
c50941f
Message:

Add missing documentation

Location:
uspace/drv/usbhub
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/usbhub/ports.c

    rc50941f r69df9373  
    4040#include <usb/debug.h>
    4141
     42/** Retrieve port status.
     43 *
     44 * @param[in] ctrl_pipe Control pipe to use.
     45 * @param[in] port Port number (starting at 1).
     46 * @param[out] status Where to store the port status.
     47 * @return Error code.
     48 */
    4249static int get_port_status(usb_pipe_t *ctrl_pipe, size_t port,
    4350    usb_port_status_t *status)
     
    6673}
    6774
     75/** Information for fibril for device discovery. */
    6876struct add_device_phase1 {
    6977        usb_hub_info_t *hub;
     
    7280};
    7381
     82/** Callback for enabling a specific port.
     83 *
     84 * We wait on a CV until port is reseted.
     85 * That is announced via change on interrupt pipe.
     86 *
     87 * @param port_no Port number (starting at 1).
     88 * @param arg Custom argument, points to @c usb_hub_info_t.
     89 * @return Error code.
     90 */
    7491static int enable_port_callback(int port_no, void *arg)
    7592{
     
    108125}
    109126
     127/** Fibril for adding a new device.
     128 *
     129 * Separate fibril is needed because the port reset completion is announced
     130 * via interrupt pipe and thus we cannot block here.
     131 *
     132 * @param arg Pointer to struct add_device_phase1.
     133 * @return 0 Always.
     134 */
    110135static int add_device_phase1_worker_fibril(void *arg)
    111136{
     
    142167}
    143168
     169/** Start device adding when connection change is detected.
     170 *
     171 * This fires a new fibril to complete the device addition.
     172 *
     173 * @param hub Hub where the change occured.
     174 * @param port Port index (starting at 1).
     175 * @param speed Speed of the device.
     176 * @return Error code.
     177 */
    144178static int add_device_phase1_new_fibril(usb_hub_info_t *hub, size_t port,
    145179    usb_speed_t speed)
     
    179213}
    180214
     215/** Process change on a single port.
     216 *
     217 * @param hub Hub to which the port belongs.
     218 * @param port Port index (starting at 1).
     219 */
    181220static void process_port_change(usb_hub_info_t *hub, size_t port)
    182221{
     
    252291}
    253292
     293
     294/** Callback for polling hub for port changes.
     295 *
     296 * @param dev Device where the change occured.
     297 * @param change_bitmap Bitmap of changed ports.
     298 * @param change_bitmap_size Size of the bitmap in bytes.
     299 * @param arg Custom argument, points to @c usb_hub_info_t.
     300 * @return Whether to continue polling.
     301 */
    254302bool hub_port_changes_callback(usb_device_t *dev,
    255303    uint8_t *change_bitmap, size_t change_bitmap_size, void *arg)
  • uspace/drv/usbhub/ports.h

    rc50941f r69df9373  
    4646#include <usb/devdrv.h>
    4747
     48/** Information about single port on a hub. */
    4849typedef struct {
     50        /** Mutex needed by CV for checking port reset. */
    4951        fibril_mutex_t reset_mutex;
     52        /** CV for waiting to port reset completion. */
    5053        fibril_condvar_t reset_cv;
     54        /** Whether port reset is completed.
     55         * Guarded by @c reset_mutex.
     56         */
     57        bool reset_completed;
     58
     59        /** Information about attached device. */
    5160        usb_hc_attached_device_t attached_device;
    52         bool reset_completed;
    5361} usb_hub_port_t;
    5462
     63/** Initialize hub port information.
     64 *
     65 * @param port Port to be initialized.
     66 */
    5567static inline void usb_hub_port_init(usb_hub_port_t *port) {
    5668        port->attached_device.address = -1;
Note: See TracChangeset for help on using the changeset viewer.