File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -66,8 +66,27 @@ USERIO_CMD_SET_PORT_TYPE
6666~~~~~~~~~~~~~~~~~~~~~~~~
6767
6868Sets the type of port we're emulating, where ``data `` is the port type being
69- set. Can be any of the macros from <linux/serio.h>. For example: SERIO_8042
70- would set the port type to be a normal PS/2 port.
69+ set. Can be any of the serio type macros from <linux/serio.h>. For example:
70+ SERIO_8042 would set the port type to be a normal PS/2 port.
71+
72+ USERIO_CMD_SET_PORT_PROTO
73+ ~~~~~~~~~~~~~~~~~~~~~~~~~
74+
75+ Sets the protocol of port we're emulating, where ``data `` is the protocol being
76+ set. Can be any of the serio proto macros from <linux/serio.h>. For example:
77+ SERIO_IFORCE would set the port type to be an I-Force serial joystick.
78+
79+ USERIO_CMD_SET_PORT_ID
80+ ~~~~~~~~~~~~~~~~~~~~~~
81+
82+ Sets the ``id `` value on the identification of port we're emulating, where
83+ ``data `` is the value being set.
84+
85+ USERIO_CMD_SET_PORT_EXTRA
86+ ~~~~~~~~~~~~~~~~~~~~~~~~~
87+
88+ Sets the ``extra `` value on the identification of port we're emulating, where
89+ ``data `` is the value being set.
7190
7291USERIO_CMD_SEND_INTERRUPT
7392~~~~~~~~~~~~~~~~~~~~~~~~~
Original file line number Diff line number Diff line change @@ -206,6 +206,36 @@ static int userio_execute_cmd(struct userio_device *userio,
206206 userio -> serio -> id .type = cmd -> data ;
207207 break ;
208208
209+ case USERIO_CMD_SET_PORT_EXTRA :
210+ if (userio -> running ) {
211+ dev_warn (userio_misc .this_device ,
212+ "Can't change port extra on an already running userio instance\n" );
213+ return - EBUSY ;
214+ }
215+
216+ userio -> serio -> id .extra = cmd -> data ;
217+ break ;
218+
219+ case USERIO_CMD_SET_PORT_ID :
220+ if (userio -> running ) {
221+ dev_warn (userio_misc .this_device ,
222+ "Can't change port id on an already running userio instance\n" );
223+ return - EBUSY ;
224+ }
225+
226+ userio -> serio -> id .id = cmd -> data ;
227+ break ;
228+
229+ case USERIO_CMD_SET_PORT_PROTO :
230+ if (userio -> running ) {
231+ dev_warn (userio_misc .this_device ,
232+ "Can't change port proto on an already running userio instance\n" );
233+ return - EBUSY ;
234+ }
235+
236+ userio -> serio -> id .proto = cmd -> data ;
237+ break ;
238+
209239 case USERIO_CMD_SEND_INTERRUPT :
210240 if (!userio -> running ) {
211241 dev_warn (userio_misc .this_device ,
Original file line number Diff line number Diff line change 2727enum userio_cmd_type {
2828 USERIO_CMD_REGISTER = 0 ,
2929 USERIO_CMD_SET_PORT_TYPE = 1 ,
30- USERIO_CMD_SEND_INTERRUPT = 2
30+ USERIO_CMD_SEND_INTERRUPT = 2 ,
31+ USERIO_CMD_SET_PORT_EXTRA = 3 ,
32+ USERIO_CMD_SET_PORT_ID = 4 ,
33+ USERIO_CMD_SET_PORT_PROTO = 5 ,
3134};
3235
3336/*
You can’t perform that action at this time.
0 commit comments