From mboxrd@z Thu Jan 1 00:00:00 1970 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=-3.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no 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 CB3A7C4338F for ; Mon, 9 Aug 2021 08:44:47 +0000 (UTC) Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 715E861004 for ; Mon, 9 Aug 2021 08:44:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 715E861004 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kernelnewbies.org Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.94.2) (envelope-from ) id 1mD0tZ-0005y2-Gm; Mon, 09 Aug 2021 04:44:29 -0400 Received: from mail.kernel.org ([198.145.29.99]) by shelob.surriel.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1mD0tX-0005xe-PH for kernelnewbies@kernelnewbies.org; Mon, 09 Aug 2021 04:44:27 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B464A60462; Mon, 9 Aug 2021 08:44:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1628498666; bh=grKMIOHGb1ru2VuvTfMUqYUzzhQ8CKPOf/66tvSq5SE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ohGQ0pIcLDIwANoZV7kjmnxzXBUNFuQw6YcdqMD1JTOKpdiE6h+u0gZ5iu3NX63/T CPB4KgXOi9pLRJOZ+1urLnJehhN9tao6D/3eWOk8UGUXGdioLpf5JzVALc8ziIGs2X aM3cyJpa5ApvCP2z9kjuNxY7spMM/MyhH07XkHb4= Date: Mon, 9 Aug 2021 10:44:23 +0200 From: Greg KH To: Muni Sekhar Subject: Re: read() via USB bus Message-ID: References: <8923f2b8-0be0-ffbf-70a4-c03c9a02d58a@suse.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <8923f2b8-0be0-ffbf-70a4-c03c9a02d58a@suse.com> Cc: linux-kernel@vger.kernel.org, Oliver Neukum , linux-usb@vger.kernel.org, kernelnewbies X-BeenThere: kernelnewbies@kernelnewbies.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Learn about the Linux kernel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kernelnewbies-bounces@kernelnewbies.org On Mon, Aug 09, 2021 at 10:15:29AM +0200, 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. Along these lines, take a look at the book, Linux Device Drivers, third edition, which is free online, as it has a chapter about USB drivers and how they work. That should help you out to understand the issues involved with USB devices. If you have specific questions after looking at that, and reading the basic usb-skeleton.c driver in the kernel source tree, please let us know! thanks, greg k-h _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies