Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp486205pxt; Thu, 12 Aug 2021 03:10:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzmRxEPNLfSoyJenZlPJFtlBon2cZJku1A02S7d8NR6byD/acnag3CnOxpwlaDbogBWfZX2 X-Received: by 2002:a05:6638:164c:: with SMTP id a12mr3145666jat.49.1628763038819; Thu, 12 Aug 2021 03:10:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628763038; cv=none; d=google.com; s=arc-20160816; b=fESpvAack6zabOJh8gXu6pUc+AUGK/sjFsCdWRwh3/kH3Lq8mK5NBvoLffK5Xacp+X OzJpDvhAvsQshGL93gsC+ozWtTVuz2r/jlfWTOcEMWk31gWzO5u/cLrJZ1KSmw82a68d Ty6nlP3rHDRQ6WCuw3Sq5+h7ANfd7kPu50PsOv4mCDksQLEDVWzk82XbRkJWStzM7Rhj j8w09qPCi7GoQyltAOcbTouvOKoIYrhx9EgjFq9boHdTOfx+uvjYnw4RuJ7wo70eDsKs 32VcNy/dqK1vVs7u2Fl6P8WOvna+rqZQyOgfc5wtZLFIQGz0cOJ6yjXUQ3Vu3ViCy/f0 0iZw== 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=JKokAdcSKF80baLZQ7+koBLNIJ4LERzZEALxoHGCtwk=; b=H045HOvg0cF2cngTln5SLGIggbu7+mBDi83uMbYZ1+L/4EEgmxIwRVhZVqO8DeZ5wz O6h86h6Zym9f/+aOGcjh1sQgBDO1n5GkhqAi/T7pfe8q3HyAW3FDYuBXfP+sO2nAvaEj EnAvkcuGBcU6/AGG5exvKTPXI+St4rLWAq9qAI5ohOE4SubGqXET33o/bdmrKQWQNtet q7Oy21VmIx36+QyAF+dr327Ex5glSBJ+jb9YCaHJy0xFbTbK/2kJ6LJV273tqJJcuOLP 6fvHN9NhiqGobfiZK5tm1NxM7eqAyosLIpOBAFnlyrUk0dm1cjNFyHrPI4mC5EcRrp4f wZzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=bdb3EBJx; 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 z7si2466829ilq.32.2021.08.12.03.10.28; Thu, 12 Aug 2021 03:10:38 -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=bdb3EBJx; 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 S236281AbhHLJqO (ORCPT + 99 others); Thu, 12 Aug 2021 05:46:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39512 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236263AbhHLJqN (ORCPT ); Thu, 12 Aug 2021 05:46:13 -0400 Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA2D0C061765; Thu, 12 Aug 2021 02:45:48 -0700 (PDT) Received: by mail-ej1-x635.google.com with SMTP id qk33so10302917ejc.12; Thu, 12 Aug 2021 02:45: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 :mime-version:content-transfer-encoding; bh=JKokAdcSKF80baLZQ7+koBLNIJ4LERzZEALxoHGCtwk=; b=bdb3EBJxeKjk0N89T7GmOcuih2cpttFaNCtlbIni0OZLUIsc3lqZHatEBj6nZC/Pll qRIm7PuNj0UiG3VOFCPWBzZ1Bn/wcWhq06fJ8q2KLXqLku95oRZZFHofxKFKNN9c97UG iciJ7mr4xOH4aoXeBjY+3Id905ixOa3mWoLVM7e7vaMm6TPswSydq2y884VbxBUWcYit 1makX8bwSSiJl56XieOfsy71jIgHG0/zasFQ/dWPbfZCXPWwIYMg6nJD7Z1TQdHjSqei 3HTJ2BIASfKbVaNvrswgABp7Df/31wa6lyZxx52DAzchHpoxEJlT+JjPH1P+24O8YfL3 Ca8Q== 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:mime-version:content-transfer-encoding; bh=JKokAdcSKF80baLZQ7+koBLNIJ4LERzZEALxoHGCtwk=; b=TBKwXAlpqpeBZ7WR5A/zR1zk/f/7q7x+wJDnbQSGlvEsQo2BwvwgwBoIjAAgU6xQUB PI0VYJdTiNb4O/iBIX7dEtP+2AEAFvPPtJRHZaEscx8GG2KA0MiVM2BgcFpIWiR+9CVn iSCU06ruk7B+aEuMSlBTnccLn1SBEO8oK0INAMeE+vYc8ff4ZKOEYqfC6T6Hg2HxAoNM dSzXL3XbXhg69lszwkpkFPGJq8LNO8YwOF7Njbzuw1wZT5g9RR4ZFx1hFqn/CwtsNwAO 1P8xAHoUzpOQmKJ41RLEOLKw4TA5s3HY9BDz78bt0pTKZdHb8S6tvE7tedtID/t2RoyS ubaQ== X-Gm-Message-State: AOAM530x2Y4U/8OTmOtC/ZK/dEnAVR8QjcVtzq1EMUpuXCkr+vBqaLfV AWkK3V87AzMDXS3feIiVnMI= X-Received: by 2002:a17:906:140e:: with SMTP id p14mr2937931ejc.235.1628761547185; Thu, 12 Aug 2021 02:45:47 -0700 (PDT) Received: from localhost.localdomain (host-79-22-109-211.retail.telecomitalia.it. [79.22.109.211]) by smtp.gmail.com with ESMTPSA id q14sm865866edr.0.2021.08.12.02.45.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Aug 2021 02:45:46 -0700 (PDT) From: "Fabio M. De Francesco" To: Greg KH Cc: Muni Sekhar , Oliver Neukum , kernelnewbies , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: LDD 3rd ed. - It was: Re: read() via USB bus Date: Thu, 12 Aug 2021 11:45:45 +0200 Message-ID: <13470108.apdoE9Qb8s@localhost.localdomain> In-Reply-To: References: <8923f2b8-0be0-ffbf-70a4-c03c9a02d58a@suse.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Greg, On Monday, August 9, 2021 10:44:23 AM CEST Greg KH wrote: > 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 > > > > [...] > > > > 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. > I've heard that your book, LDD 3rd edition, has become obsolete a long time ago and most sample code cannot anymore build. Reading what you wrote above seems to contradict what I've been told by others... I must admit that I've just had a print copy of it that I have not yet opened for reading, therefore maybe that I'm totally wrong in assuming the above. Do you mind to elaborate a bit more on this subject, please? I mean: can you point out which chapters, which content, should be skipped (if there's really something which is no more correct/relevant to today's practice of drivers development and kernel hacking? One more question, please... if after carefully studying its content, someone wanted to change and update part of the book content to reflect the changes in Linux API and in the current best practices, would it be (legally) allowed to publish a v4 on GitHub for the convenience of everyone interested in learning for free? However, I understand that it would be not so easy to come up with a good and error free text if not addressed as a public long term project and I'm also not sure of what tools are needed to edit PDF files. (At the moment my question is for a hypothetical scenario, just to know whether or not it would be technically and legally doable). I suppose that the answers to the above questions might be of interest to a lot of newcomers like me, so please, if you have time, I'd appreciate to read your reply. Thanks, Fabio > > 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