Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp199445pxm; Wed, 2 Mar 2022 13:22:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJy3KaX8V/9y+xoOo2wyWGdQV4pRPavPWv7sEaKFKx76u/LpIxFhYXDG7E4kfG1lJDSk/IWF X-Received: by 2002:a63:b345:0:b0:363:8ee2:6669 with SMTP id x5-20020a63b345000000b003638ee26669mr27707370pgt.20.1646256165565; Wed, 02 Mar 2022 13:22:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646256165; cv=none; d=google.com; s=arc-20160816; b=QmORBk5AlZWgtGN6Zh0Ta4XGpPwrE0KQ2coEOTkIW0EIKVzoptPXLzg8STj4kl62Q1 wxoySQBG+0TmR67+iy/HbJF9MhfSIAXi2t/ASJmNgelu1TLaJXb50xzLuTxTDNfVgYRM 6Vjdc7QSmbD2MmQy6RXyjk/e6on6rtdo02GrOMDtVtbDSUuhhf9DU2OHvCWs5wOc3ltc +y9ouNe881nN1gRjVLGXO92/u4aCWxx5LdBqcr+x66yFHuLmFD6n3xCQZxPQrahdcJOB 2odE56dSdPLzKsyyD3/8gmu58rW8GxraKTBJZfoxHgJczequPhp9U4a8yvbcUjZ3EKm8 E6og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=QlVXCfzD+3K9BcxK4gomRnUDmyl4DZAXCMxi9wvAQa8=; b=QaG4ootlBkUR+6ulnrJXO6ZVBQ0dYDqBP/5/ovof6oRsBXjiouCaYd3BSw7yQ1oSsW fj7RnSs9VvDgRvVzGYcs2aP0lixSQ3GeQB2PPoC9H574im4srNEDiJ5rBcegp2/c0c2E +jODgcCC2SMNw9pM1gTwIUCjBR9H1kH2GPH5HNl+bZNqLcWYr8nco806w4tiWfa4v5Wb 2Oq1QbFKwbDCZsM4CQ8MXadGdtAbQEguWRjkaQ66Gg/Sod8uZ0Ipy5ks5yWDjpB83YD5 e/Z4yzZS/Opotz4k/RpmAmFDOhAGZgciOZ9AsXgdmACJkMoG5HxUme6oHRt9RyFlRLk3 Ouyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Xfab6SBS; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 17-20020a631851000000b00372f29e3107si132520pgy.758.2022.03.02.13.22.09; Wed, 02 Mar 2022 13:22:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Xfab6SBS; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240931AbiCBPto (ORCPT + 72 others); Wed, 2 Mar 2022 10:49:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53538 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240741AbiCBPt1 (ORCPT ); Wed, 2 Mar 2022 10:49:27 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 665D72D1C5 for ; Wed, 2 Mar 2022 07:48:41 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 0D1BCB8207D for ; Wed, 2 Mar 2022 15:48:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4FC7DC340ED; Wed, 2 Mar 2022 15:48:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1646236118; bh=asrPxwbalw10OfS9T8RXKhwTL8CE32GiK7t7yIecQGo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Xfab6SBSQw/fevqm4scPsTOUPAjJ3ZMoNIcOfIlkGtRjyKHW6i1yRB+YiibfI8Vyu rHp17yWYghJEAQ26VFhecHwnof3mn//kUFzUONOIf8Q8q4e8e2VXMmbNpBwT3FdpRk 72Dw9Ka78TtdWidKSNtG+9NdTWymwZNThGKG2+czqCO8zcfXIM1Dw1vREhP9juPbNF 2wiU83Ij4vtivR1ovSJWn3MVjUoZoveswRpWzo9Z4RWJmSeUsXIsvc6OAC1YiiroOy J+DXXkRY68t1qye0mvFUTfvYlikOHdYmAk3vLEbRJlw2UURrEhQBiNvv7lb4RemUwA 7V6lMo69atRHg== From: Lorenzo Bianconi To: nbd@nbd.name Cc: linux-wireless@vger.kernel.org, lorenzo.bianconi@redhat.com, sean.wang@mediatek.com, deren.wu@mediatek.com, linux-mediatek@lists.infradead.org Subject: [PATCH 2/9] mt76: usb: add req_type to ___mt76u_wr signature Date: Wed, 2 Mar 2022 16:48:06 +0100 Message-Id: X-Mailer: git-send-email 2.35.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org This is a preliminary patch to add usb support to mt7921 driver. Signed-off-by: Lorenzo Bianconi --- drivers/net/wireless/mediatek/mt76/usb.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/usb.c b/drivers/net/wireless/mediatek/mt76/usb.c index 1b0435e0ea33..4b7a816f1b93 100644 --- a/drivers/net/wireless/mediatek/mt76/usb.c +++ b/drivers/net/wireless/mediatek/mt76/usb.c @@ -121,16 +121,14 @@ static u32 mt76u_rr_ext(struct mt76_dev *dev, u32 addr) return ret; } -static void ___mt76u_wr(struct mt76_dev *dev, u8 req, +static void ___mt76u_wr(struct mt76_dev *dev, u8 req, u8 req_type, u32 addr, u32 val) { struct mt76_usb *usb = &dev->usb; put_unaligned_le32(val, usb->data); - __mt76u_vendor_request(dev, req, - USB_DIR_OUT | USB_TYPE_VENDOR, - addr >> 16, addr, usb->data, - sizeof(__le32)); + __mt76u_vendor_request(dev, req, req_type, addr >> 16, + addr, usb->data, sizeof(__le32)); trace_usb_reg_wr(dev, addr, val); } @@ -146,7 +144,8 @@ static void __mt76u_wr(struct mt76_dev *dev, u32 addr, u32 val) req = MT_VEND_MULTI_WRITE; break; } - ___mt76u_wr(dev, req, addr & ~MT_VEND_TYPE_MASK, val); + ___mt76u_wr(dev, req, USB_DIR_OUT | USB_TYPE_VENDOR, + addr & ~MT_VEND_TYPE_MASK, val); } static void mt76u_wr(struct mt76_dev *dev, u32 addr, u32 val) @@ -159,7 +158,8 @@ static void mt76u_wr(struct mt76_dev *dev, u32 addr, u32 val) static void mt76u_wr_ext(struct mt76_dev *dev, u32 addr, u32 val) { mutex_lock(&dev->usb.usb_ctrl_mtx); - ___mt76u_wr(dev, MT_VEND_WRITE_EXT, addr, val); + ___mt76u_wr(dev, MT_VEND_WRITE_EXT, + USB_DIR_OUT | USB_TYPE_VENDOR, addr, val); mutex_unlock(&dev->usb.usb_ctrl_mtx); } @@ -180,7 +180,8 @@ static u32 mt76u_rmw_ext(struct mt76_dev *dev, u32 addr, mutex_lock(&dev->usb.usb_ctrl_mtx); val |= ___mt76u_rr(dev, MT_VEND_READ_EXT, USB_DIR_IN | USB_TYPE_VENDOR, addr) & ~mask; - ___mt76u_wr(dev, MT_VEND_WRITE_EXT, addr, val); + ___mt76u_wr(dev, MT_VEND_WRITE_EXT, + USB_DIR_OUT | USB_TYPE_VENDOR, addr, val); mutex_unlock(&dev->usb.usb_ctrl_mtx); return val; -- 2.35.1