1 /******************************************************************************
2  *
3  * Name:	skqueue.h
4  * Project:	Gigabit Ethernet Adapters, Event Scheduler Module
5  * Purpose:	Defines for the Event queue
6  *
7  ******************************************************************************/
8 
9 /******************************************************************************
10  *
11  *	(C)Copyright 1998-2002 SysKonnect GmbH.
12  *	(C)Copyright 2002-2003 Marvell.
13  *
14  *	This program is free software; you can redistribute it and/or modify
15  *	it under the terms of the GNU General Public License as published by
16  *	the Free Software Foundation; either version 2 of the License, or
17  *	(at your option) any later version.
18  *
19  *	The information in this file is provided "AS IS" without warranty.
20  *
21  ******************************************************************************/
22 
23 #ifndef _SKQUEUE_H_
24 #define _SKQUEUE_H_
25 
26 
27 /*
28  * define the event classes to be served
29  */
30 #define	SKGE_DRV	1	/* Driver Event Class */
31 #define	SKGE_RLMT	2	/* RLMT Event Class */
32 #define	SKGE_I2C	3	/* I2C Event Class */
33 #define	SKGE_PNMI	4	/* PNMI Event Class */
34 #define	SKGE_CSUM	5	/* Checksum Event Class */
35 #define	SKGE_HWAC	6	/* Hardware Access Event Class */
36 
37 #define	SKGE_SWT	9	/* Software Timer Event Class */
38 #define	SKGE_LACP	10	/* LACP Aggregation Event Class */
39 #define	SKGE_RSF	11	/* RSF Aggregation Event Class */
40 #define	SKGE_MARKER	12	/* MARKER Aggregation Event Class */
41 #define	SKGE_FD		13	/* FD Distributor Event Class */
42 
43 /*
44  * define event queue as circular buffer
45  */
46 #define SK_MAX_EVENT	64
47 
48 /*
49  * Parameter union for the Para stuff
50  */
51 typedef	union u_EvPara {
52 	void	*pParaPtr;	/* Parameter Pointer */
53 	SK_U64	Para64;		/* Parameter 64bit version */
54 	SK_U32	Para32[2];	/* Parameter Array of 32bit parameters */
55 } SK_EVPARA;
56 
57 /*
58  * Event Queue
59  *	skqueue.c
60  * events are class/value pairs
61  *	class	is addressee, e.g. RLMT, PNMI etc.
62  *	value	is command, e.g. line state change, ring op change etc.
63  */
64 typedef	struct s_EventElem {
65 	SK_U32		Class;			/* Event class */
66 	SK_U32		Event;			/* Event value */
67 	SK_EVPARA	Para;			/* Event parameter */
68 } SK_EVENTELEM;
69 
70 typedef	struct s_Queue {
71 	SK_EVENTELEM	EvQueue[SK_MAX_EVENT];
72 	SK_EVENTELEM	*EvPut;
73 	SK_EVENTELEM	*EvGet;
74 } SK_QUEUE;
75 
76 extern	void SkEventInit(SK_AC *pAC, SK_IOC Ioc, int Level);
77 extern	void SkEventQueue(SK_AC *pAC, SK_U32 Class, SK_U32 Event,
78 	SK_EVPARA Para);
79 extern	int SkEventDispatcher(SK_AC *pAC, SK_IOC Ioc);
80 
81 
82 /* Define Error Numbers and messages */
83 #define	SKERR_Q_E001	(SK_ERRBASE_QUEUE+0)
84 #define	SKERR_Q_E001MSG	"Event queue overflow"
85 #define	SKERR_Q_E002	(SKERR_Q_E001+1)
86 #define	SKERR_Q_E002MSG	"Undefined event class"
87 #endif	/* _SKQUEUE_H_ */
88 
89