Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/uhci-hcd/uhci.c

    rea993d18 rfa3de85  
    4444#include "pci.h"
    4545
    46 /** IRQ handling callback, forward status from call to diver structure.
     46/** IRQ handling callback, identifies device
    4747 *
    4848 * @param[in] dev DDF instance of the device to use.
    4949 * @param[in] iid (Unused).
    50  * @param[in] call Pointer to the call from kernel.
     50 * @param[in] call Pointer to the call that represents interrupt.
    5151 */
    5252static void irq_handler(ddf_dev_t *dev, ipc_callid_t iid, ipc_call_t *call)
     
    6161/** Get address of the device identified by handle.
    6262 *
    63  * @param[in] fun DDF instance of the function to use.
    64  * @param[in] handle DDF handle of the driver seeking its USB address.
    65  * @param[out] address Found address.
     63 * @param[in] dev DDF instance of the device to use.
     64 * @param[in] iid (Unused).
     65 * @param[in] call Pointer to the call that represents interrupt.
    6666 */
    6767static int usb_iface_get_address(
     
    6969{
    7070        assert(fun);
    71         usb_device_keeper_t *manager =
    72             &((uhci_t*)fun->dev->driver_data)->hc.manager;
     71        usb_device_keeper_t *manager = &((uhci_t*)fun->dev->driver_data)->hc.manager;
    7372
    7473        usb_address_t addr = usb_device_keeper_find(manager, handle);
     
    8483}
    8584/*----------------------------------------------------------------------------*/
    86 /** Gets handle of the respective hc.
    87  *
    88  * @param[in] fun DDF function of uhci device.
    89  * @param[out] handle Host cotnroller handle.
     85/** Gets handle of the respective hc (this or parent device).
     86 *
     87 * @param[in] root_hub_fun Root hub function seeking hc handle.
     88 * @param[out] handle Place to write the handle.
    9089 * @return Error code.
    9190 */
     
    101100}
    102101/*----------------------------------------------------------------------------*/
    103 /** USB interface implementation used by RH */
     102/** This iface is generic for both RH and HC. */
    104103static usb_iface_t usb_iface = {
    105104        .get_hc_handle = usb_iface_get_hc_handle,
     
    107106};
    108107/*----------------------------------------------------------------------------*/
    109 /** Operations supported by the HC driver */
    110108static ddf_dev_ops_t hc_ops = {
     109//      .interfaces[USB_DEV_IFACE] = &usb_iface,
    111110        .interfaces[USBHC_DEV_IFACE] = &hc_iface, /* see iface.h/c */
    112111};
     
    123122}
    124123/*----------------------------------------------------------------------------*/
    125 /** Interface to provide the root hub driver with hw info */
    126124static hw_res_ops_t hw_res_iface = {
    127125        .get_resource_list = get_resource_list,
     
    129127};
    130128/*----------------------------------------------------------------------------*/
    131 /** RH function support for uhci-rhd */
    132129static ddf_dev_ops_t rh_ops = {
    133130        .interfaces[USB_DEV_IFACE] = &usb_iface,
     
    135132};
    136133/*----------------------------------------------------------------------------*/
    137 /** Initialize hc and rh DDF structures and their respective drivers.
     134/** Initialize hc and rh ddf structures and their respective drivers.
    138135 *
    139136 * @param[in] instance UHCI structure to use.
     
    141138 *
    142139 * This function does all the preparatory work for hc and rh drivers:
    143  *  - gets device's hw resources
    144  *  - disables UHCI legacy support (PCI config space)
     140 *  - gets device hw resources
     141 *  - disables UHCI legacy support
    145142 *  - asks for interrupt
    146143 *  - registers interrupt handler
     
    196193        ret = (instance->hc_fun == NULL) ? ENOMEM : EOK;
    197194        CHECK_RET_DEST_FUN_RETURN(ret,
    198             "Failed(%d) to create HC function: %s.\n", ret, str_error(ret));
     195            "Failed(%d) to create HC function.\n", ret);
    199196
    200197        ret = hc_init(&instance->hc, instance->hc_fun,
    201198            (void*)io_reg_base, io_reg_size, interrupts);
    202         CHECK_RET_DEST_FUN_RETURN(ret,
    203             "Failed(%d) to init uhci-hcd: %s.\n", ret, str_error(ret));
    204 
     199        CHECK_RET_DEST_FUN_RETURN(ret, "Failed(%d) to init uhci-hcd.\n", ret);
    205200        instance->hc_fun->ops = &hc_ops;
    206201        instance->hc_fun->driver_data = &instance->hc;
     
    226221            &instance->hc.interrupt_code);
    227222        CHECK_RET_FINI_RETURN(ret,
    228             "Failed(%d) to register interrupt handler: %s.\n",
    229             ret, str_error(ret));
     223            "Failed(%d) to register interrupt handler.\n", ret);
    230224
    231225        instance->rh_fun = ddf_fun_create(device, fun_inner, "uhci-rh");
    232226        ret = (instance->rh_fun == NULL) ? ENOMEM : EOK;
    233227        CHECK_RET_FINI_RETURN(ret,
    234             "Failed(%d) to create root hub function: %s.\n",
    235             ret, str_error(ret));
     228            "Failed(%d) to create root hub function.\n", ret);
    236229
    237230        ret = rh_init(&instance->rh, instance->rh_fun,
    238231            (uintptr_t)instance->hc.registers + 0x10, 4);
    239232        CHECK_RET_FINI_RETURN(ret,
    240             "Failed(%d) to setup UHCI root hub: %s.\n", ret, str_error(ret));
     233            "Failed(%d) to setup UHCI root hub.\n", ret);
    241234
    242235        instance->rh_fun->ops = &rh_ops;
     
    244237        ret = ddf_fun_bind(instance->rh_fun);
    245238        CHECK_RET_FINI_RETURN(ret,
    246             "Failed(%d) to register UHCI root hub: %s.\n", ret, str_error(ret));
     239            "Failed(%d) to register UHCI root hub.\n", ret);
    247240
    248241        return EOK;
Note: See TracChangeset for help on using the changeset viewer.