Changeset c01cd32 in mainline for uspace/drv/uhci-hcd/hc.c


Ignore:
Timestamp:
2011-03-21T22:42:47Z (14 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
33fbe95
Parents:
c56c5b5b
Message:

Rename uhci_hc ⇒ hc, follow common hcd names

File:
1 moved

Legend:

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

    rc56c5b5b rc01cd32  
    4242#include <usb_iface.h>
    4343
    44 #include "uhci_hc.h"
     44#include "hc.h"
    4545
    4646static irq_cmd_t uhci_cmds[] = {
     
    6060};
    6161/*----------------------------------------------------------------------------*/
    62 static int uhci_hc_init_transfer_lists(uhci_hc_t *instance);
    63 static int uhci_hc_init_mem_structures(uhci_hc_t *instance);
    64 static void uhci_hc_init_hw(uhci_hc_t *instance);
    65 
    66 static int uhci_hc_interrupt_emulator(void *arg);
    67 static int uhci_hc_debug_checker(void *arg);
     62static int hc_init_transfer_lists(hc_t *instance);
     63static int hc_init_mem_structures(hc_t *instance);
     64static void hc_init_hw(hc_t *instance);
     65
     66static int hc_interrupt_emulator(void *arg);
     67static int hc_debug_checker(void *arg);
    6868
    6969static bool allowed_usb_packet(
     
    8282 * interrupt fibrils.
    8383 */
    84 int uhci_hc_init(uhci_hc_t *instance, ddf_fun_t *fun,
     84int hc_init(hc_t *instance, ddf_fun_t *fun,
    8585    void *regs, size_t reg_size, bool interrupts)
    8686{
     
    112112            io, reg_size);
    113113
    114         ret = uhci_hc_init_mem_structures(instance);
     114        ret = hc_init_mem_structures(instance);
    115115        CHECK_RET_DEST_FUN_RETURN(ret,
    116116            "Failed to initialize UHCI memory structures.\n");
    117117
    118         uhci_hc_init_hw(instance);
     118        hc_init_hw(instance);
    119119        if (!interrupts) {
    120120                instance->cleaner =
    121                     fibril_create(uhci_hc_interrupt_emulator, instance);
     121                    fibril_create(hc_interrupt_emulator, instance);
    122122                fibril_add_ready(instance->cleaner);
    123123        } else {
     
    126126
    127127        instance->debug_checker =
    128             fibril_create(uhci_hc_debug_checker, instance);
     128            fibril_create(hc_debug_checker, instance);
    129129//      fibril_add_ready(instance->debug_checker);
    130130
     
    138138 * For magic values see UHCI Design Guide
    139139 */
    140 void uhci_hc_init_hw(uhci_hc_t *instance)
     140void hc_init_hw(hc_t *instance)
    141141{
    142142        assert(instance);
     
    186186 *  - frame list page (needs to be one UHCI hw accessible 4K page)
    187187 */
    188 int uhci_hc_init_mem_structures(uhci_hc_t *instance)
     188int hc_init_mem_structures(hc_t *instance)
    189189{
    190190        assert(instance);
     
    215215
    216216        /* Init transfer lists */
    217         ret = uhci_hc_init_transfer_lists(instance);
     217        ret = hc_init_transfer_lists(instance);
    218218        CHECK_RET_DEST_CMDS_RETURN(ret, "Failed to init transfer lists.\n");
    219219        usb_log_debug("Initialized transfer lists.\n");
     
    252252 * USB scheduling. Sets pointer table for quick access.
    253253 */
    254 int uhci_hc_init_transfer_lists(uhci_hc_t *instance)
     254int hc_init_transfer_lists(hc_t *instance)
    255255{
    256256        assert(instance);
     
    318318 * Checks for bandwidth availability and appends the batch to the proper queue.
    319319 */
    320 int uhci_hc_schedule(uhci_hc_t *instance, usb_transfer_batch_t *batch)
     320int hc_schedule(hc_t *instance, usb_transfer_batch_t *batch)
    321321{
    322322        assert(instance);
     
    351351 * - resume from suspend state (not implemented)
    352352 */
    353 void uhci_hc_interrupt(uhci_hc_t *instance, uint16_t status)
     353void hc_interrupt(hc_t *instance, uint16_t status)
    354354{
    355355        assert(instance);
     
    373373                if (instance->hw_failures < UHCI_ALLOWED_HW_FAIL) {
    374374                        /* reinitialize hw, this triggers virtual disconnect*/
    375                         uhci_hc_init_hw(instance);
     375                        hc_init_hw(instance);
    376376                } else {
    377377                        usb_log_fatal("Too many UHCI hardware failures!.\n");
    378                         uhci_hc_fini(instance);
     378                        hc_fini(instance);
    379379                }
    380380        }
     
    386386 * @return EOK (should never return)
    387387 */
    388 int uhci_hc_interrupt_emulator(void* arg)
     388int hc_interrupt_emulator(void* arg)
    389389{
    390390        usb_log_debug("Started interrupt emulator.\n");
    391         uhci_hc_t *instance = (uhci_hc_t*)arg;
     391        hc_t *instance = (hc_t*)arg;
    392392        assert(instance);
    393393
     
    398398                if (status != 0)
    399399                        usb_log_debug2("UHCI status: %x.\n", status);
    400                 uhci_hc_interrupt(instance, status);
     400                hc_interrupt(instance, status);
    401401                async_usleep(UHCI_CLEANER_TIMEOUT);
    402402        }
     
    409409 * @return EOK (should never return)
    410410 */
    411 int uhci_hc_debug_checker(void *arg)
    412 {
    413         uhci_hc_t *instance = (uhci_hc_t*)arg;
     411int hc_debug_checker(void *arg)
     412{
     413        hc_t *instance = (hc_t*)arg;
    414414        assert(instance);
    415415
Note: See TracChangeset for help on using the changeset viewer.