⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pnpproc.c

📁 Windows CE 6.0 BSP for VOIP sample phone. Intel PXA270 platform.
💻 C
字号:
//
// Copyright (c) Microsoft Corporation.  All rights reserved.
//
//
// Use of this sample source code is subject to the terms of the Microsoft
// license agreement under which you licensed this sample source code. If
// you did not accept the terms of the license agreement, you are not
// authorized to use this sample source code. For the terms of the license,
// please see the license agreement between you and Microsoft or, if applicable,
// see the LICENSE.RTF on your install media or the root of your tools installation.
// THE SAMPLE SOURCE CODE IS PROVIDED "AS IS", WITH NO WARRANTIES OR INDEMNITIES.
//
/******************* ?Marvell Semiconductor, Inc., 2001-2004 *****************
 *
 *  Purpose:    This module provides PnP and Power management routine
 *
 *	$Author: schiu $
 *
 *	$Date: 2004/08/20 $
 *
 *	$Revision: #1 $
 *
 *****************************************************************************/


/*
===============================================================================
                                 INCLUDE FILES
===============================================================================
*/
#include "precomp.h"


/*
===============================================================================
                           CODED PUBLIC PROCEDURES
===============================================================================
*/

/******************************************************************************
 *
 *  Name: MrvDrvPnPEventNotify()
 *
 *  Description: 
 *
 *  Conditions for Use: NDIS wrapper will call MrvDrvPnPEventNotify() to notify PnP event
 *						WINXP specific function
 *  Arguments:
 *
 *    IN NDIS_HANDLE  MiniportAdapterContext,
 *    IN NDIS_DEVICE_PNP_EVENT  PnPEvent,
 *    IN PVOID  InformationBuffer,
 *    IN ULONG  InformationBufferLength
 *    
 *  Return Value: none
 * 
 *  Notes:   
 *
 *****************************************************************************/
VOID
MrvDrvPnPEventNotify(
    IN NDIS_HANDLE  MiniportAdapterContext,
    IN NDIS_DEVICE_PNP_EVENT  PnPEvent,
    IN PVOID  InformationBuffer,
    IN ULONG  InformationBufferLength
)
{
	PMRVDRV_ADAPTER Adapter;
	//NDIS_POWER_PROFILE PWProfile;
	// BOOLEAN timerStatus;

	Adapter = (PMRVDRV_ADAPTER)(MiniportAdapterContext);
	   
	switch( PnPEvent )
	{
		case NdisDevicePnPEventSurpriseRemoved:

			DBGPRINT(DBG_PNP|DBG_LOAD|DBG_OID,("PNP - Got NdisDevicePnPEventSurpriseRemoved event !!! \n"));
			Adapter->SurpriseRemoved = TRUE;

			FreeAdapter(Adapter);

			DBGPRINT(DBG_PNP|DBG_LOAD,("**** PNP - Finished NdisDevicePnPEventSurpriseRemoved ****\n"));

			break;
/*
		case NdisDevicePnPEventPowerProfileChanged:

			PWProfile = *((PNDIS_POWER_PROFILE)InformationBuffer);

			if ( PWProfile == NdisPowerProfileBattery )
			{
            			DBGPRINT(DBG_PNP | DBG_LOAD,("PNP - Power profile has been changed to NdisPowerProfileBattery !!! \n"));
			
            			// only set TX power if OS/App did not set the desired power
            			if ( Adapter->TxPowerLevelIsSetByOS == FALSE )
            			{
                			Adapter->CurrentTxPowerLevel = HostCmd_ACT_TX_POWER_INDEX_MID;
			    
			    		// Set Tx power to battery profile
			    		PrepareAndSendCommand(
							Adapter,
							HostCmd_CMD_802_11_RF_TX_POWER,
				  		       HostCmd_ACT_TX_POWER_OPT_SET_MID,
				    			HostCmd_OPTION_USE_INT,
				    			0,
				    			HostCmd_PENDING_ON_NONE,
				    			0,
				    			FALSE,
				    			NULL,
				    			NULL,
				    			NULL,
				    			NULL);
            			}
			}
			else
			{ 
				// NdisPowerProfileAcOnLine
				DBGPRINT(DBG_PNP| DBG_LOAD,("PNP - Power profile has been changed to NdisPowerProfileAcOnLine !!! \n"));
				
            			// only set TX power if OS/App did not set the desired power
           	 		if ( Adapter->TxPowerLevelIsSetByOS == FALSE )
            			{
					USHORT usValue;

#ifdef MRV_CHIP_8385PN
					usValue = 17;
#elif defined(MRV_CHIP_8381PN)
					usValue = 15;
#elif defined(MRV_CHIP_8381P)
					usValue = 15;
#elif defined(MRV_CHIP_8305)
					usValue = 19;
#elif defined(MRV_CHIP_8385H)
					usValue = 17;							
#else
					usValue = 15;
#endif 
			    		Adapter->CurrentTxPowerLevel = HostCmd_ACT_TX_POWER_INDEX_HIGH;
			    
			    		// Set Tx power to AC profile
			    		// Set Tx power to battery profile
					//
					//PrepareAndSendCommand(
				    	//		Adapter,
				    	//		HostCmd_CMD_802_11_RF_TX_POWER, 
				    	//		HostCmd_ACT_TX_POWER_OPT_SET,
					//			HostCmd_OPTION_USE_INT,
				    	//		0,
				    	//		HostCmd_PENDING_ON_NONE,
				    	//		0,
				    	//		FALSE,
				    	//		NULL,
				    	//		NULL,
				    	//		NULL,
				    	//		&usValue);
					//
					
			    		PrepareAndSendCommand(
				    			Adapter,
				    			HostCmd_CMD_802_11_RF_TX_POWER,
				    			HostCmd_ACT_TX_POWER_OPT_SET_HIGH,
				    			HostCmd_OPTION_USE_INT,
				    			0,
				    			HostCmd_PENDING_ON_NONE,
				    			0,
				    			FALSE,
				    			NULL,
				    			NULL,
				    			NULL,
				    			NULL);
				   			
            			}
			}
			break;
*/						
	}

	return;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -