File: HalDevice.h

package info (click to toggle)
oss4 4.2-build2020-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 15,332 kB
  • sloc: ansic: 239,151; cpp: 18,981; sh: 4,590; pascal: 3,863; asm: 1,189; makefile: 553; php: 53; xml: 46
file content (92 lines) | stat: -rw-r--r-- 2,150 bytes parent folder | download
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
/****************************************************************************
 HalDevice.h

 Description:	Interface for the HalDevice class.

 Created: David A. Hoatson, September 2000
	
 Copyright  2000 Lynx Studio Technology, Inc.

 This software contains the valuable TRADE SECRETS and CONFIDENTIAL INFORMATION 
 of Lynx Studio Technology, Inc. The software is protected under copyright 
 laws as an unpublished work of Lynx Studio Technology, Inc.  Notice is 
 for informational purposes only and does not imply publication.  The user 
 of this software may make copies of the software for use with products 
 manufactured by Lynx Studio Technology, Inc. or under license from 
 Lynx Studio Technology, Inc. and for no other use.

 THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
 KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
 IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
 PURPOSE.

 Environment: 

 4 spaces per tab

 Revision History
 
 When      Who  Description
 --------- ---  ------------------------------------------------------------
****************************************************************************/

#ifndef _HALDEVICE_H
#define _HALDEVICE_H

#include "Hal.h"

enum
{
  MODE_STOP = 0,
  MODE_RUNNING,
  NUM_MODES
};

// This is the abstract class CHalDevice 
class CHalDevice
{
public:
  CHalDevice ()
  {
  }
   ~CHalDevice ()
  {
  }

  USHORT Open (PHALADAPTER pHalAdapter, ULONG ulDeviceNumber);
  USHORT Close ();

  ULONG GetDeviceNumber ()
  {
    return (m_ulDeviceNumber);
  }
  BOOLEAN IsRunning ()
  {
    return (m_usMode == MODE_RUNNING);
  }

  USHORT Start ();
  USHORT Stop ();

  USHORT RegisterCallback (PHALCALLBACK pCallback, PVOID pContext1,
			   PVOID pContext2);
  USHORT Service (ULONG ulReason);

  USHORT Acquire (void);
  USHORT Release (void);

protected:
  // allow these member variables to be accessed by child classes
  PHALADAPTER m_pHalAdapter;
  ULONG m_ulDeviceNumber;
  USHORT m_usMode;
  BOOLEAN m_bInUse;

  PHALCALLBACK m_pCallback;
  PVOID m_pContext1;
  PVOID m_pContext2;

private:
};

#endif // _HALDEVICE_H