diff options
author | Alexander Aring <alex.aring@gmail.com> | 2014-10-07 04:38:27 -0400 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2014-10-25 01:56:22 -0400 |
commit | 850f43acb1869edf2a8b355330819412066d6fa2 (patch) | |
tree | 668e5e840f1cc7c10423e70c785ad5e6036d1e43 /drivers/net/ieee802154 | |
parent | d06c21990fbbca644a31a3c851c22a8d1f5d0e66 (diff) |
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: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'drivers/net/ieee802154')
-rw-r--r-- | drivers/net/ieee802154/at86rf230.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/ieee802154/at86rf230.c b/drivers/net/ieee802154/at86rf230.c index 44d2f1de31e0..2a25324d3a64 100644 --- a/drivers/net/ieee802154/at86rf230.c +++ b/drivers/net/ieee802154/at86rf230.c | |||
@@ -89,6 +89,7 @@ struct at86rf230_local { | |||
89 | struct at86rf230_state_change irq; | 89 | struct at86rf230_state_change irq; |
90 | 90 | ||
91 | bool tx_aret; | 91 | bool tx_aret; |
92 | s8 max_frame_retries; | ||
92 | bool is_tx; | 93 | bool is_tx; |
93 | /* spinlock for is_tx protection */ | 94 | /* spinlock for is_tx protection */ |
94 | spinlock_t lock; | 95 | spinlock_t lock; |
@@ -1001,6 +1002,9 @@ at86rf230_xmit(struct ieee802154_dev *dev, struct sk_buff *skb) | |||
1001 | return -ETIMEDOUT; | 1002 | return -ETIMEDOUT; |
1002 | } | 1003 | } |
1003 | 1004 | ||
1005 | if (lp->max_frame_retries > 0) | ||
1006 | return 0; | ||
1007 | |||
1004 | /* Interfame spacing time, which is phy depend. | 1008 | /* Interfame spacing time, which is phy depend. |
1005 | * TODO | 1009 | * TODO |
1006 | * Move this handling in MAC 802.15.4 layer. | 1010 | * Move this handling in MAC 802.15.4 layer. |
@@ -1230,6 +1234,7 @@ at86rf230_set_frame_retries(struct ieee802154_dev *dev, s8 retries) | |||
1230 | return -EINVAL; | 1234 | return -EINVAL; |
1231 | 1235 | ||
1232 | lp->tx_aret = retries >= 0; | 1236 | lp->tx_aret = retries >= 0; |
1237 | lp->max_frame_retries = retries; | ||
1233 | 1238 | ||
1234 | if (retries >= 0) | 1239 | if (retries >= 0) |
1235 | rc = at86rf230_write_subreg(lp, SR_MAX_FRAME_RETRIES, retries); | 1240 | rc = at86rf230_write_subreg(lp, SR_MAX_FRAME_RETRIES, retries); |