Beispiel #1
0
NTSTATUS
LspNoOperation (
	IN PLANSCSI_SESSION	LSS,
	IN UINT32			TargetId,
	OUT PBYTE			PduResponse,
	IN PLARGE_INTEGER	TimeOut
	)
{
	UINT8						PduBuffer[MAX_REQUEST_SIZE];
	PLANSCSI_H2R_PDU_HEADER		pRequestHeader;
	LANSCSI_PDU_POINTERS		pdu;
	NTSTATUS					status;

	// Check Parameters.

	if (PduResponse == NULL) {

		NDAS_ASSERT( FALSE );
		return STATUS_INVALID_PARAMETER;
	}

	//
	// Make Request.
	//
	memset(PduBuffer, 0, MAX_REQUEST_SIZE);
	
	pRequestHeader = (PLANSCSI_H2R_PDU_HEADER)PduBuffer;
	pRequestHeader->Opcode = NOP_H2R;
	pRequestHeader->HPID = HTONL(LSS->HPID);
	pRequestHeader->RPID = HTONS(LSS->RPID);
	LSS->CommandTag++;
	pRequestHeader->PathCommandTag = HTONL(LSS->CommandTag);
	pRequestHeader->TargetID = TargetId;

	// Send Request.

	pdu.pH2RHeader = (PLANSCSI_H2R_PDU_HEADER)pRequestHeader;

	status = LspSendRequest( LSS, &pdu, NULL, IF_NULL_TIMEOUT_THEN_DEFAULT(LSS, TimeOut) );

	if (status != STATUS_SUCCESS) {
	
		NDAS_ASSERT( status == STATUS_PORT_DISCONNECTED );

		KDPrintM( DBG_PROTO_ERROR, ("Error when Send Request.\n") );
		return status;
	}

	*PduResponse = LANSCSI_RESPONSE_SUCCESS;

	return STATUS_SUCCESS;
}
Beispiel #2
0
NTSTATUS
LspNoOperation(
		IN PLANSCSI_SESSION	LSS,
		IN UINT32			TargetId,
		OUT PBYTE			PduResponse,
		IN PLARGE_INTEGER	TimeOut
	)
{
	_int8								PduBuffer[MAX_REQUEST_SIZE];
	PLANSCSI_H2R_PDU_HEADER				pRequestHeader;
	LANSCSI_PDU_POINTERS				pdu;
	NTSTATUS							ntStatus;

	NDASSCSI_ASSERT( TimeOut == NULL || TimeOut->QuadPart < 0 );

	//
	// Check Parameters.
	//
	if(PduResponse == NULL) {
		KDPrintM(DBG_PROTO_ERROR, ("pResult is NULL!!!\n"));
		return STATUS_INVALID_PARAMETER;
	}

	//
	// Make Request.
	//
	memset(PduBuffer, 0, MAX_REQUEST_SIZE);
	
	pRequestHeader = (PLANSCSI_H2R_PDU_HEADER)PduBuffer;
	pRequestHeader->Opcode = NOP_H2R;
	pRequestHeader->HPID = HTONL(LSS->HPID);
	pRequestHeader->RPID = HTONS(LSS->RPID);
	LSS->CommandTag++;
	pRequestHeader->PathCommandTag = HTONL(LSS->CommandTag);
	pRequestHeader->TargetID = TargetId;

	//
	// Send Request.
	//
	pdu.pH2RHeader = (PLANSCSI_H2R_PDU_HEADER)pRequestHeader;

	ntStatus = LspSendRequest(LSS, &pdu, NULL, IF_NULL_TIMEOUT_THEN_DEFAULT(LSS, TimeOut));
	if(!NT_SUCCESS(ntStatus)) {
		KDPrintM(DBG_PROTO_ERROR, ("Error when Send Request.\n"));
		return ntStatus;
	}

	*PduResponse = LANSCSI_RESPONSE_SUCCESS;

	return STATUS_SUCCESS;
}
Beispiel #3
0
NTSTATUS
LspNoOperation(
	   IN PLANSCSI_SESSION	LSS,
		IN UINT32			TargetId,
	   OUT PBYTE			PduResponse
	)
{
	_int8								PduBuffer[MAX_REQUEST_SIZE];
	PLANSCSI_H2R_PDU_HEADER				pRequestHeader;
	LANSCSI_PDU_POINTERS				pdu;
	NTSTATUS							ntStatus;

	//
	// Check Parameters.
	//
	if(PduResponse == NULL) {
		KDPrintM(DBG_PROTO_ERROR, ("pResult is NULL!!!\n"));
		return STATUS_INVALID_PARAMETER;
	}

	//
	// Make Request.
	//
	memset(PduBuffer, 0, MAX_REQUEST_SIZE);
	
	pRequestHeader = (PLANSCSI_H2R_PDU_HEADER)PduBuffer;
	pRequestHeader->Opcode = NOP_H2R;
	pRequestHeader->HPID = HTONL(LSS->HPID);
	pRequestHeader->RPID = HTONS(LSS->RPID);
	pRequestHeader->PathCommandTag = HTONL(++LSS->CommandTag);
	pRequestHeader->TargetID = TargetId;

	//
	// Send Request.
	//
	pdu.pH2RHeader = (PLANSCSI_H2R_PDU_HEADER)pRequestHeader;

	ntStatus = LspSendRequest(LSS, &pdu, NULL);
	if(!NT_SUCCESS(ntStatus)) {
		KDPrintM(DBG_PROTO_ERROR, ("Error when Send Request.\n"));
		return ntStatus;
	}

	if (LSS->HWVersion == LANSCSIIDE_VERSION_2_5) {
		// NDAS 2.5 replies to NOP
		// Read Reply.
		ntStatus = LspReadReply(LSS, (PCHAR)PduBuffer, &pdu, NULL);
		if(!NT_SUCCESS(ntStatus)) {
			KDPrintM(DBG_PROTO_ERROR, ("Error when read request.\n"));
			return ntStatus;
		}
		if (NOP_R2H != pdu.pR2HHeader->Opcode) {
			KDPrintM(DBG_PROTO_ERROR, ("Invalid opcode %x replied to NOP.\n", pdu.pR2HHeader->Opcode));
			return ntStatus;
		}
	} else {

	}
	*PduResponse = LANSCSI_RESPONSE_SUCCESS;

	return STATUS_SUCCESS;
}