Changeset 3dd80f8 in mainline


Ignore:
Timestamp:
2018-01-24T20:45:40Z (6 years ago)
Author:
Jenda <jenda.jzqk73@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
92a7b296
Parents:
4db49344
Message:

xhci: extern all the things!

Location:
uspace/drv/bus/usb/xhci
Files:
11 edited

Legend:

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

    r4db49344 r3dd80f8  
    5252} xhci_bus_t;
    5353
    54 int xhci_bus_init(xhci_bus_t *, xhci_hc_t *);
    55 void xhci_bus_fini(xhci_bus_t *);
     54extern int xhci_bus_init(xhci_bus_t *, xhci_hc_t *);
     55extern void xhci_bus_fini(xhci_bus_t *);
    5656
    5757static inline xhci_bus_t *bus_to_xhci_bus(bus_t *bus_base)
  • uspace/drv/bus/usb/xhci/commands.h

    r4db49344 r3dd80f8  
    125125
    126126/* Command handling control */
    127 int xhci_init_commands(xhci_hc_t *);
    128 void xhci_fini_commands(xhci_hc_t *);
     127extern int xhci_init_commands(xhci_hc_t *);
     128extern void xhci_fini_commands(xhci_hc_t *);
    129129
    130 void xhci_stop_command_ring(xhci_hc_t *);
    131 void xhci_abort_command_ring(xhci_hc_t *);
    132 void xhci_start_command_ring(xhci_hc_t *);
     130extern void xhci_stop_command_ring(xhci_hc_t *);
     131extern void xhci_abort_command_ring(xhci_hc_t *);
     132extern void xhci_start_command_ring(xhci_hc_t *);
    133133
    134 int xhci_handle_command_completion(xhci_hc_t *, xhci_trb_t *);
     134extern int xhci_handle_command_completion(xhci_hc_t *, xhci_trb_t *);
    135135
    136136/* Command lifecycle */
    137 void xhci_cmd_init(xhci_cmd_t *, xhci_cmd_type_t);
    138 void xhci_cmd_fini(xhci_cmd_t *);
     137extern void xhci_cmd_init(xhci_cmd_t *, xhci_cmd_type_t);
     138extern void xhci_cmd_fini(xhci_cmd_t *);
    139139
    140140/* Issuing commands */
    141 int xhci_cmd_sync(xhci_hc_t *, xhci_cmd_t *);
    142 int xhci_cmd_sync_fini(xhci_hc_t *, xhci_cmd_t *);
    143 int xhci_cmd_async_fini(xhci_hc_t *, xhci_cmd_t *);
     141extern int xhci_cmd_sync(xhci_hc_t *, xhci_cmd_t *);
     142extern int xhci_cmd_sync_fini(xhci_hc_t *, xhci_cmd_t *);
     143extern int xhci_cmd_async_fini(xhci_hc_t *, xhci_cmd_t *);
    144144
    145145static inline int xhci_cmd_sync_inline_wrapper(xhci_hc_t *hc, xhci_cmd_t cmd)
  • uspace/drv/bus/usb/xhci/debug.h

    r4db49344 r3dd80f8  
    5050struct xhci_input_ctx;
    5151
    52 void xhci_dump_cap_regs(const struct xhci_cap_regs *);
    53 void xhci_dump_port(const struct xhci_port_regs *);
    54 void xhci_dump_state(const struct xhci_hc *);
    55 void xhci_dump_ports(const struct xhci_hc *);
     52extern void xhci_dump_cap_regs(const struct xhci_cap_regs *);
     53extern void xhci_dump_port(const struct xhci_port_regs *);
     54extern void xhci_dump_state(const struct xhci_hc *);
     55extern void xhci_dump_ports(const struct xhci_hc *);
    5656
    57 const char *xhci_trb_str_type(unsigned);
    58 void xhci_dump_trb(const struct xhci_trb *trb);
     57extern const char *xhci_trb_str_type(unsigned);
     58extern void xhci_dump_trb(const struct xhci_trb *trb);
    5959
    60 const char *xhci_ec_str_id(unsigned);
    61 void xhci_dump_extcap(const struct xhci_extcap *);
     60extern const char *xhci_ec_str_id(unsigned);
     61extern void xhci_dump_extcap(const struct xhci_extcap *);
    6262
    63 void xhci_dump_slot_ctx(const struct xhci_slot_ctx *);
    64 void xhci_dump_endpoint_ctx(const struct xhci_endpoint_ctx *);
    65 void xhci_dump_input_ctx(const struct xhci_hc *, const struct xhci_input_ctx *);
     63extern void xhci_dump_slot_ctx(const struct xhci_slot_ctx *);
     64extern void xhci_dump_endpoint_ctx(const struct xhci_endpoint_ctx *);
     65extern void xhci_dump_input_ctx(const struct xhci_hc *, const struct xhci_input_ctx *);
    6666
    6767#endif
  • uspace/drv/bus/usb/xhci/endpoint.h

    r4db49344 r3dd80f8  
    109109        (usb_str_transfer_type((ep).base.transfer_type))
    110110
    111 int xhci_endpoint_type(xhci_endpoint_t *ep);
     111extern int xhci_endpoint_type(xhci_endpoint_t *ep);
    112112
    113 endpoint_t *xhci_endpoint_create(device_t *, const usb_endpoint_descriptors_t *);
    114 int xhci_endpoint_register(endpoint_t *);
    115 void xhci_endpoint_unregister(endpoint_t *);
    116 void xhci_endpoint_destroy(endpoint_t *);
     113extern endpoint_t *xhci_endpoint_create(device_t *, const usb_endpoint_descriptors_t *);
     114extern int xhci_endpoint_register(endpoint_t *);
     115extern void xhci_endpoint_unregister(endpoint_t *);
     116extern void xhci_endpoint_destroy(endpoint_t *);
    117117
    118 void xhci_endpoint_free_transfer_ds(xhci_endpoint_t *);
    119 xhci_trb_ring_t *xhci_endpoint_get_ring(xhci_endpoint_t *, uint32_t);
     118extern void xhci_endpoint_free_transfer_ds(xhci_endpoint_t *);
     119extern xhci_trb_ring_t *xhci_endpoint_get_ring(xhci_endpoint_t *, uint32_t);
    120120
    121 void xhci_setup_endpoint_context(xhci_endpoint_t *, xhci_ep_ctx_t *);
    122 int xhci_endpoint_clear_halt(xhci_endpoint_t *, unsigned);
     121extern void xhci_setup_endpoint_context(xhci_endpoint_t *, xhci_ep_ctx_t *);
     122extern int xhci_endpoint_clear_halt(xhci_endpoint_t *, unsigned);
    123123
    124124static inline xhci_endpoint_t * xhci_endpoint_get(endpoint_t *ep)
  • uspace/drv/bus/usb/xhci/hc.h

    r4db49344 r3dd80f8  
    114114typedef struct xhci_device xhci_device_t;
    115115
    116 int hc_init_mmio(xhci_hc_t *, const hw_res_list_parsed_t *);
    117 int hc_init_memory(xhci_hc_t *, ddf_dev_t *);
    118 int hc_claim(xhci_hc_t *, ddf_dev_t *);
    119 int hc_irq_code_gen(irq_code_t *, xhci_hc_t *, const hw_res_list_parsed_t *);
    120 int hc_start(xhci_hc_t *, bool);
    121 void hc_fini(xhci_hc_t *);
     116extern int hc_init_mmio(xhci_hc_t *, const hw_res_list_parsed_t *);
     117extern int hc_init_memory(xhci_hc_t *, ddf_dev_t *);
     118extern int hc_claim(xhci_hc_t *, ddf_dev_t *);
     119extern int hc_irq_code_gen(irq_code_t *, xhci_hc_t *, const hw_res_list_parsed_t *);
     120extern int hc_start(xhci_hc_t *, bool);
     121extern void hc_fini(xhci_hc_t *);
    122122
    123 void hc_ring_doorbell(xhci_hc_t *, unsigned, unsigned);
    124 void hc_ring_ep_doorbell(xhci_endpoint_t *, uint32_t);
    125 unsigned hc_speed_to_psiv(usb_speed_t);
     123extern void hc_ring_doorbell(xhci_hc_t *, unsigned, unsigned);
     124extern void hc_ring_ep_doorbell(xhci_endpoint_t *, uint32_t);
     125extern unsigned hc_speed_to_psiv(usb_speed_t);
    126126
    127 int hc_enable_slot(xhci_device_t *);
    128 int hc_disable_slot(xhci_device_t *);
    129 int hc_address_device(xhci_device_t *);
    130 int hc_configure_device(xhci_device_t *);
    131 int hc_deconfigure_device(xhci_device_t *);
    132 int hc_add_endpoint(xhci_endpoint_t *);
    133 int hc_drop_endpoint(xhci_endpoint_t *);
    134 int hc_update_endpoint(xhci_endpoint_t *);
    135 int hc_stop_endpoint(xhci_endpoint_t *);
    136 int hc_reset_endpoint(xhci_endpoint_t *);
    137 int hc_reset_ring(xhci_endpoint_t *, uint32_t);
     127extern int hc_enable_slot(xhci_device_t *);
     128extern int hc_disable_slot(xhci_device_t *);
     129extern int hc_address_device(xhci_device_t *);
     130extern int hc_configure_device(xhci_device_t *);
     131extern int hc_deconfigure_device(xhci_device_t *);
     132extern int hc_add_endpoint(xhci_endpoint_t *);
     133extern int hc_drop_endpoint(xhci_endpoint_t *);
     134extern int hc_update_endpoint(xhci_endpoint_t *);
     135extern int hc_stop_endpoint(xhci_endpoint_t *);
     136extern int hc_reset_endpoint(xhci_endpoint_t *);
     137extern int hc_reset_ring(xhci_endpoint_t *, uint32_t);
    138138
    139 int hc_status(bus_t *, uint32_t *);
    140 void hc_interrupt(bus_t *, uint32_t);
     139extern int hc_status(bus_t *, uint32_t *);
     140extern void hc_interrupt(bus_t *, uint32_t);
    141141
    142142#endif
  • uspace/drv/bus/usb/xhci/isoch.h

    r4db49344 r3dd80f8  
    117117typedef struct usb_endpoint_descriptors usb_endpoint_descriptors_t;
    118118
    119 void isoch_init(xhci_endpoint_t *, const usb_endpoint_descriptors_t *);
    120 void isoch_fini(xhci_endpoint_t *);
    121 int isoch_alloc_transfers(xhci_endpoint_t *);
     119extern void isoch_init(xhci_endpoint_t *, const usb_endpoint_descriptors_t *);
     120extern void isoch_fini(xhci_endpoint_t *);
     121extern int isoch_alloc_transfers(xhci_endpoint_t *);
    122122
    123 int isoch_schedule_out(xhci_transfer_t *);
    124 int isoch_schedule_in(xhci_transfer_t *);
    125 void isoch_handle_transfer_event(xhci_hc_t *, xhci_endpoint_t *, xhci_trb_t *);
     123extern int isoch_schedule_out(xhci_transfer_t *);
     124extern int isoch_schedule_in(xhci_transfer_t *);
     125extern void isoch_handle_transfer_event(xhci_hc_t *, xhci_endpoint_t *, xhci_trb_t *);
    126126
    127127#endif
  • uspace/drv/bus/usb/xhci/rh.h

    r4db49344 r3dd80f8  
    7575} xhci_rh_t;
    7676
    77 int xhci_rh_init(xhci_rh_t *, xhci_hc_t *);
    78 int xhci_rh_fini(xhci_rh_t *);
     77extern int xhci_rh_init(xhci_rh_t *, xhci_hc_t *);
     78extern int xhci_rh_fini(xhci_rh_t *);
    7979
    80 void xhci_rh_handle_port_change(xhci_rh_t *, uint8_t);
    81 void xhci_rh_set_ports_protocol(xhci_rh_t *, unsigned, unsigned, unsigned);
    82 void xhci_rh_startup(xhci_rh_t *);
     80extern void xhci_rh_handle_port_change(xhci_rh_t *, uint8_t);
     81extern void xhci_rh_set_ports_protocol(xhci_rh_t *, unsigned, unsigned, unsigned);
     82extern void xhci_rh_startup(xhci_rh_t *);
    8383
    8484#endif
  • uspace/drv/bus/usb/xhci/scratchpad.h

    r4db49344 r3dd80f8  
    4545typedef struct xhci_hc xhci_hc_t;
    4646
    47 int xhci_scratchpad_alloc(xhci_hc_t *);
    48 void xhci_scratchpad_free(xhci_hc_t *);
     47extern int xhci_scratchpad_alloc(xhci_hc_t *);
     48extern void xhci_scratchpad_free(xhci_hc_t *);
    4949
    5050#endif
  • uspace/drv/bus/usb/xhci/streams.h

    r4db49344 r3dd80f8  
    6161} xhci_stream_data_t;
    6262
    63 xhci_stream_data_t *xhci_get_stream_ctx_data(xhci_endpoint_t *ep, uint32_t stream_id);
    64 void xhci_stream_free_ds(xhci_endpoint_t *xhci_ep);
     63extern xhci_stream_data_t *xhci_get_stream_ctx_data(xhci_endpoint_t *ep, uint32_t stream_id);
     64extern void xhci_stream_free_ds(xhci_endpoint_t *xhci_ep);
    6565
    66 int xhci_endpoint_remove_streams(xhci_hc_t *hc, xhci_device_t *dev, xhci_endpoint_t *xhci_ep);
    67 int xhci_endpoint_request_primary_streams(xhci_hc_t *hc, xhci_device_t *dev,
     66extern int xhci_endpoint_remove_streams(xhci_hc_t *hc, xhci_device_t *dev, xhci_endpoint_t *xhci_ep);
     67extern int xhci_endpoint_request_primary_streams(xhci_hc_t *hc, xhci_device_t *dev,
    6868        xhci_endpoint_t *xhci_ep, unsigned count);
    69 int xhci_endpoint_request_secondary_streams(xhci_hc_t *hc, xhci_device_t *dev,
     69extern int xhci_endpoint_request_secondary_streams(xhci_hc_t *hc, xhci_device_t *dev,
    7070        xhci_endpoint_t *xhci_ep, unsigned *sizes, unsigned count);
    7171
  • uspace/drv/bus/usb/xhci/transfers.h

    r4db49344 r3dd80f8  
    5555} xhci_transfer_t;
    5656
    57 usb_transfer_batch_t* xhci_transfer_create(endpoint_t *);
    58 int xhci_transfer_schedule(usb_transfer_batch_t *);
     57extern usb_transfer_batch_t* xhci_transfer_create(endpoint_t *);
     58extern int xhci_transfer_schedule(usb_transfer_batch_t *);
    5959
    60 int xhci_handle_transfer_event(xhci_hc_t *, xhci_trb_t *);
    61 void xhci_transfer_destroy(usb_transfer_batch_t *);
     60extern int xhci_handle_transfer_event(xhci_hc_t *, xhci_trb_t *);
     61extern void xhci_transfer_destroy(usb_transfer_batch_t *);
    6262
    6363static inline xhci_transfer_t *xhci_transfer_from_batch(usb_transfer_batch_t *batch)
  • uspace/drv/bus/usb/xhci/trb_ring.h

    r4db49344 r3dd80f8  
    7474} xhci_trb_ring_t;
    7575
    76 int xhci_trb_ring_init(xhci_trb_ring_t *, size_t);
    77 void xhci_trb_ring_fini(xhci_trb_ring_t *);
    78 int xhci_trb_ring_enqueue(xhci_trb_ring_t *, xhci_trb_t *, uintptr_t *);
    79 int xhci_trb_ring_enqueue_multiple(xhci_trb_ring_t *, xhci_trb_t *, size_t, uintptr_t *);
     76extern int xhci_trb_ring_init(xhci_trb_ring_t *, size_t);
     77extern void xhci_trb_ring_fini(xhci_trb_ring_t *);
     78extern int xhci_trb_ring_enqueue(xhci_trb_ring_t *, xhci_trb_t *, uintptr_t *);
     79extern int xhci_trb_ring_enqueue_multiple(xhci_trb_ring_t *, xhci_trb_t *, size_t, uintptr_t *);
    8080
    81 void xhci_trb_ring_reset_dequeue_state(xhci_trb_ring_t *ring, uintptr_t *addr);
     81extern void xhci_trb_ring_reset_dequeue_state(xhci_trb_ring_t *ring, uintptr_t *addr);
    8282
    8383/**
     
    107107} xhci_event_ring_t;
    108108
    109 int xhci_event_ring_init(xhci_event_ring_t *, size_t);
    110 void xhci_event_ring_fini(xhci_event_ring_t *);
    111 int xhci_event_ring_dequeue(xhci_event_ring_t *, xhci_trb_t *);
     109extern int xhci_event_ring_init(xhci_event_ring_t *, size_t);
     110extern void xhci_event_ring_fini(xhci_event_ring_t *);
     111extern int xhci_event_ring_dequeue(xhci_event_ring_t *, xhci_trb_t *);
    112112
    113113/**
     
    124124} xhci_sw_ring_t;
    125125
    126 void xhci_sw_ring_init(xhci_sw_ring_t *, size_t);
     126extern void xhci_sw_ring_init(xhci_sw_ring_t *, size_t);
    127127
    128128/* Both may block if the ring is full/empty. */
    129 int xhci_sw_ring_enqueue(xhci_sw_ring_t *, xhci_trb_t *);
    130 int xhci_sw_ring_dequeue(xhci_sw_ring_t *, xhci_trb_t *);
     129extern int xhci_sw_ring_enqueue(xhci_sw_ring_t *, xhci_trb_t *);
     130extern int xhci_sw_ring_dequeue(xhci_sw_ring_t *, xhci_trb_t *);
    131131
    132 void xhci_sw_ring_stop(xhci_sw_ring_t *);
    133 void xhci_sw_ring_fini(xhci_sw_ring_t *);
     132extern void xhci_sw_ring_stop(xhci_sw_ring_t *);
     133extern void xhci_sw_ring_fini(xhci_sw_ring_t *);
    134134
    135135#endif
Note: See TracChangeset for help on using the changeset viewer.