Fixed warnings.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17991 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -2,14 +2,13 @@
|
|||||||
* Copyright 2004-2006 Haiku, Inc.
|
* Copyright 2004-2006 Haiku, Inc.
|
||||||
* Distributed under the terms of the Haiku License.
|
* Distributed under the terms of the Haiku License.
|
||||||
*
|
*
|
||||||
* common.c:
|
|
||||||
* PS/2 hid device driver
|
|
||||||
* Authors (in chronological order):
|
* Authors (in chronological order):
|
||||||
* Stefano Ceccherini ([email protected])
|
* Stefano Ceccherini ([email protected])
|
||||||
* Axel Dörfler, [email protected]
|
* Axel Dörfler, [email protected]
|
||||||
* Marcus Overhagen <[email protected]>
|
* Marcus Overhagen <[email protected]>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*! PS/2 hid device driver */
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
@@ -299,34 +298,38 @@ ps2_init(void)
|
|||||||
|
|
||||||
status = get_module(B_ISA_MODULE_NAME, (module_info **)&gIsa);
|
status = get_module(B_ISA_MODULE_NAME, (module_info **)&gIsa);
|
||||||
if (status < B_OK)
|
if (status < B_OK)
|
||||||
goto err_1;
|
return status;
|
||||||
|
|
||||||
gControllerSem = create_sem(1, "ps/2 keyb ctrl");
|
gControllerSem = create_sem(1, "ps/2 keyb ctrl");
|
||||||
|
|
||||||
ps2_flush();
|
ps2_flush();
|
||||||
|
|
||||||
status = ps2_dev_init();
|
status = ps2_dev_init();
|
||||||
|
if (status < B_OK)
|
||||||
|
goto err1;
|
||||||
|
|
||||||
status = ps2_service_init();
|
status = ps2_service_init();
|
||||||
|
if (status < B_OK)
|
||||||
|
goto err2;
|
||||||
|
|
||||||
status = install_io_interrupt_handler(INT_PS2_KEYBOARD, &ps2_interrupt, NULL, 0);
|
status = install_io_interrupt_handler(INT_PS2_KEYBOARD, &ps2_interrupt, NULL, 0);
|
||||||
if (status)
|
if (status)
|
||||||
goto err_3;
|
goto err3;
|
||||||
|
|
||||||
status = install_io_interrupt_handler(INT_PS2_MOUSE, &ps2_interrupt, NULL, 0);
|
status = install_io_interrupt_handler(INT_PS2_MOUSE, &ps2_interrupt, NULL, 0);
|
||||||
if (status)
|
if (status)
|
||||||
goto err_4;
|
goto err4;
|
||||||
|
|
||||||
status = ps2_setup_command_byte();
|
status = ps2_setup_command_byte();
|
||||||
if (status) {
|
if (status) {
|
||||||
dprintf("ps2: setting up command byte failed\n");
|
dprintf("ps2: setting up command byte failed\n");
|
||||||
goto err_5;
|
goto err5;
|
||||||
}
|
}
|
||||||
|
|
||||||
status = ps2_setup_active_multiplexing(&gActiveMultiplexingEnabled);
|
status = ps2_setup_active_multiplexing(&gActiveMultiplexingEnabled);
|
||||||
if (status) {
|
if (status) {
|
||||||
dprintf("ps2: setting up active multiplexing failed\n");
|
dprintf("ps2: setting up active multiplexing failed\n");
|
||||||
goto err_5;
|
goto err5;
|
||||||
}
|
}
|
||||||
|
|
||||||
ps2_service_notify_device_added(&ps2_device[PS2_DEVICE_KEYB]);
|
ps2_service_notify_device_added(&ps2_device[PS2_DEVICE_KEYB]);
|
||||||
@@ -341,17 +344,17 @@ ps2_init(void)
|
|||||||
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
|
|
||||||
err_5:
|
err5:
|
||||||
remove_io_interrupt_handler(INT_PS2_MOUSE, &ps2_interrupt, NULL);
|
remove_io_interrupt_handler(INT_PS2_MOUSE, &ps2_interrupt, NULL);
|
||||||
err_4:
|
err4:
|
||||||
remove_io_interrupt_handler(INT_PS2_KEYBOARD, &ps2_interrupt, NULL);
|
remove_io_interrupt_handler(INT_PS2_KEYBOARD, &ps2_interrupt, NULL);
|
||||||
err_3:
|
err3:
|
||||||
ps2_service_exit();
|
ps2_service_exit();
|
||||||
|
err2:
|
||||||
ps2_dev_exit();
|
ps2_dev_exit();
|
||||||
|
err1:
|
||||||
delete_sem(gControllerSem);
|
delete_sem(gControllerSem);
|
||||||
err_2:
|
|
||||||
put_module(B_ISA_MODULE_NAME);
|
put_module(B_ISA_MODULE_NAME);
|
||||||
err_1:
|
|
||||||
TRACE(("ps2_hid: init_driver failed!\n"));
|
TRACE(("ps2_hid: init_driver failed!\n"));
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,14 +2,13 @@
|
|||||||
* Copyright 2004-2006 Haiku, Inc.
|
* Copyright 2004-2006 Haiku, Inc.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* PS/2 keyboard device driver
|
|
||||||
*
|
|
||||||
* Authors (in chronological order):
|
* Authors (in chronological order):
|
||||||
* Stefano Ceccherini ([email protected])
|
* Stefano Ceccherini ([email protected])
|
||||||
* Axel Dörfler, [email protected]
|
* Axel Dörfler, [email protected]
|
||||||
* Marcus Overhagen <[email protected]>
|
* Marcus Overhagen <[email protected]>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*! PS/2 keyboard device driver */
|
||||||
|
|
||||||
#include "ps2_service.h"
|
#include "ps2_service.h"
|
||||||
#include "kb_mouse_driver.h"
|
#include "kb_mouse_driver.h"
|
||||||
@@ -231,13 +230,13 @@ keyboard_open(const char *name, uint32 flags, void **_cookie)
|
|||||||
sKeyboardSem = create_sem(0, "keyboard_sem");
|
sKeyboardSem = create_sem(0, "keyboard_sem");
|
||||||
if (sKeyboardSem < 0) {
|
if (sKeyboardSem < 0) {
|
||||||
status = sKeyboardSem;
|
status = sKeyboardSem;
|
||||||
goto err2;
|
goto err1;
|
||||||
}
|
}
|
||||||
|
|
||||||
sKeyBuffer = create_packet_buffer(KEY_BUFFER_SIZE * sizeof(at_kbd_io));
|
sKeyBuffer = create_packet_buffer(KEY_BUFFER_SIZE * sizeof(at_kbd_io));
|
||||||
if (sKeyBuffer == NULL) {
|
if (sKeyBuffer == NULL) {
|
||||||
status = B_NO_MEMORY;
|
status = B_NO_MEMORY;
|
||||||
goto err3;
|
goto err2;
|
||||||
}
|
}
|
||||||
|
|
||||||
atomic_or(&ps2_device[PS2_DEVICE_KEYB].flags, PS2_FLAG_ENABLED);
|
atomic_or(&ps2_device[PS2_DEVICE_KEYB].flags, PS2_FLAG_ENABLED);
|
||||||
@@ -249,14 +248,11 @@ keyboard_open(const char *name, uint32 flags, void **_cookie)
|
|||||||
dprintf("ps2: keyboard_open %s success\n", name);
|
dprintf("ps2: keyboard_open %s success\n", name);
|
||||||
return B_OK;
|
return B_OK;
|
||||||
|
|
||||||
err4:
|
|
||||||
delete_packet_buffer(sKeyBuffer);
|
|
||||||
err3:
|
|
||||||
delete_sem(sKeyboardSem);
|
|
||||||
err2:
|
err2:
|
||||||
|
delete_sem(sKeyboardSem);
|
||||||
err1:
|
err1:
|
||||||
atomic_and(&sKeyboardOpenMask, 0);
|
atomic_and(&sKeyboardOpenMask, 0);
|
||||||
|
|
||||||
dprintf("ps2: keyboard_open %s failed\n", name);
|
dprintf("ps2: keyboard_open %s failed\n", name);
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user