Changes in uspace/lib/usbhost/include/usb/host/ddf_helpers.h [cccd60c3:0f6b50f] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbhost/include/usb/host/ddf_helpers.h
rcccd60c3 r0f6b50f 38 38 39 39 #include <usb/host/hcd.h> 40 #include <usb/host/ usb_bus.h>40 #include <usb/host/bus.h> 41 41 #include <usb/usb.h> 42 42 … … 45 45 #include <device/hw_res_parsed.h> 46 46 47 typedef int (*driver_init_t)(hcd_t *, const hw_res_list_parsed_t *, bool); 47 typedef int (*driver_init_t)(hcd_t *, const hw_res_list_parsed_t *, ddf_dev_t *); 48 typedef int (*irq_code_gen_t)(irq_code_t *, hcd_t *, const hw_res_list_parsed_t *); 49 typedef int (*claim_t)(hcd_t *, ddf_dev_t *); 50 typedef int (*driver_start_t)(hcd_t *, bool irq); 51 typedef int (*setup_root_hub_t)(hcd_t *, ddf_dev_t *); 52 53 typedef void (*driver_stop_t)(hcd_t *); 48 54 typedef void (*driver_fini_t)(hcd_t *); 49 typedef int (*claim_t)(ddf_dev_t *);50 typedef int (*irq_code_gen_t)(irq_code_t *, const hw_res_list_parsed_t *);51 55 56 /** 57 * All callbacks are optional. 58 */ 52 59 typedef struct { 53 60 hcd_ops_t ops; 54 claim_t claim;55 usb_speed_t hc_speed;56 driver_init_t init;57 driver_fini_t fini;58 interrupt_handler_t *irq_handler;59 irq_code_gen_t irq_code_gen;60 61 const char *name; 62 63 interrupt_handler_t *irq_handler; /**< Handler of IRQ. Do have generic implementation. */ 64 65 /* Initialization sequence: */ 66 driver_init_t init; /**< Initialize internal structures, memory */ 67 claim_t claim; /**< Claim device from BIOS */ 68 irq_code_gen_t irq_code_gen; /**< Generate IRQ handling code */ 69 driver_start_t start; /**< Start the HC */ 70 setup_root_hub_t setup_root_hub; /**< Setup the root hub */ 71 72 /* Destruction sequence: */ 73 driver_stop_t stop; /**< Stop the HC (counterpart of start) */ 74 driver_fini_t fini; /**< Destroy internal structures (counterpart of init) */ 61 75 } ddf_hc_driver_t; 62 76 63 77 int hcd_ddf_add_hc(ddf_dev_t *device, const ddf_hc_driver_t *driver); 64 78 65 int hcd_ddf_setup_hc(ddf_dev_t *device, usb_speed_t max_speed, 66 size_t bw, bw_count_func_t bw_count); 79 int hcd_ddf_setup_hc(ddf_dev_t *device); 67 80 void hcd_ddf_clean_hc(ddf_dev_t *device); 68 int hcd_ddf_setup_root_hub(ddf_dev_t *device); 81 82 int hcd_setup_virtual_root_hub(hcd_t *, ddf_dev_t *); 83 84 device_t *hcd_ddf_device_create(ddf_dev_t *, size_t); 85 void hcd_ddf_device_destroy(device_t *); 86 int hcd_ddf_device_explore(hcd_t *, device_t *); 69 87 70 88 hcd_t *dev_to_hcd(ddf_dev_t *dev); … … 75 93 const hw_res_list_parsed_t *hw_res, 76 94 interrupt_handler_t handler, 77 i nt (*gen_irq_code)(irq_code_t *, const hw_res_list_parsed_t *));95 irq_code_gen_t gen_irq_code); 78 96 void ddf_hcd_gen_irq_handler(ipc_callid_t iid, ipc_call_t *call, ddf_dev_t *dev); 79 97
Note:
See TracChangeset
for help on using the changeset viewer.