From patchwork Tue Sep 18 08:26:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felix Fietkau X-Patchwork-Id: 10603851 X-Patchwork-Delegate: kvalo@adurom.com 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 745CC15E8 for ; Tue, 18 Sep 2018 08:26:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 633002A318 for ; Tue, 18 Sep 2018 08:26:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 573872A647; Tue, 18 Sep 2018 08:26:08 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 201A52A318 for ; Tue, 18 Sep 2018 08:26:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729173AbeIRN5h (ORCPT ); Tue, 18 Sep 2018 09:57:37 -0400 Received: from nbd.name ([46.4.11.11]:51226 "EHLO nbd.name" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726433AbeIRN5g (ORCPT ); Tue, 18 Sep 2018 09:57:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Date: Message-ID:Subject:From:Cc:To:Sender:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=IddgSpksbyDpIqBYA8o37DMYnhHzZIEbOQWshBF1V2w=; b=Rra1Ui94w8R+Cm0v5zdODmfH3O mdRAzY7JZUC1UKCcjgEfgfntVcRypde8ZGAAwV7EiX5guj/XgZwHBGAXqE6YUECpbK7ktDCvUJrnI e3d0XIQ1KXzgCOm6DJ1310xn2M+awIRl2Ha9Z4gKl0bwvIaZ29PRyn945E+EDQnJQI0s=; To: Kalle Valo Cc: linux-wireless From: Felix Fietkau Subject: pull request: mt76 2018-09-18 Openpgp: preference=signencrypt Autocrypt: addr=nbd@nbd.name; prefer-encrypt=mutual; keydata= xsDiBEah5CcRBADIY7pu4LIv3jBlyQ/2u87iIZGe6f0f8pyB4UjzfJNXhJb8JylYYRzIOSxh ExKsdLCnJqsG1PY1mqTtoG8sONpwsHr2oJ4itjcGHfn5NJSUGTbtbbxLro13tHkGFCoCr4Z5 Pv+XRgiANSpYlIigiMbOkide6wbggQK32tC20QxUIwCg4k6dtV/4kwEeiOUfErq00TVqIiEE AKcUi4taOuh/PQWx/Ujjl/P1LfJXqLKRPa8PwD4j2yjoc9l+7LptSxJThL9KSu6gtXQjcoR2 vCK0OeYJhgO4kYMI78h1TSaxmtImEAnjFPYJYVsxrhay92jisYc7z5R/76AaELfF6RCjjGeP wdalulG+erWju710Bif7E1yjYVWeA/9Wd1lsOmx6uwwYgNqoFtcAunDaMKi9xVQW18FsUusM TdRvTZLBpoUAy+MajAL+R73TwLq3LnKpIcCwftyQXK5pEDKq57OhxJVv1Q8XkA9Dn1SBOjNB l25vJDFAT9ntp9THeDD2fv15yk4EKpWhu4H00/YX8KkhFsrtUs69+vZQwc0cRmVsaXggRmll dGthdSA8bmJkQG5iZC5uYW1lPsJgBBMRAgAgBQJGoeQnAhsjBgsJCAcDAgQVAggDBBYCAwEC HgECF4AACgkQ130UHQKnbvXsvgCgjsAIIOsY7xZ8VcSm7NABpi91yTMAniMMmH7FRenEAYMa VrwYTIThkTlQzsFNBEah5FQQCACMIep/hTzgPZ9HbCTKm9xN4bZX0JjrqjFem1Nxf3MBM5vN CYGBn8F4sGIzPmLhl4xFeq3k5irVg/YvxSDbQN6NJv8o+tP6zsMeWX2JjtV0P4aDIN1pK2/w VxcicArw0VYdv2ZCarccFBgH2a6GjswqlCqVM3gNIMI8ikzenKcso8YErGGiKYeMEZLwHaxE Y7mTPuOTrWL8uWWRL5mVjhZEVvDez6em/OYvzBwbkhImrryF29e3Po2cfY2n7EKjjr3/141K DHBBdgXlPNfDwROnA5ugjjEBjwkwBQqPpDA7AYPvpHh5vLbZnVGu5CwG7NAsrb2isRmjYoqk wu++3117AAMFB/9S0Sj7qFFQcD4laADVsabTpNNpaV4wAgVTRHKV/kC9luItzwDnUcsZUPdQ f3MueRJ3jIHU0UmRBG3uQftqbZJj3ikhnfvyLmkCNe+/hXhPu9sGvXyi2D4vszICvc1KL4RD aLSrOsROx22eZ26KqcW4ny7+va2FnvjsZgI8h4sDmaLzKczVRIiLITiMpLFEU/VoSv0m1F4B FtRgoiyjFzigWG0MsTdAN6FJzGh4mWWGIlE7o5JraNhnTd+yTUIPtw3ym6l8P+gbvfoZida0 TspgwBWLnXQvP5EDvlZnNaKa/3oBes6z0QdaSOwZCRA3QSLHBwtgUsrT6RxRSweLrcabwkkE GBECAAkFAkah5FQCGwwACgkQ130UHQKnbvW2GgCfTKx80VvCR/PvsUlrvdOLsIgeRGAAn1ee RjMaxwtSdaCKMw3j33ZbsWS4 Message-ID: Date: Tue, 18 Sep 2018 10:26:02 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 Content-Language: en-US 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 Hi Kalle, Here's a large batch of mt76 code cleanup / deduplication / fixes, rebased to your latest wireless-drivers-next. - Felix The following changes since commit 43e2f2904160b9a95aad77df9cbc1622910b8598: Merge wireless-drivers into wireless-drivers-next (2018-09-17 17:41:02 +0300) are available in the Git repository at: https://github.com/nbd168/wireless tags/mt76-for-kvalo-2018-09-18 for you to fetch changes up to faedbfa17bec060688a4615c5bc5dc3c681ddca3: mt76x0: usb: remove mt76_fw definition (2018-09-17 17:39:12 +0200) ---------------------------------------------------------------- Felix Fietkau (1): mt76: use a per rx queue page fragment cache Lorenzo Bianconi (58): mt76x2: change mt76x2_tx_complete routine signature mt76: move mt76x2_tx_complete routine in mt76x02-lib module mt76: move mt76x2u_remove_dma_hdr in mt76x02-lib module mt76: move mt76x2u_tx_complete_skb in mt76x02-lib moudule mt76: move mt76_qsel definition in dma.h mt76: move mt76x2u_set_txinfo in mt76x02-lib module mt76x0: introduce mt76x0_tx_prepare_skb routine mt76: move mt76x2u_tx_status_data in mt76x02-lib module mt76x0: init mt76_driver_ops callbacks mt76x0: use mt76_alloc_device for device allocation mt76x0: disable usb rx bulk aggregation mt76x0: mark device as running in mt76x0_start mt76x0: simplify mt76_mac_process_rx signature mt76x0: add mt76x0_queue_rx_skb routine mt76x0: unify tx/rx datapath with mt76x2u driver mt76x0: stop stat workqueue at hw stop mt76x0: set max fragments size mt76x0: remove unused dma.c source file mt76x0: remove unused stat work_queue mt76x0: remove unused {tx/rx}_queue definitions mt76x0: remove unused mt76x0_tx_status routine mt76x0: remove unused endpoint definitions mt76x0: remove unused stat_work mt76x0: enable per-sta tx queueing mt76x0: init hw capabilities mt76: remove unused MT76_MORE_STATS state mt76x0: remove mt76x0_stop_hardware routine mt76: move mt76 rate definitions in mt76x02-lib module mt76x0: alloc mcu buffers first in mt76x0_mcu_cmd_init mt76x0: fix memory leak during hw probe mt76x0: move stop related routines in mt76x0_mac_stop mt76x0: move mt76x0_init_hardware in mt76x0_register_device mt76x0: do not free/alloc buffers during suspend/resume mt76x0: remove has_{2,5}ghz fields of mt76x0_eeprom_params mt76x0: use mt76_register_device for device registration mt76x0: run vco calibration for each channel configuration mt76: move mt76x0 and mt76x2 mcu shared defs in mt76x02_mcu.h mt76: add mt76_mcu_ops data structure for mcu related pointers mt76: usb: use common helpers for mcu_alloc_msg()/mcu_send_msg() mt76: usb: move mt76x02 mcu code in mt76x02-usb module mt76: usb: move mt76u_skb_dma_info in mt76x02_usb_core.c mt76x02: move TXD/RXD/MCU definitions in mt76x02_dma.h mt76x02: add static qualifier to mt76x02_remove_dma_hdr mt76: usb: remove skb check in mt76x{0,2}u mcu routines mt76x2: use mt76_dev instead of mt76x2_dev in mt76x2_tx_queue_mcu mt76x2: remove leftover mt76u_buf data structure in mt76x2_mcu mt76: introduce mmio data structure in mt76_dev mt76: move __iomem regs in mt76_mmio mt76x2: use mt76_dev instead of mt76x2_dev in mt76x2_mcu_msg_send mt76x2: use common helpers for mcu_alloc_msg()/mcu_send_msg() mt76: unify firmware header between mt76x0 and mt76x2 mt76: move mt76{0,2} mcu shared code in mt76x02_mcu.c mt76x2: move mt76x2 mcu shared code in mt76x2_mcu_common.c mt76: move shared mcu_calibrate routine in mt76x02-lib module mt76x2: move mt76x2_phy_tssi_compensate in mt76x2-common module mt76x0: remove mcu source file mt76x0: remove unused usb header file mt76x0: usb: remove mt76_fw definition Stanislaw Gruszka (30): mt76: move wcid fields to common mt76_dev struct mt76: unify sta_add / sta_remove mt76: pratially unify add_interface mt76: unify ampdu_action mt76: unify set_key mt76x0: remove empty sta_notify mt76: unify AC to hw queue mapping mt76: unify conf_tx mt76x0: remove vif_mask mt76: unify remove_interface mt76: unify add_interface mt76: unify sta_rate_tbl_update and related helpers mt76: unify txwi and rxwi structures mt76: unify load_tx_status mt76: unify send_tx_status and related helpers mt76: use mt76_rx_status in mt76x0 mt76: unify mac_process_rate mt76x0: reserve enough space in mac80211 mt76: unify {insert/remove}_hdr_pad mt76: partially unify filling txwi fields mt76x0: trim rx skb to proper length mt76x0: inital split between pci and usb mt76x0: remove unused mt76x0_wcid mt76x0: remove some usb specific code from mt76x0_register_device mt76x0: make device allocation bus neutral mt76: add usb implementation of {wr,rd}_rp mt76: add rd_rp and wr_rp to bus_ops/mcu_ops mt76x0: remove unused mt76x0_burst_read_regs mt76x0: remove mt76x0_burst_write_regs() mt76x0: usb: move firmware loading to usb.c drivers/net/wireless/mediatek/mt76/Kconfig | 27 +++- drivers/net/wireless/mediatek/mt76/Makefile | 9 +- drivers/net/wireless/mediatek/mt76/dma.c | 16 +- drivers/net/wireless/mediatek/mt76/dma.h | 41 +---- drivers/net/wireless/mediatek/mt76/mac80211.c | 3 +- drivers/net/wireless/mediatek/mt76/mmio.c | 12 +- drivers/net/wireless/mediatek/mt76/mt76.h | 81 +++++++--- drivers/net/wireless/mediatek/mt76/mt76x0/Makefile | 13 +- drivers/net/wireless/mediatek/mt76/mt76x0/dma.c | 524 --------------------------------------------------------------- drivers/net/wireless/mediatek/mt76/mt76x0/eeprom.c | 26 ++-- drivers/net/wireless/mediatek/mt76/mt76x0/eeprom.h | 3 - drivers/net/wireless/mediatek/mt76/mt76x0/init.c | 378 ++++++++++++--------------------------------- drivers/net/wireless/mediatek/mt76/mt76x0/mac.c | 323 +++------------------------------------ drivers/net/wireless/mediatek/mt76/mt76x0/mac.h | 132 +--------------- drivers/net/wireless/mediatek/mt76/mt76x0/main.c | 228 +++------------------------ drivers/net/wireless/mediatek/mt76/mt76x0/mcu.c | 395 ----------------------------------------------- drivers/net/wireless/mediatek/mt76/mt76x0/mcu.h | 60 +------- drivers/net/wireless/mediatek/mt76/mt76x0/mt76x0.h | 125 ++------------- drivers/net/wireless/mediatek/mt76/mt76x0/pci.c | 81 ++++++++++ drivers/net/wireless/mediatek/mt76/mt76x0/phy.c | 37 ++--- drivers/net/wireless/mediatek/mt76/mt76x0/trace.h | 12 +- drivers/net/wireless/mediatek/mt76/mt76x0/tx.c | 245 ++++++----------------------- drivers/net/wireless/mediatek/mt76/mt76x0/usb.c | 232 +++++++++++++++++++++++++--- drivers/net/wireless/mediatek/mt76/mt76x0/usb.h | 46 ------ drivers/net/wireless/mediatek/mt76/mt76x0/util.c | 42 ----- drivers/net/wireless/mediatek/mt76/mt76x02_dma.h | 60 ++++++++ drivers/net/wireless/mediatek/mt76/mt76x02_mac.c | 347 ++++++++++++++++++++++++++++++++++++++++++ drivers/net/wireless/mediatek/mt76/mt76x02_mac.h | 122 ++++++++++++++- drivers/net/wireless/mediatek/mt76/mt76x02_mcu.c | 213 ++++++++++++++++++++++++++ drivers/net/wireless/mediatek/mt76/mt76x02_mcu.h | 100 ++++++++++++ drivers/net/wireless/mediatek/mt76/{mt76x2_dma.h => mt76x02_usb.h} | 22 +-- drivers/net/wireless/mediatek/mt76/mt76x02_usb_core.c | 72 +++++++++ drivers/net/wireless/mediatek/mt76/mt76x02_usb_mcu.c | 359 +++++++++++++++++++++++++++++++++++++++++++ drivers/net/wireless/mediatek/mt76/mt76x02_util.c | 401 ++++++++++++++++++++++++++++++++++++++++++++++++ drivers/net/wireless/mediatek/mt76/mt76x02_util.h | 29 ++++ drivers/net/wireless/mediatek/mt76/mt76x2.h | 42 +---- drivers/net/wireless/mediatek/mt76/mt76x2_common.c | 259 +------------------------------ drivers/net/wireless/mediatek/mt76/mt76x2_dma.c | 55 +------ drivers/net/wireless/mediatek/mt76/mt76x2_init.c | 12 +- drivers/net/wireless/mediatek/mt76/mt76x2_init_common.c | 33 +--- drivers/net/wireless/mediatek/mt76/mt76x2_mac.c | 15 +- drivers/net/wireless/mediatek/mt76/mt76x2_mac.h | 110 +------------- drivers/net/wireless/mediatek/mt76/mt76x2_mac_common.c | 368 ++------------------------------------------ drivers/net/wireless/mediatek/mt76/mt76x2_main.c | 50 +----- drivers/net/wireless/mediatek/mt76/mt76x2_mcu.c | 261 ++----------------------------- drivers/net/wireless/mediatek/mt76/mt76x2_mcu.h | 68 +-------- drivers/net/wireless/mediatek/mt76/mt76x2_mcu_common.c | 124 +++++++++++++++ drivers/net/wireless/mediatek/mt76/mt76x2_phy.c | 65 ++------ drivers/net/wireless/mediatek/mt76/mt76x2_phy_common.c | 49 +++++- drivers/net/wireless/mediatek/mt76/mt76x2_tx.c | 5 +- drivers/net/wireless/mediatek/mt76/mt76x2_tx_common.c | 39 +---- drivers/net/wireless/mediatek/mt76/mt76x2_usb.c | 2 + drivers/net/wireless/mediatek/mt76/mt76x2u.h | 16 +- drivers/net/wireless/mediatek/mt76/mt76x2u_core.c | 69 +-------- drivers/net/wireless/mediatek/mt76/mt76x2u_init.c | 13 +- drivers/net/wireless/mediatek/mt76/mt76x2u_main.c | 22 +-- drivers/net/wireless/mediatek/mt76/mt76x2u_mcu.c | 210 +++---------------------- drivers/net/wireless/mediatek/mt76/mt76x2u_phy.c | 67 ++------ drivers/net/wireless/mediatek/mt76/tx.c | 16 ++ drivers/net/wireless/mediatek/mt76/usb.c | 105 ++++++++----- drivers/net/wireless/mediatek/mt76/usb_mcu.c | 242 ----------------------------- 61 files changed, 2759 insertions(+), 4374 deletions(-) delete mode 100644 drivers/net/wireless/mediatek/mt76/mt76x0/dma.c delete mode 100644 drivers/net/wireless/mediatek/mt76/mt76x0/mcu.c create mode 100644 drivers/net/wireless/mediatek/mt76/mt76x0/pci.c delete mode 100644 drivers/net/wireless/mediatek/mt76/mt76x0/usb.h delete mode 100644 drivers/net/wireless/mediatek/mt76/mt76x0/util.c create mode 100644 drivers/net/wireless/mediatek/mt76/mt76x02_dma.h create mode 100644 drivers/net/wireless/mediatek/mt76/mt76x02_mcu.c create mode 100644 drivers/net/wireless/mediatek/mt76/mt76x02_mcu.h rename drivers/net/wireless/mediatek/mt76/{mt76x2_dma.h => mt76x02_usb.h} (58%) create mode 100644 drivers/net/wireless/mediatek/mt76/mt76x02_usb_core.c create mode 100644 drivers/net/wireless/mediatek/mt76/mt76x02_usb_mcu.c create mode 100644 drivers/net/wireless/mediatek/mt76/mt76x2_mcu_common.c