From patchwork Tue Jul 31 08:09:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 10550369 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3A920139A for ; Tue, 31 Jul 2018 08:09:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2D2762A38B for ; Tue, 31 Jul 2018 08:09:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2054C2A399; Tue, 31 Jul 2018 08:09:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E3F5B2A364 for ; Tue, 31 Jul 2018 08:09:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729699AbeGaJse (ORCPT ); Tue, 31 Jul 2018 05:48:34 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:36623 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729224AbeGaJsd (ORCPT ); Tue, 31 Jul 2018 05:48:33 -0400 Received: by mail-wr1-f66.google.com with SMTP id h9-v6so15620084wro.3 for ; Tue, 31 Jul 2018 01:09:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=DjcBGRO8v0IR2u5o5Ra0pEwDorXM0IUVjwAwHdZLsWY=; b=rYG4Fn49tPMc+TbwYhOlht53kFAyfZKQZtd0Vt9nikF8dWGAwUTwuCeDzAcJms9Dtx pk8PCp3iSPQA1TrRSvnM1Q1Tm3+W+EV8SaujeWYEgv+iDzQ9qrln2a0nFK79ChWU7Bus 7iqCGtTko5yqt7doINu0lZtAGlMVHfc2LCMxMCuHIflRQoO31dSEcsSMsXUPZvs8eYJc 37Rc/055ootJRPaMAFhDv9YRjOays9eT5lTRb6vOggm4HDW9jJ8IJp4J1Du8i7kzVzL2 XlTugLKUGT8oIlUoqVs/Zj4DnmdVEZqocsLiJGyKa3eUfY0yuQzA8CTzjvpK8xbr2TeH ARlA== X-Gm-Message-State: AOUpUlHS7Sdrq2Wzh01MkYpupqpyWDIKm0mona8zl0Kpp7aOsDGElZmO H2u8NW+l2gNyee7la23Gsil9qA== X-Google-Smtp-Source: AAOMgpfPygAIcXiHC9n0J/LqtjGuEfoVFqGtCmg7mZGotbxsfjRmc0UIUmpapk4aBdSCL8SWYD0LfQ== X-Received: by 2002:a5d:46d1:: with SMTP id g17-v6mr19639647wrs.76.1533024564775; Tue, 31 Jul 2018 01:09:24 -0700 (PDT) Received: from localhost.localdomain.com (nat-pool-mxp-t.redhat.com. [149.6.153.186]) by smtp.gmail.com with ESMTPSA id o4-v6sm1501051wmo.20.2018.07.31.01.09.23 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 31 Jul 2018 01:09:24 -0700 (PDT) From: Lorenzo Bianconi To: nbd@nbd.name Cc: linux-wireless@vger.kernel.org, sgruszka@redhat.com Subject: [PATCH v2 00/19] add mt76x2u support to mt76 driver Date: Tue, 31 Jul 2018 10:09:01 +0200 Message-Id: X-Mailer: git-send-email 2.17.1 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add usb layer to mt76 driver in order to support mt76x2u based devices. Move common code between pci and usb in mt76x2-common module in order to remove pci dependency from usb driver Changes since v1: - rebase on top of wireless-drivers-next master branch - fix mt7662u fw definitions - remove unused len variable in mt76x2u_remove_dma_hdr() - move mt76u_mcu_fw_reset routine in mt76-usb module in order to be reused by mt76x0 driver - move mt76u_mcu_init_rx routine in mt76-usb module in order to be reused by mt76x0 driver Changes since RFCv3: - rebase on top of wireless-drivers-next master branch - fix some sparse warnings - fix a race between stats wk and hw_stop - move stats wk handler in mt76-usb module in order to be reused for mt76x0u support - move most of tx_status management in mt76-usb module in order to be reused for mt76x0u support - move some mcu utility routines in mt76-usb module in order to be reused for mt76x0u support - rename mt76_usb* in mt76u* - drop 'mt76x2: use completion instead of wait_queue for mcu rx queue' - move MT_TXD_INFO, MT_MCU_MSG and MT_RX_FCE_INFO defs in dma.h Changes since RFCv2: - move usb layer in a separate module - add usb scatter/gather to properly support A-MSDU - rebase on top of wireless-drivers-next master branch - rename mt76_tx_queue_skb in mt76_dma_tx_queue_skb and move it in dma.c Changes since RFCv1: - added power management support - updated usb_device_id list - fixed 5GHz frequencies scan - fixed various races during module load/unload - implemented dynamic AGC tuning based on false packet detection count - use netdev_alloc_frag/build_skb to get rid of rx frames copies - addressed comments from Stanislaw - added bss configuration support - added tx power configuration support - patchset rebased on top of current wireless-drivers-next master branch Lorenzo Bianconi (19): mt76: move MT_TXD_INFO, MT_MCU_MSG and MT_RX_FCE_INFO defs in dma.h mt76x2: move mt76x2_fw_header and mt76x2_patch_header definitions in mcu.h mt76x2: move utility routines in mt76x2.h mt76x2: introduce mt76x2_init_device routine mt76x2: move interface_modes definition in mt76x2_init mt76x2: introduce mt76x2_mac_load_tx_status routine mt76x2: add napi struct to mt76_rx_poll_complete/mt76_rx_complete signatures mt76x2: add buffer len to mt76x2_mac_write_txwi signature mt76: rename mt76_tx_queue_skb in mt76_dma_tx_queue_skb mt76: introduce tx_queue_skb function pointer in mt76_bus_ops mt76: introduce mt76x2-common module mt76: add mt76x2_tx_common to mt76x2-common module mt76: add mt76x2_mac_common to mt76x2-common module mt76: add mt76x2_init_common to mt76x2-common module mt76: add mt76x2_common to mt76x2-common module mt76: add mt76x2_phy_common to mt76x2-common module mt76: move mt76x2_debugfs in mt76-common module mt76: add usb support to mt76 layer mt76: add driver code for MT76x2u based devices drivers/net/wireless/mediatek/mt76/Kconfig | 19 + drivers/net/wireless/mediatek/mt76/Makefile | 19 +- drivers/net/wireless/mediatek/mt76/agg-rx.c | 2 +- drivers/net/wireless/mediatek/mt76/dma.c | 77 +- drivers/net/wireless/mediatek/mt76/dma.h | 43 + drivers/net/wireless/mediatek/mt76/mac80211.c | 20 +- drivers/net/wireless/mediatek/mt76/mt76.h | 160 +++- drivers/net/wireless/mediatek/mt76/mt76x2.h | 90 +- .../wireless/mediatek/mt76/mt76x2_common.c | 350 ++++++++ .../wireless/mediatek/mt76/mt76x2_debugfs.c | 1 + .../net/wireless/mediatek/mt76/mt76x2_dma.c | 21 - .../net/wireless/mediatek/mt76/mt76x2_dma.h | 38 - .../wireless/mediatek/mt76/mt76x2_eeprom.c | 13 +- .../wireless/mediatek/mt76/mt76x2_eeprom.h | 1 + .../net/wireless/mediatek/mt76/mt76x2_init.c | 311 +------ .../mediatek/mt76/mt76x2_init_common.c | 259 ++++++ .../net/wireless/mediatek/mt76/mt76x2_mac.c | 626 +------------ .../net/wireless/mediatek/mt76/mt76x2_mac.h | 2 +- .../mediatek/mt76/mt76x2_mac_common.c | 699 +++++++++++++++ .../net/wireless/mediatek/mt76/mt76x2_main.c | 307 ------- .../net/wireless/mediatek/mt76/mt76x2_mcu.c | 17 - .../net/wireless/mediatek/mt76/mt76x2_mcu.h | 17 + .../net/wireless/mediatek/mt76/mt76x2_phy.c | 347 ------- .../mediatek/mt76/mt76x2_phy_common.c | 349 ++++++++ .../net/wireless/mediatek/mt76/mt76x2_regs.h | 30 + .../net/wireless/mediatek/mt76/mt76x2_tx.c | 128 +-- .../wireless/mediatek/mt76/mt76x2_tx_common.c | 149 +++ .../net/wireless/mediatek/mt76/mt76x2_usb.c | 142 +++ drivers/net/wireless/mediatek/mt76/mt76x2u.h | 83 ++ .../net/wireless/mediatek/mt76/mt76x2u_core.c | 108 +++ .../net/wireless/mediatek/mt76/mt76x2u_init.c | 318 +++++++ .../net/wireless/mediatek/mt76/mt76x2u_mac.c | 240 +++++ .../net/wireless/mediatek/mt76/mt76x2u_main.c | 185 ++++ .../net/wireless/mediatek/mt76/mt76x2u_mcu.c | 463 ++++++++++ .../net/wireless/mediatek/mt76/mt76x2u_phy.c | 303 +++++++ drivers/net/wireless/mediatek/mt76/tx.c | 85 +- drivers/net/wireless/mediatek/mt76/usb.c | 845 ++++++++++++++++++ drivers/net/wireless/mediatek/mt76/usb_mcu.c | 242 +++++ .../net/wireless/mediatek/mt76/usb_trace.c | 23 + .../net/wireless/mediatek/mt76/usb_trace.h | 71 ++ 40 files changed, 5321 insertions(+), 1882 deletions(-) create mode 100644 drivers/net/wireless/mediatek/mt76/mt76x2_common.c create mode 100644 drivers/net/wireless/mediatek/mt76/mt76x2_init_common.c create mode 100644 drivers/net/wireless/mediatek/mt76/mt76x2_mac_common.c create mode 100644 drivers/net/wireless/mediatek/mt76/mt76x2_phy_common.c create mode 100644 drivers/net/wireless/mediatek/mt76/mt76x2_tx_common.c create mode 100644 drivers/net/wireless/mediatek/mt76/mt76x2_usb.c create mode 100644 drivers/net/wireless/mediatek/mt76/mt76x2u.h create mode 100644 drivers/net/wireless/mediatek/mt76/mt76x2u_core.c create mode 100644 drivers/net/wireless/mediatek/mt76/mt76x2u_init.c create mode 100644 drivers/net/wireless/mediatek/mt76/mt76x2u_mac.c create mode 100644 drivers/net/wireless/mediatek/mt76/mt76x2u_main.c create mode 100644 drivers/net/wireless/mediatek/mt76/mt76x2u_mcu.c create mode 100644 drivers/net/wireless/mediatek/mt76/mt76x2u_phy.c create mode 100644 drivers/net/wireless/mediatek/mt76/usb.c create mode 100644 drivers/net/wireless/mediatek/mt76/usb_mcu.c create mode 100644 drivers/net/wireless/mediatek/mt76/usb_trace.c create mode 100644 drivers/net/wireless/mediatek/mt76/usb_trace.h