|
25 | 25 | #define STOP_STREAMING {'\x06', '\x04'}
|
26 | 26 | #define SEND_COMMAND {'\x06', '\x01', '\xf4', '\x01'}
|
27 | 27 |
|
| 28 | +#ifdef NVEC_PS2_DEBUG |
| 29 | +#define NVEC_PHD(str, buf, len) \ |
| 30 | + print_hex_dump(KERN_DEBUG, str, DUMP_PREFIX_NONE, \ |
| 31 | + 16, 1, buf, len, false) |
| 32 | +#else |
| 33 | +#define NVEC_PHD(str, buf, len) |
| 34 | +#endif |
| 35 | + |
28 | 36 | static const unsigned char MOUSE_RESET[] = {'\x06', '\x01', '\xff', '\x03'};
|
29 | 37 |
|
30 | 38 | struct nvec_ps2 {
|
@@ -67,18 +75,18 @@ static int nvec_ps2_notifier(struct notifier_block *nb,
|
67 | 75 | case NVEC_PS2_EVT:
|
68 | 76 | for (i = 0; i < msg[1]; i++)
|
69 | 77 | serio_interrupt(ps2_dev.ser_dev, msg[2 + i], 0);
|
| 78 | + NVEC_PHD("ps/2 mouse event: ", &msg[2], msg[1]); |
70 | 79 | return NOTIFY_STOP;
|
71 | 80 |
|
72 | 81 | case NVEC_PS2:
|
73 |
| - if (msg[2] == 1) |
| 82 | + if (msg[2] == 1) { |
74 | 83 | for (i = 0; i < (msg[1] - 2); i++)
|
75 | 84 | serio_interrupt(ps2_dev.ser_dev, msg[i + 4], 0);
|
76 |
| - else if (msg[1] != 2) { /* !ack */ |
77 |
| - print_hex_dump(KERN_WARNING, "unhandled mouse event: ", |
78 |
| - DUMP_PREFIX_NONE, 16, 1, |
79 |
| - msg, msg[1] + 2, true); |
| 85 | + NVEC_PHD("ps/2 mouse reply: ", &msg[4], msg[1] - 2); |
80 | 86 | }
|
81 | 87 |
|
| 88 | + else if (msg[1] != 2) /* !ack */ |
| 89 | + NVEC_PHD("unhandled mouse event: ", msg, msg[1] + 2); |
82 | 90 | return NOTIFY_STOP;
|
83 | 91 | }
|
84 | 92 |
|
|
0 commit comments