blob: 2bafd6e3eb82c7a714ff7fe740c644e47f6ca31b [file] [log] [blame]
wdenkeb20ad32003-09-05 23:19:14 +00001/******************************************************************************
2 *
3 * Name: skqueue.h
4 * Project: GEnesis, PCI Gigabit Ethernet Adapter
5 * Version: $Revision: 1.14 $
6 * Date: $Date: 2002/03/15 10:52:13 $
7 * Purpose: Defines for the Event queue
8 *
9 ******************************************************************************/
10
11/******************************************************************************
12 *
13 * (C)Copyright 1998,1999 SysKonnect,
14 * a business unit of Schneider & Koch & Co. Datensysteme GmbH.
15 *
16 * This program is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License as published by
18 * the Free Software Foundation; either version 2 of the License, or
19 * (at your option) any later version.
20 *
21 * The information in this file is provided "AS IS" without warranty.
22 *
23 ******************************************************************************/
24
25/******************************************************************************
26 *
27 * History:
28 *
29 * $Log: skqueue.h,v $
30 * Revision 1.14 2002/03/15 10:52:13 mkunz
31 * Added event classes for link aggregation
32 *
33 * Revision 1.13 1999/11/22 13:59:05 cgoos
34 * Changed license header to GPL.
35 *
36 * Revision 1.12 1998/09/08 08:48:01 gklug
37 * add: init level handling
38 *
39 * Revision 1.11 1998/09/03 14:15:11 gklug
40 * add: CSUM and HWAC Eventclass and function.
41 * fix: pParaPtr according to CCC
42 *
43 * Revision 1.10 1998/08/20 12:43:03 gklug
44 * add: typedef SK_QUEUE
45 *
46 * Revision 1.9 1998/08/19 09:50:59 gklug
47 * fix: remove struct keyword from c-code (see CCC) add typedefs
48 *
49 * Revision 1.8 1998/08/18 07:00:01 gklug
50 * fix: SK_PTR not defined use void * instead.
51 *
52 * Revision 1.7 1998/08/17 13:43:19 gklug
53 * chg: Parameter will be union of 64bit para, 2 times SK_U32 or SK_PTR
54 *
55 * Revision 1.6 1998/08/14 07:09:30 gklug
56 * fix: chg pAc -> pAC
57 *
58 * Revision 1.5 1998/08/11 14:26:44 gklug
59 * chg: Event Dispatcher returns now int.
60 *
61 * Revision 1.4 1998/08/11 12:15:21 gklug
62 * add: Error numbers of skqueue module
63 *
64 * Revision 1.3 1998/08/07 12:54:23 gklug
65 * fix: first compiled version
66 *
67 * Revision 1.2 1998/08/07 09:34:00 gklug
68 * adapt structure defs to CCC
69 * add: prototypes for functions
70 *
71 * Revision 1.1 1998/07/30 14:52:12 gklug
72 * Initial version.
73 * Defines Event Classes, Event structs and queue management variables.
74 *
75 *
76 *
77 ******************************************************************************/
78
79/*
80 * SKQUEUE.H contains all defines and types for the event queue
81 */
82
83#ifndef _SKQUEUE_H_
84#define _SKQUEUE_H_
85
86
87/*
88 * define the event classes to be served
89 */
90#define SKGE_DRV 1 /* Driver Event Class */
91#define SKGE_RLMT 2 /* RLMT Event Class */
92#define SKGE_I2C 3 /* i2C Event Class */
93#define SKGE_PNMI 4 /* PNMI Event Class */
94#define SKGE_CSUM 5 /* Checksum Event Class */
95#define SKGE_HWAC 6 /* Hardware Access Event Class */
96
97#define SKGE_SWT 9 /* Software Timer Event Class */
98#define SKGE_LACP 10 /* LACP Aggregation Event Class */
99#define SKGE_RSF 11 /* RSF Aggregation Event Class */
100#define SKGE_MARKER 12 /* MARKER Aggregation Event Class */
101#define SKGE_FD 13 /* FD Distributor Event Class */
102
103/*
104 * define event queue as circular buffer
105 */
106#define SK_MAX_EVENT 64
107
108/*
109 * Parameter union for the Para stuff
110 */
111typedef union u_EvPara {
112 void *pParaPtr; /* Parameter Pointer */
113 SK_U64 Para64; /* Parameter 64bit version */
114 SK_U32 Para32[2]; /* Parameter Array of 32bit parameters */
115} SK_EVPARA;
116
117/*
118 * Event Queue
119 * skqueue.c
120 * events are class/value pairs
121 * class is addressee, e.g. RMT, PCM etc.
122 * value is command, e.g. line state change, ring op change etc.
123 */
124typedef struct s_EventElem {
125 SK_U32 Class ; /* Event class */
126 SK_U32 Event ; /* Event value */
127 SK_EVPARA Para ; /* Event parameter */
128} SK_EVENTELEM;
129
130typedef struct s_Queue {
131 SK_EVENTELEM EvQueue[SK_MAX_EVENT];
132 SK_EVENTELEM *EvPut ;
133 SK_EVENTELEM *EvGet ;
134} SK_QUEUE;
135
136extern void SkEventInit(SK_AC *pAC, SK_IOC Ioc, int Level);
137extern void SkEventQueue(SK_AC *pAC, SK_U32 Class, SK_U32 Event,
138 SK_EVPARA Para);
139extern int SkEventDispatcher(SK_AC *pAC,SK_IOC Ioc);
140
141
142/* Define Error Numbers and messages */
143#define SKERR_Q_E001 (SK_ERRBASE_QUEUE+0)
144#define SKERR_Q_E001MSG "Event queue overflow"
145#define SKERR_Q_E002 (SKERR_Q_E001+1)
146#define SKERR_Q_E002MSG "Undefined event class"
147#endif /* _SKQUEUE_H_ */
148