From patchwork Wed Nov 11 05:29:54 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kenji Kaneshige X-Patchwork-Id: 59261 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nAB5TMt6028948 for ; Wed, 11 Nov 2009 05:30:14 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750905AbZKKFaI (ORCPT ); Wed, 11 Nov 2009 00:30:08 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751001AbZKKFaI (ORCPT ); Wed, 11 Nov 2009 00:30:08 -0500 Received: from fgwmail6.fujitsu.co.jp ([192.51.44.36]:57535 "EHLO fgwmail6.fujitsu.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750961AbZKKFaG (ORCPT ); Wed, 11 Nov 2009 00:30:06 -0500 Received: from m1.gw.fujitsu.co.jp ([10.0.50.71]) by fgwmail6.fujitsu.co.jp (Fujitsu Gateway) with ESMTP id nAB5UBHc010834 for (envelope-from kaneshige.kenji@jp.fujitsu.com); Wed, 11 Nov 2009 14:30:11 +0900 Received: from smail (m1 [127.0.0.1]) by outgoing.m1.gw.fujitsu.co.jp (Postfix) with ESMTP id D863B45DE52 for ; Wed, 11 Nov 2009 14:30:10 +0900 (JST) Received: from s1.gw.fujitsu.co.jp (s1.gw.fujitsu.co.jp [10.0.50.91]) by m1.gw.fujitsu.co.jp (Postfix) with ESMTP id B5A0945DE51 for ; Wed, 11 Nov 2009 14:30:10 +0900 (JST) Received: from s1.gw.fujitsu.co.jp (localhost.localdomain [127.0.0.1]) by s1.gw.fujitsu.co.jp (Postfix) with ESMTP id 9379E1DB803E for ; Wed, 11 Nov 2009 14:30:10 +0900 (JST) Received: from ml13.s.css.fujitsu.com (ml13.s.css.fujitsu.com [10.249.87.103]) by s1.gw.fujitsu.co.jp (Postfix) with ESMTP id 3452F1DB803A for ; Wed, 11 Nov 2009 14:30:10 +0900 (JST) Received: from ml13.css.fujitsu.com (ml13 [127.0.0.1]) by ml13.s.css.fujitsu.com (Postfix) with ESMTP id 0D9D2FD000C; Wed, 11 Nov 2009 14:30:10 +0900 (JST) Received: from [127.0.0.1] (KANE-LIFEBOOK.numD3.wlan.css.fujitsu.com [10.124.134.33]) by ml13.s.css.fujitsu.com (Postfix) with ESMTP id AD8B8FD000B; Wed, 11 Nov 2009 14:30:09 +0900 (JST) X-SecurityPolicyCheck-FJ: OK by FujitsuOutboundMailChecker v1.3.1 Received: from KANE-LIFEBOOK[10.124.134.33] by KANE-LIFEBOOK (FujitsuOutboundMailChecker v1.3.1/9992[10.124.134.33]); Wed, 11 Nov 2009 14:30:00 +0900 (JST) Message-ID: <4AFA4BD2.4020409@jp.fujitsu.com> Date: Wed, 11 Nov 2009 14:29:54 +0900 From: Kenji Kaneshige User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: linux-pci@vger.kernel.org, jbarnes@virtuousgeek.org CC: bjorn.helgaas@hp.com, matthew@wil.cx Subject: [PATCH 1/12] PCI: introduce pci_pcie_cap() References: <4AFA4B99.4010609@jp.fujitsu.com> In-Reply-To: <4AFA4B99.4010609@jp.fujitsu.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Index: 20091110/include/linux/pci.h =================================================================== --- 20091110.orig/include/linux/pci.h +++ 20091110/include/linux/pci.h @@ -1301,5 +1301,21 @@ extern void pci_hp_create_module_link(st extern void pci_hp_remove_module_link(struct pci_slot *pci_slot); #endif +/** + * pci_pcie_cap - get the saved PCIe capability offset + * @dev: PCI device + * + * PCIe capability offset is calculated at PCI device initialization + * time and saved in the data structure. This function returns saved + * PCIe capability offset. Using this instead of pci_find_capability() + * reduces unnecessary search in the PCI configuration space. If you + * need to calculate PCIe capability offset from raw device for some + * reasons, please use pci_find_capability() instead. + */ +static inline int pci_pcie_cap(struct pci_dev *dev) +{ + return dev->pcie_cap; +} + #endif /* __KERNEL__ */ #endif /* LINUX_PCI_H */