Source code of Windows XP (NT5)
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.

2226 lines
64 KiB

  1. #if ARCNET
  2. #include <afilter.h>
  3. #endif
  4. #include <xfilter.h>
  5. #define NDIS_M_MAX_LOOKAHEAD 526
  6. //
  7. // Function types for NDIS_MINIPORT_CHARACTERISTICS
  8. //
  9. typedef
  10. BOOLEAN
  11. (*W_CHECK_FOR_HANG_HANDLER)(
  12. IN NDIS_HANDLE MiniportAdapterContext
  13. );
  14. typedef
  15. VOID
  16. (*W_DISABLE_INTERRUPT_HANDLER)(
  17. IN NDIS_HANDLE MiniportAdapterContext
  18. );
  19. typedef
  20. VOID
  21. (*W_ENABLE_INTERRUPT_HANDLER)(
  22. IN NDIS_HANDLE MiniportAdapterContext
  23. );
  24. typedef
  25. VOID
  26. (*W_HALT_HANDLER)(
  27. IN NDIS_HANDLE MiniportAdapterContext
  28. );
  29. typedef
  30. VOID
  31. (*W_HANDLE_INTERRUPT_HANDLER)(
  32. IN NDIS_HANDLE MiniportAdapterContext
  33. );
  34. typedef
  35. NDIS_STATUS
  36. (*W_INITIALIZE_HANDLER)(
  37. OUT PNDIS_STATUS OpenErrorStatus,
  38. OUT PUINT SelectedMediumIndex,
  39. IN PNDIS_MEDIUM MediumArray,
  40. IN UINT MediumArraySize,
  41. IN NDIS_HANDLE MiniportAdapterContext,
  42. IN NDIS_HANDLE WrapperConfigurationContext
  43. );
  44. typedef
  45. VOID
  46. (*W_ISR_HANDLER)(
  47. OUT PBOOLEAN InterruptRecognized,
  48. OUT PBOOLEAN QueueMiniportHandleInterrupt,
  49. IN NDIS_HANDLE MiniportAdapterContext
  50. );
  51. typedef
  52. NDIS_STATUS
  53. (*W_QUERY_INFORMATION_HANDLER)(
  54. IN NDIS_HANDLE MiniportAdapterContext,
  55. IN NDIS_OID Oid,
  56. IN PVOID InformationBuffer,
  57. IN ULONG InformationBufferLength,
  58. OUT PULONG BytesWritten,
  59. OUT PULONG BytesNeeded
  60. );
  61. typedef
  62. NDIS_STATUS
  63. (*W_RECONFIGURE_HANDLER)(
  64. OUT PNDIS_STATUS OpenErrorStatus,
  65. IN NDIS_HANDLE MiniportAdapterContext OPTIONAL,
  66. IN NDIS_HANDLE WrapperConfigurationContext
  67. );
  68. typedef
  69. NDIS_STATUS
  70. (*W_RESET_HANDLER)(
  71. OUT PBOOLEAN AddressingReset,
  72. IN NDIS_HANDLE MiniportAdapterContext
  73. );
  74. typedef
  75. NDIS_STATUS
  76. (*W_SEND_HANDLER)(
  77. IN NDIS_HANDLE MiniportAdapterContext,
  78. IN PNDIS_PACKET Packet,
  79. IN UINT Flags
  80. );
  81. typedef
  82. NDIS_STATUS
  83. (*WM_SEND_HANDLER)(
  84. IN NDIS_HANDLE MiniportAdapterContext,
  85. IN NDIS_HANDLE NdisLinkHandle,
  86. IN PNDIS_WAN_PACKET Packet
  87. );
  88. typedef
  89. NDIS_STATUS
  90. (*W_SET_INFORMATION_HANDLER)(
  91. IN NDIS_HANDLE MiniportAdapterContext,
  92. IN NDIS_OID Oid,
  93. IN PVOID InformationBuffer,
  94. IN ULONG InformationBufferLength,
  95. OUT PULONG BytesRead,
  96. OUT PULONG BytesNeeded
  97. );
  98. typedef
  99. NDIS_STATUS
  100. (*W_TRANSFER_DATA_HANDLER)(
  101. OUT PNDIS_PACKET Packet,
  102. OUT PUINT BytesTransferred,
  103. IN NDIS_HANDLE MiniportAdapterContext,
  104. IN NDIS_HANDLE MiniportReceiveContext,
  105. IN UINT ByteOffset,
  106. IN UINT BytesToTransfer
  107. );
  108. typedef
  109. NDIS_STATUS
  110. (*WM_TRANSFER_DATA_HANDLER)(
  111. VOID
  112. );
  113. typedef struct _NDIS30_MINIPORT_CHARACTERISTICS
  114. {
  115. UCHAR MajorNdisVersion;
  116. UCHAR MinorNdisVersion;
  117. USHORT Filler;
  118. UINT Reserved;
  119. W_CHECK_FOR_HANG_HANDLER CheckForHangHandler;
  120. W_DISABLE_INTERRUPT_HANDLER DisableInterruptHandler;
  121. W_ENABLE_INTERRUPT_HANDLER EnableInterruptHandler;
  122. W_HALT_HANDLER HaltHandler;
  123. W_HANDLE_INTERRUPT_HANDLER HandleInterruptHandler;
  124. W_INITIALIZE_HANDLER InitializeHandler;
  125. W_ISR_HANDLER ISRHandler;
  126. W_QUERY_INFORMATION_HANDLER QueryInformationHandler;
  127. W_RECONFIGURE_HANDLER ReconfigureHandler;
  128. W_RESET_HANDLER ResetHandler;
  129. union
  130. {
  131. W_SEND_HANDLER SendHandler;
  132. WM_SEND_HANDLER WanSendHandler;
  133. };
  134. W_SET_INFORMATION_HANDLER SetInformationHandler;
  135. union
  136. {
  137. W_TRANSFER_DATA_HANDLER TransferDataHandler;
  138. WM_TRANSFER_DATA_HANDLER WanTransferDataHandler;
  139. };
  140. } NDIS30_MINIPORT_CHARACTERISTICS;
  141. //
  142. // Miniport extensions for NDIS 4.0
  143. //
  144. typedef
  145. VOID
  146. (*W_RETURN_PACKET_HANDLER)(
  147. IN NDIS_HANDLE MiniportAdapterContext,
  148. IN PNDIS_PACKET Packet
  149. );
  150. //
  151. // NDIS 4.0 extension
  152. //
  153. typedef
  154. VOID
  155. (*W_SEND_PACKETS_HANDLER)(
  156. IN NDIS_HANDLE MiniportAdapterContext,
  157. IN PPNDIS_PACKET PacketArray,
  158. IN UINT NumberOfPackets
  159. );
  160. typedef
  161. VOID
  162. (*W_ALLOCATE_COMPLETE_HANDLER)(
  163. IN NDIS_HANDLE MiniportAdapterContext,
  164. IN PVOID VirtualAddress,
  165. IN PNDIS_PHYSICAL_ADDRESS PhysicalAddress,
  166. IN ULONG Length,
  167. IN PVOID Context
  168. );
  169. typedef struct _NDIS40_MINIPORT_CHARACTERISTICS
  170. {
  171. #ifdef __cplusplus
  172. NDIS30_MINIPORT_CHARACTERISTICS Ndis30Chars;
  173. #else
  174. NDIS30_MINIPORT_CHARACTERISTICS;
  175. #endif
  176. //
  177. // Extensions for NDIS 4.0
  178. //
  179. W_RETURN_PACKET_HANDLER ReturnPacketHandler;
  180. W_SEND_PACKETS_HANDLER SendPacketsHandler;
  181. W_ALLOCATE_COMPLETE_HANDLER AllocateCompleteHandler;
  182. } NDIS40_MINIPORT_CHARACTERISTICS;
  183. //
  184. // Miniport extensions for NDIS 5.0
  185. //
  186. //
  187. // NDIS 5.0 extension - however available for miniports only
  188. //
  189. //
  190. // W_CO_CREATE_VC_HANDLER is a synchronous call
  191. //
  192. typedef
  193. NDIS_STATUS
  194. (*W_CO_CREATE_VC_HANDLER)(
  195. IN NDIS_HANDLE MiniportAdapterContext,
  196. IN NDIS_HANDLE NdisVcHandle,
  197. OUT PNDIS_HANDLE MiniportVcContext
  198. );
  199. typedef
  200. NDIS_STATUS
  201. (*W_CO_DELETE_VC_HANDLER)(
  202. IN NDIS_HANDLE MiniportVcContext
  203. );
  204. typedef
  205. NDIS_STATUS
  206. (*W_CO_ACTIVATE_VC_HANDLER)(
  207. IN NDIS_HANDLE MiniportVcContext,
  208. IN OUT PCO_CALL_PARAMETERS CallParameters
  209. );
  210. typedef
  211. NDIS_STATUS
  212. (*W_CO_DEACTIVATE_VC_HANDLER)(
  213. IN NDIS_HANDLE MiniportVcContext
  214. );
  215. typedef
  216. VOID
  217. (*W_CO_SEND_PACKETS_HANDLER)(
  218. IN NDIS_HANDLE MiniportVcContext,
  219. IN PPNDIS_PACKET PacketArray,
  220. IN UINT NumberOfPackets
  221. );
  222. typedef
  223. NDIS_STATUS
  224. (*W_CO_REQUEST_HANDLER)(
  225. IN NDIS_HANDLE MiniportAdapterContext,
  226. IN NDIS_HANDLE MiniportVcContext OPTIONAL,
  227. IN OUT PNDIS_REQUEST NdisRequest
  228. );
  229. typedef struct _NDIS50_MINIPORT_CHARACTERISTICS
  230. {
  231. #ifdef __cplusplus
  232. NDIS40_MINIPORT_CHARACTERISTICS Ndis40Chars;
  233. #else
  234. NDIS40_MINIPORT_CHARACTERISTICS;
  235. #endif
  236. //
  237. // Extensions for NDIS 5.0
  238. //
  239. W_CO_CREATE_VC_HANDLER CoCreateVcHandler;
  240. W_CO_DELETE_VC_HANDLER CoDeleteVcHandler;
  241. W_CO_ACTIVATE_VC_HANDLER CoActivateVcHandler;
  242. W_CO_DEACTIVATE_VC_HANDLER CoDeactivateVcHandler;
  243. W_CO_SEND_PACKETS_HANDLER CoSendPacketsHandler;
  244. W_CO_REQUEST_HANDLER CoRequestHandler;
  245. } NDIS50_MINIPORT_CHARACTERISTICS;
  246. //
  247. // Miniport extensions for NDIS 5.1
  248. //
  249. typedef VOID
  250. (*W_CANCEL_SEND_PACKETS_HANDLER)(
  251. IN NDIS_HANDLE MiniportAdapterContext,
  252. IN PVOID CancelId
  253. );
  254. //
  255. // power profiles
  256. //
  257. typedef enum _NDIS_POWER_PROFILE
  258. {
  259. NdisPowerProfileBattery,
  260. NdisPowerProfileAcOnLine
  261. } NDIS_POWER_PROFILE, *PNDIS_POWER_PROFILE;
  262. typedef enum _NDIS_DEVICE_PNP_EVENT
  263. {
  264. NdisDevicePnPEventQueryRemoved,
  265. NdisDevicePnPEventRemoved,
  266. NdisDevicePnPEventSurpriseRemoved,
  267. NdisDevicePnPEventQueryStopped,
  268. NdisDevicePnPEventStopped,
  269. NdisDevicePnPEventPowerProfileChanged,
  270. NdisDevicePnPEventMaximum
  271. } NDIS_DEVICE_PNP_EVENT, *PNDIS_DEVICE_PNP_EVENT;
  272. typedef VOID
  273. (*W_PNP_EVENT_NOTIFY_HANDLER)(
  274. IN NDIS_HANDLE MiniportAdapterContext,
  275. IN NDIS_DEVICE_PNP_EVENT DevicePnPEvent,
  276. IN PVOID InformationBuffer,
  277. IN ULONG InformationBufferLength
  278. );
  279. typedef VOID
  280. (*W_MINIPORT_SHUTDOWN_HANDLER) (
  281. IN NDIS_HANDLE MiniportAdapterContext
  282. );
  283. typedef struct _NDIS51_MINIPORT_CHARACTERISTICS
  284. {
  285. #ifdef __cplusplus
  286. NDIS50_MINIPORT_CHARACTERISTICS Ndis50Chars;
  287. #else
  288. NDIS50_MINIPORT_CHARACTERISTICS;
  289. #endif
  290. //
  291. // Extensions for NDIS 5.1
  292. //
  293. W_CANCEL_SEND_PACKETS_HANDLER CancelSendPacketsHandler;
  294. W_PNP_EVENT_NOTIFY_HANDLER PnPEventNotifyHandler;
  295. W_MINIPORT_SHUTDOWN_HANDLER AdapterShutdownHandler;
  296. PVOID Reserved1;
  297. PVOID Reserved2;
  298. PVOID Reserved3;
  299. PVOID Reserved4;
  300. } NDIS51_MINIPORT_CHARACTERISTICS;
  301. #ifdef NDIS51_MINIPORT
  302. typedef struct _NDIS51_MINIPORT_CHARACTERISTICS NDIS_MINIPORT_CHARACTERISTICS;
  303. #else
  304. #ifdef NDIS50_MINIPORT
  305. typedef struct _NDIS50_MINIPORT_CHARACTERISTICS NDIS_MINIPORT_CHARACTERISTICS;
  306. #else
  307. #ifdef NDIS40_MINIPORT
  308. typedef struct _NDIS40_MINIPORT_CHARACTERISTICS NDIS_MINIPORT_CHARACTERISTICS;
  309. #else
  310. typedef struct _NDIS30_MINIPORT_CHARACTERISTICS NDIS_MINIPORT_CHARACTERISTICS;
  311. #endif
  312. #endif
  313. #endif
  314. typedef NDIS_MINIPORT_CHARACTERISTICS * PNDIS_MINIPORT_CHARACTERISTICS;
  315. typedef NDIS_MINIPORT_CHARACTERISTICS NDIS_WAN_MINIPORT_CHARACTERISTICS;
  316. typedef NDIS_WAN_MINIPORT_CHARACTERISTICS * PNDIS_MINIPORT_CHARACTERISTICS;
  317. typedef struct _NDIS_MINIPORT_INTERRUPT
  318. {
  319. PKINTERRUPT InterruptObject;
  320. KSPIN_LOCK DpcCountLock;
  321. PVOID Reserved;
  322. W_ISR_HANDLER MiniportIsr;
  323. W_HANDLE_INTERRUPT_HANDLER MiniportDpc;
  324. KDPC InterruptDpc;
  325. PNDIS_MINIPORT_BLOCK Miniport;
  326. UCHAR DpcCount;
  327. BOOLEAN Filler1;
  328. //
  329. // This is used to tell when all the Dpcs for the adapter are completed.
  330. //
  331. KEVENT DpcsCompletedEvent;
  332. BOOLEAN SharedInterrupt;
  333. BOOLEAN IsrRequested;
  334. } NDIS_MINIPORT_INTERRUPT, *PNDIS_MINIPORT_INTERRUPT;
  335. typedef struct _NDIS_MINIPORT_TIMER
  336. {
  337. KTIMER Timer;
  338. KDPC Dpc;
  339. PNDIS_TIMER_FUNCTION MiniportTimerFunction;
  340. PVOID MiniportTimerContext;
  341. PNDIS_MINIPORT_BLOCK Miniport;
  342. struct _NDIS_MINIPORT_TIMER *NextTimer;
  343. } NDIS_MINIPORT_TIMER, *PNDIS_MINIPORT_TIMER;
  344. typedef
  345. VOID
  346. (*FILTER_PACKET_INDICATION_HANDLER)(
  347. IN NDIS_HANDLE Miniport,
  348. IN PPNDIS_PACKET PacketArray,
  349. IN UINT NumberOfPackets
  350. );
  351. typedef
  352. VOID
  353. (*ETH_RCV_INDICATE_HANDLER)(
  354. IN PETH_FILTER Filter,
  355. IN NDIS_HANDLE MacReceiveContext,
  356. IN PCHAR Address,
  357. IN PVOID HeaderBuffer,
  358. IN UINT HeaderBufferSize,
  359. IN PVOID LookaheadBuffer,
  360. IN UINT LookaheadBufferSize,
  361. IN UINT PacketSize
  362. );
  363. typedef
  364. VOID
  365. (*ETH_RCV_COMPLETE_HANDLER)(
  366. IN PETH_FILTER Filter
  367. );
  368. typedef
  369. VOID
  370. (*FDDI_RCV_INDICATE_HANDLER)(
  371. IN PFDDI_FILTER Filter,
  372. IN NDIS_HANDLE MacReceiveContext,
  373. IN PCHAR Address,
  374. IN UINT AddressLength,
  375. IN PVOID HeaderBuffer,
  376. IN UINT HeaderBufferSize,
  377. IN PVOID LookaheadBuffer,
  378. IN UINT LookaheadBufferSize,
  379. IN UINT PacketSize
  380. );
  381. typedef
  382. VOID
  383. (*FDDI_RCV_COMPLETE_HANDLER)(
  384. IN PFDDI_FILTER Filter
  385. );
  386. typedef
  387. VOID
  388. (*TR_RCV_INDICATE_HANDLER)(
  389. IN PTR_FILTER Filter,
  390. IN NDIS_HANDLE MacReceiveContext,
  391. IN PVOID HeaderBuffer,
  392. IN UINT HeaderBufferSize,
  393. IN PVOID LookaheadBuffer,
  394. IN UINT LookaheadBufferSize,
  395. IN UINT PacketSize
  396. );
  397. typedef
  398. VOID
  399. (*TR_RCV_COMPLETE_HANDLER)(
  400. IN PTR_FILTER Filter
  401. );
  402. typedef
  403. VOID
  404. (*WAN_RCV_HANDLER)(
  405. OUT PNDIS_STATUS Status,
  406. IN NDIS_HANDLE MiniportAdapterHandle,
  407. IN NDIS_HANDLE NdisLinkContext,
  408. IN PUCHAR Packet,
  409. IN ULONG PacketSize
  410. );
  411. typedef
  412. VOID
  413. (*WAN_RCV_COMPLETE_HANDLER)(
  414. IN NDIS_HANDLE MiniportAdapterHandle,
  415. IN NDIS_HANDLE NdisLinkContext
  416. );
  417. typedef
  418. VOID
  419. (*NDIS_M_SEND_COMPLETE_HANDLER)(
  420. IN NDIS_HANDLE MiniportAdapterHandle,
  421. IN PNDIS_PACKET Packet,
  422. IN NDIS_STATUS Status
  423. );
  424. typedef
  425. VOID
  426. (*NDIS_WM_SEND_COMPLETE_HANDLER)(
  427. IN NDIS_HANDLE MiniportAdapterHandle,
  428. IN PVOID Packet,
  429. IN NDIS_STATUS Status
  430. );
  431. typedef
  432. VOID
  433. (*NDIS_M_TD_COMPLETE_HANDLER)(
  434. IN NDIS_HANDLE MiniportAdapterHandle,
  435. IN PNDIS_PACKET Packet,
  436. IN NDIS_STATUS Status,
  437. IN UINT BytesTransferred
  438. );
  439. typedef
  440. VOID
  441. (*NDIS_M_SEND_RESOURCES_HANDLER)(
  442. IN NDIS_HANDLE MiniportAdapterHandle
  443. );
  444. typedef
  445. VOID
  446. (*NDIS_M_STATUS_HANDLER)(
  447. IN NDIS_HANDLE MiniportHandle,
  448. IN NDIS_STATUS GeneralStatus,
  449. IN PVOID StatusBuffer,
  450. IN UINT StatusBufferSize
  451. );
  452. typedef
  453. VOID
  454. (*NDIS_M_STS_COMPLETE_HANDLER)(
  455. IN NDIS_HANDLE MiniportAdapterHandle
  456. );
  457. typedef
  458. VOID
  459. (*NDIS_M_REQ_COMPLETE_HANDLER)(
  460. IN NDIS_HANDLE MiniportAdapterHandle,
  461. IN NDIS_STATUS Status
  462. );
  463. typedef
  464. VOID
  465. (*NDIS_M_RESET_COMPLETE_HANDLER)(
  466. IN NDIS_HANDLE MiniportAdapterHandle,
  467. IN NDIS_STATUS Status,
  468. IN BOOLEAN AddressingReset
  469. );
  470. typedef
  471. BOOLEAN
  472. (FASTCALL *NDIS_M_START_SENDS)(
  473. IN PNDIS_MINIPORT_BLOCK Miniport
  474. );
  475. //
  476. // Defines the type of work item.
  477. //
  478. typedef enum _NDIS_WORK_ITEM_TYPE
  479. {
  480. NdisWorkItemRequest,
  481. NdisWorkItemSend,
  482. NdisWorkItemReturnPackets,
  483. NdisWorkItemResetRequested,
  484. NdisWorkItemResetInProgress,
  485. NdisWorkItemReserved,
  486. NdisWorkItemMiniportCallback,
  487. NdisMaxWorkItems
  488. } NDIS_WORK_ITEM_TYPE, *PNDIS_WORK_ITEM_TYPE;
  489. #define NUMBER_OF_WORK_ITEM_TYPES NdisMaxWorkItems
  490. #define NUMBER_OF_SINGLE_WORK_ITEMS 6
  491. //
  492. // Work item structure
  493. //
  494. typedef struct _NDIS_MINIPORT_WORK_ITEM
  495. {
  496. //
  497. // Link for the list of work items of this type.
  498. //
  499. SINGLE_LIST_ENTRY Link;
  500. //
  501. // type of work item and context information.
  502. //
  503. NDIS_WORK_ITEM_TYPE WorkItemType;
  504. PVOID WorkItemContext;
  505. } NDIS_MINIPORT_WORK_ITEM, *PNDIS_MINIPORT_WORK_ITEM;
  506. typedef
  507. NDIS_STATUS
  508. (FASTCALL *NDIS_M_QUEUE_WORK_ITEM)(
  509. IN PNDIS_MINIPORT_BLOCK Miniport,
  510. IN NDIS_WORK_ITEM_TYPE WorkItemType,
  511. IN PVOID WorkItemContext
  512. );
  513. typedef
  514. NDIS_STATUS
  515. (FASTCALL *NDIS_M_QUEUE_NEW_WORK_ITEM)(
  516. IN PNDIS_MINIPORT_BLOCK Miniport,
  517. IN NDIS_WORK_ITEM_TYPE WorkItemType,
  518. IN PVOID WorkItemContext
  519. );
  520. typedef
  521. VOID
  522. (FASTCALL *NDIS_M_DEQUEUE_WORK_ITEM)(
  523. IN PNDIS_MINIPORT_BLOCK Miniport,
  524. IN NDIS_WORK_ITEM_TYPE WorkItemType,
  525. OUT PVOID * WorkItemContext
  526. );
  527. #if defined(NDIS_WRAPPER)
  528. //
  529. // Structure used by the logging apis
  530. //
  531. typedef struct _NDIS_LOG
  532. {
  533. PNDIS_MINIPORT_BLOCK Miniport; // The owning miniport block
  534. KSPIN_LOCK LogLock; // For serialization
  535. PIRP Irp; // Pending Irp to consume this log
  536. UINT TotalSize; // Size of the log buffer
  537. UINT CurrentSize;// Size of the log buffer
  538. UINT InPtr; // IN part of the circular buffer
  539. UINT OutPtr; // OUT part of the circular buffer
  540. UCHAR LogBuf[1]; // The circular buffer
  541. } NDIS_LOG, *PNDIS_LOG;
  542. #if ARCNET
  543. //
  544. // Arcnet specific stuff
  545. //
  546. #define ARC_SEND_BUFFERS 8
  547. #define ARC_HEADER_SIZE 4
  548. typedef struct _NDIS_ARC_BUF
  549. {
  550. NDIS_HANDLE ArcnetBufferPool;
  551. PUCHAR ArcnetLookaheadBuffer;
  552. UINT NumFree;
  553. ARC_BUFFER_LIST ArcnetBuffers[ARC_SEND_BUFFERS];
  554. } NDIS_ARC_BUF, *PNDIS_ARC_BUF;
  555. #endif
  556. #endif
  557. typedef struct _NDIS_BIND_PATHS
  558. {
  559. UINT Number;
  560. NDIS_STRING Paths[1];
  561. } NDIS_BIND_PATHS, *PNDIS_BIND_PATHS;
  562. //
  563. // Do not change the structure below !!!
  564. //
  565. typedef struct
  566. {
  567. union
  568. {
  569. PETH_FILTER EthDB;
  570. PNULL_FILTER NullDB; // Default Filter
  571. };
  572. PTR_FILTER TrDB;
  573. PFDDI_FILTER FddiDB;
  574. #if ARCNET
  575. PARC_FILTER ArcDB;
  576. #else
  577. PVOID XXXDB;
  578. #endif
  579. } FILTERDBS, *PFILTERDBS;
  580. //
  581. // one of these per mini-port registered on a Driver
  582. //
  583. struct _NDIS_MINIPORT_BLOCK
  584. {
  585. PVOID Signature; // MINIPORT_DEVICE_MAGIC_VALUE
  586. PNDIS_MINIPORT_BLOCK NextMiniport; // used by driver's MiniportQueue
  587. PNDIS_M_DRIVER_BLOCK DriverHandle; // pointer to our Driver block
  588. NDIS_HANDLE MiniportAdapterContext; // context when calling mini-port functions
  589. UNICODE_STRING MiniportName; // how mini-port refers to us
  590. PNDIS_BIND_PATHS BindPaths;
  591. NDIS_HANDLE OpenQueue; // queue of opens for this mini-port
  592. REFERENCE ShortRef; // contains spinlock for OpenQueue
  593. NDIS_HANDLE DeviceContext; // Context associated with the intermediate driver
  594. UCHAR Padding1; // DO NOT REMOVE OR NDIS WILL BREAK!!!
  595. //
  596. // Synchronization stuff.
  597. //
  598. // The boolean is used to lock out several DPCs from running at the same time.
  599. //
  600. UCHAR LockAcquired; // EXPOSED via macros. Do not move
  601. UCHAR PmodeOpens; // Count of opens which turned on pmode/all_local
  602. //
  603. // This is the processor number that the miniport's
  604. // interrupt DPC and timers are running on.
  605. //
  606. UCHAR AssignedProcessor;
  607. KSPIN_LOCK Lock;
  608. PNDIS_REQUEST MediaRequest;
  609. PNDIS_MINIPORT_INTERRUPT Interrupt;
  610. ULONG Flags; // Flags to keep track of the
  611. // miniport's state.
  612. ULONG PnPFlags;
  613. //
  614. // Send information
  615. //
  616. LIST_ENTRY PacketList;
  617. PNDIS_PACKET FirstPendingPacket; // This is head of the queue of packets
  618. // waiting to be sent to miniport.
  619. PNDIS_PACKET ReturnPacketsQueue;
  620. //
  621. // Space used for temp. use during request processing
  622. //
  623. ULONG RequestBuffer;
  624. PVOID SetMCastBuffer;
  625. PNDIS_MINIPORT_BLOCK PrimaryMiniport;
  626. PVOID WrapperContext;
  627. //
  628. // context to pass to bus driver when reading or writing config space
  629. //
  630. PVOID BusDataContext;
  631. //
  632. // flag to specify PnP capabilities of the device. we need this to fail query_stop
  633. // query_remove or suspend request if the device can not handle it
  634. //
  635. ULONG PnPCapabilities;
  636. //
  637. // Resource information
  638. //
  639. PCM_RESOURCE_LIST Resources;
  640. //
  641. // Watch-dog timer
  642. //
  643. NDIS_TIMER WakeUpDpcTimer;
  644. //
  645. // Needed for PnP. Upcased version. The buffer is allocated as part of the
  646. // NDIS_MINIPORT_BLOCK itself.
  647. //
  648. // Note:
  649. // the following two fields should be explicitly UNICODE_STRING because
  650. // under Win9x the NDIS_STRING is an ANSI_STRING
  651. //
  652. UNICODE_STRING BaseName;
  653. UNICODE_STRING SymbolicLinkName;
  654. //
  655. // Check for hang stuff
  656. //
  657. ULONG CheckForHangSeconds;
  658. USHORT CFHangTicks;
  659. USHORT CFHangCurrentTick;
  660. //
  661. // Reset information
  662. //
  663. NDIS_STATUS ResetStatus;
  664. NDIS_HANDLE ResetOpen;
  665. //
  666. // Holds media specific information.
  667. //
  668. #ifdef __cplusplus
  669. FILTERDBS FilterDbs; // EXPOSED via macros. Do not move
  670. #else
  671. FILTERDBS; // EXPOSED via macros. Do not move
  672. #endif
  673. FILTER_PACKET_INDICATION_HANDLER PacketIndicateHandler;
  674. NDIS_M_SEND_COMPLETE_HANDLER SendCompleteHandler;
  675. NDIS_M_SEND_RESOURCES_HANDLER SendResourcesHandler;
  676. NDIS_M_RESET_COMPLETE_HANDLER ResetCompleteHandler;
  677. NDIS_MEDIUM MediaType;
  678. //
  679. // contains mini-port information
  680. //
  681. ULONG BusNumber;
  682. NDIS_INTERFACE_TYPE BusType;
  683. NDIS_INTERFACE_TYPE AdapterType;
  684. PDEVICE_OBJECT DeviceObject;
  685. PDEVICE_OBJECT PhysicalDeviceObject;
  686. PDEVICE_OBJECT NextDeviceObject;
  687. //
  688. // Holds the map registers for this mini-port.
  689. //
  690. PMAP_REGISTER_ENTRY MapRegisters; // EXPOSED via macros. Do not move
  691. //
  692. // List of registered address families. Valid for the call-manager, Null for the client
  693. //
  694. PNDIS_AF_LIST CallMgrAfList;
  695. PVOID MiniportThread;
  696. PVOID SetInfoBuf;
  697. USHORT SetInfoBufLen;
  698. USHORT MaxSendPackets;
  699. //
  700. // Status code that is returned from the fake handlers.
  701. //
  702. NDIS_STATUS FakeStatus;
  703. PVOID LockHandler; // For the filter lock
  704. //
  705. // the following field should be explicitly UNICODE_STRING because
  706. // under Win9x the NDIS_STRING is an ANSI_STRING
  707. //
  708. PUNICODE_STRING pAdapterInstanceName; // Instance specific name for the adapter.
  709. PNDIS_MINIPORT_TIMER TimerQueue;
  710. UINT MacOptions;
  711. //
  712. // RequestInformation
  713. //
  714. PNDIS_REQUEST PendingRequest;
  715. UINT MaximumLongAddresses;
  716. UINT MaximumShortAddresses;
  717. UINT CurrentLookahead;
  718. UINT MaximumLookahead;
  719. //
  720. // For efficiency
  721. //
  722. W_HANDLE_INTERRUPT_HANDLER HandleInterruptHandler;
  723. W_DISABLE_INTERRUPT_HANDLER DisableInterruptHandler;
  724. W_ENABLE_INTERRUPT_HANDLER EnableInterruptHandler;
  725. W_SEND_PACKETS_HANDLER SendPacketsHandler;
  726. NDIS_M_START_SENDS DeferredSendHandler;
  727. //
  728. // The following cannot be unionized.
  729. //
  730. ETH_RCV_INDICATE_HANDLER EthRxIndicateHandler; // EXPOSED via macros. Do not move
  731. TR_RCV_INDICATE_HANDLER TrRxIndicateHandler; // EXPOSED via macros. Do not move
  732. FDDI_RCV_INDICATE_HANDLER FddiRxIndicateHandler; // EXPOSED via macros. Do not move
  733. ETH_RCV_COMPLETE_HANDLER EthRxCompleteHandler; // EXPOSED via macros. Do not move
  734. TR_RCV_COMPLETE_HANDLER TrRxCompleteHandler; // EXPOSED via macros. Do not move
  735. FDDI_RCV_COMPLETE_HANDLER FddiRxCompleteHandler; // EXPOSED via macros. Do not move
  736. NDIS_M_STATUS_HANDLER StatusHandler; // EXPOSED via macros. Do not move
  737. NDIS_M_STS_COMPLETE_HANDLER StatusCompleteHandler; // EXPOSED via macros. Do not move
  738. NDIS_M_TD_COMPLETE_HANDLER TDCompleteHandler; // EXPOSED via macros. Do not move
  739. NDIS_M_REQ_COMPLETE_HANDLER QueryCompleteHandler; // EXPOSED via macros. Do not move
  740. NDIS_M_REQ_COMPLETE_HANDLER SetCompleteHandler; // EXPOSED via macros. Do not move
  741. NDIS_WM_SEND_COMPLETE_HANDLER WanSendCompleteHandler;// EXPOSED via macros. Do not move
  742. WAN_RCV_HANDLER WanRcvHandler; // EXPOSED via macros. Do not move
  743. WAN_RCV_COMPLETE_HANDLER WanRcvCompleteHandler; // EXPOSED via macros. Do not move
  744. /********************************************************************************************/
  745. /**************** **********/
  746. /**************** STUFF ABOVE IS POTENTIALLY ACCESSED BY MACROS. ADD STUFF BELOW **********/
  747. /**************** SEVERE POSSIBILITY OF BREAKING SOMETHING IF STUFF ABOVE IS MOVED **********/
  748. /**************** **********/
  749. /********************************************************************************************/
  750. #if defined(NDIS_WRAPPER)
  751. PNDIS_MINIPORT_BLOCK NextGlobalMiniport; // used to queue miniport on global miniport queue
  752. //
  753. // Work that the miniport needs to do.
  754. //
  755. SINGLE_LIST_ENTRY WorkQueue[NUMBER_OF_WORK_ITEM_TYPES];
  756. SINGLE_LIST_ENTRY SingleWorkItems[NUMBER_OF_SINGLE_WORK_ITEMS];
  757. UCHAR SendFlags;
  758. UCHAR TrResetRing;
  759. UCHAR ArcnetAddress;
  760. UCHAR XState; // flag to indicate why we have set the fake handlers
  761. union
  762. {
  763. #if ARCNET
  764. PNDIS_ARC_BUF ArcBuf;
  765. #endif
  766. //
  767. // the following field has a different use under NT and Memphis
  768. //
  769. PVOID BusInterface;
  770. };
  771. PNDIS_LOG Log;
  772. //
  773. // Store information here to track adapters
  774. //
  775. ULONG SlotNumber;
  776. PCM_RESOURCE_LIST AllocatedResources;
  777. PCM_RESOURCE_LIST AllocatedResourcesTranslated;
  778. //
  779. // Contains a list of the packet patterns that have been added to the
  780. // adapter.
  781. //
  782. SINGLE_LIST_ENTRY PatternList;
  783. //
  784. // The driver's power management capabilities.
  785. //
  786. NDIS_PNP_CAPABILITIES PMCapabilities;
  787. //
  788. // DeviceCapabilites as received from bus driver
  789. //
  790. DEVICE_CAPABILITIES DeviceCaps;
  791. //
  792. // Contains the wake-up events that are enabled for the miniport.
  793. //
  794. ULONG WakeUpEnable;
  795. //
  796. // The current device state that the adapter is in.
  797. //
  798. DEVICE_POWER_STATE CurrentDevicePowerState;
  799. //
  800. // The following IRP is created in response to a cable disconnect
  801. // from the device. We keep a pointer around in case we need to cancel
  802. // it.
  803. //
  804. PIRP pIrpWaitWake;
  805. SYSTEM_POWER_STATE WaitWakeSystemState;
  806. //
  807. // The following is a pointer to a dynamically allocated array
  808. // of GUID structs. This is used to map GUIDs to OIDs
  809. // for custom GUIDs provided by the miniport.
  810. //
  811. LARGE_INTEGER VcIndex; // Index used to identify a VC.
  812. KSPIN_LOCK VcCountLock; // Lock used to protect VC instance count.
  813. LIST_ENTRY WmiEnabledVcs; // List of WMI enabled VCs
  814. PNDIS_GUID pNdisGuidMap; // This is a list of all the GUIDs
  815. // and OIDs supported including any
  816. // customg GUIDs.
  817. PNDIS_GUID pCustomGuidMap; // This is a pointer into
  818. // the pGuidToOidMap to the
  819. // first custom GUID.
  820. USHORT VcCount; // Number of VC's that have instance names.
  821. USHORT cNdisGuidMap; // This is the number of std. GUIDs
  822. USHORT cCustomGuidMap; // This is the number of custom GUIDs
  823. //
  824. // These two are used temporarily while allocating the map registers.
  825. //
  826. USHORT CurrentMapRegister;
  827. PKEVENT AllocationEvent;
  828. USHORT BaseMapRegistersNeeded;
  829. USHORT SGMapRegistersNeeded;
  830. ULONG MaximumPhysicalMapping;
  831. //
  832. // This timer is used for media disconnect timouts.
  833. //
  834. NDIS_TIMER MediaDisconnectTimer;
  835. //
  836. // The timeout value for media disconnect timer to fire
  837. // default is 20 seconds
  838. //
  839. USHORT MediaDisconnectTimeOut;
  840. //
  841. // Used for WMI support
  842. //
  843. USHORT InstanceNumber;
  844. //
  845. // this event will be set at the end of adapter initialization
  846. //
  847. NDIS_EVENT OpenReadyEvent;
  848. //
  849. // current PnP state of the device, ex. started, stopped, query_removed, etc.
  850. //
  851. NDIS_PNP_DEVICE_STATE PnPDeviceState;
  852. //
  853. // previous device state. to be used when we get a cancel_remove or a cancel_stop
  854. //
  855. NDIS_PNP_DEVICE_STATE OldPnPDeviceState;
  856. //
  857. // Handlers to Write/Read Bus data
  858. //
  859. PGET_SET_DEVICE_DATA SetBusData;
  860. PGET_SET_DEVICE_DATA GetBusData;
  861. KDPC DeferredDpc;
  862. //
  863. // Some NDIS gathered stats
  864. //
  865. NDIS_STATS NdisStats;
  866. //
  867. // Valid during Packet Indication
  868. //
  869. PNDIS_PACKET IndicatedPacket[MAXIMUM_PROCESSORS];
  870. //
  871. // this event is for protecting against returning from REMOVE IRP
  872. // too early and while we still have pending workitems
  873. //
  874. PKEVENT RemoveReadyEvent;
  875. //
  876. // this event gets signaled when all opens on the miniport are closed
  877. //
  878. PKEVENT AllOpensClosedEvent;
  879. //
  880. // this event gets signaled when all requests on the miniport are gone
  881. //
  882. PKEVENT AllRequestsCompletedEvent;
  883. //
  884. // Init time for the miniport in milliseconds
  885. //
  886. ULONG InitTimeMs;
  887. NDIS_MINIPORT_WORK_ITEM WorkItemBuffer[NUMBER_OF_SINGLE_WORK_ITEMS];
  888. PDMA_ADAPTER SystemAdapterObject;
  889. //
  890. // flags to fail certain NDIS APIs to make sure the driver does the right things
  891. //
  892. ULONG DriverVerifyFlags;
  893. POID_LIST OidList;
  894. //
  895. // InternalResetCount: The # of times NDIS decided a miniport was hung
  896. // MiniportResetCount The # of times miniport decided it was hung
  897. //
  898. USHORT InternalResetCount;
  899. USHORT MiniportResetCount;
  900. USHORT MediaSenseConnectCount;
  901. USHORT MediaSenseDisconnectCount;
  902. PNDIS_PACKET * xPackets;
  903. //
  904. // track the user mode requests
  905. //
  906. ULONG UserModeOpenReferences;
  907. //
  908. // Saved handlers. The handlers in the NDIS_OPEN_BLOCK are saved here
  909. // by ndisMSwapOpenHandlers and restored by ndisMRestoreOpenHandlers.
  910. //
  911. union
  912. {
  913. PVOID SavedSendHandler;
  914. PVOID SavedWanSendHandler;
  915. };
  916. PVOID SavedSendPacketsHandler;
  917. PVOID SavedCancelSendPacketsHandler;
  918. //
  919. // real SendPacketsHandler
  920. //
  921. W_SEND_PACKETS_HANDLER WSendPacketsHandler;
  922. ULONG MiniportAttributes;
  923. PDMA_ADAPTER SavedSystemAdapterObject;
  924. USHORT NumOpens;
  925. //
  926. // extra check for hang ticks allowed for OID_GEN_MEDIA_CONNECT_STATUS and OID_GEN_LINK_SPEED
  927. //
  928. USHORT CFHangXTicks;
  929. ULONG RequestCount;
  930. ULONG IndicatedPacketsCount;
  931. ULONG PhysicalMediumType;
  932. //
  933. // last request. needed for debugging purpose
  934. //
  935. PNDIS_REQUEST LastRequest;
  936. LONG DmaAdapterRefCount;
  937. PVOID FakeMac;
  938. ULONG LockDbg;
  939. ULONG LockDbgX;
  940. PVOID LockThread;
  941. ULONG InfoFlags;
  942. KSPIN_LOCK TimerQueueLock;
  943. PKEVENT ResetCompletedEvent;
  944. PKEVENT QueuedBindingCompletedEvent;
  945. PKEVENT DmaResourcesReleasedEvent;
  946. FILTER_PACKET_INDICATION_HANDLER SavedPacketIndicateHandler;
  947. ULONG RegisteredInterrupts;
  948. PNPAGED_LOOKASIDE_LIST SGListLookasideList;
  949. ULONG ScatterGatherListSize;
  950. PSECURITY_DESCRIPTOR SecurityDescriptor;
  951. //
  952. // both these variables are protected by Ref->SpinLock
  953. //
  954. ULONG NumUserOpens; // number of non-admin open handles
  955. ULONG NumAdminOpens; // number of admin open handles
  956. ULONG_REFERENCE Ref;
  957. #endif // NDIS_WRAPPER defined
  958. };
  959. //
  960. // Routines for intermediate miniport drivers.
  961. //
  962. typedef
  963. VOID
  964. (*W_MINIPORT_CALLBACK)(
  965. IN NDIS_HANDLE MiniportAdapterContext,
  966. IN PVOID CallbackContext
  967. );
  968. EXPORT
  969. NDIS_STATUS
  970. NdisIMRegisterLayeredMiniport(
  971. IN NDIS_HANDLE NdisWrapperHandle,
  972. IN PNDIS_MINIPORT_CHARACTERISTICS MiniportCharacteristics,
  973. IN UINT CharacteristicsLength,
  974. OUT PNDIS_HANDLE DriverHandle
  975. );
  976. EXPORT
  977. VOID
  978. NdisIMDeregisterLayeredMiniport(
  979. IN NDIS_HANDLE DriverHandle
  980. );
  981. EXPORT
  982. VOID
  983. NdisIMAssociateMiniport(
  984. IN NDIS_HANDLE DriverHandle,
  985. IN NDIS_HANDLE ProtocolHandle
  986. );
  987. EXPORT
  988. NDIS_STATUS
  989. NdisMRegisterDevice(
  990. IN NDIS_HANDLE NdisWrapperHandle,
  991. IN PNDIS_STRING DeviceName,
  992. IN PNDIS_STRING SymbolicName,
  993. IN PDRIVER_DISPATCH MajorFunctions[],
  994. OUT PDEVICE_OBJECT * pDeviceObject,
  995. OUT NDIS_HANDLE * NdisDeviceHandle
  996. );
  997. EXPORT
  998. NDIS_STATUS
  999. NdisMDeregisterDevice(
  1000. IN NDIS_HANDLE NdisDeviceHandle
  1001. );
  1002. EXPORT
  1003. VOID
  1004. NdisMRegisterUnloadHandler(
  1005. IN NDIS_HANDLE NdisWrapperHandle,
  1006. IN PDRIVER_UNLOAD UnloadHandler
  1007. );
  1008. //
  1009. // Operating System Requests
  1010. //
  1011. typedef UCHAR NDIS_DMA_SIZE;
  1012. #define NDIS_DMA_24BITS ((NDIS_DMA_SIZE)0)
  1013. #define NDIS_DMA_32BITS ((NDIS_DMA_SIZE)1)
  1014. #define NDIS_DMA_64BITS ((NDIS_DMA_SIZE)2)
  1015. EXPORT
  1016. NDIS_STATUS
  1017. NdisMAllocateMapRegisters(
  1018. IN NDIS_HANDLE MiniportAdapterHandle,
  1019. IN UINT DmaChannel,
  1020. IN NDIS_DMA_SIZE DmaSize,
  1021. IN ULONG BaseMapRegistersNeeded,
  1022. IN ULONG MaximumPhysicalMapping
  1023. );
  1024. EXPORT
  1025. VOID
  1026. NdisMFreeMapRegisters(
  1027. IN NDIS_HANDLE MiniportAdapterHandle
  1028. );
  1029. EXPORT
  1030. NDIS_STATUS
  1031. NdisMInitializeScatterGatherDma(
  1032. IN NDIS_HANDLE MiniportAdapterHandle,
  1033. IN BOOLEAN Dma64BitAddresses,
  1034. IN ULONG MaximumPhysicalMapping
  1035. );
  1036. EXPORT
  1037. NDIS_STATUS
  1038. NdisMRegisterIoPortRange(
  1039. OUT PVOID * PortOffset,
  1040. IN NDIS_HANDLE MiniportAdapterHandle,
  1041. IN UINT InitialPort,
  1042. IN UINT NumberOfPorts
  1043. );
  1044. EXPORT
  1045. VOID
  1046. NdisMDeregisterIoPortRange(
  1047. IN NDIS_HANDLE MiniportAdapterHandle,
  1048. IN UINT InitialPort,
  1049. IN UINT NumberOfPorts,
  1050. IN PVOID PortOffset
  1051. );
  1052. EXPORT
  1053. NDIS_STATUS
  1054. NdisMMapIoSpace(
  1055. OUT PVOID * VirtualAddress,
  1056. IN NDIS_HANDLE MiniportAdapterHandle,
  1057. IN NDIS_PHYSICAL_ADDRESS PhysicalAddress,
  1058. IN UINT Length
  1059. );
  1060. EXPORT
  1061. VOID
  1062. NdisMUnmapIoSpace(
  1063. IN NDIS_HANDLE MiniportAdapterHandle,
  1064. IN PVOID VirtualAddress,
  1065. IN UINT Length
  1066. );
  1067. EXPORT
  1068. NDIS_STATUS
  1069. NdisMRegisterInterrupt(
  1070. OUT PNDIS_MINIPORT_INTERRUPT Interrupt,
  1071. IN NDIS_HANDLE MiniportAdapterHandle,
  1072. IN UINT InterruptVector,
  1073. IN UINT InterruptLevel,
  1074. IN BOOLEAN RequestIsr,
  1075. IN BOOLEAN SharedInterrupt,
  1076. IN NDIS_INTERRUPT_MODE InterruptMode
  1077. );
  1078. EXPORT
  1079. VOID
  1080. NdisMDeregisterInterrupt(
  1081. IN PNDIS_MINIPORT_INTERRUPT Interrupt
  1082. );
  1083. EXPORT
  1084. BOOLEAN
  1085. NdisMSynchronizeWithInterrupt(
  1086. IN PNDIS_MINIPORT_INTERRUPT Interrupt,
  1087. IN PVOID SynchronizeFunction,
  1088. IN PVOID SynchronizeContext
  1089. );
  1090. EXPORT
  1091. VOID
  1092. NdisMQueryAdapterResources(
  1093. OUT PNDIS_STATUS Status,
  1094. IN NDIS_HANDLE WrapperConfigurationContext,
  1095. OUT PNDIS_RESOURCE_LIST ResourceList,
  1096. IN OUT PUINT BufferSize
  1097. );
  1098. //
  1099. // Timers
  1100. //
  1101. // VOID
  1102. // NdisMSetTimer(
  1103. // IN PNDIS_MINIPORT_TIMER Timer,
  1104. // IN UINT MillisecondsToDelay
  1105. // );
  1106. #define NdisMSetTimer(_Timer, _Delay) NdisSetTimer((PNDIS_TIMER)_Timer, _Delay)
  1107. EXPORT
  1108. VOID
  1109. NdisMSetPeriodicTimer(
  1110. IN PNDIS_MINIPORT_TIMER Timer,
  1111. IN UINT MillisecondPeriod
  1112. );
  1113. EXPORT
  1114. VOID
  1115. NdisMInitializeTimer(
  1116. IN OUT PNDIS_MINIPORT_TIMER Timer,
  1117. IN NDIS_HANDLE MiniportAdapterHandle,
  1118. IN PNDIS_TIMER_FUNCTION TimerFunction,
  1119. IN PVOID FunctionContext
  1120. );
  1121. EXPORT
  1122. VOID
  1123. NdisMCancelTimer(
  1124. IN PNDIS_MINIPORT_TIMER Timer,
  1125. OUT PBOOLEAN TimerCancelled
  1126. );
  1127. EXPORT
  1128. VOID
  1129. NdisMSleep(
  1130. IN ULONG MicrosecondsToSleep
  1131. );
  1132. //
  1133. // Physical Mapping
  1134. //
  1135. EXPORT
  1136. VOID
  1137. NdisMStartBufferPhysicalMapping(
  1138. IN NDIS_HANDLE MiniportAdapterHandle,
  1139. IN PNDIS_BUFFER Buffer,
  1140. IN ULONG PhysicalMapRegister,
  1141. IN BOOLEAN WriteToDevice,
  1142. OUT PNDIS_PHYSICAL_ADDRESS_UNIT PhysicalAddressArray,
  1143. OUT PUINT ArraySize
  1144. );
  1145. EXPORT
  1146. VOID
  1147. NdisMCompleteBufferPhysicalMapping(
  1148. IN NDIS_HANDLE MiniportAdapterHandle,
  1149. IN PNDIS_BUFFER Buffer,
  1150. IN ULONG PhysicalMapRegister
  1151. );
  1152. EXPORT
  1153. ULONG
  1154. NdisMGetDmaAlignment(
  1155. IN NDIS_HANDLE MiniportAdapterHandle
  1156. );
  1157. //
  1158. // Shared memory
  1159. //
  1160. EXPORT
  1161. VOID
  1162. NdisMAllocateSharedMemory(
  1163. IN NDIS_HANDLE MiniportAdapterHandle,
  1164. IN ULONG Length,
  1165. IN BOOLEAN Cached,
  1166. OUT PVOID * VirtualAddress,
  1167. OUT PNDIS_PHYSICAL_ADDRESS PhysicalAddress
  1168. );
  1169. EXPORT
  1170. NDIS_STATUS
  1171. NdisMAllocateSharedMemoryAsync(
  1172. IN NDIS_HANDLE MiniportAdapterHandle,
  1173. IN ULONG Length,
  1174. IN BOOLEAN Cached,
  1175. IN PVOID Context
  1176. );
  1177. /*++
  1178. VOID
  1179. NdisMUpdateSharedMemory(
  1180. IN NDIS_HANDLE MiniportAdapterHandle,
  1181. IN ULONG Length,
  1182. IN PVOID VirtualAddress,
  1183. IN NDIS_PHYSICAL_ADDRESS PhysicalAddress
  1184. )
  1185. --*/
  1186. #define NdisMUpdateSharedMemory(_H, _L, _V, _P) NdisUpdateSharedMemory(_H, _L, _V, _P)
  1187. EXPORT
  1188. VOID
  1189. NdisMFreeSharedMemory(
  1190. IN NDIS_HANDLE MiniportAdapterHandle,
  1191. IN ULONG Length,
  1192. IN BOOLEAN Cached,
  1193. IN PVOID VirtualAddress,
  1194. IN NDIS_PHYSICAL_ADDRESS PhysicalAddress
  1195. );
  1196. //
  1197. // DMA operations.
  1198. //
  1199. EXPORT
  1200. NDIS_STATUS
  1201. NdisMRegisterDmaChannel(
  1202. OUT PNDIS_HANDLE MiniportDmaHandle,
  1203. IN NDIS_HANDLE MiniportAdapterHandle,
  1204. IN UINT DmaChannel,
  1205. IN BOOLEAN Dma32BitAddresses,
  1206. IN PNDIS_DMA_DESCRIPTION DmaDescription,
  1207. IN ULONG MaximumLength
  1208. );
  1209. EXPORT
  1210. VOID
  1211. NdisMDeregisterDmaChannel(
  1212. IN NDIS_HANDLE MiniportDmaHandle
  1213. );
  1214. /*++
  1215. VOID
  1216. NdisMSetupDmaTransfer(
  1217. OUT PNDIS_STATUS Status,
  1218. IN NDIS_HANDLE MiniportDmaHandle,
  1219. IN PNDIS_BUFFER Buffer,
  1220. IN ULONG Offset,
  1221. IN ULONG Length,
  1222. IN BOOLEAN WriteToDevice
  1223. )
  1224. --*/
  1225. #define NdisMSetupDmaTransfer(_S, _H, _B, _O, _L, _M_) \
  1226. NdisSetupDmaTransfer(_S, _H, _B, _O, _L, _M_)
  1227. /*++
  1228. VOID
  1229. NdisMCompleteDmaTransfer(
  1230. OUT PNDIS_STATUS Status,
  1231. IN NDIS_HANDLE MiniportDmaHandle,
  1232. IN PNDIS_BUFFER Buffer,
  1233. IN ULONG Offset,
  1234. IN ULONG Length,
  1235. IN BOOLEAN WriteToDevice
  1236. )
  1237. --*/
  1238. #define NdisMCompleteDmaTransfer(_S, _H, _B, _O, _L, _M_) \
  1239. NdisCompleteDmaTransfer(_S, _H, _B, _O, _L, _M_)
  1240. EXPORT
  1241. ULONG
  1242. NdisMReadDmaCounter(
  1243. IN NDIS_HANDLE MiniportDmaHandle
  1244. );
  1245. //
  1246. // Requests Used by Miniport Drivers
  1247. //
  1248. #define NdisMInitializeWrapper(_a,_b,_c,_d) NdisInitializeWrapper((_a),(_b),(_c),(_d))
  1249. EXPORT
  1250. NDIS_STATUS
  1251. NdisMRegisterMiniport(
  1252. IN NDIS_HANDLE NdisWrapperHandle,
  1253. IN PNDIS_MINIPORT_CHARACTERISTICS MiniportCharacteristics,
  1254. IN UINT CharacteristicsLength
  1255. );
  1256. // EXPORT
  1257. // NDIS_STATUS
  1258. // NdisIMInitializeDeviceInstance(
  1259. // IN NDIS_HANDLE DriverHandle,
  1260. // IN PNDIS_STRING DriverInstance
  1261. // );
  1262. #define NdisIMInitializeDeviceInstance(_H_, _I_) \
  1263. NdisIMInitializeDeviceInstanceEx(_H_, _I_, NULL)
  1264. EXPORT
  1265. NDIS_STATUS
  1266. NdisIMInitializeDeviceInstanceEx(
  1267. IN NDIS_HANDLE DriverHandle,
  1268. IN PNDIS_STRING DriverInstance,
  1269. IN NDIS_HANDLE DeviceContext OPTIONAL
  1270. );
  1271. EXPORT
  1272. NDIS_STATUS
  1273. NdisIMCancelInitializeDeviceInstance(
  1274. IN NDIS_HANDLE DriverHandle,
  1275. IN PNDIS_STRING DeviceInstance
  1276. );
  1277. EXPORT
  1278. NDIS_HANDLE
  1279. NdisIMGetDeviceContext(
  1280. IN NDIS_HANDLE MiniportAdapterHandle
  1281. );
  1282. EXPORT
  1283. NDIS_HANDLE
  1284. NdisIMGetBindingContext(
  1285. IN NDIS_HANDLE NdisBindingHandle
  1286. );
  1287. EXPORT
  1288. NDIS_STATUS
  1289. NdisIMDeInitializeDeviceInstance(
  1290. IN NDIS_HANDLE NdisMiniportHandle
  1291. );
  1292. EXPORT
  1293. VOID
  1294. NdisIMCopySendPerPacketInfo(
  1295. OUT PNDIS_PACKET DstPacket,
  1296. IN PNDIS_PACKET SrcPacket
  1297. );
  1298. EXPORT
  1299. VOID
  1300. NdisIMCopySendCompletePerPacketInfo(
  1301. OUT PNDIS_PACKET DstPacket,
  1302. IN PNDIS_PACKET SrcPacket
  1303. );
  1304. // EXPORT
  1305. // VOID
  1306. // NdisMSetAttributes(
  1307. // IN NDIS_HANDLE MiniportAdapterHandle,
  1308. // IN NDIS_HANDLE MiniportAdapterContext,
  1309. // IN BOOLEAN BusMaster,
  1310. // IN NDIS_INTERFACE_TYPE AdapterType
  1311. // );
  1312. #define NdisMSetAttributes(_H_, _C_, _M_, _T_) \
  1313. NdisMSetAttributesEx(_H_, \
  1314. _C_, \
  1315. 0, \
  1316. (_M_) ? NDIS_ATTRIBUTE_BUS_MASTER : 0, \
  1317. _T_) \
  1318. EXPORT
  1319. VOID
  1320. NdisMSetAttributesEx(
  1321. IN NDIS_HANDLE MiniportAdapterHandle,
  1322. IN NDIS_HANDLE MiniportAdapterContext,
  1323. IN UINT CheckForHangTimeInSeconds OPTIONAL,
  1324. IN ULONG AttributeFlags,
  1325. IN NDIS_INTERFACE_TYPE AdapterType OPTIONAL
  1326. );
  1327. #define NDIS_ATTRIBUTE_IGNORE_PACKET_TIMEOUT 0x00000001
  1328. #define NDIS_ATTRIBUTE_IGNORE_REQUEST_TIMEOUT 0x00000002
  1329. #define NDIS_ATTRIBUTE_IGNORE_TOKEN_RING_ERRORS 0x00000004
  1330. #define NDIS_ATTRIBUTE_BUS_MASTER 0x00000008
  1331. #define NDIS_ATTRIBUTE_INTERMEDIATE_DRIVER 0x00000010
  1332. #define NDIS_ATTRIBUTE_DESERIALIZE 0x00000020
  1333. #define NDIS_ATTRIBUTE_NO_HALT_ON_SUSPEND 0x00000040
  1334. #define NDIS_ATTRIBUTE_SURPRISE_REMOVE_OK 0x00000080
  1335. #define NDIS_ATTRIBUTE_NOT_CO_NDIS 0x00000100
  1336. #define NDIS_ATTRIBUTE_USES_SAFE_BUFFER_APIS 0x00000200
  1337. EXPORT
  1338. NDIS_STATUS
  1339. NdisMSetMiniportSecondary(
  1340. IN NDIS_HANDLE MiniportHandle,
  1341. IN NDIS_HANDLE PrimaryMiniportHandle
  1342. );
  1343. EXPORT
  1344. NDIS_STATUS
  1345. NdisMPromoteMiniport(
  1346. IN NDIS_HANDLE MiniportHandle
  1347. );
  1348. EXPORT
  1349. NDIS_STATUS
  1350. NdisMRemoveMiniport(
  1351. IN NDIS_HANDLE MiniportHandle
  1352. );
  1353. #define NdisMSendComplete(_M, _P, _S) (*((PNDIS_MINIPORT_BLOCK)(_M))->SendCompleteHandler)(_M, _P, _S)
  1354. #define NdisMSendResourcesAvailable(_M) (*((PNDIS_MINIPORT_BLOCK)(_M))->SendResourcesHandler)(_M)
  1355. #define NdisMResetComplete(_M, _S, _A) (*((PNDIS_MINIPORT_BLOCK)(_M))->ResetCompleteHandler)(_M, _S, _A)
  1356. #define NdisMTransferDataComplete(_M, _P, _S, _B) \
  1357. (*((PNDIS_MINIPORT_BLOCK)(_M))->TDCompleteHandler)(_M, _P, _S, _B)
  1358. /*++
  1359. VOID
  1360. NdisMWanSendComplete(
  1361. IN NDIS_HANDLE MiniportAdapterHandle,
  1362. IN PVOID Packet,
  1363. IN NDIS_STATUS Status
  1364. );
  1365. --*/
  1366. #define NdisMWanSendComplete(_M_, _P_, _S_) \
  1367. (*((PNDIS_MINIPORT_BLOCK)(_M_))->WanSendCompleteHandler)(_M_, _P_, _S_)
  1368. #define NdisMQueryInformationComplete(_M, _S) \
  1369. (*((PNDIS_MINIPORT_BLOCK)(_M))->QueryCompleteHandler)(_M, _S)
  1370. #define NdisMSetInformationComplete(_M, _S) \
  1371. (*((PNDIS_MINIPORT_BLOCK)(_M))->SetCompleteHandler)(_M, _S)
  1372. /*++
  1373. VOID
  1374. NdisMIndicateReceivePacket(
  1375. IN NDIS_HANDLE MiniportAdapterHandle,
  1376. IN PPNDIS_PACKET ReceivedPackets,
  1377. IN UINT NumberOfPackets
  1378. );
  1379. --*/
  1380. #define NdisMIndicateReceivePacket(_H, _P, _N) \
  1381. { \
  1382. (*((PNDIS_MINIPORT_BLOCK)(_H))->PacketIndicateHandler)( \
  1383. _H, \
  1384. _P, \
  1385. _N); \
  1386. }
  1387. /*++
  1388. VOID
  1389. NdisMWanIndicateReceive(
  1390. OUT PNDIS_STATUS Status,
  1391. IN NDIS_HANDLE MiniportAdapterHandle,
  1392. IN NDIS_HANDLE NdisLinkContext,
  1393. IN PUCHAR Packet,
  1394. IN ULONG PacketSize
  1395. );
  1396. --*/
  1397. #define NdisMWanIndicateReceive(_S_, _M_, _C_, _P_, _Z_) \
  1398. (*((PNDIS_MINIPORT_BLOCK)(_M_))->WanRcvHandler)(_S_, _M_, _C_, _P_, _Z_)
  1399. /*++
  1400. VOID
  1401. NdisMWanIndicateReceiveComplete(
  1402. IN NDIS_HANDLE MiniportAdapterHandle,
  1403. IN NDIS_HANDLE NdisLinkContext
  1404. );
  1405. --*/
  1406. #define NdisMWanIndicateReceiveComplete(_M_, _C_) \
  1407. (*((PNDIS_MINIPORT_BLOCK)(_M_))->WanRcvCompleteHandler)(_M_, _C_)
  1408. /*++
  1409. VOID
  1410. NdisMEthIndicateReceive(
  1411. IN NDIS_HANDLE MiniportAdapterHandle,
  1412. IN NDIS_HANDLE MiniportReceiveContext,
  1413. IN PVOID HeaderBuffer,
  1414. IN UINT HeaderBufferSize,
  1415. IN PVOID LookaheadBuffer,
  1416. IN UINT LookaheadBufferSize,
  1417. IN UINT PacketSize
  1418. )
  1419. --*/
  1420. #define NdisMEthIndicateReceive( _H, _C, _B, _SZ, _L, _LSZ, _PSZ) \
  1421. { \
  1422. (*((PNDIS_MINIPORT_BLOCK)(_H))->EthRxIndicateHandler)( \
  1423. ((PNDIS_MINIPORT_BLOCK)(_H))->EthDB, \
  1424. _C, \
  1425. _B, \
  1426. _B, \
  1427. _SZ, \
  1428. _L, \
  1429. _LSZ, \
  1430. _PSZ \
  1431. ); \
  1432. }
  1433. /*++
  1434. VOID
  1435. NdisMTrIndicateReceive(
  1436. IN NDIS_HANDLE MiniportAdapterHandle,
  1437. IN NDIS_HANDLE MiniportReceiveContext,
  1438. IN PVOID HeaderBuffer,
  1439. IN UINT HeaderBufferSize,
  1440. IN PVOID LookaheadBuffer,
  1441. IN UINT LookaheadBufferSize,
  1442. IN UINT PacketSize
  1443. )
  1444. --*/
  1445. #define NdisMTrIndicateReceive( _H, _C, _B, _SZ, _L, _LSZ, _PSZ) \
  1446. { \
  1447. (*((PNDIS_MINIPORT_BLOCK)(_H))->TrRxIndicateHandler)( \
  1448. ((PNDIS_MINIPORT_BLOCK)(_H))->TrDB, \
  1449. _C, \
  1450. _B, \
  1451. _SZ, \
  1452. _L, \
  1453. _LSZ, \
  1454. _PSZ \
  1455. ); \
  1456. }
  1457. /*++
  1458. VOID
  1459. NdisMFddiIndicateReceive(
  1460. IN NDIS_HANDLE MiniportAdapterHandle,
  1461. IN NDIS_HANDLE MiniportReceiveContext,
  1462. IN PVOID HeaderBuffer,
  1463. IN UINT HeaderBufferSize,
  1464. IN PVOID LookaheadBuffer,
  1465. IN UINT LookaheadBufferSize,
  1466. IN UINT PacketSize
  1467. )
  1468. --*/
  1469. #define NdisMFddiIndicateReceive( _H, _C, _B, _SZ, _L, _LSZ, _PSZ) \
  1470. { \
  1471. (*((PNDIS_MINIPORT_BLOCK)(_H))->FddiRxIndicateHandler)( \
  1472. ((PNDIS_MINIPORT_BLOCK)(_H))->FddiDB, \
  1473. _C, \
  1474. (PUCHAR)_B + 1, \
  1475. ((((PUCHAR)_B)[0] & 0x40) ? FDDI_LENGTH_OF_LONG_ADDRESS \
  1476. : FDDI_LENGTH_OF_SHORT_ADDRESS), \
  1477. _B, \
  1478. _SZ, \
  1479. _L, \
  1480. _LSZ, \
  1481. _PSZ \
  1482. ); \
  1483. }
  1484. /*++
  1485. VOID
  1486. NdisMArcIndicateReceive(
  1487. IN NDIS_HANDLE MiniportHandle,
  1488. IN PUCHAR pRawHeader, // Pointer to Arcnet frame header
  1489. IN PUCHAR pData, // Pointer to data portion of Arcnet frame
  1490. IN UINT Length // Data Length
  1491. )
  1492. --*/
  1493. #define NdisMArcIndicateReceive( _H, _HD, _D, _SZ) \
  1494. { \
  1495. ArcFilterDprIndicateReceive(((PNDIS_MINIPORT_BLOCK)(_H))->ArcDB, \
  1496. _HD, \
  1497. _D, \
  1498. _SZ \
  1499. ); \
  1500. }
  1501. /*++
  1502. VOID
  1503. NdisMEthIndicateReceiveComplete(
  1504. IN NDIS_HANDLE MiniportHandle
  1505. );
  1506. --*/
  1507. #define NdisMEthIndicateReceiveComplete( _H ) \
  1508. { \
  1509. (*((PNDIS_MINIPORT_BLOCK)(_H))->EthRxCompleteHandler)( \
  1510. ((PNDIS_MINIPORT_BLOCK)_H)->EthDB); \
  1511. }
  1512. /*++
  1513. VOID
  1514. NdisMTrIndicateReceiveComplete(
  1515. IN NDIS_HANDLE MiniportHandle
  1516. );
  1517. --*/
  1518. #define NdisMTrIndicateReceiveComplete( _H ) \
  1519. { \
  1520. (*((PNDIS_MINIPORT_BLOCK)(_H))->TrRxCompleteHandler)( \
  1521. ((PNDIS_MINIPORT_BLOCK)_H)->TrDB); \
  1522. }
  1523. /*++
  1524. VOID
  1525. NdisMFddiIndicateReceiveComplete(
  1526. IN NDIS_HANDLE MiniportHandle
  1527. );
  1528. --*/
  1529. #define NdisMFddiIndicateReceiveComplete( _H ) \
  1530. { \
  1531. (*((PNDIS_MINIPORT_BLOCK)(_H))->FddiRxCompleteHandler)( \
  1532. ((PNDIS_MINIPORT_BLOCK)_H)->FddiDB); \
  1533. }
  1534. /*++
  1535. VOID
  1536. NdisMArcIndicateReceiveComplete(
  1537. IN NDIS_HANDLE MiniportHandle
  1538. );
  1539. --*/
  1540. #define NdisMArcIndicateReceiveComplete( _H ) \
  1541. { \
  1542. if (((PNDIS_MINIPORT_BLOCK)_H)->EthDB) \
  1543. { \
  1544. NdisMEthIndicateReceiveComplete(_H); \
  1545. } \
  1546. \
  1547. ArcFilterDprIndicateReceiveComplete(((PNDIS_MINIPORT_BLOCK)_H)->ArcDB); \
  1548. }
  1549. /*++
  1550. EXPORT
  1551. VOID
  1552. NdisMIndicateStatus(
  1553. IN NDIS_HANDLE MiniportHandle,
  1554. IN NDIS_STATUS GeneralStatus,
  1555. IN PVOID StatusBuffer,
  1556. IN UINT StatusBufferSize
  1557. );
  1558. --*/
  1559. #define NdisMIndicateStatus(_M, _G, _SB, _BS) (*((PNDIS_MINIPORT_BLOCK)(_M))->StatusHandler)(_M, _G, _SB, _BS)
  1560. /*++
  1561. EXPORT
  1562. VOID
  1563. NdisMIndicateStatusComplete(
  1564. IN NDIS_HANDLE MiniportHandle
  1565. );
  1566. --*/
  1567. #define NdisMIndicateStatusComplete(_M) (*((PNDIS_MINIPORT_BLOCK)(_M))->StatusCompleteHandler)(_M)
  1568. EXPORT
  1569. VOID
  1570. NdisMRegisterAdapterShutdownHandler(
  1571. IN NDIS_HANDLE MiniportHandle,
  1572. IN PVOID ShutdownContext,
  1573. IN ADAPTER_SHUTDOWN_HANDLER ShutdownHandler
  1574. );
  1575. EXPORT
  1576. VOID
  1577. NdisMDeregisterAdapterShutdownHandler(
  1578. IN NDIS_HANDLE MiniportHandle
  1579. );
  1580. EXPORT
  1581. NDIS_STATUS
  1582. NdisMPciAssignResources(
  1583. IN NDIS_HANDLE MiniportHandle,
  1584. IN ULONG SlotNumber,
  1585. IN PNDIS_RESOURCE_LIST * AssignedResources
  1586. );
  1587. #ifdef NDIS51_MINIPORT
  1588. EXPORT
  1589. NDIS_STATUS
  1590. NdisIMNotifyPnPEvent(
  1591. IN NDIS_HANDLE MiniportHandle,
  1592. IN PNET_PNP_EVENT NetPnPEvent
  1593. );
  1594. #endif
  1595. //
  1596. // Logging support for miniports
  1597. //
  1598. EXPORT
  1599. NDIS_STATUS
  1600. NdisMCreateLog(
  1601. IN NDIS_HANDLE MiniportAdapterHandle,
  1602. IN UINT Size,
  1603. OUT PNDIS_HANDLE LogHandle
  1604. );
  1605. EXPORT
  1606. VOID
  1607. NdisMCloseLog(
  1608. IN NDIS_HANDLE LogHandle
  1609. );
  1610. EXPORT
  1611. NDIS_STATUS
  1612. NdisMWriteLogData(
  1613. IN NDIS_HANDLE LogHandle,
  1614. IN PVOID LogBuffer,
  1615. IN UINT LogBufferSize
  1616. );
  1617. EXPORT
  1618. VOID
  1619. NdisMFlushLog(
  1620. IN NDIS_HANDLE LogHandle
  1621. );
  1622. EXPORT
  1623. VOID
  1624. NdisMGetDeviceProperty(
  1625. IN NDIS_HANDLE MiniportAdapterHandle,
  1626. IN OUT PDEVICE_OBJECT * PhysicalDeviceObject OPTIONAL,
  1627. IN OUT PDEVICE_OBJECT * FunctionalDeviceObject OPTIONAL,
  1628. IN OUT PDEVICE_OBJECT * NextDeviceObject OPTIONAL,
  1629. IN OUT PCM_RESOURCE_LIST * AllocatedResources OPTIONAL,
  1630. IN OUT PCM_RESOURCE_LIST * AllocatedResourcesTranslated OPTIONAL
  1631. );
  1632. //
  1633. // Get a pointer to the adapter's localized instance name.
  1634. //
  1635. EXPORT
  1636. NDIS_STATUS
  1637. NdisMQueryAdapterInstanceName(
  1638. OUT PNDIS_STRING pAdapterInstanceName,
  1639. IN NDIS_HANDLE MiniportHandle
  1640. );
  1641. //
  1642. // NDIS 5.0 extensions for miniports
  1643. //
  1644. EXPORT
  1645. VOID
  1646. NdisMCoIndicateReceivePacket(
  1647. IN NDIS_HANDLE NdisVcHandle,
  1648. IN PPNDIS_PACKET PacketArray,
  1649. IN UINT NumberOfPackets
  1650. );
  1651. EXPORT
  1652. VOID
  1653. NdisMCoIndicateStatus(
  1654. IN NDIS_HANDLE MiniportAdapterHandle,
  1655. IN NDIS_HANDLE NdisVcHandle OPTIONAL,
  1656. IN NDIS_STATUS GeneralStatus,
  1657. IN PVOID StatusBuffer OPTIONAL,
  1658. IN ULONG StatusBufferSize
  1659. );
  1660. EXPORT
  1661. VOID
  1662. NdisMCoReceiveComplete(
  1663. IN NDIS_HANDLE MiniportAdapterHandle
  1664. );
  1665. EXPORT
  1666. VOID
  1667. NdisMCoSendComplete(
  1668. IN NDIS_STATUS Status,
  1669. IN NDIS_HANDLE NdisVcHandle,
  1670. IN PNDIS_PACKET Packet
  1671. );
  1672. EXPORT
  1673. VOID
  1674. NdisMCoActivateVcComplete(
  1675. IN NDIS_STATUS Status,
  1676. IN NDIS_HANDLE NdisVcHandle,
  1677. IN PCO_CALL_PARAMETERS CallParameters
  1678. );
  1679. EXPORT
  1680. VOID
  1681. NdisMCoDeactivateVcComplete(
  1682. IN NDIS_STATUS Status,
  1683. IN NDIS_HANDLE NdisVcHandle
  1684. );
  1685. EXPORT
  1686. VOID
  1687. NdisMCoRequestComplete(
  1688. IN NDIS_STATUS Status,
  1689. IN NDIS_HANDLE MiniportAdapterHandle,
  1690. IN PNDIS_REQUEST Request
  1691. );
  1692. EXPORT
  1693. NDIS_STATUS
  1694. NdisMCmRegisterAddressFamily(
  1695. IN NDIS_HANDLE MiniportAdapterHandle,
  1696. IN PCO_ADDRESS_FAMILY AddressFamily,
  1697. IN PNDIS_CALL_MANAGER_CHARACTERISTICS CmCharacteristics,
  1698. IN UINT SizeOfCmCharacteristics
  1699. );
  1700. EXPORT
  1701. NDIS_STATUS
  1702. NdisMCmCreateVc(
  1703. IN NDIS_HANDLE MiniportAdapterHandle,
  1704. IN NDIS_HANDLE NdisAfHandle,
  1705. IN NDIS_HANDLE MiniportVcContext,
  1706. OUT PNDIS_HANDLE NdisVcHandle
  1707. );
  1708. EXPORT
  1709. NDIS_STATUS
  1710. NdisMCmDeleteVc(
  1711. IN NDIS_HANDLE NdisVcHandle
  1712. );
  1713. EXPORT
  1714. NDIS_STATUS
  1715. NdisMCmActivateVc(
  1716. IN NDIS_HANDLE NdisVcHandle,
  1717. IN PCO_CALL_PARAMETERS CallParameters
  1718. );
  1719. EXPORT
  1720. NDIS_STATUS
  1721. NdisMCmDeactivateVc(
  1722. IN NDIS_HANDLE NdisVcHandle
  1723. );
  1724. EXPORT
  1725. NDIS_STATUS
  1726. NdisMCmRequest(
  1727. IN NDIS_HANDLE NdisAfHandle,
  1728. IN NDIS_HANDLE NdisVcHandle OPTIONAL,
  1729. IN NDIS_HANDLE NdisPartyHandle OPTIONAL,
  1730. IN OUT PNDIS_REQUEST NdisRequest
  1731. );
  1732. // EXPORT
  1733. // VOID
  1734. // NdisMCmRequestComplete(
  1735. // IN NDIS_STATUS Status,
  1736. // IN NDIS_HANDLE NdisAfHandle,
  1737. // IN NDIS_HANDLE NdisVcHandle OPTIONAL,
  1738. // IN NDIS_HANDLE NdisPartyHandle OPTIONAL,
  1739. // IN PNDIS_REQUEST NdisRequest
  1740. // );
  1741. #define NdisMCmRequestComplete(_S_, _AH_, _VH_, _PH_, _R_) \
  1742. NdisCoRequestComplete(_S_, _AH_, _VH_, _PH_, _R_)
  1743. // EXPORT
  1744. // VOID
  1745. // NdisMCmOpenAddressFamilyComplete(
  1746. // IN NDIS_STATUS Status,
  1747. // IN NDIS_HANDLE NdisAfHandle,
  1748. // IN NDIS_HANDLE CallMgrAfContext
  1749. // );
  1750. #define NdisMCmOpenAddressFamilyComplete(_S_, _H_, _C_) \
  1751. NdisCmOpenAddressFamilyComplete(_S_, _H_, _C_)
  1752. // EXPORT
  1753. // VOID
  1754. // NdisMCmCloseAddressFamilyComplete(
  1755. // IN NDIS_STATUS Status,
  1756. // IN NDIS_HANDLE NdisAfHandle
  1757. // );
  1758. #define NdisMCmCloseAddressFamilyComplete(_S_, _H_) \
  1759. NdisCmCloseAddressFamilyComplete(_S_, _H_)
  1760. // EXPORT
  1761. // VOID
  1762. // NdisMCmRegisterSapComplete(
  1763. // IN NDIS_STATUS Status,
  1764. // IN NDIS_HANDLE NdisSapHandle,
  1765. // IN NDIS_HANDLE CallMgrSapContext
  1766. // );
  1767. #define NdisMCmRegisterSapComplete(_S_, _H_, _C_) \
  1768. NdisCmRegisterSapComplete(_S_, _H_, _C_)
  1769. // EXPORT
  1770. // VOID
  1771. // NdisMCmDeregisterSapComplete(
  1772. // IN NDIS_STATUS Status,
  1773. // IN NDIS_HANDLE NdisSapHandle
  1774. // );
  1775. #define NdisMCmDeregisterSapComplete(_S_, _H_) \
  1776. NdisCmDeregisterSapComplete(_S_, _H_)
  1777. // EXPORT
  1778. // VOID
  1779. // NdisMCmMakeCallComplete(
  1780. // IN NDIS_STATUS Status,
  1781. // IN NDIS_HANDLE NdisVcHandle,
  1782. // IN NDIS_HANDLE NdisPartyHandle OPTIONAL,
  1783. // IN NDIS_HANDLE CallMgrPartyContext OPTIONAL,
  1784. // IN PCO_CALL_PARAMETERS CallParameters
  1785. // );
  1786. #define NdisMCmMakeCallComplete(_S_, _VH_, _PH_, _CC_, _CP_) \
  1787. NdisCmMakeCallComplete(_S_, _VH_, _PH_, _CC_, _CP_)
  1788. // EXPORT
  1789. // VOID
  1790. // NdisMCmCloseCallComplete(
  1791. // IN NDIS_STATUS Status,
  1792. // IN NDIS_HANDLE NdisVcHandle,
  1793. // IN NDIS_HANDLE NdisPartyHandle OPTIONAL
  1794. // );
  1795. #define NdisMCmCloseCallComplete(_S_, _VH_, _PH_) \
  1796. NdisCmCloseCallComplete(_S_, _VH_, _PH_)
  1797. // EXPORT
  1798. // VOID
  1799. // NdisMCmAddPartyComplete(
  1800. // IN NDIS_STATUS Status,
  1801. // IN NDIS_HANDLE NdisPartyHandle,
  1802. // IN NDIS_HANDLE CallMgrPartyContext OPTIONAL,
  1803. // IN PCO_CALL_PARAMETERS CallParameters
  1804. // );
  1805. #define NdisMCmAddPartyComplete(_S_, _H_, _C_, _P_) \
  1806. NdisCmAddPartyComplete(_S_, _H_, _C_, _P_)
  1807. // EXPORT
  1808. // VOID
  1809. // NdisMCmDropPartyComplete(
  1810. // IN NDIS_STATUS Status,
  1811. // IN NDIS_HANDLE NdisPartyHandle
  1812. // );
  1813. #define NdisMCmDropPartyComplete(_S_, _H_) \
  1814. NdisCmDropPartyComplete(_S_, _H_)
  1815. // EXPORT
  1816. // NDIS_STATUS
  1817. // NdisMCmDispatchIncomingCall(
  1818. // IN NDIS_HANDLE NdisSapHandle,
  1819. // IN NDIS_HANDLE NdisVcHandle,
  1820. // IN PCO_CALL_PARAMETERS CallParameters
  1821. // );
  1822. #define NdisMCmDispatchIncomingCall(_SH_, _VH_, _CP_) \
  1823. NdisCmDispatchIncomingCall(_SH_, _VH_, _CP_)
  1824. // EXPORT
  1825. // VOID
  1826. // NdisMCmDispatchCallConnected(
  1827. // IN NDIS_HANDLE NdisVcHandle
  1828. // );
  1829. #define NdisMCmDispatchCallConnected(_H_) \
  1830. NdisCmDispatchCallConnected(_H_)
  1831. // EXPORT
  1832. // NdisMCmModifyCallQoSComplete(
  1833. // IN NDIS_STATUS Status,
  1834. // IN NDIS_HANDLE NdisVcHandle,
  1835. // IN PCO_CALL_PARAMETERS CallParameters
  1836. // );
  1837. #define NdisMCmModifyCallQoSComplete(_S_, _H_, _P_) \
  1838. NdisCmModifyCallQoSComplete(_S_, _H_, _P_)
  1839. // EXPORT
  1840. // VOID
  1841. // VOID
  1842. // NdisMCmDispatchIncomingCallQoSChange(
  1843. // IN NDIS_HANDLE NdisVcHandle,
  1844. // IN PCO_CALL_PARAMETERS CallParameters
  1845. // );
  1846. #define NdisMCmDispatchIncomingCallQoSChange(_H_, _P_) \
  1847. NdisCmDispatchIncomingCallQoSChange(_H_, _P_)
  1848. // EXPORT
  1849. // VOID
  1850. // NdisMCmDispatchIncomingCloseCall(
  1851. // IN NDIS_STATUS CloseStatus,
  1852. // IN NDIS_HANDLE NdisVcHandle,
  1853. // IN PVOID Buffer OPTIONAL,
  1854. // IN UINT Size
  1855. // );
  1856. #define NdisMCmDispatchIncomingCloseCall(_S_, _H_, _B_, _Z_) \
  1857. NdisCmDispatchIncomingCloseCall(_S_, _H_, _B_, _Z_)
  1858. // EXPORT
  1859. // VOID
  1860. // NdisMCmDispatchIncomingDropParty(
  1861. // IN NDIS_STATUS DropStatus,
  1862. // IN NDIS_HANDLE NdisPartyHandle,
  1863. // IN PVOID Buffer OPTIONAL,
  1864. // IN UINT Size
  1865. // );
  1866. #define NdisMCmDispatchIncomingDropParty(_S_, _H_, _B_, _Z_) \
  1867. NdisCmDispatchIncomingDropParty(_S_, _H_, _B_, _Z_)