Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

543 lines
30 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:Compatibility>
  20. <w:UseFELayout/>
  21. </w:Compatibility>
  22. <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
  23. </w:WordDocument>
  24. </xml><![endif]--><!--[if !mso]><object
  25. classid="clsid:38481807-CA0E-42D2-BF39-B33AF135CC4D" id=ieooui></object>
  26. <style>
  27. st1\:*{behavior:url(#ieooui) }
  28. </style>
  29. <![endif]-->
  30. <style>
  31. <!--
  32. /* Font Definitions */
  33. @font-face
  34. {font-family:SimSun;
  35. panose-1:2 1 6 0 3 1 1 1 1 1;
  36. mso-font-alt:\5B8B\4F53;
  37. mso-font-charset:134;
  38. mso-generic-font-family:auto;
  39. mso-font-pitch:variable;
  40. mso-font-signature:3 135135232 16 0 262145 0;}
  41. @font-face
  42. {font-family:"\@SimSun";
  43. panose-1:2 1 6 0 3 1 1 1 1 1;
  44. mso-font-charset:134;
  45. mso-generic-font-family:auto;
  46. mso-font-pitch:variable;
  47. mso-font-signature:3 135135232 16 0 262145 0;}
  48. @font-face
  49. {font-family:Verdana;
  50. panose-1:2 11 6 4 3 5 4 4 2 4;
  51. mso-font-charset:0;
  52. mso-generic-font-family:swiss;
  53. mso-font-pitch:variable;
  54. mso-font-signature:536871559 0 0 0 415 0;}
  55. @font-face
  56. {font-family:"MS Sans Serif";
  57. panose-1:0 0 0 0 0 0 0 0 0 0;
  58. mso-font-charset:0;
  59. mso-generic-font-family:swiss;
  60. mso-font-format:other;
  61. mso-font-pitch:variable;
  62. mso-font-signature:3 0 0 0 1 0;}
  63. /* Style Definitions */
  64. p.MsoNormal, li.MsoNormal, div.MsoNormal
  65. {mso-style-parent:"";
  66. margin:0in;
  67. margin-bottom:.0001pt;
  68. mso-pagination:widow-orphan;
  69. font-size:12.0pt;
  70. font-family:"Times New Roman";
  71. mso-fareast-font-family:"Times New Roman";
  72. color:black;}
  73. h2
  74. {mso-margin-top-alt:auto;
  75. margin-right:0in;
  76. mso-margin-bottom-alt:auto;
  77. margin-left:0in;
  78. mso-pagination:widow-orphan;
  79. mso-outline-level:2;
  80. font-size:18.0pt;
  81. font-family:"Times New Roman";
  82. mso-fareast-font-family:SimSun;
  83. color:black;
  84. font-weight:bold;}
  85. h3
  86. {mso-margin-top-alt:auto;
  87. margin-right:0in;
  88. mso-margin-bottom-alt:auto;
  89. margin-left:0in;
  90. mso-pagination:widow-orphan;
  91. mso-outline-level:3;
  92. font-size:13.5pt;
  93. font-family:"Times New Roman";
  94. mso-fareast-font-family:SimSun;
  95. color:black;
  96. font-weight:bold;}
  97. h4
  98. {mso-margin-top-alt:auto;
  99. margin-right:0in;
  100. mso-margin-bottom-alt:auto;
  101. margin-left:0in;
  102. mso-pagination:widow-orphan;
  103. mso-outline-level:4;
  104. font-size:12.0pt;
  105. font-family:"Times New Roman";
  106. mso-fareast-font-family:SimSun;
  107. color:black;
  108. font-weight:bold;}
  109. a:link, span.MsoHyperlink
  110. {color:blue;
  111. text-decoration:underline;
  112. text-underline:single;}
  113. a:visited, span.MsoHyperlinkFollowed
  114. {color:purple;
  115. text-decoration:underline;
  116. text-underline:single;}
  117. p
  118. {mso-margin-top-alt:auto;
  119. margin-right:0in;
  120. mso-margin-bottom-alt:auto;
  121. margin-left:0in;
  122. mso-pagination:widow-orphan;
  123. font-size:12.0pt;
  124. font-family:"Times New Roman";
  125. mso-fareast-font-family:"Times New Roman";
  126. color:black;}
  127. pre
  128. {margin:0in;
  129. margin-bottom:.0001pt;
  130. mso-pagination:widow-orphan;
  131. 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;
  132. font-size:10.0pt;
  133. font-family:"Courier New";
  134. mso-fareast-font-family:"Courier New";
  135. color:black;}
  136. span.SpellE
  137. {mso-style-name:"";
  138. mso-spl-e:yes;}
  139. span.GramE
  140. {mso-style-name:"";
  141. mso-gram-e:yes;}
  142. @page Section1
  143. {size:8.5in 11.0in;
  144. margin:1.0in 1.25in 1.0in 1.25in;
  145. mso-header-margin:.5in;
  146. mso-footer-margin:.5in;
  147. mso-paper-source:0;}
  148. div.Section1
  149. {page:Section1;}
  150. /* List Definitions */
  151. @list l0
  152. {mso-list-id:381560120;
  153. mso-list-type:hybrid;
  154. mso-list-template-ids:-351239334 -695840708 -1982296020 1854160056 -372070536 1348993084 1615251444 1623514094 -1314389320 -1345299260;}
  155. @list l0:level1
  156. {mso-level-tab-stop:.5in;
  157. mso-level-number-position:left;
  158. text-indent:-.25in;}
  159. @list l0:level2
  160. {mso-level-tab-stop:1.0in;
  161. mso-level-number-position:left;
  162. text-indent:-.25in;}
  163. @list l0:level3
  164. {mso-level-tab-stop:1.5in;
  165. mso-level-number-position:left;
  166. text-indent:-.25in;}
  167. @list l0:level4
  168. {mso-level-tab-stop:2.0in;
  169. mso-level-number-position:left;
  170. text-indent:-.25in;}
  171. @list l0:level5
  172. {mso-level-tab-stop:2.5in;
  173. mso-level-number-position:left;
  174. text-indent:-.25in;}
  175. @list l0:level6
  176. {mso-level-tab-stop:3.0in;
  177. mso-level-number-position:left;
  178. text-indent:-.25in;}
  179. @list l0:level7
  180. {mso-level-tab-stop:3.5in;
  181. mso-level-number-position:left;
  182. text-indent:-.25in;}
  183. @list l0:level8
  184. {mso-level-tab-stop:4.0in;
  185. mso-level-number-position:left;
  186. text-indent:-.25in;}
  187. @list l0:level9
  188. {mso-level-tab-stop:4.5in;
  189. mso-level-number-position:left;
  190. text-indent:-.25in;}
  191. @list l1
  192. {mso-list-id:493496583;
  193. mso-list-template-ids:866036378;}
  194. ol
  195. {margin-bottom:0in;}
  196. ul
  197. {margin-bottom:0in;}
  198. -->
  199. </style>
  200. <!--[if gte mso 10]>
  201. <style>
  202. /* Style Definitions */
  203. table.MsoNormalTable
  204. {mso-style-name:"Table Normal";
  205. mso-tstyle-rowband-size:0;
  206. mso-tstyle-colband-size:0;
  207. mso-style-noshow:yes;
  208. mso-style-parent:"";
  209. mso-padding-alt:0in 5.4pt 0in 5.4pt;
  210. mso-para-margin:0in;
  211. mso-para-margin-bottom:.0001pt;
  212. mso-pagination:widow-orphan;
  213. font-size:10.0pt;
  214. font-family:"Times New Roman";}
  215. </style>
  216. <![endif]-->
  217. <meta name=Template content="C:\PROGRAM FILES\MICROSOFT OFFICE\OFFICE\html.dot">
  218. <!--[if gte mso 9]><xml>
  219. <o:shapedefaults v:ext="edit" spidmax="15362"/>
  220. </xml><![endif]--><!--[if gte mso 9]><xml>
  221. <o:shapelayout v:ext="edit">
  222. <o:idmap v:ext="edit" data="1"/>
  223. </o:shapelayout></xml><![endif]-->
  224. </head>
  225. <body bgcolor=white lang=EN-US link=blue vlink=purple style='tab-interval:.5in'
  226. leftmargin=8>
  227. <div class=Section1>
  228. <h2><a name=MYSAMPLE><span style='font-family:Verdana'>E100BEX</span></a><span
  229. style='font-family:Verdana'> <o:p></o:p></span></h2>
  230. <p class=MsoNormal><span style='font-family:Verdana;color:red'>[This is
  231. preliminary documentation and subject to change.]</span><span style='font-family:
  232. Verdana'> <o:p></o:p></span></p>
  233. <h3><span style='font-family:Verdana'>SUMMARY<o:p></o:p></span></h3>
  234. <p><span style='font-size:10.0pt;font-family:Verdana'>This sample is an NDIS 5
  235. deserialized miniport driver for the Intel EtherExpress<sup>TM</sup> PRO/100+
  236. Ethernet PCI adapter and the Intel EtherExpress<sup>TM</sup> PRO/100B PCI
  237. adapter. It illustrates NDIS 4 and NDIS 5 features such as multiple packet
  238. sends/receives, scatter gather DMA, LBFO, media sense, WMI, and Po</span><st1:PersonName><span
  239. style='font-size:10.0pt;font-family:Verdana'>w</span></st1:PersonName><span
  240. style='font-size:10.0pt;font-family:Verdana'>er Management. It also has NDIS
  241. 5.1 miniport features such as cancellation of send packets and PNP event
  242. handler. This driver comes </span><st1:PersonName><span style='font-size:10.0pt;
  243. font-family:Verdana'>w</span></st1:PersonName><span style='font-size:10.0pt;
  244. font-family:Verdana'>ith a KD extension DLL.<o:p></o:p></span></p>
  245. <p class=MsoNormal><span style='font-size:10.0pt;font-family:Verdana'>This
  246. driver supports Plug and Play. The code is 64-bit compliant, and builds
  247. properly </span><st1:PersonName><span style='font-size:10.0pt;font-family:Verdana'>w</span></st1:PersonName><span
  248. style='font-size:10.0pt;font-family:Verdana'>ith Microsoft� Visual C� 6.0. <o:p></o:p></span></p>
  249. <h3><span style='font-family:Verdana'>BUILDING THE SAMPLE<o:p></o:p></span></h3>
  250. <p><span style='font-size:10.0pt;font-family:Verdana'>Run the <b>build</b>
  251. command from this directory to build the sample. That creates the binary
  252. E100bex.sys. <o:p></o:p></span></p>
  253. <h3><span style='font-family:Verdana'>TOOLS<o:p></o:p></span></h3>
  254. <p><span style='font-size:10.0pt;font-family:Verdana'>The NDISTEST tool can be
  255. used to test some of the features of this driver. Note that this is not a
  256. production driver, and is not intended to replace the driver in the Windo</span><st1:PersonName><span
  257. style='font-size:10.0pt;font-family:Verdana'>w</span></st1:PersonName><span
  258. style='font-size:10.0pt;font-family:Verdana'>s� 2000 build. <o:p></o:p></span></p>
  259. <h3><span style='font-family:Verdana'>CODE TOUR<o:p></o:p></span></h3>
  260. <h4><span style='font-family:Verdana'>File Manifest<o:p></o:p></span></h4>
  261. <pre><u>Files<span style='mso-spacerun:yes'>�������� </span><span
  262. style='mso-tab-count:1'> </span>Description<o:p></o:p></u></pre><pre>E100BEX.htm<span style='mso-spacerun:yes'>�� </span><span
  263. style='mso-tab-count:1'> </span>The documentation for this sample (this file)</pre><pre>Net557ex.inf<span style='mso-spacerun:yes'></span><span
  264. 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
  265. style='mso-tab-count:1'> </span>The resource file for the code sample</pre><pre>e100.mof<span
  266. 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
  267. style='mso-tab-count:1'> </span>Precompile header</pre><pre><o:p>&nbsp;</o:p></pre><pre>mp.h<span
  268. style='mso-tab-count:2'>���������� </span>Miniport generic portion header file</pre><pre>mp_cmn.h<span
  269. style='mso-tab-count:1'>������ </span>Common definitions for the miniport and kd extension dll</pre><pre>mp_dbg.h<span
  270. style='mso-tab-count:1'>������ </span>Debug code definitions and structures</pre><pre>mp_def.h<span
  271. style='mso-tab-count:1'>������ </span>NIC specific definitions<span
  272. style='mso-tab-count:1'>������ </span></pre><pre>mp_nic.h<span
  273. 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
  274. style='mso-tab-count:1'>������ </span>Debug-related code</pre><pre>mp_init.c<span
  275. style='mso-tab-count:1'>����� </span>Miniport initialization related routines</pre><pre>mp_main.c<span
  276. style='mso-tab-count:1'>����� </span>DriverEntry and NDIS miniport handlers</pre><pre>mp_nic.c<span
  277. style='mso-tab-count:1'>������ </span>Miniport send/receive routines</pre><pre>mp_req.c<span
  278. 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
  279. 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
  280. 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
  281. style='mso-tab-count:1'>���� </span>Hard<st1:PersonName>w</st1:PersonName>are specific constant definitions</pre><pre>e100_sup.h<span
  282. 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
  283. style='mso-tab-count:1'> </span>Routines to access EEPROM information</pre><pre>physet.c<span style='mso-spacerun:yes'>����� </span><span
  284. 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
  285. 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
  286. style='mso-tab-count:1'> </span>The sources include file</pre><pre>makefile.inc<span
  287. 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>50\sources<span
  288. style='mso-tab-count:1'>���� </span>Sources file to build NDIS 5.0 compliant driver</pre><pre>51\sources<span
  289. style='mso-tab-count:1'>���� </span>Sources file to build NDIS 5.1 compliant driver</pre><pre><o:p>&nbsp;</o:p></pre><pre>kd\e100kd.c<span
  290. style='mso-tab-count:1'>��� </span>The C file for the KD extension DLL (e100kd.dll)</pre><pre>kd\e100kd.def<span
  291. style='mso-tab-count:1'>� </span>The definition file for the KD extension DLL</pre><pre>kd\e100kd.h<span
  292. style='mso-tab-count:1'>��� </span><span class=GramE>The</span> header file for the KD extension DLL</pre><pre>kd\e100kd.rc<span
  293. style='mso-tab-count:1'>�� </span>The resource file for the KD extension DLL</pre><pre><o:p>&nbsp;</o:p></pre>
  294. <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
  295. style='font-family:Verdana'>Programming Tour<o:p></o:p></span></h4>
  296. <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
  297. style='font-size:10.0pt;font-family:Verdana'>Some of the features illustrated
  298. in this driver are listed belo</span><st1:PersonName><span style='font-size:
  299. 10.0pt;font-family:Verdana'>w</span></st1:PersonName><span style='font-size:
  300. 10.0pt;font-family:Verdana'>, along </span><st1:PersonName><span
  301. style='font-size:10.0pt;font-family:Verdana'>w</span></st1:PersonName><span
  302. style='font-size:10.0pt;font-family:Verdana'>ith the files that contain the
  303. feature.<o:p></o:p></span></p>
  304. <ol start=1 type=1>
  305. <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
  306. mso-list:l0 level1 lfo3;tab-stops:list .5in'><span style='font-size:10.0pt;
  307. font-family:Verdana'>NDIS 4: <b>SendPacketsHandler</b><span
  308. style='mso-bidi-font-weight:bold'>;</span> multiple packets per send
  309. request are handled (<span class=GramE>MpSendPackets(</span>) in mp_main.c).<o:p></o:p></span></li>
  310. <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
  311. mso-list:l0 level1 lfo3;tab-stops:list .5in'><span style='font-size:10.0pt;
  312. font-family:Verdana'>NDIS 4: <b>NdisMIndicateReceivePacket()</b><span
  313. style='mso-bidi-font-weight:bold'>;</span> multiple packets per receive
  314. indication (MpHandleRecvInterrupt() in mp_nic.c).<o:p></o:p></span></li>
  315. <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
  316. mso-list:l0 level1 lfo3;tab-stops:list .5in'><span style='font-size:10.0pt;
  317. font-family:Verdana'>NDIS 4: Receive buffer gro</span><st1:PersonName><span
  318. style='font-size:10.0pt;font-family:Verdana'>w</span></st1:PersonName><span
  319. style='font-size:10.0pt;font-family:Verdana'> and shrink; When the adapter
  320. driver begins to run out of receive memory, <b>NdisMAllocateSharedMemoryAsyn()</b>
  321. is called to allocate more shared memory for receive buffers
  322. (MpHandleRecvInterrupt() in mp_nic.c). When the traffic slo</span><st1:PersonName><span
  323. style='font-size:10.0pt;font-family:Verdana'>w</span></st1:PersonName><span
  324. style='font-size:10.0pt;font-family:Verdana'>s do</span><st1:PersonName><span
  325. style='font-size:10.0pt;font-family:Verdana'>w</span></st1:PersonName><span
  326. style='font-size:10.0pt;font-family:Verdana'>n, the driver frees the
  327. memory (MPReturnPacket() in mp_main.c)<o:p></o:p></span></li>
  328. <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
  329. mso-list:l0 level1 lfo3;tab-stops:list .5in'><span style='font-size:10.0pt;
  330. font-family:Verdana'>NDIS 4: NdisMRegisterAdapterShutdo</span><st1:PersonName><span
  331. style='font-size:10.0pt;font-family:Verdana'>w</span></st1:PersonName><span
  332. style='font-size:10.0pt;font-family:Verdana'>nHandler() is called at initialization
  333. time to make sure the adapter has a function that stops generating
  334. interrupts and receiving packets into main memory (MpInitiliaze() and
  335. MpShutdo</span><st1:PersonName><span style='font-size:10.0pt;font-family:
  336. Verdana'>w</span></st1:PersonName><span style='font-size:10.0pt;
  337. font-family:Verdana'>n() in mp_main.c).<o:p></o:p></span></li>
  338. <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
  339. mso-list:l0 level1 lfo3;tab-stops:list .5in'><span style='font-size:10.0pt;
  340. font-family:Verdana'>NDIS 4: Media disconnect/connect indications are
  341. supported. This allo</span><st1:PersonName><span style='font-size:10.0pt;
  342. font-family:Verdana'>w</span></st1:PersonName><span style='font-size:
  343. 10.0pt;font-family:Verdana'>s the driver to tell NDIS </span><st1:PersonName><span
  344. style='font-size:10.0pt;font-family:Verdana'>w</span></st1:PersonName><span
  345. style='font-size:10.0pt;font-family:Verdana'>hen the adapter has lost or
  346. regained link (MpCheckForHang() in mp_main.c).<o:p></o:p></span></li>
  347. <li class=MsoNormal style='mso-list:l0 level1 lfo3;tab-stops:list .5in;
  348. mso-layout-grid-align:none;text-autospace:none'><span style='font-size:
  349. 10.0pt;font-family:Verdana'>NDIS 5: </span><span style='font-size:10.0pt;
  350. font-family:Verdana;mso-fareast-font-family:SimSun;mso-bidi-font-family:
  351. Verdana;color:windowtext'>This driver is a de-serialized miniport,
  352. therefore it protects its resources using its o</span><st1:PersonName><span
  353. style='font-size:10.0pt;font-family:Verdana;mso-fareast-font-family:SimSun;
  354. mso-bidi-font-family:Verdana;color:windowtext'>w</span></st1:PersonName><span
  355. style='font-size:10.0pt;font-family:Verdana;mso-fareast-font-family:SimSun;
  356. mso-bidi-font-family:Verdana;color:windowtext'>n spin lock</span><span
  357. style='font-size:10.0pt;font-family:Verdana;mso-fareast-font-family:SimSun;
  358. mso-bidi-font-family:Verdana'>s</span><span style='font-size:10.0pt;
  359. font-family:Verdana;mso-fareast-font-family:SimSun;mso-bidi-font-family:
  360. Verdana;color:red'> </span><span style='font-size:10.0pt;font-family:Verdana;
  361. mso-fareast-font-family:SimSun;mso-bidi-font-family:Verdana'>rather than
  362. relying on <span class=SpellE>Ndis</span> to serialize the calls to the
  363. driver.</span><span style='font-size:10.0pt;font-family:Verdana'> This
  364. driver only implements a simple method of using spin lock: it has a <span
  365. class=GramE><b>NdisAcquireSpinlock(</b></span><b>)</b> at every entry
  366. point and a <b>NdisReleaseSpinlock()</b> at the return from those entry
  367. points. The locks could be done more efficiently in a production driver by
  368. moving the locking closer to the resources in the driver that need to be
  369. accessed </span><st1:PersonName><span style='font-size:10.0pt;font-family:
  370. Verdana'>w</span></st1:PersonName><span style='font-size:10.0pt;
  371. 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>NdisMRegisterAdapterShutdo</span></span><st1:PersonName><span
  496. class=SpellE><span style='font-size:10.0pt;font-family:Verdana'>w</span></span></st1:PersonName><span
  497. class=SpellE><span style='font-size:10.0pt;font-family:Verdana'>nhandler</span></span><span
  498. style='font-size:10.0pt;font-family:Verdana'>.<o:p></o:p></span></li>
  499. </ol>
  500. <p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
  501. 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
  502. style='font-size:10.0pt;font-family:Verdana'><o:p>&nbsp;</o:p></span></p>
  503. <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
  504. style='font-size:10.0pt;font-family:Verdana'><a href="#top">Top of page</a> <o:p></o:p></span></p>
  505. <table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 width=624
  506. style='width:6.5in;mso-cellspacing:0in;mso-padding-alt:0in 0in 0in 0in'>
  507. <tr style='mso-yfti-irow:0;mso-yfti-lastrow:yes;height:1.5pt'>
  508. <td style='background:aqua;padding:.75pt .75pt .75pt .75pt;height:1.5pt'>
  509. <p class=MsoNormal><o:p>&nbsp;</o:p></p>
  510. </td>
  511. </tr>
  512. </table>
  513. <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
  514. style='font-size:7.5pt;font-family:"MS Sans Serif"'>� 1999 Microsoft
  515. Corporation</span><span style='font-size:10.0pt;font-family:Verdana'> <o:p></o:p></span></p>
  516. </div>
  517. </body>
  518. </html>