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

Dmitry Podgorny pasis.ua at gmail.com
Mon May 23 09:46:01 EDT 2011


so, i've tested this patch on x86 and AMR (versatilepb). If i would have a
big endian architecture i receive reverse order of bytes? Does ntoh() solve
the problem? or what would you suggest?

2011/5/23 Denis Kirjanov <kirjanov at gmail.com>

> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernel-russian/attachments/20110523/bc09d824/attachment.html 


More information about the Kernel-russian mailing list