Changes in uspace/drv/bus/usb/usbhid/main.c [fbe148ee:a8c4e871] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/usbhid/main.c
rfbe148ee ra8c4e871 46 46 #include "usbhid.h" 47 47 48 /*----------------------------------------------------------------------------*/ 49 48 50 #define NAME "usbhid" 49 51 … … 65 67 * 66 68 * @param dev Device to add. 67 * @return Error code. 69 * 70 * @retval EOK if successful. 71 * @retval ENOMEM if there 72 * @return Other error code inherited from one of functions usb_kbd_init(), 73 * ddf_fun_bind() and ddf_fun_add_to_class(). 68 74 */ 69 75 static int usb_hid_try_add_device(usb_device_t *dev) … … 132 138 return EOK; 133 139 } 140 134 141 /*----------------------------------------------------------------------------*/ 135 142 /** … … 139 146 * 140 147 * @param dev Structure representing the new device. 141 * @return Error code. 148 * 149 * @retval EOK if successful. 150 * @retval EREFUSED if the device is not supported. 142 151 */ 143 152 static int usb_hid_device_add(usb_device_t *dev) … … 170 179 return EOK; 171 180 } 172 /*----------------------------------------------------------------------------*/ 173 /** 174 * Callback for a device about to be removed from the driver. 181 182 /*----------------------------------------------------------------------------*/ 183 184 /** 185 * Callback for removing a device from the driver. 175 186 * 176 187 * @param dev Structure representing the device. 177 * @return Error code. 178 */ 179 static int usb_hid_device_rem(usb_device_t *dev) 180 { 181 return EOK; 182 } 183 /*----------------------------------------------------------------------------*/ 184 /** 185 * Callback for removing a device from the driver. 186 * 187 * @param dev Structure representing the device. 188 * @return Error code. 188 * 189 * @retval EOK if successful. 190 * @retval EREFUSED if the device is not supported. 189 191 */ 190 192 static int usb_hid_device_gone(usb_device_t *dev) … … 196 198 if (!tries--) { 197 199 usb_log_error("Can't remove hub, still running.\n"); 198 return E BUSY;200 return EINPROGRESS; 199 201 } 200 202 } … … 205 207 return EOK; 206 208 } 207 /*----------------------------------------------------------------------------*/ 209 208 210 /** USB generic driver callbacks */ 209 static constusb_driver_ops_t usb_hid_driver_ops = {211 static usb_driver_ops_t usb_hid_driver_ops = { 210 212 .device_add = usb_hid_device_add, 211 .device_rem = usb_hid_device_rem,212 213 .device_gone = usb_hid_device_gone, 213 214 }; 214 /*----------------------------------------------------------------------------*/ 215 216 215 217 /** The driver itself. */ 216 static constusb_driver_t usb_hid_driver = {218 static usb_driver_t usb_hid_driver = { 217 219 .name = NAME, 218 220 .ops = &usb_hid_driver_ops, 219 221 .endpoints = usb_hid_endpoints 220 222 }; 221 /*----------------------------------------------------------------------------*/ 223 224 /*----------------------------------------------------------------------------*/ 225 222 226 int main(int argc, char *argv[]) 223 227 { … … 228 232 return usb_driver_main(&usb_hid_driver); 229 233 } 234 230 235 /** 231 236 * @}
Note:
See TracChangeset
for help on using the changeset viewer.