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

Changeset a76b01b4 in mainline


Ignore:
Timestamp:
2012-02-24T19:11:23Z (10 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master
Children:
a2bd8822
Parents:
76fbd9a
Message:

libus*: remove optical separators

Location:
uspace/lib
Files:
22 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/drv/generic/remote_usb.c

    r76fbd9a ra76b01b4  
    6565        return ret;
    6666}
    67 /*----------------------------------------------------------------------------*/
     67
    6868/** Tell interface number given device can use.
    6969 * @param[in] exch IPC communication exchange
     
    8383        return ret;
    8484}
    85 /*----------------------------------------------------------------------------*/
     85
    8686/** Tell devman handle of device host controller.
    8787 * @param[in] exch IPC communication exchange
     
    121121};
    122122
    123 /*----------------------------------------------------------------------------*/
     123
    124124void remote_usb_get_my_address(ddf_fun_t *fun, void *iface,
    125125    ipc_callid_t callid, ipc_call_t *call)
     
    140140        }
    141141}
    142 /*----------------------------------------------------------------------------*/
     142
    143143void remote_usb_get_my_interface(ddf_fun_t *fun, void *iface,
    144144    ipc_callid_t callid, ipc_call_t *call)
     
    159159        }
    160160}
    161 /*----------------------------------------------------------------------------*/
     161
    162162void remote_usb_get_hc_handle(ddf_fun_t *fun, void *iface,
    163163    ipc_callid_t callid, ipc_call_t *call)
  • uspace/lib/drv/generic/remote_usbhc.c

    r76fbd9a ra76b01b4  
    173173        return ret;
    174174}
    175 /*----------------------------------------------------------------------------*/
     175
    176176int usbhc_bind_address(async_exch_t *exch, usb_address_t address,
    177177    devman_handle_t handle)
     
    182182            IPC_M_USBHC_BIND_ADDRESS, address, handle);
    183183}
    184 /*----------------------------------------------------------------------------*/
     184
    185185int usbhc_get_handle(async_exch_t *exch, usb_address_t address,
    186186    devman_handle_t *handle)
     
    195195        return ret;
    196196}
    197 /*----------------------------------------------------------------------------*/
     197
    198198int usbhc_release_address(async_exch_t *exch, usb_address_t address)
    199199{
     
    203203            IPC_M_USBHC_RELEASE_ADDRESS, address);
    204204}
    205 /*----------------------------------------------------------------------------*/
     205
    206206int usbhc_register_endpoint(async_exch_t *exch, usb_address_t address,
    207207    usb_endpoint_t endpoint, usb_transfer_type_t type,
     
    220220#undef _PACK2
    221221}
    222 /*----------------------------------------------------------------------------*/
     222
    223223int usbhc_unregister_endpoint(async_exch_t *exch, usb_address_t address,
    224224    usb_endpoint_t endpoint, usb_direction_t direction)
     
    229229            IPC_M_USBHC_UNREGISTER_ENDPOINT, address, endpoint, direction);
    230230}
    231 /*----------------------------------------------------------------------------*/
     231
    232232int usbhc_read(async_exch_t *exch, usb_address_t address,
    233233    usb_endpoint_t endpoint, uint64_t setup, void *data, size_t size,
     
    285285        return EOK;
    286286}
    287 /*----------------------------------------------------------------------------*/
     287
    288288int usbhc_write(async_exch_t *exch, usb_address_t address,
    289289    usb_endpoint_t endpoint, uint64_t setup, const void *data, size_t size)
     
    321321        return (int) opening_request_rc;
    322322}
    323 /*----------------------------------------------------------------------------*/
     323
    324324
    325325static void remote_usbhc_request_address(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *);
     
    386386        return trans;
    387387}
    388 /*----------------------------------------------------------------------------*/
     388
    389389void remote_usbhc_request_address(ddf_fun_t *fun, void *iface,
    390390    ipc_callid_t callid, ipc_call_t *call)
     
    408408        }
    409409}
    410 /*----------------------------------------------------------------------------*/
     410
    411411void remote_usbhc_bind_address(ddf_fun_t *fun, void *iface,
    412412    ipc_callid_t callid, ipc_call_t *call)
     
    425425        async_answer_0(callid, ret);
    426426}
    427 /*----------------------------------------------------------------------------*/
     427
    428428void remote_usbhc_get_handle(ddf_fun_t *fun, void *iface,
    429429    ipc_callid_t callid, ipc_call_t *call)
     
    446446        }
    447447}
    448 /*----------------------------------------------------------------------------*/
     448
    449449void remote_usbhc_release_address(ddf_fun_t *fun, void *iface,
    450450    ipc_callid_t callid, ipc_call_t *call)
     
    462462        async_answer_0(callid, ret);
    463463}
    464 /*----------------------------------------------------------------------------*/
     464
    465465static void callback_out(ddf_fun_t *fun,
    466466    int outcome, void *arg)
     
    472472        async_transaction_destroy(trans);
    473473}
    474 /*----------------------------------------------------------------------------*/
     474
    475475static void callback_in(ddf_fun_t *fun,
    476476    int outcome, size_t actual_size, void *arg)
     
    496496        async_transaction_destroy(trans);
    497497}
    498 /*----------------------------------------------------------------------------*/
     498
    499499void remote_usbhc_register_endpoint(ddf_fun_t *fun, void *iface,
    500500    ipc_callid_t callid, ipc_call_t *call)
     
    596596        }
    597597}
    598 /*----------------------------------------------------------------------------*/
     598
    599599void remote_usbhc_write(
    600600    ddf_fun_t *fun, void *iface, ipc_callid_t callid, ipc_call_t *call)
  • uspace/lib/usb/src/hc.c

    r76fbd9a ra76b01b4  
    5959        return EOK;
    6060}
    61 /*----------------------------------------------------------------------------*/
     61
    6262static int usb_hc_connection_del_ref(usb_hc_connection_t *connection)
    6363{
     
    125125        return rc;
    126126}
    127 /*----------------------------------------------------------------------------*/
     127
    128128void usb_hc_connection_deinitialize(usb_hc_connection_t *connection)
    129129{
     
    140140        fibril_mutex_unlock(&connection->guard);
    141141}
    142 /*----------------------------------------------------------------------------*/
     142
    143143/** Open connection to host controller.
    144144 *
     
    150150        return usb_hc_connection_add_ref(connection);
    151151}
    152 /*----------------------------------------------------------------------------*/
     152
    153153/** Close connection to the host controller.
    154154 *
     
    160160        return usb_hc_connection_del_ref(connection);
    161161}
    162 /*----------------------------------------------------------------------------*/
     162
    163163/** Ask host controller for free address assignment.
    164164 *
     
    182182        return ret == EOK ? address : ret;
    183183}
    184 /*----------------------------------------------------------------------------*/
     184
    185185int usb_hc_bind_address(usb_hc_connection_t * connection,
    186186    usb_address_t address, devman_handle_t handle)
     
    194194        return ret;
    195195}
    196 /*----------------------------------------------------------------------------*/
     196
    197197/** Get handle of USB device with given address.
    198198 *
     
    213213        return ret;
    214214}
    215 /*----------------------------------------------------------------------------*/
     215
    216216int usb_hc_release_address(usb_hc_connection_t *connection,
    217217    usb_address_t address)
     
    225225        return ret;
    226226}
    227 /*----------------------------------------------------------------------------*/
     227
    228228int usb_hc_register_endpoint(usb_hc_connection_t *connection,
    229229    usb_address_t address, usb_endpoint_t endpoint, usb_transfer_type_t type,
     
    239239        return ret;
    240240}
    241 /*----------------------------------------------------------------------------*/
     241
    242242int usb_hc_unregister_endpoint(usb_hc_connection_t *connection,
    243243    usb_address_t address, usb_endpoint_t endpoint, usb_direction_t direction)
     
    252252        return ret;
    253253}
    254 /*----------------------------------------------------------------------------*/
     254
    255255int usb_hc_read(usb_hc_connection_t *connection, usb_address_t address,
    256256    usb_endpoint_t endpoint, uint64_t setup, void *data, size_t size,
     
    266266        return ret;
    267267}
    268 /*----------------------------------------------------------------------------*/
     268
    269269int usb_hc_write(usb_hc_connection_t *connection, usb_address_t address,
    270270    usb_endpoint_t endpoint, uint64_t setup, const void *data, size_t size)
  • uspace/lib/usbdev/include/usb/dev/usb_device_connection.h

    r76fbd9a ra76b01b4  
    7272        return EOK;
    7373}
    74 /*----------------------------------------------------------------------------*/
     74
    7575/** Register endpoint on the device.
    7676 * @param instance device connection structure to use.
     
    9191            instance->address, ep, type, direction, packet_size, interval);
    9292}
    93 /*----------------------------------------------------------------------------*/
     93
    9494/** Unregister endpoint on the device.
    9595 * @param instance device connection structure
     
    105105            instance->address, ep, dir);
    106106}
    107 /*----------------------------------------------------------------------------*/
     107
    108108/** Get data from the device.
    109109 * @param[in] instance device connection structure to use.
     
    122122            instance->address, ep, setup, data, size, rsize);
    123123}
    124 /*----------------------------------------------------------------------------*/
     124
    125125/** Send data to the device.
    126126 * @param instance device connection structure to use.
     
    138138            instance->address, ep, setup, data, size);
    139139}
    140 /*----------------------------------------------------------------------------*/
     140
    141141/** Wrapper for read calls with no setup stage.
    142142 * @param[in] instance device connection structure.
     
    153153        return usb_device_control_read(instance, ep, 0, data, size, real_size);
    154154}
    155 /*----------------------------------------------------------------------------*/
     155
    156156/** Wrapper for write calls with no setup stage.
    157157 * @param instance device connection structure.
  • uspace/lib/usbdev/src/devdrv.c

    r76fbd9a ra76b01b4  
    7474        return ddf_driver_main(&generic_driver);
    7575}
    76 /*----------------------------------------------------------------------------*/
     76
    7777/** Count number of pipes the driver expects.
    7878 *
     
    8787        return count;
    8888}
    89 /*----------------------------------------------------------------------------*/
     89
    9090/** Callback when a new device is supposed to be controlled by this driver.
    9191 *
     
    124124        return rc;
    125125}
    126 /*----------------------------------------------------------------------------*/
     126
    127127/** Callback when a device is supposed to be removed from the system.
    128128 *
     
    146146        return EOK;
    147147}
    148 /*----------------------------------------------------------------------------*/
     148
    149149/** Callback when a device was removed from the system.
    150150 *
     
    167167        return ret;
    168168}
    169 /*----------------------------------------------------------------------------*/
     169
    170170/** Destroy existing pipes of a USB device.
    171171 *
     
    178178        dev->pipes_count = 0;
    179179}
    180 /*----------------------------------------------------------------------------*/
     180
    181181/** Change interface setting of a device.
    182182 * This function selects new alternate setting of an interface by issuing
  • uspace/lib/usbdev/src/pipes.c

    r76fbd9a ra76b01b4  
    5454        return usb_hc_connection_open(pipe->wire->hc_connection);
    5555}
    56 /*----------------------------------------------------------------------------*/
     56
    5757/** Terminate a long transfer on a pipe.
    5858 * @param pipe Pipe where to end the long transfer.
     
    6767        return usb_hc_connection_close(pipe->wire->hc_connection);
    6868}
    69 /*----------------------------------------------------------------------------*/
     69
    7070/** Try to clear endpoint halt of default control pipe.
    7171 *
     
    8585        pipe->auto_reset_halt = true;
    8686}
    87 /*----------------------------------------------------------------------------*/
     87
    8888/** Request a control read transfer on an endpoint pipe.
    8989 *
     
    135135        return rc;
    136136}
    137 /*----------------------------------------------------------------------------*/
     137
    138138/** Request a control write transfer on an endpoint pipe.
    139139 *
     
    182182        return rc;
    183183}
    184 /*----------------------------------------------------------------------------*/
     184
    185185/** Request a read (in) transfer on an endpoint pipe.
    186186 *
     
    227227        return rc;
    228228}
    229 /*----------------------------------------------------------------------------*/
     229
    230230/** Request a write (out) transfer on an endpoint pipe.
    231231 *
     
    259259            pipe->endpoint_no, buffer, size);
    260260}
    261 /*----------------------------------------------------------------------------*/
     261
    262262/** Initialize USB endpoint pipe.
    263263 *
     
    287287        return EOK;
    288288}
    289 /*----------------------------------------------------------------------------*/
     289
    290290/** Initialize USB endpoint pipe as the default zero control pipe.
    291291 *
     
    307307        return rc;
    308308}
    309 /*----------------------------------------------------------------------------*/
     309
    310310/** Register endpoint with the host controller.
    311311 *
     
    323323           pipe->direction, pipe->max_packet_size, interval);
    324324}
    325 /*----------------------------------------------------------------------------*/
     325
    326326/** Revert endpoint registration with the host controller.
    327327 *
  • uspace/lib/usbhid/include/usb/hid/hid_report_items.h

    r76fbd9a ra76b01b4  
    3838#include <stdint.h>
    3939
    40 /*---------------------------------------------------------------------------*/
     40
    4141/*
    4242 * Item prefix
     
    5656#define USB_HID_ITEM_IS_LONG(data)      (data == 0xFE)
    5757
    58 /*---------------------------------------------------------------------------*/
     58
    5959/*
    6060 * Extended usage macros
     
    7070#define USB_HID_EXTENDED_USAGE(usage)           (usage & 0xFFFF)
    7171
    72 /*---------------------------------------------------------------------------*/
     72
    7373/*
    7474 * Input/Output/Feature Item flags
     
    142142#define USB_HID_ITEM_FLAG_BUFFERED(flags)       ((flags & 0x100) == 0x100)
    143143
    144 /*---------------------------------------------------------------------------*/
     144
    145145
    146146/* MAIN ITEMS */
     
    185185#define USB_HID_REPORT_TAG_END_COLLECTION       0xC
    186186
    187 /*---------------------------------------------------------------------------*/
     187
    188188
    189189/* GLOBAL ITEMS */
     
    272272#define USB_HID_REPORT_TAG_POP                  0xB
    273273
    274 /*---------------------------------------------------------------------------*/
     274
    275275
    276276/* LOCAL ITEMS */
     
    347347#define USB_HID_REPORT_TAG_DELIMITER            0xA
    348348
    349 /*---------------------------------------------------------------------------*/
     349
    350350
    351351#endif
  • uspace/lib/usbhid/include/usb/hid/hidpath.h

    r76fbd9a ra76b01b4  
    4141
    4242
    43 /*---------------------------------------------------------------------------*/
     43
    4444/*
    4545 * Flags of usage paths comparison modes.
     
    7373#define USB_HID_PATH_COMPARE_ANYWHERE           8
    7474
    75 /*----------------------------------------------------------------------------*/
     75
    7676/**
    7777 * Item of usage path structure. Last item of linked list describes one item
     
    9393
    9494
    95 /*---------------------------------------------------------------------------*/
     95
    9696/**
    9797 * USB HID usage path structure.
     
    112112} usb_hid_report_path_t;
    113113
    114 /*---------------------------------------------------------------------------*/
     114
    115115usb_hid_report_path_t *usb_hid_report_path(void);
    116116
  • uspace/lib/usbhid/include/usb/hid/hidtypes.h

    r76fbd9a ra76b01b4  
    3939#include <adt/list.h>
    4040
    41 /*---------------------------------------------------------------------------*/
     41
    4242
    4343/**
     
    6969        (((x) < 0 ) ? ((1 << (size)) + (x)) : (x))
    7070
    71 /*---------------------------------------------------------------------------*/
     71
    7272
    7373/**
     
    8686} usb_hid_report_type_t;
    8787
    88 /*---------------------------------------------------------------------------*/
     88
    8989
    9090/**
     
    111111       
    112112} usb_hid_report_t;
    113 /*---------------------------------------------------------------------------*/
     113
    114114
    115115/**
     
    135135        link_t reports_link;
    136136} usb_hid_report_description_t;
    137 /*---------------------------------------------------------------------------*/
     137
    138138
    139139/**
     
    202202} usb_hid_report_field_t;
    203203
    204 /*---------------------------------------------------------------------------*/
     204
    205205
    206206/**
     
    287287        int in_delimiter;
    288288} usb_hid_report_item_t;
    289 /*---------------------------------------------------------------------------*/
     289
    290290/**
    291291 * Enum of the keyboard modifiers
     
    314314        USB_HID_MOD_RGUI
    315315};
    316 /*---------------------------------------------------------------------------*/
     316
    317317
    318318
  • uspace/lib/usbhid/include/usb/hid/request.h

    r76fbd9a ra76b01b4  
    4242#include <usb/dev/pipes.h>
    4343
    44 /*----------------------------------------------------------------------------*/
     44
    4545
    4646int usbhid_req_set_report(usb_pipe_t *ctrl_pipe, int iface_no,
     
    6161int usbhid_req_get_idle(usb_pipe_t *ctrl_pipe, int iface_no, uint8_t *duration);
    6262
    63 /*----------------------------------------------------------------------------*/
     63
    6464
    6565#endif /* USB_KBD_HIDREQ_H_ */
  • uspace/lib/usbhid/src/hiddescriptor.c

    r76fbd9a ra76b01b4  
    4141#include <assert.h>
    4242
    43 /*---------------------------------------------------------------------------*/
     43
    4444/*
    4545 * Constants defining current parsing mode for correct parsing of the set of
     
    6161#define INSIDE_DELIMITER_SET    2
    6262
    63 /*---------------------------------------------------------------------------*/
     63
    6464       
    6565/** The new report item flag. Used to determine when the item is completly
     
    7878#define USB_HID_UNKNOWN_TAG             -99
    7979
    80 /*---------------------------------------------------------------------------*/
     80
    8181/**
    8282 * Checks if given collection path is already present in report structure and
     
    124124}
    125125
    126 /*---------------------------------------------------------------------------*/
     126
    127127/**
    128128 * Initialize the report descriptor parser structure
     
    147147}
    148148
    149 /*---------------------------------------------------------------------------*/
     149
    150150
    151151/**
     
    314314        return EOK;
    315315}
    316 /*---------------------------------------------------------------------------*/
     316
    317317/**
    318318 * Finds description of report with given report_id and of given type in
     
    348348        return NULL;
    349349}
    350 /*---------------------------------------------------------------------------*/
     350
    351351
    352352/** Parse HID report descriptor.
     
    536536}
    537537
    538 /*---------------------------------------------------------------------------*/
     538
    539539
    540540/**
     
    871871        return EOK;
    872872}
    873 /*---------------------------------------------------------------------------*/
     873
    874874
    875875/**
     
    892892        return result;
    893893}
    894 /*---------------------------------------------------------------------------*/
     894
    895895
    896896/**
     
    941941
    942942}
    943 /*---------------------------------------------------------------------------*/
     943
    944944
    945945/**
     
    972972        }
    973973}
    974 /*---------------------------------------------------------------------------*/
     974
    975975
    976976
     
    10221022        return;
    10231023}
    1024 /*---------------------------------------------------------------------------*/
     1024
    10251025
    10261026/**
  • uspace/lib/usbhid/src/hidparser.c

    r76fbd9a ra76b01b4  
    4141#include <assert.h>
    4242
    43 /*---------------------------------------------------------------------------*/
     43
    4444/*
    4545 * Data translation private functions
     
    5252        int32_t value);
    5353
    54 /*---------------------------------------------------------------------------*/
     54
    5555
    5656static int usb_pow(int a, int b)
     
    6868        }
    6969}
    70 /*---------------------------------------------------------------------------*/
     70
    7171
    7272/** Returns size of report of specified report id and type in items
     
    117117        }
    118118}
    119 /*---------------------------------------------------------------------------*/
     119
    120120
    121121/** Parse and act upon a HID report.
     
    192192}
    193193
    194 /*---------------------------------------------------------------------------*/
     194
    195195/**
    196196 * Translate data from the report as specified in report descriptor item
     
    274274}
    275275
    276 /*---------------------------------------------------------------------------*/
     276
    277277/* OUTPUT API */
    278278
     
    431431}
    432432
    433 /*---------------------------------------------------------------------------*/
     433
    434434/**
    435435 * Translate given data for putting them into the outoput report
     
    476476}
    477477
    478 /*---------------------------------------------------------------------------*/
     478
    479479/**
    480480 * Clones given state table
     
    497497}
    498498
    499 /*---------------------------------------------------------------------------*/
     499
    500500/**
    501501 * Function for sequence walking through the report. Returns next field in the
     
    552552}
    553553
    554 /*---------------------------------------------------------------------------*/
     554
    555555/**
    556556 * Returns next report_id of report of specified type. If zero is given than
     
    600600}
    601601
    602 /*---------------------------------------------------------------------------*/
     602
    603603/**
    604604 * Reset all local items in given state table
  • uspace/lib/usbhid/src/hidpath.c

    r76fbd9a ra76b01b4  
    4141#include <assert.h>
    4242
    43 /*---------------------------------------------------------------------------*/
     43
    4444/**
    4545 * Compares two usages if they are same or not or one of the usages is not
     
    6363        ((page1 == page2) || (page1 == 0) || (page2 == 0))
    6464
    65 /*---------------------------------------------------------------------------*/
     65
    6666/**
    6767 * Appends one item (couple of usage_path and usage) into the usage path
     
    9393}
    9494
    95 /*---------------------------------------------------------------------------*/
     95
    9696/**
    9797 * Removes last item from the usage path structure
     
    114114}
    115115
    116 /*---------------------------------------------------------------------------*/
     116
    117117/**
    118118 * Nulls last item of the usage path structure.
     
    133133}
    134134
    135 /*---------------------------------------------------------------------------*/
     135
    136136/**
    137137 * Modifies last item of usage path structure by given usage page or usage
     
    164164}
    165165
    166 /*---------------------------------------------------------------------------*/
     166
    167167/**
    168168 *
     
    188188}
    189189
    190 /*---------------------------------------------------------------------------*/
     190
    191191/**
    192192 * Compares two usage paths structures
     
    354354}
    355355
    356 /*---------------------------------------------------------------------------*/
     356
    357357/**
    358358 * Allocates and initializes new usage path structure.
     
    376376}
    377377
    378 /*---------------------------------------------------------------------------*/
     378
    379379/**
    380380 * Releases given usage path structure.
     
    395395}
    396396
    397 /*---------------------------------------------------------------------------*/
     397
    398398/**
    399399 * Clone content of given usage path to the new one
     
    441441}
    442442
    443 /*---------------------------------------------------------------------------*/
     443
    444444/**
    445445 * Sets report id in usage path structure
  • uspace/lib/usbhid/src/hidreport.c

    r76fbd9a ra76b01b4  
    161161}
    162162
    163 /*----------------------------------------------------------------------------*/
     163
    164164
    165165int usb_hid_process_report_descriptor(usb_device_t *dev,
  • uspace/lib/usbhid/src/hidreq.c

    r76fbd9a ra76b01b4  
    4545#include <usb/hid/request.h>
    4646
    47 /*----------------------------------------------------------------------------*/
     47
    4848/**
    4949 * Send Set Report request to the HID device.
     
    9797}
    9898
    99 /*----------------------------------------------------------------------------*/
     99
    100100/**
    101101 * Send Set Protocol request to the HID device.
     
    145145}
    146146
    147 /*----------------------------------------------------------------------------*/
     147
    148148/**
    149149 * Send Set Idle request to the HID device.
     
    195195}
    196196
    197 /*----------------------------------------------------------------------------*/
     197
    198198/**
    199199 * Send Get Report request to the HID device.
     
    251251}
    252252
    253 /*----------------------------------------------------------------------------*/
     253
    254254/**
    255255 * Send Get Protocol request to the HID device.
     
    310310}
    311311
    312 /*----------------------------------------------------------------------------*/
     312
    313313/**
    314314 * Send Get Idle request to the HID device.
     
    373373}
    374374
    375 /*----------------------------------------------------------------------------*/
     375
    376376
    377377/**
  • uspace/lib/usbhost/include/usb/host/hcd.h

    r76fbd9a ra76b01b4  
    6161        void (*ep_remove_hook)(hcd_t *, endpoint_t *);
    6262};
    63 /*----------------------------------------------------------------------------*/
     63
    6464/** Initialize hcd_t structure.
    6565 * Initializes device and endpoint managers. Sets data and hook pointer to NULL.
     
    7979        hcd->ep_remove_hook = NULL;
    8080}
    81 /*----------------------------------------------------------------------------*/
     81
    8282/** Check registered endpoints and reset toggle bit if necessary.
    8383 * @param hcd hcd_t structure, non-null.
     
    9292            &hcd->ep_manager, target, (const uint8_t *)setup_data);
    9393}
    94 /*----------------------------------------------------------------------------*/
     94
    9595/** Data retrieve wrapper.
    9696 * @param fun ddf function, non-null.
     
    102102        return fun->driver_data;
    103103}
    104 /*----------------------------------------------------------------------------*/
     104
    105105extern usbhc_iface_t hcd_iface;
    106106
  • uspace/lib/usbhost/include/usb/host/usb_transfer_batch.h

    r76fbd9a ra76b01b4  
    115115void usb_transfer_batch_finish_error(const usb_transfer_batch_t *instance,
    116116    const void* data, size_t size, int error);
    117 /*----------------------------------------------------------------------------*/
     117
    118118/** Finish batch using stored error value and transferred size.
    119119 *
     
    128128            instance, data, instance->transfered_size, instance->error);
    129129}
    130 /*----------------------------------------------------------------------------*/
     130
    131131/** Determine batch direction based on the callbacks present
    132132 * @param[in] instance Batch structure to use, non-null.
  • uspace/lib/usbhost/src/endpoint.c

    r76fbd9a ra76b01b4  
    7272        return instance;
    7373}
    74 /*----------------------------------------------------------------------------*/
     74
    7575/** Properly dispose of endpoint_t structure.
    7676 * @param instance endpoint_t structure.
     
    8484        free(instance);
    8585}
    86 /*----------------------------------------------------------------------------*/
     86
    8787/** Set device specific data and hooks.
    8888 * @param instance endpoint_t structure.
     
    101101        fibril_mutex_unlock(&instance->guard);
    102102}
    103 /*----------------------------------------------------------------------------*/
     103
    104104/** Clear device specific data and hooks.
    105105 * @param instance endpoint_t structure.
     
    115115        fibril_mutex_unlock(&instance->guard);
    116116}
    117 /*----------------------------------------------------------------------------*/
     117
    118118/** Mark the endpoint as active and block access for further fibrils.
    119119 * @param instance endpoint_t structure.
     
    128128        fibril_mutex_unlock(&instance->guard);
    129129}
    130 /*----------------------------------------------------------------------------*/
     130
    131131/** Mark the endpoint as inactive and allow access for further fibrils.
    132132 * @param instance endpoint_t structure.
     
    140140        fibril_condvar_signal(&instance->avail);
    141141}
    142 /*----------------------------------------------------------------------------*/
     142
    143143/** Get the value of toggle bit.
    144144 * @param instance endpoint_t structure.
     
    156156        return ret;
    157157}
    158 /*----------------------------------------------------------------------------*/
     158
    159159/** Set the value of toggle bit.
    160160 * @param instance endpoint_t structure.
  • uspace/lib/usbhost/src/iface.c

    r76fbd9a ra76b01b4  
    9898        return ret;
    9999}
    100 /*----------------------------------------------------------------------------*/
     100
    101101/** Calls ep_add_hook upon endpoint registration.
    102102 * @param ep Endpoint to be registered.
     
    113113        return EOK;
    114114}
    115 /*----------------------------------------------------------------------------*/
     115
    116116/** Calls ep_remove_hook upon endpoint removal.
    117117 * @param ep Endpoint to be unregistered.
     
    126126                hcd->ep_remove_hook(hcd, ep);
    127127}
    128 /*----------------------------------------------------------------------------*/
     128
    129129/** Calls ep_remove_hook upon endpoint removal. Prints warning.
    130130 * @param ep Endpoint to be unregistered.
     
    141141                hcd->ep_remove_hook(hcd, ep);
    142142}
    143 /*----------------------------------------------------------------------------*/
     143
    144144/** Request address interface function.
    145145 *
     
    164164            &hcd->dev_manager, address, strict, speed);
    165165}
    166 /*----------------------------------------------------------------------------*/
     166
    167167/** Bind address interface function.
    168168 *
     
    183183            &hcd->dev_manager, address, handle);
    184184}
    185 /*----------------------------------------------------------------------------*/
     185
    186186/** Find device handle by address interface function.
    187187 *
     
    200200            &hcd->dev_manager, address, handle, NULL);
    201201}
    202 /*----------------------------------------------------------------------------*/
     202
    203203/** Release address interface function.
    204204 *
     
    218218        return EOK;
    219219}
    220 /*----------------------------------------------------------------------------*/
     220
    221221/** Register endpoint interface function.
    222222 * @param fun DDF function.
     
    254254            register_helper, hcd);
    255255}
    256 /*----------------------------------------------------------------------------*/
     256
    257257/** Unregister endpoint interface function.
    258258 * @param fun DDF function.
     
    274274            endpoint, direction, unregister_helper, hcd);
    275275}
    276 /*----------------------------------------------------------------------------*/
     276
    277277/** Inbound communication interface function.
    278278 * @param fun DDF function.
     
    292292            setup_data, callback, NULL, arg, "READ");
    293293}
    294 /*----------------------------------------------------------------------------*/
     294
    295295/** Outbound communication interface function.
    296296 * @param fun DDF function.
     
    310310            setup_data, NULL, callback, arg, "WRITE");
    311311}
    312 /*----------------------------------------------------------------------------*/
     312
    313313/** usbhc Interface implementation using hcd_t from libusbhost library. */
    314314usbhc_iface_t hcd_iface = {
  • uspace/lib/usbhost/src/usb_device_manager.c

    r76fbd9a ra76b01b4  
    6161        return new_address;
    6262}
    63 /*----------------------------------------------------------------------------*/
     63
    6464/** Initialize device manager structure.
    6565 *
     
    8282        fibril_mutex_initialize(&instance->guard);
    8383}
    84 /*----------------------------------------------------------------------------*/
     84
    8585/** Request USB address.
    8686 * @param instance usb_device_manager
     
    124124        return EOK;
    125125}
    126 /*----------------------------------------------------------------------------*/
     126
    127127/** Bind USB address to devman handle.
    128128 *
     
    156156        return EOK;
    157157}
    158 /*----------------------------------------------------------------------------*/
     158
    159159/** Release used USB address.
    160160 *
     
    182182        return EOK;
    183183}
    184 /*----------------------------------------------------------------------------*/
     184
    185185/** Find USB address associated with the device.
    186186 *
     
    205205        return ENOENT;
    206206}
    207 /*----------------------------------------------------------------------------*/
     207
    208208/** Find devman handle and speed assigned to USB address.
    209209 *
  • uspace/lib/usbhost/src/usb_endpoint_manager.c

    r76fbd9a ra76b01b4  
    6161            && (address == ep->address);
    6262}
    63 /*----------------------------------------------------------------------------*/
     63
    6464/** Get list that holds endpoints for given address.
    6565 * @param instance usb_endpoint_manager structure, non-null.
     
    7373        return &instance->endpoint_lists[addr % ENDPOINT_LIST_COUNT];
    7474}
    75 /*----------------------------------------------------------------------------*/
     75
    7676/** Internal search function, works on locked structure.
    7777 * @param instance usb_endpoint_manager structure, non-null.
     
    9797        return NULL;
    9898}
    99 /*----------------------------------------------------------------------------*/
     99
    100100/** Calculate bandwidth that needs to be reserved for communication with EP.
    101101 * Calculation follows USB 1.1 specification.
     
    145145        }
    146146}
    147 /*----------------------------------------------------------------------------*/
     147
    148148/** Initialize to default state.
    149149 * You need to provide valid bw_count function if you plan to use
     
    168168        return EOK;
    169169}
    170 /*----------------------------------------------------------------------------*/
     170
    171171/** Check setup packet data for signs of toggle reset.
    172172 *
     
    227227        }
    228228}
    229 /*----------------------------------------------------------------------------*/
     229
    230230/** Register endpoint structure.
    231231 * Checks for duplicates.
     
    262262        return EOK;
    263263}
    264 /*----------------------------------------------------------------------------*/
     264
    265265/** Unregister endpoint structure.
    266266 * Checks for duplicates.
     
    286286        return EOK;
    287287}
    288 /*----------------------------------------------------------------------------*/
     288
    289289/** Find endpoint_t representing the given communication route.
    290290 * @param instance usb_endpoint_manager, non-null.
     
    301301        return ep;
    302302}
    303 /*----------------------------------------------------------------------------*/
     303
    304304/** Create and register new endpoint_t structure.
    305305 * @param instance usb_endpoint_manager structure, non-null.
     
    364364        return EOK;
    365365}
    366 /*----------------------------------------------------------------------------*/
     366
    367367/** Unregister and destroy endpoint_t structure representing given route.
    368368 * @param instance usb_endpoint_manager structure, non-null.
     
    395395        return EOK;
    396396}
    397 /*----------------------------------------------------------------------------*/
     397
    398398/** Unregister and destroy all endpoints using given address.
    399399 * @param instance usb_endpoint_manager structure, non-null.
  • uspace/lib/usbhost/src/usb_transfer_batch.c

    r76fbd9a ra76b01b4  
    9696        return instance;
    9797}
    98 /*----------------------------------------------------------------------------*/
     98
    9999/** Correctly dispose all used data structures.
    100100 *
     
    116116        free(instance);
    117117}
    118 /*----------------------------------------------------------------------------*/
     118
    119119/** Prepare data and call the right callback.
    120120 *
Note: See TracChangeset for help on using the changeset viewer.