Changeset 6769005 in mainline for uspace/srv/hid


Ignore:
Timestamp:
2018-10-31T06:03:38Z (7 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
53ee7a0
Parents:
94ab1fee
git-author:
Jakub Jermar <jakub@…> (2018-10-28 12:42:35)
git-committer:
Jakub Jermar <jakub@…> (2018-10-31 06:03:38)
Message:

Use user-defined labels instead of phone hashes

This commit changes the way how the async framework maps incomming calls
to connections. Instead of abusing the kernel addresses of attached
phones as identifiers, the IPC_M_CONNECT_TO_ME and IPC_M_CONNECT_ME_TO
messages allow the server to specify an arbitrary label which is
remembered in the connected phone and consequently imprinted on each
call which is routed through this phone.

The async framework uses the address of the connection structure as the
label. This removes the need for a connection hash table because each
incoming call already remembers the connection in its label.

To disambiguate this new label and the other user-defined label used for
answers, the call structure now has the request_label member for the
former and answer_label member for the latter.

This commit also moves the kernel definition of ipc_data_t to abi/ and
removes the uspace redefinition thereof. Finally, when forwarding the
IPC_M_CONNECT_TO_ME call, the phone capability and the kernel object
allocated in request_process are now correctly disposed of.

Location:
uspace/srv/hid
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/hid/compositor/compositor.c

    r94ab1fee r6769005  
    918918        /* Allocate resources for new window and register it to the location service. */
    919919        if (service_id == winreg_id) {
    920                 async_answer_0(icall, EOK);
     920                async_answer_5(icall, EOK, 0, 0, 0, 0, async_get_label());
    921921
    922922                async_get_call(&call);
     
    997997
    998998        if (win) {
    999                 async_answer_0(icall, EOK);
     999                async_answer_5(icall, EOK, 0, 0, 0, 0, async_get_label());
    10001000        } else {
    10011001                async_answer_0(icall, EINVAL);
  • uspace/srv/hid/input/input.c

    r94ab1fee r6769005  
    328328        }
    329329
    330         async_answer_0(icall, EOK);
     330        async_answer_5(icall, EOK, 0, 0, 0, 0, async_get_label());
    331331
    332332        while (true) {
  • uspace/srv/hid/isdv4_tablet/main.c

    r94ab1fee r6769005  
    6565static void mouse_connection(ipc_call_t *icall, void *arg)
    6666{
    67         async_answer_0(icall, EOK);
     67        async_answer_5(icall, EOK, 0, 0, 0, 0, async_get_label());
    6868
    6969        async_sess_t *sess =
  • uspace/srv/hid/output/output.c

    r94ab1fee r6769005  
    398398{
    399399        /* Accept the connection */
    400         async_answer_0(icall, EOK);
     400        async_answer_5(icall, EOK, 0, 0, 0, 0, async_get_label());
    401401
    402402        while (true) {
  • uspace/srv/hid/s3c24xx_ts/s3c24xx_ts.c

    r94ab1fee r6769005  
    372372static void s3c24xx_ts_connection(ipc_call_t *icall, void *arg)
    373373{
    374         async_answer_0(icall, EOK);
     374        async_answer_5(icall, EOK, 0, 0, 0, 0, async_get_label());
    375375
    376376        while (true) {
Note: See TracChangeset for help on using the changeset viewer.