aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/ibmasm/remote.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /drivers/misc/ibmasm/remote.h
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'drivers/misc/ibmasm/remote.h')
-rw-r--r--drivers/misc/ibmasm/remote.h119
1 files changed, 119 insertions, 0 deletions
diff --git a/drivers/misc/ibmasm/remote.h b/drivers/misc/ibmasm/remote.h
new file mode 100644
index 000000000000..a8eb19f02d3f
--- /dev/null
+++ b/drivers/misc/ibmasm/remote.h
@@ -0,0 +1,119 @@
1
2/*
3 * IBM ASM Service Processor Device Driver
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 *
19 * Copyright (C) IBM Corporation, 2004
20 *
21 * Author: Max Asböck <amax@us.ibm.com>
22 *
23 * Orignally written by Pete Reynolds
24 */
25
26#ifndef _IBMASM_REMOTE_H_
27#define _IBMASM_REMOTE_H_
28
29#include <asm/io.h>
30
31/* pci offsets */
32#define CONDOR_MOUSE_DATA 0x000AC000
33#define CONDOR_MOUSE_ISR_CONTROL 0x00
34#define CONDOR_MOUSE_ISR_STATUS 0x04
35#define CONDOR_MOUSE_Q_READER 0x08
36#define CONDOR_MOUSE_Q_WRITER 0x0C
37#define CONDOR_MOUSE_Q_BEGIN 0x10
38#define CONDOR_MOUSE_MAX_X 0x14
39#define CONDOR_MOUSE_MAX_Y 0x18
40
41#define CONDOR_INPUT_DESKTOP_INFO 0x1F0
42#define CONDOR_INPUT_DISPLAY_RESX 0x1F4
43#define CONDOR_INPUT_DISPLAY_RESY 0x1F8
44#define CONDOR_INPUT_DISPLAY_BITS 0x1FC
45#define CONDOR_OUTPUT_VNC_STATUS 0x200
46
47#define CONDOR_MOUSE_INTR_STATUS_MASK 0x00000001
48
49#define INPUT_TYPE_MOUSE 0x1
50#define INPUT_TYPE_KEYBOARD 0x2
51
52
53/* mouse button states received from SP */
54#define REMOTE_MOUSE_DOUBLE_CLICK 0xF0
55#define REMOTE_MOUSE_BUTTON_LEFT 0x01
56#define REMOTE_MOUSE_BUTTON_MIDDLE 0x02
57#define REMOTE_MOUSE_BUTTON_RIGHT 0x04
58
59
60struct mouse_input {
61 unsigned short y;
62 unsigned short x;
63};
64
65
66struct keyboard_input {
67 unsigned short key_code;
68 unsigned char key_flag;
69 unsigned char key_down;
70};
71
72
73
74struct remote_input {
75 union {
76 struct mouse_input mouse;
77 struct keyboard_input keyboard;
78 } data;
79
80 unsigned char type;
81 unsigned char pad1;
82 unsigned char mouse_buttons;
83 unsigned char pad3;
84};
85
86#define mouse_addr(sp) sp->base_address + CONDOR_MOUSE_DATA
87#define display_width(sp) mouse_addr(sp) + CONDOR_INPUT_DISPLAY_RESX
88#define display_height(sp) mouse_addr(sp) + CONDOR_INPUT_DISPLAY_RESY
89#define display_depth(sp) mouse_addr(sp) + CONDOR_INPUT_DISPLAY_BITS
90#define vnc_status(sp) mouse_addr(sp) + CONDOR_OUTPUT_VNC_STATUS
91
92#define mouse_interrupt_pending(sp) readl(mouse_addr(sp) + CONDOR_MOUSE_ISR_STATUS)
93#define clear_mouse_interrupt(sp) writel(0, mouse_addr(sp) + CONDOR_MOUSE_ISR_STATUS)
94#define enable_mouse_interrupts(sp) writel(1, mouse_addr(sp) + CONDOR_MOUSE_ISR_CONTROL)
95#define disable_mouse_interrupts(sp) writel(0, mouse_addr(sp) + CONDOR_MOUSE_ISR_CONTROL)
96
97/* remote input queue operations */
98#define REMOTE_QUEUE_SIZE 60
99
100#define get_queue_writer(sp) readl(mouse_addr(sp) + CONDOR_MOUSE_Q_WRITER)
101#define get_queue_reader(sp) readl(mouse_addr(sp) + CONDOR_MOUSE_Q_READER)
102#define set_queue_reader(sp, reader) writel(reader, mouse_addr(sp) + CONDOR_MOUSE_Q_READER)
103
104#define queue_begin mouse_addr(sp) + CONDOR_MOUSE_Q_BEGIN
105
106#define get_queue_entry(sp, read_index) \
107 queue_begin + read_index * sizeof(struct remote_input)
108
109static inline int advance_queue_reader(struct service_processor *sp, unsigned long reader)
110{
111 reader++;
112 if (reader == REMOTE_QUEUE_SIZE)
113 reader = 0;
114
115 set_queue_reader(sp, reader);
116 return reader;
117}
118
119#endif /* _IBMASM_REMOTE_H_ */