SCSI.pas 63 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414
  1. {
  2. File: SCSI.p
  3. Contains: SCSI Family Interfaces.
  4. Version: Technology: SCSI 4.3
  5. Release: Universal Interfaces 3.4.2
  6. Copyright: © 1986-2002 by Apple Computer, Inc., all rights reserved
  7. Bugs?: For bug reports, consult the following page on
  8. the World Wide Web:
  9. http://www.freepascal.org/bugs.html
  10. }
  11. {
  12. Modified for use with Free Pascal
  13. Version 200
  14. Please report any bugs to <[email protected]>
  15. }
  16. {$mode macpas}
  17. {$packenum 1}
  18. {$macro on}
  19. {$inline on}
  20. {$CALLING MWPASCAL}
  21. unit SCSI;
  22. interface
  23. {$setc UNIVERSAL_INTERFACES_VERSION := $0342}
  24. {$setc GAP_INTERFACES_VERSION := $0200}
  25. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  26. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  27. {$endc}
  28. {$ifc defined CPUPOWERPC and defined CPUI386}
  29. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  30. {$endc}
  31. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  32. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  33. {$endc}
  34. {$ifc not defined __ppc__ and defined CPUPOWERPC}
  35. {$setc __ppc__ := 1}
  36. {$elsec}
  37. {$setc __ppc__ := 0}
  38. {$endc}
  39. {$ifc not defined __i386__ and defined CPUI386}
  40. {$setc __i386__ := 1}
  41. {$elsec}
  42. {$setc __i386__ := 0}
  43. {$endc}
  44. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  45. {$error Conflicting definitions for __ppc__ and __i386__}
  46. {$endc}
  47. {$ifc defined __ppc__ and __ppc__}
  48. {$setc TARGET_CPU_PPC := TRUE}
  49. {$setc TARGET_CPU_X86 := FALSE}
  50. {$elifc defined __i386__ and __i386__}
  51. {$setc TARGET_CPU_PPC := FALSE}
  52. {$setc TARGET_CPU_X86 := TRUE}
  53. {$elsec}
  54. {$error Neither __ppc__ nor __i386__ is defined.}
  55. {$endc}
  56. {$setc TARGET_CPU_PPC_64 := FALSE}
  57. {$ifc defined FPC_BIG_ENDIAN}
  58. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  59. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  60. {$elifc defined FPC_LITTLE_ENDIAN}
  61. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  62. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  63. {$elsec}
  64. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  65. {$endc}
  66. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  67. {$setc CALL_NOT_IN_CARBON := FALSE}
  68. {$setc OLDROUTINENAMES := FALSE}
  69. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  70. {$setc OPAQUE_UPP_TYPES := TRUE}
  71. {$setc OTCARBONAPPLICATION := TRUE}
  72. {$setc OTKERNEL := FALSE}
  73. {$setc PM_USE_SESSION_APIS := TRUE}
  74. {$setc TARGET_API_MAC_CARBON := TRUE}
  75. {$setc TARGET_API_MAC_OS8 := FALSE}
  76. {$setc TARGET_API_MAC_OSX := TRUE}
  77. {$setc TARGET_CARBON := TRUE}
  78. {$setc TARGET_CPU_68K := FALSE}
  79. {$setc TARGET_CPU_MIPS := FALSE}
  80. {$setc TARGET_CPU_SPARC := FALSE}
  81. {$setc TARGET_OS_MAC := TRUE}
  82. {$setc TARGET_OS_UNIX := FALSE}
  83. {$setc TARGET_OS_WIN32 := FALSE}
  84. {$setc TARGET_RT_MAC_68881 := FALSE}
  85. {$setc TARGET_RT_MAC_CFM := FALSE}
  86. {$setc TARGET_RT_MAC_MACHO := TRUE}
  87. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  88. {$setc TYPE_BOOL := FALSE}
  89. {$setc TYPE_EXTENDED := FALSE}
  90. {$setc TYPE_LONGLONG := TRUE}
  91. uses MacTypes,MixedMode,AppleDiskPartitions;
  92. {$ALIGN MAC68K}
  93. { SCSI Manager errors. These are generated by Inside Mac IV calls only. }
  94. const
  95. scCommErr = 2; { communications error, operation timeout }
  96. scArbNBErr = 3; { arbitration timeout waiting for not BSY }
  97. scBadParmsErr = 4; { bad parameter or TIB opcode }
  98. scPhaseErr = 5; { SCSI bus not in correct phase for attempted operation }
  99. scCompareErr = 6; { data compare error }
  100. scMgrBusyErr = 7; { SCSI Manager busy }
  101. scSequenceErr = 8; { attempted operation is out of sequence }
  102. scBusTOErr = 9; { CPU bus timeout }
  103. scComplPhaseErr = 10; { SCSI bus wasn't in Status phase }
  104. { TIB opcodes }
  105. scInc = 1;
  106. scNoInc = 2;
  107. scAdd = 3;
  108. scMove = 4;
  109. scLoop = 5;
  110. scNop = 6;
  111. scStop = 7;
  112. scComp = 8;
  113. {
  114. * All disk partition structures and definitions are now in the
  115. * AppleDiskPartitions.h/p/a files.
  116. }
  117. { TIB instruction }
  118. type
  119. SCSIInstrPtr = ^SCSIInstr;
  120. SCSIInstr = record
  121. scOpcode: UInt16;
  122. scParam1: SInt32;
  123. scParam2: SInt32;
  124. end;
  125. { SCSI Phases (used by SIMs to support the Original SCSI Manager }
  126. const
  127. kDataOutPhase = 0; { Encoded MSG, C/D, I/O bits }
  128. kDataInPhase = 1;
  129. kCommandPhase = 2;
  130. kStatusPhase = 3;
  131. kPhaseIllegal0 = 4;
  132. kPhaseIllegal1 = 5;
  133. kMessageOutPhase = 6;
  134. kMessageInPhase = 7;
  135. kBusFreePhase = 8; { Additional Phases }
  136. kArbitratePhase = 9;
  137. kSelectPhase = 10;
  138. kMessageInPhaseNACK = 11; { Message In Phase with ACK hanging on the bus }
  139. {$ifc CALL_NOT_IN_CARBON}
  140. {
  141. * SCSIReset()
  142. *
  143. * Availability:
  144. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  145. * CarbonLib: not available
  146. * Mac OS X: not available
  147. }
  148. function SCSIReset: OSErr; external name '_SCSIReset';
  149. {
  150. * SCSIGet()
  151. *
  152. * Availability:
  153. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  154. * CarbonLib: not available
  155. * Mac OS X: not available
  156. }
  157. function SCSIGet: OSErr; external name '_SCSIGet';
  158. {
  159. * SCSISelect()
  160. *
  161. * Availability:
  162. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  163. * CarbonLib: not available
  164. * Mac OS X: not available
  165. }
  166. function SCSISelect(targetID: SInt16): OSErr; external name '_SCSISelect';
  167. {
  168. * SCSICmd()
  169. *
  170. * Availability:
  171. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  172. * CarbonLib: not available
  173. * Mac OS X: not available
  174. }
  175. function SCSICmd(buffer: Ptr; count: SInt16): OSErr; external name '_SCSICmd';
  176. {
  177. * SCSIRead()
  178. *
  179. * Availability:
  180. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  181. * CarbonLib: not available
  182. * Mac OS X: not available
  183. }
  184. function SCSIRead(tibPtr: Ptr): OSErr; external name '_SCSIRead';
  185. {
  186. * SCSIRBlind()
  187. *
  188. * Availability:
  189. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  190. * CarbonLib: not available
  191. * Mac OS X: not available
  192. }
  193. function SCSIRBlind(tibPtr: Ptr): OSErr; external name '_SCSIRBlind';
  194. {
  195. * SCSIWrite()
  196. *
  197. * Availability:
  198. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  199. * CarbonLib: not available
  200. * Mac OS X: not available
  201. }
  202. function SCSIWrite(tibPtr: Ptr): OSErr; external name '_SCSIWrite';
  203. {
  204. * SCSIWBlind()
  205. *
  206. * Availability:
  207. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  208. * CarbonLib: not available
  209. * Mac OS X: not available
  210. }
  211. function SCSIWBlind(tibPtr: Ptr): OSErr; external name '_SCSIWBlind';
  212. {
  213. * SCSIComplete()
  214. *
  215. * Availability:
  216. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  217. * CarbonLib: not available
  218. * Mac OS X: not available
  219. }
  220. function SCSIComplete(var stat: SInt16; var message: SInt16; wait: UInt32): OSErr; external name '_SCSIComplete';
  221. {
  222. * SCSIStat()
  223. *
  224. * Availability:
  225. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  226. * CarbonLib: not available
  227. * Mac OS X: not available
  228. }
  229. function SCSIStat: SInt16; external name '_SCSIStat';
  230. {
  231. * SCSISelAtn()
  232. *
  233. * Availability:
  234. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  235. * CarbonLib: not available
  236. * Mac OS X: not available
  237. }
  238. function SCSISelAtn(targetID: SInt16): OSErr; external name '_SCSISelAtn';
  239. {
  240. * SCSIMsgIn()
  241. *
  242. * Availability:
  243. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  244. * CarbonLib: not available
  245. * Mac OS X: not available
  246. }
  247. function SCSIMsgIn(var message: SInt16): OSErr; external name '_SCSIMsgIn';
  248. {
  249. * SCSIMsgOut()
  250. *
  251. * Availability:
  252. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  253. * CarbonLib: not available
  254. * Mac OS X: not available
  255. }
  256. function SCSIMsgOut(message: SInt16): OSErr; external name '_SCSIMsgOut';
  257. {$endc} {CALL_NOT_IN_CARBON}
  258. const
  259. scsiVERSION = 43;
  260. {
  261. * SCSI Callback Procedure Prototypes. Several of these are only callable
  262. * from SCSI Manager 4.3 SIM and XPT contexts.
  263. }
  264. type
  265. {$ifc TYPED_FUNCTION_POINTERS}
  266. AENCallbackProcPtr = procedure;
  267. {$elsec}
  268. AENCallbackProcPtr = ProcPtr;
  269. {$endc}
  270. {$ifc TYPED_FUNCTION_POINTERS}
  271. SIMInitProcPtr = function(SIMinfoPtr: Ptr): OSErr;
  272. {$elsec}
  273. SIMInitProcPtr = ProcPtr;
  274. {$endc}
  275. {$ifc TYPED_FUNCTION_POINTERS}
  276. SIMActionProcPtr = procedure(scsiPB: UnivPtr; SIMGlobals: Ptr);
  277. {$elsec}
  278. SIMActionProcPtr = ProcPtr;
  279. {$endc}
  280. {$ifc TYPED_FUNCTION_POINTERS}
  281. SCSIProcPtr = procedure;
  282. {$elsec}
  283. SCSIProcPtr = ProcPtr;
  284. {$endc}
  285. {$ifc TYPED_FUNCTION_POINTERS}
  286. SCSIMakeCallbackProcPtr = procedure(scsiPB: UnivPtr);
  287. {$elsec}
  288. SCSIMakeCallbackProcPtr = ProcPtr;
  289. {$endc}
  290. { SCSIInterruptPollProcPtr is obsolete (use SCSIInterruptProcPtr) but still here for compatibility }
  291. {$ifc TYPED_FUNCTION_POINTERS}
  292. SCSIInterruptPollProcPtr = function(SIMGlobals: Ptr): SInt32;
  293. {$elsec}
  294. SCSIInterruptPollProcPtr = ProcPtr;
  295. {$endc}
  296. {$ifc TYPED_FUNCTION_POINTERS}
  297. SCSIInterruptProcPtr = function(SIMGlobals: Ptr): SInt32;
  298. {$elsec}
  299. SCSIInterruptProcPtr = ProcPtr;
  300. {$endc}
  301. {$ifc OPAQUE_UPP_TYPES}
  302. AENCallbackUPP = ^SInt32; { an opaque UPP }
  303. {$elsec}
  304. AENCallbackUPP = UniversalProcPtr;
  305. {$endc}
  306. {$ifc OPAQUE_UPP_TYPES}
  307. SIMInitUPP = ^SInt32; { an opaque UPP }
  308. {$elsec}
  309. SIMInitUPP = UniversalProcPtr;
  310. {$endc}
  311. {$ifc OPAQUE_UPP_TYPES}
  312. SIMActionUPP = ^SInt32; { an opaque UPP }
  313. {$elsec}
  314. SIMActionUPP = UniversalProcPtr;
  315. {$endc}
  316. {$ifc OPAQUE_UPP_TYPES}
  317. SCSIUPP = ^SInt32; { an opaque UPP }
  318. {$elsec}
  319. SCSIUPP = UniversalProcPtr;
  320. {$endc}
  321. {$ifc OPAQUE_UPP_TYPES}
  322. SCSIMakeCallbackUPP = ^SInt32; { an opaque UPP }
  323. {$elsec}
  324. SCSIMakeCallbackUPP = UniversalProcPtr;
  325. {$endc}
  326. {$ifc OPAQUE_UPP_TYPES}
  327. SCSIInterruptPollUPP = ^SInt32; { an opaque UPP }
  328. {$elsec}
  329. SCSIInterruptPollUPP = UniversalProcPtr;
  330. {$endc}
  331. {$ifc OPAQUE_UPP_TYPES}
  332. SCSIInterruptUPP = ^SInt32; { an opaque UPP }
  333. {$elsec}
  334. SCSIInterruptUPP = UniversalProcPtr;
  335. {$endc}
  336. const
  337. uppAENCallbackProcInfo = $00000001;
  338. uppSIMInitProcInfo = $000000E1;
  339. uppSIMActionProcInfo = $000003C1;
  340. uppSCSIProcInfo = $00000001;
  341. uppSCSIMakeCallbackProcInfo = $000000C1;
  342. uppSCSIInterruptPollProcInfo = $000000F1;
  343. uppSCSIInterruptProcInfo = $000000F1;
  344. {$ifc CALL_NOT_IN_CARBON}
  345. {
  346. * NewAENCallbackUPP()
  347. *
  348. * Availability:
  349. * Non-Carbon CFM: available as macro/inline
  350. * CarbonLib: not available
  351. * Mac OS X: not available
  352. }
  353. function NewAENCallbackUPP(userRoutine: AENCallbackProcPtr): AENCallbackUPP; external name '_NewAENCallbackUPP'; { old name was NewAENCallbackProc }
  354. {
  355. * NewSIMInitUPP()
  356. *
  357. * Availability:
  358. * Non-Carbon CFM: available as macro/inline
  359. * CarbonLib: not available
  360. * Mac OS X: not available
  361. }
  362. function NewSIMInitUPP(userRoutine: SIMInitProcPtr): SIMInitUPP; external name '_NewSIMInitUPP'; { old name was NewSIMInitProc }
  363. {
  364. * NewSIMActionUPP()
  365. *
  366. * Availability:
  367. * Non-Carbon CFM: available as macro/inline
  368. * CarbonLib: not available
  369. * Mac OS X: not available
  370. }
  371. function NewSIMActionUPP(userRoutine: SIMActionProcPtr): SIMActionUPP; external name '_NewSIMActionUPP'; { old name was NewSIMActionProc }
  372. {
  373. * NewSCSIUPP()
  374. *
  375. * Availability:
  376. * Non-Carbon CFM: available as macro/inline
  377. * CarbonLib: not available
  378. * Mac OS X: not available
  379. }
  380. function NewSCSIUPP(userRoutine: SCSIProcPtr): SCSIUPP; external name '_NewSCSIUPP'; { old name was NewSCSIProc }
  381. {
  382. * NewSCSIMakeCallbackUPP()
  383. *
  384. * Availability:
  385. * Non-Carbon CFM: available as macro/inline
  386. * CarbonLib: not available
  387. * Mac OS X: not available
  388. }
  389. function NewSCSIMakeCallbackUPP(userRoutine: SCSIMakeCallbackProcPtr): SCSIMakeCallbackUPP; external name '_NewSCSIMakeCallbackUPP'; { old name was NewSCSIMakeCallbackProc }
  390. {
  391. * NewSCSIInterruptPollUPP()
  392. *
  393. * Availability:
  394. * Non-Carbon CFM: available as macro/inline
  395. * CarbonLib: not available
  396. * Mac OS X: not available
  397. }
  398. function NewSCSIInterruptPollUPP(userRoutine: SCSIInterruptPollProcPtr): SCSIInterruptPollUPP; external name '_NewSCSIInterruptPollUPP'; { old name was NewSCSIInterruptPollProc }
  399. {
  400. * NewSCSIInterruptUPP()
  401. *
  402. * Availability:
  403. * Non-Carbon CFM: available as macro/inline
  404. * CarbonLib: not available
  405. * Mac OS X: not available
  406. }
  407. function NewSCSIInterruptUPP(userRoutine: SCSIInterruptProcPtr): SCSIInterruptUPP; external name '_NewSCSIInterruptUPP'; { old name was NewSCSIInterruptProc }
  408. {
  409. * DisposeAENCallbackUPP()
  410. *
  411. * Availability:
  412. * Non-Carbon CFM: available as macro/inline
  413. * CarbonLib: not available
  414. * Mac OS X: not available
  415. }
  416. procedure DisposeAENCallbackUPP(userUPP: AENCallbackUPP); external name '_DisposeAENCallbackUPP';
  417. {
  418. * DisposeSIMInitUPP()
  419. *
  420. * Availability:
  421. * Non-Carbon CFM: available as macro/inline
  422. * CarbonLib: not available
  423. * Mac OS X: not available
  424. }
  425. procedure DisposeSIMInitUPP(userUPP: SIMInitUPP); external name '_DisposeSIMInitUPP';
  426. {
  427. * DisposeSIMActionUPP()
  428. *
  429. * Availability:
  430. * Non-Carbon CFM: available as macro/inline
  431. * CarbonLib: not available
  432. * Mac OS X: not available
  433. }
  434. procedure DisposeSIMActionUPP(userUPP: SIMActionUPP); external name '_DisposeSIMActionUPP';
  435. {
  436. * DisposeSCSIUPP()
  437. *
  438. * Availability:
  439. * Non-Carbon CFM: available as macro/inline
  440. * CarbonLib: not available
  441. * Mac OS X: not available
  442. }
  443. procedure DisposeSCSIUPP(userUPP: SCSIUPP); external name '_DisposeSCSIUPP';
  444. {
  445. * DisposeSCSIMakeCallbackUPP()
  446. *
  447. * Availability:
  448. * Non-Carbon CFM: available as macro/inline
  449. * CarbonLib: not available
  450. * Mac OS X: not available
  451. }
  452. procedure DisposeSCSIMakeCallbackUPP(userUPP: SCSIMakeCallbackUPP); external name '_DisposeSCSIMakeCallbackUPP';
  453. {
  454. * DisposeSCSIInterruptPollUPP()
  455. *
  456. * Availability:
  457. * Non-Carbon CFM: available as macro/inline
  458. * CarbonLib: not available
  459. * Mac OS X: not available
  460. }
  461. procedure DisposeSCSIInterruptPollUPP(userUPP: SCSIInterruptPollUPP); external name '_DisposeSCSIInterruptPollUPP';
  462. {
  463. * DisposeSCSIInterruptUPP()
  464. *
  465. * Availability:
  466. * Non-Carbon CFM: available as macro/inline
  467. * CarbonLib: not available
  468. * Mac OS X: not available
  469. }
  470. procedure DisposeSCSIInterruptUPP(userUPP: SCSIInterruptUPP); external name '_DisposeSCSIInterruptUPP';
  471. {
  472. * InvokeAENCallbackUPP()
  473. *
  474. * Availability:
  475. * Non-Carbon CFM: available as macro/inline
  476. * CarbonLib: not available
  477. * Mac OS X: not available
  478. }
  479. procedure InvokeAENCallbackUPP(userRoutine: AENCallbackUPP); external name '_InvokeAENCallbackUPP'; { old name was CallAENCallbackProc }
  480. {
  481. * InvokeSIMInitUPP()
  482. *
  483. * Availability:
  484. * Non-Carbon CFM: available as macro/inline
  485. * CarbonLib: not available
  486. * Mac OS X: not available
  487. }
  488. function InvokeSIMInitUPP(SIMinfoPtr: Ptr; userRoutine: SIMInitUPP): OSErr; external name '_InvokeSIMInitUPP'; { old name was CallSIMInitProc }
  489. {
  490. * InvokeSIMActionUPP()
  491. *
  492. * Availability:
  493. * Non-Carbon CFM: available as macro/inline
  494. * CarbonLib: not available
  495. * Mac OS X: not available
  496. }
  497. procedure InvokeSIMActionUPP(scsiPB: UnivPtr; SIMGlobals: Ptr; userRoutine: SIMActionUPP); external name '_InvokeSIMActionUPP'; { old name was CallSIMActionProc }
  498. {
  499. * InvokeSCSIUPP()
  500. *
  501. * Availability:
  502. * Non-Carbon CFM: available as macro/inline
  503. * CarbonLib: not available
  504. * Mac OS X: not available
  505. }
  506. procedure InvokeSCSIUPP(userRoutine: SCSIUPP); external name '_InvokeSCSIUPP'; { old name was CallSCSIProc }
  507. {
  508. * InvokeSCSIMakeCallbackUPP()
  509. *
  510. * Availability:
  511. * Non-Carbon CFM: available as macro/inline
  512. * CarbonLib: not available
  513. * Mac OS X: not available
  514. }
  515. procedure InvokeSCSIMakeCallbackUPP(scsiPB: UnivPtr; userRoutine: SCSIMakeCallbackUPP); external name '_InvokeSCSIMakeCallbackUPP'; { old name was CallSCSIMakeCallbackProc }
  516. {
  517. * InvokeSCSIInterruptPollUPP()
  518. *
  519. * Availability:
  520. * Non-Carbon CFM: available as macro/inline
  521. * CarbonLib: not available
  522. * Mac OS X: not available
  523. }
  524. function InvokeSCSIInterruptPollUPP(SIMGlobals: Ptr; userRoutine: SCSIInterruptPollUPP): SInt32; external name '_InvokeSCSIInterruptPollUPP'; { old name was CallSCSIInterruptPollProc }
  525. {
  526. * InvokeSCSIInterruptUPP()
  527. *
  528. * Availability:
  529. * Non-Carbon CFM: available as macro/inline
  530. * CarbonLib: not available
  531. * Mac OS X: not available
  532. }
  533. function InvokeSCSIInterruptUPP(SIMGlobals: Ptr; userRoutine: SCSIInterruptUPP): SInt32; external name '_InvokeSCSIInterruptUPP'; { old name was CallSCSIInterruptProc }
  534. {$endc} {CALL_NOT_IN_CARBON}
  535. {
  536. * SCSI Completion routine callback for SCSIAction.
  537. }
  538. type
  539. {$ifc TYPED_FUNCTION_POINTERS}
  540. SCSICallbackProcPtr = procedure(scsiPB: UnivPtr);
  541. {$elsec}
  542. SCSICallbackProcPtr = ProcPtr;
  543. {$endc}
  544. {$ifc OPAQUE_UPP_TYPES}
  545. SCSICallbackUPP = ^SInt32; { an opaque UPP }
  546. {$elsec}
  547. SCSICallbackUPP = UniversalProcPtr;
  548. {$endc}
  549. const
  550. uppSCSICallbackProcInfo = $000000C0;
  551. {
  552. * NewSCSICallbackUPP()
  553. *
  554. * Availability:
  555. * Non-Carbon CFM: available as macro/inline
  556. * CarbonLib: in CarbonLib 1.3 and later
  557. * Mac OS X: in version 10.0 and later
  558. }
  559. function NewSCSICallbackUPP(userRoutine: SCSICallbackProcPtr): SCSICallbackUPP; external name '_NewSCSICallbackUPP'; { old name was NewSCSICallbackProc }
  560. {
  561. * DisposeSCSICallbackUPP()
  562. *
  563. * Availability:
  564. * Non-Carbon CFM: available as macro/inline
  565. * CarbonLib: in CarbonLib 1.3 and later
  566. * Mac OS X: in version 10.0 and later
  567. }
  568. procedure DisposeSCSICallbackUPP(userUPP: SCSICallbackUPP); external name '_DisposeSCSICallbackUPP';
  569. {
  570. * InvokeSCSICallbackUPP()
  571. *
  572. * Availability:
  573. * Non-Carbon CFM: available as macro/inline
  574. * CarbonLib: in CarbonLib 1.3 and later
  575. * Mac OS X: in version 10.0 and later
  576. }
  577. procedure InvokeSCSICallbackUPP(scsiPB: UnivPtr; userRoutine: SCSICallbackUPP); external name '_InvokeSCSICallbackUPP'; { old name was CallSCSICallbackProc }
  578. {
  579. SCSI Manager 4.3 function codes
  580. }
  581. const
  582. SCSINop = $00; { Execute nothing }
  583. SCSIExecIO = $01; { Execute the specified IO }
  584. SCSIBusInquiry = $03; { Get parameters for entire path of HBAs }
  585. SCSIReleaseQ = $04; { Release the frozen SIM queue for particular LUN }
  586. SCSIAbortCommand = $10; { Abort the selected Control Block }
  587. SCSIResetBus = $11; { Reset the SCSI bus }
  588. SCSIResetDevice = $12; { Reset the SCSI device }
  589. SCSITerminateIO = $13; { Terminate any pending IO }
  590. { Not available in Carbon on X }
  591. SCSIGetVirtualIDInfo = $80; { Find out which bus old ID is on }
  592. SCSILoadDriver = $82; { Load a driver for a device ident }
  593. SCSIOldCall = $84; { XPT->SIM private call for old-API }
  594. SCSICreateRefNumXref = $85; { Register a DeviceIdent to drvr RefNum xref }
  595. SCSILookupRefNumXref = $86; { Get DeviceIdent to drvr RefNum xref }
  596. SCSIRemoveRefNumXref = $87; { Remove a DeviceIdent to drvr RefNum xref }
  597. SCSIRegisterWithNewXPT = $88; { XPT has changed - SIM needs to re-register itself }
  598. vendorUnique = $C0; { 0xC0 thru 0xFF }
  599. { Allocation length defines for some of the fields }
  600. handshakeDataLength = 8; { Handshake data length }
  601. maxCDBLength = 16; { Space for the CDB bytes/pointer }
  602. vendorIDLength = 16; { ASCII string len for Vendor ID }
  603. { Define DeviceIdent structure }
  604. type
  605. DeviceIdentPtr = ^DeviceIdent;
  606. DeviceIdent = packed record
  607. diReserved: UInt8; { reserved }
  608. bus: UInt8; { SCSI - Bus Number }
  609. targetID: UInt8; { SCSI - Target SCSI ID }
  610. LUN: UInt8; { SCSI - LUN }
  611. end;
  612. { Constants for the diReserved field of DeviceIdent }
  613. { used to distinguish whether the DeviceIdent holds }
  614. { information about a SCSI device (kBusTypeSCSI) }
  615. { or an ATA device (kBusTypeATA). The other }
  616. { constants are pretty much deprecated. Let me }
  617. { know if you see any. }
  618. const
  619. kBusTypeSCSI = 0;
  620. kBusTypeATA = 1;
  621. kBusTypePCMCIA = 2;
  622. kBusTypeMediaBay = 3;
  623. { If diReserved indicates that a DeviceIdent is }
  624. { really for ATA, you can cast it to DeviceIdentATA }
  625. { to get at the important fields. }
  626. type
  627. DeviceIdentATAPtr = ^DeviceIdentATA;
  628. DeviceIdentATA = record
  629. diReserved: SInt8;
  630. busNum: SInt8;
  631. devNum: SInt8;
  632. diReserved2: SInt8;
  633. end;
  634. { for use with Apple Patch Driver used during booting }
  635. PatchDescriptorPtr = ^PatchDescriptor;
  636. PatchDescriptor = record
  637. patchSig: OSType; { The patches signature }
  638. majorVers: UInt16; { The major version number of the }
  639. { patch }
  640. minorVers: UInt16; { The minor version number of the }
  641. { patch }
  642. flags: UInt32; { Reqired/Optional, etc. }
  643. patchOffset: UInt32; { Block offset to the beginning of }
  644. { the patch }
  645. patchSize: UInt32; { Actual size of the patch in bytes }
  646. patchCRC: UInt32; { As calculated by the SCSI drivers }
  647. { CRC code }
  648. patchDescriptorLen: UInt32; { Total length of the descriptor }
  649. { (must be >= 61 bytes) }
  650. patchName: Str32; { Pascal string with a short }
  651. { description of the patch }
  652. patchVendor: SInt8; { The first byte of a pascal string }
  653. { for the patch Vendor. Any amount }
  654. { of data may follow the string. }
  655. end;
  656. { Constants for the flags field of PatchDescriptor. }
  657. const
  658. kRequiredPatch = $00000001; { Patch must succeed to continue booting. }
  659. type
  660. PatchListPtr = ^PatchList;
  661. PatchList = record
  662. numPatchBlocks: UInt16; { The number of disk blocks }
  663. { to hold patch descriptions }
  664. numPatches: UInt16; { The number of patches }
  665. thePatch: array [0..0] of PatchDescriptor; { An array with one patch }
  666. { per element }
  667. end;
  668. { signature of a Patch entry point }
  669. {$ifc TYPED_FUNCTION_POINTERS}
  670. PatchEntryPoint = function(var myPatch: PatchDescriptor; myDevID: DeviceIdent): OSErr;
  671. {$elsec}
  672. PatchEntryPoint = ProcPtr;
  673. {$endc}
  674. { Command Descriptor Block structure }
  675. CDBPtr = ^CDB;
  676. CDB = record
  677. case SInt16 of
  678. 0: (
  679. cdbPtr: BytePtr; { pointer to the CDB, or }
  680. );
  681. 1: (
  682. cdbBytes: packed array [0..15] of UInt8; { the actual CDB to send }
  683. );
  684. end;
  685. { Scatter/gather list element (Deprecated for MacOS8) }
  686. SGRecordPtr = ^SGRecord;
  687. SGRecord = record
  688. SGAddr: Ptr;
  689. SGCount: UInt32;
  690. end;
  691. SCSIHdrPtr = ^SCSIHdr;
  692. SCSIHdr = record
  693. qLink: SCSIHdrPtr; { (internal use, must be nil on entry) }
  694. scsiReserved1: SInt16; { -> reserved for input }
  695. scsiPBLength: UInt16; { -> Length of the entire PB }
  696. scsiFunctionCode: SInt8; { -> function selector }
  697. scsiReserved2: SInt8; { <- reserved for output }
  698. scsiResult: OSErr; { <- Returned result }
  699. scsiDevice: DeviceIdent; { -> Device Identifier (bus+target+lun) }
  700. scsiCompletion: SCSICallbackUPP; { -> Callback on completion function }
  701. scsiFlags: UInt32; { -> assorted flags }
  702. scsiDriverStorage: BytePtr; { <> Ptr for driver private use }
  703. scsiXPTprivate: Ptr; { private field for use in XPT }
  704. scsiReserved3: SInt32; { reserved }
  705. end;
  706. SCSI_PBPtr = ^SCSI_PB;
  707. SCSI_PB = record
  708. qLink: SCSIHdrPtr; { (internal use, must be nil on entry) }
  709. scsiReserved1: SInt16; { -> reserved for input }
  710. scsiPBLength: UInt16; { -> Length of the entire PB }
  711. scsiFunctionCode: SInt8; { -> function selector }
  712. scsiReserved2: SInt8; { <- reserved for output }
  713. scsiResult: OSErr; { <- Returned result }
  714. scsiDevice: DeviceIdent; { -> Device Identifier (bus+target+lun) }
  715. scsiCompletion: SCSICallbackUPP; { -> Callback on completion function }
  716. scsiFlags: UInt32; { -> assorted flags }
  717. scsiDriverStorage: BytePtr; { <> Ptr for driver private use }
  718. scsiXPTprivate: Ptr; { private field for use in XPT }
  719. scsiReserved3: SInt32; { reserved }
  720. end;
  721. SCSI_IOPtr = ^SCSI_IO;
  722. SCSI_IO = record
  723. qLink: SCSIHdrPtr; { (internal use, must be nil on entry) }
  724. scsiReserved1: SInt16; { -> reserved for input }
  725. scsiPBLength: UInt16; { -> Length of the entire PB }
  726. scsiFunctionCode: SInt8; { -> function selector }
  727. scsiReserved2: SInt8; { <- reserved for output }
  728. scsiResult: OSErr; { <- Returned result }
  729. scsiDevice: DeviceIdent; { -> Device Identifier (bus+target+lun) }
  730. scsiCompletion: SCSICallbackUPP; { -> Callback on completion function }
  731. scsiFlags: UInt32; { -> assorted flags }
  732. scsiDriverStorage: BytePtr; { <> Ptr for driver private use }
  733. scsiXPTprivate: Ptr; { private field for use in XPT }
  734. scsiReserved3: SInt32; { reserved }
  735. scsiResultFlags: UInt16; { <- Flags which modify the scsiResult field }
  736. scsiReserved3pt5: UInt16; { -> Reserved }
  737. scsiDataPtr: BytePtr; { -> Pointer to the data buffer or the S/G list }
  738. scsiDataLength: UInt32; { -> Data transfer length }
  739. scsiSensePtr: BytePtr; { -> Ptr to autosense data buffer }
  740. scsiSenseLength: SInt8; { -> size of the autosense buffer }
  741. scsiCDBLength: SInt8; { -> Number of bytes for the CDB }
  742. scsiSGListCount: UInt16; { -> num of scatter gather list entries }
  743. scsiReserved4: UInt32; { <- reserved for output }
  744. scsiSCSIstatus: SInt8; { <- Returned scsi device status }
  745. scsiSenseResidual: SInt8; { <- Autosense residual length }
  746. scsiReserved5: UInt16; { <- reserved for output }
  747. scsiDataResidual: SInt32; { <- Returned Transfer residual length }
  748. scsiCDB: CDB; { -> Actual CDB or pointer to CDB }
  749. scsiTimeout: SInt32; { -> Timeout value (Time Mgr format) (CAM timeout) }
  750. scsiReserved5pt5: BytePtr; { -> Reserved }
  751. scsiReserved5pt6: UInt16; { -> Reserved }
  752. scsiIOFlags: UInt16; { -> additional I/O flags }
  753. scsiTagAction: SInt8; { -> What to do for tag queuing }
  754. scsiReserved6: SInt8; { -> reserved for input }
  755. scsiReserved7: UInt16; { -> reserved for input }
  756. scsiSelectTimeout: UInt16; { -> Select timeout value }
  757. scsiDataType: SInt8; { -> Data description type (i.e. buffer, TIB, S/G) }
  758. scsiTransferType: SInt8; { -> Transfer type (i.e. Blind vs Polled) }
  759. scsiReserved8: UInt32; { -> reserved for input }
  760. scsiReserved9: UInt32; { -> reserved for input }
  761. scsiHandshake: array [0..7] of UInt16; { -> handshaking points (null term'd) }
  762. scsiReserved10: UInt32; { -> reserved for input }
  763. scsiReserved11: UInt32; { -> reserved for input }
  764. scsiCommandLink: SCSI_IOPtr; { -> Ptr to the next PB in linked cmd chain }
  765. scsiSIMpublics: packed array [0..7] of UInt8; { -> reserved for input to 3rd-party SIMs }
  766. scsiAppleReserved6: packed array [0..7] of UInt8; { -> reserved for input }
  767. { XPT layer privates (for old-API emulation) }
  768. scsiCurrentPhase: UInt16; { <- phase upon completing old call }
  769. scsiSelector: SInt16; { -> selector specified in old calls }
  770. scsiOldCallResult: OSErr; { <- result of old call }
  771. scsiSCSImessage: SInt8; { <- Returned scsi device message (for SCSIComplete) }
  772. XPTprivateFlags: SInt8; { <> various flags }
  773. XPTextras: packed array [0..11] of UInt8; { }
  774. end;
  775. SCSIExecIOPB = SCSI_IO;
  776. SCSIExecIOPBPtr = ^SCSIExecIOPB;
  777. { Bus inquiry PB }
  778. SCSIBusInquiryPBPtr = ^SCSIBusInquiryPB;
  779. SCSIBusInquiryPB = record
  780. qLink: SCSIHdrPtr; { (internal use, must be nil on entry) }
  781. scsiReserved1: SInt16; { -> reserved for input }
  782. scsiPBLength: UInt16; { -> Length of the entire PB }
  783. scsiFunctionCode: SInt8; { -> function selector }
  784. scsiReserved2: SInt8; { <- reserved for output }
  785. scsiResult: OSErr; { <- Returned result }
  786. scsiDevice: DeviceIdent; { -> Device Identifier (bus+target+lun) }
  787. scsiCompletion: SCSICallbackUPP; { -> Callback on completion function }
  788. scsiFlags: UInt32; { -> assorted flags }
  789. scsiDriverStorage: BytePtr; { <> Ptr for driver private use }
  790. scsiXPTprivate: Ptr; { private field for use in XPT }
  791. scsiReserved3: SInt32; { reserved }
  792. scsiEngineCount: UInt16; { <- Number of engines on HBA }
  793. scsiMaxTransferType: UInt16; { <- Number of transfer types for this HBA }
  794. scsiDataTypes: UInt32; { <- which data types are supported by this SIM }
  795. scsiIOpbSize: UInt16; { <- Size of SCSI_IO PB for this SIM/HBA }
  796. scsiMaxIOpbSize: UInt16; { <- Size of max SCSI_IO PB for all SIM/HBAs }
  797. scsiFeatureFlags: UInt32; { <- Supported features flags field }
  798. scsiVersionNumber: SInt8; { <- Version number for the SIM/HBA }
  799. scsiHBAInquiry: SInt8; { <- Mimic of INQ byte 7 for the HBA }
  800. scsiTargetModeFlags: SInt8; { <- Flags for target mode support }
  801. scsiScanFlags: SInt8; { <- Scan related feature flags }
  802. scsiSIMPrivatesPtr: UInt32; { <- Ptr to SIM private data area }
  803. scsiSIMPrivatesSize: UInt32; { <- Size of SIM private data area }
  804. scsiAsyncFlags: UInt32; { <- Event cap. for Async Callback }
  805. scsiHiBusID: SInt8; { <- Highest path ID in the subsystem }
  806. scsiInitiatorID: SInt8; { <- ID of the HBA on the SCSI bus }
  807. scsiBIReserved0: UInt16; { }
  808. scsiBIReserved1: UInt32; { <- }
  809. scsiFlagsSupported: UInt32; { <- which scsiFlags are supported }
  810. scsiIOFlagsSupported: UInt16; { <- which scsiIOFlags are supported }
  811. scsiWeirdStuff: UInt16; { <- }
  812. scsiMaxTarget: UInt16; { <- maximum Target number supported }
  813. scsiMaxLUN: UInt16; { <- maximum Logical Unit number supported }
  814. scsiSIMVendor: packed array [0..15] of char; { <- Vendor ID of SIM (or XPT if bus<FF) }
  815. scsiHBAVendor: packed array [0..15] of char; { <- Vendor ID of the HBA }
  816. scsiControllerFamily: packed array [0..15] of char; { <- Family of SCSI Controller }
  817. scsiControllerType: packed array [0..15] of char; { <- Specific Model of SCSI Controller used }
  818. scsiXPTversion: packed array [0..3] of char; { <- version number of XPT }
  819. scsiSIMversion: packed array [0..3] of char; { <- version number of SIM }
  820. scsiHBAversion: packed array [0..3] of char; { <- version number of HBA }
  821. scsiHBAslotType: SInt8; { <- type of "slot" that this HBA is in }
  822. scsiHBAslotNumber: SInt8; { <- slot number of this HBA }
  823. scsiSIMsRsrcID: UInt16; { <- resource ID of this SIM }
  824. scsiBIReserved3: UInt16; { <- }
  825. scsiAdditionalLength: UInt16; { <- additional BusInquiry PB len }
  826. end;
  827. { Abort SIM Request PB }
  828. SCSIAbortCommandPBPtr = ^SCSIAbortCommandPB;
  829. SCSIAbortCommandPB = record
  830. qLink: SCSIHdrPtr; { (internal use, must be nil on entry) }
  831. scsiReserved1: SInt16; { -> reserved for input }
  832. scsiPBLength: UInt16; { -> Length of the entire PB }
  833. scsiFunctionCode: SInt8; { -> function selector }
  834. scsiReserved2: SInt8; { <- reserved for output }
  835. scsiResult: OSErr; { <- Returned result }
  836. scsiDevice: DeviceIdent; { -> Device Identifier (bus+target+lun) }
  837. scsiCompletion: SCSICallbackUPP; { -> Callback on completion function }
  838. scsiFlags: UInt32; { -> assorted flags }
  839. scsiDriverStorage: BytePtr; { <> Ptr for driver private use }
  840. scsiXPTprivate: Ptr; { private field for use in XPT }
  841. scsiReserved3: SInt32; { reserved }
  842. scsiIOptr: SCSI_IOPtr; { Pointer to the PB to abort }
  843. end;
  844. { Terminate I/O Process Request PB }
  845. SCSITerminateIOPBPtr = ^SCSITerminateIOPB;
  846. SCSITerminateIOPB = record
  847. qLink: SCSIHdrPtr; { (internal use, must be nil on entry) }
  848. scsiReserved1: SInt16; { -> reserved for input }
  849. scsiPBLength: UInt16; { -> Length of the entire PB }
  850. scsiFunctionCode: SInt8; { -> function selector }
  851. scsiReserved2: SInt8; { <- reserved for output }
  852. scsiResult: OSErr; { <- Returned result }
  853. scsiDevice: DeviceIdent; { -> Device Identifier (bus+target+lun) }
  854. scsiCompletion: SCSICallbackUPP; { -> Callback on completion function }
  855. scsiFlags: UInt32; { -> assorted flags }
  856. scsiDriverStorage: BytePtr; { <> Ptr for driver private use }
  857. scsiXPTprivate: Ptr; { private field for use in XPT }
  858. scsiReserved3: SInt32; { reserved }
  859. scsiIOptr: SCSI_IOPtr; { Pointer to the PB to terminate }
  860. end;
  861. { Reset SCSI Bus PB }
  862. SCSIResetBusPBPtr = ^SCSIResetBusPB;
  863. SCSIResetBusPB = record
  864. qLink: SCSIHdrPtr; { (internal use, must be nil on entry) }
  865. scsiReserved1: SInt16; { -> reserved for input }
  866. scsiPBLength: UInt16; { -> Length of the entire PB }
  867. scsiFunctionCode: SInt8; { -> function selector }
  868. scsiReserved2: SInt8; { <- reserved for output }
  869. scsiResult: OSErr; { <- Returned result }
  870. scsiDevice: DeviceIdent; { -> Device Identifier (bus+target+lun) }
  871. scsiCompletion: SCSICallbackUPP; { -> Callback on completion function }
  872. scsiFlags: UInt32; { -> assorted flags }
  873. scsiDriverStorage: BytePtr; { <> Ptr for driver private use }
  874. scsiXPTprivate: Ptr; { private field for use in XPT }
  875. scsiReserved3: SInt32; { reserved }
  876. end;
  877. { Reset SCSI Device PB }
  878. SCSIResetDevicePBPtr = ^SCSIResetDevicePB;
  879. SCSIResetDevicePB = record
  880. qLink: SCSIHdrPtr; { (internal use, must be nil on entry) }
  881. scsiReserved1: SInt16; { -> reserved for input }
  882. scsiPBLength: UInt16; { -> Length of the entire PB }
  883. scsiFunctionCode: SInt8; { -> function selector }
  884. scsiReserved2: SInt8; { <- reserved for output }
  885. scsiResult: OSErr; { <- Returned result }
  886. scsiDevice: DeviceIdent; { -> Device Identifier (bus+target+lun) }
  887. scsiCompletion: SCSICallbackUPP; { -> Callback on completion function }
  888. scsiFlags: UInt32; { -> assorted flags }
  889. scsiDriverStorage: BytePtr; { <> Ptr for driver private use }
  890. scsiXPTprivate: Ptr; { private field for use in XPT }
  891. scsiReserved3: SInt32; { reserved }
  892. end;
  893. { Release SIM Queue PB }
  894. SCSIReleaseQPBPtr = ^SCSIReleaseQPB;
  895. SCSIReleaseQPB = record
  896. qLink: SCSIHdrPtr; { (internal use, must be nil on entry) }
  897. scsiReserved1: SInt16; { -> reserved for input }
  898. scsiPBLength: UInt16; { -> Length of the entire PB }
  899. scsiFunctionCode: SInt8; { -> function selector }
  900. scsiReserved2: SInt8; { <- reserved for output }
  901. scsiResult: OSErr; { <- Returned result }
  902. scsiDevice: DeviceIdent; { -> Device Identifier (bus+target+lun) }
  903. scsiCompletion: SCSICallbackUPP; { -> Callback on completion function }
  904. scsiFlags: UInt32; { -> assorted flags }
  905. scsiDriverStorage: BytePtr; { <> Ptr for driver private use }
  906. scsiXPTprivate: Ptr; { private field for use in XPT }
  907. scsiReserved3: SInt32; { reserved }
  908. end;
  909. { SCSI Get Virtual ID Info PB }
  910. SCSIGetVirtualIDInfoPBPtr = ^SCSIGetVirtualIDInfoPB;
  911. SCSIGetVirtualIDInfoPB = record
  912. qLink: SCSIHdrPtr; { (internal use, must be nil on entry) }
  913. scsiReserved1: SInt16; { -> reserved for input }
  914. scsiPBLength: UInt16; { -> Length of the entire PB }
  915. scsiFunctionCode: SInt8; { -> function selector }
  916. scsiReserved2: SInt8; { <- reserved for output }
  917. scsiResult: OSErr; { <- Returned result }
  918. scsiDevice: DeviceIdent; { -> Device Identifier (bus+target+lun) }
  919. scsiCompletion: SCSICallbackUPP; { -> Callback on completion function }
  920. scsiFlags: UInt32; { -> assorted flags }
  921. scsiDriverStorage: Ptr; { <> Ptr for driver private use }
  922. scsiXPTprivate: Ptr; { private field for use in XPT }
  923. scsiReserved3: SInt32; { reserved }
  924. scsiOldCallID: UInt16; { -> SCSI ID of device in question }
  925. scsiExists: boolean; { <- true if device exists }
  926. filler: SInt8;
  927. end;
  928. { Create/Lookup/Remove RefNum for Device PB }
  929. SCSIDriverPBPtr = ^SCSIDriverPB;
  930. SCSIDriverPB = record
  931. qLink: SCSIHdrPtr; { (internal use, must be nil on entry) }
  932. scsiReserved1: SInt16; { -> reserved for input }
  933. scsiPBLength: UInt16; { -> Length of the entire PB }
  934. scsiFunctionCode: SInt8; { -> function selector }
  935. scsiReserved2: SInt8; { <- reserved for output }
  936. scsiResult: OSErr; { <- Returned result }
  937. scsiDevice: DeviceIdent; { -> Device Identifier (bus+target+lun) }
  938. scsiCompletion: SCSICallbackUPP; { -> Callback on completion function }
  939. scsiFlags: UInt32; { -> assorted flags }
  940. scsiDriverStorage: Ptr; { <> Ptr for driver private use }
  941. scsiXPTprivate: Ptr; { private field for use in XPT }
  942. scsiReserved3: SInt32; { reserved }
  943. scsiDriver: SInt16; { -> DriverRefNum, For SetDriver, <- For GetNextDriver }
  944. scsiDriverFlags: UInt16; { <> Details of driver/device }
  945. scsiNextDevice: DeviceIdent; { <- DeviceIdent of the NEXT Item in the list }
  946. end;
  947. { Load Driver PB }
  948. SCSILoadDriverPBPtr = ^SCSILoadDriverPB;
  949. SCSILoadDriverPB = record
  950. qLink: SCSIHdrPtr; { (internal use, must be nil on entry) }
  951. scsiReserved1: SInt16; { -> reserved for input }
  952. scsiPBLength: UInt16; { -> Length of the entire PB }
  953. scsiFunctionCode: SInt8; { -> function selector }
  954. scsiReserved2: SInt8; { <- reserved for output }
  955. scsiResult: OSErr; { <- Returned result }
  956. scsiDevice: DeviceIdent; { -> Device Identifier (bus+target+lun) }
  957. scsiCompletion: SCSICallbackUPP; { -> Callback on completion function }
  958. scsiFlags: UInt32; { -> assorted flags }
  959. scsiDriverStorage: Ptr; { <> Ptr for driver private use }
  960. scsiXPTprivate: Ptr; { private field for use in XPT }
  961. scsiReserved3: SInt32; { reserved }
  962. scsiLoadedRefNum: SInt16; { <- SIM returns refnum of driver }
  963. scsiDiskLoadFailed: boolean; { -> if true, indicates call after failure to load }
  964. filler: SInt8;
  965. end;
  966. { Defines for the scsiTransferType field }
  967. const
  968. scsiTransferBlind = 0;
  969. scsiTransferPolled = 1;
  970. scsiErrorBase = -7936;
  971. scsiRequestInProgress = 1; { 1 = PB request is in progress }
  972. { Execution failed 00-2F }
  973. scsiRequestAborted = -7934; { -7934 = PB request aborted by the host }
  974. scsiUnableToAbort = -7933; { -7933 = Unable to Abort PB request }
  975. scsiNonZeroStatus = -7932; { -7932 = PB request completed with an err }
  976. scsiUnused05 = -7931; { -7931 = }
  977. scsiUnused06 = -7930; { -7930 = }
  978. scsiUnused07 = -7929; { -7929 = }
  979. scsiUnused08 = -7928; { -7928 = }
  980. scsiUnableToTerminate = -7927; { -7927 = Unable to Terminate I/O PB req }
  981. scsiSelectTimeout = -7926; { -7926 = Target selection timeout }
  982. scsiCommandTimeout = -7925; { -7925 = Command timeout }
  983. scsiIdentifyMessageRejected = -7924; { -7924 = }
  984. scsiMessageRejectReceived = -7923; { -7923 = Message reject received }
  985. scsiSCSIBusReset = -7922; { -7922 = SCSI bus reset sent/received }
  986. scsiParityError = -7921; { -7921 = Uncorrectable parity error occured }
  987. scsiAutosenseFailed = -7920; { -7920 = Autosense: Request sense cmd fail }
  988. scsiUnused11 = -7919; { -7919 = }
  989. scsiDataRunError = -7918; { -7918 = Data overrun/underrun error }
  990. scsiUnexpectedBusFree = -7917; { -7917 = Unexpected BUS free }
  991. scsiSequenceFailed = -7916; { -7916 = Target bus phase sequence failure }
  992. scsiWrongDirection = -7915; { -7915 = Data phase was in wrong direction }
  993. scsiUnused16 = -7914; { -7914 = }
  994. scsiBDRsent = -7913; { -7913 = A SCSI BDR msg was sent to target }
  995. scsiTerminated = -7912; { -7912 = PB request terminated by the host }
  996. scsiNoNexus = -7911; { -7911 = Nexus is not established }
  997. scsiCDBReceived = -7910; { -7910 = The SCSI CDB has been received }
  998. { Couldn't begin execution 30-3F }
  999. scsiTooManyBuses = -7888; { -7888 = Register failed because we're full }
  1000. scsiBusy = -7887; { -7887 = SCSI subsystem is busy }
  1001. scsiProvideFail = -7886; { -7886 = Unable to provide requ. capability }
  1002. scsiDeviceNotThere = -7885; { -7885 = SCSI device not installed/there }
  1003. scsiNoHBA = -7884; { -7884 = No HBA detected Error }
  1004. scsiDeviceConflict = -7883; { -7883 = sorry, max 1 refNum per DeviceIdent }
  1005. scsiNoSuchXref = -7882; { -7882 = no such RefNum xref }
  1006. scsiQLinkInvalid = -7881; { -7881 = pre-linked PBs not supported }
  1007. { (The QLink field was nonzero) }
  1008. { Parameter errors 40-7F }
  1009. scsiPBLengthError = -7872; { -7872 = (scsiPBLength is insuf'ct/invalid }
  1010. scsiFunctionNotAvailable = -7871; { -7871 = The requ. func is not available }
  1011. scsiRequestInvalid = -7870; { -7870 = PB request is invalid }
  1012. scsiBusInvalid = -7869; { -7869 = Bus ID supplied is invalid }
  1013. scsiTIDInvalid = -7868; { -7868 = Target ID supplied is invalid }
  1014. scsiLUNInvalid = -7867; { -7867 = LUN supplied is invalid }
  1015. scsiIDInvalid = -7866; { -7866 = The initiator ID is invalid }
  1016. scsiDataTypeInvalid = -7865; { -7865 = scsiDataType requested not supported }
  1017. scsiTransferTypeInvalid = -7864; { -7864 = scsiTransferType field is too high }
  1018. scsiCDBLengthInvalid = -7863; { -7863 = scsiCDBLength field is too big }
  1019. { New errors for SCSI Family }
  1020. scsiUnused74 = -7862; { -7862 = }
  1021. scsiUnused75 = -7861; { -7861 = }
  1022. scsiBadDataLength = -7860; { -7860 = a zero data length in PB }
  1023. scsiPartialPrepared = -7859; { -7859 = could not do full prepare mem for I/O }
  1024. scsiInvalidMsgType = -7858; { -7858 = Invalid message type (internal) }
  1025. scsiUnused79 = -7857; { -7857 = }
  1026. scsiBadConnID = -7856; { -7856 = Bad Connection ID }
  1027. scsiUnused81 = -7855; { -7855 = }
  1028. scsiIOInProgress = -7854; { -7854 = Can't close conn, IO in prog }
  1029. scsiTargetReserved = -7853; { -7853 = Target already reserved }
  1030. scsiUnused84 = -7852; { -7852 = }
  1031. scsiUnused85 = -7851; { -7851 = }
  1032. scsiBadConnType = -7850; { -7850 = Bad connection type }
  1033. scsiCannotLoadPlugin = -7849; { -7849 = No matching service category }
  1034. { +++ }
  1035. {
  1036. * scsiFamilyInternalError and scsiPluginInternalError are intended to handle consistency check failures.
  1037. * For example, if the family stores a record on a lookaside queue, but does not find that record
  1038. * it can use this error to report this failure. SCSI Manager 4.3 uses dsIOCoreErr in a few places,
  1039. * but this is probably not the best error. In general, internal errors should be reported as bugs.
  1040. *
  1041. * The following range of errors is provided for third-party (non-Apple) SCSI SIM and device driver vendors.
  1042. * In general, they would be used for error conditions that are not covered by the standardized errors.
  1043. * They should not normally be conveyed to normal applications, but might be used for communication between
  1044. * a plug-in and a vendor-provided device driver (for example, to manage RAID hot-swapping).
  1045. *
  1046. * Note: I don't know how many SCSI errors are reserved in the error code architecture. Don't assume that
  1047. * we'll actually get sixteen, but we should reserve at least one.
  1048. }
  1049. scsiFamilyInternalError = -7849; { -7849 = Internal consistency check failed }
  1050. scsiPluginInternalError = -7848; { -7848 = Internal consistency check failed }
  1051. scsiVendorSpecificErrorBase = -7808; { ?? = Start of third-party error range }
  1052. scsiVendorSpecificErrorCount = 16; { Number of third-party errors }
  1053. { --- }
  1054. scsiExecutionErrors = -7936;
  1055. scsiNotExecutedErrors = -7888;
  1056. scsiParameterErrors = -7872;
  1057. { Defines for the scsiResultFlags field }
  1058. scsiSIMQFrozen = $0001; { The SIM queue is frozen w/this err }
  1059. scsiAutosenseValid = $0002; { Autosense data valid for target }
  1060. scsiBusNotFree = $0004; { At time of callback, SCSI bus is not free }
  1061. { Defines for the bit numbers of the scsiFlags field in the PB header for the SCSIExecIO function }
  1062. kbSCSIDisableAutosense = 29; { Disable auto sense feature }
  1063. kbSCSIFlagReservedA = 28; { }
  1064. kbSCSIFlagReserved0 = 27; { }
  1065. kbSCSICDBLinked = 26; { The PB contains a linked CDB }
  1066. kbSCSIQEnable = 25; { Target queue actions are enabled }
  1067. kbSCSICDBIsPointer = 24; { The CDB field contains a pointer }
  1068. kbSCSIFlagReserved1 = 23; { }
  1069. kbSCSIInitiateSyncData = 22; { Attempt Sync data xfer and SDTR }
  1070. kbSCSIDisableSyncData = 21; { Disable sync, go to async }
  1071. kbSCSISIMQHead = 20; { Place PB at the head of SIM Q }
  1072. kbSCSISIMQFreeze = 19; { Return the SIM Q to frozen state }
  1073. kbSCSISIMQNoFreeze = 18; { Disallow SIM Q freezing }
  1074. kbSCSIDoDisconnect = 17; { Definitely do disconnect }
  1075. kbSCSIDontDisconnect = 16; { Definitely don't disconnect }
  1076. kbSCSIDataReadyForDMA = 15; { Data buffer(s) are ready for DMA }
  1077. kbSCSIFlagReserved3 = 14; { }
  1078. kbSCSIDataPhysical = 13; { SG/Buffer data ptrs are physical }
  1079. kbSCSISensePhysical = 12; { Autosense buffer ptr is physical }
  1080. kbSCSIFlagReserved5 = 11; { }
  1081. kbSCSIFlagReserved6 = 10; { }
  1082. kbSCSIFlagReserved7 = 9; { }
  1083. kbSCSIFlagReserved8 = 8; { }
  1084. kbSCSIDataBufferValid = 7; { Data buffer valid }
  1085. kbSCSIStatusBufferValid = 6; { Status buffer valid }
  1086. kbSCSIMessageBufferValid = 5; { Message buffer valid }
  1087. kbSCSIFlagReserved9 = 4; { }
  1088. { Defines for the bit masks of the scsiFlags field }
  1089. scsiDirectionMask = $C0000000; { Data direction mask }
  1090. scsiDirectionNone = $C0000000; { Data direction (11: no data) }
  1091. scsiDirectionReserved = $00000000; { Data direction (00: reserved) }
  1092. scsiDirectionOut = $80000000; { Data direction (10: DATA OUT) }
  1093. scsiDirectionIn = $40000000; { Data direction (01: DATA IN) }
  1094. scsiDisableAutosense = $20000000; { Disable auto sense feature }
  1095. scsiFlagReservedA = $10000000; { }
  1096. scsiFlagReserved0 = $08000000; { }
  1097. scsiCDBLinked = $04000000; { The PB contains a linked CDB }
  1098. scsiQEnable = $02000000; { Target queue actions are enabled }
  1099. scsiCDBIsPointer = $01000000; { The CDB field contains a pointer }
  1100. scsiFlagReserved1 = $00800000; { }
  1101. scsiInitiateSyncData = $00400000; { Attempt Sync data xfer and SDTR }
  1102. scsiDisableSyncData = $00200000; { Disable sync, go to async }
  1103. scsiSIMQHead = $00100000; { Place PB at the head of SIM Q }
  1104. scsiSIMQFreeze = $00080000; { Return the SIM Q to frozen state }
  1105. scsiSIMQNoFreeze = $00040000; { Disallow SIM Q freezing }
  1106. scsiDoDisconnect = $00020000; { Definitely do disconnect }
  1107. scsiDontDisconnect = $00010000; { Definitely don't disconnect }
  1108. scsiDataReadyForDMA = $00008000; { Data buffer(s) are ready for DMA }
  1109. scsiFlagReserved3 = $00004000; { }
  1110. scsiDataPhysical = $00002000; { SG/Buffer data ptrs are physical }
  1111. scsiSensePhysical = $00001000; { Autosense buffer ptr is physical }
  1112. scsiFlagReserved5 = $00000800; { }
  1113. scsiFlagReserved6 = $00000400; { }
  1114. scsiFlagReserved7 = $00000200; { }
  1115. scsiFlagReserved8 = $00000100; { }
  1116. { bit masks for the scsiIOFlags field in SCSIExecIOPB }
  1117. scsiNoParityCheck = $0002; { disable parity checking }
  1118. scsiDisableSelectWAtn = $0004; { disable select w/Atn }
  1119. scsiSavePtrOnDisconnect = $0008; { do SaveDataPointer upon Disconnect msg }
  1120. scsiNoBucketIn = $0010; { donÕt bit bucket in during this I/O }
  1121. scsiNoBucketOut = $0020; { donÕt bit bucket out during this I/O }
  1122. scsiDisableWide = $0040; { disable wide transfer negotiation }
  1123. scsiInitiateWide = $0080; { initiate wide transfer negotiation }
  1124. scsiRenegotiateSense = $0100; { renegotiate sync/wide before issuing autosense }
  1125. scsiDisableDiscipline = $0200; { disable parameter checking on SCSIExecIO calls }
  1126. scsiIOFlagReserved0080 = $0080; { }
  1127. scsiIOFlagReserved8000 = $8000; { }
  1128. { Defines for the Bus Inquiry PB fields. }
  1129. { scsiHBAInquiry field bits }
  1130. scsiBusMDP = $80; { Supports Modify Data Pointer message }
  1131. scsiBusWide32 = $40; { Supports 32 bit wide SCSI }
  1132. scsiBusWide16 = $20; { Supports 16 bit wide SCSI }
  1133. scsiBusSDTR = $10; { Supports Sync Data Transfer Req message }
  1134. scsiBusLinkedCDB = $08; { Supports linked CDBs }
  1135. scsiBusTagQ = $02; { Supports tag queue message }
  1136. scsiBusSoftReset = $01; { Supports soft reset }
  1137. { Defines for the scsiDataType field }
  1138. scsiDataBuffer = 0; { single contiguous buffer supplied }
  1139. scsiDataTIB = 1; { TIB supplied (ptr in scsiDataPtr) }
  1140. scsiDataSG = 2; { scatter/gather list supplied }
  1141. scsiDataIOTable = 3; { #(7/11/95) Prepared by Block Storage }
  1142. { scsiDataTypes field bits }
  1143. { bits 0->15 Apple-defined, 16->30 3rd-party unique, 31 = reserved }
  1144. scsiBusDataTIB = $02; { TIB supplied (ptr in scsiDataPtr) }
  1145. scsiBusDataBuffer = $01; { single contiguous buffer supplied }
  1146. scsiBusDataSG = $04; { scatter/gather list supplied }
  1147. scsiBusDataIOTable = $08; { (2/6/95) Prepare Memory for IO }
  1148. scsiBusDataReserved = $80000000; { }
  1149. { scsiScanFlags field bits }
  1150. scsiBusScansDevices = $80; { Bus scans for and maintains device list }
  1151. scsiBusScansOnInit = $40; { Bus scans performed at power-up/reboot }
  1152. scsiBusLoadsROMDrivers = $20; { may load ROM drivers to support targets }
  1153. { scsiFeatureFlags field bits }
  1154. scsiBusUltra4SCSI = $00000800; { HBA supports Ultra4(Ultra320) SCSI }
  1155. scsiBusLVD = $00000400; { HBA is Low Voltage Differential Bus }
  1156. scsiBusUltra3SCSI = $00000200; { HBA supports Ultra3 SCSI }
  1157. scsiBusUltra2SCSI = $00000100; { HBA supports Ultra2 SCSI }
  1158. scsiBusInternalExternalMask = $000000C0; { bus internal/external mask }
  1159. scsiBusInternalExternalUnknown = $00000000; { not known whether bus is inside or outside }
  1160. scsiBusInternalExternal = $000000C0; { bus goes inside and outside the box }
  1161. scsiBusInternal = $00000080; { bus goes inside the box }
  1162. scsiBusExternal = $00000040; { bus goes outside the box }
  1163. scsiBusCacheCoherentDMA = $00000020; { DMA is cache coherent }
  1164. scsiBusOldCallCapable = $00000010; { SIM is old call capable }
  1165. scsiBusUltraSCSI = $00000008; { HBA supports Ultra SCSI }
  1166. scsiBusDifferential = $00000004; { Single Ended (0) or Differential (1) }
  1167. scsiBusFastSCSI = $00000002; { HBA supports fast SCSI }
  1168. scsiBusDMAavailable = $00000001; { DMA is available }
  1169. { scsiWeirdStuff field bits }
  1170. scsiOddDisconnectUnsafeRead1 = $0001; { Disconnects on odd byte boundries are unsafe with DMA and/or blind reads }
  1171. scsiOddDisconnectUnsafeWrite1 = $0002; { Disconnects on odd byte boundries are unsafe with DMA and/or blind writes }
  1172. scsiBusErrorsUnsafe = $0004; { Non-handshaked delays or disconnects during blind transfers may cause a crash }
  1173. scsiRequiresHandshake = $0008; { Non-handshaked delays or disconnects during blind transfers may cause data corruption }
  1174. scsiTargetDrivenSDTRSafe = $0010; { Targets which initiate synchronous negotiations are supported }
  1175. scsiOddCountForPhysicalUnsafe = $0020; { If using physical addrs all counts must be even, and disconnects must be on even boundries }
  1176. scsiAbortCmdFixed = $0040; { Set if abort command is fixed to properly make callbacks }
  1177. scsiMeshACKTimingFixed = $0080; { Set if bug allowing Mesh to release ACK prematurely is fixed }
  1178. { scsiHBAslotType values }
  1179. scsiMotherboardBus = $00; { A built in Apple supplied bus }
  1180. scsiNuBus = $01; { A SIM on a NuBus card }
  1181. scsiPDSBus = $03; { " on a PDS card }
  1182. scsiPCIBus = $04; { " on a PCI bus card }
  1183. scsiPCMCIABus = $05; { " on a PCMCIA card }
  1184. scsiFireWireBridgeBus = $06; { " connected through a FireWire bridge }
  1185. scsiUSBBus = $07; { " connected on a USB bus }
  1186. { Defines for the scsiDriverFlags field (in SCSIDriverPB) }
  1187. scsiDeviceSensitive = $0001; { Only driver should access this device }
  1188. scsiDeviceNoOldCallAccess = $0002; { no old call access to this device }
  1189. { SIMInitInfo PB }
  1190. { directions are for SCSIRegisterBus call ( -> parm, <- result) }
  1191. type
  1192. SIMInitInfoPtr = ^SIMInitInfo;
  1193. SIMInitInfo = record
  1194. SIMstaticPtr: Ptr; { <- alloc. ptr to the SIM's static vars }
  1195. staticSize: SInt32; { -> num bytes SIM needs for static vars }
  1196. SIMInit: SIMInitUPP; { -> pointer to the SIM init routine }
  1197. SIMAction: SIMActionUPP; { -> pointer to the SIM action routine }
  1198. SIM_ISR: SCSIInterruptUPP; { reserved }
  1199. SIMInterruptPoll: SCSIInterruptUPP; { -> pointer to the SIM interrupt poll routine }
  1200. NewOldCall: SIMActionUPP; { -> pointer to the SIM NewOldCall routine }
  1201. ioPBSize: UInt16; { -> size of SCSI_IO_PBs required for this SIM }
  1202. oldCallCapable: boolean; { -> true if this SIM can handle old-API calls }
  1203. simInfoUnused1: SInt8; { reserved }
  1204. simInternalUse: SInt32; { xx not affected or viewed by XPT }
  1205. XPT_ISR: SCSIUPP; { reserved }
  1206. EnteringSIM: SCSIUPP; { <- ptr to the EnteringSIM routine }
  1207. ExitingSIM: SCSIUPP; { <- ptr to the ExitingSIM routine }
  1208. MakeCallback: SCSIMakeCallbackUPP; { <- the XPT layerÕs SCSIMakeCallback routine }
  1209. busID: UInt16; { <- bus number for the registered bus }
  1210. simSlotNumber: SInt8; { <- Magic cookie to place in scsiHBASlotNumber (PCI) }
  1211. simSRsrcID: SInt8; { <- Magic cookie to place in scsiSIMsRsrcID (PCI) }
  1212. simRegEntry: Ptr; { -> The SIM's RegEntryIDPtr (PCI) }
  1213. end;
  1214. { Glue between SCSI calls and SCSITrap format }
  1215. const
  1216. xptSCSIAction = $0001;
  1217. xptSCSIRegisterBus = $0002;
  1218. xptSCSIDeregisterBus = $0003;
  1219. xptSCSIReregisterBus = $0004;
  1220. xptSCSIKillXPT = $0005; { kills Mini-XPT after transition }
  1221. xptSCSIInitialize = $000A; { Initialize the SCSI manager }
  1222. {
  1223. * SCSI bus status. These values are returned by the SCSI target in the status phase.
  1224. * They are not related to Macintosh status values (except that values other than
  1225. * scsiStatusGood will result in scsiResult set to scsiNonZeroStatus).
  1226. }
  1227. scsiStatGood = $00; { Good Status }
  1228. scsiStatCheckCondition = $02; { Check Condition }
  1229. scsiStatConditionMet = $04; { Condition Met }
  1230. scsiStatBusy = $08; { Busy }
  1231. scsiStatIntermediate = $10; { Intermediate }
  1232. scsiStatIntermedMet = $14; { Intermediate - Condition Met }
  1233. scsiStatResvConflict = $18; { Reservation conflict }
  1234. scsiStatTerminated = $22; { Command terminated }
  1235. scsiStatQFull = $28; { Queue full }
  1236. { SCSI messages }
  1237. kCmdCompleteMsg = 0;
  1238. kExtendedMsg = 1; { 0x01 }
  1239. kSaveDataPointerMsg = 2; { 0x02 }
  1240. kRestorePointersMsg = 3; { 0x03 }
  1241. kDisconnectMsg = 4; { 0x04 }
  1242. kInitiatorDetectedErrorMsg = 5; { 0x05 }
  1243. kAbortMsg = 6; { 0x06 }
  1244. kMsgRejectMsg = 7; { 0x07 }
  1245. kNoOperationMsg = 8; { 0x08 }
  1246. kMsgParityErrorMsg = 9; { 0x09 }
  1247. kLinkedCmdCompleteMsg = 10; { 0x0a }
  1248. kLinkedCmdCompleteWithFlagMsg = 11; { 0x0b }
  1249. kBusDeviceResetMsg = 12; { 0x0c }
  1250. kAbortTagMsg = 13; { 0x0d }
  1251. kClearQueueMsg = 14; { 0x0e }
  1252. kInitiateRecoveryMsg = 15; { 0x0f }
  1253. kReleaseRecoveryMsg = 16; { 0x10 }
  1254. kTerminateIOProcessMsg = 17; { 0x11 }
  1255. kSimpleQueueTag = $20; { 0x20 }
  1256. kHeadOfQueueTagMsg = $21; { 0x21 }
  1257. kOrderedQueueTagMsg = $22; { 0x22 }
  1258. kIgnoreWideResidueMsg = $23; { 0x23 }
  1259. { moveq #kSCSIx, D0; _SCSIAtomic }
  1260. {
  1261. * SCSIAction()
  1262. *
  1263. * Availability:
  1264. * Non-Carbon CFM: in InterfaceLib 7.5 and later
  1265. * CarbonLib: in CarbonLib 1.0 and later
  1266. * Mac OS X: in version 10.0 and later
  1267. }
  1268. function SCSIAction(var parameterBlock: SCSI_PB): OSErr; external name '_SCSIAction';
  1269. {$ifc CALL_NOT_IN_CARBON}
  1270. {
  1271. * SCSIRegisterBus()
  1272. *
  1273. * Availability:
  1274. * Non-Carbon CFM: in InterfaceLib 7.5 and later
  1275. * CarbonLib: not available
  1276. * Mac OS X: not available
  1277. }
  1278. function SCSIRegisterBus(var parameterBlock: SIMInitInfo): OSErr; external name '_SCSIRegisterBus';
  1279. {
  1280. * SCSIDeregisterBus()
  1281. *
  1282. * Availability:
  1283. * Non-Carbon CFM: in InterfaceLib 7.5 and later
  1284. * CarbonLib: not available
  1285. * Mac OS X: not available
  1286. }
  1287. function SCSIDeregisterBus(var parameterBlock: SCSI_PB): OSErr; external name '_SCSIDeregisterBus';
  1288. {
  1289. * SCSIReregisterBus()
  1290. *
  1291. * Availability:
  1292. * Non-Carbon CFM: in InterfaceLib 7.5 and later
  1293. * CarbonLib: not available
  1294. * Mac OS X: not available
  1295. }
  1296. function SCSIReregisterBus(var parameterBlock: SIMInitInfo): OSErr; external name '_SCSIReregisterBus';
  1297. {
  1298. * SCSIKillXPT()
  1299. *
  1300. * Availability:
  1301. * Non-Carbon CFM: in InterfaceLib 7.5 and later
  1302. * CarbonLib: not available
  1303. * Mac OS X: not available
  1304. }
  1305. function SCSIKillXPT(var parameterBlock: SIMInitInfo): OSErr; external name '_SCSIKillXPT';
  1306. {$endc} {CALL_NOT_IN_CARBON}
  1307. {$ALIGN MAC68K}
  1308. end.