From patchwork Wed Dec 18 16:07:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Theil X-Patchwork-Id: 11301193 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 0FBC814B7 for ; Wed, 18 Dec 2019 16:08:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E264C2176D for ; Wed, 18 Dec 2019 16:08:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727492AbfLRQI4 (ORCPT ); Wed, 18 Dec 2019 11:08:56 -0500 Received: from smail.rz.tu-ilmenau.de ([141.24.186.67]:51401 "EHLO smail.rz.tu-ilmenau.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727173AbfLRQIy (ORCPT ); Wed, 18 Dec 2019 11:08:54 -0500 Received: from isengard.tu-ilmenau.de (unknown [141.24.207.101]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smail.rz.tu-ilmenau.de (Postfix) with ESMTPSA id EA3DF580074; Wed, 18 Dec 2019 17:08:51 +0100 (CET) From: Markus Theil To: nbd@nbd.name Cc: linux-wireless@vger.kernel.org, lorenzo.bianconi@redhat.com, Stanislaw Gruszka , kvalo@codeaurora.org, Markus Theil Subject: [PATCH v10 0/6] mt76: channel switch support for USB devices Date: Wed, 18 Dec 2019 17:07:48 +0100 Message-Id: <20191218160754.24111-1-markus.theil@tu-ilmenau.de> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org This patch series adds channel switch support for mt76 usb interfaces. When testing, I noticed that between 5 or 7 consecutive beacons had the identical channel switch count set. After some debugging I found out, that beacon copying over usb took far too long (up to 700ms for one call of mt76x02u_pre_tbtt_work). Therefore the first five patches speed up beacon copying and provide beaconing fixes. The last patch enables channel switch support also for usb interfaces. Thanks to Stanislaw, Lorenzo and Felix for their help. v10: * style fixes v9: * use beacon_data_count instead of beacon_data_mask * add missing txwi copy again * move csa_check for usb under beacon iteration (send beacons and no ps frames in case of finished csa) v8: * fix mbss beaconing * fix adding vifs with idx 8 * fix memory leaks by dropping beacon buffer * permanently enable 7 additional bss to save another usb call and make beacon masking easier * added beacon_prepare call again, which now also clears beacon_data_mask v7: * fix mbss beacon settings (incorrect try) * fix compilation with latest upstream v6: * use min_t in mt76u_copy * use round_up in mt76u_copy * use additional copy for mmio beacon set again v5: * ommit empty mt76x2u_channel_switch_beacon * copy txwi into beacon skb v4: * use multiple of 4 len for usb copy again v3: * fixed checkpatch errors v2: * correctly track beacon data mask * clean-ups * make channel switch fn static (reported by kbuild test robot) Markus Theil (6): mt76: mt76x02: ommit beacon slot clearing mt76: mt76x02: split beaconing mt76: mt76x02: add check for invalid vif idx mt76: mt76x02: remove a copy call for usb speedup mt76: speed up usb bulk copy mt76: mt76x02: add channel switch support for usb interfaces drivers/net/wireless/mediatek/mt76/mt76.h | 2 +- drivers/net/wireless/mediatek/mt76/mt76x02.h | 3 +- .../wireless/mediatek/mt76/mt76x02_beacon.c | 85 +++++-------------- .../net/wireless/mediatek/mt76/mt76x02_mac.c | 2 + .../net/wireless/mediatek/mt76/mt76x02_mac.h | 3 +- .../net/wireless/mediatek/mt76/mt76x02_mmio.c | 7 ++ .../wireless/mediatek/mt76/mt76x02_usb_core.c | 29 +++++-- .../net/wireless/mediatek/mt76/mt76x02_util.c | 6 +- drivers/net/wireless/mediatek/mt76/usb.c | 24 ++++-- 9 files changed, 77 insertions(+), 84 deletions(-)