From: web+oss@zopieux.com
To: linux-wpan@vger.kernel.org
Cc: Alexandre Macabies <web+oss@zopieux.com>,
Alexander Aring <aar@pengutronix.de>
Subject: [PATCH 2/3] mrf24j40: fix security-enabled processing on inbound frames
Date: Thu, 10 Mar 2016 19:14:02 +0100 [thread overview]
Message-ID: <1457633643-12535-2-git-send-email-web+oss@zopieux.com> (raw)
In-Reply-To: <1457633643-12535-1-git-send-email-web+oss@zopieux.com>
From: Alexandre Macabies <web+oss@zopieux.com>
When receiving a security-enabled IEEE 802.15.4 frame, the MRF24J40
triggers a SECIF interrupt that needs to be handled for RX processing
to keep functioning properly.
This patch enables the SECIF interrupt and makes the MRF ignores all
hardware processing of security-enabled frames, that is handled by the
ieee802154 stack instead.
Signed-off-by: Alexander Aring <aar@pengutronix.de>
Reported-by: Alexandre Macabies <web+oss@zopieux.com>
Tested-by: Alexandre Macabies <web+oss@zopieux.com>
---
drivers/net/ieee802154/mrf24j40.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ieee802154/mrf24j40.c b/drivers/net/ieee802154/mrf24j40.c
index 764a2bd..96814cf 100644
--- a/drivers/net/ieee802154/mrf24j40.c
+++ b/drivers/net/ieee802154/mrf24j40.c
@@ -85,10 +85,12 @@
#define REG_INTSTAT 0x31 /* Interrupt Status */
#define BIT_TXNIF BIT(0)
#define BIT_RXIF BIT(3)
+#define BIT_SECIF BIT(4)
#define REG_INTCON 0x32 /* Interrupt Control */
#define BIT_TXNIE BIT(0)
#define BIT_RXIE BIT(3)
+#define BIT_SECIE BIT(4)
#define REG_GPIO 0x33 /* GPIO */
#define REG_TRISGPIO 0x34 /* GPIO direction */
@@ -616,7 +618,7 @@ static int mrf24j40_start(struct ieee802154_hw *hw)
/* Clear TXNIE and RXIE. Enable interrupts */
return regmap_update_bits(devrec->regmap_short, REG_INTCON,
- BIT_TXNIE | BIT_RXIE, 0);
+ BIT_TXNIE | BIT_RXIE | BIT_SECIE, 0);
}
static void mrf24j40_stop(struct ieee802154_hw *hw)
@@ -1025,6 +1027,9 @@ static void mrf24j40_intstat_complete(void *context)
enable_irq(devrec->spi->irq);
+ if (intstat & BIT_SECIF)
+ regmap_write_async(devrec->regmap_short, REG_SECCON0, 0x80);
+
/* Check for TX complete */
if (intstat & BIT_TXNIF)
ieee802154_xmit_complete(devrec->hw, devrec->tx_skb, false);
--
2.7.2
next prev parent reply other threads:[~2016-03-10 18:14 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-10 18:14 [PATCH 1/3] ieee802154: add security bit check function web+oss
2016-03-10 18:14 ` web+oss [this message]
2016-03-14 11:05 ` [PATCH 2/3] mrf24j40: fix security-enabled processing on inbound frames Stefan Schmidt
2016-03-10 18:14 ` [PATCH 3/3] mrf24j40: apply the security-enabled bit on secured outbound frames web+oss
2016-03-14 11:06 ` Stefan Schmidt
2016-03-14 11:03 ` [PATCH 1/3] ieee802154: add security bit check function Stefan Schmidt
2016-04-08 17:37 ` Marcel Holtmann
2016-03-14 20:46 ` [PATCH v2 " Alexandre Macabies
2016-03-14 20:46 ` [PATCH v2 2/3] mrf24j40: fix security-enabled processing on inbound frames Alexandre Macabies
2016-03-30 8:45 ` Stefan Schmidt
2016-03-14 20:46 ` [PATCH v2 3/3] mrf24j40: apply the security-enabled bit on secured outbound frames Alexandre Macabies
2016-03-30 8:45 ` Stefan Schmidt
2016-03-30 8:45 ` [PATCH v2 1/3] ieee802154: add security bit check function Stefan Schmidt
2016-03-30 14:05 ` Alan Ott
2016-03-30 16:43 ` Stefan Schmidt
2016-04-08 17:35 ` Marcel Holtmann
2016-04-12 16:53 ` [PATCH v3 " Alexandre Macabies
2016-04-12 16:53 ` [PATCH v3 2/3] mrf24j40: fix security-enabled processing on inbound frames Alexandre Macabies
2016-04-13 8:44 ` Marcel Holtmann
2016-04-12 16:53 ` [PATCH v3 3/3] mrf24j40: apply the security-enabled bit on secured outbound frames Alexandre Macabies
2016-04-13 8:44 ` Marcel Holtmann
2016-04-13 8:44 ` [PATCH v3 1/3] ieee802154: add security bit check function Marcel Holtmann
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=1457633643-12535-2-git-send-email-web+oss@zopieux.com \
--to=web+oss@zopieux.com \
--cc=aar@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.