ReactOS  0.4.15-dev-2350-g7194f2f
ParaNdis-Oid.h
Go to the documentation of this file.
1 /*
2  * This file contains common for NDIS5/NDIS6 definition,
3  * related to OID support
4  *
5  * Copyright (c) 2008-2017 Red Hat, Inc.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met :
10  * 1. Redistributions of source code must retain the above copyright
11  * notice, this list of conditions and the following disclaimer.
12  * 2. Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and / or other materials provided with the distribution.
15  * 3. Neither the names of the copyright holders nor the names of their contributors
16  * may be used to endorse or promote products derived from this software
17  * without specific prior written permission.
18  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND
19  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21  * ARE DISCLAIMED.IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE
22  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28  * SUCH DAMAGE.
29  */
30 #ifndef PARANDIS_COMMON_OID_H
31 #define PARANDIS_COMMON_OID_H
32 
33 #include "ndis56common.h"
34 
35 /**********************************************************
36 Wrapper for all the data, related to any OID request
37 ***********************************************************/
38 typedef struct _tagOidDesc
39 {
40  NDIS_OID Oid; // oid code
41  ULONG ulToDoFlags; // combination of eOidHelperFlags
42  PVOID InformationBuffer; // buffer received from NDIS
44  PUINT pBytesWritten; // OUT for query/method
45  PUINT pBytesNeeded; // OUT for query/set/method when length of buffer is wrong
46  PUINT pBytesRead; // OUT for set/method
47  PVOID Reserved; // Reserved for pending requests
48 } tOidDesc;
49 
50 typedef NDIS_STATUS (*OIDHANDLERPROC)(PARANDIS_ADAPTER *pContext, tOidDesc *pOid);
51 
52 typedef struct _tagOidWhatToDo
53 {
54  NDIS_OID oid; // oid number
55  int nEntryLevel; // do print on entry level
56  int nExitFailLevel; // do print on exit if failed
57  int nExitOKLevel; // do print on exit if OK
59  OIDHANDLERPROC OidSetProc; // procedure to call on SET
60  const char *name; // printable name
62 
63 
64 typedef enum _tageOidHelperFlags {
65  ohfQuery = 1, // can be queried
66  ohfSet = 2, // can be set
68  ohfQueryStatOnly = 4, // redirect query stat to query
70  ohfQuery3264 = 8 | ohfQuery, // convert 64 to 32 on query
71  ohfQueryStat3264 = 8 | ohfQueryStat, // convert 64 to 32 on query stat
72  ohfSetLessOK = 16, // on set: if buffer is smaller, cleanup and copy
73  ohfSetMoreOK = 32 // on set: if buffer is larger, copy anyway
75 
76 
77 
78 
79 /**********************************************************
80 Common procedures related to OID support
81 ***********************************************************/
83 NDIS_STATUS ParaNdis_OidQueryCopy(tOidDesc *pOid, PVOID pInfo, ULONG ulSize, BOOLEAN bFreeInfo);
92 NDIS_STATUS ParaNdis_OidSetCopy(tOidDesc *pOid, PVOID pDest, ULONG ulSize);
95 
96 
97 const char *ParaNdis_OidName(NDIS_OID oid);
98 /**********************************************************
99 Procedures to be implemented in NDIS5/NDIS6 specific modules
100 ***********************************************************/
101 void ParaNdis_GetSupportedOid(PVOID *pOidsArray, PULONG pLength);
103 
104 #endif
void ParaNdis_GetSupportedOid(PVOID *pOidsArray, PULONG pLength)
void ParaNdis_FillPowerCapabilities(PNDIS_PNP_CAPABILITIES pCaps)
Definition: ParaNdis-Oid.c:138
ASMGENDATA Table[]
Definition: genincdata.c:61
NDIS_STATUS ParaNdis_OnRemoveWakeupPattern(PARANDIS_ADAPTER *pContext, tOidDesc *pOid)
Definition: ParaNdis-Oid.c:606
NDIS_STATUS ParaNdis_OnSetPacketFilter(PARANDIS_ADAPTER *pContext, tOidDesc *pOid)
Definition: ParaNdis-Oid.c:118
enum _tageOidHelperFlags eOidHelperFlags
UINT InformationBufferLength
Definition: ParaNdis-Oid.h:43
ULONG NDIS_OID
Definition: ntddndis.h:230
ULONG ulToDoFlags
Definition: ParaNdis-Oid.h:41
PVOID InformationBuffer
Definition: ParaNdis-Oid.h:42
OIDHANDLERPROC OidSetProc
Definition: ParaNdis-Oid.h:59
int NDIS_STATUS
Definition: ntddndis.h:471
const char * ParaNdis_OidName(NDIS_OID oid)
Definition: ParaNdis-Oid.c:456
unsigned char BOOLEAN
const char * name
Definition: ParaNdis-Oid.h:60
NDIS_STATUS ParaNdis_OidQueryCopy(tOidDesc *pOid, PVOID pInfo, ULONG ulSize, BOOLEAN bFreeInfo)
Definition: ParaNdis-Oid.c:178
NDIS_STATUS ParaNdis_OnOidSetMulticastList(PARANDIS_ADAPTER *pContext, tOidDesc *pOid)
Definition: ParaNdis-Oid.c:150
static NDIS_STATUS ParaNdis_OidQuery(PARANDIS_ADAPTER *pContext, tOidDesc *pOid)
NDIS_STATUS ParaNdis_OnSetVlanId(PARANDIS_ADAPTER *pContext, tOidDesc *pOid)
Definition: ParaNdis-Oid.c:645
PUINT pBytesRead
Definition: ParaNdis-Oid.h:46
PUINT pBytesNeeded
Definition: ParaNdis-Oid.h:45
NDIS_STATUS ParaNdis_OidQueryCommon(PARANDIS_ADAPTER *pContext, tOidDesc *pOid)
Definition: ParaNdis-Oid.c:225
struct _tagOidWhatToDo tOidWhatToDo
void ParaNdis_GetOidSupportRules(NDIS_OID oid, tOidWhatToDo *pRule, const tOidWhatToDo *Table)
Definition: ParaNdis-Oid.c:661
NDIS_STATUS ParaNdis_OnEnableWakeup(PARANDIS_ADAPTER *pContext, tOidDesc *pOid)
Definition: ParaNdis-Oid.c:627
NDIS_OID Oid
Definition: ParaNdis-Oid.h:40
unsigned int * PULONG
Definition: retypes.h:1
_tageOidHelperFlags
Definition: ParaNdis-Oid.h:64
unsigned int UINT
Definition: ndis.h:50
PUINT pBytesWritten
Definition: ParaNdis-Oid.h:44
unsigned int ULONG
Definition: retypes.h:1
PVOID Reserved
Definition: ParaNdis-Oid.h:47
struct _tagOidDesc tOidDesc
NDIS_STATUS ParaNdis_OnAddWakeupPattern(PARANDIS_ADAPTER *pContext, tOidDesc *pOid)
Definition: ParaNdis-Oid.c:584
NDIS_STATUS ParaNdis_OidSetCopy(tOidDesc *pOid, PVOID pDest, ULONG ulSize)
Definition: ParaNdis-Oid.c:66
NDIS_STATUS ParaNdis_OnSetPower(PARANDIS_ADAPTER *pContext, tOidDesc *pOid)
unsigned int * PUINT
Definition: ndis.h:50
NDIS_STATUS(* OIDHANDLERPROC)(PARANDIS_ADAPTER *pContext, tOidDesc *pOid)
Definition: ParaNdis-Oid.h:50
NDIS_STATUS ParaNdis_OnSetLookahead(PARANDIS_ADAPTER *pContext, tOidDesc *pOid)
Definition: ParaNdis-Oid.c:640