Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp4037725ybc; Tue, 26 Nov 2019 02:47:08 -0800 (PST) X-Google-Smtp-Source: APXvYqwUHHZRpCG+cI8BkEWRaRyviVxbKPCkd7vG5nxE8BB8tOowwTrLC6Nv577a1Bzxp1TTMpdm X-Received: by 2002:a50:9fc1:: with SMTP id c59mr24786236edf.305.1574765228174; Tue, 26 Nov 2019 02:47:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574765228; cv=none; d=google.com; s=arc-20160816; b=f4sCTRqypFDAOP+k7R7PkXficF4ovt5FYQqhEsULOCKl04rJAzhu1aqRzkGfS1siv/ 0A+SjimIA1m3Qst+pnGJZ6HwEheJBbJURGJUtZBTPWALoRfw6e8cq4RrJqEJFpaS8pD5 24bUl6eLuuj0qZgHtbGhrbA6MM3Q2WusDicfCYmg6r1cnPR2Hg5OqeEL7oopen84RnBT d0E1c0tfBz4gPpZr4aVUdAnsN0NtlV2I1kqjQQ7f26w0b8GKNOTE1I9hGU+vKUsPPBRR okEfJ6BPbikWr8pxMWBEfvf+d6dfJ0MPZgaoXoQnI8Llogok27HdGZcQEo3g5jilOmej ecRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:user-agent:in-reply-to:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=THeWkxhGHlvtqEdZeq+O/q3j/6kvo8OPnFKvF146PTI=; b=kX11DjmDRAb7hHCZCvUzixFQ/79gxNK+hx0w/fHWCEADpSpiAImGjb+OaDa+0ExvYA MUBrjP+t+ociLmdJkcW7LY+0pmH4nDw7GnkyK7KCWpUgnQ8daA7JYguBuUZus6LjHegv dzN6U9Jrj3PQU+JBb/ZaOTGPcGkSMeDi5hVzaReYLI9jJLVuUjlRnKBIDlAWpYqFwUOR UhKuHD+Y+dreigbhk1s9V5HaQ7m+jSZ2tf1V8XjFnz0xrrqpJypdIVAYLjD2ZEuT+UYJ LphgcylTAPQnvZ/vZZvYnkY8rNaYkMaPd1bzOqb98l2b10JzndIODsru3u+29E8y6C01 AU5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fAieNqTw; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v13si6472844eju.409.2019.11.26.02.46.28; Tue, 26 Nov 2019 02:47:08 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fAieNqTw; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727815AbfKZKpB (ORCPT + 99 others); Tue, 26 Nov 2019 05:45:01 -0500 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:21022 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727388AbfKZKpB (ORCPT ); Tue, 26 Nov 2019 05:45:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574765100; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=THeWkxhGHlvtqEdZeq+O/q3j/6kvo8OPnFKvF146PTI=; b=fAieNqTwWMgiRqXtT+Fo8MSCGnDM+E70MVf9Aaw52Y6IP5Vc0OiK+0tJIGsufwsGWD2BrD usw4o5ukwNUJl6o8GuTyUeXIJZ1W/DI0cvYNLAjBO+4WDYmXsf/h2wBV6OIcSpaJRxoQfG S59/NyhOf7MNkULOKT41He7F7fSszPs= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-78-QM_tmhTqPRq-rkSEV8dzPA-1; Tue, 26 Nov 2019 05:44:59 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id ED2311005509; Tue, 26 Nov 2019 10:44:57 +0000 (UTC) Received: from localhost (unknown [10.40.205.113]) by smtp.corp.redhat.com (Postfix) with ESMTP id EB7B75D9CD; Tue, 26 Nov 2019 10:44:54 +0000 (UTC) Date: Tue, 26 Nov 2019 11:44:54 +0100 From: Stanislaw Gruszka To: Felix Fietkau Cc: Markus Theil , linux-wireless@vger.kernel.org, lorenzo.bianconi@redhat.com Subject: Re: [PATCH v8 2/6] mt76: mt76x02: split beaconing Message-ID: <20191126104453.GA7944@redhat.com> References: <20191121180001.22451-1-markus.theil@tu-ilmenau.de> <20191121180001.22451-3-markus.theil@tu-ilmenau.de> <20191125130014.GB28102@redhat.com> <20191125165932.GB14273@redhat.com> <40c52ae5-85d8-8a65-2b4b-1a52bf1b73ab@nbd.name> MIME-Version: 1.0 In-Reply-To: <40c52ae5-85d8-8a65-2b4b-1a52bf1b73ab@nbd.name> User-Agent: Mutt/1.11.3 (2019-02-01) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-MC-Unique: QM_tmhTqPRq-rkSEV8dzPA-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Mon, Nov 25, 2019 at 06:12:56PM +0100, Felix Fietkau wrote: > On 2019-11-25 17:59, Stanislaw Gruszka wrote: > > On Mon, Nov 25, 2019 at 03:07:59PM +0100, Markus Theil wrote: > >> On 11/25/19 2:00 PM, Stanislaw Gruszka wrote: > >> > On Thu, Nov 21, 2019 at 06:59:57PM +0100, Markus Theil wrote: > >> >> +void mt76x02_mac_set_beacon_finish(struct mt76x02_dev *dev) > >> >> +{ > >> >> +=09mt76_wr(dev, MT_BCN_BYPASS_MASK, > >> >> +=09=090xff00 | ~bitrev8(dev->beacon_data_mask)); > >> > Since you arrange beacon slots continues starting from 0 > >> > (i.e. 0,1,2 instead of "random" vif_idx values like 0,4,6), > >> > I think it would make sense to keep > >> > MT_MAC_BSSID_DW1_MBEACON_N =3D bcn_idx - 1 and set mask unchanged. > >> > > >> > But no strong opinion here, code with bitrev8 looks fine too. > >> I'd like to keep the bitrev8 code, as it saves a copy over usb for usb > >> devices, if MT_MAC_BSSID_DW_BEACON_N is kept constant. > >> bitrev8 should be a rather cheap operation compared to a copy over som= e > >> form of bus. > >=20 > > This make sense. I tested the code on MT7630E and after adding missed > > write_txwi function, it works fine. So I think bitrev8 code is ok. > I find the use of bitrev8/ffz a bit convoluted. If I understand the code > right, wouldn't it be equivalent to keeping beacon_data_count instead of > beacon_data_mask and doing: > mt76_wr(dev, MT_BCN_BYPASS_MASK, > =090xffff & ~((1 << dev->beacon_data_count) - 1)); If we want to keep constatn MT_MAC_BSSID_DW1_MBEACON_N=3D7 , I think correct formula would be: 0xff00 | ~(0xff00 >> dev->beacon_data_count) Anyway something simpler than bitrev8 can be used to calculate bypass mask. Stanislaw=20