@@ -27,7 +27,7 @@ typedef struct MouseStatus {
2727 U8 sample_rate ;
2828} MouseStatus ;
2929
30- void mouse_interrupt_asm_handler ();
30+ void ps2_mouse_interrupt_asm_handler ();
3131static bool ismouse ();
3232static MouseStatus get_mouse_state ();
3333
@@ -57,18 +57,18 @@ static MouseStatus get_mouse_state()
5757{
5858 MouseStatus status = { 0 };
5959
60- ps2_write_device_cmd (PS2_SECOND_DEVICE , PS2_MOUSE_CMD_GET_ID );
60+ ps2_write_device_data_wait_ack (PS2_SECOND_DEVICE , PS2_MOUSE_CMD_GET_ID );
6161 ps2_wait_read (PS2_DATA_PORT , & status .id );
6262
63- ps2_write_device_cmd (PS2_SECOND_DEVICE , PS2_MOUSE_CMD_STATUS_REQ );
63+ ps2_write_device_data_wait_ack (PS2_SECOND_DEVICE , PS2_MOUSE_CMD_STATUS_REQ );
6464 ps2_wait_read (PS2_DATA_PORT , & status .status );
6565 ps2_wait_read (PS2_DATA_PORT , & status .resolution );
6666 ps2_wait_read (PS2_DATA_PORT , & status .sample_rate );
6767
6868 return status ;
6969}
7070
71- bool ps2mouse_init ()
71+ bool ps2_mouse_init ()
7272{
7373 FUNC_ENTRY ();
7474
@@ -81,20 +81,20 @@ bool ps2mouse_init()
8181 }
8282
8383 // Set defaults
84- if (!ps2_write_device_cmd (PS2_SECOND_DEVICE , PS2_DEV_CMD_SET_TO_DEFAULT )) {
84+ if (!ps2_write_device_data_wait_ack (PS2_SECOND_DEVICE , PS2_DEV_CMD_SET_TO_DEFAULT )) {
8585 RETURN_ERROR (ERROR_PASSTHROUGH , false);
8686 }
8787
8888 // Set sample rate
89- if (!ps2_write_device_cmd (PS2_SECOND_DEVICE , PS2_MOUSE_CMD_SET_SAMPLE_RATE )) {
89+ if (!ps2_write_device_data_wait_ack (PS2_SECOND_DEVICE , PS2_MOUSE_CMD_SET_SAMPLE_RATE )) {
9090 RETURN_ERROR (ERROR_PASSTHROUGH , false);
9191 }
92- if (!ps2_write_device_cmd (PS2_SECOND_DEVICE , CONFIG_PS2_MOUSE_SAMPLE_RATE )) {
92+ if (!ps2_write_device_data_wait_ack (PS2_SECOND_DEVICE , CONFIG_PS2_MOUSE_SAMPLE_RATE )) {
9393 RETURN_ERROR (ERROR_PASSTHROUGH , false);
9494 }
9595
9696 // Enable scanning by the device
97- if (!ps2_write_device_cmd (PS2_SECOND_DEVICE , PS2_DEV_CMD_ENABLE_SCANNING )) {
97+ if (!ps2_write_device_data_wait_ack (PS2_SECOND_DEVICE , PS2_DEV_CMD_ENABLE_SCANNING )) {
9898 RETURN_ERROR (ERROR_PASSTHROUGH , false);
9999 }
100100
@@ -113,7 +113,7 @@ bool ps2mouse_init()
113113 ps2_configuration (PS2_CONFIG_SECOND_PORT_INTERRUPT_ENABLE , 0 , NULL );
114114
115115 // Add handlers for keyboard interrupts
116- kidt_edit (0x2C , mouse_interrupt_asm_handler , GDT_SELECTOR_KCODE ,
116+ kidt_edit (0x2C , ps2_mouse_interrupt_asm_handler , GDT_SELECTOR_KCODE ,
117117 IDT_DES_TYPE_32_INTERRUPT_GATE , 0 );
118118
119119 // Enable Mouse IRQ
@@ -122,13 +122,13 @@ bool ps2mouse_init()
122122 return true;
123123}
124124
125- MousePositionData mouse_get_packet ()
125+ MousePositionData ps2_mouse_get_packet ()
126126{
127127 return mouse_position ;
128128}
129129
130- INTERRUPT_HANDLER (mouse_interrupt )
131- void mouse_interrupt_handler (InterruptFrame * frame )
130+ INTERRUPT_HANDLER (ps2_mouse_interrupt )
131+ void ps2_mouse_interrupt_handler (InterruptFrame * frame )
132132{
133133 (void )frame ;
134134
0 commit comments