1/*
2 * cb_enabler.h
3 *
4 * The contents of this file are subject to the Mozilla Public License
5 * Version 1.1 (the "License"); you may not use this file except in
6 * compliance with the License. You may obtain a copy of the License
7 * at http://www.mozilla.org/MPL/
8 *
9 * Software distributed under the License is distributed on an "AS IS"
10 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
11 * the License for the specific language governing rights and
12 * limitations under the License.
13 *
14 * The initial developer of the original code is David A. Hinds
15 * <dahinds@users.sourceforge.net>.  Portions created by David A. Hinds
16 * are Copyright (C) 1999 David A. Hinds.  All Rights Reserved.
17 *
18 * Alternatively, the contents of this file may be used under the
19 * terms of the GNU General Public License version 2 (the "GPL"), in
20 * which case the provisions of the GPL are applicable instead of the
21 * above.  If you wish to allow the use of your version of this file
22 * only under the terms of the GPL and not to allow others to use
23 * your version of this file under the MPL, indicate your decision by
24 * deleting the provisions above and replace them with the notice and
25 * other provisions required by the GPL.  If you do not delete the
26 * provisions above, a recipient may use your version of this file
27 * under either the MPL or the GPL.
28 */
29
30#ifndef _CB_ENABLER_H
31#define _CB_ENABLER_H
32
33#define __KERNEL__
34
35#include <pcmcia/config.h>
36#include <pcmcia/k_compat.h>
37
38#include <pcmcia/version.h>
39#include <pcmcia/cs_types.h>
40#include <pcmcia/cs.h>
41#include <pcmcia/cistpl.h>
42#include <pcmcia/ds.h>
43
44#undef __KERNEL__
45
46#include <PCI.h>
47
48#define CB_ENABLER_MODULE_NAME	"bus_managers/cb_enabler/v0"
49
50typedef struct cb_device_descriptor cb_device_descriptor;
51typedef struct cb_notify_hooks cb_notify_hooks;
52typedef struct cb_enabler_module_info cb_enabler_module_info;
53
54struct cb_device_descriptor
55{
56	uint16 vendor_id;  /* 0xffff is don't-care */
57	uint16 device_id;  /* 0xffff is don't-care */
58	uint8 class_base;  /* 0xff is don't-care */
59	uint8 class_sub;   /* 0xff is don't-care */
60	uint8 class_api;   /* 0xff is don't-care */
61};
62
63struct cb_notify_hooks
64{
65	status_t (*device_added)(pci_info *pci, void **cookie);
66	void (*device_removed)(void *cookie);
67};
68
69struct cb_enabler_module_info {
70    bus_manager_info	binfo;
71
72	void (*register_driver)(const char *name,
73							const cb_device_descriptor *descriptors,
74							size_t count);
75	void (*install_notify)(const char *name,
76						   const cb_notify_hooks *hooks);
77	void (*uninstall_notify)(const char *name,
78							  const cb_notify_hooks *hooks);
79};
80
81#endif
82