Changeset 8bb9540 in mainline
- Timestamp:
- 2012-01-01T22:01:47Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 1ff1ee1
- Parents:
- 1dea6d7
- Location:
- uspace/drv/char
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/char/i8042/i8042.c
r1dea6d7 r8bb9540 57 57 static int i8042_write_aux(ddf_fun_t *, char *, size_t); 58 58 static int i8042_read_aux(ddf_fun_t *, char *, size_t); 59 /*----------------------------------------------------------------------------*/ 59 60 60 /** Primary port interface structure. */ 61 61 static char_dev_ops_t kbd_iface = { … … 63 63 .write = i8042_write_kbd, 64 64 }; 65 /*----------------------------------------------------------------------------*/ 65 66 66 /** Auxiliary port interface structure. */ 67 67 static char_dev_ops_t aux_iface = { … … 69 69 .write = i8042_write_aux, 70 70 }; 71 /*----------------------------------------------------------------------------*/ 71 72 72 /** Primary port function operations. */ 73 73 static ddf_dev_ops_t kbd_ops = { 74 74 .interfaces[CHAR_DEV_IFACE] = &kbd_iface 75 75 }; 76 /*----------------------------------------------------------------------------*/ 76 77 77 /** Auxiliary port function operations. */ 78 78 static ddf_dev_ops_t aux_ops = { … … 123 123 } 124 124 }; 125 /*----------------------------------------------------------------------------*/ 125 126 126 /** Wait until it is safe to write to the device. */ 127 127 static void wait_ready(i8042_t *dev) … … 130 130 while (pio_read_8(&dev->regs->status) & i8042_INPUT_FULL); 131 131 } 132 /*----------------------------------------------------------------------------*/ 132 133 133 /** Interrupt handler routine. 134 134 * Writes new data to the corresponding buffer. … … 150 150 buffer_write(buffer, data); 151 151 } 152 /*----------------------------------------------------------------------------*/ 152 153 153 /** Initialize i8042 driver structure. 154 154 * @param dev Driver structure to initialize. … … 287 287 return EOK; 288 288 } 289 /*----------------------------------------------------------------------------*/ 289 290 290 /** Write data to i8042 primary port. 291 291 * @param fun DDF function. … … 307 307 return size; 308 308 } 309 /*----------------------------------------------------------------------------*/ 309 310 310 /** Read data from i8042 primary port. 311 311 * @param fun DDF function. … … 327 327 return size; 328 328 } 329 /*----------------------------------------------------------------------------*/ 329 330 330 /** Write data to i8042 auxiliary port. 331 331 * @param fun DDF function. … … 348 348 return size; 349 349 } 350 /*----------------------------------------------------------------------------*/ 350 351 351 /** Read data from i8042 auxiliary port. 352 352 * @param fun DDF function. -
uspace/drv/char/i8042/main.c
r1dea6d7 r8bb9540 49 49 uintptr_t *io_reg_address, size_t *io_reg_size, int *kbd, int *mouse); 50 50 static int i8042_dev_add(ddf_dev_t *device); 51 /*----------------------------------------------------------------------------*/ 51 52 52 /** DDF driver operations. */ 53 53 static driver_ops_t i8042_driver_ops = { 54 54 .dev_add = i8042_dev_add, 55 55 }; 56 /*----------------------------------------------------------------------------*/ 56 57 57 /** DDF driver. */ 58 58 static driver_t i8042_driver = { … … 60 60 .driver_ops = &i8042_driver_ops 61 61 }; 62 /*----------------------------------------------------------------------------*/ 62 63 63 /** Initialize global driver structures (NONE). 64 64 * … … 75 75 return ddf_driver_main(&i8042_driver); 76 76 } 77 /*----------------------------------------------------------------------------*/ 77 78 78 /** Initialize a new ddf driver instance of i8042 driver 79 79 * … … 115 115 return EOK; 116 116 } 117 /*----------------------------------------------------------------------------*/ 117 118 118 /** Get address of I/O registers. 119 119 * -
uspace/drv/char/ps2mouse/main.c
r1dea6d7 r8bb9540 47 47 48 48 static int mouse_add(ddf_dev_t *device); 49 /*----------------------------------------------------------------------------*/ 49 50 50 /** DDF driver ops. */ 51 51 static driver_ops_t mouse_driver_ops = { 52 52 .dev_add = mouse_add, 53 53 }; 54 /*----------------------------------------------------------------------------*/ 54 55 55 /** DDF driver structure. */ 56 56 static driver_t mouse_driver = { … … 58 58 .driver_ops = &mouse_driver_ops 59 59 }; 60 /*----------------------------------------------------------------------------*/ 60 61 61 /** Initialize global driver structures (NONE). 62 62 * … … 73 73 return ddf_driver_main(&mouse_driver); 74 74 } 75 /*----------------------------------------------------------------------------*/ 75 76 76 /** Initialize a new ddf driver instance 77 77 * -
uspace/drv/char/ps2mouse/ps2mouse.c
r1dea6d7 r8bb9540 94 94 } \ 95 95 } while (0) 96 /*----------------------------------------------------------------------------*/ 96 97 97 static int polling_ps2(void *); 98 98 static int polling_intellimouse(void *); 99 99 static int probe_intellimouse(async_sess_t *, bool); 100 100 static void default_connection_handler(ddf_fun_t *, ipc_callid_t, ipc_call_t *); 101 /*----------------------------------------------------------------------------*/ 101 102 102 /** ps/2 mouse driver ops. */ 103 103 static ddf_dev_ops_t mouse_ops = { 104 104 .default_handler = default_connection_handler 105 105 }; 106 /*----------------------------------------------------------------------------*/ 106 107 107 /** Initialize mouse driver structure. 108 108 * @param kbd Mouse driver structure to initialize. … … 187 187 return EOK; 188 188 } 189 /*----------------------------------------------------------------------------*/ 189 190 190 /** Get data and parse ps2 protocol packets. 191 191 * @param arg Pointer to ps2_mouse_t structure. … … 242 242 } 243 243 } 244 /*----------------------------------------------------------------------------*/ 244 245 245 /** Get data and parse ps2 protocol with IntelliMouse extension packets. 246 246 * @param arg Pointer to ps2_mouse_t structure. … … 316 316 } 317 317 } 318 /*----------------------------------------------------------------------------*/ 318 319 319 /** Send magic sequence to initialize IntelliMouse extensions. 320 320 * @param session IPC session to the parent device. … … 348 348 return EOK; 349 349 } 350 /*----------------------------------------------------------------------------*/ 350 351 351 /** Default handler for IPC methods not handled by DDF. 352 352 * -
uspace/drv/char/xtkbd/main.c
r1dea6d7 r8bb9540 47 47 48 48 static int xt_kbd_add(ddf_dev_t *device); 49 /*----------------------------------------------------------------------------*/ 49 50 50 /** DDF driver ops. */ 51 51 static driver_ops_t kbd_driver_ops = { 52 52 .dev_add = xt_kbd_add, 53 53 }; 54 /*----------------------------------------------------------------------------*/ 54 55 55 /** DDF driver structure. */ 56 56 static driver_t kbd_driver = { … … 58 58 .driver_ops = &kbd_driver_ops 59 59 }; 60 /*----------------------------------------------------------------------------*/ 60 61 61 /** Initialize global driver structures (NONE). 62 62 * … … 73 73 return ddf_driver_main(&kbd_driver); 74 74 } 75 /*----------------------------------------------------------------------------*/ 75 76 76 /** Initialize a new ddf driver instance of the driver 77 77 * -
uspace/drv/char/xtkbd/xtkbd.c
r1dea6d7 r8bb9540 152 152 [0x53] = KC_NPERIOD 153 153 }; 154 /*----------------------------------------------------------------------------*/ 154 155 155 #define SCANCODE_SET_EXTENDED 0xe0 156 156 /** Scancode set 1 extended codes table */ … … 177 177 [0x1c] = KC_NENTER 178 178 }; 179 /*----------------------------------------------------------------------------*/ 179 180 180 static int polling(void *); 181 181 static void default_connection_handler(ddf_fun_t *, ipc_callid_t, ipc_call_t *); 182 /*----------------------------------------------------------------------------*/ 182 183 183 /** Keyboard function ops. */ 184 184 static ddf_dev_ops_t kbd_ops = { 185 185 .default_handler = default_connection_handler 186 186 }; 187 /*----------------------------------------------------------------------------*/ 187 188 188 /** Initialize keyboard driver structure. 189 189 * @param kbd Keyboard driver structure to initialize. … … 238 238 return EOK; 239 239 } 240 /*----------------------------------------------------------------------------*/ 240 241 241 /** Get data and parse scancodes. 242 242 * @param arg Pointer to xt_kbd_t structure. … … 290 290 } 291 291 } 292 /*----------------------------------------------------------------------------*/ 292 293 293 /** Default handler for IPC methods not handled by DDF. 294 294 *
Note:
See TracChangeset
for help on using the changeset viewer.