Changes in / [5971dd3:7102aa5] in mainline


Ignore:
Location:
uspace
Files:
3 added
2 deleted
45 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/usbinfo/dev.c

    r5971dd3 r7102aa5  
    5959        }
    6060
    61         rc = usb_endpoint_pipe_initialize_default_control(&dev->ctrl_pipe,
     61        rc = usb_pipe_initialize_default_control(&dev->ctrl_pipe,
    6262            &dev->wire);
    6363        if (rc != EOK) {
     
    6868        }
    6969
    70         rc = usb_endpoint_pipe_probe_default_control(&dev->ctrl_pipe);
     70        rc = usb_pipe_probe_default_control(&dev->ctrl_pipe);
    7171        if (rc != EOK) {
    7272                fprintf(stderr,
     
    7676        }
    7777
    78         rc = usb_endpoint_pipe_start_session(&dev->ctrl_pipe);
     78        rc = usb_pipe_start_session(&dev->ctrl_pipe);
    7979        if (rc != EOK) {
    8080                fprintf(stderr,
     
    107107
    108108leave:
    109         if (usb_endpoint_pipe_is_session_started(&dev->ctrl_pipe)) {
    110                 usb_endpoint_pipe_end_session(&dev->ctrl_pipe);
     109        if (usb_pipe_is_session_started(&dev->ctrl_pipe)) {
     110                usb_pipe_end_session(&dev->ctrl_pipe);
    111111        }
    112112
     
    118118void destroy_device(usbinfo_device_t *dev)
    119119{
    120         usb_endpoint_pipe_end_session(&dev->ctrl_pipe);
     120        usb_pipe_end_session(&dev->ctrl_pipe);
    121121        free(dev);
    122122}
  • uspace/app/usbinfo/usbinfo.h

    r5971dd3 r7102aa5  
    4444
    4545typedef struct {
    46         usb_endpoint_pipe_t ctrl_pipe;
     46        usb_pipe_t ctrl_pipe;
    4747        usb_device_connection_t wire;
    4848        usb_standard_device_descriptor_t device_descriptor;
  • uspace/drv/ohci/batch.c

    r5971dd3 r7102aa5  
    4141#include "utils/malloc32.h"
    4242
    43 static void batch_call_in_and_dispose(batch_t *instance);
    44 static void batch_call_out_and_dispose(batch_t *instance);
     43static void batch_call_in_and_dispose(usb_transfer_batch_t *instance);
     44static void batch_call_out_and_dispose(usb_transfer_batch_t *instance);
    4545
    4646#define DEFAULT_ERROR_COUNT 3
    47 batch_t * batch_get(
     47usb_transfer_batch_t * batch_get(
    4848    ddf_fun_t *fun,
    4949                usb_target_t target,
     
    5858    usbhc_iface_transfer_out_callback_t func_out,
    5959                void *arg,
    60                 device_keeper_t *manager
     60                usb_device_keeper_t *manager
    6161                )
    6262{
     
    7070        } else (void)0
    7171
    72         batch_t *instance = malloc(sizeof(batch_t));
     72        usb_transfer_batch_t *instance = malloc(sizeof(usb_transfer_batch_t));
    7373        CHECK_NULL_DISPOSE_RETURN(instance,
    7474            "Failed to allocate batch instance.\n");
    75         batch_init(instance, target, transfer_type, speed, max_packet_size,
     75        usb_transfer_batch_init(instance, target, transfer_type, speed, max_packet_size,
    7676            buffer, NULL, buffer_size, NULL, setup_size, func_in,
    7777            func_out, arg, fun, NULL);
     
    9494}
    9595/*----------------------------------------------------------------------------*/
    96 void batch_dispose(batch_t *instance)
     96void batch_dispose(usb_transfer_batch_t *instance)
    9797{
    9898        assert(instance);
     
    102102}
    103103/*----------------------------------------------------------------------------*/
    104 void batch_control_write(batch_t *instance)
     104void batch_control_write(usb_transfer_batch_t *instance)
    105105{
    106106        assert(instance);
     
    113113}
    114114/*----------------------------------------------------------------------------*/
    115 void batch_control_read(batch_t *instance)
     115void batch_control_read(usb_transfer_batch_t *instance)
    116116{
    117117        assert(instance);
     
    121121}
    122122/*----------------------------------------------------------------------------*/
    123 void batch_interrupt_in(batch_t *instance)
     123void batch_interrupt_in(usb_transfer_batch_t *instance)
    124124{
    125125        assert(instance);
     
    130130}
    131131/*----------------------------------------------------------------------------*/
    132 void batch_interrupt_out(batch_t *instance)
     132void batch_interrupt_out(usb_transfer_batch_t *instance)
    133133{
    134134        assert(instance);
     
    142142}
    143143/*----------------------------------------------------------------------------*/
    144 void batch_bulk_in(batch_t *instance)
     144void batch_bulk_in(usb_transfer_batch_t *instance)
    145145{
    146146        assert(instance);
     
    151151}
    152152/*----------------------------------------------------------------------------*/
    153 void batch_bulk_out(batch_t *instance)
     153void batch_bulk_out(usb_transfer_batch_t *instance)
    154154{
    155155        assert(instance);
     
    164164 * @param[in] instance Batch structure to use.
    165165 */
    166 void batch_call_in_and_dispose(batch_t *instance)
     166void batch_call_in_and_dispose(usb_transfer_batch_t *instance)
    167167{
    168168        assert(instance);
    169         batch_call_in(instance);
     169        usb_transfer_batch_call_in(instance);
    170170        batch_dispose(instance);
    171171}
     
    175175 * @param[in] instance Batch structure to use.
    176176 */
    177 void batch_call_out_and_dispose(batch_t *instance)
     177void batch_call_out_and_dispose(usb_transfer_batch_t *instance)
    178178{
    179179        assert(instance);
    180         batch_call_out(instance);
     180        usb_transfer_batch_call_out(instance);
    181181        batch_dispose(instance);
    182182}
  • uspace/drv/ohci/batch.h

    r5971dd3 r7102aa5  
    4141#include <usb/host/batch.h>
    4242
    43 batch_t * batch_get(
     43usb_transfer_batch_t * batch_get(
    4444    ddf_fun_t *fun,
    4545                usb_target_t target,
     
    5454    usbhc_iface_transfer_out_callback_t func_out,
    5555                void *arg,
    56                 device_keeper_t *manager
     56                usb_device_keeper_t *manager
    5757                );
    5858
    59 void batch_dispose(batch_t *instance);
     59void batch_dispose(usb_transfer_batch_t *instance);
    6060
    61 void batch_control_write(batch_t *instance);
     61void batch_control_write(usb_transfer_batch_t *instance);
    6262
    63 void batch_control_read(batch_t *instance);
     63void batch_control_read(usb_transfer_batch_t *instance);
    6464
    65 void batch_interrupt_in(batch_t *instance);
     65void batch_interrupt_in(usb_transfer_batch_t *instance);
    6666
    67 void batch_interrupt_out(batch_t *instance);
     67void batch_interrupt_out(usb_transfer_batch_t *instance);
    6868
    69 void batch_bulk_in(batch_t *instance);
     69void batch_bulk_in(usb_transfer_batch_t *instance);
    7070
    71 void batch_bulk_out(batch_t *instance);
     71void batch_bulk_out(usb_transfer_batch_t *instance);
    7272#endif
    7373/**
  • uspace/drv/ohci/hc.c

    r5971dd3 r7102aa5  
    6060        }
    6161        instance->ddf_instance = fun;
    62         device_keeper_init(&instance->manager);
     62        usb_device_keeper_init(&instance->manager);
    6363
    6464        if (!interrupts) {
     
    111111}
    112112/*----------------------------------------------------------------------------*/
    113 int hc_schedule(hc_t *instance, batch_t *batch)
     113int hc_schedule(hc_t *instance, usb_transfer_batch_t *batch)
    114114{
    115115        assert(instance);
  • uspace/drv/ohci/hc.h

    r5971dd3 r7102aa5  
    5353        rh_t rh;
    5454        ddf_fun_t *ddf_instance;
    55         device_keeper_t manager;
     55        usb_device_keeper_t manager;
    5656        fid_t interrupt_emulator;
    5757} hc_t;
     
    6262int hc_register_hub(hc_t *instance);
    6363
    64 int hc_schedule(hc_t *instance, batch_t *batch);
     64int hc_schedule(hc_t *instance, usb_transfer_batch_t *batch);
    6565
    6666void hc_interrupt(hc_t *instance, uint32_t status);
  • uspace/drv/ohci/iface.c

    r5971dd3 r7102aa5  
    6464  assert(hc);
    6565  usb_log_debug("Default address request with speed %d.\n", speed);
    66   device_keeper_reserve_default(&hc->manager, speed);
     66  usb_device_keeper_reserve_default_address(&hc->manager, speed);
    6767  return EOK;
    6868}
     
    7979  assert(hc);
    8080  usb_log_debug("Default address release.\n");
    81   device_keeper_release_default(&hc->manager);
     81  usb_device_keeper_release_default_address(&hc->manager);
    8282  return EOK;
    8383}
     
    9999
    100100  usb_log_debug("Address request with speed %d.\n", speed);
    101   *address = device_keeper_request(&hc->manager, speed);
     101  *address = device_keeper_get_free_address(&hc->manager, speed);
    102102  usb_log_debug("Address request with result: %d.\n", *address);
    103103  if (*address <= 0)
     
    120120  assert(hc);
    121121  usb_log_debug("Address bind %d-%d.\n", address, handle);
    122   device_keeper_bind(&hc->manager, address, handle);
     122  usb_device_keeper_bind(&hc->manager, address, handle);
    123123  return EOK;
    124124}
     
    136136  assert(hc);
    137137  usb_log_debug("Address release %d.\n", address);
    138   device_keeper_release(&hc->manager, address);
     138  usb_device_keeper_release(&hc->manager, address);
    139139  return EOK;
    140140}
     
    200200  hc_t *hc = fun_to_hc(fun);
    201201  assert(hc);
    202   usb_speed_t speed = device_keeper_speed(&hc->manager, target.address);
     202  usb_speed_t speed = usb_device_keeper_get_speed(&hc->manager, target.address);
    203203
    204204  usb_log_debug("Interrupt OUT %d:%d %zu(%zu).\n",
    205205      target.address, target.endpoint, size, max_packet_size);
    206206
    207   batch_t *batch = batch_get(fun, target, USB_TRANSFER_INTERRUPT,
     207  usb_transfer_batch_t *batch = batch_get(fun, target, USB_TRANSFER_INTERRUPT,
    208208      max_packet_size, speed, data, size, NULL, 0, NULL, callback, arg,
    209209      &hc->manager);
     
    243243  hc_t *hc = fun_to_hc(fun);
    244244  assert(hc);
    245   usb_speed_t speed = device_keeper_speed(&hc->manager, target.address);
     245  usb_speed_t speed = usb_device_keeper_get_speed(&hc->manager, target.address);
    246246  usb_log_debug("Interrupt IN %d:%d %zu(%zu).\n",
    247247      target.address, target.endpoint, size, max_packet_size);
    248248
    249   batch_t *batch = batch_get(fun, target, USB_TRANSFER_INTERRUPT,
     249  usb_transfer_batch_t *batch = batch_get(fun, target, USB_TRANSFER_INTERRUPT,
    250250      max_packet_size, speed, data, size, NULL, 0, callback, NULL, arg,
    251251      &hc->manager);
     
    285285  hc_t *hc = fun_to_hc(fun);
    286286  assert(hc);
    287   usb_speed_t speed = device_keeper_speed(&hc->manager, target.address);
     287  usb_speed_t speed = usb_device_keeper_get_speed(&hc->manager, target.address);
    288288
    289289  usb_log_debug("Bulk OUT %d:%d %zu(%zu).\n",
    290290      target.address, target.endpoint, size, max_packet_size);
    291291
    292   batch_t *batch = batch_get(fun, target, USB_TRANSFER_BULK,
     292  usb_transfer_batch_t *batch = batch_get(fun, target, USB_TRANSFER_BULK,
    293293      max_packet_size, speed, data, size, NULL, 0, NULL, callback, arg,
    294294      &hc->manager);
     
    329329  hc_t *hc = fun_to_hc(fun);
    330330  assert(hc);
    331   usb_speed_t speed = device_keeper_speed(&hc->manager, target.address);
     331  usb_speed_t speed = usb_device_keeper_get_speed(&hc->manager, target.address);
    332332  usb_log_debug("Bulk IN %d:%d %zu(%zu).\n",
    333333      target.address, target.endpoint, size, max_packet_size);
    334334
    335   batch_t *batch = batch_get(fun, target, USB_TRANSFER_BULK,
     335  usb_transfer_batch_t *batch = batch_get(fun, target, USB_TRANSFER_BULK,
    336336      max_packet_size, speed, data, size, NULL, 0, callback, NULL, arg,
    337337      &hc->manager);
     
    376376  hc_t *hc = fun_to_hc(fun);
    377377  assert(hc);
    378   usb_speed_t speed = device_keeper_speed(&hc->manager, target.address);
     378  usb_speed_t speed = usb_device_keeper_get_speed(&hc->manager, target.address);
    379379  usb_log_debug("Control WRITE (%d) %d:%d %zu(%zu).\n",
    380380      speed, target.address, target.endpoint, size, max_packet_size);
     
    383383    return EINVAL;
    384384
    385   batch_t *batch = batch_get(fun, target, USB_TRANSFER_CONTROL,
     385  usb_transfer_batch_t *batch = batch_get(fun, target, USB_TRANSFER_CONTROL,
    386386      max_packet_size, speed, data, size, setup_data, setup_size,
    387387      NULL, callback, arg, &hc->manager);
    388388  if (!batch)
    389389    return ENOMEM;
    390   device_keeper_reset_if_need(&hc->manager, target, setup_data);
     390  usb_device_keeper_reset_if_need(&hc->manager, target, setup_data);
    391391  batch_control_write(batch);
    392392  const int ret = hc_schedule(hc, batch);
     
    427427  hc_t *hc = fun_to_hc(fun);
    428428  assert(hc);
    429   usb_speed_t speed = device_keeper_speed(&hc->manager, target.address);
     429  usb_speed_t speed = usb_device_keeper_get_speed(&hc->manager, target.address);
    430430
    431431  usb_log_debug("Control READ(%d) %d:%d %zu(%zu).\n",
    432432      speed, target.address, target.endpoint, size, max_packet_size);
    433   batch_t *batch = batch_get(fun, target, USB_TRANSFER_CONTROL,
     433  usb_transfer_batch_t *batch = batch_get(fun, target, USB_TRANSFER_CONTROL,
    434434      max_packet_size, speed, data, size, setup_data, setup_size, callback,
    435435      NULL, arg, &hc->manager);
  • uspace/drv/ohci/main.c

    r5971dd3 r7102aa5  
    6161{
    6262        assert(fun);
    63         device_keeper_t *manager = &fun_to_hc(fun)->manager;
    64   usb_address_t addr = device_keeper_find(manager, handle);
     63        usb_device_keeper_t *manager = &fun_to_hc(fun)->manager;
     64  usb_address_t addr = usb_device_keeper_find(manager, handle);
    6565  if (addr < 0) {
    6666    return addr;
  • uspace/drv/ohci/root_hub.c

    r5971dd3 r7102aa5  
    5656}
    5757/*----------------------------------------------------------------------------*/
    58 int rh_request(rh_t *instance, batch_t *request)
     58int rh_request(rh_t *instance, usb_transfer_batch_t *request)
    5959{
    6060        assert(instance);
     
    6666        }
    6767        usb_log_error("Root hub request processing not implemented.\n");
    68         batch_finish(request, ENOTSUP);
     68        usb_transfer_batch_finish(request, ENOTSUP);
    6969        return EOK;
    7070}
  • uspace/drv/ohci/root_hub.h

    r5971dd3 r7102aa5  
    4949int rh_init(rh_t *instance, ddf_dev_t *dev, ohci_regs_t *regs);
    5050
    51 int rh_request(rh_t *instance, batch_t *request);
     51int rh_request(rh_t *instance, usb_transfer_batch_t *request);
    5252
    5353void rh_interrupt(rh_t *instance);
  • uspace/drv/uhci-hcd/batch.c

    r5971dd3 r7102aa5  
    5050        td_t *tds;
    5151        size_t packets;
    52         device_keeper_t *manager;
     52        usb_device_keeper_t *manager;
    5353} uhci_batch_t;
    5454
    55 static void batch_control(batch_t *instance,
     55static void batch_control(usb_transfer_batch_t *instance,
    5656    usb_packet_id data_stage, usb_packet_id status_stage);
    57 static void batch_data(batch_t *instance, usb_packet_id pid);
    58 static void batch_call_in_and_dispose(batch_t *instance);
    59 static void batch_call_out_and_dispose(batch_t *instance);
     57static void batch_data(usb_transfer_batch_t *instance, usb_packet_id pid);
     58static void batch_call_in_and_dispose(usb_transfer_batch_t *instance);
     59static void batch_call_out_and_dispose(usb_transfer_batch_t *instance);
    6060
    6161
     
    8282 * transaction and callback.
    8383 */
    84 batch_t * batch_get(ddf_fun_t *fun, usb_target_t target,
     84usb_transfer_batch_t * batch_get(ddf_fun_t *fun, usb_target_t target,
    8585    usb_transfer_type_t transfer_type, size_t max_packet_size,
    8686    usb_speed_t speed, char *buffer, size_t buffer_size,
     
    8888    usbhc_iface_transfer_in_callback_t func_in,
    8989    usbhc_iface_transfer_out_callback_t func_out, void *arg,
    90     device_keeper_t *manager
     90    usb_device_keeper_t *manager
    9191    )
    9292{
     
    103103        } else (void)0
    104104
    105         batch_t *instance = malloc(sizeof(batch_t));
     105        usb_transfer_batch_t *instance = malloc(sizeof(usb_transfer_batch_t));
    106106        CHECK_NULL_DISPOSE_RETURN(instance,
    107107            "Failed to allocate batch instance.\n");
    108         batch_init(instance, target, transfer_type, speed, max_packet_size,
     108        usb_transfer_batch_init(instance, target, transfer_type, speed, max_packet_size,
    109109            buffer, NULL, buffer_size, NULL, setup_size, func_in,
    110110            func_out, arg, fun, NULL);
     
    161161 * is reached.
    162162 */
    163 bool batch_is_complete(batch_t *instance)
     163bool batch_is_complete(usb_transfer_batch_t *instance)
    164164{
    165165        assert(instance);
     
    182182                        td_print_status(&data->tds[i]);
    183183
    184                         device_keeper_set_toggle(data->manager,
     184                        usb_device_keeper_set_toggle(data->manager,
    185185                            instance->target, instance->direction,
    186186                            td_toggle(&data->tds[i]));
     
    205205 * Uses genercir control function with pids OUT and IN.
    206206 */
    207 void batch_control_write(batch_t *instance)
     207void batch_control_write(usb_transfer_batch_t *instance)
    208208{
    209209        assert(instance);
     
    222222 * Uses generic control with pids IN and OUT.
    223223 */
    224 void batch_control_read(batch_t *instance)
     224void batch_control_read(usb_transfer_batch_t *instance)
    225225{
    226226        assert(instance);
     
    236236 * Data transaction with PID_IN.
    237237 */
    238 void batch_interrupt_in(batch_t *instance)
     238void batch_interrupt_in(usb_transfer_batch_t *instance)
    239239{
    240240        assert(instance);
     
    251251 * Data transaction with PID_OUT.
    252252 */
    253 void batch_interrupt_out(batch_t *instance)
     253void batch_interrupt_out(usb_transfer_batch_t *instance)
    254254{
    255255        assert(instance);
     
    269269 * Data transaction with PID_IN.
    270270 */
    271 void batch_bulk_in(batch_t *instance)
     271void batch_bulk_in(usb_transfer_batch_t *instance)
    272272{
    273273        assert(instance);
     
    284284 * Data transaction with PID_OUT.
    285285 */
    286 void batch_bulk_out(batch_t *instance)
     286void batch_bulk_out(usb_transfer_batch_t *instance)
    287287{
    288288        assert(instance);
     
    304304 * The last packet is marked with IOC flag.
    305305 */
    306 void batch_data(batch_t *instance, usb_packet_id pid)
     306void batch_data(usb_transfer_batch_t *instance, usb_packet_id pid)
    307307{
    308308        assert(instance);
     
    311311
    312312        const bool low_speed = instance->speed == USB_SPEED_LOW;
    313         int toggle = device_keeper_get_toggle(
     313        int toggle = usb_device_keeper_get_toggle(
    314314            data->manager, instance->target, instance->direction);
    315315        assert(toggle == 0 || toggle == 1);
     
    343343        }
    344344        td_set_ioc(&data->tds[packet - 1]);
    345         device_keeper_set_toggle(data->manager, instance->target,
     345        usb_device_keeper_set_toggle(data->manager, instance->target,
    346346            instance->direction, toggle);
    347347}
     
    358358 * The last packet is marked with IOC.
    359359 */
    360 void batch_control(batch_t *instance,
     360void batch_control(usb_transfer_batch_t *instance,
    361361   usb_packet_id data_stage, usb_packet_id status_stage)
    362362{
     
    411411}
    412412/*----------------------------------------------------------------------------*/
    413 qh_t * batch_qh(batch_t *instance)
     413qh_t * batch_qh(usb_transfer_batch_t *instance)
    414414{
    415415        assert(instance);
     
    423423 * @param[in] instance Batch structure to use.
    424424 */
    425 void batch_call_in_and_dispose(batch_t *instance)
    426 {
    427         assert(instance);
    428         batch_call_in(instance);
     425void batch_call_in_and_dispose(usb_transfer_batch_t *instance)
     426{
     427        assert(instance);
     428        usb_transfer_batch_call_in(instance);
    429429        batch_dispose(instance);
    430430}
     
    434434 * @param[in] instance Batch structure to use.
    435435 */
    436 void batch_call_out_and_dispose(batch_t *instance)
    437 {
    438         assert(instance);
    439         batch_call_out(instance);
     436void batch_call_out_and_dispose(usb_transfer_batch_t *instance)
     437{
     438        assert(instance);
     439        usb_transfer_batch_call_out(instance);
    440440        batch_dispose(instance);
    441441}
     
    445445 * @param[in] instance Batch structure to use.
    446446 */
    447 void batch_dispose(batch_t *instance)
     447void batch_dispose(usb_transfer_batch_t *instance)
    448448{
    449449        assert(instance);
  • uspace/drv/uhci-hcd/batch.h

    r5971dd3 r7102aa5  
    4444#include "uhci_struct/queue_head.h"
    4545
    46 batch_t * batch_get(
     46usb_transfer_batch_t * batch_get(
    4747    ddf_fun_t *fun,
    4848                usb_target_t target,
     
    5757    usbhc_iface_transfer_out_callback_t func_out,
    5858                void *arg,
    59                 device_keeper_t *manager
     59                usb_device_keeper_t *manager
    6060                );
    6161
    62 void batch_dispose(batch_t *instance);
     62void batch_dispose(usb_transfer_batch_t *instance);
    6363
    64 bool batch_is_complete(batch_t *instance);
     64bool batch_is_complete(usb_transfer_batch_t *instance);
    6565
    66 void batch_control_write(batch_t *instance);
     66void batch_control_write(usb_transfer_batch_t *instance);
    6767
    68 void batch_control_read(batch_t *instance);
     68void batch_control_read(usb_transfer_batch_t *instance);
    6969
    70 void batch_interrupt_in(batch_t *instance);
     70void batch_interrupt_in(usb_transfer_batch_t *instance);
    7171
    72 void batch_interrupt_out(batch_t *instance);
     72void batch_interrupt_out(usb_transfer_batch_t *instance);
    7373
    74 void batch_bulk_in(batch_t *instance);
     74void batch_bulk_in(usb_transfer_batch_t *instance);
    7575
    76 void batch_bulk_out(batch_t *instance);
     76void batch_bulk_out(usb_transfer_batch_t *instance);
    7777
    78 qh_t * batch_qh(batch_t *instance);
     78qh_t * batch_qh(usb_transfer_batch_t *instance);
    7979#endif
    8080/**
  • uspace/drv/uhci-hcd/iface.c

    r5971dd3 r7102aa5  
    5555        assert(hc);
    5656        usb_log_debug("Default address request with speed %d.\n", speed);
    57         device_keeper_reserve_default(&hc->device_manager, speed);
     57        usb_device_keeper_reserve_default_address(&hc->device_manager, speed);
    5858        return EOK;
    5959}
     
    7070        assert(hc);
    7171        usb_log_debug("Default address release.\n");
    72         device_keeper_release_default(&hc->device_manager);
     72        usb_device_keeper_release_default_address(&hc->device_manager);
    7373        return EOK;
    7474}
     
    9090
    9191        usb_log_debug("Address request with speed %d.\n", speed);
    92         *address = device_keeper_request(&hc->device_manager, speed);
     92        *address = device_keeper_get_free_address(&hc->device_manager, speed);
    9393        usb_log_debug("Address request with result: %d.\n", *address);
    9494        if (*address <= 0)
     
    111111        assert(hc);
    112112        usb_log_debug("Address bind %d-%d.\n", address, handle);
    113         device_keeper_bind(&hc->device_manager, address, handle);
     113        usb_device_keeper_bind(&hc->device_manager, address, handle);
    114114        return EOK;
    115115}
     
    127127        assert(hc);
    128128        usb_log_debug("Address release %d.\n", address);
    129         device_keeper_release(&hc->device_manager, address);
     129        usb_device_keeper_release(&hc->device_manager, address);
    130130        return EOK;
    131131}
     
    149149        uhci_hc_t *hc = fun_to_uhci_hc(fun);
    150150        assert(hc);
    151         usb_speed_t speed = device_keeper_speed(&hc->device_manager, target.address);
     151        usb_speed_t speed = usb_device_keeper_get_speed(&hc->device_manager, target.address);
    152152
    153153        usb_log_debug("Interrupt OUT %d:%d %zu(%zu).\n",
    154154            target.address, target.endpoint, size, max_packet_size);
    155155
    156         batch_t *batch = batch_get(fun, target, USB_TRANSFER_INTERRUPT,
     156        usb_transfer_batch_t *batch = batch_get(fun, target, USB_TRANSFER_INTERRUPT,
    157157            max_packet_size, speed, data, size, NULL, 0, NULL, callback, arg,
    158158            &hc->device_manager);
     
    186186        uhci_hc_t *hc = fun_to_uhci_hc(fun);
    187187        assert(hc);
    188         usb_speed_t speed = device_keeper_speed(&hc->device_manager, target.address);
     188        usb_speed_t speed = usb_device_keeper_get_speed(&hc->device_manager, target.address);
    189189        usb_log_debug("Interrupt IN %d:%d %zu(%zu).\n",
    190190            target.address, target.endpoint, size, max_packet_size);
    191191
    192         batch_t *batch = batch_get(fun, target, USB_TRANSFER_INTERRUPT,
     192        usb_transfer_batch_t *batch = batch_get(fun, target, USB_TRANSFER_INTERRUPT,
    193193            max_packet_size, speed, data, size, NULL, 0, callback, NULL, arg,
    194194                        &hc->device_manager);
     
    222222        uhci_hc_t *hc = fun_to_uhci_hc(fun);
    223223        assert(hc);
    224         usb_speed_t speed = device_keeper_speed(&hc->device_manager, target.address);
     224        usb_speed_t speed = usb_device_keeper_get_speed(&hc->device_manager, target.address);
    225225
    226226        usb_log_debug("Bulk OUT %d:%d %zu(%zu).\n",
    227227            target.address, target.endpoint, size, max_packet_size);
    228228
    229         batch_t *batch = batch_get(fun, target, USB_TRANSFER_BULK,
     229        usb_transfer_batch_t *batch = batch_get(fun, target, USB_TRANSFER_BULK,
    230230            max_packet_size, speed, data, size, NULL, 0, NULL, callback, arg,
    231231            &hc->device_manager);
     
    259259        uhci_hc_t *hc = fun_to_uhci_hc(fun);
    260260        assert(hc);
    261         usb_speed_t speed = device_keeper_speed(&hc->device_manager, target.address);
     261        usb_speed_t speed = usb_device_keeper_get_speed(&hc->device_manager, target.address);
    262262        usb_log_debug("Bulk IN %d:%d %zu(%zu).\n",
    263263            target.address, target.endpoint, size, max_packet_size);
    264264
    265         batch_t *batch = batch_get(fun, target, USB_TRANSFER_BULK,
     265        usb_transfer_batch_t *batch = batch_get(fun, target, USB_TRANSFER_BULK,
    266266            max_packet_size, speed, data, size, NULL, 0, callback, NULL, arg,
    267267            &hc->device_manager);
     
    298298        uhci_hc_t *hc = fun_to_uhci_hc(fun);
    299299        assert(hc);
    300         usb_speed_t speed = device_keeper_speed(&hc->device_manager, target.address);
     300        usb_speed_t speed = usb_device_keeper_get_speed(&hc->device_manager, target.address);
    301301        usb_log_debug("Control WRITE (%d) %d:%d %zu(%zu).\n",
    302302            speed, target.address, target.endpoint, size, max_packet_size);
     
    305305                return EINVAL;
    306306
    307         batch_t *batch = batch_get(fun, target, USB_TRANSFER_CONTROL,
     307        usb_transfer_batch_t *batch = batch_get(fun, target, USB_TRANSFER_CONTROL,
    308308            max_packet_size, speed, data, size, setup_data, setup_size,
    309309            NULL, callback, arg, &hc->device_manager);
    310310        if (!batch)
    311311                return ENOMEM;
    312         device_keeper_reset_if_need(&hc->device_manager, target, setup_data);
     312        usb_device_keeper_reset_if_need(&hc->device_manager, target, setup_data);
    313313        batch_control_write(batch);
    314314        const int ret = uhci_hc_schedule(hc, batch);
     
    341341        uhci_hc_t *hc = fun_to_uhci_hc(fun);
    342342        assert(hc);
    343         usb_speed_t speed = device_keeper_speed(&hc->device_manager, target.address);
     343        usb_speed_t speed = usb_device_keeper_get_speed(&hc->device_manager, target.address);
    344344
    345345        usb_log_debug("Control READ(%d) %d:%d %zu(%zu).\n",
    346346            speed, target.address, target.endpoint, size, max_packet_size);
    347         batch_t *batch = batch_get(fun, target, USB_TRANSFER_CONTROL,
     347        usb_transfer_batch_t *batch = batch_get(fun, target, USB_TRANSFER_CONTROL,
    348348            max_packet_size, speed, data, size, setup_data, setup_size, callback,
    349349            NULL, arg, &hc->device_manager);
  • uspace/drv/uhci-hcd/transfer_list.c

    r5971dd3 r7102aa5  
    3838
    3939static void transfer_list_remove_batch(
    40     transfer_list_t *instance, batch_t *batch);
     40    transfer_list_t *instance, usb_transfer_batch_t *batch);
    4141/*----------------------------------------------------------------------------*/
    4242/** Initialize transfer list structures.
     
    9292 * The batch is added to the end of the list and queue.
    9393 */
    94 void transfer_list_add_batch(transfer_list_t *instance, batch_t *batch)
     94void transfer_list_add_batch(transfer_list_t *instance, usb_transfer_batch_t *batch)
    9595{
    9696        assert(instance);
     
    115115        } else {
    116116                /* There is something scheduled */
    117                 batch_t *last = list_get_instance(
    118                     instance->batch_list.prev, batch_t, link);
     117                usb_transfer_batch_t *last = list_get_instance(
     118                    instance->batch_list.prev, usb_transfer_batch_t, link);
    119119                qh_set_next_qh(batch_qh(last), pa);
    120120        }
     
    122122        list_append(&batch->link, &instance->batch_list);
    123123
    124         batch_t *first = list_get_instance(
    125             instance->batch_list.next, batch_t, link);
     124        usb_transfer_batch_t *first = list_get_instance(
     125            instance->batch_list.next, usb_transfer_batch_t, link);
    126126        usb_log_debug("Batch(%p) added to queue %s, first is %p.\n",
    127127                batch, instance->name, first);
     
    148148        while (current != &instance->batch_list) {
    149149                link_t *next = current->next;
    150                 batch_t *batch = list_get_instance(current, batch_t, link);
     150                usb_transfer_batch_t *batch = list_get_instance(current, usb_transfer_batch_t, link);
    151151
    152152                if (batch_is_complete(batch)) {
     
    162162                link_t *item = done.next;
    163163                list_remove(item);
    164                 batch_t *batch = list_get_instance(item, batch_t, link);
     164                usb_transfer_batch_t *batch = list_get_instance(item, usb_transfer_batch_t, link);
    165165                batch->next_step(batch);
    166166        }
     
    176176        while (list_empty(&instance->batch_list)) {
    177177                link_t *current = instance->batch_list.next;
    178                 batch_t *batch = list_get_instance(current, batch_t, link);
     178                usb_transfer_batch_t *batch = list_get_instance(current, usb_transfer_batch_t, link);
    179179                transfer_list_remove_batch(instance, batch);
    180                 batch_finish(batch, EIO);
     180                usb_transfer_batch_finish(batch, EIO);
    181181        }
    182182        fibril_mutex_unlock(&instance->guard);
     
    191191 * Does not lock the transfer list, caller is responsible for that.
    192192 */
    193 void transfer_list_remove_batch(transfer_list_t *instance, batch_t *batch)
     193void transfer_list_remove_batch(transfer_list_t *instance, usb_transfer_batch_t *batch)
    194194{
    195195        assert(instance);
     
    207207                pos = "FIRST";
    208208        } else {
    209                 batch_t *prev =
    210                     list_get_instance(batch->link.prev, batch_t, link);
     209                usb_transfer_batch_t *prev =
     210                    list_get_instance(batch->link.prev, usb_transfer_batch_t, link);
    211211                qh_set_next_qh(batch_qh(prev), batch_qh(batch)->next);
    212212                pos = "NOT FIRST";
  • uspace/drv/uhci-hcd/transfer_list.h

    r5971dd3 r7102aa5  
    6666void transfer_list_set_next(transfer_list_t *instance, transfer_list_t *next);
    6767
    68 void transfer_list_add_batch(transfer_list_t *instance, batch_t *batch);
     68void transfer_list_add_batch(transfer_list_t *instance, usb_transfer_batch_t *batch);
    6969
    7070void transfer_list_remove_finished(transfer_list_t *instance);
  • uspace/drv/uhci-hcd/uhci.c

    r5971dd3 r7102aa5  
    7070{
    7171        assert(fun);
    72         device_keeper_t *manager = &((uhci_t*)fun->dev->driver_data)->hc.device_manager;
    73 
    74         usb_address_t addr = device_keeper_find(manager, handle);
     72        usb_device_keeper_t *manager = &((uhci_t*)fun->dev->driver_data)->hc.device_manager;
     73
     74        usb_address_t addr = usb_device_keeper_find(manager, handle);
    7575        if (addr < 0) {
    7676                return addr;
  • uspace/drv/uhci-hcd/uhci_hc.c

    r5971dd3 r7102aa5  
    236236
    237237        /* Init device keeper*/
    238         device_keeper_init(&instance->device_manager);
     238        usb_device_keeper_init(&instance->device_manager);
    239239        usb_log_debug("Initialized device manager.\n");
    240240
     
    318318 * Checks for bandwidth availability and appends the batch to the proper queue.
    319319 */
    320 int uhci_hc_schedule(uhci_hc_t *instance, batch_t *batch)
     320int uhci_hc_schedule(uhci_hc_t *instance, usb_transfer_batch_t *batch)
    321321{
    322322        assert(instance);
  • uspace/drv/uhci-hcd/uhci_hc.h

    r5971dd3 r7102aa5  
    8383
    8484typedef struct uhci_hc {
    85         device_keeper_t device_manager;
     85        usb_device_keeper_t device_manager;
    8686
    8787        regs_t *registers;
     
    109109    void *regs, size_t reg_size, bool interupts);
    110110
    111 int uhci_hc_schedule(uhci_hc_t *instance, batch_t *batch);
     111int uhci_hc_schedule(uhci_hc_t *instance, usb_transfer_batch_t *batch);
    112112
    113113void uhci_hc_interrupt(uhci_hc_t *instance, uint16_t status);
  • uspace/drv/usbhid/hiddev.c

    r5971dd3 r7102aa5  
    184184 *                     successfuly initialize the structure.
    185185 *
    186  * @sa usb_endpoint_pipe_initialize_from_configuration(),
     186 * @sa usb_pipe_initialize_from_configuration(),
    187187 *     usbhid_dev_get_report_descriptor()
    188188 */
     
    218218        };
    219219       
    220         rc = usb_endpoint_pipe_initialize_from_configuration(
     220        rc = usb_pipe_initialize_from_configuration(
    221221            endpoint_mapping, 1, descriptors, descriptors_size,
    222222            &hid_dev->wire);
     
    359359 * @return Other value inherited from one of functions
    360360 *         usb_device_connection_initialize_from_device(),
    361  *         usb_endpoint_pipe_initialize_default_control(),
    362  *         usb_endpoint_pipe_start_session(), usb_endpoint_pipe_end_session(),
     361 *         usb_pipe_initialize_default_control(),
     362 *         usb_pipe_start_session(), usb_pipe_end_session(),
    363363 *         usbhid_dev_process_descriptors().
    364364 *
     
    404404         * Initialize device pipes.
    405405         */
    406         rc = usb_endpoint_pipe_initialize_default_control(&hid_dev->ctrl_pipe,
     406        rc = usb_pipe_initialize_default_control(&hid_dev->ctrl_pipe,
    407407            &hid_dev->wire);
    408408        if (rc != EOK) {
     
    411411                return rc;
    412412        }
    413         rc = usb_endpoint_pipe_probe_default_control(&hid_dev->ctrl_pipe);
     413        rc = usb_pipe_probe_default_control(&hid_dev->ctrl_pipe);
    414414        if (rc != EOK) {
    415415                usb_log_error("Probing default control pipe failed: %s.\n",
     
    430430         * Get descriptors, parse descriptors and save endpoints.
    431431         */
    432         rc = usb_endpoint_pipe_start_session(&hid_dev->ctrl_pipe);
     432        rc = usb_pipe_start_session(&hid_dev->ctrl_pipe);
    433433        if (rc != EOK) {
    434434                usb_log_error("Failed to start session on the control pipe: %s"
     
    440440        if (rc != EOK) {
    441441                /* TODO: end session?? */
    442                 usb_endpoint_pipe_end_session(&hid_dev->ctrl_pipe);
     442                usb_pipe_end_session(&hid_dev->ctrl_pipe);
    443443                usb_log_error("Failed to process descriptors: %s.\n",
    444444                    str_error(rc));
     
    446446        }
    447447       
    448         rc = usb_endpoint_pipe_end_session(&hid_dev->ctrl_pipe);
     448        rc = usb_pipe_end_session(&hid_dev->ctrl_pipe);
    449449        if (rc != EOK) {
    450450                usb_log_warning("Failed to start session on the control pipe: "
  • uspace/drv/usbhid/hiddev.h

    r5971dd3 r7102aa5  
    6868        usb_device_connection_t wire;
    6969        /** USB pipe corresponding to the default Control endpoint. */
    70         usb_endpoint_pipe_t ctrl_pipe;
     70        usb_pipe_t ctrl_pipe;
    7171        /** USB pipe corresponding to the Interrupt In (polling) pipe. */
    72         usb_endpoint_pipe_t poll_pipe;
     72        usb_pipe_t poll_pipe;
    7373       
    7474        /** Polling interval retreived from the Interface descriptor. */
  • uspace/drv/usbhid/hidreq.c

    r5971dd3 r7102aa5  
    5757 * @retval EINVAL if no HID device is given.
    5858 * @return Other value inherited from one of functions
    59  *         usb_endpoint_pipe_start_session(), usb_endpoint_pipe_end_session(),
     59 *         usb_pipe_start_session(), usb_pipe_end_session(),
    6060 *         usb_control_request_set().
    6161 */
     
    7676        int rc, sess_rc;
    7777       
    78         sess_rc = usb_endpoint_pipe_start_session(&hid_dev->ctrl_pipe);
     78        sess_rc = usb_pipe_start_session(&hid_dev->ctrl_pipe);
    7979        if (sess_rc != EOK) {
    8080                usb_log_warning("Failed to start a session: %s.\n",
     
    9292            USB_HIDREQ_SET_REPORT, value, hid_dev->iface, buffer, buf_size);
    9393
    94         sess_rc = usb_endpoint_pipe_end_session(&hid_dev->ctrl_pipe);
     94        sess_rc = usb_pipe_end_session(&hid_dev->ctrl_pipe);
    9595
    9696        if (rc != EOK) {
     
    119119 * @retval EINVAL if no HID device is given.
    120120 * @return Other value inherited from one of functions
    121  *         usb_endpoint_pipe_start_session(), usb_endpoint_pipe_end_session(),
     121 *         usb_pipe_start_session(), usb_pipe_end_session(),
    122122 *         usb_control_request_set().
    123123 */
     
    137137        int rc, sess_rc;
    138138       
    139         sess_rc = usb_endpoint_pipe_start_session(&hid_dev->ctrl_pipe);
     139        sess_rc = usb_pipe_start_session(&hid_dev->ctrl_pipe);
    140140        if (sess_rc != EOK) {
    141141                usb_log_warning("Failed to start a session: %s.\n",
     
    151151            USB_HIDREQ_SET_PROTOCOL, protocol, hid_dev->iface, NULL, 0);
    152152
    153         sess_rc = usb_endpoint_pipe_end_session(&hid_dev->ctrl_pipe);
     153        sess_rc = usb_pipe_end_session(&hid_dev->ctrl_pipe);
    154154
    155155        if (rc != EOK) {
     
    179179 * @retval EINVAL if no HID device is given.
    180180 * @return Other value inherited from one of functions
    181  *         usb_endpoint_pipe_start_session(), usb_endpoint_pipe_end_session(),
     181 *         usb_pipe_start_session(), usb_pipe_end_session(),
    182182 *         usb_control_request_set().
    183183 */
     
    197197        int rc, sess_rc;
    198198       
    199         sess_rc = usb_endpoint_pipe_start_session(&hid_dev->ctrl_pipe);
     199        sess_rc = usb_pipe_start_session(&hid_dev->ctrl_pipe);
    200200        if (sess_rc != EOK) {
    201201                usb_log_warning("Failed to start a session: %s.\n",
     
    213213            USB_HIDREQ_SET_IDLE, value, hid_dev->iface, NULL, 0);
    214214
    215         sess_rc = usb_endpoint_pipe_end_session(&hid_dev->ctrl_pipe);
     215        sess_rc = usb_pipe_end_session(&hid_dev->ctrl_pipe);
    216216
    217217        if (rc != EOK) {
     
    244244 * @retval EINVAL if no HID device is given.
    245245 * @return Other value inherited from one of functions
    246  *         usb_endpoint_pipe_start_session(), usb_endpoint_pipe_end_session(),
     246 *         usb_pipe_start_session(), usb_pipe_end_session(),
    247247 *         usb_control_request_set().
    248248 */
     
    263263        int rc, sess_rc;
    264264       
    265         sess_rc = usb_endpoint_pipe_start_session(&hid_dev->ctrl_pipe);
     265        sess_rc = usb_pipe_start_session(&hid_dev->ctrl_pipe);
    266266        if (sess_rc != EOK) {
    267267                usb_log_warning("Failed to start a session: %s.\n",
     
    280280            actual_size);
    281281
    282         sess_rc = usb_endpoint_pipe_end_session(&hid_dev->ctrl_pipe);
     282        sess_rc = usb_pipe_end_session(&hid_dev->ctrl_pipe);
    283283
    284284        if (rc != EOK) {
     
    307307 * @retval EINVAL if no HID device is given.
    308308 * @return Other value inherited from one of functions
    309  *         usb_endpoint_pipe_start_session(), usb_endpoint_pipe_end_session(),
     309 *         usb_pipe_start_session(), usb_pipe_end_session(),
    310310 *         usb_control_request_set().
    311311 */
     
    325325        int rc, sess_rc;
    326326       
    327         sess_rc = usb_endpoint_pipe_start_session(&hid_dev->ctrl_pipe);
     327        sess_rc = usb_pipe_start_session(&hid_dev->ctrl_pipe);
    328328        if (sess_rc != EOK) {
    329329                usb_log_warning("Failed to start a session: %s.\n",
     
    342342            USB_HIDREQ_GET_PROTOCOL, 0, hid_dev->iface, buffer, 1, &actual_size);
    343343
    344         sess_rc = usb_endpoint_pipe_end_session(&hid_dev->ctrl_pipe);
     344        sess_rc = usb_pipe_end_session(&hid_dev->ctrl_pipe);
    345345
    346346        if (rc != EOK) {
     
    378378 * @retval EINVAL if no HID device is given.
    379379 * @return Other value inherited from one of functions
    380  *         usb_endpoint_pipe_start_session(), usb_endpoint_pipe_end_session(),
     380 *         usb_pipe_start_session(), usb_pipe_end_session(),
    381381 *         usb_control_request_set().
    382382 */
     
    396396        int rc, sess_rc;
    397397       
    398         sess_rc = usb_endpoint_pipe_start_session(&hid_dev->ctrl_pipe);
     398        sess_rc = usb_pipe_start_session(&hid_dev->ctrl_pipe);
    399399        if (sess_rc != EOK) {
    400400                usb_log_warning("Failed to start a session: %s.\n",
     
    415415            &actual_size);
    416416
    417         sess_rc = usb_endpoint_pipe_end_session(&hid_dev->ctrl_pipe);
     417        sess_rc = usb_pipe_end_session(&hid_dev->ctrl_pipe);
    418418
    419419        if (rc != EOK) {
  • uspace/drv/usbhid/kbddev.c

    r5971dd3 r7102aa5  
    780780
    781781        while (true) {
    782                 sess_rc = usb_endpoint_pipe_start_session(
     782                sess_rc = usb_pipe_start_session(
    783783                    &kbd_dev->hid_dev->poll_pipe);
    784784                if (sess_rc != EOK) {
     
    788788                }
    789789
    790                 rc = usb_endpoint_pipe_read(&kbd_dev->hid_dev->poll_pipe,
     790                rc = usb_pipe_read(&kbd_dev->hid_dev->poll_pipe,
    791791                    buffer, BOOTP_BUFFER_SIZE, &actual_size);
    792792               
    793                 sess_rc = usb_endpoint_pipe_end_session(
     793                sess_rc = usb_pipe_end_session(
    794794                    &kbd_dev->hid_dev->poll_pipe);
    795795
  • uspace/drv/usbhub/usbhub.c

    r5971dd3 r7102aa5  
    224224        }
    225225       
    226         usb_endpoint_pipe_start_session(hub_info->control_pipe);
     226        usb_pipe_start_session(hub_info->control_pipe);
    227227        //set hub configuration
    228228        opResult = usb_hub_set_configuration(hub_info);
     
    239239                return opResult;
    240240        }
    241         usb_endpoint_pipe_end_session(hub_info->control_pipe);
     241        usb_pipe_end_session(hub_info->control_pipe);
    242242
    243243
     
    321321        //reset port
    322322        usb_hub_set_reset_port_request(&request, port);
    323         opResult = usb_endpoint_pipe_control_write(
     323        opResult = usb_pipe_control_write(
    324324                        hub->control_pipe,
    325325                        &request,sizeof(usb_device_request_setup_packet_t),
     
    354354        }
    355355        //create connection to device
    356         usb_endpoint_pipe_t new_device_pipe;
     356        usb_pipe_t new_device_pipe;
    357357        usb_device_connection_t new_device_connection;
    358358        usb_device_connection_initialize_on_default_address(
     
    360360                        &hub->connection
    361361                        );
    362         usb_endpoint_pipe_initialize_default_control(
     362        usb_pipe_initialize_default_control(
    363363                        &new_device_pipe,
    364364                        &new_device_connection);
    365         usb_endpoint_pipe_probe_default_control(&new_device_pipe);
     365        usb_pipe_probe_default_control(&new_device_pipe);
    366366
    367367        /* Request address from host controller. */
     
    379379        //opResult = usb_drv_req_set_address(hc, USB_ADDRESS_DEFAULT,
    380380        //    new_device_address);
    381         usb_endpoint_pipe_start_session(&new_device_pipe);
     381        usb_pipe_start_session(&new_device_pipe);
    382382        opResult = usb_request_set_address(&new_device_pipe,new_device_address);
    383         usb_endpoint_pipe_end_session(&new_device_pipe);
     383        usb_pipe_end_session(&new_device_pipe);
    384384        if (opResult != EOK) {
    385385                usb_log_error("could not set address for new device %d\n",opResult);
     
    488488        usb_log_debug("interrupt at port %d\n", port);
    489489        //determine type of change
    490         usb_endpoint_pipe_t *pipe = hub->control_pipe;
     490        usb_pipe_t *pipe = hub->control_pipe;
    491491       
    492492        int opResult;
     
    499499        //endpoint 0
    500500
    501         opResult = usb_endpoint_pipe_control_read(
     501        opResult = usb_pipe_control_read(
    502502                        pipe,
    503503                        &request, sizeof(usb_device_request_setup_packet_t),
     
    560560int usb_hub_check_hub_changes(usb_hub_info_t * hub_info){
    561561        int opResult;
    562         opResult = usb_endpoint_pipe_start_session(
     562        opResult = usb_pipe_start_session(
    563563                        hub_info->status_change_pipe);
    564564        if(opResult != EOK){
     
    578578         * Send the request.
    579579         */
    580         opResult = usb_endpoint_pipe_read(
     580        opResult = usb_pipe_read(
    581581                        hub_info->status_change_pipe,
    582582                        change_bitmap, byte_length, &actual_size
     
    586586                free(change_bitmap);
    587587                usb_log_warning("something went wrong while getting status of hub\n");
    588                 usb_endpoint_pipe_end_session(hub_info->status_change_pipe);
     588                usb_pipe_end_session(hub_info->status_change_pipe);
    589589                return opResult;
    590590        }
    591591        unsigned int port;
    592         opResult = usb_endpoint_pipe_start_session(hub_info->control_pipe);
     592        opResult = usb_pipe_start_session(hub_info->control_pipe);
    593593        if(opResult!=EOK){
    594594                usb_log_error("could not start control pipe session %d\n", opResult);
    595                 usb_endpoint_pipe_end_session(hub_info->status_change_pipe);
     595                usb_pipe_end_session(hub_info->status_change_pipe);
    596596                return opResult;
    597597        }
     
    600600                usb_log_error("could not start host controller session %d\n",
    601601                                opResult);
    602                 usb_endpoint_pipe_end_session(hub_info->control_pipe);
    603                 usb_endpoint_pipe_end_session(hub_info->status_change_pipe);
     602                usb_pipe_end_session(hub_info->control_pipe);
     603                usb_pipe_end_session(hub_info->status_change_pipe);
    604604                return opResult;
    605605        }
     
    615615        }
    616616        usb_hc_connection_close(&hub_info->connection);
    617         usb_endpoint_pipe_end_session(hub_info->control_pipe);
    618         usb_endpoint_pipe_end_session(hub_info->status_change_pipe);
     617        usb_pipe_end_session(hub_info->control_pipe);
     618        usb_pipe_end_session(hub_info->status_change_pipe);
    619619        free(change_bitmap);
    620620        return EOK;
  • uspace/drv/usbhub/usbhub.h

    r5971dd3 r7102aa5  
    5858/* Hub endpoints. */
    5959/*typedef struct {
    60         usb_endpoint_pipe_t control;
    61         usb_endpoint_pipe_t status_change;
     60        usb_pipe_t control;
     61        usb_pipe_t status_change;
    6262} usb_hub_endpoints_t;
    6363*/
     
    8888         * searched again and again for the 'right pipe'.
    8989         */
    90         usb_endpoint_pipe_t * status_change_pipe;
     90        usb_pipe_t * status_change_pipe;
    9191
    9292        /** convenience pointer to control pipe
     
    9696         * searched again and again for the 'right pipe'.
    9797         */
    98         usb_endpoint_pipe_t * control_pipe;
     98        usb_pipe_t * control_pipe;
    9999
    100100        /** generic usb device data*/
  • uspace/drv/usbhub/usbhub_private.h

    r5971dd3 r7102aa5  
    9595 * @return Operation result
    9696 */
    97 static inline int usb_hub_clear_port_feature(usb_endpoint_pipe_t *pipe,
     97static inline int usb_hub_clear_port_feature(usb_pipe_t *pipe,
    9898    int port_index,
    9999    usb_hub_class_feature_t feature) {
     
    106106        };
    107107        clear_request.value = feature;
    108         return usb_endpoint_pipe_control_write(pipe, &clear_request,
     108        return usb_pipe_control_write(pipe, &clear_request,
    109109            sizeof(clear_request), NULL, 0);
    110110}
  • uspace/drv/usbmid/main.c

    r5971dd3 r7102aa5  
    6161        int rc;
    6262
    63         rc = usb_endpoint_pipe_start_session(&dev->ctrl_pipe);
     63        rc = usb_pipe_start_session(&dev->ctrl_pipe);
    6464        if (rc != EOK) {
    6565                usb_log_error("Failed to start session on control pipe: %s.\n",
     
    7070        bool accept = usbmid_explore_device(dev);
    7171
    72         rc = usb_endpoint_pipe_end_session(&dev->ctrl_pipe);
     72        rc = usb_pipe_end_session(&dev->ctrl_pipe);
    7373        if (rc != EOK) {
    7474                usb_log_warning("Failed to end session on control pipe: %s.\n",
  • uspace/drv/usbmid/usbmid.c

    r5971dd3 r7102aa5  
    108108        }
    109109
    110         rc = usb_endpoint_pipe_initialize_default_control(&mid->ctrl_pipe,
     110        rc = usb_pipe_initialize_default_control(&mid->ctrl_pipe,
    111111            &mid->wire);
    112112        if (rc != EOK) {
     
    116116                return NULL;
    117117        }
    118         rc = usb_endpoint_pipe_probe_default_control(&mid->ctrl_pipe);
     118        rc = usb_pipe_probe_default_control(&mid->ctrl_pipe);
    119119        if (rc != EOK) {
    120120                usb_log_error("Probing default control pipe failed: %s.\n",
  • uspace/drv/usbmid/usbmid.h

    r5971dd3 r7102aa5  
    5252        usb_device_connection_t wire;
    5353        /** Default control pipe. */
    54         usb_endpoint_pipe_t ctrl_pipe;
     54        usb_pipe_t ctrl_pipe;
    5555} usbmid_device_t;
    5656
  • uspace/drv/usbmouse/init.c

    r5971dd3 r7102aa5  
    126126       
    127127        /* Open the control pipe. */
    128         rc = usb_endpoint_pipe_start_session(&dev->ctrl_pipe);
     128        rc = usb_pipe_start_session(&dev->ctrl_pipe);
    129129        if (rc != EOK) {
    130130                goto leave;
     
    141141       
    142142        /* Close the control pipe (ignore errors). */
    143         usb_endpoint_pipe_end_session(&dev->ctrl_pipe);
     143        usb_pipe_end_session(&dev->ctrl_pipe);
    144144
    145145
  • uspace/lib/usb/include/usb/devdrv.h

    r5971dd3 r7102aa5  
    4141typedef struct {
    4242        /** The default control pipe. */
    43         usb_endpoint_pipe_t ctrl_pipe;
     43        usb_pipe_t ctrl_pipe;
    4444        /** Other endpoint pipes.
    4545         * This is an array of other endpoint pipes in the same order as
  • uspace/lib/usb/include/usb/host/batch.h

    r5971dd3 r7102aa5  
    2626 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2727 */
    28 /** @addtogroup drvusbuhcihc
     28/** @addtogroup libusb
    2929 * @{
    3030 */
    3131/** @file
    32  * @brief UHCI driver USB transaction structure
     32 * USB transfer transaction structures.
    3333 */
    3434#ifndef LIBUSB_HOST_BATCH_H
     
    4040#include <usb/usb.h>
    4141
    42 typedef struct batch
    43 {
     42typedef struct usb_transfer_batch usb_transfer_batch_t;
     43struct usb_transfer_batch {
    4444        link_t link;
    4545        usb_target_t target;
     
    5656        size_t max_packet_size;
    5757        size_t transfered_size;
    58         void (*next_step)(struct batch*);
     58        void (*next_step)(usb_transfer_batch_t *);
    5959        int error;
    6060        ddf_fun_t *fun;
    6161        void *arg;
    6262        void *private_data;
    63 } batch_t;
     63};
    6464
    65 void batch_init(
    66     batch_t *instance,
     65void usb_transfer_batch_init(
     66    usb_transfer_batch_t *instance,
    6767    usb_target_t target,
    6868    usb_transfer_type_t transfer_type,
     
    8181);
    8282
    83 static inline batch_t *batch_from_link(link_t *link_ptr)
     83static inline usb_transfer_batch_t *usb_transfer_batch_from_link(link_t *l)
    8484{
    85         assert(link_ptr);
    86         return list_get_instance(link_ptr, batch_t, link);
     85        assert(l);
     86        return list_get_instance(l, usb_transfer_batch_t, link);
    8787}
    8888
    89 void batch_call_in(batch_t *instance);
    90 void batch_call_out(batch_t *instance);
    91 void batch_finish(batch_t *instance, int error);
     89void usb_transfer_batch_call_in(usb_transfer_batch_t *instance);
     90void usb_transfer_batch_call_out(usb_transfer_batch_t *instance);
     91void usb_transfer_batch_finish(usb_transfer_batch_t *instance, int error);
     92
    9293#endif
    9394/**
  • uspace/lib/usb/include/usb/host/device_keeper.h

    r5971dd3 r7102aa5  
    3131 */
    3232/** @file
    33  * @brief UHCI driver
     33 * Device keeper structure and functions.
     34 *
     35 * Typical USB host controller needs to keep track of various settings for
     36 * each device that is connected to it.
     37 * State of toggle bit, device speed etc. etc.
     38 * This structure shall simplify the management.
    3439 */
    3540#ifndef LIBUSB_HOST_DEVICE_KEEPER_H
     
    3944#include <usb/usb.h>
    4045
     46/** Number of USB address for array dimensions. */
    4147#define USB_ADDRESS_COUNT (USB11_ADDRESS_MAX + 1)
    4248
     49/** Information about attached USB device. */
    4350struct usb_device_info {
    4451        usb_speed_t speed;
     
    4855};
    4956
    50 typedef struct device_keeper {
     57/** Host controller device keeper.
     58 * You shall not access members directly but only using functions below.
     59 */
     60typedef struct {
    5161        struct usb_device_info devices[USB_ADDRESS_COUNT];
    5262        fibril_mutex_t guard;
    5363        fibril_condvar_t default_address_occupied;
    5464        usb_address_t last_address;
    55 } device_keeper_t;
     65} usb_device_keeper_t;
    5666
    57 void device_keeper_init(device_keeper_t *instance);
     67void usb_device_keeper_init(usb_device_keeper_t *instance);
    5868
    59 void device_keeper_reserve_default(
    60     device_keeper_t *instance, usb_speed_t speed);
     69void usb_device_keeper_reserve_default_address(usb_device_keeper_t *instance,
     70    usb_speed_t speed);
    6171
    62 void device_keeper_release_default(device_keeper_t *instance);
     72void usb_device_keeper_release_default_address(usb_device_keeper_t *instance);
    6373
    64 void device_keeper_reset_if_need(
    65     device_keeper_t *instance, usb_target_t target,
    66     const unsigned char *setup_data);
     74void usb_device_keeper_reset_if_need(usb_device_keeper_t *instance,
     75    usb_target_t target,
     76    const uint8_t *setup_data);
    6777
    68 int device_keeper_get_toggle(
    69     device_keeper_t *instance, usb_target_t target, usb_direction_t direction);
     78int usb_device_keeper_get_toggle(usb_device_keeper_t *instance,
     79    usb_target_t target, usb_direction_t direction);
    7080
    71 int device_keeper_set_toggle(device_keeper_t *instance,
     81int usb_device_keeper_set_toggle(usb_device_keeper_t *instance,
    7282    usb_target_t target, usb_direction_t direction, bool toggle);
    7383
    74 usb_address_t device_keeper_request(
    75     device_keeper_t *instance, usb_speed_t speed);
     84usb_address_t device_keeper_get_free_address(usb_device_keeper_t *instance,
     85    usb_speed_t speed);
    7686
    77 void device_keeper_bind(
    78     device_keeper_t *instance, usb_address_t address, devman_handle_t handle);
     87void usb_device_keeper_bind(usb_device_keeper_t *instance,
     88    usb_address_t address, devman_handle_t handle);
    7989
    80 void device_keeper_release(device_keeper_t *instance, usb_address_t address);
     90void usb_device_keeper_release(usb_device_keeper_t *instance,
     91    usb_address_t address);
    8192
    82 usb_address_t device_keeper_find(
    83     device_keeper_t *instance, devman_handle_t handle);
     93usb_address_t usb_device_keeper_find(usb_device_keeper_t *instance,
     94    devman_handle_t handle);
    8495
    85 usb_speed_t device_keeper_speed(
    86     device_keeper_t *instance, usb_address_t address);
     96usb_speed_t usb_device_keeper_get_speed(usb_device_keeper_t *instance,
     97    usb_address_t address);
     98
    8799#endif
    88100/**
  • uspace/lib/usb/include/usb/pipes.h

    r5971dd3 r7102aa5  
    8080         */
    8181        int hc_phone;
    82 } usb_endpoint_pipe_t;
     82} usb_pipe_t;
    8383
    8484
     
    102102typedef struct {
    103103        /** Endpoint pipe. */
    104         usb_endpoint_pipe_t *pipe;
     104        usb_pipe_t *pipe;
    105105        /** Endpoint description. */
    106106        const usb_endpoint_description_t *description;
     
    125125usb_address_t usb_device_get_assigned_address(devman_handle_t);
    126126
    127 int usb_endpoint_pipe_initialize(usb_endpoint_pipe_t *,
    128     usb_device_connection_t *,
     127int usb_pipe_initialize(usb_pipe_t *, usb_device_connection_t *,
    129128    usb_endpoint_t, usb_transfer_type_t, size_t, usb_direction_t);
    130 int usb_endpoint_pipe_initialize_default_control(usb_endpoint_pipe_t *,
     129int usb_pipe_initialize_default_control(usb_pipe_t *,
    131130    usb_device_connection_t *);
    132 int usb_endpoint_pipe_probe_default_control(usb_endpoint_pipe_t *);
    133 int usb_endpoint_pipe_initialize_from_configuration(usb_endpoint_mapping_t *,
     131int usb_pipe_probe_default_control(usb_pipe_t *);
     132int usb_pipe_initialize_from_configuration(usb_endpoint_mapping_t *,
    134133    size_t, uint8_t *, size_t, usb_device_connection_t *);
    135 int usb_endpoint_pipe_register(usb_endpoint_pipe_t *, unsigned int,
    136     usb_hc_connection_t *);
    137 int usb_endpoint_pipe_unregister(usb_endpoint_pipe_t *, usb_hc_connection_t *);
     134int usb_pipe_register(usb_pipe_t *, unsigned int, usb_hc_connection_t *);
     135int usb_pipe_unregister(usb_pipe_t *, usb_hc_connection_t *);
    138136
    139 int usb_endpoint_pipe_start_session(usb_endpoint_pipe_t *);
    140 int usb_endpoint_pipe_end_session(usb_endpoint_pipe_t *);
    141 bool usb_endpoint_pipe_is_session_started(usb_endpoint_pipe_t *);
     137int usb_pipe_start_session(usb_pipe_t *);
     138int usb_pipe_end_session(usb_pipe_t *);
     139bool usb_pipe_is_session_started(usb_pipe_t *);
    142140
    143 int usb_endpoint_pipe_read(usb_endpoint_pipe_t *, void *, size_t, size_t *);
    144 int usb_endpoint_pipe_write(usb_endpoint_pipe_t *, void *, size_t);
     141int usb_pipe_read(usb_pipe_t *, void *, size_t, size_t *);
     142int usb_pipe_write(usb_pipe_t *, void *, size_t);
    145143
    146 int usb_endpoint_pipe_control_read(usb_endpoint_pipe_t *, void *, size_t,
     144int usb_pipe_control_read(usb_pipe_t *, void *, size_t,
    147145    void *, size_t, size_t *);
    148 int usb_endpoint_pipe_control_write(usb_endpoint_pipe_t *, void *, size_t,
     146int usb_pipe_control_write(usb_pipe_t *, void *, size_t,
    149147    void *, size_t);
    150148
  • uspace/lib/usb/include/usb/recognise.h

    r5971dd3 r7102aa5  
    4848    const usb_standard_interface_descriptor_t *, match_id_list_t *);
    4949
    50 int usb_device_create_match_ids(usb_endpoint_pipe_t *, match_id_list_t *);
     50int usb_device_create_match_ids(usb_pipe_t *, match_id_list_t *);
    5151
    5252int usb_device_register_child_in_devman(usb_address_t, devman_handle_t,
  • uspace/lib/usb/include/usb/request.h

    r5971dd3 r7102aa5  
    8686} __attribute__ ((packed)) usb_device_request_setup_packet_t;
    8787
    88 int usb_control_request_set(usb_endpoint_pipe_t *,
     88int usb_control_request_set(usb_pipe_t *,
    8989    usb_request_type_t, usb_request_recipient_t, uint8_t,
    9090    uint16_t, uint16_t, void *, size_t);
    9191
    92 int usb_control_request_get(usb_endpoint_pipe_t *,
     92int usb_control_request_get(usb_pipe_t *,
    9393    usb_request_type_t, usb_request_recipient_t, uint8_t,
    9494    uint16_t, uint16_t, void *, size_t, size_t *);
    9595
    96 int usb_request_get_status(usb_endpoint_pipe_t *, usb_request_recipient_t,
     96int usb_request_get_status(usb_pipe_t *, usb_request_recipient_t,
    9797    uint16_t, uint16_t *);
    98 int usb_request_clear_feature(usb_endpoint_pipe_t *, usb_request_type_t,
     98int usb_request_clear_feature(usb_pipe_t *, usb_request_type_t,
    9999    usb_request_recipient_t, uint16_t, uint16_t);
    100 int usb_request_set_feature(usb_endpoint_pipe_t *, usb_request_type_t,
     100int usb_request_set_feature(usb_pipe_t *, usb_request_type_t,
    101101    usb_request_recipient_t, uint16_t, uint16_t);
    102 int usb_request_set_address(usb_endpoint_pipe_t *, usb_address_t);
    103 int usb_request_get_descriptor(usb_endpoint_pipe_t *, usb_request_type_t,
     102int usb_request_set_address(usb_pipe_t *, usb_address_t);
     103int usb_request_get_descriptor(usb_pipe_t *, usb_request_type_t,
    104104    usb_request_recipient_t, uint8_t, uint8_t, uint16_t, void *, size_t,
    105105    size_t *);
    106 int usb_request_get_descriptor_alloc(usb_endpoint_pipe_t *, usb_request_type_t,
     106int usb_request_get_descriptor_alloc(usb_pipe_t *, usb_request_type_t,
    107107    usb_request_recipient_t, uint8_t, uint8_t, uint16_t, void **, size_t *);
    108 int usb_request_get_device_descriptor(usb_endpoint_pipe_t *,
     108int usb_request_get_device_descriptor(usb_pipe_t *,
    109109    usb_standard_device_descriptor_t *);
    110 int usb_request_get_bare_configuration_descriptor(usb_endpoint_pipe_t *, int,
     110int usb_request_get_bare_configuration_descriptor(usb_pipe_t *, int,
    111111    usb_standard_configuration_descriptor_t *);
    112 int usb_request_get_full_configuration_descriptor(usb_endpoint_pipe_t *, int,
     112int usb_request_get_full_configuration_descriptor(usb_pipe_t *, int,
    113113    void *, size_t, size_t *);
    114 int usb_request_get_full_configuration_descriptor_alloc(usb_endpoint_pipe_t *,
     114int usb_request_get_full_configuration_descriptor_alloc(usb_pipe_t *,
    115115    int, void **, size_t *);
    116 int usb_request_set_descriptor(usb_endpoint_pipe_t *, usb_request_type_t,
     116int usb_request_set_descriptor(usb_pipe_t *, usb_request_type_t,
    117117    usb_request_recipient_t, uint8_t, uint8_t, uint16_t, void *, size_t);
    118 int usb_request_get_configuration(usb_endpoint_pipe_t *, uint8_t *);
    119 int usb_request_set_configuration(usb_endpoint_pipe_t *, uint8_t);
    120 int usb_request_get_interface(usb_endpoint_pipe_t *, uint8_t, uint8_t *);
    121 int usb_request_set_interface(usb_endpoint_pipe_t *, uint8_t, uint8_t);
     118int usb_request_get_configuration(usb_pipe_t *, uint8_t *);
     119int usb_request_set_configuration(usb_pipe_t *, uint8_t);
     120int usb_request_get_interface(usb_pipe_t *, uint8_t, uint8_t *);
     121int usb_request_set_interface(usb_pipe_t *, uint8_t, uint8_t);
    122122
    123 int usb_request_get_supported_languages(usb_endpoint_pipe_t *,
     123int usb_request_get_supported_languages(usb_pipe_t *,
    124124    l18_win_locales_t **, size_t *);
    125 int usb_request_get_string(usb_endpoint_pipe_t *, size_t, l18_win_locales_t,
     125int usb_request_get_string(usb_pipe_t *, size_t, l18_win_locales_t,
    126126    char **);
    127127
  • uspace/lib/usb/src/devdrv.c

    r5971dd3 r7102aa5  
    126126
    127127        for (i = 0; i < pipe_count; i++) {
    128                 dev->pipes[i].pipe = malloc(sizeof(usb_endpoint_pipe_t));
     128                dev->pipes[i].pipe = malloc(sizeof(usb_pipe_t));
    129129                if (dev->pipes[i].pipe == NULL) {
    130130                        usb_log_oom(dev->ddf_dev);
     
    147147        }
    148148
    149         rc = usb_endpoint_pipe_initialize_from_configuration(dev->pipes,
     149        rc = usb_pipe_initialize_from_configuration(dev->pipes,
    150150           pipe_count, config_descriptor, config_descriptor_size, &dev->wire);
    151151        if (rc != EOK) {
     
    172172        for (i = 0; i < pipe_count; i++) {
    173173                if (dev->pipes[i].present) {
    174                         rc = usb_endpoint_pipe_register(dev->pipes[i].pipe,
     174                        rc = usb_pipe_register(dev->pipes[i].pipe,
    175175                            dev->pipes[i].descriptor->poll_interval,
    176176                            &hc_conn);
     
    219219        }
    220220
    221         rc = usb_endpoint_pipe_initialize_default_control(&dev->ctrl_pipe,
     221        rc = usb_pipe_initialize_default_control(&dev->ctrl_pipe,
    222222            &dev->wire);
    223223        if (rc != EOK) {
     
    228228        }
    229229
    230         rc = usb_endpoint_pipe_probe_default_control(&dev->ctrl_pipe);
     230        rc = usb_pipe_probe_default_control(&dev->ctrl_pipe);
    231231        if (rc != EOK) {
    232232                usb_log_error(
     
    240240         * default control pipe.
    241241         */
    242         rc = usb_endpoint_pipe_start_session(&dev->ctrl_pipe);
     242        rc = usb_pipe_start_session(&dev->ctrl_pipe);
    243243        if (rc != EOK) {
    244244                usb_log_error("Failed to start an IPC session: %s.\n",
     
    252252
    253253        /* No checking here. */
    254         usb_endpoint_pipe_end_session(&dev->ctrl_pipe);
     254        usb_pipe_end_session(&dev->ctrl_pipe);
    255255
    256256        return rc;
  • uspace/lib/usb/src/devpoll.c

    r5971dd3 r7102aa5  
    6464        assert(polling_data);
    6565
    66         usb_endpoint_pipe_t *pipe
     66        usb_pipe_t *pipe
    6767            = polling_data->dev->pipes[polling_data->pipe_index].pipe;
    6868
     
    7171                int rc;
    7272
    73                 rc = usb_endpoint_pipe_start_session(pipe);
     73                rc = usb_pipe_start_session(pipe);
    7474                if (rc != EOK) {
    7575                        failed_attempts++;
     
    7878
    7979                size_t actual_size;
    80                 rc = usb_endpoint_pipe_read(pipe, polling_data->buffer,
     80                rc = usb_pipe_read(pipe, polling_data->buffer,
    8181                    polling_data->request_size, &actual_size);
    8282
    8383                /* Quit the session regardless of errors. */
    84                 usb_endpoint_pipe_end_session(pipe);
     84                usb_pipe_end_session(pipe);
    8585
    8686                if (rc != EOK) {
  • uspace/lib/usb/src/host/batch.c

    r5971dd3 r7102aa5  
    3030 */
    3131/** @file
    32  * @brief OHCI driver USB transaction structure
     32 * USB transfer transaction structures (implementation).
    3333 */
    3434#include <errno.h>
     
    3939#include <usb/host/batch.h>
    4040
    41 void batch_init(
    42     batch_t *instance,
     41void usb_transfer_batch_init(
     42    usb_transfer_batch_t *instance,
    4343    usb_target_t target,
    4444    usb_transfer_type_t transfer_type,
     
    8585 *
    8686 */
    87 void batch_finish(batch_t *instance, int error)
     87void usb_transfer_batch_finish(usb_transfer_batch_t *instance, int error)
    8888{
    8989        assert(instance);
     
    9898 * parameters.
    9999 */
    100 void batch_call_in(batch_t *instance)
     100void usb_transfer_batch_call_in(usb_transfer_batch_t *instance)
    101101{
    102102        assert(instance);
     
    120120 * @param[in] instance Batch structure to use.
    121121 */
    122 void batch_call_out(batch_t *instance)
     122void usb_transfer_batch_call_out(usb_transfer_batch_t *instance)
    123123{
    124124        assert(instance);
  • uspace/lib/usb/src/host/device_keeper.c

    r5971dd3 r7102aa5  
    3131 */
    3232/** @file
    33  * @brief UHCI driver
     33 * Device keeper structure and functions (implementation).
    3434 */
    3535#include <assert.h>
     
    4545 * Set all values to false/0.
    4646 */
    47 void device_keeper_init(device_keeper_t *instance)
     47void usb_device_keeper_init(usb_device_keeper_t *instance)
    4848{
    4949        assert(instance);
     
    6565 * @param[in] speed Speed of the device requesting default address.
    6666 */
    67 void device_keeper_reserve_default(device_keeper_t *instance, usb_speed_t speed)
     67void usb_device_keeper_reserve_default_address(usb_device_keeper_t *instance,
     68    usb_speed_t speed)
    6869{
    6970        assert(instance);
     
    8384 * @param[in] speed Speed of the device requesting default address.
    8485 */
    85 void device_keeper_release_default(device_keeper_t *instance)
     86void usb_device_keeper_release_default_address(usb_device_keeper_t *instance)
    8687{
    8788        assert(instance);
     
    100101 * Really ugly one.
    101102 */
    102 void device_keeper_reset_if_need(
    103     device_keeper_t *instance, usb_target_t target, const unsigned char *data)
     103void usb_device_keeper_reset_if_need(usb_device_keeper_t *instance,
     104    usb_target_t target, const uint8_t *data)
    104105{
    105106        assert(instance);
     
    144145 * @return Error code
    145146 */
    146 int device_keeper_get_toggle(
    147     device_keeper_t *instance, usb_target_t target, usb_direction_t direction)
     147int usb_device_keeper_get_toggle(usb_device_keeper_t *instance,
     148    usb_target_t target, usb_direction_t direction)
    148149{
    149150        assert(instance);
     
    173174 * @return Error code.
    174175 */
    175 int device_keeper_set_toggle(device_keeper_t *instance,
     176int usb_device_keeper_set_toggle(usb_device_keeper_t *instance,
    176177    usb_target_t target, usb_direction_t direction, bool toggle)
    177178{
     
    207208 * @return Free address, or error code.
    208209 */
    209 usb_address_t device_keeper_request(
    210     device_keeper_t *instance, usb_speed_t speed)
     210usb_address_t device_keeper_get_free_address(usb_device_keeper_t *instance,
     211    usb_speed_t speed)
    211212{
    212213        assert(instance);
     
    241242 * @param[in] handle Devman handle of the device.
    242243 */
    243 void device_keeper_bind(
    244     device_keeper_t *instance, usb_address_t address, devman_handle_t handle)
     244void usb_device_keeper_bind(usb_device_keeper_t *instance,
     245    usb_address_t address, devman_handle_t handle)
    245246{
    246247        assert(instance);
     
    258259 * @param[in] address Device address
    259260 */
    260 void device_keeper_release(device_keeper_t *instance, usb_address_t address)
     261void usb_device_keeper_release(usb_device_keeper_t *instance,
     262    usb_address_t address)
    261263{
    262264        assert(instance);
     
    276278 * @return USB Address, or error code.
    277279 */
    278 usb_address_t device_keeper_find(
    279     device_keeper_t *instance, devman_handle_t handle)
     280usb_address_t usb_device_keeper_find(usb_device_keeper_t *instance,
     281    devman_handle_t handle)
    280282{
    281283        assert(instance);
     
    299301 * @return USB speed.
    300302 */
    301 usb_speed_t device_keeper_speed(
    302     device_keeper_t *instance, usb_address_t address)
     303usb_speed_t usb_device_keeper_get_speed(usb_device_keeper_t *instance,
     304    usb_address_t address)
    303305{
    304306        assert(instance);
     
    307309        return instance->devices[address].speed;
    308310}
     311
    309312/**
    310313 * @}
  • uspace/lib/usb/src/hub.c

    r5971dd3 r7102aa5  
    228228        }
    229229
    230         usb_endpoint_pipe_t ctrl_pipe;
    231         rc = usb_endpoint_pipe_initialize_default_control(&ctrl_pipe,
     230        usb_pipe_t ctrl_pipe;
     231        rc = usb_pipe_initialize_default_control(&ctrl_pipe,
    232232            &dev_conn);
    233233        if (rc != EOK) {
     
    235235                goto leave_release_default_address;
    236236        }
    237         rc = usb_endpoint_pipe_probe_default_control(&ctrl_pipe);
     237        rc = usb_pipe_probe_default_control(&ctrl_pipe);
    238238        if (rc != EOK) {
    239239                rc = ENOTCONN;
     
    241241        }
    242242
    243         rc = usb_endpoint_pipe_start_session(&ctrl_pipe);
     243        rc = usb_pipe_start_session(&ctrl_pipe);
    244244        if (rc != EOK) {
    245245                rc = ENOTCONN;
     
    253253        }
    254254
    255         usb_endpoint_pipe_end_session(&ctrl_pipe);
     255        usb_pipe_end_session(&ctrl_pipe);
    256256
    257257        /*
     
    306306
    307307leave_stop_session:
    308         usb_endpoint_pipe_end_session(&ctrl_pipe);
     308        usb_pipe_end_session(&ctrl_pipe);
    309309
    310310leave_release_default_address:
  • uspace/lib/usb/src/pipes.c

    r5971dd3 r7102aa5  
    233233 * A session is something inside what any communication occurs.
    234234 * It is expected that sessions would be started right before the transfer
    235  * and ended - see usb_endpoint_pipe_end_session() - after the last
     235 * and ended - see usb_pipe_end_session() - after the last
    236236 * transfer.
    237237 * The reason for this is that session actually opens some communication
     
    244244 * @return Error code.
    245245 */
    246 int usb_endpoint_pipe_start_session(usb_endpoint_pipe_t *pipe)
     246int usb_pipe_start_session(usb_pipe_t *pipe)
    247247{
    248248        assert(pipe);
    249249
    250         if (usb_endpoint_pipe_is_session_started(pipe)) {
     250        if (usb_pipe_is_session_started(pipe)) {
    251251                return EBUSY;
    252252        }
     
    265265/** Ends a session on the endpoint pipe.
    266266 *
    267  * @see usb_endpoint_pipe_start_session
     267 * @see usb_pipe_start_session
    268268 *
    269269 * @param pipe Endpoint pipe to end the session on.
    270270 * @return Error code.
    271271 */
    272 int usb_endpoint_pipe_end_session(usb_endpoint_pipe_t *pipe)
     272int usb_pipe_end_session(usb_pipe_t *pipe)
    273273{
    274274        assert(pipe);
    275275
    276         if (!usb_endpoint_pipe_is_session_started(pipe)) {
     276        if (!usb_pipe_is_session_started(pipe)) {
    277277                return ENOENT;
    278278        }
     
    296296 * @return Whether @p pipe has opened a session.
    297297 */
    298 bool usb_endpoint_pipe_is_session_started(usb_endpoint_pipe_t *pipe)
     298bool usb_pipe_is_session_started(usb_pipe_t *pipe)
    299299{
    300300        return (pipe->hc_phone >= 0);
  • uspace/lib/usb/src/pipesinit.c

    r5971dd3 r7102aa5  
    193193        }
    194194
    195         int rc = usb_endpoint_pipe_initialize(ep_mapping->pipe, wire,
     195        int rc = usb_pipe_initialize(ep_mapping->pipe, wire,
    196196            ep_no, description.transfer_type, endpoint->max_packet_size,
    197197            description.direction);
     
    276276 * @return Error code.
    277277 */
    278 int usb_endpoint_pipe_initialize_from_configuration(
     278int usb_pipe_initialize_from_configuration(
    279279    usb_endpoint_mapping_t *mapping, size_t mapping_count,
    280280    uint8_t *configuration_descriptor, size_t configuration_descriptor_size,
     
    342342 * @return Error code.
    343343 */
    344 int usb_endpoint_pipe_initialize(usb_endpoint_pipe_t *pipe,
     344int usb_pipe_initialize(usb_pipe_t *pipe,
    345345    usb_device_connection_t *connection, usb_endpoint_t endpoint_no,
    346346    usb_transfer_type_t transfer_type, size_t max_packet_size,
     
    367367 * @return Error code.
    368368 */
    369 int usb_endpoint_pipe_initialize_default_control(usb_endpoint_pipe_t *pipe,
     369int usb_pipe_initialize_default_control(usb_pipe_t *pipe,
    370370    usb_device_connection_t *connection)
    371371{
     
    373373        assert(connection);
    374374
    375         int rc = usb_endpoint_pipe_initialize(pipe, connection,
     375        int rc = usb_pipe_initialize(pipe, connection,
    376376            0, USB_TRANSFER_CONTROL, CTRL_PIPE_MIN_PACKET_SIZE,
    377377            USB_DIRECTION_BOTH);
     
    390390 * @return Error code.
    391391 */
    392 int usb_endpoint_pipe_probe_default_control(usb_endpoint_pipe_t *pipe)
     392int usb_pipe_probe_default_control(usb_pipe_t *pipe)
    393393{
    394394        assert(pipe);
     
    408408
    409409        TRY_LOOP(failed_attempts) {
    410                 rc = usb_endpoint_pipe_start_session(pipe);
     410                rc = usb_pipe_start_session(pipe);
    411411                if (rc == EOK) {
    412412                        break;
     
    433433                }
    434434        }
    435         usb_endpoint_pipe_end_session(pipe);
     435        usb_pipe_end_session(pipe);
    436436        if (rc != EOK) {
    437437                return rc;
     
    451451 * @return Error code.
    452452 */
    453 int usb_endpoint_pipe_register(usb_endpoint_pipe_t *pipe,
     453int usb_pipe_register(usb_pipe_t *pipe,
    454454    unsigned int interval,
    455455    usb_hc_connection_t *hc_connection)
     
    479479 * @return Error code.
    480480 */
    481 int usb_endpoint_pipe_unregister(usb_endpoint_pipe_t *pipe,
     481int usb_pipe_unregister(usb_pipe_t *pipe,
    482482    usb_hc_connection_t *hc_connection)
    483483{
  • uspace/lib/usb/src/pipesio.c

    r5971dd3 r7102aa5  
    5858 * @return Error code.
    5959 */
    60 static int usb_endpoint_pipe_read_no_checks(usb_endpoint_pipe_t *pipe,
     60static int usb_pipe_read_no_checks(usb_pipe_t *pipe,
    6161    void *buffer, size_t size, size_t *size_transfered)
    6262{
     
    140140 * @return Error code.
    141141 */
    142 int usb_endpoint_pipe_read(usb_endpoint_pipe_t *pipe,
     142int usb_pipe_read(usb_pipe_t *pipe,
    143143    void *buffer, size_t size, size_t *size_transfered)
    144144{
     
    153153        }
    154154
    155         if (!usb_endpoint_pipe_is_session_started(pipe)) {
     155        if (!usb_pipe_is_session_started(pipe)) {
    156156                return EBADF;
    157157        }
     
    168168        int rc;
    169169
    170         rc = usb_endpoint_pipe_read_no_checks(pipe, buffer, size, &act_size);
     170        rc = usb_pipe_read_no_checks(pipe, buffer, size, &act_size);
    171171        if (rc != EOK) {
    172172                return rc;
     
    190190 * @return Error code.
    191191 */
    192 static int usb_endpoint_pipe_write_no_check(usb_endpoint_pipe_t *pipe,
     192static int usb_pipe_write_no_check(usb_pipe_t *pipe,
    193193    void *buffer, size_t size)
    194194{
     
    247247 * @return Error code.
    248248 */
    249 int usb_endpoint_pipe_write(usb_endpoint_pipe_t *pipe,
     249int usb_pipe_write(usb_pipe_t *pipe,
    250250    void *buffer, size_t size)
    251251{
     
    260260        }
    261261
    262         if (!usb_endpoint_pipe_is_session_started(pipe)) {
     262        if (!usb_pipe_is_session_started(pipe)) {
    263263                return EBADF;
    264264        }
     
    272272        }
    273273
    274         int rc = usb_endpoint_pipe_write_no_check(pipe, buffer, size);
     274        int rc = usb_pipe_write_no_check(pipe, buffer, size);
    275275
    276276        return rc;
     
    289289 * @return Error code.
    290290 */
    291 static int usb_endpoint_pipe_control_read_no_check(usb_endpoint_pipe_t *pipe,
     291static int usb_pipe_control_read_no_check(usb_pipe_t *pipe,
    292292    void *setup_buffer, size_t setup_buffer_size,
    293293    void *data_buffer, size_t data_buffer_size, size_t *data_transfered_size)
     
    365365 * @return Error code.
    366366 */
    367 int usb_endpoint_pipe_control_read(usb_endpoint_pipe_t *pipe,
     367int usb_pipe_control_read(usb_pipe_t *pipe,
    368368    void *setup_buffer, size_t setup_buffer_size,
    369369    void *data_buffer, size_t data_buffer_size, size_t *data_transfered_size)
     
    379379        }
    380380
    381         if (!usb_endpoint_pipe_is_session_started(pipe)) {
     381        if (!usb_pipe_is_session_started(pipe)) {
    382382                return EBADF;
    383383        }
     
    389389
    390390        size_t act_size = 0;
    391         int rc = usb_endpoint_pipe_control_read_no_check(pipe,
     391        int rc = usb_pipe_control_read_no_check(pipe,
    392392            setup_buffer, setup_buffer_size,
    393393            data_buffer, data_buffer_size, &act_size);
     
    414414 * @return Error code.
    415415 */
    416 static int usb_endpoint_pipe_control_write_no_check(usb_endpoint_pipe_t *pipe,
     416static int usb_pipe_control_write_no_check(usb_pipe_t *pipe,
    417417    void *setup_buffer, size_t setup_buffer_size,
    418418    void *data_buffer, size_t data_buffer_size)
     
    473473 * @return Error code.
    474474 */
    475 int usb_endpoint_pipe_control_write(usb_endpoint_pipe_t *pipe,
     475int usb_pipe_control_write(usb_pipe_t *pipe,
    476476    void *setup_buffer, size_t setup_buffer_size,
    477477    void *data_buffer, size_t data_buffer_size)
     
    491491        }
    492492
    493         if (!usb_endpoint_pipe_is_session_started(pipe)) {
     493        if (!usb_pipe_is_session_started(pipe)) {
    494494                return EBADF;
    495495        }
     
    500500        }
    501501
    502         int rc = usb_endpoint_pipe_control_write_no_check(pipe,
     502        int rc = usb_pipe_control_write_no_check(pipe,
    503503            setup_buffer, setup_buffer_size, data_buffer, data_buffer_size);
    504504
  • uspace/lib/usb/src/recognise.c

    r5971dd3 r7102aa5  
    311311 * @return Error code.
    312312 */
    313 int usb_device_create_match_ids(usb_endpoint_pipe_t *ctrl_pipe,
     313int usb_device_create_match_ids(usb_pipe_t *ctrl_pipe,
    314314    match_id_list_t *matches)
    315315{
     
    363363        int rc;
    364364        usb_device_connection_t dev_connection;
    365         usb_endpoint_pipe_t ctrl_pipe;
     365        usb_pipe_t ctrl_pipe;
    366366
    367367        rc = usb_device_connection_initialize(&dev_connection, hc_handle, address);
     
    370370        }
    371371
    372         rc = usb_endpoint_pipe_initialize_default_control(&ctrl_pipe,
     372        rc = usb_pipe_initialize_default_control(&ctrl_pipe,
    373373            &dev_connection);
    374374        if (rc != EOK) {
    375375                goto failure;
    376376        }
    377         rc = usb_endpoint_pipe_probe_default_control(&ctrl_pipe);
     377        rc = usb_pipe_probe_default_control(&ctrl_pipe);
    378378        if (rc != EOK) {
    379379                goto failure;
     
    404404        child->driver_data = dev_data;
    405405
    406         rc = usb_endpoint_pipe_start_session(&ctrl_pipe);
     406        rc = usb_pipe_start_session(&ctrl_pipe);
    407407        if (rc != EOK) {
    408408                goto failure;
     
    414414        }
    415415
    416         rc = usb_endpoint_pipe_end_session(&ctrl_pipe);
     416        rc = usb_pipe_end_session(&ctrl_pipe);
    417417        if (rc != EOK) {
    418418                goto failure;
  • uspace/lib/usb/src/request.c

    r5971dd3 r7102aa5  
    4242/** Generic wrapper for SET requests using standard control request format.
    4343 *
    44  * @see usb_endpoint_pipe_control_write
     44 * @see usb_pipe_control_write
    4545 *
    4646 * @param pipe Pipe used for the communication.
     
    6060 * @retval ERANGE Data buffer too large.
    6161 */
    62 int usb_control_request_set(usb_endpoint_pipe_t *pipe,
     62int usb_control_request_set(usb_pipe_t *pipe,
    6363    usb_request_type_t request_type, usb_request_recipient_t recipient,
    6464    uint8_t request,
     
    9090        setup_packet.length = (uint16_t) data_size;
    9191
    92         int rc = usb_endpoint_pipe_control_write(pipe,
     92        int rc = usb_pipe_control_write(pipe,
    9393            &setup_packet, sizeof(setup_packet),
    9494            data, data_size);
     
    9999 /** Generic wrapper for GET requests using standard control request format.
    100100  *
    101   * @see usb_endpoint_pipe_control_read
     101  * @see usb_pipe_control_read
    102102  *
    103103  * @param pipe Pipe used for the communication.
     
    120120  * @retval ERANGE Data buffer too large.
    121121  */
    122 int usb_control_request_get(usb_endpoint_pipe_t *pipe,
     122int usb_control_request_get(usb_pipe_t *pipe,
    123123    usb_request_type_t request_type, usb_request_recipient_t recipient,
    124124    uint8_t request,
     
    150150        setup_packet.length = (uint16_t) data_size;
    151151
    152         int rc = usb_endpoint_pipe_control_read(pipe,
     152        int rc = usb_pipe_control_read(pipe,
    153153            &setup_packet, sizeof(setup_packet),
    154154            data, data_size, actual_data_size);
     
    165165 * @return Error code.
    166166 */
    167 int usb_request_get_status(usb_endpoint_pipe_t *pipe,
     167int usb_request_get_status(usb_pipe_t *pipe,
    168168    usb_request_recipient_t recipient, uint16_t index,
    169169    uint16_t *status)
     
    203203 * @return Error code.
    204204 */
    205 int usb_request_clear_feature(usb_endpoint_pipe_t *pipe,
     205int usb_request_clear_feature(usb_pipe_t *pipe,
    206206    usb_request_type_t request_type, usb_request_recipient_t recipient,
    207207    uint16_t feature_selector, uint16_t index)
     
    231231 * @return Error code.
    232232 */
    233 int usb_request_set_feature(usb_endpoint_pipe_t *pipe,
     233int usb_request_set_feature(usb_pipe_t *pipe,
    234234    usb_request_type_t request_type, usb_request_recipient_t recipient,
    235235    uint16_t feature_selector, uint16_t index)
     
    258258 * @return Error code.
    259259 */
    260 int usb_request_set_address(usb_endpoint_pipe_t *pipe,
     260int usb_request_set_address(usb_pipe_t *pipe,
    261261    usb_address_t new_address)
    262262{
     
    297297 * @return Error code.
    298298 */
    299 int usb_request_get_descriptor(usb_endpoint_pipe_t *pipe,
     299int usb_request_get_descriptor(usb_pipe_t *pipe,
    300300    usb_request_type_t request_type, usb_request_recipient_t recipient,
    301301    uint8_t descriptor_type, uint8_t descriptor_index,
     
    331331 * @return
    332332 */
    333 int usb_request_get_descriptor_alloc(usb_endpoint_pipe_t * pipe,
     333int usb_request_get_descriptor_alloc(usb_pipe_t * pipe,
    334334    usb_request_type_t request_type, usb_request_recipient_t recipient,
    335335    uint8_t descriptor_type, uint8_t descriptor_index,
     
    400400 * @return Error code.
    401401 */
    402 int usb_request_get_device_descriptor(usb_endpoint_pipe_t *pipe,
     402int usb_request_get_device_descriptor(usb_pipe_t *pipe,
    403403    usb_standard_device_descriptor_t *descriptor)
    404404{
     
    442442 * @return Error code.
    443443 */
    444 int usb_request_get_bare_configuration_descriptor(usb_endpoint_pipe_t *pipe,
     444int usb_request_get_bare_configuration_descriptor(usb_pipe_t *pipe,
    445445    int index, usb_standard_configuration_descriptor_t *descriptor)
    446446{
     
    488488 * @return Error code.
    489489 */
    490 int usb_request_get_full_configuration_descriptor(usb_endpoint_pipe_t *pipe,
     490int usb_request_get_full_configuration_descriptor(usb_pipe_t *pipe,
    491491    int index, void *descriptor, size_t descriptor_size, size_t *actual_size)
    492492{
     
    514514 */
    515515int usb_request_get_full_configuration_descriptor_alloc(
    516     usb_endpoint_pipe_t *pipe, int index,
     516    usb_pipe_t *pipe, int index,
    517517    void **descriptor_ptr, size_t *descriptor_size)
    518518{
     
    578578 * @return Error code.
    579579 */
    580 int usb_request_set_descriptor(usb_endpoint_pipe_t *pipe,
     580int usb_request_set_descriptor(usb_pipe_t *pipe,
    581581    usb_request_type_t request_type, usb_request_recipient_t recipient,
    582582    uint8_t descriptor_type, uint8_t descriptor_index,
     
    607607 * @return Error code.
    608608 */
    609 int usb_request_get_configuration(usb_endpoint_pipe_t *pipe,
     609int usb_request_get_configuration(usb_pipe_t *pipe,
    610610    uint8_t *configuration_value)
    611611{
     
    639639 * @return Error code.
    640640 */
    641 int usb_request_set_configuration(usb_endpoint_pipe_t *pipe,
     641int usb_request_set_configuration(usb_pipe_t *pipe,
    642642    uint8_t configuration_value)
    643643{
     
    658658 * @return Error code.
    659659 */
    660 int usb_request_get_interface(usb_endpoint_pipe_t *pipe,
     660int usb_request_get_interface(usb_pipe_t *pipe,
    661661    uint8_t interface_index, uint8_t *alternate_setting)
    662662{
     
    691691 * @return Error code.
    692692 */
    693 int usb_request_set_interface(usb_endpoint_pipe_t *pipe,
     693int usb_request_set_interface(usb_pipe_t *pipe,
    694694    uint8_t interface_index, uint8_t alternate_setting)
    695695{
     
    710710 * @return Error code.
    711711 */
    712 int usb_request_get_supported_languages(usb_endpoint_pipe_t *pipe,
     712int usb_request_get_supported_languages(usb_pipe_t *pipe,
    713713    l18_win_locales_t **languages_ptr, size_t *languages_count)
    714714{
     
    782782 * @return Error code.
    783783 */
    784 int usb_request_get_string(usb_endpoint_pipe_t *pipe,
     784int usb_request_get_string(usb_pipe_t *pipe,
    785785    size_t index, l18_win_locales_t lang, char **string_ptr)
    786786{
Note: See TracChangeset for help on using the changeset viewer.