Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 850f43ac authored by Alexander Aring's avatar Alexander Aring Committed by Marcel Holtmann
Browse files

at86rf230: correct aret lifs and sifs handling



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: default avatarAlexander Aring <alex.aring@gmail.com>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent d06c2199
Loading
Loading
Loading
Loading
+5 −0
Original line number Original line Diff line number Diff line
@@ -89,6 +89,7 @@ struct at86rf230_local {
	struct at86rf230_state_change irq;
	struct at86rf230_state_change irq;


	bool tx_aret;
	bool tx_aret;
	s8 max_frame_retries;
	bool is_tx;
	bool is_tx;
	/* spinlock for is_tx protection */
	/* spinlock for is_tx protection */
	spinlock_t lock;
	spinlock_t lock;
@@ -1001,6 +1002,9 @@ at86rf230_xmit(struct ieee802154_dev *dev, struct sk_buff *skb)
		return -ETIMEDOUT;
		return -ETIMEDOUT;
	}
	}


	if (lp->max_frame_retries > 0)
		return 0;

	/* Interfame spacing time, which is phy depend.
	/* Interfame spacing time, which is phy depend.
	 * TODO
	 * TODO
	 * Move this handling in MAC 802.15.4 layer.
	 * 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;
		return -EINVAL;


	lp->tx_aret = retries >= 0;
	lp->tx_aret = retries >= 0;
	lp->max_frame_retries = retries;


	if (retries >= 0)
	if (retries >= 0)
		rc = at86rf230_write_subreg(lp, SR_MAX_FRAME_RETRIES, retries);
		rc = at86rf230_write_subreg(lp, SR_MAX_FRAME_RETRIES, retries);