Changeset f9b2cb4c in mainline for uspace/srv/hid


Ignore:
Timestamp:
2015-08-23T12:50:23Z (10 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
9ef495f
Parents:
0dd16778
Message:

unify interface API

  • introduce new interfaces
  • unify location service clients to always expect service ID as the second argument
  • remove obsolete methods that take explicit exchange management arguments (first phase)
  • use interfaces in device drivers, devman, location service, logger, inet
Location:
uspace/srv/hid
Files:
10 edited

Legend:

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

    r0dd16778 rf9b2cb4c  
    896896        ipc_call_t call;
    897897        ipc_callid_t callid;
    898         service_id_t service_id = (service_id_t) IPC_GET_ARG1(*icall);
     898        service_id_t service_id = (service_id_t) IPC_GET_ARG2(*icall);
    899899
    900900        /* Allocate resources for new window and register it to the location service. */
     
    11751175        async_sess_t *sess;
    11761176
    1177         sess = loc_service_connect(EXCHANGE_SERIALIZE, sid, 0);
     1177        sess = loc_service_connect(sid, INTERFACE_DDF, 0);
    11781178        if (sess == NULL) {
    11791179                printf("%s: Unable to connect to visualizer %s\n", NAME, svc);
     
    11821182
    11831183        async_exch_t *exch = async_exchange_begin(sess);
    1184         rc = async_connect_to_me(exch, sid, 0, 0, vsl_notifications, NULL);
     1184       
     1185        port_id_t port;
     1186        rc = async_create_callback_port(exch, INTERFACE_VISUALIZER_CB, 0, 0,
     1187            vsl_notifications, NULL, &port);
     1188       
    11851189        async_exchange_end(exch);
    11861190
     
    21452149        }
    21462150
    2147         sess = loc_service_connect(EXCHANGE_ATOMIC, dsid, 0);
     2151        sess = loc_service_connect(dsid, INTERFACE_INPUT, 0);
    21482152        if (sess == NULL) {
    21492153                printf("%s: Unable to connect to input service %s\n", NAME,
  • uspace/srv/hid/console/console.c

    r0dd16778 rf9b2cb4c  
    508508       
    509509        for (size_t i = 0; i < CONSOLE_COUNT; i++) {
    510                 if (consoles[i].dsid == (service_id_t) IPC_GET_ARG1(*icall)) {
     510                if (consoles[i].dsid == (service_id_t) IPC_GET_ARG2(*icall)) {
    511511                        cons = &consoles[i];
    512512                        break;
     
    536536        }
    537537
    538         sess = loc_service_connect(EXCHANGE_ATOMIC, dsid, 0);
     538        sess = loc_service_connect(dsid, INTERFACE_INPUT, 0);
    539539        if (sess == NULL) {
    540540                printf("%s: Unable to connect to input service %s\n", NAME,
     
    561561        int rc = loc_service_get_id(svc, &dsid, 0);
    562562        if (rc == EOK) {
    563                 sess = loc_service_connect(EXCHANGE_SERIALIZE, dsid, 0);
     563                sess = loc_service_connect(dsid, INTERFACE_OUTPUT, 0);
    564564                if (sess == NULL) {
    565565                        printf("%s: Unable to connect to output service %s\n",
  • uspace/srv/hid/input/ctl/kbdev.c

    r0dd16778 rf9b2cb4c  
    9494static int kbdev_ctl_init(kbd_dev_t *kdev)
    9595{
    96         async_sess_t *sess = loc_service_connect(EXCHANGE_SERIALIZE,
    97             kdev->svc_id, 0);
     96        async_sess_t *sess = loc_service_connect(kdev->svc_id,
     97            INTERFACE_DDF, 0);
    9898        if (sess == NULL) {
    9999                printf("%s: Failed starting session with '%s.'\n", NAME,
     
    120120        }
    121121       
    122         int rc = async_connect_to_me(exch, 0, 0, 0, kbdev_callback_conn, kbdev);
     122        port_id_t port;
     123        int rc = async_create_callback_port(exch, INTERFACE_KBD_CB, 0, 0,
     124            kbdev_callback_conn, kbdev, &port);
     125       
    123126        if (rc != EOK) {
    124127                printf("%s: Failed creating callback connection from '%s'.\n",
  • uspace/srv/hid/input/input.c

    r0dd16778 rf9b2cb4c  
    745745        if (irc_service) {
    746746                while (irc_sess == NULL)
    747                         irc_sess = service_connect_blocking(EXCHANGE_SERIALIZE,
    748                             SERVICE_IRC, 0);
     747                        irc_sess = service_connect_blocking(SERVICE_IRC,
     748                            INTERFACE_IRC, 0);
    749749        }
    750750       
  • uspace/srv/hid/input/port/adb.c

    r0dd16778 rf9b2cb4c  
    6969                return rc;
    7070       
    71         dev_sess = loc_service_connect(EXCHANGE_ATOMIC, service_id, 0);
     71        dev_sess = loc_service_connect(service_id, INTERFACE_DDF, 0);
    7272        if (dev_sess == NULL) {
    7373                printf("%s: Failed to connect to device\n", NAME);
     
    8282        }
    8383       
    84         rc = async_connect_to_me(exch, 0, 0, 0, kbd_port_events, NULL);
     84        port_id_t port;
     85        rc = async_create_callback_port(exch, INTERFACE_ADB_CB, 0, 0,
     86            kbd_port_events, NULL, &port);
     87       
    8588        async_exchange_end(exch);
    8689        if (rc != EOK) {
  • uspace/srv/hid/input/port/adb_mouse.c

    r0dd16778 rf9b2cb4c  
    8484                return rc;
    8585       
    86         dev_sess = loc_service_connect(EXCHANGE_ATOMIC, service_id, 0);
     86        dev_sess = loc_service_connect(service_id, INTERFACE_DDF, 0);
    8787        if (dev_sess == NULL) {
    8888                printf("%s: Failed to connect to device\n", NAME);
     
    9898       
    9999        /* NB: The callback connection is slotted for removal */
    100         rc = async_connect_to_me(exch, 0, 0, 0, mouse_port_events, NULL);
     100        port_id_t port;
     101        rc = async_create_callback_port(exch, INTERFACE_ADB_CB, 0, 0,
     102            mouse_port_events, NULL, &port);
     103       
    101104        async_exchange_end(exch);
    102105        if (rc != EOK) {
  • uspace/srv/hid/input/port/chardev.c

    r0dd16778 rf9b2cb4c  
    8484        }
    8585       
    86         dev_sess = loc_service_connect(EXCHANGE_ATOMIC, service_id,
     86        dev_sess = loc_service_connect(service_id, INTERFACE_DDF,
    8787            IPC_FLAG_BLOCKING);
    8888        if (dev_sess == NULL) {
     
    9898        }
    9999       
    100         /* NB: The callback connection is slotted for removal */
    101         rc = async_connect_to_me(exch, 0, 0, 0, kbd_port_events, NULL);
     100        port_id_t port;
     101        rc = async_create_callback_port(exch, INTERFACE_CHAR_CB, 0, 0,
     102            kbd_port_events, NULL, &port);
     103       
    102104        async_exchange_end(exch);
    103105       
  • uspace/srv/hid/input/proto/mousedev.c

    r0dd16778 rf9b2cb4c  
    118118static int mousedev_proto_init(mouse_dev_t *mdev)
    119119{
    120         async_sess_t *sess = loc_service_connect(EXCHANGE_SERIALIZE,
    121             mdev->svc_id, 0);
     120        async_sess_t *sess = loc_service_connect(mdev->svc_id, INTERFACE_DDF, 0);
    122121        if (sess == NULL) {
    123122                printf("%s: Failed starting session with '%s'\n", NAME,
     
    143142        }
    144143       
    145         int rc = async_connect_to_me(exch, 0, 0, 0, mousedev_callback_conn, mousedev);
     144        port_id_t port;
     145        int rc = async_create_callback_port(exch, INTERFACE_MOUSE_CB, 0, 0,
     146            mousedev_callback_conn, mousedev, &port);
     147       
    146148        async_exchange_end(exch);
    147149        async_hangup(sess);
  • uspace/srv/hid/isdv4_tablet/main.c

    r0dd16778 rf9b2cb4c  
    6969        async_sess_t *sess =
    7070            async_callback_receive(EXCHANGE_SERIALIZE);
     71       
    7172        fibril_mutex_lock(&client_mutex);
    72                 if (client_sess == NULL) {
    73                         client_sess = sess;
    74                 }
     73       
     74        if (client_sess == NULL)
     75                client_sess = sess;
     76       
    7577        fibril_mutex_unlock(&client_mutex);
    7678
     
    262264        printf(NAME ": Using serial port %s\n", serial_port_name);
    263265
    264         async_sess_t *sess = loc_service_connect(EXCHANGE_SERIALIZE, svc_id,
     266        async_sess_t *sess = loc_service_connect(svc_id, INTERFACE_DDF,
    265267            IPC_FLAG_BLOCKING);
    266268        if (!sess) {
  • uspace/srv/hid/remcons/remcons.c

    r0dd16778 rf9b2cb4c  
    217217{
    218218        /* Find the user. */
    219         telnet_user_t *user = telnet_user_get_for_client_connection(IPC_GET_ARG1(*icall));
     219        telnet_user_t *user = telnet_user_get_for_client_connection(IPC_GET_ARG2(*icall));
    220220        if (user == NULL) {
    221221                async_answer_0(iid, ENOENT);
Note: See TracChangeset for help on using the changeset viewer.