Some tidy up for the drivers we now include and load.

- add api_version to keyboard and ps2mouse
- remove some excessive debugging comments from random
- add back the last 2 NULL's for the device_hooks structure now we
  actaully define them (iovec's are now available)


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@273 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
David Reid 2002-07-17 12:13:24 +00:00
parent d2c1ff9a7d
commit 1a615d2c90
3 changed files with 14 additions and 17 deletions

View File

@ -36,6 +36,7 @@ static sem_id keyboard_sem;
static mutex keyboard_read_mutex;
static char keyboard_buf[1024];
static unsigned int head, tail;
int32 api_version = B_CUR_DRIVER_API_VERSION;
// stolen from nujeffos
const char unshifted_keymap[128] = {
@ -277,8 +278,8 @@ device_hooks keyboard_hooks = {
&keyboard_write,
NULL,
NULL,
// NULL,
// NULL
NULL,
NULL
};
static int setup_keyboard(void)
@ -307,8 +308,6 @@ status_t init_hardware()
setup_keyboard();
int_set_io_interrupt_handler(0x21,&handle_keyboard_interrupt, NULL);
// devfs_publish_device(DEVICE_NAME, NULL, &keyboard_hooks);
return 0;
}

View File

@ -58,6 +58,7 @@
#include <arch/x86/ps2mouse.h>
#define DEVICE_NAME "ps2mouse"
int32 api_version = B_CUR_DRIVER_API_VERSION;
/////////////////////////////////////////////////////////////////////////
// interrupt
@ -207,8 +208,8 @@ device_hooks ps2_mouse_hooks = {
&mouse_write,
NULL,
NULL,
// NULL,
// NULL
NULL,
NULL
}; // ps2_mouse_hooks
/////////////////////////////////////////////////////////////////////////
@ -327,9 +328,6 @@ status_t init_hardware()
if(mouse_sem < 0)
panic("failed to create PS/2 mouse semaphore!\n");
// register device file-system like operations
// devfs_publish_device("ps2mouse", NULL, &ps2_mouse_hooks);
return 0;
} // mouse_dev_init

View File

@ -271,7 +271,7 @@ int32 api_version = B_CUR_DRIVER_API_VERSION;
status_t init_hardware (void)
{
dprintf (DRIVER_NAME ": init_hardware()\n");
// dprintf (DRIVER_NAME ": init_hardware()\n");
return B_OK;
}
@ -286,7 +286,7 @@ status_t init_driver (void)
{
rng = new_chrand(8);
rand_mutex = create_sem(1, "RNG semaphore");
dprintf (DRIVER_NAME ": init_driver()\n");
// dprintf (DRIVER_NAME ": init_driver()\n");
return B_OK;
}
@ -300,7 +300,7 @@ void uninit_driver (void)
{
kill_chrand(rng);
delete_sem(rand_mutex);
dprintf (DRIVER_NAME ": uninit_driver()\n");
// dprintf (DRIVER_NAME ": uninit_driver()\n");
}
@ -310,7 +310,7 @@ void uninit_driver (void)
static status_t my_device_open (const char *name, uint32 flags, void** cookie)
{
dprintf (DRIVER_NAME ": open(\"%s\")\n", name);
// dprintf (DRIVER_NAME ": open(\"%s\")\n", name);
return B_OK;
}
@ -373,7 +373,7 @@ static status_t my_device_control (void* cookie, uint32 op, void* arg, size_t le
static status_t my_device_close (void* cookie)
{
dprintf (DRIVER_NAME ": close()\n");
// dprintf (DRIVER_NAME ": close()\n");
return B_OK;
}
@ -386,7 +386,7 @@ static status_t my_device_close (void* cookie)
static status_t my_device_free (void* cookie)
{
dprintf (DRIVER_NAME ": free()\n");
// dprintf (DRIVER_NAME ": free()\n");
return B_OK;
}
@ -426,7 +426,7 @@ static device_hooks my_device_hooks = {
const char **publish_devices()
{
dprintf (DRIVER_NAME ": publish_devices()\n");
// dprintf (DRIVER_NAME ": publish_devices()\n");
return my_device_name;
}
@ -437,7 +437,7 @@ const char **publish_devices()
device_hooks *find_device(const char* name)
{
int i;
dprintf (DRIVER_NAME ": find_device(\"%s\")\n", name);
// dprintf (DRIVER_NAME ": find_device(\"%s\")\n", name);
for (i = 0; my_device_name[i] != NULL; i++)
if (strcmp (name, my_device_name [i]) == 0)
return &my_device_hooks;