sculpt: refine condition of nic support

A network card can be provided by PCI, and the SoC as well. Therefore,
add an additional state variable in the Board_info::Soc, and check it
appropriatedly.

Issue #5174
This commit is contained in:
Stefan Kalkowski 2024-04-22 16:31:22 +02:00 committed by Christian Helmuth
parent 47c1e45f28
commit 3b83292205
4 changed files with 4 additions and 3 deletions

View File

@ -209,6 +209,7 @@ struct Sculpt::Main : Input_event_handler,
.usb = false,
.mmc = false,
.modem = false, /* depends on presence of battery */
.nic = false,
};
Drivers _drivers { _env, _child_states, *this, *this };

View File

@ -47,7 +47,7 @@ struct Sculpt::Nic_driver : private Noncopyable
void update(Registry<Child_state> &registry, Board_info const &board_info)
{
bool const use_nic = board_info.detected.nic
bool const use_nic = (board_info.detected.nic || board_info.soc.nic)
&& board_info.options.nic
&& !board_info.options.suspending;

View File

@ -93,7 +93,7 @@ struct Sculpt::Board_info
*/
struct Soc
{
bool fb, touch, wifi, usb, mmc, modem;
bool fb, touch, wifi, usb, mmc, modem, nic;
bool operator != (Soc const &other) const
{

View File

@ -60,7 +60,7 @@ struct Sculpt::Network_widget : Widget<Frame>
s.widget(_local, selected);
if (target.managed() || target.manual_type == Nic_target::WIRED)
if (board_info.detected.nic)
if (board_info.detected.nic || board_info.soc.nic)
s.widget(_wired, selected);
if (target.managed() || target.manual_type == Nic_target::WIFI)