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.

770 lines
24 KiB

  1. /*
  2. (C) Copyright 1998
  3. All rights reserved.
  4. Portions of this software are:
  5. (C) Copyright 1995, 1999 TriplePoint, Inc. -- http://www.TriplePoint.com
  6. License to use this software is granted under the terms outlined in
  7. the TriplePoint Software Services Agreement.
  8. (C) Copyright 1992 Microsoft Corp. -- http://www.Microsoft.com
  9. License to use this software is granted under the terms outlined in
  10. the Microsoft Windows Device Driver Development Kit.
  11. @doc INTERNAL BChannel BChannel_c
  12. @module BChannel.c |
  13. This module implements the interface to the <t BCHANNEL_OBJECT>.
  14. Supports the high-level channel control functions used by the NDIS WAN
  15. Minport driver. This module isolates most the vendor specific channel
  16. access interfaces. It will require some changes to accomodate your
  17. hardware device's channel access methods.
  18. @head3 Contents |
  19. @index class,mfunc,func,msg,mdata,struct,enum | BChannel_c
  20. @end
  21. */
  22. #define __FILEID__ BCHANNEL_OBJECT_TYPE
  23. // Unique file ID for error logging
  24. #include "Miniport.h" // Defines all the miniport objects
  25. #if defined(NDIS_LCODE)
  26. # pragma NDIS_LCODE // Windows 95 wants this code locked down!
  27. # pragma NDIS_LDATA
  28. #endif
  29. DBG_STATIC ULONG g_BChannelInstanceCounter // @globalv
  30. // Keeps track of how many <t BCHANNEL_OBJECT>s are created.
  31. = 0;
  32. /* @doc EXTERNAL INTERNAL BChannel BChannel_c g_BChannelParameters
  33. @topic 5.3 BChannel Parameters |
  34. This section describes the registry parameters read into the
  35. <t BCHANNEL_OBJECT>.
  36. @globalv PARAM_TABLE | g_BChannelParameters |
  37. This table defines the registry based parameters to be assigned to data
  38. members of the <t BCHANNEL_OBJECT>.
  39. <f Note>:
  40. If you add any registry based data members to <t BCHANNEL_OBJECT>
  41. you will need to modify <f BChannelReadParameters> and add the parameter
  42. definitions to the <f g_BChannelParameters> table.
  43. */
  44. DBG_STATIC PARAM_TABLE g_BChannelParameters[] =
  45. {
  46. PARAM_ENTRY(BCHANNEL_OBJECT,
  47. TODO, PARAM_TODO,
  48. FALSE, NdisParameterInteger, 0,
  49. 0, 0, 0),
  50. /* The last entry must be an empty string! */
  51. { { 0 } }
  52. };
  53. /* @doc INTERNAL BChannel BChannel_c BChannelReadParameters
  54. @func
  55. <f BChannelReadParameters> reads the BChannel parameters from the registry
  56. and initializes the associated data members. This should only be called
  57. by <f BChannelCreate>.
  58. @rdesc
  59. <f BChannelReadParameters> returns zero if it is successful.<nl>
  60. Otherwise, a non-zero return value indicates an error condition.
  61. <f Note>:
  62. If you add any registry based data members to <t BCHANNEL_OBJECT>
  63. you will need to modify <f BChannelReadParameters> and add the parameter
  64. definitions to the <f g_BChannelParameters> table.
  65. */
  66. DBG_STATIC NDIS_STATUS BChannelReadParameters(
  67. IN PBCHANNEL_OBJECT pBChannel // @parm
  68. // A pointer to the <t BCHANNEL_OBJECT> returned by <f BChannelCreate>.
  69. )
  70. {
  71. DBG_FUNC("BChannelReadParameters")
  72. NDIS_STATUS Status;
  73. // Status result returned from an NDIS function call.
  74. PMINIPORT_ADAPTER_OBJECT pAdapter;
  75. // A pointer to the <t MINIPORT_ADAPTER_OBJECT>.
  76. ASSERT(pBChannel && pBChannel->ObjectType == BCHANNEL_OBJECT_TYPE);
  77. pAdapter = GET_ADAPTER_FROM_BCHANNEL(pBChannel);
  78. DBG_ENTER(pAdapter);
  79. /*
  80. // Parse the registry parameters.
  81. */
  82. Status = ParamParseRegistry(
  83. pAdapter->MiniportAdapterHandle,
  84. pAdapter->WrapperConfigurationContext,
  85. (PUCHAR)pBChannel,
  86. g_BChannelParameters
  87. );
  88. if (Status == NDIS_STATUS_SUCCESS)
  89. {
  90. /*
  91. // Make sure the parameters are valid.
  92. */
  93. if (pBChannel->TODO)
  94. {
  95. DBG_ERROR(pAdapter,("Invalid parameter\n"
  96. ));
  97. NdisWriteErrorLogEntry(
  98. pAdapter->MiniportAdapterHandle,
  99. NDIS_ERROR_CODE_UNSUPPORTED_CONFIGURATION,
  100. 3,
  101. pBChannel->TODO,
  102. __FILEID__,
  103. __LINE__
  104. );
  105. Status = NDIS_STATUS_FAILURE;
  106. }
  107. else
  108. {
  109. /*
  110. // Finish setting up data members based on registry settings.
  111. */
  112. }
  113. }
  114. DBG_RETURN(pAdapter, Status);
  115. return (Status);
  116. }
  117. /* @doc INTERNAL BChannel BChannel_c BChannelCreateObjects
  118. @func
  119. <f BChannelCreateObjects> calls the create routines for all the objects
  120. contained in <t BCHANNEL_OBJECT>. This should only be called
  121. by <f BChannelCreate>.
  122. <f Note>:
  123. If you add any new objects to <t BCHANNEL_OBJECT> you will need
  124. to modify <f BChannelCreateObjects> and <f BChannelDestroyObjects> so they
  125. will get created and destroyed properly.
  126. @rdesc
  127. <f BChannelCreateObjects> returns zero if it is successful.<nl>
  128. Otherwise, a non-zero return value indicates an error condition.
  129. */
  130. DBG_STATIC NDIS_STATUS BChannelCreateObjects(
  131. IN PBCHANNEL_OBJECT pBChannel // @parm
  132. // A pointer to the <t BCHANNEL_OBJECT> returned by <f BChannelCreate>.
  133. )
  134. {
  135. DBG_FUNC("BChannelCreateObjects")
  136. NDIS_STATUS Result = NDIS_STATUS_SUCCESS;
  137. // Holds the result code returned by this function.
  138. PMINIPORT_ADAPTER_OBJECT pAdapter;
  139. // A pointer to the <t MINIPORT_ADAPTER_OBJECT>.
  140. ASSERT(pBChannel && pBChannel->ObjectType == BCHANNEL_OBJECT_TYPE);
  141. pAdapter = GET_ADAPTER_FROM_BCHANNEL(pBChannel);
  142. DBG_ENTER(pAdapter);
  143. // TODO - Add code here
  144. DBG_RETURN(pAdapter, Result);
  145. return (Result);
  146. }
  147. /* @doc INTERNAL BChannel BChannel_c BChannelCreate
  148. @func
  149. <f BChannelCreate> allocates memory for a <t BCHANNEL_OBJECT> and then
  150. initializes the data members to their starting state.
  151. If successful, <p ppBChannel> will be set to point to the newly created
  152. <t BCHANNEL_OBJECT>. Otherwise, <p ppBChannel> will be set to NULL.
  153. @comm
  154. This function should be called only once when the Miniport is loaded.
  155. Before the Miniport is unloaded, <f BChannelDestroy> must be called to
  156. release the <t BCHANNEL_OBJECT> created by this function.
  157. @rdesc
  158. <f BChannelCreate> returns zero if it is successful.<nl>
  159. Otherwise, a non-zero return value indicates an error condition.
  160. */
  161. NDIS_STATUS BChannelCreate(
  162. OUT PBCHANNEL_OBJECT * ppBChannel, // @parm
  163. // Points to a caller-defined memory location to which this function
  164. // writes the virtual address of the allocated <t BCHANNEL_OBJECT>.
  165. IN ULONG BChannelIndex, // @parm
  166. // Index into the pBChannelArray.
  167. IN PUCHAR pTapiLineAddress, // @parm
  168. // A pointer to the RAS/TAPI line address assigned to each RAS line.
  169. IN PMINIPORT_ADAPTER_OBJECT pAdapter // @parm
  170. // A pointer to the <t MINIPORT_ADAPTER_OBJECT> instance.
  171. )
  172. {
  173. DBG_FUNC("BChannelCreate")
  174. PBCHANNEL_OBJECT pBChannel;
  175. // Pointer to our newly allocated object.
  176. NDIS_STATUS Result = NDIS_STATUS_SUCCESS;
  177. // Holds the result code returned by this function.
  178. ASSERT(pAdapter && pAdapter->ObjectType == MINIPORT_ADAPTER_OBJECT_TYPE);
  179. DBG_ENTER(pAdapter);
  180. /*
  181. // Make sure the caller's object pointer is NULL to begin with.
  182. // It will be set later only if everything is successful.
  183. */
  184. *ppBChannel = NULL;
  185. /*
  186. // Allocate memory for the object.
  187. */
  188. Result = ALLOCATE_OBJECT(pBChannel, pAdapter->MiniportAdapterHandle);
  189. if (Result == NDIS_STATUS_SUCCESS)
  190. {
  191. /*
  192. // Zero everything to begin with.
  193. // Then set the object type and assign a unique ID .
  194. */
  195. pBChannel->ObjectType = BCHANNEL_OBJECT_TYPE;
  196. pBChannel->ObjectID = ++g_BChannelInstanceCounter;
  197. /*
  198. // Initialize the member variables to their default settings.
  199. */
  200. pBChannel->pAdapter = pAdapter;
  201. pBChannel->BChannelIndex = BChannelIndex;
  202. if(strlen(pTapiLineAddress) < sizeof(pBChannel->pTapiLineAddress))
  203. {
  204. strcpy(pBChannel->pTapiLineAddress, pTapiLineAddress);
  205. }
  206. else
  207. {
  208. strncpy(pBChannel->pTapiLineAddress, pTapiLineAddress, sizeof(pBChannel->pTapiLineAddress)-1);
  209. pBChannel->pTapiLineAddress[sizeof(pBChannel->pTapiLineAddress)-1] = '0';
  210. }
  211. // TODO - Add code here
  212. /*
  213. // Parse the registry parameters.
  214. */
  215. Result = BChannelReadParameters(pBChannel);
  216. /*
  217. // If all goes well, we are ready to create the sub-components.
  218. */
  219. if (Result == NDIS_STATUS_SUCCESS)
  220. {
  221. Result = BChannelCreateObjects(pBChannel);
  222. }
  223. if (Result == NDIS_STATUS_SUCCESS)
  224. {
  225. /*
  226. // All is well, so return the object pointer to the caller.
  227. */
  228. *ppBChannel = pBChannel;
  229. }
  230. else
  231. {
  232. /*
  233. // Something went wrong, so let's make sure everything is
  234. // cleaned up.
  235. */
  236. BChannelDestroy(pBChannel);
  237. }
  238. }
  239. DBG_RETURN(pAdapter, Result);
  240. return (Result);
  241. }
  242. /* @doc INTERNAL BChannel BChannel_c BChannelDestroyObjects
  243. @func
  244. <f BChannelDestroyObjects> calls the destroy routines for all the objects
  245. contained in <t BCHANNEL_OBJECT>. This should only be called by
  246. <f BChannelDestroy>.
  247. <f Note>:
  248. If you add any new objects to <t PBCHANNEL_OBJECT> you will need to
  249. modify <f BChannelCreateObjects> and <f BChannelDestroyObjects> so they
  250. will get created and destroyed properly.
  251. */
  252. DBG_STATIC void BChannelDestroyObjects(
  253. IN PBCHANNEL_OBJECT pBChannel // @parm
  254. // A pointer to the <t BCHANNEL_OBJECT> returned by <f BChannelCreate>.
  255. )
  256. {
  257. DBG_FUNC("BChannelDestroyObjects")
  258. PMINIPORT_ADAPTER_OBJECT pAdapter;
  259. // A pointer to the <t MINIPORT_ADAPTER_OBJECT>.
  260. ASSERT(pBChannel && pBChannel->ObjectType == BCHANNEL_OBJECT_TYPE);
  261. pAdapter = GET_ADAPTER_FROM_BCHANNEL(pBChannel);
  262. DBG_ENTER(pAdapter);
  263. // TODO - Add code here
  264. DBG_LEAVE(pAdapter);
  265. }
  266. /* @doc INTERNAL BChannel BChannel_c BChannelDestroy
  267. @func
  268. <f BChannelDestroy> frees the memory for this <t BCHANNEL_OBJECT>.
  269. All memory allocated by <f BChannelCreate> will be released back to the
  270. OS.
  271. */
  272. void BChannelDestroy(
  273. IN PBCHANNEL_OBJECT pBChannel // @parm
  274. // A pointer to the <t BCHANNEL_OBJECT> returned by <f BChannelCreate>.
  275. )
  276. {
  277. DBG_FUNC("BChannelDestroy")
  278. PMINIPORT_ADAPTER_OBJECT pAdapter;
  279. // A pointer to the <t MINIPORT_ADAPTER_OBJECT>.
  280. if (pBChannel)
  281. {
  282. ASSERT(pBChannel->ObjectType == BCHANNEL_OBJECT_TYPE);
  283. pAdapter = GET_ADAPTER_FROM_BCHANNEL(pBChannel);
  284. DBG_ENTER(pAdapter);
  285. // TODO - Add code here
  286. /*
  287. // Release all objects allocated within this object.
  288. */
  289. BChannelDestroyObjects(pBChannel);
  290. /*
  291. // Make sure we fail the ASSERT if we see this object again.
  292. */
  293. pBChannel->ObjectType = 0;
  294. FREE_OBJECT(pBChannel);
  295. DBG_LEAVE(pAdapter);
  296. }
  297. }
  298. /* @doc INTERNAL BChannel BChannel_c BChannelInitialize
  299. @func
  300. <f BChannelInitialize> resets all the internal data members contained
  301. in <t BCHANNEL_OBJECT> back to their initial state.
  302. <f Note>:
  303. If you add any new members to <t BCHANNEL_OBJECT> you will need to
  304. modify <f BChannelInitialize> to initialize your new data mamebers.
  305. */
  306. void BChannelInitialize(
  307. IN PBCHANNEL_OBJECT pBChannel // @parm
  308. // A pointer to the <t BCHANNEL_OBJECT> returned by <f BChannelCreate>.
  309. )
  310. {
  311. DBG_FUNC("BChannelInitialize")
  312. PMINIPORT_ADAPTER_OBJECT pAdapter;
  313. // A pointer to the <t MINIPORT_ADAPTER_OBJECT>.
  314. ASSERT(pBChannel && pBChannel->ObjectType == BCHANNEL_OBJECT_TYPE);
  315. pAdapter = GET_ADAPTER_FROM_BCHANNEL(pBChannel);
  316. DBG_ENTER(pAdapter);
  317. /*
  318. // Initially, the BChannel is not allocated to anyone and these fields
  319. // must be reset.
  320. */
  321. ASSERT(pBChannel->NdisLinkContext == NULL);
  322. ASSERT(pBChannel->htLine == (HTAPI_LINE)0);
  323. ASSERT(pBChannel->htCall == (HTAPI_CALL)0);
  324. /*
  325. // Setup the static features of the link.
  326. */
  327. pBChannel->LinkSpeed = _64KBPS;
  328. pBChannel->BearerModesCaps = LINEBEARERMODE_DATA
  329. | LINEBEARERMODE_VOICE
  330. ;
  331. pBChannel->MediaModesCaps = LINEMEDIAMODE_DIGITALDATA
  332. | LINEMEDIAMODE_UNKNOWN
  333. // | LINEMEDIAMODE_DATAMODEM
  334. ;
  335. /*
  336. // Initialize the TAPI event capabilities supported by the link.
  337. */
  338. pBChannel->DevStatesCaps = LINEDEVSTATE_RINGING
  339. | LINEDEVSTATE_CONNECTED
  340. | LINEDEVSTATE_DISCONNECTED
  341. | LINEDEVSTATE_INSERVICE
  342. | LINEDEVSTATE_OUTOFSERVICE
  343. | LINEDEVSTATE_OPEN
  344. | LINEDEVSTATE_CLOSE
  345. | LINEDEVSTATE_REINIT
  346. ;
  347. pBChannel->AddressStatesCaps = 0;
  348. pBChannel->CallStatesCaps = LINECALLSTATE_IDLE
  349. | LINECALLSTATE_DIALTONE
  350. | LINECALLSTATE_DIALING
  351. | LINECALLSTATE_PROCEEDING
  352. | LINECALLSTATE_RINGBACK
  353. | LINECALLSTATE_BUSY
  354. | LINECALLSTATE_OFFERING
  355. | LINECALLSTATE_ACCEPTED
  356. | LINECALLSTATE_CONNECTED
  357. | LINECALLSTATE_DISCONNECTED
  358. ;
  359. /*
  360. // We use this timer to keep track of incoming and outgoing call
  361. // status, and to provide timeouts for certain call states.
  362. */
  363. NdisMInitializeTimer(
  364. &pBChannel->CallTimer,
  365. pAdapter->MiniportAdapterHandle,
  366. TspiCallTimerHandler,
  367. pBChannel
  368. );
  369. /*
  370. // Set the TransmitBusyList and ReceivePendingList to empty.
  371. */
  372. InitializeListHead(&pBChannel->TransmitBusyList);
  373. InitializeListHead(&pBChannel->ReceivePendingList);
  374. // TODO - Add code here
  375. DBG_LEAVE(pAdapter);
  376. }
  377. /* @doc INTERNAL BChannel BChannel_c BChannelOpen
  378. @func
  379. <f BChannelOpen> makes the BChannel connection ready to transmit and
  380. receive data.
  381. @rdesc
  382. <f BChannelOpen> returns zero if it is successful.<nl>
  383. Otherwise, a non-zero return value indicates an error condition.
  384. */
  385. NDIS_STATUS BChannelOpen(
  386. IN PBCHANNEL_OBJECT pBChannel, // @parm
  387. // A pointer to the <t BCHANNEL_OBJECT> returned by <f BChannelCreate>.
  388. IN HTAPI_LINE htLine
  389. )
  390. {
  391. DBG_FUNC("BChannelOpen")
  392. NDIS_STATUS Result = NDIS_STATUS_SUCCESS;
  393. // Holds the result code returned by this function.
  394. PMINIPORT_ADAPTER_OBJECT pAdapter;
  395. // A pointer to the <t MINIPORT_ADAPTER_OBJECT>.
  396. ASSERT(pBChannel && pBChannel->ObjectType == BCHANNEL_OBJECT_TYPE);
  397. pAdapter = GET_ADAPTER_FROM_BCHANNEL(pBChannel);
  398. DBG_ENTER(pAdapter);
  399. if (!pBChannel->IsOpen)
  400. {
  401. DBG_NOTICE(pAdapter,("Opening BChannel #%d\n",
  402. pBChannel->ObjectID));
  403. /*
  404. // The htLine field is used to associate this BChannel with the
  405. // TAPI Connection Wrapper. Reset all the state information for
  406. // this BChannel.
  407. */
  408. pBChannel->htLine = htLine;
  409. pBChannel->CallClosing = FALSE;
  410. // Don't clear the line state flags that are set by card.c
  411. pBChannel->DevState &= (LINEDEVSTATE_CONNECTED |
  412. LINEDEVSTATE_INSERVICE);
  413. pBChannel->DevStatesMask = 0; // Default to indicate no line events
  414. pBChannel->AddressState = 0;
  415. pBChannel->AddressStatesMask = 0; // Default to indicate no address events
  416. pBChannel->CallState = 0;
  417. pBChannel->CallStateMode = 0;
  418. pBChannel->CallStatesMask = pBChannel->CallStatesCaps;
  419. pBChannel->MediaMode = 0;
  420. pBChannel->MediaModesMask = 0;
  421. pBChannel->TotalRxPackets = 0;
  422. pBChannel->AppSpecificCallInfo = 0;
  423. /*
  424. // Initialize the default BChannel information structure. It may be
  425. // changed later by MiniportSetInformation.
  426. */
  427. pBChannel->WanLinkInfo.MiniportLinkContext = pBChannel;
  428. pBChannel->WanLinkInfo.MaxSendFrameSize = pAdapter->WanInfo.MaxFrameSize;
  429. pBChannel->WanLinkInfo.MaxRecvFrameSize = pAdapter->WanInfo.MaxFrameSize;
  430. pBChannel->WanLinkInfo.SendFramingBits = pAdapter->WanInfo.FramingBits;
  431. pBChannel->WanLinkInfo.RecvFramingBits = pAdapter->WanInfo.FramingBits;
  432. pBChannel->WanLinkInfo.SendACCM = pAdapter->WanInfo.DesiredACCM;
  433. pBChannel->WanLinkInfo.RecvACCM = pAdapter->WanInfo.DesiredACCM;
  434. #if defined(SAMPLE_DRIVER)
  435. // Sample just tells tapi that the line is connected and in service.
  436. TspiLineDevStateHandler(pAdapter, pBChannel, LINEDEVSTATE_CONNECTED);
  437. TspiLineDevStateHandler(pAdapter, pBChannel, LINEDEVSTATE_INSERVICE);
  438. #else // SAMPLE_DRIVER
  439. // TODO - Add code here
  440. TspiLineDevStateHandler(pAdapter, pBChannel, LINEDEVSTATE_CONNECTED);
  441. #endif // SAMPLE_DRIVER
  442. pBChannel->IsOpen = TRUE;
  443. }
  444. else
  445. {
  446. DBG_ERROR(pAdapter,("BChannel #%d already opened\n",
  447. pBChannel->ObjectID));
  448. }
  449. DBG_RETURN(pAdapter, Result);
  450. return (Result);
  451. }
  452. /* @doc INTERNAL BChannel BChannel_c BChannelClose
  453. @func
  454. <f BChannelClose> closes the given B-channel.
  455. */
  456. void BChannelClose(
  457. IN PBCHANNEL_OBJECT pBChannel // @parm
  458. // A pointer to the <t BCHANNEL_OBJECT> returned by <f BChannelCreate>.
  459. )
  460. {
  461. DBG_FUNC("BChannelClose")
  462. PMINIPORT_ADAPTER_OBJECT pAdapter;
  463. // A pointer to the <t MINIPORT_ADAPTER_OBJECT>.
  464. ASSERT(pBChannel && pBChannel->ObjectType == BCHANNEL_OBJECT_TYPE);
  465. pAdapter = GET_ADAPTER_FROM_BCHANNEL(pBChannel);
  466. DBG_ENTER(pAdapter);
  467. if (pBChannel->IsOpen)
  468. {
  469. DBG_NOTICE(pAdapter,("Closing BChannel #%d\n",
  470. pBChannel->ObjectID));
  471. /*
  472. // Make sure call is cleared and B channel is disabled.
  473. */
  474. DChannelCloseCall(pAdapter->pDChannel, pBChannel);
  475. // TODO - Add code here
  476. // Don't clear the line state flags that are set by card.c
  477. pBChannel->DevState &= (LINEDEVSTATE_CONNECTED |
  478. LINEDEVSTATE_INSERVICE);
  479. pBChannel->CallState = 0;
  480. pBChannel->htLine = (HTAPI_LINE)0;
  481. pBChannel->htCall = (HTAPI_CALL)0;
  482. pBChannel->NdisLinkContext = NULL;
  483. pBChannel->IsOpen = FALSE;
  484. }
  485. else
  486. {
  487. DBG_ERROR(pAdapter,("BChannel #%d already closed\n",
  488. pBChannel->ObjectID));
  489. }
  490. DBG_LEAVE(pAdapter);
  491. }
  492. /* @doc INTERNAL BChannel BChannel_c BChannelAddToReceiveQueue
  493. @func
  494. <f BChannelAddToReceiveQueue> adds a buffer to the queue of available
  495. receive buffers associated with this B-channel.
  496. @rdesc
  497. <f BChannelAddToReceiveQueue> returns zero if it is successful.<nl>
  498. Otherwise, a non-zero return value indicates an error condition.
  499. */
  500. NDIS_STATUS BChannelAddToReceiveQueue(
  501. IN PBCHANNEL_OBJECT pBChannel, // @parm
  502. // A pointer to the <t BCHANNEL_OBJECT> returned by <f BChannelCreate>.
  503. IN PVOID pReceiveContext, // @parm
  504. // A context value to be passed back to <f TransmitComplete>.
  505. IN PUCHAR BufferPointer, // @parm
  506. // A pointer to the buffer to be transmitted.
  507. IN ULONG BufferSize // @parm
  508. // The size in bytes of the buffer to be transmitted.
  509. )
  510. {
  511. DBG_FUNC("BChannelAddToReceiveQueue")
  512. NDIS_STATUS Result = NDIS_STATUS_SUCCESS;
  513. // Holds the result code returned by this function.
  514. PMINIPORT_ADAPTER_OBJECT pAdapter;
  515. // A pointer to the <t MINIPORT_ADAPTER_OBJECT>.
  516. ASSERT(pBChannel && pBChannel->ObjectType == BCHANNEL_OBJECT_TYPE);
  517. pAdapter = GET_ADAPTER_FROM_BCHANNEL(pBChannel);
  518. DBG_ENTER(pAdapter);
  519. ASSERT(pBChannel->IsOpen);
  520. // TODO - Add code here
  521. DBG_RETURN(pAdapter, Result);
  522. return (Result);
  523. }
  524. /* @doc INTERNAL BChannel BChannel_c BChannelAddToTransmitQueue
  525. @func
  526. <f BChannelAddToTransmitQueue> adds a buffer to the queue of buffers
  527. to be transmitted on this B-channel.
  528. @rdesc
  529. <f BChannelAddToTransmitQueue> returns zero if it is successful.<nl>
  530. Otherwise, a non-zero return value indicates an error condition.
  531. */
  532. NDIS_STATUS BChannelAddToTransmitQueue(
  533. IN PBCHANNEL_OBJECT pBChannel, // @parm
  534. // A pointer to the <t BCHANNEL_OBJECT> returned by <f BChannelCreate>.
  535. IN PVOID pTransmitContext, // @parm
  536. // A context value to be passed back to <f TransmitComplete>.
  537. IN PUCHAR BufferPointer, // @parm
  538. // A pointer to the buffer to be transmitted.
  539. IN ULONG BufferSize // @parm
  540. // The size in bytes of the buffer to be transmitted.
  541. )
  542. {
  543. DBG_FUNC("BChannelAddToTransmitQueue")
  544. NDIS_STATUS Result = NDIS_STATUS_SUCCESS;
  545. // Holds the result code returned by this function.
  546. PMINIPORT_ADAPTER_OBJECT pAdapter;
  547. // A pointer to the <t MINIPORT_ADAPTER_OBJECT>.
  548. ASSERT(pBChannel && pBChannel->ObjectType == BCHANNEL_OBJECT_TYPE);
  549. pAdapter = GET_ADAPTER_FROM_BCHANNEL(pBChannel);
  550. DBG_ENTER(pAdapter);
  551. ASSERT(pBChannel->IsOpen);
  552. // TODO - Add code here
  553. DBG_RETURN(pAdapter, Result);
  554. return (Result);
  555. }