Changeset 32fb6bce in mainline for uspace/lib/usbhost/include/usb/host/ddf_helpers.h
- Timestamp:
- 2017-12-18T22:50:21Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 7f70d1c
- Parents:
- 1ea0bbf
- git-author:
- Ondřej Hlavatý <aearsis@…> (2017-12-18 22:04:50)
- git-committer:
- Ondřej Hlavatý <aearsis@…> (2017-12-18 22:50:21)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbhost/include/usb/host/ddf_helpers.h
r1ea0bbf r32fb6bce 39 39 #include <ddf/driver.h> 40 40 #include <ddf/interrupt.h> 41 #include <device/hw_res_parsed.h>42 41 #include <usb/usb.h> 43 42 44 43 #include <usb/host/hcd.h> 45 44 46 typedef int (*driver_init_t)(hcd_t *, const hw_res_list_parsed_t *, ddf_dev_t *); 47 typedef int (*irq_code_gen_t)(irq_code_t *, hcd_t *, const hw_res_list_parsed_t *); 48 typedef int (*claim_t)(hcd_t *, ddf_dev_t *); 49 typedef int (*driver_start_t)(hcd_t *, bool irq); 50 typedef int (*setup_root_hub_t)(hcd_t *, ddf_dev_t *); 45 int hcd_ddf_setup_hc(ddf_dev_t *, size_t); 46 void hcd_ddf_clean_hc(hc_device_t *); 51 47 52 typedef void (*driver_stop_t)(hcd_t *); 53 typedef void (*driver_fini_t)(hcd_t *); 48 int hcd_setup_virtual_root_hub(hc_device_t *); 54 49 55 /** 56 * All callbacks are optional. 57 */ 58 typedef struct { 59 hcd_ops_t ops; 60 const char *name; 50 device_t *hcd_ddf_fun_create(hc_device_t *); 51 void hcd_ddf_fun_destroy(device_t *); 61 52 62 interrupt_handler_t *irq_handler; /**< Handler of IRQ. Do have generic implementation. */ 53 int hcd_device_explore(device_t *); 63 54 64 /* Initialization sequence: */ 65 driver_init_t init; /**< Initialize internal structures, memory */ 66 claim_t claim; /**< Claim device from BIOS */ 67 irq_code_gen_t irq_code_gen; /**< Generate IRQ handling code */ 68 driver_start_t start; /**< Start the HC */ 69 setup_root_hub_t setup_root_hub; /**< Setup the root hub */ 55 int hcd_ddf_enable_interrupt(hc_device_t *hcd, int); 56 int hcd_ddf_get_registers(hc_device_t *hcd, hw_res_list_parsed_t *hw_res); 70 57 71 /* Destruction sequence: */ 72 driver_stop_t stop; /**< Stop the HC (counterpart of start) */ 73 driver_fini_t fini; /**< Destroy internal structures (counterpart of init) */ 74 } ddf_hc_driver_t; 75 76 int hcd_ddf_add_hc(ddf_dev_t *device, const ddf_hc_driver_t *driver); 77 78 int hcd_ddf_setup_hc(ddf_dev_t *device); 79 void hcd_ddf_clean_hc(ddf_dev_t *device); 80 81 int hcd_setup_virtual_root_hub(hcd_t *, ddf_dev_t *); 82 83 device_t *hcd_ddf_device_create(ddf_dev_t *, bus_t *); 84 void hcd_ddf_device_destroy(device_t *); 85 int hcd_ddf_device_explore(device_t *); 86 int hcd_ddf_device_online(ddf_fun_t *); 87 int hcd_ddf_device_offline(ddf_fun_t *); 88 89 hcd_t *dev_to_hcd(ddf_dev_t *dev); 90 91 int hcd_ddf_enable_interrupt(ddf_dev_t *device, int); 92 int hcd_ddf_get_registers(ddf_dev_t *device, hw_res_list_parsed_t *hw_res); 93 int hcd_ddf_setup_interrupts(ddf_dev_t *device, 94 const hw_res_list_parsed_t *hw_res, 95 interrupt_handler_t handler, 96 irq_code_gen_t gen_irq_code); 97 void ddf_hcd_gen_irq_handler(ipc_callid_t iid, ipc_call_t *call, ddf_dev_t *dev); 58 void hcd_ddf_gen_irq_handler(ipc_callid_t iid, ipc_call_t *call, ddf_dev_t *dev); 98 59 99 60 #endif
Note:
See TracChangeset
for help on using the changeset viewer.