diff options
Diffstat (limited to 'libs')
-rw-r--r-- | libs/NCSI/include/Ethernet.h | 4 | ||||
-rw-r--r-- | libs/NCSI/ncsi.c | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/libs/NCSI/include/Ethernet.h b/libs/NCSI/include/Ethernet.h index 0a9fccd..ce7ba34 100644 --- a/libs/NCSI/include/Ethernet.h +++ b/libs/NCSI/include/Ethernet.h @@ -47,7 +47,7 @@ #include <types.h> -#define ETHERNET_FRAME_MIN 64 +#define ETHERNET_FRAME_MIN (64 - 4) /* Hardware automatically adds FCS (last 4 bytes) */ typedef struct { @@ -496,4 +496,4 @@ typedef union { -#endif /* ETHERNET_H */
\ No newline at end of file +#endif /* ETHERNET_H */ diff --git a/libs/NCSI/ncsi.c b/libs/NCSI/ncsi.c index 55b7dbc..c54eb72 100644 --- a/libs/NCSI/ncsi.c +++ b/libs/NCSI/ncsi.c @@ -461,7 +461,7 @@ static void getCapabilities(NetworkFrame_t *frame) { int ch = frame->controlPacket.ChannelID & CHANNEL_ID_MASK; // NetworkPort_t *port = gPackageState.port[ch]; - uint32_t packetSize = MAX(sizeof(gCapabilitiesFrame.capabilities), ETHERNET_FRAME_MIN - 4); + uint32_t packetSize = MAX(sizeof(gCapabilitiesFrame.capabilities), ETHERNET_FRAME_MIN); gCapabilitiesFrame.capabilities.ChannelID = ch; gCapabilitiesFrame.capabilities.ControlPacketType = frame->controlPacket.ControlPacketType | CONTROL_PACKET_TYPE_RESPONSE; @@ -477,7 +477,7 @@ static void getVersionID(NetworkFrame_t *frame) int ch = frame->controlPacket.ChannelID & CHANNEL_ID_MASK; NetworkPort_t *port = gPackageState.port[ch]; DEVICE_t *device = (DEVICE_t *)port->device; - uint32_t packetSize = MAX(sizeof(gVersionFrame.version), ETHERNET_FRAME_MIN - 4); + uint32_t packetSize = MAX(sizeof(gVersionFrame.version), ETHERNET_FRAME_MIN); gVersionFrame.version.ChannelID = ch; gVersionFrame.version.ControlPacketType = frame->controlPacket.ControlPacketType | CONTROL_PACKET_TYPE_RESPONSE; @@ -746,7 +746,7 @@ void NCSI_TxPacket(uint32_t *packet, uint32_t packet_len) } void sendNCSILinkStatusResponse(uint8_t InstanceID, uint8_t channelID, uint32_t LinkStatus, uint32_t OEMLinkStatus, uint32_t OtherIndications) { - uint32_t packetSize = MAX(sizeof(gLinkStatusResponseFrame.linkStatusResponse), ETHERNET_FRAME_MIN - 4); + uint32_t packetSize = MAX(sizeof(gLinkStatusResponseFrame.linkStatusResponse), ETHERNET_FRAME_MIN); gLinkStatusResponseFrame.linkStatusResponse.ChannelID = channelID; gLinkStatusResponseFrame.linkStatusResponse.InstanceID = InstanceID; @@ -765,7 +765,7 @@ void sendNCSILinkStatusResponse(uint8_t InstanceID, uint8_t channelID, uint32_t void sendNCSIResponse(uint8_t InstanceID, uint8_t channelID, uint16_t controlID, uint16_t response_code, uint16_t reasons_code) { - uint32_t packetSize = MAX(sizeof(gResponseFrame.responsePacket), ETHERNET_FRAME_MIN - 4); + uint32_t packetSize = MAX(sizeof(gResponseFrame.responsePacket), ETHERNET_FRAME_MIN); gResponseFrame.responsePacket.ChannelID = channelID; gResponseFrame.responsePacket.ControlPacketType = controlID | CONTROL_PACKET_TYPE_RESPONSE; |