You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
VID, PID and SUBDEV are all unsigned 16bit values (per PCI specification).
As the corresponding struct uses signed 16bit values (on most architectures, implemented as short) and the bdx_get_phy_by_id function uses signed ints (32bit on most architectures) as arguments. This will cause an unintended sign extension e.g. for the "Edimax 10 Gigabit Ethernet SFP+ PCI Express Adapter" which has a subdev ID of 0x8103 (which will get extended to 0xffff8103) thus failing the comparison.
Fixing the struct to use ints instead was successful in our quick and dirty test, however, using u16 everywhere might be cleaner.
The text was updated successfully, but these errors were encountered:
VID, PID and SUBDEV are all unsigned 16bit values (per PCI specification).
As the corresponding struct uses signed 16bit values (on most architectures, implemented as short) and the
bdx_get_phy_by_id
function uses signed ints (32bit on most architectures) as arguments. This will cause an unintended sign extension e.g. for the "Edimax 10 Gigabit Ethernet SFP+ PCI Express Adapter" which has a subdev ID of0x8103
(which will get extended to0xffff8103
) thus failing the comparison.Fixing the struct to use ints instead was successful in our quick and dirty test, however, using u16 everywhere might be cleaner.
The text was updated successfully, but these errors were encountered: