From: Alexander Aring <alex.aring@gmail.com>
To: linux-wpan@vger.kernel.org
Cc: kernel@pengutronix.de, Alexander Aring <alex.aring@gmail.com>
Subject: [PATCH wpan-next 2/6] at86rf230: move cal_timeout to state change
Date: Tue, 28 Apr 2015 23:22:30 +0200 [thread overview]
Message-ID: <1430256154-1813-3-git-send-email-alex.aring@gmail.com> (raw)
In-Reply-To: <1430256154-1813-1-git-send-email-alex.aring@gmail.com>
This patch moves the calculation timeout of TRX_OFF to RX_AACK_ON
handling to the async state change functionality. With this patch we can
do a reset of calculation timeout when others TRX_OFF to RX_AACK_ON
happens instead of doing this on interface up only.
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
---
drivers/net/ieee802154/at86rf230.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ieee802154/at86rf230.c b/drivers/net/ieee802154/at86rf230.c
index 9a41deb..6358788 100644
--- a/drivers/net/ieee802154/at86rf230.c
+++ b/drivers/net/ieee802154/at86rf230.c
@@ -611,6 +611,11 @@ at86rf230_async_state_delay(void *context)
switch (ctx->to_state) {
case STATE_RX_AACK_ON:
tim = ktime_set(0, c->t_off_to_aack * NSEC_PER_USEC);
+ /* state change from TRX_OFF to RX_AACK_ON to do a
+ * calibration, we need to reset the timeout for the
+ * next one.
+ */
+ lp->cal_timeout = jiffies + AT86RF2XX_CAL_LOOP_TIMEOUT;
goto change;
case STATE_TX_ON:
tim = ktime_set(0, c->t_off_to_tx_on * NSEC_PER_USEC);
@@ -1039,9 +1044,6 @@ at86rf230_ed(struct ieee802154_hw *hw, u8 *level)
static int
at86rf230_start(struct ieee802154_hw *hw)
{
- struct at86rf230_local *lp = hw->priv;
-
- lp->cal_timeout = jiffies + AT86RF2XX_CAL_LOOP_TIMEOUT;
return at86rf230_sync_state_change(hw->priv, STATE_RX_AACK_ON);
}
--
2.3.6
next prev parent reply other threads:[~2015-04-28 21:23 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-28 21:22 [PATCH wpan-next 0/6] at86rf230: cleanups and transmit improvements Alexander Aring
2015-04-28 21:22 ` [PATCH wpan-next 1/6] at86rf230: remove tabs after define Alexander Aring
2015-04-28 21:22 ` Alexander Aring [this message]
2015-04-28 21:22 ` [PATCH wpan-next 3/6] at86rf230: add TX_ARET_ON for calibration timeout Alexander Aring
2015-04-28 21:22 ` [PATCH wpan-next 4/6] at86rf230: remove unnecessary tx state change Alexander Aring
2015-04-28 21:22 ` [PATCH wpan-next 5/6] at86rf230: change state change if from trx_off Alexander Aring
2015-04-29 4:05 ` Varka Bhadram
2015-04-28 21:22 ` [PATCH wpan-next 6/6] at86rf230: add slp_tr support to start tx Alexander Aring
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=1430256154-1813-3-git-send-email-alex.aring@gmail.com \
--to=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