Changeset b317b0b in mainline for uspace/drv


Ignore:
Timestamp:
2011-02-21T19:50:41Z (15 years ago)
Author:
Matus Dekanek <smekideki@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
15b0432
Parents:
ace12560 (diff), 41b70d30 (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 from usb/development

Location:
uspace/drv
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/uhci-rhd/root_hub.c

    race12560 rb317b0b  
    3535#include <stdint.h>
    3636
    37 #include <usb/usbdrv.h>
    3837#include <usb/debug.h>
    3938
  • uspace/drv/usbhid/main.c

    race12560 rb317b0b  
    3636 */
    3737
    38 #include <usb/usbdrv.h>
    3938#include <driver.h>
    4039#include <ipc/driver.h>
  • uspace/drv/usbhub/main.c

    race12560 rb317b0b  
    3434#include <errno.h>
    3535#include <async.h>
    36 
    37 #include <usb/usbdrv.h>
    38 
    3936
    4037#include "usbhub.h"
  • uspace/drv/usbhub/port_status.h

    race12560 rb317b0b  
    3535#include <bool.h>
    3636#include <sys/types.h>
    37 #include <usb/devreq.h>
     37#include <usb/request.h>
    3838#include "usbhub_private.h"
    3939
  • uspace/drv/usbhub/usbhub.c

    race12560 rb317b0b  
    4040#include <usb_iface.h>
    4141#include <usb/ddfiface.h>
    42 #include <usb/usbdrv.h>
    4342#include <usb/descriptor.h>
    4443#include <usb/recognise.h>
    45 #include <usb/devreq.h>
    4644#include <usb/request.h>
    4745#include <usb/classes/hub.h>
     
    232230
    233231/**
    234  * Convenience function for releasing default address and writing debug info
    235  * (these few lines are used too often to be written again and again).
    236  * @param hc
    237  * @return
    238  */
    239 inline static int usb_hub_release_default_address(int hc){
    240         int opResult;
    241         dprintf(USB_LOG_LEVEL_INFO, "releasing default address");
    242         opResult = usb_drv_release_default_address(hc);
    243         if (opResult != EOK) {
    244                 dprintf(USB_LOG_LEVEL_WARNING, "failed to release default address");
    245         }
    246         return opResult;
    247 }
    248 
    249 /**
    250232 * Reset the port with new device and reserve the default address.
    251233 * @param hc
     
    261243        //opResult = usb_drv_reserve_default_address(hc);
    262244        opResult = usb_hc_reserve_default_address(&hub->connection, USB_SPEED_LOW);
     245
    263246        if (opResult != EOK) {
    264247                dprintf(USB_LOG_LEVEL_WARNING, "cannot assign default address, it is probably used");
  • uspace/drv/usbhub/usbhub.h

    race12560 rb317b0b  
    4242#define NAME "usbhub"
    4343
    44 //#include "usb/hcdhubd.h"
    45 #include <usb/usbdrv.h>
    4644#include <usb/hub.h>
    4745
  • uspace/drv/usbhub/usbhub_private.h

    race12560 rb317b0b  
    4747#include <usb/classes/hub.h>
    4848#include <usb/usb.h>
    49 #include <usb/usbdrv.h>
    50 
    51 //#include <usb/devreq.h>
    5249#include <usb/debug.h>
     50#include <usb/request.h>
    5351
    5452//************
  • uspace/drv/usbhub/utils.c

    race12560 rb317b0b  
    3838
    3939#include <usbhc_iface.h>
    40 #include <usb/usbdrv.h>
    4140#include <usb/descriptor.h>
    42 #include <usb/devreq.h>
    4341#include <usb/classes/hub.h>
    4442
  • uspace/drv/vhc/hub.c

    race12560 rb317b0b  
    4040#include <stdlib.h>
    4141#include <driver.h>
    42 #include <usb/usbdrv.h>
     42#include <usb/hub.h>
    4343#include <usb/recognise.h>
    4444
     
    7171}
    7272
     73static int pretend_port_rest(int unused, void *unused2)
     74{
     75        return EOK;
     76}
     77
    7378/** Register root hub in devman.
    7479 *
     
    8085        device_t *hc_dev = (device_t *) arg;
    8186
    82         int hc;
     87        /*
     88         * Wait until parent device is properly initialized.
     89         */
     90        int phone;
    8391        do {
    84                 hc = usb_drv_hc_connect(hc_dev, hc_dev->handle,
    85                     IPC_FLAG_BLOCKING);
    86         } while (hc < 0);
     92                phone = devman_device_connect(hc_dev->handle, 0);
     93        } while (phone < 0);
     94        async_hangup(phone);
    8795
    88         usb_drv_reserve_default_address(hc);
     96        usb_hc_connection_t hc_conn;
     97        usb_hc_connection_initialize(&hc_conn, hc_dev->handle);
    8998
    90         usb_address_t hub_address = usb_drv_request_address(hc);
    91         usb_drv_req_set_address(hc, USB_ADDRESS_DEFAULT, hub_address);
     99        usb_hc_connection_open(&hc_conn);
    92100
    93         usb_drv_release_default_address(hc);
     101        int rc = usb_hc_new_device_wrapper(hc_dev, &hc_conn, USB_SPEED_FULL,
     102            pretend_port_rest, 0, NULL,
     103            NULL, NULL);
     104        if (rc != EOK) {
     105                usb_log_fatal("Failed to create root hub: %s.\n",
     106                    str_error(rc));
     107        }
    94108
    95         devman_handle_t hub_handle;
    96         usb_device_register_child_in_devman(hub_address, hc_dev->handle,
    97             hc_dev, &hub_handle);
    98         //usb_drv_register_child_in_devman(hc, hc_dev, hub_address, &hub_handle);
    99         usb_drv_bind_address(hc, hub_address, hub_handle);
     109        usb_hc_connection_close(&hc_conn);
    100110
    101         return EOK;
     111        return 0;
    102112}
    103113       
  • uspace/drv/vhc/hub/hub.c

    race12560 rb317b0b  
    4040#include <stdlib.h>
    4141#include <driver.h>
    42 #include <usb/usbdrv.h>
    4342
    4443#include "hub.h"
  • uspace/drv/vhc/hub/virthub.c

    race12560 rb317b0b  
    4141#include <stdlib.h>
    4242#include <driver.h>
    43 #include <usb/usbdrv.h>
    4443
    4544#include "virthub.h"
Note: See TracChangeset for help on using the changeset viewer.