Re: [Patch] Micrel KS8695 intergrated ethernet driver

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Ben Hutchings
Date: Friday, December 5, 2008 - 10:57 am

On Fri, 2008-12-05 at 15:06 +0000, Daniel Silverstone wrote:


netdev patches should really be based on David Miller's net-next-2.6.

[...]

The enumerators should be indented with tabs.


Which device object - the platform device?

[...]

Don't use ndev->priv, use netdev_priv(ndev).  Which makes this function
redundant, except for the implicit pointer conversion.

[...]

I take it that dma_map_single() can never fail on ARM?


You need a wmb() in here, otherwise the descriptor might not be complete
when the hardware sees RDES_OWN set.

[...]

rmb()


Clearing data_ptr seems redundant.  The TDES_OWN flag indicates whether
the descriptor is pending and the skb pointer indicates whether a buffer
needs to be freed.


Do you need to test all the descriptors or can you keep track of which
to check first and then stop when you find one still pending?  Maybe it
doesn't matter when you only have 8 of them...


rmb()


I think this line belongs after the following comment.


That's another expensive division.

[...]

Is there any reason this timeout should be tied to the TX watchdog
timeout?

[...]

The RX and TX IRQ handlers need to be released in case the TX or link
IRQ setup fails.



I think the TP and MII flags should be dependent on ksp->dtype.

[...]

You'd better implement these or return -EOPNOTSUPP.  Similarly in
ks8695_set_settings() and ks8695_nwayreset().

[...]

Yes, or return -EOPNOTSUPP.

[...]

It looks like this might lose multicast settings.


You must return NETDEV_TX_OK or NETDEV_TX_BUSY, not 0 or a negative
error code.


That's an expensive division, which could be avoided by either (1)
declaring buff_n unsigned or (2) explicitly masking.


Since you already tested tx_ring_used, wouldn't this indicate a bug?


wmb()

[...]
[...]

Don't bother setting base_addr and irq; they are for ancient ISA crap.


You should use net_device_ops now.


Use %pM to format a MAC address instead of %s and print_mac().


I don't think this reports anything!

[...]

Does this reinit the MAC address or multicast?

[...]

Ben.

-- 
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[Patch] Micrel KS8695 intergrated ethernet driver, Daniel Silverstone, (Fri Dec 5, 8:06 am)
Re: [Patch] Micrel KS8695 intergrated ethernet driver, Ben Hutchings, (Fri Dec 5, 10:57 am)
Re: [Patch] Micrel KS8695 intergrated ethernet driver, Daniel Silverstone, (Mon Dec 8, 4:05 am)
Re: [Patch] Micrel KS8695 intergrated ethernet driver, Daniel Silverstone, (Mon Dec 8, 6:08 am)
Re: [Patch] Micrel KS8695 intergrated ethernet driver, Ben Hutchings, (Mon Dec 8, 8:17 am)
Re: [Patch] Micrel KS8695 intergrated ethernet driver, David Miller, (Mon Dec 8, 1:29 pm)
Re: [Patch] Micrel KS8695 intergrated ethernet driver, Christoph Hellwig, (Tue Dec 9, 1:57 am)
Re: [Patch] Micrel KS8695 intergrated ethernet driver, David Miller, (Tue Dec 9, 2:05 am)
Re: [Patch] Micrel KS8695 intergrated ethernet driver, Daniel Silverstone, (Tue Dec 9, 2:29 am)
Re: [Patch] Micrel KS8695 intergrated ethernet driver, Daniel Silverstone, (Tue Dec 9, 10:00 am)
Re: [Patch] Micrel KS8695 intergrated ethernet driver, Kalle Valo, (Sat Dec 13, 12:07 pm)