From patchwork Mon Aug 17 09:06:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen Pais X-Patchwork-Id: 259597 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 811E9C433E1 for ; Mon, 17 Aug 2020 09:07:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5AB5B2063A for ; Mon, 17 Aug 2020 09:07:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="tsfmRDS7" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728636AbgHQJHF (ORCPT ); Mon, 17 Aug 2020 05:07:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59236 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726795AbgHQJHB (ORCPT ); Mon, 17 Aug 2020 05:07:01 -0400 Received: from mail-pj1-x1041.google.com (mail-pj1-x1041.google.com [IPv6:2607:f8b0:4864:20::1041]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DEB21C061389; Mon, 17 Aug 2020 02:07:00 -0700 (PDT) Received: by mail-pj1-x1041.google.com with SMTP id c6so7507405pje.1; Mon, 17 Aug 2020 02:07:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=73OEUlzheqIr65mDZYXuVcZPnRGe22jWdsxi0fOe4yw=; b=tsfmRDS7/ZwPrkBLeeJVYo7rbSBfGZR8cuQarVTYp2KBssYvgGNOpYHX8hZNbc7rlU xVVWBiO67fgAByG4DH9fnKstotFNHJGyd4iAYokm3UGvYRQENrtHwAJ41fRpFMlZvo+9 pG2sreBnGZ8m41lyDp4iugkgW6Cm8/51bRk0u9/NEAQFpyFLjUC7ZkDgMmSbo0Hj6Afd NoarQT9/b8O0xGHKLWNLD0QUuEzW/P4iBU1inazN0IVcOpMO8KknUsVId7NiFvGn8IUx MPmYJLdITw3DTnZ88DicJeAHmjpXgWxTxPK7SRxVFsnjI8RKs6vNQNrxBIntwEvW8ZcM Tf4A== 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:in-reply-to :references; bh=73OEUlzheqIr65mDZYXuVcZPnRGe22jWdsxi0fOe4yw=; b=UzyqHKC/UgiD2/MsYLMGM0Gh3Ro20l2d3SbX5RLqoAieUCDar1DFTcreuP6FcfDyr4 udhl37oycsGWqkHs++u1or+Bio5IMzMwY/RsFm+tevsUnWn0oze4zJBs5SKLOGi5PUiW j1rS/AyOsKtVy59imqGGUD95ljTZz2HJKGxY5bNbC2wBZsxKMUv5V4j56ESvnSNy5jV1 tB8gohYV9+fiXcEEyjJq99DorNKgPN/itc63TKPrGmFbEiQtuo9ahSMxO5B1ChixMNEt g5Qsmg310N4oPF2iHrZgc8fPhNi3Yt9QuBoLPyF2e04C+xMzGTk85kI+qyNbajbRPzOU AKog== X-Gm-Message-State: AOAM533g3FpO5dXvCG2i/4cjzNEoyqdPGvqCeK3jWjObx6DH5f/U8PvK GIZIxO1J3Q6dMyfrVrDvLB0ZCk1+jrsWZg== X-Google-Smtp-Source: ABdhPJxahlAjTcIFdW6z0ysUPrm1Yr8wdrpdQtZoWr4mGMWgf/X4V//25uccjoU3huBe+x3AYVgxgg== X-Received: by 2002:a17:90a:7345:: with SMTP id j5mr11274057pjs.168.1597655220434; Mon, 17 Aug 2020 02:07:00 -0700 (PDT) Received: from localhost.localdomain ([49.207.202.98]) by smtp.gmail.com with ESMTPSA id t14sm16616237pgb.51.2020.08.17.02.06.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Aug 2020 02:06:59 -0700 (PDT) From: Allen Pais To: kvalo@codeaurora.org, kuba@kernel.org, jirislaby@kernel.org, mickflemm@gmail.com, mcgrof@kernel.org, chunkeey@googlemail.com, Larry.Finger@lwfinger.net, stas.yakovlev@gmail.com, helmut.schaa@googlemail.com, pkshih@realtek.com, yhchuang@realtek.com, dsd@gentoo.org, kune@deine-taler.de Cc: keescook@chromium.org, ath11k@lists.infradead.org, linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, b43-dev@lists.infradead.org, brcm80211-dev-list.pdl@broadcom.com, brcm80211-dev-list@cypress.com, Allen Pais , Romain Perier Subject: [PATCH 01/16] wireless: ath5k: convert tasklets to use new tasklet_setup() API Date: Mon, 17 Aug 2020 14:36:22 +0530 Message-Id: <20200817090637.26887-2-allen.cryptic@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200817090637.26887-1-allen.cryptic@gmail.com> References: <20200817090637.26887-1-allen.cryptic@gmail.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Allen Pais In preparation for unconditionally passing the struct tasklet_struct pointer to all tasklet callbacks, switch to using the new tasklet_setup() and from_tasklet() to pass the tasklet pointer explicitly. Signed-off-by: Romain Perier Signed-off-by: Allen Pais --- drivers/net/wireless/ath/ath5k/base.c | 24 ++++++++++++------------ drivers/net/wireless/ath/ath5k/rfkill.c | 7 +++---- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c index 65a4c142640d..2781dcd534a9 100644 --- a/drivers/net/wireless/ath/ath5k/base.c +++ b/drivers/net/wireless/ath/ath5k/base.c @@ -1536,12 +1536,12 @@ ath5k_set_current_imask(struct ath5k_hw *ah) } static void -ath5k_tasklet_rx(unsigned long data) +ath5k_tasklet_rx(struct tasklet_struct *t) { struct ath5k_rx_status rs = {}; struct sk_buff *skb, *next_skb; dma_addr_t next_skb_addr; - struct ath5k_hw *ah = (void *)data; + struct ath5k_hw *ah = from_tasklet(ah, t, rxtq); struct ath_common *common = ath5k_hw_common(ah); struct ath5k_buf *bf; struct ath5k_desc *ds; @@ -1784,10 +1784,10 @@ ath5k_tx_processq(struct ath5k_hw *ah, struct ath5k_txq *txq) } static void -ath5k_tasklet_tx(unsigned long data) +ath5k_tasklet_tx(struct tasklet_struct *t) { int i; - struct ath5k_hw *ah = (void *)data; + struct ath5k_hw *ah = from_tasklet(ah, t, txtq); for (i = 0; i < AR5K_NUM_TX_QUEUES; i++) if (ah->txqs[i].setup && (ah->ah_txq_isr_txok_all & BIT(i))) @@ -2176,9 +2176,9 @@ ath5k_beacon_config(struct ath5k_hw *ah) spin_unlock_bh(&ah->block); } -static void ath5k_tasklet_beacon(unsigned long data) +static void ath5k_tasklet_beacon(struct tasklet_struct *t) { - struct ath5k_hw *ah = (struct ath5k_hw *) data; + struct ath5k_hw *ah = from_tasklet(ah, t, beacontq); /* * Software beacon alert--time to send a beacon. @@ -2447,9 +2447,9 @@ ath5k_calibrate_work(struct work_struct *work) static void -ath5k_tasklet_ani(unsigned long data) +ath5k_tasklet_ani(struct tasklet_struct *t) { - struct ath5k_hw *ah = (void *)data; + struct ath5k_hw *ah = from_tasklet(ah, t, ani_tasklet); ah->ah_cal_mask |= AR5K_CALIBRATION_ANI; ath5k_ani_calibration(ah); @@ -3069,10 +3069,10 @@ ath5k_init(struct ieee80211_hw *hw) hw->queues = 1; } - tasklet_init(&ah->rxtq, ath5k_tasklet_rx, (unsigned long)ah); - tasklet_init(&ah->txtq, ath5k_tasklet_tx, (unsigned long)ah); - tasklet_init(&ah->beacontq, ath5k_tasklet_beacon, (unsigned long)ah); - tasklet_init(&ah->ani_tasklet, ath5k_tasklet_ani, (unsigned long)ah); + tasklet_setup(&ah->rxtq, ath5k_tasklet_rx); + tasklet_setup(&ah->txtq, ath5k_tasklet_tx); + tasklet_setup(&ah->beacontq, ath5k_tasklet_beacon); + tasklet_setup(&ah->ani_tasklet, ath5k_tasklet_ani); INIT_WORK(&ah->reset_work, ath5k_reset_work); INIT_WORK(&ah->calib_work, ath5k_calibrate_work); diff --git a/drivers/net/wireless/ath/ath5k/rfkill.c b/drivers/net/wireless/ath/ath5k/rfkill.c index 270a319f3aeb..855ed7fc720d 100644 --- a/drivers/net/wireless/ath/ath5k/rfkill.c +++ b/drivers/net/wireless/ath/ath5k/rfkill.c @@ -73,9 +73,9 @@ ath5k_is_rfkill_set(struct ath5k_hw *ah) } static void -ath5k_tasklet_rfkill_toggle(unsigned long data) +ath5k_tasklet_rfkill_toggle(struct tasklet_struct *t) { - struct ath5k_hw *ah = (void *)data; + struct ath5k_hw *ah = from_tasklet(ah, t, rf_kill.toggleq); bool blocked; blocked = ath5k_is_rfkill_set(ah); @@ -90,8 +90,7 @@ ath5k_rfkill_hw_start(struct ath5k_hw *ah) ah->rf_kill.gpio = ah->ah_capabilities.cap_eeprom.ee_rfkill_pin; ah->rf_kill.polarity = ah->ah_capabilities.cap_eeprom.ee_rfkill_pol; - tasklet_init(&ah->rf_kill.toggleq, ath5k_tasklet_rfkill_toggle, - (unsigned long)ah); + tasklet_setup(&ah->rf_kill.toggleq, ath5k_tasklet_rfkill_toggle); ath5k_rfkill_disable(ah); From patchwork Mon Aug 17 09:06:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen Pais X-Patchwork-Id: 259596 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6D947C433E1 for ; Mon, 17 Aug 2020 09:07:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3313C2063A for ; Mon, 17 Aug 2020 09:07:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="g0cmPZRh" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728785AbgHQJHr (ORCPT ); Mon, 17 Aug 2020 05:07:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59302 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727807AbgHQJHZ (ORCPT ); Mon, 17 Aug 2020 05:07:25 -0400 Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A84CBC061389; Mon, 17 Aug 2020 02:07:25 -0700 (PDT) Received: by mail-pf1-x444.google.com with SMTP id y206so7898279pfb.10; Mon, 17 Aug 2020 02:07:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=MGsv8A1wVj28a3UQWL19W4pLCqNK/n7XN47Mle0gRf0=; b=g0cmPZRhcILxoEnjZPRTGxSCc+cAfwGWvZIKj7Y+pbzSNHFFO2zTQQN9KYG+34IVwa j3TmLzAjPiU619fIp3yeL9Igsl1XpItyWHlMwXbOP7+NgYacG0jRF242DFUmHleurIWx 3Y9yWFTnEOJRCJ7ZC4Vn5W6OcqD4DBy4D9poqtyW+dZlaE7K1b4SArKNzEJ3d2lbjgOx TZUC0SBVVAbOR/qPbgoQgp2C3i3Lg0InJUuvelxpeog5G6YJQfg7UmMBEVCwRQum8OL3 Pu1TYq++IQhlG3AKR4qVlVTeSx4EWsVGlBlyUvUlbVpvEEs8bNk+kbthRmKlEmH2HNmW Qhmg== 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:in-reply-to :references; bh=MGsv8A1wVj28a3UQWL19W4pLCqNK/n7XN47Mle0gRf0=; b=lv5uD/JrecHpt+48D85K+DfMyKdvDVsJj4uxu0QOA8rQ4tcWPj67veTazwVEUwcKsJ nCFHAS0PLJ1fNjh/jiqQwzWLm/OKgTtaSZoBYOZHSc8n/PTxAdFpHsOdX9Fb2eCBtyAQ XftxlmfoQP42qb3tuxD5lE+bgAm4r+lYRdYYYJz1Bv5u6MZrtG0LVRRxE65fFSlrTWbC ZhF4ExoWJjZaVIl63R8AKowj3x/+ceDSwJQ/tx8XmO80HQBuq1xSrJdgCizKW3qcoDSh T/1zAA7BEf6xqpS1l03acC/K5ZcXlY1mwqV7029/KU6QQkTe72d0cO0eosJkdsQ9hUXl 77Dg== X-Gm-Message-State: AOAM533f6wa75+TdxIP+n1JTLS/GY9cqt3Xf8QoO/GJfl1nuXIrOF0+J CiMPo4wq+XSeiN5efWU7hkM= X-Google-Smtp-Source: ABdhPJyIoQbr9T/8qnWekXPjsOiorbPCvMa//vMXiCVBRpI1R33p2QuX6J5OeDaVuSprkarw2Orp4w== X-Received: by 2002:a63:3241:: with SMTP id y62mr9589717pgy.305.1597655245210; Mon, 17 Aug 2020 02:07:25 -0700 (PDT) Received: from localhost.localdomain ([49.207.202.98]) by smtp.gmail.com with ESMTPSA id t14sm16616237pgb.51.2020.08.17.02.07.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Aug 2020 02:07:24 -0700 (PDT) From: Allen Pais To: kvalo@codeaurora.org, kuba@kernel.org, jirislaby@kernel.org, mickflemm@gmail.com, mcgrof@kernel.org, chunkeey@googlemail.com, Larry.Finger@lwfinger.net, stas.yakovlev@gmail.com, helmut.schaa@googlemail.com, pkshih@realtek.com, yhchuang@realtek.com, dsd@gentoo.org, kune@deine-taler.de Cc: keescook@chromium.org, ath11k@lists.infradead.org, linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, b43-dev@lists.infradead.org, brcm80211-dev-list.pdl@broadcom.com, brcm80211-dev-list@cypress.com, Allen Pais Subject: [PATCH 04/16] wireless: ath11k: convert tasklets to use new tasklet_setup() API Date: Mon, 17 Aug 2020 14:36:25 +0530 Message-Id: <20200817090637.26887-5-allen.cryptic@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200817090637.26887-1-allen.cryptic@gmail.com> References: <20200817090637.26887-1-allen.cryptic@gmail.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Allen Pais In preparation for unconditionally passing the struct tasklet_struct pointer to all tasklet callbacks, switch to using the new tasklet_setup() and from_tasklet() to pass the tasklet pointer explicitly. Signed-off-by: Allen Pais --- drivers/net/wireless/ath/ath11k/ahb.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/ath/ath11k/ahb.c b/drivers/net/wireless/ath/ath11k/ahb.c index 30092841ac46..28d7e833e27f 100644 --- a/drivers/net/wireless/ath/ath11k/ahb.c +++ b/drivers/net/wireless/ath/ath11k/ahb.c @@ -675,9 +675,9 @@ static void ath11k_ahb_free_irq(struct ath11k_base *ab) ath11k_ahb_free_ext_irq(ab); } -static void ath11k_ahb_ce_tasklet(unsigned long data) +static void ath11k_ahb_ce_tasklet(struct tasklet_struct *t) { - struct ath11k_ce_pipe *ce_pipe = (struct ath11k_ce_pipe *)data; + struct ath11k_ce_pipe *ce_pipe = from_tasklet(ce_pipe, t, intr_tq); ath11k_ce_per_engine_service(ce_pipe->ab, ce_pipe->pipe_num); @@ -827,8 +827,7 @@ static int ath11k_ahb_config_irq(struct ath11k_base *ab) irq_idx = ATH11K_IRQ_CE0_OFFSET + i; - tasklet_init(&ce_pipe->intr_tq, ath11k_ahb_ce_tasklet, - (unsigned long)ce_pipe); + tasklet_setup(&ce_pipe->intr_tq, ath11k_ahb_ce_tasklet); irq = platform_get_irq_byname(ab->pdev, irq_name[irq_idx]); ret = request_irq(irq, ath11k_ahb_ce_interrupt_handler, IRQF_TRIGGER_RISING, irq_name[irq_idx], From patchwork Mon Aug 17 09:06:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen Pais X-Patchwork-Id: 259590 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 22FECC433DF for ; Mon, 17 Aug 2020 09:10:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EB1CB2063A for ; Mon, 17 Aug 2020 09:10:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bUpe3lkH" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728165AbgHQJKS (ORCPT ); Mon, 17 Aug 2020 05:10:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59346 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726876AbgHQJHl (ORCPT ); Mon, 17 Aug 2020 05:07:41 -0400 Received: from mail-pl1-x643.google.com (mail-pl1-x643.google.com [IPv6:2607:f8b0:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77BB9C061389; Mon, 17 Aug 2020 02:07:41 -0700 (PDT) Received: by mail-pl1-x643.google.com with SMTP id y10so5622143plr.11; Mon, 17 Aug 2020 02:07:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=2IBGDTRlqNvahuHmxcRRXVtAp4AqF0ucZxlKJk+dn2M=; b=bUpe3lkHHiWeE9fypq5FMRZVDtUY8VoTccue34JGh/9p2k4OhRzS6BjyY4Bd9qTRiD HcbcBOCidPnkUlckjG0pQpPr3SBnPnm+On29sqxfzZdLsl8FQ7OvWGY8atHAg53TIKUP Nhm3LAImHY0LceA50ndVDTenrCowNHDuP0rucbFJFtN5rJxnQgq+F+Qtc3cYgh8nXF4H hKgi+3LEO2QPnAJoz2HAsTmDwJrUArE1nTbsBra+um9cAwBjBM9gv4zgoaVU4haxTTFW SyDjDgB7rO++ebAZ/h9uwZDeZuM5jI4l1DhA2tmsoxy4eKcodtYoitoHwHh61f9+CApm x/aA== 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:in-reply-to :references; bh=2IBGDTRlqNvahuHmxcRRXVtAp4AqF0ucZxlKJk+dn2M=; b=ulOpr+TJEwOi8bVZH9JpQH39kUxgQfQq5sSk/a9Sa4zVladYWAjwFGD8RaRC9jY12P LLs8R0E/tP3JDTbTEEw2a/GZKcL2MYwpJYCp1WIg8p8A81N90m8RIzmvm2gfJZE1hMym L02UewghV+IBcTr/a+X/UxLHh7caNn5NeOzEF/eL710g5+KUnrrKX045aTC6fNW7jQlt HZG9krh4wOHUCNRv4gfoQCFbAhnsFqRSI2pIiCUmrqJVmyl+E5LuTG82cdF1jwU0Jv44 fQErh6ffWSFH40bPcLabNw/fAlfvlOf87arE6/aah6kc5rwptSYrBxyTCb9fbUqCg17n bxpw== X-Gm-Message-State: AOAM533AvG+0NLBTmBsRuHlPmiUwvaBM5++ShhgFegRKnP4kykvfCm6q O4mLUI1/yeVWDIgeoOa5JN0= X-Google-Smtp-Source: ABdhPJzNy7hxGHuoAT9Ds/zo0r/p3Xdwvw7xt6TvMKktGn938rhVPwowpw50RfYo/4rBLuS0/Azjfg== X-Received: by 2002:a17:902:c111:: with SMTP id 17mr9611024pli.46.1597655260971; Mon, 17 Aug 2020 02:07:40 -0700 (PDT) Received: from localhost.localdomain ([49.207.202.98]) by smtp.gmail.com with ESMTPSA id t14sm16616237pgb.51.2020.08.17.02.07.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Aug 2020 02:07:40 -0700 (PDT) From: Allen Pais To: kvalo@codeaurora.org, kuba@kernel.org, jirislaby@kernel.org, mickflemm@gmail.com, mcgrof@kernel.org, chunkeey@googlemail.com, Larry.Finger@lwfinger.net, stas.yakovlev@gmail.com, helmut.schaa@googlemail.com, pkshih@realtek.com, yhchuang@realtek.com, dsd@gentoo.org, kune@deine-taler.de Cc: keescook@chromium.org, ath11k@lists.infradead.org, linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, b43-dev@lists.infradead.org, brcm80211-dev-list.pdl@broadcom.com, brcm80211-dev-list@cypress.com, Allen Pais , Romain Perier Subject: [PATCH 06/16] wireless: b43legacy: convert tasklets to use new tasklet_setup() API Date: Mon, 17 Aug 2020 14:36:27 +0530 Message-Id: <20200817090637.26887-7-allen.cryptic@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200817090637.26887-1-allen.cryptic@gmail.com> References: <20200817090637.26887-1-allen.cryptic@gmail.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Allen Pais In preparation for unconditionally passing the struct tasklet_struct pointer to all tasklet callbacks, switch to using the new tasklet_setup() and from_tasklet() to pass the tasklet pointer explicitly. Signed-off-by: Romain Perier Signed-off-by: Allen Pais --- drivers/net/wireless/broadcom/b43legacy/main.c | 8 +++----- drivers/net/wireless/broadcom/b43legacy/pio.c | 7 +++---- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/drivers/net/wireless/broadcom/b43legacy/main.c b/drivers/net/wireless/broadcom/b43legacy/main.c index 2eaf481f03f1..15d592cf056c 100644 --- a/drivers/net/wireless/broadcom/b43legacy/main.c +++ b/drivers/net/wireless/broadcom/b43legacy/main.c @@ -1275,9 +1275,9 @@ static void handle_irq_ucode_debug(struct b43legacy_wldev *dev) } /* Interrupt handler bottom-half */ -static void b43legacy_interrupt_tasklet(unsigned long data) +static void b43legacy_interrupt_tasklet(struct tasklet_struct *t) { - struct b43legacy_wldev *dev = (struct b43legacy_wldev *)data; + struct b43legacy_wldev *dev = from_tasklet(dev, t, isr_tasklet); u32 reason; u32 dma_reason[ARRAY_SIZE(dev->dma_reason)]; u32 merged_dma_reason = 0; @@ -3741,9 +3741,7 @@ static int b43legacy_one_core_attach(struct ssb_device *dev, wldev->wl = wl; b43legacy_set_status(wldev, B43legacy_STAT_UNINIT); wldev->bad_frames_preempt = modparam_bad_frames_preempt; - tasklet_init(&wldev->isr_tasklet, - b43legacy_interrupt_tasklet, - (unsigned long)wldev); + tasklet_setup(&wldev->isr_tasklet, b43legacy_interrupt_tasklet); if (modparam_pio) wldev->__using_pio = true; INIT_LIST_HEAD(&wldev->list); diff --git a/drivers/net/wireless/broadcom/b43legacy/pio.c b/drivers/net/wireless/broadcom/b43legacy/pio.c index cbb761378619..aac413d0f629 100644 --- a/drivers/net/wireless/broadcom/b43legacy/pio.c +++ b/drivers/net/wireless/broadcom/b43legacy/pio.c @@ -264,9 +264,9 @@ static int pio_tx_packet(struct b43legacy_pio_txpacket *packet) return 0; } -static void tx_tasklet(unsigned long d) +static void tx_tasklet(struct tasklet_struct *t) { - struct b43legacy_pioqueue *queue = (struct b43legacy_pioqueue *)d; + struct b43legacy_pioqueue *queue = from_tasklet(queue, t, txtask); struct b43legacy_wldev *dev = queue->dev; unsigned long flags; struct b43legacy_pio_txpacket *packet, *tmp_packet; @@ -331,8 +331,7 @@ struct b43legacy_pioqueue *b43legacy_setup_pioqueue(struct b43legacy_wldev *dev, INIT_LIST_HEAD(&queue->txfree); INIT_LIST_HEAD(&queue->txqueue); INIT_LIST_HEAD(&queue->txrunning); - tasklet_init(&queue->txtask, tx_tasklet, - (unsigned long)queue); + tasklet_setup(&queue->txtask, tx_tasklet); value = b43legacy_read32(dev, B43legacy_MMIO_MACCTL); value &= ~B43legacy_MACCTL_BE; From patchwork Mon Aug 17 09:06:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen Pais X-Patchwork-Id: 259591 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A76CAC433DF for ; Mon, 17 Aug 2020 09:10:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 84FB82080D for ; Mon, 17 Aug 2020 09:10:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="HklbjWKA" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728269AbgHQJJ4 (ORCPT ); Mon, 17 Aug 2020 05:09:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728786AbgHQJHt (ORCPT ); Mon, 17 Aug 2020 05:07:49 -0400 Received: from mail-pj1-x1041.google.com (mail-pj1-x1041.google.com [IPv6:2607:f8b0:4864:20::1041]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD0CFC061342; Mon, 17 Aug 2020 02:07:48 -0700 (PDT) Received: by mail-pj1-x1041.google.com with SMTP id d4so7383714pjx.5; Mon, 17 Aug 2020 02:07:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=n+X9d5vT8SC5Pz64vMe7g5tLMlNwSaXJUm4aDGP4qA4=; b=HklbjWKAcCZdZeoSN/XgxzMU8/wRR2Auy4T9VjyP8XL3EIQu/B9o+zT6u5qH1TWRTO au79B2xEPMbiU4xrZ7zXzCQg2VLDMdMpeFEnijkByJRFPZk21pfGl8pTIGNrHe4rZ0ni dYqi+t1m58tLfCir+Phy7Nl8KTdaT/s097e8/hTweB1PlagUBuFpF8aWswX9j0LeZKWC SWAUNzK2TtD0qVupQ4jErl5/7mwh5liwf091mhsSzuXH9r+7nJpo8ac6gvpD2+63nUd0 leTlsxBQRsRxUbOwtInPSxCIdbsoxDt1COqkjCjyv37RC5EcRiqk8ywMT1xhU2a9+yso deDQ== 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:in-reply-to :references; bh=n+X9d5vT8SC5Pz64vMe7g5tLMlNwSaXJUm4aDGP4qA4=; b=YsltANe3mtkQ1ThVLUTf3gt3s8H1WY5KDpftSzSKsY8fVHEac3T+FmGu5+RoNRsTsa o+RYtl2xA1+lFC5SMKu48h2arsXJFR2VO857xYTMANwLMLE/xS/PRuZFeaBQ1IdHoHxO tOi8jVv8DMYRyCqiJMI6E6bmcefC5gyfQU4t99Hxasmaf3C44MZwD0rhacQjB5TubVSt t3xyDdU90WIOlP/gcyLJDJCZGCkZ9qDpid+oER003CZExF478IlKbQByp/OtugHTpY3H XCxdDQHPrAGlfPDK+meZldKWj889VI4VSicHcahpA/+6CzcIIxvhOHwVq9dx/Wo7I9SF 1tdw== X-Gm-Message-State: AOAM530s5DiV5PxAhNnSmx36E5gLF/jrgUQq/gJOWsc8XIGlatoxr8Pw Jmg1TskVqkdJOAU84c9QOi8= X-Google-Smtp-Source: ABdhPJyi1nfjNr696xImaFKXbCsrOUzUKLp19qvJx/y7bR1RGilmldIE98IAYhPWvrOKTAjfe6rlfA== X-Received: by 2002:a17:902:7484:: with SMTP id h4mr10089195pll.139.1597655268400; Mon, 17 Aug 2020 02:07:48 -0700 (PDT) Received: from localhost.localdomain ([49.207.202.98]) by smtp.gmail.com with ESMTPSA id t14sm16616237pgb.51.2020.08.17.02.07.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Aug 2020 02:07:47 -0700 (PDT) From: Allen Pais To: kvalo@codeaurora.org, kuba@kernel.org, jirislaby@kernel.org, mickflemm@gmail.com, mcgrof@kernel.org, chunkeey@googlemail.com, Larry.Finger@lwfinger.net, stas.yakovlev@gmail.com, helmut.schaa@googlemail.com, pkshih@realtek.com, yhchuang@realtek.com, dsd@gentoo.org, kune@deine-taler.de Cc: keescook@chromium.org, ath11k@lists.infradead.org, linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, b43-dev@lists.infradead.org, brcm80211-dev-list.pdl@broadcom.com, brcm80211-dev-list@cypress.com, Allen Pais , Romain Perier Subject: [PATCH 07/16] wireless: brcm80211: convert tasklets to use new tasklet_setup() API Date: Mon, 17 Aug 2020 14:36:28 +0530 Message-Id: <20200817090637.26887-8-allen.cryptic@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200817090637.26887-1-allen.cryptic@gmail.com> References: <20200817090637.26887-1-allen.cryptic@gmail.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Allen Pais In preparation for unconditionally passing the struct tasklet_struct pointer to all tasklet callbacks, switch to using the new tasklet_setup() and from_tasklet() to pass the tasklet pointer explicitly. Signed-off-by: Romain Perier Signed-off-by: Allen Pais --- .../net/wireless/broadcom/brcm80211/brcmsmac/mac80211_if.c | 6 +++--- .../net/wireless/broadcom/brcm80211/brcmsmac/mac80211_if.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/mac80211_if.c b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/mac80211_if.c index 648efcbc819f..521abe5ce5b8 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/mac80211_if.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/mac80211_if.c @@ -982,11 +982,11 @@ static const struct ieee80211_ops brcms_ops = { .set_tim = brcms_ops_beacon_set_tim, }; -void brcms_dpc(unsigned long data) +void brcms_dpc(struct tasklet_struct *t) { struct brcms_info *wl; - wl = (struct brcms_info *) data; + wl = from_tasklet(wl, t, tasklet); spin_lock_bh(&wl->lock); @@ -1149,7 +1149,7 @@ static struct brcms_info *brcms_attach(struct bcma_device *pdev) init_waitqueue_head(&wl->tx_flush_wq); /* setup the bottom half handler */ - tasklet_init(&wl->tasklet, brcms_dpc, (unsigned long) wl); + tasklet_setup(&wl->tasklet, brcms_dpc); spin_lock_init(&wl->lock); spin_lock_init(&wl->isr_lock); diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/mac80211_if.h b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/mac80211_if.h index 198053dfc310..eaf926a96a88 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/mac80211_if.h +++ b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/mac80211_if.h @@ -106,7 +106,7 @@ struct brcms_timer *brcms_init_timer(struct brcms_info *wl, void brcms_free_timer(struct brcms_timer *timer); void brcms_add_timer(struct brcms_timer *timer, uint ms, int periodic); bool brcms_del_timer(struct brcms_timer *timer); -void brcms_dpc(unsigned long data); +void brcms_dpc(struct tasklet_struct *t); void brcms_timer(struct brcms_timer *t); void brcms_fatal_error(struct brcms_info *wl); From patchwork Mon Aug 17 09:06:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen Pais X-Patchwork-Id: 259592 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A751BC433E3 for ; Mon, 17 Aug 2020 09:09:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7A18D2063A for ; Mon, 17 Aug 2020 09:09:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="THtE6gYB" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728695AbgHQJI0 (ORCPT ); Mon, 17 Aug 2020 05:08:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59420 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728179AbgHQJIF (ORCPT ); Mon, 17 Aug 2020 05:08:05 -0400 Received: from mail-pf1-x443.google.com (mail-pf1-x443.google.com [IPv6:2607:f8b0:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6063C061347; Mon, 17 Aug 2020 02:08:03 -0700 (PDT) Received: by mail-pf1-x443.google.com with SMTP id 74so7896655pfx.13; Mon, 17 Aug 2020 02:08:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=O5yUISL0n5UDVWTbrqgSqFJ+8un0wnfOhWT/JxFzWgU=; b=THtE6gYBzS3NJNRoDz41V470lbExfVM+Uv76yOpHQy6P0r8xs1svhnqBmf7GsSUyJ9 0OhkBtZ5PAN6RKOWkeyUSCb3niRwhko+isyeF4gb4C1TJQuCxHie5WSg0euWz8e/64b+ KfHpmXQAK8npYwyRVZz8g6iK7aanPSsLlin/b0AHzZn0rIkTgZVugtkYB9XIt+g0qlxM OIXr/2BJbpundJOcGmWtRGizakuH/mM/jLtAmQYn32O5lGqHO9qZfCVG7JVw7sDijVAq 0ewRCAbin84he/EdyU/BlWomEAyNc3S6H014rT2rRdNbuj5znR19FV3OLYb/f33A+8XT ZkbA== 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:in-reply-to :references; bh=O5yUISL0n5UDVWTbrqgSqFJ+8un0wnfOhWT/JxFzWgU=; b=CpXM5WcHwWbLX9ys7X+tJ/PDnzPqpe1HIVapIYbYQt/R1v7sAoGf7Rl7zpijcMq42I Taiw0gp/uRy8p1djkwXv1t0JJ4sLLHDgumTw1zrOxEiUhENw1Y0w3O/Qt8OAo5km/ssk xSUtBJSYwfOPZ5DNkH++69sx1ajKBlPI6T4ZAYg/yXFP1jIrVAG3q3NFLzIcWszz4E1V s0Bmhnplv4E2OYEj2OExSgo3x9a/vdUvgzq5th+RkraO3N/kmDW1nQyHhCc6BwLCkMIX C10fOd8Fs3B7WPc4/bis+GgBrq8vsJZPahaw4t8O63YCx0Ioye06PgjpGG+t+LwPy4DQ RFJQ== X-Gm-Message-State: AOAM532GjMSUdJXOSpVloIEnZlcujT6yTW8aXbtSrqodP6VP5V7DTDzg Q+72/YiSNMlCPOUXPuhWAmU= X-Google-Smtp-Source: ABdhPJx7a7b9XqfiJheNfprZ6SjPVpk7DN4CXcJ6/Hoyh5xc/cTtA43nxillzq8XLt/TaWHc8YdwWQ== X-Received: by 2002:aa7:9493:: with SMTP id z19mr10706326pfk.190.1597655283311; Mon, 17 Aug 2020 02:08:03 -0700 (PDT) Received: from localhost.localdomain ([49.207.202.98]) by smtp.gmail.com with ESMTPSA id t14sm16616237pgb.51.2020.08.17.02.07.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Aug 2020 02:08:02 -0700 (PDT) From: Allen Pais To: kvalo@codeaurora.org, kuba@kernel.org, jirislaby@kernel.org, mickflemm@gmail.com, mcgrof@kernel.org, chunkeey@googlemail.com, Larry.Finger@lwfinger.net, stas.yakovlev@gmail.com, helmut.schaa@googlemail.com, pkshih@realtek.com, yhchuang@realtek.com, dsd@gentoo.org, kune@deine-taler.de Cc: keescook@chromium.org, ath11k@lists.infradead.org, linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, b43-dev@lists.infradead.org, brcm80211-dev-list.pdl@broadcom.com, brcm80211-dev-list@cypress.com, Allen Pais , Romain Perier Subject: [PATCH 09/16] wireless: iwlegacy: convert tasklets to use new tasklet_setup() API Date: Mon, 17 Aug 2020 14:36:30 +0530 Message-Id: <20200817090637.26887-10-allen.cryptic@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200817090637.26887-1-allen.cryptic@gmail.com> References: <20200817090637.26887-1-allen.cryptic@gmail.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Allen Pais In preparation for unconditionally passing the struct tasklet_struct pointer to all tasklet callbacks, switch to using the new tasklet_setup() and from_tasklet() to pass the tasklet pointer explicitly. Signed-off-by: Romain Perier Signed-off-by: Allen Pais --- drivers/net/wireless/intel/iwlegacy/3945-mac.c | 8 +++----- drivers/net/wireless/intel/iwlegacy/4965-mac.c | 8 +++----- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/drivers/net/wireless/intel/iwlegacy/3945-mac.c b/drivers/net/wireless/intel/iwlegacy/3945-mac.c index 9167c3d2711d..5fe98bbefc56 100644 --- a/drivers/net/wireless/intel/iwlegacy/3945-mac.c +++ b/drivers/net/wireless/intel/iwlegacy/3945-mac.c @@ -1374,9 +1374,9 @@ il3945_dump_nic_error_log(struct il_priv *il) } static void -il3945_irq_tasklet(unsigned long data) +il3945_irq_tasklet(struct tasklet_struct *t) { - struct il_priv *il = (struct il_priv *)data; + struct il_priv *il = from_tasklet(il, t, irq_tasklet); u32 inta, handled = 0; u32 inta_fh; unsigned long flags; @@ -3399,9 +3399,7 @@ il3945_setup_deferred_work(struct il_priv *il) timer_setup(&il->watchdog, il_bg_watchdog, 0); - tasklet_init(&il->irq_tasklet, - il3945_irq_tasklet, - (unsigned long)il); + tasklet_setup(&il->irq_tasklet, il3945_irq_tasklet); } static void diff --git a/drivers/net/wireless/intel/iwlegacy/4965-mac.c b/drivers/net/wireless/intel/iwlegacy/4965-mac.c index e73c223a7d28..afc54c63c4c6 100644 --- a/drivers/net/wireless/intel/iwlegacy/4965-mac.c +++ b/drivers/net/wireless/intel/iwlegacy/4965-mac.c @@ -4344,9 +4344,9 @@ il4965_synchronize_irq(struct il_priv *il) } static void -il4965_irq_tasklet(unsigned long data) +il4965_irq_tasklet(struct tasklet_struct *t) { - struct il_priv *il = (struct il_priv *)data; + struct il_priv *il = from_tasklet(il, t, irq_tasklet); u32 inta, handled = 0; u32 inta_fh; unsigned long flags; @@ -6238,9 +6238,7 @@ il4965_setup_deferred_work(struct il_priv *il) timer_setup(&il->watchdog, il_bg_watchdog, 0); - tasklet_init(&il->irq_tasklet, - il4965_irq_tasklet, - (unsigned long)il); + tasklet_setup(&il->irq_tasklet, il4965_irq_tasklet); } static void From patchwork Mon Aug 17 09:06:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen Pais X-Patchwork-Id: 259595 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 73943C433DF for ; Mon, 17 Aug 2020 09:08:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3DD4C2063A for ; Mon, 17 Aug 2020 09:08:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="qXUGS1RM" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727927AbgHQJI1 (ORCPT ); Mon, 17 Aug 2020 05:08:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59464 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728087AbgHQJIV (ORCPT ); Mon, 17 Aug 2020 05:08:21 -0400 Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C8062C06138A; Mon, 17 Aug 2020 02:08:18 -0700 (PDT) Received: by mail-pg1-x541.google.com with SMTP id p37so7816186pgl.3; Mon, 17 Aug 2020 02:08:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=6sU8o1XQWmR2sc7LetPQwvecEyprB+Gwia5I48gR5I8=; b=qXUGS1RMqtA2xbUCujNZntnf2zOYYcE4h+WiPza4dc2NxIOQswDgtwqqFOqtfM6jgC QuPK4TVQO9JSJ4I9FqbXKzWHKoUV9OR1GBGMMdT4TvLd6U8K9zRNhWk/oIz7pL+upc/s Yp1OG7Ab2JGPN3/+SRfK22DJjo8TVGcxcDYk1usgMWMU9cvO48EffkFfAiCqd9dMcv6E 9J788afLBfzzkubzeWyn5SsGC46VcFAV2NFjBPlRNM1lYvubWAAHatDIbjpESVOW8nQp uzcFM8Ey1dfVFDbdyp3UKtEQxPt9zLE3MjO4bZvlfFdv2PJkh1UZKYJnKIGmth6UIQge AJDg== 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:in-reply-to :references; bh=6sU8o1XQWmR2sc7LetPQwvecEyprB+Gwia5I48gR5I8=; b=VvG39ZUs9mZeE6tnDJAiuDvIy3Yg1kIixT9Tgyp59WgdQvY7/QiINyWMA87OvPRtDX nAvHqeZINayACQkutEqCtlQ2Dd88hUJ9porX19K4MBSg9lX6d4DFALQ5inls67Wd72Mz MkJlWE+6JUZtW5KFHOQV9TfVQivB6M9ikTggHdX6d3dnSTY983A66GVSc1kIT1TOt1I2 U3sSzB4xLDuLiex78iWiWOWkmSdjIeIm8z22MJdTasr+6Z3O84A6OxtZQiXUg760N0QL cdrj7mB/ml2F4sjeHdicW7M8zAr90KBjLUmVX2TB/ii7on2NS4ZYkb3ScKrkwKASPDDx lSKQ== X-Gm-Message-State: AOAM531YZN+5qDpIXRbUbipbPhN99POIWopowFQgjWyPr4Nh9yQYQnCz NWbJdYoV340bCENJsw3Zbko= X-Google-Smtp-Source: ABdhPJzR0Lmnn1LKu2ZlXZNS9fQDRnVIaqr85aSxwYitxzM90mPxjkiagXju+vNO4oP8X/WAoR5E4w== X-Received: by 2002:a63:5049:: with SMTP id q9mr9560233pgl.219.1597655298339; Mon, 17 Aug 2020 02:08:18 -0700 (PDT) Received: from localhost.localdomain ([49.207.202.98]) by smtp.gmail.com with ESMTPSA id t14sm16616237pgb.51.2020.08.17.02.08.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Aug 2020 02:08:17 -0700 (PDT) From: Allen Pais To: kvalo@codeaurora.org, kuba@kernel.org, jirislaby@kernel.org, mickflemm@gmail.com, mcgrof@kernel.org, chunkeey@googlemail.com, Larry.Finger@lwfinger.net, stas.yakovlev@gmail.com, helmut.schaa@googlemail.com, pkshih@realtek.com, yhchuang@realtek.com, dsd@gentoo.org, kune@deine-taler.de Cc: keescook@chromium.org, ath11k@lists.infradead.org, linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, b43-dev@lists.infradead.org, brcm80211-dev-list.pdl@broadcom.com, brcm80211-dev-list@cypress.com, Allen Pais , Romain Perier Subject: [PATCH 11/16] wireless: marvell: convert tasklets to use new tasklet_setup() API Date: Mon, 17 Aug 2020 14:36:32 +0530 Message-Id: <20200817090637.26887-12-allen.cryptic@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200817090637.26887-1-allen.cryptic@gmail.com> References: <20200817090637.26887-1-allen.cryptic@gmail.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Allen Pais In preparation for unconditionally passing the struct tasklet_struct pointer to all tasklet callbacks, switch to using the new tasklet_setup() and from_tasklet() to pass the tasklet pointer explicitly. Signed-off-by: Romain Perier Signed-off-by: Allen Pais --- drivers/net/wireless/marvell/mwl8k.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/net/wireless/marvell/mwl8k.c b/drivers/net/wireless/marvell/mwl8k.c index 97f23f93f6e7..23efd7075df6 100644 --- a/drivers/net/wireless/marvell/mwl8k.c +++ b/drivers/net/wireless/marvell/mwl8k.c @@ -4630,10 +4630,10 @@ static irqreturn_t mwl8k_interrupt(int irq, void *dev_id) return IRQ_HANDLED; } -static void mwl8k_tx_poll(unsigned long data) +static void mwl8k_tx_poll(struct tasklet_struct *t) { - struct ieee80211_hw *hw = (struct ieee80211_hw *)data; - struct mwl8k_priv *priv = hw->priv; + struct mwl8k_priv *priv = from_tasklet(priv, t, poll_tx_task); + struct ieee80211_hw *hw = pci_get_drvdata(priv->pdev); int limit; int i; @@ -4659,10 +4659,10 @@ static void mwl8k_tx_poll(unsigned long data) } } -static void mwl8k_rx_poll(unsigned long data) +static void mwl8k_rx_poll(struct tasklet_struct *t) { - struct ieee80211_hw *hw = (struct ieee80211_hw *)data; - struct mwl8k_priv *priv = hw->priv; + struct mwl8k_priv *priv = from_tasklet(priv, t, poll_rx_task); + struct ieee80211_hw *hw = pci_get_drvdata(priv->pdev); int limit; limit = 32; @@ -6120,9 +6120,9 @@ static int mwl8k_firmware_load_success(struct mwl8k_priv *priv) INIT_WORK(&priv->fw_reload, mwl8k_hw_restart_work); /* TX reclaim and RX tasklets. */ - tasklet_init(&priv->poll_tx_task, mwl8k_tx_poll, (unsigned long)hw); + tasklet_setup(&priv->poll_tx_task, mwl8k_tx_poll); tasklet_disable(&priv->poll_tx_task); - tasklet_init(&priv->poll_rx_task, mwl8k_rx_poll, (unsigned long)hw); + tasklet_setup(&priv->poll_rx_task, mwl8k_rx_poll); tasklet_disable(&priv->poll_rx_task); /* Power management cookie */ From patchwork Mon Aug 17 09:06:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen Pais X-Patchwork-Id: 259593 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1E232C433E1 for ; Mon, 17 Aug 2020 09:09:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C5E39206C0 for ; Mon, 17 Aug 2020 09:09:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="lh7LI148" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728838AbgHQJIy (ORCPT ); Mon, 17 Aug 2020 05:08:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728799AbgHQJI0 (ORCPT ); Mon, 17 Aug 2020 05:08:26 -0400 Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9BA1CC061389; Mon, 17 Aug 2020 02:08:26 -0700 (PDT) Received: by mail-pg1-x544.google.com with SMTP id x6so7800518pgx.12; Mon, 17 Aug 2020 02:08:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=5jd3SPGy36IvMuT4jYdHL+WdaATkelH7fNMzjOtvpww=; b=lh7LI148qHiX1XW/u93lpMRrE1FE6adJiPl4hXBaN7TSi+t8AFX32PBdVT74AkX6Et JmGnD9G/uh3RY9Mo3u0qgoUqtFzN0wWEXBAakogPWuy/dpFdhly63oEiW+2lPZmeBHma G7e8ilCuTJfPHglF24NKLhrDtnHDOsoa4VERV8I31MEqxNCqz30+JkoweMYpmq81g5Nz KOdXj/ZI722q2yfLzXcLETs87EuTXsReEnM55duEBi8iEvRWax8hnQLGFY4nzzCstDNK +5qKCx4wisnLAK0qJFo+G2cooHFV7OSfjvUTJPS2ffFiYeEo6YKBgSTPx5U/zjHTYcUF Ui1Q== 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:in-reply-to :references; bh=5jd3SPGy36IvMuT4jYdHL+WdaATkelH7fNMzjOtvpww=; b=OnF3j0c2jTarwOI+F5gMB465iZmvoBw5sbDqBOkd/aWjkQpkRqHncYlL044+XNBmRD OOVAEClF3MyepPKSmQA/J5LNKLrrm3LV2vf9WT7Z2fMSB7N9Vn3ymYsrqrdn1fic3EAo FOyyMgJuAFpUrTTGfi8GG0okB3a6F+WmItzIK51lQHCq2ofYMZ59Pavce8jnQkHPXpSq Vt3ilkD2bY/n3GxcWteHb9YxnTD0hI2yJ1WiUau2t3FatLoWoe4XI7oi9a66sA/fURzj 1N/32MziRot+vl58/Sdq6/EukGUYGR4uANNIhk244zR6UjPuXC6j3lBv0LzRdlCsL0Ma TBZw== X-Gm-Message-State: AOAM533b754VCvE/zkV9BD0shvWfqi9HsioqFHGlUOZqQ7lvpHyEsujJ oRjEEE3qvjEwW6Yw9OAPHuSrBifgy9Jdpw== X-Google-Smtp-Source: ABdhPJwznMjrz8m0MqPQCgRLF5wKrTJyxvIr5j+Ft0OdkfmDXtcxet1XO9/tnZ4C5Pu5qPTB2afNtA== X-Received: by 2002:aa7:92cb:: with SMTP id k11mr10413769pfa.233.1597655306031; Mon, 17 Aug 2020 02:08:26 -0700 (PDT) Received: from localhost.localdomain ([49.207.202.98]) by smtp.gmail.com with ESMTPSA id t14sm16616237pgb.51.2020.08.17.02.08.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Aug 2020 02:08:25 -0700 (PDT) From: Allen Pais To: kvalo@codeaurora.org, kuba@kernel.org, jirislaby@kernel.org, mickflemm@gmail.com, mcgrof@kernel.org, chunkeey@googlemail.com, Larry.Finger@lwfinger.net, stas.yakovlev@gmail.com, helmut.schaa@googlemail.com, pkshih@realtek.com, yhchuang@realtek.com, dsd@gentoo.org, kune@deine-taler.de Cc: keescook@chromium.org, ath11k@lists.infradead.org, linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, b43-dev@lists.infradead.org, brcm80211-dev-list.pdl@broadcom.com, brcm80211-dev-list@cypress.com, Allen Pais , Romain Perier Subject: [PATCH 12/16] wireless: mediatek: convert tasklets to use new tasklet_setup() API Date: Mon, 17 Aug 2020 14:36:33 +0530 Message-Id: <20200817090637.26887-13-allen.cryptic@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200817090637.26887-1-allen.cryptic@gmail.com> References: <20200817090637.26887-1-allen.cryptic@gmail.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Allen Pais In preparation for unconditionally passing the struct tasklet_struct pointer to all tasklet callbacks, switch to using the new tasklet_setup() and from_tasklet() to pass the tasklet pointer explicitly. Signed-off-by: Romain Perier Signed-off-by: Allen Pais --- drivers/net/wireless/mediatek/mt76/mac80211.c | 2 +- drivers/net/wireless/mediatek/mt76/mt76.h | 2 +- drivers/net/wireless/mediatek/mt76/mt7603/beacon.c | 4 ++-- drivers/net/wireless/mediatek/mt76/mt7603/init.c | 3 +-- drivers/net/wireless/mediatek/mt76/mt7603/mt7603.h | 2 +- drivers/net/wireless/mediatek/mt76/mt7615/mmio.c | 6 +++--- drivers/net/wireless/mediatek/mt76/mt76x02_dfs.c | 10 +++++----- drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c | 14 ++++++-------- drivers/net/wireless/mediatek/mt76/tx.c | 4 ++-- drivers/net/wireless/mediatek/mt76/usb.c | 12 ++++++------ drivers/net/wireless/mediatek/mt7601u/dma.c | 12 ++++++------ 11 files changed, 34 insertions(+), 37 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mac80211.c b/drivers/net/wireless/mediatek/mt76/mac80211.c index 3d4bf72700a5..1f62f069a0dc 100644 --- a/drivers/net/wireless/mediatek/mt76/mac80211.c +++ b/drivers/net/wireless/mediatek/mt76/mac80211.c @@ -439,7 +439,7 @@ mt76_alloc_device(struct device *pdev, unsigned int size, for (i = 0; i < ARRAY_SIZE(dev->q_rx); i++) skb_queue_head_init(&dev->rx_skb[i]); - tasklet_init(&dev->tx_tasklet, mt76_tx_tasklet, (unsigned long)dev); + tasklet_setup(&dev->tx_tasklet, mt76_tx_tasklet); dev->wq = alloc_ordered_workqueue("mt76", 0); if (!dev->wq) { diff --git a/drivers/net/wireless/mediatek/mt76/mt76.h b/drivers/net/wireless/mediatek/mt76/mt76.h index af35bc388ae2..1ab52fc37a1c 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76.h +++ b/drivers/net/wireless/mediatek/mt76/mt76.h @@ -899,7 +899,7 @@ void mt76_stop_tx_queues(struct mt76_dev *dev, struct ieee80211_sta *sta, bool send_bar); void mt76_txq_schedule(struct mt76_phy *phy, enum mt76_txq_id qid); void mt76_txq_schedule_all(struct mt76_phy *phy); -void mt76_tx_tasklet(unsigned long data); +void mt76_tx_tasklet(struct tasklet_struct *t); void mt76_release_buffered_frames(struct ieee80211_hw *hw, struct ieee80211_sta *sta, u16 tids, int nframes, diff --git a/drivers/net/wireless/mediatek/mt76/mt7603/beacon.c b/drivers/net/wireless/mediatek/mt76/mt7603/beacon.c index 7a41cdf1c4ae..ab6771c6d2a6 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7603/beacon.c +++ b/drivers/net/wireless/mediatek/mt76/mt7603/beacon.c @@ -64,9 +64,9 @@ mt7603_add_buffered_bc(void *priv, u8 *mac, struct ieee80211_vif *vif) data->count[mvif->idx]++; } -void mt7603_pre_tbtt_tasklet(unsigned long arg) +void mt7603_pre_tbtt_tasklet(struct tasklet_struct *t) { - struct mt7603_dev *dev = (struct mt7603_dev *)arg; + struct mt7603_dev *dev = from_tasklet(dev, t, mt76.pre_tbtt_tasklet); struct mt76_queue *q; struct beacon_bc_data data = {}; struct sk_buff *skb; diff --git a/drivers/net/wireless/mediatek/mt76/mt7603/init.c b/drivers/net/wireless/mediatek/mt76/mt7603/init.c index 94196599797e..a5aaa790692a 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7603/init.c +++ b/drivers/net/wireless/mediatek/mt76/mt7603/init.c @@ -533,8 +533,7 @@ int mt7603_register_device(struct mt7603_dev *dev) spin_lock_init(&dev->ps_lock); INIT_DELAYED_WORK(&dev->mt76.mac_work, mt7603_mac_work); - tasklet_init(&dev->mt76.pre_tbtt_tasklet, mt7603_pre_tbtt_tasklet, - (unsigned long)dev); + tasklet_setup(&dev->mt76.pre_tbtt_tasklet, mt7603_pre_tbtt_tasklet); /* Check for 7688, which only has 1SS */ dev->mphy.antenna_mask = 3; diff --git a/drivers/net/wireless/mediatek/mt76/mt7603/mt7603.h b/drivers/net/wireless/mediatek/mt76/mt7603/mt7603.h index c86305241e66..582d356382ed 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7603/mt7603.h +++ b/drivers/net/wireless/mediatek/mt76/mt7603/mt7603.h @@ -255,7 +255,7 @@ void mt7603_sta_assoc(struct mt76_dev *mdev, struct ieee80211_vif *vif, void mt7603_sta_remove(struct mt76_dev *mdev, struct ieee80211_vif *vif, struct ieee80211_sta *sta); -void mt7603_pre_tbtt_tasklet(unsigned long arg); +void mt7603_pre_tbtt_tasklet(struct tasklet_struct *t); void mt7603_update_channel(struct mt76_dev *mdev); diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mmio.c b/drivers/net/wireless/mediatek/mt76/mt7615/mmio.c index 133f93a6ed1b..c081a1c0449c 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/mmio.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/mmio.c @@ -98,9 +98,9 @@ static irqreturn_t mt7615_irq_handler(int irq, void *dev_instance) return IRQ_HANDLED; } -static void mt7615_irq_tasklet(unsigned long data) +static void mt7615_irq_tasklet(struct tasklet_struct *t) { - struct mt7615_dev *dev = (struct mt7615_dev *)data; + struct mt7615_dev *dev = from_tasklet(dev, t, irq_tasklet); u32 intr, mask = 0; mt76_wr(dev, MT_INT_MASK_CSR, 0); @@ -206,7 +206,7 @@ int mt7615_mmio_probe(struct device *pdev, void __iomem *mem_base, dev = container_of(mdev, struct mt7615_dev, mt76); mt76_mmio_init(&dev->mt76, mem_base); - tasklet_init(&dev->irq_tasklet, mt7615_irq_tasklet, (unsigned long)dev); + tasklet_setup(&dev->irq_tasklet, mt7615_irq_tasklet); dev->reg_map = map; dev->ops = ops; diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02_dfs.c b/drivers/net/wireless/mediatek/mt76/mt76x02_dfs.c index ff6a9e4daac0..d45c5bcda72f 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x02_dfs.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x02_dfs.c @@ -609,10 +609,11 @@ static void mt76x02_dfs_check_event_window(struct mt76x02_dev *dev) } } -static void mt76x02_dfs_tasklet(unsigned long arg) +static void mt76x02_dfs_tasklet(struct tasklet_struct *t) { - struct mt76x02_dev *dev = (struct mt76x02_dev *)arg; - struct mt76x02_dfs_pattern_detector *dfs_pd = &dev->dfs_pd; + struct mt76x02_dfs_pattern_detector *dfs_pd = from_tasklet(dfs_pd, t, + dfs_tasklet); + struct mt76x02_dev *dev = container_of(dfs_pd, typeof(*dev), dfs_pd); u32 engine_mask; int i; @@ -860,8 +861,7 @@ void mt76x02_dfs_init_detector(struct mt76x02_dev *dev) INIT_LIST_HEAD(&dfs_pd->seq_pool); dev->mt76.region = NL80211_DFS_UNSET; dfs_pd->last_sw_check = jiffies; - tasklet_init(&dfs_pd->dfs_tasklet, mt76x02_dfs_tasklet, - (unsigned long)dev); + tasklet_setup(&dfs_pd->dfs_tasklet, mt76x02_dfs_tasklet); } static void diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c b/drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c index bacb1f10a699..5a3db4edc265 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c @@ -11,9 +11,9 @@ #include "mt76x02_mcu.h" #include "trace.h" -static void mt76x02_pre_tbtt_tasklet(unsigned long arg) +static void mt76x02_pre_tbtt_tasklet(struct tasklet_struct *t) { - struct mt76x02_dev *dev = (struct mt76x02_dev *)arg; + struct mt76x02_dev *dev = from_tasklet(dev, t, mt76.pre_tbtt_tasklet); struct mt76_queue *q = dev->mt76.q_tx[MT_TXQ_PSD].q; struct beacon_bc_data data = {}; struct sk_buff *skb; @@ -151,9 +151,9 @@ static void mt76x02_process_tx_status_fifo(struct mt76x02_dev *dev) mt76x02_send_tx_status(dev, &stat, &update); } -static void mt76x02_tx_tasklet(unsigned long data) +static void mt76x02_tx_tasklet(struct tasklet_struct *t) { - struct mt76x02_dev *dev = (struct mt76x02_dev *)data; + struct mt76x02_dev *dev = from_tasklet(dev, t, mt76.tx_tasklet); mt76x02_mac_poll_tx_status(dev, false); mt76x02_process_tx_status_fifo(dev); @@ -197,10 +197,8 @@ int mt76x02_dma_init(struct mt76x02_dev *dev) if (!status_fifo) return -ENOMEM; - tasklet_init(&dev->mt76.tx_tasklet, mt76x02_tx_tasklet, - (unsigned long)dev); - tasklet_init(&dev->mt76.pre_tbtt_tasklet, mt76x02_pre_tbtt_tasklet, - (unsigned long)dev); + tasklet_setup(&dev->mt76.tx_tasklet, mt76x02_tx_tasklet); + tasklet_setup(&dev->mt76.pre_tbtt_tasklet, mt76x02_pre_tbtt_tasklet); spin_lock_init(&dev->txstatus_fifo_lock); kfifo_init(&dev->txstatus_fifo, status_fifo, fifo_size); diff --git a/drivers/net/wireless/mediatek/mt76/tx.c b/drivers/net/wireless/mediatek/mt76/tx.c index 3afd89ecd6c9..89d99755cf6c 100644 --- a/drivers/net/wireless/mediatek/mt76/tx.c +++ b/drivers/net/wireless/mediatek/mt76/tx.c @@ -585,9 +585,9 @@ void mt76_txq_schedule_all(struct mt76_phy *phy) } EXPORT_SYMBOL_GPL(mt76_txq_schedule_all); -void mt76_tx_tasklet(unsigned long data) +void mt76_tx_tasklet(struct tasklet_struct *t) { - struct mt76_dev *dev = (struct mt76_dev *)data; + struct mt76_dev *dev = from_tasklet(dev, t, tx_tasklet); mt76_txq_schedule_all(&dev->phy); if (dev->phy2) diff --git a/drivers/net/wireless/mediatek/mt76/usb.c b/drivers/net/wireless/mediatek/mt76/usb.c index dcab5993763a..fa63753976c9 100644 --- a/drivers/net/wireless/mediatek/mt76/usb.c +++ b/drivers/net/wireless/mediatek/mt76/usb.c @@ -669,9 +669,9 @@ mt76u_process_rx_queue(struct mt76_dev *dev, struct mt76_queue *q) mt76_rx_poll_complete(dev, MT_RXQ_MAIN, NULL); } -static void mt76u_rx_tasklet(unsigned long data) +static void mt76u_rx_tasklet(struct tasklet_struct *t) { - struct mt76_dev *dev = (struct mt76_dev *)data; + struct mt76_dev *dev = from_tasklet(dev, t, usb.rx_tasklet); int i; rcu_read_lock(); @@ -792,9 +792,9 @@ int mt76u_resume_rx(struct mt76_dev *dev) } EXPORT_SYMBOL_GPL(mt76u_resume_rx); -static void mt76u_tx_tasklet(unsigned long data) +static void mt76u_tx_tasklet(struct tasklet_struct *t) { - struct mt76_dev *dev = (struct mt76_dev *)data; + struct mt76_dev *dev = from_tasklet(dev, t, tx_tasklet); struct mt76_queue_entry entry; struct mt76_sw_queue *sq; struct mt76_queue *q; @@ -1133,8 +1133,8 @@ int mt76u_init(struct mt76_dev *dev, mt76u_ops.rmw = ext ? mt76u_rmw_ext : mt76u_rmw; mt76u_ops.write_copy = ext ? mt76u_copy_ext : mt76u_copy; - tasklet_init(&usb->rx_tasklet, mt76u_rx_tasklet, (unsigned long)dev); - tasklet_init(&dev->tx_tasklet, mt76u_tx_tasklet, (unsigned long)dev); + tasklet_setup(&usb->rx_tasklet, mt76u_rx_tasklet); + tasklet_setup(&dev->tx_tasklet, mt76u_tx_tasklet); INIT_WORK(&usb->stat_work, mt76u_tx_status_data); usb->data_len = usb_maxpacket(udev, usb_sndctrlpipe(udev, 0), 1); diff --git a/drivers/net/wireless/mediatek/mt7601u/dma.c b/drivers/net/wireless/mediatek/mt7601u/dma.c index f6a0454abe04..abeffeb388b7 100644 --- a/drivers/net/wireless/mediatek/mt7601u/dma.c +++ b/drivers/net/wireless/mediatek/mt7601u/dma.c @@ -212,9 +212,9 @@ static void mt7601u_complete_rx(struct urb *urb) spin_unlock_irqrestore(&dev->rx_lock, flags); } -static void mt7601u_rx_tasklet(unsigned long data) +static void mt7601u_rx_tasklet(struct tasklet_struct *t) { - struct mt7601u_dev *dev = (struct mt7601u_dev *) data; + struct mt7601u_dev *dev = from_tasklet(dev, t, rx_tasklet); struct mt7601u_dma_buf_rx *e; while ((e = mt7601u_rx_get_pending_entry(dev))) { @@ -266,9 +266,9 @@ static void mt7601u_complete_tx(struct urb *urb) spin_unlock_irqrestore(&dev->tx_lock, flags); } -static void mt7601u_tx_tasklet(unsigned long data) +static void mt7601u_tx_tasklet(struct tasklet_struct *t) { - struct mt7601u_dev *dev = (struct mt7601u_dev *) data; + struct mt7601u_dev *dev = from_tasklet(dev, t, tx_tasklet); struct sk_buff_head skbs; unsigned long flags; @@ -507,8 +507,8 @@ int mt7601u_dma_init(struct mt7601u_dev *dev) { int ret = -ENOMEM; - tasklet_init(&dev->tx_tasklet, mt7601u_tx_tasklet, (unsigned long) dev); - tasklet_init(&dev->rx_tasklet, mt7601u_rx_tasklet, (unsigned long) dev); + tasklet_setup(&dev->tx_tasklet, mt7601u_tx_tasklet); + tasklet_setup(&dev->rx_tasklet, mt7601u_rx_tasklet); ret = mt7601u_alloc_tx(dev); if (ret) From patchwork Mon Aug 17 09:06:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen Pais X-Patchwork-Id: 259594 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 71EDDC433E1 for ; Mon, 17 Aug 2020 09:08:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 307ED2063A for ; Mon, 17 Aug 2020 09:08:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Ki3ruPaD" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728830AbgHQJIx (ORCPT ); Mon, 17 Aug 2020 05:08:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727935AbgHQJIm (ORCPT ); Mon, 17 Aug 2020 05:08:42 -0400 Received: from mail-pl1-x643.google.com (mail-pl1-x643.google.com [IPv6:2607:f8b0:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D9E3AC061389; Mon, 17 Aug 2020 02:08:42 -0700 (PDT) Received: by mail-pl1-x643.google.com with SMTP id r4so7189659pls.2; Mon, 17 Aug 2020 02:08:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Xxa+05scFrzuBe+yAyWNv34XMm2FcC+GEQxivOtc53E=; b=Ki3ruPaD0Z9pPfj72g+hjVnPsRghNxtnQMqty9t1TocTqaaMchv1YYsLcM9PAI7dmy yGDlsF/c18MbgaTAVcUnuDmpY8ofvc9cRCkrdj05ykWRwWRIpiwpZMfLqDdU+qG5O/1W vJ65HMXjtaQeKzDxf6t7G8jhj3SxwZaYamh3KR3/ThXaDeoDxBbJQShrPmXUhcBqT83Q mHhP/pGDb3YY84kY7b8/y9cGOxT4yzY3E1Rf32j8jQybAND2K6VW8qlnU+BMZChm7hTf T2r5Xojpre88O+a9cn9wXi8ehy16zUHUFy8WLOMUo0Dcx6m7i++SAciHmLSDQU9tyjPy rCVw== 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:in-reply-to :references; bh=Xxa+05scFrzuBe+yAyWNv34XMm2FcC+GEQxivOtc53E=; b=MzXYvgNtjPFxsUb61E19Z/D1gzEZrLlntoMLMR/V3vB5IbJIOO0JBrE/b+opxJvGE+ lqM8ZKwbsQaPTeL7HTSIRwYZElJmvkyhXDzV74hbXJCkdI6KhR5adIFQJ3dgULzruh1p rF8aO7iZcoJTtbtyoJBzYLHt6QM6mCDSC9f4PnTUcziPAhxt5jz5XwoERvmi1csOdIib Gs5mtsci4mIv8fdKuoCnrl3aP4VijNHmyRwBSHXwnq/uMa88LXz86sfyJuETLwAuqkIt qfxSnijrqBiW6tPlagWpa0iH724aSI+DgoSR16wAGWmPAM841wixGjaoXEaEXFHbXfBY X1NA== X-Gm-Message-State: AOAM531H6/qAs5LBWphknokCsG+hMr2buS0/XYWH94FbbbXm9y9+4Hdu BtTXNyEiIOAXTV4YQaexu0I= X-Google-Smtp-Source: ABdhPJxQW4KA0xZjB/vdlce2wn7jeZLOHGg8HjqGfJ5HwDWTuIKqfW8rKWGknDtkLWCZG1/U0A3bzw== X-Received: by 2002:a17:902:82c3:: with SMTP id u3mr10494198plz.81.1597655322221; Mon, 17 Aug 2020 02:08:42 -0700 (PDT) Received: from localhost.localdomain ([49.207.202.98]) by smtp.gmail.com with ESMTPSA id t14sm16616237pgb.51.2020.08.17.02.08.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Aug 2020 02:08:41 -0700 (PDT) From: Allen Pais To: kvalo@codeaurora.org, kuba@kernel.org, jirislaby@kernel.org, mickflemm@gmail.com, mcgrof@kernel.org, chunkeey@googlemail.com, Larry.Finger@lwfinger.net, stas.yakovlev@gmail.com, helmut.schaa@googlemail.com, pkshih@realtek.com, yhchuang@realtek.com, dsd@gentoo.org, kune@deine-taler.de Cc: keescook@chromium.org, ath11k@lists.infradead.org, linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, b43-dev@lists.infradead.org, brcm80211-dev-list.pdl@broadcom.com, brcm80211-dev-list@cypress.com, Allen Pais , Romain Perier Subject: [PATCH 14/16] wireless: ralink: convert tasklets to use new tasklet_setup() API Date: Mon, 17 Aug 2020 14:36:35 +0530 Message-Id: <20200817090637.26887-15-allen.cryptic@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200817090637.26887-1-allen.cryptic@gmail.com> References: <20200817090637.26887-1-allen.cryptic@gmail.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Allen Pais In preparation for unconditionally passing the struct tasklet_struct pointer to all tasklet callbacks, switch to using the new tasklet_setup() and from_tasklet() to pass the tasklet pointer explicitly. Signed-off-by: Romain Perier Signed-off-by: Allen Pais --- .../net/wireless/ralink/rt2x00/rt2400pci.c | 14 ++++++----- .../net/wireless/ralink/rt2x00/rt2500pci.c | 14 ++++++----- .../net/wireless/ralink/rt2x00/rt2800mmio.c | 24 +++++++++++-------- .../net/wireless/ralink/rt2x00/rt2800mmio.h | 10 ++++---- drivers/net/wireless/ralink/rt2x00/rt2x00.h | 10 ++++---- .../net/wireless/ralink/rt2x00/rt2x00dev.c | 5 ++-- drivers/net/wireless/ralink/rt2x00/rt61pci.c | 20 +++++++++------- 7 files changed, 54 insertions(+), 43 deletions(-) diff --git a/drivers/net/wireless/ralink/rt2x00/rt2400pci.c b/drivers/net/wireless/ralink/rt2x00/rt2400pci.c index c1ac933349d1..687a4686f3ae 100644 --- a/drivers/net/wireless/ralink/rt2x00/rt2400pci.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2400pci.c @@ -1319,9 +1319,10 @@ static inline void rt2400pci_enable_interrupt(struct rt2x00_dev *rt2x00dev, spin_unlock_irq(&rt2x00dev->irqmask_lock); } -static void rt2400pci_txstatus_tasklet(unsigned long data) +static void rt2400pci_txstatus_tasklet(struct tasklet_struct *t) { - struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data; + struct rt2x00_dev *rt2x00dev = from_tasklet(rt2x00dev, t, + txstatus_tasklet); u32 reg; /* @@ -1347,17 +1348,18 @@ static void rt2400pci_txstatus_tasklet(unsigned long data) } } -static void rt2400pci_tbtt_tasklet(unsigned long data) +static void rt2400pci_tbtt_tasklet(struct tasklet_struct *t) { - struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data; + struct rt2x00_dev *rt2x00dev = from_tasklet(rt2x00dev, t, tbtt_tasklet); rt2x00lib_beacondone(rt2x00dev); if (test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags)) rt2400pci_enable_interrupt(rt2x00dev, CSR8_TBCN_EXPIRE); } -static void rt2400pci_rxdone_tasklet(unsigned long data) +static void rt2400pci_rxdone_tasklet(struct tasklet_struct *t) { - struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data; + struct rt2x00_dev *rt2x00dev = from_tasklet(rt2x00dev, t, + rxdone_tasklet); if (rt2x00mmio_rxdone(rt2x00dev)) tasklet_schedule(&rt2x00dev->rxdone_tasklet); else if (test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags)) diff --git a/drivers/net/wireless/ralink/rt2x00/rt2500pci.c b/drivers/net/wireless/ralink/rt2x00/rt2500pci.c index 0859adebd860..ea06041f594a 100644 --- a/drivers/net/wireless/ralink/rt2x00/rt2500pci.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2500pci.c @@ -1447,9 +1447,10 @@ static inline void rt2500pci_enable_interrupt(struct rt2x00_dev *rt2x00dev, spin_unlock_irq(&rt2x00dev->irqmask_lock); } -static void rt2500pci_txstatus_tasklet(unsigned long data) +static void rt2500pci_txstatus_tasklet(struct tasklet_struct *t) { - struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data; + struct rt2x00_dev *rt2x00dev = from_tasklet(rt2x00dev, t, + txstatus_tasklet); u32 reg; /* @@ -1475,17 +1476,18 @@ static void rt2500pci_txstatus_tasklet(unsigned long data) } } -static void rt2500pci_tbtt_tasklet(unsigned long data) +static void rt2500pci_tbtt_tasklet(struct tasklet_struct *t) { - struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data; + struct rt2x00_dev *rt2x00dev = from_tasklet(rt2x00dev, t, tbtt_tasklet); rt2x00lib_beacondone(rt2x00dev); if (test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags)) rt2500pci_enable_interrupt(rt2x00dev, CSR8_TBCN_EXPIRE); } -static void rt2500pci_rxdone_tasklet(unsigned long data) +static void rt2500pci_rxdone_tasklet(struct tasklet_struct *t) { - struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data; + struct rt2x00_dev *rt2x00dev = from_tasklet(rt2x00dev, t, + rxdone_tasklet); if (rt2x00mmio_rxdone(rt2x00dev)) tasklet_schedule(&rt2x00dev->rxdone_tasklet); else if (test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags)) diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800mmio.c b/drivers/net/wireless/ralink/rt2x00/rt2800mmio.c index 110bb391c372..d4fb3cc6d6a3 100644 --- a/drivers/net/wireless/ralink/rt2x00/rt2800mmio.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2800mmio.c @@ -210,18 +210,19 @@ static inline void rt2800mmio_enable_interrupt(struct rt2x00_dev *rt2x00dev, spin_unlock_irq(&rt2x00dev->irqmask_lock); } -void rt2800mmio_pretbtt_tasklet(unsigned long data) +void rt2800mmio_pretbtt_tasklet(struct tasklet_struct *t) { - struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data; + struct rt2x00_dev *rt2x00dev = from_tasklet(rt2x00dev, t, + pretbtt_tasklet); rt2x00lib_pretbtt(rt2x00dev); if (test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags)) rt2800mmio_enable_interrupt(rt2x00dev, INT_MASK_CSR_PRE_TBTT); } EXPORT_SYMBOL_GPL(rt2800mmio_pretbtt_tasklet); -void rt2800mmio_tbtt_tasklet(unsigned long data) +void rt2800mmio_tbtt_tasklet(struct tasklet_struct *t) { - struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data; + struct rt2x00_dev *rt2x00dev = from_tasklet(rt2x00dev, t, tbtt_tasklet); struct rt2800_drv_data *drv_data = rt2x00dev->drv_data; u32 reg; @@ -254,9 +255,10 @@ void rt2800mmio_tbtt_tasklet(unsigned long data) } EXPORT_SYMBOL_GPL(rt2800mmio_tbtt_tasklet); -void rt2800mmio_rxdone_tasklet(unsigned long data) +void rt2800mmio_rxdone_tasklet(struct tasklet_struct *t) { - struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data; + struct rt2x00_dev *rt2x00dev = from_tasklet(rt2x00dev, t, + rxdone_tasklet); if (rt2x00mmio_rxdone(rt2x00dev)) tasklet_schedule(&rt2x00dev->rxdone_tasklet); else if (test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags)) @@ -264,9 +266,10 @@ void rt2800mmio_rxdone_tasklet(unsigned long data) } EXPORT_SYMBOL_GPL(rt2800mmio_rxdone_tasklet); -void rt2800mmio_autowake_tasklet(unsigned long data) +void rt2800mmio_autowake_tasklet(struct tasklet_struct *t) { - struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data; + struct rt2x00_dev *rt2x00dev = from_tasklet(rt2x00dev, t, + autowake_tasklet); rt2800mmio_wakeup(rt2x00dev); if (test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags)) rt2800mmio_enable_interrupt(rt2x00dev, @@ -307,9 +310,10 @@ static void rt2800mmio_fetch_txstatus(struct rt2x00_dev *rt2x00dev) spin_unlock_irqrestore(&rt2x00dev->irqmask_lock, flags); } -void rt2800mmio_txstatus_tasklet(unsigned long data) +void rt2800mmio_txstatus_tasklet(struct tasklet_struct *t) { - struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data; + struct rt2x00_dev *rt2x00dev = from_tasklet(rt2x00dev, t, + txstatus_tasklet); rt2800_txdone(rt2x00dev, 16); diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800mmio.h b/drivers/net/wireless/ralink/rt2x00/rt2800mmio.h index adcd9d54ac1c..05708950f24d 100644 --- a/drivers/net/wireless/ralink/rt2x00/rt2800mmio.h +++ b/drivers/net/wireless/ralink/rt2x00/rt2800mmio.h @@ -126,11 +126,11 @@ void rt2800mmio_fill_rxdone(struct queue_entry *entry, struct rxdone_entry_desc *rxdesc); /* Interrupt functions */ -void rt2800mmio_txstatus_tasklet(unsigned long data); -void rt2800mmio_pretbtt_tasklet(unsigned long data); -void rt2800mmio_tbtt_tasklet(unsigned long data); -void rt2800mmio_rxdone_tasklet(unsigned long data); -void rt2800mmio_autowake_tasklet(unsigned long data); +void rt2800mmio_txstatus_tasklet(struct tasklet_struct *t); +void rt2800mmio_pretbtt_tasklet(struct tasklet_struct *t); +void rt2800mmio_tbtt_tasklet(struct tasklet_struct *t); +void rt2800mmio_rxdone_tasklet(struct tasklet_struct *t); +void rt2800mmio_autowake_tasklet(struct tasklet_struct *t); irqreturn_t rt2800mmio_interrupt(int irq, void *dev_instance); void rt2800mmio_toggle_irq(struct rt2x00_dev *rt2x00dev, enum dev_state state); diff --git a/drivers/net/wireless/ralink/rt2x00/rt2x00.h b/drivers/net/wireless/ralink/rt2x00/rt2x00.h index ecc60d8cbb01..780be81863b6 100644 --- a/drivers/net/wireless/ralink/rt2x00/rt2x00.h +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00.h @@ -518,11 +518,11 @@ struct rt2x00lib_ops { /* * TX status tasklet handler. */ - void (*txstatus_tasklet) (unsigned long data); - void (*pretbtt_tasklet) (unsigned long data); - void (*tbtt_tasklet) (unsigned long data); - void (*rxdone_tasklet) (unsigned long data); - void (*autowake_tasklet) (unsigned long data); + void (*txstatus_tasklet) (struct tasklet_struct *t); + void (*pretbtt_tasklet) (struct tasklet_struct *t); + void (*tbtt_tasklet) (struct tasklet_struct *t); + void (*rxdone_tasklet) (struct tasklet_struct *t); + void (*autowake_tasklet) (struct tasklet_struct *t); /* * Device init handlers. diff --git a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c index 8c6d3099b19d..b04f76551ca4 100644 --- a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c @@ -1167,9 +1167,8 @@ static int rt2x00lib_probe_hw(struct rt2x00_dev *rt2x00dev) */ #define RT2X00_TASKLET_INIT(taskletname) \ if (rt2x00dev->ops->lib->taskletname) { \ - tasklet_init(&rt2x00dev->taskletname, \ - rt2x00dev->ops->lib->taskletname, \ - (unsigned long)rt2x00dev); \ + tasklet_setup(&rt2x00dev->taskletname, \ + rt2x00dev->ops->lib->taskletname); \ } RT2X00_TASKLET_INIT(txstatus_tasklet); diff --git a/drivers/net/wireless/ralink/rt2x00/rt61pci.c b/drivers/net/wireless/ralink/rt2x00/rt61pci.c index eefce76fc99b..146675ee34c4 100644 --- a/drivers/net/wireless/ralink/rt2x00/rt61pci.c +++ b/drivers/net/wireless/ralink/rt2x00/rt61pci.c @@ -2190,34 +2190,38 @@ static void rt61pci_enable_mcu_interrupt(struct rt2x00_dev *rt2x00dev, spin_unlock_irq(&rt2x00dev->irqmask_lock); } -static void rt61pci_txstatus_tasklet(unsigned long data) +static void rt61pci_txstatus_tasklet(struct tasklet_struct *t) { - struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data; + struct rt2x00_dev *rt2x00dev = from_tasklet(rt2x00dev, t, + txstatus_tasklet); + rt61pci_txdone(rt2x00dev); if (test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags)) rt61pci_enable_interrupt(rt2x00dev, INT_MASK_CSR_TXDONE); } -static void rt61pci_tbtt_tasklet(unsigned long data) +static void rt61pci_tbtt_tasklet(struct tasklet_struct *t) { - struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data; + struct rt2x00_dev *rt2x00dev = from_tasklet(rt2x00dev, t, tbtt_tasklet); rt2x00lib_beacondone(rt2x00dev); if (test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags)) rt61pci_enable_interrupt(rt2x00dev, INT_MASK_CSR_BEACON_DONE); } -static void rt61pci_rxdone_tasklet(unsigned long data) +static void rt61pci_rxdone_tasklet(struct tasklet_struct *t) { - struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data; + struct rt2x00_dev *rt2x00dev = from_tasklet(rt2x00dev, t, + rxdone_tasklet); if (rt2x00mmio_rxdone(rt2x00dev)) tasklet_schedule(&rt2x00dev->rxdone_tasklet); else if (test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags)) rt61pci_enable_interrupt(rt2x00dev, INT_MASK_CSR_RXDONE); } -static void rt61pci_autowake_tasklet(unsigned long data) +static void rt61pci_autowake_tasklet(struct tasklet_struct *t) { - struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data; + struct rt2x00_dev *rt2x00dev = from_tasklet(rt2x00dev, t, + autowake_tasklet); rt61pci_wakeup(rt2x00dev); rt2x00mmio_register_write(rt2x00dev, M2H_CMD_DONE_CSR, 0xffffffff);