From e924431344ebab61923ec93fe583c8b8eec0b468 Mon Sep 17 00:00:00 2001 From: logicog Date: Wed, 20 Aug 2025 10:17:15 +0200 Subject: [PATCH] Move definition of NSFP to header file --- rtl837x_common.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/rtl837x_common.h b/rtl837x_common.h index 731c3ec..c536253 100644 --- a/rtl837x_common.h +++ b/rtl837x_common.h @@ -4,6 +4,9 @@ #include "uip/uip-conf.h" #include +// This has to be set to the number of SFP+ ports, i.e. 1 or 2 +#define NSFP 2 + // The serial buffer. Defines the command line size // Must be 2^x and <= 128 #define SBUF_SIZE 128 @@ -23,6 +26,11 @@ // This is the standard size of an Ethernet frame header #define ETHER_HEADER_SIZE 14 +#if NSFP == 1 +#define IS_SFP(port) (i == maxPort) +#else +#define IS_SFP(port) (i == maxPort || i == 3) +#endif /** * Representation of a 48-bit Ethernet address. @@ -64,4 +72,5 @@ uint16_t strtox(register __xdata uint8_t *dst, register __code const char *s); void tcpip_output(void); void print_string_x(__xdata char *p); + #endif