[PATCH 2/3] set hardware MAC address to net_device

Denis Kirjanov kirjanov at gmail.com
Mon May 23 09:33:54 EDT 2011


Hm, what about endianness?


On Mon, May 23, 2011 at 5:22 PM, Dmitry Podgorny <pasis.ua at gmail.com> wrote:
> ---
>  src/pcnet.c |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/src/pcnet.c b/src/pcnet.c
> index 5b3d889..39a0d72 100644
> --- a/src/pcnet.c
> +++ b/src/pcnet.c
> @@ -241,6 +241,10 @@ static int __devinit pcnet_dummy_init_netdev(struct pci_dev *pdev,
>        pp->base = (void *)ioaddr;
>        spin_lock_init(&pp->lock);
>
> +       /* set hardware MAC address to net_device */
> +       *((unsigned long *)ndev->dev_addr) = ioread32((void *)ioaddr);
> +       *((u16 *)&ndev->dev_addr[4]) = ioread32((void *)(ioaddr + 4)) & 0xffff;
> +
>        /* init DMA rings */
>        /* init net_dev_ops */
>        /* FIXME:
> --
> 1.7.5.rc3
>
>
> _______________________________________________
> Kernel-russian mailing list
> Kernel-russian at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernel-russian
>



-- 
Regards,
Denis



More information about the Kernel-russian mailing list