aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ieee1394/eth1394.c
diff options
context:
space:
mode:
authorBen Collins <bcollins@ubuntu.com>2006-06-12 18:16:25 -0400
committerBen Collins <bcollins@ubuntu.com>2006-06-12 18:16:25 -0400
commit7136b8073f0123918e3e50269ae021bbb09e1a81 (patch)
tree65643f892bcac13e27f65bf53dd6a00f1969c071 /drivers/ieee1394/eth1394.c
parent2c4b69bd7bff85ae9e8b2032179aee9c04da70ba (diff)
eth1394: replace __constant_htons by htons
...and __constant_ntohs, __constant_ntohl, __constant_cpu_to_be32 too where possible. Htons and friends are resolved to constants in these places anyway. Also fix an endianess glitch in a log message, spotted by Alexey Dobriyan. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> Signed-off-by: Ben Collins <bcollins@ubuntu.com>
Diffstat (limited to 'drivers/ieee1394/eth1394.c')
-rw-r--r--drivers/ieee1394/eth1394.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/drivers/ieee1394/eth1394.c b/drivers/ieee1394/eth1394.c
index cf80fed6163b..5bda15904a08 100644
--- a/drivers/ieee1394/eth1394.c
+++ b/drivers/ieee1394/eth1394.c
@@ -770,7 +770,7 @@ static int ether1394_rebuild_header(struct sk_buff *skb)
770 default: 770 default:
771 ETH1394_PRINT(KERN_DEBUG, dev->name, 771 ETH1394_PRINT(KERN_DEBUG, dev->name,
772 "unable to resolve type %04x addresses.\n", 772 "unable to resolve type %04x addresses.\n",
773 eth->h_proto); 773 ntohs(eth->h_proto));
774 break; 774 break;
775 } 775 }
776 776
@@ -792,9 +792,8 @@ static int ether1394_header_cache(struct neighbour *neigh, struct hh_cache *hh)
792 (16 - ETH1394_HLEN)); 792 (16 - ETH1394_HLEN));
793 struct net_device *dev = neigh->dev; 793 struct net_device *dev = neigh->dev;
794 794
795 if (type == __constant_htons(ETH_P_802_3)) { 795 if (type == htons(ETH_P_802_3))
796 return -1; 796 return -1;
797 }
798 797
799 eth->h_proto = type; 798 eth->h_proto = type;
800 memcpy(eth->h_dest, neigh->ha, dev->addr_len); 799 memcpy(eth->h_dest, neigh->ha, dev->addr_len);
@@ -883,7 +882,7 @@ static inline u16 ether1394_parse_encap(struct sk_buff *skb,
883 /* If this is an ARP packet, convert it. First, we want to make 882 /* If this is an ARP packet, convert it. First, we want to make
884 * use of some of the fields, since they tell us a little bit 883 * use of some of the fields, since they tell us a little bit
885 * about the sending machine. */ 884 * about the sending machine. */
886 if (ether_type == __constant_htons (ETH_P_ARP)) { 885 if (ether_type == htons(ETH_P_ARP)) {
887 struct eth1394_arp *arp1394 = (struct eth1394_arp*)skb->data; 886 struct eth1394_arp *arp1394 = (struct eth1394_arp*)skb->data;
888 struct arphdr *arp = (struct arphdr *)skb->data; 887 struct arphdr *arp = (struct arphdr *)skb->data;
889 unsigned char *arp_ptr = (unsigned char *)(arp + 1); 888 unsigned char *arp_ptr = (unsigned char *)(arp + 1);
@@ -939,8 +938,8 @@ static inline u16 ether1394_parse_encap(struct sk_buff *skb,
939 } 938 }
940 939
941 /* Now add the ethernet header. */ 940 /* Now add the ethernet header. */
942 if (dev->hard_header (skb, dev, __constant_ntohs (ether_type), 941 if (dev->hard_header(skb, dev, ntohs(ether_type), &dest_hw, NULL,
943 &dest_hw, NULL, skb->len) >= 0) 942 skb->len) >= 0)
944 ret = ether1394_type_trans(skb, dev); 943 ret = ether1394_type_trans(skb, dev);
945 944
946 return ret; 945 return ret;
@@ -1510,8 +1509,8 @@ static inline void ether1394_prep_gasp_packet(struct hpsb_packet *p,
1510 p->data = ((quadlet_t*)skb->data) - 2; 1509 p->data = ((quadlet_t*)skb->data) - 2;
1511 p->data[0] = cpu_to_be32((priv->host->node_id << 16) | 1510 p->data[0] = cpu_to_be32((priv->host->node_id << 16) |
1512 ETHER1394_GASP_SPECIFIER_ID_HI); 1511 ETHER1394_GASP_SPECIFIER_ID_HI);
1513 p->data[1] = __constant_cpu_to_be32((ETHER1394_GASP_SPECIFIER_ID_LO << 24) | 1512 p->data[1] = cpu_to_be32((ETHER1394_GASP_SPECIFIER_ID_LO << 24) |
1514 ETHER1394_GASP_VERSION); 1513 ETHER1394_GASP_VERSION);
1515 1514
1516 /* Setting the node id to ALL_NODES (not LOCAL_BUS | ALL_NODES) 1515 /* Setting the node id to ALL_NODES (not LOCAL_BUS | ALL_NODES)
1517 * prevents hpsb_send_packet() from setting the speed to an arbitrary 1516 * prevents hpsb_send_packet() from setting the speed to an arbitrary
@@ -1666,9 +1665,9 @@ static int ether1394_tx (struct sk_buff *skb, struct net_device *dev)
1666 /* Set the transmission type for the packet. ARP packets and IP 1665 /* Set the transmission type for the packet. ARP packets and IP
1667 * broadcast packets are sent via GASP. */ 1666 * broadcast packets are sent via GASP. */
1668 if (memcmp(eth->h_dest, dev->broadcast, ETH1394_ALEN) == 0 || 1667 if (memcmp(eth->h_dest, dev->broadcast, ETH1394_ALEN) == 0 ||
1669 proto == __constant_htons(ETH_P_ARP) || 1668 proto == htons(ETH_P_ARP) ||
1670 (proto == __constant_htons(ETH_P_IP) && 1669 (proto == htons(ETH_P_IP) &&
1671 IN_MULTICAST(__constant_ntohl(skb->nh.iph->daddr)))) { 1670 IN_MULTICAST(ntohl(skb->nh.iph->daddr)))) {
1672 tx_type = ETH1394_GASP; 1671 tx_type = ETH1394_GASP;
1673 dest_node = LOCAL_BUS | ALL_NODES; 1672 dest_node = LOCAL_BUS | ALL_NODES;
1674 max_payload = priv->bc_maxpayload - ETHER1394_GASP_OVERHEAD; 1673 max_payload = priv->bc_maxpayload - ETHER1394_GASP_OVERHEAD;
@@ -1700,7 +1699,7 @@ static int ether1394_tx (struct sk_buff *skb, struct net_device *dev)
1700 } 1699 }
1701 1700
1702 /* If this is an ARP packet, convert it */ 1701 /* If this is an ARP packet, convert it */
1703 if (proto == __constant_htons (ETH_P_ARP)) 1702 if (proto == htons(ETH_P_ARP))
1704 ether1394_arp_to_1394arp (skb, dev); 1703 ether1394_arp_to_1394arp (skb, dev);
1705 1704
1706 ptask->hdr.words.word1 = 0; 1705 ptask->hdr.words.word1 = 0;