This commit was manufactured by cvs2svn to create branch 'vserver'.
[linux-2.6.git] / drivers / net / rclanmtl.h
1 /*
2 ** *************************************************************************
3 **
4 **
5 **     R C L A N M T L . H             $Revision: 6 $
6 **
7 **
8 **  RedCreek I2O LAN Message Transport Layer header file.
9 **
10 **  ---------------------------------------------------------------------
11 **  ---     Copyright (c) 1997-1999, RedCreek Communications Inc.     ---
12 **  ---                   All rights reserved.                        ---
13 **  ---------------------------------------------------------------------
14 **
15 **  File Description:
16 **
17 **  Header file for host I2O (Intelligent I/O) LAN message transport layer 
18 **  API and data types.
19 **
20 **  This program is free software; you can redistribute it and/or modify
21 **  it under the terms of the GNU General Public License as published by
22 **  the Free Software Foundation; either version 2 of the License, or
23 **  (at your option) any later version.
24
25 **  This program is distributed in the hope that it will be useful,
26 **  but WITHOUT ANY WARRANTY; without even the implied warranty of
27 **  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
28 **  GNU General Public License for more details.
29
30 **  You should have received a copy of the GNU General Public License
31 **  along with this program; if not, write to the Free Software
32 **  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
33 **
34 ** *************************************************************************
35 */
36
37 #ifndef RCLANMTL_H
38 #define RCLANMTL_H
39
40 /* Linux specific includes */
41 #include <asm/types.h>
42 #ifdef RC_LINUX_MODULE          /* linux modules need non-library version of string functions */
43 #include <linux/string.h>
44 #else
45 #include <string.h>
46 #endif
47 #include <linux/delay.h>        /* for udelay() */
48
49 #include <linux/netdevice.h>
50 #include <linux/if_ether.h>
51 #include <linux/etherdevice.h>
52 #include <linux/skbuff.h>
53
54 #include <asm/io.h>
55
56 /* Debug stuff. Define for debug output */
57 #undef RCDEBUG
58
59 #ifdef RCDEBUG
60 #define dprintk(args...) printk(KERN_DEBUG "rc: " args)
61 #else
62 #define dprintk(args...) { }
63 #endif
64
65 /* Typedefs */
66
67  /* scalar data types */
68 typedef __u8 U8;
69 typedef __u16 U16;
70 typedef __u32 U32;
71 typedef __u8 *PU8;
72 typedef __u16 *PU16;
73 typedef __u32 *PU32;
74 typedef unsigned long BF;
75 typedef int RC_RETURN;
76
77  /* 
78     ** type PFNWAITCALLBACK
79     **
80     ** pointer to void function - type used for WaitCallback in some functions 
81   */
82 typedef void (*PFNWAITCALLBACK) (void); /* void argument avoids compiler complaint */
83
84  /*
85     ** type PFNTXCALLBACK 
86     **
87     ** Pointer to user's transmit callback function.  This user function is
88     ** called from RCProcI2OMsgQ() when packet have been transmitted from buffers
89     ** given in the RCI2OSendPacket() function.  BufferContext is a pointer to
90     ** an array of 32 bit context values.  These are the values the user assigned
91     ** and passed in the TCB to the RCI2OSendPacket() function.  PcktCount
92     ** indicates the number of buffer context values in the BufferContext[] array.
93     ** The User's TransmitCallbackFunction should recover (put back in free queue)
94     ** the packet buffers associated with the buffer context values.
95   */
96 typedef void (*PFNTXCALLBACK) (U32 Status,
97                                U16 PcktCount,
98                                PU32 BufferContext, struct net_device *);
99
100  /* 
101     ** type PFNRXCALLBACK 
102     **
103     ** Pointer to user's receive callback function.  This user function
104     ** is called from RCProcI2OMsgQ() when packets have been received into
105     ** previously posted packet buffers throught the RCPostRecvBuffers() function.
106     ** The received callback function should process the Packet Descriptor Block
107     ** pointed to by PacketDescBlock. See Packet Decription Block below.
108   */
109 typedef void (*PFNRXCALLBACK) (U32 Status,
110                                U8 PktCount,
111                                U32 BucketsRemain,
112                                PU32 PacketDescBlock, struct net_device *);
113
114  /* 
115     ** type PFNCALLBACK 
116     **
117     ** Pointer to user's generic callback function.  This user function
118     ** can be passed to LANReset or LANShutdown and is called when the 
119     ** the reset or shutdown is complete.
120     ** Param1 and Param2 are invalid for LANReset and LANShutdown.
121   */
122 typedef void (*PFNCALLBACK) (U32 Status,
123                              U32 Param1, U32 Param2, struct net_device * dev);
124
125 /*
126 **  Message Unit CSR definitions for RedCreek PCI45 board
127 */
128 typedef struct tag_rcatu {
129         volatile unsigned long APICRegSel;      /* APIC Register Select */
130         volatile unsigned long reserved0;
131         volatile unsigned long APICWinReg;      /* APIC Window Register */
132         volatile unsigned long reserved1;
133         volatile unsigned long InMsgReg0;       /* inbound message register 0 */
134         volatile unsigned long InMsgReg1;       /* inbound message register 1 */
135         volatile unsigned long OutMsgReg0;      /* outbound message register 0 */
136         volatile unsigned long OutMsgReg1;      /* outbound message register 1 */
137         volatile unsigned long InDoorReg;       /* inbound doorbell register */
138         volatile unsigned long InIntStat;       /* inbound interrupt status register */
139         volatile unsigned long InIntMask;       /* inbound interrupt mask register */
140         volatile unsigned long OutDoorReg;      /* outbound doorbell register */
141         volatile unsigned long OutIntStat;      /* outbound interrupt status register */
142         volatile unsigned long OutIntMask;      /* outbound interrupt mask register */
143         volatile unsigned long reserved2;
144         volatile unsigned long reserved3;
145         volatile unsigned long InQueue; /* inbound queue port */
146         volatile unsigned long OutQueue;        /* outbound queue port */
147         volatile unsigned long reserved4;
148         volatile unsigned long reserver5;
149         /* RedCreek extension */
150         volatile unsigned long EtherMacLow;
151         volatile unsigned long EtherMacHi;
152         volatile unsigned long IPaddr;
153         volatile unsigned long IPmask;
154 } *PATU;
155
156  /* 
157     ** typedef PAB
158     **
159     ** PCI Adapter Block - holds instance specific information.
160   */
161 typedef struct {
162         PATU p_atu;             /* ptr to  ATU register block */
163         PU8 pPci45LinBaseAddr;
164         PU8 pLinOutMsgBlock;
165         U32 outMsgBlockPhyAddr;
166         PFNTXCALLBACK pTransCallbackFunc;
167         PFNRXCALLBACK pRecvCallbackFunc;
168         PFNCALLBACK pRebootCallbackFunc;
169         PFNCALLBACK pCallbackFunc;
170         U16 IOPState;
171         U16 InboundMFrameSize;
172 } *PPAB;
173
174 /*
175  * Driver Private Area, DPA.
176  */
177 typedef struct {
178         U8 id;                  /* the AdapterID */
179
180         /* These two field are basically for the RCioctl function.
181          * I could not determine if they could be avoided. (RAA)*/
182         U32 pci_addr;           /* the pci address of the adapter */
183         U32 pci_addr_len;
184
185         struct pci_dev *pci_dev;
186         struct timer_list timer;        /*  timer */
187         struct net_device_stats stats;  /* the statistics structure */
188         unsigned long numOutRcvBuffers; /* number of outstanding receive buffers */
189         unsigned char shutdown;
190         unsigned char reboot;
191         unsigned char nexus;
192         PU8 msgbuf;             /* Pointer to Lan Api Private Area */
193         dma_addr_t msgbuf_dma;
194         PPAB pPab;              /* Pointer to the PCI Adapter Block */
195 } *PDPA;
196
197 /* PCI/45 Configuration space values */
198 #define RC_PCI45_VENDOR_ID  0x4916
199 #define RC_PCI45_DEVICE_ID  0x1960
200
201  /* RedCreek API function return values */
202 #define RC_RTN_NO_ERROR             0
203 #define RC_RTN_I2O_NOT_INIT         1
204 #define RC_RTN_FREE_Q_EMPTY         2
205 #define RC_RTN_TCB_ERROR            3
206 #define RC_RTN_TRANSACTION_ERROR    4
207 #define RC_RTN_ADAPTER_ALREADY_INIT 5
208 #define RC_RTN_MALLOC_ERROR         6
209 #define RC_RTN_ADPTR_NOT_REGISTERED 7
210 #define RC_RTN_MSG_REPLY_TIMEOUT    8
211 #define RC_RTN_NO_I2O_STATUS        9
212 #define RC_RTN_NO_FIRM_VER         10
213 #define RC_RTN_NO_LINK_SPEED       11
214
215 /* Driver capability flags */
216 #define WARM_REBOOT_CAPABLE      0x01
217
218 /*
219 ** Status - Transmit and Receive callback status word 
220 **
221 ** A 32 bit Status is returned to the TX and RX callback functions.  This value
222 ** contains both the reply status and the detailed status as follows:
223 **
224 **  32    24     16            0
225 **  +------+------+------------+
226 **  | Reply|      |  Detailed  |
227 **  |Status|   0  |   Status   |
228 **  +------+------+------------+
229 **
230 ** Reply Status and Detailed Status of zero indicates No Errors.
231 */
232  /* reply message status defines */
233 #define    I2O_REPLY_STATUS_SUCCESS                    0x00
234 #define    I2O_REPLY_STATUS_ABORT_NO_DATA_TRANSFER     0x02
235 #define    I2O_REPLY_STATUS_TRANSACTION_ERROR          0x0A
236
237 /* DetailedStatusCode defines */
238 #define    I2O_LAN_DSC_SUCCESS                         0x0000
239 #define    I2O_LAN_DSC_DEVICE_FAILURE                  0x0001
240 #define    I2O_LAN_DSC_DESTINATION_NOT_FOUND           0x0002
241 #define    I2O_LAN_DSC_TRANSMIT_ERROR                  0x0003
242 #define    I2O_LAN_DSC_TRANSMIT_ABORTED                0x0004
243 #define    I2O_LAN_DSC_RECEIVE_ERROR                   0x0005
244 #define    I2O_LAN_DSC_RECEIVE_ABORTED                 0x0006
245 #define    I2O_LAN_DSC_DMA_ERROR                       0x0007
246 #define    I2O_LAN_DSC_BAD_PACKET_DETECTED             0x0008
247 #define    I2O_LAN_DSC_OUT_OF_MEMORY                   0x0009
248 #define    I2O_LAN_DSC_BUCKET_OVERRUN                  0x000A
249 #define    I2O_LAN_DSC_IOP_INTERNAL_ERROR              0x000B
250 #define    I2O_LAN_DSC_CANCELED                        0x000C
251 #define    I2O_LAN_DSC_INVALID_TRANSACTION_CONTEXT     0x000D
252 #define    I2O_LAN_DSC_DESTINATION_ADDRESS_DETECTED    0x000E
253 #define    I2O_LAN_DSC_DESTINATION_ADDRESS_OMITTED     0x000F
254 #define    I2O_LAN_DSC_PARTIAL_PACKET_RETURNED         0x0010
255
256 /*
257 ** Packet Description Block   (Received packets)
258 **
259 ** A pointer to this block structure is returned to the ReceiveCallback 
260 ** function.  It contains the list of packet buffers which have either been
261 ** filled with a packet or returned to host due to a LANReset function. 
262 ** Currently there will only be one packet per receive bucket (buffer) posted. 
263 **
264 **   32   24               0     
265 **  +-----------------------+  -\
266 **  |   Buffer 1 Context    |    \
267 **  +-----------------------+     \
268 **  |      0xC0000000       |     / First Bucket Descriptor
269 **  +-----+-----------------+    /
270 **  |  0  | packet 1 length |   / 
271 **  +-----------------------+  -\
272 **  |   Buffer 2 Context    |    \
273 **  +-----------------------+     \
274 **  |      0xC0000000       |     / Second Bucket Descriptor
275 **  +-----+-----------------+    /
276 **  |  0  | packet 2 length |   / 
277 **  +-----+-----------------+  -
278 **  |         ...           |  ----- more bucket descriptors
279 **  +-----------------------+  -\
280 **  |   Buffer n Context    |    \
281 **  +-----------------------+     \
282 **  |      0xC0000000       |     / Last Bucket Descriptor
283 **  +-----+-----------------+    /
284 **  |  0  | packet n length |   / 
285 **  +-----+-----------------+  -
286 **
287 ** Buffer Context values are those given to adapter in the TCB on calls to
288 ** RCPostRecvBuffers().
289 **  
290 */
291
292 /*
293 ** Transaction Control Block (TCB) structure
294 **
295 ** A structure like this is filled in by the user and passed by reference to 
296 ** RCI2OSendPacket() and RCPostRecvBuffers() functions.  Minimum size is five
297 ** 32-bit words for one buffer with one segment descriptor.  
298 ** MAX_NMBR_POST_BUFFERS_PER_MSG defines the maximum single segment buffers
299 ** that can be described in a given TCB.
300 **
301 **   32                    0
302 **  +-----------------------+
303 **  |   Buffer Count        |  Number of buffers in the TCB
304 **  +-----------------------+
305 **  |   Buffer 1 Context    |  first buffer reference
306 **  +-----------------------+
307 **  |   Buffer 1 Seg Count  |  number of segments in buffer
308 **  +-----------------------+
309 **  |   Buffer 1 Seg Desc 1 |  first segment descriptor (size, physical address)
310 **  +-----------------------+
311 **  |         ...           |  more segment descriptors (size, physical address)
312 **  +-----------------------+
313 **  |   Buffer 1 Seg Desc n |  last segment descriptor (size, physical address)
314 **  +-----------------------+
315 **  |   Buffer 2 Context    |  second buffer reference
316 **  +-----------------------+
317 **  |   Buffer 2 Seg Count  |  number of segments in buffer
318 **  +-----------------------+
319 **  |   Buffer 2 Seg Desc 1 |  segment descriptor (size, physical address)
320 **  +-----------------------+
321 **  |         ...           |  more segment descriptors (size, physical address)
322 **  +-----------------------+
323 **  |   Buffer 2 Seg Desc n |
324 **  +-----------------------+
325 **  |         ...           |  more buffer descriptor blocks ...
326 **  +-----------------------+
327 **  |   Buffer n Context    |
328 **  +-----------------------+
329 **  |   Buffer n Seg Count  |
330 **  +-----------------------+
331 **  |   Buffer n Seg Desc 1 |
332 **  +-----------------------+
333 **  |         ...           |
334 **  +-----------------------+
335 **  |   Buffer n Seg Desc n |
336 **  +-----------------------+
337 **
338 **
339 ** A TCB for one contigous packet buffer would look like the following:
340 **
341 **   32                    0
342 **  +-----------------------+
343 **  |         1             |  one buffer in the TCB
344 **  +-----------------------+
345 **  |  <user's Context>     |  user's buffer reference
346 **  +-----------------------+
347 **  |         1             |  one segment buffer
348 **  +-----------------------+                            _
349 **  |    <buffer size>      |  size                       \ 
350 **  +-----------------------+                              \ segment descriptor
351 **  |  <physical address>   |  physical address of buffer  /
352 **  +-----------------------+                            _/
353 **
354 */
355
356  /* Buffer Segment Descriptor */
357 typedef struct {
358         U32 size;
359         U32 phyAddress;
360 } BSD, *PBSD;
361
362 typedef PU32 PRCTCB;
363 /*
364 ** -------------------------------------------------------------------------
365 ** Exported functions comprising the API to the LAN I2O message transport layer
366 ** -------------------------------------------------------------------------
367 */
368
369  /*
370     ** InitRCI2OMsgLayer()
371     ** 
372     ** Called once prior to using the I2O LAN message transport layer.  User 
373     ** provides both the physical and virual address of a locked page buffer 
374     ** that is used as a private buffer for the RedCreek I2O message
375     ** transport layer.  This buffer must be a contigous memory block of a 
376     ** minimum of 16K bytes and long word aligned.  The user also must provide
377     ** the base address of the RedCreek PCI adapter assigned by BIOS or operating
378     ** system.  
379     **
380     ** Inputs:  dev - the net_device struct for the device.
381     **          TransmitCallbackFunction - address of user's TX callback function
382     **          ReceiveCallbackFunction  - address of user's RX callback function
383     **          RebootCallbackFunction  - address of user's reboot callback function
384     **
385   */
386 RC_RETURN RCInitI2OMsgLayer (struct net_device *dev,
387                              PFNTXCALLBACK TransmitCallbackFunction,
388                              PFNRXCALLBACK ReceiveCallbackFunction,
389                              PFNCALLBACK RebootCallbackFunction);
390
391  /*
392     ** RCSetRavlinIPandMask()
393     **
394     ** Set the Ravlin 45/PCI cards IP address and network mask.
395     **
396     ** IP address and mask must be in network byte order.
397     ** For example, IP address 1.2.3.4 and mask 255.255.255.0 would be
398     ** 0x04030201 and 0x00FFFFFF on a little endian machine.
399     **
400   */
401 RC_RETURN RCSetRavlinIPandMask (struct net_device *dev, U32 ipAddr,
402                                 U32 netMask);
403
404 /*
405 ** =========================================================================
406 ** RCGetRavlinIPandMask()
407 **
408 ** get the IP address and MASK from the card
409 ** 
410 ** =========================================================================
411 */
412 RC_RETURN
413 RCGetRavlinIPandMask (struct net_device *dev, PU32 pIpAddr, PU32 pNetMask,
414                       PFNWAITCALLBACK WaitCallback);
415
416  /* 
417     ** RCProcI2OMsgQ()
418     ** 
419     ** Called from user's polling loop or Interrupt Service Routine for a PCI 
420     ** interrupt from the RedCreek PCI adapter.  User responsible for determining
421     ** and hooking the PCI interrupt. This function will call the registered
422     ** callback functions, TransmitCallbackFunction or ReceiveCallbackFunction,
423     ** if a TX or RX transaction has completed.
424   */
425 irqreturn_t RCProcI2OMsgQ (struct net_device *dev);
426
427  /*
428     ** Disable and Enable I2O interrupts.  I2O interrupts are enabled at Init time
429     ** but can be disabled and re-enabled through these two function calls.
430     ** Packets will still be put into any posted received buffers and packets will
431     ** be sent through RCI2OSendPacket() functions.  Disabling I2O interrupts
432     ** will prevent hardware interrupt to host even though the outbound I2O msg
433     ** queue is not emtpy.
434   */
435 RC_RETURN RCEnableI2OInterrupts (struct net_device *dev);
436 RC_RETURN RCDisableI2OInterrupts (struct net_device *dev);
437
438  /* 
439     ** RCPostRecvBuffers()
440     ** 
441     ** Post user's page locked buffers for use by the PCI adapter to
442     ** return ethernet packets received from the LAN.  Transaction Control Block,
443     ** provided by user, contains buffer descriptor(s) which includes a buffer
444     ** context number along with buffer size and physical address.  See TCB above.
445     ** The buffer context and actual packet length are returned to the 
446     ** ReceiveCallbackFunction when packets have been received.  Buffers posted
447     ** to the RedCreek adapter are considered owned by the adapter until the
448     ** context is return to user through the ReceiveCallbackFunction.
449   */
450 RC_RETURN RCPostRecvBuffers (struct net_device *dev,
451                              PRCTCB pTransactionCtrlBlock);
452 #define MAX_NMBR_POST_BUFFERS_PER_MSG 32
453
454  /*
455     ** RCI2OSendPacket()
456     ** 
457     ** Send user's ethernet packet from a locked page buffer.  
458     ** Packet must have full MAC header, however without a CRC.  
459     ** Initiator context is a user provided value that is returned 
460     ** to the TransmitCallbackFunction when packet buffer is free.
461     ** Transmit buffer are considered owned by the adapter until context's
462     ** returned to user through the TransmitCallbackFunction.
463   */
464 RC_RETURN RCI2OSendPacket (struct net_device *dev,
465                            U32 context, PRCTCB pTransactionCtrlBlock);
466
467  /* Ethernet Link Statistics structure */
468 typedef struct tag_RC_link_stats {
469         U32 TX_good;            /* good transmit frames */
470         U32 TX_maxcol;          /* frames not TX due to MAX collisions */
471         U32 TX_latecol;         /* frames not TX due to late collisions */
472         U32 TX_urun;            /* frames not TX due to DMA underrun */
473         U32 TX_crs;             /* frames TX with lost carrier sense */
474         U32 TX_def;             /* frames deferred due to activity on link */
475         U32 TX_singlecol;       /* frames TX with one and only on collision */
476         U32 TX_multcol;         /* frames TX with more than one collision */
477         U32 TX_totcol;          /* total collisions detected during TX */
478         U32 Rcv_good;           /* good frames received */
479         U32 Rcv_CRCerr;         /* frames RX and discarded with CRC errors */
480         U32 Rcv_alignerr;       /* frames RX with alignment and CRC errors */
481         U32 Rcv_reserr;         /* good frames discarded due to no RX buffer */
482         U32 Rcv_orun;           /* RX frames lost due to FIFO overrun */
483         U32 Rcv_cdt;            /* RX frames with collision during RX */
484         U32 Rcv_runt;           /* RX frames shorter than 64 bytes */
485 } RCLINKSTATS, *P_RCLINKSTATS;
486
487  /*
488     ** RCGetLinkStatistics()
489     **
490     ** Returns link statistics in user's structure at address StatsReturnAddr
491     ** If given, not NULL, the function WaitCallback is called during the wait
492     ** loop while waiting for the adapter to respond.
493   */
494 RC_RETURN RCGetLinkStatistics (struct net_device *dev,
495                                P_RCLINKSTATS StatsReturnAddr,
496                                PFNWAITCALLBACK WaitCallback);
497
498  /*
499     ** RCGetLinkStatus()
500     **
501     ** Return link status, up or down, to user's location addressed by ReturnAddr.
502     ** If given, not NULL, the function WaitCallback is called during the wait
503     ** loop while waiting for the adapter to respond.
504   */
505 RC_RETURN RCGetLinkStatus (struct net_device *dev,
506                            PU32 pReturnStatus, PFNWAITCALLBACK WaitCallback);
507
508  /* Link Status defines - value returned in pReturnStatus */
509 #define RC_LAN_LINK_STATUS_DOWN     0
510 #define RC_LAN_LINK_STATUS_UP       1
511
512  /*
513     ** RCGetMAC()
514     **
515     ** Get the current MAC address assigned to user.  RedCreek Ravlin 45/PCI 
516     ** has two MAC addresses.  One which is private to the PCI Card, and 
517     ** another MAC which is given to the user as its link layer MAC address. The
518     ** adapter runs in promiscous mode because of the dual address requirement.
519     ** The MAC address is returned to the unsigned char array pointer to by mac.
520   */
521 RC_RETURN RCGetMAC (struct net_device *dev, PFNWAITCALLBACK WaitCallback);
522
523  /*
524     ** RCSetMAC()
525     **
526     ** Set a new user port MAC address.  This address will be returned on
527     ** subsequent RCGetMAC() calls.
528   */
529 RC_RETURN RCSetMAC (struct net_device *dev, PU8 mac);
530
531  /*
532     ** RCSetLinkSpeed()
533     **
534     ** set adapter's link speed based on given input code.
535   */
536 RC_RETURN RCSetLinkSpeed (struct net_device *dev, U16 LinkSpeedCode);
537  /* Set link speed codes */
538 #define LNK_SPD_AUTO_NEG_NWAY   0
539 #define LNK_SPD_100MB_FULL      1
540 #define LNK_SPD_100MB_HALF      2
541 #define LNK_SPD_10MB_FULL       3
542 #define LNK_SPD_10MB_HALF       4
543
544  /*
545     ** RCGetLinkSpeed()
546     **
547     ** Return link speed code.
548   */
549  /* Return link speed codes */
550 #define LNK_SPD_UNKNOWN         0
551 #define LNK_SPD_100MB_FULL      1
552 #define LNK_SPD_100MB_HALF      2
553 #define LNK_SPD_10MB_FULL       3
554 #define LNK_SPD_10MB_HALF       4
555
556 RC_RETURN
557 RCGetLinkSpeed (struct net_device *dev, PU32 pLinkSpeedCode,
558                 PFNWAITCALLBACK WaitCallback);
559 /*
560 ** =========================================================================
561 ** RCSetPromiscuousMode(struct net_device *dev, U16 Mode)
562 **
563 ** Defined values for Mode:
564 **  0 - turn off promiscuous mode
565 **  1 - turn on  promiscuous mode
566 **
567 ** =========================================================================
568 */
569 #define PROMISCUOUS_MODE_OFF 0
570 #define PROMISCUOUS_MODE_ON  1
571 RC_RETURN RCSetPromiscuousMode (struct net_device *dev, U16 Mode);
572 /*
573 ** =========================================================================
574 ** RCGetPromiscuousMode(struct net_device *dev, PU32 pMode, PFNWAITCALLBACK WaitCallback)
575 **
576 ** get promiscuous mode setting
577 **
578 ** Possible return values placed in pMode:
579 **  0 = promisuous mode not set
580 **  1 = promisuous mode is set
581 **
582 ** =========================================================================
583 */
584 RC_RETURN
585 RCGetPromiscuousMode (struct net_device *dev, PU32 pMode,
586                       PFNWAITCALLBACK WaitCallback);
587
588 /*
589 ** =========================================================================
590 ** RCSetBroadcastMode(struct net_device *dev, U16 Mode)
591 **
592 ** Defined values for Mode:
593 **  0 - turn off promiscuous mode
594 **  1 - turn on  promiscuous mode
595 **
596 ** =========================================================================
597 */
598 #define BROADCAST_MODE_OFF 0
599 #define BROADCAST_MODE_ON  1
600 RC_RETURN RCSetBroadcastMode (struct net_device *dev, U16 Mode);
601 /*
602 ** =========================================================================
603 ** RCGetBroadcastMode(struct net_device *dev, PU32 pMode, PFNWAITCALLBACK WaitCallback)
604 **
605 ** get broadcast mode setting
606 **
607 ** Possible return values placed in pMode:
608 **  0 = broadcast mode not set
609 **  1 = broadcast mode is set
610 **
611 ** =========================================================================
612 */
613 RC_RETURN
614 RCGetBroadcastMode (struct net_device *dev, PU32 pMode,
615                     PFNWAITCALLBACK WaitCallback);
616 /*
617 ** =========================================================================
618 ** RCReportDriverCapability(struct net_device *dev, U32 capability)
619 **
620 ** Currently defined bits:
621 ** WARM_REBOOT_CAPABLE   0x01
622 **
623 ** =========================================================================
624 */
625 RC_RETURN RCReportDriverCapability (struct net_device *dev, U32 capability);
626
627 /*
628 ** RCGetFirmwareVer()
629 **
630 ** Return firmware version in the form "SoftwareVersion : Bt BootVersion"
631 **
632 ** WARNING: user's space pointed to by pFirmString should be at least 60 bytes.
633 */
634 RC_RETURN
635 RCGetFirmwareVer (struct net_device *dev, PU8 pFirmString,
636                   PFNWAITCALLBACK WaitCallback);
637
638 /*
639 ** ----------------------------------------------
640 ** LAN adapter Reset and Shutdown functions
641 ** ----------------------------------------------
642 */
643  /* resource flag bit assignments for RCResetLANCard() & RCShutdownLANCard() */
644 #define RC_RESOURCE_RETURN_POSTED_RX_BUCKETS  0x0001
645 #define RC_RESOURCE_RETURN_PEND_TX_BUFFERS    0x0002
646
647  /*
648     ** RCResetLANCard()
649     **
650     ** Reset LAN card operation.  Causes a software reset of the ethernet
651     ** controller and restarts the command and receive units. Depending on 
652     ** the ResourceFlags given, the buffers are either returned to the
653     ** host with reply status of I2O_REPLY_STATUS_ABORT_NO_DATA_TRANSFER and
654     ** detailed status of I2O_LAN_DSC_CANCELED (new receive buffers must be
655     ** posted after issuing this) OR the buffers are kept and reused by
656     ** the ethernet controller. If CallbackFunction is not NULL, the function
657     ** will be called when the reset is complete.  If the CallbackFunction is
658     ** NULL,a 1 will be put into the ReturnAddr after waiting for the reset 
659     ** to complete (please disable I2O interrupts during this method).
660     ** Any outstanding transmit or receive buffers that are complete will be
661     ** returned via the normal reply messages before the requested resource
662     ** buffers are returned.
663     ** A call to RCPostRecvBuffers() is needed to return the ethernet to full
664     ** operation if the receive buffers were returned during LANReset.
665     ** Note: The IOP status is not affected by a LAN reset.
666   */
667 RC_RETURN RCResetLANCard (struct net_device *dev, U16 ResourceFlags,
668                           PU32 ReturnAddr, PFNCALLBACK CallbackFunction);
669
670  /*
671     ** RCShutdownLANCard()
672     **
673     ** Shutdown LAN card operation and put into an idle (suspended) state.
674     ** The LAN card is restarted with RCResetLANCard() function.
675     ** Depending on the ResourceFlags given, the buffers are either returned 
676     ** to the host with reply status of I2O_REPLY_STATUS_ABORT_NO_DATA_TRANSFER 
677     ** and detailed status of I2O_LAN_DSC_CANCELED (new receive buffers must be
678     ** posted after issuing this) OR the buffers are kept and reused by
679     ** the ethernet controller. If CallbackFunction is not NULL, the function
680     ** will be called when the reset is complete.  If the CallbackFunction is
681     ** NULL,a 1 will be put into the ReturnAddr after waiting for the reset 
682     ** to complete (please disable I2O interrupts during this method).
683     ** Any outstanding transmit or receive buffers that are complete will be
684     ** returned via the normal reply messages before the requested resource
685     ** buffers are returned.
686     ** Note: The IOP status is not affected by a LAN shutdown.
687   */
688 RC_RETURN
689 RCShutdownLANCard (struct net_device *dev, U16 ResourceFlags, PU32 ReturnAddr,
690                    PFNCALLBACK CallbackFunction);
691
692  /*
693     ** RCResetIOP();
694     **     Initializes IOPState to I2O_IOP_STATE_RESET.
695     **     Stops access to outbound message Q.
696     **     Discards any outstanding transmit or posted receive buffers.
697     **     Clears outbound message Q. 
698   */
699 RC_RETURN RCResetIOP (struct net_device *dev);
700
701 #endif                          /* RCLANMTL_H */