Linux IEEE 802.15.4 and 6LoWPAN development
 help / color / mirror / Atom feed
From: Stefan Schmidt <stefan@osg.samsung.com>
To: Alexander Aring <alex.aring@gmail.com>, linux-wpan@vger.kernel.org
Cc: kernel@pengutronix.de
Subject: Re: [RFCv5 bluetooth-next 3/4] at86rf230: use STATE_TX_ARET mode only
Date: Thu, 6 Aug 2015 19:37:05 +0200	[thread overview]
Message-ID: <55C39B41.6070105@osg.samsung.com> (raw)
In-Reply-To: <1438846116-4787-4-git-send-email-alex.aring@gmail.com>

Hello.

On 06/08/15 09:28, Alexander Aring wrote:
> This patch changes the state change behaviour of at86rf230 to always
> TX_ARET mode. According the at86rf2xx datasheets TX_ARET mode doesn't
> mean to be always waiting for ack frames after transmit. The transceiver
> will automatically wait for ack frames or not if the acknowledge request
> bit is set. See section "TX_ARET_ON – Transmit with Automatic Frame
> Retransmission and CSMA-CA Retry".
>
> Signed-off-by: Alexander Aring <alex.aring@gmail.com>
> ---
>   drivers/net/ieee802154/at86rf230.c | 52 ++++++++++----------------------------
>   1 file changed, 14 insertions(+), 38 deletions(-)
>
> diff --git a/drivers/net/ieee802154/at86rf230.c b/drivers/net/ieee802154/at86rf230.c
> index d0d5bf6..6422caa 100644
> --- a/drivers/net/ieee802154/at86rf230.c
> +++ b/drivers/net/ieee802154/at86rf230.c
> @@ -97,9 +97,7 @@ struct at86rf230_local {
>   
>   	struct at86rf230_state_change irq;
>   
> -	bool tx_aret;
>   	unsigned long cal_timeout;
> -	s8 max_frame_retries;
>   	bool is_tx;
>   	bool is_tx_from_off;
>   	u8 tx_retry;
> @@ -651,7 +649,7 @@ at86rf230_tx_complete(void *context)
>   
>   	enable_irq(ctx->irq);
>   
> -	ieee802154_xmit_complete(lp->hw, lp->tx_skb, !lp->tx_aret);
> +	ieee802154_xmit_complete(lp->hw, lp->tx_skb, false);
>   }
>   
>   static void
> @@ -760,17 +758,10 @@ at86rf230_irq_trx_end(struct at86rf230_local *lp)
>   {
>   	if (lp->is_tx) {
>   		lp->is_tx = 0;
> -
> -		if (lp->tx_aret)
> -			at86rf230_async_state_change(lp, &lp->irq,
> -						     STATE_FORCE_TX_ON,
> -						     at86rf230_tx_trac_status,
> -						     true);
> -		else
> -			at86rf230_async_state_change(lp, &lp->irq,
> -						     STATE_RX_AACK_ON,
> -						     at86rf230_tx_complete,
> -						     true);
> +		at86rf230_async_state_change(lp, &lp->irq,
> +					     STATE_FORCE_TX_ON,
> +					     at86rf230_tx_trac_status,
> +					     true);
>   	} else {
>   		at86rf230_async_read_reg(lp, RG_TRX_STATE, &lp->irq,
>   					 at86rf230_rx_trac_check, true);
> @@ -876,24 +867,16 @@ at86rf230_xmit_start(void *context)
>   	struct at86rf230_state_change *ctx = context;
>   	struct at86rf230_local *lp = ctx->lp;
>   
> -	/* In ARET mode we need to go into STATE_TX_ARET_ON after we
> -	 * are in STATE_TX_ON. The pfad differs here, so we change
> -	 * the complete handler.
> -	 */
> -	if (lp->tx_aret) {
> -		if (lp->is_tx_from_off) {
> -			lp->is_tx_from_off = false;
> -			at86rf230_async_state_change(lp, ctx, STATE_TX_ARET_ON,
> -						     at86rf230_write_frame,
> -						     false);
> -		} else {
> -			at86rf230_async_state_change(lp, ctx, STATE_TX_ON,
> -						     at86rf230_xmit_tx_on,
> -						     false);
> -		}
> +	/* check if we change from off state */
> +	if (lp->is_tx_from_off) {
> +		lp->is_tx_from_off = false;
> +		at86rf230_async_state_change(lp, ctx, STATE_TX_ARET_ON,
> +					     at86rf230_write_frame,
> +					     false);
>   	} else {
>   		at86rf230_async_state_change(lp, ctx, STATE_TX_ON,
> -					     at86rf230_write_frame, false);
> +					     at86rf230_xmit_tx_on,
> +					     false);
>   	}
>   }
>   
> @@ -1267,15 +1250,8 @@ static int
>   at86rf230_set_frame_retries(struct ieee802154_hw *hw, s8 retries)
>   {
>   	struct at86rf230_local *lp = hw->priv;
> -	int rc = 0;
> -
> -	lp->tx_aret = retries >= 0;
> -	lp->max_frame_retries = retries;
>   
> -	if (retries >= 0)
> -		rc = at86rf230_write_subreg(lp, SR_MAX_FRAME_RETRIES, retries);
> -
> -	return rc;
> +	return at86rf230_write_subreg(lp, SR_MAX_FRAME_RETRIES, retries);
>   }
>   
>   static int

Reviewed-by: Stefan Schmidt<stefan@osg.samsung.com>

regards
Stefan Schmidt



  reply	other threads:[~2015-08-06 17:37 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-06  7:28 [RFCv5 bluetooth-next 0/4] ieee802154: aret handling changes Alexander Aring
2015-08-06  7:28 ` [RFCv5 bluetooth-next 1/4] mac802154: cfg: remove test and set checks Alexander Aring
2015-08-06  7:28 ` [RFCv5 bluetooth-next 2/4] mac802154: change frame_retries behaviour Alexander Aring
2015-08-06 17:37   ` Stefan Schmidt
2015-08-06  7:28 ` [RFCv5 bluetooth-next 3/4] at86rf230: use STATE_TX_ARET mode only Alexander Aring
2015-08-06 17:37   ` Stefan Schmidt [this message]
2015-08-06  7:28 ` [RFCv5 bluetooth-next 4/4] ieee802154: add ack request default handling Alexander Aring
2015-08-06 17:37   ` Stefan Schmidt
2015-08-07  6:43     ` Alexander Aring
2015-08-07  7:42       ` Stefan Schmidt

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=55C39B41.6070105@osg.samsung.com \
    --to=stefan@osg.samsung.com \
    --cc=alex.aring@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-wpan@vger.kernel.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