Changeset aa05b29 in mainline
- Timestamp:
- 2011-10-30T13:10:24Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9871bca
- Parents:
- cf7561f
- Location:
- uspace/drv/bus/usb/usbmid
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/usbmid/main.c
rcf7561f raa05b29 65 65 return EOK; 66 66 } 67 /*----------------------------------------------------------------------------*/ 68 /** Callback when a MID device is about to be removed from the host. 69 * 70 * @param gen_dev Generic DDF device representing the removed device. 71 * @return Error code. 72 */ 73 static int usbmid_device_remove(usb_device_t *dev) 74 { 75 assert(dev); 76 int ret = ENOTSUP; 77 usb_mid_t *usb_mid = dev->driver_data; 78 assert(usb_mid); 67 79 80 /* Signal all interface functions */ 81 list_foreach(usb_mid->interface_list, item) { 82 usbmid_interface_t *iface = usbmid_interface_from_link(item); 83 84 usb_log_info("Signaling remove to child for interface " 85 "%d (%s).\n", iface->interface_no, 86 usb_str_class(iface->interface->interface_class)); 87 // TODO cascade the call. 88 } 89 return ret; 90 } 91 /*----------------------------------------------------------------------------*/ 92 /** Callback when a MID device was removed from the host. 93 * 94 * @param gen_dev Generic DDF device representing the removed device. 95 * @return Error code. 96 */ 68 97 static int usbmid_device_gone(usb_device_t *dev) 69 98 { … … 86 115 list_remove(item); 87 116 88 usbmid_interface_t *iface = list_get_instance(item, 89 usbmid_interface_t, link); 117 usbmid_interface_t *iface = usbmid_interface_from_link(item); 90 118 91 119 usb_log_info("Removing child for interface %d (%s).\n", … … 107 135 108 136 /** USB MID driver ops. */ 109 static usb_driver_ops_t mid_driver_ops = {137 static const usb_driver_ops_t mid_driver_ops = { 110 138 .device_add = usbmid_device_add, 139 .device_rem = usbmid_device_remove, 111 140 .device_gone = usbmid_device_gone, 112 141 }; 113 142 114 143 /** USB MID driver. */ 115 static usb_driver_t mid_driver = {144 static const usb_driver_t mid_driver = { 116 145 .name = NAME, 117 146 .ops = &mid_driver_ops, -
uspace/drv/bus/usb/usbmid/usbmid.h
rcf7561f raa05b29 71 71 int usbmid_interface_destroy(usbmid_interface_t *mid_iface); 72 72 73 static inline usbmid_interface_t * usbmid_interface_from_link(link_t *item) 74 { 75 return list_get_instance(item, usbmid_interface_t, link); 76 } 77 73 78 #endif 74 79 /**
Note:
See TracChangeset
for help on using the changeset viewer.