diff options
Diffstat (limited to 'drivers/ieee1394/eth1394.c')
-rw-r--r-- | drivers/ieee1394/eth1394.c | 51 |
1 files changed, 23 insertions, 28 deletions
diff --git a/drivers/ieee1394/eth1394.c b/drivers/ieee1394/eth1394.c index 30fa0d43a43a..5bda15904a08 100644 --- a/drivers/ieee1394/eth1394.c +++ b/drivers/ieee1394/eth1394.c | |||
@@ -367,7 +367,7 @@ static int eth1394_probe(struct device *dev) | |||
367 | spin_lock_init(&node_info->pdg.lock); | 367 | spin_lock_init(&node_info->pdg.lock); |
368 | INIT_LIST_HEAD(&node_info->pdg.list); | 368 | INIT_LIST_HEAD(&node_info->pdg.list); |
369 | node_info->pdg.sz = 0; | 369 | node_info->pdg.sz = 0; |
370 | node_info->fifo = ETHER1394_INVALID_ADDR; | 370 | node_info->fifo = CSR1212_INVALID_ADDR_SPACE; |
371 | 371 | ||
372 | ud->device.driver_data = node_info; | 372 | ud->device.driver_data = node_info; |
373 | new_node->ud = ud; | 373 | new_node->ud = ud; |
@@ -502,10 +502,8 @@ static void ether1394_reset_priv (struct net_device *dev, int set_mtu) | |||
502 | 502 | ||
503 | /* Determine speed limit */ | 503 | /* Determine speed limit */ |
504 | for (i = 0; i < host->node_count; i++) | 504 | for (i = 0; i < host->node_count; i++) |
505 | if (max_speed > host->speed_map[NODEID_TO_NODE(host->node_id) * | 505 | if (max_speed > host->speed[i]) |
506 | 64 + i]) | 506 | max_speed = host->speed[i]; |
507 | max_speed = host->speed_map[NODEID_TO_NODE(host->node_id) * | ||
508 | 64 + i]; | ||
509 | priv->bc_sspd = max_speed; | 507 | priv->bc_sspd = max_speed; |
510 | 508 | ||
511 | /* We'll use our maxpayload as the default mtu */ | 509 | /* We'll use our maxpayload as the default mtu */ |
@@ -568,13 +566,11 @@ static void ether1394_add_host (struct hpsb_host *host) | |||
568 | if (!(host->config_roms & HPSB_CONFIG_ROM_ENTRY_IP1394)) | 566 | if (!(host->config_roms & HPSB_CONFIG_ROM_ENTRY_IP1394)) |
569 | return; | 567 | return; |
570 | 568 | ||
571 | fifo_addr = hpsb_allocate_and_register_addrspace(ð1394_highlevel, | 569 | fifo_addr = hpsb_allocate_and_register_addrspace( |
572 | host, | 570 | ð1394_highlevel, host, &addr_ops, |
573 | &addr_ops, | 571 | ETHER1394_REGION_ADDR_LEN, ETHER1394_REGION_ADDR_LEN, |
574 | ETHER1394_REGION_ADDR_LEN, | 572 | CSR1212_INVALID_ADDR_SPACE, CSR1212_INVALID_ADDR_SPACE); |
575 | ETHER1394_REGION_ADDR_LEN, | 573 | if (fifo_addr == CSR1212_INVALID_ADDR_SPACE) |
576 | -1, -1); | ||
577 | if (fifo_addr == ~0ULL) | ||
578 | goto out; | 574 | goto out; |
579 | 575 | ||
580 | /* We should really have our own alloc_hpsbdev() function in | 576 | /* We should really have our own alloc_hpsbdev() function in |
@@ -774,7 +770,7 @@ static int ether1394_rebuild_header(struct sk_buff *skb) | |||
774 | default: | 770 | default: |
775 | ETH1394_PRINT(KERN_DEBUG, dev->name, | 771 | ETH1394_PRINT(KERN_DEBUG, dev->name, |
776 | "unable to resolve type %04x addresses.\n", | 772 | "unable to resolve type %04x addresses.\n", |
777 | eth->h_proto); | 773 | ntohs(eth->h_proto)); |
778 | break; | 774 | break; |
779 | } | 775 | } |
780 | 776 | ||
@@ -796,9 +792,8 @@ static int ether1394_header_cache(struct neighbour *neigh, struct hh_cache *hh) | |||
796 | (16 - ETH1394_HLEN)); | 792 | (16 - ETH1394_HLEN)); |
797 | struct net_device *dev = neigh->dev; | 793 | struct net_device *dev = neigh->dev; |
798 | 794 | ||
799 | if (type == __constant_htons(ETH_P_802_3)) { | 795 | if (type == htons(ETH_P_802_3)) |
800 | return -1; | 796 | return -1; |
801 | } | ||
802 | 797 | ||
803 | eth->h_proto = type; | 798 | eth->h_proto = type; |
804 | memcpy(eth->h_dest, neigh->ha, dev->addr_len); | 799 | memcpy(eth->h_dest, neigh->ha, dev->addr_len); |
@@ -887,7 +882,7 @@ static inline u16 ether1394_parse_encap(struct sk_buff *skb, | |||
887 | /* 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 |
888 | * 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 |
889 | * about the sending machine. */ | 884 | * about the sending machine. */ |
890 | if (ether_type == __constant_htons (ETH_P_ARP)) { | 885 | if (ether_type == htons(ETH_P_ARP)) { |
891 | struct eth1394_arp *arp1394 = (struct eth1394_arp*)skb->data; | 886 | struct eth1394_arp *arp1394 = (struct eth1394_arp*)skb->data; |
892 | struct arphdr *arp = (struct arphdr *)skb->data; | 887 | struct arphdr *arp = (struct arphdr *)skb->data; |
893 | unsigned char *arp_ptr = (unsigned char *)(arp + 1); | 888 | unsigned char *arp_ptr = (unsigned char *)(arp + 1); |
@@ -935,7 +930,7 @@ static inline u16 ether1394_parse_encap(struct sk_buff *skb, | |||
935 | *(u32*)arp_ptr = arp1394->sip; /* move sender IP addr */ | 930 | *(u32*)arp_ptr = arp1394->sip; /* move sender IP addr */ |
936 | arp_ptr += arp->ar_pln; /* skip over sender IP addr */ | 931 | arp_ptr += arp->ar_pln; /* skip over sender IP addr */ |
937 | 932 | ||
938 | if (arp->ar_op == 1) | 933 | if (arp->ar_op == htons(ARPOP_REQUEST)) |
939 | /* just set ARP req target unique ID to 0 */ | 934 | /* just set ARP req target unique ID to 0 */ |
940 | *((u64*)arp_ptr) = 0; | 935 | *((u64*)arp_ptr) = 0; |
941 | else | 936 | else |
@@ -943,8 +938,8 @@ static inline u16 ether1394_parse_encap(struct sk_buff *skb, | |||
943 | } | 938 | } |
944 | 939 | ||
945 | /* Now add the ethernet header. */ | 940 | /* Now add the ethernet header. */ |
946 | if (dev->hard_header (skb, dev, __constant_ntohs (ether_type), | 941 | if (dev->hard_header(skb, dev, ntohs(ether_type), &dest_hw, NULL, |
947 | &dest_hw, NULL, skb->len) >= 0) | 942 | skb->len) >= 0) |
948 | ret = ether1394_type_trans(skb, dev); | 943 | ret = ether1394_type_trans(skb, dev); |
949 | 944 | ||
950 | return ret; | 945 | return ret; |
@@ -1395,7 +1390,7 @@ static inline void ether1394_arp_to_1394arp(struct sk_buff *skb, | |||
1395 | /* We need to encapsulate the standard header with our own. We use the | 1390 | /* We need to encapsulate the standard header with our own. We use the |
1396 | * ethernet header's proto for our own. */ | 1391 | * ethernet header's proto for our own. */ |
1397 | static inline unsigned int ether1394_encapsulate_prep(unsigned int max_payload, | 1392 | static inline unsigned int ether1394_encapsulate_prep(unsigned int max_payload, |
1398 | int proto, | 1393 | __be16 proto, |
1399 | union eth1394_hdr *hdr, | 1394 | union eth1394_hdr *hdr, |
1400 | u16 dg_size, u16 dgl) | 1395 | u16 dg_size, u16 dgl) |
1401 | { | 1396 | { |
@@ -1514,8 +1509,8 @@ static inline void ether1394_prep_gasp_packet(struct hpsb_packet *p, | |||
1514 | p->data = ((quadlet_t*)skb->data) - 2; | 1509 | p->data = ((quadlet_t*)skb->data) - 2; |
1515 | p->data[0] = cpu_to_be32((priv->host->node_id << 16) | | 1510 | p->data[0] = cpu_to_be32((priv->host->node_id << 16) | |
1516 | ETHER1394_GASP_SPECIFIER_ID_HI); | 1511 | ETHER1394_GASP_SPECIFIER_ID_HI); |
1517 | 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) | |
1518 | ETHER1394_GASP_VERSION); | 1513 | ETHER1394_GASP_VERSION); |
1519 | 1514 | ||
1520 | /* 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) |
1521 | * prevents hpsb_send_packet() from setting the speed to an arbitrary | 1516 | * prevents hpsb_send_packet() from setting the speed to an arbitrary |
@@ -1626,7 +1621,7 @@ static int ether1394_tx (struct sk_buff *skb, struct net_device *dev) | |||
1626 | gfp_t kmflags = in_interrupt() ? GFP_ATOMIC : GFP_KERNEL; | 1621 | gfp_t kmflags = in_interrupt() ? GFP_ATOMIC : GFP_KERNEL; |
1627 | struct eth1394hdr *eth; | 1622 | struct eth1394hdr *eth; |
1628 | struct eth1394_priv *priv = netdev_priv(dev); | 1623 | struct eth1394_priv *priv = netdev_priv(dev); |
1629 | int proto; | 1624 | __be16 proto; |
1630 | unsigned long flags; | 1625 | unsigned long flags; |
1631 | nodeid_t dest_node; | 1626 | nodeid_t dest_node; |
1632 | eth1394_tx_type tx_type; | 1627 | eth1394_tx_type tx_type; |
@@ -1670,9 +1665,9 @@ static int ether1394_tx (struct sk_buff *skb, struct net_device *dev) | |||
1670 | /* Set the transmission type for the packet. ARP packets and IP | 1665 | /* Set the transmission type for the packet. ARP packets and IP |
1671 | * broadcast packets are sent via GASP. */ | 1666 | * broadcast packets are sent via GASP. */ |
1672 | if (memcmp(eth->h_dest, dev->broadcast, ETH1394_ALEN) == 0 || | 1667 | if (memcmp(eth->h_dest, dev->broadcast, ETH1394_ALEN) == 0 || |
1673 | proto == __constant_htons(ETH_P_ARP) || | 1668 | proto == htons(ETH_P_ARP) || |
1674 | (proto == __constant_htons(ETH_P_IP) && | 1669 | (proto == htons(ETH_P_IP) && |
1675 | IN_MULTICAST(__constant_ntohl(skb->nh.iph->daddr)))) { | 1670 | IN_MULTICAST(ntohl(skb->nh.iph->daddr)))) { |
1676 | tx_type = ETH1394_GASP; | 1671 | tx_type = ETH1394_GASP; |
1677 | dest_node = LOCAL_BUS | ALL_NODES; | 1672 | dest_node = LOCAL_BUS | ALL_NODES; |
1678 | max_payload = priv->bc_maxpayload - ETHER1394_GASP_OVERHEAD; | 1673 | max_payload = priv->bc_maxpayload - ETHER1394_GASP_OVERHEAD; |
@@ -1688,7 +1683,7 @@ static int ether1394_tx (struct sk_buff *skb, struct net_device *dev) | |||
1688 | goto fail; | 1683 | goto fail; |
1689 | } | 1684 | } |
1690 | node_info = (struct eth1394_node_info*)node->ud->device.driver_data; | 1685 | node_info = (struct eth1394_node_info*)node->ud->device.driver_data; |
1691 | if (node_info->fifo == ETHER1394_INVALID_ADDR) { | 1686 | if (node_info->fifo == CSR1212_INVALID_ADDR_SPACE) { |
1692 | ret = -EAGAIN; | 1687 | ret = -EAGAIN; |
1693 | goto fail; | 1688 | goto fail; |
1694 | } | 1689 | } |
@@ -1704,7 +1699,7 @@ static int ether1394_tx (struct sk_buff *skb, struct net_device *dev) | |||
1704 | } | 1699 | } |
1705 | 1700 | ||
1706 | /* If this is an ARP packet, convert it */ | 1701 | /* If this is an ARP packet, convert it */ |
1707 | if (proto == __constant_htons (ETH_P_ARP)) | 1702 | if (proto == htons(ETH_P_ARP)) |
1708 | ether1394_arp_to_1394arp (skb, dev); | 1703 | ether1394_arp_to_1394arp (skb, dev); |
1709 | 1704 | ||
1710 | ptask->hdr.words.word1 = 0; | 1705 | ptask->hdr.words.word1 = 0; |