From: Eric Dumazet <dada1@cosmosbay.com>
To: Ilya Yanok <yanok@emcraft.com>
Cc: linux-arm-kernel@lists.arm.linux.org.uk, netdev@vger.kernel.org,
s.hauer@pengutronix.de, wd@denx.de, dzu@denx.de
Subject: Re: [PATCH] dnet: Dave DNET ethernet controller driver
Date: Wed, 11 Mar 2009 05:00:58 +0100 [thread overview]
Message-ID: <49B7377A.2070006@cosmosbay.com> (raw)
In-Reply-To: <1236738549-16703-1-git-send-email-yanok@emcraft.com>
Ilya Yanok a écrit :
> Driver for Dave DNET ethernet controller found on Dave/DENX QongEVB-LITE
> FPGA. Heavily based on Dave sources, I've just adopted it to current
> kernel version and done some code cleanup.
>
> Signed-off-by: Ilya Yanok <yanok@emcraft.com>
> + skb = dev_alloc_skb(pkt_len + 5);
> + if (skb != NULL) {
> + skb->dev = dev;
minor nit : This is not necessary anymore
eth_type_trans(skb, dev) does the skb->dev = dev; initialization
in recent kernels.
commit 4c13eb6657fe9ef7b4dc8f1a405c902e9e5234e0
Author: Arnaldo Carvalho de Melo <acme@redhat.com>
Date: Wed Apr 25 17:40:23 2007 -0700
[ETH]: Make eth_type_trans set skb->dev like the other *_type_trans
One less thing for drivers writers to worry about.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
> + /* Align IP on 16 byte boundaries */
> + skb_reserve(skb, 2);
> + /*
> + * 'skb_put()' points to the start of sk_buff
> + * data area.
> + */
> + data_ptr = (unsigned int *)skb_put(skb, pkt_len);
> + for (i = 0; i < (pkt_len + 3) >> 2; i++)
> + *data_ptr++ = dnet_readl(bp, RX_DATA_FIFO);
> + skb->protocol = eth_type_trans(skb, dev);
> + netif_receive_skb(skb);
> + bp->dev->last_rx = jiffies;
This last_rx init is not anymore needed :
commit babcda74e9d96bb58fd9c6c5112dbdbff169e695
Author: David S. Miller <davem@davemloft.net>
Date: Mon Nov 3 21:11:17 2008 -0800
drivers/net: Kill now superfluous ->last_rx stores.
The generic packet receive code takes care of setting
netdev->last_rx when necessary, for the sake of the
bonding ARP monitor.
Drivers need not do it any more.
Some cases had to be skipped over because the drivers
were making use of the ->last_rx value themselves.
Signed-off-by: David S. Miller <davem@davemloft.net>
> + npackets++;
> + } else
> + printk(KERN_NOTICE
> + "%s: No memory to allocate a sk_buff of "
> + "size %d.\n", dev->name, pkt_len);
pkt_len is an "unsigned int", so please use %u
> + }
> +
+static struct ethtool_ops dnet_ethtool_ops = {
+ .get_settings = dnet_get_settings,
+ .set_settings = dnet_set_settings,
+ .get_drvinfo = dnet_get_drvinfo,
+ .get_link = ethtool_op_get_link,
+};
+
Please add a const qualifier to this.
struct dnet {
+ void __iomem *regs;
+ spinlock_t lock;
+ struct platform_device *pdev;
+ struct net_device *dev;
+ struct net_device_stats stats;
+ struct dnet_stats hw_stats;
+ unsigned int capabilities; /* read from FPGA */
+ struct napi_struct napi;
Are you sure you need a "struct net_device_stats stats;" in "struct dnet" ?
One is already included in "struct net_device", you probably can use it.
Thank you
next prev parent reply other threads:[~2009-03-11 4:01 UTC|newest]
Thread overview: 58+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-11 2:29 [PATCH] dnet: Dave DNET ethernet controller driver Ilya Yanok
2009-03-11 4:00 ` Eric Dumazet [this message]
2009-03-11 23:33 ` [PATCH] dnet: Dave DNET ethernet controller driver (updated) Ilya Yanok
2009-03-12 6:29 ` David Miller
2009-03-11 4:18 ` [PATCH] dnet: Dave DNET ethernet controller driver Stephen Hemminger
2009-03-11 8:44 ` Sascha Hauer
2009-03-11 8:49 ` David Miller
2009-03-11 8:57 ` Sascha Hauer
2009-03-11 9:09 ` Wolfgang Denk
2009-03-11 10:35 ` Sascha Hauer
2009-03-11 13:23 ` David Miller
2009-03-11 14:00 ` Dan Williams
2009-03-11 18:23 ` Robert Schwebel
2009-03-11 19:15 ` Riku Voipio
2009-03-12 0:44 ` David Miller
2009-03-11 20:56 ` Christer Weinigel
2009-03-11 21:33 ` Russell King - ARM Linux
2009-03-12 0:13 ` Stephen Hemminger
2009-03-12 10:41 ` Christer Weinigel
2009-03-12 12:55 ` David Miller
2009-03-12 14:21 ` Christer Weinigel
2009-03-12 14:34 ` Sascha Hauer
2009-03-12 15:01 ` David Miller
2009-03-12 15:12 ` Neil Horman
2009-03-12 16:25 ` Christer Weinigel
2009-03-12 17:43 ` David Miller
2009-03-12 17:52 ` Christer Weinigel
2009-03-12 18:06 ` Jamie Lokier
2009-03-12 18:39 ` Dan Williams
2009-03-12 18:48 ` Christer Weinigel
2009-03-12 19:04 ` Sascha Hauer
2009-03-12 19:15 ` Jamie Lokier
2009-03-12 19:16 ` Neil Horman
2009-03-12 19:21 ` Christer Weinigel
2009-03-12 20:14 ` Wolfgang Denk
2009-03-12 20:27 ` Sascha Hauer
2009-03-12 20:35 ` Russell King - ARM Linux
2009-03-12 17:49 ` Neil Horman
2009-03-12 18:25 ` Christer Weinigel
2009-03-12 19:05 ` Neil Horman
2009-03-12 19:14 ` Sascha Hauer
2009-03-12 19:29 ` Christer Weinigel
2009-03-12 21:59 ` Jamie Lokier
2009-03-12 23:42 ` Christer Weinigel
2009-03-13 0:21 ` Neil Horman
2009-03-13 1:29 ` Christer Weinigel
2009-03-13 10:30 ` Neil Horman
2009-03-13 0:16 ` Neil Horman
2009-03-12 19:25 ` Jamie Lokier
2009-03-12 19:43 ` Christer Weinigel
2009-03-12 20:24 ` Mike (mwester)
2009-03-13 0:29 ` Neil Horman
2009-03-12 13:41 ` Michael Cashwell
2009-03-12 14:05 ` David Miller
2009-03-12 14:26 ` Neil Horman
2009-03-12 18:02 ` Jamie Lokier
2009-03-13 19:49 ` Robert Schwebel
2009-03-13 20:12 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=49B7377A.2070006@cosmosbay.com \
--to=dada1@cosmosbay.com \
--cc=dzu@denx.de \
--cc=linux-arm-kernel@lists.arm.linux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=s.hauer@pengutronix.de \
--cc=wd@denx.de \
--cc=yanok@emcraft.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).