net: remove unnecessary if
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
parent
faa61661cf
commit
6289b5a51d
28
net/net.c
28
net/net.c
|
@ -227,6 +227,7 @@ int NetLoopInit(proto_t protocol)
|
||||||
struct eth_device *eth_current = eth_get_current();
|
struct eth_device *eth_current = eth_get_current();
|
||||||
IPaddr_t ip;
|
IPaddr_t ip;
|
||||||
int ret;
|
int ret;
|
||||||
|
int i;
|
||||||
|
|
||||||
if (!eth_current) {
|
if (!eth_current) {
|
||||||
printf("Current ethernet device not set!\n");
|
printf("Current ethernet device not set!\n");
|
||||||
|
@ -241,26 +242,19 @@ int NetLoopInit(proto_t protocol)
|
||||||
NetArpWaitTxPacket = NULL;
|
NetArpWaitTxPacket = NULL;
|
||||||
NetArpWaitPacketIP = 0;
|
NetArpWaitPacketIP = 0;
|
||||||
NetArpWaitReplyIP = 0;
|
NetArpWaitReplyIP = 0;
|
||||||
NetArpWaitTxPacket = NULL;
|
|
||||||
NetTxPacket = NULL;
|
|
||||||
|
|
||||||
if (!NetTxPacket) {
|
/*
|
||||||
int i;
|
* Setup packet buffers, aligned correctly.
|
||||||
/*
|
*/
|
||||||
* Setup packet buffers, aligned correctly.
|
NetTxPacket = &PktBuf[0] + (PKTALIGN - 1);
|
||||||
*/
|
NetTxPacket -= (ulong)NetTxPacket % PKTALIGN;
|
||||||
NetTxPacket = &PktBuf[0] + (PKTALIGN - 1);
|
for (i = 0; i < PKTBUFSRX; i++) {
|
||||||
NetTxPacket -= (ulong)NetTxPacket % PKTALIGN;
|
NetRxPackets[i] = NetTxPacket + (i+1)*PKTSIZE_ALIGN;
|
||||||
for (i = 0; i < PKTBUFSRX; i++) {
|
|
||||||
NetRxPackets[i] = NetTxPacket + (i+1)*PKTSIZE_ALIGN;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!NetArpWaitTxPacket) {
|
NetArpWaitTxPacket = &NetArpWaitPacketBuf[0] + (PKTALIGN - 1);
|
||||||
NetArpWaitTxPacket = &NetArpWaitPacketBuf[0] + (PKTALIGN - 1);
|
NetArpWaitTxPacket -= (ulong)NetArpWaitTxPacket % PKTALIGN;
|
||||||
NetArpWaitTxPacket -= (ulong)NetArpWaitTxPacket % PKTALIGN;
|
NetArpWaitTxPacketSize = 0;
|
||||||
NetArpWaitTxPacketSize = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (eth_open() < 0)
|
if (eth_open() < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
Loading…
Reference in New Issue