source: cmedia/trunk/Drv16/idc_vdd.c@ 577

Last change on this file since 577 was 354, checked in by stevenhl, 18 years ago

Import untested baseline cmedia sources, work products and binaries
Binaries and work products should be deleted from repository.
once new builds are verified to work.

File size: 2.8 KB
Line 
1/* $Id: idc_vdd.c,v 1.1 2000/04/23 14:55:16 ktk Exp $ */
2
3#define INCL_16
4#define INCL_DOSINFOSEG
5#include <os2.h>
6
7#include "idc_vdd.h"
8#include <include.h>
9#include <devhelp.h>
10
11ULONG pLincodec = 0;
12
13ADAPTERINFO __far * pfcodec_info;
14ADAPTERINFO codec_info;
15USHORT usInUseCount = 0;
16USHORT usVDDHasHardware = FALSE;
17
18#pragma off (unreferenced);
19
20
21// -------------------------- IDCVddOPENPDD -
22// OS/2 MVDM kernel calls us to provide the IDC address
23// of the Virtual Device driver.
24// The VDD can also call (with address of NULL) to terminate
25// future IDC between the drivers.
26//
27ULONG IDCVddOPENPDD (ULONG ul1, ULONG ul2)
28{
29 // Nothing to do, we don't call the VDD
30 // ###should save the vdd entry point so we can call him later...
31 // we should inform him of shutdowns, apm events and when the hardware
32 // becomes free......
33 return (TRUE);
34}
35// -------------------- IDCVddQUERYPROTOCOL -
36ULONG IDCVddQUERYPROTOCOL (ULONG ul1, ULONG ul2)
37{
38 // if the VDD sends us Dead Beef
39 // We Return Dead Beef just like Hudson Foods !!
40 if (ul1 == IDC_PROTOCOL_LEVEL) {
41 return (IDC_PROTOCOL_LEVEL);
42 }
43 // Else Return junk
44 else {
45 return (-1);
46 } /* endif */
47}
48
49// ---------------------- IDCVddASSIGNHANDLE -
50ULONG IDCVddASSIGNHANDLE (ULONG ul1, ULONG ul2)
51{
52 return (FALSE);
53}
54// ---------------------- IDCVddOPENDEVICE -
55ULONG IDCVddOPENDEVICE (ULONG ul1, ULONG ul2)
56{
57 if (usInUseCount == 0) {
58 usVDDHasHardware = TRUE;
59 return (TRUE);
60 }
61 else {
62 return (FALSE);
63 } /* endif */
64}
65// -------------------- IDCVddCLOSEDEVICE -
66ULONG IDCVddCLOSEDEVICE (ULONG ul1, ULONG ul2)
67{
68 usVDDHasHardware = FALSE;
69 return (TRUE);
70}
71// ------------------ IDCVddGETIOPORTINFO -
72ULONG IDCVddGETIOPORTINFO (ULONG ul1, ULONG ul2)
73{
74 return (pLincodec);
75}
76// --------------------- IDCVddTRUSTEDOPEN -
77ULONG IDCVddTRUSTEDOPEN (ULONG ul1, ULONG ul2)
78{
79 return (FALSE);
80}
81
82
83ULONG (*IDCVddFuncs[]) (ULONG ul1, ULONG ul2) =
84{
85 IDCVddOPENPDD,
86 IDCVddQUERYPROTOCOL,
87 IDCVddASSIGNHANDLE,
88 IDCVddOPENDEVICE,
89 IDCVddCLOSEDEVICE,
90 IDCVddGETIOPORTINFO,
91 IDCVddTRUSTEDOPEN
92};
93USHORT MaxIDCVddFuncs = sizeof(IDCVddFuncs)/sizeof(USHORT);
94
95
96// ---------------------- IDCEntry_VDD_c -
97// Interface for other VDDs to call this device driver
98//
99ULONG pascal IDCEntry_VDD_c (ULONG ulFunc, ULONG ul1, ULONG ul2)
100{
101 if (ulFunc > MaxIDCVddFuncs) {
102 return (FALSE);
103 }
104 else {
105 return (IDCVddFuncs [ulFunc](ul1,ul2));
106 }
107}
Note: See TracBrowser for help on using the repository browser.