summaryrefslogtreecommitdiffstats
path: root/libs/Network/include
diff options
context:
space:
mode:
authorEvan Lojewski <github@meklort.com>2019-06-01 10:57:29 -0600
committerEvan Lojewski <github@meklort.com>2019-06-01 10:57:29 -0600
commit3a5e8aba2ca066626ec4ec058153530c4591b1e5 (patch)
tree70a90e137b8fff2847175a91d58d34caefa565a5 /libs/Network/include
parenta70db0191841f43b6453cc395a22e68f8cb365db (diff)
downloadbcm5719-ortega-3a5e8aba2ca066626ec4ec058153530c4591b1e5.tar.gz
bcm5719-ortega-3a5e8aba2ca066626ec4ec058153530c4591b1e5.zip
Additional refactoring to ensure network tx/rx is enabled properly.
Diffstat (limited to 'libs/Network/include')
-rw-r--r--libs/Network/include/Network.h31
1 files changed, 21 insertions, 10 deletions
diff --git a/libs/Network/include/Network.h b/libs/Network/include/Network.h
index 25dab4b..82a5a7e 100644
--- a/libs/Network/include/Network.h
+++ b/libs/Network/include/Network.h
@@ -55,21 +55,31 @@
#include <APE_TX_PORT1.h>
#include <APE_TX_PORT2.h>
#include <APE_TX_PORT3.h>
+#include <APE_DEVICE.h>
#include <types.h>
+#ifdef CXX_SIMULATOR
+#define VOLATILE
+#else
+#define VOLATILE volatile
+#endif
+
typedef struct
{
/* TX Registers */
- volatile RegAPETxToNetPoolModeStatus_t *tx_mode;
- volatile TX_PORT_t *tx_port;
- volatile RegAPETxToNetBufferAllocator_t *tx_allocator;
- volatile RegAPETxToNetDoorbell_t *tx_doorbell;
+ VOLATILE RegAPETxToNetPoolModeStatus_t *tx_mode;
+ VOLATILE TX_PORT_t *tx_port;
+ VOLATILE RegAPETxToNetBufferAllocator_t *tx_allocator;
+ VOLATILE RegAPETxToNetDoorbell_t *tx_doorbell;
/* RX Registers */
- volatile RegAPERxPoolModeStatus_t *rx_mode;
- volatile RX_PORT_t *rx_port;
- volatile RegAPERxbufoffset_t *rx_offset;
- volatile RegAPERxPoolRetire_t *rx_retire;
+ VOLATILE RegAPERxPoolModeStatus_t *rx_mode;
+ VOLATILE RX_PORT_t *rx_port;
+ VOLATILE RegAPERxbufoffset_t *rx_offset;
+ VOLATILE RegAPERxPoolRetire_t *rx_retire;
+
+ /* Port Registers */
+ VOLATILE DEVICE_t *device;
} NetworkPort_t;
typedef union {
@@ -89,6 +99,7 @@ extern NetworkPort_t gPort1;
extern NetworkPort_t gPort2;
extern NetworkPort_t gPort3;
+void Network_InitPort(NetworkPort_t *port);
void Network_InitTxRx(void);
uint32_t Network_TX_numBlocksNeeded(uint32_t frame_size);
@@ -108,7 +119,7 @@ bool Network_RxLePatcket(uint32_t *buffer, uint32_t *length,
NetworkPort_t *port);
bool Network_PassthroughRxPatcket(NetworkPort_t *port);
-void Network_SetMACAddr(uint16_t high, uint32_t low, uint32_t index,
- bool enabled);
+void Network_SetMACAddr(NetworkPort_t *port, uint16_t high, uint32_t low,
+ uint32_t index, bool enabled);
#endif /* NETWORK_H */ \ No newline at end of file
OpenPOWER on IntegriCloud