Changeset 6c8a221c in mainline
- Timestamp:
- 2017-11-26T12:14:38Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 1814b4ae
- Parents:
- d23fab9
- Location:
- uspace/drv/bus/usb/usbdbg
- Files:
-
- 3 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/usbdbg/Makefile
rd23fab9 r6c8a221c 34 34 35 35 SOURCES = \ 36 device.c \ 36 37 main.c \ 37 38 -
uspace/drv/bus/usb/usbdbg/main.c
rd23fab9 r6c8a221c 38 38 #include <usb/dev/driver.h> 39 39 40 #include "usbdbg.h" 41 #include "device.h" 42 40 43 #define NAME "usbdbg" 41 44 42 static int usbdbg_device_add(usb_device_t *dev)45 static int device_add(usb_device_t *dev) 43 46 { 44 usb_log_info("usbdbg_device_add"); 47 usb_log_info("Adding device '%s'", usb_device_get_name(dev)); 48 49 int err; 50 51 usb_dbg_dev_t *dbg_dev; 52 if ((err = usb_dbg_dev_create(dev, &dbg_dev))) 53 return err; 54 55 /* TODO: Register device in some list. */ 56 /* TODO: Register device DDF function. */ 57 45 58 return EOK; 46 59 } 47 60 48 static int usbdbg_device_remove(usb_device_t *dev)61 static int device_remove(usb_device_t *dev) 49 62 { 50 usb_log_info("usbdbg_device_remove"); 63 usb_log_info("Removing device '%s'", usb_device_get_name(dev)); 64 65 usb_dbg_dev_t *dbg_dev = usb_dbg_dev_get(dev); 66 67 /* TODO: Make sure nothing is going on with the device. */ 68 /* TODO: Unregister device DDF function. */ 69 /* TODO: Remove device from list */ 70 71 usb_dbg_dev_destroy(dbg_dev); 72 51 73 return EOK; 52 74 } 53 75 54 static int usbdbg_device_gone(usb_device_t *dev)76 static int device_gone(usb_device_t *dev) 55 77 { 56 usb_log_info("usbdbg_device_gone"); 78 usb_log_info("Device '%s' gone.", usb_device_get_name(dev)); 79 80 usb_dbg_dev_t *dbg_dev = usb_dbg_dev_get(dev); 81 82 /* TODO: Make sure nothing is going on with the device. */ 83 /* TODO: Unregister device DDF function. */ 84 /* TODO: Remove device from list */ 85 86 usb_dbg_dev_destroy(dbg_dev); 87 57 88 return EOK; 58 89 } 59 90 60 static int usbdbg_function_online(ddf_fun_t *fun)91 static int function_online(ddf_fun_t *fun) 61 92 { 62 /* TODO: What if this is the control function? */63 93 return ddf_fun_online(fun); 64 94 } 65 95 66 static int usbdbg_function_offline(ddf_fun_t *fun)96 static int function_offline(ddf_fun_t *fun) 67 97 { 68 /* TODO: What if this is the control function? */69 98 return ddf_fun_offline(fun); 70 99 } … … 72 101 /** USB debug driver ops. */ 73 102 static const usb_driver_ops_t dbg_driver_ops = { 74 .device_add = usbdbg_device_add,75 .device_rem = usbdbg_device_remove,76 .device_gone = usbdbg_device_gone,77 .function_online = usbdbg_function_online,78 .function_offline = usbdbg_function_offline103 .device_add = device_add, 104 .device_rem = device_remove, 105 .device_gone = device_gone, 106 .function_online = function_online, 107 .function_offline = function_offline 79 108 }; 80 109
Note:
See TracChangeset
for help on using the changeset viewer.