Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp5934931ybi; Wed, 31 Jul 2019 05:44:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqxE68nnL+FpUocXv0720l8XpmHwlK50AcxBNbAg1T7HmRY4PlC9Qsvy4BThWq7If+FK4kPR X-Received: by 2002:a17:902:361:: with SMTP id 88mr122002136pld.123.1564577074692; Wed, 31 Jul 2019 05:44:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564577074; cv=none; d=google.com; s=arc-20160816; b=iWLt+RcN+pp8LECJF/RdnjrZprcgxO+fZp2wLpTNQ8adXh7iUf6QTwSRV3upTaayem 2pxttHVM2Sx6fJZ/8LAjglxXIUH9zDWuR7ueZlxzcXnVJNjCgrEBCHUrgq1WY62AuKhM mgIglyLvaJdlZtaKj2tZodoietuZ8h6pfseV4yWc1tgVUkXhBj9gxb8oRUd1wnlw+H/h Qav5tkW2v+bGV93tQv4CZYuibWnXkHSGBfKO+kEIrj08+sPwP+eazObmVcYX94X0rSQU k4+HwR5adwBH5tYtja3O/11Sz+625GhZy25QZDwLPJAqMloAhZE+Bpckx5RX9PwrxahI NuQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:authenticated-by; bh=MHtJGMOCyl6/rLSajY4LjJDNO/dIX0mvwPoBoePIQAE=; b=mjyq35KjzdtpbECzyAtWEx2j5uxj9mIzSznakCcAGvkuvzJQq1BJLCpSN68sMAJybU Xay0DS2rnnZeS9ndQngrlVOHj7WR5tTR8+CrhGPHeM+pt9RGwFA8tQsRc9sirmKQuyrl Bve1UcjeXFQGTe2CndGaoZO2W3KZqBhw5QA02XDN+QBioCCkDl9c8EFD8ymEwo+3pmXD WGv8j1LMwxo2ZAZnr9CMMsfykJ/YQ9aowzytCyJQ8xv/RHrV+IjO7tK66vtHkFoNsFza gwrI1ENVcGvDjEBBjMugS8FYYaK3NQAjW+A/jbA0xivlEORUoRnvwxtdYfmvy8iytyXU QQGA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k8si33125918pgt.548.2019.07.31.05.44.20; Wed, 31 Jul 2019 05:44:34 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727565AbfGaMXH (ORCPT + 99 others); Wed, 31 Jul 2019 08:23:07 -0400 Received: from rtits2.realtek.com ([211.75.126.72]:36785 "EHLO rtits2.realtek.com.tw" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726696AbfGaMXH (ORCPT ); Wed, 31 Jul 2019 08:23:07 -0400 Authenticated-By: X-SpamFilter-By: BOX Solutions SpamTrap 5.62 with qID x6VCMrkO007662, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (RTITCASV01.realtek.com.tw[172.21.6.18]) by rtits2.realtek.com.tw (8.15.2/2.57/5.78) with ESMTPS id x6VCMrkO007662 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 31 Jul 2019 20:22:53 +0800 Received: from localhost.localdomain (172.21.68.126) by RTITCASV01.realtek.com.tw (172.21.6.18) with Microsoft SMTP Server id 14.3.439.0; Wed, 31 Jul 2019 20:22:53 +0800 From: To: CC: , , Subject: [PATCH v3 0/3] rtw88: add support for BT co-existence mechanism Date: Wed, 31 Jul 2019 20:22:44 +0800 Message-ID: <1564575767-27557-1-git-send-email-yhchuang@realtek.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.21.68.126] Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Yan-Hsuan Chuang This patch set mainly adds a BT co-existence mechanism, which helps WiFi device to work with BT device concurrently without interfering each other. For Realtek's WiFi/BT combo devices, the co-existence mechanism is on the WiFi side. The rest of the patches add BTcoex support. BTcoex needs to wake up events that is waiting for some C2H reported in IRQ context, so these C2H skbs do not required to be queued into workqueues to be processed. What we need to do is to simply wake it uin IRQ context. And actually C2H workqueue context should be protected by rtwdev->mutex lock to perform some hardware operations against mac80211 callbacks. The final patch contains the most of the BTcoex logic. It is not that complicated, just to gather information and make decision on WiFi driver side. What makes the code so much is that the mechanism needs to take care of a lot of WiFi/BT combinations. Such as if WiFi is at 2G or is having a lot of traffic or is connecting to AP. And BT has many profiles such as A2DP/HID/PAN or it is slave or not. v1 -> v2 rebase onto the latest wireless-drivers-next the conflicts is in pci.c with patch "rtw88: pci: Rearrange the memory usage for skb in RX ISR" v2 -> v3 - free skbs responded for coex information - remove BT efuse check related patches, because it is not recommended to read BT's efuse at WiFi side. If the efuse bank is switched at WiFi side, BT is not able to read its own efuse content - add TDMA mode with 4 slots, to deal with some BT earphones that have small buffer Yan-Hsuan Chuang (3): rtw88: allow c2h operation in irq context rtw88: enclose c2h cmd handle with mutex rtw88: add BT co-existence support drivers/net/wireless/realtek/rtw88/Makefile | 1 + drivers/net/wireless/realtek/rtw88/coex.c | 2507 +++++++++++++++++++++++++ drivers/net/wireless/realtek/rtw88/coex.h | 369 ++++ drivers/net/wireless/realtek/rtw88/fw.c | 135 +- drivers/net/wireless/realtek/rtw88/fw.h | 73 + drivers/net/wireless/realtek/rtw88/mac80211.c | 19 + drivers/net/wireless/realtek/rtw88/main.c | 45 +- drivers/net/wireless/realtek/rtw88/main.h | 233 +++ drivers/net/wireless/realtek/rtw88/pci.c | 6 +- drivers/net/wireless/realtek/rtw88/ps.c | 9 + drivers/net/wireless/realtek/rtw88/reg.h | 62 + drivers/net/wireless/realtek/rtw88/rtw8822b.c | 460 ++++- drivers/net/wireless/realtek/rtw88/rtw8822c.c | 355 +++- 13 files changed, 4240 insertions(+), 34 deletions(-) create mode 100644 drivers/net/wireless/realtek/rtw88/coex.c create mode 100644 drivers/net/wireless/realtek/rtw88/coex.h -- 2.7.4