Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions drivers/net/ethernet/faraday/ftgmac100.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@
#define MAX_PKT_SIZE 1518
#define RX_BUF_SIZE PAGE_SIZE /* must be smaller than 0x3fff */

#define MAX_NCSI_DATA_PAYLOAD 1480 /* for getting the size of the nc-si control data packet */
/* max ethernet frame size = 1518 */
/* ethernet headr (14) + nc-si header (16) + nc-si payload (1480) + nc-si checksum (4) + 4 (FCS) = 1518*/

#define noNCSI_DEBUG /* for debug printf messages */

/*
Expand Down Expand Up @@ -166,7 +162,7 @@ typedef struct ncsi_nl_msg_t {
} NCSI_NL_MSG_T;


#define MAX_RESPONSE_PAYLOAD 1024 /* maximum payload size*/
#define MAX_RESPONSE_PAYLOAD MAX_NCSI_DATA_PAYLOAD /* maximum payload size*/
typedef struct ncsi_nl_response {
uint8_t cmd;
uint16_t payload_length;
Expand Down
6 changes: 5 additions & 1 deletion drivers/net/ethernet/faraday/ftgmac100.h
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,10 @@ typedef struct {
#define GET_NCSI_STATISTICS 0x19
#define GET_NCSI_PASS_THROUGH_STATISTICS 0x1A

#define MAX_NCSI_DATA_PAYLOAD 1480 /* for getting the size of the nc-si control data packet */
/* max ethernet frame size = 1518 */
/* ethernet headr (14) + nc-si header (16) + nc-si payload (1480) + nc-si checksum (4) + 4 (FCS) = 1518*/

/* NC-SI Response Packet */
typedef struct {
unsigned char DA[6];
Expand All @@ -319,7 +323,7 @@ typedef struct {
/* end of NC-SI header */
unsigned short Response_Code;
unsigned short Reason_Code;
unsigned char Payload_Data[256];
unsigned char Payload_Data[MAX_NCSI_DATA_PAYLOAD-4]; /* Exclude resp/reason code */
} __attribute__((packed)) NCSI_Response_Packet;


Expand Down