Devbranch network switch

This commit is contained in:
Jasmine Iwanek
2025-08-02 16:53:01 -04:00
parent 0767d5bb2a
commit 6c375d04e2
5 changed files with 32 additions and 8 deletions

View File

@@ -503,11 +503,13 @@ network_attach(void *card_drv, uint8_t *mac, NETRXCB rx, NETSETLINKSTATE set_lin
card->host_drv.priv = card->host_drv.init(card, mac, net_cards_conf[net_card_current].host_dev_name, net_drv_error);
break;
#endif
#ifdef USE_NETSWITCH
case NET_TYPE_NMSWITCH:
case NET_TYPE_NRSWITCH:
card->host_drv = net_netswitch_drv;
card->host_drv.priv = card->host_drv.init(card, mac, &net_cards_conf[net_card_current], net_drv_error);
break;
#endif /* USE_NETSWITCH */
default:
card->host_drv.priv = NULL;
break;
@@ -519,11 +521,13 @@ network_attach(void *card_drv, uint8_t *mac, NETRXCB rx, NETSETLINKSTATE set_lin
if (!card->host_drv.priv) {
if(net_cards_conf[net_card_current].net_type != NET_TYPE_NONE) {
#ifdef USE_NETSWITCH
// FIXME: Hardcoded during dev
// FIXME: Remove when done!
if((net_cards_conf[net_card_current].net_type == NET_TYPE_NMSWITCH) ||
(net_cards_conf[net_card_current].net_type == NET_TYPE_NRSWITCH))
fatal("%s", net_drv_error);
#endif /* USE_NETSWITCH */
// We're here because of a failure
swprintf(tempmsg, sizeof_w(tempmsg), L"%ls:\n\n%s\n\n%ls", plat_get_string(STRING_NET_ERROR), net_drv_error, plat_get_string(STRING_NET_ERROR_DESC));