2
0
mirror of https://github.com/xcat2/xNBA.git synced 2024-12-23 19:51:46 +00:00

Remove _PROTOCOL macros for gcc 3.2 compatibility

This commit is contained in:
Marty Connor 2006-08-09 04:42:14 +00:00
parent dd7e103d58
commit ee9ae8130a
9 changed files with 17 additions and 55 deletions

View File

@ -176,21 +176,11 @@ struct net_device {
void *priv;
};
/**
* Register a link-layer protocol
*
* @v protocol Link-layer protocol
*/
#define LL_PROTOCOL( protocol ) \
struct ll_protocol protocol __table ( ll_protocols, 01 )
/** Declare a link-layer protocol */
#define __ll_protocol __table ( ll_protocols, 01 )
/**
* Register a network-layer protocol
*
* @v protocol Network-layer protocol
*/
#define NET_PROTOCOL( protocol ) \
struct net_protocol protocol __table ( net_protocols, 01 )
/** Declare a network-layer protocol */
#define __net_protocol __table ( net_protocols, 01 )
/**
* Get network device name

View File

@ -94,21 +94,11 @@ struct tcpip_net_protocol {
struct sockaddr_tcpip *st_dest );
};
/**
* Register a TCP/IP transport-layer protocol
*
* @v protocol Transport-layer protocol
*/
#define TCPIP_PROTOCOL( protocol ) \
struct tcpip_protocol protocol __table ( tcpip_protocols, 01 )
/** Declare a TCP/IP transport-layer protocol */
#define __tcpip_protocol __table ( tcpip_protocols, 01 )
/**
* Register a TCP/IP network-layer protocol
*
* @v protocol Network-layer protocol
*/
#define TCPIP_NET_PROTOCOL( protocol ) \
struct tcpip_net_protocol protocol __table ( tcpip_net_protocols, 01 )
/** Declare a TCP/IP network-layer protocol */
#define __tcpip_net_protocol __table ( tcpip_net_protocols, 01 )
extern int tcpip_rx ( struct pk_buff *pkb, uint8_t tcpip_proto,
struct sockaddr_tcpip *st_src,

View File

@ -253,14 +253,12 @@ static int aoe_rx ( struct pk_buff *pkb, struct net_device *netdev __unused,
}
/** AoE protocol */
struct net_protocol aoe_protocol = {
struct net_protocol aoe_protocol __net_protocol = {
.name = "AoE",
.net_proto = htons ( ETH_P_AOE ),
.rx = aoe_rx,
};
NET_PROTOCOL ( aoe_protocol );
/**
* Open AoE session
*

View File

@ -287,11 +287,9 @@ arp_ntoa ( const void *net_addr __attribute__ (( unused )) ) {
}
/** ARP protocol */
struct net_protocol arp_protocol = {
struct net_protocol arp_protocol __net_protocol = {
.name = "ARP",
.net_proto = htons ( ETH_P_ARP ),
.rx = arp_rx,
.ntoa = arp_ntoa,
};
NET_PROTOCOL ( arp_protocol );

View File

@ -104,7 +104,7 @@ static const char * eth_ntoa ( const void *ll_addr ) {
}
/** Ethernet protocol */
struct ll_protocol ethernet_protocol = {
struct ll_protocol ethernet_protocol __ll_protocol = {
.name = "Ethernet",
.ll_proto = htons ( ARPHRD_ETHER ),
.ll_addr_len = ETH_ALEN,
@ -113,5 +113,3 @@ struct ll_protocol ethernet_protocol = {
.rx = eth_rx,
.ntoa = eth_ntoa,
};
LL_PROTOCOL ( ethernet_protocol );

View File

@ -499,7 +499,7 @@ static const char * ipv4_ntoa ( const void *net_addr ) {
}
/** IPv4 protocol */
struct net_protocol ipv4_protocol = {
struct net_protocol ipv4_protocol __net_protocol = {
.name = "IP",
.net_proto = htons ( ETH_P_IP ),
.net_addr_len = sizeof ( struct in_addr ),
@ -507,17 +507,13 @@ struct net_protocol ipv4_protocol = {
.ntoa = ipv4_ntoa,
};
NET_PROTOCOL ( ipv4_protocol );
/** IPv4 TCPIP net protocol */
struct tcpip_net_protocol ipv4_tcpip_protocol = {
struct tcpip_net_protocol ipv4_tcpip_protocol __tcpip_net_protocol = {
.name = "IPv4",
.sa_family = AF_INET,
.tx = ipv4_tx,
};
TCPIP_NET_PROTOCOL ( ipv4_tcpip_protocol );
/** IPv4 ARP protocol */
struct arp_net_protocol ipv4_arp_protocol __arp_net_protocol = {
.net_protocol = &ipv4_protocol,

View File

@ -35,7 +35,7 @@ static const char * ipv6_ntoa ( const void *net_addr ) {
}
/** IPv6 protocol */
struct net_protocol ipv6_protocol = {
struct net_protocol ipv6_protocol __net_protocol = {
.name = "IP6",
.net_proto = htons ( ETH_P_IPV6 ),
.net_addr_len = sizeof ( struct in6_addr ),
@ -43,13 +43,9 @@ struct net_protocol ipv6_protocol = {
.ntoa = ipv6_ntoa,
};
NET_PROTOCOL ( ipv6_protocol );
/** IPv6 TCPIP net protocol */
struct tcpip_net_protocol ipv6_tcpip_protocol = {
struct tcpip_net_protocol ipv6_tcpip_protocol __tcpip_net_protocol = {
.name = "IPv6",
.sa_family = AF_INET6,
.tx = ipv6_tx,
};
TCPIP_NET_PROTOCOL ( ipv6_tcpip_protocol );

View File

@ -922,13 +922,11 @@ static int tcp_rx ( struct pk_buff *pkb,
}
/** TCP protocol */
struct tcpip_protocol tcp_protocol = {
struct tcpip_protocol tcp_protocol __tcpip_protocol = {
.name = "TCP",
.rx = tcp_rx,
.tcpip_proto = IP_TCP,
.csum_offset = 16,
};
TCPIP_PROTOCOL ( tcp_protocol );
#endif /* USE_UIP */

View File

@ -267,11 +267,9 @@ static int udp_rx ( struct pk_buff *pkb, struct sockaddr_tcpip *st_src,
return rc;
}
struct tcpip_protocol udp_protocol = {
struct tcpip_protocol udp_protocol __tcpip_protocol = {
.name = "UDP",
.rx = udp_rx,
.tcpip_proto = IP_UDP,
.csum_offset = 6,
};
TCPIP_PROTOCOL ( udp_protocol );