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

Changeset 94c19b8 in mainline


Ignore:
Timestamp:
2010-12-12T13:30:44Z (11 years ago)
Author:
Matus Dekanek <smekideki@…>
Branches:
lfn, master
Children:
b666608
Parents:
1eb272d
Message:

minor changes in usbhub/utils.c

Location:
uspace/drv/usbhub
Files:
2 edited

Legend:

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

    r1eb272d r94c19b8  
    4646        /** Number of ports. */
    4747        int port_count;
    48         /** General device info. */
    49         usb_hcd_attached_device_info_t * device;
     48        /** General usb device info. */
     49        usb_hcd_attached_device_info_t * usb_device;
     50        /** General device info*/
     51        device_t * device;
     52
    5053} usb_hub_info_t;
    5154
  • uspace/drv/usbhub/utils.c

    r1eb272d r94c19b8  
    3434 */
    3535#include <driver.h>
    36 #include <usb/devreq.h>
     36#include <bool.h>
     37#include <errno.h>
     38
    3739#include <usbhc_iface.h>
    3840#include <usb/usbdrv.h>
    3941#include <usb/descriptor.h>
    40 #include <driver.h>
    41 #include <bool.h>
    42 #include <errno.h>
     42#include <usb/devreq.h>
    4343#include <usb/classes/hub.h>
     44
    4445#include "usbhub.h"
    4546#include "usbhub_private.h"
    4647#include "port_status.h"
    47 #include <usb/devreq.h>
     48
    4849
    4950static void check_hub_changes(void);
     
    302303        //result->device = device;
    303304        result->port_count = -1;
     305        /// \TODO is this correct? is the device stored?
     306        result->device = device;
    304307
    305308
     
    316319        }*/
    317320
    318         result->device = usb_new(usb_hcd_attached_device_info_t);
    319         result->device->address = addr;
     321        result->usb_device = usb_new(usb_hcd_attached_device_info_t);
     322        result->usb_device->address = addr;
    320323
    321324        // get hub descriptor
     
    387390        usb_device_request_setup_packet_t request;
    388391        usb_target_t target;
    389         target.address = hub_info->device->address;
     392        target.address = hub_info->usb_device->address;
    390393        target.endpoint = 0;
    391394        for (port = 0; port < hub_info->port_count; ++port) {
     
    429432 * @param target
    430433 */
    431 
    432434static void usb_hub_init_add_device(int hc, uint16_t port, usb_target_t target) {
    433435        usb_device_request_setup_packet_t request;
     
    479481                return;
    480482        }
     483
     484
    481485        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         */
    482495
    483496
    484497        /// \TODO driver work
    485498        //add_child_device.....
     499        //opResult = usb_drv_bind_address(hc, new_device_address,
     500    //devman_handle_t handle);...
    486501}
    487502
     
    594609                        lst_item = lst_item->next) {
    595610                printf("[usb_hub] checking hub changes\n");
     611                usb_hub_info_t * hub_info = ((usb_hub_info_t*)lst_item->data);
    596612                /*
    597613                 * Check status change pipe of this hub.
    598614                 */
    599615
    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;
     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;
    608621
    609622                /*
    610623                 * Connect to respective HC.
    611624                 */
    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);
     625                int hc = usb_drv_hc_connect(hub_info->device, 0);
    616626                if (hc < 0) {
    617627                        continue;
Note: See TracChangeset for help on using the changeset viewer.