Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 76fbd9a in mainline


Ignore:
Timestamp:
2012-02-24T19:07:44Z (8 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
master
Children:
a76b01b
Parents:
5837c7a
Message:

usb drivers: remove optical separators

Location:
uspace/drv/bus/usb
Files:
41 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/ehci/main.c

    r5837c7a r76fbd9a  
    4949
    5050static int ehci_dev_add(ddf_dev_t *device);
    51 /*----------------------------------------------------------------------------*/
     51
    5252static driver_ops_t ehci_driver_ops = {
    5353        .dev_add = ehci_dev_add,
    5454};
    55 /*----------------------------------------------------------------------------*/
     55
    5656static driver_t ehci_driver = {
    5757        .name = NAME,
     
    6262};
    6363
    64 /*----------------------------------------------------------------------------*/
     64
    6565/** Initializes a new ddf driver instance of EHCI hcd.
    6666 *
     
    121121#undef CHECK_RET_RETURN
    122122}
    123 /*----------------------------------------------------------------------------*/
     123
    124124/** Initializes global driver structures (NONE).
    125125 *
  • uspace/drv/bus/usb/ehci/pci.c

    r5837c7a r76fbd9a  
    219219        return rc;
    220220}
    221 /*----------------------------------------------------------------------------*/
     221
    222222/** Calls the PCI driver with a request to enable interrupts
    223223 *
     
    238238        return enabled ? EOK : EIO;
    239239}
    240 /*----------------------------------------------------------------------------*/
     240
    241241/** Implements BIOS handoff routine as decribed in EHCI spec
    242242 *
  • uspace/drv/bus/usb/ohci/endpoint_list.c

    r5837c7a r76fbd9a  
    6565        return EOK;
    6666}
    67 /*----------------------------------------------------------------------------*/
     67
    6868/** Set the next list in transfer list chain.
    6969 *
     
    8080        ed_append_ed(instance->list_head, next->list_head);
    8181}
    82 /*----------------------------------------------------------------------------*/
     82
    8383/** Add endpoint to the list and queue.
    8484 *
     
    132132        fibril_mutex_unlock(&instance->guard);
    133133}
    134 /*----------------------------------------------------------------------------*/
     134
    135135/** Remove endpoint from the list and queue.
    136136 *
  • uspace/drv/bus/usb/ohci/hc.c

    r5837c7a r76fbd9a  
    6868static int interrupt_emulator(hc_t *instance);
    6969static int hc_schedule(hcd_t *hcd, usb_transfer_batch_t *batch);
    70 /*----------------------------------------------------------------------------*/
     70
    7171/** Get number of PIO ranges used in IRQ code.
    7272 * @return Number of ranges.
     
    7676        return sizeof(ohci_pio_ranges) / sizeof(irq_pio_range_t);
    7777}
    78 /*----------------------------------------------------------------------------*/
    79 /*----------------------------------------------------------------------------*/
     78
     79
    8080/** Get number of commands used in IRQ code.
    8181 * @return Number of commands.
     
    8585        return sizeof(ohci_irq_commands) / sizeof(irq_cmd_t);
    8686}
    87 /*----------------------------------------------------------------------------*/
     87
    8888/** Generate IRQ code.
    8989 * @param[out] ranges PIO ranges buffer.
     
    116116        return EOK;
    117117}
    118 /*----------------------------------------------------------------------------*/
     118
    119119/** Announce OHCI root hub to the DDF
    120120 *
     
    175175#undef CHECK_RET_RELEASE
    176176}
    177 /*----------------------------------------------------------------------------*/
     177
    178178/** Initialize OHCI hc driver structure
    179179 *
     
    228228        return EOK;
    229229}
    230 /*----------------------------------------------------------------------------*/
     230
    231231void hc_enqueue_endpoint(hc_t *instance, const endpoint_t *ep)
    232232{
     
    261261        }
    262262}
    263 /*----------------------------------------------------------------------------*/
     263
    264264void hc_dequeue_endpoint(hc_t *instance, const endpoint_t *ep)
    265265{
     
    296296        }
    297297}
    298 /*----------------------------------------------------------------------------*/
     298
    299299/** Add USB transfer to the schedule.
    300300 *
     
    338338        return EOK;
    339339}
    340 /*----------------------------------------------------------------------------*/
     340
    341341/** Interrupt handling routine
    342342 *
     
    384384
    385385}
    386 /*----------------------------------------------------------------------------*/
     386
    387387/** Check status register regularly
    388388 *
     
    402402        return EOK;
    403403}
    404 /*----------------------------------------------------------------------------*/
     404
    405405/** Turn off any (BIOS)driver that might be in control of the device.
    406406 *
     
    465465        async_usleep(50000);
    466466}
    467 /*----------------------------------------------------------------------------*/
     467
    468468/** OHCI hw initialization routine.
    469469 *
     
    537537            OHCI_RD(instance->registers->control));
    538538}
    539 /*----------------------------------------------------------------------------*/
     539
    540540/** Initialize schedule queues
    541541 *
     
    571571        return EOK;
    572572}
    573 /*----------------------------------------------------------------------------*/
     573
    574574/** Initialize memory structures used by the OHCI hcd.
    575575 *
  • uspace/drv/bus/usb/ohci/main.c

    r5837c7a r76fbd9a  
    6363        return EOK;
    6464}
    65 /*----------------------------------------------------------------------------*/
     65
    6666static driver_ops_t ohci_driver_ops = {
    6767        .dev_add = ohci_dev_add,
    6868};
    69 /*----------------------------------------------------------------------------*/
     69
    7070static driver_t ohci_driver = {
    7171        .name = NAME,
    7272        .driver_ops = &ohci_driver_ops
    7373};
    74 /*----------------------------------------------------------------------------*/
     74
    7575/** Initializes global driver structures (NONE).
    7676 *
  • uspace/drv/bus/usb/ohci/ohci.c

    r5837c7a r76fbd9a  
    7575        hc_interrupt(&ohci->hc, status);
    7676}
    77 /*----------------------------------------------------------------------------*/
     77
    7878/** Get USB address assigned to root hub.
    7979 *
     
    9292        return EOK;
    9393}
    94 /*----------------------------------------------------------------------------*/
     94
    9595/** Gets handle of the respective hc (this device, hc function).
    9696 *
     
    110110        return EOK;
    111111}
    112 /*----------------------------------------------------------------------------*/
     112
    113113/** Root hub USB interface */
    114114static usb_iface_t usb_iface = {
     
    116116        .get_my_address = rh_get_my_address,
    117117};
    118 /*----------------------------------------------------------------------------*/
     118
    119119/** Standard USB HC options (HC interface) */
    120120static ddf_dev_ops_t hc_ops = {
    121121        .interfaces[USBHC_DEV_IFACE] = &hcd_iface,
    122122};
    123 /*----------------------------------------------------------------------------*/
     123
    124124/** Standard USB RH options (RH interface) */
    125125static ddf_dev_ops_t rh_ops = {
    126126        .interfaces[USB_DEV_IFACE] = &usb_iface,
    127127};
    128 /*----------------------------------------------------------------------------*/
     128
    129129/** Initialize hc and rh ddf structures and their respective drivers.
    130130 *
  • uspace/drv/bus/usb/ohci/ohci_batch.c

    r5837c7a r76fbd9a  
    4444
    4545static void (*const batch_setup[])(ohci_transfer_batch_t*, usb_direction_t);
    46 /*----------------------------------------------------------------------------*/
     46
    4747/** Safely destructs ohci_transfer_batch_t structure
    4848 *
     
    6767        free(ohci_batch);
    6868}
    69 /*----------------------------------------------------------------------------*/
     69
    7070/** Finishes usb_transfer_batch and destroys the structure.
    7171 *
     
    8080        ohci_transfer_batch_dispose(ohci_batch);
    8181}
    82 /*----------------------------------------------------------------------------*/
     82
    8383/** Allocate memory and initialize internal data structure.
    8484 *
     
    158158#undef CHECK_NULL_DISPOSE_RET
    159159}
    160 /*----------------------------------------------------------------------------*/
     160
    161161/** Check batch TDs' status.
    162162 *
     
    261261        return true;
    262262}
    263 /*----------------------------------------------------------------------------*/
     263
    264264/** Starts execution of the TD list
    265265 *
     
    271271        ed_set_tail_td(ohci_batch->ed, ohci_batch->tds[ohci_batch->td_count]);
    272272}
    273 /*----------------------------------------------------------------------------*/
     273
    274274/** Prepare generic control transfer
    275275 *
     
    347347            USB_TRANSFER_BATCH_ARGS(*ohci_batch->usb_batch));
    348348}
    349 /*----------------------------------------------------------------------------*/
     349
    350350/** Prepare generic data transfer
    351351 *
     
    394394            USB_TRANSFER_BATCH_ARGS(*ohci_batch->usb_batch));
    395395}
    396 /*----------------------------------------------------------------------------*/
     396
    397397/** Transfer setup table. */
    398398static void (*const batch_setup[])(ohci_transfer_batch_t*, usb_direction_t) =
  • uspace/drv/bus/usb/ohci/ohci_batch.h

    r5837c7a r76fbd9a  
    6363void ohci_transfer_batch_commit(const ohci_transfer_batch_t *batch);
    6464void ohci_transfer_batch_finish_dispose(ohci_transfer_batch_t *batch);
    65 /*----------------------------------------------------------------------------*/
     65
    6666static inline ohci_transfer_batch_t *ohci_transfer_batch_from_link(link_t *l)
    6767{
  • uspace/drv/bus/usb/ohci/ohci_endpoint.c

    r5837c7a r76fbd9a  
    4848        ed_toggle_set(instance->ed, toggle);
    4949}
    50 /*----------------------------------------------------------------------------*/
     50
    5151/** Callback to get value of toggle bit.
    5252 *
     
    6161        return ed_toggle_get(instance->ed);
    6262}
    63 /*----------------------------------------------------------------------------*/
     63
    6464/** Creates new hcd endpoint representation.
    6565 *
     
    9393        return EOK;
    9494}
    95 /*----------------------------------------------------------------------------*/
     95
    9696/** Disposes hcd endpoint structure
    9797 *
  • uspace/drv/bus/usb/ohci/root_hub.c

    r5837c7a r76fbd9a  
    210210            instance->port_count);
    211211}
    212 /*----------------------------------------------------------------------------*/
     212
    213213/**
    214214 * Process root hub request.
     
    251251        }
    252252}
    253 /*----------------------------------------------------------------------------*/
     253
    254254/**
    255255 * Process interrupt on a hub device.
     
    272272        fibril_mutex_unlock(&instance->guard);
    273273}
    274 /*----------------------------------------------------------------------------*/
     274
    275275/**
    276276 * Create hub descriptor.
     
    327327        }
    328328}
    329 /*----------------------------------------------------------------------------*/
     329
    330330/** Initialize hub descriptors.
    331331 *
     
    353353            instance->hub_descriptor_size);
    354354}
    355 /*----------------------------------------------------------------------------*/
     355
    356356/**
    357357 * Create bitmap of changes to answer status interrupt.
     
    384384        return uint16_host2usb(mask);
    385385}
    386 /*----------------------------------------------------------------------------*/
     386
    387387/**
    388388 * Create answer to status request.
     
    475475
    476476}
    477 /*----------------------------------------------------------------------------*/
     477
    478478/**
    479479 * Create answer to a descriptor request.
     
    549549        TRANSFER_END(request, ENOTSUP);
    550550}
    551 /*----------------------------------------------------------------------------*/
     551
    552552/**
    553553 * process feature-enabling request on hub
     
    595595        }
    596596}
    597 /*----------------------------------------------------------------------------*/
     597
    598598/**
    599599 * Process feature clear request.
     
    659659        }
    660660}
    661 /*----------------------------------------------------------------------------*/
     661
    662662/**
    663663 * process one of requests that do not request nor carry additional data
     
    697697        }
    698698}
    699 /*----------------------------------------------------------------------------*/
     699
    700700/**
    701701 * process one of requests that do not request nor carry additional data
     
    744744        }
    745745}
    746 /*----------------------------------------------------------------------------*/
     746
    747747/**
    748748 * Process hub control request.
  • uspace/drv/bus/usb/ohci/utils/malloc32.h

    r5837c7a r76fbd9a  
    6262        return result;
    6363}
    64 /*----------------------------------------------------------------------------*/
     64
    6565/** Physical mallocator simulator
    6666 *
     
    7070static inline void * malloc32(size_t size)
    7171        { return memalign(OHCI_ALIGN, size); }
    72 /*----------------------------------------------------------------------------*/
     72
    7373/** Physical mallocator simulator
    7474 *
  • 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{
  • uspace/drv/bus/usb/uhcirh/port.c

    r5837c7a r76fbd9a  
    6464        return pio_read_16(port->address);
    6565}
    66 /*----------------------------------------------------------------------------*/
     66
    6767/** Register writing helper function.
    6868 *
     
    7676        pio_write_16(port->address, val);
    7777}
    78 /*----------------------------------------------------------------------------*/
     78
    7979/** Initialize UHCI root hub port instance.
    8080 *
     
    128128        return EOK;
    129129}
    130 /*----------------------------------------------------------------------------*/
     130
    131131/** Cleanup UHCI root hub port instance.
    132132 *
     
    142142        return;
    143143}
    144 /*----------------------------------------------------------------------------*/
     144
    145145/** Periodically checks port status and reports new devices.
    146146 *
     
    211211        return EOK;
    212212}
    213 /*----------------------------------------------------------------------------*/
     213
    214214/** Callback for enabling port during adding a new device.
    215215 *
     
    248248        return EOK;
    249249}
    250 /*----------------------------------------------------------------------------*/
     250
    251251/** Initialize and report connected device.
    252252 *
     
    283283        return EOK;
    284284}
    285 /*----------------------------------------------------------------------------*/
     285
    286286/** Remove device.
    287287 *
     
    325325        return EOK;
    326326}
    327 /*----------------------------------------------------------------------------*/
     327
    328328/** Enable or disable root hub port.
    329329 *
     
    359359        return EOK;
    360360}
    361 /*----------------------------------------------------------------------------*/
     361
    362362/** Print the port status value in a human friendly way
    363363 *
  • uspace/drv/bus/usb/uhcirh/root_hub.c

    r5837c7a r76fbd9a  
    7979        return EOK;
    8080}
    81 /*----------------------------------------------------------------------------*/
     81
    8282/** Cleanup UHCI root hub instance.
    8383 *
     
    9292        }
    9393}
    94 /*----------------------------------------------------------------------------*/
     94
    9595/**
    9696 * @}
  • uspace/drv/bus/usb/usbhid/generic/hiddev.c

    r5837c7a r76fbd9a  
    4646#include "usbhid.h"
    4747
    48 /*----------------------------------------------------------------------------*/
     48
    4949
    5050const usb_endpoint_description_t usb_hid_generic_poll_endpoint_description = {
     
    6060const char *HID_GENERIC_CLASS_NAME = "hid";
    6161
    62 /*----------------------------------------------------------------------------*/
     62
    6363static size_t usb_generic_hid_get_event_length(ddf_fun_t *fun);
    6464static int usb_generic_hid_get_event(ddf_fun_t *fun, uint8_t *buffer,
     
    6868static int usb_generic_get_report_descriptor(ddf_fun_t *fun, uint8_t *desc,
    6969    size_t size, size_t *actual_size);
    70 /*----------------------------------------------------------------------------*/
     70
    7171static usbhid_iface_t usb_generic_iface = {
    7272        .get_event = usb_generic_hid_get_event,
     
    7575        .get_report_descriptor = usb_generic_get_report_descriptor
    7676};
    77 /*----------------------------------------------------------------------------*/
     77
    7878static ddf_dev_ops_t usb_generic_hid_ops = {
    7979        .interfaces[USBHID_DEV_IFACE] = &usb_generic_iface,
    8080        .open = usb_generic_hid_client_connected
    8181};
    82 /*----------------------------------------------------------------------------*/
     82
    8383static size_t usb_generic_hid_get_event_length(ddf_fun_t *fun)
    8484{
     
    9797        return hid_dev->max_input_report_size;
    9898}
    99 /*----------------------------------------------------------------------------*/
     99
    100100static int usb_generic_hid_get_event(ddf_fun_t *fun, uint8_t *buffer,
    101101    size_t size, size_t *act_size, int *event_nr, unsigned int flags)
     
    127127        return EOK;
    128128}
    129 /*----------------------------------------------------------------------------*/
     129
    130130static size_t usb_generic_get_report_descriptor_length(ddf_fun_t *fun)
    131131{
     
    144144        return hid_dev->report_desc_size;
    145145}
    146 /*----------------------------------------------------------------------------*/
     146
    147147static int usb_generic_get_report_descriptor(ddf_fun_t *fun, uint8_t *desc,
    148148    size_t size, size_t *actual_size)
     
    166166        return EOK;
    167167}
    168 /*----------------------------------------------------------------------------*/
     168
    169169static int usb_generic_hid_client_connected(ddf_fun_t *fun)
    170170{
     
    172172        return EOK;
    173173}
    174 /*----------------------------------------------------------------------------*/
     174
    175175void usb_generic_hid_deinit(usb_hid_dev_t *hid_dev, void *data)
    176176{
     
    189189        ddf_fun_destroy(fun);
    190190}
    191 /*----------------------------------------------------------------------------*/
     191
    192192int usb_generic_hid_init(usb_hid_dev_t *hid_dev, void **data)
    193193{
     
    224224        return EOK;
    225225}
    226 /*----------------------------------------------------------------------------*/
     226
    227227bool usb_generic_hid_polling_callback(usb_hid_dev_t *hid_dev, void *data)
    228228{
  • uspace/drv/bus/usb/usbhid/generic/hiddev.h

    r5837c7a r76fbd9a  
    4747const char *HID_GENERIC_CLASS_NAME;
    4848
    49 /*----------------------------------------------------------------------------*/
     49
    5050
    5151int usb_generic_hid_init(struct usb_hid_dev *hid_dev, void **data);
  • uspace/drv/bus/usb/usbhid/kbd/kbddev.c

    r5837c7a r76fbd9a  
    7373static void default_connection_handler(ddf_fun_t *, ipc_callid_t, ipc_call_t *);
    7474static ddf_dev_ops_t kbdops = { .default_handler = default_connection_handler };
    75 /*----------------------------------------------------------------------------*/
     75
    7676
    7777static const unsigned DEFAULT_ACTIVE_MODS = KM_NUM_LOCK;
     
    8888static const unsigned int DEFAULT_REPEAT_DELAY = 50 * 1000;
    8989
    90 /*----------------------------------------------------------------------------*/
     90
    9191/** Keyboard polling endpoint description for boot protocol class. */
    9292const usb_endpoint_description_t usb_hid_kbd_poll_endpoint_description = {
     
    103103
    104104static void usb_kbd_set_led(usb_hid_dev_t *hid_dev, usb_kbd_t *kbd_dev);
    105 /*----------------------------------------------------------------------------*/
     105
    106106static const uint8_t USB_KBD_BOOT_REPORT_DESCRIPTOR[] = {
    107107        0x05, 0x01,  /* Usage Page (Generic Desktop), */
     
    138138        0xC0         /* End Collection */
    139139};
    140 /*----------------------------------------------------------------------------*/
     140
    141141typedef enum usb_kbd_flags {
    142142        USB_KBD_STATUS_UNINITIALIZED = 0,
     
    144144        USB_KBD_STATUS_TO_DESTROY = -1
    145145} usb_kbd_flags;
    146 /*----------------------------------------------------------------------------*/
     146
    147147/* IPC method handler                                                         */
    148 /*----------------------------------------------------------------------------*/
     148
    149149/**
    150150 * Default handler for IPC methods not handled by DDF.
     
    208208
    209209}
    210 /*----------------------------------------------------------------------------*/
     210
    211211/* Key processing functions                                                   */
    212 /*----------------------------------------------------------------------------*/
     212
    213213/**
    214214 * Handles turning of LED lights on and off.
     
    283283        }
    284284}
    285 /*----------------------------------------------------------------------------*/
     285
    286286/** Send key event.
    287287 *
     
    308308        }
    309309}
    310 /*----------------------------------------------------------------------------*/
     310
    311311static inline int usb_kbd_is_lock(unsigned int key_code)
    312312{
     
    315315            || key_code == KC_CAPS_LOCK);
    316316}
    317 /*----------------------------------------------------------------------------*/
     317
    318318static size_t find_in_array_int32(int32_t val, int32_t *arr, size_t arr_size)
    319319{
     
    326326        return (size_t) -1;
    327327}
    328 /*----------------------------------------------------------------------------*/
     328
    329329/**
    330330 * Checks if some keys were pressed or released and generates key events.
     
    409409        usb_log_debug2("Stored keys %s.\n", key_buffer);
    410410}
    411 /*----------------------------------------------------------------------------*/
     411
    412412/* General kbd functions                                                      */
    413 /*----------------------------------------------------------------------------*/
     413
    414414/**
    415415 * Processes data received from the device in form of report.
     
    481481        usb_kbd_check_key_changes(hid_dev, kbd_dev);
    482482}
    483 /*----------------------------------------------------------------------------*/
     483
    484484/* HID/KBD structure manipulation                                             */
    485 /*----------------------------------------------------------------------------*/
     485
    486486static int usb_kbd_create_function(usb_kbd_t *kbd_dev)
    487487{
     
    537537        return EOK;
    538538}
    539 /*----------------------------------------------------------------------------*/
     539
    540540/* API functions                                                              */
    541 /*----------------------------------------------------------------------------*/
     541
    542542/**
    543543 * Initialization of the USB/HID keyboard structure.
     
    701701        return EOK;
    702702}
    703 /*----------------------------------------------------------------------------*/
     703
    704704bool usb_kbd_polling_callback(usb_hid_dev_t *hid_dev, void *data)
    705705{
     
    715715        return true;
    716716}
    717 /*----------------------------------------------------------------------------*/
     717
    718718int usb_kbd_is_initialized(const usb_kbd_t *kbd_dev)
    719719{
    720720        return (kbd_dev->initialized == USB_KBD_STATUS_INITIALIZED);
    721721}
    722 /*----------------------------------------------------------------------------*/
     722
    723723int usb_kbd_is_ready_to_destroy(const usb_kbd_t *kbd_dev)
    724724{
    725725        return (kbd_dev->initialized == USB_KBD_STATUS_TO_DESTROY);
    726726}
    727 /*----------------------------------------------------------------------------*/
     727
    728728/**
    729729 * Properly destroys the USB/HID keyboard structure.
     
    766766        free(kbd_dev);
    767767}
    768 /*----------------------------------------------------------------------------*/
     768
    769769void usb_kbd_deinit(usb_hid_dev_t *hid_dev, void *data)
    770770{
     
    779779        }
    780780}
    781 /*----------------------------------------------------------------------------*/
     781
    782782int usb_kbd_set_boot_protocol(usb_hid_dev_t *hid_dev)
    783783{
  • uspace/drv/bus/usb/usbhid/kbd/kbddev.h

    r5837c7a r76fbd9a  
    5050struct usb_hid_dev;
    5151
    52 /*----------------------------------------------------------------------------*/
     52
    5353/**
    5454 * USB/HID keyboard device type.
     
    113113} usb_kbd_t;
    114114
    115 /*----------------------------------------------------------------------------*/
     115
    116116
    117117extern const usb_endpoint_description_t usb_hid_kbd_poll_endpoint_description;
     
    120120const char *HID_KBD_CLASS_NAME;
    121121
    122 /*----------------------------------------------------------------------------*/
     122
    123123
    124124int usb_kbd_init(struct usb_hid_dev *hid_dev, void **data);
  • uspace/drv/bus/usb/usbhid/kbd/kbdrepeat.c

    r5837c7a r76fbd9a  
    105105        }
    106106}
    107 /*----------------------------------------------------------------------------*/
     107
    108108/**
    109109 * Main routine to be executed by a fibril for handling auto-repeat.
     
    132132        return EOK;
    133133}
    134 /*----------------------------------------------------------------------------*/
     134
    135135/**
    136136 * Start repeating particular key.
     
    149149        fibril_mutex_unlock(&kbd->repeat_mtx);
    150150}
    151 /*----------------------------------------------------------------------------*/
     151
    152152/**
    153153 * Stop repeating particular key.
  • uspace/drv/bus/usb/usbhid/kbd/kbdrepeat.h

    r5837c7a r76fbd9a  
    4242struct usb_kbd_t;
    4343
    44 /*----------------------------------------------------------------------------*/
     44
    4545/**
    4646 * Structure for keeping information needed for auto-repeat of keys.
     
    5757} usb_kbd_repeat_t;
    5858
    59 /*----------------------------------------------------------------------------*/
     59
    6060
    6161int usb_kbd_repeat_fibril(void *arg);
  • uspace/drv/bus/usb/usbhid/main.c

    r5837c7a r76fbd9a  
    113113        return EOK;
    114114}
    115 /*----------------------------------------------------------------------------*/
     115
    116116/**
    117117 * Callback for a device about to be removed from the driver.
     
    126126        return ENOTSUP;
    127127}
    128 /*----------------------------------------------------------------------------*/
     128
    129129/**
    130130 * Callback for removing a device from the driver.
     
    152152        return EOK;
    153153}
    154 /*----------------------------------------------------------------------------*/
     154
    155155/** USB generic driver callbacks */
    156156static const usb_driver_ops_t usb_hid_driver_ops = {
     
    159159        .device_gone = usb_hid_device_gone,
    160160};
    161 /*----------------------------------------------------------------------------*/
     161
    162162/** The driver itself. */
    163163static const usb_driver_t usb_hid_driver = {
     
    166166        .endpoints = usb_hid_endpoints
    167167};
    168 /*----------------------------------------------------------------------------*/
     168
    169169int main(int argc, char *argv[])
    170170{
  • uspace/drv/bus/usb/usbhid/mouse/mousedev.c

    r5837c7a r76fbd9a  
    5858static ddf_dev_ops_t ops = { .default_handler = default_connection_handler };
    5959
    60 /*----------------------------------------------------------------------------*/
     60
    6161const usb_endpoint_description_t usb_hid_mouse_poll_endpoint_description = {
    6262        .transfer_type = USB_TRANSFER_INTERRUPT,
     
    7474static const uint8_t IDLE_RATE = 0;
    7575
    76 /*----------------------------------------------------------------------------*/
     76
    7777static const uint8_t USB_MOUSE_BOOT_REPORT_DESCRIPTOR[] = {
    7878        0x05, 0x01,                    // USAGE_PAGE (Generic Desktop)
     
    104104};
    105105
    106 /*----------------------------------------------------------------------------*/
     106
    107107
    108108/** Default handler for IPC methods not handled by DDF.
     
    146146        }
    147147}
    148 /*----------------------------------------------------------------------------*/
     148
    149149static int get_mouse_axis_move_value(uint8_t rid, usb_hid_report_t *report,
    150150    int32_t usage)
     
    245245        return true;
    246246}
    247 /*----------------------------------------------------------------------------*/
     247
    248248#define FUN_UNBIND_DESTROY(fun) \
    249249if (fun) { \
     
    256256        } \
    257257} else (void)0
    258 /*----------------------------------------------------------------------------*/
     258
    259259static int usb_mouse_create_function(usb_hid_dev_t *hid_dev, usb_mouse_t *mouse)
    260260{
     
    337337        return highest_button;
    338338}
    339 /*----------------------------------------------------------------------------*/
     339
    340340int usb_mouse_init(usb_hid_dev_t *hid_dev, void **data)
    341341{
     
    387387        return EOK;
    388388}
    389 /*----------------------------------------------------------------------------*/
     389
    390390bool usb_mouse_polling_callback(usb_hid_dev_t *hid_dev, void *data)
    391391{
     
    400400        return usb_mouse_process_report(hid_dev, mouse_dev);
    401401}
    402 /*----------------------------------------------------------------------------*/
     402
    403403void usb_mouse_deinit(usb_hid_dev_t *hid_dev, void *data)
    404404{
     
    421421        free(mouse_dev);
    422422}
    423 /*----------------------------------------------------------------------------*/
     423
    424424int usb_mouse_set_boot_protocol(usb_hid_dev_t *hid_dev)
    425425{
  • uspace/drv/bus/usb/usbhid/mouse/mousedev.h

    r5837c7a r76fbd9a  
    4242struct usb_hid_dev;
    4343
    44 /*----------------------------------------------------------------------------*/
     44
    4545
    4646/** Container for USB mouse device. */
     
    5757} usb_mouse_t;
    5858
    59 /*----------------------------------------------------------------------------*/
     59
    6060
    6161extern const usb_endpoint_description_t usb_hid_mouse_poll_endpoint_description;
     
    6464const char *HID_MOUSE_CATEGORY;
    6565
    66 /*----------------------------------------------------------------------------*/
     66
    6767
    6868int usb_mouse_init(struct usb_hid_dev *hid_dev, void **data);
     
    7474int usb_mouse_set_boot_protocol(struct usb_hid_dev *hid_dev);
    7575
    76 /*----------------------------------------------------------------------------*/
     76
    7777
    7878#endif // USB_HID_MOUSEDEV_H_
  • uspace/drv/bus/usb/usbhid/multimedia/multimedia.c

    r5837c7a r76fbd9a  
    5454#define NAME  "multimedia-keys"
    5555
    56 /*----------------------------------------------------------------------------*/
     56
    5757/**
    5858 * Logitech UltraX device type.
     
    7070
    7171
    72 /*----------------------------------------------------------------------------*/
     72
    7373/**
    7474 * Default handler for IPC methods not handled by DDF.
     
    106106                async_answer_0(icallid, EINVAL);
    107107}
    108 /*----------------------------------------------------------------------------*/
     108
    109109static ddf_dev_ops_t multimedia_ops = {
    110110        .default_handler = default_connection_handler
    111111};
    112 /*----------------------------------------------------------------------------*/
     112
    113113/**
    114114 * Processes key events.
     
    155155        }
    156156}
    157 /*----------------------------------------------------------------------------*/
     157
    158158int usb_multimedia_init(struct usb_hid_dev *hid_dev, void **data)
    159159{
     
    216216        return EOK;
    217217}
    218 /*----------------------------------------------------------------------------*/
     218
    219219void usb_multimedia_deinit(struct usb_hid_dev *hid_dev, void *data)
    220220{
     
    239239        }
    240240}
    241 /*----------------------------------------------------------------------------*/
     241
    242242bool usb_multimedia_polling_callback(struct usb_hid_dev *hid_dev, void *data)
    243243{
  • uspace/drv/bus/usb/usbhid/multimedia/multimedia.h

    r5837c7a r76fbd9a  
    4141struct usb_hid_dev;
    4242
    43 /*----------------------------------------------------------------------------*/
     43
    4444
    4545int usb_multimedia_init(struct usb_hid_dev *hid_dev, void **data);
     
    4949bool usb_multimedia_polling_callback(struct usb_hid_dev *hid_dev, void *data);
    5050
    51 /*----------------------------------------------------------------------------*/
     51
    5252
    5353#endif // USB_HID_MULTIMEDIA_H_
  • uspace/drv/bus/usb/usbhid/subdrivers.h

    r5837c7a r76fbd9a  
    4040#include "kbd/kbddev.h"
    4141
    42 /*----------------------------------------------------------------------------*/
     42
    4343
    4444typedef struct usb_hid_subdriver_usage {
     
    4747} usb_hid_subdriver_usage_t;
    4848
    49 /*----------------------------------------------------------------------------*/
     49
    5050
    5151/** Structure representing the mapping between device requirements and the
     
    8181} usb_hid_subdriver_mapping_t;
    8282
    83 /*----------------------------------------------------------------------------*/
     83
    8484
    8585extern const usb_hid_subdriver_mapping_t usb_hid_subdrivers[];
    8686extern const size_t USB_HID_MAX_SUBDRIVERS;
    8787
    88 /*----------------------------------------------------------------------------*/
     88
    8989
    9090#endif /* USB_HID_SUBDRIVERS_H_ */
  • uspace/drv/bus/usb/usbhid/usbhid.c

    r5837c7a r76fbd9a  
    5858        NULL
    5959};
    60 /*----------------------------------------------------------------------------*/
     60
    6161static int usb_hid_set_boot_kbd_subdriver(usb_hid_dev_t *hid_dev)
    6262{
     
    7474        return EOK;
    7575}
    76 /*----------------------------------------------------------------------------*/
     76
    7777static int usb_hid_set_boot_mouse_subdriver(usb_hid_dev_t *hid_dev)
    7878{
     
    9090        return EOK;
    9191}
    92 /*----------------------------------------------------------------------------*/
     92
    9393static int usb_hid_set_generic_hid_subdriver(usb_hid_dev_t *hid_dev)
    9494{
     
    110110        return EOK;
    111111}
    112 /*----------------------------------------------------------------------------*/
     112
    113113static bool usb_hid_ids_match(const usb_hid_dev_t *hid_dev,
    114114    const usb_hid_subdriver_mapping_t *mapping)
     
    122122            == mapping->product_id);
    123123}
    124 /*----------------------------------------------------------------------------*/
     124
    125125static bool usb_hid_path_matches(usb_hid_dev_t *hid_dev,
    126126    const usb_hid_subdriver_mapping_t *mapping)
     
    178178        return matches;
    179179}
    180 /*----------------------------------------------------------------------------*/
     180
    181181static int usb_hid_save_subdrivers(usb_hid_dev_t *hid_dev,
    182182    const usb_hid_subdriver_t **subdrivers, unsigned count)
     
    211211        return EOK;
    212212}
    213 /*----------------------------------------------------------------------------*/
     213
    214214static int usb_hid_find_subdrivers(usb_hid_dev_t *hid_dev)
    215215{
     
    263263        return usb_hid_save_subdrivers(hid_dev, subdrivers, count);
    264264}
    265 /*----------------------------------------------------------------------------*/
     265
    266266static int usb_hid_check_pipes(usb_hid_dev_t *hid_dev, const usb_device_t *dev)
    267267{
     
    290290        return ENOTSUP;
    291291}
    292 /*----------------------------------------------------------------------------*/
     292
    293293static int usb_hid_init_report(usb_hid_dev_t *hid_dev)
    294294{
     
    322322        return EOK;
    323323}
    324 /*----------------------------------------------------------------------------*/
     324
    325325/*
    326326 * This functions initializes required structures from the device's descriptors
     
    458458        return rc;
    459459}
    460 /*----------------------------------------------------------------------------*/
     460
    461461bool usb_hid_polling_callback(usb_device_t *dev, uint8_t *buffer,
    462462    size_t buffer_size, void *arg)
     
    500500        return cont;
    501501}
    502 /*----------------------------------------------------------------------------*/
     502
    503503void usb_hid_polling_ended_callback(usb_device_t *dev, bool reason, void *arg)
    504504{
     
    517517        hid_dev->running = false;
    518518}
    519 /*----------------------------------------------------------------------------*/
     519
    520520void usb_hid_new_report(usb_hid_dev_t *hid_dev)
    521521{
    522522        ++hid_dev->report_nr;
    523523}
    524 /*----------------------------------------------------------------------------*/
     524
    525525int usb_hid_report_number(const usb_hid_dev_t *hid_dev)
    526526{
    527527        return hid_dev->report_nr;
    528528}
    529 /*----------------------------------------------------------------------------*/
     529
    530530void usb_hid_deinit(usb_hid_dev_t *hid_dev)
    531531{
  • uspace/drv/bus/usb/usbhid/usbhid.h

    r5837c7a r76fbd9a  
    9595};
    9696
    97 /*----------------------------------------------------------------------------*/
     97
    9898/**
    9999 * Structure for holding general HID device data.
     
    132132};
    133133
    134 /*----------------------------------------------------------------------------*/
     134
    135135
    136136enum {
     
    143143extern const usb_endpoint_description_t *usb_hid_endpoints[];
    144144
    145 /*----------------------------------------------------------------------------*/
     145
    146146
    147147int usb_hid_init(usb_hid_dev_t *hid_dev, usb_device_t *dev);
  • uspace/drv/bus/usb/usbhub/port.c

    r5837c7a r76fbd9a  
    7171        return EOK;
    7272}
    73 /*----------------------------------------------------------------------------*/
     73
    7474/**
    7575 * Clear feature on hub port.
     
    9393            sizeof(clear_request), NULL, 0);
    9494}
    95 /*----------------------------------------------------------------------------*/
     95
    9696/**
    9797 * Set feature on hub port.
     
    115115            sizeof(clear_request), NULL, 0);
    116116}
    117 /*----------------------------------------------------------------------------*/
     117
    118118/**
    119119 * Mark reset process as failed due to external reasons
     
    130130        fibril_mutex_unlock(&port->mutex);
    131131}
    132 /*----------------------------------------------------------------------------*/
     132
    133133/**
    134134 * Process interrupts on given port
     
    246246            port->port_number, status);
    247247}
    248 /*----------------------------------------------------------------------------*/
     248
    249249/**
    250250 * routine called when a device on port has been removed
     
    300300        return EOK;
    301301}
    302 /*----------------------------------------------------------------------------*/
     302
    303303/**
    304304 * Process port reset change
     
    336336        }
    337337}
    338 /*----------------------------------------------------------------------------*/
     338
    339339/** Retrieve port status.
    340340 *
     
    376376        return EOK;
    377377}
    378 /*----------------------------------------------------------------------------*/
     378
    379379/** Callback for enabling a specific port.
    380380 *
     
    408408        return port->reset_okay ? EOK : ESTALL;
    409409}
    410 /*----------------------------------------------------------------------------*/
     410
    411411/** Fibril for adding a new device.
    412412 *
     
    455455        return rc;
    456456}
    457 /*----------------------------------------------------------------------------*/
     457
    458458/** Start device adding when connection change is detected.
    459459 *
  • uspace/drv/bus/usb/usbhub/usbhub.c

    r5837c7a r76fbd9a  
    165165        return EOK;
    166166}
    167 /*----------------------------------------------------------------------------*/
     167
    168168/**
    169169 * Turn off power to all ports.
     
    176176        return ENOTSUP;
    177177}
    178 /*----------------------------------------------------------------------------*/
     178
    179179/**
    180180 * Remove all attached devices
     
    219219        return EOK;
    220220}
    221 /*----------------------------------------------------------------------------*/
     221
    222222/** Callback for polling hub for changes.
    223223 *
     
    256256        return true;
    257257}
    258 /*----------------------------------------------------------------------------*/
     258
    259259/**
    260260 * Load hub-specific information into hub_dev structure and process if needed
     
    331331        return EOK;
    332332}
    333 /*----------------------------------------------------------------------------*/
     333
    334334/**
    335335 * Set configuration of and USB device
     
    378378        return opResult;
    379379}
    380 /*----------------------------------------------------------------------------*/
     380
    381381/**
    382382 * Process hub over current change
     
    416416
    417417}
    418 /*----------------------------------------------------------------------------*/
     418
    419419/**
    420420 * Process hub interrupts.
     
    485485        }
    486486}
    487 /*----------------------------------------------------------------------------*/
     487
    488488/**
    489489 * callback called from hub polling fibril when the fibril terminates
  • uspace/drv/bus/usb/usbmid/main.c

    r5837c7a r76fbd9a  
    6161        return EOK;
    6262}
    63 /*----------------------------------------------------------------------------*/
     63
    6464/** Callback when a MID device is about to be removed from the host.
    6565 *
     
    115115        return ret;
    116116}
    117 /*----------------------------------------------------------------------------*/
     117
    118118/** Callback when a MID device was removed from the host.
    119119 *
Note: See TracChangeset for help on using the changeset viewer.