From patchwork Wed Apr 29 18:39:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Malcolm Priestley X-Patchwork-Id: 11518099 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 EBFB71392 for ; Wed, 29 Apr 2020 18:39:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D477020B1F for ; Wed, 29 Apr 2020 18:39:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="J35UU2p9" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726929AbgD2SjI (ORCPT ); Wed, 29 Apr 2020 14:39:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44184 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726423AbgD2SjI (ORCPT ); Wed, 29 Apr 2020 14:39:08 -0400 Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D5B09C03C1AE for ; Wed, 29 Apr 2020 11:39:06 -0700 (PDT) Received: by mail-wm1-x341.google.com with SMTP id r26so3159926wmh.0 for ; Wed, 29 Apr 2020 11:39:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:cc:from:subject:message-id:date:user-agent:mime-version :content-language:content-transfer-encoding; bh=2b18ysXI32I8mHEzjma7PL/yS9Aub1eqd1HMHVebyB4=; b=J35UU2p9u1+cHQRXZPr/wVc9wtLHvFS/uQwBXFnd6IVNAmOV73DJ7v70bUsHCXL1KU IyEGsAvDLYkCVLxiBFYXJ373FM0rtaMhskvdzdn4Cs8RdlOjMc3zUHo4NY/9VbMUhzWp y/SOE0lLpVxrBdW/Mj6Oq6x2LZ6I80kLNa9SZvDtGGXDR82SmmwBMhPntpJKUiRTgYqi etBJThCWQ4vsstuxFcTE+B2szQp4niRwvwwwbKaXkq729mmrFuWLBQf6GDiENaTfgR7/ qJ2W3UnJS1O2qaAdyU52Otvjg6dcLi9d+DmKn/NPW5ZWxy+Fn9p7a+T4Yr3qyl8DojeG 3E1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:from:subject:message-id:date:user-agent :mime-version:content-language:content-transfer-encoding; bh=2b18ysXI32I8mHEzjma7PL/yS9Aub1eqd1HMHVebyB4=; b=o9Yb7rkjwGL8jZP03oVSvO9LBq27vWxGV4ShwRNJQRp6wp1bykTsOrpj8HpqSGcCZu YV+QQ9WqZlXPzGxZdR5v9E2R1onT2T415C8QFxrDPRxijjGkmk3EfvlB/WsWB7faEJn9 oUj7ysu7RLk0hENKw46Cxw1NeYn2X5rVcSE983RvZUyg0ezjhdniOStnYckJEd2aE/Jo C4VDBGN1RccYHFXjM5Jpz4wUaGLNUP6yt9nAKPUh/pZlsxbIegahlmakakdJKtseO3hy Bj81M3UZJG8OTGjoXWlAmiokoGWE1pkXv6TTbL9UdLnrnA9ZRiBPSRcXl/IJcH5Qa3v1 2dnQ== X-Gm-Message-State: AGi0PuZiTEL3dmY7cuqJhIue3FGBbabyX4PMfVbG4mdxF1EioKdrGVRc SR8vn1L4PmnRPCX+IGgtTo/hKPyC X-Google-Smtp-Source: APiQypLEXo2qyodrHD3T4LGV0PDMnIAeChRnBgROobFW6BWed6hg92O1RPKer2m/T9QqLNPo3XnMcA== X-Received: by 2002:a1c:a9c3:: with SMTP id s186mr4686917wme.89.1588185545469; Wed, 29 Apr 2020 11:39:05 -0700 (PDT) Received: from [192.168.43.18] (188.29.164.11.threembb.co.uk. [188.29.164.11]) by smtp.gmail.com with ESMTPSA id f23sm8632510wml.4.2020.04.29.11.39.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 29 Apr 2020 11:39:04 -0700 (PDT) To: Greg Kroah-Hartman Cc: "devel@driverdev.osuosl.org" , linux-wireless@vger.kernel.org, Oscar Carter From: Malcolm Priestley Subject: [PATCH 1/3] staging: vt6656: vnt_set_keymode simplify key modes. Message-ID: <0eb6f5bb-f756-ab1d-5b63-db9b0dc422da@gmail.com> Date: Wed, 29 Apr 2020 19:39:03 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 Content-Language: en-US Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Unused macros and onfly_latch are removed and others contain to actual key_type value is or-ed with key_mode. Signed-off-by: Malcolm Priestley --- drivers/staging/vt6656/key.c | 25 +++++++++---------------- drivers/staging/vt6656/key.h | 13 +++++++------ 2 files changed, 16 insertions(+), 22 deletions(-) diff --git a/drivers/staging/vt6656/key.c b/drivers/staging/vt6656/key.c index ac3b188984d0..47338077c033 100644 --- a/drivers/staging/vt6656/key.c +++ b/drivers/staging/vt6656/key.c @@ -35,7 +35,7 @@ int vnt_key_init_table(struct vnt_private *priv) static int vnt_set_keymode(struct ieee80211_hw *hw, u8 *mac_addr, struct ieee80211_key_conf *key, u32 key_type, - u32 mode, bool onfly_latch) + u32 mode) { struct vnt_private *priv = hw->priv; u8 broadcast[6] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; @@ -68,17 +68,11 @@ static int vnt_set_keymode(struct ieee80211_hw *hw, u8 *mac_addr, entry = MAX_KEY_TABLE - 1; key->hw_key_idx = entry; /* fall through */ - case VNT_KEY_ALLGROUP: - key_mode |= VNT_KEY_ALLGROUP; - if (onfly_latch) - key_mode |= VNT_KEY_ONFLY_ALL; - /* fall through */ case VNT_KEY_GROUP_ADDRESS: - key_mode |= mode; - /* fall through */ + key_mode = mode | (mode << 4); + break; case VNT_KEY_GROUP: - key_mode |= (mode << 4); - key_mode |= VNT_KEY_GROUP; + key_mode = mode << 4; break; case VNT_KEY_PAIRWISE: key_mode |= mode; @@ -88,8 +82,7 @@ static int vnt_set_keymode(struct ieee80211_hw *hw, u8 *mac_addr, return -EINVAL; } - if (onfly_latch) - key_mode |= VNT_KEY_ONFLY; + key_mode |= key_type; if (mode == KEY_CTL_WEP) { if (key->keylen == WLAN_KEY_LEN_WEP40) @@ -126,7 +119,7 @@ int vnt_set_keys(struct ieee80211_hw *hw, struct ieee80211_sta *sta, vnt_mac_disable_keyentry(priv, u); vnt_set_keymode(hw, mac_addr, key, VNT_KEY_DEFAULTKEY, - KEY_CTL_WEP, true); + KEY_CTL_WEP); key->flags |= IEEE80211_KEY_FLAG_GENERATE_IV; @@ -152,10 +145,10 @@ int vnt_set_keys(struct ieee80211_hw *hw, struct ieee80211_sta *sta, if (key->flags & IEEE80211_KEY_FLAG_PAIRWISE) vnt_set_keymode(hw, mac_addr, key, VNT_KEY_PAIRWISE, - key_dec_mode, true); + key_dec_mode); else - vnt_set_keymode(hw, mac_addr, key, VNT_KEY_GROUP_ADDRESS, - key_dec_mode, true); + vnt_set_keymode(hw, mac_addr, key, + VNT_KEY_GROUP_ADDRESS, key_dec_mode); return 0; } diff --git a/drivers/staging/vt6656/key.h b/drivers/staging/vt6656/key.h index 918c07cf86cd..1f3449e66143 100644 --- a/drivers/staging/vt6656/key.h +++ b/drivers/staging/vt6656/key.h @@ -25,13 +25,14 @@ #define KEY_CTL_TKIP 0x02 #define KEY_CTL_CCMP 0x03 -#define VNT_KEY_DEFAULTKEY 0x1 -#define VNT_KEY_GROUP_ADDRESS 0x2 -#define VNT_KEY_ALLGROUP 0x4 -#define VNT_KEY_GROUP 0x40 -#define VNT_KEY_PAIRWISE 0x00 -#define VNT_KEY_ONFLY 0x8000 #define VNT_KEY_ONFLY_ALL 0x4000 +#define VNT_KEY_ONFLY 0x8000 +#define VNT_KEY_ALLGROUP 0x04 +#define VNT_KEY_GROUP 0x40 +#define VNT_KEY_PAIRWISE VNT_KEY_ONFLY +#define VNT_KEY_GROUP_ADDRESS (VNT_KEY_ALLGROUP | VNT_KEY_GROUP) +#define VNT_KEY_DEFAULTKEY (VNT_KEY_GROUP_ADDRESS | VNT_KEY_ONFLY |\ + VNT_KEY_ONFLY_ALL) int vnt_key_init_table(struct vnt_private *priv); From patchwork Wed Apr 29 18:44:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Malcolm Priestley X-Patchwork-Id: 11518123 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 98C1281 for ; Wed, 29 Apr 2020 18:44:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 815572072A for ; Wed, 29 Apr 2020 18:44:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="PhQvfhhT" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726815AbgD2Sod (ORCPT ); Wed, 29 Apr 2020 14:44:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45034 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726519AbgD2Sod (ORCPT ); Wed, 29 Apr 2020 14:44:33 -0400 Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0A5D7C03C1AE for ; Wed, 29 Apr 2020 11:44:33 -0700 (PDT) Received: by mail-wm1-x344.google.com with SMTP id 188so3187984wmc.2 for ; Wed, 29 Apr 2020 11:44:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:cc:from:subject:message-id:date:user-agent:mime-version :content-language:content-transfer-encoding; bh=RZJHwCxCbQeMsgn1IlnEFNBZsOdeAV4P2O5iQG5bMuA=; b=PhQvfhhTBuit2cIQdfBfbUwmb2yIAEX01Nl1CF2WtZtE7F6DpcAqHC2JUiADu/IbfB 1WOTJvvvu2srdgC2chlKxfWPRkDQai8wvPZ2j1To64FGhxXlcRXe0Itu8Ey8aWVhk3h4 7pGCkK7NScZQOJlO+I//lZXsLQ2Mkpz2A9PGAXCgXAwAo9b1rFegiNnuskILeKHlYZaR os73e3nPDBzzPR0qZPRjfIa9yG2iorGr1xQJh+dOG5r4oPRvMVKJicy1w0Vn5VCC3uJA 6F5faCGkuMAScXlLXnRciPMrcBCmC7YjcLMEn0M/UwPrAB6FOGn7t0g8XY0r6MvxhwFM Q0WQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:from:subject:message-id:date:user-agent :mime-version:content-language:content-transfer-encoding; bh=RZJHwCxCbQeMsgn1IlnEFNBZsOdeAV4P2O5iQG5bMuA=; b=f60D6Ezna9MNYRiKjawo0921RJQ0M/FbMzEDg2Eh/65zAqOWXIw0Y7tIvDpZ6nl9av 6TjmPqWqKs4tiRIwfhGrMnYl/d72Ryn3oIsq9KxkXsmcVkmbdDWuCTtpGRBXPkKs3SfB qg0yEgoG+vmISkwCCUHHM2w3FcquJFuNelMCCwpFttpM2+BNAEykymYuFvOJ6y5SU2Zk l9s32LVogVteaK31KoYVyNk2SuZgCacWzmb94fZpNBV//lFYKJxAlcSJp6WrqLzevTdA DJ5d0ve1cIMc81RoSpV6vcxKBEEBp2L+pZb9iy8WIRONes36aSxwcrYWCG4BTxdCmnv6 GxxA== X-Gm-Message-State: AGi0PubA3XUgraiv7aUe0vudXlQM379DiipExwe+tYW4gBYhsNnB4Rb2 xTr0cSdmzqM5r8dEo4dP0GDhvGMc X-Google-Smtp-Source: APiQypLtoA222rR5uHfba83rSlpFAPFw/B8xJCaNydBniOGwkm0yOBCrIqi0rt3r/IO6u3ptXpLqVA== X-Received: by 2002:a1c:bc05:: with SMTP id m5mr4393934wmf.143.1588185871738; Wed, 29 Apr 2020 11:44:31 -0700 (PDT) Received: from [192.168.43.18] (188.29.164.11.threembb.co.uk. [188.29.164.11]) by smtp.gmail.com with ESMTPSA id p7sm183561wrf.31.2020.04.29.11.44.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 29 Apr 2020 11:44:31 -0700 (PDT) To: Greg Kroah-Hartman Cc: "devel@driverdev.osuosl.org" , linux-wireless@vger.kernel.org, Oscar Carter From: Malcolm Priestley Subject: [PATCH 2/3] staging: vt6656 remove vnt_mac_disable_keyentry calls Message-ID: <844df68d-08e2-7672-524f-42b918e300c1@gmail.com> Date: Wed, 29 Apr 2020 19:44:29 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 Content-Language: en-US Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org It is not necessary to disable all the keys mac80211 will have removed any existing keys that were used. Signed-off-by: Malcolm Priestley --- drivers/staging/vt6656/key.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/drivers/staging/vt6656/key.c b/drivers/staging/vt6656/key.c index 47338077c033..de54cc3ff95a 100644 --- a/drivers/staging/vt6656/key.c +++ b/drivers/staging/vt6656/key.c @@ -102,22 +102,14 @@ int vnt_set_keys(struct ieee80211_hw *hw, struct ieee80211_sta *sta, struct vnt_private *priv = hw->priv; u8 *mac_addr = NULL; u8 key_dec_mode = 0; - int ret = 0, u; + int ret = 0; if (sta) mac_addr = &sta->addr[0]; switch (key->cipher) { - case 0: - for (u = 0 ; u < MAX_KEY_TABLE; u++) - vnt_mac_disable_keyentry(priv, u); - return ret; - case WLAN_CIPHER_SUITE_WEP40: case WLAN_CIPHER_SUITE_WEP104: - for (u = 0; u < MAX_KEY_TABLE; u++) - vnt_mac_disable_keyentry(priv, u); - vnt_set_keymode(hw, mac_addr, key, VNT_KEY_DEFAULTKEY, KEY_CTL_WEP); From patchwork Wed Apr 29 18:48:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Malcolm Priestley X-Patchwork-Id: 11518127 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 9FE6781 for ; Wed, 29 Apr 2020 18:48:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 880E42072A for ; Wed, 29 Apr 2020 18:48:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="RFScoR6J" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726556AbgD2SsS (ORCPT ); Wed, 29 Apr 2020 14:48:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726423AbgD2SsS (ORCPT ); Wed, 29 Apr 2020 14:48:18 -0400 Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 391BFC03C1AE for ; Wed, 29 Apr 2020 11:48:18 -0700 (PDT) Received: by mail-wr1-x441.google.com with SMTP id x17so3814862wrt.5 for ; Wed, 29 Apr 2020 11:48:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:cc:from:subject:message-id:date:user-agent:mime-version :content-language:content-transfer-encoding; bh=CDyB54AjrNjFSRl8MhLod74ljRZRfy3XowXumg1NuYA=; b=RFScoR6J8meDk+PuK2qeAGbRkEVzZHhD1uzBwEJ3DQIcVuxphdWlDVf0fgX2hJIqBx YTz6jzAXFrAfbNp47ifFA2RHHuWlxI9AIinVzfZPApdRnXhllA5zFbpzSnfuRilh8jhG skmXqtlsKN1kxXtdIrVJXiLYbKYSbauT0rT0uuy3Mmx+5rdUj41bDCsHOBjB4rz+jmFQ Qgi6AgskeaeEHq70tSzHYCON5fAPq5ctWxmzLifGl26WCWnUatDX9Ll1iCLpjQivmWSq Z1hgFT8YHzZtM8kXgf77XOOYVfWf7TNswDuplPDs1/PQdSBrhjvcW//GfxvLLQMtHeRt J6vQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:from:subject:message-id:date:user-agent :mime-version:content-language:content-transfer-encoding; bh=CDyB54AjrNjFSRl8MhLod74ljRZRfy3XowXumg1NuYA=; b=fKg2SUtTholUbp5K2vEoKjXj16w2HFwFYNjdvltFcp0dZOD2YjfU041yxh/hy4j8r6 7Y9o2DQOS5HbuBYICwhwoh38afF33FvomgX/t86LiBRkeGtVOulhsXSOyoEePlknoPIw buSt6EhtL1qkZAk/V+JlA9FTJ4U0yBsJgOjxRmhFvzsAng4tmCPbCBHJGroB/6kq4ajW JPGAbhDK7UCJotrTjK/sD/Ju/4iv96DQQ2iFtBQ4pMf94PxJiYxkFxgRG/Yuj24WOKkz fVthrQzLQ87x5bABGgHMLKc/2noS8dx5nRu1on6lWUys1PxJQKZ+Als+njv4zPjikxG8 9m9A== X-Gm-Message-State: AGi0PubOtYqVnByTFD3T1DShJ+RQzI5EZ4EBmspHKWg/qarRgI7m95sy Uo4zwEY31GU4zikoxTlMUMo= X-Google-Smtp-Source: APiQypK15N3MYMdXuYh567Rs8EzSzfvFBlvE/iyAcEzmCfK8JKzNtPKARNjeW+aRpjc3w8l3d/RF+g== X-Received: by 2002:adf:e5c8:: with SMTP id a8mr44341553wrn.56.1588186096957; Wed, 29 Apr 2020 11:48:16 -0700 (PDT) Received: from [192.168.43.18] (188.29.164.11.threembb.co.uk. [188.29.164.11]) by smtp.gmail.com with ESMTPSA id 17sm8790455wmo.2.2020.04.29.11.48.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 29 Apr 2020 11:48:16 -0700 (PDT) To: Greg Kroah-Hartman Cc: "devel@driverdev.osuosl.org" , linux-wireless@vger.kernel.org, Oscar Carter From: Malcolm Priestley Subject: [PATCH 3/3] staging: vt6656: return all key calls to mac80211 stack. Message-ID: Date: Wed, 29 Apr 2020 19:48:14 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 Content-Language: en-US Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org vnt_mac_set_keyentry can return USB calls so return them to mac80211. Signed-off-by: Malcolm Priestley --- drivers/staging/vt6656/key.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/drivers/staging/vt6656/key.c b/drivers/staging/vt6656/key.c index de54cc3ff95a..c66cb53cfc09 100644 --- a/drivers/staging/vt6656/key.c +++ b/drivers/staging/vt6656/key.c @@ -91,9 +91,8 @@ static int vnt_set_keymode(struct ieee80211_hw *hw, u8 *mac_addr, key->key[15] |= 0x80; } - vnt_mac_set_keyentry(priv, key_mode, entry, key_inx, bssid, key->key); - - return 0; + return vnt_mac_set_keyentry(priv, key_mode, entry, + key_inx, bssid, key->key); } int vnt_set_keys(struct ieee80211_hw *hw, struct ieee80211_sta *sta, @@ -102,7 +101,6 @@ int vnt_set_keys(struct ieee80211_hw *hw, struct ieee80211_sta *sta, struct vnt_private *priv = hw->priv; u8 *mac_addr = NULL; u8 key_dec_mode = 0; - int ret = 0; if (sta) mac_addr = &sta->addr[0]; @@ -115,7 +113,9 @@ int vnt_set_keys(struct ieee80211_hw *hw, struct ieee80211_sta *sta, key->flags |= IEEE80211_KEY_FLAG_GENERATE_IV; - return ret; + return vnt_set_keymode(hw, mac_addr, key, VNT_KEY_DEFAULTKEY, + KEY_CTL_WEP); + case WLAN_CIPHER_SUITE_TKIP: key->flags |= IEEE80211_KEY_FLAG_GENERATE_MMIC; key->flags |= IEEE80211_KEY_FLAG_GENERATE_IV; @@ -136,11 +136,9 @@ int vnt_set_keys(struct ieee80211_hw *hw, struct ieee80211_sta *sta, } if (key->flags & IEEE80211_KEY_FLAG_PAIRWISE) - vnt_set_keymode(hw, mac_addr, key, VNT_KEY_PAIRWISE, - key_dec_mode); - else - vnt_set_keymode(hw, mac_addr, key, - VNT_KEY_GROUP_ADDRESS, key_dec_mode); + return vnt_set_keymode(hw, mac_addr, key, VNT_KEY_PAIRWISE, + key_dec_mode); - return 0; + return vnt_set_keymode(hw, mac_addr, key, + VNT_KEY_GROUP_ADDRESS, key_dec_mode); }