Windows NT 4.0 source code leak
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

889 lines
22 KiB

4 years ago
  1. /*++
  2. Copyright (c) 1990 Microsoft Corporation
  3. Module Name:
  4. pc586sft.h
  5. Abstract:
  6. The main header for a PC586 (Local Area Network Controller
  7. Intel pc586) MAC driver.
  8. Author:
  9. Weldon Washburn (o-weldo) creation-date 10-29-90 adapted from...
  10. Anthony V. Ercolano (tonye) creation-date 19-Jun-1990
  11. Environment:
  12. This driver is expected to work in DOS, OS2 and NT at the equivalent
  13. of kernal mode.
  14. Notes:
  15. optional-notes
  16. Revision History:
  17. --*/
  18. #ifndef _PC586SFT_
  19. #define _PC586SFT_
  20. #define PC586_NDIS_MAJOR_VERSION 3
  21. #define PC586_NDIS_MINOR_VERSION 0
  22. //
  23. // ZZZ These macros are peculiar to NT.
  24. //
  25. #define PC586_ALLOC_PHYS(s) ExAllocatePool(NonPagedPool,(s))
  26. #define PC586_FREE_PHYS(s) ExFreePool((s))
  27. #define PC586_MOVE_MEMORY(Destination,Source,Length) RtlMoveMemory(Destination,Source,Length)
  28. #define PC586_ZERO_MEMORY(Destination,Length) RtlZeroMemory(Destination,Length)
  29. // = 6 bytes src addr, 6 dest, 2 length and RCVBUFSIZE (Rbd->RbdSize) data
  30. #define LOOKAHEADBUFFERSIZE (RCVBUFSIZE + 6 + 6 + 2) / 2
  31. //
  32. // This record type is inserted into the MacReserved portion
  33. // of the packet header when the packet is going through the
  34. // staged allocation of buffer space prior to the actual send.
  35. //
  36. typedef struct _PC586_RESERVED {
  37. //
  38. // Points to the next packet in the chain of queued packets
  39. // being allocated, loopbacked, or waiting for the finish
  40. // of transmission.
  41. //
  42. // The packet will either be on the stage list for allocation,
  43. // the loopback list for loopback processing, on an adapter
  44. // wide doubly linked list (see below) for post transmission
  45. // processing.
  46. //
  47. // We always keep the packet on a list so that in case the
  48. // the adapter is closing down or resetting, all the packets
  49. // can easily be located and "canceled".
  50. //
  51. PNDIS_PACKET Next;
  52. //
  53. // This field holds the binding handle of the open binding
  54. // that submitted this packet for send.
  55. //
  56. NDIS_HANDLE MacBindingHandle;
  57. //
  58. // The particular request handle for the send of this packet.
  59. //
  60. NDIS_HANDLE RequestHandle;
  61. //
  62. // The following union elements are adjusted at each stage
  63. // of the allocation. Each union element should only be accessed
  64. // during it's own stage.
  65. //
  66. union _STAGE {
  67. UINT ClearStage;
  68. struct _STAGE1 {
  69. //
  70. // A value of zero indicates that the packet needs
  71. // no adjustment.
  72. //
  73. // A value of 1 means it only requires a small packet.
  74. //
  75. // A value of 2 means it only requires a medium packet.
  76. //
  77. // A value of 3 means it must use a large packet.
  78. //
  79. UINT MinimumBufferRequirements:2;
  80. //
  81. // The number of ndis buffers to copy into the buffer.
  82. //
  83. UINT NdisBuffersToMove:14;
  84. } STAGE1;
  85. struct _STAGE2 {
  86. //
  87. // If TRUE then the packet caused an adapter buffer to
  88. // be allocated.
  89. //
  90. UINT UsedPc586Buffer:1;
  91. //
  92. // If the previous field was TRUE then this gives the
  93. // index into the array of adapter buffer descriptors that
  94. // contains the old packet information.
  95. //
  96. UINT Pc586BuffersIndex:15;
  97. //
  98. // If UsedPc586Buffer is true then this field contains the
  99. // number of *physical* ndis buffers contained in the adapter
  100. // buffer.
  101. //
  102. UINT PhysicalBuffersContained:16;
  103. } STAGE2;
  104. struct _STAGE3 {
  105. //
  106. // If TRUE then the packet caused an adapter buffer to
  107. // be allocated.
  108. //
  109. UINT UsedPc586Buffer:1;
  110. //
  111. // If the previous field was TRUE then this gives the
  112. // index into the array of adapter buffer descriptors that
  113. // contains the old packet information.
  114. //
  115. UINT Pc586BuffersIndex:15;
  116. //
  117. // Gives the index into the ring to packet structure as well
  118. // as the ring descriptors.
  119. //
  120. UINT RingIndex:16;
  121. } STAGE3;
  122. //
  123. // When the packet is submitted to the hardware and/or
  124. // placed on the loopback queue these two fields of the
  125. // union are used.
  126. //
  127. // It is always desired to keep the packet linked on
  128. // one list.
  129. //
  130. // Here's how the fields are used.
  131. //
  132. // If the packet is just going on the hardware transmit
  133. // or it is just going on the loopback then the ReadyToComplete
  134. // flag will be set TRUE immediately. If it is just going on the
  135. // loopback it also sets the status field in stage4 to successful.
  136. //
  137. // In the above situations, if the packet just went on the
  138. // loopback queue, when the packet was finished with loopback
  139. // the code would see that it was ready to complete. It would
  140. // also know that it is in loopback processing. Since the packet
  141. // can only be on one queue at a time it could simply remove
  142. // the packet from the loopback queue and indicate the send
  143. // as complete.
  144. //
  145. // If the packet not going on the loopback queue it would
  146. // be placed on an adapter wide queue. It would use as a
  147. // forward pointer the Next field. As a backward pointer it
  148. // would overlay the stage 4 field with the backward pointer.
  149. // Note that this is safe since no PNDIS_PACKET is ever odd
  150. // byte aligned, and therefore the low bit would always be clear.
  151. //
  152. // We put the packet on a doubly linked list since we could
  153. // never be quite sure of the order that we would remove packets
  154. // from this list. (This will be clear shortly.)
  155. //
  156. // If the packet needs to be transmitted as well as loopbacked
  157. // then the following occurs.
  158. //
  159. // The packets buffers are relinquished to the hardware. At the
  160. // same time the packet is placed on the loopback queue. The
  161. // stage4 field ReadyToComplete is set to false.
  162. //
  163. // If the packet finishes transmission and the ReadyToComplete
  164. // flag is false that means it still hasn't finished loopback
  165. // and therefore is still on the loopback list. The code
  166. // simply sets ReadyToComplete to true and the status of the
  167. // operation to true or false (depending on the result.)
  168. // When that packet does finish loopback it notes that the
  169. // ready to complete is true. It recovers that status from stage
  170. // 4. It can then remove the packet from the loopback list and
  171. // signal completion for that packet.
  172. //
  173. // If the packet finishes transmission and ReadyToComplete is true
  174. // it simply removes it from the doubly linked adapter wide queue
  175. // and signals its completion with the status that has been
  176. // determined in the trasmission complete code.
  177. //
  178. // If the loopback code finishes processing the packet and it finds
  179. // the ReadyToComplete TRUE it simply removes it from the loopback
  180. // list and signals with the saved status in STAGE4.
  181. //
  182. // If the loopback code finishes processing the packet and it finds
  183. // the ReadyToComplete FALSE it simply puts the packet on the adapter
  184. // wide doubly linked list with ReadyToComplete set to TRUE.
  185. //
  186. // The main reason this is a doubly linked list is that there is no
  187. // real way to predict when a packet will finish loopback and no
  188. // real way to predict whether a packet even will be loopbacked.
  189. // With this lack of knowledge, and the fact that the above packets
  190. // may end up on the same list, the packet at the front of that
  191. // list may not be the first packet to complete first. With
  192. // a doubly linked list it is much easier to pull a packet out of
  193. // the middle of that list.
  194. //
  195. struct _STAGE4 {
  196. //
  197. // Under the protection of the transmit queue lock
  198. // this value will be examined by both the loopback
  199. // completion code and the hardware send completion
  200. // code. If either of them find the value to be true
  201. // they will send the transmit complete.
  202. //
  203. // Note that if the packet didn't have to be loopbacked
  204. // or if the packet didn't need to go out on the wire
  205. // the this value will be initialized to true. Otherwise
  206. // this value will be set to false just before it is
  207. // relinquished to the hardware and to the loopback queue.
  208. //
  209. UINT ReadyToComplete:1;
  210. //
  211. // When the hardware send is done this will record whether
  212. // the send was successful or not. It is only used if
  213. // ReadyToComplete is FALSE.
  214. //
  215. // By definition loopback can never fail.
  216. //
  217. UINT SuccessfulTransmit:1;
  218. } STAGE4;
  219. //
  220. // Used as a back pointer in a doubly linked list if the
  221. // packet needs to go on an adapter wide queue to finish
  222. // processing.
  223. //
  224. PNDIS_PACKET BackPointer;
  225. } STAGE;
  226. } PC586_RESERVED,*PPC586_RESERVED;
  227. //
  228. // This macro will return a pointer to the pc586 reserved portion
  229. // of a packet given a pointer to a packet.
  230. //
  231. #define PPC586_RESERVED_FROM_PACKET(Packet) \
  232. ((PPC586_RESERVED)((PVOID)(&(Packet)->MacReserved)))
  233. typedef struct _PC586_ADAPTER {
  234. //
  235. // OS Dependant fields of the adapter.
  236. //
  237. //
  238. // Holds the interrupt object for this adapter.
  239. //
  240. KINTERRUPT Interrupt;
  241. //
  242. // Normal processing DPC.
  243. //
  244. KDPC InterruptDPC;
  245. //
  246. // Non OS fields of the adapter.
  247. //
  248. //
  249. // Zero terminated string that holds the name of the particular device
  250. // adapter. This is set at initialization.
  251. //
  252. PSZ DeviceName;
  253. //
  254. // This boolean is used as a gate to ensure that only one thread
  255. // of execution is actually processing interrupts or some other
  256. // source of deferred processing.
  257. //
  258. BOOLEAN DoingProcessing;
  259. //
  260. // The network address from the hardware.
  261. //
  262. UCHAR NetworkAddress[MAC_LENGTH_OF_ADDRESS];
  263. //
  264. // Keeps a reference count on the current number of uses of
  265. // this adapter block. Uses is defined to be the number of
  266. // routines currently within the "external" interface.
  267. //
  268. UINT References;
  269. //
  270. // List head for all open bindings for this adapter.
  271. //
  272. LIST_ENTRY OpenBindings;
  273. //
  274. // List head for all opens that had outstanding references
  275. // when an attempt was made to close them.
  276. //
  277. LIST_ENTRY CloseList;
  278. //
  279. // Spinlock to protect fields in this structure..
  280. //
  281. NDIS_SPIN_LOCK Lock;
  282. //
  283. // Handle given by NDIS when the MAC registered itself.
  284. //
  285. NDIS_HANDLE NdisMacHandle;
  286. //
  287. // Handle given by NDIS when the adapter was registered.
  288. //
  289. NDIS_HANDLE NdisAdapterHandle;
  290. //
  291. // Pointer to the filter database for the MAC.
  292. //
  293. PMAC_FILTER FilterDB;
  294. //
  295. // Pointer to the first packet on the loopback list.
  296. //
  297. // Can only be accessed when the adapter lock
  298. // is held.
  299. //
  300. PNDIS_PACKET FirstLoopBack;
  301. //
  302. // Pointer to the last packet on the loopback list.
  303. //
  304. // Can only be accessed when the adapter lock
  305. // is held.
  306. //
  307. PNDIS_PACKET LastLoopBack;
  308. //
  309. // Pointer to the first transmitting packet that is actually
  310. // sending, or done with the living on the loopback queue.
  311. //
  312. // Can only be accessed when the adapter lock
  313. // is held.
  314. //
  315. PNDIS_PACKET FirstFinishTransmit;
  316. //
  317. // Pointer to the last transmitting packet that is actually
  318. // sending, or done with the living on the loopback queue.
  319. //
  320. // Can only be accessed when the adapter lock
  321. // is held.
  322. //
  323. PNDIS_PACKET LastFinishTransmit;
  324. //
  325. // These fields let the send allocation code know that it's
  326. // futile to even try to move a packet along to that stage.
  327. //
  328. // Stage2 and Stage3 Open would be set to false in StagedAllocation
  329. // and set to true by the interrupt processing code.
  330. //
  331. // Stage4Open could be set to false by any number of routines
  332. // if they wish to close down the sending of packets. It
  333. // would be set to true to turn back sending of packets.
  334. //
  335. // All of the stages would be closed to close a binding
  336. // or to reset the adapter.
  337. //
  338. // These variables can only be accessed when the adapter
  339. // lock is held.
  340. //
  341. BOOLEAN Stage4Open;
  342. BOOLEAN Stage3Open;
  343. BOOLEAN Stage2Open;
  344. BOOLEAN Stage1Open;
  345. //
  346. // These AlreadyProcessingStageX variables are set up to keep
  347. // more than one thread from accessing a particular thread
  348. // a one time.
  349. //
  350. // These variables can only be accessed when the adapter
  351. // lock is held.
  352. //
  353. BOOLEAN AlreadyProcessingStage4;
  354. BOOLEAN AlreadyProcessingStage3;
  355. BOOLEAN AlreadyProcessingStage2;
  356. //
  357. // Pointers to the first and last packets at a particular stage
  358. // of allocation. All packets in transmit are linked
  359. // via there next field.
  360. //
  361. // Can only be accessed when the adapter lock
  362. // is held.
  363. //
  364. PNDIS_PACKET FirstStage1Packet;
  365. PNDIS_PACKET LastStage1Packet;
  366. PNDIS_PACKET FirstStage2Packet;
  367. PNDIS_PACKET LastStage2Packet;
  368. PNDIS_PACKET FirstStage3Packet;
  369. PNDIS_PACKET LastStage3Packet;
  370. //
  371. // Flag that when enabled lets routines know that a reset
  372. // is in progress.
  373. //
  374. BOOLEAN ResetInProgress;
  375. //
  376. // Pointer to the binding that initiated the reset. This
  377. // will be null if the reset is initiated by the MAC itself.
  378. //
  379. struct _PC586_OPEN *ResettingOpen;
  380. //
  381. // RequestHandle of the request that initiated the reset. This
  382. // value is undefined if the reset is initiated by the MAC itself.
  383. //
  384. NDIS_HANDLE ResetRequestHandle;
  385. //
  386. // The type of the request that caused the adapter to reset.
  387. //
  388. NDIS_REQUEST_TYPE ResetRequestType;
  389. USHORT LookaheadBufferNdis [LOOKAHEADBUFFERSIZE];
  390. // The transmit packet that currently "owns" the 586 xmt cmd block
  391. PNDIS_PACKET OwningPacket;
  392. //
  393. // 82586 specific part of PC586_ADAPTER
  394. //
  395. // pointers used in receiveing a packet
  396. PFD BeginFd, EndFd;
  397. PRBD BeginRbd, EndRbd;
  398. // pointers to 82586 control structures
  399. PSCP Scp;
  400. PISCP Iscp;
  401. PSCB Scb;
  402. PCMD Cb;
  403. PTBD Tbd;
  404. PUSHORT CommandBuffer;
  405. //
  406. // pc586 netcard specific part of PC586_ADAPTER
  407. //
  408. PUSHORT CAAddr;
  409. PUSHORT IntAddr;
  410. PUCHAR StaticRam, CmdProm;
  411. } PC586_ADAPTER,*PPC586_ADAPTER;
  412. //
  413. // Given a MacBindingHandle this macro returns a pointer to the
  414. // PC586_ADAPTER.
  415. //
  416. #define PPC586_ADAPTER_FROM_BINDING_HANDLE(Handle) \
  417. (((PPC586_OPEN)((PVOID)(Handle)))->OwningPc586)
  418. //
  419. // Given a MacContextHandle return the PPC586_ADAPTER
  420. // it represents.
  421. //
  422. #define PPC586_ADAPTER_FROM_CONTEXT_HANDLE(Handle) \
  423. ((PPC586_ADAPTER)((PVOID)(Handle)))
  424. //
  425. // Given a pointer to a PC586_ADAPTER return the
  426. // proper MacContextHandle.
  427. //
  428. #define CONTEXT_HANDLE_FROM_PPC586_ADAPTER(Ptr) \
  429. ((NDIS_HANDLE)((PVOID)(Ptr)))
  430. //
  431. // One of these structures is created on each MacOpenAdapter.
  432. //
  433. typedef struct _PC586_OPEN {
  434. //
  435. // Linking structure for all of the open bindings of a particular
  436. // adapter.
  437. //
  438. LIST_ENTRY OpenList;
  439. //
  440. // The Adapter that requested this open binding.
  441. //
  442. PPC586_ADAPTER OwningPc586;
  443. //
  444. // Index of this adapter in the filter database.
  445. //
  446. UINT FilterIndex;
  447. //
  448. // Given by NDIS when the adapter was opened.
  449. //
  450. NDIS_HANDLE NdisBindingContext;
  451. //
  452. // Counter of all the different reasons that a open binding
  453. // couldn't be closed. This would be incremented each time
  454. // for:
  455. //
  456. // While a particular interface routine is accessing this open
  457. //
  458. // During an indication.
  459. //
  460. // When the open causes a reset.
  461. //
  462. // A packet currently being sent.
  463. //
  464. // (Basically the above two mean any time the open has left
  465. // some processing around to be accomplished later.)
  466. //
  467. // This field should only be accessed when the adapter lock is held.
  468. //
  469. UINT References;
  470. //
  471. // A flag indicating that this binding is in the process of closing.
  472. //
  473. BOOLEAN BindingShuttingDown;
  474. //
  475. // Request handle of the close request for this binding.
  476. //
  477. NDIS_HANDLE CloseHandle;
  478. } PC586_OPEN,*PPC586_OPEN;
  479. //
  480. // This macro returns a pointer to a PPC586_OPEN given a MacBindingHandle.
  481. //
  482. #define PPC586_OPEN_FROM_BINDING_HANDLE(Handle) \
  483. ((PPC586_OPEN)((PVOID)Handle))
  484. //
  485. // This macro returns a NDIS_HANDLE from a PPC586_OPEN
  486. //
  487. #define BINDING_HANDLE_FROM_PPC586_OPEN(Open) \
  488. ((NDIS_HANDLE)((PVOID)Open))
  489. //
  490. // This macro will act a "epilogue" to every routine in the
  491. // *interface*. It will check whether there any requests needed
  492. // to defer there processing. It will also decrement the reference
  493. // count on the adapter. If the reference count is zero and there
  494. // is deferred work to do it will insert the interrupt processing
  495. // routine in the DPC queue.
  496. //
  497. // Note that we don't need to include checking for blocked receives
  498. // since blocked receives imply that there will eventually be an
  499. // interrupt.
  500. //
  501. // NOTE: This macro assumes that it is called with the lock acquired.
  502. //
  503. // ZZZ This routine is NT specific.
  504. //
  505. #define PC586_DO_DEFERRED(Adapter) \
  506. { \
  507. PPC586_ADAPTER _A = (Adapter); \
  508. _A->References--; \
  509. if ((!_A->References) && \
  510. (_A->ResetInProgress || \
  511. _A->FirstLoopBack || \
  512. (!IsListEmpty(&_A->CloseList)))) { \
  513. NdisReleaseSpinLock(&_A->Lock); \
  514. KeInsertQueueDpc( \
  515. &_A->InterruptDPC, \
  516. NULL, \
  517. NULL \
  518. ); \
  519. } else { \
  520. NdisReleaseSpinLock(&_A->Lock); \
  521. } \
  522. }
  523. //
  524. // This structure is passed as context from the receive interrupt
  525. // processor. Eventually it will be used as a parameter to
  526. // Pc586TransferData. Pc586TransferData can get two kinds of
  527. // context. It will receive either an ndis packet or it will
  528. // receive a PC586_RECEIVE_CONTEXT. It will be able to tell
  529. // the difference since the PC586_RECEIVE_CONTEXT will have
  530. // its low bit set. No pointer to an ndis packet can have its low
  531. // bit set.
  532. //
  533. typedef struct { union {
  534. UINT WholeThing;
  535. UINT FrameDescriptor; } a;
  536. } PC586_RECEIVE_CONTEXT,*PPC586_RECEIVE_CONTEXT;
  537. //
  538. // We define the external interfaces to the pc586 driver.
  539. // These routines are only external to permit separate
  540. // compilation. Given a truely fast compiler they could
  541. // all reside in a single file and be static.
  542. //
  543. extern
  544. NDIS_STATUS
  545. Pc586TransferData(
  546. IN NDIS_HANDLE MacBindingHandle,
  547. IN NDIS_HANDLE RequestHandle,
  548. IN NDIS_HANDLE MacReceiveContext,
  549. IN UINT ByteOffset,
  550. IN UINT BytesToTransfer,
  551. OUT PNDIS_PACKET Packet,
  552. OUT PUINT BytesTransferred
  553. );
  554. extern
  555. NDIS_STATUS
  556. Pc586Send(
  557. IN NDIS_HANDLE MacBindingHandle,
  558. IN NDIS_HANDLE RequestHandle,
  559. IN PNDIS_PACKET Packet
  560. );
  561. extern
  562. BOOLEAN
  563. Pc586StartAdapters(
  564. IN NDIS_HANDLE NdisMacHandle
  565. );
  566. extern
  567. VOID
  568. Pc586StagedAllocation(
  569. IN PPC586_ADAPTER Adapter
  570. );
  571. extern
  572. VOID
  573. Pc586CopyFromPacketToBuffer(
  574. IN PNDIS_PACKET Packet,
  575. IN UINT Offset,
  576. IN UINT BytesToCopy,
  577. OUT PCHAR Buffer,
  578. OUT PUINT BytesCopied
  579. );
  580. extern
  581. VOID
  582. Pc586CopyFromPacketToPacket(
  583. IN PNDIS_PACKET Destination,
  584. IN UINT DestinationOffset,
  585. IN UINT BytesToCopy,
  586. IN PNDIS_PACKET Source,
  587. IN UINT SourceOffset,
  588. OUT PUINT BytesCopied
  589. );
  590. extern
  591. VOID
  592. Pc586ProcessLoopback(
  593. IN PPC586_ADAPTER Adapter
  594. );
  595. extern
  596. VOID
  597. Pc586RemovePacketFromLoopBack(
  598. IN PPC586_ADAPTER Adapter
  599. );
  600. extern
  601. VOID
  602. Pc586PutPacketOnLoopBack(
  603. IN PPC586_ADAPTER Adapter,
  604. IN PNDIS_PACKET Packet,
  605. IN BOOLEAN ReadyToComplete
  606. );
  607. extern
  608. VOID
  609. Pc586RemovePacketOnFinishTrans(
  610. IN PPC586_ADAPTER Adapter,
  611. IN PNDIS_PACKET Packet
  612. );
  613. extern
  614. VOID
  615. Pc586PutPacketOnFinishTrans(
  616. IN PPC586_ADAPTER Adapter,
  617. IN PNDIS_PACKET Packet
  618. );
  619. extern
  620. VOID
  621. Pc586HardwareDetails(
  622. IN PPC586_ADAPTER Adapter,
  623. IN PVOID Specific
  624. );
  625. extern
  626. VOID
  627. Pc586StopChip(
  628. IN PPC586_ADAPTER Adapter
  629. );
  630. extern
  631. BOOLEAN
  632. Pc586RegisterAdapter(
  633. IN NDIS_HANDLE NdisMacHandle,
  634. IN PSZ DeviceName,
  635. IN PVOID Pc586BaseHardwareMemoryAddress,
  636. IN CCHAR Pc586InterruptVector,
  637. IN KIRQL Pc586InterruptIrql,
  638. IN UINT MaximumMulticastAddresses,
  639. IN UINT MaximumOpenAdapters,
  640. );
  641. #endif // _PC586SFT_
  642. static
  643. VOID
  644. ReQFd(
  645. IN PPC586_ADAPTER Adapter,
  646. IN PFD Fd
  647. );
  648. static
  649. VOID
  650. RuStart(
  651. IN PPC586_ADAPTER Adapter
  652. );
  653. static
  654. VOID
  655. ShuvWord(
  656. IN PUSHORT VirtAddr,
  657. IN USHORT Value
  658. );
  659. static
  660. USHORT
  661. PullWord(
  662. IN PUSHORT VirtAddr
  663. );
  664. static
  665. VOID
  666. BuildCu(
  667. IN PPC586_ADAPTER Adapter
  668. );
  669. static
  670. VOID
  671. BuildRu(
  672. IN PPC586_ADAPTER Adapter
  673. );
  674. static
  675. BOOLEAN
  676. Diagnose586(
  677. IN PPC586_ADAPTER Adapter
  678. );
  679. static
  680. BOOLEAN
  681. Config586(
  682. IN PPC586_ADAPTER Adapter
  683. );
  684. static
  685. USHORT
  686. PromAddr(
  687. IN PPC586_ADAPTER Adapter,
  688. IN ULONG Index
  689. );
  690. static
  691. VOID
  692. ChanAttn(
  693. IN PPC586_ADAPTER Adapter
  694. );
  695. static
  696. VOID
  697. WaitScb(
  698. IN PPC586_ADAPTER Adapter
  699. );
  700. static
  701. USHORT
  702. VirtToPc586(
  703. IN PPC586_ADAPTER Adapter,
  704. IN PUCHAR KernelVirtAddr
  705. );
  706. static
  707. PUCHAR
  708. Pc586ToVirt(
  709. IN PPC586_ADAPTER Adapter,
  710. IN USHORT Addr586
  711. );
  712. static
  713. VOID
  714. PutPacket(
  715. IN PPC586_ADAPTER Adapter,
  716. IN PFD Fd,
  717. IN UINT PacketLength
  718. );
  719. static
  720. VOID
  721. Pc586IntOn(
  722. IN PPC586_ADAPTER Adapter
  723. );
  724. static
  725. VOID
  726. Pc586IntOff(
  727. IN PPC586_ADAPTER Adapter
  728. );
  729. static
  730. Pc586TimeOut(
  731. IN PDEVICE_OBJECT DeviceObject,
  732. IN PLONG TimerCounter
  733. );
  734. static
  735. VOID
  736. Pc586MoveToHost(
  737. IN PVOID DestinationVirtualAddress,
  738. IN PVOID SourceVirtualAddress,
  739. IN UINT AmountToMove
  740. );
  741. static
  742. VOID
  743. Pc586MoveToAdapter(
  744. IN PVOID DestinationVirtualAddress,
  745. IN PVOID SourceVirtualAddress,
  746. IN UINT AmountToMove
  747. );