Skip to content

Conversation

@smoe
Copy link
Collaborator

@smoe smoe commented Jan 15, 2026

Addressing #3698.

@BsAtHome
Copy link
Contributor

Fixing this in hostmot2.h may not be the right place. The warning comes from a local struct in the llio_info.c file. I think you need to fix this in llio_info.c line 29.

Now you mentioned the 'board' field and comparison, there are many references to (a different) 'board' field in other hostmot2 driver files and the comparisons are, well, a bit fragile. There are a combination of string and non-string comparisons spread out in the code (strncmp and memcmp) and I never fixed them all because it possibly broke things. The code to detect the different cards based on identifiers should be revamped not to use any string functions.

@BsAtHome
Copy link
Contributor

Why are you still changing hostmot2.h? Is that also giving warnings, #3698 did not indicate that? If not, then you should leave it alone until all of the board ID code gets fixed.

@smoe
Copy link
Collaborator Author

smoe commented Jan 16, 2026

Fixing this in hostmot2.h may not be the right place. The warning comes from a local struct in the llio_info.c file. I think you need to fix this in llio_info.c line 29.

Thank you so much, yes, right, done.

Now you mentioned the 'board' field and comparison, there are many references to (a different) 'board' field in other hostmot2 driver files and the comparisons are, well, a bit fragile. There are a combination of string and non-string comparisons spread out in the code (strncmp and memcmp) and I never fixed them all because it possibly broke things. The code to detect the different cards based on identifiers should be revamped not to use any string functions.

I skimmed through it. Would not know how to start or how to test. Somehow I happily leave this to a future generation of some AI coding tool :-)

@BsAtHome
Copy link
Contributor

I skimmed through it. Would not know how to start or how to test. Somehow I happily leave this to a future generation of some AI coding tool :-)

Aie, aie, aie, yes, that will be a guarantee that no board will ever be found again...

I think @pcw-mesa needs to get involved here (if he wants to) and provide a /full/ list of all supported board identifiers (all 8 bytes for each board) so that they can be properly compared with a full 8-byte memcmp() call and mapped accordingly. Then the code can be fixed and streamlined for all hostmot2 board drivers. If there are any boards that use fewer than 8 ID bytes, with the remaining being random, then we need to fix the code of the comparisons/mappings a bit further.

The current comparisons are (can be) a bit fragile and I did not dare to touch previously it because I do not know the complete list of valid identifiers with their corresponding mapping(s).

@pcw-mesa
Copy link
Collaborator

There are two distinct board name sources: One is the one embedded in the HM2ID ROM
These are used in PCI/PCIE/EPP/SPI cards. These are all 8 bytes long. The other name
source is on Ethernet cards where the name is stored on an on card EEPROM.
This is a normal null terminated string of up to 16 characters. These names are
often shortened when creating the hal name to make differing implementations
of the same card functionality use the same hal name (7I97/7I97T for example)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants