MAX_RX_PKT_LEN value 2 selects 1552-byte frames, not jumbo mode.
Select value 3 so the configured 2 KiB frames are actually accepted by
the switch.
Tested on a ZBT-WE826 (MT7620). With value 2, 1534-byte IPv4
packets pass while 1535-byte packets are dropped. With value 3,
1792-byte and 1800-byte DF IPv4 packets pass.
Fixes: d083212e1105 ("ramips: ethernet: ralink: mt7620 enable jumbo frames")
Signed-off-by: Gleb Pesin <dormancygrace@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24242
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
#define GSW_REG_GMACCR 0x3FE0 /* correct address per MT7620A datasheet */
#define GMACCR_JMB_LEN_MASK 0x0F
#define GMACCR_JMB_LEN_SHIFT 2
-// MAX_RX_PKT_LEN field (bits 0:1): 0=1518, 1=1536, 2=jumbo
+/* MAX_RX_PKT_LEN (bits [1:0]):
+ * 0: 1518 (untagged) / 1522 (tagged)
+ * 1: 1536
+ * 2: 1552
+ * 3: jumbo frame mode
+ */
#define GMACCR_MAX_RX_PKT_LEN_MASK 0x3
-#define GMACCR_MAX_RX_PKT_LEN_JUMBO 0x2
+#define GMACCR_MAX_RX_PKT_LEN_JUMBO 0x3
#define SYSC_REG_CHIP_REV_ID 0x0c
#define SYSC_REG_CFG1 0x14