Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

e6000sw: Add support for MV88E6190X switch variant #1408

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions sys/dev/etherswitch/e6000sw/e6000sw.c
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,9 @@ e6000sw_probe(device_t dev)
*/
resource_int_value(device_get_name(sc->dev),
device_get_unit(sc->dev), "is8190", &is_6190);
resource_int_value(device_get_name(sc->dev),
device_get_unit(sc->dev), "is6190x", &is_6190x);
if (resource_int_value(device_get_name(sc->dev),
Copy link
Contributor

@rilysh rilysh Sep 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If "is6190" is available, but "is6190x" isn't, it will just stop the execution (according to resource_int_value() function, source: https://github.com/freebsd/freebsd-src/blob/abed32f91d01d91faa709622e3279e9baec37272/sys/kern/subr_hints.c#L338). I'm not exactly sure if MV88E6190 and MV88E6190X are related to each other (without one either one can't work).

Also, return isn't returning any meaningful values, and the function expects an integer.

device_get_unit(sc->dev), "is6190x", &is_6190x) != 0)
return;
Comment on lines +263 to +265
Copy link
Author

@salekseev salekseev Sep 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should avoid the following error: error: misleading indentation; statement is not part of the previous 'if' [-Werror,-Wmisleading-indentation]

if (is_6190 !=0 && is_6190x != 0)
if (bootverbose)
device_printf(dev, "Cannot configure conflicting variants\n");
Expand Down