OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rc203soc/] [sw/] [uClinux/] [drivers/] [net/] [rclanmtl.h] - Blame information for rev 1772

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1626 jcastillo
/*
2
** *************************************************************************
3
**
4
**
5
**     R C L A N M T L . H             $Revision: 1.1 $
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
#define kprintf printk
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
 
48
/* PCI/45 Configuration space values */
49
#define RC_PCI45_VENDOR_ID  0x4916
50
#define RC_PCI45_DEVICE_ID  0x1960
51
 
52
 
53
 /* RedCreek API function return values */
54
#define RC_RTN_NO_ERROR             0
55
#define RC_RTN_I2O_NOT_INIT         1
56
#define RC_RTN_FREE_Q_EMPTY         2
57
#define RC_RTN_TCB_ERROR            3
58
#define RC_RTN_TRANSACTION_ERROR    4
59
#define RC_RTN_ADAPTER_ALREADY_INIT 5
60
#define RC_RTN_MALLOC_ERROR         6
61
#define RC_RTN_ADPTR_NOT_REGISTERED 7
62
#define RC_RTN_MSG_REPLY_TIMEOUT    8
63
#define RC_RTN_NO_I2O_STATUS        9
64
#define RC_RTN_NO_FIRM_VER         10
65
#define RC_RTN_NO_LINK_SPEED       11
66
 
67
/* Driver capability flags */
68
#define WARM_REBOOT_CAPABLE      0x01
69
 
70
 /* scalar data types */
71
typedef unsigned char   U8;
72
typedef unsigned char*  PU8;
73
typedef unsigned short  U16;
74
typedef unsigned short* PU16;
75
typedef unsigned long   U32;
76
typedef unsigned long*  PU32;
77
typedef unsigned long   BF;
78
typedef int             RC_RETURN;
79
 
80
 
81
 /*
82
 ** type PFNWAITCALLBACK
83
 **
84
 ** pointer to void function - type used for WaitCallback in some functions
85
 */
86
typedef void (*PFNWAITCALLBACK)(void);  /* void argument avoids compiler complaint */
87
 
88
 /*
89
 ** type PFNTXCALLBACK
90
 **
91
 ** Pointer to user's transmit callback function.  This user function is
92
 ** called from RCProcI2OMsgQ() when packet have been transmitted from buffers
93
 ** given in the RCI2OSendPacket() function.  BufferContext is a pointer to
94
 ** an array of 32 bit context values.  These are the values the user assigned
95
 ** and passed in the TCB to the RCI2OSendPacket() function.  PcktCount
96
 ** indicates the number of buffer context values in the BufferContext[] array.
97
 ** The User's TransmitCallbackFunction should recover (put back in free queue)
98
 ** the packet buffers associated with the buffer context values.
99
 */
100
typedef void (*PFNTXCALLBACK)(U32  Status,
101
                              U16  PcktCount,
102
                              PU32 BufferContext,
103
                              U16  AdaterID);
104
 
105
 /*
106
 ** type PFNRXCALLBACK
107
 **
108
 ** Pointer to user's receive callback function.  This user function
109
 ** is called from RCProcI2OMsgQ() when packets have been received into
110
 ** previously posted packet buffers throught the RCPostRecvBuffers() function.
111
 ** The received callback function should process the Packet Descriptor Block
112
 ** pointed to by PacketDescBlock. See Packet Decription Block below.
113
 */
114
typedef void (*PFNRXCALLBACK)(U32  Status,
115
                              U8   PktCount,
116
                              U32  BucketsRemain,
117
                              PU32 PacketDescBlock,
118
                              U16  AdapterID);
119
 
120
 /*
121
 ** type PFNCALLBACK
122
 **
123
 ** Pointer to user's generic callback function.  This user function
124
 ** can be passed to LANReset or LANShutdown and is called when the
125
 ** the reset or shutdown is complete.
126
 ** Param1 and Param2 are invalid for LANReset and LANShutdown.
127
 */
128
typedef void (*PFNCALLBACK)(U32  Status,
129
                              U32  Param1,
130
                              U32  Param2,
131
                              U16  AdapterID);
132
 
133
/*
134
** Status - Transmit and Receive callback status word
135
**
136
** A 32 bit Status is returned to the TX and RX callback functions.  This value
137
** contains both the reply status and the detailed status as follows:
138
**
139
**  32    24     16            0
140
**  +------+------+------------+
141
**  | Reply|      |  Detailed  |
142
**  |Status|   0  |   Status   |
143
**  +------+------+------------+
144
**
145
** Reply Status and Detailed Status of zero indicates No Errors.
146
*/
147
 /* reply message status defines */
148
#define    I2O_REPLY_STATUS_SUCCESS                    0x00
149
#define    I2O_REPLY_STATUS_ABORT_NO_DATA_TRANSFER     0x02
150
#define    I2O_REPLY_STATUS_TRANSACTION_ERROR          0x0A
151
 
152
 
153
/* DetailedStatusCode defines */
154
#define    I2O_LAN_DSC_SUCCESS                         0x0000
155
#define    I2O_LAN_DSC_DEVICE_FAILURE                  0x0001
156
#define    I2O_LAN_DSC_DESTINATION_NOT_FOUND           0x0002
157
#define    I2O_LAN_DSC_TRANSMIT_ERROR                  0x0003
158
#define    I2O_LAN_DSC_TRANSMIT_ABORTED                0x0004
159
#define    I2O_LAN_DSC_RECEIVE_ERROR                   0x0005
160
#define    I2O_LAN_DSC_RECEIVE_ABORTED                 0x0006
161
#define    I2O_LAN_DSC_DMA_ERROR                       0x0007
162
#define    I2O_LAN_DSC_BAD_PACKET_DETECTED             0x0008
163
#define    I2O_LAN_DSC_OUT_OF_MEMORY                   0x0009
164
#define    I2O_LAN_DSC_BUCKET_OVERRUN                  0x000A
165
#define    I2O_LAN_DSC_IOP_INTERNAL_ERROR              0x000B
166
#define    I2O_LAN_DSC_CANCELED                        0x000C
167
#define    I2O_LAN_DSC_INVALID_TRANSACTION_CONTEXT     0x000D
168
#define    I2O_LAN_DSC_DESTINATION_ADDRESS_DETECTED    0x000E
169
#define    I2O_LAN_DSC_DESTINATION_ADDRESS_OMITTED     0x000F
170
#define    I2O_LAN_DSC_PARTIAL_PACKET_RETURNED         0x0010
171
 
172
 
173
/*
174
** Packet Description Block   (Received packets)
175
**
176
** A pointer to this block structure is returned to the ReceiveCallback
177
** function.  It contains the list of packet buffers which have either been
178
** filled with a packet or returned to host due to a LANReset function.
179
** Currently there will only be one packet per receive bucket (buffer) posted.
180
**
181
**   32   24               0
182
**  +-----------------------+  -\
183
**  |   Buffer 1 Context    |    \
184
**  +-----------------------+     \
185
**  |      0xC0000000       |     / First Bucket Descriptor
186
**  +-----+-----------------+    /
187
**  |  0  | packet 1 length |   /
188
**  +-----------------------+  -\
189
**  |   Buffer 2 Context    |    \
190
**  +-----------------------+     \
191
**  |      0xC0000000       |     / Second Bucket Descriptor
192
**  +-----+-----------------+    /
193
**  |  0  | packet 2 length |   /
194
**  +-----+-----------------+  -
195
**  |         ...           |  ----- more bucket descriptors
196
**  +-----------------------+  -\
197
**  |   Buffer n Context    |    \
198
**  +-----------------------+     \
199
**  |      0xC0000000       |     / Last Bucket Descriptor
200
**  +-----+-----------------+    /
201
**  |  0  | packet n length |   /
202
**  +-----+-----------------+  -
203
**
204
** Buffer Context values are those given to adapter in the TCB on calls to
205
** RCPostRecvBuffers().
206
**
207
*/
208
 
209
 
210
 
211
/*
212
** Transaction Control Block (TCB) structure
213
**
214
** A structure like this is filled in by the user and passed by reference to
215
** RCI2OSendPacket() and RCPostRecvBuffers() functions.  Minimum size is five
216
** 32-bit words for one buffer with one segment descriptor.
217
** MAX_NMBR_POST_BUFFERS_PER_MSG defines the maximum single segment buffers
218
** that can be described in a given TCB.
219
**
220
**   32                    0
221
**  +-----------------------+
222
**  |   Buffer Count        |  Number of buffers in the TCB
223
**  +-----------------------+
224
**  |   Buffer 1 Context    |  first buffer reference
225
**  +-----------------------+
226
**  |   Buffer 1 Seg Count  |  number of segments in buffer
227
**  +-----------------------+
228
**  |   Buffer 1 Seg Desc 1 |  first segment descriptor (size, physical address)
229
**  +-----------------------+
230
**  |         ...           |  more segment descriptors (size, physical address)
231
**  +-----------------------+
232
**  |   Buffer 1 Seg Desc n |  last segment descriptor (size, physical address)
233
**  +-----------------------+
234
**  |   Buffer 2 Context    |  second buffer reference
235
**  +-----------------------+
236
**  |   Buffer 2 Seg Count  |  number of segments in buffer
237
**  +-----------------------+
238
**  |   Buffer 2 Seg Desc 1 |  segment descriptor (size, physical address)
239
**  +-----------------------+
240
**  |         ...           |  more segment descriptors (size, physical address)
241
**  +-----------------------+
242
**  |   Buffer 2 Seg Desc n |
243
**  +-----------------------+
244
**  |         ...           |  more buffer descriptor blocks ...
245
**  +-----------------------+
246
**  |   Buffer n Context    |
247
**  +-----------------------+
248
**  |   Buffer n Seg Count  |
249
**  +-----------------------+
250
**  |   Buffer n Seg Desc 1 |
251
**  +-----------------------+
252
**  |         ...           |
253
**  +-----------------------+
254
**  |   Buffer n Seg Desc n |
255
**  +-----------------------+
256
**
257
**
258
** A TCB for one contigous packet buffer would look like the following:
259
**
260
**   32                    0
261
**  +-----------------------+
262
**  |         1             |  one buffer in the TCB
263
**  +-----------------------+
264
**  |  <user's Context>     |  user's buffer reference
265
**  +-----------------------+
266
**  |         1             |  one segment buffer
267
**  +-----------------------+                            _
268
**  |    <buffer size>      |  size                       \
269
**  +-----------------------+                              \ segment descriptor
270
**  |  <physical address>   |  physical address of buffer  /
271
**  +-----------------------+                            _/
272
**
273
*/
274
 
275
 /* Buffer Segment Descriptor */
276
typedef struct
277
{
278
    U32 size;
279
    U32 phyAddress;
280
}
281
 BSD, *PBSD;
282
 
283
typedef PU32 PRCTCB;
284
/*
285
** -------------------------------------------------------------------------
286
** Exported functions comprising the API to the LAN I2O message transport layer
287
** -------------------------------------------------------------------------
288
*/
289
 
290
 
291
 /*
292
 ** InitRCI2OMsgLayer()
293
 **
294
 ** Called once prior to using the I2O LAN message transport layer.  User
295
 ** provides both the physical and virual address of a locked page buffer
296
 ** that is used as a private buffer for the RedCreek I2O message
297
 ** transport layer.  This buffer must be a contigous memory block of a
298
 ** minimum of 16K bytes and long word aligned.  The user also must provide
299
 ** the base address of the RedCreek PCI adapter assigned by BIOS or operating
300
 ** system.  The user provided value AdapterID is a zero based index of the
301
 ** Ravlin 45/PCI adapter.  This interface number is used in all subsequent API
302
 ** calls to identify which adpapter for which the function is intended.
303
 ** Up to sixteen interfaces are supported with this API.
304
 **
305
 ** Inputs:  AdapterID - interface number from 0 to 15
306
 **          pciBaseAddr - virual base address of PCI (set by BIOS)
307
 **          p_msgbuf - virual address to private message block (min. 16K)
308
 **          p_phymsgbuf - physical address of private message block
309
 **          TransmitCallbackFunction - address of user's TX callback function
310
 **          ReceiveCallbackFunction  - address of user's RX callback function
311
 **
312
 */
313
RC_RETURN RCInitI2OMsgLayer(U16 AdapterID, U32 pciBaseAddr,
314
                            PU8 p_msgbuf,  PU8 p_phymsgbuf,
315
                            PFNTXCALLBACK TransmitCallbackFunction,
316
                            PFNRXCALLBACK ReceiveCallbackFunction,
317
                            PFNCALLBACK   RebootCallbackFunction);
318
 
319
 /*
320
 ** RCSetRavlinIPandMask()
321
 **
322
 ** Set the Ravlin 45/PCI cards IP address and network mask.
323
 **
324
 ** IP address and mask must be in network byte order.
325
 ** For example, IP address 1.2.3.4 and mask 255.255.255.0 would be
326
 ** 0x04030201 and 0x00FFFFFF on a little endian machine.
327
 **
328
 */
329
RC_RETURN RCSetRavlinIPandMask(U16 AdapterID, U32 ipAddr, U32 netMask);
330
 
331
 
332
/*
333
** =========================================================================
334
** RCGetRavlinIPandMask()
335
**
336
** get the IP address and MASK from the card
337
**
338
** =========================================================================
339
*/
340
RC_RETURN
341
RCGetRavlinIPandMask(U16 AdapterID, PU32 pIpAddr, PU32 pNetMask,
342
                        PFNWAITCALLBACK WaitCallback);
343
 
344
 /*
345
 ** RCProcI2OMsgQ()
346
 **
347
 ** Called from user's polling loop or Interrupt Service Routine for a PCI
348
 ** interrupt from the RedCreek PCI adapter.  User responsible for determining
349
 ** and hooking the PCI interrupt. This function will call the registered
350
 ** callback functions, TransmitCallbackFunction or ReceiveCallbackFunction,
351
 ** if a TX or RX transaction has completed.
352
 */
353
void RCProcI2OMsgQ(U16 AdapterID);
354
 
355
 
356
 /*
357
 ** Disable and Enable I2O interrupts.  I2O interrupts are enabled at Init time
358
 ** but can be disabled and re-enabled through these two function calls.
359
 ** Packets will still be put into any posted recieved buffers and packets will
360
 ** be sent through RCI2OSendPacket() functions.  Disabling I2O interrupts
361
 ** will prevent hardware interrupt to host even though the outbound I2O msg
362
 ** queue is not emtpy.
363
 */
364
RC_RETURN RCEnableI2OInterrupts(U16 adapterID);
365
RC_RETURN RCDisableI2OInterrupts(U16 AdapterID);
366
 
367
 
368
 /*
369
 ** RCPostRecvBuffers()
370
 **
371
 ** Post user's page locked buffers for use by the PCI adapter to
372
 ** return ethernet packets received from the LAN.  Transaction Control Block,
373
 ** provided by user, contains buffer descriptor(s) which includes a buffer
374
 ** context number along with buffer size and physical address.  See TCB above.
375
 ** The buffer context and actual packet length are returned to the
376
 ** ReceiveCallbackFunction when packets have been received.  Buffers posted
377
 ** to the RedCreek adapter are considered owned by the adapter until the
378
 ** context is return to user through the ReceiveCallbackFunction.
379
 */
380
RC_RETURN RCPostRecvBuffers(U16 AdapterID, PRCTCB pTransactionCtrlBlock);
381
#define MAX_NMBR_POST_BUFFERS_PER_MSG 32
382
 
383
 /*
384
 ** RCI2OSendPacket()
385
 **
386
 ** Send user's ethernet packet from a locked page buffer.
387
 ** Packet must have full MAC header, however without a CRC.
388
 ** Initiator context is a user provided value that is returned
389
 ** to the TransmitCallbackFunction when packet buffer is free.
390
 ** Transmit buffer are considered owned by the adapter until context's
391
 ** returned to user through the TransmitCallbackFunction.
392
 */
393
RC_RETURN RCI2OSendPacket(U16 AdapterID,
394
                          U32 context,
395
                          PRCTCB pTransactionCtrlBlock);
396
 
397
 
398
 /* Ethernet Link Statistics structure */
399
typedef struct tag_RC_link_stats
400
{
401
    U32 TX_good;      /* good transmit frames */
402
    U32 TX_maxcol;    /* frames not TX due to MAX collisions */
403
    U32 TX_latecol;   /* frames not TX due to late collisions */
404
    U32 TX_urun;      /* frames not TX due to DMA underrun */
405
    U32 TX_crs;       /* frames TX with lost carrier sense */
406
    U32 TX_def;       /* frames deferred due to activity on link */
407
    U32 TX_singlecol; /* frames TX with one and only on collision */
408
    U32 TX_multcol;   /* frames TX with more than one collision */
409
    U32 TX_totcol;    /* total collisions detected during TX */
410
    U32 Rcv_good;     /* good frames received */
411
    U32 Rcv_CRCerr;   /* frames RX and discarded with CRC errors */
412
    U32 Rcv_alignerr; /* frames RX with alignment and CRC errors */
413
    U32 Rcv_reserr;   /* good frames discarded due to no RX buffer */
414
    U32 Rcv_orun;     /* RX frames lost due to FIFO overrun */
415
    U32 Rcv_cdt;      /* RX frames with collision during RX */
416
    U32 Rcv_runt;     /* RX frames shorter than 64 bytes */
417
}
418
 RCLINKSTATS, *P_RCLINKSTATS;
419
 
420
 /*
421
 ** RCGetLinkStatistics()
422
 **
423
 ** Returns link statistics in user's structure at address StatsReturnAddr
424
 ** If given, not NULL, the function WaitCallback is called during the wait
425
 ** loop while waiting for the adapter to respond.
426
 */
427
RC_RETURN RCGetLinkStatistics(U16 AdapterID,
428
                              P_RCLINKSTATS StatsReturnAddr,
429
                              PFNWAITCALLBACK WaitCallback);
430
 
431
 /*
432
 ** RCGetLinkStatus()
433
 **
434
 ** Return link status, up or down, to user's location addressed by ReturnAddr.
435
 ** If given, not NULL, the function WaitCallback is called during the wait
436
 ** loop while waiting for the adapter to respond.
437
 */
438
RC_RETURN RCGetLinkStatus(U16 AdapterID,
439
                          PU32 pReturnStatus,
440
                          PFNWAITCALLBACK WaitCallback);
441
 
442
 /* Link Status defines - value returned in pReturnStatus */
443
#define RC_LAN_LINK_STATUS_DOWN     0
444
#define RC_LAN_LINK_STATUS_UP       1
445
 
446
 /*
447
 ** RCGetMAC()
448
 **
449
 ** Get the current MAC address assigned to user.  RedCreek Ravlin 45/PCI
450
 ** has two MAC addresses.  One which is private to the PCI Card, and
451
 ** another MAC which is given to the user as its link layer MAC address. The
452
 ** adapter runs in promiscous mode because of the dual address requirement.
453
 ** The MAC address is returned to the unsigned char array pointer to by mac.
454
 */
455
RC_RETURN RCGetMAC(U16 AdapterID, PU8 mac, PFNWAITCALLBACK WaitCallback);
456
 
457
 /*
458
 ** RCSetMAC()
459
 **
460
 ** Set a new user port MAC address.  This address will be returned on
461
 ** subsequent RCGetMAC() calls.
462
 */
463
RC_RETURN RCSetMAC(U16 AdapterID, PU8 mac);
464
 
465
 /*
466
 ** RCSetLinkSpeed()
467
 **
468
 ** set adapter's link speed based on given input code.
469
 */
470
RC_RETURN RCSetLinkSpeed(U16 AdapterID, U16 LinkSpeedCode);
471
 /* Set link speed codes */
472
#define LNK_SPD_AUTO_NEG_NWAY   0
473
#define LNK_SPD_100MB_FULL      1
474
#define LNK_SPD_100MB_HALF      2
475
#define LNK_SPD_10MB_FULL       3
476
#define LNK_SPD_10MB_HALF       4
477
 
478
 
479
 
480
 
481
 /*
482
 ** RCGetLinkSpeed()
483
 **
484
 ** Return link speed code.
485
 */
486
 /* Return link speed codes */
487
#define LNK_SPD_UNKNOWN         0
488
#define LNK_SPD_100MB_FULL      1
489
#define LNK_SPD_100MB_HALF      2
490
#define LNK_SPD_10MB_FULL       3
491
#define LNK_SPD_10MB_HALF       4
492
 
493
RC_RETURN
494
RCGetLinkSpeed(U16 AdapterID, PU32 pLinkSpeedCode, PFNWAITCALLBACK WaitCallback);
495
/*
496
** =========================================================================
497
** RCSetPromiscuousMode(U16 AdapterID, U16 Mode)
498
**
499
** Defined values for Mode:
500
**  0 - turn off promiscuous mode
501
**  1 - turn on  promiscuous mode
502
**
503
** =========================================================================
504
*/
505
#define PROMISCUOUS_MODE_OFF 0
506
#define PROMISCUOUS_MODE_ON  1
507
RC_RETURN
508
RCSetPromiscuousMode(U16 AdapterID, U16 Mode);
509
/*
510
** =========================================================================
511
** RCGetPromiscuousMode(U16 AdapterID, PU32 pMode, PFNWAITCALLBACK WaitCallback)
512
**
513
** get promiscuous mode setting
514
**
515
** Possible return values placed in pMode:
516
**  0 = promisuous mode not set
517
**  1 = promisuous mode is set
518
**
519
** =========================================================================
520
*/
521
RC_RETURN
522
RCGetPromiscuousMode(U16 AdapterID, PU32 pMode, PFNWAITCALLBACK WaitCallback);
523
 
524
/*
525
** =========================================================================
526
** RCSetBroadcastMode(U16 AdapterID, U16 Mode)
527
**
528
** Defined values for Mode:
529
**  0 - turn off promiscuous mode
530
**  1 - turn on  promiscuous mode
531
**
532
** =========================================================================
533
*/
534
#define BROADCAST_MODE_OFF 0
535
#define BROADCAST_MODE_ON  1
536
RC_RETURN
537
RCSetBroadcastMode(U16 AdapterID, U16 Mode);
538
/*
539
** =========================================================================
540
** RCGetBroadcastMode(U16 AdapterID, PU32 pMode, PFNWAITCALLBACK WaitCallback)
541
**
542
** get broadcast mode setting
543
**
544
** Possible return values placed in pMode:
545
**  0 = broadcast mode not set
546
**  1 = broadcast mode is set
547
**
548
** =========================================================================
549
*/
550
RC_RETURN
551
RCGetBroadcastMode(U16 AdapterID, PU32 pMode, PFNWAITCALLBACK WaitCallback);
552
/*
553
** =========================================================================
554
** RCReportDriverCapability(U16 AdapterID, U32 capability)
555
**
556
** Currently defined bits:
557
** WARM_REBOOT_CAPABLE   0x01
558
**
559
** =========================================================================
560
*/
561
RC_RETURN
562
RCReportDriverCapability(U16 AdapterID, U32 capability);
563
 
564
/*
565
** RCGetFirmwareVer()
566
**
567
** Return firmware version in the form "SoftwareVersion : Bt BootVersion"
568
**
569
** WARNING: user's space pointed to by pFirmString should be at least 60 bytes.
570
*/
571
RC_RETURN
572
RCGetFirmwareVer(U16 AdapterID, PU8 pFirmString, PFNWAITCALLBACK WaitCallback);
573
 
574
/*
575
** ----------------------------------------------
576
** LAN adapter Reset and Shutdown functions
577
** ----------------------------------------------
578
*/
579
 /* resource flag bit assignments for RCResetLANCard() & RCShutdownLANCard() */
580
#define RC_RESOURCE_RETURN_POSTED_RX_BUCKETS  0x0001 
581
#define RC_RESOURCE_RETURN_PEND_TX_BUFFERS    0x0002
582
 
583
 /*
584
 ** RCResetLANCard()
585
 **
586
 ** Reset LAN card operation.  Causes a software reset of the ethernet
587
 ** controller and restarts the command and receive units. Depending on
588
 ** the ResourceFlags given, the buffers are either returned to the
589
 ** host with reply status of I2O_REPLY_STATUS_ABORT_NO_DATA_TRANSFER and
590
 ** detailed status of I2O_LAN_DSC_CANCELED (new receive buffers must be
591
 ** posted after issuing this) OR the buffers are kept and reused by
592
 ** the ethernet controller. If CallbackFunction is not NULL, the function
593
 ** will be called when the reset is complete.  If the CallbackFunction is
594
 ** NULL,a 1 will be put into the ReturnAddr after waiting for the reset
595
 ** to complete (please disable I2O interrupts during this method).
596
 ** Any outstanding transmit or receive buffers that are complete will be
597
 ** returned via the normal reply messages before the requested resource
598
 ** buffers are returned.
599
 ** A call to RCPostRecvBuffers() is needed to return the ethernet to full
600
 ** operation if the receive buffers were returned during LANReset.
601
 ** Note: The IOP status is not affected by a LAN reset.
602
 */
603
RC_RETURN RCResetLANCard(U16 AdapterID, U16 ResourceFlags, PU32 ReturnAddr, PFNCALLBACK CallbackFunction);
604
 
605
 
606
 /*
607
 ** RCShutdownLANCard()
608
 **
609
 ** Shutdown LAN card operation and put into an idle (suspended) state.
610
 ** The LAN card is restarted with RCResetLANCard() function.
611
 ** Depending on the ResourceFlags given, the buffers are either returned
612
 ** to the host with reply status of I2O_REPLY_STATUS_ABORT_NO_DATA_TRANSFER
613
 ** and detailed status of I2O_LAN_DSC_CANCELED (new receive buffers must be
614
 ** posted after issuing this) OR the buffers are kept and reused by
615
 ** the ethernet controller. If CallbackFunction is not NULL, the function
616
 ** will be called when the reset is complete.  If the CallbackFunction is
617
 ** NULL,a 1 will be put into the ReturnAddr after waiting for the reset
618
 ** to complete (please disable I2O interrupts during this method).
619
 ** Any outstanding transmit or receive buffers that are complete will be
620
 ** returned via the normal reply messages before the requested resource
621
 ** buffers are returned.
622
 ** Note: The IOP status is not affected by a LAN shutdown.
623
 */
624
RC_RETURN
625
RCShutdownLANCard(U16 AdapterID, U16 ResourceFlags, PU32 ReturnAddr, PFNCALLBACK CallbackFunction);
626
 
627
 /*
628
 ** RCResetIOP();
629
 **     Initializes IOPState to I2O_IOP_STATE_RESET.
630
 **     Stops access to outbound message Q.
631
 **     Discards any outstanding transmit or posted receive buffers.
632
 **     Clears outbound message Q.
633
 */
634
RC_RETURN
635
RCResetIOP(U16 AdapterID);
636
 
637
#endif /* RCLANMTL_H */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.