/*++

    Copyright (c) Microsoft Corporation.  All rights reserved.

Rule Name:

    StorPortFindAdapter

Domain:

    storport

Rule ID:

    Not Applicable

Description:

    
    The FindAdapter routine must set the MaximumTransferLength and NumberOfPhysicalBreaks 
    fields in the PORT_CONFIGURATION_INFORMATION structure. 
    By default, the value of both these fields is SP_UNINITIALIZED_VALUE.
    If either of these fields is still set to SP_UNINITIALIZED_VALUE upon exit from
    FindAdapter, the driver fails the rule.

Help Link:

    https://go.microsoft.com/fwlink/?LinkId=507235

--*/



#include "ntddk_slic.h"

state {
	enum { success, failure } findAdapter = failure;
}

fun_SP_HW_FIND_ADAPTER.exit
{  
	if ($return == SP_RETURN_FOUND)
	{
		findAdapter = success;
	}
}
	
sdv_CheckConfig.exit
{	
	if ( (findAdapter == success) && (! ($return)) ) {
		abort "FindAdapter must initialize the MaximumTransferLength and NumberOfPhysicalBreaks fields of the PORT_CONFIGURATION_INFORMATION structure.";
	}
}
