From patchwork Mon Mar 14 20:46:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: web+oss@zopieux.com X-Patchwork-Id: 8583811 Return-Path: X-Original-To: patchwork-linux-wpan@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C27B99F758 for ; Mon, 14 Mar 2016 20:47:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 956E220154 for ; Mon, 14 Mar 2016 20:47:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EC01B20155 for ; Mon, 14 Mar 2016 20:47:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750741AbcCNUr0 (ORCPT ); Mon, 14 Mar 2016 16:47:26 -0400 Received: from r0.smtpout1.alwaysdata.com ([176.31.58.0]:33406 "EHLO r0.smtpout1.alwaysdata.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756132AbcCNUrZ (ORCPT ); Mon, 14 Mar 2016 16:47:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=alwaysdata.net; s=zopieux; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=+/NheM25gweWB6iRVvCqY94Yd3+qv21Gs5eRdJ32TLM=; b=tRP2iWeVWJn8e0DoBIizQKu5BXvfrPvTi5Su0pW0p95vCLgl4udy3eNkRNJdK7fIeSzedOgN4c1HeQO7PQp9cTRGYJu3H8Ib4GqMBwKwiUEP+/0NN5QnMleOvrPSpw3qtqLVNo49xbibR4uoEngpQcu1Pcnc5unBjtNP6LAhFdw=; Received: from agrenoble-651-1-452-143.w82-122.abo.wanadoo.fr ([82.122.156.143] helo=alex-arch-laptop.localdomain) by smtpout1.roubaix1.alwaysdata.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_CBC_SHA256:128) (Exim 4.84) (envelope-from ) id 1afZOb-00086z-LZ; Mon, 14 Mar 2016 21:47:21 +0100 From: Alexandre Macabies To: linux-wpan@vger.kernel.org Cc: Alexandre Macabies , Alexander Aring Subject: [PATCH v2 3/3] mrf24j40: apply the security-enabled bit on secured outbound frames Date: Mon, 14 Mar 2016 21:46:14 +0100 Message-Id: <1457988374-31220-3-git-send-email-web+oss@zopieux.com> X-Mailer: git-send-email 2.7.3 In-Reply-To: <1457988374-31220-1-git-send-email-web+oss@zopieux.com> References: <1457633643-12535-1-git-send-email-web+oss@zopieux.com> <1457988374-31220-1-git-send-email-web+oss@zopieux.com> X-alwaysdata-ID: 132956224 Sender: linux-wpan-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wpan@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We set the TXNSECEN bit of register TXNCON to on when transmitting a security-enabled frame, as described in section 3.12.2 of the MRF datasheet. Signed-off-by: Alexander Aring Signed-off-by: Alexandre Macabies Reviewed-by: Stefan Schmidt --- drivers/net/ieee802154/mrf24j40.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/ieee802154/mrf24j40.c b/drivers/net/ieee802154/mrf24j40.c index adc67be..f446db8 100644 --- a/drivers/net/ieee802154/mrf24j40.c +++ b/drivers/net/ieee802154/mrf24j40.c @@ -61,6 +61,7 @@ #define REG_TXBCON0 0x1A #define REG_TXNCON 0x1B /* Transmit Normal FIFO Control */ #define BIT_TXNTRIG BIT(0) +#define BIT_TXNSECEN BIT(1) #define BIT_TXNACKREQ BIT(2) #define REG_TXG1CON 0x1C @@ -551,6 +552,9 @@ static void write_tx_buf_complete(void *context) u8 val = BIT_TXNTRIG; int ret; + if (ieee802154_is_secen(fc)) + val |= BIT_TXNSECEN; + if (ieee802154_is_ackreq(fc)) val |= BIT_TXNACKREQ;