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.

996 lines
20 KiB

  1. /*++
  2. Copyright (c) Microsoft Corporation. All rights reserved.
  3. Module Name:
  4. 61883.h
  5. Abstract:
  6. The public header for clients of the 61883 Class.
  7. Author:
  8. WGJ
  9. PSB
  10. --*/
  11. //
  12. // Class GUID
  13. //
  14. // {7EBEFBC0-3200-11d2-B4C2-00A0C9697D07}
  15. DEFINE_GUID(GUID_61883_CLASS, 0x7ebefbc0, 0x3200, 0x11d2, 0xb4, 0xc2, 0x0, 0xa0, 0xc9, 0x69, 0x7d, 0x7);
  16. //
  17. // IOCTL Definitions
  18. //
  19. #define IOCTL_61883_CLASS CTL_CODE( \
  20. FILE_DEVICE_UNKNOWN, \
  21. 0x91, \
  22. METHOD_IN_DIRECT, \
  23. FILE_ANY_ACCESS \
  24. )
  25. //
  26. // Current 61883 DDI Version
  27. //
  28. #define CURRENT_61883_DDI_VERSION 0x2
  29. //
  30. // INIT_61883_HEADER Macro
  31. //
  32. #define INIT_61883_HEADER( Av61883, Request ) \
  33. (Av61883)->Function = Request; \
  34. (Av61883)->Version = CURRENT_61883_DDI_VERSION;
  35. //
  36. // 61883 I/O Request Functions
  37. //
  38. enum {
  39. Av61883_GetUnitInfo,
  40. Av61883_SetUnitInfo,
  41. Av61883_SetPlug,
  42. Av61883_GetPlugHandle,
  43. Av61883_GetPlugState,
  44. Av61883_Connect,
  45. Av61883_Disconnect,
  46. Av61883_AttachFrame,
  47. Av61883_CancelFrame,
  48. Av61883_Talk,
  49. Av61883_Listen,
  50. Av61883_Stop,
  51. Av61883_SendFcpRequest,
  52. Av61883_GetFcpResponse,
  53. Av61883_GetFcpRequest,
  54. Av61883_SendFcpResponse,
  55. Av61883_SetFcpNotify,
  56. Av61883_CreatePlug,
  57. Av61883_DeletePlug,
  58. Av61883_BusResetNotify,
  59. Av61883_BusReset,
  60. Av61883_SetUnitDirectory,
  61. Av61883_MonitorPlugs,
  62. Av61883_MAX
  63. };
  64. //
  65. // Plug States
  66. //
  67. #define CMP_PLUG_STATE_IDLE 0
  68. #define CMP_PLUG_STATE_READY 1
  69. #define CMP_PLUG_STATE_SUSPENDED 2
  70. #define CMP_PLUG_STATE_ACTIVE 3
  71. //
  72. // Connect Speeds (not the same as 1394 speed flags!!)
  73. //
  74. #define CMP_SPEED_S100 0x00
  75. #define CMP_SPEED_S200 0x01
  76. #define CMP_SPEED_S400 0x02
  77. //
  78. // CIP Frame Flags
  79. //
  80. #define CIP_VALIDATE_FIRST_SOURCE 0x00000001
  81. #define CIP_VALIDATE_ALL_SOURCE 0x00000002
  82. #define CIP_STRIP_SOURCE_HEADER 0x00000004
  83. #define CIP_USE_SOURCE_HEADER_TIMESTAMP 0x00000008
  84. #define CIP_DV_STYLE_SYT 0x00000010
  85. #define CIP_AUDIO_STYLE_SYT 0x00000020
  86. #define CIP_RESET_FRAME_ON_DISCONTINUITY 0x00000040
  87. //
  88. // CIP Status Codes
  89. //
  90. #define CIP_STATUS_SUCCESS 0x00000000
  91. #define CIP_STATUS_CORRUPT_FRAME 0x00000001
  92. #define CIP_STATUS_FIRST_FRAME 0x00000002
  93. //
  94. // CIP Talk Flags
  95. //
  96. #define CIP_TALK_USE_SPH_TIMESTAMP 0x00000001
  97. #define CIP_TALK_DOUBLE_BUFFER 0x00000002
  98. //
  99. // Plug Location
  100. //
  101. typedef enum {
  102. CMP_PlugLocal = 0,
  103. CMP_PlugRemote
  104. } CMP_PLUG_LOCATION;
  105. //
  106. // Plug Type
  107. //
  108. typedef enum {
  109. CMP_PlugOut = 0, // oPCR
  110. CMP_PlugIn // iPCR
  111. } CMP_PLUG_TYPE;
  112. //
  113. // Connect Type
  114. //
  115. typedef enum {
  116. CMP_Broadcast = 0,
  117. CMP_PointToPoint
  118. } CMP_CONNECT_TYPE;
  119. typedef struct _OPCR {
  120. ULONG Payload:10;
  121. ULONG OverheadID:4;
  122. ULONG DataRate:2;
  123. ULONG Channel:6;
  124. ULONG Reserved:2;
  125. ULONG PPCCounter:6;
  126. ULONG BCCCounter:1;
  127. ULONG OnLine:1;
  128. } OPCR, *POPCR;
  129. typedef struct _IPCR {
  130. ULONG Reserved0:16;
  131. ULONG Channel:6;
  132. ULONG Reserved1:2;
  133. ULONG PPCCounter:6;
  134. ULONG BCCCounter:1;
  135. ULONG OnLine:1;
  136. } IPCR, *PIPCR;
  137. typedef struct _AV_PCR {
  138. union {
  139. OPCR oPCR;
  140. IPCR iPCR;
  141. ULONG ulongData;
  142. };
  143. } AV_PCR, *PAV_PCR;
  144. //
  145. // Client Request Structures
  146. //
  147. //
  148. // Local or Device Unit Info
  149. //
  150. #define RETRIEVE_DEVICE_UNIT_INFO 0x00000000 // Retrieve Info from Device
  151. #define RETRIEVE_LOCAL_UNIT_INFO 0x00000001 // Retrieve Info from Local Node
  152. //
  153. // DiagLevel's used for controlling various behavior
  154. //
  155. #define DIAGLEVEL_NONE 0x00000000 // Nothing.
  156. #define DIAGLEVEL_IGNORE_OPLUG 0x00000001 // Will not program the oPCR
  157. #define DIAGLEVEL_IGNORE_IPLUG 0x00000002 // Will not program the iPCR
  158. #define DIAGLEVEL_SET_CHANNEL_63 0x00000004 // Resets channel to 63 when oPCR/iPCR is disconnected
  159. #define DIAGLEVEL_IPCR_IGNORE_FREE 0x00000008 // Will not free isoch resources when iPCR is disconnected
  160. // and local oPCR is not specified
  161. #define DIAGLEVEL_HIDE_OPLUG 0x00000010 // Hides the oMPR & oPCR in an exclusive address range
  162. #define DIAGLEVEL_IPCR_ALWAYS_ALLOC 0x00000020 // Will always allocate when connecting to iPCR with no
  163. // oPCR specified, regardless if iPCR has existing connection
  164. #define DIAGLEVEL_SPECIFY_BLOCKSIZE 0x00000040 // This flag is specified when we detect an invalid max_rec or
  165. // want to specify the block size. If this flag is set, all async
  166. // transactions will be transmitted upto 512 byte blocks (S100)
  167. //
  168. // GetUnitInfo nLevel's
  169. //
  170. #define GET_UNIT_INFO_IDS 0x00000001 // Retrieves IDs of Unit
  171. #define GET_UNIT_INFO_CAPABILITIES 0x00000002 // Retrieves Capabilities of Unit
  172. #define GET_UNIT_INFO_ISOCH_PARAMS 0x00000003 // Retrieves parameters for isoch
  173. #define GET_UNIT_BUS_GENERATION_NODE 0x00000004 // Retrieves current generation/node
  174. #define GET_UNIT_DDI_VERSION 0x00000005 // Retrieves 61883 DDI Version
  175. #define GET_UNIT_DIAG_LEVEL 0x00000006 // Retrieves the currently set DiagLevel flags
  176. //
  177. // Hardware Flags
  178. //
  179. #define AV_HOST_DMA_DOUBLE_BUFFERING_ENABLED 0x00000001
  180. typedef struct _GET_UNIT_IDS {
  181. //
  182. // UniqueID
  183. //
  184. OUT LARGE_INTEGER UniqueID;
  185. //
  186. // VendorID
  187. //
  188. OUT ULONG VendorID;
  189. //
  190. // ModelID
  191. //
  192. OUT ULONG ModelID;
  193. //
  194. // VendorText Length
  195. //
  196. OUT ULONG ulVendorLength;
  197. //
  198. // VendorText String
  199. //
  200. OUT PWSTR VendorText;
  201. //
  202. // ModelText Length
  203. //
  204. OUT ULONG ulModelLength;
  205. //
  206. // ModelText String
  207. //
  208. OUT PWSTR ModelText;
  209. //
  210. // UnitModelID
  211. //
  212. OUT ULONG UnitModelID;
  213. //
  214. // UnitModelText Length
  215. //
  216. OUT ULONG ulUnitModelLength;
  217. //
  218. // UnitModelText String
  219. //
  220. OUT PWSTR UnitModelText;
  221. } GET_UNIT_IDS, *PGET_UNIT_IDS;
  222. typedef struct _GET_UNIT_CAPABILITIES {
  223. //
  224. // Number of Output Plugs supported by device
  225. //
  226. OUT ULONG NumOutputPlugs;
  227. //
  228. // Number of Input Plugs supported by device
  229. //
  230. OUT ULONG NumInputPlugs;
  231. //
  232. // MaxDataRate
  233. //
  234. OUT ULONG MaxDataRate;
  235. //
  236. // CTS Flags
  237. //
  238. OUT ULONG CTSFlags;
  239. //
  240. // Hardware Flags
  241. //
  242. OUT ULONG HardwareFlags;
  243. } GET_UNIT_CAPABILITIES, *PGET_UNIT_CAPABILITIES;
  244. //
  245. // UnitIsochParams
  246. //
  247. typedef struct _UNIT_ISOCH_PARAMS {
  248. IN OUT ULONG RX_NumPackets;
  249. IN OUT ULONG RX_NumDescriptors;
  250. IN OUT ULONG TX_NumPackets;
  251. IN OUT ULONG TX_NumDescriptors;
  252. } UNIT_ISOCH_PARAMS, *PUNIT_ISOCH_PARAMS;
  253. //
  254. // Unit Generation/Node Info
  255. //
  256. typedef struct _BUS_GENERATION_NODE {
  257. OUT ULONG GenerationCount;
  258. OUT NODE_ADDRESS LocalNodeAddress;
  259. OUT NODE_ADDRESS DeviceNodeAddress;
  260. } BUS_GENERATION_NODE, *PBUS_GENERATION_NODE;
  261. //
  262. // Unit DDI Version
  263. //
  264. typedef struct _UNIT_DDI_VERSION {
  265. OUT ULONG Version;
  266. } UNIT_DDI_VERSION, *PUNIT_DDI_VERSION;
  267. //
  268. // UnitDiagLevel
  269. //
  270. typedef struct _UNIT_DIAG_LEVEL {
  271. IN ULONG DiagLevel;
  272. } UNIT_DIAG_LEVEL, *PUNIT_DIAG_LEVEL;
  273. //
  274. // GetUnitInfo
  275. //
  276. typedef struct _GET_UNIT_INFO {
  277. IN ULONG nLevel;
  278. IN OUT PVOID Information;
  279. } GET_UNIT_INFO, *PGET_UNIT_INFO;
  280. //
  281. // SetUnitInfo nLevel's
  282. //
  283. #define SET_UNIT_INFO_DIAG_LEVEL 0x00000001 // Sets the diag level for 61883
  284. #define SET_UNIT_INFO_ISOCH_PARAMS 0x00000002 // Sets the parameters for isoch
  285. #define SET_CMP_ADDRESS_RANGE_TYPE 0x00000003 // Sets the type of CMP address range
  286. //
  287. // CMP Address Range Type
  288. //
  289. #define CMP_ADDRESS_TYPE_GLOBAL 0x00000001 // Global CMP for this instance - default
  290. #define CMP_ADDRESS_TYPE_EXCLUSIVE 0x00000002 // Exclusive CMP for this instance
  291. //
  292. // SetCmpAddressRange
  293. //
  294. typedef struct _SET_CMP_ADDRESS_TYPE {
  295. IN ULONG Type;
  296. } SET_CMP_ADDRESS_TYPE, *PSET_CMP_ADDRESS_TYPE;
  297. //
  298. // SetUnitInfo
  299. //
  300. typedef struct _SET_UNIT_INFO {
  301. IN ULONG nLevel;
  302. IN OUT PVOID Information;
  303. } SET_UNIT_INFO, *PSET_UNIT_INFO;
  304. //
  305. // GetPlugHandle
  306. //
  307. typedef struct _CMP_GET_PLUG_HANDLE {
  308. //
  309. // Requested Plug Number
  310. //
  311. IN ULONG PlugNum;
  312. //
  313. // Requested Plug Type
  314. //
  315. IN CMP_PLUG_TYPE Type;
  316. //
  317. // Returned Plug Handle
  318. //
  319. OUT HANDLE hPlug;
  320. } CMP_GET_PLUG_HANDLE, *PCMP_GET_PLUG_HANDLE;
  321. //
  322. // GetPlugState
  323. //
  324. typedef struct _CMP_GET_PLUG_STATE {
  325. //
  326. // Plug Handle
  327. //
  328. IN HANDLE hPlug;
  329. //
  330. // Current State
  331. //
  332. OUT ULONG State;
  333. //
  334. // Current Data Rate
  335. //
  336. OUT ULONG DataRate;
  337. //
  338. // Current Payload Size
  339. //
  340. OUT ULONG Payload;
  341. //
  342. // Number of Broadcast Connections
  343. //
  344. OUT ULONG BC_Connections;
  345. //
  346. // Number of Point to Point Connections
  347. //
  348. OUT ULONG PP_Connections;
  349. } CMP_GET_PLUG_STATE, *PCMP_GET_PLUG_STATE;
  350. //
  351. // CipDataFormat
  352. //
  353. typedef struct _CIP_DATA_FORMAT {
  354. //
  355. // FMT and FDF either known, or discovered
  356. // via AV/C command
  357. //
  358. UCHAR FMT;
  359. UCHAR FDF_hi;
  360. UCHAR FDF_mid;
  361. UCHAR FDF_lo;
  362. //
  363. // SPH as defined by IEC-61883
  364. //
  365. BOOLEAN bHeader;
  366. //
  367. // QPC as defined by IEC-61883
  368. //
  369. UCHAR Padding;
  370. //
  371. // DBS as defined by IEC-61883
  372. //
  373. UCHAR BlockSize;
  374. //
  375. // FN as defined by IEC-61883
  376. //
  377. UCHAR Fraction;
  378. //
  379. // BlockPeriod - TX Only
  380. //
  381. ULONG BlockPeriod;
  382. } CIP_DATA_FORMAT, *PCIP_DATA_FORMAT;
  383. //
  384. // Connect
  385. //
  386. typedef struct _CMP_CONNECT {
  387. //
  388. // Output Plug Handle
  389. //
  390. IN HANDLE hOutputPlug;
  391. //
  392. // Input Plug Handle
  393. //
  394. IN HANDLE hInputPlug;
  395. //
  396. // Requested Connect Type
  397. //
  398. IN CMP_CONNECT_TYPE Type;
  399. //
  400. // Requested Data Format - TX Only
  401. //
  402. IN CIP_DATA_FORMAT Format;
  403. //
  404. // Returned Connect Handle
  405. //
  406. OUT HANDLE hConnect;
  407. } CMP_CONNECT, *PCMP_CONNECT;
  408. //
  409. // Disconnect
  410. //
  411. typedef struct _CMP_DISCONNECT {
  412. //
  413. // Connect Handle to Disconnect
  414. //
  415. IN HANDLE hConnect;
  416. } CMP_DISCONNECT, *PCMP_DISCONNECT;
  417. //
  418. // CIP Frame typedef
  419. //
  420. typedef struct _CIP_FRAME CIP_FRAME, *PCIP_FRAME;
  421. //
  422. // ValidateInfo Struct. returned on pfnValidate.
  423. //
  424. typedef struct _CIP_VALIDATE_INFO {
  425. //
  426. // Connection Handle
  427. //
  428. HANDLE hConnect;
  429. //
  430. // Validate Context
  431. //
  432. PVOID Context;
  433. //
  434. // TimeStamp for current source packet
  435. //
  436. CYCLE_TIME TimeStamp;
  437. //
  438. // Packet offset for current source packet
  439. //
  440. PUCHAR Packet;
  441. } CIP_VALIDATE_INFO, *PCIP_VALIDATE_INFO;
  442. //
  443. // NotifyInfo Struct. returned on pfnNotify
  444. //
  445. typedef struct _CIP_NOTIFY_INFO {
  446. //
  447. // Connection Handle
  448. //
  449. HANDLE hConnect;
  450. //
  451. // Notify Context
  452. //
  453. PVOID Context;
  454. //
  455. // Frame
  456. //
  457. PCIP_FRAME Frame;
  458. } CIP_NOTIFY_INFO, *PCIP_NOTIFY_INFO;
  459. //
  460. // Validate & Notify Routines
  461. //
  462. typedef
  463. ULONG
  464. (*PCIP_VALIDATE_ROUTINE) (
  465. IN PCIP_VALIDATE_INFO ValidateInfo
  466. );
  467. typedef
  468. ULONG
  469. (*PCIP_NOTIFY_ROUTINE) (
  470. IN PCIP_NOTIFY_INFO NotifyInfo
  471. );
  472. //
  473. // CIP Frame Struct
  474. //
  475. struct _CIP_FRAME {
  476. IN PCIP_FRAME pNext; // chain multiple frames together
  477. IN ULONG Flags; //specify flag options
  478. IN PCIP_VALIDATE_ROUTINE pfnValidate; //backdoor
  479. IN PVOID ValidateContext;
  480. IN PCIP_NOTIFY_ROUTINE pfnNotify; //completion
  481. IN PVOID NotifyContext;
  482. OUT CYCLE_TIME Timestamp;
  483. OUT ULONG Status;
  484. IN OUT PUCHAR Packet; //the locked buffer
  485. OUT ULONG CompletedBytes;
  486. };
  487. //
  488. // CIP Attach Frame Structure
  489. //
  490. typedef struct _CIP_ATTACH_FRAME {
  491. HANDLE hConnect; // Connect Handle
  492. ULONG FrameLength; // Frame Length
  493. ULONG SourceLength; // Source Length
  494. PCIP_FRAME Frame; // Frame
  495. } CIP_ATTACH_FRAME, *PCIP_ATTACH_FRAME;
  496. //
  497. // CIP Cancel Frame Structure
  498. //
  499. typedef struct _CIP_CANCEL_FRAME {
  500. IN HANDLE hConnect;
  501. IN PCIP_FRAME Frame;
  502. } CIP_CANCEL_FRAME, *PCIP_CANCEL_FRAME;
  503. //
  504. // CIP Talk Structure
  505. //
  506. typedef struct _CIP_TALK {
  507. //
  508. // Connect Handle
  509. //
  510. IN HANDLE hConnect;
  511. } CIP_TALK, *PCIP_TALK;
  512. //
  513. // CIP Listen Structure
  514. //
  515. typedef struct _CIP_LISTEN {
  516. //
  517. // Connect Handle
  518. //
  519. IN HANDLE hConnect;
  520. } CIP_LISTEN, *PCIP_LISTEN;
  521. //
  522. // CIP Stop Structure
  523. //
  524. typedef struct _CIP_STOP {
  525. //
  526. // Connect Handle
  527. //
  528. IN HANDLE hConnect;
  529. } CIP_STOP, *PCIP_STOP;
  530. //
  531. // FCP Frame Format
  532. //
  533. typedef struct _FCP_FRAME {
  534. UCHAR ctype:4;
  535. UCHAR cts:4;
  536. UCHAR payload[511];
  537. } FCP_FRAME, *PFCP_FRAME;
  538. // Legacy FCP structs
  539. typedef struct _FCP_SEND_REQUEST FCP_REQUEST, *PFCP_REQUEST;
  540. typedef struct _FCP_GET_RESPONSE FCP_RESPONSE, *PFCP_RESPONSE;
  541. //
  542. // FCP Send Request Structure
  543. //
  544. typedef struct _FCP_SEND_REQUEST {
  545. IN NODE_ADDRESS NodeAddress;
  546. IN ULONG Length;
  547. IN PFCP_FRAME Frame;
  548. } FCP_SEND_REQUEST, *PFCP_SEND_REQUEST;
  549. //
  550. // FCP Get Response Structure
  551. //
  552. typedef struct _FCP_GET_RESPONSE {
  553. OUT NODE_ADDRESS NodeAddress;
  554. IN OUT ULONG Length;
  555. IN OUT PFCP_FRAME Frame;
  556. } FCP_GET_RESPONSE, *PFCP_GET_RESPONSE;
  557. //
  558. // FCP Get Request Structure
  559. //
  560. typedef struct _FCP_GET_REQUEST {
  561. OUT NODE_ADDRESS NodeAddress;
  562. IN OUT ULONG Length;
  563. IN OUT PFCP_FRAME Frame;
  564. } FCP_GET_REQUEST, *PFCP_GET_REQUEST;
  565. //
  566. // FCP Send Response Structure
  567. //
  568. typedef struct _FCP_SEND_RESPONSE {
  569. IN NODE_ADDRESS NodeAddress;
  570. IN ULONG Length;
  571. IN PFCP_FRAME Frame;
  572. } FCP_SEND_RESPONSE, *PFCP_SEND_RESPONSE;
  573. //
  574. // Set FCP Notify Flags
  575. //
  576. #define DEREGISTER_FCP_NOTIFY 0x00000000
  577. #define REGISTER_FCP_RESPONSE_NOTIFY 0x00000001
  578. #define REGISTER_FCP_REQUEST_NOTIFY 0x00000002
  579. //
  580. // Set FCP Notify Structure
  581. //
  582. typedef struct _SET_FCP_NOTIFY {
  583. //
  584. // Flags
  585. //
  586. IN ULONG Flags;
  587. //
  588. // Node Address
  589. //
  590. IN NODE_ADDRESS NodeAddress;
  591. } SET_FCP_NOTIFY, *PSET_FCP_NOTIFY;
  592. //
  593. // Plug Notify Routine
  594. //
  595. typedef struct _CMP_NOTIFY_INFO {
  596. HANDLE hPlug;
  597. AV_PCR Pcr;
  598. PVOID Context;
  599. } CMP_NOTIFY_INFO, *PCMP_NOTIFY_INFO;
  600. //
  601. // Plug Notify Routine
  602. //
  603. typedef
  604. void
  605. (*PCMP_NOTIFY_ROUTINE) (
  606. IN PCMP_NOTIFY_INFO NotifyInfo
  607. );
  608. //
  609. // CreatePlug
  610. //
  611. typedef struct _CMP_CREATE_PLUG {
  612. // Type of plug to create
  613. IN CMP_PLUG_TYPE PlugType;
  614. // PCR Settings
  615. IN AV_PCR Pcr;
  616. // Notification Routine for Register
  617. IN PCMP_NOTIFY_ROUTINE pfnNotify;
  618. // Notification Context
  619. IN PVOID Context;
  620. // Plug Number
  621. OUT ULONG PlugNum;
  622. // Plug Handle
  623. OUT HANDLE hPlug;
  624. } CMP_CREATE_PLUG, *PCMP_CREATE_PLUG;
  625. //
  626. // DeletePlug
  627. //
  628. typedef struct _CMP_DELETE_PLUG {
  629. // Plug Handle
  630. IN HANDLE hPlug;
  631. } CMP_DELETE_PLUG, *PCMP_DELETE_PLUG;
  632. //
  633. // SetPlug
  634. //
  635. typedef struct _CMP_SET_PLUG {
  636. // Plug Handle
  637. IN HANDLE hPlug;
  638. // PCR Settings
  639. IN AV_PCR Pcr;
  640. } CMP_SET_PLUG, *PCMP_SET_PLUG;
  641. //
  642. // Bus Reset Notify Routine
  643. //
  644. typedef
  645. void
  646. (*PBUS_RESET_ROUTINE) (
  647. IN PVOID Context,
  648. IN PBUS_GENERATION_NODE BusResetInfo
  649. );
  650. #define REGISTER_BUS_RESET_NOTIFY 0x1
  651. #define DEREGISTER_BUS_RESET_NOTIFY 0x2
  652. //
  653. // BusResetNotify
  654. //
  655. typedef struct _BUS_RESET_NOTIFY {
  656. IN ULONG Flags;
  657. IN PBUS_RESET_ROUTINE pfnNotify;
  658. IN PVOID Context;
  659. } BUS_RESET_NOTIFY, *PBUS_RESET_NOTIFY;
  660. //
  661. // Flags for Av61883_SetUnitDirectory
  662. //
  663. #define ADD_UNIT_DIRECTORY_ENTRY 0x1
  664. #define REMOVE_UNIT_DIRECTORY_ENTRY 0x2
  665. #define ISSUE_BUS_RESET_AFTER_MODIFY 0x4
  666. //
  667. // Set Unit Directory
  668. //
  669. typedef struct _SET_UNIT_DIRECTORY {
  670. IN ULONG Flags;
  671. IN ULONG UnitSpecId;
  672. IN ULONG UnitSwVersion;
  673. IN OUT HANDLE hCromEntry;
  674. } SET_UNIT_DIRECTORY, *PSET_UNIT_DIRECTORY;
  675. //
  676. // States for Monitoring Plugs
  677. //
  678. #define MONITOR_STATE_CREATED 0x00000001 // Plug Created
  679. #define MONITOR_STATE_REMOVED 0x00000002 // Plug Removed
  680. #define MONITOR_STATE_UPDATED 0x00000004 // Plug Contents Updated
  681. //
  682. // Monitor Plugs Notify Routine
  683. //
  684. typedef struct _CMP_MONITOR_INFO {
  685. ULONG State;
  686. ULONG PlugNum;
  687. ULONG PlugType;
  688. AV_PCR Pcr;
  689. PVOID Context;
  690. } CMP_MONITOR_INFO, *PCMP_MONITOR_INFO;
  691. typedef
  692. void
  693. (*PCMP_MONITOR_ROUTINE) (
  694. IN PCMP_MONITOR_INFO MonitorInfo
  695. );
  696. //
  697. // Flags for Av61883_MonitorPlugs
  698. //
  699. #define REGISTER_MONITOR_PLUG_NOTIFY 0x1
  700. #define DEREGISTER_MONITOR_PLUG_NOTIFY 0x2
  701. //
  702. // MonitorPlugs (Local only)
  703. //
  704. typedef struct _CMP_MONITOR_PLUGS {
  705. IN ULONG Flags;
  706. IN PCMP_MONITOR_ROUTINE pfnNotify;
  707. IN PVOID Context;
  708. } CMP_MONITOR_PLUGS, *PCMP_MONITOR_PLUGS;
  709. //
  710. // Av61883 Struct
  711. //
  712. typedef struct _AV_61883_REQUEST {
  713. //
  714. // Requested Function
  715. //
  716. ULONG Function;
  717. //
  718. // Selected DDI Version
  719. //
  720. ULONG Version;
  721. //
  722. // Flags
  723. //
  724. ULONG Flags;
  725. union {
  726. GET_UNIT_INFO GetUnitInfo;
  727. SET_UNIT_INFO SetUnitInfo;
  728. CMP_GET_PLUG_HANDLE GetPlugHandle;
  729. CMP_GET_PLUG_STATE GetPlugState;
  730. CMP_CONNECT Connect;
  731. CMP_DISCONNECT Disconnect;
  732. CIP_ATTACH_FRAME AttachFrame;
  733. CIP_CANCEL_FRAME CancelFrame;
  734. CIP_TALK Talk;
  735. CIP_LISTEN Listen;
  736. CIP_STOP Stop;
  737. FCP_REQUEST Request; // Legacy
  738. FCP_RESPONSE Response; // Legacy
  739. FCP_SEND_REQUEST SendRequest;
  740. FCP_GET_RESPONSE GetResponse;
  741. FCP_GET_REQUEST GetRequest;
  742. FCP_SEND_RESPONSE SendResponse;
  743. SET_FCP_NOTIFY SetFcpNotify;
  744. CMP_CREATE_PLUG CreatePlug;
  745. CMP_DELETE_PLUG DeletePlug;
  746. CMP_SET_PLUG SetPlug;
  747. BUS_RESET_NOTIFY BusResetNotify;
  748. SET_UNIT_DIRECTORY SetUnitDirectory;
  749. CMP_MONITOR_PLUGS MonitorPlugs;
  750. };
  751. } AV_61883_REQUEST, *PAV_61883_REQUEST;