Changeset 58563585 in mainline for uspace/drv
- Timestamp:
- 2016-08-31T11:15:39Z (9 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 10cb47e
- Parents:
- 7a67416
- Location:
- uspace/drv
- Files:
-
- 46 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/ehci/main.c
r7a67416 r58563585 27 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 28 */ 29 29 30 /** @addtogroup drvusbehci 30 31 * @{ … … 33 34 * Main routines of EHCI driver. 34 35 */ 36 35 37 #include <ddf/driver.h> 36 38 #include <ddf/interrupt.h> … … 70 72 71 73 72 static int ehci_driver_init(hcd_t *hcd, const hw_res_list_parsed_t *res, bool irq) 74 static int ehci_driver_init(hcd_t *hcd, const hw_res_list_parsed_t *res, 75 bool irq) 73 76 { 74 77 assert(hcd); … … 138 141 return ddf_driver_main(&ehci_driver); 139 142 } 143 140 144 /** 141 145 * @} -
uspace/drv/bus/usb/ehci/res.h
r7a67416 r58563585 39 39 #include <device/hw_res_parsed.h> 40 40 41 int disable_legacy(ddf_dev_t *);41 extern int disable_legacy(ddf_dev_t *); 42 42 43 43 #endif -
uspace/drv/bus/usb/ohci/endpoint_list.h
r7a67416 r58563585 76 76 void endpoint_list_add_ep(endpoint_list_t *instance, ohci_endpoint_t *ep); 77 77 void endpoint_list_remove_ep(endpoint_list_t *instance, ohci_endpoint_t *ep); 78 78 79 #endif 80 79 81 /** 80 82 * @} -
uspace/drv/bus/usb/ohci/hc.c
r7a67416 r58563585 177 177 usb_log_error("Failed to create OHCI memory structures: %s.\n", 178 178 str_error(ret)); 179 // TODO: We should disable pio access here179 // TODO: We should disable pio access here 180 180 return ret; 181 181 } … … 393 393 ohci_emulation_reg, OHCI_RD(*ohci_emulation_reg)); 394 394 /* Zero everything but A20State */ 395 // TODO: should we ack interrupts before doing this?395 // TODO: should we ack interrupts before doing this? 396 396 OHCI_CLR(*ohci_emulation_reg, ~0x100); 397 397 usb_log_debug( … … 403 403 if (OHCI_RD(instance->registers->control) & C_IR) { 404 404 usb_log_debug("SMM driver: request ownership change.\n"); 405 // TODO: should we ack interrupts before doing this?405 // TODO: should we ack interrupts before doing this? 406 406 OHCI_SET(instance->registers->command_status, CS_OCR); 407 407 /* Hope that SMM actually knows its stuff or we can hang here */ -
uspace/drv/bus/usb/ohci/hc.h
r7a67416 r58563585 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 28 29 /** @addtogroup drvusbohci 29 30 * @{ … … 32 33 * @brief OHCI host controller driver structure 33 34 */ 35 34 36 #ifndef DRV_OHCI_HC_H 35 37 #define DRV_OHCI_HC_H … … 78 80 } hc_t; 79 81 80 int hc_init(hc_t *instance, const hw_res_list_parsed_t *hw_res, bool interrupts);81 void hc_fini(hc_t *instance);82 extern int hc_init(hc_t *, const hw_res_list_parsed_t *, bool); 83 extern void hc_fini(hc_t *); 82 84 83 void hc_enqueue_endpoint(hc_t *instance, const endpoint_t *ep);84 void hc_dequeue_endpoint(hc_t *instance, const endpoint_t *ep);85 extern void hc_enqueue_endpoint(hc_t *, const endpoint_t *); 86 extern void hc_dequeue_endpoint(hc_t *, const endpoint_t *); 85 87 86 88 int ohci_hc_gen_irq_code(irq_code_t *code, const hw_res_list_parsed_t *hw_res); 87 89 88 void ohci_hc_interrupt(hcd_t *hcd, uint32_t status); 89 int ohci_hc_status(hcd_t *hcd, uint32_t *status); 90 int ohci_hc_schedule(hcd_t *hcd, usb_transfer_batch_t *batch); 90 extern void ohci_hc_interrupt(hcd_t *, uint32_t); 91 extern int ohci_hc_status(hcd_t *, uint32_t *); 92 extern int ohci_hc_schedule(hcd_t *, usb_transfer_batch_t *); 93 91 94 #endif 95 92 96 /** 93 97 * @} -
uspace/drv/bus/usb/ohci/hw_struct/completion_codes.h
r7a67416 r58563585 54 54 }; 55 55 56 inline static unsigned cc_to_rc(unsignedcc)56 inline static unsigned int cc_to_rc(unsigned int cc) 57 57 { 58 58 switch (cc) { -
uspace/drv/bus/usb/ohci/hw_struct/endpoint_descriptor.c
r7a67416 r58563585 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 28 29 /** @addtogroup drvusbohci 29 30 * @{ -
uspace/drv/bus/usb/ohci/hw_struct/hcca.h
r7a67416 r58563585 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 28 29 /** @addtogroup drvusbohci 29 30 * @{ … … 32 33 * @brief OHCI driver 33 34 */ 35 34 36 #ifndef DRV_OHCI_HW_STRUCT_HCCA_H 35 37 #define DRV_OHCI_HW_STRUCT_HCCA_H … … 85 87 OHCI_MEM32_WR(hcca->int_ep[index], pa); 86 88 } 89 87 90 #endif 91 88 92 /** 89 93 * @} -
uspace/drv/bus/usb/ohci/hw_struct/iso_transfer_descriptor.h
r7a67416 r58563585 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 28 29 /** @addtogroup drvusbohci 29 30 * @{ … … 32 33 * @brief OHCI driver 33 34 */ 35 34 36 #ifndef DRV_OHCI_HW_STRUCT_ISO_TRANSFER_DESCRIPTOR_H 35 37 #define DRV_OHCI_HW_STRUCT_ISO_TRANSFER_DESCRIPTOR_H … … 68 70 69 71 } __attribute__((packed)) itd_t; 72 70 73 #endif 74 71 75 /** 72 76 * @} -
uspace/drv/bus/usb/ohci/hw_struct/mem_access.h
r7a67416 r58563585 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 28 29 /** @addtogroup drvusbohci 29 30 * @{ … … 32 33 * @brief OHCI driver 33 34 */ 35 34 36 #ifndef DRV_OHCI_HW_MEM_ACCESS_H 35 37 #define DRV_OHCI_HW_MEM_ACCESS_H -
uspace/drv/bus/usb/ohci/hw_struct/transfer_descriptor.c
r7a67416 r58563585 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 28 29 /** @addtogroup drvusbohci 29 30 * @{ -
uspace/drv/bus/usb/ohci/hw_struct/transfer_descriptor.h
r7a67416 r58563585 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 28 29 /** @addtogroup drvusbohci 29 30 * @{ … … 32 33 * @brief OHCI driver 33 34 */ 35 34 36 #ifndef DRV_OHCI_HW_STRUCT_TRANSFER_DESCRIPTOR_H 35 37 #define DRV_OHCI_HW_STRUCT_TRANSFER_DESCRIPTOR_H … … 139 141 return OHCI_MEM32_RD(instance->be) - OHCI_MEM32_RD(instance->cbp) + 1; 140 142 } 143 141 144 #endif 145 142 146 /** 143 147 * @} -
uspace/drv/bus/usb/ohci/main.c
r7a67416 r58563585 27 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 28 */ 29 29 30 /** @addtogroup drvusbohci 30 31 * @{ … … 128 129 return ddf_driver_main(&ohci_driver); 129 130 } 131 130 132 /** 131 133 * @} -
uspace/drv/bus/usb/ohci/ohci_batch.c
r7a67416 r58563585 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 28 29 /** @addtogroup drvusbohci 29 30 * @{ -
uspace/drv/bus/usb/ohci/ohci_endpoint.c
r7a67416 r58563585 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 28 29 /** @addtogroup drvusbohci 29 30 * @{ … … 117 118 } 118 119 } 120 119 121 /** 120 122 * @} -
uspace/drv/bus/usb/ohci/ohci_regs.h
r7a67416 r58563585 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 28 29 /** @addtogroup drvusbohci 29 30 * @{ … … 32 33 * @brief OHCI host controller register structure 33 34 */ 35 34 36 #ifndef DRV_OHCI_OHCI_REGS_H 35 37 #define DRV_OHCI_OHCI_REGS_H 38 36 39 #include <ddi.h> 37 40 #include <sys/types.h> … … 246 249 #define RHPS_CHANGE_WC_MASK (0x1f0000) 247 250 } ohci_regs_t; 251 248 252 #endif 253 249 254 /** 250 255 * @} -
uspace/drv/bus/usb/uhci/hc.c
r7a67416 r58563585 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 28 29 /** @addtogroup drvusbuhcihc 29 30 * @{ -
uspace/drv/bus/usb/uhci/hc.h
r7a67416 r58563585 33 33 * @brief UHCI host controller driver structure 34 34 */ 35 35 36 #ifndef DRV_UHCI_HC_H 36 37 #define DRV_UHCI_HC_H … … 123 124 } hc_t; 124 125 125 int hc_init(hc_t *instance, const hw_res_list_parsed_t *hw_res, bool interupts);126 void hc_fini(hc_t *instance);126 extern int hc_init(hc_t *, const hw_res_list_parsed_t *, bool); 127 extern void hc_fini(hc_t *); 127 128 128 int uhci_hc_gen_irq_code(irq_code_t *code, const hw_res_list_parsed_t *hw_res);129 extern int uhci_hc_gen_irq_code(irq_code_t *, const hw_res_list_parsed_t *); 129 130 130 void uhci_hc_interrupt(hcd_t *hcd, uint32_t status);131 int uhci_hc_status(hcd_t *hcd, uint32_t *status);132 int uhci_hc_schedule(hcd_t *hcd, usb_transfer_batch_t *batch);131 extern void uhci_hc_interrupt(hcd_t *, uint32_t); 132 extern int uhci_hc_status(hcd_t *, uint32_t *); 133 extern int uhci_hc_schedule(hcd_t *, usb_transfer_batch_t *); 133 134 134 135 #endif -
uspace/drv/bus/usb/uhci/hw_struct/link_pointer.h
r7a67416 r58563585 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 28 29 /** @addtogroup drvusbuhcihc 29 30 * @{ … … 32 33 * @brief UHCI driver 33 34 */ 35 34 36 #ifndef DRV_UHCI_HW_STRUCT_LINK_POINTER_H 35 37 #define DRV_UHCI_HW_STRUCT_LINK_POINTER_H … … 58 60 59 61 #endif 62 60 63 /** 61 64 * @} -
uspace/drv/bus/usb/uhci/hw_struct/queue_head.h
r7a67416 r58563585 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 28 29 /** @addtogroup drvusbuhcihc 29 30 * @{ … … 32 33 * @brief UHCI driver 33 34 */ 35 34 36 #ifndef DRV_UHCI_HW_STRUCT_QH_H 35 37 #define DRV_UHCI_HW_STRUCT_QH_H … … 103 105 } 104 106 } 107 105 108 #endif 109 106 110 /** 107 111 * @} -
uspace/drv/bus/usb/uhci/hw_struct/transfer_descriptor.c
r7a67416 r58563585 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 28 29 /** @addtogroup drvusbuhcihc 29 30 * @{ -
uspace/drv/bus/usb/uhci/hw_struct/transfer_descriptor.h
r7a67416 r58563585 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 28 29 /** @addtogroup drvusbuhcihc 29 30 * @{ … … 32 33 * @brief UHCI driver 33 34 */ 35 34 36 #ifndef DRV_UHCI_HW_STRUCT_TRANSFER_DESCRIPTOR_H 35 37 #define DRV_UHCI_HW_STRUCT_TRANSFER_DESCRIPTOR_H … … 165 167 166 168 #endif 169 167 170 /** 168 171 * @} -
uspace/drv/bus/usb/uhci/main.c
r7a67416 r58563585 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 28 29 /** @addtogroup drvusbuhci 29 30 * @{ -
uspace/drv/bus/usb/uhci/transfer_list.h
r7a67416 r58563585 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 28 29 /** @addtogroup drvusbuhcihc 29 30 * @{ … … 32 33 * @brief UHCI driver transfer list structure 33 34 */ 35 34 36 #ifndef DRV_UHCI_TRANSFER_LIST_H 35 37 #define DRV_UHCI_TRANSFER_LIST_H … … 61 63 void transfer_list_remove_finished(transfer_list_t *instance, list_t *done); 62 64 void transfer_list_abort_all(transfer_list_t *instance); 65 63 66 #endif 67 64 68 /** 65 69 * @} -
uspace/drv/bus/usb/uhci/uhci_batch.c
r7a67416 r58563585 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 28 29 /** @addtogroup drvusbuhcihc 29 30 * @{ -
uspace/drv/bus/usb/uhci/uhci_batch.h
r7a67416 r58563585 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 28 29 /** @addtogroup drvusbuhcihc 29 30 * @{ … … 32 33 * @brief UHCI driver USB tranfer helper functions 33 34 */ 35 34 36 #ifndef DRV_UHCI_BATCH_H 35 37 #define DRV_UHCI_BATCH_H … … 119 121 120 122 #endif 123 121 124 /** 122 125 * @} -
uspace/drv/bus/usb/usbhid/mouse/mousedev.c
r7a67416 r58563585 254 254 "will not be destroyed.\n", ddf_fun_get_name(fun)); \ 255 255 } \ 256 } else (void) 0256 } else (void) 0 257 257 258 258 /** Get highest index of a button mentioned in given report. … … 325 325 326 326 if (hid_dev == NULL) { 327 usb_log_error("Failed to init keyboardstructure: no structure"327 usb_log_error("Failed to init mouse structure: no structure" 328 328 " given.\n"); 329 329 return EINVAL; -
uspace/drv/bus/usb/usbhub/port.c
r7a67416 r58563585 27 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 28 */ 29 29 30 /** @addtogroup drvusbhub 30 31 * @{ … … 175 176 } else { 176 177 /* Handle the case we were in reset */ 177 // usb_hub_port_reset_fail(port);178 // FIXME: usb_hub_port_reset_fail(port); 178 179 /* If enabled change was reported leave the removal 179 180 * to that handler, it shall ACK the change too. */ … … 186 187 /* Enable change, ports are automatically disabled on errors. */ 187 188 if (status & USB_HUB_PORT_C_STATUS_ENABLED) { 188 // TODO: maybe HS reset failed?189 // TODO: maybe HS reset failed? 189 190 usb_log_info("(%p-%u): Port disabled because of errors.\n", hub, 190 191 port->port_number); -
uspace/drv/bus/usb/usbhub/port.h
r7a67416 r58563585 27 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 28 */ 29 29 30 /** @addtogroup drvusbhub 30 31 * @{ … … 33 34 * Hub ports related functions. 34 35 */ 36 35 37 #ifndef DRV_USBHUB_PORT_H 36 38 #define DRV_USBHUB_PORT_H … … 45 47 typedef struct { 46 48 /** Port number as reported in descriptors. */ 47 unsigned port_number;49 unsigned int port_number; 48 50 /** Device communication pipe. */ 49 51 usb_pipe_t *control_pipe; … … 69 71 * @param port Port to be initialized. 70 72 */ 71 static inline void usb_hub_port_init(usb_hub_port_t *port, unsigned port_number,72 u sb_pipe_t *control_pipe)73 static inline void usb_hub_port_init(usb_hub_port_t *port, 74 unsigned int port_number, usb_pipe_t *control_pipe) 73 75 { 74 76 assert(port); … … 80 82 fibril_condvar_initialize(&port->reset_cv); 81 83 } 84 82 85 int usb_hub_port_fini(usb_hub_port_t *port, usb_hub_dev_t *hub); 83 86 int usb_hub_port_clear_feature( … … 89 92 90 93 #endif 94 91 95 /** 92 96 * @} -
uspace/drv/bus/usb/usbhub/status.h
r7a67416 r58563585 27 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 28 */ 29 29 30 /** @addtogroup drvusbhub 30 31 * @{ … … 114 115 } 115 116 116 #endif /* HUB_STATUS_H */ 117 #endif 118 117 119 /** 118 120 * @} -
uspace/drv/bus/usb/usbhub/usbhub.c
r7a67416 r58563585 27 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 28 */ 29 29 30 /** @addtogroup drvusbhub 30 31 * @{ … … 56 57 57 58 #define HUB_FNC_NAME "hub" 59 58 60 /** Hub status-change endpoint description. 59 61 * … … 229 231 uint8_t *change_bitmap, size_t change_bitmap_size, void *arg) 230 232 { 231 // usb_log_debug("hub_port_changes_callback\n");232 233 usb_hub_dev_t *hub = arg; 233 234 assert(hub); … … 314 315 hub_dev->per_port_power ? "per port" : "ganged"); 315 316 316 for (unsigned port = 0; port < hub_dev->port_count; ++port) {317 for (unsigned int port = 0; port < hub_dev->port_count; ++port) { 317 318 usb_log_debug("(%p): Powering port %u.", hub_dev, port); 318 319 const int ret = usb_hub_port_set_feature( -
uspace/drv/bus/usb/usbhub/usbhub.h
r7a67416 r58563585 27 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 28 */ 29 29 30 /** @addtogroup drvusbhub 30 31 * @{ … … 33 34 * @brief Hub driver. 34 35 */ 36 35 37 #ifndef DRV_USBHUB_USBHUB_H 36 38 #define DRV_USBHUB_USBHUB_H … … 82 84 extern const usb_endpoint_description_t hub_status_change_endpoint_description; 83 85 84 int usb_hub_device_add(usb_device_t *usb_dev);85 int usb_hub_device_remove(usb_device_t *usb_dev);86 int usb_hub_device_gone(usb_device_t *usb_dev);86 extern int usb_hub_device_add(usb_device_t *); 87 extern int usb_hub_device_remove(usb_device_t *); 88 extern int usb_hub_device_gone(usb_device_t *); 87 89 88 bool hub_port_changes_callback(usb_device_t *dev,89 uint8_t *change_bitmap, size_t change_bitmap_size, void *arg);90 extern bool hub_port_changes_callback(usb_device_t *, uint8_t *, size_t, 91 void *); 90 92 91 93 #endif 94 92 95 /** 93 96 * @} -
uspace/drv/bus/usb/usbmast/bo_trans.c
r7a67416 r58563585 34 34 * USB mass storage bulk-only transport. 35 35 */ 36 36 37 #include <stdbool.h> 37 38 #include <errno.h> -
uspace/drv/bus/usb/usbmast/main.c
r7a67416 r58563585 35 35 * Main routines of USB mass storage driver. 36 36 */ 37 37 38 #include <as.h> 38 39 #include <async.h> -
uspace/drv/bus/usb/usbmast/scsi_ms.c
r7a67416 r58563585 35 35 * SCSI functions for USB mass storage driver. 36 36 */ 37 37 38 #include <bitops.h> 38 39 #include <byteorder.h> -
uspace/drv/bus/usb/usbmid/explore.c
r7a67416 r58563585 34 34 * Exploration of available interfaces in the USB device. 35 35 */ 36 36 37 #include <errno.h> 37 38 #include <str_error.h> -
uspace/drv/bus/usb/usbmid/usbmid.c
r7a67416 r58563585 35 35 * Helper functions. 36 36 */ 37 37 38 #include <errno.h> 38 39 #include <str_error.h> -
uspace/drv/bus/usb/usbmid/usbmid.h
r7a67416 r58563585 62 62 } usb_mid_t; 63 63 64 int usbmid_explore_device(usb_device_t *);65 int usbmid_spawn_interface_child(usb_device_t *, usbmid_interface_t **,64 extern int usbmid_explore_device(usb_device_t *); 65 extern int usbmid_spawn_interface_child(usb_device_t *, usbmid_interface_t **, 66 66 const usb_standard_device_descriptor_t *, 67 67 const usb_standard_interface_descriptor_t *); 68 void usbmid_dump_descriptors(uint8_t *, size_t);69 int usbmid_interface_destroy(usbmid_interface_t *mid_iface);68 extern void usbmid_dump_descriptors(uint8_t *, size_t); 69 extern int usbmid_interface_destroy(usbmid_interface_t *mid_iface); 70 70 71 71 static inline usbmid_interface_t * usbmid_interface_from_link(link_t *item) … … 75 75 76 76 #endif 77 77 78 /** 78 79 * @} -
uspace/drv/bus/usb/vhc/devconn.c
r7a67416 r58563585 95 95 } 96 96 97 int vhc_virtdev_plug_hub(vhc_data_t *vhc, usbvirt_device_t *dev, uintptr_t *handle, usb_address_t address) 97 int vhc_virtdev_plug_hub(vhc_data_t *vhc, usbvirt_device_t *dev, 98 uintptr_t *handle, usb_address_t address) 98 99 { 99 100 return vhc_virtdev_plug_generic(vhc, NULL, dev, handle, false, address); -
uspace/drv/bus/usb/vhc/hub/virthub.c
r7a67416 r58563585 33 33 * @brief 34 34 */ 35 35 36 #include <usb/classes/classes.h> 36 37 #include <usb/classes/hub.h> -
uspace/drv/bus/usb/vhc/hub/virthub.h
r7a67416 r58563585 33 33 * @brief USB hub as a virtual USB device. 34 34 */ 35 35 36 #ifndef VHC_HUB_VIRTHUB_H_ 36 37 #define VHC_HUB_VIRTHUB_H_ … … 86 87 87 88 #endif 89 88 90 /** 89 91 * @} -
uspace/drv/bus/usb/vhc/hub/virthubops.c
r7a67416 r58563585 33 33 * @brief Virtual USB hub operations. 34 34 */ 35 35 36 #include <errno.h> 36 37 #include <usb/classes/hub.h> -
uspace/drv/bus/usb/vhc/main.c
r7a67416 r58563585 43 43 #include <usb/debug.h> 44 44 #include "vhcd.h" 45 46 45 47 46 static ddf_dev_ops_t vhc_ops = { -
uspace/drv/bus/usb/vhc/transfer.c
r7a67416 r58563585 233 233 if (rc == EOK) { 234 234 if (is_set_address_transfer(transfer)) { 235 usb_device_request_setup_packet_t *setup 236 = (void*)transfer->batch->setup_buffer;235 usb_device_request_setup_packet_t *setup = 236 (void*) transfer->batch->setup_buffer; 237 237 dev->address = setup->value; 238 238 usb_log_debug2("Address changed to %d\n", -
uspace/drv/bus/usb/vhc/vhcd.h
r7a67416 r58563585 33 33 * @brief Virtual USB host controller common definitions. 34 34 */ 35 35 36 #ifndef VHCD_VHCD_H_ 36 37 #define VHCD_VHCD_H_ … … 41 42 42 43 #include <usb/host/hcd.h> 43 44 44 45 45 #define NAME "vhc" … … 67 67 } vhc_transfer_t; 68 68 69 70 69 void on_client_close(ddf_fun_t *fun); 71 70 void default_connection_handler(ddf_fun_t *fun, ipc_callid_t icallid, … … 82 81 83 82 #endif 83 84 84 /** 85 85 * @} -
uspace/drv/nic/ar9271/ath_usb.c
r7a67416 r58563585 100 100 usb_pipe_t *pipe = &usb_device_get_mapped_ep( 101 101 ath_usb->usb_device, ath_usb->output_ctrl_pipe_number)->pipe; 102 102 103 103 return usb_pipe_write(pipe, buffer, buffer_size); 104 104 } … … 120 120 usb_pipe_t *pipe = &usb_device_get_mapped_ep( 121 121 ath_usb->usb_device, ath_usb->input_ctrl_pipe_number)->pipe; 122 122 123 123 return usb_pipe_read(pipe, buffer, buffer_size, transferred_size); 124 124 } … … 141 141 memcpy(complete_buffer + sizeof(ath_usb_data_header_t), 142 142 buffer, buffer_size); 143 143 144 144 ath_usb_data_header_t *data_header = 145 145 (ath_usb_data_header_t *) complete_buffer; 146 146 data_header->length = host2uint16_t_le(buffer_size); 147 147 data_header->tag = host2uint16_t_le(TX_TAG); 148 148 149 149 ath_usb_t *ath_usb = (ath_usb_t *) ath->specific_data; 150 150 usb_pipe_t *pipe = &usb_device_get_mapped_ep( 151 151 ath_usb->usb_device, ath_usb->output_data_pipe_number)->pipe; 152 152 153 153 int ret_val = usb_pipe_write(pipe, complete_buffer, 154 154 complete_buffer_size); 155 155 156 156 free(complete_buffer); 157 157 158 158 return ret_val; 159 159 } … … 175 175 usb_pipe_t *pipe = &usb_device_get_mapped_ep( 176 176 ath_usb->usb_device, ath_usb->input_data_pipe_number)->pipe; 177 177 178 178 return usb_pipe_read(pipe, buffer, buffer_size, transferred_size); 179 179 }
Note:
See TracChangeset
for help on using the changeset viewer.