Leaked source code of windows server 2003
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.

1001 lines
17 KiB

  1. /*++
  2. Module Name:
  3. moxadf.h
  4. Environment:
  5. Kernel mode
  6. Revision History :
  7. --*/
  8. typedef
  9. NTSTATUS
  10. (*PMOXA_START_ROUTINE) (
  11. IN PMOXA_DEVICE_EXTENSION
  12. );
  13. typedef
  14. VOID
  15. (*PMOXA_GET_NEXT_ROUTINE) (
  16. IN PIRP *CurrentOpIrp,
  17. IN PLIST_ENTRY QueueToProcess,
  18. OUT PIRP *NewIrp,
  19. IN BOOLEAN CompleteCurrent,
  20. IN PMOXA_DEVICE_EXTENSION extension
  21. );
  22. //
  23. // main.c
  24. //
  25. NTSTATUS
  26. DriverEntry(
  27. IN PDRIVER_OBJECT DriverObject,
  28. IN PUNICODE_STRING RegistryPath
  29. );
  30. NTSTATUS
  31. MoxaGetConfigInfo(
  32. IN PDRIVER_OBJECT DriverObject,
  33. IN PUNICODE_STRING RegistryPath,
  34. OUT PMOXA_GLOBAL_DATA GlobalData
  35. );
  36. NTSTATUS
  37. MoxaGetConfigInfo1(
  38. IN PDRIVER_OBJECT DriverObject,
  39. IN PUNICODE_STRING RegistryPath,
  40. OUT PMOXA_GLOBAL_DATA GlobalData
  41. );
  42. VOID
  43. MoxaInitializeDevices(
  44. IN PDRIVER_OBJECT DriverObject,
  45. IN PMOXA_GLOBAL_DATA GlobalData
  46. );
  47. VOID
  48. MoxaDeleteDevices(
  49. IN PDRIVER_OBJECT DriverObject
  50. );
  51. VOID
  52. MoxaReportResourcesDevice(
  53. IN PMOXA_GLOBAL_DATA GlobalData,
  54. OUT BOOLEAN *ConflictDetected
  55. );
  56. VOID
  57. MoxaUnReportResourcesDevice(
  58. IN PMOXA_GLOBAL_DATA GlobalData
  59. );
  60. VOID
  61. MoxaUnload(
  62. IN PDRIVER_OBJECT DriverObject
  63. );
  64. //
  65. // openclos.c
  66. //
  67. NTSTATUS
  68. MoxaGetPortPropertyFromRegistry(IN PMOXA_DEVICE_EXTENSION extension);
  69. NTSTATUS
  70. MoxaCreateOpen(
  71. IN PDEVICE_OBJECT DeviceObject,
  72. IN PIRP Irp
  73. );
  74. VOID
  75. MoxaReset(
  76. IN PMOXA_DEVICE_EXTENSION Extension
  77. );
  78. NTSTATUS
  79. MoxaClose(
  80. IN PDEVICE_OBJECT DeviceObject,
  81. IN PIRP Irp
  82. );
  83. LARGE_INTEGER
  84. MoxaGetCharTime(
  85. IN PMOXA_DEVICE_EXTENSION Extension
  86. );
  87. NTSTATUS
  88. MoxaCleanup(
  89. IN PDEVICE_OBJECT DeviceObject,
  90. IN PIRP Irp
  91. );
  92. //
  93. // ioctl.c
  94. //
  95. NTSTATUS
  96. MoxaIoControl(
  97. IN PDEVICE_OBJECT DeviceObject,
  98. IN PIRP Irp
  99. );
  100. BOOLEAN
  101. MoxaSetFuncCode(
  102. IN PVOID Context
  103. );
  104. BOOLEAN
  105. MoxaSetFuncArgu(
  106. IN PVOID Context
  107. );
  108. BOOLEAN
  109. MoxaSetFuncGetArgu(
  110. IN PVOID Context
  111. );
  112. BOOLEAN
  113. MoxaGetCommStatus(
  114. IN PVOID Context
  115. );
  116. VOID
  117. MoxaGetProperties(
  118. IN PMOXA_DEVICE_EXTENSION Extension,
  119. IN PSERIAL_COMMPROP Properties
  120. );
  121. #if 0
  122. BOOLEAN
  123. MoxaClearDownLoad(
  124. IN PVOID Context
  125. );
  126. #endif
  127. VOID
  128. InitPort(
  129. IN PMOXA_DEVICE_EXTENSION Extension,
  130. IN ULONG RxBufSize,
  131. IN ULONG TxBufSize,
  132. IN ULONG MaxBauds
  133. );
  134. BOOLEAN
  135. MoxaGetStats(
  136. IN PVOID Context
  137. );
  138. BOOLEAN
  139. MoxaClearStats(
  140. IN PVOID Context
  141. );
  142. //
  143. // utils.c
  144. //
  145. NTSTATUS
  146. MoxaCompleteIfError(
  147. IN PDEVICE_OBJECT DeviceObject,
  148. IN PIRP Irp
  149. );
  150. VOID
  151. MoxaDelay(
  152. IN ULONG t
  153. );
  154. VOID
  155. MoxaFunc(
  156. IN PUCHAR PortOfs,
  157. IN UCHAR Command,
  158. IN USHORT Argument
  159. );
  160. VOID
  161. MoxaFunc1(
  162. IN PUCHAR PortOfs,
  163. IN UCHAR Command,
  164. IN USHORT Argument
  165. );
  166. VOID
  167. MoxaFuncWithLock(
  168. IN PMOXA_DEVICE_EXTENSION Extension,
  169. IN UCHAR Command,
  170. IN USHORT Argument
  171. );
  172. VOID
  173. MoxaFuncGetLineStatus(
  174. IN PUCHAR PortOfs,
  175. IN PUSHORT Argument
  176. );
  177. VOID
  178. MoxaFuncGetDataError(
  179. IN PUCHAR PortOfs,
  180. IN PUSHORT Argument
  181. );
  182. VOID
  183. MoxaLoop();
  184. BOOLEAN
  185. MoxaWaitFinish(
  186. IN PUCHAR PortOfs
  187. );
  188. BOOLEAN
  189. MoxaWaitFinish1(
  190. IN PUCHAR PortOfs
  191. );
  192. BOOLEAN
  193. MoxaDumbWaitFinish(
  194. IN PUCHAR PortOfs
  195. );
  196. VOID
  197. MoxaFuncWithDumbWait(
  198. IN PUCHAR PortOfs,
  199. IN UCHAR Command,
  200. IN USHORT Argument
  201. );
  202. NTSTATUS
  203. MoxaGetDivisorFromBaud(
  204. IN ULONG ClockType,
  205. IN LONG DesiredBaud,
  206. OUT PSHORT AppropriateDivisor
  207. );
  208. NTSTATUS
  209. MoxaStartOrQueue(
  210. IN PMOXA_DEVICE_EXTENSION Extension,
  211. IN PIRP Irp,
  212. IN PLIST_ENTRY QueueToExamine,
  213. IN PIRP *CurrentOpIrp,
  214. IN PMOXA_START_ROUTINE Starter
  215. );
  216. VOID
  217. MoxaCancelQueued(
  218. PDEVICE_OBJECT DeviceObject,
  219. PIRP Irp
  220. );
  221. VOID
  222. MoxaGetNextIrp(
  223. IN PIRP *CurrentOpIrp,
  224. IN PLIST_ENTRY QueueToProcess,
  225. OUT PIRP *NextIrp,
  226. IN BOOLEAN CompleteCurrent,
  227. IN PMOXA_DEVICE_EXTENSION extension
  228. );
  229. VOID
  230. MoxaTryToCompleteCurrent(
  231. IN PMOXA_DEVICE_EXTENSION Extension,
  232. IN PKSYNCHRONIZE_ROUTINE SynchRoutine OPTIONAL,
  233. IN KIRQL IrqlForRelease,
  234. IN NTSTATUS StatusToUse,
  235. IN PIRP *CurrentOpIrp,
  236. IN PLIST_ENTRY QueueToProcess OPTIONAL,
  237. IN PKTIMER IntervalTimer OPTIONAL,
  238. IN PKTIMER TotalTimer OPTIONAL,
  239. IN PMOXA_START_ROUTINE Starter OPTIONAL,
  240. IN PMOXA_GET_NEXT_ROUTINE GetNextIrp OPTIONAL
  241. );
  242. VOID
  243. MoxaRundownIrpRefs(
  244. IN PIRP *CurrentOpIrp,
  245. IN PKTIMER IntervalTimer OPTIONAL,
  246. IN PKTIMER TotalTimer OPTIONAL,
  247. IN PMOXA_DEVICE_EXTENSION pDevExt
  248. );
  249. VOID
  250. MoxaKillAllReadsOrWrites(
  251. IN PDEVICE_OBJECT DeviceObject,
  252. IN PLIST_ENTRY QueueToClean,
  253. IN PIRP *CurrentOpIrp
  254. );
  255. VOID
  256. MoxaCommError(
  257. IN PKDPC Dpc,
  258. IN PVOID DeferredContext,
  259. IN PVOID SystemContext1,
  260. IN PVOID SystemContext2
  261. );
  262. USHORT
  263. GetDeviceTxQueueWithLock(
  264. IN PMOXA_DEVICE_EXTENSION Extension
  265. );
  266. USHORT
  267. GetDeviceTxQueue(
  268. IN PMOXA_DEVICE_EXTENSION Extension
  269. );
  270. USHORT
  271. GetDeviceRxQueueWithLock(
  272. IN PMOXA_DEVICE_EXTENSION Extension
  273. );
  274. VOID
  275. MoxaUnlockPages(IN PKDPC PDpc, IN PVOID PDeferredContext,
  276. IN PVOID PSysContext1, IN PVOID PSysContext2);
  277. VOID
  278. MoxaLoop();
  279. //
  280. // qsfile.c
  281. //
  282. NTSTATUS
  283. MoxaQueryInformationFile(
  284. IN PDEVICE_OBJECT DeviceObject,
  285. IN PIRP Irp
  286. );
  287. NTSTATUS
  288. MoxaSetInformationFile(
  289. IN PDEVICE_OBJECT DeviceObject,
  290. IN PIRP Irp
  291. );
  292. //
  293. // modmflow.c
  294. //
  295. BOOLEAN
  296. MoxaSetupNewHandFlow(
  297. IN IN PVOID Context
  298. );
  299. //
  300. // write.c
  301. //
  302. NTSTATUS
  303. MoxaWrite(
  304. IN PDEVICE_OBJECT DeviceObject,
  305. IN PIRP Irp
  306. );
  307. NTSTATUS
  308. MoxaStartWrite(
  309. IN PMOXA_DEVICE_EXTENSION Extension
  310. );
  311. BOOLEAN
  312. MoxaPutB(
  313. IN PVOID Context
  314. );
  315. BOOLEAN
  316. MoxaOut(
  317. IN PVOID Context
  318. );
  319. BOOLEAN
  320. MoxaPutData (
  321. IN PMOXA_DEVICE_EXTENSION Extension
  322. );
  323. VOID
  324. MoxaGetNextWrite(
  325. IN PIRP *CurrentOpIrp,
  326. IN PLIST_ENTRY QueueToProcess,
  327. IN PIRP *NewIrp,
  328. IN BOOLEAN CompleteCurrent,
  329. IN PMOXA_DEVICE_EXTENSION Extension
  330. );
  331. VOID
  332. MoxaCancelCurrentWrite(
  333. PDEVICE_OBJECT DeviceObject,
  334. PIRP Irp
  335. );
  336. BOOLEAN
  337. MoxaGrabWriteFromIsr(
  338. IN PVOID Context
  339. );
  340. BOOLEAN
  341. MoxaProcessEmptyTransmit(
  342. IN PVOID Context
  343. );
  344. VOID
  345. MoxaCompleteWrite(
  346. IN PKDPC Dpc,
  347. IN PVOID DeferredContext,
  348. IN PVOID SystemContext1,
  349. IN PVOID SystemContext2
  350. );
  351. VOID
  352. MoxaWriteTimeout(
  353. IN PKDPC Dpc,
  354. IN PVOID DeferredContext,
  355. IN PVOID SystemContext1,
  356. IN PVOID SystemContext2
  357. );
  358. //
  359. // read.c
  360. //
  361. NTSTATUS
  362. MoxaRead(
  363. IN PDEVICE_OBJECT DeviceObject,
  364. IN PIRP Irp
  365. );
  366. NTSTATUS
  367. MoxaStartRead(
  368. IN PMOXA_DEVICE_EXTENSION Extension
  369. );
  370. BOOLEAN
  371. MoxaLineInput(
  372. IN PVOID Context
  373. );
  374. BOOLEAN
  375. MoxaView(
  376. IN PVOID Context
  377. );
  378. BOOLEAN
  379. MoxaIn(
  380. IN PVOID Context
  381. );
  382. VOID
  383. MoxaGetData(
  384. IN PMOXA_DEVICE_EXTENSION Extension
  385. );
  386. BOOLEAN
  387. MoxaInSwitchToUser(
  388. IN PVOID Context
  389. );
  390. VOID
  391. MoxaCancelCurrentRead(
  392. PDEVICE_OBJECT DeviceObject,
  393. PIRP Irp
  394. );
  395. BOOLEAN
  396. MoxaGrabReadFromIsr(
  397. IN PVOID Context
  398. );
  399. VOID
  400. MoxaCompleteRead(
  401. IN PKDPC Dpc,
  402. IN PVOID DeferredContext,
  403. IN PVOID SystemContext1,
  404. IN PVOID SystemContext2
  405. );
  406. VOID
  407. MoxaReadTimeout(
  408. IN PKDPC Dpc,
  409. IN PVOID DeferredContext,
  410. IN PVOID SystemContext1,
  411. IN PVOID SystemContext2
  412. );
  413. VOID
  414. MoxaIntervalReadTimeout(
  415. IN PKDPC Dpc,
  416. IN PVOID DeferredContext,
  417. IN PVOID SystemContext1,
  418. IN PVOID SystemContext2
  419. );
  420. BOOLEAN
  421. MoxaCheckInQueue(
  422. IN PMOXA_DEVICE_EXTENSION Extension
  423. );
  424. BOOLEAN
  425. MoxaPollGetData(
  426. IN PVOID Context
  427. );
  428. //
  429. // flush.c
  430. //
  431. NTSTATUS
  432. MoxaFlush(
  433. IN PDEVICE_OBJECT DeviceObject,
  434. IN PIRP Irp
  435. );
  436. NTSTATUS
  437. MoxaStartFlush(
  438. IN PMOXA_DEVICE_EXTENSION Extension
  439. );
  440. //
  441. // waitmask.c
  442. //
  443. NTSTATUS
  444. MoxaStartMask(
  445. IN PMOXA_DEVICE_EXTENSION Extension
  446. );
  447. BOOLEAN
  448. MoxaFinishOldWait(
  449. IN PVOID Context
  450. );
  451. VOID
  452. MoxaCancelWait(
  453. IN PDEVICE_OBJECT DeviceObject,
  454. IN PIRP Irp
  455. );
  456. BOOLEAN
  457. MoxaGrabWaitFromIsr(
  458. IN PVOID Context
  459. );
  460. BOOLEAN
  461. MoxaGiveWaitToIsr(
  462. IN PVOID Context
  463. );
  464. VOID
  465. MoxaCompleteWait(
  466. IN PKDPC Dpc,
  467. IN PVOID DeferredContext,
  468. IN PVOID SystemContext1,
  469. IN PVOID SystemContext2
  470. );
  471. //
  472. // purge.c
  473. //
  474. NTSTATUS
  475. MoxaStartPurge(
  476. IN PMOXA_DEVICE_EXTENSION Extension
  477. );
  478. //
  479. // isr.c
  480. //
  481. BOOLEAN
  482. MoxaISR(
  483. IN PKINTERRUPT InterruptObject,
  484. IN PVOID Context
  485. );
  486. VOID
  487. MoxaIsrIn(
  488. IN PKDPC Dpc,
  489. IN PVOID DeferredContext,
  490. IN PVOID SystemContext1,
  491. IN PVOID SystemContext2
  492. );
  493. BOOLEAN
  494. MoxaIsrGetData(
  495. IN PVOID Context
  496. );
  497. VOID
  498. MoxaIsrOut(
  499. IN PKDPC Dpc,
  500. IN PVOID DeferredContext,
  501. IN PVOID SystemContext1,
  502. IN PVOID SystemContext2
  503. );
  504. BOOLEAN
  505. MoxaIsrPutData(
  506. IN PVOID Context
  507. );
  508. //
  509. // 9-24-01 by William
  510. //
  511. #if 0
  512. VOID
  513. MoxaIntrLine(
  514. IN PKDPC Dpc,
  515. IN PVOID DeferredContext,
  516. IN PVOID SystemContext1,
  517. IN PVOID SystemContext2
  518. );
  519. VOID
  520. MoxaIntrError(
  521. IN PKDPC Dpc,
  522. IN PVOID DeferredContext,
  523. IN PVOID SystemContext1,
  524. IN PVOID SystemContext2
  525. );
  526. #endif
  527. // end
  528. //
  529. //
  530. //
  531. VOID
  532. MoxaConnectInterrupt(
  533. IN PDRIVER_OBJECT ,
  534. IN PMOXA_GLOBAL_DATA
  535. );
  536. USHORT
  537. MoxaFindPCIBoards(
  538. IN PMOXA_Config
  539. );
  540. NTSTATUS
  541. MoxaGetBoardType(IN PDEVICE_OBJECT devObject,
  542. OUT PULONG boardType
  543. );
  544. NTSTATUS
  545. MoxaCreateDevObj(IN PDRIVER_OBJECT DriverObject,
  546. IN PUNICODE_STRING pDeviceObjName,
  547. IN PDEVICE_SETTINGS pSettings,
  548. OUT PDEVICE_OBJECT *NewDeviceObject
  549. );
  550. NTSTATUS
  551. MoxaSyncCompletion(IN PDEVICE_OBJECT DeviceObject,
  552. IN PIRP Irp,
  553. IN PKEVENT MoxaSyncEvent
  554. );
  555. NTSTATUS
  556. MoxaAddDevice(IN PDRIVER_OBJECT DriverObject,
  557. IN PDEVICE_OBJECT PPdo
  558. );
  559. #if 0
  560. NTSTATUS
  561. MoxaDoExternalNaming(IN PMOXA_DEVICE_EXTENSION PDevExt,
  562. IN PDRIVER_OBJECT PDrvObj
  563. );
  564. NTSTATUS
  565. MoxaGetPortInfo(IN PDEVICE_OBJECT PDevObj,
  566. OUT PCONFIG_DATA PConfig,
  567. IN PSERIAL_USER_DATA PUserData
  568. );
  569. NTSTATUS
  570. MoxaStartDevice(IN PDEVICE_OBJECT PDevObj,
  571. IN PIRP PIrp
  572. );
  573. NTSTATUS
  574. MoxaFinishStartDevice(IN PDEVICE_OBJECT PDevObj,
  575. IN PCM_RESOURCE_LIST PResList,
  576. IN PCM_RESOURCE_LIST PTrResList,
  577. PSERIAL_USER_DATA PUserData
  578. );
  579. VOID
  580. MoxaUndoExternalNaming(IN PMOXA_DEVICE_EXTENSION Extension);
  581. #endif
  582. NTSTATUS
  583. MoxaPnpDispatch(IN PDEVICE_OBJECT PDevObj,
  584. IN PIRP PIrp
  585. );
  586. MOXA_MEM_COMPARES
  587. MoxaMemCompare(
  588. IN PHYSICAL_ADDRESS A,
  589. IN ULONG SpanOfA,
  590. IN PHYSICAL_ADDRESS B,
  591. IN ULONG SpanOfB
  592. );
  593. VOID
  594. MoxaLogError(
  595. IN PDRIVER_OBJECT DriverObject,
  596. IN PDEVICE_OBJECT DeviceObject OPTIONAL,
  597. IN PHYSICAL_ADDRESS P1,
  598. IN PHYSICAL_ADDRESS P2,
  599. IN ULONG SequenceNumber,
  600. IN UCHAR MajorFunctionCode,
  601. IN UCHAR RetryCount,
  602. IN ULONG UniqueErrorValue,
  603. IN NTSTATUS FinalStatus,
  604. IN NTSTATUS SpecificIOStatus,
  605. IN ULONG LengthOfInsert1,
  606. IN PWCHAR Insert1,
  607. IN ULONG LengthOfInsert2,
  608. IN PWCHAR Insert2
  609. );
  610. VOID
  611. MoxaIRPEpilogue(IN PMOXA_DEVICE_EXTENSION PDevExt);
  612. NTSTATUS
  613. MoxaIRPPrologue(IN PIRP PIrp,
  614. IN PMOXA_DEVICE_EXTENSION PDevExt
  615. );
  616. VOID
  617. MoxaFilterCancelQueued(IN PDEVICE_OBJECT PDevObj,
  618. IN PIRP PIrp);
  619. VOID
  620. MoxaKillAllStalled(IN PDEVICE_OBJECT PDevObj);
  621. NTSTATUS
  622. MoxaFilterIrps(IN PIRP PIrp,
  623. IN PMOXA_DEVICE_EXTENSION PDevExt);
  624. VOID
  625. MoxaUnstallIrps(IN PMOXA_DEVICE_EXTENSION PDevExt);
  626. VOID
  627. MoxaSetDeviceFlags(IN PMOXA_DEVICE_EXTENSION PDevExt,
  628. OUT PULONG PFlags,
  629. IN ULONG Value,
  630. IN BOOLEAN Set
  631. );
  632. #define MoxaSetFlags(PDevExt, Value) \
  633. MoxaSetDeviceFlags((PDevExt), &(PDevExt)->Flags, (Value), TRUE)
  634. #define MoxaClearFlags(PDevExt, Value) \
  635. MoxaSetDeviceFlags((PDevExt), &(PDevExt)->Flags, (Value), FALSE)
  636. #define MoxaSetAccept(PDevExt, Value) \
  637. MoxaSetDeviceFlags((PDevExt), &(PDevExt)->DevicePNPAccept, (Value), TRUE)
  638. #define MoxaClearAccept(PDevExt, Value) \
  639. MoxaSetDeviceFlags((PDevExt), &(PDevExt)->DevicePNPAccept, (Value), FALSE)
  640. NTSTATUS
  641. MoxaPoCallDriver(PMOXA_DEVICE_EXTENSION PDevExt,
  642. PDEVICE_OBJECT PDevObj,
  643. PIRP PIrp
  644. );
  645. NTSTATUS
  646. MoxaIoCallDriver(PMOXA_DEVICE_EXTENSION PDevExt,
  647. PDEVICE_OBJECT PDevObj,
  648. PIRP PIrp
  649. );
  650. VOID
  651. MoxaKillPendingIrps(PDEVICE_OBJECT PDevObj);
  652. NTSTATUS
  653. MoxaRemoveDevObj(IN PDEVICE_OBJECT PDevObj);
  654. NTSTATUS
  655. MoxaIoSyncIoctlEx(ULONG Ioctl,
  656. BOOLEAN Internal,
  657. PDEVICE_OBJECT PDevObj,
  658. PKEVENT PEvent,
  659. PIO_STATUS_BLOCK PIoStatusBlock,
  660. PVOID PInBuffer,
  661. ULONG InBufferLen,
  662. PVOID POutBuffer, // output buffer - optional
  663. ULONG OutBufferLen
  664. );
  665. NTSTATUS
  666. MoxaIoSyncReq(PDEVICE_OBJECT PDevObj,
  667. IN PIRP PIrp,
  668. PKEVENT PEvent
  669. );
  670. NTSTATUS
  671. MoxaSystemPowerCompletion(IN PDEVICE_OBJECT PDevObj,
  672. UCHAR MinorFunction,
  673. IN POWER_STATE PowerState,
  674. IN PVOID Context,
  675. PIO_STATUS_BLOCK IoStatus
  676. );
  677. VOID
  678. MoxaSaveDeviceState(IN PMOXA_DEVICE_EXTENSION PDevExt);
  679. VOID
  680. MoxaRestoreDeviceState(IN PMOXA_DEVICE_EXTENSION PDevExt);
  681. NTSTATUS
  682. MoxaSetPowerD0(IN PDEVICE_OBJECT PDevObj,
  683. IN PIRP PIrp
  684. );
  685. NTSTATUS
  686. MoxaGotoPowerState(IN PDEVICE_OBJECT PDevObj,
  687. IN PMOXA_DEVICE_EXTENSION PDevExt,
  688. IN DEVICE_POWER_STATE DevPowerState
  689. );
  690. NTSTATUS
  691. MoxaSetPowerD3(IN PDEVICE_OBJECT PDevObj,
  692. IN PIRP PIrp
  693. );
  694. NTSTATUS
  695. MoxaSendWaitWake(PMOXA_DEVICE_EXTENSION PDevExt);
  696. NTSTATUS
  697. MoxaWakeCompletion(IN PDEVICE_OBJECT PDevObj,
  698. IN UCHAR MinorFunction,
  699. IN POWER_STATE PowerState,
  700. IN PVOID Context,
  701. IN PIO_STATUS_BLOCK IoStatus
  702. );
  703. NTSTATUS
  704. MoxaPowerDispatch(IN PDEVICE_OBJECT PDevObj,
  705. IN PIRP PIrp);
  706. NTSTATUS
  707. MoxaDoExternalNaming(IN PMOXA_DEVICE_EXTENSION PDevExt,
  708. IN PDRIVER_OBJECT PDrvObj);
  709. VOID
  710. MoxaUndoExternalNaming(IN PMOXA_DEVICE_EXTENSION Extension);
  711. NTSTATUS
  712. MoxaInternalIoControl(IN PDEVICE_OBJECT PDevObj,
  713. IN PIRP PIrp
  714. );
  715. NTSTATUS
  716. MoxaSystemControlDispatch(IN PDEVICE_OBJECT DeviceObject,
  717. IN PIRP Irp
  718. );
  719. NTSTATUS
  720. MoxaTossWMIRequest(IN PDEVICE_OBJECT PDevObj,
  721. IN PIRP PIrp,
  722. IN ULONG GuidIndex
  723. );
  724. NTSTATUS
  725. MoxaSetWmiDataItem(IN PDEVICE_OBJECT PDevObj,
  726. IN PIRP PIrp,
  727. IN ULONG GuidIndex,
  728. IN ULONG InstanceIndex,
  729. IN ULONG DataItemId,
  730. IN ULONG BufferSize,
  731. IN PUCHAR PBuffer
  732. );
  733. NTSTATUS
  734. MoxaSetWmiDataBlock(IN PDEVICE_OBJECT PDevObj,
  735. IN PIRP PIrp,
  736. IN ULONG GuidIndex,
  737. IN ULONG InstanceIndex,
  738. IN ULONG BufferSize,
  739. IN PUCHAR PBuffer
  740. );
  741. NTSTATUS
  742. MoxaQueryWmiDataBlock(IN PDEVICE_OBJECT PDevObj,
  743. IN PIRP PIrp,
  744. IN ULONG GuidIndex,
  745. IN ULONG InstanceIndex,
  746. IN ULONG InstanceCount,
  747. IN OUT PULONG InstanceLengthArray,
  748. IN ULONG OutBufferSize,
  749. OUT PUCHAR PBuffer
  750. );
  751. NTSTATUS
  752. MoxaQueryWmiRegInfo(IN PDEVICE_OBJECT PDevObj,
  753. OUT PULONG PRegFlags,
  754. OUT PUNICODE_STRING PInstanceName,
  755. OUT PUNICODE_STRING *PRegistryPath,
  756. OUT PUNICODE_STRING MofResourceName,
  757. OUT PDEVICE_OBJECT *Pdo
  758. );
  759. BOOLEAN
  760. MoxaInsertQueueDpc(IN PRKDPC PDpc,
  761. IN PVOID Sarg1,
  762. IN PVOID Sarg2,
  763. IN PMOXA_DEVICE_EXTENSION PDevExt
  764. );
  765. BOOLEAN
  766. MoxaSetTimer(IN PKTIMER Timer,
  767. IN LARGE_INTEGER DueTime,
  768. IN PKDPC Dpc OPTIONAL,
  769. IN PMOXA_DEVICE_EXTENSION PDevExt
  770. );
  771. BOOLEAN
  772. MoxaCancelTimer(IN PKTIMER Timer,
  773. IN PMOXA_DEVICE_EXTENSION PDevExt
  774. );
  775. VOID
  776. MoxaDpcEpilogue(IN PMOXA_DEVICE_EXTENSION PDevExt,
  777. PKDPC PDpc
  778. );
  779. VOID
  780. MoxaReleaseResources(IN PMOXA_DEVICE_EXTENSION pDevExt);
  781. VOID
  782. MoxaDisableInterfacesResources(IN PDEVICE_OBJECT PDevObj,
  783. BOOLEAN DisableUART);
  784. BOOLEAN
  785. MoxaCleanInterruptShareLists(IN PMOXA_DEVICE_EXTENSION pDevExt );
  786. BOOLEAN
  787. MoxaRemoveLists(IN PVOID Context);
  788. //
  789. // registry.c
  790. //
  791. NTSTATUS
  792. MoxaPutRegistryKeyValue(
  793. IN HANDLE Handle,
  794. IN PWCHAR PKeyNameString,
  795. IN ULONG KeyNameStringLength,
  796. IN ULONG Dtype,
  797. IN PVOID PData,
  798. IN ULONG DataLength
  799. );
  800. NTSTATUS
  801. MoxaGetRegistryKeyValue (
  802. IN HANDLE Handle,
  803. IN PWCHAR KeyNameString,
  804. IN ULONG KeyNameStringLength,
  805. IN PVOID Data,
  806. IN ULONG DataLength,
  807. OUT PULONG ActualLength
  808. );
  809. //
  810. // timer.c
  811. //
  812. void MoxaInitTimeOutProc(void);
  813. void MoxaStopTimeOutProc(void);
  814. BOOLEAN MoxaAddTimeOutProc(
  815. PMOXA_DEVICE_EXTENSION extension
  816. );
  817. BOOLEAN MoxaDelTimeOutProc(
  818. PMOXA_DEVICE_EXTENSION extension
  819. );
  820. ULONG MoxaGetModemStatus(
  821. PMOXA_DEVICE_EXTENSION extension
  822. );