Changes in / [b666608:0c05496] in mainline


Ignore:
Location:
uspace/drv/usbhub
Files:
2 edited

Legend:

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

    rb666608 r0c05496  
    4646        /** Number of ports. */
    4747        int port_count;
    48         /** General usb device info. */
    49         usb_hcd_attached_device_info_t * usb_device;
    50         /** General device info*/
    51         device_t * device;
    52 
     48        /** General device info. */
     49        usb_hcd_attached_device_info_t * device;
    5350} usb_hub_info_t;
    5451
  • uspace/drv/usbhub/utils.c

    rb666608 r0c05496  
    3434 */
    3535#include <driver.h>
    36 #include <bool.h>
    37 #include <errno.h>
    38 
     36#include <usb/devreq.h>
    3937#include <usbhc_iface.h>
    4038#include <usb/usbdrv.h>
    4139#include <usb/descriptor.h>
    42 #include <usb/devreq.h>
     40#include <driver.h>
     41#include <bool.h>
     42#include <errno.h>
    4343#include <usb/classes/hub.h>
    44 
    4544#include "usbhub.h"
    4645#include "usbhub_private.h"
    4746#include "port_status.h"
    48 
     47#include <usb/devreq.h>
    4948
    5049static void check_hub_changes(void);
     
    303302        //result->device = device;
    304303        result->port_count = -1;
    305         /// \TODO is this correct? is the device stored?
    306         result->device = device;
    307304
    308305
     
    319316        }*/
    320317
    321         result->usb_device = usb_new(usb_hcd_attached_device_info_t);
    322         result->usb_device->address = addr;
     318        result->device = usb_new(usb_hcd_attached_device_info_t);
     319        result->device->address = addr;
    323320
    324321        // get hub descriptor
     
    390387        usb_device_request_setup_packet_t request;
    391388        usb_target_t target;
    392         target.address = hub_info->usb_device->address;
     389        target.address = hub_info->device->address;
    393390        target.endpoint = 0;
    394391        for (port = 0; port < hub_info->port_count; ++port) {
     
    432429 * @param target
    433430 */
     431
    434432static void usb_hub_init_add_device(int hc, uint16_t port, usb_target_t target) {
    435433        usb_device_request_setup_packet_t request;
     
    481479                return;
    482480        }
    483 
    484 
    485481        usb_drv_release_default_address(hc);
    486         /*
    487          devman_handle_t dev_handle;
    488         rc = child_device_register_wrapper(hub_dev, "dev",
    489          *      match_id, match_score, &dev_handle);
    490         if (rc != EOK) {
    491                 free(id);
    492         }
    493          *
    494          */
    495482
    496483
    497484        /// \TODO driver work
    498485        //add_child_device.....
    499         //opResult = usb_drv_bind_address(hc, new_device_address,
    500     //devman_handle_t handle);...
    501486}
    502487
     
    609594                        lst_item = lst_item->next) {
    610595                printf("[usb_hub] checking hub changes\n");
    611                 usb_hub_info_t * hub_info = ((usb_hub_info_t*)lst_item->data);
    612596                /*
    613597                 * Check status change pipe of this hub.
    614598                 */
    615599
    616                 usb_target_t target;
    617                 target.address = hub_info->usb_device->address;
    618                 target.endpoint = 1;
    619 
    620                 size_t port_count = hub_info->port_count;
     600                usb_target_t target = {
     601                        .address = 5,
     602                        .endpoint = 1
     603                };
     604                /// \TODO uncomment once it works correctly
     605                //target.address = usb_create_hub_info(lst_item)->device->address;
     606
     607                size_t port_count = 7;
    621608
    622609                /*
    623610                 * Connect to respective HC.
    624611                 */
    625                 int hc = usb_drv_hc_connect(hub_info->device, 0);
     612                /// \FIXME this is incorrect code: here
     613                /// must be used particular device instead of NULL
     614                //which one?
     615                int hc = usb_drv_hc_connect(NULL, 0);
    626616                if (hc < 0) {
    627617                        continue;
Note: See TracChangeset for help on using the changeset viewer.