root/src/add-ons/kernel/bus_managers/ps2/ps2_alps.h
/*
 * Copyright 2011, Haiku, Inc.
 * Distributed under the terms of the MIT License.
 *
 * Authors:
 *              Clemens Zeidler (haiku@Clemens-Zeidler.de)
 */
#ifndef ALPS_H
#define ALPS_H

#include <KernelExport.h>

#include "packet_buffer.h"
#include "ps2_dev.h"


typedef struct {
                        ps2_dev*                        dev;

                        sem_id                          sem;
        struct  packet_buffer*          ring_buffer;
                        size_t                          packet_index;
                        uint8                           buffer[PS2_PACKET_ALPS];
                        uint8                           mode;

                        uint8                           previousZ;
} alps_cookie;


status_t probe_alps(ps2_dev *dev);

status_t alps_open(const char *name, uint32 flags, void **_cookie);
status_t alps_close(void *_cookie);
status_t alps_freecookie(void *_cookie);
status_t alps_ioctl(void *_cookie, uint32 op, void *buffer, size_t length);

int32 alps_handle_int(ps2_dev *dev);
void alps_disconnect(ps2_dev *dev);

extern device_hooks gALPSDeviceHooks;


#endif /* ALPS_H */