Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 98d06b8 in mainline for uspace/drv/usbhub/usbhub_private.h


Ignore:
Timestamp:
2010-12-10T15:11:24Z (11 years ago)
Author:
Matus Dekanek <smekideki@…>
Branches:
lfn, master
Children:
c01255c
Parents:
b5ec347
Message:

hub driver:
connect a new device
init a hub

File:
1 edited

Legend:

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

    rb5ec347 r98d06b8  
    100100 * @brief create hub structure instance
    101101 *
     102 * Set the address and port count information most importantly.
     103 *
    102104 * @param device
     105 * @param hc host controller phone
    103106 * @return
    104107 */
    105 usb_hub_info_t * usb_create_hub_info(device_t * device);
     108usb_hub_info_t * usb_create_hub_info(device_t * device, int hc);
    106109
    107110/** list of hubs maanged by this driver */
     
    146149
    147150/**
    148  * set the device requsst to be a set address request
     151 * set the device request to be a set address request
    149152 * @param request
    150153 * @param addr
     
    154157){
    155158        request->index = 0;
    156         request->request_type = 0;/// \TODO this is not very nice sollution
     159        request->request_type = 0;/// \TODO this is not very nice sollution, we ned constant
    157160        request->request = USB_DEVREQ_SET_ADDRESS;
    158161        request->value = addr;
    159162        request->length = 0;
    160163}
     164
     165/**
     166 * set the device request to be a get hub descriptor request.
     167 * @warning the size is allways set to USB_HUB_MAX_DESCRIPTOR_SIZE
     168 * @param request
     169 * @param addr
     170 */
     171static inline void usb_hub_get_descriptor_request(
     172usb_device_request_setup_packet_t * request
     173){
     174        request->index = 0;
     175        request->request_type = USB_HUB_REQ_TYPE_GET_DESCRIPTOR;
     176        request->request = USB_HUB_REQUEST_GET_DESCRIPTOR;
     177        request->value = USB_DESCTYPE_HUB;
     178        request->length = USB_HUB_MAX_DESCRIPTOR_SIZE;
     179}
     180
    161181
    162182
Note: See TracChangeset for help on using the changeset viewer.