Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp2809191pxt; Mon, 9 Aug 2021 09:22:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzO2WvSz1Ayqjc6wP7VOIuoZr0HkAOaJwS6L66Sk23ABi+t8kqkJ9sTtkpoZgrct4Et0wfD X-Received: by 2002:a05:6638:306:: with SMTP id w6mr23092998jap.132.1628526121778; Mon, 09 Aug 2021 09:22:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628526121; cv=none; d=google.com; s=arc-20160816; b=oi29LSvRqkSHbXVV1bYqzxZi2ZH8BJhrBsfD7fZZhib281yIc7kjiFVT1jmQOJP5Ik ZFihgBncO+ZcI6XaRvMoEFphe01hNvpVuHj8NtTw2bLNe5SfiIEyRiqFTBUy6qKnXDse mnMYoPFIJRhQg9796ObzFTHTqeec3w4QP0wkDfR6Mqkuy1mRApZqMUMmRElfDHqsXVWv aE3Ln13NCXll5g+9nnqNmN83TPIM06B5OAlJ6tyBabg5bt47iKj5u/cDd22MiLdYU7u6 PPG65sPvF3cYMdStyGbS5cAW0AnUnANoJEwB3uWITZdCxZsOm9IvAYDRNjcZ+0PSwULs XYBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=z9VdH7ns3h5j/pkoJcdwYLPrHEhcNZabrfGVRGH7EGA=; b=NR6/OgIw52LnsePfitoqJpVAldGb4/GTCRGO239oElLLkSmxYqBAKvmFHvgZshvarz jSApZ2rjytif8QZM0vHkG8yFVEVenj/metIaIx9zQfiUeGZpEvPmr10MTdzWhNtjIYhq kNT0fKzvQ3TxTtPUTkDxoAlULSbG/SkUCziUGBBm3UnlcaUvOL0tX+9wpcDr7FSN+Nc0 OVI/9+5NPzVAYFtCIgO04sJKoYG1I6beFFsI5zbEqp9p8SwGsqN6XFP37/oTMBxWjW3J oySZfwyv1bi2vKav5QcF8r3y+/vU8XW5CPmblKwWCYroNYaqoYmZ6UyOAt8ugZSlQPH8 gnVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=aAsa1Gsr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p31si20594415jac.95.2021.08.09.09.21.37; Mon, 09 Aug 2021 09:22:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=aAsa1Gsr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232927AbhHIQVI (ORCPT + 99 others); Mon, 9 Aug 2021 12:21:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232865AbhHIQTn (ORCPT ); Mon, 9 Aug 2021 12:19:43 -0400 Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [IPv6:2a00:1450:4864:20::12e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A6A5AC061796; Mon, 9 Aug 2021 09:19:20 -0700 (PDT) Received: by mail-lf1-x12e.google.com with SMTP id c24so8365165lfi.11; Mon, 09 Aug 2021 09:19:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=z9VdH7ns3h5j/pkoJcdwYLPrHEhcNZabrfGVRGH7EGA=; b=aAsa1GsrKNIid2ukdTvB2onVx9ChYfIoWc+oMoD5C29aHmVYhbEtRDyNuZ/M2jmtYF n0h0A7uQwwCdELxuSJM9wc9w4NCDqdCzdvLCsWvLMD9yjVLDGPzGe+QQhQ1LWIKOAzdg jIuCoVhdXzs8kCIbVh85AYcJ5n0OKX5iLg0Rtj0Bh80gKYuBBkUxP3x6rziQOJtweF+c /+NxmL8xS/yd4jj+JvifBTV/Wtl+ZpsesMbBh10g9VMIt8uG/jLUxxqiP/YgUfunvvwc u6uMR67yhLB+mc2nL0mvjUmCuvrxzmQAWoHpkrCkmNAwzNASI5Xi3mUwtvDFf/eDdd/J +eUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=z9VdH7ns3h5j/pkoJcdwYLPrHEhcNZabrfGVRGH7EGA=; b=GtVfSNGcFLRAlsltEaQDWx/Cd5yqhsLCv0QsLLHo3GEArjpfBFG1ToeD/DxmJuR4A7 A9vh+1FD6zMNLhA5EQR1seTXZGoDzA4u/vAib2bgZgaxzHNKl6CdM+jrd5YJs6DZgEb4 gf5tcaBGWjff/WXonnB9bFMCb0ZS0RMc6Tz3LZ1l2/A7uW56PsMybjP6LcwbDBDk0Gjt /S+4+Q7bpIVcM1lInZhk4MNDEDkrD2EqmvYCFDPgt4rbkd89YUoFFapJLRiztYIpAO0q NCK0ZYj3gyrKbaixpQKEDEFPuRwQmbPY2JK6hDoTMr6NVfY5A0k1XEPWL6y5evpWHC74 Qflg== X-Gm-Message-State: AOAM5324QB50rEKj/Dz6WFscBYFEB2gBaMllO68CvrAloHHG33aOGgZA 3S/nKg2uzXsz6GEqQEWyFi9ABI2vpiB56Zo7e7s= X-Received: by 2002:a05:6512:39c6:: with SMTP id k6mr18099640lfu.549.1628525959073; Mon, 09 Aug 2021 09:19:19 -0700 (PDT) MIME-Version: 1.0 References: <8923f2b8-0be0-ffbf-70a4-c03c9a02d58a@suse.com> In-Reply-To: <8923f2b8-0be0-ffbf-70a4-c03c9a02d58a@suse.com> From: Muni Sekhar Date: Mon, 9 Aug 2021 21:49:07 +0530 Message-ID: Subject: Re: read() via USB bus To: Oliver Neukum Cc: kernelnewbies , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 9, 2021 at 1:45 PM Oliver Neukum wrote: > > > On 09.08.21 09:58, Muni Sekhar wrote: > > Hi all, > > > > PCIe memory mapped registers can be read via readb(), readw(), readl() > > kernel API's. Similarly what are the kernel API to read the device > > registers via USB bus > > > > Hi, > > I am afraid this is based on a fundamental misunderstanding on how > USB works. It is based on passing messages, not reading and writing > registers. > > USB devices are primarily based on endpoints, not registers. A literal > answer to your question would point you to the clear/set/get_feature > standard requests of chapter 9 of the specification, but that really > will not help you, as you are making assumption that fundamentally > do not apply. > > I hope this list stays friendly to newcomers and we will answer > specific questions, but at this point I must advise you to first > read an introductory book. Thank you, I will check it out. > > HTH > Oliver > > -- Thanks, Sekhar