From patchwork Wed Sep 8 09:18:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ryder Lee X-Patchwork-Id: 1525701 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=cnzhERHV; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4H4GtX3v7nz9t54 for ; Wed, 8 Sep 2021 19:24:36 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=jiVMIXA5tOJCHDySAtqzqgdHW+nnXYHkHNl+VQues2Q=; b=cnzhERHV+onDUg bPmHzedwF7u6J6N+MyT58RlytQWv6j0fb+A+sQgJSoutIA3z3yyLKJfafdX4QNkTGvn52xEZIB1Ed nhnYL90omDdd8rlj+u3C4/uJMjWMFBACW8z4ixU3EcCcoglaLS0gzqlK9hsNxcKfFhGG2LorHaBBo qj9icWOWaY98fBk4WwDsjDiIrQBu68MOCzay8rkzgbqFd/qA417G2q0E1gvCnkjoGqyNXL0g8W7jb BE6wBmr25f2Nr1jS0Nq53JL+zYUpTnxIlrfXcrTIHdQU7ZF6hVBq4Dn6bvHJhBEeXuoQYP5g4WEmG 3khnM/y4hwPck7hACERw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mNtnD-006HZU-FQ; Wed, 08 Sep 2021 09:22:55 +0000 Received: from mailgw02.mediatek.com ([216.200.240.185]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mNtnA-006HXd-VA for hostap@lists.infradead.org; Wed, 08 Sep 2021 09:22:54 +0000 X-UUID: 9464fd726e6c4beebf7ceff6edb50497-20210908 X-UUID: 9464fd726e6c4beebf7ceff6edb50497-20210908 Received: from mtkcas66.mediatek.inc [(172.29.193.44)] by mailgw02.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1348899873; Wed, 08 Sep 2021 02:22:47 -0700 Received: from mtkmbs05n2.mediatek.inc (172.21.101.140) by MTKMBS62DR.mediatek.inc (172.29.94.18) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 8 Sep 2021 02:19:59 -0700 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs05n2.mediatek.inc (172.21.101.140) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 8 Sep 2021 17:19:58 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 8 Sep 2021 17:19:58 +0800 From: Ryder Lee To: Jouni Malinen CC: Felix Fietkau , Lorenzo Bianconi , Shayne Chen , "Evelyn Tsai" , , John Crispin , Lorenzo Bianconi , Ryder Lee Subject: [PATCH 6/6] bss_coloring: allow using a random starting color Date: Wed, 8 Sep 2021 17:18:55 +0800 Message-ID: <46fa29623e1fb485e9070ef9d066a57c2111bad0.1631091272.git.ryder.lee@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <3602d12247be5d7a335ee9e3d57e04664256712b.1631091271.git.ryder.lee@mediatek.com> References: <3602d12247be5d7a335ee9e3d57e04664256712b.1631091271.git.ryder.lee@mediatek.com> MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210908_022253_088750_5B160C0F X-CRM114-Status: GOOD ( 11.91 ) X-Spam-Score: 0.0 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: John Crispin Enhance the possible values for he_bss_color. Anything greater than 63 will make hostapd choose a random color. Co-developed-by: Lorenzo Bianconi Signed-off-by: Lorenzo Bianconi Signed-off-by: John Crispin Signed-off-by: Ryder Lee List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: John Crispin Enhance the possible values for he_bss_color. Anything greater than 63 will make hostapd choose a random color. Co-developed-by: Lorenzo Bianconi Signed-off-by: Lorenzo Bianconi Signed-off-by: John Crispin Signed-off-by: Ryder Lee --- hostapd/config_file.c | 7 +++++-- hostapd/hostapd.conf | 5 ++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/hostapd/config_file.c b/hostapd/config_file.c index 7b03edf36..70d8809c7 100644 --- a/hostapd/config_file.c +++ b/hostapd/config_file.c @@ -3503,8 +3503,11 @@ static int hostapd_config_fill(struct hostapd_config *conf, } else if (os_strcmp(buf, "he_mu_beamformer") == 0) { conf->he_phy_capab.he_mu_beamformer = atoi(pos); } else if (os_strcmp(buf, "he_bss_color") == 0) { - conf->he_op.he_bss_color = atoi(pos) & 0x3f; - conf->he_op.he_bss_color_disabled = 0; + conf->he_op.he_bss_color = atoi(pos); + if (conf->he_op.he_bss_color > 63) + conf->he_op.he_bss_color = (os_random() % 63) + 1; + if (conf->he_op.he_bss_color) + conf->he_op.he_bss_color_disabled = 0; } else if (os_strcmp(buf, "he_bss_color_partial") == 0) { conf->he_op.he_bss_color_partial = atoi(pos); } else if (os_strcmp(buf, "he_default_pe_duration") == 0) { diff --git a/hostapd/hostapd.conf b/hostapd/hostapd.conf index dbdd3d7fb..88a2b9b83 100644 --- a/hostapd/hostapd.conf +++ b/hostapd/hostapd.conf @@ -816,7 +816,10 @@ wmm_ac_vo_acm=0 # 1 = supported #he_mu_beamformer=1 -# he_bss_color: BSS color (1-63) +# he_bss_color: +# 0 = disable +# 1-63 = pre-defined color +# 64+ = random color #he_bss_color=1 # he_bss_color_partial: BSS color AID equation