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("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 timer_list timer;	/*  timer */
186 	struct net_device_stats stats;	/* the statistics structure */
187 	unsigned long numOutRcvBuffers;	/* number of outstanding receive buffers */
188 	unsigned char shutdown;
189 	unsigned char reboot;
190 	unsigned char nexus;
191 	PU8 msgbuf;		/* Pointer to Lan Api Private Area */
192 	PU8 PLanApiPA;		/* Pointer to Lan Api Private Area (aligned) */
193 	PPAB pPab;		/* Pointer to the PCI Adapter Block */
194 } *PDPA;
195 
196 /* PCI/45 Configuration space values */
197 #define RC_PCI45_VENDOR_ID  0x4916
198 #define RC_PCI45_DEVICE_ID  0x1960
199 
200  /* RedCreek API function return values */
201 #define RC_RTN_NO_ERROR             0
202 #define RC_RTN_I2O_NOT_INIT         1
203 #define RC_RTN_FREE_Q_EMPTY         2
204 #define RC_RTN_TCB_ERROR            3
205 #define RC_RTN_TRANSACTION_ERROR    4
206 #define RC_RTN_ADAPTER_ALREADY_INIT 5
207 #define RC_RTN_MALLOC_ERROR         6
208 #define RC_RTN_ADPTR_NOT_REGISTERED 7
209 #define RC_RTN_MSG_REPLY_TIMEOUT    8
210 #define RC_RTN_NO_I2O_STATUS        9
211 #define RC_RTN_NO_FIRM_VER         10
212 #define RC_RTN_NO_LINK_SPEED       11
213 
214 /* Driver capability flags */
215 #define WARM_REBOOT_CAPABLE      0x01
216 
217 /*
218 ** Status - Transmit and Receive callback status word
219 **
220 ** A 32 bit Status is returned to the TX and RX callback functions.  This value
221 ** contains both the reply status and the detailed status as follows:
222 **
223 **  32    24     16            0
224 **  +------+------+------------+
225 **  | Reply|      |  Detailed  |
226 **  |Status|   0  |   Status   |
227 **  +------+------+------------+
228 **
229 ** Reply Status and Detailed Status of zero indicates No Errors.
230 */
231  /* reply message status defines */
232 #define    I2O_REPLY_STATUS_SUCCESS                    0x00
233 #define    I2O_REPLY_STATUS_ABORT_NO_DATA_TRANSFER     0x02
234 #define    I2O_REPLY_STATUS_TRANSACTION_ERROR          0x0A
235 
236 /* DetailedStatusCode defines */
237 #define    I2O_LAN_DSC_SUCCESS                         0x0000
238 #define    I2O_LAN_DSC_DEVICE_FAILURE                  0x0001
239 #define    I2O_LAN_DSC_DESTINATION_NOT_FOUND           0x0002
240 #define    I2O_LAN_DSC_TRANSMIT_ERROR                  0x0003
241 #define    I2O_LAN_DSC_TRANSMIT_ABORTED                0x0004
242 #define    I2O_LAN_DSC_RECEIVE_ERROR                   0x0005
243 #define    I2O_LAN_DSC_RECEIVE_ABORTED                 0x0006
244 #define    I2O_LAN_DSC_DMA_ERROR                       0x0007
245 #define    I2O_LAN_DSC_BAD_PACKET_DETECTED             0x0008
246 #define    I2O_LAN_DSC_OUT_OF_MEMORY                   0x0009
247 #define    I2O_LAN_DSC_BUCKET_OVERRUN                  0x000A
248 #define    I2O_LAN_DSC_IOP_INTERNAL_ERROR              0x000B
249 #define    I2O_LAN_DSC_CANCELED                        0x000C
250 #define    I2O_LAN_DSC_INVALID_TRANSACTION_CONTEXT     0x000D
251 #define    I2O_LAN_DSC_DESTINATION_ADDRESS_DETECTED    0x000E
252 #define    I2O_LAN_DSC_DESTINATION_ADDRESS_OMITTED     0x000F
253 #define    I2O_LAN_DSC_PARTIAL_PACKET_RETURNED         0x0010
254 
255 /*
256 ** Packet Description Block   (Received packets)
257 **
258 ** A pointer to this block structure is returned to the ReceiveCallback
259 ** function.  It contains the list of packet buffers which have either been
260 ** filled with a packet or returned to host due to a LANReset function.
261 ** Currently there will only be one packet per receive bucket (buffer) posted.
262 **
263 **   32   24               0
264 **  +-----------------------+  -\
265 **  |   Buffer 1 Context    |    \
266 **  +-----------------------+     \
267 **  |      0xC0000000       |     / First Bucket Descriptor
268 **  +-----+-----------------+    /
269 **  |  0  | packet 1 length |   /
270 **  +-----------------------+  -\
271 **  |   Buffer 2 Context    |    \
272 **  +-----------------------+     \
273 **  |      0xC0000000       |     / Second Bucket Descriptor
274 **  +-----+-----------------+    /
275 **  |  0  | packet 2 length |   /
276 **  +-----+-----------------+  -
277 **  |         ...           |  ----- more bucket descriptors
278 **  +-----------------------+  -\
279 **  |   Buffer n Context    |    \
280 **  +-----------------------+     \
281 **  |      0xC0000000       |     / Last Bucket Descriptor
282 **  +-----+-----------------+    /
283 **  |  0  | packet n length |   /
284 **  +-----+-----------------+  -
285 **
286 ** Buffer Context values are those given to adapter in the TCB on calls to
287 ** RCPostRecvBuffers().
288 **
289 */
290 
291 /*
292 ** Transaction Control Block (TCB) structure
293 **
294 ** A structure like this is filled in by the user and passed by reference to
295 ** RCI2OSendPacket() and RCPostRecvBuffers() functions.  Minimum size is five
296 ** 32-bit words for one buffer with one segment descriptor.
297 ** MAX_NMBR_POST_BUFFERS_PER_MSG defines the maximum single segment buffers
298 ** that can be described in a given TCB.
299 **
300 **   32                    0
301 **  +-----------------------+
302 **  |   Buffer Count        |  Number of buffers in the TCB
303 **  +-----------------------+
304 **  |   Buffer 1 Context    |  first buffer reference
305 **  +-----------------------+
306 **  |   Buffer 1 Seg Count  |  number of segments in buffer
307 **  +-----------------------+
308 **  |   Buffer 1 Seg Desc 1 |  first segment descriptor (size, physical address)
309 **  +-----------------------+
310 **  |         ...           |  more segment descriptors (size, physical address)
311 **  +-----------------------+
312 **  |   Buffer 1 Seg Desc n |  last segment descriptor (size, physical address)
313 **  +-----------------------+
314 **  |   Buffer 2 Context    |  second buffer reference
315 **  +-----------------------+
316 **  |   Buffer 2 Seg Count  |  number of segments in buffer
317 **  +-----------------------+
318 **  |   Buffer 2 Seg Desc 1 |  segment descriptor (size, physical address)
319 **  +-----------------------+
320 **  |         ...           |  more segment descriptors (size, physical address)
321 **  +-----------------------+
322 **  |   Buffer 2 Seg Desc n |
323 **  +-----------------------+
324 **  |         ...           |  more buffer descriptor blocks ...
325 **  +-----------------------+
326 **  |   Buffer n Context    |
327 **  +-----------------------+
328 **  |   Buffer n Seg Count  |
329 **  +-----------------------+
330 **  |   Buffer n Seg Desc 1 |
331 **  +-----------------------+
332 **  |         ...           |
333 **  +-----------------------+
334 **  |   Buffer n Seg Desc n |
335 **  +-----------------------+
336 **
337 **
338 ** A TCB for one contigous packet buffer would look like the following:
339 **
340 **   32                    0
341 **  +-----------------------+
342 **  |         1             |  one buffer in the TCB
343 **  +-----------------------+
344 **  |  <user's Context>     |  user's buffer reference
345 **  +-----------------------+
346 **  |         1             |  one segment buffer
347 **  +-----------------------+                            _
348 **  |    <buffer size>      |  size                       \
349 **  +-----------------------+                              \ segment descriptor
350 **  |  <physical address>   |  physical address of buffer  /
351 **  +-----------------------+                            _/
352 **
353 */
354 
355  /* Buffer Segment Descriptor */
356 typedef struct {
357 	U32 size;
358 	U32 phyAddress;
359 } BSD, *PBSD;
360 
361 typedef PU32 PRCTCB;
362 /*
363 ** -------------------------------------------------------------------------
364 ** Exported functions comprising the API to the LAN I2O message transport layer
365 ** -------------------------------------------------------------------------
366 */
367 
368  /*
369     ** InitRCI2OMsgLayer()
370     **
371     ** Called once prior to using the I2O LAN message transport layer.  User
372     ** provides both the physical and virual address of a locked page buffer
373     ** that is used as a private buffer for the RedCreek I2O message
374     ** transport layer.  This buffer must be a contigous memory block of a
375     ** minimum of 16K bytes and long word aligned.  The user also must provide
376     ** the base address of the RedCreek PCI adapter assigned by BIOS or operating
377     ** system.
378     **
379     ** Inputs:  dev - the net_device struct for the device.
380     **          TransmitCallbackFunction - address of user's TX callback function
381     **          ReceiveCallbackFunction  - address of user's RX callback function
382     **          RebootCallbackFunction  - address of user's reboot callback function
383     **
384   */
385 RC_RETURN RCInitI2OMsgLayer (struct net_device *dev,
386 			     PFNTXCALLBACK TransmitCallbackFunction,
387 			     PFNRXCALLBACK ReceiveCallbackFunction,
388 			     PFNCALLBACK RebootCallbackFunction);
389 
390  /*
391     ** RCSetRavlinIPandMask()
392     **
393     ** Set the Ravlin 45/PCI cards IP address and network mask.
394     **
395     ** IP address and mask must be in network byte order.
396     ** For example, IP address 1.2.3.4 and mask 255.255.255.0 would be
397     ** 0x04030201 and 0x00FFFFFF on a little endian machine.
398     **
399   */
400 RC_RETURN RCSetRavlinIPandMask (struct net_device *dev, U32 ipAddr,
401 				U32 netMask);
402 
403 /*
404 ** =========================================================================
405 ** RCGetRavlinIPandMask()
406 **
407 ** get the IP address and MASK from the card
408 **
409 ** =========================================================================
410 */
411 RC_RETURN
412 RCGetRavlinIPandMask (struct net_device *dev, PU32 pIpAddr, PU32 pNetMask,
413 		      PFNWAITCALLBACK WaitCallback);
414 
415  /*
416     ** RCProcI2OMsgQ()
417     **
418     ** Called from user's polling loop or Interrupt Service Routine for a PCI
419     ** interrupt from the RedCreek PCI adapter.  User responsible for determining
420     ** and hooking the PCI interrupt. This function will call the registered
421     ** callback functions, TransmitCallbackFunction or ReceiveCallbackFunction,
422     ** if a TX or RX transaction has completed.
423   */
424 void RCProcI2OMsgQ (struct net_device *dev);
425 
426  /*
427     ** Disable and Enable I2O interrupts.  I2O interrupts are enabled at Init time
428     ** but can be disabled and re-enabled through these two function calls.
429     ** Packets will still be put into any posted received buffers and packets will
430     ** be sent through RCI2OSendPacket() functions.  Disabling I2O interrupts
431     ** will prevent hardware interrupt to host even though the outbound I2O msg
432     ** queue is not emtpy.
433   */
434 RC_RETURN RCEnableI2OInterrupts (struct net_device *dev);
435 RC_RETURN RCDisableI2OInterrupts (struct net_device *dev);
436 
437  /*
438     ** RCPostRecvBuffers()
439     **
440     ** Post user's page locked buffers for use by the PCI adapter to
441     ** return ethernet packets received from the LAN.  Transaction Control Block,
442     ** provided by user, contains buffer descriptor(s) which includes a buffer
443     ** context number along with buffer size and physical address.  See TCB above.
444     ** The buffer context and actual packet length are returned to the
445     ** ReceiveCallbackFunction when packets have been received.  Buffers posted
446     ** to the RedCreek adapter are considered owned by the adapter until the
447     ** context is return to user through the ReceiveCallbackFunction.
448   */
449 RC_RETURN RCPostRecvBuffers (struct net_device *dev,
450 			     PRCTCB pTransactionCtrlBlock);
451 #define MAX_NMBR_POST_BUFFERS_PER_MSG 32
452 
453  /*
454     ** RCI2OSendPacket()
455     **
456     ** Send user's ethernet packet from a locked page buffer.
457     ** Packet must have full MAC header, however without a CRC.
458     ** Initiator context is a user provided value that is returned
459     ** to the TransmitCallbackFunction when packet buffer is free.
460     ** Transmit buffer are considered owned by the adapter until context's
461     ** returned to user through the TransmitCallbackFunction.
462   */
463 RC_RETURN RCI2OSendPacket (struct net_device *dev,
464 			   U32 context, PRCTCB pTransactionCtrlBlock);
465 
466  /* Ethernet Link Statistics structure */
467 typedef struct tag_RC_link_stats {
468 	U32 TX_good;		/* good transmit frames */
469 	U32 TX_maxcol;		/* frames not TX due to MAX collisions */
470 	U32 TX_latecol;		/* frames not TX due to late collisions */
471 	U32 TX_urun;		/* frames not TX due to DMA underrun */
472 	U32 TX_crs;		/* frames TX with lost carrier sense */
473 	U32 TX_def;		/* frames deferred due to activity on link */
474 	U32 TX_singlecol;	/* frames TX with one and only on collision */
475 	U32 TX_multcol;		/* frames TX with more than one collision */
476 	U32 TX_totcol;		/* total collisions detected during TX */
477 	U32 Rcv_good;		/* good frames received */
478 	U32 Rcv_CRCerr;		/* frames RX and discarded with CRC errors */
479 	U32 Rcv_alignerr;	/* frames RX with alignment and CRC errors */
480 	U32 Rcv_reserr;		/* good frames discarded due to no RX buffer */
481 	U32 Rcv_orun;		/* RX frames lost due to FIFO overrun */
482 	U32 Rcv_cdt;		/* RX frames with collision during RX */
483 	U32 Rcv_runt;		/* RX frames shorter than 64 bytes */
484 } RCLINKSTATS, *P_RCLINKSTATS;
485 
486  /*
487     ** RCGetLinkStatistics()
488     **
489     ** Returns link statistics in user's structure at address StatsReturnAddr
490     ** If given, not NULL, the function WaitCallback is called during the wait
491     ** loop while waiting for the adapter to respond.
492   */
493 RC_RETURN RCGetLinkStatistics (struct net_device *dev,
494 			       P_RCLINKSTATS StatsReturnAddr,
495 			       PFNWAITCALLBACK WaitCallback);
496 
497  /*
498     ** RCGetLinkStatus()
499     **
500     ** Return link status, up or down, to user's location addressed by ReturnAddr.
501     ** If given, not NULL, the function WaitCallback is called during the wait
502     ** loop while waiting for the adapter to respond.
503   */
504 RC_RETURN RCGetLinkStatus (struct net_device *dev,
505 			   PU32 pReturnStatus, PFNWAITCALLBACK WaitCallback);
506 
507  /* Link Status defines - value returned in pReturnStatus */
508 #define RC_LAN_LINK_STATUS_DOWN     0
509 #define RC_LAN_LINK_STATUS_UP       1
510 
511  /*
512     ** RCGetMAC()
513     **
514     ** Get the current MAC address assigned to user.  RedCreek Ravlin 45/PCI
515     ** has two MAC addresses.  One which is private to the PCI Card, and
516     ** another MAC which is given to the user as its link layer MAC address. The
517     ** adapter runs in promiscous mode because of the dual address requirement.
518     ** The MAC address is returned to the unsigned char array pointer to by mac.
519   */
520 RC_RETURN RCGetMAC (struct net_device *dev, PFNWAITCALLBACK WaitCallback);
521 
522  /*
523     ** RCSetMAC()
524     **
525     ** Set a new user port MAC address.  This address will be returned on
526     ** subsequent RCGetMAC() calls.
527   */
528 RC_RETURN RCSetMAC (struct net_device *dev, PU8 mac);
529 
530  /*
531     ** RCSetLinkSpeed()
532     **
533     ** set adapter's link speed based on given input code.
534   */
535 RC_RETURN RCSetLinkSpeed (struct net_device *dev, U16 LinkSpeedCode);
536  /* Set link speed codes */
537 #define LNK_SPD_AUTO_NEG_NWAY   0
538 #define LNK_SPD_100MB_FULL      1
539 #define LNK_SPD_100MB_HALF      2
540 #define LNK_SPD_10MB_FULL       3
541 #define LNK_SPD_10MB_HALF       4
542 
543  /*
544     ** RCGetLinkSpeed()
545     **
546     ** Return link speed code.
547   */
548  /* Return link speed codes */
549 #define LNK_SPD_UNKNOWN         0
550 #define LNK_SPD_100MB_FULL      1
551 #define LNK_SPD_100MB_HALF      2
552 #define LNK_SPD_10MB_FULL       3
553 #define LNK_SPD_10MB_HALF       4
554 
555 RC_RETURN
556 RCGetLinkSpeed (struct net_device *dev, PU32 pLinkSpeedCode,
557 		PFNWAITCALLBACK WaitCallback);
558 /*
559 ** =========================================================================
560 ** RCSetPromiscuousMode(struct net_device *dev, U16 Mode)
561 **
562 ** Defined values for Mode:
563 **  0 - turn off promiscuous mode
564 **  1 - turn on  promiscuous mode
565 **
566 ** =========================================================================
567 */
568 #define PROMISCUOUS_MODE_OFF 0
569 #define PROMISCUOUS_MODE_ON  1
570 RC_RETURN RCSetPromiscuousMode (struct net_device *dev, U16 Mode);
571 /*
572 ** =========================================================================
573 ** RCGetPromiscuousMode(struct net_device *dev, PU32 pMode, PFNWAITCALLBACK WaitCallback)
574 **
575 ** get promiscuous mode setting
576 **
577 ** Possible return values placed in pMode:
578 **  0 = promisuous mode not set
579 **  1 = promisuous mode is set
580 **
581 ** =========================================================================
582 */
583 RC_RETURN
584 RCGetPromiscuousMode (struct net_device *dev, PU32 pMode,
585 		      PFNWAITCALLBACK WaitCallback);
586 
587 /*
588 ** =========================================================================
589 ** RCSetBroadcastMode(struct net_device *dev, U16 Mode)
590 **
591 ** Defined values for Mode:
592 **  0 - turn off promiscuous mode
593 **  1 - turn on  promiscuous mode
594 **
595 ** =========================================================================
596 */
597 #define BROADCAST_MODE_OFF 0
598 #define BROADCAST_MODE_ON  1
599 RC_RETURN RCSetBroadcastMode (struct net_device *dev, U16 Mode);
600 /*
601 ** =========================================================================
602 ** RCGetBroadcastMode(struct net_device *dev, PU32 pMode, PFNWAITCALLBACK WaitCallback)
603 **
604 ** get broadcast mode setting
605 **
606 ** Possible return values placed in pMode:
607 **  0 = broadcast mode not set
608 **  1 = broadcast mode is set
609 **
610 ** =========================================================================
611 */
612 RC_RETURN
613 RCGetBroadcastMode (struct net_device *dev, PU32 pMode,
614 		    PFNWAITCALLBACK WaitCallback);
615 /*
616 ** =========================================================================
617 ** RCReportDriverCapability(struct net_device *dev, U32 capability)
618 **
619 ** Currently defined bits:
620 ** WARM_REBOOT_CAPABLE   0x01
621 **
622 ** =========================================================================
623 */
624 RC_RETURN RCReportDriverCapability (struct net_device *dev, U32 capability);
625 
626 /*
627 ** RCGetFirmwareVer()
628 **
629 ** Return firmware version in the form "SoftwareVersion : Bt BootVersion"
630 **
631 ** WARNING: user's space pointed to by pFirmString should be at least 60 bytes.
632 */
633 RC_RETURN
634 RCGetFirmwareVer (struct net_device *dev, PU8 pFirmString,
635 		  PFNWAITCALLBACK WaitCallback);
636 
637 /*
638 ** ----------------------------------------------
639 ** LAN adapter Reset and Shutdown functions
640 ** ----------------------------------------------
641 */
642  /* resource flag bit assignments for RCResetLANCard() & RCShutdownLANCard() */
643 #define RC_RESOURCE_RETURN_POSTED_RX_BUCKETS  0x0001
644 #define RC_RESOURCE_RETURN_PEND_TX_BUFFERS    0x0002
645 
646  /*
647     ** RCResetLANCard()
648     **
649     ** Reset LAN card operation.  Causes a software reset of the ethernet
650     ** controller and restarts the command and receive units. Depending on
651     ** the ResourceFlags given, the buffers are either returned to the
652     ** host with reply status of I2O_REPLY_STATUS_ABORT_NO_DATA_TRANSFER and
653     ** detailed status of I2O_LAN_DSC_CANCELED (new receive buffers must be
654     ** posted after issuing this) OR the buffers are kept and reused by
655     ** the ethernet controller. If CallbackFunction is not NULL, the function
656     ** will be called when the reset is complete.  If the CallbackFunction is
657     ** NULL,a 1 will be put into the ReturnAddr after waiting for the reset
658     ** to complete (please disable I2O interrupts during this method).
659     ** Any outstanding transmit or receive buffers that are complete will be
660     ** returned via the normal reply messages before the requested resource
661     ** buffers are returned.
662     ** A call to RCPostRecvBuffers() is needed to return the ethernet to full
663     ** operation if the receive buffers were returned during LANReset.
664     ** Note: The IOP status is not affected by a LAN reset.
665   */
666 RC_RETURN RCResetLANCard (struct net_device *dev, U16 ResourceFlags,
667 			  PU32 ReturnAddr, PFNCALLBACK CallbackFunction);
668 
669  /*
670     ** RCShutdownLANCard()
671     **
672     ** Shutdown LAN card operation and put into an idle (suspended) state.
673     ** The LAN card is restarted with RCResetLANCard() function.
674     ** Depending on the ResourceFlags given, the buffers are either returned
675     ** to the host with reply status of I2O_REPLY_STATUS_ABORT_NO_DATA_TRANSFER
676     ** and detailed status of I2O_LAN_DSC_CANCELED (new receive buffers must be
677     ** posted after issuing this) OR the buffers are kept and reused by
678     ** the ethernet controller. If CallbackFunction is not NULL, the function
679     ** will be called when the reset is complete.  If the CallbackFunction is
680     ** NULL,a 1 will be put into the ReturnAddr after waiting for the reset
681     ** to complete (please disable I2O interrupts during this method).
682     ** Any outstanding transmit or receive buffers that are complete will be
683     ** returned via the normal reply messages before the requested resource
684     ** buffers are returned.
685     ** Note: The IOP status is not affected by a LAN shutdown.
686   */
687 RC_RETURN
688 RCShutdownLANCard (struct net_device *dev, U16 ResourceFlags, PU32 ReturnAddr,
689 		   PFNCALLBACK CallbackFunction);
690 
691  /*
692     ** RCResetIOP();
693     **     Initializes IOPState to I2O_IOP_STATE_RESET.
694     **     Stops access to outbound message Q.
695     **     Discards any outstanding transmit or posted receive buffers.
696     **     Clears outbound message Q.
697   */
698 RC_RETURN RCResetIOP (struct net_device *dev);
699 
700 #endif				/* RCLANMTL_H */
701