Changeset 76fbd9a in mainline for uspace/drv/bus/usb/uhci


Ignore:
Timestamp:
2012-02-24T19:07:44Z (14 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a76b01b4
Parents:
5837c7a
Message:

usb drivers: remove optical separators

Location:
uspace/drv/bus/usb/uhci
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/uhci/hc.c

    r5837c7a r76fbd9a  
    7272static int hc_debug_checker(void *arg);
    7373
    74 /*----------------------------------------------------------------------------*/
     74
    7575/** Get number of PIO ranges used in IRQ code.
    7676 * @return Number of ranges.
     
    8080        return sizeof(uhci_irq_pio_ranges) / sizeof(irq_pio_range_t);
    8181}
    82 /*----------------------------------------------------------------------------*/
     82
    8383/** Get number of commands used in IRQ code.
    8484 * @return Number of commands.
     
    8888        return sizeof(uhci_irq_commands) / sizeof(irq_cmd_t);
    8989}
    90 /*----------------------------------------------------------------------------*/
     90
    9191/** Generate IRQ code.
    9292 * @param[out] ranges PIO ranges buffer.
     
    118118        return EOK;
    119119}
    120 /*----------------------------------------------------------------------------*/
     120
    121121/** Take action based on the interrupt cause.
    122122 *
     
    175175        }
    176176}
    177 /*----------------------------------------------------------------------------*/
     177
    178178/** Initialize UHCI hc driver structure
    179179 *
     
    235235        return EOK;
    236236}
    237 /*----------------------------------------------------------------------------*/
     237
    238238/** Initialize UHCI hc hw resources.
    239239 *
     
    277277            UHCI_CMD_RUN_STOP | UHCI_CMD_MAX_PACKET | UHCI_CMD_CONFIGURE);
    278278}
    279 /*----------------------------------------------------------------------------*/
     279
    280280/** Initialize UHCI hc memory structures.
    281281 *
     
    319319        return EOK;
    320320}
    321 /*----------------------------------------------------------------------------*/
     321
    322322/** Initialize UHCI hc transfer lists.
    323323 *
     
    381381#undef CHECK_RET_CLEAR_RETURN
    382382}
    383 /*----------------------------------------------------------------------------*/
     383
    384384/** Schedule batch for execution.
    385385 *
     
    409409        return EOK;
    410410}
    411 /*----------------------------------------------------------------------------*/
     411
    412412/** Polling function, emulates interrupts.
    413413 *
     
    432432        return EOK;
    433433}
    434 /*----------------------------------------------------------------------------*/
     434
    435435/** Debug function, checks consistency of memory structures.
    436436 *
  • uspace/drv/bus/usb/uhci/hw_struct/queue_head.h

    r5837c7a r76fbd9a  
    4747        volatile link_pointer_t element;
    4848} __attribute__((packed)) qh_t;
    49 /*----------------------------------------------------------------------------*/
     49
    5050/** Initialize queue head structure
    5151 *
     
    6161        instance->next = LINK_POINTER_TERM;
    6262}
    63 /*----------------------------------------------------------------------------*/
     63
    6464/** Set queue head next pointer
    6565 *
     
    8181        }
    8282}
    83 /*----------------------------------------------------------------------------*/
     83
    8484/** Set queue head element pointer
    8585 *
  • uspace/drv/bus/usb/uhci/hw_struct/transfer_descriptor.c

    r5837c7a r76fbd9a  
    107107        }
    108108}
    109 /*----------------------------------------------------------------------------*/
     109
    110110/** Convert TD status into standard error code
    111111 *
     
    145145        return EOK;
    146146}
    147 /*----------------------------------------------------------------------------*/
     147
    148148/** Print values in status field (dw1) in a human readable way.
    149149 *
  • uspace/drv/bus/usb/uhci/hw_struct/transfer_descriptor.h

    r5837c7a r76fbd9a  
    100100
    101101void td_print_status(const td_t *instance);
    102 /*----------------------------------------------------------------------------*/
     102
    103103/** Helper function for parsing actual size out of TD.
    104104 *
     
    113113        return ((s >> TD_STATUS_ACTLEN_POS) + 1) & TD_STATUS_ACTLEN_MASK;
    114114}
    115 /*----------------------------------------------------------------------------*/
     115
    116116/** Check whether less than max data were received on SPD marked transfer.
    117117 *
     
    129129            (instance->status | TD_STATUS_SPD_FLAG) && act_size < max_size;
    130130}
    131 /*----------------------------------------------------------------------------*/
     131
    132132/** Helper function for parsing value of toggle bit.
    133133 *
     
    140140        return (instance->device & TD_DEVICE_DATA_TOGGLE_ONE_FLAG) ? 1 : 0;
    141141}
    142 /*----------------------------------------------------------------------------*/
     142
    143143/** Helper function for parsing value of active bit
    144144 *
     
    151151        return (instance->status & TD_STATUS_ERROR_ACTIVE) != 0;
    152152}
    153 /*----------------------------------------------------------------------------*/
     153
    154154/** Helper function for setting IOC bit.
    155155 *
     
    161161        instance->status |= TD_STATUS_IOC_FLAG;
    162162}
    163 /*----------------------------------------------------------------------------*/
     163
    164164#endif
    165165/**
  • uspace/drv/bus/usb/uhci/main.c

    r5837c7a r76fbd9a  
    4444
    4545static int uhci_dev_add(ddf_dev_t *device);
    46 /*----------------------------------------------------------------------------*/
     46
    4747static driver_ops_t uhci_driver_ops = {
    4848        .dev_add = uhci_dev_add,
    4949};
    50 /*----------------------------------------------------------------------------*/
     50
    5151static driver_t uhci_driver = {
    5252        .name = NAME,
    5353        .driver_ops = &uhci_driver_ops
    5454};
    55 /*----------------------------------------------------------------------------*/
     55
    5656/** Initialize a new ddf driver instance for uhci hc and hub.
    5757 *
     
    7575        return ret;
    7676}
    77 /*----------------------------------------------------------------------------*/
     77
    7878/** Initialize global driver structures (NONE).
    7979 *
  • uspace/drv/bus/usb/uhci/pci.c

    r5837c7a r76fbd9a  
    9191        return EOK;
    9292}
    93 /*----------------------------------------------------------------------------*/
     93
    9494/** Call the PCI driver with a request to enable interrupts
    9595 *
     
    110110        return enabled ? EOK : EIO;
    111111}
    112 /*----------------------------------------------------------------------------*/
     112
    113113/** Call the PCI driver with a request to clear legacy support register
    114114 *
  • uspace/drv/bus/usb/uhci/transfer_list.c

    r5837c7a r76fbd9a  
    4242static void transfer_list_remove_batch(
    4343    transfer_list_t *instance, uhci_transfer_batch_t *uhci_batch);
    44 /*----------------------------------------------------------------------------*/
     44
    4545/** Initialize transfer list structures.
    4646 *
     
    6969        return EOK;
    7070}
    71 /*----------------------------------------------------------------------------*/
     71
    7272/** Dispose transfer list structures.
    7373 *
     
    9797        qh_set_next_qh(instance->queue_head, next->queue_head);
    9898}
    99 /*----------------------------------------------------------------------------*/
     99
    100100/** Add transfer batch to the list and queue.
    101101 *
     
    144144        fibril_mutex_unlock(&instance->guard);
    145145}
    146 /*----------------------------------------------------------------------------*/
     146
    147147/** Add completed batches to the provided list.
    148148 *
     
    171171        fibril_mutex_unlock(&instance->guard);
    172172}
    173 /*----------------------------------------------------------------------------*/
     173
    174174/** Walk the list and finish all batches with EINTR.
    175175 *
     
    188188        fibril_mutex_unlock(&instance->guard);
    189189}
    190 /*----------------------------------------------------------------------------*/
     190
    191191/** Remove a transfer batch from the list and queue.
    192192 *
  • uspace/drv/bus/usb/uhci/uhci.c

    r5837c7a r76fbd9a  
    6565        return dev->driver_data;
    6666}
    67 /*----------------------------------------------------------------------------*/
     67
    6868/** IRQ handling callback, forward status from call to diver structure.
    6969 *
     
    8383        hc_interrupt(&uhci->hc, status);
    8484}
    85 /*----------------------------------------------------------------------------*/
     85
    8686/** Operations supported by the HC driver */
    8787static ddf_dev_ops_t hc_ops = {
    8888        .interfaces[USBHC_DEV_IFACE] = &hcd_iface, /* see iface.h/c */
    8989};
    90 /*----------------------------------------------------------------------------*/
     90
    9191/** Gets handle of the respective hc.
    9292 *
     
    105105        return EOK;
    106106}
    107 /*----------------------------------------------------------------------------*/
     107
    108108/** USB interface implementation used by RH */
    109109static usb_iface_t usb_iface = {
    110110        .get_hc_handle = usb_iface_get_hc_handle,
    111111};
    112 /*----------------------------------------------------------------------------*/
     112
    113113/** Get root hub hw resources (I/O registers).
    114114 *
     
    123123        return &rh->resource_list;
    124124}
    125 /*----------------------------------------------------------------------------*/
     125
    126126/** Interface to provide the root hub driver with hw info */
    127127static hw_res_ops_t hw_res_iface = {
     
    129129        .enable_interrupt = NULL,
    130130};
    131 /*----------------------------------------------------------------------------*/
     131
    132132/** RH function support for uhci_rhd */
    133133static ddf_dev_ops_t rh_ops = {
     
    135135        .interfaces[HW_RES_DEV_IFACE] = &hw_res_iface
    136136};
    137 /*----------------------------------------------------------------------------*/
     137
    138138/** Initialize hc and rh DDF structures and their respective drivers.
    139139 *
  • uspace/drv/bus/usb/uhci/uhci_batch.c

    r5837c7a r76fbd9a  
    5858        }
    5959}
    60 /*----------------------------------------------------------------------------*/
     60
    6161/** Finishes usb_transfer_batch and destroys the structure.
    6262 *
     
    7171        uhci_transfer_batch_dispose(uhci_batch);
    7272}
    73 /*----------------------------------------------------------------------------*/
     73
    7474/** Transfer batch setup table. */
    7575static void (*const batch_setup[])(uhci_transfer_batch_t*, usb_direction_t);
    76 /*----------------------------------------------------------------------------*/
     76
    7777/** Allocate memory and initialize internal data structure.
    7878 *
     
    143143        return uhci_batch;
    144144}
    145 /*----------------------------------------------------------------------------*/
     145
    146146/** Check batch TDs for activity.
    147147 *
     
    196196        return true;
    197197}
    198 /*----------------------------------------------------------------------------*/
     198
    199199/** Direction to pid conversion table */
    200200static const usb_packet_id direction_pids[] = {
     
    202202        [USB_DIRECTION_OUT] = USB_PID_OUT,
    203203};
    204 /*----------------------------------------------------------------------------*/
     204
    205205/** Prepare generic data transfer
    206206 *
     
    259259            USB_TRANSFER_BATCH_ARGS(*uhci_batch->usb_batch));
    260260}
    261 /*----------------------------------------------------------------------------*/
     261
    262262/** Prepare generic control transfer
    263263 *
     
    331331            uhci_batch->tds[td].status);
    332332}
    333 /*----------------------------------------------------------------------------*/
     333
    334334static void (*const batch_setup[])(uhci_transfer_batch_t*, usb_direction_t) =
    335335{
  • uspace/drv/bus/usb/uhci/uhci_batch.h

    r5837c7a r76fbd9a  
    7676            uhci_batch->td_count * sizeof(td_t);
    7777}
    78 /*----------------------------------------------------------------------------*/
     78
    7979/** Get offset to data buffer accessible to the HC hw.
    8080 * @param uhci_batch UHCI batch structure.
     
    8989            uhci_batch->usb_batch->setup_size;
    9090}
    91 /*----------------------------------------------------------------------------*/
     91
    9292/** Aborts the batch.
    9393 * Sets error to EINTR and size off transferd data to 0, before finishing the
     
    103103        uhci_transfer_batch_finish_dispose(uhci_batch);
    104104}
    105 /*----------------------------------------------------------------------------*/
     105
    106106/** Linked list conversion wrapper.
    107107 * @param l Linked list link.
  • uspace/drv/bus/usb/uhci/utils/malloc32.h

    r5837c7a r76fbd9a  
    6262        return result;
    6363}
    64 /*----------------------------------------------------------------------------*/
     64
    6565/** DMA malloc simulator
    6666 *
     
    8484        return memalign(alignment, size);
    8585}
    86 /*----------------------------------------------------------------------------*/
     86
    8787/** DMA malloc simulator
    8888 *
     
    9191static inline void free32(void *addr)
    9292        { free(addr); }
    93 /*----------------------------------------------------------------------------*/
     93
    9494/** Create 4KB page mapping
    9595 *
     
    105105        return address;
    106106}
    107 /*----------------------------------------------------------------------------*/
     107
    108108static inline void return_page(void *page)
    109109{
Note: See TracChangeset for help on using the changeset viewer.