📄 scsitestlib.c
字号:
SCSI_PHYS_DEV *pScsiPhysDev /* ptr to SCSI physical device */ ) { if (scsiErase (pScsiPhysDev, TRUE) == ERROR) { printf ("Failed tape ERASE\n"); return (ERROR); } TEST_VERBOSE ("\tPass tape ERASE\n"); return (OK); }/******************************************************************************** scsiTestWrtFileMarks - runs tape WRITE FILE MARKS command** This routine executes the tape WRITE FILE MARKS command to the specified* SCSI physical device.** RETURNS: OK if passes, or ERROR if an error is encountered.*/STATUS scsiTestWrtFileMarks ( SCSI_PHYS_DEV *pScsiPhysDev, /* ptr to SCSI physical device */ int numMarks, /* number of file marks to write */ BOOL shortMark /* TRUE to write short file mark */ ) { if (scsiWrtFileMarks (pScsiPhysDev, numMarks, shortMark) == ERROR) { printf ("Failed tape WRITE FILE MARKS\n"); return (ERROR); } TEST_VERBOSE ("\tPass tape WRITE FILE MARKS\n"); return (OK); }/******************************************************************************** scsiTestSpace - runs tape SPACE command** This routine executes the tape SPACE command to the specified* SCSI physical device.** RETURNS: OK if passes, or ERROR if an error is encountered.*/STATUS scsiTestSpace ( SCSI_PHYS_DEV *pScsiPhysDev, /* ptr to SCSI physical device */ int count, /* count for space command */ int spaceCode /* code for the type of space command */ ) { if (scsiSpace (pScsiPhysDev, count, spaceCode) == ERROR) { printf ("Failed tape SPACE\n"); return (ERROR); } TEST_VERBOSE ("\tPass tape SPACE\n"); return (OK); }/******************************************************************************** scsiTestWrtTapeVar - runs tape WRITE command for variable block size** This routine executes the tape WRITE command to the specified* SCSI physical device. Data is written using variable block size.** RETURNS: OK if passes, or ERROR if an error is encountered.*/STATUS scsiTestWrtTapeVar ( SCSI_PHYS_DEV *pScsiPhysDev, /* ptr to SCSI physical device */ int numBytes, /* total bytes to be written */ char *buffer /* ptr to input data buffer */ ) { if (scsiWrtTape (pScsiPhysDev, numBytes, buffer, FALSE) == ERROR) { printf ("Failed tape WRITE Var\n"); return (ERROR); } TEST_VERBOSE ("\tPass tape WRITE Var\n"); return (OK); }/******************************************************************************** scsiTestRdTapeVar - runs tape READ command for variable block size** This routine executes the tape READ command to the specified* SCSI physical device. Data is written using variable block size.** RETURNS: OK if passes, or ERROR if an error is encountered.*/STATUS scsiTestRdTapeVar ( SCSI_PHYS_DEV *pScsiPhysDev, /* ptr to SCSI physical device */ int numBytes, /* total bytes to be written */ char *buffer /* ptr to input data buffer */ ) { if (scsiRdTape (pScsiPhysDev, numBytes, buffer, FALSE) == ERROR) { printf ("Failed tape READ Var\n"); return (ERROR); } TEST_VERBOSE ("\tPass tape READ Var\n"); return (OK); }/******************************************************************************** scsiTestWrtTapeFixed - runs tape WRITE command for fixed block size** This routine executes the tape WRITE command to the specified* SCSI physical device. Data is written using fixed block size.** RETURNS: OK if passes, or ERROR if an error is encountered.*/STATUS scsiTestWrtTapeFixed ( SCSI_PHYS_DEV *pScsiPhysDev, /* ptr to SCSI physical device */ int numBytes, /* total bytes to be written */ char *buffer /* ptr to input data buffer */ ) { if (scsiWrtTape (pScsiPhysDev, numBytes, buffer, TRUE) == ERROR) { printf ("Failed tape WRITE Fixed\n"); return (ERROR); } TEST_VERBOSE ("\tPass tape WRITE Fixed\n"); return (OK); }/******************************************************************************** scsiTestRdTapeFixed - runs tape READ command for fixed block size** This routine executes the tape READ command to the specified* SCSI physical device. Data is written using fixed block size.** RETURNS: OK if passes, or ERROR if an error is encountered.*/STATUS scsiTestRdTapeFixed ( SCSI_PHYS_DEV *pScsiPhysDev, /* ptr to SCSI physical device */ int numBytes, /* total bytes to be written */ char *buffer /* ptr to input data buffer */ ) { if (scsiRdTape (pScsiPhysDev, numBytes, buffer, TRUE) == ERROR) { printf ("Failed tape READ Fixed\n"); return (ERROR); } TEST_VERBOSE ("\tPass tape READ Fixed\n"); return (OK); }#endif/*DIRECT ACCESS COMMANDS *//******************************************************************************** scsiTestModeSense - runs disk MODE SENSE command** This routine executes the disk MODE SENSE command to the specified* SCSI physical device.** RETURNS: OK if passes, or ERROR if an error is encountered.*/STATUS scsiTestModeSense ( SCSI_PHYS_DEV *pScsiPhysDev, /* ptr to SCSI physical device */ int pageControl, /* value of the page control field */ int pageCode, /* value of the page code field */ char *buffer, /* ptr to data buffer */ int bufLength /* length of buffer in bytes */ ) { if (scsiModeSense (pScsiPhysDev, pageControl, pageCode, buffer, bufLength) == ERROR) { printf ("Failed disk MODE SENSE\n"); return (ERROR); } TEST_VERBOSE ("\tPass disk MODE SENSE\n"); return (OK); }/******************************************************************************** scsiTestModeSelect - runs disk MODE SELECT command** This routine executes the disk MODE SELECT command to the specified* SCSI physical device.** RETURNS: OK if passes, or ERROR if an error is encountered.*/STATUS scsiTestModeSelect ( SCSI_PHYS_DEV *pScsiPhysDev, /* ptr to SCSI physical device */ int pageFormat, /* value of the page format bit */ int saveParams, /* value of the save parameters bit */ char *buffer, /* ptr to data buffer */ int bufLength /* length of buffer in bytes */ ) { if (scsiModeSelect (pScsiPhysDev, pageFormat, saveParams, buffer, bufLength) == ERROR) { printf ("Failed disk MODE SELECT\n"); return (ERROR); } TEST_VERBOSE ("\tPass disk MODE SELECT\n"); return (OK); }/******************************************************************************** scsiTestReserve - runs disk RESERVE command** This routine executes the disk RESERVE command to the specified* SCSI physical device.** RETURNS: OK if passes, or ERROR if an error is encountered.*/STATUS scsiTestReserve ( SCSI_PHYS_DEV *pScsiPhysDev ) { if (scsiReserve (pScsiPhysDev) == ERROR) { printf ("Failed disk RESERVE\n"); return (ERROR); } TEST_VERBOSE ("\tPass disk RESERVE\n"); return (OK); }/******************************************************************************** scsiTestRelease - runs disk RELEASE command** This routine executes the disk RELEASE command to the specified* SCSI physical device.** RETURNS: OK if passes, or ERROR if an error is encountered.*/STATUS scsiTestRelease ( SCSI_PHYS_DEV *pScsiPhysDev ) { if (scsiRelease (pScsiPhysDev) == ERROR) { printf ("Failed disk RELEASE\n"); return (ERROR); } TEST_VERBOSE ("\tPass disk RELEASE\n"); return (OK); }/******************************************************************************** scsiTestReadCapacity - runs disk READ CAPACITY command** This routine executes the disk READ CAPACITY command to the specified* SCSI physical device.** RETURNS: OK if passes, or ERROR if an error is encountered.*/STATUS scsiTestReadCapacity ( SCSI_PHYS_DEV *pScsiPhysDev,/* ptr to SCSI physical device */ int *pLastLBA, /* last logical block address */ int *pBlkLength /* where to return block length */ ) { if (scsiReadCapacity (pScsiPhysDev, pLastLBA, pBlkLength) == ERROR) { printf ("Failed disk READ CAPACITY\n"); return (ERROR); } TEST_VERBOSE ("\tPass disk READ CAPACITY\n"); return (OK); }/******************************************************************************** scsiTestRdSecs - runs disk READ command** This routine executes the disk READ command to the specified* SCSI physical device.** RETURNS: OK if passes, or ERROR if an error is encountered.*/STATUS scsiTestRdSecs ( SCSI_BLK_DEV *pScsiBlkDev, /* ptr to SCSI block device info */ int sector, /* sector number to be read */ int numSecs, /* total sectors to be read */ char *buffer /* ptr to input data buffer */ ) { if (scsiRdSecs (pScsiBlkDev, sector, numSecs, buffer) == ERROR) { printf ("Failed disk READ\n"); return (ERROR); } TEST_VERBOSE ("\tPass disk READ\n"); return (OK); }/******************************************************************************** scsiTestWrtSecs - runs disk WRITE command** This routine executes the disk WRITE command to the specified* SCSI physical device.** RETURNS: OK if passes, or ERROR if an error is encountered.*/STATUS scsiTestWrtSecs ( SCSI_BLK_DEV *pScsiBlkDev, /* ptr to SCSI block device info */ int sector, /* sector number to be written */ int numSecs, /* total sectors to be written */ char *buffer /* ptr to output data buffer */ ) { if (scsiWrtSecs (pScsiBlkDev, sector, numSecs, buffer) == ERROR) { printf ("Failed disk WRITE\n"); return (ERROR); } TEST_VERBOSE ("\tPass disk WRITE\n"); return (OK); }/******************************************************************************** scsiTestStartStopUnit - runs disk START STOP UNIT command** This routine executes the disk START STOP UNIT command to the specified* SCSI physical device.** RETURNS: OK if passes, or ERROR if an error is encountered.*/STATUS scsiTestStartStopUnit ( SCSI_PHYS_DEV *pScsiPhysDev, /* ptr to SCSI physical device */ BOOL start /* TRUE == start, FALSE == stop */ ) { if (scsiStartStopUnit (pScsiPhysDev, start) == ERROR) { printf ("Failed disk START STOP UNIT\n"); return (ERROR); } TEST_VERBOSE ("\tPass disk START STOP UNIT\n"); return (OK); }/******************************************************************************** scsiTestFormatUnit - runs disk FORMAT UNIT command** This routine executes the disk FORMAT UNIT command to the specified* SCSI physical device.** RETURNS: OK if passes, or ERROR if an error is encountered.*/STATUS scsiTestFormatUnit ( SCSI_PHYS_DEV *pScsiPhysDev,/* ptr to SCSI physical device */ BOOL cmpDefectList, /* whether defect list is complete */ int defListFormat, /* defect list format */ int vendorUnique, /* vendor unique byte */ int interleave, /* interleave factor */ char *buffer, /* ptr to input data buffer */ int bufLength /* length of buffer in bytes */ ) { if (scsiFormatUnit (pScsiPhysDev, cmpDefectList, defListFormat, vendorUnique, interleave, buffer, bufLength) == ERROR) { printf ("Failed disk FORMAT UNIT\n"); return (ERROR); } TEST_VERBOSE ("\tPass disk FORMAT UNIT\n"); return (OK); }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -