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.

4027 lines
114 KiB

  1. /*++
  2. Copyright (c) 1991 Microsoft Corporation
  3. Module Name:
  4. vrdlcdbg.c
  5. Abstract:
  6. Contains functions for dumping CCBs, parameter tables; diagnostic and
  7. debugging functions for DOS DLC (CCB1)
  8. Contents:
  9. DbgOut
  10. DbgOutStr
  11. DumpCcb
  12. DumpDosDlcBufferPool
  13. DumpDosDlcBufferChain
  14. MapCcbRetcode
  15. (DefaultParameterTableDump)
  16. (DumpParameterTableHeader)
  17. (DumpBufferFreeParms)
  18. (DumpBufferGetParms)
  19. (DumpDirCloseAdapterParms)
  20. (DumpDirDefineMifEnvironmentParms)
  21. (DumpDirInitializeParms)
  22. (DumpDirModifyOpenParmsParms)
  23. (DumpDirOpenAdapterParms)
  24. (DumpDirReadLog)
  25. (DumpDirRestoreOpenParmsParms)
  26. (DumpDirSetFunctionalAddressParms)
  27. (DumpDirSetGroupAddressParms)
  28. (DumpDirSetUserAppendageParms)
  29. (DumpDirStatusParms)
  30. (DumpDirTimerCancelParms)
  31. (DumpDirTimerCancelGroupParms)
  32. (DumpDirTimerSetParms)
  33. (DumpDlcCloseSapParms)
  34. (DumpDlcCloseStationParms)
  35. (DumpDlcConnectStationParms)
  36. (DumpDlcFlowControlParms)
  37. (MapFlowControl)
  38. (DumpDlcModifyParms)
  39. (DumpDlcOpenSapParms)
  40. (MapOptionsPriority)
  41. (DumpDlcOpenStationParms)
  42. (DumpDlcReallocateParms)
  43. (DumpDlcResetParms)
  44. (DumpDlcStatisticsParms)
  45. (DumpPdtTraceOffParms)
  46. (DumpPdtTraceOnParms)
  47. (DumpReadParms)
  48. (MapReadEvent)
  49. (MapDlcStatus)
  50. (DumpReadCancelParms)
  51. (DumpReceiveParms)
  52. (DumpReceiveCancelParms)
  53. (DumpReceiveModifyParms)
  54. (DumpTransmitDirFrameParms)
  55. (DumpTransmitIFrameParms)
  56. (DumpTransmitTestCmdParms)
  57. (DumpTransmitUiFrameParms)
  58. (DumpTransmitXidCmdParms)
  59. (DumpTransmitXidRespFinalParms)
  60. (DumpTransmitXidRespNotFinalParms)
  61. (DumpTransmitParms)
  62. (DumpTransmitQueue)
  63. DumpReceiveDataBuffer
  64. (MapMessageType)
  65. DumpData
  66. IsCcbErrorCodeAllowable
  67. IsCcbErrorCodeValid
  68. IsCcbCommandValid
  69. MapCcbCommandToName
  70. DumpDosAdapter
  71. (MapAdapterType)
  72. Author:
  73. Richard L Firth (rfirth) 30-Apr-1992
  74. Revision History:
  75. --*/
  76. #if DBG
  77. #include <stdio.h>
  78. #include <stdarg.h>
  79. #include <string.h>
  80. #include <nt.h>
  81. #include <ntrtl.h> // ASSERT, DbgPrint
  82. #include <nturtl.h>
  83. #include <windows.h>
  84. #include <softpc.h> // x86 virtual machine definitions
  85. #include <vrdlctab.h>
  86. #include <vdmredir.h>
  87. #include <smbgtpt.h>
  88. #include <dlcapi.h> // Official DLC API definition
  89. #include <ntdddlc.h> // IOCTL commands
  90. #include <dlcio.h> // Internal IOCTL API interface structures
  91. #include "vrdlc.h"
  92. #include "vrdebug.h"
  93. #include "vrdlcdbg.h"
  94. //
  95. // defines
  96. //
  97. //
  98. // standard parameters to each table dump routine
  99. //
  100. #define DUMP_TABLE_PARMS \
  101. IN PVOID Parameters, \
  102. IN BOOL IsDos, \
  103. IN BOOL IsInput, \
  104. IN WORD Segment, \
  105. IN WORD Offset
  106. //
  107. // DumpData options
  108. //
  109. #define DD_NO_ADDRESS 0x00000001 // don't display address of data
  110. #define DD_LINE_BEFORE 0x00000002 // linefeed before first dumped line
  111. #define DD_LINE_AFTER 0x00000004 // linefeed after last dumped line
  112. #define DD_INDENT_ALL 0x00000008 // indent all lines
  113. #define DD_NO_ASCII 0x00000010 // don't dump ASCII respresentation
  114. #define DD_UPPER_CASE 0x00000020 // upper-case hex dump (F4 instead of f4)
  115. //
  116. // misc.
  117. //
  118. #define DEFAULT_FIELD_WIDTH 13 // amount of description before a number
  119. //
  120. // local prototypes
  121. //
  122. VOID
  123. DbgOutStr(
  124. IN LPSTR Str
  125. );
  126. PRIVATE
  127. VOID
  128. DefaultParameterTableDump(
  129. DUMP_TABLE_PARMS
  130. );
  131. PRIVATE
  132. VOID
  133. DumpParameterTableHeader(
  134. IN LPSTR CommandName,
  135. IN PVOID Table,
  136. IN BOOL IsDos,
  137. IN WORD Segment,
  138. IN WORD Offset
  139. );
  140. PRIVATE
  141. VOID
  142. DumpBufferFreeParms(
  143. DUMP_TABLE_PARMS
  144. );
  145. PRIVATE
  146. VOID
  147. DumpBufferGetParms(
  148. DUMP_TABLE_PARMS
  149. );
  150. PRIVATE
  151. VOID
  152. DumpDirCloseAdapterParms(
  153. DUMP_TABLE_PARMS
  154. );
  155. PRIVATE
  156. VOID
  157. DumpDirDefineMifEnvironmentParms(
  158. DUMP_TABLE_PARMS
  159. );
  160. PRIVATE
  161. VOID
  162. DumpDirInitializeParms(
  163. DUMP_TABLE_PARMS
  164. );
  165. PRIVATE
  166. VOID
  167. DumpDirModifyOpenParmsParms(
  168. DUMP_TABLE_PARMS
  169. );
  170. PRIVATE
  171. VOID
  172. DumpDirOpenAdapterParms(
  173. DUMP_TABLE_PARMS
  174. );
  175. PRIVATE
  176. VOID
  177. DumpDirReadLog(
  178. DUMP_TABLE_PARMS
  179. );
  180. PRIVATE
  181. VOID
  182. DumpDirRestoreOpenParmsParms(
  183. DUMP_TABLE_PARMS
  184. );
  185. PRIVATE
  186. VOID
  187. DumpDirSetFunctionalAddressParms(
  188. DUMP_TABLE_PARMS
  189. );
  190. PRIVATE
  191. VOID
  192. DumpDirSetGroupAddressParms(
  193. DUMP_TABLE_PARMS
  194. );
  195. PRIVATE
  196. VOID
  197. DumpDirSetUserAppendageParms(
  198. DUMP_TABLE_PARMS
  199. );
  200. PRIVATE
  201. VOID
  202. DumpDirStatusParms(
  203. DUMP_TABLE_PARMS
  204. );
  205. PRIVATE
  206. VOID
  207. DumpDirTimerCancelParms(
  208. DUMP_TABLE_PARMS
  209. );
  210. PRIVATE
  211. VOID
  212. DumpDirTimerCancelGroupParms(
  213. DUMP_TABLE_PARMS
  214. );
  215. PRIVATE
  216. VOID
  217. DumpDirTimerSetParms(
  218. DUMP_TABLE_PARMS
  219. );
  220. PRIVATE
  221. VOID
  222. DumpDlcCloseSapParms(
  223. DUMP_TABLE_PARMS
  224. );
  225. PRIVATE
  226. VOID
  227. DumpDlcCloseStationParms(
  228. DUMP_TABLE_PARMS
  229. );
  230. PRIVATE
  231. VOID
  232. DumpDlcConnectStationParms(
  233. DUMP_TABLE_PARMS
  234. );
  235. PRIVATE
  236. VOID
  237. DumpDlcFlowControlParms(
  238. DUMP_TABLE_PARMS
  239. );
  240. PRIVATE
  241. LPSTR
  242. MapFlowControl(
  243. BYTE FlowControl
  244. );
  245. PRIVATE
  246. VOID
  247. DumpDlcModifyParms(
  248. DUMP_TABLE_PARMS
  249. );
  250. PRIVATE
  251. VOID
  252. DumpDlcOpenSapParms(
  253. DUMP_TABLE_PARMS
  254. );
  255. PRIVATE
  256. LPSTR
  257. MapOptionsPriority(
  258. UCHAR OptionsPriority
  259. );
  260. PRIVATE
  261. VOID
  262. DumpDlcOpenStationParms(
  263. DUMP_TABLE_PARMS
  264. );
  265. PRIVATE
  266. VOID
  267. DumpDlcReallocateParms(
  268. DUMP_TABLE_PARMS
  269. );
  270. PRIVATE
  271. VOID
  272. DumpDlcResetParms(
  273. DUMP_TABLE_PARMS
  274. );
  275. PRIVATE
  276. VOID
  277. DumpDlcStatisticsParms(
  278. DUMP_TABLE_PARMS
  279. );
  280. PRIVATE
  281. VOID
  282. DumpPdtTraceOffParms(
  283. DUMP_TABLE_PARMS
  284. );
  285. PRIVATE
  286. VOID
  287. DumpPdtTraceOnParms(
  288. DUMP_TABLE_PARMS
  289. );
  290. PRIVATE
  291. VOID
  292. DumpReadParms(
  293. DUMP_TABLE_PARMS
  294. );
  295. PRIVATE
  296. LPSTR
  297. MapReadEvent(
  298. UCHAR Event
  299. );
  300. PRIVATE
  301. LPSTR
  302. MapDlcStatus(
  303. WORD Status
  304. );
  305. PRIVATE
  306. VOID
  307. DumpReadCancelParms(
  308. DUMP_TABLE_PARMS
  309. );
  310. PRIVATE
  311. VOID
  312. DumpReceiveParms(
  313. DUMP_TABLE_PARMS
  314. );
  315. PRIVATE
  316. VOID
  317. DumpReceiveCancelParms(
  318. DUMP_TABLE_PARMS
  319. );
  320. PRIVATE
  321. VOID
  322. DumpReceiveModifyParms(
  323. DUMP_TABLE_PARMS
  324. );
  325. PRIVATE
  326. VOID
  327. DumpTransmitDirFrameParms(
  328. DUMP_TABLE_PARMS
  329. );
  330. PRIVATE
  331. VOID
  332. DumpTransmitIFrameParms(
  333. DUMP_TABLE_PARMS
  334. );
  335. PRIVATE
  336. VOID
  337. DumpTransmitTestCmdParms(
  338. DUMP_TABLE_PARMS
  339. );
  340. PRIVATE
  341. VOID
  342. DumpTransmitUiFrameParms(
  343. DUMP_TABLE_PARMS
  344. );
  345. PRIVATE
  346. VOID
  347. DumpTransmitXidCmdParms(
  348. DUMP_TABLE_PARMS
  349. );
  350. PRIVATE
  351. VOID
  352. DumpTransmitXidRespFinalParms(
  353. DUMP_TABLE_PARMS
  354. );
  355. PRIVATE
  356. VOID
  357. DumpTransmitXidRespNotFinalParms(
  358. DUMP_TABLE_PARMS
  359. );
  360. PRIVATE
  361. VOID
  362. DumpTransmitParms(
  363. DUMP_TABLE_PARMS
  364. );
  365. PRIVATE
  366. VOID
  367. DumpTransmitQueue(
  368. IN DOS_ADDRESS dpQueue
  369. );
  370. PRIVATE
  371. LPSTR
  372. MapMessageType(
  373. UCHAR MessageType
  374. );
  375. VOID
  376. DumpData(
  377. IN LPSTR Title,
  378. IN PBYTE Address,
  379. IN DWORD Length,
  380. IN DWORD Options,
  381. IN DWORD Indent,
  382. IN BOOL IsDos,
  383. IN WORD Segment,
  384. IN WORD Offset
  385. );
  386. PRIVATE
  387. LPSTR
  388. MapAdapterType(
  389. IN ADAPTER_TYPE AdapterType
  390. );
  391. //
  392. // explanations of error codes returned in CCB_RETCODE fields. Explanations
  393. // taken more-or-less verbatim from IBM Local Area Network Technical Reference
  394. // table B-1 ppB-2 to B-5. Includes all errors, even not relevant to CCB1
  395. //
  396. static LPSTR CcbRetcodeExplanations[] = {
  397. "Success",
  398. "Invalid command code",
  399. "Duplicate command, one already outstanding",
  400. "Adapter open, should be closed",
  401. "Adapter closed, should be open",
  402. "Required parameter missing",
  403. "Invalid/incompatible option",
  404. "Command cancelled - unrecoverable failure",
  405. "Unauthorized access priority",
  406. "Adapter not initialized, should be",
  407. "Command cancelled by user request",
  408. "Command cancelled, adapter closed while command in progress",
  409. "Command completed Ok, adapter not open",
  410. "Invalid error code 0x0D",
  411. "Invalid error code 0x0E",
  412. "Invalid error code 0x0F",
  413. "Adapter open, NetBIOS not operational",
  414. "Error in DIR.TIMER.SET or DIR.TIMER.CANCEL",
  415. "Available work area exceeded",
  416. "Invalid LOG.ID",
  417. "Invalid shared RAM segment or size",
  418. "Lost log data, buffer too small, log reset",
  419. "Requested buffer size exceeds pool length",
  420. "Command invalid, NetBIOS operational",
  421. "Invalid SAP buffer length",
  422. "Inadequate buffers available for request",
  423. "USER_LENGTH value too large for buffer length",
  424. "The CCB_PARM_TAB pointer is invalid",
  425. "A pointer in the CCB parameter table is invalid",
  426. "Invalid CCB_ADAPTER value",
  427. "Invalid functional address",
  428. "Invalid error code 0x1F",
  429. "Lost data on receive, no buffers available",
  430. "Lost data on receive, inadequate buffer space",
  431. "Error on frame transmission, check TRANSMIT_FS data",
  432. "Error on frame transmit or strip process",
  433. "Unauthorized MAC frame",
  434. "Maximum number of commands exceeded",
  435. "Unrecognized command correlator",
  436. "Link not transmitting I frames, state changed from link opened",
  437. "Invalid transmit frame length",
  438. "Invalid error code 0x29",
  439. "Invalid error code 0x2a",
  440. "Invalid error code 0x2b",
  441. "Invalid error code 0x2c",
  442. "Invalid error code 0x2d",
  443. "Invalid error code 0x2e",
  444. "Invalid error code 0x2f",
  445. "Inadequate receive buffers for adapter to open",
  446. "Invalid error code 0x31",
  447. "Invalid NODE_ADDRESS",
  448. "Invalid adapter receive buffer length defined",
  449. "Invalid adapter transmit buffer length defined",
  450. "Invalid error code 0x35",
  451. "Invalid error code 0x36",
  452. "Invalid error code 0x37",
  453. "Invalid error code 0x38",
  454. "Invalid error code 0x39",
  455. "Invalid error code 0x3a",
  456. "Invalid error code 0x3b",
  457. "Invalid error code 0x3c",
  458. "Invalid error code 0x3d",
  459. "Invalid error code 0x3e",
  460. "Invalid error code 0x3f",
  461. "Invalid STATION_ID",
  462. "Protocol error, link in invalid state for command",
  463. "Parameter exceeded maximum allowed",
  464. "Invalid SAP value or value already in use",
  465. "Invalid routing information field",
  466. "Requested group membership in non-existent group SAP",
  467. "Resources not available",
  468. "Sap cannot close unless all link stations are closed",
  469. "Group SAP cannot close, individual SAPs not closed",
  470. "Group SAP has reached maximum membership",
  471. "Sequence error, incompatible command in progress",
  472. "Station closed without remote acknowledgement",
  473. "Sequence error, cannot close, DLC commands outstanding",
  474. "Unsuccessful link station connection attempted",
  475. "Member SAP not found in group SAP list",
  476. "Invalid remote address, may not be a group address",
  477. "Invalid pointer in CCB_POINTER field",
  478. "Invalid error code 0x51",
  479. "Invalid application program ID",
  480. "Invalid application program key code",
  481. "Invalid system key code",
  482. "Buffer is smaller than buffer size given in DLC.OPEN.SAP",
  483. "Adapter's system process is not installed",
  484. "Inadequate stations available",
  485. "Invalid CCB_PARAMETER_1 parameter",
  486. "Inadequate queue elements to satisfy request",
  487. "Initialization failure, cannot open adapter",
  488. "Error detected in chained READ command",
  489. "Direct stations not assigned to application program",
  490. "Dd interface not installed",
  491. "Requested adapter is not installed",
  492. "Chained CCBs must all be for same adapter",
  493. "Adapter initializing, command not accepted",
  494. "Number of allowed application programs has been exceeded",
  495. "Command cancelled by system action",
  496. "Direct stations not available",
  497. "Invalid DDNAME parameter",
  498. "Inadequate GDT selectors to satisfy request",
  499. "Invalid error code 0x66",
  500. "Command cancelled, CCB resources purged",
  501. "Application program ID not valid for interface",
  502. "Segment associated with request cannot be locked"
  503. };
  504. #define NUMBER_OF_ERROR_MESSAGES ARRAY_ELEMENTS(CcbRetcodeExplanations)
  505. #define LAST_DLC_ERROR_CODE LAST_ELEMENT(CcbRetcodeExplanations)
  506. VOID
  507. DbgOut(
  508. IN LPSTR Format,
  509. IN ...
  510. )
  511. /*++
  512. Routine Description:
  513. Sends formatted debug output to desired output device. If DEBUG_TO_FILE
  514. was specified in VR environment flags, output goes to VRDEBUG.LOG in
  515. current directory, else to standard debug output via DbgPrint
  516. Arguments:
  517. Format - printf-style format string
  518. ... - variable args
  519. Return Value:
  520. None.
  521. --*/
  522. {
  523. va_list list;
  524. char buffer[2048];
  525. va_start(list, Format);
  526. vsprintf(buffer, Format, list);
  527. va_end(list);
  528. if (hVrDebugLog) {
  529. fputs(buffer, hVrDebugLog);
  530. } else {
  531. DbgPrint(buffer);
  532. }
  533. }
  534. VOID
  535. DbgOutStr(
  536. IN LPSTR Str
  537. )
  538. /*++
  539. Routine Description:
  540. Sends formatted debug output to desired output device. If DEBUG_TO_FILE
  541. was specified in VR environment flags, output goes to VRDEBUG.LOG in
  542. current directory, else to standard debug output via DbgPrint
  543. Arguments:
  544. Str - string to print
  545. Return Value:
  546. None.
  547. --*/
  548. {
  549. if (hVrDebugLog) {
  550. fputs(Str, hVrDebugLog);
  551. } else {
  552. DbgPrint(Str);
  553. }
  554. }
  555. VOID
  556. DumpCcb(
  557. IN PVOID Ccb,
  558. IN BOOL DumpAll,
  559. IN BOOL CcbIsInput,
  560. IN BOOL IsDos,
  561. IN WORD Segment OPTIONAL,
  562. IN WORD Offset OPTIONAL
  563. )
  564. /*++
  565. Routine Description:
  566. Dumps (to debug terminal) a CCB and any associated parameter table. Also
  567. displays the symbolic CCB command and an error code description if the
  568. CCB is being returned to the caller. Dumps in either DOS format (segmented
  569. 16-bit pointers) or NT format (flat 32-bit pointers)
  570. Arguments:
  571. Ccb - flat 32-bit pointer to CCB1 or CCB2 to dump
  572. DumpAll - if TRUE, dumps parameter tables and buffers, else just CCB
  573. CcbIsInput - if TRUE, CCB is from user: don't display error code explanation
  574. IsDos - if TRUE, CCB is DOS format
  575. Segment - if IsDos is TRUE, segment of CCB in VDM
  576. Offset - if IsDos is TRUE, offset of CCB in VDM
  577. Return Value:
  578. None.
  579. --*/
  580. {
  581. PVOID parmtab = NULL;
  582. LPSTR cmdname = "UNKNOWN CCB!";
  583. PLLC_CCB NtCcb = (PLLC_CCB)Ccb;
  584. PLLC_DOS_CCB DosCcb = (PLLC_DOS_CCB)Ccb;
  585. BOOL haveParms = FALSE;
  586. VOID (*DumpParms)(PVOID, BOOL, BOOL, WORD, WORD) = DefaultParameterTableDump;
  587. PVOID parameterTable = NULL;
  588. WORD seg;
  589. WORD off;
  590. BOOL parmsInCcb = FALSE;
  591. switch (((PLLC_CCB)Ccb)->uchDlcCommand) {
  592. case LLC_BUFFER_FREE:
  593. cmdname = "BUFFER.FREE";
  594. haveParms = TRUE;
  595. DumpParms = DumpBufferFreeParms;
  596. break;
  597. case LLC_BUFFER_GET:
  598. cmdname = "BUFFER.GET";
  599. haveParms = TRUE;
  600. DumpParms = DumpBufferGetParms;
  601. break;
  602. case LLC_DIR_CLOSE_ADAPTER:
  603. cmdname = "DIR.CLOSE.ADAPTER";
  604. haveParms = TRUE;
  605. DumpParms = DumpDirCloseAdapterParms;
  606. parmsInCcb = TRUE;
  607. break;
  608. case LLC_DIR_CLOSE_DIRECT:
  609. cmdname = "DIR.CLOSE.DIRECT";
  610. break;
  611. case 0x2b:
  612. //
  613. // not supported ! (yet?)
  614. //
  615. cmdname = "DIR.DEFINE.MIF.ENVIRONMENT";
  616. haveParms = TRUE;
  617. break;
  618. case LLC_DIR_INITIALIZE:
  619. cmdname = "DIR.INITIALIZE";
  620. haveParms = TRUE;
  621. DumpParms = DumpDirInitializeParms;
  622. break;
  623. case LLC_DIR_INTERRUPT:
  624. cmdname = "DIR.INTERRUPT";
  625. break;
  626. case LLC_DIR_MODIFY_OPEN_PARMS:
  627. cmdname = "DIR.MODIFY.OPEN.PARMS";
  628. haveParms = TRUE;
  629. break;
  630. case LLC_DIR_OPEN_ADAPTER:
  631. cmdname = "DIR.OPEN.ADAPTER";
  632. haveParms = TRUE;
  633. DumpParms = DumpDirOpenAdapterParms;
  634. break;
  635. case LLC_DIR_OPEN_DIRECT:
  636. //
  637. // not supported from DOS!
  638. //
  639. cmdname = "DIR.OPEN.DIRECT";
  640. haveParms = TRUE;
  641. break;
  642. case LLC_DIR_READ_LOG:
  643. cmdname = "DIR.READ.LOG";
  644. haveParms = TRUE;
  645. break;
  646. case LLC_DIR_RESTORE_OPEN_PARMS:
  647. cmdname = "DIR.RESTORE.OPEN.PARMS";
  648. break;
  649. case LLC_DIR_SET_FUNCTIONAL_ADDRESS:
  650. cmdname = "DIR.SET.FUNCTIONAL.ADDRESS";
  651. haveParms = TRUE;
  652. DumpParms = DumpDirSetFunctionalAddressParms;
  653. parmsInCcb = TRUE;
  654. break;
  655. case LLC_DIR_SET_GROUP_ADDRESS:
  656. cmdname = "DIR.SET.GROUP.ADDRESS";
  657. haveParms = TRUE;
  658. DumpParms = DumpDirSetGroupAddressParms;
  659. parmsInCcb = TRUE;
  660. break;
  661. case LLC_DIR_SET_USER_APPENDAGE:
  662. cmdname = "DIR.SET.USER.APPENDAGE";
  663. haveParms = TRUE;
  664. DumpParms = DumpDirSetUserAppendageParms;
  665. break;
  666. case LLC_DIR_STATUS:
  667. cmdname = "DIR.STATUS";
  668. haveParms = TRUE;
  669. DumpParms = DumpDirStatusParms;
  670. break;
  671. case LLC_DIR_TIMER_CANCEL:
  672. cmdname = "DIR.TIMER.CANCEL";
  673. haveParms = TRUE;
  674. DumpParms = DumpDirTimerCancelParms;
  675. parmsInCcb = TRUE;
  676. break;
  677. case LLC_DIR_TIMER_CANCEL_GROUP:
  678. cmdname = "DIR.TIMER.CANCEL.GROUP";
  679. haveParms = TRUE;
  680. DumpParms = DumpDirTimerCancelGroupParms;
  681. parmsInCcb = TRUE;
  682. break;
  683. case LLC_DIR_TIMER_SET:
  684. cmdname = "DIR.TIMER.SET";
  685. haveParms = TRUE;
  686. DumpParms = DumpDirTimerSetParms;
  687. parmsInCcb = TRUE;
  688. break;
  689. case LLC_DLC_CLOSE_SAP:
  690. cmdname = "DLC.CLOSE.SAP";
  691. haveParms = TRUE;
  692. DumpParms = DumpDlcCloseSapParms;
  693. parmsInCcb = TRUE;
  694. break;
  695. case LLC_DLC_CLOSE_STATION:
  696. cmdname = "DLC.CLOSE.STATION";
  697. haveParms = TRUE;
  698. DumpParms = DumpDlcCloseStationParms;
  699. parmsInCcb = TRUE;
  700. break;
  701. case LLC_DLC_CONNECT_STATION:
  702. cmdname = "DLC.CONNECT.STATION";
  703. haveParms = TRUE;
  704. DumpParms = DumpDlcConnectStationParms;
  705. break;
  706. case LLC_DLC_FLOW_CONTROL:
  707. cmdname = "DLC.FLOW.CONTROL";
  708. haveParms = TRUE;
  709. DumpParms = DumpDlcFlowControlParms;
  710. parmsInCcb = TRUE;
  711. break;
  712. case LLC_DLC_MODIFY:
  713. cmdname = "DLC.MODIFY";
  714. haveParms = TRUE;
  715. break;
  716. case LLC_DLC_OPEN_SAP:
  717. cmdname = "DLC.OPEN.SAP";
  718. haveParms = TRUE;
  719. DumpParms = DumpDlcOpenSapParms;
  720. break;
  721. case LLC_DLC_OPEN_STATION:
  722. cmdname = "DLC.OPEN.STATION";
  723. haveParms = TRUE;
  724. DumpParms = DumpDlcOpenStationParms;
  725. break;
  726. case LLC_DLC_REALLOCATE_STATIONS:
  727. cmdname = "DLC.REALLOCATE";
  728. haveParms = TRUE;
  729. break;
  730. case LLC_DLC_RESET:
  731. cmdname = "DLC.RESET";
  732. haveParms = TRUE;
  733. DumpParms = DumpDlcResetParms;
  734. parmsInCcb = TRUE;
  735. break;
  736. case LLC_DLC_SET_THRESHOLD:
  737. cmdname = "DLC.SET.THRESHOLD";
  738. haveParms = TRUE;
  739. break;
  740. case LLC_DLC_STATISTICS:
  741. cmdname = "DLC.STATISTICS";
  742. haveParms = TRUE;
  743. break;
  744. case 0x25:
  745. //
  746. // not supported !
  747. //
  748. cmdname = "PDT.TRACE.OFF";
  749. break;
  750. case 0x24:
  751. //
  752. // not supported !
  753. //
  754. cmdname = "PDT.TRACE.ON";
  755. break;
  756. case LLC_READ:
  757. cmdname = "READ";
  758. haveParms = TRUE;
  759. DumpParms = DumpReadParms;
  760. break;
  761. case LLC_READ_CANCEL:
  762. cmdname = "READ.CANCEL";
  763. break;
  764. case LLC_RECEIVE:
  765. cmdname = "RECEIVE";
  766. haveParms = TRUE;
  767. DumpParms = DumpReceiveParms;
  768. break;
  769. case LLC_RECEIVE_CANCEL:
  770. cmdname = "RECEIVE.CANCEL";
  771. haveParms = TRUE;
  772. DumpParms = DumpReceiveCancelParms;
  773. parmsInCcb = TRUE;
  774. break;
  775. case LLC_RECEIVE_MODIFY:
  776. cmdname = "RECEIVE.MODIFY";
  777. haveParms = TRUE;
  778. DumpParms = DumpReceiveModifyParms;
  779. break;
  780. case LLC_TRANSMIT_DIR_FRAME:
  781. cmdname = "TRANSMIT.DIR.FRAME";
  782. haveParms = TRUE;
  783. DumpParms = DumpTransmitDirFrameParms;
  784. break;
  785. case LLC_TRANSMIT_I_FRAME:
  786. cmdname = "TRANSMIT.I.FRAME";
  787. haveParms = TRUE;
  788. DumpParms = DumpTransmitIFrameParms;
  789. break;
  790. case LLC_TRANSMIT_TEST_CMD:
  791. cmdname = "TRANSMIT.TEST.CMD";
  792. haveParms = TRUE;
  793. DumpParms = DumpTransmitTestCmdParms;
  794. break;
  795. case LLC_TRANSMIT_UI_FRAME:
  796. cmdname = "TRANSMIT.UI.FRAME";
  797. haveParms = TRUE;
  798. DumpParms = DumpTransmitUiFrameParms;
  799. break;
  800. case LLC_TRANSMIT_XID_CMD:
  801. cmdname = "TRANSMIT.XID.CMD";
  802. haveParms = TRUE;
  803. DumpParms = DumpTransmitXidCmdParms;
  804. break;
  805. case LLC_TRANSMIT_XID_RESP_FINAL:
  806. cmdname = "TRANSMIT.XID.RESP.FINAL";
  807. haveParms = TRUE;
  808. DumpParms = DumpTransmitXidRespFinalParms;
  809. break;
  810. case LLC_TRANSMIT_XID_RESP_NOT_FINAL:
  811. cmdname = "TRANSMIT.XID.RESP.NOT.FINAL";
  812. haveParms = TRUE;
  813. DumpParms = DumpTransmitXidRespNotFinalParms;
  814. break;
  815. }
  816. if (IsDos) {
  817. seg = GET_SELECTOR(&DosCcb->u.pParms);
  818. off = GET_OFFSET(&DosCcb->u.pParms);
  819. parmtab = POINTER_FROM_WORDS(seg, off);
  820. } else {
  821. parmtab = NtCcb->u.pParameterTable;
  822. }
  823. if (IsDos) {
  824. PLLC_DOS_CCB DosCcb = (PLLC_DOS_CCB)Ccb;
  825. DBGPRINT( "\n"
  826. "------------------------------------------------------------------------------"
  827. "\n"
  828. );
  829. IF_DEBUG(TIME) {
  830. SYSTEMTIME timestruct;
  831. GetLocalTime(&timestruct);
  832. DBGPRINT(
  833. "%02d:%02d:%02d.%03d\n",
  834. timestruct.wHour,
  835. timestruct.wMinute,
  836. timestruct.wSecond,
  837. timestruct.wMilliseconds
  838. );
  839. }
  840. DBGPRINT( "%s DOS CCB @%04x:%04x:\n"
  841. "adapter %02x\n"
  842. "command %02x [%s]\n"
  843. "retcode %02x [%s]\n"
  844. "reserved %02x\n"
  845. "next %04x:%04x\n"
  846. "ANR %04x:%04x\n",
  847. CcbIsInput ? "INPUT" : "OUTPUT",
  848. Segment,
  849. Offset,
  850. DosCcb->uchAdapterNumber,
  851. DosCcb->uchDlcCommand,
  852. cmdname,
  853. DosCcb->uchDlcStatus,
  854. CcbIsInput ? "" : MapCcbRetcode(DosCcb->uchDlcStatus),
  855. DosCcb->uchReserved1,
  856. GET_SEGMENT(&DosCcb->pNext),
  857. GET_OFFSET(&DosCcb->pNext),
  858. GET_SEGMENT(&DosCcb->ulCompletionFlag),
  859. GET_OFFSET(&DosCcb->ulCompletionFlag)
  860. );
  861. if (haveParms) {
  862. if (!parmsInCcb) {
  863. DBGPRINT(
  864. "parms %04x:%04x\n",
  865. GET_SEGMENT(&DosCcb->u.pParms),
  866. GET_OFFSET(&DosCcb->u.pParms)
  867. );
  868. parameterTable = POINTER_FROM_WORDS(GET_SEGMENT(&DosCcb->u.pParms),
  869. GET_OFFSET(&DosCcb->u.pParms)
  870. );
  871. } else {
  872. parameterTable = (PVOID)READ_DWORD(&DosCcb->u.ulParameter);
  873. }
  874. }
  875. } else {
  876. PLLC_CCB NtCcb = (PLLC_CCB)Ccb;
  877. DBGPRINT( "\n"
  878. "------------------------------------------------------------------------------"
  879. "\n"
  880. );
  881. IF_DEBUG(TIME) {
  882. SYSTEMTIME timestruct;
  883. GetLocalTime(&timestruct);
  884. DBGPRINT(
  885. "%02d:%02d:%02d.%03d\n",
  886. timestruct.wHour,
  887. timestruct.wMinute,
  888. timestruct.wSecond,
  889. timestruct.wMilliseconds
  890. );
  891. }
  892. DBGPRINT( "%s NT CCB @ %#8x\n"
  893. "adapter %02x\n"
  894. "command %02x [%s]\n"
  895. "retcode %02x [%s]\n"
  896. "reserved %02x\n"
  897. "next %08x\n"
  898. "ANR %08x\n",
  899. CcbIsInput ? "INPUT" : "OUTPUT",
  900. Ccb,
  901. NtCcb->uchAdapterNumber,
  902. NtCcb->uchDlcCommand,
  903. cmdname,
  904. NtCcb->uchDlcStatus,
  905. CcbIsInput ? "" : MapCcbRetcode(NtCcb->uchDlcStatus),
  906. NtCcb->uchReserved1,
  907. NtCcb->pNext,
  908. NtCcb->ulCompletionFlag
  909. );
  910. if (haveParms) {
  911. if (!parmsInCcb) {
  912. DBGPRINT(
  913. "parms %08x\n",
  914. NtCcb->u.pParameterTable
  915. );
  916. }
  917. parameterTable = NtCcb->u.pParameterTable;
  918. }
  919. DBGPRINT(
  920. "hEvent %08x\n"
  921. "reserved %02x\n"
  922. "readflag %02x\n"
  923. "reserved %04x\n",
  924. NtCcb->hCompletionEvent,
  925. NtCcb->uchReserved2,
  926. NtCcb->uchReadFlag,
  927. NtCcb->usReserved3
  928. );
  929. }
  930. if ((parameterTable && DumpAll) || parmsInCcb) {
  931. DumpParms(parameterTable, IsDos, CcbIsInput, seg, off);
  932. }
  933. }
  934. VOID
  935. DumpDosDlcBufferPool(
  936. IN PDOS_DLC_BUFFER_POOL PoolDescriptor
  937. )
  938. /*++
  939. Routine Description:
  940. Dumps a DOS DLC buffer pool so we can see that it looks ok
  941. Arguments:
  942. PoolDescriptor - pointer to DOS_DLC_BUFFER_POOL structure
  943. Return Value:
  944. None.
  945. --*/
  946. {
  947. int count = PoolDescriptor->BufferCount;
  948. DBGPRINT( "DOS DLC Buffer Pool @%04x:%04x, BufferSize=%d, BufferCount=%d\n",
  949. HIWORD(PoolDescriptor->dpBuffer),
  950. LOWORD(PoolDescriptor->dpBuffer),
  951. PoolDescriptor->BufferSize,
  952. PoolDescriptor->BufferCount
  953. );
  954. DumpDosDlcBufferChain(PoolDescriptor->dpBuffer, PoolDescriptor->BufferCount);
  955. }
  956. VOID
  957. DumpDosDlcBufferChain(
  958. IN DOS_ADDRESS DosAddress,
  959. IN DWORD BufferCount
  960. )
  961. /*++
  962. Routine Description:
  963. Dumps a chain of DOS buffers
  964. Arguments:
  965. DosAddress - address of buffer in VDM memory in DOS_ADDRESS format (16:16)
  966. BufferCount - number of buffers to dump
  967. Return Value:
  968. None.
  969. --*/
  970. {
  971. WORD seg = HIWORD(DosAddress);
  972. WORD off = LOWORD(DosAddress);
  973. LPVOID pointer = DOS_PTR_TO_FLAT(DosAddress);
  974. int i;
  975. for (i = 1; BufferCount; --BufferCount, ++i) {
  976. DBGPRINT("Buffer % 3d: %04x:%04x, Next Buffer @%04x:%04x\n",
  977. i,
  978. seg, off,
  979. (DWORD)GET_SELECTOR(&((PLLC_DOS_BUFFER)pointer)->pNext),
  980. (DWORD)GET_OFFSET(&((PLLC_DOS_BUFFER)pointer)->pNext)
  981. );
  982. seg = GET_SELECTOR(&((PLLC_DOS_BUFFER)pointer)->pNext);
  983. off = GET_OFFSET(&((PLLC_DOS_BUFFER)pointer)->pNext);
  984. IF_DEBUG(DUMP_FREE_BUF) {
  985. PLLC_DOS_BUFFER pBuf = (PLLC_DOS_BUFFER)pointer;
  986. DBGPRINT(
  987. "next buffer %04x:%04x\n"
  988. "frame length %04x\n"
  989. "data length %04x\n"
  990. "user offset %04x\n"
  991. "user length %04x\n"
  992. "station id %04x\n"
  993. "options %02x\n"
  994. "message type %02x\n"
  995. "buffers left %04x\n"
  996. "rcv FS %02x\n"
  997. "adapter num %02x\n"
  998. "\n",
  999. GET_SEGMENT(&pBuf->Contiguous.pNextBuffer),
  1000. GET_OFFSET(&pBuf->Contiguous.pNextBuffer),
  1001. READ_WORD(&pBuf->Contiguous.cbFrame),
  1002. READ_WORD(&pBuf->Contiguous.cbBuffer),
  1003. READ_WORD(&pBuf->Contiguous.offUserData),
  1004. READ_WORD(&pBuf->Contiguous.cbUserData),
  1005. READ_WORD(&pBuf->Contiguous.usStationId),
  1006. pBuf->Contiguous.uchOptions,
  1007. pBuf->Contiguous.uchMsgType,
  1008. READ_WORD(&pBuf->Contiguous.cBuffersLeft),
  1009. pBuf->Contiguous.uchRcvFS,
  1010. pBuf->Contiguous.uchAdapterNumber
  1011. );
  1012. }
  1013. pointer = READ_FAR_POINTER(&((PLLC_DOS_BUFFER)pointer)->pNext);
  1014. }
  1015. }
  1016. LPSTR
  1017. MapCcbRetcode(
  1018. IN BYTE Retcode
  1019. )
  1020. /*++
  1021. Routine Description:
  1022. Returns string describing error code
  1023. Arguments:
  1024. Retcode - CCB_RETCODE
  1025. Return Value:
  1026. LPSTR
  1027. --*/
  1028. {
  1029. static char errbuf[128];
  1030. if (Retcode == LLC_STATUS_PENDING) {
  1031. return "Command in progress";
  1032. } else if (Retcode > NUMBER_OF_ERROR_MESSAGES) {
  1033. sprintf(errbuf, "*** Invalid error code 0x%2x ***", Retcode);
  1034. return errbuf;
  1035. }
  1036. return CcbRetcodeExplanations[Retcode];
  1037. }
  1038. PRIVATE
  1039. VOID
  1040. DefaultParameterTableDump(
  1041. DUMP_TABLE_PARMS
  1042. )
  1043. /*++
  1044. Routine Description:
  1045. Displays default message for CCBs which have parameter tables that don't
  1046. have a dump routine yet
  1047. Arguments:
  1048. Parameters - pointer to parameter table
  1049. IsDos - if TRUE parameters in DOS (16:16) format
  1050. Segment - if IsDos is TRUE, segment of CCB in VDM
  1051. Offset - if IsDos is TRUE, offset of CCB in VDM
  1052. Return Value:
  1053. None.
  1054. --*/
  1055. {
  1056. DBGPRINT("Parameter table dump not implemented for this CCB\n");
  1057. }
  1058. PRIVATE
  1059. VOID
  1060. DumpParameterTableHeader(
  1061. IN LPSTR CommandName,
  1062. IN PVOID Table,
  1063. IN BOOL IsDos,
  1064. IN WORD Segment,
  1065. IN WORD Offset
  1066. )
  1067. /*++
  1068. Routine Description:
  1069. Displays header for parameter table dump. Displays address in DOS or NT
  1070. format (32-bit flat or 16:16)
  1071. Arguments:
  1072. CommandName - name of command which owns parameter table
  1073. Table - flat 32-bit address of parameter table
  1074. IsDos - if TRUE, use Segment:Offset in display
  1075. Segment - if IsDos is TRUE, segment of parameter table in VDM
  1076. Offset - if IsDos is TRUE, offset of parameter table in VDM
  1077. Return Value:
  1078. None.
  1079. --*/
  1080. {
  1081. DBGPRINT( IsDos ? "\n%s parameter table @%04x:%04x\n"
  1082. : "\n%s parameter table @%08x\n",
  1083. CommandName,
  1084. IsDos ? (DWORD)Segment : (DWORD)Table,
  1085. IsDos ? (DWORD)Offset : 0
  1086. );
  1087. }
  1088. PRIVATE
  1089. VOID
  1090. DumpBufferFreeParms(
  1091. DUMP_TABLE_PARMS
  1092. )
  1093. {
  1094. PLLC_BUFFER_FREE_PARMS parms = (PLLC_BUFFER_FREE_PARMS)Parameters;
  1095. DumpParameterTableHeader("BUFFER.FREE", Parameters, IsDos, Segment, Offset);
  1096. DBGPRINT( "station id %04x\n"
  1097. "buffers left %04x\n"
  1098. "reserved %02x %02x %02x %02x\n",
  1099. READ_WORD(&parms->usReserved1),
  1100. READ_WORD(&parms->cBuffersLeft),
  1101. ((PBYTE)&(parms->ulReserved))[0],
  1102. ((PBYTE)&(parms->ulReserved))[1],
  1103. ((PBYTE)&(parms->ulReserved))[2],
  1104. ((PBYTE)&(parms->ulReserved))[3]
  1105. );
  1106. if (IsDos) {
  1107. DBGPRINT(
  1108. "first buffer %04x:%04x\n",
  1109. GET_SELECTOR(&parms->pFirstBuffer),
  1110. GET_OFFSET(&parms->pFirstBuffer)
  1111. );
  1112. } else {
  1113. DBGPRINT(
  1114. "first buffer %08x\n", parms->pFirstBuffer);
  1115. }
  1116. }
  1117. PRIVATE
  1118. VOID
  1119. DumpBufferGetParms(
  1120. DUMP_TABLE_PARMS
  1121. )
  1122. {
  1123. //
  1124. // Antti's definition different from that in manual, so use IBM def.
  1125. //
  1126. typedef struct {
  1127. WORD StationId;
  1128. WORD BufferLeft;
  1129. BYTE BufferGet;
  1130. BYTE Reserved[3];
  1131. DWORD FirstBuffer;
  1132. } CCB1_BUFFER_GET_PARMS, *PCCB1_BUFFER_GET_PARMS;
  1133. PCCB1_BUFFER_GET_PARMS parms = (PCCB1_BUFFER_GET_PARMS)Parameters;
  1134. DumpParameterTableHeader("BUFFER.GET", Parameters, IsDos, Segment, Offset);
  1135. DBGPRINT( "station id %04x\n"
  1136. "buffers left %04x\n"
  1137. "buffers get %02x\n"
  1138. "reserved %02x %02x %02x\n",
  1139. READ_WORD(&parms->StationId),
  1140. READ_WORD(&parms->BufferLeft),
  1141. parms->BufferGet,
  1142. parms->Reserved[0],
  1143. parms->Reserved[1],
  1144. parms->Reserved[2]
  1145. );
  1146. if (IsDos) {
  1147. DBGPRINT(
  1148. "first buffer %04x:%04x\n",
  1149. GET_SELECTOR(&parms->FirstBuffer),
  1150. GET_OFFSET(&parms->FirstBuffer)
  1151. );
  1152. } else {
  1153. DBGPRINT(
  1154. "first buffer %08x\n", parms->FirstBuffer);
  1155. }
  1156. }
  1157. PRIVATE
  1158. VOID
  1159. DumpDirCloseAdapterParms(
  1160. DUMP_TABLE_PARMS
  1161. )
  1162. {
  1163. UNREFERENCED_PARAMETER(IsDos);
  1164. UNREFERENCED_PARAMETER(Segment);
  1165. UNREFERENCED_PARAMETER(Offset);
  1166. DBGPRINT( "lock code %04x\n", LOWORD(Parameters));
  1167. }
  1168. PRIVATE
  1169. VOID
  1170. DumpDirDefineMifEnvironmentParms(
  1171. DUMP_TABLE_PARMS
  1172. )
  1173. {
  1174. }
  1175. PRIVATE
  1176. VOID
  1177. DumpDirInitializeParms(
  1178. DUMP_TABLE_PARMS
  1179. )
  1180. {
  1181. //
  1182. // once again, invent a structure to reflect the DOS CCB parameter table
  1183. // as defined in the IBM LAN tech ref
  1184. //
  1185. typedef struct {
  1186. WORD BringUps;
  1187. WORD SharedRam;
  1188. BYTE Reserved[4];
  1189. DWORD AdapterCheckAppendage;
  1190. DWORD NetworkStatusChangeAppendage;
  1191. DWORD IoErrorAppendage;
  1192. } CCB1_DIR_INITIALIZE_PARMS, *PCCB1_DIR_INITIALIZE_PARMS;
  1193. PCCB1_DIR_INITIALIZE_PARMS parms = (PCCB1_DIR_INITIALIZE_PARMS)Parameters;
  1194. DumpParameterTableHeader("DIR.INITIALIZE", Parameters, IsDos, Segment, Offset);
  1195. DBGPRINT( "bring ups %04x\n"
  1196. "shared RAM %04x\n"
  1197. "reserved %02x %02x %02x %02x\n"
  1198. "adap. check %04x:%04x\n"
  1199. "n/w status %04x:%04x\n"
  1200. "pc error %04x:%04x\n",
  1201. READ_WORD(&parms->BringUps),
  1202. READ_WORD(&parms->SharedRam),
  1203. parms->Reserved[0],
  1204. parms->Reserved[1],
  1205. parms->Reserved[2],
  1206. parms->Reserved[3],
  1207. GET_SEGMENT(&parms->AdapterCheckAppendage),
  1208. GET_OFFSET(&parms->AdapterCheckAppendage),
  1209. GET_SEGMENT(&parms->NetworkStatusChangeAppendage),
  1210. GET_OFFSET(&parms->NetworkStatusChangeAppendage),
  1211. GET_SEGMENT(&parms->IoErrorAppendage),
  1212. GET_OFFSET(&parms->IoErrorAppendage)
  1213. );
  1214. }
  1215. PRIVATE
  1216. VOID
  1217. DumpDirModifyOpenParmsParms(
  1218. DUMP_TABLE_PARMS
  1219. )
  1220. {
  1221. }
  1222. PRIVATE
  1223. VOID
  1224. DumpDirOpenAdapterParms(
  1225. DUMP_TABLE_PARMS
  1226. )
  1227. {
  1228. PLLC_DOS_DIR_OPEN_ADAPTER_PARMS dosParms = (PLLC_DOS_DIR_OPEN_ADAPTER_PARMS)Parameters;
  1229. PLLC_DIR_OPEN_ADAPTER_PARMS ntParms = (PLLC_DIR_OPEN_ADAPTER_PARMS)Parameters;
  1230. DumpParameterTableHeader("DIR.OPEN.ADAPTER", Parameters, IsDos, Segment, Offset);
  1231. if (IsDos) {
  1232. PADAPTER_PARMS pAdapterParms = READ_FAR_POINTER(&dosParms->pAdapterParms);
  1233. PDIRECT_PARMS pDirectParms = READ_FAR_POINTER(&dosParms->pDirectParms);
  1234. PDLC_PARMS pDlcParms = READ_FAR_POINTER(&dosParms->pDlcParms);
  1235. PNCB_PARMS pNcbParms = READ_FAR_POINTER(&dosParms->pNcbParms);
  1236. ULPBYTE pProductId;
  1237. DWORD i;
  1238. DBGPRINT(
  1239. "adapter parms %04x:%04x\n"
  1240. "direct parms %04x:%04x\n"
  1241. "DLC parms %04x:%04x\n"
  1242. "NCB parms %04x:%04x\n",
  1243. GET_SEGMENT(&dosParms->pAdapterParms),
  1244. GET_OFFSET(&dosParms->pAdapterParms),
  1245. GET_SEGMENT(&dosParms->pDirectParms),
  1246. GET_OFFSET(&dosParms->pDirectParms),
  1247. GET_SEGMENT(&dosParms->pDlcParms),
  1248. GET_OFFSET(&dosParms->pDlcParms),
  1249. GET_SEGMENT(&dosParms->pNcbParms),
  1250. GET_OFFSET(&dosParms->pNcbParms)
  1251. );
  1252. if (pAdapterParms) {
  1253. DBGPRINT(
  1254. "\n"
  1255. "ADAPTER_PARMS @%04x:%04x\n"
  1256. "open error %04x\n"
  1257. "open options %04x\n"
  1258. "node address %02x-%02x-%02x-%02x-%02x-%02x\n"
  1259. "group address %08x\n"
  1260. "func. address %08x\n"
  1261. "# rcv buffers %04x\n"
  1262. "rcv buf len %04x\n"
  1263. "DHB len %04x\n"
  1264. "# DHBs %02x\n"
  1265. "Reserved %02x\n"
  1266. "Open Lock %04x\n"
  1267. "Product ID %04x:%04x\n",
  1268. GET_SEGMENT(&dosParms->pAdapterParms),
  1269. GET_OFFSET(&dosParms->pAdapterParms),
  1270. READ_WORD(&pAdapterParms->OpenErrorCode),
  1271. READ_WORD(&pAdapterParms->OpenOptions),
  1272. READ_BYTE(&pAdapterParms->NodeAddress[0]),
  1273. READ_BYTE(&pAdapterParms->NodeAddress[1]),
  1274. READ_BYTE(&pAdapterParms->NodeAddress[2]),
  1275. READ_BYTE(&pAdapterParms->NodeAddress[3]),
  1276. READ_BYTE(&pAdapterParms->NodeAddress[4]),
  1277. READ_BYTE(&pAdapterParms->NodeAddress[5]),
  1278. READ_DWORD(&pAdapterParms->GroupAddress),
  1279. READ_DWORD(&pAdapterParms->FunctionalAddress),
  1280. READ_WORD(&pAdapterParms->NumberReceiveBuffers),
  1281. READ_WORD(&pAdapterParms->ReceiveBufferLength),
  1282. READ_WORD(&pAdapterParms->DataHoldBufferLength),
  1283. READ_BYTE(&pAdapterParms->NumberDataHoldBuffers),
  1284. READ_BYTE(&pAdapterParms->Reserved),
  1285. READ_WORD(&pAdapterParms->OpenLock),
  1286. GET_SEGMENT(&pAdapterParms->ProductId),
  1287. GET_OFFSET(&pAdapterParms->ProductId)
  1288. );
  1289. pProductId = READ_FAR_POINTER(&pAdapterParms->ProductId);
  1290. if (pProductId) {
  1291. DBGPRINT("\nPRODUCT ID:\n");
  1292. for (i=0; i<18; ++i) {
  1293. DBGPRINT("%02x ", *pProductId++);
  1294. }
  1295. DBGPRINT("\n");
  1296. }
  1297. }
  1298. if (pDirectParms) {
  1299. DBGPRINT(
  1300. "\n"
  1301. "DIRECT_PARMS @%04x:%04x\n"
  1302. "dir buf size %04x\n"
  1303. "dir pool blx %04x\n"
  1304. "dir buf pool %04x:%04x\n"
  1305. "adap chk exit %04x:%04x\n"
  1306. "nw stat exit %04x:%04x\n"
  1307. "pc error exit %04x:%04x\n"
  1308. "adap wrk area %04x:%04x\n"
  1309. "adap wrk req. %04x\n"
  1310. "adap wrk act %04x\n",
  1311. GET_SEGMENT(&dosParms->pDirectParms),
  1312. GET_OFFSET(&dosParms->pDirectParms),
  1313. READ_WORD(&pDirectParms->DirectBufferSize),
  1314. READ_WORD(&pDirectParms->DirectPoolBlocks),
  1315. GET_SEGMENT(&pDirectParms->DirectBufferPool),
  1316. GET_OFFSET(&pDirectParms->DirectBufferPool),
  1317. GET_SEGMENT(&pDirectParms->AdapterCheckExit),
  1318. GET_OFFSET(&pDirectParms->AdapterCheckExit),
  1319. GET_SEGMENT(&pDirectParms->NetworkStatusExit),
  1320. GET_OFFSET(&pDirectParms->NetworkStatusExit),
  1321. GET_SEGMENT(&pDirectParms->PcErrorExit),
  1322. GET_OFFSET(&pDirectParms->PcErrorExit),
  1323. GET_SEGMENT(&pDirectParms->AdapterWorkArea),
  1324. GET_OFFSET(&pDirectParms->AdapterWorkArea),
  1325. READ_WORD(&pDirectParms->AdapterWorkAreaRequested),
  1326. READ_WORD(&pDirectParms->AdapterWorkAreaActual)
  1327. );
  1328. }
  1329. if (pDlcParms) {
  1330. DBGPRINT(
  1331. "\n"
  1332. "DLC_PARMS @%04x:%04x\n"
  1333. "max SAPs %02x\n"
  1334. "max links %02x\n"
  1335. "max grp SAPs %02x\n"
  1336. "max grp memb %02x\n"
  1337. "T1 tick 1 %02x\n"
  1338. "T2 tick 1 %02x\n"
  1339. "Ti tick 1 %02x\n"
  1340. "T1 tick 2 %02x\n"
  1341. "T2 tick 2 %02x\n"
  1342. "Ti tick 2 %02x\n",
  1343. GET_SEGMENT(&dosParms->pDlcParms),
  1344. GET_OFFSET(&dosParms->pDlcParms),
  1345. READ_BYTE(&pDlcParms->MaxSaps),
  1346. READ_BYTE(&pDlcParms->MaxStations),
  1347. READ_BYTE(&pDlcParms->MaxGroupSaps),
  1348. READ_BYTE(&pDlcParms->MaxGroupMembers),
  1349. READ_BYTE(&pDlcParms->T1Tick1),
  1350. READ_BYTE(&pDlcParms->T2Tick1),
  1351. READ_BYTE(&pDlcParms->TiTick1),
  1352. READ_BYTE(&pDlcParms->T1Tick2),
  1353. READ_BYTE(&pDlcParms->T2Tick2),
  1354. READ_BYTE(&pDlcParms->TiTick2)
  1355. );
  1356. }
  1357. if (pNcbParms) {
  1358. DBGPRINT(
  1359. "\n"
  1360. "NCB_PARMS @%04x:%04x???\n",
  1361. GET_SEGMENT(&dosParms->pNcbParms),
  1362. GET_OFFSET(&dosParms->pNcbParms)
  1363. );
  1364. }
  1365. } else {
  1366. PLLC_ADAPTER_OPEN_PARMS pAdapterParms = ntParms->pAdapterParms;
  1367. PLLC_EXTENDED_ADAPTER_PARMS pExtendedParms = ntParms->pExtendedParms;
  1368. PLLC_DLC_PARMS pDlcParms = ntParms->pDlcParms;
  1369. PVOID pNcbParms = ntParms->pReserved1;
  1370. DBGPRINT(
  1371. "adapter parms %08x\n"
  1372. "direct parms %08x\n"
  1373. "DLC parms %08x\n"
  1374. "NCB parms %08x\n",
  1375. pAdapterParms,
  1376. pExtendedParms,
  1377. pDlcParms,
  1378. pNcbParms
  1379. );
  1380. if (pAdapterParms) {
  1381. DBGPRINT(
  1382. "\n"
  1383. "ADAPTER_PARMS @%08x\n"
  1384. "open error %04x\n"
  1385. "open options %04x\n"
  1386. "node address %02x-%02x-%02x-%02x-%02x-%02x\n"
  1387. "group address %08x\n"
  1388. "func. address %08x\n"
  1389. "reserved 1 %04x\n"
  1390. "reserved 2 %04x\n"
  1391. "max frame len %04x\n"
  1392. "reserved 3[0] %04x\n"
  1393. "reserved 3[1] %04x\n"
  1394. "reserved 3[2] %04x\n"
  1395. "reserved 3[3] %04x\n"
  1396. "bring ups %04x\n"
  1397. "init warnings %04x\n"
  1398. "reserved 4[0] %04x\n"
  1399. "reserved 4[1] %04x\n"
  1400. "reserved 4[2] %04x\n",
  1401. pAdapterParms,
  1402. pAdapterParms->usOpenErrorCode,
  1403. pAdapterParms->usOpenOptions,
  1404. pAdapterParms->auchNodeAddress[0],
  1405. pAdapterParms->auchNodeAddress[1],
  1406. pAdapterParms->auchNodeAddress[2],
  1407. pAdapterParms->auchNodeAddress[3],
  1408. pAdapterParms->auchNodeAddress[4],
  1409. pAdapterParms->auchNodeAddress[5],
  1410. *(UNALIGNED DWORD *)&pAdapterParms->auchGroupAddress,
  1411. *(UNALIGNED DWORD *)&pAdapterParms->auchFunctionalAddress,
  1412. pAdapterParms->usReserved1,
  1413. pAdapterParms->usReserved2,
  1414. pAdapterParms->usMaxFrameSize,
  1415. pAdapterParms->usReserved3[0],
  1416. pAdapterParms->usReserved3[1],
  1417. pAdapterParms->usReserved3[2],
  1418. pAdapterParms->usReserved3[3],
  1419. pAdapterParms->usBringUps,
  1420. pAdapterParms->InitWarnings,
  1421. pAdapterParms->usReserved4[0],
  1422. pAdapterParms->usReserved4[1],
  1423. pAdapterParms->usReserved4[2]
  1424. );
  1425. }
  1426. if (pExtendedParms) {
  1427. DBGPRINT(
  1428. "\n"
  1429. "EXTENDED PARMS @%08x\n"
  1430. "hBufferPool %08x\n"
  1431. "pSecurityDesc %08x\n"
  1432. "Ethernet Type %08x\n",
  1433. pExtendedParms,
  1434. pExtendedParms->hBufferPool,
  1435. pExtendedParms->pSecurityDescriptor,
  1436. pExtendedParms->LlcEthernetType
  1437. );
  1438. }
  1439. if (pDlcParms) {
  1440. DBGPRINT(
  1441. "\n"
  1442. "DLC_PARMS @%04x:%04x\n"
  1443. "max SAPs %02x\n"
  1444. "max links %02x\n"
  1445. "max grp SAPs %02x\n"
  1446. "max grp memb %02x\n"
  1447. "T1 tick 1 %02x\n"
  1448. "T2 tick 1 %02x\n"
  1449. "Ti tick 1 %02x\n"
  1450. "T1 tick 2 %02x\n"
  1451. "T2 tick 2 %02x\n"
  1452. "Ti tick 2 %02x\n",
  1453. pDlcParms,
  1454. pDlcParms->uchDlcMaxSaps,
  1455. pDlcParms->uchDlcMaxStations,
  1456. pDlcParms->uchDlcMaxGroupSaps,
  1457. pDlcParms->uchDlcMaxGroupMembers,
  1458. pDlcParms->uchT1_TickOne,
  1459. pDlcParms->uchT2_TickOne,
  1460. pDlcParms->uchTi_TickOne,
  1461. pDlcParms->uchT1_TickTwo,
  1462. pDlcParms->uchT2_TickTwo,
  1463. pDlcParms->uchTi_TickTwo
  1464. );
  1465. }
  1466. if (pNcbParms) {
  1467. DBGPRINT(
  1468. "\n"
  1469. "NCB_PARMS @%08x???\n",
  1470. pNcbParms
  1471. );
  1472. }
  1473. }
  1474. }
  1475. PRIVATE
  1476. VOID
  1477. DumpDirReadLog(
  1478. DUMP_TABLE_PARMS
  1479. )
  1480. {
  1481. DumpParameterTableHeader("DIR.READ.LOG", Parameters, IsDos, Segment, Offset);
  1482. }
  1483. PRIVATE
  1484. VOID
  1485. DumpDirRestoreOpenParmsParms(
  1486. DUMP_TABLE_PARMS
  1487. )
  1488. {
  1489. }
  1490. PRIVATE
  1491. VOID
  1492. DumpDirSetFunctionalAddressParms(
  1493. DUMP_TABLE_PARMS
  1494. )
  1495. {
  1496. DBGPRINT( "funct addr %08lx\n", Parameters);
  1497. }
  1498. PRIVATE
  1499. VOID
  1500. DumpDirSetGroupAddressParms(
  1501. DUMP_TABLE_PARMS
  1502. )
  1503. {
  1504. DBGPRINT( "group addr %08lx\n", Parameters);
  1505. }
  1506. PRIVATE
  1507. VOID
  1508. DumpDirSetUserAppendageParms(
  1509. DUMP_TABLE_PARMS
  1510. )
  1511. {
  1512. PLLC_DIR_SET_USER_APPENDAGE_PARMS parms = (PLLC_DIR_SET_USER_APPENDAGE_PARMS)Parameters;
  1513. DumpParameterTableHeader("DIR.SET.USER.APPENDAGE", Parameters, IsDos, Segment, Offset);
  1514. if (IsDos) {
  1515. DBGPRINT( "adapt check %04x:%04x\n"
  1516. "n/w status %04x:%04x\n"
  1517. "w/s error %04x:%04x\n",
  1518. GET_SEGMENT(&parms->dpAdapterCheckExit),
  1519. GET_OFFSET(&parms->dpAdapterCheckExit),
  1520. GET_SEGMENT(&parms->dpNetworkStatusExit),
  1521. GET_OFFSET(&parms->dpNetworkStatusExit),
  1522. GET_SEGMENT(&parms->dpPcErrorExit),
  1523. GET_OFFSET(&parms->dpPcErrorExit)
  1524. );
  1525. }
  1526. }
  1527. PRIVATE
  1528. VOID
  1529. DumpDirStatusParms(
  1530. DUMP_TABLE_PARMS
  1531. )
  1532. {
  1533. PDOS_DIR_STATUS_PARMS dosParms = (PDOS_DIR_STATUS_PARMS)Parameters;
  1534. DumpParameterTableHeader("DIR.STATUS", Parameters, IsDos, Segment, Offset);
  1535. if (IsDos) {
  1536. DBGPRINT( "perm addr %02x-%02x-%02x-%02x-%02x-%02x\n"
  1537. "local addr %02x-%02x-%02x-%02x-%02x-%02x\n"
  1538. "group addr %08lx\n"
  1539. "func addr %08lx\n"
  1540. "max SAPs %02x\n"
  1541. "open SAPs %02x\n"
  1542. "max links %02x\n"
  1543. "open links %02x\n"
  1544. "avail links %02x\n"
  1545. "adapt config %02x\n"
  1546. "ucode level %02x-%02x-%02x-%02x-%02x-%02x-%02x-%02x-%02x-%02x\n"
  1547. "adap parms %04x:%04x\n"
  1548. "adap MAC %04x:%04x\n"
  1549. "timer tick %04x:%04x\n"
  1550. "last NW stat %04x\n"
  1551. "ext. status %04x:%04x\n",
  1552. dosParms->auchPermanentAddress[0],
  1553. dosParms->auchPermanentAddress[1],
  1554. dosParms->auchPermanentAddress[2],
  1555. dosParms->auchPermanentAddress[3],
  1556. dosParms->auchPermanentAddress[4],
  1557. dosParms->auchPermanentAddress[5],
  1558. dosParms->auchNodeAddress[0],
  1559. dosParms->auchNodeAddress[1],
  1560. dosParms->auchNodeAddress[2],
  1561. dosParms->auchNodeAddress[3],
  1562. dosParms->auchNodeAddress[4],
  1563. dosParms->auchNodeAddress[5],
  1564. READ_DWORD(&dosParms->auchGroupAddress),
  1565. READ_DWORD(&dosParms->auchFunctAddr),
  1566. dosParms->uchMaxSap,
  1567. dosParms->uchOpenSaps,
  1568. dosParms->uchMaxStations,
  1569. dosParms->uchOpenStation,
  1570. dosParms->uchAvailStations,
  1571. dosParms->uchAdapterConfig,
  1572. dosParms->auchMicroCodeLevel[0],
  1573. dosParms->auchMicroCodeLevel[1],
  1574. dosParms->auchMicroCodeLevel[2],
  1575. dosParms->auchMicroCodeLevel[3],
  1576. dosParms->auchMicroCodeLevel[4],
  1577. dosParms->auchMicroCodeLevel[5],
  1578. dosParms->auchMicroCodeLevel[6],
  1579. dosParms->auchMicroCodeLevel[7],
  1580. dosParms->auchMicroCodeLevel[8],
  1581. dosParms->auchMicroCodeLevel[9],
  1582. GET_SEGMENT(&dosParms->dpAdapterParmsAddr),
  1583. GET_OFFSET(&dosParms->dpAdapterParmsAddr),
  1584. GET_SEGMENT(&dosParms->dpAdapterMacAddr),
  1585. GET_OFFSET(&dosParms->dpAdapterMacAddr),
  1586. GET_SEGMENT(&dosParms->dpTimerTick),
  1587. GET_OFFSET(&dosParms->dpTimerTick),
  1588. READ_WORD(&dosParms->usLastNetworkStatus),
  1589. GET_SEGMENT(&dosParms->dpExtendedParms),
  1590. GET_OFFSET(&dosParms->dpExtendedParms)
  1591. );
  1592. } else {
  1593. DBGPRINT("no dump for this table yet\n");
  1594. }
  1595. }
  1596. PRIVATE
  1597. VOID
  1598. DumpDirTimerCancelParms(
  1599. DUMP_TABLE_PARMS
  1600. )
  1601. {
  1602. if (IsDos) {
  1603. DBGPRINT( "cancel timer %04x:%04x\n",
  1604. HIWORD(Parameters),
  1605. LOWORD(Parameters)
  1606. );
  1607. }
  1608. }
  1609. PRIVATE
  1610. VOID
  1611. DumpDirTimerCancelGroupParms(
  1612. DUMP_TABLE_PARMS
  1613. )
  1614. {
  1615. if (IsDos) {
  1616. DBGPRINT( "cancel timer %04x:%04x\n",
  1617. HIWORD(Parameters),
  1618. LOWORD(Parameters)
  1619. );
  1620. }
  1621. }
  1622. PRIVATE
  1623. VOID
  1624. DumpDirTimerSetParms(
  1625. DUMP_TABLE_PARMS
  1626. )
  1627. {
  1628. if (IsDos) {
  1629. DBGPRINT( "timer value %04x\n",
  1630. LOWORD(Parameters)
  1631. );
  1632. }
  1633. }
  1634. PRIVATE
  1635. VOID
  1636. DumpDlcCloseSapParms(
  1637. DUMP_TABLE_PARMS
  1638. )
  1639. {
  1640. if (IsDos) {
  1641. DBGPRINT( "STATION_ID %04x\n"
  1642. "reserved %04x\n",
  1643. LOWORD(Parameters),
  1644. HIWORD(Parameters)
  1645. );
  1646. }
  1647. }
  1648. PRIVATE
  1649. VOID
  1650. DumpDlcCloseStationParms(
  1651. DUMP_TABLE_PARMS
  1652. )
  1653. {
  1654. if (IsDos) {
  1655. DBGPRINT( "STATION_ID %04x\n"
  1656. "reserved %02x %02x\n",
  1657. LOWORD(Parameters),
  1658. LOBYTE(HIWORD(Parameters)),
  1659. HIBYTE(HIWORD(Parameters))
  1660. );
  1661. }
  1662. }
  1663. PRIVATE
  1664. VOID
  1665. DumpDlcConnectStationParms(
  1666. DUMP_TABLE_PARMS
  1667. )
  1668. {
  1669. LLC_DLC_CONNECT_PARMS UNALIGNED * parms = (PLLC_DLC_CONNECT_PARMS)Parameters;
  1670. ULPBYTE routing = NULL;
  1671. int i;
  1672. DumpParameterTableHeader("DLC.CONNECT.STATION", Parameters, IsDos, Segment, Offset);
  1673. DBGPRINT( "station id %04x\n"
  1674. "reserved %02x %02x\n",
  1675. READ_WORD(&parms->usStationId),
  1676. ((ULPBYTE)(&parms->usReserved))[0],
  1677. ((ULPBYTE)(&parms->usReserved))[1]
  1678. );
  1679. if (IsDos) {
  1680. DBGPRINT(
  1681. "routing addr %04x:%04x\n",
  1682. GET_SEGMENT(&parms->pRoutingInfo),
  1683. GET_OFFSET(&parms->pRoutingInfo)
  1684. );
  1685. routing = READ_FAR_POINTER(&parms->pRoutingInfo);
  1686. } else {
  1687. DBGPRINT(
  1688. "routing addr %08x\n",
  1689. parms->pRoutingInfo
  1690. );
  1691. routing = parms->pRoutingInfo;
  1692. }
  1693. if (routing) {
  1694. DBGPRINT("ROUTING INFO: ");
  1695. for (i=0; i<18; ++i) {
  1696. DBGPRINT("%02x ", routing[i]);
  1697. }
  1698. DBGPRINT("\n");
  1699. }
  1700. }
  1701. PRIVATE
  1702. VOID
  1703. DumpDlcFlowControlParms(
  1704. DUMP_TABLE_PARMS
  1705. )
  1706. {
  1707. DBGPRINT(
  1708. "STATION_ID %04x\n"
  1709. "flow control %02x [%s]\n"
  1710. "reserved %02x\n",
  1711. LOWORD(Parameters),
  1712. LOBYTE(HIWORD(Parameters)),
  1713. MapFlowControl(LOBYTE(HIWORD(Parameters))),
  1714. HIBYTE(HIWORD(Parameters))
  1715. );
  1716. }
  1717. PRIVATE LPSTR MapFlowControl(BYTE FlowControl) {
  1718. if (FlowControl & 0x80) {
  1719. if (FlowControl & 0x40) {
  1720. return "reset local_busy(buffer)";
  1721. } else {
  1722. return "reset local_busy(user)";
  1723. }
  1724. } else {
  1725. return "set local_busy(user)";
  1726. }
  1727. }
  1728. PRIVATE
  1729. VOID
  1730. DumpDlcModifyParms(
  1731. DUMP_TABLE_PARMS
  1732. )
  1733. {
  1734. }
  1735. PRIVATE
  1736. VOID
  1737. DumpDlcOpenSapParms(
  1738. DUMP_TABLE_PARMS
  1739. )
  1740. {
  1741. PLLC_DLC_OPEN_SAP_PARMS parms = (PLLC_DLC_OPEN_SAP_PARMS)Parameters;
  1742. DumpParameterTableHeader("DLC.OPEN.SAP", Parameters, IsDos, Segment, Offset);
  1743. DBGPRINT( "station id %04x\n"
  1744. "user stat %04x\n"
  1745. "T1 %02x\n"
  1746. "T2 %02x\n"
  1747. "Ti %02x\n"
  1748. "max out %02x\n"
  1749. "max in %02x\n"
  1750. "max out inc %02x\n"
  1751. "max retry %02x\n"
  1752. "max members %02x\n"
  1753. "max I field %04x\n"
  1754. "SAP value %02x\n"
  1755. "options %02x [%s]\n"
  1756. "link count %02x\n"
  1757. "reserved %02x %02x\n"
  1758. "group count %02x\n",
  1759. READ_WORD(&parms->usStationId),
  1760. READ_WORD(&parms->usUserStatValue),
  1761. parms->uchT1,
  1762. parms->uchT2,
  1763. parms->uchTi,
  1764. parms->uchMaxOut,
  1765. parms->uchMaxIn,
  1766. parms->uchMaxOutIncr,
  1767. parms->uchMaxRetryCnt,
  1768. parms->uchMaxMembers,
  1769. READ_WORD(&parms->usMaxI_Field),
  1770. parms->uchSapValue,
  1771. parms->uchOptionsPriority,
  1772. MapOptionsPriority(parms->uchOptionsPriority),
  1773. parms->uchcStationCount,
  1774. parms->uchReserved2[0],
  1775. parms->uchReserved2[1],
  1776. parms->cGroupCount
  1777. );
  1778. if (IsDos) {
  1779. DBGPRINT(
  1780. "group list %04x:%04x\n"
  1781. "dlc stat app %04x:%04x\n",
  1782. GET_SEGMENT(&parms->pGroupList),
  1783. GET_OFFSET(&parms->pGroupList),
  1784. GET_SEGMENT(&parms->DlcStatusFlags),
  1785. GET_OFFSET(&parms->DlcStatusFlags)
  1786. );
  1787. //
  1788. // some code here to dump group list
  1789. //
  1790. } else {
  1791. DBGPRINT(
  1792. "group list %08x\n"
  1793. "dlc status %08x\n",
  1794. parms->pGroupList,
  1795. parms->DlcStatusFlags
  1796. );
  1797. }
  1798. DBGPRINT( "buffer size %04x\n"
  1799. "pool length %04x\n",
  1800. READ_WORD(&parms->uchReserved3[0]),
  1801. READ_WORD(&parms->uchReserved3[2])
  1802. );
  1803. if (IsDos) {
  1804. DBGPRINT(
  1805. "buffer pool %04x:%04x\n",
  1806. READ_WORD(&parms->uchReserved3[6]),
  1807. READ_WORD(&parms->uchReserved3[4])
  1808. );
  1809. } else {
  1810. DBGPRINT(
  1811. "buffer pool %08x\n",
  1812. *(LPDWORD)&parms->uchReserved3[4]
  1813. );
  1814. }
  1815. }
  1816. PRIVATE LPSTR MapOptionsPriority(UCHAR OptionsPriority) {
  1817. static char buf[80];
  1818. char* bufptr = buf;
  1819. bufptr += sprintf(buf, "Access Priority=%d", (OptionsPriority & 0xe0) >> 5);
  1820. if (OptionsPriority & 8) {
  1821. bufptr += sprintf(bufptr, " XID handled by APP");
  1822. } else {
  1823. bufptr += sprintf(bufptr, " XID handled by DLC");
  1824. }
  1825. if (OptionsPriority & 4) {
  1826. bufptr += sprintf(bufptr, " Individual SAP");
  1827. }
  1828. if (OptionsPriority & 2) {
  1829. bufptr += sprintf(bufptr, " Group SAP");
  1830. }
  1831. if (OptionsPriority & 1) {
  1832. bufptr += sprintf(bufptr, " Group Member SAP");
  1833. }
  1834. return buf;
  1835. }
  1836. PRIVATE
  1837. VOID
  1838. DumpDlcOpenStationParms(
  1839. DUMP_TABLE_PARMS
  1840. )
  1841. {
  1842. PLLC_DLC_OPEN_STATION_PARMS parms = (PLLC_DLC_OPEN_STATION_PARMS)Parameters;
  1843. ULPBYTE dest = NULL;
  1844. int i;
  1845. DumpParameterTableHeader("DLC.OPEN.STATION", Parameters, IsDos, Segment, Offset);
  1846. DBGPRINT( "sap station %04x\n"
  1847. "link station %04x\n"
  1848. "T1 %02x\n"
  1849. "T2 %02x\n"
  1850. "Ti %02x\n"
  1851. "max out %02x\n"
  1852. "max in %02x\n"
  1853. "max out inc %02x\n"
  1854. "max retry %02x\n"
  1855. "remote SAP %02x\n"
  1856. "max I field %04x\n"
  1857. "access pri %02x\n",
  1858. READ_WORD(&parms->usSapStationId),
  1859. READ_WORD(&parms->usLinkStationId),
  1860. parms->uchT1,
  1861. parms->uchT2,
  1862. parms->uchTi,
  1863. parms->uchMaxOut,
  1864. parms->uchMaxIn,
  1865. parms->uchMaxOutIncr,
  1866. parms->uchMaxRetryCnt,
  1867. parms->uchRemoteSap,
  1868. READ_WORD(&parms->usMaxI_Field),
  1869. parms->uchAccessPriority
  1870. );
  1871. if (IsDos) {
  1872. DBGPRINT(
  1873. "destination %04x:%04x\n",
  1874. GET_SEGMENT(&parms->pRemoteNodeAddress),
  1875. GET_OFFSET(&parms->pRemoteNodeAddress)
  1876. );
  1877. dest = READ_FAR_POINTER(&parms->pRemoteNodeAddress);
  1878. } else {
  1879. DBGPRINT(
  1880. "destination %08x\n",
  1881. parms->pRemoteNodeAddress
  1882. );
  1883. dest = parms->pRemoteNodeAddress;
  1884. }
  1885. if (dest) {
  1886. DBGPRINT("DESTINATION ADDRESS: ");
  1887. for (i=0; i<6; ++i) {
  1888. DBGPRINT("%02x ", dest[i]);
  1889. }
  1890. DBGPRINT("\n");
  1891. }
  1892. }
  1893. PRIVATE
  1894. VOID
  1895. DumpDlcReallocateParms(
  1896. DUMP_TABLE_PARMS
  1897. )
  1898. {
  1899. }
  1900. PRIVATE
  1901. VOID
  1902. DumpDlcResetParms(
  1903. DUMP_TABLE_PARMS
  1904. )
  1905. {
  1906. DBGPRINT( "STATION_ID %04x\n"
  1907. "reserved %02x %02x\n",
  1908. LOWORD(Parameters),
  1909. LOBYTE(HIWORD(Parameters)),
  1910. HIBYTE(HIWORD(Parameters))
  1911. );
  1912. }
  1913. PRIVATE
  1914. VOID
  1915. DumpDlcStatisticsParms(
  1916. DUMP_TABLE_PARMS
  1917. )
  1918. {
  1919. }
  1920. PRIVATE
  1921. VOID
  1922. DumpPdtTraceOffParms(
  1923. DUMP_TABLE_PARMS
  1924. )
  1925. {
  1926. }
  1927. PRIVATE
  1928. VOID
  1929. DumpPdtTraceOnParms(
  1930. DUMP_TABLE_PARMS
  1931. )
  1932. {
  1933. }
  1934. PRIVATE
  1935. VOID
  1936. DumpReadParms(
  1937. DUMP_TABLE_PARMS
  1938. )
  1939. {
  1940. PLLC_READ_PARMS parms = (PLLC_READ_PARMS)Parameters;
  1941. DumpParameterTableHeader("READ", Parameters, IsDos, Segment, Offset);
  1942. //
  1943. // this parameter table not for DOS
  1944. //
  1945. DBGPRINT( "station id %04x\n"
  1946. "option ind. %02x\n"
  1947. "event set %02x\n"
  1948. "event %02x [%s]\n"
  1949. "crit. subset %02x\n"
  1950. "notify flag %08x\n",
  1951. parms->usStationId,
  1952. parms->uchOptionIndicator,
  1953. parms->uchEventSet,
  1954. parms->uchEvent,
  1955. MapReadEvent(parms->uchEvent),
  1956. parms->uchCriticalSubset,
  1957. parms->ulNotificationFlag
  1958. );
  1959. //
  1960. // rest of table interpreted differently depending on whether status change
  1961. //
  1962. if (parms->uchEvent & 0x38) {
  1963. DBGPRINT(
  1964. "station id %04x\n"
  1965. "status code %04x [%s]\n"
  1966. "FRMR data %02x %02x %02x %02x %02x\n"
  1967. "access pri. %02x\n"
  1968. "remote addr %02x-%02x-%02x-%02x-%02x-%02x\n"
  1969. "remote SAP %02x\n"
  1970. "reserved %02x\n"
  1971. "user stat %04x\n",
  1972. parms->Type.Status.usStationId,
  1973. parms->Type.Status.usDlcStatusCode,
  1974. MapDlcStatus(parms->Type.Status.usDlcStatusCode),
  1975. parms->Type.Status.uchFrmrData[0],
  1976. parms->Type.Status.uchFrmrData[1],
  1977. parms->Type.Status.uchFrmrData[2],
  1978. parms->Type.Status.uchFrmrData[3],
  1979. parms->Type.Status.uchFrmrData[4],
  1980. parms->Type.Status.uchAccessPritority,
  1981. parms->Type.Status.uchRemoteNodeAddress[0],
  1982. parms->Type.Status.uchRemoteNodeAddress[1],
  1983. parms->Type.Status.uchRemoteNodeAddress[2],
  1984. parms->Type.Status.uchRemoteNodeAddress[3],
  1985. parms->Type.Status.uchRemoteNodeAddress[4],
  1986. parms->Type.Status.uchRemoteNodeAddress[5],
  1987. parms->Type.Status.uchRemoteSap,
  1988. parms->Type.Status.uchReserved,
  1989. parms->Type.Status.usUserStatusValue
  1990. );
  1991. } else {
  1992. DBGPRINT(
  1993. "CCB count %04x\n"
  1994. "CCB list %08x\n"
  1995. "buffer count %04x\n"
  1996. "buffer list %08x\n"
  1997. "frame count %04x\n"
  1998. "frame list %08x\n"
  1999. "error code %04x\n"
  2000. "error data %04x %04x %04x\n",
  2001. parms->Type.Event.usCcbCount,
  2002. parms->Type.Event.pCcbCompletionList,
  2003. parms->Type.Event.usBufferCount,
  2004. parms->Type.Event.pFirstBuffer,
  2005. parms->Type.Event.usReceivedFrameCount,
  2006. parms->Type.Event.pReceivedFrame,
  2007. parms->Type.Event.usEventErrorCode,
  2008. parms->Type.Event.usEventErrorData[0],
  2009. parms->Type.Event.usEventErrorData[1],
  2010. parms->Type.Event.usEventErrorData[2]
  2011. );
  2012. //
  2013. // address of CCB is in DOS memory
  2014. //
  2015. if (parms->Type.Event.usCcbCount) {
  2016. DumpCcb(DOS_PTR_TO_FLAT(parms->Type.Event.pCcbCompletionList),
  2017. TRUE, // DumpAll
  2018. FALSE, // CcbIsInput
  2019. TRUE, // IsDos
  2020. HIWORD(parms->Type.Event.pCcbCompletionList),
  2021. LOWORD(parms->Type.Event.pCcbCompletionList)
  2022. );
  2023. }
  2024. if (parms->Type.Event.usReceivedFrameCount) {
  2025. DumpReceiveDataBuffer(parms->Type.Event.pReceivedFrame, FALSE, 0, 0);
  2026. }
  2027. }
  2028. }
  2029. PRIVATE LPSTR MapReadEvent(UCHAR Event) {
  2030. switch (Event) {
  2031. case 0x80:
  2032. return "Reserved Event!";
  2033. case 0x40:
  2034. return "System Action (non-critical)";
  2035. case 0x20:
  2036. return "Network Status (non-critical)";
  2037. case 0x10:
  2038. return "Critical Exception";
  2039. case 0x8:
  2040. return "DLC Status Change";
  2041. case 0x4:
  2042. return "Receive Data";
  2043. case 0x2:
  2044. return "Transmit Completion";
  2045. case 0x1:
  2046. return "Command Completion";
  2047. }
  2048. return "Unknown Read Event";
  2049. }
  2050. PRIVATE LPSTR MapDlcStatus(WORD Status) {
  2051. if (Status & 0x8000) {
  2052. return "Link lost";
  2053. } else if (Status & 0x4000) {
  2054. return "DM/DISC Received -or- DISC ack'd";
  2055. } else if (Status & 0x2000) {
  2056. return "FRMR Received";
  2057. } else if (Status & 0x1000) {
  2058. return "FRMR Sent";
  2059. } else if (Status & 0x0800) {
  2060. return "SABME Received for open link station";
  2061. } else if (Status & 0x0400) {
  2062. return "SABME Received - link station opened";
  2063. } else if (Status & 0x0200) {
  2064. return "REMOTE Busy Entered";
  2065. } else if (Status & 0x0100) {
  2066. return "REMOTE Busy Left";
  2067. } else if (Status & 0x0080) {
  2068. return "Ti EXPIRED";
  2069. } else if (Status & 0x0040) {
  2070. return "DLC counter overflow - issue DLC.STATISTICS";
  2071. } else if (Status & 0x0020) {
  2072. return "Access Priority lowered";
  2073. } else if (Status & 0x001e) {
  2074. return "*** ERROR - INVALID STATUS ***";
  2075. } else if (Status & 0x0001) {
  2076. return "Entered LOCAL Busy";
  2077. } else {
  2078. return "Unknown DLC Status";
  2079. }
  2080. }
  2081. PRIVATE
  2082. VOID
  2083. DumpReadCancelParms(
  2084. DUMP_TABLE_PARMS
  2085. )
  2086. {
  2087. }
  2088. PRIVATE
  2089. VOID
  2090. DumpReceiveParms(
  2091. DUMP_TABLE_PARMS
  2092. )
  2093. {
  2094. //
  2095. // the format of the recieve parameter table is different depending on
  2096. // whether this is a DOS command (CCB1) or NT (CCB2)
  2097. //
  2098. PLLC_RECEIVE_PARMS ntParms = (PLLC_RECEIVE_PARMS)Parameters;
  2099. PLLC_DOS_RECEIVE_PARMS dosParms = (PLLC_DOS_RECEIVE_PARMS)Parameters;
  2100. PLLC_DOS_RECEIVE_PARMS_EX dosExParms = (PLLC_DOS_RECEIVE_PARMS_EX)Parameters;
  2101. PVOID Buffer;
  2102. DumpParameterTableHeader("RECEIVE", Parameters, IsDos, Segment, Offset);
  2103. //
  2104. // some common bits: use any structure pointer
  2105. //
  2106. DBGPRINT( "station id %04x\n"
  2107. "user length %04x\n",
  2108. READ_WORD(&ntParms->usStationId),
  2109. READ_WORD(&ntParms->usUserLength)
  2110. );
  2111. //
  2112. // dump segmented pointers for DOS, flat for NT
  2113. //
  2114. if (IsDos) {
  2115. DBGPRINT(
  2116. "receive exit %04x:%04x\n"
  2117. "first buffer %04x:%04x\n",
  2118. GET_SEGMENT(&dosParms->ulReceiveExit),
  2119. GET_OFFSET(&dosParms->ulReceiveExit),
  2120. GET_SEGMENT(&dosParms->pFirstBuffer),
  2121. GET_OFFSET(&dosParms->pFirstBuffer)
  2122. );
  2123. Buffer = READ_FAR_POINTER(&dosParms->pFirstBuffer);
  2124. //
  2125. // use Segment & Offset to address received data buffer
  2126. //
  2127. Segment = GET_SEGMENT(&dosParms->pFirstBuffer);
  2128. Offset = GET_OFFSET(&dosParms->pFirstBuffer);
  2129. } else {
  2130. DBGPRINT(
  2131. "receive flag %08x\n"
  2132. "first buffer %08x\n",
  2133. ntParms->ulReceiveFlag,
  2134. ntParms->pFirstBuffer
  2135. );
  2136. Buffer = ntParms->pFirstBuffer;
  2137. }
  2138. //
  2139. // more common bits
  2140. //
  2141. DBGPRINT( "options %02x\n",
  2142. ntParms->uchOptions
  2143. );
  2144. if (!IsDos) {
  2145. DBGPRINT(
  2146. "reserved1 %02x %02x %02x\n"
  2147. "read options %02x\n"
  2148. "reserved2 %02x %02x %02x\n"
  2149. "original CCB %08x\n"
  2150. "orig. exit %08x\n",
  2151. ntParms->auchReserved1[0],
  2152. ntParms->auchReserved1[1],
  2153. ntParms->auchReserved1[2],
  2154. ntParms->uchRcvReadOption,
  2155. ((PLLC_DOS_RECEIVE_PARMS_EX)ntParms)->auchReserved2[0],
  2156. ((PLLC_DOS_RECEIVE_PARMS_EX)ntParms)->auchReserved2[1],
  2157. ((PLLC_DOS_RECEIVE_PARMS_EX)ntParms)->auchReserved2[2],
  2158. ((PLLC_DOS_RECEIVE_PARMS_EX)ntParms)->dpOriginalCcbAddress,
  2159. ((PLLC_DOS_RECEIVE_PARMS_EX)ntParms)->dpCompletionFlag
  2160. );
  2161. /* } else {
  2162. //
  2163. // we have no way of knowing from the general purpose parameters if this
  2164. // is the original DOS CCB1 RECEIVE parameter table, or the extended
  2165. // RECEIVE parameter table that we create. Dump the extended bits for
  2166. // DOS anyhow
  2167. //
  2168. DBGPRINT(
  2169. "\nExtended RECEIVE parameters for table @%08x\n"
  2170. "reserved1 %02x %02x %02x\n"
  2171. "read options %02x\n"
  2172. "reserved2 %02x %02x %02x\n"
  2173. "original CCB %04x:%04x\n"
  2174. "orig. exit %04x:%04x\n",
  2175. Parameters,
  2176. dosExParms->auchReserved1[0],
  2177. dosExParms->auchReserved1[1],
  2178. dosExParms->auchReserved1[2],
  2179. dosExParms->uchRcvReadOption,
  2180. dosExParms->auchReserved2[0],
  2181. dosExParms->auchReserved2[1],
  2182. dosExParms->auchReserved2[2],
  2183. GET_SEGMENT(&dosExParms->dpOriginalCcbAddress),
  2184. GET_OFFSET(&dosExParms->dpOriginalCcbAddress),
  2185. GET_SEGMENT(&dosExParms->dpCompletionFlag),
  2186. GET_OFFSET(&dosExParms->dpCompletionFlag)
  2187. );
  2188. */
  2189. }
  2190. //
  2191. // only dump the buffer(s) if this is an output CCB dump
  2192. //
  2193. if (Buffer && !IsInput) {
  2194. DumpReceiveDataBuffer(Buffer, IsDos, Segment, Offset);
  2195. }
  2196. }
  2197. PRIVATE
  2198. VOID
  2199. DumpReceiveCancelParms(
  2200. DUMP_TABLE_PARMS
  2201. )
  2202. {
  2203. DBGPRINT("STATION_ID %04x\n", LOWORD(Parameters));
  2204. }
  2205. PRIVATE
  2206. VOID
  2207. DumpReceiveModifyParms(
  2208. DUMP_TABLE_PARMS
  2209. )
  2210. {
  2211. PLLC_DOS_RECEIVE_MODIFY_PARMS parms = (PLLC_DOS_RECEIVE_MODIFY_PARMS)Parameters;
  2212. PVOID Buffer;
  2213. DumpParameterTableHeader("RECEIVE.MODIFY", Parameters, IsDos, Segment, Offset);
  2214. DBGPRINT( "station id %04x\n"
  2215. "user length %04x\n"
  2216. "receive exit %04x:%04x\n"
  2217. "first buffer %04x:%04x\n"
  2218. "subroutine %04x:%04x\n",
  2219. READ_WORD(&parms->StationId),
  2220. READ_WORD(&parms->UserLength),
  2221. GET_SEGMENT(&parms->ReceivedDataExit),
  2222. GET_OFFSET(&parms->ReceivedDataExit),
  2223. GET_SEGMENT(&parms->FirstBuffer),
  2224. GET_OFFSET(&parms->FirstBuffer),
  2225. GET_SEGMENT(&parms->Subroutine),
  2226. GET_OFFSET(&parms->Subroutine)
  2227. );
  2228. Buffer = READ_FAR_POINTER(&parms->FirstBuffer);
  2229. if (Buffer) {
  2230. DumpReceiveDataBuffer(Buffer, IsDos, Segment, Offset);
  2231. }
  2232. }
  2233. PRIVATE
  2234. VOID
  2235. DumpTransmitDirFrameParms(
  2236. DUMP_TABLE_PARMS
  2237. )
  2238. {
  2239. DumpParameterTableHeader("TRANSMIT.DIR.FRAME", Parameters, IsDos, Segment, Offset);
  2240. DumpTransmitParms(Parameters, IsDos, IsInput, Segment, Offset);
  2241. }
  2242. PRIVATE
  2243. VOID
  2244. DumpTransmitIFrameParms(
  2245. DUMP_TABLE_PARMS
  2246. )
  2247. {
  2248. DumpParameterTableHeader("TRANSMIT.I.FRAME", Parameters, IsDos, Segment, Offset);
  2249. DumpTransmitParms(Parameters, IsDos, IsInput, Segment, Offset);
  2250. }
  2251. PRIVATE
  2252. VOID
  2253. DumpTransmitTestCmdParms(
  2254. DUMP_TABLE_PARMS
  2255. )
  2256. {
  2257. DumpParameterTableHeader("TRANSMIT.TEST.CMD", Parameters, IsDos, Segment, Offset);
  2258. DumpTransmitParms(Parameters, IsDos, IsInput, Segment, Offset);
  2259. }
  2260. PRIVATE
  2261. VOID
  2262. DumpTransmitUiFrameParms(
  2263. DUMP_TABLE_PARMS
  2264. )
  2265. {
  2266. DumpParameterTableHeader("TRANSMIT.UI.FRAME", Parameters, IsDos, Segment, Offset);
  2267. DumpTransmitParms(Parameters, IsDos, IsInput, Segment, Offset);
  2268. }
  2269. PRIVATE
  2270. VOID
  2271. DumpTransmitXidCmdParms(
  2272. DUMP_TABLE_PARMS
  2273. )
  2274. {
  2275. DumpParameterTableHeader("TRANSMIT.XID.CMD", Parameters, IsDos, Segment, Offset);
  2276. DumpTransmitParms(Parameters, IsDos, IsInput, Segment, Offset);
  2277. }
  2278. PRIVATE
  2279. VOID
  2280. DumpTransmitXidRespFinalParms(
  2281. DUMP_TABLE_PARMS
  2282. )
  2283. {
  2284. DumpParameterTableHeader("TRANSMIT.XID.RESP.FINAL", Parameters, IsDos, Segment, Offset);
  2285. DumpTransmitParms(Parameters, IsDos, IsInput, Segment, Offset);
  2286. }
  2287. PRIVATE
  2288. VOID
  2289. DumpTransmitXidRespNotFinalParms(
  2290. DUMP_TABLE_PARMS
  2291. )
  2292. {
  2293. DumpParameterTableHeader("TRANSMIT.XID.RESP.NOT.FINAL", Parameters, IsDos, Segment, Offset);
  2294. DumpTransmitParms(Parameters, IsDos, IsInput, Segment, Offset);
  2295. }
  2296. PRIVATE
  2297. VOID
  2298. DumpTransmitParms(
  2299. DUMP_TABLE_PARMS
  2300. )
  2301. {
  2302. PLLC_TRANSMIT_PARMS ntParms = (PLLC_TRANSMIT_PARMS)Parameters;
  2303. PLLC_DOS_TRANSMIT_PARMS dosParms = (PLLC_DOS_TRANSMIT_PARMS)Parameters;
  2304. DBGPRINT( "station id %04x\n"
  2305. "frame status %02x\n"
  2306. "remote SAP %02x\n",
  2307. READ_WORD(&dosParms->usStationId),
  2308. dosParms->uchTransmitFs,
  2309. dosParms->uchRemoteSap
  2310. );
  2311. if (IsDos) {
  2312. DBGPRINT(
  2313. "xmit q1 %04x:%04x\n"
  2314. "xmit q2 %04x:%04x\n"
  2315. "buf. len. 1 %04x\n"
  2316. "buf. len. 2 %04x\n"
  2317. "buffer 1 %04x:%04x\n"
  2318. "buffer 2 %04x:%04x\n",
  2319. GET_SEGMENT(&dosParms->pXmitQueue1),
  2320. GET_OFFSET(&dosParms->pXmitQueue1),
  2321. GET_SEGMENT(&dosParms->pXmitQueue2),
  2322. GET_OFFSET(&dosParms->pXmitQueue2),
  2323. READ_WORD(&dosParms->cbBuffer1),
  2324. READ_WORD(&dosParms->cbBuffer2),
  2325. GET_SEGMENT(&dosParms->pBuffer1),
  2326. GET_OFFSET(&dosParms->pBuffer1),
  2327. GET_SEGMENT(&dosParms->pBuffer2),
  2328. GET_OFFSET(&dosParms->pBuffer2)
  2329. );
  2330. IF_DEBUG(DLC_TX_DATA) {
  2331. if (READ_DWORD(&dosParms->pXmitQueue1)) {
  2332. DBGPRINT("\nXMIT_QUEUE_ONE:\n");
  2333. DumpTransmitQueue(READ_DWORD(&dosParms->pXmitQueue1));
  2334. }
  2335. if (READ_DWORD(&dosParms->pXmitQueue2)) {
  2336. DBGPRINT("\nXMIT_QUEUE_TWO:\n");
  2337. DumpTransmitQueue(READ_DWORD(&dosParms->pXmitQueue2));
  2338. }
  2339. if (dosParms->cbBuffer1) {
  2340. DBGPRINT("\nBUFFER1:\n");
  2341. DumpData(NULL,
  2342. NULL,
  2343. dosParms->cbBuffer1,
  2344. DD_UPPER_CASE,
  2345. 0,
  2346. TRUE,
  2347. GET_SEGMENT(&dosParms->pBuffer1),
  2348. GET_OFFSET(&dosParms->pBuffer1)
  2349. );
  2350. }
  2351. if (dosParms->cbBuffer2) {
  2352. DBGPRINT("\nBUFFER2:\n");
  2353. DumpData(NULL,
  2354. NULL,
  2355. dosParms->cbBuffer2,
  2356. DD_UPPER_CASE,
  2357. 0,
  2358. TRUE,
  2359. GET_SEGMENT(&dosParms->pBuffer2),
  2360. GET_OFFSET(&dosParms->pBuffer2)
  2361. );
  2362. }
  2363. }
  2364. } else {
  2365. DBGPRINT(
  2366. "xmit q1 %08x\n"
  2367. "xmit q2 %08x\n"
  2368. "buf. len. 1 %02x\n"
  2369. "buf. len. 2 %02x\n"
  2370. "buffer 1 %08x\n"
  2371. "buffer 2 %08x\n"
  2372. "xmt read opt %02x\n",
  2373. ntParms->pXmitQueue1,
  2374. ntParms->pXmitQueue2,
  2375. ntParms->cbBuffer1,
  2376. ntParms->cbBuffer2,
  2377. ntParms->pBuffer1,
  2378. ntParms->pBuffer2,
  2379. ntParms->uchXmitReadOption
  2380. );
  2381. }
  2382. }
  2383. PRIVATE
  2384. VOID
  2385. DumpTransmitQueue(
  2386. IN DOS_ADDRESS dpQueue
  2387. )
  2388. {
  2389. PLLC_XMIT_BUFFER pTxBuffer;
  2390. WORD userLength;
  2391. WORD dataLength;
  2392. while (dpQueue) {
  2393. pTxBuffer = (PLLC_XMIT_BUFFER)DOS_PTR_TO_FLAT(dpQueue);
  2394. dataLength = READ_WORD(&pTxBuffer->cbBuffer);
  2395. userLength = READ_WORD(&pTxBuffer->cbUserData);
  2396. DBGPRINT(
  2397. "\n"
  2398. "Transmit Buffer @%04x:%04x\n"
  2399. "next buffer %04x:%04x\n"
  2400. "reserved %02x %02x\n"
  2401. "data length %04x\n"
  2402. "user data %04x\n"
  2403. "user length %04x\n",
  2404. HIWORD(dpQueue),
  2405. LOWORD(dpQueue),
  2406. GET_SEGMENT(&pTxBuffer->pNext),
  2407. GET_OFFSET(&pTxBuffer->pNext),
  2408. ((LPBYTE)(&pTxBuffer->usReserved1))[0],
  2409. ((LPBYTE)(&pTxBuffer->usReserved1))[1],
  2410. dataLength,
  2411. READ_WORD(&pTxBuffer->usReserved2),
  2412. userLength
  2413. );
  2414. DumpData("user space",
  2415. (PBYTE)(&pTxBuffer->auchData),
  2416. userLength,
  2417. DD_NO_ADDRESS | DD_UPPER_CASE | DD_INDENT_ALL,
  2418. DEFAULT_FIELD_WIDTH,
  2419. FALSE, // not displaying seg:off, so no need for these 3
  2420. 0,
  2421. 0
  2422. );
  2423. DumpData("xmit data",
  2424. (PBYTE)(&pTxBuffer->auchData) + userLength,
  2425. dataLength,
  2426. DD_NO_ADDRESS | DD_UPPER_CASE | DD_INDENT_ALL,
  2427. DEFAULT_FIELD_WIDTH,
  2428. FALSE, // not displaying seg:off, so no need for these 3
  2429. 0,
  2430. 0
  2431. );
  2432. dpQueue = READ_DWORD(&pTxBuffer->pNext);
  2433. }
  2434. }
  2435. VOID
  2436. DumpReceiveDataBuffer(
  2437. IN PVOID Buffer,
  2438. IN BOOL IsDos,
  2439. IN WORD Segment,
  2440. IN WORD Offset
  2441. )
  2442. {
  2443. if (IsDos) {
  2444. PLLC_DOS_BUFFER pBuf = (PLLC_DOS_BUFFER)Buffer;
  2445. BOOL contiguous = pBuf->Contiguous.uchOptions & 0xc0;
  2446. WORD userLength = READ_WORD(&pBuf->Next.cbUserData);
  2447. WORD dataLength = READ_WORD(&pBuf->Next.cbBuffer);
  2448. WORD userOffset = READ_WORD(&pBuf->Next.offUserData);
  2449. //
  2450. // Buffer 1: [not] contiguous MAC/DATA
  2451. //
  2452. DBGPRINT(
  2453. "\n"
  2454. "%sContiguous MAC/DATA frame @%04x:%04x\n"
  2455. "next buffer %04x:%04x\n"
  2456. "frame length %04x\n"
  2457. "data length %04x\n"
  2458. "user offset %04x\n"
  2459. "user length %04x\n"
  2460. "station id %04x\n"
  2461. "options %02x\n"
  2462. "message type %02x [%s]\n"
  2463. "buffers left %04x\n"
  2464. "rcv FS %02x\n"
  2465. "adapter num %02x\n",
  2466. contiguous ? "" : "Not",
  2467. Segment,
  2468. Offset,
  2469. GET_SEGMENT(&pBuf->Contiguous.pNextBuffer),
  2470. GET_OFFSET(&pBuf->Contiguous.pNextBuffer),
  2471. READ_WORD(&pBuf->Contiguous.cbFrame),
  2472. READ_WORD(&pBuf->Contiguous.cbBuffer),
  2473. READ_WORD(&pBuf->Contiguous.offUserData),
  2474. READ_WORD(&pBuf->Contiguous.cbUserData),
  2475. READ_WORD(&pBuf->Contiguous.usStationId),
  2476. pBuf->Contiguous.uchOptions,
  2477. pBuf->Contiguous.uchMsgType,
  2478. MapMessageType(pBuf->Contiguous.uchMsgType),
  2479. READ_WORD(&pBuf->Contiguous.cBuffersLeft),
  2480. pBuf->Contiguous.uchRcvFS,
  2481. pBuf->Contiguous.uchAdapterNumber
  2482. );
  2483. if (!contiguous) {
  2484. DWORD cbLanHeader = (DWORD)pBuf->NotContiguous.cbLanHeader;
  2485. DWORD cbDlcHeader = (DWORD)pBuf->NotContiguous.cbDlcHeader;
  2486. DBGPRINT(
  2487. "LAN hdr len %02x\n"
  2488. "DLC hdr len %02x\n",
  2489. cbLanHeader,
  2490. cbDlcHeader
  2491. );
  2492. DumpData("LAN header",
  2493. NULL,
  2494. (DWORD)cbLanHeader,
  2495. DD_NO_ADDRESS | DD_NO_ASCII | DD_UPPER_CASE | DD_INDENT_ALL,
  2496. DEFAULT_FIELD_WIDTH,
  2497. TRUE,
  2498. Segment,
  2499. (WORD)(Offset + (WORD)&((PLLC_DOS_BUFFER)0)->NotContiguous.auchLanHeader)
  2500. );
  2501. DumpData("DLC header",
  2502. NULL,
  2503. cbDlcHeader,
  2504. DD_NO_ADDRESS | DD_NO_ASCII | DD_UPPER_CASE | DD_INDENT_ALL,
  2505. DEFAULT_FIELD_WIDTH,
  2506. TRUE,
  2507. Segment,
  2508. (WORD)(Offset + (WORD)&((PLLC_DOS_BUFFER)0)->NotContiguous.auchDlcHeader)
  2509. );
  2510. IF_DEBUG(DLC_RX_DATA) {
  2511. if (userLength) {
  2512. DumpData("user space",
  2513. NULL,
  2514. userLength,
  2515. DD_NO_ADDRESS | DD_UPPER_CASE | DD_INDENT_ALL,
  2516. DEFAULT_FIELD_WIDTH,
  2517. TRUE,
  2518. Segment,
  2519. //Offset + userOffset
  2520. userOffset
  2521. );
  2522. } else {
  2523. DBGPRINT(
  2524. "user space\n"
  2525. );
  2526. }
  2527. if (dataLength) {
  2528. DumpData("rcvd data",
  2529. NULL,
  2530. dataLength,
  2531. DD_NO_ADDRESS | DD_UPPER_CASE | DD_INDENT_ALL,
  2532. DEFAULT_FIELD_WIDTH,
  2533. TRUE,
  2534. Segment,
  2535. //Offset + userOffset + userLength
  2536. (WORD)(userOffset + userLength)
  2537. );
  2538. } else {
  2539. DBGPRINT(
  2540. "rcvd data\n"
  2541. );
  2542. }
  2543. }
  2544. } else {
  2545. //
  2546. // data length is size of frame in contiguous buffer?
  2547. //
  2548. dataLength = READ_WORD(&pBuf->Contiguous.cbBuffer);
  2549. IF_DEBUG(DLC_RX_DATA) {
  2550. if (userLength) {
  2551. DumpData("user space",
  2552. NULL,
  2553. userLength,
  2554. DD_NO_ADDRESS | DD_UPPER_CASE | DD_INDENT_ALL,
  2555. DEFAULT_FIELD_WIDTH,
  2556. TRUE,
  2557. Segment,
  2558. //Offset + userOffset
  2559. userOffset
  2560. );
  2561. } else {
  2562. DBGPRINT(
  2563. "user space\n"
  2564. );
  2565. }
  2566. if (dataLength) {
  2567. DumpData("rcvd data",
  2568. NULL,
  2569. dataLength,
  2570. DD_NO_ADDRESS | DD_UPPER_CASE | DD_INDENT_ALL,
  2571. DEFAULT_FIELD_WIDTH,
  2572. TRUE,
  2573. Segment,
  2574. //Offset + userOffset + userLength
  2575. (WORD)(userOffset + userLength)
  2576. );
  2577. } else {
  2578. DBGPRINT(
  2579. "rcvd data\n"
  2580. );
  2581. }
  2582. }
  2583. }
  2584. //
  2585. // dump second & subsequent buffers
  2586. //
  2587. Segment = GET_SEGMENT(&pBuf->pNext);
  2588. Offset = GET_OFFSET(&pBuf->pNext);
  2589. for (
  2590. pBuf = (PLLC_DOS_BUFFER)READ_FAR_POINTER(&pBuf->pNext);
  2591. pBuf;
  2592. pBuf = (PLLC_DOS_BUFFER)READ_FAR_POINTER(&pBuf->pNext)
  2593. ) {
  2594. userLength = READ_WORD(&pBuf->Next.cbUserData);
  2595. dataLength = READ_WORD(&pBuf->Next.cbBuffer);
  2596. DBGPRINT(
  2597. "\n"
  2598. "Buffer 2/Subsequent @%04x:%04x\n"
  2599. "next buffer %04x:%04x\n"
  2600. "frame length %04x\n"
  2601. "data length %04x\n"
  2602. "user offset %04x\n"
  2603. "user length %04x\n",
  2604. Segment,
  2605. Offset,
  2606. GET_SEGMENT(&pBuf->pNext),
  2607. GET_OFFSET(&pBuf->pNext),
  2608. READ_WORD(&pBuf->Next.cbFrame),
  2609. dataLength,
  2610. READ_WORD(&pBuf->Next.offUserData),
  2611. userLength
  2612. );
  2613. IF_DEBUG(DLC_RX_DATA) {
  2614. if (userLength) {
  2615. DumpData("user space",
  2616. NULL,
  2617. userLength,
  2618. DD_NO_ADDRESS | DD_UPPER_CASE | DD_INDENT_ALL,
  2619. DEFAULT_FIELD_WIDTH,
  2620. TRUE,
  2621. Segment,
  2622. //Offset + READ_WORD(&pBuf->Next.offUserData)
  2623. READ_WORD(&pBuf->Next.offUserData)
  2624. );
  2625. } else {
  2626. DBGPRINT(
  2627. "user space\n"
  2628. );
  2629. }
  2630. //
  2631. // there must be received data
  2632. //
  2633. DumpData("rcvd data",
  2634. NULL,
  2635. dataLength,
  2636. DD_NO_ADDRESS | DD_UPPER_CASE | DD_INDENT_ALL,
  2637. DEFAULT_FIELD_WIDTH,
  2638. TRUE,
  2639. Segment,
  2640. //Offset + READ_WORD(&pBuf->Next.offUserData) + userLength
  2641. (WORD)(READ_WORD(&pBuf->Next.offUserData) + userLength)
  2642. );
  2643. }
  2644. Segment = GET_SEGMENT(&pBuf->pNext);
  2645. Offset = GET_OFFSET(&pBuf->pNext);
  2646. }
  2647. } else {
  2648. PLLC_BUFFER pBuf = (PLLC_BUFFER)Buffer;
  2649. BOOL contiguous = pBuf->Contiguous.uchOptions & 0xc0;
  2650. WORD userLength = pBuf->Next.cbUserData;
  2651. WORD dataLength = pBuf->Next.cbBuffer;
  2652. WORD userOffset = pBuf->Next.offUserData;
  2653. //
  2654. // Buffer 1: [not] contiguous MAC/DATA
  2655. //
  2656. DBGPRINT(
  2657. "\n"
  2658. "%sContiguous MAC/DATA frame @%08x\n"
  2659. "next buffer %08x\n"
  2660. "frame length %04x\n"
  2661. "data length %04x\n"
  2662. "user offset %04x\n"
  2663. "user length %04x\n"
  2664. "station id %04x\n"
  2665. "options %02x\n"
  2666. "message type %02x [%s]\n"
  2667. "buffers left %04x\n"
  2668. "rcv FS %02x\n"
  2669. "adapter num %02x\n",
  2670. contiguous ? "" : "Not",
  2671. pBuf,
  2672. pBuf->Contiguous.pNextBuffer,
  2673. pBuf->Contiguous.cbFrame,
  2674. pBuf->Contiguous.cbBuffer,
  2675. pBuf->Contiguous.offUserData,
  2676. pBuf->Contiguous.cbUserData,
  2677. pBuf->Contiguous.usStationId,
  2678. pBuf->Contiguous.uchOptions,
  2679. pBuf->Contiguous.uchMsgType,
  2680. MapMessageType(pBuf->Contiguous.uchMsgType),
  2681. pBuf->Contiguous.cBuffersLeft,
  2682. pBuf->Contiguous.uchRcvFS,
  2683. pBuf->Contiguous.uchAdapterNumber
  2684. );
  2685. if (!contiguous) {
  2686. DWORD cbLanHeader = (DWORD)pBuf->NotContiguous.cbLanHeader;
  2687. DWORD cbDlcHeader = (DWORD)pBuf->NotContiguous.cbDlcHeader;
  2688. DBGPRINT(
  2689. "next frame %08x\n"
  2690. "LAN hdr len %02x\n"
  2691. "DLC hdr len %02x\n",
  2692. pBuf->NotContiguous.pNextFrame,
  2693. cbLanHeader,
  2694. cbDlcHeader
  2695. );
  2696. DumpData("LAN header",
  2697. pBuf->NotContiguous.auchLanHeader,
  2698. cbLanHeader,
  2699. DD_NO_ADDRESS | DD_NO_ASCII | DD_UPPER_CASE | DD_INDENT_ALL,
  2700. DEFAULT_FIELD_WIDTH,
  2701. FALSE,
  2702. 0,
  2703. 0
  2704. );
  2705. DumpData("DLC header",
  2706. pBuf->NotContiguous.auchDlcHeader,
  2707. cbDlcHeader,
  2708. DD_NO_ADDRESS | DD_NO_ASCII | DD_UPPER_CASE | DD_INDENT_ALL,
  2709. DEFAULT_FIELD_WIDTH,
  2710. FALSE,
  2711. 0,
  2712. 0
  2713. );
  2714. IF_DEBUG(DLC_RX_DATA) {
  2715. if (userLength) {
  2716. DumpData("user space ",
  2717. (PBYTE)pBuf + userOffset,
  2718. userLength,
  2719. DD_NO_ADDRESS | DD_UPPER_CASE | DD_INDENT_ALL,
  2720. DEFAULT_FIELD_WIDTH,
  2721. FALSE,
  2722. 0,
  2723. 0
  2724. );
  2725. } else {
  2726. DBGPRINT(
  2727. "user space\n"
  2728. );
  2729. }
  2730. if (dataLength) {
  2731. DumpData("rcvd data",
  2732. (PBYTE)pBuf + userOffset + userLength,
  2733. dataLength,
  2734. DD_NO_ADDRESS | DD_UPPER_CASE | DD_INDENT_ALL,
  2735. DEFAULT_FIELD_WIDTH,
  2736. FALSE,
  2737. 0,
  2738. 0
  2739. );
  2740. } else {
  2741. DBGPRINT(
  2742. "rcvd data\n"
  2743. );
  2744. }
  2745. }
  2746. } else {
  2747. //
  2748. // data length is size of frame in contiguous buffer?
  2749. //
  2750. dataLength = pBuf->Contiguous.cbFrame;
  2751. DBGPRINT(
  2752. "next frame %08x\n",
  2753. pBuf->NotContiguous.pNextFrame
  2754. );
  2755. IF_DEBUG(DLC_RX_DATA) {
  2756. if (userLength) {
  2757. DumpData("user space",
  2758. (PBYTE)pBuf + userOffset,
  2759. userLength,
  2760. DD_NO_ADDRESS | DD_UPPER_CASE | DD_INDENT_ALL,
  2761. DEFAULT_FIELD_WIDTH,
  2762. FALSE,
  2763. 0,
  2764. 0
  2765. );
  2766. } else {
  2767. DBGPRINT(
  2768. "user space\n"
  2769. );
  2770. }
  2771. if (dataLength) {
  2772. DumpData("rcvd data",
  2773. (PBYTE)pBuf + userOffset + userLength,
  2774. dataLength,
  2775. DD_NO_ADDRESS | DD_UPPER_CASE | DD_INDENT_ALL,
  2776. DEFAULT_FIELD_WIDTH,
  2777. FALSE,
  2778. 0,
  2779. 0
  2780. );
  2781. } else {
  2782. DBGPRINT(
  2783. "rcvd data\n"
  2784. );
  2785. }
  2786. }
  2787. }
  2788. //
  2789. // dump second & subsequent buffers
  2790. //
  2791. for (pBuf = pBuf->pNext; pBuf; pBuf = pBuf->pNext) {
  2792. userLength = pBuf->Next.cbUserData;
  2793. dataLength = pBuf->Next.cbBuffer;
  2794. DBGPRINT(
  2795. "\n"
  2796. "Buffer 2/Subsequent @%08x\n"
  2797. "next buffer %08x\n"
  2798. "frame length %04x\n"
  2799. "data length %04x\n"
  2800. "user offset %04x\n"
  2801. "user length %04x\n",
  2802. pBuf,
  2803. pBuf->pNext,
  2804. pBuf->Next.cbFrame,
  2805. dataLength,
  2806. pBuf->Next.offUserData,
  2807. userLength
  2808. );
  2809. IF_DEBUG(DLC_RX_DATA) {
  2810. if (userLength) {
  2811. DumpData("user space",
  2812. (PBYTE)&pBuf + pBuf->Next.offUserData,
  2813. userLength,
  2814. DD_NO_ADDRESS | DD_UPPER_CASE | DD_INDENT_ALL,
  2815. DEFAULT_FIELD_WIDTH,
  2816. FALSE,
  2817. 0,
  2818. 0
  2819. );
  2820. } else {
  2821. DBGPRINT(
  2822. "user space\n"
  2823. );
  2824. }
  2825. //
  2826. // there must be received data
  2827. //
  2828. DumpData("rcvd data",
  2829. (PBYTE)pBuf + pBuf->Next.offUserData + userLength,
  2830. dataLength,
  2831. DD_NO_ADDRESS | DD_UPPER_CASE | DD_INDENT_ALL,
  2832. DEFAULT_FIELD_WIDTH,
  2833. FALSE,
  2834. 0,
  2835. 0
  2836. );
  2837. }
  2838. }
  2839. }
  2840. }
  2841. PRIVATE LPSTR MapMessageType(UCHAR MessageType) {
  2842. switch (MessageType) {
  2843. case 0x02:
  2844. return "MAC Frame (Direct Station on Token Ring only)";
  2845. case 0x04:
  2846. return "I-Frame";
  2847. case 0x06:
  2848. return "UI-Frame";
  2849. case 0x08:
  2850. return "XID Command (POLL)";
  2851. case 0x0a:
  2852. return "XID Command (not POLL)";
  2853. case 0x0c:
  2854. return "XID Response (FINAL)";
  2855. case 0x0e:
  2856. return "XID Response (not FINAL)";
  2857. case 0x10:
  2858. return "TEST Response (FINAL)";
  2859. case 0x12:
  2860. return "TEST Response (not FINAL)";
  2861. case 0x14:
  2862. return "OTHER - non-MAC frame (Direct Station only)";
  2863. default:
  2864. return "*** BAD FRAME TYPE ***";
  2865. }
  2866. }
  2867. VOID
  2868. DumpData(
  2869. IN LPSTR Title,
  2870. IN PBYTE Address,
  2871. IN DWORD Length,
  2872. IN DWORD Options,
  2873. IN DWORD Indent,
  2874. IN BOOL IsDos,
  2875. IN WORD Segment,
  2876. IN WORD Offset
  2877. )
  2878. {
  2879. char dumpBuf[128];
  2880. char* bufptr;
  2881. int i, n, iterations;
  2882. char* hexptr;
  2883. if (IsDos) {
  2884. Address = LPBYTE_FROM_WORDS(Segment, Offset);
  2885. }
  2886. //
  2887. // the usual dump style: 16 columns of hex bytes, followed by 16 columns
  2888. // of corresponding ASCII characters, or '.' where the character is < 0x20
  2889. // (space) or > 0x7f (del?)
  2890. //
  2891. if (Options & DD_LINE_BEFORE) {
  2892. DbgOutStr("\n");
  2893. }
  2894. iterations = 0;
  2895. while (Length) {
  2896. bufptr = dumpBuf;
  2897. if (Title && !iterations) {
  2898. strcpy(bufptr, Title);
  2899. bufptr = strchr(bufptr, 0);
  2900. }
  2901. if (Indent && ((Options & DD_INDENT_ALL) || iterations)) {
  2902. int indentLen = (!iterations && Title)
  2903. ? ((int)Indent - (int)strlen(Title) < 0)
  2904. ? 1
  2905. : Indent - strlen(Title)
  2906. : Indent;
  2907. RtlFillMemory(bufptr, indentLen, ' ');
  2908. bufptr += indentLen;
  2909. }
  2910. if (!(Options & DD_NO_ADDRESS)) {
  2911. if (IsDos) {
  2912. bufptr += sprintf(bufptr, "%04x:%04x ", Segment, Offset);
  2913. } else {
  2914. bufptr += sprintf(bufptr, "%08x: ", Address);
  2915. }
  2916. }
  2917. n = (Length < 16) ? Length : 16;
  2918. hexptr = bufptr;
  2919. for (i = 0; i < n; ++i) {
  2920. bufptr += sprintf(bufptr, "%02x", Address[i]);
  2921. *bufptr++ = (i == 7) ? '-' : ' ';
  2922. }
  2923. if (Options & DD_UPPER_CASE) {
  2924. _strupr(hexptr);
  2925. }
  2926. if (!(Options & DD_NO_ASCII)) {
  2927. if (n < 16) {
  2928. for (i = 0; i < 16-n; ++i) {
  2929. bufptr += sprintf(bufptr, " ");
  2930. }
  2931. }
  2932. bufptr += sprintf(bufptr, " ");
  2933. for (i = 0; i < n; ++i) {
  2934. *bufptr++ = (Address[i] < 0x20 || Address[i] > 0x7f) ? '.' : Address[i];
  2935. }
  2936. }
  2937. *bufptr++ = '\n';
  2938. *bufptr = 0;
  2939. DbgOutStr(dumpBuf);
  2940. Length -= n;
  2941. Address += n;
  2942. ++iterations;
  2943. //
  2944. // take care of segment wrap for DOS addresses
  2945. //
  2946. if (IsDos) {
  2947. DWORD x = (DWORD)Offset + n;
  2948. Offset = (WORD)x;
  2949. if (HIWORD(x)) {
  2950. Segment += 0x1000;
  2951. }
  2952. }
  2953. }
  2954. if (Options & DD_LINE_AFTER) {
  2955. DbgOutStr("\n");
  2956. }
  2957. }
  2958. //
  2959. // CCB1 error checking
  2960. //
  2961. #define BITS_PER_BYTE 8
  2962. #define CCB1_ERROR_SPREAD ((MAX_CCB1_ERROR + BITS_PER_BYTE) & ~(BITS_PER_BYTE-1))
  2963. //
  2964. // Ccb1ErrorTable - for each command described in IBM Lan Tech. Ref. (including
  2965. // those not applicable to CCB1), we keep a list of the permissable error codes
  2966. // which are taken from the "Return Codes for CCB1 Commands" table on pp B-5
  2967. // and B-6
  2968. // The error list is an 80-bit bitmap in which an ON bit indicates that the
  2969. // error number corresponding to the bit's position is allowable for the CCB1
  2970. // command corresponding to the list's index in the table
  2971. //
  2972. typedef struct {
  2973. BOOL ValidForCcb1;
  2974. BYTE ErrorList[CCB1_ERROR_SPREAD/BITS_PER_BYTE];
  2975. char* CommandName;
  2976. } CCB1_ERROR_TABLE;
  2977. #define MAX_INCLUSIVE_CCB1_COMMAND LLC_MAX_DLC_COMMAND
  2978. CCB1_ERROR_TABLE Ccb1ErrorTable[MAX_INCLUSIVE_CCB1_COMMAND + 1] = {
  2979. // DIR.INTERRUPT (0x00)
  2980. {
  2981. TRUE,
  2982. {0x83, 0x02, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
  2983. "DIR.INTERRUPT"
  2984. },
  2985. // DIR.MODIFY.OPEN.PARMS (0x01)
  2986. {
  2987. TRUE,
  2988. {0x97, 0x02, 0x40, 0x39, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
  2989. "DIR.MODIFY.OPEN.PARMS"
  2990. },
  2991. // DIR.RESTORE.OPEN.PARMS (0x02)
  2992. {
  2993. TRUE,
  2994. {0xd3, 0x02, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
  2995. "DIR.RESTORE.OPEN.PARMS"
  2996. },
  2997. // DIR.OPEN.ADAPTER (0x03)
  2998. {
  2999. TRUE,
  3000. {0xaf, 0x02, 0x45, 0x79, 0x00, 0x00, 0x1d, 0x00, 0x00, 0x00},
  3001. "DIR.OPEN.ADAPTER"
  3002. },
  3003. // DIR.CLOSE.ADAPTER (0x04)
  3004. {
  3005. TRUE,
  3006. {0xb3, 0x02, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
  3007. "DIR.CLOSE.ADAPTER"
  3008. },
  3009. // non-existent command (0x05)
  3010. {
  3011. FALSE,
  3012. {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
  3013. "NON-EXISTENT COMMAND (0x05)"
  3014. },
  3015. // DIR.SET.GROUP.ADDRESS (0x06)
  3016. {
  3017. TRUE,
  3018. {0x93, 0x0a, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
  3019. "DIR.SET.GROUP.ADDRESS"
  3020. },
  3021. // DIR.SET.FUNCTIONAL.ADDRESS (0x07)
  3022. {
  3023. TRUE,
  3024. {0x93, 0x0a, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
  3025. "DIR.SET.FUNCTIONAL.ADDRESS"
  3026. },
  3027. // DIR.READ.LOG (0x08)
  3028. {
  3029. TRUE,
  3030. {0x93, 0x0a, 0x28, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
  3031. "DIR.READ.LOG"
  3032. },
  3033. // non-existent command (0x09)
  3034. {
  3035. FALSE,
  3036. {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
  3037. "NON-EXISTENT COMMAND (0x09)"
  3038. },
  3039. // TRANSMIT.DIR.FRAME (0x0a)
  3040. {
  3041. TRUE,
  3042. {0x93, 0x0f, 0x00, 0x28, 0xbc, 0x01, 0x00, 0x00, 0x13, 0x04},
  3043. "TRANSMIT.DIR.FRAME"
  3044. },
  3045. // TRANSMIT.I.FRAME (0x0b)
  3046. {
  3047. TRUE,
  3048. {0x93, 0x0f, 0x00, 0x28, 0xbc, 0x01, 0x00, 0x00, 0x13, 0x04},
  3049. "TRANSMIT.I.FRAME"
  3050. },
  3051. // non-existent command (0x0c)
  3052. {
  3053. FALSE,
  3054. {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
  3055. "NON-EXISTENT COMMAND (0x0c)"
  3056. },
  3057. // TRANSMIT.UI.FRAME (0x0d)
  3058. {
  3059. TRUE,
  3060. {0x93, 0x0f, 0x00, 0x28, 0xbc, 0x01, 0x00, 0x00, 0x13, 0x04},
  3061. "TRANSMIT.UI.FRAME"
  3062. },
  3063. // TRANSMIT.XID.CMD (0x0e)
  3064. {
  3065. TRUE,
  3066. {0x93, 0x0f, 0x00, 0x28, 0xbc, 0x01, 0x00, 0x00, 0x13, 0x04},
  3067. "TRANSMIT.XID.CMD"
  3068. },
  3069. // TRANSMIT.XID.RESP.FINAL (0x0f)
  3070. {
  3071. TRUE,
  3072. {0x93, 0x0f, 0x00, 0x28, 0xbc, 0x01, 0x00, 0x00, 0x13, 0x04},
  3073. "TRANSMIT.XID.RESP.FINAL"
  3074. },
  3075. // TRANSMIT.XID.RESP.NOT.FINAL (0x10)
  3076. {
  3077. TRUE,
  3078. {0x93, 0x0f, 0x00, 0x28, 0xbc, 0x01, 0x00, 0x00, 0x13, 0x04},
  3079. "TRANSMIT.XID.RESP.NOT.FINAL"
  3080. },
  3081. // TRANSMIT.TEST.CMD (0x11)
  3082. {
  3083. TRUE,
  3084. {0x93, 0x0f, 0x00, 0x28, 0xbc, 0x01, 0x00, 0x00, 0x13, 0x04},
  3085. "TRANSMIT.TEST.CMD"
  3086. },
  3087. // non-existent command (0x12)
  3088. {
  3089. FALSE,
  3090. {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
  3091. "NON-EXISTENT COMMAND (0x12)"
  3092. },
  3093. // non-existent command (0x13)
  3094. {
  3095. FALSE,
  3096. {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
  3097. "NON-EXISTENT COMMAND (0x13)"
  3098. },
  3099. // DLC.RESET (0x14)
  3100. {
  3101. TRUE,
  3102. {0x93, 0x0a, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00},
  3103. "DLC.RESET"
  3104. },
  3105. // DLC.OPEN.SAP (0x15)
  3106. {
  3107. TRUE,
  3108. {0xd3, 0x0b, 0x40, 0x39, 0x00, 0x00, 0x00, 0x00, 0x6c, 0x02},
  3109. "DLC.OPEN.SAP"
  3110. },
  3111. // DLC.CLOSE.SAP (0x16)
  3112. {
  3113. TRUE,
  3114. {0x93, 0x0a, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x81, 0x11},
  3115. "DLC.CLOSE.SAP"
  3116. },
  3117. // DLC.REALLOCATE (0x17)
  3118. {
  3119. TRUE,
  3120. {0x93, 0x01, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00},
  3121. "DLC.REALLOCATE"
  3122. },
  3123. // non-existent command (0x18)
  3124. {
  3125. FALSE,
  3126. {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
  3127. "NON-EXISTENT COMMAND (0x18)"
  3128. },
  3129. // DLC.OPEN.STATION (0x19)
  3130. {
  3131. TRUE,
  3132. {0xb3, 0x0b, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x4d, 0x80},
  3133. "DLC.OPEN.STATION"
  3134. },
  3135. // DLC.CLOSE.STATION (0x1a)
  3136. {
  3137. TRUE,
  3138. {0x93, 0x0a, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x81, 0x18},
  3139. "DLC.CLOSE.STATION"
  3140. },
  3141. // DLC.CONNECT.STATION (0x1b)
  3142. {
  3143. TRUE,
  3144. {0x97, 0x0a, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x13, 0x24},
  3145. "DLC.CONNECT.STATION"
  3146. },
  3147. // DLC.MODIFY (0x1c)
  3148. {
  3149. TRUE,
  3150. {0x93, 0x0b, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, 0x25, 0x42},
  3151. "DLC.MODIFY"
  3152. },
  3153. // DLC.FLOW.CONTROL (0x1d)
  3154. {
  3155. TRUE,
  3156. {0x93, 0x0a, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00},
  3157. "DLC.FLOW.CONTROL"
  3158. },
  3159. // DLC.STATISTICS (0x1e)
  3160. {
  3161. TRUE,
  3162. {0x93, 0x0a, 0x20, 0x28, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00},
  3163. "DLC.STATISTICS"
  3164. },
  3165. // non-existent command (0x1f)
  3166. {
  3167. FALSE,
  3168. {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
  3169. "NON-EXISTENT COMMAND (0x1f)"
  3170. },
  3171. // DIR.INITIALIZE (0x20)
  3172. {
  3173. TRUE,
  3174. {0x87, 0x00, 0x10, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
  3175. "DIR.INITIALIZE"
  3176. },
  3177. // DIR.STATUS (0x21)
  3178. {
  3179. TRUE,
  3180. {0x03, 0x12, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
  3181. "DIR.STATUS"
  3182. },
  3183. // DIR.TIMER.SET (0x22)
  3184. {
  3185. TRUE,
  3186. {0x83, 0x0e, 0x02, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
  3187. "DIR.TIMER.SET"
  3188. },
  3189. // DIR.TIMER.CANCEL (0x23)
  3190. {
  3191. TRUE,
  3192. {0x03, 0x02, 0x02, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
  3193. "DIR.TIMER.CANCEL"
  3194. },
  3195. // PDT.TRACE.ON (0x24)
  3196. {
  3197. TRUE,
  3198. {0x45, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
  3199. "PDT.TRACE.ON"
  3200. },
  3201. // PDT.TRACE.OFF (0x25)
  3202. {
  3203. TRUE,
  3204. {0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
  3205. "PDT.TRACE.OFF"
  3206. },
  3207. // BUFFER.GET (0x26)
  3208. {
  3209. TRUE,
  3210. {0x13, 0x02, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00},
  3211. "BUFFER.GET"
  3212. },
  3213. // BUFFER.FREE (0x27)
  3214. {
  3215. TRUE,
  3216. {0x13, 0x02, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00},
  3217. "BUFFER.FREE"
  3218. },
  3219. // RECEIVE (0x28)
  3220. {
  3221. TRUE,
  3222. {0x97, 0x0e, 0x00, 0x3c, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00},
  3223. "RECEIVE"
  3224. },
  3225. // RECEIVE.CANCEL (0x29)
  3226. {
  3227. TRUE,
  3228. {0x13, 0x02, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00},
  3229. "RECEIVE.CANCEL"
  3230. },
  3231. // RECEIVE.MODIFY (0x2a)
  3232. {
  3233. TRUE,
  3234. {0x97, 0x0e, 0x00, 0x3c, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00},
  3235. "RECEIVE.MODIFY"
  3236. },
  3237. // DIR.DEFINE.MIF.ENVIRONMENT (0x2b)
  3238. {
  3239. TRUE,
  3240. {0x03, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
  3241. "DIR.DEFINE.MIF.ENVIRONMENT"
  3242. },
  3243. // DIR.TIMER.CANCEL.GROUP (0x2c)
  3244. {
  3245. TRUE,
  3246. {0x03, 0x02, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
  3247. "DIR.TIMER.CANCEL.GROUP"
  3248. },
  3249. // DIR.SET.USER.APPENDAGE (0x2d)
  3250. {
  3251. TRUE,
  3252. {0x93, 0x02, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
  3253. "DIR.SET.USER.APPENDAGE"
  3254. },
  3255. // non-existent command (0x2e)
  3256. {
  3257. FALSE,
  3258. {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
  3259. "NON-EXISTENT COMMAND (0x2e)"
  3260. },
  3261. // non-existent command (0x2f)
  3262. {
  3263. FALSE,
  3264. {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
  3265. "NON-EXISTENT COMMAND (0x2f)"
  3266. },
  3267. // non-existent command (0x30)
  3268. {
  3269. FALSE,
  3270. {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
  3271. "NON-EXISTENT COMMAND (0x30)"
  3272. },
  3273. // READ (0x31)
  3274. {
  3275. FALSE,
  3276. {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
  3277. "READ"
  3278. },
  3279. // READ.CANCEL (0x32)
  3280. {
  3281. FALSE,
  3282. {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
  3283. "READ.CANCEL"
  3284. },
  3285. // DLC.SET.THRESHOLD (0x33)
  3286. {
  3287. FALSE,
  3288. {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
  3289. "DLC.SET.THRESHOLD"
  3290. },
  3291. // DIR.CLOSE.DIRECT (0x34)
  3292. {
  3293. FALSE,
  3294. {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
  3295. "DIR.CLOSE.DIRECT"
  3296. },
  3297. // DIR.OPEN.DIRECT (0x35)
  3298. {
  3299. FALSE,
  3300. {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
  3301. "DIR.OPEN.DIRECT"
  3302. },
  3303. // PURGE.RESOURCES (0x36)
  3304. {
  3305. FALSE,
  3306. {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
  3307. "PURGE.RESOURCES"
  3308. },
  3309. // LLC_MAX_DLC_COMMAND (0x37) ?
  3310. {
  3311. FALSE,
  3312. {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
  3313. "NON-EXISTENT-COMMAND (0x37)"
  3314. }
  3315. };
  3316. BOOL
  3317. IsCcbErrorCodeAllowable(
  3318. IN BYTE CcbCommand,
  3319. IN BYTE CcbErrorCode
  3320. )
  3321. /*++
  3322. Routine Description:
  3323. Check whether an error code is allowable for a particular CCB(1) command
  3324. code. Perform range check on the error code before using as index into
  3325. allowable error table
  3326. Arguments:
  3327. CcbCommand - Command code
  3328. CcbErrorCode - Return code
  3329. Return Value:
  3330. BOOL
  3331. TRUE - CcbErrorCode is valid for CcbCommand
  3332. FALSE - CcbErrorCode should not be returned for CcbCommand
  3333. OR CcbErrorCode is invalid (out of range)
  3334. --*/
  3335. {
  3336. if (CcbErrorCode == CCB_COMMAND_IN_PROGRESS) {
  3337. return TRUE;
  3338. }
  3339. if (CcbErrorCode > MAX_CCB1_ERROR)
  3340. return FALSE;
  3341. return Ccb1ErrorTable[CcbCommand].ErrorList[CcbErrorCode/8] & (1 << (CcbErrorCode % 8));
  3342. }
  3343. BOOL
  3344. IsCcbErrorCodeValid(
  3345. IN BYTE CcbErrorCode
  3346. )
  3347. /*++
  3348. Routine Description:
  3349. Check if a return code from a CCB(1) is an allowable return code,
  3350. irrespective of command type
  3351. Arguments:
  3352. CcbErrorCode - return code to check
  3353. Return Value:
  3354. BOOL
  3355. TRUE - CcbErrorCode is in range
  3356. FALSE - CcbErrorCode is not in range
  3357. --*/
  3358. {
  3359. return (CcbErrorCode == CCB_COMMAND_IN_PROGRESS) // 0xff
  3360. // 0x00 - 0x0c
  3361. || ((CcbErrorCode >= CCB_SUCCESS) && (CcbErrorCode <= CCB_SUCCESS_ADAPTER_NOT_OPEN))
  3362. // 0x10 - 0x1e
  3363. || ((CcbErrorCode >= CCB_NETBIOS_FAILURE) && (CcbErrorCode <= CCB_INVALID_FUNCTION_ADDRESS))
  3364. // 0x20 - 0x28
  3365. || ((CcbErrorCode >= CCB_DATA_LOST_NO_BUFFERS) && (CcbErrorCode <= CCB_INVALID_FRAME_LENGTH))
  3366. // 0x30
  3367. || (CcbErrorCode == CCB_NOT_ENOUGH_BUFFERS_OPEN)
  3368. // 0x32 - 0x34
  3369. || ((CcbErrorCode >= CCB_INVALID_NODE_ADDRESS) && (CcbErrorCode <= CCB_INVALID_TRANSMIT_LENGTH))
  3370. // 0x40 - 0x4f
  3371. || ((CcbErrorCode >= CCB_INVALID_STATION_ID) && (CcbErrorCode <= CCB_INVALID_REMOTE_ADDRESS))
  3372. ;
  3373. }
  3374. BOOL
  3375. IsCcbCommandValid(
  3376. IN BYTE CcbCommand
  3377. )
  3378. /*++
  3379. Routine Description:
  3380. Check if CCB command code is one of the allowable codes for a DOS CCB
  3381. (CCB1)
  3382. Arguments:
  3383. CcbCommand - command code to check
  3384. Return Value:
  3385. BOOL
  3386. TRUE - CcbCommand is recognized
  3387. FALSE - CcbCommand is not recognized
  3388. --*/
  3389. {
  3390. return ((CcbCommand >= LLC_DIR_INTERRUPT) && (CcbCommand <= LLC_DIR_CLOSE_ADAPTER))
  3391. || ((CcbCommand >= LLC_DIR_SET_GROUP_ADDRESS) && (CcbCommand <= LLC_DIR_SET_FUNCTIONAL_ADDRESS))
  3392. || ((CcbCommand >= LLC_TRANSMIT_DIR_FRAME) && (CcbCommand <= LLC_TRANSMIT_I_FRAME))
  3393. || ((CcbCommand >= LLC_TRANSMIT_UI_FRAME) && (CcbCommand <= LLC_TRANSMIT_TEST_CMD))
  3394. || ((CcbCommand >= LLC_DLC_RESET) && (CcbCommand <= LLC_DLC_REALLOCATE_STATIONS))
  3395. || ((CcbCommand >= LLC_DLC_OPEN_STATION) && (CcbCommand <= LLC_DLC_STATISTICS))
  3396. || ((CcbCommand >= LLC_DIR_INITIALIZE) && (CcbCommand <= LLC_DIR_SET_USER_APPENDAGE))
  3397. ;
  3398. }
  3399. LPSTR
  3400. MapCcbCommandToName(
  3401. IN BYTE CcbCommand
  3402. )
  3403. /*++
  3404. Routine Description:
  3405. Return the name of a CCB command, given its value
  3406. Arguments:
  3407. CcbCommand - command code to map
  3408. Return Value:
  3409. char* pointer to ASCIZ name of command (in IBM format X.Y.Z)
  3410. --*/
  3411. {
  3412. return Ccb1ErrorTable[CcbCommand].CommandName;
  3413. }
  3414. VOID
  3415. DumpDosAdapter(
  3416. IN DOS_ADAPTER* pDosAdapter
  3417. )
  3418. {
  3419. DBGPRINT( "DOS_ADAPTER @ %08x\n"
  3420. "AdapterType. . . . . . . . . %s\n"
  3421. "IsOpen . . . . . . . . . . . %d\n"
  3422. "DirectStationOpen. . . . . . %d\n"
  3423. "DirectReceive. . . . . . . . %d\n"
  3424. "WaitingRestore . . . . . . . %d\n"
  3425. "BufferFree . . . . . . . . . %d\n"
  3426. "BufferPool . . . . . . . . . %08x\n"
  3427. "CurrentExceptionHandlers . . %08x %08x %08x\n"
  3428. "PreviousExceptionHandlers. . %08x %08x %08x\n"
  3429. "DlcStatusChangeAppendage . . \n"
  3430. "LastNetworkStatusChange. . . %04x\n"
  3431. "UserStatusValue. . . . . . . \n"
  3432. "AdapterParms:\n"
  3433. " OpenErrorCode . . . . . . %04x\n"
  3434. " OpenOptions . . . . . . . %04x\n"
  3435. " NodeAddress . . . . . . . %02x-%02x-%02x-%02x-%02x-%02x\n"
  3436. " GroupAddress. . . . . . . %08x\n"
  3437. " FunctionalAddress . . . . %08x\n"
  3438. " NumberReceiveBuffers. . . %04x\n"
  3439. " ReceiveBufferLength . . . %04x\n"
  3440. " DataHoldBufferLength. . . %04x\n"
  3441. " NumberDataHoldBuffers . . %02x\n"
  3442. " Reserved. . . . . . . . . %02x\n"
  3443. " OpenLock. . . . . . . . . %04x\n"
  3444. " ProductId . . . . . . . . %08x\n"
  3445. "DlcSpecified . . . . . . . . %d\n"
  3446. "DlcParms:\n"
  3447. " MaxSaps . . . . . . . . . %02x\n"
  3448. " MaxStations . . . . . . . %02x\n"
  3449. " MaxGroupSaps. . . . . . . %02x\n"
  3450. " MaxGroupMembers . . . . . %02x\n"
  3451. " T1Tick1 . . . . . . . . . %02x\n"
  3452. " T2Tick1 . . . . . . . . . %02x\n"
  3453. " TiTick1 . . . . . . . . . %02x\n"
  3454. " T1Tick2 . . . . . . . . . %02x\n"
  3455. " T2Tick2 . . . . . . . . . %02x\n"
  3456. " TiTick2 . . . . . . . . . %02x\n"
  3457. "AdapterCloseCcb. . . . . . . \n"
  3458. "DirectCloseCcb . . . . . . . \n"
  3459. "ReadCcb. . . . . . . . . . . \n"
  3460. "EventQueueCritSec. . . . . . \n"
  3461. "EventQueueHead . . . . . . . \n"
  3462. "EventQueueTail . . . . . . . \n"
  3463. "QueueElements. . . . . . . . \n"
  3464. "LocalBusyCritSec . . . . . . \n"
  3465. "DeferredReceives . . . . . . \n"
  3466. "FirstIndex . . . . . . . . . \n"
  3467. "LastIndex. . . . . . . . . . \n"
  3468. "LocalBusyInfo. . . . . . . . \n",
  3469. MapAdapterType(pDosAdapter->AdapterType),
  3470. pDosAdapter->IsOpen,
  3471. pDosAdapter->DirectStationOpen,
  3472. pDosAdapter->DirectReceive,
  3473. pDosAdapter->WaitingRestore,
  3474. pDosAdapter->BufferFree,
  3475. pDosAdapter->BufferPool,
  3476. pDosAdapter->CurrentExceptionHandlers[0],
  3477. pDosAdapter->CurrentExceptionHandlers[1],
  3478. pDosAdapter->CurrentExceptionHandlers[2],
  3479. pDosAdapter->PreviousExceptionHandlers[0],
  3480. pDosAdapter->PreviousExceptionHandlers[1],
  3481. pDosAdapter->PreviousExceptionHandlers[2],
  3482. pDosAdapter->LastNetworkStatusChange,
  3483. pDosAdapter->AdapterParms.OpenErrorCode,
  3484. pDosAdapter->AdapterParms.OpenOptions,
  3485. pDosAdapter->AdapterParms.NodeAddress[0],
  3486. pDosAdapter->AdapterParms.NodeAddress[1],
  3487. pDosAdapter->AdapterParms.NodeAddress[2],
  3488. pDosAdapter->AdapterParms.NodeAddress[3],
  3489. pDosAdapter->AdapterParms.NodeAddress[4],
  3490. pDosAdapter->AdapterParms.NodeAddress[5],
  3491. pDosAdapter->AdapterParms.GroupAddress,
  3492. pDosAdapter->AdapterParms.FunctionalAddress,
  3493. pDosAdapter->AdapterParms.NumberReceiveBuffers,
  3494. pDosAdapter->AdapterParms.ReceiveBufferLength,
  3495. pDosAdapter->AdapterParms.DataHoldBufferLength,
  3496. pDosAdapter->AdapterParms.NumberDataHoldBuffers,
  3497. pDosAdapter->AdapterParms.Reserved,
  3498. pDosAdapter->AdapterParms.OpenLock,
  3499. pDosAdapter->AdapterParms.ProductId,
  3500. pDosAdapter->DlcSpecified,
  3501. pDosAdapter->DlcParms.MaxSaps,
  3502. pDosAdapter->DlcParms.MaxStations,
  3503. pDosAdapter->DlcParms.MaxGroupSaps,
  3504. pDosAdapter->DlcParms.MaxGroupMembers,
  3505. pDosAdapter->DlcParms.T1Tick1,
  3506. pDosAdapter->DlcParms.T2Tick1,
  3507. pDosAdapter->DlcParms.TiTick1,
  3508. pDosAdapter->DlcParms.T1Tick2,
  3509. pDosAdapter->DlcParms.T2Tick2,
  3510. pDosAdapter->DlcParms.TiTick2
  3511. );
  3512. }
  3513. PRIVATE
  3514. LPSTR
  3515. MapAdapterType(
  3516. IN ADAPTER_TYPE AdapterType
  3517. )
  3518. {
  3519. switch (AdapterType) {
  3520. case TokenRing:
  3521. return "Token Ring";
  3522. case Ethernet:
  3523. return "Ethernet";
  3524. case PcNetwork:
  3525. return "PC Network";
  3526. case UnknownAdapter:
  3527. return "Unknown Adapter";
  3528. }
  3529. return "*** REALLY UNKNOWN ADAPTER! ***";
  3530. }
  3531. #endif