From patchwork Tue Apr 12 16:53:02 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: 8812741 Return-Path: X-Original-To: patchwork-linux-wpan@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 42065C0553 for ; Tue, 12 Apr 2016 16:53:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5B4EA2034C for ; Tue, 12 Apr 2016 16:53:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CEBA820320 for ; Tue, 12 Apr 2016 16:53:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933260AbcDLQxm (ORCPT ); Tue, 12 Apr 2016 12:53:42 -0400 Received: from r0.smtpout1.alwaysdata.com ([176.31.58.0]:56641 "EHLO r0.smtpout1.alwaysdata.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933074AbcDLQxl (ORCPT ); Tue, 12 Apr 2016 12:53:41 -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=0opT9rE9blLC5z1KIO4rYgaBKJZJac40LfGXx4HtVwM=; b=dHQIYEwH3mb6y4mDWW/24lg8feRXVahOgP4qDU69RfqBtKLfRLjGYQicPKA+3nW1gExvTGEB258TlgTbORS0beAjeCRRar2GaJJTWu2PYGguixB6taskIsMvUbIf/bxNVLDjGCoOXCtXhFJ3CpbUQdOmYd/gJnltksejAT+cpiU=; Received: from [2a01:cb15:82ab:3a00:290:f5ff:fecd:4ad7] (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 1aq1ZH-0002qA-92; Tue, 12 Apr 2016 18:53:35 +0200 From: Alexandre Macabies To: linux-wpan@vger.kernel.org Cc: marcel@holtmann.org, Alexandre Macabies , Alexander Aring Subject: [PATCH v3 3/3] mrf24j40: apply the security-enabled bit on secured outbound frames Date: Tue, 12 Apr 2016 18:53:02 +0200 Message-Id: <1460479982-4955-3-git-send-email-web+oss@zopieux.com> X-Mailer: git-send-email 2.8.0 In-Reply-To: <1460479982-4955-1-git-send-email-web+oss@zopieux.com> References: <1457988374-31220-1-git-send-email-web+oss@zopieux.com> <1460479982-4955-1-git-send-email-web+oss@zopieux.com> X-alwaysdata-ID: 138702653 Sender: linux-wpan-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wpan@vger.kernel.org X-Spam-Status: No, score=-7.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 Acked-by: Alan Ott --- 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;