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

105 lines
2.2 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 (C) 1990-1992 COLORADO MEMORY SYSTEMS, INC.
* COPYRIGHT (C) 1992-1994 HEWLETT-PACKARD COMPANY
*
******************************************************************************
*
* FILE: \SE\DRIVER\Q117CD\SRC\0X11059.C
*
* FUNCTION: cqd_SetXferRates
*
* PURPOSE: Sets the slow and fast transfer rates in the CQD context
*
* HISTORY:
* $Log: J:\se.vcs\driver\q117cd\src\0x11059.c $
*
* Rev 1.0 09 Dec 1994 09:32:16 MARKMILL
* Initial revision.
*
*****************************************************************************/
#define FCT_ID 0x11059
#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*/
dVoid cqd_SetXferRates
(
/* INPUT PARAMETERS: */
CqdContextPtr cqd_context
/* UPDATE PARAMETERS: */
/* OUTPUT PARAMETERS: */
)
/* COMMENTS: *****************************************************************
*
* This function determines the fastest and slowest transfer rates that are
* supported by the FDC and tape drive. The results are stored in the
* CQD context.
*
* DEFINITIONS: *************************************************************/
{
/* DATA: ********************************************************************/
dUByte rate=0;
dUByte tape_rates=0;
/* CODE: ********************************************************************/
tape_rates =
(dUByte)(cqd_context->device_cfg.supported_rates &
cqd_context->floppy_tape_parms.tape_rates);
rate = XFER_2Mbps;
do {
if ((rate & tape_rates) != 0) {
cqd_context->tape_cfg.xfer_fast = (dUByte)rate;
rate = 0;
} else {
rate >>= 1;
}
} while (rate != 0);
rate = XFER_250Kbps;
do {
if ((rate & tape_rates) != 0) {
cqd_context->tape_cfg.xfer_slow = (dUByte)rate;
rate = 0;
} else {
rate <<= 1;
}
} while ((rate <= XFER_2Mbps) && (rate != 0));
if (cqd_context->tape_cfg.xfer_slow !=
cqd_context->tape_cfg.xfer_fast) {
cqd_context->tape_cfg.speed_change_ok = dTRUE;
} else {
cqd_context->tape_cfg.speed_change_ok = dFALSE;
}
}