summaryrefslogtreecommitdiffstats
path: root/libs/NCSI/include
diff options
context:
space:
mode:
Diffstat (limited to 'libs/NCSI/include')
-rw-r--r--libs/NCSI/include/Ethernet.h6
-rw-r--r--libs/NCSI/include/NCSI.h11
2 files changed, 10 insertions, 7 deletions
diff --git a/libs/NCSI/include/Ethernet.h b/libs/NCSI/include/Ethernet.h
index ce7ba34..e5851c7 100644
--- a/libs/NCSI/include/Ethernet.h
+++ b/libs/NCSI/include/Ethernet.h
@@ -466,9 +466,6 @@ typedef struct
#define CAPABILITIES_MULTICAST (1 << 4)
typedef union {
- // Ethernet frame must be at least 64 bytes.
- uint32_t words[ETHERNET_FRAME_MIN/4];
-
EthernetHeader_t header;
/* Control Packets */
@@ -494,6 +491,7 @@ typedef union {
VersionResponsePacket_t version;
} __attribute__((packed)) NetworkFrame_t;
-
+// Ethernet frame must be at least 64 bytes.
+_Static_assert(sizeof(NetworkFrame_t) >= ETHERNET_FRAME_MIN, "NetworkFrame_t must be at least ETHERNET_FRAME_MIN bytes");
#endif /* ETHERNET_H */
diff --git a/libs/NCSI/include/NCSI.h b/libs/NCSI/include/NCSI.h
index d59f343..90ff5b5 100644
--- a/libs/NCSI/include/NCSI.h
+++ b/libs/NCSI/include/NCSI.h
@@ -49,7 +49,8 @@
#include <Ethernet.h>
#include <Network.h>
-void handleNCSIFrame(NetworkFrame_t* frame);
+//lint -sem(handleNCSIFrame, 1p) Warn if frame is NULL
+void handleNCSIFrame(const NetworkFrame_t* frame);
#define NCSI_RESPONSE_CODE_COMMAND_COMPLETE (0)
@@ -65,7 +66,10 @@ void handleNCSIFrame(NetworkFrame_t* frame);
#define NCSI_REASON_CODE_INVALID_PAYLOAD_LENGTH (5) /* The payload length in the command is incorrect for the given command */
#define NCSI_REASON_CODE_UNKNOWN_UNSUPPORTED (0x7FFF) /* Returned when the command type is unknown or unsupported */
-void NCSI_TxPacket(uint32_t* packet, uint32_t packet_len);
+
+//lint -sem(NCSI_TxPacket, 1p) Warn if packet is NULL
+//lint -sem(NCSI_TxPacket, 2n >= 1P) Warn if packet is smaller than packet_len
+void NCSI_TxPacket(const uint32_t* packet, uint32_t packet_len);
void NCSI_handlePassthrough(void);
@@ -73,6 +77,7 @@ void NCSI_init(void);
void NCSI_reload(reload_type_t reset_phy);
+//lint -sem(NCSI_usePort, 1p) Warn if port is NULL
void NCSI_usePort(NetworkPort_t *port);
-#endif /* NCSI_H */ \ No newline at end of file
+#endif /* NCSI_H */
OpenPOWER on IntegriCloud