Ignore:
Timestamp:
2011-09-16T21:13:57Z (13 years ago)
Author:
Martin Sucha <sucha14@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
3a11f17
Parents:
c0e53ff (diff), fd07e526 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes

File:
1 edited

Legend:

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

    rc0e53ff r432a269  
    4444#include <ipc/mouseev.h>
    4545#include <async.h>
    46 #include <async_obsolete.h>
    4746#include <unistd.h>
    4847#include <stdio.h>
     
    5352#include "s3c24xx_ts.h"
    5453
    55 // FIXME: remove this header
    56 #include <abi/ipc/methods.h>
    57 
    58 #define NAME "s3c24ser"
    59 #define NAMESPACE "hid"
     54#define NAME       "s3c24ser"
     55#define NAMESPACE  "hid"
    6056
    6157static irq_cmd_t ts_irq_cmds[] = {
     
    134130
    135131        ts->io = vaddr;
    136         ts->client_phone = -1;
     132        ts->client_sess = NULL;
    137133        ts->state = ts_wait_pendown;
    138134        ts->last_x = 0;
     
    284280        button = 1;
    285281        press = 0;
    286         async_obsolete_msg_2(ts->client_phone, MOUSEEV_BUTTON_EVENT, button, press);
     282       
     283        async_exch_t *exch = async_exchange_begin(ts->client_sess);
     284        async_msg_2(exch, MOUSEEV_BUTTON_EVENT, button, press);
     285        async_exchange_end(exch);
    287286
    288287        s3c24xx_ts_wait_for_int_mode(ts, updn_down);
     
    325324
    326325        /* Send notifications to client. */
    327         async_obsolete_msg_2(ts->client_phone, MOUSEEV_MOVE_EVENT, dx, dy);
    328         async_obsolete_msg_2(ts->client_phone, MOUSEEV_BUTTON_EVENT, button, press);
     326        async_exch_t *exch = async_exchange_begin(ts->client_sess);
     327        async_msg_2(exch, MOUSEEV_MOVE_EVENT, dx, dy);
     328        async_msg_2(exch, MOUSEEV_BUTTON_EVENT, button, press);
     329        async_exchange_end(exch);
    329330
    330331        ts->last_x = x_pos;
     
    377378    void *arg)
    378379{
    379         ipc_callid_t callid;
    380         ipc_call_t call;
    381         int retval;
    382 
    383380        async_answer_0(iid, EOK);
    384 
    385         while (1) {
    386                 callid = async_get_call(&call);
     381       
     382        while (true) {
     383                ipc_call_t call;
     384                ipc_callid_t callid = async_get_call(&call);
    387385               
    388386                if (!IPC_GET_IMETHOD(call)) {
    389                         if (ts->client_phone != -1) {
    390                                 async_obsolete_hangup(ts->client_phone);
    391                                 ts->client_phone = -1;
     387                        if (ts->client_sess != NULL) {
     388                                async_hangup(ts->client_sess);
     389                                ts->client_sess = NULL;
    392390                        }
    393 
     391                       
    394392                        async_answer_0(callid, EOK);
    395393                        return;
    396394                }
    397395               
    398                 switch (IPC_GET_IMETHOD(call)) {
    399                 case IPC_M_CONNECT_TO_ME:
    400                         if (ts->client_phone != -1) {
    401                                 retval = ELIMIT;
    402                                 break;
    403                         }
    404                         ts->client_phone = IPC_GET_ARG5(call);
    405                         retval = 0;
    406                         break;
    407                 default:
    408                         retval = EINVAL;
    409                 }
    410                 async_answer_0(callid, retval);
     396                async_sess_t *sess =
     397                    async_callback_receive_start(EXCHANGE_SERIALIZE, &call);
     398                if (sess != NULL) {
     399                        if (ts->client_sess == NULL) {
     400                                ts->client_sess = sess;
     401                                async_answer_0(callid, EOK);
     402                        } else
     403                                async_answer_0(callid, ELIMIT);
     404                } else
     405                        async_answer_0(callid, EINVAL);
    411406        }
    412407}
Note: See TracChangeset for help on using the changeset viewer.