Changeset 18e9eeb in mainline for uspace/drv
- Timestamp:
- 2011-03-07T19:03:30Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0c0f5a5d, ec4538d
- Parents:
- a7e2f0d (diff), f16a76b (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- uspace/drv
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/usbmid/main.c
ra7e2f0d r18e9eeb 44 44 #include "usbmid.h" 45 45 46 /** Callback when new MID device is attached to the host. 47 * 48 * @param gen_dev Generic DDF device representing the new device. 49 * @return Error code. 50 */ 46 51 static int usbmid_add_device(ddf_dev_t *gen_dev) 47 52 { … … 86 91 } 87 92 93 /** USB MID driver ops. */ 88 94 static driver_ops_t mid_driver_ops = { 89 95 .add_device = usbmid_add_device, 90 96 }; 91 97 98 /** USB MID driver. */ 92 99 static driver_t mid_driver = { 93 100 .name = NAME, -
uspace/drv/usbmid/usbmid.c
ra7e2f0d r18e9eeb 67 67 } 68 68 69 /** DDF interface of the child - interface function. */ 69 70 static usb_iface_t child_usb_iface = { 70 71 .get_hc_handle = usb_iface_get_hc_handle_hub_child_impl, … … 73 74 }; 74 75 75 76 /** Operations for children - interface functions. */ 76 77 static ddf_dev_ops_t child_device_ops = { 77 78 .interfaces[USB_DEV_IFACE] = &child_usb_iface 78 79 }; 79 80 81 /** Operations of the device itself. */ 80 82 static ddf_dev_ops_t mid_device_ops = { 81 83 .interfaces[USB_DEV_IFACE] = &usb_iface_hub_impl -
uspace/drv/usbmid/usbmid.h
ra7e2f0d r18e9eeb 44 44 #define NAME "usbmid" 45 45 46 /** USB MID device container. */ 46 47 typedef struct { 47 48 /** Device container. */ … … 54 55 } usbmid_device_t; 55 56 57 58 /** Container for single interface in a MID device. */ 56 59 typedef struct { 57 60 /** Function container. */ -
uspace/drv/usbmouse/init.c
ra7e2f0d r18e9eeb 101 101 102 102 static void default_connection_handler(ddf_fun_t *, ipc_callid_t, ipc_call_t *); 103 /** Device ops for USB mouse. */ 103 104 static ddf_dev_ops_t mouse_ops = { 104 105 .default_handler = default_connection_handler … … 135 136 } 136 137 137 138 /** Create USB mouse device. 139 * 140 * The mouse device is stored into <code>dev->driver_data</code>. 141 * 142 * @param dev Generic device. 143 * @return Error code. 144 */ 138 145 int usb_mouse_create(ddf_dev_t *dev) 139 146 { -
uspace/drv/usbmouse/main.c
ra7e2f0d r18e9eeb 39 39 #include <str_error.h> 40 40 41 /** Callback when new mouse device is attached and recognised by DDF. 42 * 43 * @param dev Representation of a generic DDF device. 44 * @return Error code. 45 */ 41 46 static int usbmouse_add_device(ddf_dev_t *dev) 42 47 { … … 63 68 } 64 69 70 /** USB mouse driver ops. */ 65 71 static driver_ops_t mouse_driver_ops = { 66 72 .add_device = usbmouse_add_device, 67 73 }; 68 74 75 /** USB mouse driver. */ 69 76 static driver_t mouse_driver = { 70 77 .name = NAME, … … 74 81 int main(int argc, char *argv[]) 75 82 { 76 usb_log_enable(USB_LOG_LEVEL_DEBUG 2, NAME);83 usb_log_enable(USB_LOG_LEVEL_DEBUG, NAME); 77 84 78 85 return ddf_driver_main(&mouse_driver); -
uspace/drv/usbmouse/mouse.c
ra7e2f0d r18e9eeb 40 40 #include <ipc/mouse.h> 41 41 42 /** Fibril function for polling the mouse device. 43 * 44 * This function shall not terminate unless the device breaks and fails 45 * to send data (e.g. stalls on data request). 46 * 47 * @param arg ddf_dev_t type representing the mouse device. 48 * @return EOK Always. 49 */ 42 50 int usb_mouse_polling_fibril(void *arg) 43 51 { -
uspace/drv/usbmouse/mouse.h
ra7e2f0d r18e9eeb 43 43 #define NAME "usbmouse" 44 44 45 /** Container for USB mouse device. */ 45 46 typedef struct { 47 /** Generic device container. */ 46 48 ddf_dev_t *device; 49 /** Function representing the device. */ 47 50 ddf_fun_t *mouse_fun; 51 /** Representation of connection to the device. */ 48 52 usb_device_connection_t wire; 53 /** Default (zero) control pipe. */ 49 54 usb_endpoint_pipe_t ctrl_pipe; 55 /** Polling (in) pipe. */ 50 56 usb_endpoint_pipe_t poll_pipe; 57 /** Polling interval in microseconds. */ 51 58 suseconds_t poll_interval_us; 59 /** IPC phone to console (consumer). */ 52 60 int console_phone; 53 61 } usb_mouse_t;
Note:
See TracChangeset
for help on using the changeset viewer.