netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kurt Van Dijck <kurt.van.dijck-/BeEPy95v10@public.gmane.org>
To: Wolfgang Grandegger <wg-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
Cc: socketcan-core-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org,
	netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH net-next-2.6 v2 1/2] can: add driver for Softing card
Date: Mon, 10 Jan 2011 14:31:12 +0100	[thread overview]
Message-ID: <20110110133112.GA324@e-circ.dyndns.org> (raw)
In-Reply-To: <4D24DB2C.9040104-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>

Wolfgang,

A few thoughts ...

On Wed, Jan 05, 2011 at 09:57:16PM +0100, Wolfgang Grandegger wrote:
> >  
> >  obj-y				+= usb/
> > +obj-y				+= softing/
> 
> Please use "obj-$(CONFIG_CAN_SOFTING)" here.
As I explained, softing does not depend on softing_cs or vice versa,
which makes "obj-$(CONFIG_CAN_SOFTING)" not right.

> > +	if (type != 0xffff) {
> > +		dev_alert(&card->pdev->dev, "firware starts with type 0x%04x\n",
> 
> Typo?
> 
??

> > +
> > +int softing_default_output(struct net_device *netdev)
> > +{
> > +	struct softing_priv *priv = netdev_priv(netdev);
> > +	struct softing *card = priv->card;
> > +
> > +	switch (priv->chip) {
> > +	case 1000:
> > +		if (card->pdat->generation < 2)
> > +			return 0xfb;
> > +		return 0xfa;
> > +	case 5:
> > +		return 0x60;
> > +	default:
> > +		return 0x40;
> > +	}
> > +}
> 
> Again, some magic constants.
The thing is, I didn't create those number, nor do I precisely know
which are the right ones, or how I would name those.
Since they're used one, I tought this would work.
> 
> > +	ret = netif_rx(skb);
> > +	if (ret == NET_RX_DROP)
> > +		++netdev->stats.rx_dropped;
> 
> Hm, I wonder if all Socket-CAN drivers should handle the return value of
> netif_rx that way?
> 
No, they should not.
After a seconds look, I'm a tiny little bit wrong here.
I should only increment rx_dropped when it's a real received message,
and not a virtual constructed one (bus crtls).
I moved this thing to the rx data handler.
Maybe, a common CAN rx function is usefull to properly deal with
the can_echo_skb & friends.

> 
> > +	priv->can.ctrlmode_supported =
> > +		CAN_CTRLMODE_3_SAMPLES;/* | CAN_CTRLMODE_BERR_REPORTING */;
> 
> Hm, any chance to support CAN_CTRLMODE_BERR_REPORTING? If not, please
> remove the comment.

I think I better try to write it properly without, and add error reporting
later, after serious testing of the error reporting on a softing card.

The primary goal now is get this driver in mainline kernel since PCMCIA
has been changing recently, and I found it hard to keep up. So, first things
first ...


Kurt

  parent reply	other threads:[~2011-01-10 13:31 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-04 15:05 [PATCH net-next-2.6 v2 0/2] can: add driver for Softing card Kurt Van Dijck
     [not found] ` <20110104150513.GA321-MxZ6Iy/zr/UdbCeoMzGj59i2O/JbrIOy@public.gmane.org>
2011-01-04 15:07   ` [PATCH net-next-2.6 v2 1/2] " Kurt Van Dijck
     [not found]     ` <20110104150759.GB321-MxZ6Iy/zr/UdbCeoMzGj59i2O/JbrIOy@public.gmane.org>
2011-01-05 20:57       ` Wolfgang Grandegger
2011-01-06 15:05         ` Kurt Van Dijck
     [not found]           ` <20110106150525.GB324-MxZ6Iy/zr/UdbCeoMzGj59i2O/JbrIOy@public.gmane.org>
2011-01-06 16:27             ` Wolfgang Grandegger
     [not found]               ` <4D25ED70.7000303-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
2011-01-07 12:29                 ` Kurt Van Dijck
     [not found]         ` <4D24DB2C.9040104-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
2011-01-10 13:31           ` Kurt Van Dijck [this message]
     [not found]             ` <20110110133112.GA324-MxZ6Iy/zr/UdbCeoMzGj59i2O/JbrIOy@public.gmane.org>
2011-01-10 13:40               ` Wolfram Sang
     [not found]                 ` <20110110134006.GC31011-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2011-01-10 13:44                   ` Kurt Van Dijck
2011-01-10 14:05             ` Wolfgang Grandegger
     [not found]               ` <4D2B1245.9060303-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
2011-01-10 14:07                 ` Wolfgang Grandegger
2011-01-10 14:40                 ` Kurt Van Dijck
2011-01-04 15:09 ` [PATCH net-next-2.6 v2 2/2] " Kurt Van Dijck
     [not found]   ` <20110104150923.GC321-MxZ6Iy/zr/UdbCeoMzGj59i2O/JbrIOy@public.gmane.org>
2011-01-05 21:02     ` Wolfgang Grandegger
     [not found]       ` <4D24DC58.7090009-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
2011-01-06  6:26         ` Kurt Van Dijck

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=20110110133112.GA324@e-circ.dyndns.org \
    --to=kurt.van.dijck-/beepy95v10@public.gmane.org \
    --cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=socketcan-core-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org \
    --cc=wg-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org \
    /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).