Changeset 5a6cc679 in mainline for uspace/drv/bus
- Timestamp:
- 2018-01-31T02:21:24Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a0a9cc2
- Parents:
- 132ab5d1
- Location:
- uspace/drv/bus
- Files:
-
- 54 edited
-
adb/cuda_adb/cuda_adb.c (modified) (5 diffs)
-
adb/cuda_adb/cuda_adb.h (modified) (1 diff)
-
adb/cuda_adb/main.c (modified) (7 diffs)
-
isa/i8237.c (modified) (3 diffs)
-
isa/i8237.h (modified) (1 diff)
-
isa/isa.c (modified) (13 diffs)
-
pci/pciintel/pci.c (modified) (16 diffs)
-
usb/ehci/ehci_bus.h (modified) (1 diff)
-
usb/ehci/ehci_rh.c (modified) (12 diffs)
-
usb/ehci/ehci_rh.h (modified) (1 diff)
-
usb/ehci/endpoint_list.c (modified) (1 diff)
-
usb/ehci/endpoint_list.h (modified) (1 diff)
-
usb/ehci/hc.c (modified) (7 diffs)
-
usb/ehci/hc.h (modified) (1 diff)
-
usb/ehci/hw_struct/transfer_descriptor.c (modified) (1 diff)
-
usb/ehci/hw_struct/transfer_descriptor.h (modified) (1 diff)
-
usb/ehci/res.c (modified) (4 diffs)
-
usb/ehci/res.h (modified) (1 diff)
-
usb/ohci/endpoint_list.c (modified) (1 diff)
-
usb/ohci/endpoint_list.h (modified) (1 diff)
-
usb/ohci/hc.c (modified) (10 diffs)
-
usb/ohci/hc.h (modified) (1 diff)
-
usb/ohci/hw_struct/completion_codes.h (modified) (1 diff)
-
usb/ohci/hw_struct/transfer_descriptor.h (modified) (1 diff)
-
usb/ohci/ohci_bus.h (modified) (1 diff)
-
usb/ohci/ohci_rh.c (modified) (9 diffs)
-
usb/ohci/ohci_rh.h (modified) (1 diff)
-
usb/uhci/hc.c (modified) (12 diffs)
-
usb/uhci/hc.h (modified) (1 diff)
-
usb/uhci/hw_struct/transfer_descriptor.c (modified) (1 diff)
-
usb/uhci/hw_struct/transfer_descriptor.h (modified) (1 diff)
-
usb/uhci/main.c (modified) (2 diffs)
-
usb/uhci/transfer_list.c (modified) (1 diff)
-
usb/uhci/transfer_list.h (modified) (1 diff)
-
usb/uhci/uhci_rh.c (modified) (7 diffs)
-
usb/uhci/uhci_rh.h (modified) (1 diff)
-
usb/usbflbk/main.c (modified) (2 diffs)
-
usb/usbhub/port.c (modified) (4 diffs)
-
usb/usbhub/usbhub.c (modified) (14 diffs)
-
usb/usbhub/usbhub.h (modified) (1 diff)
-
usb/usbmid/explore.c (modified) (4 diffs)
-
usb/usbmid/main.c (modified) (7 diffs)
-
usb/usbmid/usbmid.c (modified) (5 diffs)
-
usb/usbmid/usbmid.h (modified) (1 diff)
-
usb/vhc/conndev.c (modified) (2 diffs)
-
usb/vhc/devconn.c (modified) (2 diffs)
-
usb/vhc/hub/hub.c (modified) (3 diffs)
-
usb/vhc/hub/hub.h (modified) (1 diff)
-
usb/vhc/hub/virthub.c (modified) (2 diffs)
-
usb/vhc/hub/virthub.h (modified) (1 diff)
-
usb/vhc/hub/virthubops.c (modified) (9 diffs)
-
usb/vhc/main.c (modified) (3 diffs)
-
usb/vhc/transfer.c (modified) (7 diffs)
-
usb/vhc/vhcd.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/adb/cuda_adb/cuda_adb.c
r132ab5d1 r5a6cc679 56 56 57 57 static void cuda_dev_connection(ipc_callid_t, ipc_call_t *, void *); 58 static int cuda_init(cuda_t *);58 static errno_t cuda_init(cuda_t *); 59 59 static void cuda_irq_handler(ipc_call_t *, void *); 60 60 … … 108 108 }; 109 109 110 static int cuda_dev_create(cuda_t *cuda, const char *name, const char *id,110 static errno_t cuda_dev_create(cuda_t *cuda, const char *name, const char *id, 111 111 adb_dev_t **rdev) 112 112 { 113 113 adb_dev_t *dev = NULL; 114 114 ddf_fun_t *fun; 115 int rc;115 errno_t rc; 116 116 117 117 fun = ddf_fun_create(cuda->dev, fun_inner, name); … … 155 155 } 156 156 157 int cuda_add(cuda_t *cuda, cuda_res_t *res)157 errno_t cuda_add(cuda_t *cuda, cuda_res_t *res) 158 158 { 159 159 adb_dev_t *kbd = NULL; 160 160 adb_dev_t *mouse = NULL; 161 int rc;161 errno_t rc; 162 162 163 163 cuda->phys_base = res->base; … … 187 187 } 188 188 189 int cuda_remove(cuda_t *cuda)189 errno_t cuda_remove(cuda_t *cuda) 190 190 { 191 191 return ENOTSUP; 192 192 } 193 193 194 int cuda_gone(cuda_t *cuda)194 errno_t cuda_gone(cuda_t *cuda) 195 195 { 196 196 return ENOTSUP; … … 229 229 } 230 230 231 static int cuda_init(cuda_t *cuda)232 { 233 int rc;231 static errno_t cuda_init(cuda_t *cuda) 232 { 233 errno_t rc; 234 234 235 235 void *vaddr; -
uspace/drv/bus/adb/cuda_adb/cuda_adb.h
r132ab5d1 r5a6cc679 87 87 } cuda_t; 88 88 89 extern int cuda_add(cuda_t *, cuda_res_t *);90 extern int cuda_remove(cuda_t *);91 extern int cuda_gone(cuda_t *);89 extern errno_t cuda_add(cuda_t *, cuda_res_t *); 90 extern errno_t cuda_remove(cuda_t *); 91 extern errno_t cuda_gone(cuda_t *); 92 92 93 93 #endif -
uspace/drv/bus/adb/cuda_adb/main.c
r132ab5d1 r5a6cc679 43 43 #define NAME "cuda_adb" 44 44 45 static int cuda_dev_add(ddf_dev_t *dev);46 static int cuda_dev_remove(ddf_dev_t *dev);47 static int cuda_dev_gone(ddf_dev_t *dev);48 static int cuda_fun_online(ddf_fun_t *fun);49 static int cuda_fun_offline(ddf_fun_t *fun);45 static errno_t cuda_dev_add(ddf_dev_t *dev); 46 static errno_t cuda_dev_remove(ddf_dev_t *dev); 47 static errno_t cuda_dev_gone(ddf_dev_t *dev); 48 static errno_t cuda_fun_online(ddf_fun_t *fun); 49 static errno_t cuda_fun_offline(ddf_fun_t *fun); 50 50 51 51 static driver_ops_t driver_ops = { … … 62 62 }; 63 63 64 static int cuda_get_res(ddf_dev_t *dev, cuda_res_t *res)64 static errno_t cuda_get_res(ddf_dev_t *dev, cuda_res_t *res) 65 65 { 66 66 async_sess_t *parent_sess; 67 67 hw_res_list_parsed_t hw_res; 68 int rc;68 errno_t rc; 69 69 70 70 parent_sess = ddf_dev_parent_sess_get(dev); … … 97 97 } 98 98 99 static int cuda_dev_add(ddf_dev_t *dev)99 static errno_t cuda_dev_add(ddf_dev_t *dev) 100 100 { 101 101 cuda_t *cuda; 102 102 cuda_res_t cuda_res; 103 int rc;103 errno_t rc; 104 104 105 105 ddf_msg(LVL_DEBUG, "cuda_dev_add(%p)", dev); … … 122 122 } 123 123 124 static int cuda_dev_remove(ddf_dev_t *dev)124 static errno_t cuda_dev_remove(ddf_dev_t *dev) 125 125 { 126 126 cuda_t *cuda = (cuda_t *)ddf_dev_data_get(dev); … … 131 131 } 132 132 133 static int cuda_dev_gone(ddf_dev_t *dev)133 static errno_t cuda_dev_gone(ddf_dev_t *dev) 134 134 { 135 135 cuda_t *cuda = (cuda_t *)ddf_dev_data_get(dev); … … 140 140 } 141 141 142 static int cuda_fun_online(ddf_fun_t *fun)142 static errno_t cuda_fun_online(ddf_fun_t *fun) 143 143 { 144 144 ddf_msg(LVL_DEBUG, "cuda_fun_online()"); … … 146 146 } 147 147 148 static int cuda_fun_offline(ddf_fun_t *fun)148 static errno_t cuda_fun_offline(ddf_fun_t *fun) 149 149 { 150 150 ddf_msg(LVL_DEBUG, "cuda_fun_offline()"); -
uspace/drv/bus/isa/i8237.c
r132ab5d1 r5a6cc679 279 279 * 280 280 */ 281 static inline int dma_controller_init(dma_controller_t *controller)281 static inline errno_t dma_controller_init(dma_controller_t *controller) 282 282 { 283 283 assert(controller); 284 int ret = pio_enable(DMA_CONTROLLER_PAGE_BASE, sizeof(dma_page_regs_t),284 errno_t ret = pio_enable(DMA_CONTROLLER_PAGE_BASE, sizeof(dma_page_regs_t), 285 285 (void **) &controller->page_table); 286 286 if (ret != EOK) … … 339 339 * @return Error code. 340 340 */ 341 int dma_channel_setup(unsigned int channel, uint32_t pa, uint32_t size,341 errno_t dma_channel_setup(unsigned int channel, uint32_t pa, uint32_t size, 342 342 uint8_t mode) 343 343 { … … 454 454 * @return Error code. 455 455 */ 456 int dma_channel_remain(unsigned channel, size_t *size)456 errno_t dma_channel_remain(unsigned channel, size_t *size) 457 457 { 458 458 assert(size); -
uspace/drv/bus/isa/i8237.h
r132ab5d1 r5a6cc679 38 38 #define DRV_BUS_ISA_I8237_H 39 39 40 extern int dma_channel_setup(unsigned, uint32_t, uint32_t, uint8_t);41 extern int dma_channel_remain(unsigned, size_t *);40 extern errno_t dma_channel_setup(unsigned, uint32_t, uint32_t, uint8_t); 41 extern errno_t dma_channel_remain(unsigned, size_t *); 42 42 43 43 #endif -
uspace/drv/bus/isa/isa.c
r132ab5d1 r5a6cc679 130 130 } 131 131 132 static int isa_fun_enable_interrupt(ddf_fun_t *fnode, int irq)132 static errno_t isa_fun_enable_interrupt(ddf_fun_t *fnode, int irq) 133 133 { 134 134 isa_fun_t *fun = isa_fun(fnode); … … 140 140 } 141 141 142 static int isa_fun_disable_interrupt(ddf_fun_t *fnode, int irq)142 static errno_t isa_fun_disable_interrupt(ddf_fun_t *fnode, int irq) 143 143 { 144 144 isa_fun_t *fun = isa_fun(fnode); … … 150 150 } 151 151 152 static int isa_fun_clear_interrupt(ddf_fun_t *fnode, int irq)152 static errno_t isa_fun_clear_interrupt(ddf_fun_t *fnode, int irq) 153 153 { 154 154 isa_fun_t *fun = isa_fun(fnode); … … 160 160 } 161 161 162 static int isa_fun_setup_dma(ddf_fun_t *fnode,162 static errno_t isa_fun_setup_dma(ddf_fun_t *fnode, 163 163 unsigned int channel, uint32_t pa, uint32_t size, uint8_t mode) 164 164 { … … 182 182 } 183 183 184 static int isa_fun_remain_dma(ddf_fun_t *fnode,184 static errno_t isa_fun_remain_dma(ddf_fun_t *fnode, 185 185 unsigned channel, size_t *size) 186 186 { … … 232 232 }; 233 233 234 static int isa_dev_add(ddf_dev_t *dev);235 static int isa_dev_remove(ddf_dev_t *dev);236 static int isa_fun_online(ddf_fun_t *fun);237 static int isa_fun_offline(ddf_fun_t *fun);234 static errno_t isa_dev_add(ddf_dev_t *dev); 235 static errno_t isa_dev_remove(ddf_dev_t *dev); 236 static errno_t isa_fun_online(ddf_fun_t *fun); 237 static errno_t isa_fun_offline(ddf_fun_t *fun); 238 238 239 239 /** The isa device driver's standard operations */ … … 277 277 int fd; 278 278 size_t len; 279 int rc;279 errno_t rc; 280 280 size_t nread; 281 281 struct stat st; … … 578 578 "function %s", id, score, ddf_fun_get_name(fun->fnode)); 579 579 580 int rc = ddf_fun_add_match_id(fun->fnode, id, score);580 errno_t rc = ddf_fun_add_match_id(fun->fnode, id, score); 581 581 if (rc != EOK) { 582 582 ddf_msg(LVL_ERROR, "Failed adding match ID: %s", … … 698 698 } 699 699 700 static int isa_dev_add(ddf_dev_t *dev)700 static errno_t isa_dev_add(ddf_dev_t *dev) 701 701 { 702 702 async_sess_t *sess; 703 int rc;703 errno_t rc; 704 704 705 705 ddf_msg(LVL_DEBUG, "isa_dev_add, device handle = %d", … … 767 767 } 768 768 769 static int isa_dev_remove(ddf_dev_t *dev)769 static errno_t isa_dev_remove(ddf_dev_t *dev) 770 770 { 771 771 isa_bus_t *isa = isa_bus(dev); … … 777 777 isa_fun_t, bus_link); 778 778 779 int rc = ddf_fun_offline(fun->fnode);779 errno_t rc = ddf_fun_offline(fun->fnode); 780 780 if (rc != EOK) { 781 781 fibril_mutex_unlock(&isa->mutex); … … 807 807 } 808 808 809 static int isa_fun_online(ddf_fun_t *fun)809 static errno_t isa_fun_online(ddf_fun_t *fun) 810 810 { 811 811 ddf_msg(LVL_DEBUG, "isa_fun_online()"); … … 813 813 } 814 814 815 static int isa_fun_offline(ddf_fun_t *fun)815 static errno_t isa_fun_offline(ddf_fun_t *fun) 816 816 { 817 817 ddf_msg(LVL_DEBUG, "isa_fun_offline()"); -
uspace/drv/bus/pci/pciintel/pci.c
r132ab5d1 r5a6cc679 114 114 } 115 115 116 static int pciintel_enable_interrupt(ddf_fun_t *fnode, int irq)116 static errno_t pciintel_enable_interrupt(ddf_fun_t *fnode, int irq) 117 117 { 118 118 pci_fun_t *fun = pci_fun(fnode); … … 124 124 } 125 125 126 static int pciintel_disable_interrupt(ddf_fun_t *fnode, int irq)126 static errno_t pciintel_disable_interrupt(ddf_fun_t *fnode, int irq) 127 127 { 128 128 pci_fun_t *fun = pci_fun(fnode); … … 134 134 } 135 135 136 static int pciintel_clear_interrupt(ddf_fun_t *fnode, int irq)136 static errno_t pciintel_clear_interrupt(ddf_fun_t *fnode, int irq) 137 137 { 138 138 pci_fun_t *fun = pci_fun(fnode); … … 154 154 155 155 156 static int config_space_write_32(ddf_fun_t *fun, uint32_t address,156 static errno_t config_space_write_32(ddf_fun_t *fun, uint32_t address, 157 157 uint32_t data) 158 158 { … … 163 163 } 164 164 165 static int config_space_write_16(165 static errno_t config_space_write_16( 166 166 ddf_fun_t *fun, uint32_t address, uint16_t data) 167 167 { … … 172 172 } 173 173 174 static int config_space_write_8(174 static errno_t config_space_write_8( 175 175 ddf_fun_t *fun, uint32_t address, uint8_t data) 176 176 { … … 181 181 } 182 182 183 static int config_space_read_32(183 static errno_t config_space_read_32( 184 184 ddf_fun_t *fun, uint32_t address, uint32_t *data) 185 185 { … … 190 190 } 191 191 192 static int config_space_read_16(192 static errno_t config_space_read_16( 193 193 ddf_fun_t *fun, uint32_t address, uint16_t *data) 194 194 { … … 199 199 } 200 200 201 static int config_space_read_8(201 static errno_t config_space_read_8( 202 202 ddf_fun_t *fun, uint32_t address, uint8_t *data) 203 203 { … … 234 234 }; 235 235 236 static int pci_dev_add(ddf_dev_t *);237 static int pci_fun_online(ddf_fun_t *);238 static int pci_fun_offline(ddf_fun_t *);236 static errno_t pci_dev_add(ddf_dev_t *); 237 static errno_t pci_fun_online(ddf_fun_t *); 238 static errno_t pci_fun_offline(ddf_fun_t *); 239 239 240 240 /** PCI bus driver standard operations */ … … 382 382 void pci_fun_create_match_ids(pci_fun_t *fun) 383 383 { 384 int rc;384 errno_t rc; 385 385 int ret; 386 386 char match_id_str[ID_MAX_STR_LEN]; … … 602 602 { 603 603 pci_fun_t *fun; 604 int rc;604 errno_t rc; 605 605 606 606 int child_bus = 0; … … 684 684 } 685 685 686 static int pci_dev_add(ddf_dev_t *dnode)686 static errno_t pci_dev_add(ddf_dev_t *dnode) 687 687 { 688 688 hw_resource_list_t hw_resources; … … 691 691 bool got_res = false; 692 692 async_sess_t *sess; 693 int rc;693 errno_t rc; 694 694 695 695 ddf_msg(LVL_DEBUG, "pci_dev_add"); … … 810 810 } 811 811 812 static int pci_fun_online(ddf_fun_t *fun)812 static errno_t pci_fun_online(ddf_fun_t *fun) 813 813 { 814 814 ddf_msg(LVL_DEBUG, "pci_fun_online()"); … … 816 816 } 817 817 818 static int pci_fun_offline(ddf_fun_t *fun)818 static errno_t pci_fun_offline(ddf_fun_t *fun) 819 819 { 820 820 ddf_msg(LVL_DEBUG, "pci_fun_offline()"); -
uspace/drv/bus/usb/ehci/ehci_bus.h
r132ab5d1 r5a6cc679 72 72 void ehci_bus_prepare_ops(void); 73 73 74 int ehci_bus_init(ehci_bus_t *, hc_t *);74 errno_t ehci_bus_init(ehci_bus_t *, hc_t *); 75 75 76 76 /** Get and convert assigned ehci_endpoint_t structure -
uspace/drv/bus/usb/ehci/ehci_rh.c
r132ab5d1 r5a6cc679 99 99 * initializes internal virtual hub. 100 100 */ 101 int ehci_rh_init(ehci_rh_t *instance, ehci_caps_regs_t *caps, ehci_regs_t *regs,101 errno_t ehci_rh_init(ehci_rh_t *instance, ehci_caps_regs_t *caps, ehci_regs_t *regs, 102 102 fibril_mutex_t *guard, const char *name) 103 103 { … … 141 141 * status change requests might be postponed until there is something to report. 142 142 */ 143 int ehci_rh_schedule(ehci_rh_t *instance, usb_transfer_batch_t *batch)143 errno_t ehci_rh_schedule(ehci_rh_t *instance, usb_transfer_batch_t *batch) 144 144 { 145 145 assert(instance); … … 184 184 * processing of a postponed request. 185 185 */ 186 int ehci_rh_interrupt(ehci_rh_t *instance)186 errno_t ehci_rh_interrupt(ehci_rh_t *instance) 187 187 { 188 188 fibril_mutex_lock(instance->guard); … … 231 231 * @return Error code. 232 232 */ 233 static int req_get_status(usbvirt_device_t *device,233 static errno_t req_get_status(usbvirt_device_t *device, 234 234 const usb_device_request_setup_packet_t *setup_packet, 235 235 uint8_t *data, size_t *act_size) … … 254 254 * @return Error code. 255 255 */ 256 static int req_clear_hub_feature(usbvirt_device_t *device,256 static errno_t req_clear_hub_feature(usbvirt_device_t *device, 257 257 const usb_device_request_setup_packet_t *setup_packet, 258 258 uint8_t *data, size_t *act_size) … … 282 282 * @return Error code. 283 283 */ 284 static int req_get_port_status(usbvirt_device_t *device,284 static errno_t req_get_port_status(usbvirt_device_t *device, 285 285 const usb_device_request_setup_packet_t *setup_packet, 286 286 uint8_t *data, size_t *act_size) … … 325 325 } ehci_rh_job_t; 326 326 327 static int stop_reset(void *arg)327 static errno_t stop_reset(void *arg) 328 328 { 329 329 ehci_rh_job_t *job = arg; … … 354 354 } 355 355 356 static int stop_resume(void *arg)356 static errno_t stop_resume(void *arg) 357 357 { 358 358 ehci_rh_job_t *job = arg; … … 367 367 } 368 368 369 static int delayed_job(int (*func)(void*), ehci_rh_t *rh, unsigned port)369 static errno_t delayed_job(errno_t (*func)(void*), ehci_rh_t *rh, unsigned port) 370 370 { 371 371 ehci_rh_job_t *job = malloc(sizeof(*job)); … … 393 393 * @return Error code. 394 394 */ 395 static int req_clear_port_feature(usbvirt_device_t *device,395 static errno_t req_clear_port_feature(usbvirt_device_t *device, 396 396 const usb_device_request_setup_packet_t *setup_packet, 397 397 uint8_t *data, size_t *act_size) … … 472 472 * @return Error code. 473 473 */ 474 static int req_set_port_feature(usbvirt_device_t *device,474 static errno_t req_set_port_feature(usbvirt_device_t *device, 475 475 const usb_device_request_setup_packet_t *setup_packet, 476 476 uint8_t *data, size_t *act_size) … … 521 521 * only need 1 byte. 522 522 */ 523 static int req_status_change_handler(usbvirt_device_t *device,523 static errno_t req_status_change_handler(usbvirt_device_t *device, 524 524 usb_endpoint_t endpoint, usb_transfer_type_t tr_type, 525 525 void *buffer, size_t buffer_size, size_t *actual_size) -
uspace/drv/bus/usb/ehci/ehci_rh.h
r132ab5d1 r5a6cc679 79 79 } ehci_rh_t; 80 80 81 int ehci_rh_init(ehci_rh_t *instance, ehci_caps_regs_t *caps, ehci_regs_t *regs,81 errno_t ehci_rh_init(ehci_rh_t *instance, ehci_caps_regs_t *caps, ehci_regs_t *regs, 82 82 fibril_mutex_t *guard, const char *name); 83 int ehci_rh_schedule(ehci_rh_t *instance, usb_transfer_batch_t *batch);84 int ehci_rh_interrupt(ehci_rh_t *instance);83 errno_t ehci_rh_schedule(ehci_rh_t *instance, usb_transfer_batch_t *batch); 84 errno_t ehci_rh_interrupt(ehci_rh_t *instance); 85 85 86 86 /** Get EHCI rh address. -
uspace/drv/bus/usb/ehci/endpoint_list.c
r132ab5d1 r5a6cc679 50 50 * Allocates memory for internal ed_t structure. 51 51 */ 52 int endpoint_list_init(endpoint_list_t *instance, const char *name)52 errno_t endpoint_list_init(endpoint_list_t *instance, const char *name) 53 53 { 54 54 assert(instance); -
uspace/drv/bus/usb/ehci/endpoint_list.h
r132ab5d1 r5a6cc679 68 68 } 69 69 70 int endpoint_list_init(endpoint_list_t *instance, const char *name);70 errno_t endpoint_list_init(endpoint_list_t *instance, const char *name); 71 71 void endpoint_list_chain(endpoint_list_t *instance, const endpoint_list_t *next); 72 72 void endpoint_list_append_ep(endpoint_list_t *instance, ehci_endpoint_t *ep); -
uspace/drv/bus/usb/ehci/hc.c
r132ab5d1 r5a6cc679 89 89 }; 90 90 91 static int hc_init_memory(hc_t *instance);91 static errno_t hc_init_memory(hc_t *instance); 92 92 93 93 /** Generate IRQ code. … … 99 99 * @return Error code. 100 100 */ 101 int hc_gen_irq_code(irq_code_t *code, hc_device_t *hcd, const hw_res_list_parsed_t *hw_res, int *irq)101 errno_t hc_gen_irq_code(irq_code_t *code, hc_device_t *hcd, const hw_res_list_parsed_t *hw_res, int *irq) 102 102 { 103 103 assert(code); … … 151 151 * @return Error code 152 152 */ 153 int hc_add(hc_device_t *hcd, const hw_res_list_parsed_t *hw_res)153 errno_t hc_add(hc_device_t *hcd, const hw_res_list_parsed_t *hw_res) 154 154 { 155 155 hc_t *instance = hcd_to_hc(hcd); … … 160 160 return EINVAL; 161 161 162 int ret = pio_enable_range(&hw_res->mem_ranges.ranges[0],162 errno_t ret = pio_enable_range(&hw_res->mem_ranges.ranges[0], 163 163 (void **)&instance->caps); 164 164 if (ret != EOK) { … … 265 265 } 266 266 267 int ehci_hc_status(bus_t *bus_base, uint32_t *status)267 errno_t ehci_hc_status(bus_t *bus_base, uint32_t *status) 268 268 { 269 269 assert(bus_base); … … 289 289 * @return Error code. 290 290 */ 291 int ehci_hc_schedule(usb_transfer_batch_t *batch)291 errno_t ehci_hc_schedule(usb_transfer_batch_t *batch) 292 292 { 293 293 assert(batch); … … 477 477 * @return Error code. 478 478 */ 479 int hc_init_memory(hc_t *instance)479 errno_t hc_init_memory(hc_t *instance) 480 480 { 481 481 assert(instance); 482 482 usb_log_debug2("HC(%p): Initializing Async list(%p).", instance, 483 483 &instance->async_list); 484 int ret = endpoint_list_init(&instance->async_list, "ASYNC");484 errno_t ret = endpoint_list_init(&instance->async_list, "ASYNC"); 485 485 if (ret != EOK) { 486 486 usb_log_error("HC(%p): Failed to setup ASYNC list: %s", -
uspace/drv/bus/usb/ehci/hc.h
r132ab5d1 r5a6cc679 100 100 101 101 /* Boottime operations */ 102 extern int hc_add(hc_device_t *, const hw_res_list_parsed_t *);103 extern int hc_start(hc_device_t *);104 extern int hc_setup_roothub(hc_device_t *);105 extern int hc_gen_irq_code(irq_code_t *, hc_device_t *, const hw_res_list_parsed_t *, int *);106 extern int hc_gone(hc_device_t *);102 extern errno_t hc_add(hc_device_t *, const hw_res_list_parsed_t *); 103 extern errno_t hc_start(hc_device_t *); 104 extern errno_t hc_setup_roothub(hc_device_t *); 105 extern errno_t hc_gen_irq_code(irq_code_t *, hc_device_t *, const hw_res_list_parsed_t *, int *); 106 extern errno_t hc_gone(hc_device_t *); 107 107 108 108 /** Runtime operations */ 109 109 extern void ehci_hc_interrupt(bus_t *, uint32_t); 110 extern int ehci_hc_status(bus_t *, uint32_t *);111 extern int ehci_hc_schedule(usb_transfer_batch_t *);110 extern errno_t ehci_hc_status(bus_t *, uint32_t *); 111 extern errno_t ehci_hc_schedule(usb_transfer_batch_t *); 112 112 113 113 #endif -
uspace/drv/bus/usb/ehci/hw_struct/transfer_descriptor.c
r132ab5d1 r5a6cc679 44 44 45 45 46 int td_error(const td_t *td)46 errno_t td_error(const td_t *td) 47 47 { 48 48 assert(td); -
uspace/drv/bus/usb/ehci/hw_struct/transfer_descriptor.h
r132ab5d1 r5a6cc679 97 97 } 98 98 99 int td_error(const td_t *td);99 errno_t td_error(const td_t *td); 100 100 101 101 void td_init(td_t *td, uintptr_t next_phys, uintptr_t buf, usb_direction_t dir, -
uspace/drv/bus/usb/ehci/res.c
r132ab5d1 r5a6cc679 63 63 * @return Error code. 64 64 */ 65 static int disable_extended_caps(async_sess_t *parent_sess, unsigned eecp)65 static errno_t disable_extended_caps(async_sess_t *parent_sess, unsigned eecp) 66 66 { 67 67 /* nothing to do */ … … 71 71 /* Read the first EEC. i.e. Legacy Support register */ 72 72 uint32_t usblegsup; 73 int ret = pci_config_space_read_32(parent_sess,73 errno_t ret = pci_config_space_read_32(parent_sess, 74 74 eecp + USBLEGSUP_OFFSET, &usblegsup); 75 75 if (ret != EOK) { … … 173 173 } 174 174 175 int disable_legacy(hc_device_t *hcd)175 errno_t disable_legacy(hc_device_t *hcd) 176 176 { 177 177 hc_t *hc = hcd_to_hc(hcd); … … 182 182 183 183 usb_log_debug("Disabling EHCI legacy support."); 184 185 184 186 185 const uint32_t hcc_params = EHCI_RD(hc->caps->hccparams); -
uspace/drv/bus/usb/ehci/res.h
r132ab5d1 r5a6cc679 38 38 typedef struct hc_device hc_device_t; 39 39 40 extern int disable_legacy(hc_device_t *);40 extern errno_t disable_legacy(hc_device_t *); 41 41 42 42 #endif -
uspace/drv/bus/usb/ohci/endpoint_list.c
r132ab5d1 r5a6cc679 51 51 * Allocates memory for internal ed_t structure. 52 52 */ 53 int endpoint_list_init(endpoint_list_t *instance, const char *name)53 errno_t endpoint_list_init(endpoint_list_t *instance, const char *name) 54 54 { 55 55 assert(instance); -
uspace/drv/bus/usb/ohci/endpoint_list.h
r132ab5d1 r5a6cc679 71 71 } 72 72 73 int endpoint_list_init(endpoint_list_t *instance, const char *name);73 errno_t endpoint_list_init(endpoint_list_t *instance, const char *name); 74 74 void endpoint_list_set_next( 75 75 const endpoint_list_t *instance, const endpoint_list_t *next); -
uspace/drv/bus/usb/ohci/hc.c
r132ab5d1 r5a6cc679 90 90 }; 91 91 92 static int hc_init_transfer_lists(hc_t *instance);93 static int hc_init_memory(hc_t *instance);92 static errno_t hc_init_transfer_lists(hc_t *instance); 93 static errno_t hc_init_memory(hc_t *instance); 94 94 95 95 /** Generate IRQ code. … … 102 102 * @return Error code. 103 103 */ 104 int hc_gen_irq_code(irq_code_t *code, hc_device_t *hcd, const hw_res_list_parsed_t *hw_res, int *irq)104 errno_t hc_gen_irq_code(irq_code_t *code, hc_device_t *hcd, const hw_res_list_parsed_t *hw_res, int *irq) 105 105 { 106 106 assert(code); … … 151 151 * @return Error code 152 152 */ 153 int hc_add(hc_device_t *hcd, const hw_res_list_parsed_t *hw_res)153 errno_t hc_add(hc_device_t *hcd, const hw_res_list_parsed_t *hw_res) 154 154 { 155 155 hc_t *instance = hcd_to_hc(hcd); … … 159 159 return EINVAL; 160 160 161 int ret = pio_enable_range(&hw_res->mem_ranges.ranges[0],161 errno_t ret = pio_enable_range(&hw_res->mem_ranges.ranges[0], 162 162 (void **) &instance->registers); 163 163 if (ret != EOK) { … … 263 263 } 264 264 265 int ohci_hc_status(bus_t *bus_base, uint32_t *status)265 errno_t ohci_hc_status(bus_t *bus_base, uint32_t *status) 266 266 { 267 267 assert(bus_base); … … 285 285 * @return Error code. 286 286 */ 287 int ohci_hc_schedule(usb_transfer_batch_t *batch)287 errno_t ohci_hc_schedule(usb_transfer_batch_t *batch) 288 288 { 289 289 assert(batch); … … 547 547 * @return Error code 548 548 */ 549 int hc_init_transfer_lists(hc_t *instance)549 errno_t hc_init_transfer_lists(hc_t *instance) 550 550 { 551 551 assert(instance); … … 553 553 do { \ 554 554 const char *name = usb_str_transfer_type(type); \ 555 const int ret = endpoint_list_init(&instance->lists[type], name); \555 const errno_t ret = endpoint_list_init(&instance->lists[type], name); \ 556 556 if (ret != EOK) { \ 557 557 usb_log_error("Failed to setup %s endpoint list: %s.", \ … … 581 581 * @return Error code. 582 582 */ 583 int hc_init_memory(hc_t *instance)583 errno_t hc_init_memory(hc_t *instance) 584 584 { 585 585 assert(instance); … … 587 587 memset(&instance->rh, 0, sizeof(instance->rh)); 588 588 /* Init queues */ 589 int ret = hc_init_transfer_lists(instance);589 errno_t ret = hc_init_transfer_lists(instance); 590 590 if (ret != EOK) { 591 591 return ret; -
uspace/drv/bus/usb/ohci/hc.h
r132ab5d1 r5a6cc679 89 89 } 90 90 91 extern int hc_add(hc_device_t *, const hw_res_list_parsed_t *);92 extern int hc_gen_irq_code(irq_code_t *, hc_device_t *, const hw_res_list_parsed_t *, int *);93 extern int hc_gain_control(hc_device_t *);94 extern int hc_start(hc_device_t *);95 extern int hc_setup_roothub(hc_device_t *);96 extern int hc_gone(hc_device_t *);91 extern errno_t hc_add(hc_device_t *, const hw_res_list_parsed_t *); 92 extern errno_t hc_gen_irq_code(irq_code_t *, hc_device_t *, const hw_res_list_parsed_t *, int *); 93 extern errno_t hc_gain_control(hc_device_t *); 94 extern errno_t hc_start(hc_device_t *); 95 extern errno_t hc_setup_roothub(hc_device_t *); 96 extern errno_t hc_gone(hc_device_t *); 97 97 98 98 extern void hc_enqueue_endpoint(hc_t *, const endpoint_t *); 99 99 extern void hc_dequeue_endpoint(hc_t *, const endpoint_t *); 100 100 101 extern int ohci_hc_schedule(usb_transfer_batch_t *);102 extern int ohci_hc_status(bus_t *, uint32_t *);101 extern errno_t ohci_hc_schedule(usb_transfer_batch_t *); 102 extern errno_t ohci_hc_status(bus_t *, uint32_t *); 103 103 extern void ohci_hc_interrupt(bus_t *, uint32_t); 104 104 -
uspace/drv/bus/usb/ohci/hw_struct/completion_codes.h
r132ab5d1 r5a6cc679 54 54 }; 55 55 56 inline static int cc_to_rc(unsigned int cc)56 inline static errno_t cc_to_rc(unsigned int cc) 57 57 { 58 58 switch (cc) { -
uspace/drv/bus/usb/ohci/hw_struct/transfer_descriptor.h
r132ab5d1 r5a6cc679 119 119 * @return Error code. 120 120 */ 121 static inline int td_error(const td_t *instance)121 static inline errno_t td_error(const td_t *instance) 122 122 { 123 123 assert(instance); -
uspace/drv/bus/usb/ohci/ohci_bus.h
r132ab5d1 r5a6cc679 65 65 } ohci_bus_t; 66 66 67 int ohci_bus_init(ohci_bus_t *, hc_t *);67 errno_t ohci_bus_init(ohci_bus_t *, hc_t *); 68 68 void ohci_ep_toggle_reset(endpoint_t *); 69 69 -
uspace/drv/bus/usb/ohci/ohci_rh.c
r132ab5d1 r5a6cc679 109 109 * initializes internal virtual hub. 110 110 */ 111 int ohci_rh_init(ohci_rh_t *instance, ohci_regs_t *regs,111 errno_t ohci_rh_init(ohci_rh_t *instance, ohci_regs_t *regs, 112 112 fibril_mutex_t *guard, const char *name) 113 113 { … … 176 176 * status change requests might be postponed until there is something to report. 177 177 */ 178 int ohci_rh_schedule(ohci_rh_t *instance, usb_transfer_batch_t *batch)178 errno_t ohci_rh_schedule(ohci_rh_t *instance, usb_transfer_batch_t *batch) 179 179 { 180 180 assert(instance); … … 214 214 * processing of a postponed request. 215 215 */ 216 int ohci_rh_interrupt(ohci_rh_t *instance)216 errno_t ohci_rh_interrupt(ohci_rh_t *instance) 217 217 { 218 218 fibril_mutex_lock(instance->guard); … … 259 259 * @return Error code. 260 260 */ 261 static int req_get_status(usbvirt_device_t *device,261 static errno_t req_get_status(usbvirt_device_t *device, 262 262 const usb_device_request_setup_packet_t *setup_packet, 263 263 uint8_t *data, size_t *act_size) … … 282 282 * @return Error code. 283 283 */ 284 static int req_clear_hub_feature(usbvirt_device_t *device,284 static errno_t req_clear_hub_feature(usbvirt_device_t *device, 285 285 const usb_device_request_setup_packet_t *setup_packet, 286 286 uint8_t *data, size_t *act_size) … … 312 312 * @return Error code. 313 313 */ 314 static int req_get_port_status(usbvirt_device_t *device,314 static errno_t req_get_port_status(usbvirt_device_t *device, 315 315 const usb_device_request_setup_packet_t *setup_packet, 316 316 uint8_t *data, size_t *act_size) … … 336 336 * @return Error code. 337 337 */ 338 static int req_clear_port_feature(usbvirt_device_t *device,338 static errno_t req_clear_port_feature(usbvirt_device_t *device, 339 339 const usb_device_request_setup_packet_t *setup_packet, 340 340 uint8_t *data, size_t *act_size) … … 400 400 * @return Error code. 401 401 */ 402 static int req_set_port_feature(usbvirt_device_t *device,402 static errno_t req_set_port_feature(usbvirt_device_t *device, 403 403 const usb_device_request_setup_packet_t *setup_packet, 404 404 uint8_t *data, size_t *act_size) … … 451 451 * only need 1 byte. 452 452 */ 453 static int req_status_change_handler(usbvirt_device_t *device,453 static errno_t req_status_change_handler(usbvirt_device_t *device, 454 454 usb_endpoint_t endpoint, usb_transfer_type_t tr_type, 455 455 void *buffer, size_t buffer_size, size_t *actual_size) -
uspace/drv/bus/usb/ohci/ohci_rh.h
r132ab5d1 r5a6cc679 66 66 } ohci_rh_t; 67 67 68 int ohci_rh_init(ohci_rh_t *, ohci_regs_t *, fibril_mutex_t *, const char *);69 int ohci_rh_schedule(ohci_rh_t *instance, usb_transfer_batch_t *batch);70 int ohci_rh_interrupt(ohci_rh_t *instance);68 errno_t ohci_rh_init(ohci_rh_t *, ohci_regs_t *, fibril_mutex_t *, const char *); 69 errno_t ohci_rh_schedule(ohci_rh_t *instance, usb_transfer_batch_t *batch); 70 errno_t ohci_rh_interrupt(ohci_rh_t *instance); 71 71 72 72 /** Get OHCI rh address. -
uspace/drv/bus/usb/uhci/hc.c
r132ab5d1 r5a6cc679 97 97 98 98 static void hc_init_hw(const hc_t *instance); 99 static int hc_init_mem_structures(hc_t *instance);100 static int hc_init_transfer_lists(hc_t *instance);101 102 static int hc_debug_checker(void *arg);99 static errno_t hc_init_mem_structures(hc_t *instance); 100 static errno_t hc_init_transfer_lists(hc_t *instance); 101 102 static errno_t hc_debug_checker(void *arg); 103 103 104 104 … … 110 110 * @return Error code. 111 111 */ 112 int hc_gen_irq_code(irq_code_t *code, hc_device_t *hcd, const hw_res_list_parsed_t *hw_res, int *irq)112 errno_t hc_gen_irq_code(irq_code_t *code, hc_device_t *hcd, const hw_res_list_parsed_t *hw_res, int *irq) 113 113 { 114 114 assert(code); … … 207 207 * interrupt fibrils. 208 208 */ 209 int hc_add(hc_device_t *hcd, const hw_res_list_parsed_t *hw_res)209 errno_t hc_add(hc_device_t *hcd, const hw_res_list_parsed_t *hw_res) 210 210 { 211 211 hc_t *instance = hcd_to_hc(hcd); … … 218 218 219 219 /* allow access to hc control registers */ 220 int ret = pio_enable_range(&hw_res->io_ranges.ranges[0],220 errno_t ret = pio_enable_range(&hw_res->io_ranges.ranges[0], 221 221 (void **) &instance->registers); 222 222 if (ret != EOK) { … … 327 327 } 328 328 329 static int endpoint_register(endpoint_t *ep)329 static errno_t endpoint_register(endpoint_t *ep) 330 330 { 331 331 hc_t * const hc = bus_to_hc(endpoint_get_bus(ep)); 332 332 333 const int err = usb2_bus_endpoint_register(&hc->bus_helper, ep);333 const errno_t err = usb2_bus_endpoint_register(&hc->bus_helper, ep); 334 334 if (err) 335 335 return err; … … 449 449 * - frame list page (needs to be one UHCI hw accessible 4K page) 450 450 */ 451 int hc_init_mem_structures(hc_t *instance)451 errno_t hc_init_mem_structures(hc_t *instance) 452 452 { 453 453 assert(instance); … … 468 468 469 469 /* Init transfer lists */ 470 int ret = hc_init_transfer_lists(instance);470 errno_t ret = hc_init_transfer_lists(instance); 471 471 if (ret != EOK) { 472 472 usb_log_error("Failed to initialize transfer lists."); … … 498 498 * USB scheduling. Sets pointer table for quick access. 499 499 */ 500 int hc_init_transfer_lists(hc_t *instance)500 errno_t hc_init_transfer_lists(hc_t *instance) 501 501 { 502 502 assert(instance); 503 503 #define SETUP_TRANSFER_LIST(type, name) \ 504 504 do { \ 505 int ret = transfer_list_init(&instance->transfers_##type, name); \505 errno_t ret = transfer_list_init(&instance->transfers_##type, name); \ 506 506 if (ret != EOK) { \ 507 507 usb_log_error("Failed to setup %s transfer list: %s.", \ … … 550 550 } 551 551 552 static int hc_status(bus_t *bus, uint32_t *status)552 static errno_t hc_status(bus_t *bus, uint32_t *status) 553 553 { 554 554 hc_t *instance = bus_to_hc(bus); … … 571 571 * @return Error code 572 572 */ 573 static int hc_schedule(usb_transfer_batch_t *batch)573 static errno_t hc_schedule(usb_transfer_batch_t *batch) 574 574 { 575 575 uhci_transfer_batch_t *uhci_batch = uhci_transfer_batch_get(batch); … … 586 586 return ENOTSUP; 587 587 588 int err;588 errno_t err; 589 589 if ((err = uhci_transfer_batch_prepare(uhci_batch))) 590 590 return err; … … 598 598 * @return EOK (should never return) 599 599 */ 600 int hc_debug_checker(void *arg)600 errno_t hc_debug_checker(void *arg) 601 601 { 602 602 hc_t *instance = arg; -
uspace/drv/bus/usb/uhci/hc.h
r132ab5d1 r5a6cc679 157 157 int hc_unschedule_batch(usb_transfer_batch_t *); 158 158 159 extern int hc_add(hc_device_t *, const hw_res_list_parsed_t *);160 extern int hc_gen_irq_code(irq_code_t *, hc_device_t *, const hw_res_list_parsed_t *, int *);161 extern int hc_start(hc_device_t *);162 extern int hc_setup_roothub(hc_device_t *);163 extern int hc_gone(hc_device_t *);159 extern errno_t hc_add(hc_device_t *, const hw_res_list_parsed_t *); 160 extern errno_t hc_gen_irq_code(irq_code_t *, hc_device_t *, const hw_res_list_parsed_t *, int *); 161 extern errno_t hc_start(hc_device_t *); 162 extern errno_t hc_setup_roothub(hc_device_t *); 163 extern errno_t hc_gone(hc_device_t *); 164 164 165 165 #endif -
uspace/drv/bus/usb/uhci/hw_struct/transfer_descriptor.c
r132ab5d1 r5a6cc679 119 119 * @return Error code. 120 120 */ 121 int td_status(const td_t *instance)121 errno_t td_status(const td_t *instance) 122 122 { 123 123 assert(instance); -
uspace/drv/bus/usb/uhci/hw_struct/transfer_descriptor.h
r132ab5d1 r5a6cc679 102 102 const void *buffer, const td_t *next); 103 103 104 int td_status(const td_t *instance);104 errno_t td_status(const td_t *instance); 105 105 106 106 void td_print_status(const td_t *instance); -
uspace/drv/bus/usb/uhci/main.c
r132ab5d1 r5a6cc679 49 49 #define NAME "uhci" 50 50 51 static int disable_legacy(hc_device_t *);51 static errno_t disable_legacy(hc_device_t *); 52 52 53 53 static const hc_driver_t uhci_driver = { … … 67 67 * @return Error code. 68 68 */ 69 static int disable_legacy(hc_device_t *hcd)69 static errno_t disable_legacy(hc_device_t *hcd) 70 70 { 71 71 assert(hcd); -
uspace/drv/bus/usb/uhci/transfer_list.c
r132ab5d1 r5a6cc679 55 55 * Allocates memory for internal qh_t structure. 56 56 */ 57 int transfer_list_init(transfer_list_t *instance, const char *name)57 errno_t transfer_list_init(transfer_list_t *instance, const char *name) 58 58 { 59 59 assert(instance); -
uspace/drv/bus/usb/uhci/transfer_list.h
r132ab5d1 r5a6cc679 57 57 58 58 void transfer_list_fini(transfer_list_t *); 59 int transfer_list_init(transfer_list_t *, const char *);59 errno_t transfer_list_init(transfer_list_t *, const char *); 60 60 void transfer_list_set_next(transfer_list_t *, transfer_list_t *); 61 int transfer_list_add_batch(transfer_list_t *, uhci_transfer_batch_t *);61 errno_t transfer_list_add_batch(transfer_list_t *, uhci_transfer_batch_t *); 62 62 void transfer_list_remove_batch(transfer_list_t *, uhci_transfer_batch_t *); 63 63 void transfer_list_check_finished(transfer_list_t *); -
uspace/drv/bus/usb/uhci/uhci_rh.c
r132ab5d1 r5a6cc679 79 79 * @return Error code, EOK on success. 80 80 */ 81 int uhci_rh_init(uhci_rh_t *instance, ioport16_t *ports, const char *name)81 errno_t uhci_rh_init(uhci_rh_t *instance, ioport16_t *ports, const char *name) 82 82 { 83 83 assert(instance); … … 99 99 * not have to be. 100 100 */ 101 int uhci_rh_schedule(uhci_rh_t *instance, usb_transfer_batch_t *batch)101 errno_t uhci_rh_schedule(uhci_rh_t *instance, usb_transfer_batch_t *batch) 102 102 { 103 103 assert(instance); … … 189 189 * it is usefull for debuging purposes only. 190 190 */ 191 static int req_get_port_state(usbvirt_device_t *device,191 static errno_t req_get_port_state(usbvirt_device_t *device, 192 192 const usb_device_request_setup_packet_t *setup_packet, 193 193 uint8_t *data, size_t *act_size) … … 224 224 * @note: reset change status needs to be handled in sw. 225 225 */ 226 static int req_get_port_status(usbvirt_device_t *device,226 static errno_t req_get_port_status(usbvirt_device_t *device, 227 227 const usb_device_request_setup_packet_t *setup_packet, 228 228 uint8_t *data, size_t *act_size) … … 263 263 * @return Error code. 264 264 */ 265 static int req_clear_port_feature(usbvirt_device_t *device,265 static errno_t req_clear_port_feature(usbvirt_device_t *device, 266 266 const usb_device_request_setup_packet_t *setup_packet, 267 267 uint8_t *data, size_t *act_size) … … 336 336 * @return Error code. 337 337 */ 338 static int req_set_port_feature(usbvirt_device_t *device,338 static errno_t req_set_port_feature(usbvirt_device_t *device, 339 339 const usb_device_request_setup_packet_t *setup_packet, 340 340 uint8_t *data, size_t *act_size) … … 398 398 * only need 1 byte. 399 399 */ 400 static int req_status_change_handler(usbvirt_device_t *device,400 static errno_t req_status_change_handler(usbvirt_device_t *device, 401 401 usb_endpoint_t endpoint, usb_transfer_type_t tr_type, 402 402 void *buffer, size_t buffer_size, size_t *actual_size) -
uspace/drv/bus/usb/uhci/uhci_rh.h
r132ab5d1 r5a6cc679 56 56 } uhci_rh_t; 57 57 58 int uhci_rh_init(uhci_rh_t *instance, ioport16_t *ports, const char *name);59 int uhci_rh_schedule(uhci_rh_t *instance, usb_transfer_batch_t *batch);58 errno_t uhci_rh_init(uhci_rh_t *instance, ioport16_t *ports, const char *name); 59 errno_t uhci_rh_schedule(uhci_rh_t *instance, usb_transfer_batch_t *batch); 60 60 61 61 /** Get UHCI rh address. -
uspace/drv/bus/usb/usbflbk/main.c
r132ab5d1 r5a6cc679 46 46 * @return Error code. 47 47 */ 48 static int usbfallback_device_add(usb_device_t *dev)48 static errno_t usbfallback_device_add(usb_device_t *dev) 49 49 { 50 50 usb_log_info("Pretending to control %s `%s'.", … … 59 59 * @return Error code. 60 60 */ 61 static int usbfallback_device_gone(usb_device_t *dev)61 static errno_t usbfallback_device_gone(usb_device_t *dev) 62 62 { 63 63 assert(dev); -
uspace/drv/bus/usb/usbhub/port.c
r132ab5d1 r5a6cc679 101 101 * Routine for adding a new device in USB2. 102 102 */ 103 static int enumerate_device_usb2(usb_hub_port_t *port, async_exch_t *exch)104 { 105 int err;103 static errno_t enumerate_device_usb2(usb_hub_port_t *port, async_exch_t *exch) 104 { 105 errno_t err; 106 106 107 107 port_log(debug, port, "Requesting default address."); … … 145 145 * Routine for adding a new device in USB 3. 146 146 */ 147 static int enumerate_device_usb3(usb_hub_port_t *port, async_exch_t *exch)148 { 149 int err;147 static errno_t enumerate_device_usb3(usb_hub_port_t *port, async_exch_t *exch) 148 { 149 errno_t err; 150 150 151 151 port_log(debug, port, "Issuing a warm reset."); … … 170 170 } 171 171 172 static int enumerate_device(usb_port_t *port_base)172 static errno_t enumerate_device(usb_port_t *port_base) 173 173 { 174 174 usb_hub_port_t *port = get_hub_port(port_base); … … 181 181 } 182 182 183 const int err = port->hub->speed == USB_SPEED_SUPER183 const errno_t err = port->hub->speed == USB_SPEED_SUPER 184 184 ? enumerate_device_usb3(port, exch) 185 185 : enumerate_device_usb2(port, exch); -
uspace/drv/bus/usb/usbhub/usbhub.c
r132ab5d1 r5a6cc679 99 99 }; 100 100 101 static int usb_set_first_configuration(usb_device_t *);102 static int usb_hub_process_hub_specific_info(usb_hub_dev_t *);101 static errno_t usb_set_first_configuration(usb_device_t *); 102 static errno_t usb_hub_process_hub_specific_info(usb_hub_dev_t *); 103 103 static void usb_hub_over_current(const usb_hub_dev_t *, usb_hub_status_t); 104 static int usb_hub_polling_init(usb_hub_dev_t *, usb_endpoint_mapping_t *);104 static errno_t usb_hub_polling_init(usb_hub_dev_t *, usb_endpoint_mapping_t *); 105 105 static void usb_hub_global_interrupt(const usb_hub_dev_t *); 106 106 107 107 static bool usb_hub_polling_error_callback(usb_device_t *dev, 108 int err_code, void *arg)108 errno_t err_code, void *arg) 109 109 { 110 110 assert(dev); … … 125 125 * @return error code 126 126 */ 127 int usb_hub_device_add(usb_device_t *usb_dev)127 errno_t usb_hub_device_add(usb_device_t *usb_dev) 128 128 { 129 129 int err; … … 198 198 } 199 199 200 static int usb_hub_cleanup(usb_hub_dev_t *hub)200 static errno_t usb_hub_cleanup(usb_hub_dev_t *hub) 201 201 { 202 202 free(hub->polling.buffer); … … 228 228 * @return error code 229 229 */ 230 int usb_hub_device_remove(usb_device_t *usb_dev)230 errno_t usb_hub_device_remove(usb_device_t *usb_dev) 231 231 { 232 232 assert(usb_dev); … … 249 249 * @return error code 250 250 */ 251 int usb_hub_device_gone(usb_device_t *usb_dev)251 errno_t usb_hub_device_gone(usb_device_t *usb_dev) 252 252 { 253 253 assert(usb_dev); … … 270 270 * @param mapping The mapping of Status Change Endpoint 271 271 */ 272 static int usb_hub_polling_init(usb_hub_dev_t *hub_dev,272 static errno_t usb_hub_polling_init(usb_hub_dev_t *hub_dev, 273 273 usb_endpoint_mapping_t *mapping) 274 274 { 275 int err;275 errno_t err; 276 276 usb_polling_t *polling = &hub_dev->polling; 277 277 … … 369 369 * @return error code 370 370 */ 371 static int usb_hub_process_hub_specific_info(usb_hub_dev_t *hub_dev)371 static errno_t usb_hub_process_hub_specific_info(usb_hub_dev_t *hub_dev) 372 372 { 373 373 assert(hub_dev); … … 382 382 usb_hub_descriptor_header_t descriptor; 383 383 size_t received_size; 384 int opResult = usb_request_get_descriptor(control_pipe,384 errno_t opResult = usb_request_get_descriptor(control_pipe, 385 385 USB_REQUEST_TYPE_CLASS, USB_REQUEST_RECIPIENT_DEVICE, 386 386 desc_type, 0, 0, &descriptor, … … 436 436 * @return error code 437 437 */ 438 static int usb_set_first_configuration(usb_device_t *usb_device)438 static errno_t usb_set_first_configuration(usb_device_t *usb_device) 439 439 { 440 440 assert(usb_device); … … 462 462 /* Set configuration. Use the configuration that was in 463 463 * usb_device->descriptors.configuration i.e. The first one. */ 464 int opResult = usb_request_set_configuration(464 errno_t opResult = usb_request_set_configuration( 465 465 usb_device_get_default_pipe(usb_device), 466 466 config_descriptor->configuration_number); … … 500 500 /* Over-current condition is gone, it is safe to turn the ports on. */ 501 501 for (size_t port = 0; port < hub_dev->port_count; ++port) { 502 const int ret = usb_hub_set_port_feature(hub_dev, port,502 const errno_t ret = usb_hub_set_port_feature(hub_dev, port, 503 503 USB_HUB_FEATURE_PORT_POWER); 504 504 if (ret != EOK) { … … 637 637 /* NOTE: We can't use standard USB GET_STATUS request, because 638 638 * hubs reply is 4byte instead of 2 */ 639 const int opResult = usb_pipe_control_read(control_pipe,639 const errno_t opResult = usb_pipe_control_read(control_pipe, 640 640 &get_hub_status_request, sizeof(get_hub_status_request), 641 641 &status, sizeof(usb_hub_status_t), &rcvd_size); … … 655 655 usb_hub_over_current(hub_dev, status); 656 656 /* Ack change in hub OC flag */ 657 const int ret = usb_request_clear_feature(657 const errno_t ret = usb_request_clear_feature( 658 658 control_pipe, USB_REQUEST_TYPE_CLASS, 659 659 USB_REQUEST_RECIPIENT_DEVICE, … … 679 679 * Just ACK the change. 680 680 */ 681 const int ret = usb_request_clear_feature(681 const errno_t ret = usb_request_clear_feature( 682 682 control_pipe, USB_REQUEST_TYPE_CLASS, 683 683 USB_REQUEST_RECIPIENT_DEVICE, -
uspace/drv/bus/usb/usbhub/usbhub.h
r132ab5d1 r5a6cc679 78 78 extern const usb_endpoint_description_t *usb_hub_endpoints []; 79 79 80 int usb_hub_device_add(usb_device_t *);81 int usb_hub_device_remove(usb_device_t *);82 int usb_hub_device_gone(usb_device_t *);80 errno_t usb_hub_device_add(usb_device_t *); 81 errno_t usb_hub_device_remove(usb_device_t *); 82 errno_t usb_hub_device_gone(usb_device_t *); 83 83 84 int usb_hub_set_depth(const usb_hub_dev_t *);85 int usb_hub_get_port_status(const usb_hub_dev_t *, size_t, usb_port_status_t *);86 int usb_hub_set_port_feature(const usb_hub_dev_t *, size_t, usb_hub_class_feature_t);87 int usb_hub_clear_port_feature(const usb_hub_dev_t *, size_t, usb_hub_class_feature_t);84 errno_t usb_hub_set_depth(const usb_hub_dev_t *); 85 errno_t usb_hub_get_port_status(const usb_hub_dev_t *, size_t, usb_port_status_t *); 86 errno_t usb_hub_set_port_feature(const usb_hub_dev_t *, size_t, usb_hub_class_feature_t); 87 errno_t usb_hub_clear_port_feature(const usb_hub_dev_t *, size_t, usb_hub_class_feature_t); 88 88 89 89 bool hub_port_changes_callback(usb_device_t *, uint8_t *, size_t, void *); 90 90 91 int usb_hub_reserve_default_address(usb_hub_dev_t *, async_exch_t *, usb_port_t *);92 int usb_hub_release_default_address(usb_hub_dev_t *, async_exch_t *);91 errno_t usb_hub_reserve_default_address(usb_hub_dev_t *, async_exch_t *, usb_port_t *); 92 errno_t usb_hub_release_default_address(usb_hub_dev_t *, async_exch_t *); 93 93 94 94 #endif -
uspace/drv/bus/usb/usbmid/explore.c
r132ab5d1 r5a6cc679 66 66 * @param list List where to add the interfaces. 67 67 */ 68 static int create_interfaces(const uint8_t *config_descriptor,68 static errno_t create_interfaces(const uint8_t *config_descriptor, 69 69 size_t config_descriptor_size, list_t *list, usb_device_t *usb_dev) 70 70 { … … 111 111 112 112 usbmid_interface_t *iface = NULL; 113 const int rc = usbmid_spawn_interface_child(usb_dev, &iface,113 const errno_t rc = usbmid_spawn_interface_child(usb_dev, &iface, 114 114 &usb_device_descriptors(usb_dev)->device, interface); 115 115 if (rc != EOK) { … … 134 134 * @return Whether to accept this device. 135 135 */ 136 int usbmid_explore_device(usb_device_t *dev)136 errno_t usbmid_explore_device(usb_device_t *dev) 137 137 { 138 138 assert(dev); … … 157 157 158 158 /* Select the first configuration */ 159 int rc = usb_request_set_configuration(usb_device_get_default_pipe(dev),159 errno_t rc = usb_request_set_configuration(usb_device_get_default_pipe(dev), 160 160 config_descriptor->configuration_number); 161 161 if (rc != EOK) { -
uspace/drv/bus/usb/usbmid/main.c
r132ab5d1 r5a6cc679 49 49 * @return Error code. 50 50 */ 51 static int usbmid_device_add(usb_device_t *dev)51 static errno_t usbmid_device_add(usb_device_t *dev) 52 52 { 53 53 usb_log_info("Taking care of new MID `%s'.", usb_device_get_name(dev)); … … 82 82 * @return Error code. 83 83 */ 84 static int usbmid_device_remove(usb_device_t *dev)84 static errno_t usbmid_device_remove(usb_device_t *dev) 85 85 { 86 86 assert(dev); … … 89 89 90 90 /* Remove ctl function */ 91 int ret = ddf_fun_unbind(usb_mid->ctl_fun);91 errno_t ret = ddf_fun_unbind(usb_mid->ctl_fun); 92 92 if (ret != EOK) { 93 93 usb_log_error("Failed to unbind USB MID ctl function: %s.", … … 103 103 104 104 /* Tell the child to go offline. */ 105 int pret = ddf_fun_offline(iface->fun);105 errno_t pret = ddf_fun_offline(iface->fun); 106 106 if (pret != EOK) { 107 107 usb_log_warning("Failed to turn off child `%s': %s", … … 118 118 * @return Error code. 119 119 */ 120 static int usbmid_device_gone(usb_device_t *dev)120 static errno_t usbmid_device_gone(usb_device_t *dev) 121 121 { 122 122 assert(dev); … … 127 127 128 128 /* Remove ctl function */ 129 int ret = ddf_fun_unbind(usb_mid->ctl_fun);129 errno_t ret = ddf_fun_unbind(usb_mid->ctl_fun); 130 130 if (ret != EOK) { 131 131 usb_log_error("Failed to unbind USB MID ctl function: %s.", … … 149 149 } 150 150 151 static int usbmid_function_offline(ddf_fun_t *fun)151 static errno_t usbmid_function_offline(ddf_fun_t *fun) 152 152 { 153 153 usb_device_t *usb_dev = ddf_dev_data_get(ddf_fun_get_dev(fun)); -
uspace/drv/bus/usb/usbmid/usbmid.c
r132ab5d1 r5a6cc679 52 52 * @return Error code. 53 53 */ 54 static int usb_iface_description(ddf_fun_t *fun, usb_device_desc_t *desc)54 static errno_t usb_iface_description(ddf_fun_t *fun, usb_device_desc_t *desc) 55 55 { 56 56 usbmid_interface_t *iface = ddf_fun_data_get(fun); … … 64 64 65 65 usb_device_desc_t tmp_desc; 66 const int ret = usb_get_my_description(exch, &tmp_desc);66 const errno_t ret = usb_get_my_description(exch, &tmp_desc); 67 67 68 68 if (ret == EOK && desc) { … … 86 86 }; 87 87 88 int usbmid_interface_destroy(usbmid_interface_t *mid_iface)88 errno_t usbmid_interface_destroy(usbmid_interface_t *mid_iface) 89 89 { 90 90 assert(mid_iface); 91 91 assert_link_not_used(&mid_iface->link); 92 const int ret = ddf_fun_unbind(mid_iface->fun);92 const errno_t ret = ddf_fun_unbind(mid_iface->fun); 93 93 if (ret != EOK) { 94 94 return ret; … … 106 106 * @return Error code. 107 107 */ 108 int usbmid_spawn_interface_child(usb_device_t *parent,108 errno_t usbmid_spawn_interface_child(usb_device_t *parent, 109 109 usbmid_interface_t **iface_ret, 110 110 const usb_standard_device_descriptor_t *device_descriptor, … … 113 113 ddf_fun_t *child = NULL; 114 114 char *child_name = NULL; 115 int rc;115 errno_t rc; 116 116 117 117 /* -
uspace/drv/bus/usb/usbmid/usbmid.h
r132ab5d1 r5a6cc679 62 62 } usb_mid_t; 63 63 64 extern int usbmid_explore_device(usb_device_t *);65 extern int usbmid_spawn_interface_child(usb_device_t *, usbmid_interface_t **,64 extern errno_t usbmid_explore_device(usb_device_t *); 65 extern errno_t 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 68 extern void usbmid_dump_descriptors(uint8_t *, size_t); 69 extern int usbmid_interface_destroy(usbmid_interface_t *mid_iface);69 extern errno_t usbmid_interface_destroy(usbmid_interface_t *mid_iface); 70 70 71 71 static inline usbmid_interface_t * usbmid_interface_from_link(link_t *item) -
uspace/drv/bus/usb/vhc/conndev.c
r132ab5d1 r5a6cc679 75 75 } 76 76 77 int data_request_rc;78 int opening_request_rc;77 errno_t data_request_rc; 78 errno_t opening_request_rc; 79 79 async_wait_for(data_request, &data_request_rc); 80 80 async_wait_for(opening_request, &opening_request_rc); … … 102 102 103 103 if (callback) { 104 int rc = vhc_virtdev_plug(vhc, callback, &plugged_device_handle);104 errno_t rc = vhc_virtdev_plug(vhc, callback, &plugged_device_handle); 105 105 if (rc != EOK) { 106 106 async_answer_0(icallid, rc); -
uspace/drv/bus/usb/vhc/devconn.c
r132ab5d1 r5a6cc679 49 49 } 50 50 51 static int vhc_virtdev_plug_generic(vhc_data_t *vhc,51 static errno_t vhc_virtdev_plug_generic(vhc_data_t *vhc, 52 52 async_sess_t *sess, usbvirt_device_t *virtdev, 53 53 uintptr_t *handle, bool connect, usb_address_t address) … … 85 85 } 86 86 87 int vhc_virtdev_plug(vhc_data_t *vhc, async_sess_t *sess, uintptr_t *handle)87 errno_t vhc_virtdev_plug(vhc_data_t *vhc, async_sess_t *sess, uintptr_t *handle) 88 88 { 89 89 return vhc_virtdev_plug_generic(vhc, sess, NULL, handle, true, 0); 90 90 } 91 91 92 int vhc_virtdev_plug_local(vhc_data_t *vhc, usbvirt_device_t *dev, uintptr_t *handle)92 errno_t vhc_virtdev_plug_local(vhc_data_t *vhc, usbvirt_device_t *dev, uintptr_t *handle) 93 93 { 94 94 return vhc_virtdev_plug_generic(vhc, NULL, dev, handle, true, 0); 95 95 } 96 96 97 int vhc_virtdev_plug_hub(vhc_data_t *vhc, usbvirt_device_t *dev,97 errno_t vhc_virtdev_plug_hub(vhc_data_t *vhc, usbvirt_device_t *dev, 98 98 uintptr_t *handle, usb_address_t address) 99 99 { -
uspace/drv/bus/usb/vhc/hub/hub.c
r132ab5d1 r5a6cc679 63 63 static void set_port_status_change(hub_port_t *, hub_status_change_t); 64 64 static void clear_port_status_change(hub_port_t *, uint16_t); 65 static int set_port_state_delayed_fibril(void *);65 static errno_t set_port_state_delayed_fibril(void *); 66 66 static void set_port_state_delayed(hub_t *, size_t, suseconds_t, 67 67 hub_port_state_t, hub_port_state_t); … … 163 163 * @return Error code. 164 164 */ 165 int hub_disconnect_device(hub_t *hub, void *device)165 errno_t hub_disconnect_device(hub_t *hub, void *device) 166 166 { 167 167 size_t index = hub_find_device(hub, device); … … 461 461 * @return Always EOK. 462 462 */ 463 static int set_port_state_delayed_fibril(void *arg)463 static errno_t set_port_state_delayed_fibril(void *arg) 464 464 { 465 465 struct delay_port_state_change *change -
uspace/drv/bus/usb/vhc/hub/hub.h
r132ab5d1 r5a6cc679 102 102 void hub_init(hub_t *); 103 103 size_t hub_connect_device(hub_t *, void *); 104 int hub_disconnect_device(hub_t *, void *);104 errno_t hub_disconnect_device(hub_t *, void *); 105 105 size_t hub_find_device(hub_t *, void *); 106 106 void hub_acquire(hub_t *); -
uspace/drv/bus/usb/vhc/hub/virthub.c
r132ab5d1 r5a6cc679 147 147 * @return Error code. 148 148 */ 149 int virthub_init(usbvirt_device_t *dev, const char* name)149 errno_t virthub_init(usbvirt_device_t *dev, const char* name) 150 150 { 151 151 if (dev == NULL) { … … 197 197 * @return Error code. 198 198 */ 199 int virthub_disconnect_device(usbvirt_device_t *dev, vhc_virtdev_t *conn)199 errno_t virthub_disconnect_device(usbvirt_device_t *dev, vhc_virtdev_t *conn) 200 200 { 201 201 assert(dev != NULL); -
uspace/drv/bus/usb/vhc/hub/virthub.h
r132ab5d1 r5a6cc679 80 80 extern hub_descriptor_t hub_descriptor; 81 81 82 int virthub_init(usbvirt_device_t *, const char *name);82 errno_t virthub_init(usbvirt_device_t *, const char *name); 83 83 int virthub_connect_device(usbvirt_device_t *, vhc_virtdev_t *); 84 int virthub_disconnect_device(usbvirt_device_t *, vhc_virtdev_t *);84 errno_t virthub_disconnect_device(usbvirt_device_t *, vhc_virtdev_t *); 85 85 bool virthub_is_device_enabled(usbvirt_device_t *, vhc_virtdev_t *); 86 86 void virthub_get_status(usbvirt_device_t *, char *, size_t); -
uspace/drv/bus/usb/vhc/hub/virthubops.c
r132ab5d1 r5a6cc679 63 63 64 64 /** Callback for data request. */ 65 static int req_on_status_change_pipe(usbvirt_device_t *dev,65 static errno_t req_on_status_change_pipe(usbvirt_device_t *dev, 66 66 usb_endpoint_t endpoint, usb_transfer_type_t tr_type, 67 67 void *buffer, size_t buffer_size, size_t *actual_size) … … 109 109 * @return Error code. 110 110 */ 111 static int req_clear_hub_feature(usbvirt_device_t *dev,111 static errno_t req_clear_hub_feature(usbvirt_device_t *dev, 112 112 const usb_device_request_setup_packet_t *request, uint8_t *data, 113 113 size_t *act_size) … … 123 123 * @return Error code. 124 124 */ 125 static int req_clear_port_feature(usbvirt_device_t *dev,126 const usb_device_request_setup_packet_t *request, uint8_t *data, 127 size_t *act_size) 128 { 129 int rc;125 static errno_t req_clear_port_feature(usbvirt_device_t *dev, 126 const usb_device_request_setup_packet_t *request, uint8_t *data, 127 size_t *act_size) 128 { 129 errno_t rc; 130 130 size_t port = request->index - 1; 131 131 usb_hub_class_feature_t feature = request->value; … … 203 203 * @return Error code. 204 204 */ 205 static int req_get_bus_state(usbvirt_device_t *dev,205 static errno_t req_get_bus_state(usbvirt_device_t *dev, 206 206 const usb_device_request_setup_packet_t *request, uint8_t *data, 207 207 size_t *act_size) … … 217 217 * @return Error code. 218 218 */ 219 static int req_get_descriptor(usbvirt_device_t *dev,219 static errno_t req_get_descriptor(usbvirt_device_t *dev, 220 220 const usb_device_request_setup_packet_t *request, uint8_t *data, 221 221 size_t *act_size) … … 238 238 * @return Error code. 239 239 */ 240 static int req_get_hub_status(usbvirt_device_t *dev,240 static errno_t req_get_hub_status(usbvirt_device_t *dev, 241 241 const usb_device_request_setup_packet_t *request, uint8_t *data, 242 242 size_t *act_size) … … 257 257 * @return Error code. 258 258 */ 259 static int req_get_port_status(usbvirt_device_t *dev,259 static errno_t req_get_port_status(usbvirt_device_t *dev, 260 260 const usb_device_request_setup_packet_t *request, uint8_t *data, 261 261 size_t *act_size) … … 282 282 * @return Error code. 283 283 */ 284 static int req_set_hub_feature(usbvirt_device_t *dev,284 static errno_t req_set_hub_feature(usbvirt_device_t *dev, 285 285 const usb_device_request_setup_packet_t *request, uint8_t *data, 286 286 size_t *act_size) … … 296 296 * @return Error code. 297 297 */ 298 static int req_set_port_feature(usbvirt_device_t *dev,299 const usb_device_request_setup_packet_t *request, uint8_t *data, 300 size_t *act_size) 301 { 302 int rc = ENOTSUP;298 static errno_t req_set_port_feature(usbvirt_device_t *dev, 299 const usb_device_request_setup_packet_t *request, uint8_t *data, 300 size_t *act_size) 301 { 302 errno_t rc = ENOTSUP; 303 303 size_t port = request->index - 1; 304 304 usb_hub_class_feature_t feature = request->value; -
uspace/drv/bus/usb/vhc/main.c
r132ab5d1 r5a6cc679 50 50 }; 51 51 52 static int vhc_control_node(ddf_dev_t *dev, ddf_fun_t **fun)52 static errno_t vhc_control_node(ddf_dev_t *dev, ddf_fun_t **fun) 53 53 { 54 54 assert(dev); … … 64 64 } 65 65 ddf_fun_set_ops(*fun, &vhc_ops); 66 const int ret = ddf_fun_bind(*fun);66 const errno_t ret = ddf_fun_bind(*fun); 67 67 if (ret != EOK) { 68 68 ddf_fun_destroy(*fun); … … 73 73 } 74 74 75 static int vhc_dev_add(ddf_dev_t *dev)75 static errno_t vhc_dev_add(ddf_dev_t *dev) 76 76 { 77 77 /* Initialize generic structures */ 78 int ret = hcd_ddf_setup_hc(dev, sizeof(vhc_data_t));78 errno_t ret = hcd_ddf_setup_hc(dev, sizeof(vhc_data_t)); 79 79 if (ret != EOK) { 80 80 usb_log_error("Failed to init HCD structures: %s.", -
uspace/drv/bus/usb/vhc/transfer.c
r132ab5d1 r5a6cc679 61 61 } 62 62 63 static int process_transfer_local(usb_transfer_batch_t *batch,63 static errno_t process_transfer_local(usb_transfer_batch_t *batch, 64 64 usbvirt_device_t *dev, size_t *actual_data_size) 65 65 { 66 int rc;66 errno_t rc; 67 67 68 68 const usb_direction_t dir = batch->dir; … … 97 97 } 98 98 99 static int process_transfer_remote(usb_transfer_batch_t *batch,99 static errno_t process_transfer_remote(usb_transfer_batch_t *batch, 100 100 async_sess_t *sess, size_t *actual_data_size) 101 101 { 102 int rc;102 errno_t rc; 103 103 104 104 const usb_direction_t dir = batch->dir; … … 146 146 147 147 static void execute_transfer_callback_and_free(vhc_transfer_t *transfer, 148 size_t data_transfer_size, int outcome)148 size_t data_transfer_size, errno_t outcome) 149 149 { 150 150 assert(outcome != ENAK); … … 192 192 }; 193 193 194 int vhc_init(vhc_data_t *instance)194 errno_t vhc_init(vhc_data_t *instance) 195 195 { 196 196 assert(instance); … … 203 203 } 204 204 205 int vhc_schedule(usb_transfer_batch_t *batch)205 errno_t vhc_schedule(usb_transfer_batch_t *batch) 206 206 { 207 207 assert(batch); … … 233 233 } 234 234 235 int vhc_transfer_queue_processor(void *arg)235 errno_t vhc_transfer_queue_processor(void *arg) 236 236 { 237 237 vhc_virtdev_t *dev = arg; … … 248 248 fibril_mutex_unlock(&dev->guard); 249 249 250 int rc = EOK;250 errno_t rc = EOK; 251 251 size_t data_transfer_size = 0; 252 252 if (dev->dev_sess) { -
uspace/drv/bus/usb/vhc/vhcd.h
r132ab5d1 r5a6cc679 90 90 ipc_call_t *icall); 91 91 92 int vhc_virtdev_plug(vhc_data_t *, async_sess_t *, uintptr_t *);93 int vhc_virtdev_plug_local(vhc_data_t *, usbvirt_device_t *, uintptr_t *);94 int vhc_virtdev_plug_hub(vhc_data_t *, usbvirt_device_t *, uintptr_t *, usb_address_t address);92 errno_t vhc_virtdev_plug(vhc_data_t *, async_sess_t *, uintptr_t *); 93 errno_t vhc_virtdev_plug_local(vhc_data_t *, usbvirt_device_t *, uintptr_t *); 94 errno_t vhc_virtdev_plug_hub(vhc_data_t *, usbvirt_device_t *, uintptr_t *, usb_address_t address); 95 95 void vhc_virtdev_unplug(vhc_data_t *, uintptr_t); 96 96 97 int vhc_init(vhc_data_t *);98 int vhc_schedule(usb_transfer_batch_t *);99 int vhc_transfer_queue_processor(void *arg);97 errno_t vhc_init(vhc_data_t *); 98 errno_t vhc_schedule(usb_transfer_batch_t *); 99 errno_t vhc_transfer_queue_processor(void *arg); 100 100 101 101 #endif
Note:
See TracChangeset
for help on using the changeset viewer.
