From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751577AbdAaR2U (ORCPT ); Tue, 31 Jan 2017 12:28:20 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:41488 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751291AbdAaR1r (ORCPT ); Tue, 31 Jan 2017 12:27:47 -0500 Date: Tue, 31 Jan 2017 18:27:50 +0100 From: Greg Kroah-Hartman To: Logan Gunthorpe Cc: Keith Busch , Myron Stowe , Bjorn Helgaas , Geert Uytterhoeven , Jonathan Corbet , "David S. Miller" , Andrew Morton , Emil Velikov , Mauro Carvalho Chehab , Guenter Roeck , Jarkko Sakkinen , Linus Walleij , Ryusuke Konishi , Stefan Berger , Wei Zhang , Kurt Schwemmer , Stephen Bates , linux-pci@vger.kernel.org, linux-doc@vger.kernel.org, linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/1] MicroSemi Switchtec management interface driver Message-ID: <20170131172750.GC12595@kroah.com> References: <1485882204-26947-1-git-send-email-logang@deltatee.com> <1485882204-26947-2-git-send-email-logang@deltatee.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1485882204-26947-2-git-send-email-logang@deltatee.com> User-Agent: Mutt/1.7.2 (2016-11-26) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 31, 2017 at 10:03:24AM -0700, Logan Gunthorpe wrote: > Microsemi's "Switchtec" line of PCI switch devices is already well > supported by the kernel with standard PCI switch drivers. However, the > Switchtec device advertises a special management endpoint with a separate > PCI function address and class code. This endpoint enables some additional > functionality which includes: > > * Packet and Byte Counters > * Switch Firmware Upgrades > * Event and Error logs > * Querying port link status > * Custom user firmware commands > > This patch introduces the switchtec kernel module which provides > PCI driver that exposes a char device. The char device provides > userspace access to this interface through read, write and (optionally) > poll calls. A couple of special IOCTLs are provided to: > > * Inform userspace of firmware partition locations > * Pass event counts and allow userspace to wait on events > > A short text file is provided which documents the switchtec driver, > outlines the semantics of using the char device and describes the > IOCTLs. > > The device also exposes a few read-only sysfs attributes which provide > some device information component names and versions which is provided > by the hardware. These are documented in > Documentation/ABI/testing/sysfs-class-switchtec > > A userspace tool and library which utilizes this interface is available > at [1]. This tool takes inspiration (and borrows some code) from > nvme-cli [2]. The tool is largely complete at this time but additional > features may be added in the future. > > [1] https://github.com/sbates130272/switchtec-user > [2] https://github.com/linux-nvme/nvme-cli > > Signed-off-by: Logan Gunthorpe > Signed-off-by: Stephen Bates > --- > Documentation/ABI/testing/sysfs-class-switchtec | 96 ++ > Documentation/ioctl/ioctl-number.txt | 1 + > Documentation/switchtec.txt | 80 ++ > MAINTAINERS | 11 + > drivers/pci/Kconfig | 1 + > drivers/pci/Makefile | 1 + > drivers/pci/switch/Kconfig | 13 + > drivers/pci/switch/Makefile | 1 + > drivers/pci/switch/switchtec.c | 1320 +++++++++++++++++++++++ > drivers/pci/switch/switchtec.h | 266 +++++ Why a .h file for a single .c file? Also, why a whole new directory? thanks, greg k-h