1/******************************************************************************
2 *
3 * Name:	skqueue.h
4 * Project:	Genesis, PCI Gigabit Ethernet Adapter
5 * Version:	$Revision: 1.1.1.1 $
6 * Date:	$Date: 2008/10/15 03:26:44 $
7 * Purpose:	Defines for the Event queue
8 *
9 ******************************************************************************/
10
11/******************************************************************************
12 *
13 *	(C)Copyright 1989-1998 SysKonnect,
14 *	a business unit of Schneider & Koch & Co. Datensysteme GmbH.
15 *	All Rights Reserved
16 *
17 *	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF SYSKONNECT
18 *	The copyright notice above does not evidence any
19 *	actual or intended publication of such source code.
20 *
21 *	This Module contains Proprietary Information of SysKonnect
22 *	and should be treated as Confidential.
23 *
24 *	The information in this file is provided for the exclusive use of
25 *	the licensees of SysKonnect.
26 *	Such users have the right to use, modify, and incorporate this code
27 *	into products for purposes authorized by the license agreement
28 *	provided they include this notice and the associated copyright notice
29 *	with any such product.
30 *	The information in this file is provided "AS IS" without warranty.
31 *
32 ******************************************************************************/
33
34/******************************************************************************
35 *
36 * History:
37 *
38 *	$Log: skqueue.h,v $
39 *	Revision 1.1.1.1  2008/10/15 03:26:44  james26_jang
40 *	Initial.
41 *
42 *	Revision 1.1.1.1  2008/07/21 09:15:07  james26_jang
43 *	New UI, New QoS, New wireless driver(4.151.10.29), ipmonitor.
44 *
45 *	Revision 1.1  2008/07/17 12:43:35  james26_jang
46 *	*** empty log message ***
47 *
48 *	Revision 1.1.1.1  2007/02/15 12:11:35  jiahao
49 *	initial update
50 *
51 *	Revision 1.1.1.1  2007/01/25 12:51:56  jiahao_jhou
52 *
53 *
54 *	Revision 1.1.1.1  2003/02/03 22:37:48  mhuang
55 *	LINUX_2_4 branch snapshot from linux-mips.org CVS
56 *
57 *	Revision 1.12  1998/09/08 08:48:01  gklug
58 *	add: init level handling
59 *
60 *	Revision 1.11  1998/09/03 14:15:11  gklug
61 *	add: CSUM and HWAC Eventclass and function.
62 *	fix: pParaPtr according to CCC
63 *
64 *	Revision 1.10  1998/08/20 12:43:03  gklug
65 *	add: typedef SK_QUEUE
66 *
67 *	Revision 1.9  1998/08/19 09:50:59  gklug
68 *	fix: remove struct keyword from c-code (see CCC) add typedefs
69 *
70 *	Revision 1.8  1998/08/18 07:00:01  gklug
71 *	fix: SK_PTR not defined use void * instead.
72 *
73 *	Revision 1.7  1998/08/17 13:43:19  gklug
74 *	chg: Parameter will be union of 64bit para, 2 times SK_U32 or SK_PTR
75 *
76 *	Revision 1.6  1998/08/14 07:09:30  gklug
77 *	fix: chg pAc -> pAC
78 *
79 *	Revision 1.5  1998/08/11 14:26:44  gklug
80 *	chg: Event Dispatcher returns now int.
81 *
82 *	Revision 1.4  1998/08/11 12:15:21  gklug
83 *	add: Error numbers of skqueue module
84 *
85 *	Revision 1.3  1998/08/07 12:54:23  gklug
86 *	fix: first compiled version
87 *
88 *	Revision 1.2  1998/08/07 09:34:00  gklug
89 *	adapt structure defs to CCC
90 *	add: prototypes for functions
91 *
92 *	Revision 1.1  1998/07/30 14:52:12  gklug
93 *	Initial version.
94 *	Defines Event Classes, Event structs and queue management variables.
95 *
96 *
97 *
98 ******************************************************************************/
99
100/*
101 * SKQUEUE.H	contains all defines and types for the event queue
102 */
103
104#ifndef _SKQUEUE_H_
105#define _SKQUEUE_H_
106
107
108/*
109 * define the event classes to be served
110 */
111#define	SKGE_DRV	1	/* Driver Event Class */
112#define	SKGE_RLMT	2	/* RLMT Event Class */
113#define	SKGE_I2C	3	/* i2C Event Class */
114#define	SKGE_PNMI	4	/* PNMI Event Class */
115#define	SKGE_CSUM	5	/* Checksum Event Class */
116#define	SKGE_HWAC	6	/* Hardware Access Event Class */
117
118/*
119 * define event queue as circular buffer
120 */
121#define SK_MAX_EVENT	64
122
123/*
124 * Parameter union for the Para stuff
125 */
126typedef	union u_EvPara {
127	void	*pParaPtr;	/* Parameter Pointer */
128	SK_U64	Para64;		/* Parameter 64bit version */
129	SK_U32	Para32[2];	/* Parameter Array of 32bit parameters */
130} SK_EVPARA;
131
132/*
133 * Event Queue
134 *	skqueue.c
135 * events are class/value pairs
136 *	class	is addressee, e.g. RMT, PCM etc.
137 *	value	is command, e.g. line state change, ring op change etc.
138 */
139typedef	struct s_EventElem {
140	SK_U32		Class ;			/* Event class */
141	SK_U32		Event ;			/* Event value */
142	SK_EVPARA	Para ;			/* Event parameter */
143} SK_EVENTELEM;
144
145typedef	struct s_Queue {
146	SK_EVENTELEM	EvQueue[SK_MAX_EVENT];
147	SK_EVENTELEM	*EvPut ;
148	SK_EVENTELEM	*EvGet ;
149} SK_QUEUE;
150
151extern	void SkEventInit(SK_AC *pAC, SK_IOC Ioc, int Level);
152extern	void SkEventQueue(SK_AC *pAC, SK_U32 Class, SK_U32 Event,
153	SK_EVPARA Para);
154extern	int SkEventDispatcher(SK_AC *pAC,SK_IOC Ioc);
155
156
157/* Define Error Numbers and messages */
158#define	SKERR_Q_E001	(SK_ERRBASE_QUEUE+0)
159#define	SKERR_Q_E001MSG	"Event queue overflow"
160#define	SKERR_Q_E002	(SKERR_Q_E001+1)
161#define	SKERR_Q_E002MSG	"Undefined event class"
162#endif	/* _SKQUEUE_H_ */
163
164