linux-wpan.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Aring <alex.aring@gmail.com>
To: Varka Bhadram <varkabhadram@gmail.com>
Cc: linux-wpan@vger.kernel.org, m.olbrich@pengutronix.de
Subject: Re: [PATCH bluetooth-next 3/9] at86rf230: correct aret lifs and sifs handling
Date: Tue, 7 Oct 2014 10:56:31 +0200	[thread overview]
Message-ID: <20141007085629.GA27930@omega> (raw)
In-Reply-To: <5433A9A0.5090407@gmail.com>

On Tue, Oct 07, 2014 at 02:21:44PM +0530, Varka Bhadram wrote:
> Hi Alex,
> 
> On 10/07/2014 02:08 PM, Alexander Aring wrote:
> 
> >This patch adds lifs/sifs handling only if max_frame_retries is above
> >zero. The at86rf2xx datasheets says nothing about phy lifs/sifs
> >handling. I asked the atmel support and they said lifs/sifs is done
> >by phy when max_frame_retries is above zero.
> >
> >Signed-off-by: Alexander Aring <alex.aring@gmail.com>
> >---
> >  drivers/net/ieee802154/at86rf230.c | 5 +++++
> >  1 file changed, 5 insertions(+)
> >
> >diff --git a/drivers/net/ieee802154/at86rf230.c b/drivers/net/ieee802154/at86rf230.c
> >index 44d2f1d..2a25324 100644
> >--- a/drivers/net/ieee802154/at86rf230.c
> >+++ b/drivers/net/ieee802154/at86rf230.c
> >@@ -89,6 +89,7 @@ struct at86rf230_local {
> >  	struct at86rf230_state_change irq;
> >  	bool tx_aret;
> >+	s8 max_frame_retries;
> 
> Why s8 here..? Is there any reason..
> 

yep.

> >  	bool is_tx;
> >  	/* spinlock for is_tx protection */
> >  	spinlock_t lock;
> >@@ -1001,6 +1002,9 @@ at86rf230_xmit(struct ieee802154_dev *dev, struct sk_buff *skb)
> >  		return -ETIMEDOUT;
> >  	}
> >+	if (lp->max_frame_retries > 0)
> >+		return 0;
> >+
> >  	/* Interfame spacing time, which is phy depend.
> >  	 * TODO
> >  	 * Move this handling in MAC 802.15.4 layer.
> >@@ -1230,6 +1234,7 @@ at86rf230_set_frame_retries(struct ieee802154_dev *dev, s8 retries)
> >  		return -EINVAL;
> >  	lp->tx_aret = retries >= 0;
> >+	lp->max_frame_retries = retries;

this parameter retries is s8. The value "-1" means no ARET handling here.

If you do now u8 at max_frame_retries, then we get a overflow by setting
"-1" here and have a invalid max_frame_retries setting of 255.

Then checking via:

if (lp->max_frame_retries > 0)

doesn't work.

- Alex

  reply	other threads:[~2014-10-07  8:56 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-07  8:38 [PATCH bluetooth-next 0/9] at86rf230: various fixes and cleanups Alexander Aring
2014-10-07  8:38 ` [PATCH bluetooth-next 1/9] at86rf230: fix errno on tx timeout handling Alexander Aring
2014-10-07  8:54   ` Varka Bhadram
2014-10-07  8:38 ` [PATCH bluetooth-next 2/9] at86rf230: add missing error handling Alexander Aring
2014-10-07  8:38 ` [PATCH bluetooth-next 3/9] at86rf230: correct aret lifs and sifs handling Alexander Aring
2014-10-07  8:51   ` Varka Bhadram
2014-10-07  8:56     ` Alexander Aring [this message]
2014-10-07  9:00       ` Varka Bhadram
2014-10-07  8:38 ` [PATCH bluetooth-next 4/9] at86rf230: correct at86rf2xx lifs timings Alexander Aring
2014-10-07  8:38 ` [PATCH bluetooth-next 5/9] at86rf230: squash unnecessary dereferencing Alexander Aring
2014-10-07  8:38 ` [PATCH bluetooth-next 6/9] at86rf230: add missing enable_irq Alexander Aring
2014-10-07  8:38 ` [PATCH bluetooth-next 7/9] at86rf230: fix race condition Alexander Aring
2014-10-07  8:38 ` [PATCH bluetooth-next 8/9] at86rf230: fix enable_irq handling on async spi Alexander Aring
2014-10-07  8:38 ` [PATCH bluetooth-next 9/9] at86rf230: remove unnecessary print of async error Alexander Aring
2014-10-07 11:16 ` [PATCH bluetooth-next 0/9] at86rf230: various fixes and cleanups Marcel Holtmann

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=20141007085629.GA27930@omega \
    --to=alex.aring@gmail.com \
    --cc=linux-wpan@vger.kernel.org \
    --cc=m.olbrich@pengutronix.de \
    --cc=varkabhadram@gmail.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).