Re: [PATCH]: Third (final?) release of Sun Neptune driver

David Miller
2007-10-05T23:27:56Z

From: Stephen Hemminger <shemminger@linux-foundation.org>
Date: Fri, 5 Oct 2007 08:35:56 -0700

> > +static int niu_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
> > +{
> > + return -EINVAL;
> > +}
>
> Why not leave function ptr null and get "-EOPNOTSUPP"

To be honest, it's there mostly to remind me that I need to implement
this routine :-)

> > + spin_lock_irqsave(&np->lock, flags);
> > + niu_enable_interrupts(np, 0);
> > + spin_unlock_irqrestore(&np->lock, flags);
> > +
> > + netif_device_detach(dev);
>
> No need to drop lock for detach? all it does is call stop_queue()

I think I'm just being paranoid here, I think it's fine either
way.

> > +static void *niu_phys_alloc_coherent(struct device *dev, size_t size,
> > + u64 *dma_addr, gfp_t flag)
> > +{
> > + unsigned long order = get_order(size);
> > + unsigned long page = __get_free_pages(flag, order);
> > +
> > + if (page == 0UL)
> > + return NULL;
> > + memset((char *)page, 0, PAGE_SIZE << order);
> > + *dma_addr = __pa(page);
> > +
> > + return (void *) page;
> > +}
>
> Generic cod useful for other drivers??

Quite possibly, once we have something else that wants this
we can split it out into some generic place. Currently I am
unaware of any such in-tree cases.

Thanks.