Changeset 50ba203 in mainline for uspace/drv/usbhub/usbhub.c


Ignore:
Timestamp:
2011-02-20T15:46:48Z (13 years ago)
Author:
Matus Dekanek <smekideki@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
6bb83c7
Parents:
d81ef61c (diff), 0c00dac (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

merge with usb/development

File:
1 edited

Legend:

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

    rd81ef61c r50ba203  
    3636#include <bool.h>
    3737#include <errno.h>
     38#include <str_error.h>
    3839
    3940#include <usb_iface.h>
    4041#include <usb/usbdrv.h>
    4142#include <usb/descriptor.h>
     43#include <usb/recognise.h>
    4244#include <usb/devreq.h>
    4345#include <usb/request.h>
     
    7678        result->device = device;
    7779
     80<<<<<<< TREE
    7881        result->usb_device = usb_new(usb_hcd_attached_device_info_t);
    7982       
     83=======
     84
     85        dprintf(USB_LOG_LEVEL_DEBUG, "phone to hc = %d", hc);
     86        if (hc < 0) {
     87                return result;
     88        }
     89        //get some hub info
     90        usb_address_t addr = usb_drv_get_my_address(hc, device);
     91        dprintf(USB_LOG_LEVEL_DEBUG, "address of newly created hub = %d", addr);
     92        /*if(addr<0){
     93                //return result;
     94
     95        }*/
     96
     97        result->address = addr;
     98
     99>>>>>>> MERGE-SOURCE
    80100        // get hub descriptor
    81101
     
    148168        int port;
    149169        int opResult;
     170<<<<<<< TREE
    150171        //usb_target_t target;
    151172        //target.address = hub_info->usb_device->address;
    152173        //target.endpoint = 0;
     174=======
     175        usb_target_t target;
     176        target.address = hub_info->address;
     177        target.endpoint = 0;
     178>>>>>>> MERGE-SOURCE
    153179
    154180        //get configuration descriptor
     
    212238        dprintf(USB_LOG_LEVEL_INFO, "hub dev added");
    213239        dprintf(USB_LOG_LEVEL_DEBUG, "\taddress %d, has %d ports ",
    214                         hub_info->usb_device->address,
     240                        hub_info->address,
    215241                        hub_info->port_count);
    216242        dprintf(USB_LOG_LEVEL_DEBUG, "\tused configuration %d",config_descriptor.configuration_number);
     
    317343        }
    318344
     345        devman_handle_t hc_handle;
     346        opResult = usb_drv_find_hc(hub->device, &hc_handle);
     347        if (opResult != EOK) {
     348                usb_log_error("Failed to get handle of host controller: %s.\n",
     349                    str_error(opResult));
     350                return;
     351        }
     352
    319353        devman_handle_t child_handle;
    320         opResult = usb_drv_register_child_in_devman(hc, hub->device,
    321             new_device_address, &child_handle);
     354        opResult = usb_device_register_child_in_devman(new_device_address,
     355            hc_handle, hub->device, &child_handle);
    322356        if (opResult != EOK) {
    323357                dprintf(USB_LOG_LEVEL_ERROR, "could not start driver for new device");
     
    472506                /*
    473507                usb_target_t target;
    474                 target.address = hub_info->usb_device->address;
     508                target.address = hub_info->address;
    475509                target.endpoint = 1;/// \TODO get from endpoint descriptor
    476510                dprintf(USB_LOG_LEVEL_INFO, "checking changes for hub at addr %d",
     
    515549                        if (interrupt) {
    516550                                usb_hub_process_interrupt(
     551<<<<<<< TREE
    517552                                        hub_info, port);
     553=======
     554                                        hub_info, hc, port, hub_info->address);
     555>>>>>>> MERGE-SOURCE
    518556                        }
    519557                }
Note: See TracChangeset for help on using the changeset viewer.