From patchwork Thu Feb 18 20:31:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jordan_Hargrave@Dell.com X-Patchwork-Id: 8354601 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 66BC49F372 for ; Thu, 18 Feb 2016 20:34:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F31CD20395 for ; Thu, 18 Feb 2016 20:34:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 32EF1200E7 for ; Thu, 18 Feb 2016 20:34:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1947649AbcBRUei (ORCPT ); Thu, 18 Feb 2016 15:34:38 -0500 Received: from ausc60ps301.us.dell.com ([143.166.148.206]:5375 "EHLO ausc60ps301.us.dell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1946859AbcBRUeh (ORCPT ); Thu, 18 Feb 2016 15:34:37 -0500 DomainKey-Signature: s=smtpout; d=dell.com; c=nofws; q=dns; h=X-LoopCount0:X-IronPort-AV:From:To:Cc:Subject:Date: Message-Id:X-Mailer:To; b=VHedrAWToJk1F2LKxs1JC2aYEaHOPnS6migkr8n0XHwni/+eoW2wShyw Fwvs2Ga0mgFlimSFbxb50jX20+SuWdqVbS+zVBTDkBTOjyUJU/wdJrSNl /oTNRcScNs+qNqHMDPqKf1zzcTYVtzkKN1a7HKlazgcF+ry3MA05VJDdV c=; DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=dell.com; i=@dell.com; q=dns/txt; s=smtpout; t=1455827677; x=1487363677; h=from:cc:subject:date:message-id; bh=hs7NLuJkpgcDFWnYk/0HCp8B5mhHGErMLPStrEgzM6g=; b=T02zezlB/TfRYtmYVB5zAn1iieNGU1S4oOQw+faRY/9NhJyUlYx9b7RZ 3a/4n/LgYtyFCsoFqEv/bMaY8CX7CYeCGKaYGDiLEdsAtE21ee1bSGezf h9sebVE7rdmHLK9xzs/WTvg2looR3cVXK7hzbh4qyviaqC5YA34xGZ56u k=; X-LoopCount0: from 10.208.46.141 X-IronPort-AV: E=Sophos;i="5.22,467,1449554400"; d="scan'208";a="789910213" From: Jordan Hargrave To: jordan_hargrave@dell.com, bhelgaas@google.com Cc: alexander.duyck@gmail.com, linux-pci@vger.kernel.org, babu.moger@oracle.com, hare@suse.de, linux-kernel@vger.kernel.org, jharg93@gmail.com, Jordan Hargrave Subject: [PATCH 2/2] Create sysfs entries for PCI VPDI and VPDR tags Date: Thu, 18 Feb 2016 14:31:04 -0600 Message-Id: <1455827464-11398-1-git-send-email-Jordan_Hargrave@dell.com> X-Mailer: git-send-email 1.7.1 To: Jordan_Hargrave@dell.com Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The VPD-R is a readonly area of the PCI Vital Product Data region. There are some standard keywords for serial number, manufacturer, and vendor-specific values. Dell Servers use a vendor-specific tag to store number of ports and port mapping of partitioned NICs. info = VPD-Info string PN = Part Number SN = Serial Number MN = Manufacturer ID Vx = Vendor-specific (x=0..9 A..Z) This creates a sysfs subdirectory in the pci device: vpdattr with 'info', 'EC', 'SN', 'V0', etc. files containing the tag values. Added pci.h patch Signed-off-by: Jordan Hargrave --- include/linux/pci.h | 3 + 1 files changed, 3 insertions(+) diff --git a/include/linux/pci.h b/include/linux/pci.h index 8135a2f..c1313b1 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -372,6 +372,9 @@ struct pci_dev { const struct attribute_group **msi_irq_groups; #endif struct pci_vpd *vpd; + int vpdr_len; + u8 *vpdr_data; + char *vpdi_data; #ifdef CONFIG_PCI_ATS union { struct pci_sriov *sriov; /* SR-IOV capability related */