diff options
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/arcnet/arc-rawmode.c | 2 | ||||
-rw-r--r-- | drivers/net/arcnet/capmode.c | 4 | ||||
-rw-r--r-- | drivers/net/bonding/bond_3ad.h | 2 | ||||
-rw-r--r-- | drivers/net/bonding/bond_alb.c | 4 | ||||
-rw-r--r-- | drivers/net/e1000/e1000_main.c | 4 | ||||
-rw-r--r-- | drivers/net/e1000e/netdev.c | 4 | ||||
-rw-r--r-- | drivers/net/enic/enic_main.c | 4 | ||||
-rw-r--r-- | drivers/net/hamachi.c | 8 | ||||
-rw-r--r-- | drivers/net/hamradio/bpqether.c | 2 | ||||
-rw-r--r-- | drivers/net/igb/igb_main.c | 4 | ||||
-rw-r--r-- | drivers/net/ixgbe/ixgbe_main.c | 4 | ||||
-rw-r--r-- | drivers/net/myri_sbus.c | 2 | ||||
-rw-r--r-- | drivers/net/netxen/netxen_nic_main.c | 8 | ||||
-rw-r--r-- | drivers/net/niu.c | 4 | ||||
-rw-r--r-- | drivers/net/pppoe.c | 8 | ||||
-rw-r--r-- | drivers/net/ps3_gelic_net.c | 2 | ||||
-rw-r--r-- | drivers/net/sfc/bitfield.h | 4 | ||||
-rw-r--r-- | drivers/net/tun.c | 2 | ||||
-rw-r--r-- | drivers/net/usb/hso.c | 3 | ||||
-rw-r--r-- | drivers/net/via-velocity.h | 6 | ||||
-rw-r--r-- | drivers/net/wan/hdlc.c | 2 | ||||
-rw-r--r-- | drivers/net/wan/hdlc_cisco.c | 16 | ||||
-rw-r--r-- | drivers/net/wan/hdlc_fr.c | 16 | ||||
-rw-r--r-- | drivers/net/wan/hdlc_ppp.c | 4 | ||||
-rw-r--r-- | drivers/net/wan/hdlc_raw.c | 2 | ||||
-rw-r--r-- | drivers/net/wan/lapbether.c | 2 |
26 files changed, 61 insertions, 62 deletions
diff --git a/drivers/net/arcnet/arc-rawmode.c b/drivers/net/arcnet/arc-rawmode.c index da017cbb5f64..646dfc5f50c9 100644 --- a/drivers/net/arcnet/arc-rawmode.c +++ b/drivers/net/arcnet/arc-rawmode.c | |||
@@ -122,7 +122,7 @@ static void rx(struct net_device *dev, int bufnum, | |||
122 | 122 | ||
123 | BUGLVL(D_SKB) arcnet_dump_skb(dev, skb, "rx"); | 123 | BUGLVL(D_SKB) arcnet_dump_skb(dev, skb, "rx"); |
124 | 124 | ||
125 | skb->protocol = __constant_htons(ETH_P_ARCNET); | 125 | skb->protocol = cpu_to_be16(ETH_P_ARCNET); |
126 | ; | 126 | ; |
127 | netif_rx(skb); | 127 | netif_rx(skb); |
128 | } | 128 | } |
diff --git a/drivers/net/arcnet/capmode.c b/drivers/net/arcnet/capmode.c index 1613929ff301..083e21094b20 100644 --- a/drivers/net/arcnet/capmode.c +++ b/drivers/net/arcnet/capmode.c | |||
@@ -148,7 +148,7 @@ static void rx(struct net_device *dev, int bufnum, | |||
148 | 148 | ||
149 | BUGLVL(D_SKB) arcnet_dump_skb(dev, skb, "rx"); | 149 | BUGLVL(D_SKB) arcnet_dump_skb(dev, skb, "rx"); |
150 | 150 | ||
151 | skb->protocol = __constant_htons(ETH_P_ARCNET); | 151 | skb->protocol = cpu_to_be16(ETH_P_ARCNET); |
152 | ; | 152 | ; |
153 | netif_rx(skb); | 153 | netif_rx(skb); |
154 | } | 154 | } |
@@ -282,7 +282,7 @@ static int ack_tx(struct net_device *dev, int acked) | |||
282 | BUGMSG(D_PROTO, "Ackknowledge for cap packet %x.\n", | 282 | BUGMSG(D_PROTO, "Ackknowledge for cap packet %x.\n", |
283 | *((int*)&ackpkt->soft.cap.cookie[0])); | 283 | *((int*)&ackpkt->soft.cap.cookie[0])); |
284 | 284 | ||
285 | ackskb->protocol = __constant_htons(ETH_P_ARCNET); | 285 | ackskb->protocol = cpu_to_be16(ETH_P_ARCNET); |
286 | 286 | ||
287 | BUGLVL(D_SKB) arcnet_dump_skb(dev, ackskb, "ack_tx_recv"); | 287 | BUGLVL(D_SKB) arcnet_dump_skb(dev, ackskb, "ack_tx_recv"); |
288 | netif_rx(ackskb); | 288 | netif_rx(ackskb); |
diff --git a/drivers/net/bonding/bond_3ad.h b/drivers/net/bonding/bond_3ad.h index 8a83eb283c21..a306230381c8 100644 --- a/drivers/net/bonding/bond_3ad.h +++ b/drivers/net/bonding/bond_3ad.h | |||
@@ -29,7 +29,7 @@ | |||
29 | 29 | ||
30 | // General definitions | 30 | // General definitions |
31 | #define BOND_ETH_P_LACPDU 0x8809 | 31 | #define BOND_ETH_P_LACPDU 0x8809 |
32 | #define PKT_TYPE_LACPDU __constant_htons(BOND_ETH_P_LACPDU) | 32 | #define PKT_TYPE_LACPDU cpu_to_be16(BOND_ETH_P_LACPDU) |
33 | #define AD_TIMER_INTERVAL 100 /*msec*/ | 33 | #define AD_TIMER_INTERVAL 100 /*msec*/ |
34 | 34 | ||
35 | #define MULTICAST_LACPDU_ADDR {0x01, 0x80, 0xC2, 0x00, 0x00, 0x02} | 35 | #define MULTICAST_LACPDU_ADDR {0x01, 0x80, 0xC2, 0x00, 0x00, 0x02} |
diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c index 27fb7f5c21cf..409b14074275 100644 --- a/drivers/net/bonding/bond_alb.c +++ b/drivers/net/bonding/bond_alb.c | |||
@@ -822,7 +822,7 @@ static int rlb_initialize(struct bonding *bond) | |||
822 | _unlock_rx_hashtbl(bond); | 822 | _unlock_rx_hashtbl(bond); |
823 | 823 | ||
824 | /*initialize packet type*/ | 824 | /*initialize packet type*/ |
825 | pk_type->type = __constant_htons(ETH_P_ARP); | 825 | pk_type->type = cpu_to_be16(ETH_P_ARP); |
826 | pk_type->dev = NULL; | 826 | pk_type->dev = NULL; |
827 | pk_type->func = rlb_arp_recv; | 827 | pk_type->func = rlb_arp_recv; |
828 | 828 | ||
@@ -892,7 +892,7 @@ static void alb_send_learning_packets(struct slave *slave, u8 mac_addr[]) | |||
892 | memset(&pkt, 0, size); | 892 | memset(&pkt, 0, size); |
893 | memcpy(pkt.mac_dst, mac_addr, ETH_ALEN); | 893 | memcpy(pkt.mac_dst, mac_addr, ETH_ALEN); |
894 | memcpy(pkt.mac_src, mac_addr, ETH_ALEN); | 894 | memcpy(pkt.mac_src, mac_addr, ETH_ALEN); |
895 | pkt.type = __constant_htons(ETH_P_LOOP); | 895 | pkt.type = cpu_to_be16(ETH_P_LOOP); |
896 | 896 | ||
897 | for (i = 0; i < MAX_LP_BURST; i++) { | 897 | for (i = 0; i < MAX_LP_BURST; i++) { |
898 | struct sk_buff *skb; | 898 | struct sk_buff *skb; |
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c index c4a303023b31..40db34deebde 100644 --- a/drivers/net/e1000/e1000_main.c +++ b/drivers/net/e1000/e1000_main.c | |||
@@ -2860,11 +2860,11 @@ static bool e1000_tx_csum(struct e1000_adapter *adapter, | |||
2860 | return false; | 2860 | return false; |
2861 | 2861 | ||
2862 | switch (skb->protocol) { | 2862 | switch (skb->protocol) { |
2863 | case __constant_htons(ETH_P_IP): | 2863 | case cpu_to_be16(ETH_P_IP): |
2864 | if (ip_hdr(skb)->protocol == IPPROTO_TCP) | 2864 | if (ip_hdr(skb)->protocol == IPPROTO_TCP) |
2865 | cmd_len |= E1000_TXD_CMD_TCP; | 2865 | cmd_len |= E1000_TXD_CMD_TCP; |
2866 | break; | 2866 | break; |
2867 | case __constant_htons(ETH_P_IPV6): | 2867 | case cpu_to_be16(ETH_P_IPV6): |
2868 | /* XXX not handling all IPV6 headers */ | 2868 | /* XXX not handling all IPV6 headers */ |
2869 | if (ipv6_hdr(skb)->nexthdr == IPPROTO_TCP) | 2869 | if (ipv6_hdr(skb)->nexthdr == IPPROTO_TCP) |
2870 | cmd_len |= E1000_TXD_CMD_TCP; | 2870 | cmd_len |= E1000_TXD_CMD_TCP; |
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c index e04b392c9a59..c425b19e3362 100644 --- a/drivers/net/e1000e/netdev.c +++ b/drivers/net/e1000e/netdev.c | |||
@@ -3770,11 +3770,11 @@ static bool e1000_tx_csum(struct e1000_adapter *adapter, struct sk_buff *skb) | |||
3770 | return 0; | 3770 | return 0; |
3771 | 3771 | ||
3772 | switch (skb->protocol) { | 3772 | switch (skb->protocol) { |
3773 | case __constant_htons(ETH_P_IP): | 3773 | case cpu_to_be16(ETH_P_IP): |
3774 | if (ip_hdr(skb)->protocol == IPPROTO_TCP) | 3774 | if (ip_hdr(skb)->protocol == IPPROTO_TCP) |
3775 | cmd_len |= E1000_TXD_CMD_TCP; | 3775 | cmd_len |= E1000_TXD_CMD_TCP; |
3776 | break; | 3776 | break; |
3777 | case __constant_htons(ETH_P_IPV6): | 3777 | case cpu_to_be16(ETH_P_IPV6): |
3778 | /* XXX not handling all IPV6 headers */ | 3778 | /* XXX not handling all IPV6 headers */ |
3779 | if (ipv6_hdr(skb)->nexthdr == IPPROTO_TCP) | 3779 | if (ipv6_hdr(skb)->nexthdr == IPPROTO_TCP) |
3780 | cmd_len |= E1000_TXD_CMD_TCP; | 3780 | cmd_len |= E1000_TXD_CMD_TCP; |
diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c index 4617956821cd..5dd11563553e 100644 --- a/drivers/net/enic/enic_main.c +++ b/drivers/net/enic/enic_main.c | |||
@@ -570,11 +570,11 @@ static inline void enic_queue_wq_skb_tso(struct enic *enic, | |||
570 | * to each TCP segment resulting from the TSO. | 570 | * to each TCP segment resulting from the TSO. |
571 | */ | 571 | */ |
572 | 572 | ||
573 | if (skb->protocol == __constant_htons(ETH_P_IP)) { | 573 | if (skb->protocol == cpu_to_be16(ETH_P_IP)) { |
574 | ip_hdr(skb)->check = 0; | 574 | ip_hdr(skb)->check = 0; |
575 | tcp_hdr(skb)->check = ~csum_tcpudp_magic(ip_hdr(skb)->saddr, | 575 | tcp_hdr(skb)->check = ~csum_tcpudp_magic(ip_hdr(skb)->saddr, |
576 | ip_hdr(skb)->daddr, 0, IPPROTO_TCP, 0); | 576 | ip_hdr(skb)->daddr, 0, IPPROTO_TCP, 0); |
577 | } else if (skb->protocol == __constant_htons(ETH_P_IPV6)) { | 577 | } else if (skb->protocol == cpu_to_be16(ETH_P_IPV6)) { |
578 | tcp_hdr(skb)->check = ~csum_ipv6_magic(&ipv6_hdr(skb)->saddr, | 578 | tcp_hdr(skb)->check = ~csum_ipv6_magic(&ipv6_hdr(skb)->saddr, |
579 | &ipv6_hdr(skb)->daddr, 0, IPPROTO_TCP, 0); | 579 | &ipv6_hdr(skb)->daddr, 0, IPPROTO_TCP, 0); |
580 | } | 580 | } |
diff --git a/drivers/net/hamachi.c b/drivers/net/hamachi.c index 7e8b3c59a7d6..455641f8677e 100644 --- a/drivers/net/hamachi.c +++ b/drivers/net/hamachi.c | |||
@@ -1244,7 +1244,7 @@ do { \ | |||
1244 | csum_add(sum, (ih)->saddr & 0xffff); \ | 1244 | csum_add(sum, (ih)->saddr & 0xffff); \ |
1245 | csum_add(sum, (ih)->daddr >> 16); \ | 1245 | csum_add(sum, (ih)->daddr >> 16); \ |
1246 | csum_add(sum, (ih)->daddr & 0xffff); \ | 1246 | csum_add(sum, (ih)->daddr & 0xffff); \ |
1247 | csum_add(sum, __constant_htons(IPPROTO_UDP)); \ | 1247 | csum_add(sum, cpu_to_be16(IPPROTO_UDP)); \ |
1248 | csum_add(sum, (uh)->len); \ | 1248 | csum_add(sum, (uh)->len); \ |
1249 | } while (0) | 1249 | } while (0) |
1250 | 1250 | ||
@@ -1255,7 +1255,7 @@ do { \ | |||
1255 | csum_add(sum, (ih)->saddr & 0xffff); \ | 1255 | csum_add(sum, (ih)->saddr & 0xffff); \ |
1256 | csum_add(sum, (ih)->daddr >> 16); \ | 1256 | csum_add(sum, (ih)->daddr >> 16); \ |
1257 | csum_add(sum, (ih)->daddr & 0xffff); \ | 1257 | csum_add(sum, (ih)->daddr & 0xffff); \ |
1258 | csum_add(sum, __constant_htons(IPPROTO_TCP)); \ | 1258 | csum_add(sum, cpu_to_be16(IPPROTO_TCP)); \ |
1259 | csum_add(sum, htons(len)); \ | 1259 | csum_add(sum, htons(len)); \ |
1260 | } while (0) | 1260 | } while (0) |
1261 | #endif | 1261 | #endif |
@@ -1296,7 +1296,7 @@ static int hamachi_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1296 | /* tack on checksum tag */ | 1296 | /* tack on checksum tag */ |
1297 | u32 tagval = 0; | 1297 | u32 tagval = 0; |
1298 | struct ethhdr *eh = (struct ethhdr *)skb->data; | 1298 | struct ethhdr *eh = (struct ethhdr *)skb->data; |
1299 | if (eh->h_proto == __constant_htons(ETH_P_IP)) { | 1299 | if (eh->h_proto == cpu_to_be16(ETH_P_IP)) { |
1300 | struct iphdr *ih = (struct iphdr *)((char *)eh + ETH_HLEN); | 1300 | struct iphdr *ih = (struct iphdr *)((char *)eh + ETH_HLEN); |
1301 | if (ih->protocol == IPPROTO_UDP) { | 1301 | if (ih->protocol == IPPROTO_UDP) { |
1302 | struct udphdr *uh | 1302 | struct udphdr *uh |
@@ -1605,7 +1605,7 @@ static int hamachi_rx(struct net_device *dev) | |||
1605 | */ | 1605 | */ |
1606 | if (ntohs(ih->tot_len) >= 46){ | 1606 | if (ntohs(ih->tot_len) >= 46){ |
1607 | /* don't worry about frags */ | 1607 | /* don't worry about frags */ |
1608 | if (!(ih->frag_off & __constant_htons(IP_MF|IP_OFFSET))) { | 1608 | if (!(ih->frag_off & cpu_to_be16(IP_MF|IP_OFFSET))) { |
1609 | u32 inv = *(u32 *) &buf_addr[data_size - 16]; | 1609 | u32 inv = *(u32 *) &buf_addr[data_size - 16]; |
1610 | u32 *p = (u32 *) &buf_addr[data_size - 20]; | 1610 | u32 *p = (u32 *) &buf_addr[data_size - 20]; |
1611 | register u32 crc, p_r, p_r1; | 1611 | register u32 crc, p_r, p_r1; |
diff --git a/drivers/net/hamradio/bpqether.c b/drivers/net/hamradio/bpqether.c index 1f65d1edf132..2c619bc99ae7 100644 --- a/drivers/net/hamradio/bpqether.c +++ b/drivers/net/hamradio/bpqether.c | |||
@@ -97,7 +97,7 @@ static int bpq_rcv(struct sk_buff *, struct net_device *, struct packet_type *, | |||
97 | static int bpq_device_event(struct notifier_block *, unsigned long, void *); | 97 | static int bpq_device_event(struct notifier_block *, unsigned long, void *); |
98 | 98 | ||
99 | static struct packet_type bpq_packet_type = { | 99 | static struct packet_type bpq_packet_type = { |
100 | .type = __constant_htons(ETH_P_BPQ), | 100 | .type = cpu_to_be16(ETH_P_BPQ), |
101 | .func = bpq_rcv, | 101 | .func = bpq_rcv, |
102 | }; | 102 | }; |
103 | 103 | ||
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c index bd166803671d..cd794bac8b80 100644 --- a/drivers/net/igb/igb_main.c +++ b/drivers/net/igb/igb_main.c | |||
@@ -2749,12 +2749,12 @@ static inline bool igb_tx_csum_adv(struct igb_adapter *adapter, | |||
2749 | 2749 | ||
2750 | if (skb->ip_summed == CHECKSUM_PARTIAL) { | 2750 | if (skb->ip_summed == CHECKSUM_PARTIAL) { |
2751 | switch (skb->protocol) { | 2751 | switch (skb->protocol) { |
2752 | case __constant_htons(ETH_P_IP): | 2752 | case cpu_to_be16(ETH_P_IP): |
2753 | tu_cmd |= E1000_ADVTXD_TUCMD_IPV4; | 2753 | tu_cmd |= E1000_ADVTXD_TUCMD_IPV4; |
2754 | if (ip_hdr(skb)->protocol == IPPROTO_TCP) | 2754 | if (ip_hdr(skb)->protocol == IPPROTO_TCP) |
2755 | tu_cmd |= E1000_ADVTXD_TUCMD_L4T_TCP; | 2755 | tu_cmd |= E1000_ADVTXD_TUCMD_L4T_TCP; |
2756 | break; | 2756 | break; |
2757 | case __constant_htons(ETH_P_IPV6): | 2757 | case cpu_to_be16(ETH_P_IPV6): |
2758 | /* XXX what about other V6 headers?? */ | 2758 | /* XXX what about other V6 headers?? */ |
2759 | if (ipv6_hdr(skb)->nexthdr == IPPROTO_TCP) | 2759 | if (ipv6_hdr(skb)->nexthdr == IPPROTO_TCP) |
2760 | tu_cmd |= E1000_ADVTXD_TUCMD_L4T_TCP; | 2760 | tu_cmd |= E1000_ADVTXD_TUCMD_L4T_TCP; |
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index fe4a4d17c4bc..88615f69976e 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c | |||
@@ -3567,13 +3567,13 @@ static bool ixgbe_tx_csum(struct ixgbe_adapter *adapter, | |||
3567 | 3567 | ||
3568 | if (skb->ip_summed == CHECKSUM_PARTIAL) { | 3568 | if (skb->ip_summed == CHECKSUM_PARTIAL) { |
3569 | switch (skb->protocol) { | 3569 | switch (skb->protocol) { |
3570 | case __constant_htons(ETH_P_IP): | 3570 | case cpu_to_be16(ETH_P_IP): |
3571 | type_tucmd_mlhl |= IXGBE_ADVTXD_TUCMD_IPV4; | 3571 | type_tucmd_mlhl |= IXGBE_ADVTXD_TUCMD_IPV4; |
3572 | if (ip_hdr(skb)->protocol == IPPROTO_TCP) | 3572 | if (ip_hdr(skb)->protocol == IPPROTO_TCP) |
3573 | type_tucmd_mlhl |= | 3573 | type_tucmd_mlhl |= |
3574 | IXGBE_ADVTXD_TUCMD_L4T_TCP; | 3574 | IXGBE_ADVTXD_TUCMD_L4T_TCP; |
3575 | break; | 3575 | break; |
3576 | case __constant_htons(ETH_P_IPV6): | 3576 | case cpu_to_be16(ETH_P_IPV6): |
3577 | /* XXX what about other V6 headers?? */ | 3577 | /* XXX what about other V6 headers?? */ |
3578 | if (ipv6_hdr(skb)->nexthdr == IPPROTO_TCP) | 3578 | if (ipv6_hdr(skb)->nexthdr == IPPROTO_TCP) |
3579 | type_tucmd_mlhl |= | 3579 | type_tucmd_mlhl |= |
diff --git a/drivers/net/myri_sbus.c b/drivers/net/myri_sbus.c index 899ed065a147..88b52883acea 100644 --- a/drivers/net/myri_sbus.c +++ b/drivers/net/myri_sbus.c | |||
@@ -748,7 +748,7 @@ static int myri_rebuild_header(struct sk_buff *skb) | |||
748 | switch (eth->h_proto) | 748 | switch (eth->h_proto) |
749 | { | 749 | { |
750 | #ifdef CONFIG_INET | 750 | #ifdef CONFIG_INET |
751 | case __constant_htons(ETH_P_IP): | 751 | case cpu_to_be16(ETH_P_IP): |
752 | return arp_find(eth->h_dest, skb); | 752 | return arp_find(eth->h_dest, skb); |
753 | #endif | 753 | #endif |
754 | 754 | ||
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c index cc06cc5429fe..ada462e94c96 100644 --- a/drivers/net/netxen/netxen_nic_main.c +++ b/drivers/net/netxen/netxen_nic_main.c | |||
@@ -1170,7 +1170,7 @@ static bool netxen_tso_check(struct net_device *netdev, | |||
1170 | __be16 protocol = skb->protocol; | 1170 | __be16 protocol = skb->protocol; |
1171 | u16 flags = 0; | 1171 | u16 flags = 0; |
1172 | 1172 | ||
1173 | if (protocol == __constant_htons(ETH_P_8021Q)) { | 1173 | if (protocol == cpu_to_be16(ETH_P_8021Q)) { |
1174 | struct vlan_ethhdr *vh = (struct vlan_ethhdr *)skb->data; | 1174 | struct vlan_ethhdr *vh = (struct vlan_ethhdr *)skb->data; |
1175 | protocol = vh->h_vlan_encapsulated_proto; | 1175 | protocol = vh->h_vlan_encapsulated_proto; |
1176 | flags = FLAGS_VLAN_TAGGED; | 1176 | flags = FLAGS_VLAN_TAGGED; |
@@ -1183,21 +1183,21 @@ static bool netxen_tso_check(struct net_device *netdev, | |||
1183 | desc->total_hdr_length = | 1183 | desc->total_hdr_length = |
1184 | skb_transport_offset(skb) + tcp_hdrlen(skb); | 1184 | skb_transport_offset(skb) + tcp_hdrlen(skb); |
1185 | 1185 | ||
1186 | opcode = (protocol == __constant_htons(ETH_P_IPV6)) ? | 1186 | opcode = (protocol == cpu_to_be16(ETH_P_IPV6)) ? |
1187 | TX_TCP_LSO6 : TX_TCP_LSO; | 1187 | TX_TCP_LSO6 : TX_TCP_LSO; |
1188 | tso = true; | 1188 | tso = true; |
1189 | 1189 | ||
1190 | } else if (skb->ip_summed == CHECKSUM_PARTIAL) { | 1190 | } else if (skb->ip_summed == CHECKSUM_PARTIAL) { |
1191 | u8 l4proto; | 1191 | u8 l4proto; |
1192 | 1192 | ||
1193 | if (protocol == __constant_htons(ETH_P_IP)) { | 1193 | if (protocol == cpu_to_be16(ETH_P_IP)) { |
1194 | l4proto = ip_hdr(skb)->protocol; | 1194 | l4proto = ip_hdr(skb)->protocol; |
1195 | 1195 | ||
1196 | if (l4proto == IPPROTO_TCP) | 1196 | if (l4proto == IPPROTO_TCP) |
1197 | opcode = TX_TCP_PKT; | 1197 | opcode = TX_TCP_PKT; |
1198 | else if(l4proto == IPPROTO_UDP) | 1198 | else if(l4proto == IPPROTO_UDP) |
1199 | opcode = TX_UDP_PKT; | 1199 | opcode = TX_UDP_PKT; |
1200 | } else if (protocol == __constant_htons(ETH_P_IPV6)) { | 1200 | } else if (protocol == cpu_to_be16(ETH_P_IPV6)) { |
1201 | l4proto = ipv6_hdr(skb)->nexthdr; | 1201 | l4proto = ipv6_hdr(skb)->nexthdr; |
1202 | 1202 | ||
1203 | if (l4proto == IPPROTO_TCP) | 1203 | if (l4proto == IPPROTO_TCP) |
diff --git a/drivers/net/niu.c b/drivers/net/niu.c index 2346ca6bf5ba..c26325ded20e 100644 --- a/drivers/net/niu.c +++ b/drivers/net/niu.c | |||
@@ -6447,11 +6447,11 @@ static u64 niu_compute_tx_flags(struct sk_buff *skb, struct ethhdr *ehdr, | |||
6447 | 6447 | ||
6448 | ipv6 = ihl = 0; | 6448 | ipv6 = ihl = 0; |
6449 | switch (skb->protocol) { | 6449 | switch (skb->protocol) { |
6450 | case __constant_htons(ETH_P_IP): | 6450 | case cpu_to_be16(ETH_P_IP): |
6451 | ip_proto = ip_hdr(skb)->protocol; | 6451 | ip_proto = ip_hdr(skb)->protocol; |
6452 | ihl = ip_hdr(skb)->ihl; | 6452 | ihl = ip_hdr(skb)->ihl; |
6453 | break; | 6453 | break; |
6454 | case __constant_htons(ETH_P_IPV6): | 6454 | case cpu_to_be16(ETH_P_IPV6): |
6455 | ip_proto = ipv6_hdr(skb)->nexthdr; | 6455 | ip_proto = ipv6_hdr(skb)->nexthdr; |
6456 | ihl = (40 >> 2); | 6456 | ihl = (40 >> 2); |
6457 | ipv6 = 1; | 6457 | ipv6 = 1; |
diff --git a/drivers/net/pppoe.c b/drivers/net/pppoe.c index 074803a78fc6..1011fd64108b 100644 --- a/drivers/net/pppoe.c +++ b/drivers/net/pppoe.c | |||
@@ -514,12 +514,12 @@ out: | |||
514 | } | 514 | } |
515 | 515 | ||
516 | static struct packet_type pppoes_ptype = { | 516 | static struct packet_type pppoes_ptype = { |
517 | .type = __constant_htons(ETH_P_PPP_SES), | 517 | .type = cpu_to_be16(ETH_P_PPP_SES), |
518 | .func = pppoe_rcv, | 518 | .func = pppoe_rcv, |
519 | }; | 519 | }; |
520 | 520 | ||
521 | static struct packet_type pppoed_ptype = { | 521 | static struct packet_type pppoed_ptype = { |
522 | .type = __constant_htons(ETH_P_PPP_DISC), | 522 | .type = cpu_to_be16(ETH_P_PPP_DISC), |
523 | .func = pppoe_disc_rcv, | 523 | .func = pppoe_disc_rcv, |
524 | }; | 524 | }; |
525 | 525 | ||
@@ -877,7 +877,7 @@ static int pppoe_sendmsg(struct kiocb *iocb, struct socket *sock, | |||
877 | skb->dev = dev; | 877 | skb->dev = dev; |
878 | 878 | ||
879 | skb->priority = sk->sk_priority; | 879 | skb->priority = sk->sk_priority; |
880 | skb->protocol = __constant_htons(ETH_P_PPP_SES); | 880 | skb->protocol = cpu_to_be16(ETH_P_PPP_SES); |
881 | 881 | ||
882 | ph = (struct pppoe_hdr *)skb_put(skb, total_len + sizeof(struct pppoe_hdr)); | 882 | ph = (struct pppoe_hdr *)skb_put(skb, total_len + sizeof(struct pppoe_hdr)); |
883 | start = (char *)&ph->tag[0]; | 883 | start = (char *)&ph->tag[0]; |
@@ -937,7 +937,7 @@ static int __pppoe_xmit(struct sock *sk, struct sk_buff *skb) | |||
937 | ph->sid = po->num; | 937 | ph->sid = po->num; |
938 | ph->length = htons(data_len); | 938 | ph->length = htons(data_len); |
939 | 939 | ||
940 | skb->protocol = __constant_htons(ETH_P_PPP_SES); | 940 | skb->protocol = cpu_to_be16(ETH_P_PPP_SES); |
941 | skb->dev = dev; | 941 | skb->dev = dev; |
942 | 942 | ||
943 | dev_hard_header(skb, dev, ETH_P_PPP_SES, | 943 | dev_hard_header(skb, dev, ETH_P_PPP_SES, |
diff --git a/drivers/net/ps3_gelic_net.c b/drivers/net/ps3_gelic_net.c index 06649d0c2098..30900b30d532 100644 --- a/drivers/net/ps3_gelic_net.c +++ b/drivers/net/ps3_gelic_net.c | |||
@@ -745,7 +745,7 @@ static inline struct sk_buff *gelic_put_vlan_tag(struct sk_buff *skb, | |||
745 | /* Move the mac addresses to the top of buffer */ | 745 | /* Move the mac addresses to the top of buffer */ |
746 | memmove(skb->data, skb->data + VLAN_HLEN, 2 * ETH_ALEN); | 746 | memmove(skb->data, skb->data + VLAN_HLEN, 2 * ETH_ALEN); |
747 | 747 | ||
748 | veth->h_vlan_proto = __constant_htons(ETH_P_8021Q); | 748 | veth->h_vlan_proto = cpu_to_be16(ETH_P_8021Q); |
749 | veth->h_vlan_TCI = htons(tag); | 749 | veth->h_vlan_TCI = htons(tag); |
750 | 750 | ||
751 | return skb; | 751 | return skb; |
diff --git a/drivers/net/sfc/bitfield.h b/drivers/net/sfc/bitfield.h index d95c21828014..d54d84c267b9 100644 --- a/drivers/net/sfc/bitfield.h +++ b/drivers/net/sfc/bitfield.h | |||
@@ -543,7 +543,7 @@ typedef union efx_oword { | |||
543 | 543 | ||
544 | /* Static initialiser */ | 544 | /* Static initialiser */ |
545 | #define EFX_OWORD32(a, b, c, d) \ | 545 | #define EFX_OWORD32(a, b, c, d) \ |
546 | { .u32 = { __constant_cpu_to_le32(a), __constant_cpu_to_le32(b), \ | 546 | { .u32 = { cpu_to_le32(a), cpu_to_le32(b), \ |
547 | __constant_cpu_to_le32(c), __constant_cpu_to_le32(d) } } | 547 | cpu_to_le32(c), cpu_to_le32(d) } } |
548 | 548 | ||
549 | #endif /* EFX_BITFIELD_H */ | 549 | #endif /* EFX_BITFIELD_H */ |
diff --git a/drivers/net/tun.c b/drivers/net/tun.c index e9bcbdfe015a..457f2d7430cf 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c | |||
@@ -543,7 +543,7 @@ static struct sk_buff *tun_alloc_skb(size_t prepad, size_t len, size_t linear, | |||
543 | /* Get packet from user space buffer */ | 543 | /* Get packet from user space buffer */ |
544 | static __inline__ ssize_t tun_get_user(struct tun_struct *tun, struct iovec *iv, size_t count) | 544 | static __inline__ ssize_t tun_get_user(struct tun_struct *tun, struct iovec *iv, size_t count) |
545 | { | 545 | { |
546 | struct tun_pi pi = { 0, __constant_htons(ETH_P_IP) }; | 546 | struct tun_pi pi = { 0, cpu_to_be16(ETH_P_IP) }; |
547 | struct sk_buff *skb; | 547 | struct sk_buff *skb; |
548 | size_t len = count, align = 0; | 548 | size_t len = count, align = 0; |
549 | struct virtio_net_hdr gso = { 0 }; | 549 | struct virtio_net_hdr gso = { 0 }; |
diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c index 0d0fa91c0251..806cc5da56ce 100644 --- a/drivers/net/usb/hso.c +++ b/drivers/net/usb/hso.c | |||
@@ -934,8 +934,7 @@ static void packetizeRx(struct hso_net *odev, unsigned char *ip_pkt, | |||
934 | if (!odev->rx_buf_missing) { | 934 | if (!odev->rx_buf_missing) { |
935 | /* Packet is complete. Inject into stack. */ | 935 | /* Packet is complete. Inject into stack. */ |
936 | /* We have IP packet here */ | 936 | /* We have IP packet here */ |
937 | odev->skb_rx_buf->protocol = | 937 | odev->skb_rx_buf->protocol = cpu_to_be16(ETH_P_IP); |
938 | __constant_htons(ETH_P_IP); | ||
939 | /* don't check it */ | 938 | /* don't check it */ |
940 | odev->skb_rx_buf->ip_summed = | 939 | odev->skb_rx_buf->ip_summed = |
941 | CHECKSUM_UNNECESSARY; | 940 | CHECKSUM_UNNECESSARY; |
diff --git a/drivers/net/via-velocity.h b/drivers/net/via-velocity.h index 29a33090d3d4..ea43e1832afb 100644 --- a/drivers/net/via-velocity.h +++ b/drivers/net/via-velocity.h | |||
@@ -183,7 +183,7 @@ struct rdesc1 { | |||
183 | }; | 183 | }; |
184 | 184 | ||
185 | enum { | 185 | enum { |
186 | RX_INTEN = __constant_cpu_to_le16(0x8000) | 186 | RX_INTEN = cpu_to_le16(0x8000) |
187 | }; | 187 | }; |
188 | 188 | ||
189 | struct rx_desc { | 189 | struct rx_desc { |
@@ -210,7 +210,7 @@ struct tdesc1 { | |||
210 | } __attribute__ ((__packed__)); | 210 | } __attribute__ ((__packed__)); |
211 | 211 | ||
212 | enum { | 212 | enum { |
213 | TD_QUEUE = __constant_cpu_to_le16(0x8000) | 213 | TD_QUEUE = cpu_to_le16(0x8000) |
214 | }; | 214 | }; |
215 | 215 | ||
216 | struct td_buf { | 216 | struct td_buf { |
@@ -242,7 +242,7 @@ struct velocity_td_info { | |||
242 | 242 | ||
243 | enum velocity_owner { | 243 | enum velocity_owner { |
244 | OWNED_BY_HOST = 0, | 244 | OWNED_BY_HOST = 0, |
245 | OWNED_BY_NIC = __constant_cpu_to_le16(0x8000) | 245 | OWNED_BY_NIC = cpu_to_le16(0x8000) |
246 | }; | 246 | }; |
247 | 247 | ||
248 | 248 | ||
diff --git a/drivers/net/wan/hdlc.c b/drivers/net/wan/hdlc.c index 43da8bd72973..5ce437205558 100644 --- a/drivers/net/wan/hdlc.c +++ b/drivers/net/wan/hdlc.c | |||
@@ -349,7 +349,7 @@ EXPORT_SYMBOL(attach_hdlc_protocol); | |||
349 | EXPORT_SYMBOL(detach_hdlc_protocol); | 349 | EXPORT_SYMBOL(detach_hdlc_protocol); |
350 | 350 | ||
351 | static struct packet_type hdlc_packet_type = { | 351 | static struct packet_type hdlc_packet_type = { |
352 | .type = __constant_htons(ETH_P_HDLC), | 352 | .type = cpu_to_be16(ETH_P_HDLC), |
353 | .func = hdlc_rcv, | 353 | .func = hdlc_rcv, |
354 | }; | 354 | }; |
355 | 355 | ||
diff --git a/drivers/net/wan/hdlc_cisco.c b/drivers/net/wan/hdlc_cisco.c index af3fd4fead8a..cf5fd17ad707 100644 --- a/drivers/net/wan/hdlc_cisco.c +++ b/drivers/net/wan/hdlc_cisco.c | |||
@@ -117,7 +117,7 @@ static void cisco_keepalive_send(struct net_device *dev, u32 type, | |||
117 | data->type = htonl(type); | 117 | data->type = htonl(type); |
118 | data->par1 = par1; | 118 | data->par1 = par1; |
119 | data->par2 = par2; | 119 | data->par2 = par2; |
120 | data->rel = __constant_htons(0xFFFF); | 120 | data->rel = cpu_to_be16(0xFFFF); |
121 | /* we will need do_div here if 1000 % HZ != 0 */ | 121 | /* we will need do_div here if 1000 % HZ != 0 */ |
122 | data->time = htonl((jiffies - INITIAL_JIFFIES) * (1000 / HZ)); | 122 | data->time = htonl((jiffies - INITIAL_JIFFIES) * (1000 / HZ)); |
123 | 123 | ||
@@ -136,20 +136,20 @@ static __be16 cisco_type_trans(struct sk_buff *skb, struct net_device *dev) | |||
136 | struct hdlc_header *data = (struct hdlc_header*)skb->data; | 136 | struct hdlc_header *data = (struct hdlc_header*)skb->data; |
137 | 137 | ||
138 | if (skb->len < sizeof(struct hdlc_header)) | 138 | if (skb->len < sizeof(struct hdlc_header)) |
139 | return __constant_htons(ETH_P_HDLC); | 139 | return cpu_to_be16(ETH_P_HDLC); |
140 | 140 | ||
141 | if (data->address != CISCO_MULTICAST && | 141 | if (data->address != CISCO_MULTICAST && |
142 | data->address != CISCO_UNICAST) | 142 | data->address != CISCO_UNICAST) |
143 | return __constant_htons(ETH_P_HDLC); | 143 | return cpu_to_be16(ETH_P_HDLC); |
144 | 144 | ||
145 | switch(data->protocol) { | 145 | switch(data->protocol) { |
146 | case __constant_htons(ETH_P_IP): | 146 | case cpu_to_be16(ETH_P_IP): |
147 | case __constant_htons(ETH_P_IPX): | 147 | case cpu_to_be16(ETH_P_IPX): |
148 | case __constant_htons(ETH_P_IPV6): | 148 | case cpu_to_be16(ETH_P_IPV6): |
149 | skb_pull(skb, sizeof(struct hdlc_header)); | 149 | skb_pull(skb, sizeof(struct hdlc_header)); |
150 | return data->protocol; | 150 | return data->protocol; |
151 | default: | 151 | default: |
152 | return __constant_htons(ETH_P_HDLC); | 152 | return cpu_to_be16(ETH_P_HDLC); |
153 | } | 153 | } |
154 | } | 154 | } |
155 | 155 | ||
@@ -194,7 +194,7 @@ static int cisco_rx(struct sk_buff *skb) | |||
194 | case CISCO_ADDR_REQ: /* Stolen from syncppp.c :-) */ | 194 | case CISCO_ADDR_REQ: /* Stolen from syncppp.c :-) */ |
195 | in_dev = dev->ip_ptr; | 195 | in_dev = dev->ip_ptr; |
196 | addr = 0; | 196 | addr = 0; |
197 | mask = __constant_htonl(~0); /* is the mask correct? */ | 197 | mask = ~cpu_to_be32(0); /* is the mask correct? */ |
198 | 198 | ||
199 | if (in_dev != NULL) { | 199 | if (in_dev != NULL) { |
200 | struct in_ifaddr **ifap = &in_dev->ifa_list; | 200 | struct in_ifaddr **ifap = &in_dev->ifa_list; |
diff --git a/drivers/net/wan/hdlc_fr.c b/drivers/net/wan/hdlc_fr.c index 70e57cebc955..800530101093 100644 --- a/drivers/net/wan/hdlc_fr.c +++ b/drivers/net/wan/hdlc_fr.c | |||
@@ -278,31 +278,31 @@ static int fr_hard_header(struct sk_buff **skb_p, u16 dlci) | |||
278 | struct sk_buff *skb = *skb_p; | 278 | struct sk_buff *skb = *skb_p; |
279 | 279 | ||
280 | switch (skb->protocol) { | 280 | switch (skb->protocol) { |
281 | case __constant_htons(NLPID_CCITT_ANSI_LMI): | 281 | case cpu_to_be16(NLPID_CCITT_ANSI_LMI): |
282 | head_len = 4; | 282 | head_len = 4; |
283 | skb_push(skb, head_len); | 283 | skb_push(skb, head_len); |
284 | skb->data[3] = NLPID_CCITT_ANSI_LMI; | 284 | skb->data[3] = NLPID_CCITT_ANSI_LMI; |
285 | break; | 285 | break; |
286 | 286 | ||
287 | case __constant_htons(NLPID_CISCO_LMI): | 287 | case cpu_to_be16(NLPID_CISCO_LMI): |
288 | head_len = 4; | 288 | head_len = 4; |
289 | skb_push(skb, head_len); | 289 | skb_push(skb, head_len); |
290 | skb->data[3] = NLPID_CISCO_LMI; | 290 | skb->data[3] = NLPID_CISCO_LMI; |
291 | break; | 291 | break; |
292 | 292 | ||
293 | case __constant_htons(ETH_P_IP): | 293 | case cpu_to_be16(ETH_P_IP): |
294 | head_len = 4; | 294 | head_len = 4; |
295 | skb_push(skb, head_len); | 295 | skb_push(skb, head_len); |
296 | skb->data[3] = NLPID_IP; | 296 | skb->data[3] = NLPID_IP; |
297 | break; | 297 | break; |
298 | 298 | ||
299 | case __constant_htons(ETH_P_IPV6): | 299 | case cpu_to_be16(ETH_P_IPV6): |
300 | head_len = 4; | 300 | head_len = 4; |
301 | skb_push(skb, head_len); | 301 | skb_push(skb, head_len); |
302 | skb->data[3] = NLPID_IPV6; | 302 | skb->data[3] = NLPID_IPV6; |
303 | break; | 303 | break; |
304 | 304 | ||
305 | case __constant_htons(ETH_P_802_3): | 305 | case cpu_to_be16(ETH_P_802_3): |
306 | head_len = 10; | 306 | head_len = 10; |
307 | if (skb_headroom(skb) < head_len) { | 307 | if (skb_headroom(skb) < head_len) { |
308 | struct sk_buff *skb2 = skb_realloc_headroom(skb, | 308 | struct sk_buff *skb2 = skb_realloc_headroom(skb, |
@@ -426,7 +426,7 @@ static int pvc_xmit(struct sk_buff *skb, struct net_device *dev) | |||
426 | skb_put(skb, pad); | 426 | skb_put(skb, pad); |
427 | memset(skb->data + len, 0, pad); | 427 | memset(skb->data + len, 0, pad); |
428 | } | 428 | } |
429 | skb->protocol = __constant_htons(ETH_P_802_3); | 429 | skb->protocol = cpu_to_be16(ETH_P_802_3); |
430 | } | 430 | } |
431 | if (!fr_hard_header(&skb, pvc->dlci)) { | 431 | if (!fr_hard_header(&skb, pvc->dlci)) { |
432 | dev->stats.tx_bytes += skb->len; | 432 | dev->stats.tx_bytes += skb->len; |
@@ -496,10 +496,10 @@ static void fr_lmi_send(struct net_device *dev, int fullrep) | |||
496 | memset(skb->data, 0, len); | 496 | memset(skb->data, 0, len); |
497 | skb_reserve(skb, 4); | 497 | skb_reserve(skb, 4); |
498 | if (lmi == LMI_CISCO) { | 498 | if (lmi == LMI_CISCO) { |
499 | skb->protocol = __constant_htons(NLPID_CISCO_LMI); | 499 | skb->protocol = cpu_to_be16(NLPID_CISCO_LMI); |
500 | fr_hard_header(&skb, LMI_CISCO_DLCI); | 500 | fr_hard_header(&skb, LMI_CISCO_DLCI); |
501 | } else { | 501 | } else { |
502 | skb->protocol = __constant_htons(NLPID_CCITT_ANSI_LMI); | 502 | skb->protocol = cpu_to_be16(NLPID_CCITT_ANSI_LMI); |
503 | fr_hard_header(&skb, LMI_CCITT_ANSI_DLCI); | 503 | fr_hard_header(&skb, LMI_CCITT_ANSI_DLCI); |
504 | } | 504 | } |
505 | data = skb_tail_pointer(skb); | 505 | data = skb_tail_pointer(skb); |
diff --git a/drivers/net/wan/hdlc_ppp.c b/drivers/net/wan/hdlc_ppp.c index 7b8a5eae201d..72a7cdab4245 100644 --- a/drivers/net/wan/hdlc_ppp.c +++ b/drivers/net/wan/hdlc_ppp.c | |||
@@ -150,11 +150,11 @@ static __be16 ppp_type_trans(struct sk_buff *skb, struct net_device *dev) | |||
150 | return htons(ETH_P_HDLC); | 150 | return htons(ETH_P_HDLC); |
151 | 151 | ||
152 | switch (data->protocol) { | 152 | switch (data->protocol) { |
153 | case __constant_htons(PID_IP): | 153 | case cpu_to_be16(PID_IP): |
154 | skb_pull(skb, sizeof(struct hdlc_header)); | 154 | skb_pull(skb, sizeof(struct hdlc_header)); |
155 | return htons(ETH_P_IP); | 155 | return htons(ETH_P_IP); |
156 | 156 | ||
157 | case __constant_htons(PID_IPV6): | 157 | case cpu_to_be16(PID_IPV6): |
158 | skb_pull(skb, sizeof(struct hdlc_header)); | 158 | skb_pull(skb, sizeof(struct hdlc_header)); |
159 | return htons(ETH_P_IPV6); | 159 | return htons(ETH_P_IPV6); |
160 | 160 | ||
diff --git a/drivers/net/wan/hdlc_raw.c b/drivers/net/wan/hdlc_raw.c index 6e92c64ebd0f..19f51fdd5522 100644 --- a/drivers/net/wan/hdlc_raw.c +++ b/drivers/net/wan/hdlc_raw.c | |||
@@ -27,7 +27,7 @@ static int raw_ioctl(struct net_device *dev, struct ifreq *ifr); | |||
27 | 27 | ||
28 | static __be16 raw_type_trans(struct sk_buff *skb, struct net_device *dev) | 28 | static __be16 raw_type_trans(struct sk_buff *skb, struct net_device *dev) |
29 | { | 29 | { |
30 | return __constant_htons(ETH_P_IP); | 30 | return cpu_to_be16(ETH_P_IP); |
31 | } | 31 | } |
32 | 32 | ||
33 | static struct hdlc_proto proto = { | 33 | static struct hdlc_proto proto = { |
diff --git a/drivers/net/wan/lapbether.c b/drivers/net/wan/lapbether.c index 5b61b3eef45f..da9dcf59de24 100644 --- a/drivers/net/wan/lapbether.c +++ b/drivers/net/wan/lapbether.c | |||
@@ -422,7 +422,7 @@ static int lapbeth_device_event(struct notifier_block *this, | |||
422 | /* ------------------------------------------------------------------------ */ | 422 | /* ------------------------------------------------------------------------ */ |
423 | 423 | ||
424 | static struct packet_type lapbeth_packet_type = { | 424 | static struct packet_type lapbeth_packet_type = { |
425 | .type = __constant_htons(ETH_P_DEC), | 425 | .type = cpu_to_be16(ETH_P_DEC), |
426 | .func = lapbeth_rcv, | 426 | .func = lapbeth_rcv, |
427 | }; | 427 | }; |
428 | 428 | ||