Changeset fbe148ee in mainline
- Timestamp:
- 2011-10-30T13:13:14Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 54d1ad9
- Parents:
- 9871bca
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/usbhid/main.c
r9871bca rfbe148ee 46 46 #include "usbhid.h" 47 47 48 /*----------------------------------------------------------------------------*/49 50 48 #define NAME "usbhid" 51 49 … … 67 65 * 68 66 * @param dev Device to add. 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(). 67 * @return Error code. 74 68 */ 75 69 static int usb_hid_try_add_device(usb_device_t *dev) … … 138 132 return EOK; 139 133 } 140 141 134 /*----------------------------------------------------------------------------*/ 142 135 /** … … 146 139 * 147 140 * @param dev Structure representing the new device. 148 * 149 * @retval EOK if successful. 150 * @retval EREFUSED if the device is not supported. 141 * @return Error code. 151 142 */ 152 143 static int usb_hid_device_add(usb_device_t *dev) … … 179 170 return EOK; 180 171 } 181 182 /*----------------------------------------------------------------------------*/ 183 172 /*----------------------------------------------------------------------------*/ 173 /** 174 * Callback for a device about to be removed from the driver. 175 * 176 * @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 184 /** 185 185 * Callback for removing a device from the driver. 186 186 * 187 187 * @param dev Structure representing the device. 188 * 189 * @retval EOK if successful. 190 * @retval EREFUSED if the device is not supported. 188 * @return Error code. 191 189 */ 192 190 static int usb_hid_device_gone(usb_device_t *dev) … … 198 196 if (!tries--) { 199 197 usb_log_error("Can't remove hub, still running.\n"); 200 return E INPROGRESS;198 return EBUSY; 201 199 } 202 200 } … … 207 205 return EOK; 208 206 } 209 207 /*----------------------------------------------------------------------------*/ 210 208 /** USB generic driver callbacks */ 211 static usb_driver_ops_t usb_hid_driver_ops = {209 static const usb_driver_ops_t usb_hid_driver_ops = { 212 210 .device_add = usb_hid_device_add, 211 .device_rem = usb_hid_device_rem, 213 212 .device_gone = usb_hid_device_gone, 214 213 }; 215 216 214 /*----------------------------------------------------------------------------*/ 217 215 /** The driver itself. */ 218 static usb_driver_t usb_hid_driver = {216 static const usb_driver_t usb_hid_driver = { 219 217 .name = NAME, 220 218 .ops = &usb_hid_driver_ops, 221 219 .endpoints = usb_hid_endpoints 222 220 }; 223 224 /*----------------------------------------------------------------------------*/ 225 221 /*----------------------------------------------------------------------------*/ 226 222 int main(int argc, char *argv[]) 227 223 { … … 232 228 return usb_driver_main(&usb_hid_driver); 233 229 } 234 235 230 /** 236 231 * @}
Note:
See TracChangeset
for help on using the changeset viewer.