Skip to content

Commit 8f64adf

Browse files
fjtrujyclaude
andcommitted
cleanup: [tcpip-netman] drop dead PRE_LWIP_130_COMPAT, advertise NETIF_FLAG_ETHERNET
Symmetric with the earlier smap/main.c cleanup: lwIP 2.0.3 is well past 1.3.0, so the SMapOutput() wrapper and ifdef forks in SMapIFInit are dead code. Replace the conditional flag block with a single line, and add NETIF_FLAG_ETHERNET to correctly mark the netif as Ethernet — lwIP 2.0.3 defines this flag in netif.h:95 and certain code paths (e.g. when LWIP_ARP is disabled) branch on it. ps2link end-to-end test (execee over TCP) confirmed unaffected. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 08f50f7 commit 8f64adf

1 file changed

Lines changed: 2 additions & 25 deletions

File tree

iop/tcpip/tcpip-netman/src/ps2ip.c

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -348,21 +348,6 @@ SMapLowLevelOutput(struct netif *pNetIF, struct pbuf* pOutput)
348348
return result;
349349
}
350350

351-
//SMapOutput():
352-
353-
//This function is called by the TCP/IP stack when an IP packet should be sent. It'll be invoked in the context of the
354-
//tcpip-thread, hence no synchronization is required.
355-
// For LWIP versions before v1.3.0.
356-
#ifdef PRE_LWIP_130_COMPAT
357-
static err_t
358-
SMapOutput(struct netif *pNetIF, struct pbuf *pOutput, IPAddr* pIPAddr)
359-
{
360-
struct pbuf *pBuf=etharp_output(pNetIF,pIPAddr,pOutput);
361-
362-
return pBuf!=NULL ? SMapLowLevelOutput(pNetIF, pBuf):ERR_OK;
363-
}
364-
#endif
365-
366351
//Should be called at the beginning of the program to set up the network interface.
367352
static err_t SMapIFInit(struct netif* pNetIF)
368353
{
@@ -371,18 +356,10 @@ static err_t SMapIFInit(struct netif* pNetIF)
371356

372357
pNetIF->name[0]='s';
373358
pNetIF->name[1]='m';
374-
#ifdef PRE_LWIP_130_COMPAT
375-
pNetIF->output=&SMapOutput; // For LWIP versions before v1.3.0.
376-
#else
377-
pNetIF->output=&etharp_output; // For LWIP 1.3.0 and later.
378-
#endif
359+
pNetIF->output=&etharp_output;
379360
pNetIF->linkoutput=&SMapLowLevelOutput;
380361
pNetIF->hwaddr_len=NETIF_MAX_HWADDR_LEN;
381-
#ifdef PRE_LWIP_130_COMPAT
382-
pNetIF->flags|=(NETIF_FLAG_LINK_UP|NETIF_FLAG_BROADCAST); // For LWIP versions before v1.3.0.
383-
#else
384-
pNetIF->flags|=(NETIF_FLAG_ETHARP|NETIF_FLAG_BROADCAST); // For LWIP v1.3.0 and later.
385-
#endif
362+
pNetIF->flags|=(NETIF_FLAG_ETHARP|NETIF_FLAG_ETHERNET|NETIF_FLAG_BROADCAST);
386363
pNetIF->mtu=1500;
387364

388365
//Get MAC address.

0 commit comments

Comments
 (0)