BNX2X: spatch endian converters
[akaros.git] / kern / drivers / net / bnx2x / bnx2x_cmn.c
index 7d75cda..abbe541 100644 (file)
@@ -779,7 +779,9 @@ static void bnx2x_tpa_stop(struct bnx2x *bp, struct bnx2x_fastpath *fp,
                if (!bnx2x_fill_frag_skb(bp, fp, tpa_info, pages,
                                         skb, cqe, cqe_idx)) {
                        if (tpa_info->parsing_flags & PARSING_FLAGS_VLAN)
-                               __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), tpa_info->vlan_tag);
+                               __vlan_hwaccel_put_tag(skb,
+                                                      cpu_to_be16(ETH_P_8021Q),
+                                                      tpa_info->vlan_tag);
                        bnx2x_gro_receive(bp, fp, skb);
                } else {
                        DP(NETIF_MSG_RX_STATUS,
@@ -1063,7 +1065,7 @@ reuse_rx:
 
                if (le16_to_cpu(cqe_fp->pars_flags.flags) &
                    PARSING_FLAGS_VLAN)
-                       __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q),
+                       __vlan_hwaccel_put_tag(skb, cpu_to_be16(ETH_P_8021Q),
                                               le16_to_cpu(cqe_fp->vlan_tag));
 
                skb_mark_napi_id(skb, &fp->napi);
@@ -1905,14 +1907,14 @@ uint16_t bnx2x_select_queue(struct ether *dev, struct sk_buff *skb,
 
        if (CNIC_LOADED(bp) && !NO_FCOE(bp)) {
                struct ethhdr *hdr = (struct ethhdr *)skb->data;
-               uint16_t ether_type = ntohs(hdr->h_proto);
+               uint16_t ether_type = be16_to_cpu(hdr->h_proto);
 
                /* Skip VLAN tag if present */
                if (ether_type == ETH_P_8021Q) {
                        struct vlan_ethhdr *vhdr =
                                (struct vlan_ethhdr *)skb->data;
 
-                       ether_type = ntohs(vhdr->h_vlan_encapsulated_proto);
+                       ether_type = be16_to_cpu(vhdr->h_vlan_encapsulated_proto);
                }
 
                /* If ethertype is FCoE or FIP - use FCoE ring */
@@ -3328,7 +3330,7 @@ static uint32_t bnx2x_xmit_type(struct bnx2x *bp, struct sk_buff *skb)
                return XMIT_PLAIN;
 
        protocol = vlan_get_protocol(skb);
-       if (protocol == htons(ETH_P_IPV6)) {
+       if (protocol == cpu_to_be16(ETH_P_IPV6)) {
                rc = XMIT_CSUM_V6;
                prot = ipv6_hdr(skb)->nexthdr;
        } else {
@@ -3873,7 +3875,7 @@ netdev_tx_t bnx2x_start_xmit(struct sk_buff *skb, struct ether *dev)
                if (IS_VF(bp))
 #endif
                        tx_start_bd->vlan_or_ethertype =
-                               cpu_to_le16(ntohs(eth->h_proto));
+                               cpu_to_le16(be16_to_cpu(eth->h_proto));
 #ifndef BNX2X_STOP_ON_ERROR
                else
                        /* used by FW for packet accounting */