@ -137,9 +137,9 @@ struct in_addr net_ip;
/* Server IP addr (0 = unknown) */
struct in_addr net_server_ip ;
/* Current receive packet */
uchar * NetRxP acket;
uchar * net_rx_p acket;
/* Current rx packet length */
int NetRxPacketL en;
int net_rx_packet_l en;
/* IP packet ID */
unsigned NetIPID ;
/* Ethernet bcast address */
@ -177,7 +177,7 @@ struct in_addr net_ntp_server;
int NetTimeOffset ;
# endif
static uchar PktB uf[ ( PKTBUFSRX + 1 ) * PKTSIZE_ALIGN + PKTALIGN ] ;
static uchar net_pkt_b uf[ ( PKTBUFSRX + 1 ) * PKTSIZE_ALIGN + PKTALIGN ] ;
# ifdef CONFIG_DM_ETH
/* Receive packets */
uchar * net_rx_packets [ PKTBUFSRX ] ;
@ -200,7 +200,7 @@ static ulong timeStart;
/* Current timeout value */
static ulong timeDelta ;
/* THE transmit packet */
uchar * NetTxP acket;
uchar * net_tx_p acket;
static int net_check_prereq ( enum proto_t protocol ) ;
@ -301,16 +301,17 @@ void net_init(void)
*/
int i ;
NetTxPacket = & PktB uf[ 0 ] + ( PKTALIGN - 1 ) ;
NetTxP acket - = ( ulong ) NetTxP acket % PKTALIGN ;
net_tx_packet = & net_pkt_b uf[ 0 ] + ( PKTALIGN - 1 ) ;
net_tx_p acket - = ( ulong ) net_tx_p acket % PKTALIGN ;
# ifdef CONFIG_DM_ETH
for ( i = 0 ; i < PKTBUFSRX ; i + + ) {
net_rx_packets [ i ] = NetTxPacket + ( i + 1 ) *
PKTSIZE_ALIGN ;
net_rx_packets [ i ] = net_tx_packet +
( i + 1 ) * PKTSIZE_ALIGN ;
}
# else
for ( i = 0 ; i < PKTBUFSRX ; i + + )
NetRxPackets [ i ] = NetTxPacket + ( i + 1 ) * PKTSIZE_ALIGN ;
NetRxPackets [ i ] = net_tx_packet +
( i + 1 ) * PKTSIZE_ALIGN ;
# endif
ArpInit ( ) ;
net_clear_handlers ( ) ;
@ -710,16 +711,16 @@ NetSetTimeout(ulong iv, thand_f *f)
}
}
int NetSendUDPP acket( uchar * ether , struct in_addr dest , int dport , int sport ,
int net_send_udp_p acket( uchar * ether , struct in_addr dest , int dport , int sport ,
int payload_len )
{
uchar * pkt ;
int eth_hdr_size ;
int pkt_hdr_size ;
/* make sure the NetTxP acket is initialized (NetInit() was called) */
assert ( NetTxP acket ! = NULL ) ;
if ( NetTxP acket = = NULL )
/* make sure the net_tx_p acket is initialized (NetInit() was called) */
assert ( net_tx_p acket ! = NULL ) ;
if ( net_tx_p acket = = NULL )
return - 1 ;
/* convert to new style broadcast */
@ -730,9 +731,9 @@ int NetSendUDPPacket(uchar *ether, struct in_addr dest, int dport, int sport,
if ( dest . s_addr = = 0xFFFFFFFF )
ether = ( uchar * ) net_bcast_ethaddr ;
pkt = ( uchar * ) NetTxP acket;
pkt = ( uchar * ) net_tx_p acket;
eth_hdr_size = NetSetE ther( pkt , ether , PROT_IP ) ;
eth_hdr_size = net_set_e ther( pkt , ether , PROT_IP ) ;
pkt + = eth_hdr_size ;
net_set_udp_header ( pkt , dest , dport , sport , payload_len ) ;
pkt_hdr_size = eth_hdr_size + IP_UDP_HDR_SIZE ;
@ -756,7 +757,7 @@ int NetSendUDPPacket(uchar *ether, struct in_addr dest, int dport, int sport,
} else {
debug_cond ( DEBUG_DEV_PKT , " sending UDP to %pI4/%pM \n " ,
& dest , ether ) ;
NetSendPacket ( NetTxP acket, pkt_hdr_size + payload_len ) ;
net_send_packet ( net_tx_p acket, pkt_hdr_size + payload_len ) ;
return 0 ; /* transmitted */
}
}
@ -979,8 +980,8 @@ void net_process_received_packet(uchar *in_packet, int len)
debug_cond ( DEBUG_NET_PKT , " packet received \n " ) ;
NetRxP acket = in_packet ;
NetRxPacketL en = len ;
net_rx_p acket = in_packet ;
net_rx_packet_l en = len ;
et = ( struct ethernet_hdr * ) in_packet ;
/* too small packet? */
@ -1307,7 +1308,7 @@ common:
/**********************************************************************/
int
NetEthHdrS ize( void )
net_eth_hdr_s ize( void )
{
ushort myvlanid ;
@ -1319,8 +1320,7 @@ NetEthHdrSize(void)
VLAN_ETHER_HDR_SIZE ;
}
int
NetSetEther ( uchar * xet , const uchar * dest_ethaddr , uint prot )
int net_set_ether ( uchar * xet , const uchar * dest_ethaddr , uint prot )
{
struct ethernet_hdr * et = ( struct ethernet_hdr * ) xet ;
ushort myvlanid ;