您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 信息化管理 > Advanced SCSI Programming Interface
November6,20011AdaptecAdvancedSCSIProgrammingInterfaceASPIforWin32TechnicalReferenceNovember6,2001åNovember6,20012AdaptecCopyrightCopyright©1989-2001Adaptec,Inc.Allrightsreserved.Nopartofthispublicationmaybereproduced,storedinaretrievalsystem,ortransmittedinanyformorbyanymeans,electronic,mechanical,photocopying,recordingorotherwise,withoutthepriorwrittenconsentofAdaptec,Inc.,691SouthMilpitasBlvd.,Milpitas,CA95035.TrademarksAdaptec,theAdapteclogo,andAHAaretrademarksofAdaptec,Inc.whichmayberegisteredinsomejurisdictions.Allothertrademarksareownedbytheirrespectiveowners.ChangesThematerialinthisdocumentisforinformationonlyandissubjecttochangewithoutnotice.Whilereasonableeffortshavebeenmadeinthepreparationofthisdocumenttoassureitsaccuracy,Adaptec,Inc.assumesnoliabilityresultingfromerrorsoromissionsinthisdocument,orfromtheuseoftheinformationcontainedherein.Adaptecreservestherighttomakechangesintheproductdesignwithoutreservationandwithoutnotificationtoitsusers.AdaptecWarranties,TechnicalSupportandServicesTHEADAPTECSOFTWAREISPROVIDEDASIS.THEREARENOWARRANTIESANDADAPTECEXPRESSLYDISCLAIMSANYIMPLIEDWARRANTYOFMERCHANTABILITYORFITNESSFORPARTICULARPURPOSE.Adaptechasnoobligationtoprovideanymodifications,improvements,updates,trainingorsupportrelatingtotheAdaptecSoftware.Anysuchmatters,ifapplicable,shallbesubjecttomutualwrittenagreementbetweentheparties.Forlicensinginformation,pleasecontactAdaptec'sDianeMcGeeat(408)957-4836ordiane_mcgee@adaptec.com.November6,20013AdaptecASPIforWin32OverviewThearchitectureofSCSImakesitpossibletoaccessawidevarietyofdevicesusingasinglebuslinkedtoahostcomputerwithaSCSIhostadapter.SupportforperipheraldevicesinWindows(98,ME,NT,2000andWindowsXP(32-bit))isnormallyachievedthroughdevicespecificdriverslayeredontopoftheoperatingsystems’nativeSCSIsupport.BecauseofthetremendousdiversityofSCSIdevices,nodrivercansupportallSCSIperipherals.Instead,separatedriversareneededforeachmajorclassofinstalledSCSIdevice.Thesedriverssharethehostadapterhardwarethroughtheoperatingsystems’nativeSCSIsupport.ThenativeSCSIlayersaredifferentbetweenWindows98/MEandWindowsNT/2000/XP(32-bit).Inaddition,developmentanddebuggingofVxDsorkernelmodedriverscanbeverydifficult.TheneedforastandardSCSIprogramminginterfacetosimplifySCSIapplicationdevelopmentandeasetheportingofSCSIapplicationsfromoneWin32platformtoanotherbroughtASPIforWin32intoexistence.TheAdvancedSCSIProgrammingInterface(ASPI)forWin32wasdesignedtoincreasecompatibilityandsimplifytheconnectionofSCSIperipheraldevicesliketape,CD-ROM,WORM,magneto-optical,scanners,andotherdevices.ItdefinesaprotocolforSCSIapplications(calledASPImodules)tosubmitI/Orequeststoasingleoperatingsystemdriver(calledtheASPImanager).AccesstotheoperatingsystemdriverismadethroughaDynamicLinkLibrarynamedWNASPI32.DLL.BeforeBeginningBeforeyoubeginyourASPIforWin32developmenteffort,besurethatyouhaveasolidunderstandingoftheSCSIspecifications.MuchofyoursuccessindevelopinganASPImoduleisdependentonyourunderstandingofthesespecifications.Herearesourcesforthespecifications:SCSI-1andCCS:AmericanNationalStandardsInstitute25West43rdStreet,4thFl.NY,NY10036Phone:(212)642-4900Fax:(212)398-0023SCSI-2andSCSI-3:GlobalEngineeringDocumentsWorldHeadquarters15IvernessWayEastEnglewood,CO80112-5776Phone:(800)854-7179Phone:(303)397-7956Fax:(314)726-6418:(719)574-0424Inaddition,itishighlyrecommendedthatyouacquirethetechnicalreferencemanualsforanySCSIhardwarewhichyourASPImoduleintendstosupport.Thesemanualscanbeobtainedfromthehardwaremanufacturer,andtheyprovidedetailedinformationonwhichSCSIcommandsaresupportedandhowtheyareimplemented.November6,20014AdaptecProgrammingConventionsThisspecificationcontainsfunctionprototypesandstructuredefinitionswiththefollowingdatatypes:TypeSize(Bytes)DescriptionVOIDN/AIndicateslackofareturnvalueorlackoffunctionarguments.BYTE1Unsigned8-bitvalue.WORD2Unsigned16-bitvalue.DWORD4Unsigned32-bitvalue.LPVOID4Genericpointer.UsedinSRBfieldswhichrequireeitherapointertoafunctionoraWin32handle(forexample,SRB_PostProc).LPBYTE4PointertoanarrayofBYTEs.Mainlyusedasabufferpointer.LPSRB4GenericpointertooneoftheSRB_*structuresdefinedbelow.Unlessotherwisenoted,allmultibytefieldsfollowIntel'sbyteorderoflowbytefirstandendwiththehighbyte.Forexample,ifthereisa2-byteoffsetfield,thefirstbyteisthelowbyteoftheoffsetwhilethesecondbyteisthehighbyteoftheoffset.Allstructurefieldsmarkedreservedmustbesettozero,andstructuresmustbepacked!Packedmeansthatbytealignmentisusedonallstructuredefinitions.Microsoftcompilersallowbytepackingtobesetthroughtheuseof“#pragmapack(1)”whileBorlandcompilersallowpackingtobesetwith“#pragmaoption-a1”.Seeyourcompilerdocumentationformoreinformation.Failuretopackstructuresandzeroreservedfieldscancausesysteminstability,includingcrashes.AllASPIforWin32functionsareexportedfromWNASPI32.DLLusingthe‘C’callingconvention(specifically,__cdeclasimplementedbyMicrosoft’scompilers).Withthe‘C’callingconventionthecallerpushesthelastfunctionargumentonthestackfirst(thefirstargumenthasthelowestmemoryaddress),and
本文标题:Advanced SCSI Programming Interface
链接地址:https://www.777doc.com/doc-1919159 .html