Changeset 9868982 in mainline for uspace/drv/bus/usb/xhci/bus.c


Ignore:
Timestamp:
2017-10-28T16:35:32Z (6 years ago)
Author:
Petr Manek <petr.manek@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a3044b4
Parents:
c910ecf
Message:

Refactoring. XHCI bus ops are set using a neat macro.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/xhci/bus.c

    rc910ecf r9868982  
    484484
    485485static const bus_ops_t xhci_bus_ops = {
    486         .enumerate_device = enumerate_device,
    487         .remove_device = remove_device,
    488 
    489         .online_device = online_device,
    490         .offline_device = offline_device,
    491 
    492         .create_endpoint = create_endpoint,
    493         .destroy_endpoint = destroy_endpoint,
    494 
    495         .register_endpoint = register_endpoint,
    496         .unregister_endpoint = unregister_endpoint,
    497         .find_endpoint = find_endpoint,
    498 
    499         .request_address = request_address,
    500         .release_address = release_address,
    501         .reset_toggle = reset_toggle,
    502 
    503         .count_bw = count_bw,
    504 
    505         .endpoint_get_toggle = endpoint_get_toggle,
    506         .endpoint_set_toggle = endpoint_set_toggle,
    507 
    508         .create_batch = create_batch,
    509         .destroy_batch = destroy_batch,
     486#define BIND_OP(op) .op = op,
     487        BIND_OP(enumerate_device)
     488        BIND_OP(remove_device)
     489
     490        BIND_OP(online_device)
     491        BIND_OP(offline_device)
     492
     493        BIND_OP(create_endpoint)
     494        BIND_OP(destroy_endpoint)
     495
     496        BIND_OP(register_endpoint)
     497        BIND_OP(unregister_endpoint)
     498        BIND_OP(find_endpoint)
     499
     500        BIND_OP(request_address)
     501        BIND_OP(release_address)
     502        BIND_OP(reset_toggle)
     503
     504        BIND_OP(count_bw)
     505
     506        BIND_OP(endpoint_get_toggle)
     507        BIND_OP(endpoint_set_toggle)
     508
     509        BIND_OP(create_batch)
     510        BIND_OP(destroy_batch)
     511#undef BIND_OP
    510512};
    511513
Note: See TracChangeset for help on using the changeset viewer.