NT4/private/ntos/dd/qic117/0x1104b.c
2020-09-30 17:12:29 +02:00

122 lines
3.1 KiB
C
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*****************************************************************************
*
* COPYRIGHT 1993 - COLORADO MEMORY SYSTEMS, INC.
* ALL RIGHTS RESERVED.
*
******************************************************************************
*
* FILE: \SE\DRIVER\Q117CD\SRC\0X1104B.C
*
* FUNCTION: cqd_EnablePerpendicularMode
*
* PURPOSE:
*
* HISTORY:
* $Log: J:\se.vcs\driver\q117cd\src\0x1104b.c $
*
* Rev 1.1 11 Nov 1993 15:21:06 KEVINKES
* Changed calls to cqd_inp and cqd_outp to kdi_ReadPort and kdi_WritePort.
* Modified the parameters to these calls. Changed FDC commands to be
* defines.
*
* Rev 1.0 08 Nov 1993 14:07:46 KEVINKES
* Initial Revision.
*
*****************************************************************************/
#define FCT_ID 0x1104b
#include "include\public\adi_api.h"
#include "include\public\frb_api.h"
#include "include\private\kdi_pub.h"
#include "include\private\cqd_pub.h"
#include "q117cd\include\cqd_defs.h"
#include "q117cd\include\cqd_strc.h"
#include "q117cd\include\cqd_hdr.h"
/*endinclude*/
dStatus cqd_EnablePerpendicularMode
(
/* INPUT PARAMETERS: */
CqdContextPtr cqd_context,
dBoolean enable_perp_mode
/* UPDATE PARAMETERS: */
/* OUTPUT PARAMETERS: */
)
/* COMMENTS: *****************************************************************
*
* DEFINITIONS: *************************************************************/
{
/* DATA: ********************************************************************/
dStatus status=ERR_NO_ERR; /* Status or error condition.*/
PerpMode perp_mode;
/* CODE: ********************************************************************/
if (cqd_context->device_descriptor.drive_class == QIC3020_DRIVE) {
perp_mode.command = FDC_CMD_PERP_MODE;
perp_mode.perp_setup = cqd_context->device_cfg.perp_mode_select;
perp_mode.perp_setup <<= PERP_SELECT_SHIFT;
perp_mode.perp_setup |= PERP_OVERWRITE_ON;
if (enable_perp_mode) {
/* Enable Perpendicular Mode */
if (!cqd_context->controller_data.perpendicular_mode) {
perp_mode.perp_setup |= PERP_WGATE_ON;
perp_mode.perp_setup |= PERP_GAP_ON;
if ((status = cqd_ProgramFDC(
cqd_context,
(dUByte *)&perp_mode,
sizeof(perp_mode),
dFALSE)) != DONT_PANIC) {
cqd_ResetFDC(cqd_context);
cqd_PauseTape(cqd_context);
} else {
cqd_context->controller_data.perpendicular_mode = dTRUE;
}
}
} else {
/* Disable Perpendicular Mode */
if (cqd_context->controller_data.perpendicular_mode) {
perp_mode.perp_setup &= ~PERP_WGATE_ON;
perp_mode.perp_setup &= ~PERP_GAP_ON;
if ((status = cqd_ProgramFDC(
cqd_context,
(dUByte *)&perp_mode,
sizeof(perp_mode),
dFALSE)) != DONT_PANIC) {
cqd_ResetFDC(cqd_context);
cqd_PauseTape(cqd_context);
return status;
}
cqd_context->controller_data.perpendicular_mode = dFALSE;
}
}
}
return status;
}