📄 miniport.h
字号:
//**********************************************************************
//
// Filename: miniport.h
//
// Description: Handles as much of the interface between the upper
// NDIS layer as possible.
//
// 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.
//
// Use of this source code is subject to the terms of the Cirrus end-user
// license agreement (EULA) under which you licensed this SOFTWARE PRODUCT.
// If you did not accept the terms of the EULA, you are not authorized to
// use this source code. For a copy of the EULA, please see the
// EULA.RTF on your install media.
//
// Copyright(c) Cirrus Logic Corporation 2005, All Rights Reserved
//
//**********************************************************************
#ifndef _H_MINIPORT
#define _H_MINIPORT
//
// BAUDRATE_INFO - Struct for array to maintain supported baud rates.
//
struct BAUDRATE_INFO
{
DWORD dwBPS;
// DWORD dwSpeedMask; // NDIS_IRDA_SPEED_Xxx mask.
DWORD dwCommSpeedMask; // Speed mask from GetCommProperties.
TCHAR *lpszDbgSpeed;
DWORD dwExtraBOFs;
};
typedef BAUDRATE_INFO * PBAUDRATE_INFO;
//
// Class that handles communication between the NDIS upper edge
// and the driver.
//
class IRMiniport : public IrdaHW
{
public:
IRMiniport::IRMiniport(NDIS_HANDLE hNdisAdapter):
m_ReceivePacketList( hNdisAdapter),
m_hNdisAdapter(hNdisAdapter),
m_fMediaBusy(FALSE),
m_ulNextBaudRate(0)
{
}
friend NDIS_STATUS MiniportInitialize
(
OUT PNDIS_STATUS OpenErrorStatus,
OUT PUINT SelectedMediumIndex,
IN PNDIS_MEDIUM MediumArray,
IN UINT MediumArraySize,
IN NDIS_HANDLE MiniportAdapterHandle,
IN NDIS_HANDLE WrapperConfigurationContext
);
friend VOID MiniportHalt(IN NDIS_HANDLE MiniportAdapterContext );
friend NDIS_STATUS MiniportQueryInformation
(
IN NDIS_HANDLE MiniportAdapterContext,
IN NDIS_OID Oid,
IN PVOID InformationBuffer,
IN ULONG InformationBufferLength,
OUT PULONG lpcbWritten,
OUT PULONG lpcbNeeded
);
friend NDIS_STATUS MiniportSetInformation
(
IN NDIS_HANDLE hContext,
IN NDIS_OID Oid,
IN PVOID lpvBuf,
IN ULONG cbBuf,
OUT PULONG lpcbRead,
OUT PULONG lpcbNeeded
);
friend NDIS_STATUS MiniportSetInformation
(
IN NDIS_HANDLE hContext,
IN NDIS_OID Oid,
IN PVOID lpvBuf,
IN ULONG cbBuf,
OUT PULONG lpcbRead,
OUT PULONG lpcbNeeded
);
friend NDIS_STATUS MiniportReset
(
OUT PBOOLEAN lpfAddressingReset,
IN NDIS_HANDLE hContext
);
friend NDIS_STATUS MiniportSend
(
IN NDIS_HANDLE MiniportAdapterContext,
IN PNDIS_PACKET Packet,
IN UINT Flags
);
friend VOID MiniportReturnPacket
(
IN NDIS_HANDLE MiniportAdapterContext,
IN PNDIS_PACKET Packet
);
friend DWORD WINAPI SIRInterruptHandler(LPVOID Handle);
NDIS_STATUS ChangeBaudRate( ULONG ulBaudRate);
private:
//
// Used by the interrupt handler and MiniportSend to update
// the put the next packet to be transmitted on the stack.
//
// Also enables the transmitt interrupt if a packet is
// available.
//
void GetNextSirPacket();
ReceiveList m_ReceivePacketList;
SendList m_SendPacketList;
BAUDRATE_INFO * m_pCurrBaud;
NDIS_HANDLE m_hNdisAdapter;
CRITICAL_SECTION m_ListCriticalSection;
//
// Are we currently busy.
//
BOOL m_fMediaBusy;
//
// Get the next baud rate.
//
ULONG m_ulNextBaudRate;
};
#endif // _H_MINIPORT
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -