cleanup
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16144 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
acf395bb4b
commit
64faaed88a
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2004-2005 Haiku, Inc.
|
||||
* Copyright 2004-2006 Haiku, Inc.
|
||||
* Distributed under the terms of the Haiku License.
|
||||
*
|
||||
* common.c:
|
||||
@ -7,6 +7,7 @@
|
||||
* Authors (in chronological order):
|
||||
* Stefano Ceccherini (burton666@libero.it)
|
||||
* Axel Dörfler, axeld@pinc-software.de
|
||||
* Marcus Overhagen <marcus@overhagen.de>
|
||||
*/
|
||||
|
||||
|
||||
@ -16,33 +17,6 @@
|
||||
#include "ps2_service.h"
|
||||
#include "ps2_dev.h"
|
||||
|
||||
device_hooks sKeyboardDeviceHooks = {
|
||||
keyboard_open,
|
||||
keyboard_close,
|
||||
keyboard_freecookie,
|
||||
keyboard_ioctl,
|
||||
keyboard_read,
|
||||
keyboard_write,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL
|
||||
};
|
||||
|
||||
device_hooks sMouseDeviceHooks = {
|
||||
mouse_open,
|
||||
mouse_close,
|
||||
mouse_freecookie,
|
||||
mouse_ioctl,
|
||||
mouse_read,
|
||||
mouse_write,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL
|
||||
};
|
||||
|
||||
|
||||
isa_module_info *gIsa = NULL;
|
||||
|
||||
static sem_id sKbcSem;
|
||||
@ -232,11 +206,11 @@ ps2_interrupt(void* cookie)
|
||||
|
||||
|
||||
status_t
|
||||
ps2_init_driver(void)
|
||||
ps2_init(void)
|
||||
{
|
||||
status_t status;
|
||||
|
||||
TRACE(("ps2_hid: init_driver\n"));
|
||||
TRACE(("ps2: init\n"));
|
||||
|
||||
status = get_module(B_ISA_MODULE_NAME, (module_info **)&gIsa);
|
||||
if (status < B_OK)
|
||||
@ -349,9 +323,9 @@ err_1:
|
||||
|
||||
|
||||
void
|
||||
ps2_uninit_driver(void)
|
||||
ps2_uninit(void)
|
||||
{
|
||||
TRACE(("ps2_hid: uninit_driver\n"));
|
||||
TRACE(("ps2: uninit\n"));
|
||||
remove_io_interrupt_handler(INT_PS2_MOUSE, &ps2_interrupt, NULL);
|
||||
remove_io_interrupt_handler(INT_PS2_KEYBOARD, &ps2_interrupt, NULL);
|
||||
ps2_service_exit();
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2004-2005 Haiku, Inc.
|
||||
* Copyright 2004-2006 Haiku, Inc.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* PS/2 hid device driver
|
||||
@ -8,6 +8,7 @@
|
||||
* Elad Lahav (elad@eldarshany.com)
|
||||
* Stefano Ceccherini (burton666@libero.it)
|
||||
* Axel Dörfler, axeld@pinc-software.de
|
||||
* Marcus Overhagen <marcus@overhagen.de>
|
||||
*/
|
||||
#ifndef __PS2_COMMON_H
|
||||
#define __PS2_COMMON_H
|
||||
@ -32,15 +33,15 @@
|
||||
// global variables
|
||||
extern isa_module_info *gIsa;
|
||||
|
||||
extern device_hooks sKeyboardDeviceHooks;
|
||||
extern device_hooks sMouseDeviceHooks;
|
||||
extern device_hooks gKeyboardDeviceHooks;
|
||||
extern device_hooks gMouseDeviceHooks;
|
||||
|
||||
extern bool gMultiplexingActive;
|
||||
|
||||
// prototypes from common.c
|
||||
|
||||
status_t ps2_init_driver(void);
|
||||
void ps2_uninit_driver(void);
|
||||
status_t ps2_init(void);
|
||||
void ps2_uninit(void);
|
||||
|
||||
extern status_t ps2_wait_read();
|
||||
extern status_t ps2_wait_write();
|
||||
@ -66,19 +67,4 @@ extern status_t probe_keyboard(void);
|
||||
extern int32 mouse_handle_int(ps2_dev *dev, uint8 data);
|
||||
extern int32 keyboard_handle_int(uint8 data);
|
||||
|
||||
|
||||
extern status_t keyboard_open(const char *name, uint32 flags, void **cookie);
|
||||
extern status_t keyboard_close(void *cookie);
|
||||
extern status_t keyboard_freecookie(void *cookie);
|
||||
extern status_t keyboard_read(void *cookie, off_t pos, void *buf, size_t *len);
|
||||
extern status_t keyboard_write(void * cookie, off_t pos, const void *buf, size_t *len);
|
||||
extern status_t keyboard_ioctl(void *cookie, uint32 op, void *buf, size_t len);
|
||||
|
||||
extern status_t mouse_open(const char *name, uint32 flags, void **cookie);
|
||||
extern status_t mouse_close(void *cookie);
|
||||
extern status_t mouse_freecookie(void *cookie);
|
||||
extern status_t mouse_read(void *cookie, off_t pos, void *buf, size_t *len);
|
||||
extern status_t mouse_write(void * cookie, off_t pos, const void *buf, size_t *len);
|
||||
extern status_t mouse_ioctl(void *cookie, uint32 op, void *buf, size_t len);
|
||||
|
||||
#endif /* __PS2_COMMON_H */
|
||||
|
@ -66,7 +66,7 @@ ps2_dev_publish(ps2_dev *dev)
|
||||
dev->active = true;
|
||||
|
||||
status = devfs_publish_device(dev->name, NULL,
|
||||
(dev->flags & PS2_FLAG_KEYB) ? &sKeyboardDeviceHooks : &sMouseDeviceHooks);
|
||||
(dev->flags & PS2_FLAG_KEYB) ? &gKeyboardDeviceHooks : &gMouseDeviceHooks);
|
||||
|
||||
TRACE(("devfs_publish_device %s, status = 0x%08x\n", dev->name, status));
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2004-2005 Haiku, Inc.
|
||||
* Copyright 2004-2006 Haiku, Inc.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* PS/2 keyboard device driver
|
||||
@ -7,6 +7,7 @@
|
||||
* Authors (in chronological order):
|
||||
* Stefano Ceccherini (burton666@libero.it)
|
||||
* Axel Dörfler, axeld@pinc-software.de
|
||||
* Marcus Overhagen <marcus@overhagen.de>
|
||||
*/
|
||||
|
||||
|
||||
@ -16,7 +17,6 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
|
||||
#define KEY_BUFFER_SIZE 100
|
||||
// we will buffer 100 key strokes before we start dropping them
|
||||
|
||||
@ -199,7 +199,7 @@ probe_keyboard(void)
|
||||
// #pragma mark -
|
||||
|
||||
|
||||
status_t
|
||||
static status_t
|
||||
keyboard_open(const char *name, uint32 flags, void **_cookie)
|
||||
{
|
||||
status_t status;
|
||||
@ -240,29 +240,30 @@ err1:
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
static status_t
|
||||
keyboard_close(void *cookie)
|
||||
{
|
||||
TRACE(("keyboard_close()\n"));
|
||||
|
||||
|
||||
delete_packet_buffer(sKeyBuffer);
|
||||
delete_sem(sKeyboardSem);
|
||||
|
||||
atomic_and(&ps2_device[PS2_DEVICE_KEYB].flags, ~PS2_FLAG_ENABLED);
|
||||
|
||||
atomic_and(&sKeyboardOpenMask, 0);
|
||||
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
static status_t
|
||||
keyboard_freecookie(void *cookie)
|
||||
{
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
static status_t
|
||||
keyboard_read(void *cookie, off_t pos, void *buffer, size_t *_length)
|
||||
{
|
||||
TRACE(("keyboard read()\n"));
|
||||
@ -271,7 +272,7 @@ keyboard_read(void *cookie, off_t pos, void *buffer, size_t *_length)
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
static status_t
|
||||
keyboard_write(void *cookie, off_t pos, const void *buffer, size_t *_length)
|
||||
{
|
||||
TRACE(("keyboard write()\n"));
|
||||
@ -280,7 +281,7 @@ keyboard_write(void *cookie, off_t pos, const void *buffer, size_t *_length)
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
static status_t
|
||||
keyboard_ioctl(void *cookie, uint32 op, void *buffer, size_t length)
|
||||
{
|
||||
TRACE(("keyboard ioctl()\n"));
|
||||
@ -309,3 +310,12 @@ keyboard_ioctl(void *cookie, uint32 op, void *buffer, size_t length)
|
||||
return EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
device_hooks gKeyboardDeviceHooks = {
|
||||
keyboard_open,
|
||||
keyboard_close,
|
||||
keyboard_freecookie,
|
||||
keyboard_ioctl,
|
||||
keyboard_read,
|
||||
keyboard_write,
|
||||
};
|
||||
|
@ -29,10 +29,10 @@ std_ops(int32 op, ...)
|
||||
{
|
||||
switch(op) {
|
||||
case B_MODULE_INIT:
|
||||
return ps2_init_driver();
|
||||
return ps2_init();
|
||||
|
||||
case B_MODULE_UNINIT:
|
||||
ps2_uninit_driver();
|
||||
ps2_uninit();
|
||||
break;
|
||||
default:
|
||||
return B_ERROR;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2001-2005 Haiku, Inc.
|
||||
* Copyright 2001-2006 Haiku, Inc.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* PS/2 mouse device driver
|
||||
@ -8,6 +8,7 @@
|
||||
* Elad Lahav (elad@eldarshany.com)
|
||||
* Stefano Ceccherini (burton666@libero.it)
|
||||
* Axel Dörfler, axeld@pinc-software.de
|
||||
* Marcus Overhagen <marcus@overhagen.de>
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -240,7 +241,8 @@ set_mouse_enabled(mouse_cookie *cookie, bool enable)
|
||||
* calls to the handler, each holds a different byte on the data port.
|
||||
*/
|
||||
|
||||
int32 mouse_handle_int(ps2_dev *dev, uint8 data)
|
||||
int32
|
||||
mouse_handle_int(ps2_dev *dev, uint8 data)
|
||||
{
|
||||
mouse_cookie *cookie = dev->cookie;
|
||||
|
||||
@ -325,7 +327,7 @@ probe_mouse(mouse_cookie *cookie, size_t *probed_packet_size)
|
||||
// Device functions
|
||||
|
||||
|
||||
status_t
|
||||
static status_t
|
||||
mouse_open(const char *name, uint32 flags, void **_cookie)
|
||||
{
|
||||
mouse_cookie *cookie;
|
||||
@ -403,7 +405,7 @@ err1:
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
static status_t
|
||||
mouse_close(void *_cookie)
|
||||
{
|
||||
mouse_cookie *cookie = _cookie;
|
||||
@ -422,7 +424,7 @@ mouse_close(void *_cookie)
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
static status_t
|
||||
mouse_freecookie(void *_cookie)
|
||||
{
|
||||
mouse_cookie *cookie = _cookie;
|
||||
@ -431,7 +433,7 @@ mouse_freecookie(void *_cookie)
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
static status_t
|
||||
mouse_read(void *cookie, off_t pos, void *buffer, size_t *_length)
|
||||
{
|
||||
*_length = 0;
|
||||
@ -439,7 +441,7 @@ mouse_read(void *cookie, off_t pos, void *buffer, size_t *_length)
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
static status_t
|
||||
mouse_write(void *cookie, off_t pos, const void *buffer, size_t *_length)
|
||||
{
|
||||
*_length = 0;
|
||||
@ -447,7 +449,7 @@ mouse_write(void *cookie, off_t pos, const void *buffer, size_t *_length)
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
static status_t
|
||||
mouse_ioctl(void *_cookie, uint32 op, void *buffer, size_t length)
|
||||
{
|
||||
mouse_cookie *cookie = _cookie;
|
||||
@ -491,3 +493,11 @@ mouse_ioctl(void *_cookie, uint32 op, void *buffer, size_t length)
|
||||
}
|
||||
}
|
||||
|
||||
device_hooks gMouseDeviceHooks = {
|
||||
mouse_open,
|
||||
mouse_close,
|
||||
mouse_freecookie,
|
||||
mouse_ioctl,
|
||||
mouse_read,
|
||||
mouse_write,
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user