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.

549 lines
31 KiB

  1. <html xmlns:v="urn:schemas-microsoft-com:vml"
  2. xmlns:o="urn:schemas-microsoft-com:office:office"
  3. xmlns:w="urn:schemas-microsoft-com:office:word"
  4. xmlns:st1="urn:schemas-microsoft-com:office:smarttags"
  5. xmlns="http://www.w3.org/TR/REC-html40">
  6. <head>
  7. <meta http-equiv=Content-Type content="text/html; charset=windows-1252">
  8. <meta name=ProgId content=Word.Document>
  9. <meta name=Generator content="Microsoft Word 10">
  10. <meta name=Originator content="Microsoft Word 10">
  11. <link rel=File-List href="e100bex_files/filelist.xml">
  12. <title>E100BEX</title>
  13. <o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
  14. name="PersonName"/>
  15. <!--[if gte mso 9]><xml>
  16. <w:WordDocument>
  17. <w:SpellingState>Clean</w:SpellingState>
  18. <w:GrammarState>Clean</w:GrammarState>
  19. <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
  20. </w:WordDocument>
  21. </xml><![endif]--><!--[if !mso]><object
  22. classid="clsid:38481807-CA0E-42D2-BF39-B33AF135CC4D" id=ieooui></object>
  23. <style>
  24. st1\:*{behavior:url(#ieooui) }
  25. </style>
  26. <![endif]-->
  27. <style>
  28. <!--
  29. /* Font Definitions */
  30. @font-face
  31. {font-family:SimSun;
  32. panose-1:2 1 6 0 3 1 1 1 1 1;
  33. mso-font-alt:\5B8B\4F53;
  34. mso-font-charset:134;
  35. mso-generic-font-family:auto;
  36. mso-font-format:other;
  37. mso-font-pitch:variable;
  38. mso-font-signature:1 135135232 16 0 262144 0;}
  39. @font-face
  40. {font-family:Verdana;
  41. panose-1:2 11 6 4 3 5 4 4 2 4;
  42. mso-font-charset:0;
  43. mso-generic-font-family:swiss;
  44. mso-font-pitch:variable;
  45. mso-font-signature:536871559 0 0 0 415 0;}
  46. @font-face
  47. {font-family:"\@SimSun";
  48. mso-font-charset:134;
  49. mso-generic-font-family:auto;
  50. mso-font-pitch:auto;
  51. mso-font-signature:0 0 0 0 0 0;}
  52. @font-face
  53. {font-family:"MS Sans Serif";
  54. panose-1:0 0 0 0 0 0 0 0 0 0;
  55. mso-font-alt:Arial;
  56. mso-font-charset:0;
  57. mso-generic-font-family:swiss;
  58. mso-font-format:other;
  59. mso-font-pitch:variable;
  60. mso-font-signature:3 0 0 0 1 0;}
  61. /* Style Definitions */
  62. p.MsoNormal, li.MsoNormal, div.MsoNormal
  63. {mso-style-parent:"";
  64. margin:0in;
  65. margin-bottom:.0001pt;
  66. mso-pagination:widow-orphan;
  67. font-size:12.0pt;
  68. font-family:"Times New Roman";
  69. mso-fareast-font-family:"Times New Roman";
  70. color:black;}
  71. h2
  72. {mso-margin-top-alt:auto;
  73. margin-right:0in;
  74. mso-margin-bottom-alt:auto;
  75. margin-left:0in;
  76. mso-pagination:widow-orphan;
  77. mso-outline-level:2;
  78. font-size:18.0pt;
  79. font-family:"Times New Roman";
  80. mso-fareast-font-family:SimSun;
  81. color:black;
  82. font-weight:bold;}
  83. h3
  84. {mso-margin-top-alt:auto;
  85. margin-right:0in;
  86. mso-margin-bottom-alt:auto;
  87. margin-left:0in;
  88. mso-pagination:widow-orphan;
  89. mso-outline-level:3;
  90. font-size:13.5pt;
  91. font-family:"Times New Roman";
  92. mso-fareast-font-family:SimSun;
  93. color:black;
  94. font-weight:bold;}
  95. h4
  96. {mso-margin-top-alt:auto;
  97. margin-right:0in;
  98. mso-margin-bottom-alt:auto;
  99. margin-left:0in;
  100. mso-pagination:widow-orphan;
  101. mso-outline-level:4;
  102. font-size:12.0pt;
  103. font-family:"Times New Roman";
  104. mso-fareast-font-family:SimSun;
  105. color:black;
  106. font-weight:bold;}
  107. a:link, span.MsoHyperlink
  108. {color:blue;
  109. text-decoration:underline;
  110. text-underline:single;}
  111. a:visited, span.MsoHyperlinkFollowed
  112. {color:purple;
  113. text-decoration:underline;
  114. text-underline:single;}
  115. p
  116. {mso-margin-top-alt:auto;
  117. margin-right:0in;
  118. mso-margin-bottom-alt:auto;
  119. margin-left:0in;
  120. mso-pagination:widow-orphan;
  121. font-size:12.0pt;
  122. font-family:"Times New Roman";
  123. mso-fareast-font-family:"Times New Roman";
  124. color:black;}
  125. pre
  126. {margin:0in;
  127. margin-bottom:.0001pt;
  128. mso-pagination:widow-orphan;
  129. tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
  130. font-size:10.0pt;
  131. font-family:"Courier New";
  132. mso-fareast-font-family:"Courier New";
  133. color:black;}
  134. span.SpellE
  135. {mso-style-name:"";
  136. mso-spl-e:yes;}
  137. span.GramE
  138. {mso-style-name:"";
  139. mso-gram-e:yes;}
  140. @page Section1
  141. {size:8.5in 11.0in;
  142. margin:1.0in 1.25in 1.0in 1.25in;
  143. mso-header-margin:.5in;
  144. mso-footer-margin:.5in;
  145. mso-paper-source:0;}
  146. div.Section1
  147. {page:Section1;}
  148. /* List Definitions */
  149. @list l0
  150. {mso-list-id:381560120;
  151. mso-list-type:hybrid;
  152. mso-list-template-ids:-351239334 -695840708 -1982296020 1854160056 -372070536 1348993084 1615251444 1623514094 -1314389320 -1345299260;}
  153. @list l0:level1
  154. {mso-level-tab-stop:.5in;
  155. mso-level-number-position:left;
  156. text-indent:-.25in;}
  157. @list l0:level2
  158. {mso-level-tab-stop:1.0in;
  159. mso-level-number-position:left;
  160. text-indent:-.25in;}
  161. @list l0:level3
  162. {mso-level-tab-stop:1.5in;
  163. mso-level-number-position:left;
  164. text-indent:-.25in;}
  165. @list l0:level4
  166. {mso-level-tab-stop:2.0in;
  167. mso-level-number-position:left;
  168. text-indent:-.25in;}
  169. @list l0:level5
  170. {mso-level-tab-stop:2.5in;
  171. mso-level-number-position:left;
  172. text-indent:-.25in;}
  173. @list l0:level6
  174. {mso-level-tab-stop:3.0in;
  175. mso-level-number-position:left;
  176. text-indent:-.25in;}
  177. @list l0:level7
  178. {mso-level-tab-stop:3.5in;
  179. mso-level-number-position:left;
  180. text-indent:-.25in;}
  181. @list l0:level8
  182. {mso-level-tab-stop:4.0in;
  183. mso-level-number-position:left;
  184. text-indent:-.25in;}
  185. @list l0:level9
  186. {mso-level-tab-stop:4.5in;
  187. mso-level-number-position:left;
  188. text-indent:-.25in;}
  189. @list l1
  190. {mso-list-id:1066881914;
  191. mso-list-template-ids:2067152616;}
  192. ol
  193. {margin-bottom:0in;}
  194. ul
  195. {margin-bottom:0in;}
  196. -->
  197. </style>
  198. <!--[if gte mso 10]>
  199. <style>
  200. /* Style Definitions */
  201. table.MsoNormalTable
  202. {mso-style-name:"Table Normal";
  203. mso-tstyle-rowband-size:0;
  204. mso-tstyle-colband-size:0;
  205. mso-style-noshow:yes;
  206. mso-style-parent:"";
  207. mso-padding-alt:0in 5.4pt 0in 5.4pt;
  208. mso-para-margin:0in;
  209. mso-para-margin-bottom:.0001pt;
  210. mso-pagination:widow-orphan;
  211. font-size:10.0pt;
  212. font-family:"Times New Roman";}
  213. </style>
  214. <![endif]-->
  215. <meta name=Template content="C:\PROGRAM FILES\MICROSOFT OFFICE\OFFICE\html.dot">
  216. <!--[if gte mso 9]><xml>
  217. <o:shapedefaults v:ext="edit" spidmax="18434"/>
  218. </xml><![endif]--><!--[if gte mso 9]><xml>
  219. <o:shapelayout v:ext="edit">
  220. <o:idmap v:ext="edit" data="1"/>
  221. </o:shapelayout></xml><![endif]-->
  222. </head>
  223. <body bgcolor=white lang=EN-US link=blue vlink=purple style='tab-interval:.5in'
  224. leftmargin=8>
  225. <div class=Section1>
  226. <h2><a name=MYSAMPLE><span style='font-family:Verdana'>E100BEX</span></a><span
  227. style='font-family:Verdana'> <o:p></o:p></span></h2>
  228. <p class=MsoNormal><span style='font-family:Verdana;color:red'>[This is
  229. preliminary documentation and subject to change.]</span><span style='font-family:
  230. Verdana'> <o:p></o:p></span></p>
  231. <h3><span style='font-family:Verdana'>SUMMARY<o:p></o:p></span></h3>
  232. <p><span style='font-size:10.0pt;font-family:Verdana'>This sample is an NDIS 5 deserialized
  233. miniport driver for the Intel EtherExpress<sup>TM</sup> PRO/100+ Ethernet PCI
  234. adapter and the Intel EtherExpress<sup>TM</sup> PRO/100B PCI adapter. It
  235. illustrates NDIS 4 and NDIS 5 features such as multiple packet sends/receives,
  236. scatter gather DMA, LBFO, media sense, WMI, and Po</span><st1:PersonName><span
  237. style='font-size:10.0pt;font-family:Verdana'>w</span></st1:PersonName><span
  238. style='font-size:10.0pt;font-family:Verdana'>er Management. It also has NDIS
  239. 5.1 miniport features such as cancellation of send packets and PNP event
  240. handler. This driver comes </span><st1:PersonName><span style='font-size:10.0pt;
  241. font-family:Verdana'>w</span></st1:PersonName><span style='font-size:10.0pt;
  242. font-family:Verdana'>ith a KD extension DLL.<o:p></o:p></span></p>
  243. <p><span style='font-size:10.0pt;font-family:Verdana'>If NDIS51_MINIPORT is
  244. defined, the driver only does scatter gather DMA method and it will fail the
  245. initialization if its call to <span style='mso-bidi-font-weight:bold'>NdisMInitializeScatterGatherDma
  246. fails.</span><o:p></o:p></span></p>
  247. <p class=MsoNormal><span style='font-size:10.0pt;font-family:Verdana'>This
  248. driver supports Plug and Play. The code is 64-bit compliant, and builds
  249. properly </span><st1:PersonName><span style='font-size:10.0pt;font-family:Verdana'>w</span></st1:PersonName><span
  250. style='font-size:10.0pt;font-family:Verdana'>ith Microsoft� Visual C� 6.0. <o:p></o:p></span></p>
  251. <h3><span style='font-family:Verdana'>BUILDING THE SAMPLE<o:p></o:p></span></h3>
  252. <p><span style='font-size:10.0pt;font-family:Verdana'>Run the <b>build</b>
  253. command from this directory to build the sample. That creates the binary
  254. E100bex.sys. <o:p></o:p></span></p>
  255. <h3><span style='font-family:Verdana'>TOOLS<o:p></o:p></span></h3>
  256. <p><span style='font-size:10.0pt;font-family:Verdana'>The NDISTEST tool can be
  257. used to test some of the features of this driver. Note that this is not a
  258. production driver, and is not intended to replace the driver in the Windo</span><st1:PersonName><span
  259. style='font-size:10.0pt;font-family:Verdana'>w</span></st1:PersonName><span
  260. style='font-size:10.0pt;font-family:Verdana'>s� 2000 build. <o:p></o:p></span></p>
  261. <h3><span style='font-family:Verdana'>CODE TOUR<o:p></o:p></span></h3>
  262. <h4><span style='font-family:Verdana'>File Manifest<o:p></o:p></span></h4>
  263. <pre><u>Files<span style='mso-spacerun:yes'>�������� </span><span
  264. style='mso-tab-count:1'> </span>Description<o:p></o:p></u></pre><pre>E100BEX.htm<span style='mso-spacerun:yes'>�� </span><span
  265. style='mso-tab-count:1'> </span>The documentation for this sample (this file)</pre><pre>Net557ex.inf<span style='mso-spacerun:yes'></span><span
  266. style='mso-tab-count:1'> </span>The .inf file for installing the code sample</pre><pre>e100.rc<span style='mso-spacerun:yes'>������ </span><span
  267. style='mso-tab-count:1'> </span>The resource file for the code sample</pre><pre>e100.mof<span
  268. style='mso-tab-count:1'>������ </span>The WMI mof file for the code sample</pre><pre>precomp.h<span style='mso-spacerun:yes'>���� </span><span
  269. style='mso-tab-count:1'> </span>Precompile header</pre><pre><o:p>&nbsp;</o:p></pre><pre>mp.h<span
  270. style='mso-tab-count:2'>���������� </span>Miniport generic portion header file</pre><pre>mp_cmn.h<span
  271. style='mso-tab-count:1'>������ </span>Common definitions for the miniport and kd extension dll</pre><pre>mp_dbg.h<span
  272. style='mso-tab-count:1'>������ </span>Debug code definitions and structures</pre><pre>mp_def.h<span
  273. style='mso-tab-count:1'>������ </span>NIC specific definitions<span
  274. style='mso-tab-count:1'>������ </span></pre><pre>mp_nic.h<span
  275. style='mso-tab-count:1'>������ </span>Function prototypes for mp_nic.c, mp_init.c and mp_req.c</pre><pre>mp_dbg.c<span
  276. style='mso-tab-count:1'>������ </span>Debug-related code</pre><pre>mp_init.c<span
  277. style='mso-tab-count:1'>����� </span>Miniport initialization related routines</pre><pre>mp_main.c<span
  278. style='mso-tab-count:1'>����� </span>DriverEntry and NDIS miniport handlers</pre><pre>mp_nic.c<span
  279. style='mso-tab-count:1'>������ </span>Miniport send/receive routines</pre><pre>mp_req.c<span
  280. style='mso-tab-count:1'>������ </span>Miniport OID related handlers</pre><pre>offload.h<span style='mso-spacerun:yes'>����� </span>Task offloading related data structures and function prototypes</pre><pre>offload.c<span style='mso-spacerun:yes'>����� </span>Task offloading related functions</pre><pre><o:p>&nbsp;</o:p></pre><pre>e100_557.h<span
  281. style='mso-tab-count:1'>���� </span>Hard<st1:PersonName>w</st1:PersonName>are definitions and structures for Intel 82557 controllers</pre><pre>e100_def.h<span
  282. style='mso-tab-count:1'>���� </span>Other hard<st1:PersonName>w</st1:PersonName>are specific definitions, e100_<st1:PersonName>w</st1:PersonName>mi.h included in this file</pre><pre>e100_equ.h<span
  283. style='mso-tab-count:1'>���� </span>Hard<st1:PersonName>w</st1:PersonName>are specific constant definitions</pre><pre>e100_sup.h<span
  284. style='mso-tab-count:1'>���� </span>Hard<st1:PersonName>w</st1:PersonName>are specific function prototypes and inline functions</pre><pre>eeprom.c<span style='mso-spacerun:yes'>����� </span><span
  285. style='mso-tab-count:1'> </span>Routines to access EEPROM information</pre><pre>physet.c<span style='mso-spacerun:yes'>����� </span><span
  286. style='mso-tab-count:1'> </span>Routines to detect and set up the physical layer</pre><pre>routines.c<span style='mso-spacerun:yes'>��� </span><span
  287. style='mso-tab-count:1'> </span>Miscellaneous utility functions</pre><pre><o:p>&nbsp;</o:p></pre><pre>sources.inc<span style='mso-spacerun:yes'>�� </span><span
  288. style='mso-tab-count:1'> </span>The sources include file</pre><pre>makefile.inc<span
  289. style='mso-tab-count:1'>�� </span>Used to generate e100_<st1:PersonName>w</st1:PersonName>mi.h from e100.bmf <st1:PersonName>w</st1:PersonName>hich is compiled from e100.mof</pre><pre>sys\sources<span
  290. style='mso-tab-count:1'>��� </span>Sources file to build NDIS 5.1 and NDIS 5.0 compliant driver</pre><pre><o:p>&nbsp;</o:p></pre><pre>kd\e100kd.c<span
  291. style='mso-tab-count:1'>��� </span>The C <span class=GramE>file</span> for the KD extension DLL (e100kd.dll)</pre><pre>kd\e100kd.def<span
  292. style='mso-tab-count:1'>� </span>The definition file for the KD extension DLL</pre><pre>kd\e100kd.h<span
  293. style='mso-tab-count:1'>��� </span>The header file for the KD extension DLL</pre><pre>kd\e100kd.rc<span
  294. style='mso-tab-count:1'>�� </span>The resource file for the KD extension DLL</pre><pre><o:p>&nbsp;</o:p></pre>
  295. <h4 style='tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
  296. style='font-family:Verdana'>Programming Tour<o:p></o:p></span></h4>
  297. <p style='tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
  298. style='font-size:10.0pt;font-family:Verdana'>Some of the features illustrated
  299. in this driver are listed belo</span><st1:PersonName><span style='font-size:
  300. 10.0pt;font-family:Verdana'>w</span></st1:PersonName><span style='font-size:
  301. 10.0pt;font-family:Verdana'>, along </span><st1:PersonName><span
  302. style='font-size:10.0pt;font-family:Verdana'>w</span></st1:PersonName><span
  303. style='font-size:10.0pt;font-family:Verdana'>ith the files that contain the
  304. feature.<o:p></o:p></span></p>
  305. <ol start=1 type=1>
  306. <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
  307. mso-list:l0 level1 lfo3;tab-stops:list .5in'><span style='font-size:10.0pt;
  308. font-family:Verdana'>NDIS 4: <b>SendPacketsHandler</b><span
  309. style='mso-bidi-font-weight:bold'>;</span> multiple packets per send
  310. request are handled (MpSendPackets() in mp_main.c).<o:p></o:p></span></li>
  311. <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
  312. mso-list:l0 level1 lfo3;tab-stops:list .5in'><span style='font-size:10.0pt;
  313. font-family:Verdana'>NDIS 4: <b>NdisMIndicateReceivePacket()</b><span
  314. style='mso-bidi-font-weight:bold'>;</span> multiple packets per receive
  315. indication (MpHandleRecvInterrupt() in mp_nic.c).<o:p></o:p></span></li>
  316. <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
  317. mso-list:l0 level1 lfo3;tab-stops:list .5in'><span style='font-size:10.0pt;
  318. font-family:Verdana'>NDIS 4: Receive buffer gro</span><st1:PersonName><span
  319. style='font-size:10.0pt;font-family:Verdana'>w</span></st1:PersonName><span
  320. style='font-size:10.0pt;font-family:Verdana'> and shrink; When the adapter
  321. driver begins to run out of receive memory, <b>NdisMAllocateSharedMemoryAsyn()</b>
  322. is called to allocate more shared memory for receive buffers
  323. (MpHandleRecvInterrupt() in mp_nic.c). When the traffic slo</span><st1:PersonName><span
  324. style='font-size:10.0pt;font-family:Verdana'>w</span></st1:PersonName><span
  325. style='font-size:10.0pt;font-family:Verdana'>s do</span><st1:PersonName><span
  326. style='font-size:10.0pt;font-family:Verdana'>w</span></st1:PersonName><span
  327. style='font-size:10.0pt;font-family:Verdana'>n, the driver frees the
  328. memory (MPReturnPacket() in mp_main.c)<o:p></o:p></span></li>
  329. <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
  330. mso-list:l0 level1 lfo3;tab-stops:list .5in'><span style='font-size:10.0pt;
  331. font-family:Verdana'>NDIS 4: NdisMRegisterAdapterShutdo</span><st1:PersonName><span
  332. style='font-size:10.0pt;font-family:Verdana'>w</span></st1:PersonName><span
  333. style='font-size:10.0pt;font-family:Verdana'>nHandler() is called at
  334. initialization time to make sure the adapter has a function that stops
  335. generating interrupts and receiving packets into main memory
  336. (MpInitiliaze() and MpShutdo</span><st1:PersonName><span style='font-size:
  337. 10.0pt;font-family:Verdana'>w</span></st1:PersonName><span
  338. style='font-size:10.0pt;font-family:Verdana'>n() in mp_main.c).<o:p></o:p></span></li>
  339. <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
  340. mso-list:l0 level1 lfo3;tab-stops:list .5in'><span style='font-size:10.0pt;
  341. font-family:Verdana'>NDIS 4: Media disconnect/connect indications are
  342. supported. This allo</span><st1:PersonName><span style='font-size:10.0pt;
  343. font-family:Verdana'>w</span></st1:PersonName><span style='font-size:
  344. 10.0pt;font-family:Verdana'>s the driver to tell NDIS </span><st1:PersonName><span
  345. style='font-size:10.0pt;font-family:Verdana'>w</span></st1:PersonName><span
  346. style='font-size:10.0pt;font-family:Verdana'>hen the adapter has lost or
  347. regained link (MpCheckForHang() in mp_main.c).<o:p></o:p></span></li>
  348. <li class=MsoNormal style='mso-list:l0 level1 lfo3;tab-stops:list .5in;
  349. mso-layout-grid-align:none;text-autospace:none'><span style='font-size:
  350. 10.0pt;font-family:Verdana'>NDIS 5: </span><span style='font-size:10.0pt;
  351. font-family:Verdana;mso-fareast-font-family:SimSun;mso-bidi-font-family:
  352. Verdana;color:windowtext'>This driver is a de-serialized miniport,
  353. therefore it protects its resources using its o</span><st1:PersonName><span
  354. style='font-size:10.0pt;font-family:Verdana;mso-fareast-font-family:SimSun;
  355. mso-bidi-font-family:Verdana;color:windowtext'>w</span></st1:PersonName><span
  356. style='font-size:10.0pt;font-family:Verdana;mso-fareast-font-family:SimSun;
  357. mso-bidi-font-family:Verdana;color:windowtext'>n spin lock</span><span
  358. style='font-size:10.0pt;font-family:Verdana;mso-fareast-font-family:SimSun;
  359. mso-bidi-font-family:Verdana'>s</span><span style='font-size:10.0pt;
  360. font-family:Verdana;mso-fareast-font-family:SimSun;mso-bidi-font-family:
  361. Verdana;color:red'> </span><span style='font-size:10.0pt;font-family:Verdana;
  362. mso-fareast-font-family:SimSun;mso-bidi-font-family:Verdana'>rather than
  363. relying on Ndis to serialize the calls to the driver.</span><span
  364. style='font-size:10.0pt;font-family:Verdana'> This driver only implements
  365. a simple method of using spin lock: it has a <span class=GramE><b>NdisAcquireSpinlock(</b></span><b>)</b>
  366. at every entry point and a <b>NdisReleaseSpinlock()</b> at the return from
  367. those entry points. The locks could be done more efficiently in a
  368. production driver by moving the locking closer to the resources in the
  369. driver that need to be accessed </span><st1:PersonName><span
  370. style='font-size:10.0pt;font-family:Verdana'>w</span></st1:PersonName><span
  371. style='font-size:10.0pt;font-family:Verdana'>ith atomic operations.<o:p></o:p></span></li>
  372. <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
  373. mso-list:l0 level1 lfo3;tab-stops:list .5in'><span style='font-size:10.0pt;
  374. font-family:Verdana'>NDIS 5: WMI: There are several examples of using
  375. GUIDs to advertise custom driver SETs and QUERIES. The E100.mof and
  376. mp_req.c files implement the functionality, the Makefile.inc is used to
  377. generate e100_wmi.h file and the e100.rc file includes the .bmf data into
  378. the driver resource area. By default the private WMI GUIDs provided by the
  379. driver are only accessible to users with administrator privilege. If the
  380. driver wants to give SETs(WRITE) or QUERIES(READ) access to users without
  381. administrator privilege, it must set the corresponding flags to the GUIDs
  382. which it wants to give access to. <o:p></o:p></span></li>
  383. <li class=MsoNormal style='color:windowtext;mso-list:l0 level1 lfo3;
  384. tab-stops:list .5in;mso-layout-grid-align:none;text-autospace:none'><span
  385. style='font-size:10.0pt;font-family:Verdana;color:black'>NDIS 5: </span><span
  386. style='font-size:10.0pt;font-family:Verdana;mso-fareast-font-family:SimSun;
  387. mso-bidi-font-family:Verdana'>Power Management:<span style='color:navy'> </span>This
  388. <span style='color:navy'>driver</span> demonstrates how to respond to
  389. Power Management OIDs. It sho</span><st1:PersonName><span
  390. style='font-size:10.0pt;font-family:Verdana;mso-fareast-font-family:SimSun;
  391. mso-bidi-font-family:Verdana'>w</span></st1:PersonName><span
  392. style='font-size:10.0pt;font-family:Verdana;mso-fareast-font-family:SimSun;
  393. mso-bidi-font-family:Verdana'>s ho</span><st1:PersonName><span
  394. style='font-size:10.0pt;font-family:Verdana;mso-fareast-font-family:SimSun;
  395. mso-bidi-font-family:Verdana'>w</span></st1:PersonName><span
  396. style='font-size:10.0pt;font-family:Verdana;mso-fareast-font-family:SimSun;
  397. mso-bidi-font-family:Verdana'> the miniport driver should suspend and
  398. resume the netcard. The <span style='color:navy'>driver</span> also sets
  399. WakeUp Patterns on the netcard and enables the <span class=SpellE>netcard</span>
  400. to </span><st1:PersonName><span style='font-size:10.0pt;font-family:Verdana;
  401. mso-fareast-font-family:SimSun;mso-bidi-font-family:Verdana'>w</span></st1:PersonName><span
  402. style='font-size:10.0pt;font-family:Verdana;mso-fareast-font-family:SimSun;
  403. mso-bidi-font-family:Verdana'>ake up the machine on <span class=SpellE>PatternMatch</span>
  404. (this is only implemented on the 82559 version of the Intel <span
  405. class=SpellE>NetCard</span>).<o:p></o:p></span></li>
  406. <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
  407. mso-list:l0 level1 lfo3;tab-stops:list .5in'><span style='font-size:10.0pt;
  408. font-family:Verdana'>NDIS 5: <b>LBFO</b>: This driver sho</span><st1:PersonName><span
  409. style='font-size:10.0pt;font-family:Verdana'>w</span></st1:PersonName><span
  410. style='font-size:10.0pt;font-family:Verdana'>s ho</span><st1:PersonName><span
  411. style='font-size:10.0pt;font-family:Verdana'>w</span></st1:PersonName><span
  412. style='font-size:10.0pt;font-family:Verdana'> to use LBFO APIs to
  413. implement LBFO functionality. This driver implements a simple LBFO
  414. scenario. This driver uses the primary adapter to receive packets. On the
  415. send side, the driver sends packets on the first available secondary
  416. adapter. If no secondary adapter is available, the driver sends packets on
  417. the primary adapter (see mp_main.c).<o:p></o:p></span></li>
  418. <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
  419. mso-list:l0 level1 lfo3;tab-stops:list .5in'><span style='font-size:10.0pt;
  420. font-family:Verdana'>NDIS 5: <b>NdisMInitializeScatterGatherDma</b><span
  421. style='mso-bidi-font-weight:bold'>;<b> </b></span>this driver al</span><st1:PersonName><span
  422. style='font-size:10.0pt;font-family:Verdana'>w</span></st1:PersonName><span
  423. style='font-size:10.0pt;font-family:Verdana'>ays attempts to use scatter
  424. gather </span><st1:PersonName><span style='font-size:10.0pt;font-family:
  425. Verdana'>w</span></st1:PersonName><span style='font-size:10.0pt;
  426. font-family:Verdana'>hich is available in NDIS 5 and later. If this call
  427. fails (on Win98 and later), it falls back to use map registers.<o:p></o:p></span></li>
  428. <li class=MsoNormal style='color:navy;mso-list:l0 level1 lfo3;tab-stops:list .5in;
  429. mso-layout-grid-align:none;text-autospace:none'><b style='mso-bidi-font-weight:
  430. normal'><span style='font-size:10.0pt;font-family:Verdana;color:black'>OFFLOAD</span></b><span
  431. style='font-size:10.0pt;font-family:Verdana;color:black'>:<b
  432. style='mso-bidi-font-weight:normal'> </b></span><span style='font-size:
  433. 10.0pt;font-family:Verdana;mso-fareast-font-family:SimSun;mso-bidi-font-family:
  434. Verdana;color:windowtext'>This driver sho</span><st1:PersonName><span
  435. style='font-size:10.0pt;font-family:Verdana;mso-fareast-font-family:SimSun;
  436. mso-bidi-font-family:Verdana;color:windowtext'>w</span></st1:PersonName><span
  437. style='font-size:10.0pt;font-family:Verdana;mso-fareast-font-family:SimSun;
  438. mso-bidi-font-family:Verdana;color:windowtext'>s ho</span><st1:PersonName><span
  439. style='font-size:10.0pt;font-family:Verdana;mso-fareast-font-family:SimSun;
  440. mso-bidi-font-family:Verdana;color:windowtext'>w</span></st1:PersonName><span
  441. style='font-size:10.0pt;font-family:Verdana;mso-fareast-font-family:SimSun;
  442. mso-bidi-font-family:Verdana;color:windowtext'> to handle
  443. OID_TCP_TASK_OFFLOAD to enable/disable task offload capabilities of a NIC,
  444. and ho</span><st1:PersonName><span style='font-size:10.0pt;font-family:
  445. Verdana;mso-fareast-font-family:SimSun;mso-bidi-font-family:Verdana;
  446. color:windowtext'>w</span></st1:PersonName><span style='font-size:10.0pt;
  447. font-family:Verdana;mso-fareast-font-family:SimSun;mso-bidi-font-family:
  448. Verdana;color:windowtext'> to handle per-packet information related to
  449. these capabilities. In particular, the driver implements algorithms for
  450. TCP/IP checksum offloading and segmentation of large TCP packets on the
  451. send side. Note that these algorithms are implemented in soft</span><st1:PersonName><span
  452. style='font-size:10.0pt;font-family:Verdana;mso-fareast-font-family:SimSun;
  453. mso-bidi-font-family:Verdana;color:windowtext'>w</span></st1:PersonName><span
  454. style='font-size:10.0pt;font-family:Verdana;mso-fareast-font-family:SimSun;
  455. mso-bidi-font-family:Verdana;color:windowtext'>are purely for illustrative
  456. purposes. It is expected that these algorithms </span><st1:PersonName><span
  457. style='font-size:10.0pt;font-family:Verdana;mso-fareast-font-family:SimSun;
  458. mso-bidi-font-family:Verdana;color:windowtext'>w</span></st1:PersonName><span
  459. style='font-size:10.0pt;font-family:Verdana;mso-fareast-font-family:SimSun;
  460. mso-bidi-font-family:Verdana;color:windowtext'>ould be implemented in hard</span><st1:PersonName><span
  461. style='font-size:10.0pt;font-family:Verdana;mso-fareast-font-family:SimSun;
  462. mso-bidi-font-family:Verdana;color:windowtext'>w</span></st1:PersonName><span
  463. style='font-size:10.0pt;font-family:Verdana;mso-fareast-font-family:SimSun;
  464. mso-bidi-font-family:Verdana;color:windowtext'>are. Shipping drivers
  465. should not perform task offload in soft</span><st1:PersonName><span
  466. style='font-size:10.0pt;font-family:Verdana;mso-fareast-font-family:SimSun;
  467. mso-bidi-font-family:Verdana;color:windowtext'>w</span></st1:PersonName><span
  468. style='font-size:10.0pt;font-family:Verdana;mso-fareast-font-family:SimSun;
  469. mso-bidi-font-family:Verdana;color:windowtext'>are.</span><span
  470. style='font-size:10.0pt;font-family:Arial;mso-fareast-font-family:SimSun'><o:p></o:p></span></li>
  471. <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
  472. mso-list:l0 level1 lfo3;tab-stops:list .5in'><span style='font-size:10.0pt;
  473. font-family:Verdana'>NDIS 5.1: Send packet cancellation. The <b>CancelSendPacketsHandler
  474. </b>allo</span><st1:PersonName><span style='font-size:10.0pt;font-family:
  475. Verdana'>w</span></st1:PersonName><span style='font-size:10.0pt;
  476. font-family:Verdana'>s protocols to cancel pending send packets </span><st1:PersonName><span
  477. style='font-size:10.0pt;font-family:Verdana'>w</span></st1:PersonName><span
  478. style='font-size:10.0pt;font-family:Verdana'>hich are queued in the
  479. miniport send queue (MPCancelSendPackets() in mp_main.c).<o:p></o:p></span></li>
  480. <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
  481. mso-list:l0 level1 lfo3;tab-stops:list .5in'><span style='font-size:10.0pt;
  482. font-family:Verdana'>NDIS 5.1: PNP event notification handler. The
  483. miniport drivers can have a <b>PnPEventNotifyHandler </b>to process
  484. anything necessary </span><st1:PersonName><span style='font-size:10.0pt;
  485. font-family:Verdana'>w</span></st1:PersonName><span style='font-size:
  486. 10.0pt;font-family:Verdana'>hen a PNP event happens (MPPnPEventNotify() in
  487. mp_main.c). <o:p></o:p></span></li>
  488. <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
  489. mso-list:l0 level1 lfo3;tab-stops:list .5in'><span style='font-size:10.0pt;
  490. font-family:Verdana'>NDIS 5.1: AdapterShutdo</span><st1:PersonName><span
  491. style='font-size:10.0pt;font-family:Verdana'>w</span></st1:PersonName><span
  492. style='font-size:10.0pt;font-family:Verdana'>nHandler is no</span><st1:PersonName><span
  493. style='font-size:10.0pt;font-family:Verdana'>w</span></st1:PersonName><span
  494. style='font-size:10.0pt;font-family:Verdana'> a standard miniport handler
  495. starting NDIS 5.1. It eliminates the need to call <span class=SpellE>NdisMRegisterAdapterShutdownhandler</span>.<o:p></o:p></span></li>
  496. <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
  497. mso-list:l0 level1 lfo3;tab-stops:list .5in'><span style='font-size:10.0pt;
  498. font-family:Verdana'>The Kernel Debugger DLL in this package works on
  499. Windows XP and later Operating Systems.<o:p></o:p></span></li>
  500. </ol>
  501. <p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
  502. margin-left:.25in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
  503. style='font-size:10.0pt;font-family:Verdana'><o:p>&nbsp;</o:p></span></p>
  504. <p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
  505. margin-left:.25in;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
  506. style='font-size:10.0pt;font-family:Verdana'><o:p>&nbsp;</o:p></span></p>
  507. <p align=center style='text-align:center;tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
  508. style='font-size:10.0pt;font-family:Verdana'><a href="#top">Top of page</a> <o:p></o:p></span></p>
  509. <table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 width=624
  510. style='width:6.5in;mso-cellspacing:0in;mso-padding-alt:0in 0in 0in 0in'>
  511. <tr style='mso-yfti-irow:0;mso-yfti-lastrow:yes;height:1.5pt'>
  512. <td style='background:aqua;padding:.75pt .75pt .75pt .75pt;height:1.5pt'>
  513. <p class=MsoNormal><o:p>&nbsp;</o:p></p>
  514. </td>
  515. </tr>
  516. </table>
  517. <p style='tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt'><span
  518. style='font-size:7.5pt;font-family:"MS Sans Serif"'>� 1999 Microsoft
  519. Corporation</span><span style='font-size:10.0pt;font-family:Verdana'> <o:p></o:p></span></p>
  520. </div>
  521. </body>
  522. </html>