fed up with those stupid warnings
[mmotm.git] / include / linux / vbus_pci.h
blobfe337590e644017392e4c9d9236150adb2333729
1 /*
2 * Copyright 2009 Novell. All Rights Reserved.
4 * PCI to Virtual-Bus Bridge
6 * Author:
7 * Gregory Haskins <ghaskins@novell.com>
9 * This file is free software; you can redistribute it and/or modify
10 * it under the terms of version 2 of the GNU General Public License
11 * as published by the Free Software Foundation.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software Foundation,
20 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
23 #ifndef _LINUX_VBUS_PCI_H
24 #define _LINUX_VBUS_PCI_H
26 #include <linux/ioctl.h>
27 #include <linux/types.h>
29 #define VBUS_PCI_ABI_MAGIC 0xbf53eef5
30 #define VBUS_PCI_ABI_VERSION 2
31 #define VBUS_PCI_HC_VERSION 1
33 enum {
34 VBUS_PCI_BRIDGE_NEGOTIATE,
35 VBUS_PCI_BRIDGE_QREG,
36 VBUS_PCI_BRIDGE_SLOWCALL,
37 VBUS_PCI_BRIDGE_FASTCALL_ADD,
38 VBUS_PCI_BRIDGE_FASTCALL_DROP,
40 VBUS_PCI_BRIDGE_MAX, /* must be last */
43 enum {
44 VBUS_PCI_HC_DEVOPEN,
45 VBUS_PCI_HC_DEVCLOSE,
46 VBUS_PCI_HC_DEVCALL,
47 VBUS_PCI_HC_DEVSHM,
49 VBUS_PCI_HC_MAX, /* must be last */
52 struct vbus_pci_bridge_negotiate {
53 __u32 magic;
54 __u32 version;
55 __u64 capabilities;
58 struct vbus_pci_deviceopen {
59 __u32 devid;
60 __u32 version; /* device ABI version */
61 __u64 handle; /* return value for devh */
64 struct vbus_pci_devicecall {
65 __u64 devh; /* device-handle (returned from DEVICEOPEN */
66 __u32 func;
67 __u32 len;
68 __u32 flags;
69 __u64 datap;
72 struct vbus_pci_deviceshm {
73 __u64 devh; /* device-handle (returned from DEVICEOPEN */
74 __u32 id;
75 __u32 len;
76 __u32 flags;
77 struct {
78 __u32 offset;
79 __u32 prio;
80 __u64 cookie; /* token to pass back when signaling client */
81 } signal;
82 __u64 datap;
85 struct vbus_pci_call_desc {
86 __u32 vector;
87 __u32 len;
88 __u64 datap;
91 struct vbus_pci_fastcall_desc {
92 struct vbus_pci_call_desc call;
93 __u32 result;
96 struct vbus_pci_regs {
97 struct vbus_pci_call_desc bridgecall;
98 __u8 pad[48];
101 struct vbus_pci_signals {
102 __u32 eventq;
103 __u32 fastcall;
104 __u32 shmsignal;
105 __u8 pad[20];
108 struct vbus_pci_eventqreg {
109 __u32 count;
110 __u64 ring;
111 __u64 data;
114 struct vbus_pci_busreg {
115 __u32 count; /* supporting multiple queues allows for prio, etc */
116 struct vbus_pci_eventqreg eventq[1];
119 enum vbus_pci_eventid {
120 VBUS_PCI_EVENT_DEVADD,
121 VBUS_PCI_EVENT_DEVDROP,
122 VBUS_PCI_EVENT_SHMSIGNAL,
123 VBUS_PCI_EVENT_SHMCLOSE,
126 #define VBUS_MAX_DEVTYPE_LEN 128
128 struct vbus_pci_add_event {
129 __u64 id;
130 char type[VBUS_MAX_DEVTYPE_LEN];
133 struct vbus_pci_handle_event {
134 __u64 handle;
137 struct vbus_pci_event {
138 __u32 eventid;
139 union {
140 struct vbus_pci_add_event add;
141 struct vbus_pci_handle_event handle;
142 } data;
145 #endif /* _LINUX_VBUS_PCI_H */