From: Wolfgang Grandegger <wg@grandegger.com>
To: Masayuki Ohtake <masa-korg@dsn.okisemi.com>
Cc: Andrew Chih Howe <andrew.chih.howe.khor@intel.com>,
Samuel Ortiz <sameo@linux.intel.com>,
ML netdev <netdev@vger.kernel.org>,
gregkh@suse.de, "Wang, Yong Y" <yong.y.wang@intel.com>,
ML linux-kernel <linux-kernel@vger.kernel.org>,
socketcan-core@lists.berlios.de,
Morinaga <morinaga526@dsn.okisemi.com>,
arjan@linux.intel.com, "David S. Miller" <davem@davemloft.net>,
Christian Pellegrin <chripell@fsfe.org>, Qi <qi.wang@intel.com>
Subject: Re: [MeeGo-Dev][PATCH] Topcliff: Update PCH_CAN driver to 2.6.35
Date: Thu, 02 Sep 2010 08:32:44 +0200 [thread overview]
Message-ID: <4C7F450C.4010002@grandegger.com> (raw)
In-Reply-To: <001301cb4a4d$b4c4ba80$66f8800a@maildom.okisemi.com>
On 09/02/2010 05:19 AM, Masayuki Ohtake wrote:
> ----- Original Message -----
> From: "Wolfgang Grandegger" <wg@grandegger.com>
> To: "Masayuki Ohtake" <masa-korg@dsn.okisemi.com>
> Cc: "Andrew Chih Howe" <andrew.chih.howe.khor@intel.com>; "Qi" <qi.wang@intel.com>; "ML netdev"
> <netdev@vger.kernel.org>; <gregkh@suse.de>; "ML linux-kernel" <linux-kernel@vger.kernel.org>; "Wang, Yong Y"
> <yong.y.wang@intel.com>; <socketcan-core@lists.berlios.de>; <arjan@linux.intel.com>; "David S. Miller"
> <davem@davemloft.net>; "Christian Pellegrin" <chripell@fsfe.org>; "Samuel Ortiz" <sameo@linux.intel.com>
> Sent: Thursday, September 02, 2010 3:51 AM
> Subject: Re: [MeeGo-Dev][PATCH] Topcliff: Update PCH_CAN driver to 2.6.35
>
>> ...
>>>>>>> - The values for the hw-specific bit-timing registers should be derived
>>>>>>> from the calculated values in "priv->can.bittiming":
>>>>>>>
>>>>>>> http://lxr.linux.no/#linux+v2.6.35/include/linux/can/netlink.h#L17
>>>>>>>
>>>
>>> I show current pch_can code below.
>>>
>>> +static int pch_set_bittiming(struct net_device *ndev)
>>> +{
>>> + struct pch_can_priv *priv = netdev_priv(ndev);
>>> + struct pch_can_os *dev_can_os = priv->pch_can_os_p;
>>> + const struct can_bittiming *bt = &priv->can.bittiming;
>>>
>>> Is the above TRUE, isn't it ?
>>
>> The code fragment looks good. In that function you should then *derive*
>> the values of the bit-timing registers from the data fields of "bt". For
>> the SJA1000, you find the code here:
>>
>> http://lxr.linux.no/#linux+v2.6.35/drivers/net/can/sja1000/sja1000.c#L202
>>
>
> I can't understand the your saying.
> I think our can driver is implemented like your saying.
>
> In function "pch_set_bittiming", get the value of the bit-timing registers from
> the data fields of "bt" at "pch_can_set_baud_custom" or "pch_can_set_baud_simple".
Please *remove* "pch_can_set_baud_custom" or "pch_can_set_baud_simple"
and use the fields of "const struct can_bittiming *bt" *directly*:
/* Getting the appropriate register value. */
reg_val = (((bt->brp & MSK_BITT_BRP) << BIT_BITT_BRP) |
((bt->prop_seg + bt->phase_seg1 - 1) << BIT_BITT_TSEG1) |
...
> Could you indicate in more detail ?
Please have a closer look to the link mentioned above.
>>>>>>> - The driver should handle state changes and communicate them to the
>>>>>>> user space via error messages, if possible.
>>>>>>>
>>> What's "state chage" mean ?
>>
>> Googling for "can bis states" returned:
>>
>>
> http://www.softing.com/home/en/industrial-automation/products/can-bus/more-can-bus/error-handling/error-states.php?navanchor=3010510
>>
>> The CAN controller usually triggers an interrupt when the state changes,
>> which allows the driver to track the CAN state and deliver that
>> information to the user space.
>
> I could understand your saying.
> In our current code, our driver can detect state change, but doesn't notify to
> can-core module or kennel protocol stack.
> We will modify our driver to notify to these.
The code is your friend. Please have a more detailed look to the SJA1000
driver, e.g. search it for "state".
Wolfgang.
prev parent reply other threads:[~2010-09-02 6:32 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <4C61EDE5.4030505@dsn.okisemi.com>
[not found] ` <4C62981B.8050402@grandegger.com>
[not found] ` <D5AB6E638E5A3E4B8F4406B113A5A19A28EA26CC@shsmsx501.ccr.corp.intel.com>
[not found] ` <4C63B6C9.5050804@grandegger.com>
[not found] ` <D5AB6E638E5A3E4B8F4406B113A5A19A28EA29DF@shsmsx501.ccr.corp.intel.com>
2010-09-01 7:45 ` [MeeGo-Dev][PATCH] Topcliff: Update PCH_CAN driver to 2.6.35 Masayuki Ohtake
2010-09-01 17:04 ` out-of-order tx objects - was " Oliver Hartkopp
2010-09-01 18:51 ` Wolfgang Grandegger
2010-09-02 3:19 ` Masayuki Ohtake
2010-09-02 6:32 ` Wolfgang Grandegger [this message]
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=4C7F450C.4010002@grandegger.com \
--to=wg@grandegger.com \
--cc=andrew.chih.howe.khor@intel.com \
--cc=arjan@linux.intel.com \
--cc=chripell@fsfe.org \
--cc=davem@davemloft.net \
--cc=gregkh@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=masa-korg@dsn.okisemi.com \
--cc=morinaga526@dsn.okisemi.com \
--cc=netdev@vger.kernel.org \
--cc=qi.wang@intel.com \
--cc=sameo@linux.intel.com \
--cc=socketcan-core@lists.berlios.de \
--cc=yong.y.wang@intel.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