44 #include "debug/PS2.hh" 46 #include "params/PS2Mouse.hh" 50 status(0), resolution(4), sampleRate(100)
59 DPRINTF(PS2,
"Mouse ID requested.\n");
64 DPRINTF(PS2,
"Disabling data reporting.\n");
69 DPRINTF(PS2,
"Enabling data reporting.\n");
74 panic(
"Mouse resend unimplemented.\n");
76 DPRINTF(PS2,
"Resetting the mouse.\n");
87 DPRINTF(PS2,
"Setting mouse scale to 1:1.\n");
92 DPRINTF(PS2,
"Setting mouse scale to 2:1.\n");
97 if (data.size() == 1) {
98 DPRINTF(PS2,
"Setting mouse resolution.\n");
102 DPRINTF(PS2,
"Mouse resolution set to %d.\n", data[1]);
108 DPRINTF(PS2,
"Getting mouse status.\n");
115 panic(
"Reading mouse data unimplemented.\n");
117 panic(
"Resetting mouse wrap mode unimplemented.\n");
119 panic(
"Setting mouse wrap mode unimplemented.\n");
121 panic(
"Setting mouse remote mode unimplemented.\n");
123 if (data.size() == 1) {
124 DPRINTF(PS2,
"Setting mouse sample rate.\n");
128 DPRINTF(PS2,
"Mouse sample rate %d samples " 129 "per second.\n", data[1]);
135 DPRINTF(PS2,
"Disabling and resetting mouse.\n");
143 warn(
"Unknown mouse command %#02x.\n", data[0]);
170 PS2MouseParams::create()
#define panic(...)
This implements a cprintf based panic() function.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
const std::vector< uint8_t > ID
void sendAck()
Send an ACK byte to the host.
void serialize(CheckpointOut &cp) const override
Serialize an object.
PS2Mouse(const PS2MouseParams *p)
#define UNSERIALIZE_SCALAR(scalar)
void serialize(CheckpointOut &cp) const override
Serialize an object.
bool recv(const std::vector< uint8_t > &data) override
Data received from host.
#define SERIALIZE_SCALAR(scalar)
void send(const uint8_t *data, size_t size)
Send data from a PS/2 device to a host.
std::ostream CheckpointOut
void unserialize(CheckpointIn &cp) override
Unserialize an object.