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