aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ieee802154
diff options
context:
space:
mode:
authorAlan Ott <alan@signal11.us>2013-04-05 06:34:51 -0400
committerDavid S. Miller <davem@davemloft.net>2013-04-08 12:09:18 -0400
commitcbde8123f6c18f34781de3a5095fb58e951326f4 (patch)
treee206581ecd6f598bc7645f33ae0e0c4969176cb2 /drivers/net/ieee802154
parentc17277f7d7c502afe1062587913d47881ba0f116 (diff)
mrf24j40: Enable link-layer acknowledgement and retry
On the MRF24J40, link-layer acknowledgment request and retry must be turned on explicitly for each packet. Turn this on in the hardware based on the FC_ACK_REQ bit being set in the packet. Also, now that failure to receive an ACK will cause the hardware to report failure of transmission, change the log level for this failure to debug level. Signed-off-by: Alan Ott <alan@signal11.us> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ieee802154')
-rw-r--r--drivers/net/ieee802154/mrf24j40.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/net/ieee802154/mrf24j40.c b/drivers/net/ieee802154/mrf24j40.c
index ca0035116a18..3d3c529e76ec 100644
--- a/drivers/net/ieee802154/mrf24j40.c
+++ b/drivers/net/ieee802154/mrf24j40.c
@@ -25,6 +25,7 @@
25#include <linux/pinctrl/consumer.h> 25#include <linux/pinctrl/consumer.h>
26#include <net/wpan-phy.h> 26#include <net/wpan-phy.h>
27#include <net/mac802154.h> 27#include <net/mac802154.h>
28#include <net/ieee802154.h>
28 29
29/* MRF24J40 Short Address Registers */ 30/* MRF24J40 Short Address Registers */
30#define REG_RXMCR 0x00 /* Receive MAC control */ 31#define REG_RXMCR 0x00 /* Receive MAC control */
@@ -349,7 +350,9 @@ static int mrf24j40_tx(struct ieee802154_dev *dev, struct sk_buff *skb)
349 if (ret) 350 if (ret)
350 goto err; 351 goto err;
351 val |= 0x1; 352 val |= 0x1;
352 val &= ~0x4; 353 /* Set TXNACKREQ if the ACK bit is set in the packet. */
354 if (skb->data[0] & IEEE802154_FC_ACK_REQ)
355 val |= 0x4;
353 write_short_reg(devrec, REG_TXNCON, val); 356 write_short_reg(devrec, REG_TXNCON, val);
354 357
355 INIT_COMPLETION(devrec->tx_complete); 358 INIT_COMPLETION(devrec->tx_complete);
@@ -371,7 +374,7 @@ static int mrf24j40_tx(struct ieee802154_dev *dev, struct sk_buff *skb)
371 if (ret) 374 if (ret)
372 goto err; 375 goto err;
373 if (val & 0x1) { 376 if (val & 0x1) {
374 dev_err(printdev(devrec), "Error Sending. Retry count exceeded\n"); 377 dev_dbg(printdev(devrec), "Error Sending. Retry count exceeded\n");
375 ret = -ECOMM; /* TODO: Better error code ? */ 378 ret = -ECOMM; /* TODO: Better error code ? */
376 } else 379 } else
377 dev_dbg(printdev(devrec), "Packet Sent\n"); 380 dev_dbg(printdev(devrec), "Packet Sent\n");