From patchwork Wed Jan 15 12:12:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 11333975 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A1658138D for ; Wed, 15 Jan 2020 12:17:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7585C22522 for ; Wed, 15 Jan 2020 12:17:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="eFYQT/Rc" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731331AbgAOMNd (ORCPT ); Wed, 15 Jan 2020 07:13:33 -0500 Received: from mail-bn7nam10on2048.outbound.protection.outlook.com ([40.107.92.48]:31808 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731305AbgAOMNc (ORCPT ); Wed, 15 Jan 2020 07:13:32 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JgP5abDShITF00TM0zuLjMJWvu+jM6q7jeJ2xx0TFQIdqxW4JBDIRAYItOj7sGlus7szZa2wB6nq/xbGNoq+gNsAZoMVVOjeKZIndtek64wzmbeJZSZg0+FUs1OYZhvxRC5QgKPNJiw4ED3H0vHnLetc69gTOLSlbcxQJJijA3FvWN0TWTO/sRzlvOw2eekEn2LIceC8VvxtihX4KaKh4oLYVNP+7uml89cn/GF6mLQ8HOuYPiRz91Q0teEyAst60W0OsYig2BZv/cCLwJ2YRvHCFoTZt82rhJrtTLSPEA9gVUBTRCgDN3frYnlvA8Br0sW6zR2+9tu4HiIX8/Dtwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wE4NZayrc5/OqYjwEoTG0wWNVVdW3mn+wI1Dx4BnsqA=; b=W04jmEGQUq/owXfuuFa63PzmhjmnONj4q7sMkrl/pQJ31E+s0Xtg0JmcZzzkFoFNf9vb8vV8atrTiepk7exVdILi5oeum2s/B9YNY+o5Kn0Wi+5DkJQnS1xpa2eeH8iJwPebNkVxB8KitFtfjpgRk0/eTAWS5A5tNLW3xsBeq5eyY8GqvAEEQ40jyu/xtq50VvFxzuipDwW/mZ4Zpd2Lvbv7F9vcCa5ltuAPVkP/682B58bFcO4olsM5siD4jZ63DnPI1HymnklmFLlT1NfDfkHCdbTxgNmC95hgqhZ2cTVN1NnBMUbAam2TYU2nPGbmL1t7VFSukAoT5piJjeA1HA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=silabs.com; dmarc=pass action=none header.from=silabs.com; dkim=pass header.d=silabs.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silabs.onmicrosoft.com; s=selector2-silabs-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wE4NZayrc5/OqYjwEoTG0wWNVVdW3mn+wI1Dx4BnsqA=; b=eFYQT/RcF7a83/fFzUwYHgRO6ZV0Rjlt8dp9s2eV1yemN51GVVdrXoeWcE/IHsJ1xJx1D3L94UF+Mr+Gc/1VpNR67iCMmKLbpUOP3t+A6sOfm82GtI/eM1W45nTKmyvV3hEBY4pBd8tQaZiH/cGqKHt87370xHaYuUwDWMa1Z/Y= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB4096.namprd11.prod.outlook.com (20.179.150.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2623.10; Wed, 15 Jan 2020 12:13:22 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf%4]) with mapi id 15.20.2623.018; Wed, 15 Jan 2020 12:13:22 +0000 Received: from pc-42.silabs.com (37.71.187.125) by PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Wed, 15 Jan 2020 12:12:54 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: "devel@driverdev.osuosl.org" , "linux-wireless@vger.kernel.org" CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= Subject: [PATCH 35/65] staging: wfx: simplify hif_set_mac_addr_condition() Thread-Topic: [PATCH 35/65] staging: wfx: simplify hif_set_mac_addr_condition() Thread-Index: AQHVy50ecNC0Ux3kl0yNLHwNJCt/cw== Date: Wed, 15 Jan 2020 12:12:55 +0000 Message-ID: <20200115121041.10863-36-Jerome.Pouiller@silabs.com> References: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.25.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: b45e65fd-aab2-4968-6cfb-08d799b440c8 x-ms-traffictypediagnostic: MN2PR11MB4096: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3173; x-forefront-prvs: 02830F0362 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(396003)(346002)(39860400002)(366004)(376002)(136003)(199004)(189003)(85202003)(66946007)(66446008)(66476007)(2906002)(107886003)(66556008)(1076003)(66574012)(64756008)(5660300002)(8936002)(6486002)(186003)(26005)(8676002)(316002)(81156014)(36756003)(52116002)(2616005)(7696005)(478600001)(16526019)(956004)(54906003)(110136005)(86362001)(71200400001)(85182001)(4326008)(81166006);DIR:OUT;SFP:1101;SCL:1;SRVR:MN2PR11MB4096;H:MN2PR11MB4063.namprd11.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: lLJvPx+0OP2dcn/bsZveMeMwxI8IHZKOicVNq5pCoN5crRgY63F7ZIFpxP0x7GuE/3NDUHPjzpnprnMb9QVnKHsdsVwx8L3EgkkPIJkF74pFyCMgtW/PyeeM+BuDgcKt3AUjD1+1q07X/I6spx/CCqj2EsOgboFDADUTZkCPdp8dySVjTAczfGry1vAJ0z5249es/peV8nlcMu+Z+mLOREK+aKDMnFRH1dP4/tvO6R9beydAAGobTISYgNkezQmmT4O2g4NHqK9Vuk+nw6bYaSH6/syooQfEQGVR/Hk3/BLGbTOKDxwLpGsWrZurgJTOo3WZE6FPWjQHEezmHrsp+YZh5NfJU+P4eaS7AmR4aRIuIH+DAQFSo/7Gop8oWlV/0ukK6nhjBzYaXGxzgVRnjWkr+j8+65OKHBYrFJ5EOSyYs5KRVXVe2JzCg39ePOqF Content-ID: <3E5D283AD3451D4CB9861EA4FB41B356@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: b45e65fd-aab2-4968-6cfb-08d799b440c8 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 12:12:55.7943 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 54dbd822-5231-4b20-944d-6f4abcd541fb X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: vKSNuksgCUsuANcOsIUfjvWjeGpu5qwg8EXnD5HAuvUI3qbiWp7UtAtxNfKDb+mOeoTrpLix245ohVCp1kqliA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4096 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller The structure hif_mib_mac_addr_data_frame_condition come from hardware API. It is not intended to be manipulated in upper layers of the driver. In add, current code for hif_set_mac_addr_condition() is too dumb. It should pack data with hardware representation instead of leaving all work to the caller. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_tx_mib.h | 10 ++++++++-- drivers/staging/wfx/sta.c | 9 +-------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/drivers/staging/wfx/hif_tx_mib.h b/drivers/staging/wfx/hif_tx_mib.h index ee22c7169fab..90474b1c5ec3 100644 --- a/drivers/staging/wfx/hif_tx_mib.h +++ b/drivers/staging/wfx/hif_tx_mib.h @@ -239,11 +239,17 @@ static inline int hif_set_tx_rate_retry_policy(struct wfx_vif *wvif, } static inline int hif_set_mac_addr_condition(struct wfx_vif *wvif, - struct hif_mib_mac_addr_data_frame_condition *arg) + int idx, const u8 *mac_addr) { + struct hif_mib_mac_addr_data_frame_condition val = { + .condition_idx = idx, + .address_type = HIF_MAC_ADDR_A1, + }; + + ether_addr_copy(val.mac_address, mac_addr); return hif_write_mib(wvif->wdev, wvif->id, HIF_MIB_ID_MAC_ADDR_DATAFRAME_CONDITION, - arg, sizeof(*arg)); + &val, sizeof(val)); } static inline int hif_set_uc_mc_bc_condition(struct wfx_vif *wvif, diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 588094486a7a..b74e0ce41069 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -118,7 +118,6 @@ static int wfx_set_mcast_filter(struct wfx_vif *wvif, { int i, ret; struct hif_mib_config_data_filter config = { }; - struct hif_mib_mac_addr_data_frame_condition filter_addr_val = { }; // Temporary workaround for filters return hif_set_data_filtering(wvif, false, true); @@ -126,14 +125,8 @@ static int wfx_set_mcast_filter(struct wfx_vif *wvif, if (!fp->enable) return hif_set_data_filtering(wvif, false, true); - // A1 Address match on list for (i = 0; i < fp->num_addresses; i++) { - filter_addr_val.condition_idx = i; - filter_addr_val.address_type = HIF_MAC_ADDR_A1; - ether_addr_copy(filter_addr_val.mac_address, - fp->address_list[i]); - ret = hif_set_mac_addr_condition(wvif, - &filter_addr_val); + ret = hif_set_mac_addr_condition(wvif, i, fp->address_list[i]); if (ret) return ret; config.mac_cond |= 1 << i;