Changeset b9fa0a9 in mainline for uspace/drv/uhci-hcd/iface.c


Ignore:
Timestamp:
2011-03-21T23:33:19Z (14 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
87644b4
Parents:
1c6a45f
Message:

80-column fixes

File:
1 edited

Legend:

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

    r1c6a45f rb9fa0a9  
    7878 * @return Error code.
    7979 */
    80 static int request_address(ddf_fun_t *fun, usb_speed_t speed,
    81     usb_address_t *address)
     80static int request_address(
     81    ddf_fun_t *fun, usb_speed_t speed, usb_address_t *address)
    8282{
    8383        assert(fun);
     
    139139 * @return Error code.
    140140 */
    141 static int interrupt_out(ddf_fun_t *fun, usb_target_t target,
    142     size_t max_packet_size, void *data, size_t size,
    143     usbhc_iface_transfer_out_callback_t callback, void *arg)
    144 {
    145         assert(fun);
    146         hc_t *hc = fun_to_hc(fun);
    147         assert(hc);
    148         usb_speed_t speed = usb_device_keeper_get_speed(&hc->manager, target.address);
     141static int interrupt_out(
     142    ddf_fun_t *fun, usb_target_t target, size_t max_packet_size, void *data,
     143    size_t size, usbhc_iface_transfer_out_callback_t callback, void *arg)
     144{
     145        assert(fun);
     146        hc_t *hc = fun_to_hc(fun);
     147        assert(hc);
     148        usb_speed_t speed =
     149            usb_device_keeper_get_speed(&hc->manager, target.address);
    149150
    150151        usb_log_debug("Interrupt OUT %d:%d %zu(%zu).\n",
    151152            target.address, target.endpoint, size, max_packet_size);
    152153
    153         usb_transfer_batch_t *batch = batch_get(fun, target, USB_TRANSFER_INTERRUPT,
    154             max_packet_size, speed, data, size, NULL, 0, NULL, callback, arg,
    155             &hc->manager);
     154        usb_transfer_batch_t *batch =
     155            batch_get(fun, target, USB_TRANSFER_INTERRUPT, max_packet_size,
     156                speed, data, size, NULL, 0, NULL, callback, arg, &hc->manager);
    156157        if (!batch)
    157158                return ENOMEM;
     
    160161        if (ret != EOK) {
    161162                batch_dispose(batch);
    162                 return ret;
    163         }
    164         return EOK;
     163        }
     164        return ret;
    165165}
    166166/*----------------------------------------------------------------------------*/
     
    176176 * @return Error code.
    177177 */
    178 static int interrupt_in(ddf_fun_t *fun, usb_target_t target,
    179     size_t max_packet_size, void *data, size_t size,
    180     usbhc_iface_transfer_in_callback_t callback, void *arg)
    181 {
    182         assert(fun);
    183         hc_t *hc = fun_to_hc(fun);
    184         assert(hc);
    185         usb_speed_t speed = usb_device_keeper_get_speed(&hc->manager, target.address);
     178static int interrupt_in(
     179    ddf_fun_t *fun, usb_target_t target, size_t max_packet_size, void *data,
     180    size_t size, usbhc_iface_transfer_in_callback_t callback, void *arg)
     181{
     182        assert(fun);
     183        hc_t *hc = fun_to_hc(fun);
     184        assert(hc);
     185        usb_speed_t speed =
     186            usb_device_keeper_get_speed(&hc->manager, target.address);
    186187        usb_log_debug("Interrupt IN %d:%d %zu(%zu).\n",
    187188            target.address, target.endpoint, size, max_packet_size);
    188189
    189         usb_transfer_batch_t *batch = batch_get(fun, target, USB_TRANSFER_INTERRUPT,
    190             max_packet_size, speed, data, size, NULL, 0, callback, NULL, arg,
    191             &hc->manager);
     190        usb_transfer_batch_t *batch =
     191            batch_get(fun, target, USB_TRANSFER_INTERRUPT, max_packet_size,
     192                speed, data, size, NULL, 0, callback, NULL, arg, &hc->manager);
    192193        if (!batch)
    193194                return ENOMEM;
     
    196197        if (ret != EOK) {
    197198                batch_dispose(batch);
    198                 return ret;
    199         }
    200         return EOK;
     199        }
     200        return ret;
    201201}
    202202/*----------------------------------------------------------------------------*/
     
    212212 * @return Error code.
    213213 */
    214 static int bulk_out(ddf_fun_t *fun, usb_target_t target,
    215     size_t max_packet_size, void *data, size_t size,
    216     usbhc_iface_transfer_out_callback_t callback, void *arg)
    217 {
    218         assert(fun);
    219         hc_t *hc = fun_to_hc(fun);
    220         assert(hc);
    221         usb_speed_t speed = usb_device_keeper_get_speed(&hc->manager, target.address);
     214static int bulk_out(
     215    ddf_fun_t *fun, usb_target_t target, size_t max_packet_size, void *data,
     216    size_t size, usbhc_iface_transfer_out_callback_t callback, void *arg)
     217{
     218        assert(fun);
     219        hc_t *hc = fun_to_hc(fun);
     220        assert(hc);
     221        usb_speed_t speed =
     222            usb_device_keeper_get_speed(&hc->manager, target.address);
    222223
    223224        usb_log_debug("Bulk OUT %d:%d %zu(%zu).\n",
    224225            target.address, target.endpoint, size, max_packet_size);
    225226
    226         usb_transfer_batch_t *batch = batch_get(fun, target, USB_TRANSFER_BULK,
    227             max_packet_size, speed, data, size, NULL, 0, NULL, callback, arg,
    228             &hc->manager);
     227        usb_transfer_batch_t *batch =
     228            batch_get(fun, target, USB_TRANSFER_BULK, max_packet_size, speed,
     229                data, size, NULL, 0, NULL, callback, arg, &hc->manager);
    229230        if (!batch)
    230231                return ENOMEM;
     
    233234        if (ret != EOK) {
    234235                batch_dispose(batch);
    235                 return ret;
    236         }
    237         return EOK;
     236        }
     237        return ret;
    238238}
    239239/*----------------------------------------------------------------------------*/
     
    249249 * @return Error code.
    250250 */
    251 static int bulk_in(ddf_fun_t *fun, usb_target_t target,
    252     size_t max_packet_size, void *data, size_t size,
    253     usbhc_iface_transfer_in_callback_t callback, void *arg)
    254 {
    255         assert(fun);
    256         hc_t *hc = fun_to_hc(fun);
    257         assert(hc);
    258         usb_speed_t speed = usb_device_keeper_get_speed(&hc->manager, target.address);
     251static int bulk_in(
     252    ddf_fun_t *fun, usb_target_t target, size_t max_packet_size, void *data,
     253    size_t size, usbhc_iface_transfer_in_callback_t callback, void *arg)
     254{
     255        assert(fun);
     256        hc_t *hc = fun_to_hc(fun);
     257        assert(hc);
     258        usb_speed_t speed =
     259            usb_device_keeper_get_speed(&hc->manager, target.address);
    259260        usb_log_debug("Bulk IN %d:%d %zu(%zu).\n",
    260261            target.address, target.endpoint, size, max_packet_size);
    261262
    262         usb_transfer_batch_t *batch = batch_get(fun, target, USB_TRANSFER_BULK,
    263             max_packet_size, speed, data, size, NULL, 0, callback, NULL, arg,
    264             &hc->manager);
     263        usb_transfer_batch_t *batch =
     264            batch_get(fun, target, USB_TRANSFER_BULK, max_packet_size, speed,
     265                data, size, NULL, 0, callback, NULL, arg, &hc->manager);
    265266        if (!batch)
    266267                return ENOMEM;
     
    269270        if (ret != EOK) {
    270271                batch_dispose(batch);
    271                 return ret;
    272         }
    273         return EOK;
     272        }
     273        return ret;
    274274}
    275275/*----------------------------------------------------------------------------*/
     
    287287 * @return Error code.
    288288 */
    289 static int control_write(ddf_fun_t *fun, usb_target_t target,
    290     size_t max_packet_size,
     289static int control_write(
     290    ddf_fun_t *fun, usb_target_t target, size_t max_packet_size,
    291291    void *setup_data, size_t setup_size, void *data, size_t size,
    292292    usbhc_iface_transfer_out_callback_t callback, void *arg)
     
    295295        hc_t *hc = fun_to_hc(fun);
    296296        assert(hc);
    297         usb_speed_t speed = usb_device_keeper_get_speed(&hc->manager, target.address);
     297        usb_speed_t speed =
     298            usb_device_keeper_get_speed(&hc->manager, target.address);
    298299        usb_log_debug("Control WRITE (%d) %d:%d %zu(%zu).\n",
    299300            speed, target.address, target.endpoint, size, max_packet_size);
     
    302303                return EINVAL;
    303304
    304         usb_transfer_batch_t *batch = batch_get(fun, target, USB_TRANSFER_CONTROL,
    305             max_packet_size, speed, data, size, setup_data, setup_size,
    306             NULL, callback, arg, &hc->manager);
     305        usb_transfer_batch_t *batch =
     306            batch_get(fun, target, USB_TRANSFER_CONTROL, max_packet_size, speed,
     307                data, size, setup_data, setup_size, NULL, callback, arg,
     308                &hc->manager);
    307309        if (!batch)
    308310                return ENOMEM;
     
    312314        if (ret != EOK) {
    313315                batch_dispose(batch);
    314                 return ret;
    315         }
    316         return EOK;
     316        }
     317        return ret;
    317318}
    318319/*----------------------------------------------------------------------------*/
     
    330331 * @return Error code.
    331332 */
    332 static int control_read(ddf_fun_t *fun, usb_target_t target,
    333     size_t max_packet_size,
     333static int control_read(
     334    ddf_fun_t *fun, usb_target_t target, size_t max_packet_size,
    334335    void *setup_data, size_t setup_size, void *data, size_t size,
    335336    usbhc_iface_transfer_in_callback_t callback, void *arg)
     
    338339        hc_t *hc = fun_to_hc(fun);
    339340        assert(hc);
    340         usb_speed_t speed = usb_device_keeper_get_speed(&hc->manager, target.address);
     341        usb_speed_t speed =
     342            usb_device_keeper_get_speed(&hc->manager, target.address);
    341343
    342344        usb_log_debug("Control READ(%d) %d:%d %zu(%zu).\n",
    343345            speed, target.address, target.endpoint, size, max_packet_size);
    344         usb_transfer_batch_t *batch = batch_get(fun, target, USB_TRANSFER_CONTROL,
    345             max_packet_size, speed, data, size, setup_data, setup_size, callback,
    346             NULL, arg, &hc->manager);
     346        usb_transfer_batch_t *batch =
     347            batch_get(fun, target, USB_TRANSFER_CONTROL, max_packet_size, speed,
     348                data, size, setup_data, setup_size, callback, NULL, arg,
     349                &hc->manager);
    347350        if (!batch)
    348351                return ENOMEM;
     
    351354        if (ret != EOK) {
    352355                batch_dispose(batch);
    353                 return ret;
    354         }
    355         return EOK;
     356        }
     357        return ret;
    356358}
    357359/*----------------------------------------------------------------------------*/
Note: See TracChangeset for help on using the changeset viewer.