Changeset a6add7a in mainline for uspace/drv/usbmouse
- Timestamp:
- 2011-03-04T23:35:22Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 960bee9
- Parents:
- d78a32f
- Location:
- uspace/drv/usbmouse
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/usbmouse/init.c
rd78a32f ra6add7a 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
rd78a32f ra6add7a 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
rd78a32f ra6add7a 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
rd78a32f ra6add7a 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.
