diff options
Diffstat (limited to 'drivers/firmware/iscsi_ibft.c')
-rw-r--r-- | drivers/firmware/iscsi_ibft.c | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/drivers/firmware/iscsi_ibft.c b/drivers/firmware/iscsi_ibft.c index ed2801c378de..b3ab24f9d78f 100644 --- a/drivers/firmware/iscsi_ibft.c +++ b/drivers/firmware/iscsi_ibft.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright 2007 Red Hat, Inc. | 2 | * Copyright 2007-2010 Red Hat, Inc. |
3 | * by Peter Jones <pjones@redhat.com> | 3 | * by Peter Jones <pjones@redhat.com> |
4 | * Copyright 2008 IBM, Inc. | 4 | * Copyright 2008 IBM, Inc. |
5 | * by Konrad Rzeszutek <konradr@linux.vnet.ibm.com> | 5 | * by Konrad Rzeszutek <konradr@linux.vnet.ibm.com> |
@@ -19,6 +19,9 @@ | |||
19 | * | 19 | * |
20 | * Changelog: | 20 | * Changelog: |
21 | * | 21 | * |
22 | * 06 Jan 2010 - Peter Jones <pjones@redhat.com> | ||
23 | * New changelog entries are in the git log from now on. Not here. | ||
24 | * | ||
22 | * 14 Mar 2008 - Konrad Rzeszutek <ketuzsezr@darnok.org> | 25 | * 14 Mar 2008 - Konrad Rzeszutek <ketuzsezr@darnok.org> |
23 | * Updated comments and copyrights. (v0.4.9) | 26 | * Updated comments and copyrights. (v0.4.9) |
24 | * | 27 | * |
@@ -78,9 +81,10 @@ | |||
78 | #include <linux/stat.h> | 81 | #include <linux/stat.h> |
79 | #include <linux/string.h> | 82 | #include <linux/string.h> |
80 | #include <linux/types.h> | 83 | #include <linux/types.h> |
84 | #include <linux/acpi.h> | ||
81 | 85 | ||
82 | #define IBFT_ISCSI_VERSION "0.4.9" | 86 | #define IBFT_ISCSI_VERSION "0.5.0" |
83 | #define IBFT_ISCSI_DATE "2008-Mar-14" | 87 | #define IBFT_ISCSI_DATE "2010-Feb-25" |
84 | 88 | ||
85 | MODULE_AUTHOR("Peter Jones <pjones@redhat.com> and \ | 89 | MODULE_AUTHOR("Peter Jones <pjones@redhat.com> and \ |
86 | Konrad Rzeszutek <ketuzsezr@darnok.org>"); | 90 | Konrad Rzeszutek <ketuzsezr@darnok.org>"); |
@@ -238,7 +242,7 @@ static const char *ibft_initiator_properties[] = | |||
238 | */ | 242 | */ |
239 | 243 | ||
240 | struct ibft_kobject { | 244 | struct ibft_kobject { |
241 | struct ibft_table_header *header; | 245 | struct acpi_table_ibft *header; |
242 | union { | 246 | union { |
243 | struct ibft_initiator *initiator; | 247 | struct ibft_initiator *initiator; |
244 | struct ibft_nic *nic; | 248 | struct ibft_nic *nic; |
@@ -536,12 +540,13 @@ static int __init ibft_check_device(void) | |||
536 | u8 *pos; | 540 | u8 *pos; |
537 | u8 csum = 0; | 541 | u8 csum = 0; |
538 | 542 | ||
539 | len = ibft_addr->length; | 543 | len = ibft_addr->header.length; |
540 | 544 | ||
541 | /* Sanity checking of iBFT. */ | 545 | /* Sanity checking of iBFT. */ |
542 | if (ibft_addr->revision != 1) { | 546 | if (ibft_addr->header.revision != 1) { |
543 | printk(KERN_ERR "iBFT module supports only revision 1, " \ | 547 | printk(KERN_ERR "iBFT module supports only revision 1, " \ |
544 | "while this is %d.\n", ibft_addr->revision); | 548 | "while this is %d.\n", |
549 | ibft_addr->header.revision); | ||
545 | return -ENOENT; | 550 | return -ENOENT; |
546 | } | 551 | } |
547 | for (pos = (u8 *)ibft_addr; pos < (u8 *)ibft_addr + len; pos++) | 552 | for (pos = (u8 *)ibft_addr; pos < (u8 *)ibft_addr + len; pos++) |
@@ -558,7 +563,7 @@ static int __init ibft_check_device(void) | |||
558 | /* | 563 | /* |
559 | * Helper function for ibft_register_kobjects. | 564 | * Helper function for ibft_register_kobjects. |
560 | */ | 565 | */ |
561 | static int __init ibft_create_kobject(struct ibft_table_header *header, | 566 | static int __init ibft_create_kobject(struct acpi_table_ibft *header, |
562 | struct ibft_hdr *hdr, | 567 | struct ibft_hdr *hdr, |
563 | struct list_head *list) | 568 | struct list_head *list) |
564 | { | 569 | { |
@@ -596,7 +601,7 @@ static int __init ibft_create_kobject(struct ibft_table_header *header, | |||
596 | default: | 601 | default: |
597 | printk(KERN_ERR "iBFT has unknown structure type (%d). " \ | 602 | printk(KERN_ERR "iBFT has unknown structure type (%d). " \ |
598 | "Report this bug to %.6s!\n", hdr->id, | 603 | "Report this bug to %.6s!\n", hdr->id, |
599 | header->oem_id); | 604 | header->header.oem_id); |
600 | rc = 1; | 605 | rc = 1; |
601 | break; | 606 | break; |
602 | } | 607 | } |
@@ -649,7 +654,7 @@ out_invalid_struct: | |||
649 | * found add them on the passed-in list. We do not support the other | 654 | * found add them on the passed-in list. We do not support the other |
650 | * fields at this point, so they are skipped. | 655 | * fields at this point, so they are skipped. |
651 | */ | 656 | */ |
652 | static int __init ibft_register_kobjects(struct ibft_table_header *header, | 657 | static int __init ibft_register_kobjects(struct acpi_table_ibft *header, |
653 | struct list_head *list) | 658 | struct list_head *list) |
654 | { | 659 | { |
655 | struct ibft_control *control = NULL; | 660 | struct ibft_control *control = NULL; |
@@ -660,7 +665,7 @@ static int __init ibft_register_kobjects(struct ibft_table_header *header, | |||
660 | 665 | ||
661 | control = (void *)header + sizeof(*header); | 666 | control = (void *)header + sizeof(*header); |
662 | end = (void *)control + control->hdr.length; | 667 | end = (void *)control + control->hdr.length; |
663 | eot_offset = (void *)header + header->length - (void *)control; | 668 | eot_offset = (void *)header + header->header.length - (void *)control; |
664 | rc = ibft_verify_hdr("control", (struct ibft_hdr *)control, id_control, | 669 | rc = ibft_verify_hdr("control", (struct ibft_hdr *)control, id_control, |
665 | sizeof(*control)); | 670 | sizeof(*control)); |
666 | 671 | ||
@@ -672,7 +677,8 @@ static int __init ibft_register_kobjects(struct ibft_table_header *header, | |||
672 | } | 677 | } |
673 | for (ptr = &control->initiator_off; ptr < end; ptr += sizeof(u16)) { | 678 | for (ptr = &control->initiator_off; ptr < end; ptr += sizeof(u16)) { |
674 | offset = *(u16 *)ptr; | 679 | offset = *(u16 *)ptr; |
675 | if (offset && offset < header->length && offset < eot_offset) { | 680 | if (offset && offset < header->header.length && |
681 | offset < eot_offset) { | ||
676 | rc = ibft_create_kobject(header, | 682 | rc = ibft_create_kobject(header, |
677 | (void *)header + offset, | 683 | (void *)header + offset, |
678 | list); | 684 | list); |