Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/usbhub/usbhub_private.h

    rd493ac17 r5097bed4  
    2727 */
    2828
    29 /** @addtogroup drvusbhub
     29/** @addtogroup usb
    3030 * @{
    3131 */
    3232/** @file
    33  * @brief Hub driver private definitions
     33 * @brief Hub driver.
    3434 */
    3535
     
    4242#include <adt/list.h>
    4343#include <bool.h>
    44 #include <ddf/driver.h>
    45 #include <fibril_synch.h>
     44#include <driver.h>
     45#include <futex.h>
    4646
     47#include <usb/usb.h>
     48#include <usb/usbdrv.h>
    4749#include <usb/classes/hub.h>
    48 #include <usb/usb.h>
     50#include <usb/devreq.h>
    4951#include <usb/debug.h>
    50 #include <usb/request.h>
    5152
    5253//************
     
    6061//************
    6162//
    62 // convenience debug printf for usb hub
     63// convenience debug printf
    6364//
    6465//************
    6566#define dprintf(level, format, ...) \
    66         usb_log_printf((level), format "\n", ##__VA_ARGS__)
    67 
     67        usb_dprintf(NAME, (level), format "\n", ##__VA_ARGS__)
    6868
    6969/**
    70  * Create hub structure instance
     70 * create hub structure instance
    7171 *
    7272 * Set the address and port count information most importantly.
     
    7676 * @return
    7777 */
    78 usb_hub_info_t * usb_create_hub_info(ddf_dev_t * device);
     78usb_hub_info_t * usb_create_hub_info(device_t * device, int hc);
    7979
    80 /** List of hubs maanged by this driver */
     80/** list of hubs maanged by this driver */
    8181extern usb_general_list_t usb_hub_list;
    8282
    83 /** Lock for hub list*/
    84 extern fibril_mutex_t usb_hub_list_lock;
     83/** lock for hub list*/
     84extern futex_t usb_hub_list_lock;
    8585
    8686
    8787/**
    88  * Perform complete control read transaction
     88 * perform complete control read transaction
    8989 *
    90  * Manages all three steps of transaction: setup, read and finalize
     90 * manages all three steps of transaction: setup, read and finalize
    9191 * @param phone
    9292 * @param target
    93  * @param request Request packet
    94  * @param rcvd_buffer Received data
     93 * @param request request for data
     94 * @param rcvd_buffer received data
    9595 * @param rcvd_size
    96  * @param actual_size Actual size of received data
     96 * @param actual_size actual size of received data
    9797 * @return error code
    9898 */
    99 /*
    10099int usb_drv_sync_control_read(
    101     usb_endpoint_pipe_t *pipe,
     100    int phone, usb_target_t target,
    102101    usb_device_request_setup_packet_t * request,
    103102    void * rcvd_buffer, size_t rcvd_size, size_t * actual_size
    104 );*/
     103);
    105104
    106105/**
    107  * Perform complete control write transaction
     106 * perform complete control write transaction
    108107 *
    109  * Manages all three steps of transaction: setup, write and finalize
     108 * manages all three steps of transaction: setup, write and finalize
    110109 * @param phone
    111110 * @param target
    112  * @param request Request packet to send data
     111 * @param request request to send data
    113112 * @param sent_buffer
    114113 * @param sent_size
    115114 * @return error code
    116115 */
    117 /*int usb_drv_sync_control_write(
    118     usb_endpoint_pipe_t *pipe,
     116int usb_drv_sync_control_write(
     117    int phone, usb_target_t target,
    119118    usb_device_request_setup_packet_t * request,
    120119    void * sent_buffer, size_t sent_size
    121 );*/
     120);
    122121
    123122/**
    124  * Set the device request to be a get hub descriptor request.
     123 * set the device request to be a get hub descriptor request.
    125124 * @warning the size is allways set to USB_HUB_MAX_DESCRIPTOR_SIZE
    126125 * @param request
     
    138137}
    139138
    140 /**
    141  * Clear feature on hub port.
    142  *
    143  * @param hc Host controller telephone
    144  * @param address Hub address
    145  * @param port_index Port
    146  * @param feature Feature selector
    147  * @return Operation result
    148  */
    149 static inline int usb_hub_clear_port_feature(usb_endpoint_pipe_t *pipe,
     139static inline int usb_hub_clear_port_feature(int hc, usb_address_t address,
    150140    int port_index,
    151141    usb_hub_class_feature_t feature) {
    152        
     142        usb_target_t target = {
     143                .address = address,
     144                .endpoint = 0
     145        };
    153146        usb_device_request_setup_packet_t clear_request = {
    154147                .request_type = USB_HUB_REQ_TYPE_CLEAR_PORT_FEATURE,
     
    158151        };
    159152        clear_request.value = feature;
    160         return usb_endpoint_pipe_control_write(pipe, &clear_request,
     153        return usb_drv_psync_control_write(hc, target, &clear_request,
    161154            sizeof(clear_request), NULL, 0);
    162155}
    163156
    164 /**
    165  * @brief create uint8_t array with serialized descriptor
    166  *
    167  * @param descriptor
    168  * @return newly created serializd descriptor pointer
    169  */
    170 void * usb_serialize_hub_descriptor(usb_hub_descriptor_t * descriptor);
    171 
    172 /**
    173  * @brief create deserialized desriptor structure out of serialized descriptor
    174  *
    175  * The serialized descriptor must be proper usb hub descriptor,
    176  * otherwise an eerror might occur.
    177  *
    178  * @param sdescriptor serialized descriptor
    179  * @return newly created deserialized descriptor pointer
    180  */
    181 usb_hub_descriptor_t * usb_deserialize_hub_desriptor(void * sdescriptor);
    182157
    183158
Note: See TracChangeset for help on using the changeset viewer.