linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] IMSM-orom: make sure, that device list is supported
@ 2015-02-27 14:45 Pawel Baldysiak
  2015-03-04  5:00 ` NeilBrown
  0 siblings, 1 reply; 2+ messages in thread
From: Pawel Baldysiak @ 2015-02-27 14:45 UTC (permalink / raw)
  To: neilb; +Cc: linux-raid, pawel.baldysiak, artur.paszkiewicz

Devices list in PCI Data Structure is supported only in
3 and above revision. Make sure that this is checked.

Signed-off-by: Pawel Baldysiak <pawel.baldysiak@intel.com>
---
 platform-intel.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/platform-intel.c b/platform-intel.c
index 37274da..c6a28e8 100644
--- a/platform-intel.c
+++ b/platform-intel.c
@@ -227,6 +227,8 @@ struct pciExpDataStructFormat {
 	__u16 vendorID;
 	__u16 deviceID;
 	__u16 devListOffset;
+	__u16 pciDataStructLen;
+	__u8 pciDataStructRev;
 } __attribute__ ((packed));
 
 static struct orom_entry oroms[SYS_DEV_MAX];
@@ -323,7 +325,8 @@ static int scan(const void *start, const void *end, const void *data)
 
 	const struct imsm_orom *orom = add_orom(imsm_mem);
 
-	if (ptr->devListOffset) {
+	/* only PciDataStructure with revision 3 and above supports devices list. */
+	if (ptr->pciDataStructRev >= 3 && ptr->devListOffset) {
 		const __u16 *dev_list = (void *)ptr + ptr->devListOffset;
 		int i;
 


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] IMSM-orom: make sure, that device list is supported
  2015-02-27 14:45 [PATCH] IMSM-orom: make sure, that device list is supported Pawel Baldysiak
@ 2015-03-04  5:00 ` NeilBrown
  0 siblings, 0 replies; 2+ messages in thread
From: NeilBrown @ 2015-03-04  5:00 UTC (permalink / raw)
  To: Pawel Baldysiak; +Cc: linux-raid, artur.paszkiewicz

[-- Attachment #1: Type: text/plain, Size: 1219 bytes --]

On Fri, 27 Feb 2015 15:45:50 +0100 Pawel Baldysiak
<pawel.baldysiak@intel.com> wrote:

> Devices list in PCI Data Structure is supported only in
> 3 and above revision. Make sure that this is checked.
> 
> Signed-off-by: Pawel Baldysiak <pawel.baldysiak@intel.com>
> ---
>  platform-intel.c |    5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/platform-intel.c b/platform-intel.c
> index 37274da..c6a28e8 100644
> --- a/platform-intel.c
> +++ b/platform-intel.c
> @@ -227,6 +227,8 @@ struct pciExpDataStructFormat {
>  	__u16 vendorID;
>  	__u16 deviceID;
>  	__u16 devListOffset;
> +	__u16 pciDataStructLen;
> +	__u8 pciDataStructRev;
>  } __attribute__ ((packed));
>  
>  static struct orom_entry oroms[SYS_DEV_MAX];
> @@ -323,7 +325,8 @@ static int scan(const void *start, const void *end, const void *data)
>  
>  	const struct imsm_orom *orom = add_orom(imsm_mem);
>  
> -	if (ptr->devListOffset) {
> +	/* only PciDataStructure with revision 3 and above supports devices list. */
> +	if (ptr->pciDataStructRev >= 3 && ptr->devListOffset) {
>  		const __u16 *dev_list = (void *)ptr + ptr->devListOffset;
>  		int i;
>  

Applied, thanks.

NeilBrown

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 811 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-03-04  5:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-27 14:45 [PATCH] IMSM-orom: make sure, that device list is supported Pawel Baldysiak
2015-03-04  5:00 ` NeilBrown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).