Changeset 79ae36dd in mainline for uspace/drv/usbhid/mouse/mousedev.c


Ignore:
Timestamp:
2011-06-08T19:01:55Z (13 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0eff68e
Parents:
764d71e
Message:

new async framework with integrated exchange tracking

  • strict isolation between low-level IPC and high-level async framework with integrated exchange tracking
    • each IPC connection is represented by an async_sess_t structure
    • each IPC exchange is represented by an async_exch_t structure
    • exchange management is either based on atomic messages (EXCHANGE_ATOMIC), locking (EXCHANGE_SERIALIZE) or connection cloning (EXCHANGE_CLONE)
  • async_obsolete: temporary compatibility layer to keep old async clients working (several pieces of code are currently broken, but only non-essential functionality)
  • IPC_M_PHONE_HANGUP is now method no. 0 (for elegant boolean evaluation)
  • IPC_M_DEBUG_ALL has been renamed to IPC_M_DEBUG
  • IPC_M_PING has been removed (VFS protocol now has VFS_IN_PING)
  • console routines in libc have been rewritten for better abstraction
  • additional use for libc-private header files (FILE structure opaque to the client)
  • various cstyle changes (typos, indentation, missing externs in header files, improved comments, etc.)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/usbhid/mouse/mousedev.c

    r764d71e r79ae36dd  
    4141#include <usb/hid/usages/core.h>
    4242#include <errno.h>
     43#include <async.h>
     44#include <async_obsolete.h>
    4345#include <str_error.h>
    4446#include <ipc/mouse.h>
     
    5052#include "mousedev.h"
    5153#include "../usbhid.h"
     54
     55// FIXME: remove this header
     56#include <kernel/ipc/ipc_methods.h>
    5257
    5358#define NAME "mouse"
     
    181186        // hangup phone to the console
    182187        if ((*mouse_dev)->mouse_phone >= 0) {
    183                 async_hangup((*mouse_dev)->mouse_phone);
     188                async_obsolete_hangup((*mouse_dev)->mouse_phone);
    184189        }
    185190       
    186191        if ((*mouse_dev)->wheel_phone >= 0) {
    187                 async_hangup((*mouse_dev)->wheel_phone);
     192                async_obsolete_hangup((*mouse_dev)->wheel_phone);
    188193        }
    189194       
     
    196201static void usb_mouse_send_wheel(const usb_mouse_t *mouse_dev, int wheel)
    197202{
    198         console_event_t ev;
     203        kbd_event_t ev;
    199204       
    200205        ev.type = KEY_PRESS;
     
    214219        for (i = 0; i < count * 3; ++i) {
    215220                usb_log_debug2("Sending key %d to the console\n", ev.key);
    216                 async_msg_4(mouse_dev->wheel_phone, KBD_EVENT, ev.type,
     221                async_obsolete_msg_4(mouse_dev->wheel_phone, KBD_EVENT, ev.type,
    217222                    ev.key, ev.mods, ev.c);
    218223                // send key release right away
    219                 async_msg_4(mouse_dev->wheel_phone, KBD_EVENT, KEY_RELEASE,
     224                async_obsolete_msg_4(mouse_dev->wheel_phone, KBD_EVENT, KEY_RELEASE,
    220225                    ev.key, ev.mods, ev.c);
    221226        }
     
    303308       
    304309        if ((shift_x != 0) || (shift_y != 0)) {
    305                 async_req_2_0(mouse_dev->mouse_phone,
     310                async_obsolete_req_2_0(mouse_dev->mouse_phone,
    306311                    MEVENT_MOVE, shift_x, shift_y);
    307312        }
     
    353358                if (mouse_dev->buttons[field->usage - field->usage_minimum] == 0
    354359                    && field->value != 0) {
    355                         async_req_2_0(mouse_dev->mouse_phone,
     360                        async_obsolete_req_2_0(mouse_dev->mouse_phone,
    356361                            MEVENT_BUTTON, field->usage, 1);
    357362                        mouse_dev->buttons[field->usage - field->usage_minimum]
     
    360365                    mouse_dev->buttons[field->usage - field->usage_minimum] != 0
    361366                    && field->value == 0) {
    362                        async_req_2_0(mouse_dev->mouse_phone,
     367                       async_obsolete_req_2_0(mouse_dev->mouse_phone,
    363368                           MEVENT_BUTTON, field->usage, 0);
    364369                       mouse_dev->buttons[field->usage - field->usage_minimum]
Note: See TracChangeset for help on using the changeset viewer.