From: Eric Lapuyade <eric.lapuyade@linux.intel.com>
To: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com>
Cc: eric.lapuyade@intel.com, linux-wireless@vger.kernel.org,
linux-nfc@lists.01.org
Subject: Re: [linux-nfc] [PATCH 1/2] NFC: Remove crc generation from shdlc layer
Date: Fri, 07 Sep 2012 10:08:28 +0200 [thread overview]
Message-ID: <5049AB7C.1020103@linux.intel.com> (raw)
In-Reply-To: <5048C901.5010704@linux.intel.com>
On 09/06/2012 06:02 PM, Eric Lapuyade wrote:
> Hi Waldemar,
>
> On 09/06/2012 12:22 PM, Waldemar Rymarkiewicz wrote:
>> /* Largest headroom needed for outgoing custom commands */
>> #define PN544_CMDS_HEADROOM 2
>> +#define PN544_CMDS_TAILROOM 2
As a side effect of my comment on the second patch, this should be
defined like this:
#define PN544_CMDS_HEADROOM 2
+#define PN544_FRAME_HEADROOM 1
+#define PN544_FRAME_TAILROOM 2
>> static int pn544_hci_xmit(struct nfc_shdlc *shdlc, struct sk_buff *skb)
>> {
>> struct pn544_hci_info *info = nfc_shdlc_get_clientdata(shdlc);
>> @@ -584,6 +599,8 @@ static int pn544_hci_xmit(struct nfc_shdlc
*shdlc, struct sk_buff *skb)
>> if (info->hard_fault != 0)
>> return info->hard_fault;
>>
>> + pn544_hci_add_len_crc(skb);
>> +
>> return pn544_hci_i2c_write(client, skb->data, skb->len);
Here, we would have:
r = pn544_hci_i2c_write(client, skb->data, skb->len);
pn544_hci_remove_len_crc(skb);
return r;
>> info->shdlc = nfc_shdlc_allocate(&pn544_shdlc_ops,
>> &init_data, protocols,
>> - PN544_CMDS_HEADROOM, 0,
>> + PN544_CMDS_HEADROOM, PN544_CMDS_TAILROOM,
>> PN544_HCI_LLC_MAX_PAYLOAD,
>> dev_name(&client->dev));
And this should be:
info->shdlc = nfc_shdlc_allocate(&pn544_shdlc_ops,
&init_data, protocols,
PN544_CMDS_HEADROOM +
PN544_FRAME_HEADROOM,
PN544_FRAME_TAILROOM,
PN544_HCI_LLC_MAX_PAYLOAD,
dev_name(&client->dev));
note that PN544_CMDS_HEADROOM is really only for skb allocated by HCI
(or NFC Core), not by those allocated by shdlc, but we aggregate it all
in a single parameter for simplicity.
Eric
next prev parent reply other threads:[~2012-09-07 8:08 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-06 10:22 [PATCH 1/2] NFC: Remove crc generation from shdlc layer Waldemar Rymarkiewicz
2012-09-06 10:22 ` [PATCH 2/2] NFC: Correct outgoing frame before requeueing Waldemar Rymarkiewicz
2012-09-06 16:17 ` [linux-nfc] " Eric Lapuyade
2012-09-07 6:38 ` Rymarkiewicz Waldemar
2012-09-07 7:43 ` Eric Lapuyade
2012-09-07 8:08 ` Rymarkiewicz Waldemar
2012-09-06 16:02 ` [linux-nfc] [PATCH 1/2] NFC: Remove crc generation from shdlc layer Eric Lapuyade
2012-09-07 8:08 ` Eric Lapuyade [this message]
2012-09-07 8:11 ` Rymarkiewicz Waldemar
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=5049AB7C.1020103@linux.intel.com \
--to=eric.lapuyade@linux.intel.com \
--cc=eric.lapuyade@intel.com \
--cc=linux-nfc@lists.01.org \
--cc=linux-wireless@vger.kernel.org \
--cc=waldemar.rymarkiewicz@tieto.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).