<feed xmlns='http://www.w3.org/2005/Atom'>
<title>Tianocore/edk2.git/MdeModulePkg/Include/Protocol/UsbEthernetProtocol.h, branch master</title>
<subtitle>EDK II (mirror)</subtitle>
<id>https://git.radix-linux.su/Tianocore/edk2.git/atom?h=master</id>
<link rel='self' href='https://git.radix-linux.su/Tianocore/edk2.git/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/'/>
<updated>2026-02-23T21:01:28+00:00</updated>
<entry>
<title>MdeModulePkg: Replace include guards with #pragma once</title>
<updated>2026-02-23T21:01:28+00:00</updated>
<author>
<name>Michael Kubacki</name>
<email>michael.kubacki@microsoft.com</email>
</author>
<published>2026-02-03T18:48:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=7a934d0befca7d10f361c76af6d2fcb6eb48c835'/>
<id>urn:sha1:7a934d0befca7d10f361c76af6d2fcb6eb48c835</id>
<content type='text'>
Replace traditional `#ifndef`/`#define`/`#endif` include guards with
`#pragma` once.

`#pragma once` is a widely supported preprocessor directive that
prevents header files from being included multiple times. It is
supported by all toolchains used to build edk2: GCC, Clang/LLVM, and
MSVC.

Compared to macro-based include guards, `#pragma once`:

- Eliminates the risk of macro name collisions or copy/paste errors
  where two headers inadvertently use the same guard macro.
- Eliminate inconsistency in the way include guard macros are named
  (e.g., some files use `__FILE_H__`, others use `FILE_H_`, etc.).
- Reduces boilerplate (three lines replaced by one).
- Avoids polluting the macro namespace with guard symbols.
- Can improve build times as the preprocessor can skip re-opening the
  file entirely, rather than re-reading it to find the matching
  `#endif` ("multiple-include optimization").
  - Note that some compilers may already optimize traditional include
    guards, by recognzining the idiomatic pattern.

This change is made acknowledging that overall portability of the
code will technically be reduced, as `#pragma once` is not part of the
C/C++ standards.

However, this is considered acceptable given:

1. edk2 already defines a subset of supported compilers in
   BaseTools/Conf/tools_def.template, all of which have supported
   `#pragma once` for over two decades.
2. There have been concerns raised to the project about inconsistent
   include guard naming and potential macro collisions.

Approximate compiler support dates:

- MSVC: Supported since Visual C++ 4.2 (1996)
- GCC: Supported since 3.4 (2004)
  (http://gnu.ist.utl.pt/software/gcc/gcc-3.4/changes.html)
- Clang (LLVM based): Since initial release in 2007

Signed-off-by: Michael Kubacki &lt;michael.kubacki@microsoft.com&gt;
</content>
</entry>
<entry>
<title>MdeModulePkg UsbNetwork: Use USB class definition from MdePkg</title>
<updated>2024-10-22T05:40:04+00:00</updated>
<author>
<name>Oleg Ilyasov</name>
<email>olegi@ami.com</email>
</author>
<published>2024-10-16T18:27:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=7b3969c95160a35255743c6220572401b64c6eb7'/>
<id>urn:sha1:7b3969c95160a35255743c6220572401b64c6eb7</id>
<content type='text'>
- Class specific types for interface and endpoint are generic
- Definitions are in IndustryStandard/Usb.h
- Remove type redefinitions
- Update references to the descriptor types

Signed-off-by: Oleg Ilyasov &lt;olegi@ami.com&gt;
</content>
</entry>
<entry>
<title>MdeModulePkg: UsbRndis: get rid of magic values</title>
<updated>2023-10-16T22:49:33+00:00</updated>
<author>
<name>Mike Maslenkin</name>
<email>mike.maslenkin@gmail.com</email>
</author>
<published>2023-08-26T01:58:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=03d6569f70939d2a1653265367121212459a6b89'/>
<id>urn:sha1:03d6569f70939d2a1653265367121212459a6b89</id>
<content type='text'>
Replace magic values used for checking Base Class, SubClass and Protocol
fields of USB Interface Descriptor.
Add definitions for Base Class EFh (Miscellaneous) and RNDIS subclass.
These definitions were taken from https://www.usb.org/defined-class-codes

Cc: Richard Ho &lt;richardho@ami.com&gt;
Cc: Rebecca Cran &lt;rebecca@bsdio.com&gt;
Signed-off-by: Mike Maslenkin &lt;mike.maslenkin@gmail.com&gt;
</content>
</entry>
<entry>
<title>MdeModulePkg: UsbNetwork: fix Ethernet functional descriptor processing</title>
<updated>2023-10-16T22:49:33+00:00</updated>
<author>
<name>Mike Maslenkin</name>
<email>mike.maslenkin@gmail.com</email>
</author>
<published>2023-08-26T01:57:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=e07948255cfafb75fa9cbe4555bfe3421488dd9a'/>
<id>urn:sha1:e07948255cfafb75fa9cbe4555bfe3421488dd9a</id>
<content type='text'>
This patch fixes wrong condition because of UINT16 value to integer
promotion. NumberMcFilters is UINT16 value, so when bitwise shift operator
applied to small integer type, the operation is preceded by integral
promotion. This is described in MISRA-C:2004 guideline as Rule 10.5:
"If the bitwise operators ~ and &lt;&lt; are applied to an operand of underlying
type unsigned char or unsigned short, the result shall be immediately cast
to the underlying type of the operand."

A simple fix for this issue would be the following:
  if ((UINT16)(UsbEthFunDescriptor.NumberMcFilters &lt;&lt; 1) == 0)

But this patch proposes to use bitwise AND operation with a proper bit mask
rather than shifting to prevent similar mistakes in future.

Cc: Richard Ho &lt;richardho@ami.com&gt;
Cc: Rebecca Cran &lt;rebecca@bsdio.com&gt;
Signed-off-by: Mike Maslenkin &lt;mike.maslenkin@gmail.com&gt;
</content>
</entry>
<entry>
<title>MdeModulePkg/Bus/Usb/UsbNetwork/UsbRndis: Add USB RNDIS devices support</title>
<updated>2023-07-13T17:18:40+00:00</updated>
<author>
<name>Richard Ho</name>
<email>richardho@ami.com</email>
</author>
<published>2023-07-13T06:15:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=fc0d5922f1f866b47561545ebd15883d618c91bf'/>
<id>urn:sha1:fc0d5922f1f866b47561545ebd15883d618c91bf</id>
<content type='text'>
This driver provides UEFI driver for USB RNDIS device

Signed-off-by: Richard Ho &lt;richardho@ami.com&gt;
Cc: Andrew Fish &lt;afish@apple.com&gt;
Cc: Leif Lindholm &lt;quic_llindhol@quicinc.com&gt;
Cc: Michael D Kinney &lt;michael.d.kinney@intel.com&gt;
Cc: Michael Kubacki &lt;mikuback@linux.microsoft.com&gt;
Cc: Zhiguang Liu &lt;zhiguang.liu@intel.com&gt;
Cc: Liming Gao &lt;gaoliming@byosoft.com.cn&gt;
Cc: Hao A Wu &lt;hao.a.wu@intel.com&gt;
Cc: Ray Ni &lt;ray.ni@intel.com&gt;
Tested-by: Tinh Nguyen &lt;tinhnguyen@os.amperecomputing.com&gt;
Acked-by: Hao A Wu &lt;hao.a.wu@intel.com&gt;
Reviewed-by: Rebecca Cran &lt;rebecca@bsdio.com&gt;
Reviewed-by: Tony Lo &lt;tonylo@ami.com&gt;
</content>
</entry>
</feed>
