X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fnet%2Fibmveth.c;h=4e4e8767881990872be7ec8cb3095826318ed9b5;hb=8924cb29b44d7e7bc69a58f6d196470a5bcd9385;hp=c3836f6de58c91f5330ca004e68238ab7bb278bc;hpb=86090fcac5e27b630656fe3d963a6b80e26dac44;p=linux-2.6.git diff --git a/drivers/net/ibmveth.c b/drivers/net/ibmveth.c index c3836f6de..4e4e87678 100644 --- a/drivers/net/ibmveth.c +++ b/drivers/net/ibmveth.c @@ -55,7 +55,6 @@ #include #include #include -#include #include #include "ibmveth.h" @@ -874,14 +873,14 @@ static int __devinit ibmveth_probe(struct vio_dev *dev, const struct vio_device_ struct net_device *netdev; struct ibmveth_adapter *adapter; - unsigned int *mac_addr_p; + unsigned char *mac_addr_p; unsigned int *mcastFilterSize_p; ibmveth_debug_printk_no_adapter("entering ibmveth_probe for UA 0x%x\n", dev->unit_address); - mac_addr_p = (unsigned int *) vio_get_attribute(dev, VETH_MAC_ADDR, 0); + mac_addr_p = (unsigned char *) vio_get_attribute(dev, VETH_MAC_ADDR, 0); if(!mac_addr_p) { ibmveth_error_printk("Can't find VETH_MAC_ADDR attribute\n"); return 0; @@ -916,8 +915,8 @@ static int __devinit ibmveth_probe(struct vio_dev *dev, const struct vio_device_ The RPA doc specifies that the first byte must be 10b, so we'll just look for it to solve this 8 vs. 6 byte field issue */ - while (*((char*)mac_addr_p) != (char)(0x02)) - ((char*)mac_addr_p)++; + if ((*mac_addr_p & 0x3) != 0x02) + mac_addr_p += 2; adapter->mac_addr = 0; memcpy(&adapter->mac_addr, mac_addr_p, 6); @@ -935,6 +934,7 @@ static int __devinit ibmveth_probe(struct vio_dev *dev, const struct vio_device_ netdev->do_ioctl = ibmveth_ioctl; netdev->ethtool_ops = &netdev_ethtool_ops; netdev->change_mtu = ibmveth_change_mtu; + SET_NETDEV_DEV(netdev, &dev->dev); memcpy(&netdev->dev_addr, &adapter->mac_addr, netdev->addr_len);