Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 40530
b: refs/heads/master
c: c20e394
h: refs/heads/master
v: v3
  • Loading branch information
David S. Miller authored and David S. Miller committed Oct 30, 2006
1 parent b6e700e commit 429273a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 234af4840135342ab295b4e1219fd35c27fdd439
refs/heads/master: c20e3945c761502b9d5d73ef0ff5f1a84b3a717e
20 changes: 12 additions & 8 deletions trunk/drivers/ieee1394/eth1394.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
#include <linux/ethtool.h>
#include <asm/uaccess.h>
#include <asm/delay.h>
#include <asm/unaligned.h>
#include <net/arp.h>

#include "config_roms.h"
Expand Down Expand Up @@ -491,7 +492,7 @@ static void ether1394_reset_priv (struct net_device *dev, int set_mtu)
int i;
struct eth1394_priv *priv = netdev_priv(dev);
struct hpsb_host *host = priv->host;
u64 guid = *((u64*)&(host->csr.rom->bus_info_data[3]));
u64 guid = get_unaligned((u64*)&(host->csr.rom->bus_info_data[3]));
u16 maxpayload = 1 << (host->csr.max_rec + 1);
int max_speed = IEEE1394_SPEED_MAX;

Expand All @@ -514,8 +515,8 @@ static void ether1394_reset_priv (struct net_device *dev, int set_mtu)
ETHER1394_GASP_OVERHEAD)));

/* Set our hardware address while we're at it */
*(u64*)dev->dev_addr = guid;
*(u64*)dev->broadcast = ~0x0ULL;
memcpy(dev->dev_addr, &guid, sizeof(u64));
memset(dev->broadcast, 0xff, sizeof(u64));
}

spin_unlock_irqrestore (&priv->lock, flags);
Expand Down Expand Up @@ -894,6 +895,7 @@ static inline u16 ether1394_parse_encap(struct sk_buff *skb,
u16 maxpayload;
struct eth1394_node_ref *node;
struct eth1394_node_info *node_info;
__be64 guid;

/* Sanity check. MacOSX seems to be sending us 131 in this
* field (atleast on my Panther G5). Not sure why. */
Expand All @@ -902,8 +904,9 @@ static inline u16 ether1394_parse_encap(struct sk_buff *skb,

maxpayload = min(eth1394_speedto_maxpayload[sspd], (u16)(1 << (max_rec + 1)));

guid = get_unaligned(&arp1394->s_uniq_id);
node = eth1394_find_node_guid(&priv->ip_node_list,
be64_to_cpu(arp1394->s_uniq_id));
be64_to_cpu(guid));
if (!node) {
return 0;
}
Expand Down Expand Up @@ -931,10 +934,9 @@ static inline u16 ether1394_parse_encap(struct sk_buff *skb,
arp_ptr += arp->ar_pln; /* skip over sender IP addr */

if (arp->ar_op == htons(ARPOP_REQUEST))
/* just set ARP req target unique ID to 0 */
*((u64*)arp_ptr) = 0;
memset(arp_ptr, 0, sizeof(u64));
else
*((u64*)arp_ptr) = *((u64*)dev->dev_addr);
memcpy(arp_ptr, dev->dev_addr, sizeof(u64));
}

/* Now add the ethernet header. */
Expand Down Expand Up @@ -1675,8 +1677,10 @@ static int ether1394_tx (struct sk_buff *skb, struct net_device *dev)
if (max_payload < dg_size + hdr_type_len[ETH1394_HDR_LF_UF])
priv->bc_dgl++;
} else {
__be64 guid = get_unaligned((u64 *)eth->h_dest);

node = eth1394_find_node_guid(&priv->ip_node_list,
be64_to_cpu(*(u64*)eth->h_dest));
be64_to_cpu(guid));
if (!node) {
ret = -EAGAIN;
goto fail;
Expand Down

0 comments on commit 429273a

Please sign in to comment.