From nobody Sat Jun 27 22:15:13 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4D9F6C433EF for ; Sun, 20 Feb 2022 15:49:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240742AbiBTPtc (ORCPT ); Sun, 20 Feb 2022 10:49:32 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:39342 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240355AbiBTPt1 (ORCPT ); Sun, 20 Feb 2022 10:49:27 -0500 Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9096C532D2 for ; Sun, 20 Feb 2022 07:49:05 -0800 (PST) Received: by mail-ej1-x633.google.com with SMTP id qx21so26875664ejb.13 for ; Sun, 20 Feb 2022 07:49:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=PXWkUCOam5DNv4E6wTMBoogFAVwI0cIVhZM2na4fJgA=; b=mtImQpHEx86uqnWxdQ0PqfY0vygneLhldx924GSLvq36VlEkuiZ81yXhLqW0/ofFRi /0tamkzK9cv26VUmezQ3LlX16A6KXhnn8TPnCY/Ms9fkGI+R7WfEDYJpiiSg3ZquIqj4 REVrBgPuUTr0OBaQhgkIJNUV1nssa37fj1vtevnqywCUo9REq78tE84jd/SakHVpPvlr KtrMtMlt12FRinzcRO9qx0rPiTsCeQTVf6A2UaxwE0Ci4iAD2tnKG7ZqlfgaDZQ3Ho98 O1SpTCsETD7DbFVdFNBSwqx82brANRDnBYilThNv7FefucN+lRDGuON/31gh5L+gLfJa kZbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=PXWkUCOam5DNv4E6wTMBoogFAVwI0cIVhZM2na4fJgA=; b=XjWprij2a+VyWbaiMdiNnGPKPBGUuJgahiLU14H1FlV2HTtfOs6B9xjWWxKc9I+oWg t5SFo3BAk5OwIAItRLpqkYVXrmCnrNSBzM6ZRk9VDGwLx+/jvSXjhUF3o8HiJnddxkPz RHObBWSY9ZajQKKRITXTGCtriVwGE0W5QopjHnIfH41nWOVF4uYoHwlxodw4dRpCp99z CP2Z11xQbyfg51tHPkeKE+ItSOdHrnhw2VupDF5Kc5hbsbZz9zYVaOWvDXO+7/z0jCIO AvYvyXD0qxGSp0gNNd6F3vfbzETPvsh1G/Qj6cW14Yxmk0b5TtVBhoqOh8TbihlFQQ9A VswQ== X-Gm-Message-State: AOAM531Oh55eQX01n8T6mMBCdxehPmCriapmyJf3vIc6Y1wL9QtC5X9Z wELS0L1Xosp5pbcucmT/YgeXV06+584= X-Google-Smtp-Source: ABdhPJw4p4xCogA3E/+PYwGpEybaM8V8Sf/TLR1wh8jgUnG3vMiuCdy6l9yXLJNzA6Hg7MGTkNA89Q== X-Received: by 2002:a17:906:d41:b0:6ce:78b0:8113 with SMTP id r1-20020a1709060d4100b006ce78b08113mr13281771ejh.357.1645372144149; Sun, 20 Feb 2022 07:49:04 -0800 (PST) Received: from localhost.localdomain (ip5f5abb8f.dynamic.kabel-deutschland.de. [95.90.187.143]) by smtp.gmail.com with ESMTPSA id ew6sm4178979ejc.217.2022.02.20.07.49.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Feb 2022 07:49:03 -0800 (PST) From: Michael Straube To: gregkh@linuxfoundation.org Cc: Larry.Finger@lwfinger.net, phil@philpotter.co.uk, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Michael Straube Subject: [PATCH 1/3] staging: r8188eu: remove 5 GHz channels from ch_freq_map Date: Sun, 20 Feb 2022 16:48:45 +0100 Message-Id: <20220220154847.7521-2-straube.linux@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220220154847.7521-1-straube.linux@gmail.com> References: <20220220154847.7521-1-straube.linux@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" This driver is for chips that operate only in the 2.4 GHz band. Frequencies for 5 GHz channels can be removed from the ch_freq_map array. Signed-off-by: Michael Straube --- drivers/staging/r8188eu/core/rtw_rf.c | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_rf.c b/drivers/staging/r8188e= u/core/rtw_rf.c index e704092d31d0..51425971782b 100644 --- a/drivers/staging/r8188eu/core/rtw_rf.c +++ b/drivers/staging/r8188eu/core/rtw_rf.c @@ -17,22 +17,6 @@ static struct ch_freq ch_freq_map[] =3D { {1, 2412}, {2, 2417}, {3, 2422}, {4, 2427}, {5, 2432}, {6, 2437}, {7, 2442}, {8, 2447}, {9, 2452}, {10, 2457}, {11, 2462}, {12, 2467}, {13, 2472}, {14, 2484}, - /* UNII */ - {36, 5180}, {40, 5200}, {44, 5220}, {48, 5240}, {52, 5260}, - {56, 5280}, {60, 5300}, {64, 5320}, {149, 5745}, {153, 5765}, - {157, 5785}, {161, 5805}, {165, 5825}, {167, 5835}, {169, 5845}, - {171, 5855}, {173, 5865}, - /* HiperLAN2 */ - {100, 5500}, {104, 5520}, {108, 5540}, {112, 5560}, {116, 5580}, - {120, 5600}, {124, 5620}, {128, 5640}, {132, 5660}, {136, 5680}, - {140, 5700}, - /* Japan MMAC */ - {34, 5170}, {38, 5190}, {42, 5210}, {46, 5230}, - /* Japan */ - {184, 4920}, {188, 4940}, {192, 4960}, {196, 4980}, - {208, 5040},/* Japan, means J08 */ - {212, 5060},/* Japan, means J12 */ - {216, 5080},/* Japan, means J16 */ }; =20 static int ch_freq_map_num =3D ARRAY_SIZE(ch_freq_map); --=20 2.35.1 From nobody Sat Jun 27 22:15:13 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1F5F9C433F5 for ; Sun, 20 Feb 2022 15:49:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240876AbiBTPte (ORCPT ); Sun, 20 Feb 2022 10:49:34 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:39344 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240431AbiBTPt1 (ORCPT ); Sun, 20 Feb 2022 10:49:27 -0500 Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46EE4532D3 for ; Sun, 20 Feb 2022 07:49:06 -0800 (PST) Received: by mail-ej1-x62e.google.com with SMTP id bg10so26968317ejb.4 for ; Sun, 20 Feb 2022 07:49:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=mTYsVbDSvOAH4QYIkGgRDagMrOUXfFeihf5F3hcHwp0=; b=JEkHopJZKie/5DpEOnlLTQV+KtGhmNVl3cJqcA0CZGOZErKJxZvqO3g3aK6DHFuetW giGTYma2wCdU7kOlbDPI5FziKoLV4ukFcPnKy25N5PKSmZHKhBjN3aZ/m84nFwITAa98 MhbGTXcAi/C1z3l1WMYeB8VTeYm7vzHvuU2seJX29IH3/NjBjhvqw8cfHNlanrai3C9B +UOZJ85ITqFLAqqs4lADjzCO+FNI6WRoiXwklnkTP2oG2Q67n9uwBKLOZmJZQ82GaAHB QTqOBElNBjhMChfMUTcFHm+RSP9wLcSx0uqoFVeSvNrfWWCINHgjkqM0iNi19sR9zwly v3BA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=mTYsVbDSvOAH4QYIkGgRDagMrOUXfFeihf5F3hcHwp0=; b=fNccwCiBi9TbBIYC97QNHtx8bUMYDdKLbRyoyzn0G1/s6ot0zO2zzvO0RXzGxO6XBz Qs897Vrs2oaATxvplgqhqfSALTWjZBAZtgtzcSsAIVWRZGTLnRItTCUZbhpsJp1PEFym anW0zPXhJ+3GKEcFWv3KNRz/LEz/uHt5lmyiqjF40gYey9dC/S+QB3FzXelD/fEgmg5M 7gYv9wRxhwTxbzhuLRIaXWHnTM1IUoxYbS50Ce3mwlBmcQEV+1EpWWZ/RONp0aDFxxgh cgUajKpJleXoZUuHMIWY5GFce8PQPZYedvyJIMVwnMzCjCH9BNwmT4Auhcw3cBjqwFBt mBJg== X-Gm-Message-State: AOAM533n8b1umprW8HrR40qGB7i0pb3j2LWSvrjaTLrN86r7vwzg2wQv 1fY4NNyVMDEQpj1fKcOXmIo= X-Google-Smtp-Source: ABdhPJxdPwhPAac2wjri7r1WjHPjTNs0Zti2xNCwFgEFycMioLNm+X7124lC2XdcWXYkGpElccuBRg== X-Received: by 2002:a17:906:538f:b0:6ce:98ad:3100 with SMTP id g15-20020a170906538f00b006ce98ad3100mr13288782ejo.566.1645372144858; Sun, 20 Feb 2022 07:49:04 -0800 (PST) Received: from localhost.localdomain (ip5f5abb8f.dynamic.kabel-deutschland.de. [95.90.187.143]) by smtp.gmail.com with ESMTPSA id ew6sm4178979ejc.217.2022.02.20.07.49.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Feb 2022 07:49:04 -0800 (PST) From: Michael Straube To: gregkh@linuxfoundation.org Cc: Larry.Finger@lwfinger.net, phil@philpotter.co.uk, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Michael Straube Subject: [PATCH 2/3] staging: r8188eu: refactor rtw_ch2freq() Date: Sun, 20 Feb 2022 16:48:46 +0100 Message-Id: <20220220154847.7521-3-straube.linux@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220220154847.7521-1-straube.linux@gmail.com> References: <20220220154847.7521-1-straube.linux@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Since we have only channel values from 1 to 14 we can convert the array ch_freq_map to a simple integer array and use the indices as channel numbers. This simplifies the code and avoids looping through the array to get the frequency. Signed-off-by: Michael Straube --- drivers/staging/r8188eu/core/rtw_rf.c | 40 +++++++++++---------------- 1 file changed, 16 insertions(+), 24 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_rf.c b/drivers/staging/r8188e= u/core/rtw_rf.c index 51425971782b..945a40e6511a 100644 --- a/drivers/staging/r8188eu/core/rtw_rf.c +++ b/drivers/staging/r8188eu/core/rtw_rf.c @@ -8,32 +8,24 @@ #include "../include/recv_osdep.h" #include "../include/xmit_osdep.h" =20 -struct ch_freq { - u32 channel; - u32 frequency; +static const u32 ch_freq_map[] =3D { + 2412, + 2417, + 2422, + 2427, + 2432, + 2437, + 2442, + 2447, + 2452, + 2457, + 2462, + 2467, + 2472, + 2484 }; =20 -static struct ch_freq ch_freq_map[] =3D { - {1, 2412}, {2, 2417}, {3, 2422}, {4, 2427}, {5, 2432}, - {6, 2437}, {7, 2442}, {8, 2447}, {9, 2452}, {10, 2457}, - {11, 2462}, {12, 2467}, {13, 2472}, {14, 2484}, -}; - -static int ch_freq_map_num =3D ARRAY_SIZE(ch_freq_map); - u32 rtw_ch2freq(u32 channel) { - u8 i; - u32 freq =3D 0; - - for (i =3D 0; i < ch_freq_map_num; i++) { - if (channel =3D=3D ch_freq_map[i].channel) { - freq =3D ch_freq_map[i].frequency; - break; - } - } - if (i =3D=3D ch_freq_map_num) - freq =3D 2412; - - return freq; + return ch_freq_map[channel - 1]; } --=20 2.35.1 From nobody Sat Jun 27 22:15:13 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EABCBC433F5 for ; Sun, 20 Feb 2022 15:49:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243520AbiBTPth (ORCPT ); Sun, 20 Feb 2022 10:49:37 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:39386 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236087AbiBTPt2 (ORCPT ); Sun, 20 Feb 2022 10:49:28 -0500 Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com [IPv6:2a00:1450:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D495C532D0 for ; Sun, 20 Feb 2022 07:49:06 -0800 (PST) Received: by mail-ej1-x634.google.com with SMTP id qx21so26875756ejb.13 for ; Sun, 20 Feb 2022 07:49:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=0LzislRsRPF3CyBdUmLIeLjcZ+WoLwAHUia8Yqa/r/Y=; b=ha2FxVA0CtY8C335/jYpTtab94I/NRB2Yqb/JJbP0d2h/g9iGmnwOCu++Tavz5zs2w JqQGVBD3pfViPN84daHU4fJZapDw3N0GAZNgHt7N88C1Dc5kAhTtGIpZbDM6dY3t87sH I29TcN8zqeLJM1Ia0lRZF1+q9qqBij5nwqL//tLuYqJU4BTl7VXxGd7twjUpjVbRczlr iPNrsJkHpR0AS2yTJO+nomj/brlQQrJmq2dLSh32tfVGBOuEOW4tEtVWUgJjaAmHk5Aq Fj7icxH8+2e7Yy+iIOzoUQkt+nIswofz916in6foReEN9J1pLe42dgIND8xaO7qrxtj4 ZlyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=0LzislRsRPF3CyBdUmLIeLjcZ+WoLwAHUia8Yqa/r/Y=; b=YBzoEQnzWelmYIk3VzXWgc6lEp9lzhdn9MGEGtl5y4FNVEi4uHbm079pKlz6+LjyJd /u8EfKwGTBEPdP+9Mbe5rH3MXLnZvIFUW+YoZ+seShedbVoNLeYa17lqeFkrZ7reusxm p2ZQ0NismLOe/wW7NHdr/S/ceHiw2zSF4+KhiIpKWcLRI556LBRMJAoHhser3AYo1mPF lR94MtYBDPOkHpzDICqu3WMFHTAq+AFALrTXukx2K/N4YZoYi0euCgz2y2IKZb55p6ra YtOcPLSoQjlD19atJrc2ZiiLD+q+SWr2YvXCTzeDImWqvVPRETX164pEXDGLYhfQ8+PZ lZbw== X-Gm-Message-State: AOAM530uso7rmpmqhpnApAwEy6QyN2rHbkD8jL3ZpJUihGkN6t0MAHwB c3EAsqyQvQJyEGi4G61gfKU= X-Google-Smtp-Source: ABdhPJwZykj1EHixwqFV4XcWPVOX4bsIPTaOFEh54CJYyRq5L+ohYrYHChEMs7+jKAhm4XTIzhNA4Q== X-Received: by 2002:a17:906:39c7:b0:6b5:1c00:f6a0 with SMTP id i7-20020a17090639c700b006b51c00f6a0mr12889792eje.631.1645372145481; Sun, 20 Feb 2022 07:49:05 -0800 (PST) Received: from localhost.localdomain (ip5f5abb8f.dynamic.kabel-deutschland.de. [95.90.187.143]) by smtp.gmail.com with ESMTPSA id ew6sm4178979ejc.217.2022.02.20.07.49.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Feb 2022 07:49:05 -0800 (PST) From: Michael Straube To: gregkh@linuxfoundation.org Cc: Larry.Finger@lwfinger.net, phil@philpotter.co.uk, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Michael Straube Subject: [PATCH 3/3] staging: r8188eu: clean up rtw_rf.c Date: Sun, 20 Feb 2022 16:48:47 +0100 Message-Id: <20220220154847.7521-4-straube.linux@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220220154847.7521-1-straube.linux@gmail.com> References: <20220220154847.7521-1-straube.linux@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Remove unnecessary includes and the unused define _RTW_RF_C_ from rtw_rf.c. Signed-off-by: Michael Straube --- drivers/staging/r8188eu/core/rtw_rf.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_rf.c b/drivers/staging/r8188e= u/core/rtw_rf.c index 945a40e6511a..ac1c06a60735 100644 --- a/drivers/staging/r8188eu/core/rtw_rf.c +++ b/drivers/staging/r8188eu/core/rtw_rf.c @@ -1,12 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 /* Copyright(c) 2007 - 2011 Realtek Corporation. */ =20 -#define _RTW_RF_C_ - -#include "../include/osdep_service.h" #include "../include/drv_types.h" -#include "../include/recv_osdep.h" -#include "../include/xmit_osdep.h" =20 static const u32 ch_freq_map[] =3D { 2412, --=20 2.35.1