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.

UefiPxe.h 48KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774
  1. /** @file
  2. This header file contains all of the PXE type definitions,
  3. structure prototypes, global variables and constants that
  4. are needed for porting PXE to EFI.
  5. Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
  6. This program and the accompanying materials are licensed and made available under
  7. the terms and conditions of the BSD License that accompanies this distribution.
  8. The full text of the license may be found at
  9. http://opensource.org/licenses/bsd-license.php.
  10. THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
  11. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
  12. @par Revision Reference:
  13. 32/64-bit PXE specification:
  14. alpha-4, 99-Dec-17.
  15. **/
  16. #ifndef __EFI_PXE_H__
  17. #define __EFI_PXE_H__
  18. FILE_LICENCE ( BSD3 );
  19. #pragma pack(1)
  20. #define PXE_BUSTYPE(a, b, c, d) \
  21. ( \
  22. (((PXE_UINT32) (d) & 0xFF) << 24) | (((PXE_UINT32) (c) & 0xFF) << 16) | (((PXE_UINT32) (b) & 0xFF) << 8) | \
  23. ((PXE_UINT32) (a) & 0xFF) \
  24. )
  25. ///
  26. /// UNDI ROM ID and devive ID signature.
  27. ///
  28. #define PXE_BUSTYPE_PXE PXE_BUSTYPE ('!', 'P', 'X', 'E')
  29. ///
  30. /// BUS ROM ID signatures.
  31. ///
  32. #define PXE_BUSTYPE_PCI PXE_BUSTYPE ('P', 'C', 'I', 'R')
  33. #define PXE_BUSTYPE_PC_CARD PXE_BUSTYPE ('P', 'C', 'C', 'R')
  34. #define PXE_BUSTYPE_USB PXE_BUSTYPE ('U', 'S', 'B', 'R')
  35. #define PXE_BUSTYPE_1394 PXE_BUSTYPE ('1', '3', '9', '4')
  36. #define PXE_SWAP_UINT16(n) ((((PXE_UINT16) (n) & 0x00FF) << 8) | (((PXE_UINT16) (n) & 0xFF00) >> 8))
  37. #define PXE_SWAP_UINT32(n) \
  38. ((((PXE_UINT32)(n) & 0x000000FF) << 24) | \
  39. (((PXE_UINT32)(n) & 0x0000FF00) << 8) | \
  40. (((PXE_UINT32)(n) & 0x00FF0000) >> 8) | \
  41. (((PXE_UINT32)(n) & 0xFF000000) >> 24))
  42. #define PXE_SWAP_UINT64(n) \
  43. ((((PXE_UINT64)(n) & 0x00000000000000FFULL) << 56) | \
  44. (((PXE_UINT64)(n) & 0x000000000000FF00ULL) << 40) | \
  45. (((PXE_UINT64)(n) & 0x0000000000FF0000ULL) << 24) | \
  46. (((PXE_UINT64)(n) & 0x00000000FF000000ULL) << 8) | \
  47. (((PXE_UINT64)(n) & 0x000000FF00000000ULL) >> 8) | \
  48. (((PXE_UINT64)(n) & 0x0000FF0000000000ULL) >> 24) | \
  49. (((PXE_UINT64)(n) & 0x00FF000000000000ULL) >> 40) | \
  50. (((PXE_UINT64)(n) & 0xFF00000000000000ULL) >> 56))
  51. #define PXE_CPBSIZE_NOT_USED 0 ///< zero
  52. #define PXE_DBSIZE_NOT_USED 0 ///< zero
  53. #define PXE_CPBADDR_NOT_USED (PXE_UINT64) 0 ///< zero
  54. #define PXE_DBADDR_NOT_USED (PXE_UINT64) 0 ///< zero
  55. #define PXE_CONST CONST
  56. #define PXE_VOLATILE volatile
  57. typedef VOID PXE_VOID;
  58. typedef UINT8 PXE_UINT8;
  59. typedef UINT16 PXE_UINT16;
  60. typedef UINT32 PXE_UINT32;
  61. typedef UINTN PXE_UINTN;
  62. ///
  63. /// Typedef unsigned long PXE_UINT64.
  64. ///
  65. typedef UINT64 PXE_UINT64;
  66. typedef PXE_UINT8 PXE_BOOL;
  67. #define PXE_FALSE 0 ///< zero
  68. #define PXE_TRUE (!PXE_FALSE)
  69. typedef PXE_UINT16 PXE_OPCODE;
  70. ///
  71. /// Return UNDI operational state.
  72. ///
  73. #define PXE_OPCODE_GET_STATE 0x0000
  74. ///
  75. /// Change UNDI operational state from Stopped to Started.
  76. ///
  77. #define PXE_OPCODE_START 0x0001
  78. ///
  79. /// Change UNDI operational state from Started to Stopped.
  80. ///
  81. #define PXE_OPCODE_STOP 0x0002
  82. ///
  83. /// Get UNDI initialization information.
  84. ///
  85. #define PXE_OPCODE_GET_INIT_INFO 0x0003
  86. ///
  87. /// Get NIC configuration information.
  88. ///
  89. #define PXE_OPCODE_GET_CONFIG_INFO 0x0004
  90. ///
  91. /// Changed UNDI operational state from Started to Initialized.
  92. ///
  93. #define PXE_OPCODE_INITIALIZE 0x0005
  94. ///
  95. /// Re-initialize the NIC H/W.
  96. ///
  97. #define PXE_OPCODE_RESET 0x0006
  98. ///
  99. /// Change the UNDI operational state from Initialized to Started.
  100. ///
  101. #define PXE_OPCODE_SHUTDOWN 0x0007
  102. ///
  103. /// Read & change state of external interrupt enables.
  104. ///
  105. #define PXE_OPCODE_INTERRUPT_ENABLES 0x0008
  106. ///
  107. /// Read & change state of packet receive filters.
  108. ///
  109. #define PXE_OPCODE_RECEIVE_FILTERS 0x0009
  110. ///
  111. /// Read & change station MAC address.
  112. ///
  113. #define PXE_OPCODE_STATION_ADDRESS 0x000A
  114. ///
  115. /// Read traffic statistics.
  116. ///
  117. #define PXE_OPCODE_STATISTICS 0x000B
  118. ///
  119. /// Convert multicast IP address to multicast MAC address.
  120. ///
  121. #define PXE_OPCODE_MCAST_IP_TO_MAC 0x000C
  122. ///
  123. /// Read or change non-volatile storage on the NIC.
  124. ///
  125. #define PXE_OPCODE_NVDATA 0x000D
  126. ///
  127. /// Get & clear interrupt status.
  128. ///
  129. #define PXE_OPCODE_GET_STATUS 0x000E
  130. ///
  131. /// Fill media header in packet for transmit.
  132. ///
  133. #define PXE_OPCODE_FILL_HEADER 0x000F
  134. ///
  135. /// Transmit packet(s).
  136. ///
  137. #define PXE_OPCODE_TRANSMIT 0x0010
  138. ///
  139. /// Receive packet.
  140. ///
  141. #define PXE_OPCODE_RECEIVE 0x0011
  142. ///
  143. /// Last valid PXE UNDI OpCode number.
  144. ///
  145. #define PXE_OPCODE_LAST_VALID 0x0011
  146. typedef PXE_UINT16 PXE_OPFLAGS;
  147. #define PXE_OPFLAGS_NOT_USED 0x0000
  148. //
  149. // //////////////////////////////////////
  150. // UNDI Get State
  151. //
  152. // No OpFlags
  153. ////////////////////////////////////////
  154. // UNDI Start
  155. //
  156. // No OpFlags
  157. ////////////////////////////////////////
  158. // UNDI Stop
  159. //
  160. // No OpFlags
  161. ////////////////////////////////////////
  162. // UNDI Get Init Info
  163. //
  164. // No Opflags
  165. ////////////////////////////////////////
  166. // UNDI Get Config Info
  167. //
  168. // No Opflags
  169. ///
  170. /// UNDI Initialize
  171. ///
  172. #define PXE_OPFLAGS_INITIALIZE_CABLE_DETECT_MASK 0x0001
  173. #define PXE_OPFLAGS_INITIALIZE_DETECT_CABLE 0x0000
  174. #define PXE_OPFLAGS_INITIALIZE_DO_NOT_DETECT_CABLE 0x0001
  175. ///
  176. ///
  177. /// UNDI Reset
  178. ///
  179. #define PXE_OPFLAGS_RESET_DISABLE_INTERRUPTS 0x0001
  180. #define PXE_OPFLAGS_RESET_DISABLE_FILTERS 0x0002
  181. ///
  182. /// UNDI Shutdown.
  183. ///
  184. /// No OpFlags.
  185. ///
  186. /// UNDI Interrupt Enables.
  187. ///
  188. ///
  189. /// Select whether to enable or disable external interrupt signals.
  190. /// Setting both enable and disable will return PXE_STATCODE_INVALID_OPFLAGS.
  191. ///
  192. #define PXE_OPFLAGS_INTERRUPT_OPMASK 0xC000
  193. #define PXE_OPFLAGS_INTERRUPT_ENABLE 0x8000
  194. #define PXE_OPFLAGS_INTERRUPT_DISABLE 0x4000
  195. #define PXE_OPFLAGS_INTERRUPT_READ 0x0000
  196. ///
  197. /// Enable receive interrupts. An external interrupt will be generated
  198. /// after a complete non-error packet has been received.
  199. ///
  200. #define PXE_OPFLAGS_INTERRUPT_RECEIVE 0x0001
  201. ///
  202. /// Enable transmit interrupts. An external interrupt will be generated
  203. /// after a complete non-error packet has been transmitted.
  204. ///
  205. #define PXE_OPFLAGS_INTERRUPT_TRANSMIT 0x0002
  206. ///
  207. /// Enable command interrupts. An external interrupt will be generated
  208. /// when command execution stops.
  209. ///
  210. #define PXE_OPFLAGS_INTERRUPT_COMMAND 0x0004
  211. ///
  212. /// Generate software interrupt. Setting this bit generates an external
  213. /// interrupt, if it is supported by the hardware.
  214. ///
  215. #define PXE_OPFLAGS_INTERRUPT_SOFTWARE 0x0008
  216. ///
  217. /// UNDI Receive Filters.
  218. ///
  219. ///
  220. /// Select whether to enable or disable receive filters.
  221. /// Setting both enable and disable will return PXE_STATCODE_INVALID_OPCODE.
  222. ///
  223. #define PXE_OPFLAGS_RECEIVE_FILTER_OPMASK 0xC000
  224. #define PXE_OPFLAGS_RECEIVE_FILTER_ENABLE 0x8000
  225. #define PXE_OPFLAGS_RECEIVE_FILTER_DISABLE 0x4000
  226. #define PXE_OPFLAGS_RECEIVE_FILTER_READ 0x0000
  227. ///
  228. /// To reset the contents of the multicast MAC address filter list,
  229. /// set this OpFlag:
  230. ///
  231. #define PXE_OPFLAGS_RECEIVE_FILTER_RESET_MCAST_LIST 0x2000
  232. ///
  233. /// Enable unicast packet receiving. Packets sent to the current station
  234. /// MAC address will be received.
  235. ///
  236. #define PXE_OPFLAGS_RECEIVE_FILTER_UNICAST 0x0001
  237. ///
  238. /// Enable broadcast packet receiving. Packets sent to the broadcast
  239. /// MAC address will be received.
  240. ///
  241. #define PXE_OPFLAGS_RECEIVE_FILTER_BROADCAST 0x0002
  242. ///
  243. /// Enable filtered multicast packet receiving. Packets sent to any
  244. /// of the multicast MAC addresses in the multicast MAC address filter
  245. /// list will be received. If the filter list is empty, no multicast
  246. ///
  247. #define PXE_OPFLAGS_RECEIVE_FILTER_FILTERED_MULTICAST 0x0004
  248. ///
  249. /// Enable promiscuous packet receiving. All packets will be received.
  250. ///
  251. #define PXE_OPFLAGS_RECEIVE_FILTER_PROMISCUOUS 0x0008
  252. ///
  253. /// Enable promiscuous multicast packet receiving. All multicast
  254. /// packets will be received.
  255. ///
  256. #define PXE_OPFLAGS_RECEIVE_FILTER_ALL_MULTICAST 0x0010
  257. ///
  258. /// UNDI Station Address.
  259. ///
  260. #define PXE_OPFLAGS_STATION_ADDRESS_READ 0x0000
  261. #define PXE_OPFLAGS_STATION_ADDRESS_WRITE 0x0000
  262. #define PXE_OPFLAGS_STATION_ADDRESS_RESET 0x0001
  263. ///
  264. /// UNDI Statistics.
  265. ///
  266. #define PXE_OPFLAGS_STATISTICS_READ 0x0000
  267. #define PXE_OPFLAGS_STATISTICS_RESET 0x0001
  268. ///
  269. /// UNDI MCast IP to MAC.
  270. ///
  271. ///
  272. /// Identify the type of IP address in the CPB.
  273. ///
  274. #define PXE_OPFLAGS_MCAST_IP_TO_MAC_OPMASK 0x0003
  275. #define PXE_OPFLAGS_MCAST_IPV4_TO_MAC 0x0000
  276. #define PXE_OPFLAGS_MCAST_IPV6_TO_MAC 0x0001
  277. ///
  278. /// UNDI NvData.
  279. ///
  280. ///
  281. /// Select the type of non-volatile data operation.
  282. ///
  283. #define PXE_OPFLAGS_NVDATA_OPMASK 0x0001
  284. #define PXE_OPFLAGS_NVDATA_READ 0x0000
  285. #define PXE_OPFLAGS_NVDATA_WRITE 0x0001
  286. ///
  287. /// UNDI Get Status.
  288. ///
  289. ///
  290. /// Return current interrupt status. This will also clear any interrupts
  291. /// that are currently set. This can be used in a polling routine. The
  292. /// interrupt flags are still set and cleared even when the interrupts
  293. /// are disabled.
  294. ///
  295. #define PXE_OPFLAGS_GET_INTERRUPT_STATUS 0x0001
  296. ///
  297. /// Return list of transmitted buffers for recycling. Transmit buffers
  298. /// must not be changed or unallocated until they have recycled. After
  299. /// issuing a transmit command, wait for a transmit complete interrupt.
  300. /// When a transmit complete interrupt is received, read the transmitted
  301. /// buffers. Do not plan on getting one buffer per interrupt. Some
  302. /// NICs and UNDIs may transmit multiple buffers per interrupt.
  303. ///
  304. #define PXE_OPFLAGS_GET_TRANSMITTED_BUFFERS 0x0002
  305. ///
  306. /// Return current media status.
  307. ///
  308. #define PXE_OPFLAGS_GET_MEDIA_STATUS 0x0004
  309. ///
  310. /// UNDI Fill Header.
  311. ///
  312. #define PXE_OPFLAGS_FILL_HEADER_OPMASK 0x0001
  313. #define PXE_OPFLAGS_FILL_HEADER_FRAGMENTED 0x0001
  314. #define PXE_OPFLAGS_FILL_HEADER_WHOLE 0x0000
  315. ///
  316. /// UNDI Transmit.
  317. ///
  318. ///
  319. /// S/W UNDI only. Return after the packet has been transmitted. A
  320. /// transmit complete interrupt will still be generated and the transmit
  321. /// buffer will have to be recycled.
  322. ///
  323. #define PXE_OPFLAGS_SWUNDI_TRANSMIT_OPMASK 0x0001
  324. #define PXE_OPFLAGS_TRANSMIT_BLOCK 0x0001
  325. #define PXE_OPFLAGS_TRANSMIT_DONT_BLOCK 0x0000
  326. #define PXE_OPFLAGS_TRANSMIT_OPMASK 0x0002
  327. #define PXE_OPFLAGS_TRANSMIT_FRAGMENTED 0x0002
  328. #define PXE_OPFLAGS_TRANSMIT_WHOLE 0x0000
  329. ///
  330. /// UNDI Receive.
  331. ///
  332. /// No OpFlags.
  333. ///
  334. ///
  335. /// PXE STATFLAGS.
  336. ///
  337. typedef PXE_UINT16 PXE_STATFLAGS;
  338. #define PXE_STATFLAGS_INITIALIZE 0x0000
  339. ///
  340. /// Common StatFlags that can be returned by all commands.
  341. ///
  342. ///
  343. /// The COMMAND_COMPLETE and COMMAND_FAILED status flags must be
  344. /// implemented by all UNDIs. COMMAND_QUEUED is only needed by UNDIs
  345. /// that support command queuing.
  346. ///
  347. #define PXE_STATFLAGS_STATUS_MASK 0xC000
  348. #define PXE_STATFLAGS_COMMAND_COMPLETE 0xC000
  349. #define PXE_STATFLAGS_COMMAND_FAILED 0x8000
  350. #define PXE_STATFLAGS_COMMAND_QUEUED 0x4000
  351. ///
  352. /// UNDI Get State.
  353. ///
  354. #define PXE_STATFLAGS_GET_STATE_MASK 0x0003
  355. #define PXE_STATFLAGS_GET_STATE_INITIALIZED 0x0002
  356. #define PXE_STATFLAGS_GET_STATE_STARTED 0x0001
  357. #define PXE_STATFLAGS_GET_STATE_STOPPED 0x0000
  358. ///
  359. /// UNDI Start.
  360. ///
  361. /// No additional StatFlags.
  362. ///
  363. ///
  364. /// UNDI Get Init Info.
  365. ///
  366. #define PXE_STATFLAGS_CABLE_DETECT_MASK 0x0001
  367. #define PXE_STATFLAGS_CABLE_DETECT_NOT_SUPPORTED 0x0000
  368. #define PXE_STATFLAGS_CABLE_DETECT_SUPPORTED 0x0001
  369. #define PXE_STATFLAGS_GET_STATUS_NO_MEDIA_MASK 0x0002
  370. #define PXE_STATFLAGS_GET_STATUS_NO_MEDIA_NOT_SUPPORTED 0x0000
  371. #define PXE_STATFLAGS_GET_STATUS_NO_MEDIA_SUPPORTED 0x0002
  372. ///
  373. /// UNDI Initialize.
  374. ///
  375. #define PXE_STATFLAGS_INITIALIZED_NO_MEDIA 0x0001
  376. ///
  377. /// UNDI Reset.
  378. ///
  379. #define PXE_STATFLAGS_RESET_NO_MEDIA 0x0001
  380. ///
  381. /// UNDI Shutdown.
  382. ///
  383. /// No additional StatFlags.
  384. ///
  385. /// UNDI Interrupt Enables.
  386. ///
  387. ///
  388. /// If set, receive interrupts are enabled.
  389. ///
  390. #define PXE_STATFLAGS_INTERRUPT_RECEIVE 0x0001
  391. ///
  392. /// If set, transmit interrupts are enabled.
  393. ///
  394. #define PXE_STATFLAGS_INTERRUPT_TRANSMIT 0x0002
  395. ///
  396. /// If set, command interrupts are enabled.
  397. ///
  398. #define PXE_STATFLAGS_INTERRUPT_COMMAND 0x0004
  399. ///
  400. /// UNDI Receive Filters.
  401. ///
  402. ///
  403. /// If set, unicast packets will be received.
  404. ///
  405. #define PXE_STATFLAGS_RECEIVE_FILTER_UNICAST 0x0001
  406. ///
  407. /// If set, broadcast packets will be received.
  408. ///
  409. #define PXE_STATFLAGS_RECEIVE_FILTER_BROADCAST 0x0002
  410. ///
  411. /// If set, multicast packets that match up with the multicast address
  412. /// filter list will be received.
  413. ///
  414. #define PXE_STATFLAGS_RECEIVE_FILTER_FILTERED_MULTICAST 0x0004
  415. ///
  416. /// If set, all packets will be received.
  417. ///
  418. #define PXE_STATFLAGS_RECEIVE_FILTER_PROMISCUOUS 0x0008
  419. ///
  420. /// If set, all multicast packets will be received.
  421. ///
  422. #define PXE_STATFLAGS_RECEIVE_FILTER_ALL_MULTICAST 0x0010
  423. ///
  424. /// UNDI Station Address.
  425. ///
  426. /// No additional StatFlags.
  427. ///
  428. ///
  429. /// UNDI Statistics.
  430. ///
  431. /// No additional StatFlags.
  432. ///
  433. ///
  434. //// UNDI MCast IP to MAC.
  435. ////
  436. //// No additional StatFlags.
  437. ///
  438. /// UNDI NvData.
  439. ///
  440. /// No additional StatFlags.
  441. ///
  442. ///
  443. /// UNDI Get Status.
  444. ///
  445. ///
  446. /// Use to determine if an interrupt has occurred.
  447. ///
  448. #define PXE_STATFLAGS_GET_STATUS_INTERRUPT_MASK 0x000F
  449. #define PXE_STATFLAGS_GET_STATUS_NO_INTERRUPTS 0x0000
  450. ///
  451. /// If set, at least one receive interrupt occurred.
  452. ///
  453. #define PXE_STATFLAGS_GET_STATUS_RECEIVE 0x0001
  454. ///
  455. /// If set, at least one transmit interrupt occurred.
  456. ///
  457. #define PXE_STATFLAGS_GET_STATUS_TRANSMIT 0x0002
  458. ///
  459. /// If set, at least one command interrupt occurred.
  460. ///
  461. #define PXE_STATFLAGS_GET_STATUS_COMMAND 0x0004
  462. ///
  463. /// If set, at least one software interrupt occurred.
  464. ///
  465. #define PXE_STATFLAGS_GET_STATUS_SOFTWARE 0x0008
  466. ///
  467. /// This flag is set if the transmitted buffer queue is empty. This flag
  468. /// will be set if all transmitted buffer addresses get written into the DB.
  469. ///
  470. #define PXE_STATFLAGS_GET_STATUS_TXBUF_QUEUE_EMPTY 0x0010
  471. ///
  472. /// This flag is set if no transmitted buffer addresses were written
  473. /// into the DB. (This could be because DBsize was too small.)
  474. ///
  475. #define PXE_STATFLAGS_GET_STATUS_NO_TXBUFS_WRITTEN 0x0020
  476. ///
  477. /// This flag is set if there is no media detected.
  478. ///
  479. #define PXE_STATFLAGS_GET_STATUS_NO_MEDIA 0x0040
  480. ///
  481. /// UNDI Fill Header.
  482. ///
  483. /// No additional StatFlags.
  484. ///
  485. ///
  486. /// UNDI Transmit.
  487. ///
  488. /// No additional StatFlags.
  489. ///
  490. /// UNDI Receive
  491. ///.
  492. ///
  493. /// No additional StatFlags.
  494. ///
  495. typedef PXE_UINT16 PXE_STATCODE;
  496. #define PXE_STATCODE_INITIALIZE 0x0000
  497. ///
  498. /// Common StatCodes returned by all UNDI commands, UNDI protocol functions
  499. /// and BC protocol functions.
  500. ///
  501. #define PXE_STATCODE_SUCCESS 0x0000
  502. #define PXE_STATCODE_INVALID_CDB 0x0001
  503. #define PXE_STATCODE_INVALID_CPB 0x0002
  504. #define PXE_STATCODE_BUSY 0x0003
  505. #define PXE_STATCODE_QUEUE_FULL 0x0004
  506. #define PXE_STATCODE_ALREADY_STARTED 0x0005
  507. #define PXE_STATCODE_NOT_STARTED 0x0006
  508. #define PXE_STATCODE_NOT_SHUTDOWN 0x0007
  509. #define PXE_STATCODE_ALREADY_INITIALIZED 0x0008
  510. #define PXE_STATCODE_NOT_INITIALIZED 0x0009
  511. #define PXE_STATCODE_DEVICE_FAILURE 0x000A
  512. #define PXE_STATCODE_NVDATA_FAILURE 0x000B
  513. #define PXE_STATCODE_UNSUPPORTED 0x000C
  514. #define PXE_STATCODE_BUFFER_FULL 0x000D
  515. #define PXE_STATCODE_INVALID_PARAMETER 0x000E
  516. #define PXE_STATCODE_INVALID_UNDI 0x000F
  517. #define PXE_STATCODE_IPV4_NOT_SUPPORTED 0x0010
  518. #define PXE_STATCODE_IPV6_NOT_SUPPORTED 0x0011
  519. #define PXE_STATCODE_NOT_ENOUGH_MEMORY 0x0012
  520. #define PXE_STATCODE_NO_DATA 0x0013
  521. typedef PXE_UINT16 PXE_IFNUM;
  522. ///
  523. /// This interface number must be passed to the S/W UNDI Start command.
  524. ///
  525. #define PXE_IFNUM_START 0x0000
  526. ///
  527. /// This interface number is returned by the S/W UNDI Get State and
  528. /// Start commands if information in the CDB, CPB or DB is invalid.
  529. ///
  530. #define PXE_IFNUM_INVALID 0x0000
  531. typedef PXE_UINT16 PXE_CONTROL;
  532. ///
  533. /// Setting this flag directs the UNDI to queue this command for later
  534. /// execution if the UNDI is busy and it supports command queuing.
  535. /// If queuing is not supported, a PXE_STATCODE_INVALID_CONTROL error
  536. /// is returned. If the queue is full, a PXE_STATCODE_CDB_QUEUE_FULL
  537. /// error is returned.
  538. ///
  539. #define PXE_CONTROL_QUEUE_IF_BUSY 0x0002
  540. ///
  541. /// These two bit values are used to determine if there are more UNDI
  542. /// CDB structures following this one. If the link bit is set, there
  543. /// must be a CDB structure following this one. Execution will start
  544. /// on the next CDB structure as soon as this one completes successfully.
  545. /// If an error is generated by this command, execution will stop.
  546. ///
  547. #define PXE_CONTROL_LINK 0x0001
  548. #define PXE_CONTROL_LAST_CDB_IN_LIST 0x0000
  549. typedef PXE_UINT8 PXE_FRAME_TYPE;
  550. #define PXE_FRAME_TYPE_NONE 0x00
  551. #define PXE_FRAME_TYPE_UNICAST 0x01
  552. #define PXE_FRAME_TYPE_BROADCAST 0x02
  553. #define PXE_FRAME_TYPE_FILTERED_MULTICAST 0x03
  554. #define PXE_FRAME_TYPE_PROMISCUOUS 0x04
  555. #define PXE_FRAME_TYPE_PROMISCUOUS_MULTICAST 0x05
  556. #define PXE_FRAME_TYPE_MULTICAST PXE_FRAME_TYPE_FILTERED_MULTICAST
  557. typedef PXE_UINT32 PXE_IPV4;
  558. typedef PXE_UINT32 PXE_IPV6[4];
  559. #define PXE_MAC_LENGTH 32
  560. typedef PXE_UINT8 PXE_MAC_ADDR[PXE_MAC_LENGTH];
  561. typedef PXE_UINT8 PXE_IFTYPE;
  562. typedef UINT16 PXE_MEDIA_PROTOCOL;
  563. ///
  564. /// This information is from the ARP section of RFC 1700.
  565. ///
  566. /// 1 Ethernet (10Mb) [JBP]
  567. /// 2 Experimental Ethernet (3Mb) [JBP]
  568. /// 3 Amateur Radio AX.25 [PXK]
  569. /// 4 Proteon ProNET Token Ring [JBP]
  570. /// 5 Chaos [GXP]
  571. /// 6 IEEE 802 Networks [JBP]
  572. /// 7 ARCNET [JBP]
  573. /// 8 Hyperchannel [JBP]
  574. /// 9 Lanstar [TU]
  575. /// 10 Autonet Short Address [MXB1]
  576. /// 11 LocalTalk [JKR1]
  577. /// 12 LocalNet (IBM* PCNet or SYTEK* LocalNET) [JXM]
  578. /// 13 Ultra link [RXD2]
  579. /// 14 SMDS [GXC1]
  580. /// 15 Frame Relay [AGM]
  581. /// 16 Asynchronous Transmission Mode (ATM) [JXB2]
  582. /// 17 HDLC [JBP]
  583. /// 18 Fibre Channel [Yakov Rekhter]
  584. /// 19 Asynchronous Transmission Mode (ATM) [Mark Laubach]
  585. /// 20 Serial Line [JBP]
  586. /// 21 Asynchronous Transmission Mode (ATM) [MXB1]
  587. ///
  588. /// * Other names and brands may be claimed as the property of others.
  589. ///
  590. #define PXE_IFTYPE_ETHERNET 0x01
  591. #define PXE_IFTYPE_TOKENRING 0x04
  592. #define PXE_IFTYPE_FIBRE_CHANNEL 0x12
  593. typedef struct s_pxe_hw_undi {
  594. PXE_UINT32 Signature; ///< PXE_ROMID_SIGNATURE.
  595. PXE_UINT8 Len; ///< sizeof(PXE_HW_UNDI).
  596. PXE_UINT8 Fudge; ///< makes 8-bit cksum equal zero.
  597. PXE_UINT8 Rev; ///< PXE_ROMID_REV.
  598. PXE_UINT8 IFcnt; ///< physical connector count lower byte.
  599. PXE_UINT8 MajorVer; ///< PXE_ROMID_MAJORVER.
  600. PXE_UINT8 MinorVer; ///< PXE_ROMID_MINORVER.
  601. PXE_UINT8 IFcntExt; ///< physical connector count upper byte.
  602. PXE_UINT8 reserved; ///< zero, not used.
  603. PXE_UINT32 Implementation; ///< implementation flags.
  604. ///< reserved ///< vendor use.
  605. ///< UINT32 Status; ///< status port.
  606. ///< UINT32 Command; ///< command port.
  607. ///< UINT64 CDBaddr; ///< CDB address port.
  608. ///<
  609. } PXE_HW_UNDI;
  610. ///
  611. /// Status port bit definitions.
  612. ///
  613. ///
  614. /// UNDI operation state.
  615. ///
  616. #define PXE_HWSTAT_STATE_MASK 0xC0000000
  617. #define PXE_HWSTAT_BUSY 0xC0000000
  618. #define PXE_HWSTAT_INITIALIZED 0x80000000
  619. #define PXE_HWSTAT_STARTED 0x40000000
  620. #define PXE_HWSTAT_STOPPED 0x00000000
  621. ///
  622. /// If set, last command failed.
  623. ///
  624. #define PXE_HWSTAT_COMMAND_FAILED 0x20000000
  625. ///
  626. /// If set, identifies enabled receive filters.
  627. ///
  628. #define PXE_HWSTAT_PROMISCUOUS_MULTICAST_RX_ENABLED 0x00001000
  629. #define PXE_HWSTAT_PROMISCUOUS_RX_ENABLED 0x00000800
  630. #define PXE_HWSTAT_BROADCAST_RX_ENABLED 0x00000400
  631. #define PXE_HWSTAT_MULTICAST_RX_ENABLED 0x00000200
  632. #define PXE_HWSTAT_UNICAST_RX_ENABLED 0x00000100
  633. ///
  634. /// If set, identifies enabled external interrupts.
  635. ///
  636. #define PXE_HWSTAT_SOFTWARE_INT_ENABLED 0x00000080
  637. #define PXE_HWSTAT_TX_COMPLETE_INT_ENABLED 0x00000040
  638. #define PXE_HWSTAT_PACKET_RX_INT_ENABLED 0x00000020
  639. #define PXE_HWSTAT_CMD_COMPLETE_INT_ENABLED 0x00000010
  640. ///
  641. /// If set, identifies pending interrupts.
  642. ///
  643. #define PXE_HWSTAT_SOFTWARE_INT_PENDING 0x00000008
  644. #define PXE_HWSTAT_TX_COMPLETE_INT_PENDING 0x00000004
  645. #define PXE_HWSTAT_PACKET_RX_INT_PENDING 0x00000002
  646. #define PXE_HWSTAT_CMD_COMPLETE_INT_PENDING 0x00000001
  647. ///
  648. /// Command port definitions.
  649. ///
  650. ///
  651. /// If set, CDB identified in CDBaddr port is given to UNDI.
  652. /// If not set, other bits in this word will be processed.
  653. ///
  654. #define PXE_HWCMD_ISSUE_COMMAND 0x80000000
  655. #define PXE_HWCMD_INTS_AND_FILTS 0x00000000
  656. ///
  657. /// Use these to enable/disable receive filters.
  658. ///
  659. #define PXE_HWCMD_PROMISCUOUS_MULTICAST_RX_ENABLE 0x00001000
  660. #define PXE_HWCMD_PROMISCUOUS_RX_ENABLE 0x00000800
  661. #define PXE_HWCMD_BROADCAST_RX_ENABLE 0x00000400
  662. #define PXE_HWCMD_MULTICAST_RX_ENABLE 0x00000200
  663. #define PXE_HWCMD_UNICAST_RX_ENABLE 0x00000100
  664. ///
  665. /// Use these to enable/disable external interrupts.
  666. ///
  667. #define PXE_HWCMD_SOFTWARE_INT_ENABLE 0x00000080
  668. #define PXE_HWCMD_TX_COMPLETE_INT_ENABLE 0x00000040
  669. #define PXE_HWCMD_PACKET_RX_INT_ENABLE 0x00000020
  670. #define PXE_HWCMD_CMD_COMPLETE_INT_ENABLE 0x00000010
  671. ///
  672. /// Use these to clear pending external interrupts.
  673. ///
  674. #define PXE_HWCMD_CLEAR_SOFTWARE_INT 0x00000008
  675. #define PXE_HWCMD_CLEAR_TX_COMPLETE_INT 0x00000004
  676. #define PXE_HWCMD_CLEAR_PACKET_RX_INT 0x00000002
  677. #define PXE_HWCMD_CLEAR_CMD_COMPLETE_INT 0x00000001
  678. typedef struct s_pxe_sw_undi {
  679. PXE_UINT32 Signature; ///< PXE_ROMID_SIGNATURE.
  680. PXE_UINT8 Len; ///< sizeof(PXE_SW_UNDI).
  681. PXE_UINT8 Fudge; ///< makes 8-bit cksum zero.
  682. PXE_UINT8 Rev; ///< PXE_ROMID_REV.
  683. PXE_UINT8 IFcnt; ///< physical connector count lower byte.
  684. PXE_UINT8 MajorVer; ///< PXE_ROMID_MAJORVER.
  685. PXE_UINT8 MinorVer; ///< PXE_ROMID_MINORVER.
  686. PXE_UINT8 IFcntExt; ///< physical connector count upper byte.
  687. PXE_UINT8 reserved1; ///< zero, not used.
  688. PXE_UINT32 Implementation; ///< Implementation flags.
  689. PXE_UINT64 EntryPoint; ///< API entry point.
  690. PXE_UINT8 reserved2[3]; ///< zero, not used.
  691. PXE_UINT8 BusCnt; ///< number of bustypes supported.
  692. PXE_UINT32 BusType[1]; ///< list of supported bustypes.
  693. } PXE_SW_UNDI;
  694. typedef union u_pxe_undi {
  695. PXE_HW_UNDI hw;
  696. PXE_SW_UNDI sw;
  697. } PXE_UNDI;
  698. ///
  699. /// Signature of !PXE structure.
  700. ///
  701. #define PXE_ROMID_SIGNATURE PXE_BUSTYPE ('!', 'P', 'X', 'E')
  702. ///
  703. /// !PXE structure format revision
  704. ///.
  705. #define PXE_ROMID_REV 0x02
  706. ///
  707. /// UNDI command interface revision. These are the values that get sent
  708. /// in option 94 (Client Network Interface Identifier) in the DHCP Discover
  709. /// and PXE Boot Server Request packets.
  710. ///
  711. #define PXE_ROMID_MAJORVER 0x03
  712. #define PXE_ROMID_MINORVER 0x01
  713. ///
  714. /// Implementation flags.
  715. ///
  716. #define PXE_ROMID_IMP_HW_UNDI 0x80000000
  717. #define PXE_ROMID_IMP_SW_VIRT_ADDR 0x40000000
  718. #define PXE_ROMID_IMP_64BIT_DEVICE 0x00010000
  719. #define PXE_ROMID_IMP_FRAG_SUPPORTED 0x00008000
  720. #define PXE_ROMID_IMP_CMD_LINK_SUPPORTED 0x00004000
  721. #define PXE_ROMID_IMP_CMD_QUEUE_SUPPORTED 0x00002000
  722. #define PXE_ROMID_IMP_MULTI_FRAME_SUPPORTED 0x00001000
  723. #define PXE_ROMID_IMP_NVDATA_SUPPORT_MASK 0x00000C00
  724. #define PXE_ROMID_IMP_NVDATA_BULK_WRITABLE 0x00000C00
  725. #define PXE_ROMID_IMP_NVDATA_SPARSE_WRITABLE 0x00000800
  726. #define PXE_ROMID_IMP_NVDATA_READ_ONLY 0x00000400
  727. #define PXE_ROMID_IMP_NVDATA_NOT_AVAILABLE 0x00000000
  728. #define PXE_ROMID_IMP_STATISTICS_SUPPORTED 0x00000200
  729. #define PXE_ROMID_IMP_STATION_ADDR_SETTABLE 0x00000100
  730. #define PXE_ROMID_IMP_PROMISCUOUS_MULTICAST_RX_SUPPORTED 0x00000080
  731. #define PXE_ROMID_IMP_PROMISCUOUS_RX_SUPPORTED 0x00000040
  732. #define PXE_ROMID_IMP_BROADCAST_RX_SUPPORTED 0x00000020
  733. #define PXE_ROMID_IMP_FILTERED_MULTICAST_RX_SUPPORTED 0x00000010
  734. #define PXE_ROMID_IMP_SOFTWARE_INT_SUPPORTED 0x00000008
  735. #define PXE_ROMID_IMP_TX_COMPLETE_INT_SUPPORTED 0x00000004
  736. #define PXE_ROMID_IMP_PACKET_RX_INT_SUPPORTED 0x00000002
  737. #define PXE_ROMID_IMP_CMD_COMPLETE_INT_SUPPORTED 0x00000001
  738. typedef struct s_pxe_cdb {
  739. PXE_OPCODE OpCode;
  740. PXE_OPFLAGS OpFlags;
  741. PXE_UINT16 CPBsize;
  742. PXE_UINT16 DBsize;
  743. PXE_UINT64 CPBaddr;
  744. PXE_UINT64 DBaddr;
  745. PXE_STATCODE StatCode;
  746. PXE_STATFLAGS StatFlags;
  747. PXE_UINT16 IFnum;
  748. PXE_CONTROL Control;
  749. } PXE_CDB;
  750. typedef union u_pxe_ip_addr {
  751. PXE_IPV6 IPv6;
  752. PXE_IPV4 IPv4;
  753. } PXE_IP_ADDR;
  754. typedef union pxe_device {
  755. ///
  756. /// PCI and PC Card NICs are both identified using bus, device
  757. /// and function numbers. For PC Card, this may require PC
  758. /// Card services to be loaded in the BIOS or preboot
  759. /// environment.
  760. ///
  761. struct {
  762. ///
  763. /// See S/W UNDI ROMID structure definition for PCI and
  764. /// PCC BusType definitions.
  765. ///
  766. PXE_UINT32 BusType;
  767. ///
  768. /// Bus, device & function numbers that locate this device.
  769. ///
  770. PXE_UINT16 Bus;
  771. PXE_UINT8 Device;
  772. PXE_UINT8 Function;
  773. }
  774. PCI, PCC;
  775. } PXE_DEVICE;
  776. ///
  777. /// cpb and db definitions
  778. ///
  779. #define MAX_PCI_CONFIG_LEN 64 ///< # of dwords.
  780. #define MAX_EEPROM_LEN 128 ///< # of dwords.
  781. #define MAX_XMIT_BUFFERS 32 ///< recycling Q length for xmit_done.
  782. #define MAX_MCAST_ADDRESS_CNT 8
  783. typedef struct s_pxe_cpb_start_30 {
  784. ///
  785. /// PXE_VOID Delay(UINTN microseconds);
  786. ///
  787. /// UNDI will never request a delay smaller than 10 microseconds
  788. /// and will always request delays in increments of 10 microseconds.
  789. /// The Delay() CallBack routine must delay between n and n + 10
  790. /// microseconds before returning control to the UNDI.
  791. ///
  792. /// This field cannot be set to zero.
  793. ///
  794. UINT64 Delay;
  795. ///
  796. /// PXE_VOID Block(UINT32 enable);
  797. ///
  798. /// UNDI may need to block multi-threaded/multi-processor access to
  799. /// critical code sections when programming or accessing the network
  800. /// device. To this end, a blocking service is needed by the UNDI.
  801. /// When UNDI needs a block, it will call Block() passing a non-zero
  802. /// value. When UNDI no longer needs a block, it will call Block()
  803. /// with a zero value. When called, if the Block() is already enabled,
  804. /// do not return control to the UNDI until the previous Block() is
  805. /// disabled.
  806. ///
  807. /// This field cannot be set to zero.
  808. ///
  809. UINT64 Block;
  810. ///
  811. /// PXE_VOID Virt2Phys(UINT64 virtual, UINT64 physical_ptr);
  812. ///
  813. /// UNDI will pass the virtual address of a buffer and the virtual
  814. /// address of a 64-bit physical buffer. Convert the virtual address
  815. /// to a physical address and write the result to the physical address
  816. /// buffer. If virtual and physical addresses are the same, just
  817. /// copy the virtual address to the physical address buffer.
  818. ///
  819. /// This field can be set to zero if virtual and physical addresses
  820. /// are equal.
  821. ///
  822. UINT64 Virt2Phys;
  823. ///
  824. /// PXE_VOID Mem_IO(UINT8 read_write, UINT8 len, UINT64 port,
  825. /// UINT64 buf_addr);
  826. ///
  827. /// UNDI will read or write the device io space using this call back
  828. /// function. It passes the number of bytes as the len parameter and it
  829. /// will be either 1,2,4 or 8.
  830. ///
  831. /// This field can not be set to zero.
  832. ///
  833. UINT64 Mem_IO;
  834. } PXE_CPB_START_30;
  835. typedef struct s_pxe_cpb_start_31 {
  836. ///
  837. /// PXE_VOID Delay(UINT64 UnqId, UINTN microseconds);
  838. ///
  839. /// UNDI will never request a delay smaller than 10 microseconds
  840. /// and will always request delays in increments of 10 microseconds.
  841. /// The Delay() CallBack routine must delay between n and n + 10
  842. /// microseconds before returning control to the UNDI.
  843. ///
  844. /// This field cannot be set to zero.
  845. ///
  846. UINT64 Delay;
  847. ///
  848. /// PXE_VOID Block(UINT64 unq_id, UINT32 enable);
  849. ///
  850. /// UNDI may need to block multi-threaded/multi-processor access to
  851. /// critical code sections when programming or accessing the network
  852. /// device. To this end, a blocking service is needed by the UNDI.
  853. /// When UNDI needs a block, it will call Block() passing a non-zero
  854. /// value. When UNDI no longer needs a block, it will call Block()
  855. /// with a zero value. When called, if the Block() is already enabled,
  856. /// do not return control to the UNDI until the previous Block() is
  857. /// disabled.
  858. ///
  859. /// This field cannot be set to zero.
  860. ///
  861. UINT64 Block;
  862. ///
  863. /// PXE_VOID Virt2Phys(UINT64 UnqId, UINT64 virtual, UINT64 physical_ptr);
  864. ///
  865. /// UNDI will pass the virtual address of a buffer and the virtual
  866. /// address of a 64-bit physical buffer. Convert the virtual address
  867. /// to a physical address and write the result to the physical address
  868. /// buffer. If virtual and physical addresses are the same, just
  869. /// copy the virtual address to the physical address buffer.
  870. ///
  871. /// This field can be set to zero if virtual and physical addresses
  872. /// are equal.
  873. ///
  874. UINT64 Virt2Phys;
  875. ///
  876. /// PXE_VOID Mem_IO(UINT64 UnqId, UINT8 read_write, UINT8 len, UINT64 port,
  877. /// UINT64 buf_addr);
  878. ///
  879. /// UNDI will read or write the device io space using this call back
  880. /// function. It passes the number of bytes as the len parameter and it
  881. /// will be either 1,2,4 or 8.
  882. ///
  883. /// This field can not be set to zero.
  884. ///
  885. UINT64 Mem_IO;
  886. ///
  887. /// PXE_VOID Map_Mem(UINT64 unq_id, UINT64 virtual_addr, UINT32 size,
  888. /// UINT32 Direction, UINT64 mapped_addr);
  889. ///
  890. /// UNDI will pass the virtual address of a buffer, direction of the data
  891. /// flow from/to the mapped buffer (the constants are defined below)
  892. /// and a place holder (pointer) for the mapped address.
  893. /// This call will Map the given address to a physical DMA address and write
  894. /// the result to the mapped_addr pointer. If there is no need to
  895. /// map the given address to a lower address (i.e. the given address is
  896. /// associated with a physical address that is already compatible to be
  897. /// used with the DMA, it converts the given virtual address to it's
  898. /// physical address and write that in the mapped address pointer.
  899. ///
  900. /// This field can be set to zero if there is no mapping service available.
  901. ///
  902. UINT64 Map_Mem;
  903. ///
  904. /// PXE_VOID UnMap_Mem(UINT64 unq_id, UINT64 virtual_addr, UINT32 size,
  905. /// UINT32 Direction, UINT64 mapped_addr);
  906. ///
  907. /// UNDI will pass the virtual and mapped addresses of a buffer.
  908. /// This call will un map the given address.
  909. ///
  910. /// This field can be set to zero if there is no unmapping service available.
  911. ///
  912. UINT64 UnMap_Mem;
  913. ///
  914. /// PXE_VOID Sync_Mem(UINT64 unq_id, UINT64 virtual,
  915. /// UINT32 size, UINT32 Direction, UINT64 mapped_addr);
  916. ///
  917. /// UNDI will pass the virtual and mapped addresses of a buffer.
  918. /// This call will synchronize the contents of both the virtual and mapped.
  919. /// buffers for the given Direction.
  920. ///
  921. /// This field can be set to zero if there is no service available.
  922. ///
  923. UINT64 Sync_Mem;
  924. ///
  925. /// protocol driver can provide anything for this Unique_ID, UNDI remembers
  926. /// that as just a 64bit value assocaited to the interface specified by
  927. /// the ifnum and gives it back as a parameter to all the call-back routines
  928. /// when calling for that interface!
  929. ///
  930. UINT64 Unique_ID;
  931. } PXE_CPB_START_31;
  932. #define TO_AND_FROM_DEVICE 0
  933. #define FROM_DEVICE 1
  934. #define TO_DEVICE 2
  935. #define PXE_DELAY_MILLISECOND 1000
  936. #define PXE_DELAY_SECOND 1000000
  937. #define PXE_IO_READ 0
  938. #define PXE_IO_WRITE 1
  939. #define PXE_MEM_READ 2
  940. #define PXE_MEM_WRITE 4
  941. typedef struct s_pxe_db_get_init_info {
  942. ///
  943. /// Minimum length of locked memory buffer that must be given to
  944. /// the Initialize command. Giving UNDI more memory will generally
  945. /// give better performance.
  946. ///
  947. /// If MemoryRequired is zero, the UNDI does not need and will not
  948. /// use system memory to receive and transmit packets.
  949. ///
  950. PXE_UINT32 MemoryRequired;
  951. ///
  952. /// Maximum frame data length for Tx/Rx excluding the media header.
  953. ///
  954. PXE_UINT32 FrameDataLen;
  955. ///
  956. /// Supported link speeds are in units of mega bits. Common ethernet
  957. /// values are 10, 100 and 1000. Unused LinkSpeeds[] entries are zero
  958. /// filled.
  959. ///
  960. PXE_UINT32 LinkSpeeds[4];
  961. ///
  962. /// Number of non-volatile storage items.
  963. ///
  964. PXE_UINT32 NvCount;
  965. ///
  966. /// Width of non-volatile storage item in bytes. 0, 1, 2 or 4
  967. ///
  968. PXE_UINT16 NvWidth;
  969. ///
  970. /// Media header length. This is the typical media header length for
  971. /// this UNDI. This information is needed when allocating receive
  972. /// and transmit buffers.
  973. ///
  974. PXE_UINT16 MediaHeaderLen;
  975. ///
  976. /// Number of bytes in the NIC hardware (MAC) address.
  977. ///
  978. PXE_UINT16 HWaddrLen;
  979. ///
  980. /// Maximum number of multicast MAC addresses in the multicast
  981. /// MAC address filter list.
  982. ///
  983. PXE_UINT16 MCastFilterCnt;
  984. ///
  985. /// Default number and size of transmit and receive buffers that will
  986. /// be allocated by the UNDI. If MemoryRequired is non-zero, this
  987. /// allocation will come out of the memory buffer given to the Initialize
  988. /// command. If MemoryRequired is zero, this allocation will come out of
  989. /// memory on the NIC.
  990. ///
  991. PXE_UINT16 TxBufCnt;
  992. PXE_UINT16 TxBufSize;
  993. PXE_UINT16 RxBufCnt;
  994. PXE_UINT16 RxBufSize;
  995. ///
  996. /// Hardware interface types defined in the Assigned Numbers RFC
  997. /// and used in DHCP and ARP packets.
  998. /// See the PXE_IFTYPE typedef and PXE_IFTYPE_xxx macros.
  999. ///
  1000. PXE_UINT8 IFtype;
  1001. ///
  1002. /// Supported duplex. See PXE_DUPLEX_xxxxx #defines below.
  1003. ///
  1004. PXE_UINT8 SupportedDuplexModes;
  1005. ///
  1006. /// Supported loopback options. See PXE_LOOPBACK_xxxxx #defines below.
  1007. ///
  1008. PXE_UINT8 SupportedLoopBackModes;
  1009. } PXE_DB_GET_INIT_INFO;
  1010. #define PXE_MAX_TXRX_UNIT_ETHER 1500
  1011. #define PXE_HWADDR_LEN_ETHER 0x0006
  1012. #define PXE_MAC_HEADER_LEN_ETHER 0x000E
  1013. #define PXE_DUPLEX_ENABLE_FULL_SUPPORTED 1
  1014. #define PXE_DUPLEX_FORCE_FULL_SUPPORTED 2
  1015. #define PXE_LOOPBACK_INTERNAL_SUPPORTED 1
  1016. #define PXE_LOOPBACK_EXTERNAL_SUPPORTED 2
  1017. typedef struct s_pxe_pci_config_info {
  1018. ///
  1019. /// This is the flag field for the PXE_DB_GET_CONFIG_INFO union.
  1020. /// For PCI bus devices, this field is set to PXE_BUSTYPE_PCI.
  1021. ///
  1022. UINT32 BusType;
  1023. ///
  1024. /// This identifies the PCI network device that this UNDI interface.
  1025. /// is bound to.
  1026. ///
  1027. UINT16 Bus;
  1028. UINT8 Device;
  1029. UINT8 Function;
  1030. ///
  1031. /// This is a copy of the PCI configuration space for this
  1032. /// network device.
  1033. ///
  1034. union {
  1035. UINT8 Byte[256];
  1036. UINT16 Word[128];
  1037. UINT32 Dword[64];
  1038. } Config;
  1039. } PXE_PCI_CONFIG_INFO;
  1040. typedef struct s_pxe_pcc_config_info {
  1041. ///
  1042. /// This is the flag field for the PXE_DB_GET_CONFIG_INFO union.
  1043. /// For PCC bus devices, this field is set to PXE_BUSTYPE_PCC.
  1044. ///
  1045. PXE_UINT32 BusType;
  1046. ///
  1047. /// This identifies the PCC network device that this UNDI interface
  1048. /// is bound to.
  1049. ///
  1050. PXE_UINT16 Bus;
  1051. PXE_UINT8 Device;
  1052. PXE_UINT8 Function;
  1053. ///
  1054. /// This is a copy of the PCC configuration space for this
  1055. /// network device.
  1056. ///
  1057. union {
  1058. PXE_UINT8 Byte[256];
  1059. PXE_UINT16 Word[128];
  1060. PXE_UINT32 Dword[64];
  1061. } Config;
  1062. } PXE_PCC_CONFIG_INFO;
  1063. typedef union u_pxe_db_get_config_info {
  1064. PXE_PCI_CONFIG_INFO pci;
  1065. PXE_PCC_CONFIG_INFO pcc;
  1066. } PXE_DB_GET_CONFIG_INFO;
  1067. typedef struct s_pxe_cpb_initialize {
  1068. ///
  1069. /// Address of first (lowest) byte of the memory buffer. This buffer must
  1070. /// be in contiguous physical memory and cannot be swapped out. The UNDI
  1071. /// will be using this for transmit and receive buffering.
  1072. ///
  1073. PXE_UINT64 MemoryAddr;
  1074. ///
  1075. /// MemoryLength must be greater than or equal to MemoryRequired
  1076. /// returned by the Get Init Info command.
  1077. ///
  1078. PXE_UINT32 MemoryLength;
  1079. ///
  1080. /// Desired link speed in Mbit/sec. Common ethernet values are 10, 100
  1081. /// and 1000. Setting a value of zero will auto-detect and/or use the
  1082. /// default link speed (operation depends on UNDI/NIC functionality).
  1083. ///
  1084. PXE_UINT32 LinkSpeed;
  1085. ///
  1086. /// Suggested number and size of receive and transmit buffers to
  1087. /// allocate. If MemoryAddr and MemoryLength are non-zero, this
  1088. /// allocation comes out of the supplied memory buffer. If MemoryAddr
  1089. /// and MemoryLength are zero, this allocation comes out of memory
  1090. /// on the NIC.
  1091. ///
  1092. /// If these fields are set to zero, the UNDI will allocate buffer
  1093. /// counts and sizes as it sees fit.
  1094. ///
  1095. PXE_UINT16 TxBufCnt;
  1096. PXE_UINT16 TxBufSize;
  1097. PXE_UINT16 RxBufCnt;
  1098. PXE_UINT16 RxBufSize;
  1099. ///
  1100. /// The following configuration parameters are optional and must be zero
  1101. /// to use the default values.
  1102. ///
  1103. PXE_UINT8 DuplexMode;
  1104. PXE_UINT8 LoopBackMode;
  1105. } PXE_CPB_INITIALIZE;
  1106. #define PXE_DUPLEX_DEFAULT 0x00
  1107. #define PXE_FORCE_FULL_DUPLEX 0x01
  1108. #define PXE_ENABLE_FULL_DUPLEX 0x02
  1109. #define PXE_FORCE_HALF_DUPLEX 0x04
  1110. #define PXE_DISABLE_FULL_DUPLEX 0x08
  1111. #define LOOPBACK_NORMAL 0
  1112. #define LOOPBACK_INTERNAL 1
  1113. #define LOOPBACK_EXTERNAL 2
  1114. typedef struct s_pxe_db_initialize {
  1115. ///
  1116. /// Actual amount of memory used from the supplied memory buffer. This
  1117. /// may be less that the amount of memory suppllied and may be zero if
  1118. /// the UNDI and network device do not use external memory buffers.
  1119. ///
  1120. /// Memory used by the UNDI and network device is allocated from the
  1121. /// lowest memory buffer address.
  1122. ///
  1123. PXE_UINT32 MemoryUsed;
  1124. ///
  1125. /// Actual number and size of receive and transmit buffers that were
  1126. /// allocated.
  1127. ///
  1128. PXE_UINT16 TxBufCnt;
  1129. PXE_UINT16 TxBufSize;
  1130. PXE_UINT16 RxBufCnt;
  1131. PXE_UINT16 RxBufSize;
  1132. } PXE_DB_INITIALIZE;
  1133. typedef struct s_pxe_cpb_receive_filters {
  1134. ///
  1135. /// List of multicast MAC addresses. This list, if present, will
  1136. /// replace the existing multicast MAC address filter list.
  1137. ///
  1138. PXE_MAC_ADDR MCastList[MAX_MCAST_ADDRESS_CNT];
  1139. } PXE_CPB_RECEIVE_FILTERS;
  1140. typedef struct s_pxe_db_receive_filters {
  1141. ///
  1142. /// Filtered multicast MAC address list.
  1143. ///
  1144. PXE_MAC_ADDR MCastList[MAX_MCAST_ADDRESS_CNT];
  1145. } PXE_DB_RECEIVE_FILTERS;
  1146. typedef struct s_pxe_cpb_station_address {
  1147. ///
  1148. /// If supplied and supported, the current station MAC address
  1149. /// will be changed.
  1150. ///
  1151. PXE_MAC_ADDR StationAddr;
  1152. } PXE_CPB_STATION_ADDRESS;
  1153. typedef struct s_pxe_dpb_station_address {
  1154. ///
  1155. /// Current station MAC address.
  1156. ///
  1157. PXE_MAC_ADDR StationAddr;
  1158. ///
  1159. /// Station broadcast MAC address.
  1160. ///
  1161. PXE_MAC_ADDR BroadcastAddr;
  1162. ///
  1163. /// Permanent station MAC address.
  1164. ///
  1165. PXE_MAC_ADDR PermanentAddr;
  1166. } PXE_DB_STATION_ADDRESS;
  1167. typedef struct s_pxe_db_statistics {
  1168. ///
  1169. /// Bit field identifying what statistic data is collected by the
  1170. /// UNDI/NIC.
  1171. /// If bit 0x00 is set, Data[0x00] is collected.
  1172. /// If bit 0x01 is set, Data[0x01] is collected.
  1173. /// If bit 0x20 is set, Data[0x20] is collected.
  1174. /// If bit 0x21 is set, Data[0x21] is collected.
  1175. /// Etc.
  1176. ///
  1177. PXE_UINT64 Supported;
  1178. ///
  1179. /// Statistic data.
  1180. ///
  1181. PXE_UINT64 Data[64];
  1182. } PXE_DB_STATISTICS;
  1183. ///
  1184. /// Total number of frames received. Includes frames with errors and
  1185. /// dropped frames.
  1186. ///
  1187. #define PXE_STATISTICS_RX_TOTAL_FRAMES 0x00
  1188. ///
  1189. /// Number of valid frames received and copied into receive buffers.
  1190. ///
  1191. #define PXE_STATISTICS_RX_GOOD_FRAMES 0x01
  1192. ///
  1193. /// Number of frames below the minimum length for the media.
  1194. /// This would be <64 for ethernet.
  1195. ///
  1196. #define PXE_STATISTICS_RX_UNDERSIZE_FRAMES 0x02
  1197. ///
  1198. /// Number of frames longer than the maxminum length for the
  1199. /// media. This would be >1500 for ethernet.
  1200. ///
  1201. #define PXE_STATISTICS_RX_OVERSIZE_FRAMES 0x03
  1202. ///
  1203. /// Valid frames that were dropped because receive buffers were full.
  1204. ///
  1205. #define PXE_STATISTICS_RX_DROPPED_FRAMES 0x04
  1206. ///
  1207. /// Number of valid unicast frames received and not dropped.
  1208. ///
  1209. #define PXE_STATISTICS_RX_UNICAST_FRAMES 0x05
  1210. ///
  1211. /// Number of valid broadcast frames received and not dropped.
  1212. ///
  1213. #define PXE_STATISTICS_RX_BROADCAST_FRAMES 0x06
  1214. ///
  1215. /// Number of valid mutlicast frames received and not dropped.
  1216. ///
  1217. #define PXE_STATISTICS_RX_MULTICAST_FRAMES 0x07
  1218. ///
  1219. /// Number of frames w/ CRC or alignment errors.
  1220. ///
  1221. #define PXE_STATISTICS_RX_CRC_ERROR_FRAMES 0x08
  1222. ///
  1223. /// Total number of bytes received. Includes frames with errors
  1224. /// and dropped frames.
  1225. ///
  1226. #define PXE_STATISTICS_RX_TOTAL_BYTES 0x09
  1227. ///
  1228. /// Transmit statistics.
  1229. ///
  1230. #define PXE_STATISTICS_TX_TOTAL_FRAMES 0x0A
  1231. #define PXE_STATISTICS_TX_GOOD_FRAMES 0x0B
  1232. #define PXE_STATISTICS_TX_UNDERSIZE_FRAMES 0x0C
  1233. #define PXE_STATISTICS_TX_OVERSIZE_FRAMES 0x0D
  1234. #define PXE_STATISTICS_TX_DROPPED_FRAMES 0x0E
  1235. #define PXE_STATISTICS_TX_UNICAST_FRAMES 0x0F
  1236. #define PXE_STATISTICS_TX_BROADCAST_FRAMES 0x10
  1237. #define PXE_STATISTICS_TX_MULTICAST_FRAMES 0x11
  1238. #define PXE_STATISTICS_TX_CRC_ERROR_FRAMES 0x12
  1239. #define PXE_STATISTICS_TX_TOTAL_BYTES 0x13
  1240. ///
  1241. /// Number of collisions detection on this subnet.
  1242. ///
  1243. #define PXE_STATISTICS_COLLISIONS 0x14
  1244. ///
  1245. /// Number of frames destined for unsupported protocol.
  1246. ///
  1247. #define PXE_STATISTICS_UNSUPPORTED_PROTOCOL 0x15
  1248. typedef struct s_pxe_cpb_mcast_ip_to_mac {
  1249. ///
  1250. /// Multicast IP address to be converted to multicast MAC address.
  1251. ///
  1252. PXE_IP_ADDR IP;
  1253. } PXE_CPB_MCAST_IP_TO_MAC;
  1254. typedef struct s_pxe_db_mcast_ip_to_mac {
  1255. ///
  1256. /// Multicast MAC address.
  1257. ///
  1258. PXE_MAC_ADDR MAC;
  1259. } PXE_DB_MCAST_IP_TO_MAC;
  1260. typedef struct s_pxe_cpb_nvdata_sparse {
  1261. ///
  1262. /// NvData item list. Only items in this list will be updated.
  1263. ///
  1264. struct {
  1265. ///
  1266. /// Non-volatile storage address to be changed.
  1267. ///
  1268. PXE_UINT32 Addr;
  1269. ///
  1270. /// Data item to write into above storage address.
  1271. ///
  1272. union {
  1273. PXE_UINT8 Byte;
  1274. PXE_UINT16 Word;
  1275. PXE_UINT32 Dword;
  1276. } Data;
  1277. } Item[MAX_EEPROM_LEN];
  1278. } PXE_CPB_NVDATA_SPARSE;
  1279. ///
  1280. /// When using bulk update, the size of the CPB structure must be
  1281. /// the same size as the non-volatile NIC storage.
  1282. ///
  1283. typedef union u_pxe_cpb_nvdata_bulk {
  1284. ///
  1285. /// Array of byte-wide data items.
  1286. ///
  1287. PXE_UINT8 Byte[MAX_EEPROM_LEN << 2];
  1288. ///
  1289. /// Array of word-wide data items.
  1290. ///
  1291. PXE_UINT16 Word[MAX_EEPROM_LEN << 1];
  1292. ///
  1293. /// Array of dword-wide data items.
  1294. ///
  1295. PXE_UINT32 Dword[MAX_EEPROM_LEN];
  1296. } PXE_CPB_NVDATA_BULK;
  1297. typedef struct s_pxe_db_nvdata {
  1298. ///
  1299. /// Arrays of data items from non-volatile storage.
  1300. ///
  1301. union {
  1302. ///
  1303. /// Array of byte-wide data items.
  1304. ///
  1305. PXE_UINT8 Byte[MAX_EEPROM_LEN << 2];
  1306. ///
  1307. /// Array of word-wide data items.
  1308. ///
  1309. PXE_UINT16 Word[MAX_EEPROM_LEN << 1];
  1310. ///
  1311. /// Array of dword-wide data items.
  1312. ///
  1313. PXE_UINT32 Dword[MAX_EEPROM_LEN];
  1314. } Data;
  1315. } PXE_DB_NVDATA;
  1316. typedef struct s_pxe_db_get_status {
  1317. ///
  1318. /// Length of next receive frame (header + data). If this is zero,
  1319. /// there is no next receive frame available.
  1320. ///
  1321. PXE_UINT32 RxFrameLen;
  1322. ///
  1323. /// Reserved, set to zero.
  1324. ///
  1325. PXE_UINT32 reserved;
  1326. ///
  1327. /// Addresses of transmitted buffers that need to be recycled.
  1328. ///
  1329. PXE_UINT64 TxBuffer[MAX_XMIT_BUFFERS];
  1330. } PXE_DB_GET_STATUS;
  1331. typedef struct s_pxe_cpb_fill_header {
  1332. ///
  1333. /// Source and destination MAC addresses. These will be copied into
  1334. /// the media header without doing byte swapping.
  1335. ///
  1336. PXE_MAC_ADDR SrcAddr;
  1337. PXE_MAC_ADDR DestAddr;
  1338. ///
  1339. /// Address of first byte of media header. The first byte of packet data
  1340. /// follows the last byte of the media header.
  1341. ///
  1342. PXE_UINT64 MediaHeader;
  1343. ///
  1344. /// Length of packet data in bytes (not including the media header).
  1345. ///
  1346. PXE_UINT32 PacketLen;
  1347. ///
  1348. /// Protocol type. This will be copied into the media header without
  1349. /// doing byte swapping. Protocol type numbers can be obtained from
  1350. /// the Assigned Numbers RFC 1700.
  1351. ///
  1352. PXE_UINT16 Protocol;
  1353. ///
  1354. /// Length of the media header in bytes.
  1355. ///
  1356. PXE_UINT16 MediaHeaderLen;
  1357. } PXE_CPB_FILL_HEADER;
  1358. #define PXE_PROTOCOL_ETHERNET_IP 0x0800
  1359. #define PXE_PROTOCOL_ETHERNET_ARP 0x0806
  1360. #define MAX_XMIT_FRAGMENTS 16
  1361. typedef struct s_pxe_cpb_fill_header_fragmented {
  1362. ///
  1363. /// Source and destination MAC addresses. These will be copied into
  1364. /// the media header without doing byte swapping.
  1365. ///
  1366. PXE_MAC_ADDR SrcAddr;
  1367. PXE_MAC_ADDR DestAddr;
  1368. ///
  1369. /// Length of packet data in bytes (not including the media header).
  1370. ///
  1371. PXE_UINT32 PacketLen;
  1372. ///
  1373. /// Protocol type. This will be copied into the media header without
  1374. /// doing byte swapping. Protocol type numbers can be obtained from
  1375. /// the Assigned Numbers RFC 1700.
  1376. ///
  1377. PXE_MEDIA_PROTOCOL Protocol;
  1378. ///
  1379. /// Length of the media header in bytes.
  1380. ///
  1381. PXE_UINT16 MediaHeaderLen;
  1382. ///
  1383. /// Number of packet fragment descriptors.
  1384. ///
  1385. PXE_UINT16 FragCnt;
  1386. ///
  1387. /// Reserved, must be set to zero.
  1388. ///
  1389. PXE_UINT16 reserved;
  1390. ///
  1391. /// Array of packet fragment descriptors. The first byte of the media
  1392. /// header is the first byte of the first fragment.
  1393. ///
  1394. struct {
  1395. ///
  1396. /// Address of this packet fragment.
  1397. ///
  1398. PXE_UINT64 FragAddr;
  1399. ///
  1400. /// Length of this packet fragment.
  1401. ///
  1402. PXE_UINT32 FragLen;
  1403. ///
  1404. /// Reserved, must be set to zero.
  1405. ///
  1406. PXE_UINT32 reserved;
  1407. } FragDesc[MAX_XMIT_FRAGMENTS];
  1408. }
  1409. PXE_CPB_FILL_HEADER_FRAGMENTED;
  1410. typedef struct s_pxe_cpb_transmit {
  1411. ///
  1412. /// Address of first byte of frame buffer. This is also the first byte
  1413. /// of the media header.
  1414. ///
  1415. PXE_UINT64 FrameAddr;
  1416. ///
  1417. /// Length of the data portion of the frame buffer in bytes. Do not
  1418. /// include the length of the media header.
  1419. ///
  1420. PXE_UINT32 DataLen;
  1421. ///
  1422. /// Length of the media header in bytes.
  1423. ///
  1424. PXE_UINT16 MediaheaderLen;
  1425. ///
  1426. /// Reserved, must be zero.
  1427. ///
  1428. PXE_UINT16 reserved;
  1429. } PXE_CPB_TRANSMIT;
  1430. typedef struct s_pxe_cpb_transmit_fragments {
  1431. ///
  1432. /// Length of packet data in bytes (not including the media header).
  1433. ///
  1434. PXE_UINT32 FrameLen;
  1435. ///
  1436. /// Length of the media header in bytes.
  1437. ///
  1438. PXE_UINT16 MediaheaderLen;
  1439. ///
  1440. /// Number of packet fragment descriptors.
  1441. ///
  1442. PXE_UINT16 FragCnt;
  1443. ///
  1444. /// Array of frame fragment descriptors. The first byte of the first
  1445. /// fragment is also the first byte of the media header.
  1446. ///
  1447. struct {
  1448. ///
  1449. /// Address of this frame fragment.
  1450. ///
  1451. PXE_UINT64 FragAddr;
  1452. ///
  1453. /// Length of this frame fragment.
  1454. ///
  1455. PXE_UINT32 FragLen;
  1456. ///
  1457. /// Reserved, must be set to zero.
  1458. ///
  1459. PXE_UINT32 reserved;
  1460. } FragDesc[MAX_XMIT_FRAGMENTS];
  1461. }
  1462. PXE_CPB_TRANSMIT_FRAGMENTS;
  1463. typedef struct s_pxe_cpb_receive {
  1464. ///
  1465. /// Address of first byte of receive buffer. This is also the first byte
  1466. /// of the frame header.
  1467. ///
  1468. PXE_UINT64 BufferAddr;
  1469. ///
  1470. /// Length of receive buffer. This must be large enough to hold the
  1471. /// received frame (media header + data). If the length of smaller than
  1472. /// the received frame, data will be lost.
  1473. ///
  1474. PXE_UINT32 BufferLen;
  1475. ///
  1476. /// Reserved, must be set to zero.
  1477. ///
  1478. PXE_UINT32 reserved;
  1479. } PXE_CPB_RECEIVE;
  1480. typedef struct s_pxe_db_receive {
  1481. ///
  1482. /// Source and destination MAC addresses from media header.
  1483. ///
  1484. PXE_MAC_ADDR SrcAddr;
  1485. PXE_MAC_ADDR DestAddr;
  1486. ///
  1487. /// Length of received frame. May be larger than receive buffer size.
  1488. /// The receive buffer will not be overwritten. This is how to tell
  1489. /// if data was lost because the receive buffer was too small.
  1490. ///
  1491. PXE_UINT32 FrameLen;
  1492. ///
  1493. /// Protocol type from media header.
  1494. ///
  1495. PXE_MEDIA_PROTOCOL Protocol;
  1496. ///
  1497. /// Length of media header in received frame.
  1498. ///
  1499. PXE_UINT16 MediaHeaderLen;
  1500. ///
  1501. /// Type of receive frame.
  1502. ///
  1503. PXE_FRAME_TYPE Type;
  1504. ///
  1505. /// Reserved, must be zero.
  1506. ///
  1507. PXE_UINT8 reserved[7];
  1508. } PXE_DB_RECEIVE;
  1509. #pragma pack()
  1510. #endif