summaryrefslogtreecommitdiff
path: root/include/lisa/device.h
blob: 820475878dc3132d985bb163b8fd8abf2fabc452 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
/****************************************************************************
 *                            HEADER
 *
 *     $Workfile:   device.h  $
 *     Document no: @(#) 510/OSE66-6 $Revision: 1.1.2.1 $
 *     $Author: save $
 *     $Date: 2007/10/12 14:47:02 $
 *
 *     Copyright (C) 1996 by ENEA OSE SYSTEMS AB. All rights reserved.
 *
 ****************************************************************************

	CONTENTS
	--------

	1  Description
	2  History of development
	3  Include files
	4  Define
	5  Types
	6  Device Driver Functions
	7  Device Client Functions

 ****************************************************************************
 */
#ifndef _DEVICE_H
#define _DEVICE_H

#ifdef __cplusplus
extern "C" {
#endif

  /*
  ****************************************************************************
  * 1  DESCRIPTION.
  ****************************************************************************
  * OSE Delta System Device Driver and Device Client Interface Description.
  *
  */


  /*
  ****************************************************************************
  * 2  HISTORY OF DEVELOPMENT.
  */

  /*
  ****************************************************************************
  * 3 INCLUDE
  ****************************************************************************
  */

#include "osetypes.h"
#ifdef USE_OSEDEF_H
#include "osedef.h"
#endif
    
  /*
  ****************************************************************************
  * 4 DEFINE
  ****************************************************************************
  */

  /*
   *===========================================================================
   *                         DEVICE VERSION
   *===========================================================================
   * The version number of the current device driver interface.
   */

#define DEVICE_VERSION			2

  /*
   *===========================================================================
   *                         DEVICE CLASS
   *===========================================================================
   * A unique number that will be returned by device drivers when called with
   * the DEVICE_FCDEVCLASS function code.
   */

#define DEVICE_CLASS            0x2A86F264

  /*
   *===========================================================================
   *                         DEVICE FUNCTION CODES
   *===========================================================================
   * Function codes to be used in biosCall().
   */

#define DEVICE_FCBASE            0x72957209

#define DEVICE_FCDEVCLASS        (DEVICE_FCBASE + 0)

#define DEVICE_FCINIT            (DEVICE_FCBASE + 1)
#define DEVICE_FCFUNCTIONS       (DEVICE_FCBASE + 2)

#define DEVICE_FCDEVINFO         (DEVICE_FCBASE + 3)
#define DEVICE_FCUNITINFO        (DEVICE_FCBASE + 4)

#define DEVICE_FCOPEN            (DEVICE_FCBASE + 5)
#define DEVICE_FCSTART           (DEVICE_FCBASE + 6)
#define DEVICE_FCCLOSE           (DEVICE_FCBASE + 7)

#define DEVICE_FCGETCONF         (DEVICE_FCBASE + 8)
#define DEVICE_FCSETCONF         (DEVICE_FCBASE + 9)

#define DEVICE_FCWRITE           (DEVICE_FCBASE + 10)
#define DEVICE_FCREAD            (DEVICE_FCBASE + 11)
#define DEVICE_FCSIMINT          (DEVICE_FCBASE + 12)

#define DEVICE_FCABORTWRITE      (DEVICE_FCBASE + 13)
#define DEVICE_FCABORTREAD       (DEVICE_FCBASE + 14)

    /* Function codes with a value of 0x80000000 and above are reserved for
     * customer additions.
     */
#define DEVICE_FCUSER          	 0x80000000
    
  /*
   *===========================================================================
   *                     DCHANDLEEX ERRORCODE FATAL BIT
   *===========================================================================
   * If this bit is set in dcHandleEX() 'errorCode' the driver must be closed.
   * NEW VERSION 2.
   */
#define DEVICE_EFATAL_MASK			(0x80000000) 

  /*
   *===========================================================================
   *                         DEVICE ERROR CODES
   *===========================================================================
   * The different error codes to be returned.
   */

  /* Request was unknown, can be returned by either BIOS (unknown handle) or
   * device driver (unknown function code). */
#define DEVICE_EUNKNOWN               -1

  /* Operation was performed successfully. */
#define DEVICE_SUCCESS                 0

  /* Device hardware not found, device is unusable. */
#define DEVICE_EDEVICE_NOT_FOUND       1

  /* Operation specified illegal (non existing) unit. */
#define DEVICE_EILLEGAL_UNIT           2

  /* Device does not support (implement) specified device type. */
#define DEVICE_EILLEGAL_DEVTYPE        3

  /* Device is already opened (and must be closed before opened again). */
#define DEVICE_EALREADY_OPENED         4

  /* Device is not opened (and cannot be used until opened). */
#define DEVICE_ENOT_OPENED             5

  /* Device is already started. */
#define DEVICE_EALREADY_STARTED        6

  /* Device is not started (and cannot be used until started). */
#define DEVICE_ENOT_STARTED            7

  /* Device hardware did not perform as expected. */
#define DEVICE_EHARDWARE_ERROR         8

  /* Function not available (not implemented). */
#define DEVICE_EFUNCTION_NOT_AVAILABLE 9

  /* An invalid/unknown tag in tag list. */
#define DEVICE_EINVALID_TAG           10

  /* A tag had an invalid value. */
#define DEVICE_EINVALID_VALUE         11

  /* Output queue full, failed to write. */
#define DEVICE_EQUEUE_FULL            12

  /* Failed to allocate buffer, failed to read. */
#define DEVICE_ENO_BUFFERS            13

  /* Invalid length in read or write request. */
#define DEVICE_EINVALID_LENGTH        15

  /* Receive buffer overflowed. */
#define DEVICE_EOVERFLOW_RX           16

  /* Bad initialization of the driver. Has <drvname>_init been called? */
#define DEVICE_EINIT                  17

  /* Physical link can not be established on this media */
#define DEVICE_ELINK_DOWN             18

  /*
   *===========================================================================
   *                    GENERIC TAGS
   *===========================================================================
   * Generic tags.
   */

  /* This tag signifies the end of a tag list. */
#define DEVICE_TAGEND       -1L

  /* This tag's parameter is a pointer to a DevTag variable that will contain a
     pointer to the tag that was unknown or had an invalid value. If no error
     is detected in the tag list the variable will be set to NULL */
#define DEVICE_TAGERRPTR    -2L

  /*
   *===========================================================================
   *                    DEVICE INFO TAGS
   *===========================================================================
   * Tags used for retrieving device information.
   */

  /* Return the lowest numbered unit. */
#define DEVICE_TAGD_UNITLO			0x100

  /* Return the highest numbered unit. */
#define DEVICE_TAGD_UNITHI			0x101

  /* Must client open all units at once? Needed by some old hardware where
     the units cannot be operated separately. */
#define DEVICE_TAGD_OPENALL			0x102

  /* Return the device name in the specified buffer. Buffer must be minimum
     32 characters large. */
#define DEVICE_TAGD_NAME			0x103

  /* Return the driver version. */
#define DEVICE_TAGD_VERSION			0x104

  /*
   *===========================================================================
   *                    UNIT INFO TAGS
   *===========================================================================
   * Tags used for retrieving unit information.
   */

  /* Return a 32 bit device type value for each supported device type. CHANGED VERSION 2. */
#define DEVICE_TAGU_DEVTYPES                    0x200

  /* Return non zero value if unit is open. */
#define DEVICE_TAGU_INUSE			0x201

  /* Return the hardware/driver limitation on MTU. */
#define DEVICE_TAGU_MAX_MTU			0x202

  /* Return the hardware/driver limitation on MRU. */
#define DEVICE_TAGU_MAX_MRU			0x203

  /* Return the number of supported device types. NEW VERSION 2. */
#define DEVICE_TAGU_NUMDEVTYPES                 0x204


/*
 *===========================================================================
 *                GENERIC SETCONF/GETCONF TAGS
 *===========================================================================
 * Generic tags used in ddGetConf() and ddSetConf().
 */

  /* Enable (1) or disable (0) hardware interrupts for this unit. NEW VERSION 2. */
#define DEVICE_TAGC_INTERRUPTS                  0x300

  /* Enable (1) or disable (0) ddWrite iovec functionality. NEW VERSION 2. */
#define DEVICE_TAGC_IOVEC                       0x301

   /* Enable (1) or disable (0) minimum receive unit one feature. */
#define DEVICE_TAGC_MIN_RU_ONE                  0x302

/*
 *===========================================================================
 *             DUAL VIRTUAL UNIT SETCONF/GETCONF TAGS
 *===========================================================================
 * Dual virtual unit tags used in ddGetConf() and ddSetConf().
 */

  /* Add buffer (in tagcList[1]) to pending free-list for the other unit. */
#define DEVICE_TAGC_PUSH                        0x310

  /* Set active unit to the unit specified by the tagcList[1]. */
#define DEVICE_TAGC_SET_UNIT                    0x311

  /* Let other unit handle the buffer pointed by tagcList[1]. */
#define DEVICE_TAGC_REDIRECT_BUFFER             0x312
   

  /*
  ****************************************************************************
  * 5  TYPES
  ****************************************************************************
  */
#ifndef _DEVICE_TYPES
#define _DEVICE_TYPES

  typedef S32 DevTag;
  typedef U32 DevErr;
  typedef U32 DevBool;

#endif
   
  /*
   *===========================================================================
   *                         ISRInfo
   *===========================================================================
   * ISRInfo contains information about the Interrupt Service Routines (ISR's)
   * needed by this driver.
   */

  struct ISRInfo
  {
    U32 numISRs;		/* Number of elements valid in the ISR array below. */

    struct
    {
      void (*entrypoint) (void);	/* Entry point for the Interrupt
					   Service Routine. */
      U32 priority;	/* Priority this interrupt operates on.
			   This value should be from 0 (highest) to 6
			   (lowest) priority. */
      U32 stacksize;	/* The stack size (in bytes) that this ISR
			   needs. */
      S32 vector;		/* The vector number the device hardware
				   generates on interrupt. */
    }ISR[4];			/* A maximum of four ISR's per unit. */
  };

  /*
   *===========================================================================
   *                         DcFuncs
   *===========================================================================
   */

  struct DcFuncs
  {
    void *(*dcAlloc) (void *dcObjects, U32 buflen);
    void (*dcFree) (void *dcObjects, void *buf);

    void (*dcHandleEX) (void *dcObjects, DevErr errorCode);
    void (*dcHandleRX) (void *dcObjects, void *buf, U32 buflen, U32 numFR);
    void (*dcHandleTX) (void *dcObjects, void *buf, U32 buflen, U32 numFW);
  };

  /*
   *===========================================================================
   *                         DdFuncs
   *===========================================================================
   * A client executing in supervisor mode might want to bypass the trap
   * interface for performance reasons. These functions can be obtained with
   * the DEVICE_FCFUNCTIONS BIOS call and can be called direct from the client.
   */

  struct DdFuncs
  {
    DevErr(*ddDevInfo) (DevTag * tagdList);
    DevErr(*ddUnitInfo) (U32 unit, DevTag * taguList);

    DevErr(*ddOpen) (U32 unit, U32 deviceType, void *dcObjects,
		     const struct DcFuncs * dcFuncs, struct ISRInfo * isrInfo);
    DevErr(*ddStart) (U32 unit);
    DevErr(*ddClose) (U32 unit);

    DevErr(*ddGetConf) (U32 unit, DevTag * tagcList);
    DevErr(*ddSetConf) (U32 unit, DevTag * tagcList);

    DevErr(*ddWrite) (U32 unit, void *buf, U32 * buflen);
    DevErr(*ddRead) (U32 unit, void *buf, U32 * buflen);
    DevErr(*ddSimInt) (U32 unit);   /* replaces ddPeek(). CHANGED VERSION 2. */ 

    DevErr(*ddAbortWrite) (U32 unit);
    DevErr(*ddAbortRead) (U32 unit);
  };

/* Device drivers (implementations) should define this symbol before including
   this file. Device clients should not define this symbol. */
#ifdef DEVICE_DRIVER

  /*
  ****************************************************************************
  * 6 DEVICE DRIVER FUNCTIONS
  ****************************************************************************
  */

  /*
   *===========================================================================
   *                    ddDevClass
   *===========================================================================
   * Description: ddDevClass() is called to verify that this BIOS module really
   *		  is a device driver according to this API.
   *		  The mechanism to verify this is designed as follows:
   *		  The function code for the DEVICE_FCDEVCLASS is an almost
   *		  random number. Any BIOS module not understanding this f-code
   *		  should return -1. 
   *		  The return value of this call is the constant DEVICE_CLASS,
   *		  another almost random number.
   *		  The probability of a BIOS module responding correctly to this
   *		  call without being a device driver is very low.
   *
   * Parameters:  none
   *
   * Returns:     the DEVICE_CLASS constant
   */

  static U32 ddDevClass(void);

  /*
   *===========================================================================
   *                    ddDevInfo
   *===========================================================================
   * Description: Returns information about the device.
   *
   * Parameters:  tagdList	A pointer to a tag list (array), terminated by
   *				the TAG_END tag.
   *
   * Returns:     DEVICE_SUCCESS
   *		  DEVICE_EINVALID_TAG
   */

  static DevErr ddDevInfo(DevTag * tagdList);

  /*
   *===========================================================================
   *                    ddUnitInfo
   *===========================================================================
   * Description: Returns information about the specified unit.
   *
   * Parameters:  taguList	A pointer to a tag list (array), terminated by
   *				the TAG_END tag.
   *
   * Returns:     DEVICE_SUCCESS
   *		  DEVICE_EINVALID_TAG
   */

  static DevErr ddUnitInfo(U32 unit, DevTag * taguList);

  /*
   *===========================================================================
   *                    ddOpen
   *===========================================================================
   * Description: Open the specified unit with the specified mode (device type).
   *
   * Parameters:  unit		Which unit to open.
   *		  deviceType	Automatic or manual mode.
   *		  dcObjects	The client object to be used in the call-backs.
   *		  dcFuncs	Pointer to a structure to be filled with
   *				pointers to the drivers static functions.
   *		  isrInfo	Pointer to a structure to be filled with
   *				information about the ISR this unit needs.
   *				Specify as NULL for polled mode.
   *
   * Returns:     DEVICE_SUCCESS
   *		  DEVICE_EILLEGAL_UNIT
   *		  DEVICE_EILLEGAL_DEVTYPE if specified mode (device type) is
   *					not supported.
   *		  DEVICE_EALREADY_OPENED
   *		  DEVICE_EFUNCTION_NOT_AVAILABLE polled mode not implemented.
   */

  static DevErr ddOpen(U32 unit, U32 deviceType, void *dcObjects,
		       const struct DcFuncs *dcFuncs, struct ISRInfo *isrInfo);

  /*
   *===========================================================================
   *                    ddClose
   *===========================================================================
   * Description: Close the specified unit, thus returning allocated buffers
   *		  and disabling the interrupts for the hardware etc.
   *
   * Parameters:  unit		Which unit to open.
   *
   * Returns:     DEVICE_SUCCESS
   *		  DEVICE_EILLEGAL_UNIT
   *		  DEVICE_ENOT_OPENED
   */

  static DevErr ddClose(U32 unit);

  /*
   *===========================================================================
   *                    ddSetConf
   *===========================================================================
   * Description: Change the configuration for the specified unit.
   *
   * Parameters:  unit		Which unit to change configuration for.
   *		  tagcList	A pointer to a tag list (array) specifying the
   *				configuration item to change and their new
   *				values.
   *
   * Returns:	  DEVICE_SUCCESS
   *		  DEVICE_EILLEGAL_UNIT
   *		  DEVICE_EINVALID_VALUE
   *		  DEVICE_EINVALID_TAG
   */

  static DevErr ddSetConf(U32 unit, DevTag * tagcList);

  /*
   *===========================================================================
   *                    ddGetConf
   *===========================================================================
   * Description: Obtain the configuration for the specified unit.
   *
   * Parameters:  unit		Which unit to change configuration for.
   *		  tagcList	A pointer to a tag list (array) specifying the
   *				configurations items whose values should be
   *				obtained.
   *
   * Returns:	  DEVICE_SUCCESS
   *		  DEVICE_EILLEGAL_UNIT
   *		  DEVICE_EINVALID_TAG
   */

  static DevErr ddGetConf(U32 unit, DevTag * tagcList);

  /*
   *===========================================================================
   *                    ddStart
   *===========================================================================
   * Description: Start the specified unit, enabling transmission and reception.
   *
   * Parameters:  unit		Which unit to start.
   *
   * Returns:	  DEVICE_SUCCESS
   *		  DEVICE_EILLEGAL_UNIT
   *		  DEVICE_ENOT_OPENED
   *		  DEVICE_EALREADY_STARTED
   */

  static DevErr ddStart(U32 unit);

  /*
   *===========================================================================
   *                    ddWrite
   *===========================================================================
   * Description: Hand of a packet (buffer) for transmission.
   *
   * Parameters:  unit		Which unit to write on.
   *		  buf		The buffer to write.
   *		  buflen	A pointer to a variable containing the length
   *				of the buffer. In polled mode this variable
   *				will be updated with the number of characters
   *				successfully transmitted.
   *
   * Returns:	  DEVICE_SUCCESS
   *		  DEVICE_EILLEGAL_UNIT
   *		  DEVICE_ENOT_OPENED
   *		  DEVICE_ENOT_STARTED
   *		  DEVICE_EINVALID_LENGTH buflen zero or larger than MTU.
   *		  DEVICE_EQUEUE_FULL	internal (hardware) queue is full
   *		  DEVICE_EFUNCTION_NOT_AVAILABLE function not available
   *					(not implemented)
   */

  static DevErr ddWrite(U32 unit, void *buf, U32 * buflen);

  /*
   *===========================================================================
   *                    ddRead
   *===========================================================================
   * Description: Manually request the read of a packet with the maximum size
   *		  specified in *buflen.
   *
   * Parameters:  unit		Which unit to read from.
   *		  buf		The buffer to write into.
   *		  buflen	A pointer to a variable containing the maximum
   *				length of the packet to read. In polled mode
   *				this variable will be updated with the number
   *				of characters successfully received.
   *
   * Returns:	  DEVICE_SUCCESS
   *		  DEVICE_EILLEGAL_UNIT
   *		  DEVICE_ENOT_OPENED
   *		  DEVICE_ENOT_STARTED
   *		  DEVICE_EFUNCTION_NOT_AVAILABLE called ddRead() in automatic
   *					(packet) mode or function not implemented.
   *		  DEVICE_EINVALID_LENGTH buflen zero or larger than MRU.
   *		  DEVICE_EQUEUE_FULL internal (hardware) queue is full
   */

  static DevErr ddRead(U32 unit, void *buf, U32 * buflen);

  /*
   *===========================================================================
   *                    ddSimInt
   *===========================================================================
   * Description: Check registers for new RX and TX events and simulate
   *              an interrupt by calling the ISR.
   *
   * Parameters:  unit		Which unit to check.
   *
   * Returns:	  DEVICE_SUCCESS
   *		  DEVICE_EILLEGAL_UNIT
   *		  DEVICE_ENOT_OPENED
   *		  DEVICE_ENOT_STARTED
   *		  DEVICE_EFUNCTION_NOT_AVAILABLE (if not implemented)
   */

  static DevErr ddSimInt(U32 unit);

  /*
   *===========================================================================
   *                    ddAbortWrite
   *===========================================================================
   * Description: Abort all pending write requests and return all buffers (with
   *		  actual values of written data) by calling dcHandleTX for each
   *		  buffer.
   *
   * Parameters:  unit		Which unit to abort write on.
   *
   * Returns:	  DEVICE_SUCCESS
   *		  DEVICE_EILLEGAL_UNIT
   *		  DEVICE_ENOT_OPENED
   *		  DEVICE_ENOT_STARTED
   */

  static DevErr ddAbortWrite(U32 unit);

  /*
   *===========================================================================
   *                    ddAbortRead
   *===========================================================================
   * Description: Abort all pending read requests and return all buffers (with
   *		  actual figures of read data) by calling dcHandleRX for each
   *		  buffer.
   *
   * Parameters:  unit		Which unit to abort read on.
   *
   * Returns:	  DEVICE_SUCCESS
   *		  DEVICE_EILLEGAL_UNIT
   *		  DEVICE_ENOT_OPENED
   *		  DEVICE_ENOT_STARTED
   */

  static DevErr ddAbortRead(U32 unit);

#endif /* #ifdef DEVICE_DRIVER */

  /*
  ****************************************************************************
  * 7 DEVICE CLIENT FUNCTIONS (example prototypes)
  ****************************************************************************
  */

  /*
   *===========================================================================
   *                    dcAlloc
   *===========================================================================
   * Description: Allocate one buffer (packet) to be used when receiving data.
   *		  dcAlloc will be called both in the client's context and in
   *		  the interrupt process' context.
   *
   * Parameters:  dcObject	The dcObjects parameter that was specified when
   *				the unit was opened.
   *		  buflen	The requested size of the buffer.
   *
   * Returns:	  A pointer to a buffer or NULL.
   *
   
   static void *dcAlloc(void *dcObjects, U32 buflen);
   
   */

   /*
   *===========================================================================
   *                    dcFree
   *===========================================================================
   * Description: Return (release) a previously allocated buffer. dcFree will
   *		  be called (in the client's context) when the clients calls
   *		  ddClose.
   *
   * Parameters:  dcObject	The dcObjects parameter that was specified when
   *				the unit was opened.
   *		  buf		Pointer to the buffer to be released.
   *
   * Returns:     Nothing.
   
   static void dcFree(void *dcObjects, void *buf);

   */

  

  /*
   *===========================================================================
   *                    dcHandleEX
   *===========================================================================
   * Description: Tells the client the something went wrong in the driver/
   *		  hardware and that the driver must be closed and opened again.
   *		  dcHandleEX must not call any device functions. dcHandleEX
   *		  will always be called in the interrupt process' context.
   *
   *              If the most significant bit in errorCode is set, the device
   *              signaled a fatal error and the device must be closed.
   *
   * Parameters:  dcObject	The dcObjects parameter that was specified when
   *				the unit was opened.
   *		  errorCode	A code describing the error that occurred.
   *
   * Returns:     Nothing.

   static void dcHandleEX(void *dcObjects, DevErr errorCode);

   */


  /*
   *===========================================================================
   *                    dcHandleRX
   *===========================================================================
   * Description: Called (in the interrupt process' context) when a packet has
   *		  been received. It is up to the device client to decide what
   *		  to do with this packet now.
   *		  dcHandleRX might also be called (in the client's context)
   *		  when the client calls ddClose or ddAbortRead.
   *
   * Parameters:  dcObject	The dcObjects parameter that was specified when
   *				the unit was opened.
   *		  buf		Pointer to the buffer (packet) that was
   *				received.
   *		  buflen	Size of the received packet.
   *		  numFailedReads Number of read requests (ddRead) that failed
   *		  		- because the internal queue was full - since
   *				the last dcHandleRX call.
   *
   * Returns:	  Nothing.

   static void dcHandleRX(void *dcObjects, void *buf, U32 buflen, U32 numFailedReads);

   */


  /*
   *===========================================================================
   *                    dcHandleTX
   *===========================================================================
   * Description: Called (in the interrupt process' context) when a packet has
   *		  been transmitted. It is up to the device client to decide
   *		  what to do with this packet now.
   *		  dcHandleTX might also be called (in the client's context)
   *		  when the client calls ddClose or ddAbortWrite.
   *
   * Parameters:  dcObject	The dcObjects parameter that was specified when
   *				the unit was opened.
   *		  buf		Pointer to the buffer (packet) that was
   *				transmitted.
   *		  buflen	Size of the transmitted packet.
   *		  numFailedWrites  Number of write requests (ddWrite) that
   *				failed - because the internal queue was full - 
   *				since the last dcHandleTX call.
   *
   * Returns:	  Nothing.

   static void dcHandleTX(void *dcObjects, void *buf, U32 buflen, U32 numFailedWrites);

   */

#ifdef __cplusplus
}
#endif

#endif
/* _DEVICE_H */