From fae16dabf56b4fedbb1116945156f9f29436286f Mon Sep 17 00:00:00 2001 From: bloqaudio Date: Fri, 3 Jul 2026 20:57:45 -0500 Subject: [PATCH] rtl837x_igmp: cast &entry to __xdata pointer in memset() SDCC rejects memset() on the generic &entry pointer (error 78, incompatible types). The ipmc/l2mc table entries are __xdata; pass an explicit (__xdata uint8_t *) so the call resolves. --- rtl837x_igmp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rtl837x_igmp.c b/rtl837x_igmp.c index e36dda6..ec9d59a 100644 --- a/rtl837x_igmp.c +++ b/rtl837x_igmp.c @@ -223,7 +223,7 @@ void igmp_packet_handler(void) __banked #endif #ifdef IPMC_USES_L3MC - memset(&entry, 0, sizeof(struct ipmc_table_entry)); + memset((__xdata uint8_t *)&entry, 0, sizeof(struct ipmc_table_entry)); // For IPv4 MC, the Source-IP is 0.0.0.0 entry.sip[0] = 0x00; entry.sip[1] = 0x00; entry.sip[2] = 0x00; entry.sip[3] = 0x00; // For IPv4 MC, the Destination-IP is the IPv4 MC address @@ -235,7 +235,7 @@ void igmp_packet_handler(void) __banked * yy = MC_IP[2] * zz = MC_IP[3] */ - memset(&entry, 0, sizeof(struct l2mc_table_entry)); + memset((__xdata uint8_t *)&entry, 0, sizeof(struct l2mc_table_entry)); entry.mac[0] = 0x01; entry.mac[1] = 0x00; entry.mac[2] = 0x5e; entry.mac[3] = IGMP_I->mc_ip[1] & 0x7f; entry.mac[4] = IGMP_I->mc_ip[2]; entry.mac[5] = IGMP_I->mc_ip[3]; entry.vlan = 1; //TODO: Get this out of the packet and compare with VLAN table!