Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1763692AbcLSQwy (ORCPT ); Mon, 19 Dec 2016 11:52:54 -0500 Received: from mga09.intel.com ([134.134.136.24]:41565 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756227AbcLSQwk (ORCPT ); Mon, 19 Dec 2016 11:52:40 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,374,1477983600"; d="scan'208";a="1074062226" Date: Mon, 19 Dec 2016 12:02:02 -0500 From: Keith Busch To: Logan Gunthorpe Cc: Bjorn Helgaas , Greg Kroah-Hartman , Geert Uytterhoeven , Jonathan Corbet , "David S. Miller" , Andrew Morton , Emil Velikov , Mauro Carvalho Chehab , Guenter Roeck , linux-doc@vger.kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, Stephen Bates , Kurt Schwemmer Subject: Re: [RFC 1/1] MicroSemi Switchtec management interface driver Message-ID: <20161219170201.GA1043@localhost.localdomain> References: <1481994562-9283-1-git-send-email-logang@deltatee.com> <1481994562-9283-2-git-send-email-logang@deltatee.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1481994562-9283-2-git-send-email-logang@deltatee.com> User-Agent: Mutt/1.7.0 (2016-08-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1042 Lines: 23 On Sat, Dec 17, 2016 at 10:09:22AM -0700, Logan Gunthorpe wrote: > Microsemi's "Switchtec" line of PCI switch devices is already > supported by the kernel with standard PCI switch drivers. However, the > Switchtec device advertises a special management endpoint which > enables some additional functionality. This includes: > > * Packet and Byte Counters > * 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. Currently no ioctls have been implemented but a couple > may be added in a later revision. > > A short text file is provided which documents the switchtec driver > and outlines the semantics of using the char device. Some of this would be simplified if you use the managed device API's: devm_request_irq, pcim_enable_device, pcim_iomap, etc...