Skip to content

Commit 21d7e13

Browse files
authored
Merge pull request #831 from fjtrujy/cleanup/drop-pre-lwip-130-compat
cleanup: drop dead `PRE_LWIP_130_COMPAT` branches from `smap` and `tcpip-netman`
2 parents 294911f + 8f64adf commit 21d7e13

2 files changed

Lines changed: 6 additions & 67 deletions

File tree

iop/network/smap/src/main.c

Lines changed: 4 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -92,36 +92,6 @@ SMapLowLevelOutput(NetIF *pNetIF, PBuf *pOutput)
9292
return result;
9393
}
9494

95-
// SMapOutput():
96-
97-
// 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
98-
// tcpip-thread, hence no synchronization is required.
99-
// For LWIP versions before v1.3.0.
100-
#ifdef PRE_LWIP_130_COMPAT
101-
static err_t
102-
SMapOutput(NetIF *pNetIF, PBuf *pOutput, IPAddr *pIPAddr)
103-
{
104-
err_t result;
105-
PBuf *pBuf;
106-
107-
#if USE_GP_REGISTER
108-
void *OldGP;
109-
110-
OldGP = SetModuleGP();
111-
#endif
112-
113-
pBuf = etharp_output(pNetIF, pIPAddr, pOutput);
114-
115-
result = pBuf != NULL ? SMapLowLevelOutput(pNetIF, pBuf) : ERR_OK;
116-
117-
#if USE_GP_REGISTER
118-
SetGP(OldGP);
119-
#endif
120-
121-
return result;
122-
}
123-
#endif
124-
12595
// SMapIFInit():
12696

12797
// Should be called at the beginning of the program to set up the network interface.
@@ -138,20 +108,12 @@ SMapIFInit(NetIF *pNetIF)
138108
TxHead = NULL;
139109
TxTail = NULL;
140110

141-
pNetIF->name[0] = IFNAME0;
142-
pNetIF->name[1] = IFNAME1;
143-
#ifdef PRE_LWIP_130_COMPAT
144-
pNetIF->output = &SMapOutput; // For LWIP versions before v1.3.0.
145-
#else
146-
pNetIF->output = &etharp_output; // For LWIP 1.3.0 and later.
147-
#endif
111+
pNetIF->name[0] = IFNAME0;
112+
pNetIF->name[1] = IFNAME1;
113+
pNetIF->output = &etharp_output;
148114
pNetIF->linkoutput = &SMapLowLevelOutput;
149115
pNetIF->hwaddr_len = NETIF_MAX_HWADDR_LEN;
150-
#ifdef PRE_LWIP_130_COMPAT
151-
pNetIF->flags |= (NETIF_FLAG_LINK_UP | NETIF_FLAG_BROADCAST); // For LWIP versions before v1.3.0.
152-
#else
153-
pNetIF->flags |= (NETIF_FLAG_ETHARP | NETIF_FLAG_BROADCAST); // For LWIP v1.3.0 and later.
154-
#endif
116+
pNetIF->flags |= (NETIF_FLAG_ETHARP | NETIF_FLAG_BROADCAST);
155117
pNetIF->mtu = 1500;
156118

157119
// Get MAC address.

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)