+/* net.c
+ * Top-level network glue code
+ * NetWatch system management mode administration console
+ *
+ * Copyright (c) 2008 Jacob Potter and Joshua Wise. All rights reserved.
+ * This program is free software; you can redistribute and/or modify it under
+ * the terms found in the file LICENSE in the root of this source tree.
+ *
+ */
+
#include <pci.h>
#include <smram.h>
#include <pci-bother.h>
#include <output.h>
#include <minilib.h>
+#include <tables.h>
#include <lwip/init.h>
#include "net.h"
#include "netif/etharp.h"
#include "netif/ppp_oe.h"
-#include "rfb.h"
-
static struct nic *_nic = 0x0;
static struct netif _netif;
// outputf("NIC: Transmit packet");
- nic->transmit(p);
+ nic->transmit(nic, p);
LINK_STATS_INC(link.xmit);
return 0;
}
+typedef void(*thunk_t)();
+
+TABLE(thunk_t, protocols);
+
void eth_init()
{
- extern void httpd_init();
+ int i;
/* Required for DMA to work. :( */
smram_tseg_set_state(SMRAM_TSEG_OPEN);
- lwip_init();
- httpd_init();
- rfb_init();
+ lwip_init();
+ for (i = 0; i < TABLE_LENGTH(protocols); i++)
+ protocols_table[i]();
}