Changeset 3dd80f8 in mainline
- Timestamp:
- 2018-01-24T20:45:40Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 92a7b296
- Parents:
- 4db49344
- Location:
- uspace/drv/bus/usb/xhci
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/xhci/bus.h
r4db49344 r3dd80f8 52 52 } xhci_bus_t; 53 53 54 int xhci_bus_init(xhci_bus_t *, xhci_hc_t *);55 void xhci_bus_fini(xhci_bus_t *);54 extern int xhci_bus_init(xhci_bus_t *, xhci_hc_t *); 55 extern void xhci_bus_fini(xhci_bus_t *); 56 56 57 57 static inline xhci_bus_t *bus_to_xhci_bus(bus_t *bus_base) -
uspace/drv/bus/usb/xhci/commands.h
r4db49344 r3dd80f8 125 125 126 126 /* Command handling control */ 127 int xhci_init_commands(xhci_hc_t *);128 void xhci_fini_commands(xhci_hc_t *);127 extern int xhci_init_commands(xhci_hc_t *); 128 extern void xhci_fini_commands(xhci_hc_t *); 129 129 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 *);130 extern void xhci_stop_command_ring(xhci_hc_t *); 131 extern void xhci_abort_command_ring(xhci_hc_t *); 132 extern void xhci_start_command_ring(xhci_hc_t *); 133 133 134 int xhci_handle_command_completion(xhci_hc_t *, xhci_trb_t *);134 extern int xhci_handle_command_completion(xhci_hc_t *, xhci_trb_t *); 135 135 136 136 /* Command lifecycle */ 137 void xhci_cmd_init(xhci_cmd_t *, xhci_cmd_type_t);138 void xhci_cmd_fini(xhci_cmd_t *);137 extern void xhci_cmd_init(xhci_cmd_t *, xhci_cmd_type_t); 138 extern void xhci_cmd_fini(xhci_cmd_t *); 139 139 140 140 /* 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 *);141 extern int xhci_cmd_sync(xhci_hc_t *, xhci_cmd_t *); 142 extern int xhci_cmd_sync_fini(xhci_hc_t *, xhci_cmd_t *); 143 extern int xhci_cmd_async_fini(xhci_hc_t *, xhci_cmd_t *); 144 144 145 145 static inline int xhci_cmd_sync_inline_wrapper(xhci_hc_t *hc, xhci_cmd_t cmd) -
uspace/drv/bus/usb/xhci/debug.h
r4db49344 r3dd80f8 50 50 struct xhci_input_ctx; 51 51 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 *);52 extern void xhci_dump_cap_regs(const struct xhci_cap_regs *); 53 extern void xhci_dump_port(const struct xhci_port_regs *); 54 extern void xhci_dump_state(const struct xhci_hc *); 55 extern void xhci_dump_ports(const struct xhci_hc *); 56 56 57 const char *xhci_trb_str_type(unsigned);58 void xhci_dump_trb(const struct xhci_trb *trb);57 extern const char *xhci_trb_str_type(unsigned); 58 extern void xhci_dump_trb(const struct xhci_trb *trb); 59 59 60 const char *xhci_ec_str_id(unsigned);61 void xhci_dump_extcap(const struct xhci_extcap *);60 extern const char *xhci_ec_str_id(unsigned); 61 extern void xhci_dump_extcap(const struct xhci_extcap *); 62 62 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 *);63 extern void xhci_dump_slot_ctx(const struct xhci_slot_ctx *); 64 extern void xhci_dump_endpoint_ctx(const struct xhci_endpoint_ctx *); 65 extern void xhci_dump_input_ctx(const struct xhci_hc *, const struct xhci_input_ctx *); 66 66 67 67 #endif -
uspace/drv/bus/usb/xhci/endpoint.h
r4db49344 r3dd80f8 109 109 (usb_str_transfer_type((ep).base.transfer_type)) 110 110 111 int xhci_endpoint_type(xhci_endpoint_t *ep);111 extern int xhci_endpoint_type(xhci_endpoint_t *ep); 112 112 113 e ndpoint_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 *);113 extern endpoint_t *xhci_endpoint_create(device_t *, const usb_endpoint_descriptors_t *); 114 extern int xhci_endpoint_register(endpoint_t *); 115 extern void xhci_endpoint_unregister(endpoint_t *); 116 extern void xhci_endpoint_destroy(endpoint_t *); 117 117 118 void xhci_endpoint_free_transfer_ds(xhci_endpoint_t *);119 xhci_trb_ring_t *xhci_endpoint_get_ring(xhci_endpoint_t *, uint32_t);118 extern void xhci_endpoint_free_transfer_ds(xhci_endpoint_t *); 119 extern xhci_trb_ring_t *xhci_endpoint_get_ring(xhci_endpoint_t *, uint32_t); 120 120 121 void xhci_setup_endpoint_context(xhci_endpoint_t *, xhci_ep_ctx_t *);122 int xhci_endpoint_clear_halt(xhci_endpoint_t *, unsigned);121 extern void xhci_setup_endpoint_context(xhci_endpoint_t *, xhci_ep_ctx_t *); 122 extern int xhci_endpoint_clear_halt(xhci_endpoint_t *, unsigned); 123 123 124 124 static inline xhci_endpoint_t * xhci_endpoint_get(endpoint_t *ep) -
uspace/drv/bus/usb/xhci/hc.h
r4db49344 r3dd80f8 114 114 typedef struct xhci_device xhci_device_t; 115 115 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 *);116 extern int hc_init_mmio(xhci_hc_t *, const hw_res_list_parsed_t *); 117 extern int hc_init_memory(xhci_hc_t *, ddf_dev_t *); 118 extern int hc_claim(xhci_hc_t *, ddf_dev_t *); 119 extern int hc_irq_code_gen(irq_code_t *, xhci_hc_t *, const hw_res_list_parsed_t *); 120 extern int hc_start(xhci_hc_t *, bool); 121 extern void hc_fini(xhci_hc_t *); 122 122 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);123 extern void hc_ring_doorbell(xhci_hc_t *, unsigned, unsigned); 124 extern void hc_ring_ep_doorbell(xhci_endpoint_t *, uint32_t); 125 extern unsigned hc_speed_to_psiv(usb_speed_t); 126 126 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);127 extern int hc_enable_slot(xhci_device_t *); 128 extern int hc_disable_slot(xhci_device_t *); 129 extern int hc_address_device(xhci_device_t *); 130 extern int hc_configure_device(xhci_device_t *); 131 extern int hc_deconfigure_device(xhci_device_t *); 132 extern int hc_add_endpoint(xhci_endpoint_t *); 133 extern int hc_drop_endpoint(xhci_endpoint_t *); 134 extern int hc_update_endpoint(xhci_endpoint_t *); 135 extern int hc_stop_endpoint(xhci_endpoint_t *); 136 extern int hc_reset_endpoint(xhci_endpoint_t *); 137 extern int hc_reset_ring(xhci_endpoint_t *, uint32_t); 138 138 139 int hc_status(bus_t *, uint32_t *);140 void hc_interrupt(bus_t *, uint32_t);139 extern int hc_status(bus_t *, uint32_t *); 140 extern void hc_interrupt(bus_t *, uint32_t); 141 141 142 142 #endif -
uspace/drv/bus/usb/xhci/isoch.h
r4db49344 r3dd80f8 117 117 typedef struct usb_endpoint_descriptors usb_endpoint_descriptors_t; 118 118 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 *);119 extern void isoch_init(xhci_endpoint_t *, const usb_endpoint_descriptors_t *); 120 extern void isoch_fini(xhci_endpoint_t *); 121 extern int isoch_alloc_transfers(xhci_endpoint_t *); 122 122 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 *);123 extern int isoch_schedule_out(xhci_transfer_t *); 124 extern int isoch_schedule_in(xhci_transfer_t *); 125 extern void isoch_handle_transfer_event(xhci_hc_t *, xhci_endpoint_t *, xhci_trb_t *); 126 126 127 127 #endif -
uspace/drv/bus/usb/xhci/rh.h
r4db49344 r3dd80f8 75 75 } xhci_rh_t; 76 76 77 int xhci_rh_init(xhci_rh_t *, xhci_hc_t *);78 int xhci_rh_fini(xhci_rh_t *);77 extern int xhci_rh_init(xhci_rh_t *, xhci_hc_t *); 78 extern int xhci_rh_fini(xhci_rh_t *); 79 79 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 *);80 extern void xhci_rh_handle_port_change(xhci_rh_t *, uint8_t); 81 extern void xhci_rh_set_ports_protocol(xhci_rh_t *, unsigned, unsigned, unsigned); 82 extern void xhci_rh_startup(xhci_rh_t *); 83 83 84 84 #endif -
uspace/drv/bus/usb/xhci/scratchpad.h
r4db49344 r3dd80f8 45 45 typedef struct xhci_hc xhci_hc_t; 46 46 47 int xhci_scratchpad_alloc(xhci_hc_t *);48 void xhci_scratchpad_free(xhci_hc_t *);47 extern int xhci_scratchpad_alloc(xhci_hc_t *); 48 extern void xhci_scratchpad_free(xhci_hc_t *); 49 49 50 50 #endif -
uspace/drv/bus/usb/xhci/streams.h
r4db49344 r3dd80f8 61 61 } xhci_stream_data_t; 62 62 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);63 extern xhci_stream_data_t *xhci_get_stream_ctx_data(xhci_endpoint_t *ep, uint32_t stream_id); 64 extern void xhci_stream_free_ds(xhci_endpoint_t *xhci_ep); 65 65 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,66 extern int xhci_endpoint_remove_streams(xhci_hc_t *hc, xhci_device_t *dev, xhci_endpoint_t *xhci_ep); 67 extern int xhci_endpoint_request_primary_streams(xhci_hc_t *hc, xhci_device_t *dev, 68 68 xhci_endpoint_t *xhci_ep, unsigned count); 69 int xhci_endpoint_request_secondary_streams(xhci_hc_t *hc, xhci_device_t *dev,69 extern int xhci_endpoint_request_secondary_streams(xhci_hc_t *hc, xhci_device_t *dev, 70 70 xhci_endpoint_t *xhci_ep, unsigned *sizes, unsigned count); 71 71 -
uspace/drv/bus/usb/xhci/transfers.h
r4db49344 r3dd80f8 55 55 } xhci_transfer_t; 56 56 57 usb_transfer_batch_t* xhci_transfer_create(endpoint_t *);58 int xhci_transfer_schedule(usb_transfer_batch_t *);57 extern usb_transfer_batch_t* xhci_transfer_create(endpoint_t *); 58 extern int xhci_transfer_schedule(usb_transfer_batch_t *); 59 59 60 int xhci_handle_transfer_event(xhci_hc_t *, xhci_trb_t *);61 void xhci_transfer_destroy(usb_transfer_batch_t *);60 extern int xhci_handle_transfer_event(xhci_hc_t *, xhci_trb_t *); 61 extern void xhci_transfer_destroy(usb_transfer_batch_t *); 62 62 63 63 static inline xhci_transfer_t *xhci_transfer_from_batch(usb_transfer_batch_t *batch) -
uspace/drv/bus/usb/xhci/trb_ring.h
r4db49344 r3dd80f8 74 74 } xhci_trb_ring_t; 75 75 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 *);76 extern int xhci_trb_ring_init(xhci_trb_ring_t *, size_t); 77 extern void xhci_trb_ring_fini(xhci_trb_ring_t *); 78 extern int xhci_trb_ring_enqueue(xhci_trb_ring_t *, xhci_trb_t *, uintptr_t *); 79 extern int xhci_trb_ring_enqueue_multiple(xhci_trb_ring_t *, xhci_trb_t *, size_t, uintptr_t *); 80 80 81 void xhci_trb_ring_reset_dequeue_state(xhci_trb_ring_t *ring, uintptr_t *addr);81 extern void xhci_trb_ring_reset_dequeue_state(xhci_trb_ring_t *ring, uintptr_t *addr); 82 82 83 83 /** … … 107 107 } xhci_event_ring_t; 108 108 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 *);109 extern int xhci_event_ring_init(xhci_event_ring_t *, size_t); 110 extern void xhci_event_ring_fini(xhci_event_ring_t *); 111 extern int xhci_event_ring_dequeue(xhci_event_ring_t *, xhci_trb_t *); 112 112 113 113 /** … … 124 124 } xhci_sw_ring_t; 125 125 126 void xhci_sw_ring_init(xhci_sw_ring_t *, size_t);126 extern void xhci_sw_ring_init(xhci_sw_ring_t *, size_t); 127 127 128 128 /* 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 *);129 extern int xhci_sw_ring_enqueue(xhci_sw_ring_t *, xhci_trb_t *); 130 extern int xhci_sw_ring_dequeue(xhci_sw_ring_t *, xhci_trb_t *); 131 131 132 void xhci_sw_ring_stop(xhci_sw_ring_t *);133 void xhci_sw_ring_fini(xhci_sw_ring_t *);132 extern void xhci_sw_ring_stop(xhci_sw_ring_t *); 133 extern void xhci_sw_ring_fini(xhci_sw_ring_t *); 134 134 135 135 #endif
Note:
See TracChangeset
for help on using the changeset viewer.