imsm: detail_platform_imsm supports Intel SAS controller (isci driver)
Added support in detail_platform_imsm for Intel (R) SAS controller. Function supports AHCI and ISCI controllers. RAID properties are derived from common OROM for both types. Based on code From: Artur Wojcik <artur.wojcik@intel.com> Signed-off-by: Marcin Labun <marcin.labun@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
parent
120dc88745
commit
155cbb4c2c
|
@ -1297,12 +1297,15 @@ static int ahci_enumerate_ports(const char *hba_path, int port_count, int host_b
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static void print_found_intel_controllers(struct sys_dev *elem)
|
static void print_found_intel_controllers(struct sys_dev *elem)
|
||||||
{
|
{
|
||||||
for (; elem; elem = elem->next) {
|
for (; elem; elem = elem->next) {
|
||||||
fprintf(stderr, Name ": found Intel(R) ");
|
fprintf(stderr, Name ": found Intel(R) ");
|
||||||
if (elem->type == SYS_DEV_SATA)
|
if (elem->type == SYS_DEV_SATA)
|
||||||
fprintf(stderr, "SATA ");
|
fprintf(stderr, "SATA ");
|
||||||
|
else if (elem->type == SYS_DEV_SAS)
|
||||||
|
fprintf(stderr, "SAS ");
|
||||||
fprintf(stderr, "RAID controller");
|
fprintf(stderr, "RAID controller");
|
||||||
if (elem->pci_id)
|
if (elem->pci_id)
|
||||||
fprintf(stderr, " at %s", elem->pci_id);
|
fprintf(stderr, " at %s", elem->pci_id);
|
||||||
|
@ -1311,7 +1314,6 @@ static void print_found_intel_controllers(struct sys_dev *elem)
|
||||||
fflush(stderr);
|
fflush(stderr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int ahci_get_port_count(const char *hba_path, int *port_count)
|
static int ahci_get_port_count(const char *hba_path, int *port_count)
|
||||||
{
|
{
|
||||||
struct dirent *ent;
|
struct dirent *ent;
|
||||||
|
@ -1364,22 +1366,19 @@ static int detail_platform_imsm(int verbose, int enumerate_only)
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
list = find_driver_devices("pci", "ahci");
|
list = find_intel_devices();
|
||||||
for (hba = list; hba; hba = hba->next)
|
if (!list) {
|
||||||
if (devpath_to_vendor(hba->path) == 0x8086)
|
|
||||||
break;
|
|
||||||
|
|
||||||
if (!hba) {
|
|
||||||
if (verbose)
|
if (verbose)
|
||||||
fprintf(stderr, Name ": unable to find active ahci controller\n");
|
fprintf(stderr, Name ": no active Intel(R) RAID "
|
||||||
|
"controller found.\n");
|
||||||
free_sys_dev(&list);
|
free_sys_dev(&list);
|
||||||
return 2;
|
return 2;
|
||||||
} else if (verbose)
|
} else if (verbose)
|
||||||
fprintf(stderr, Name ": found Intel SATA AHCI Controller\n");
|
print_found_intel_controllers(list);
|
||||||
|
|
||||||
print_found_intel_controllers(list);
|
|
||||||
orom = find_imsm_orom();
|
orom = find_imsm_orom();
|
||||||
if (!orom) {
|
if (!orom) {
|
||||||
|
free_sys_dev(&list);
|
||||||
if (verbose)
|
if (verbose)
|
||||||
fprintf(stderr, Name ": imsm option-rom not found\n");
|
fprintf(stderr, Name ": imsm option-rom not found\n");
|
||||||
return 2;
|
return 2;
|
||||||
|
@ -1414,7 +1413,6 @@ static int detail_platform_imsm(int verbose, int enumerate_only)
|
||||||
printf(" Max Disks : %d\n", orom->tds);
|
printf(" Max Disks : %d\n", orom->tds);
|
||||||
printf(" Max Volumes : %d\n", orom->vpa);
|
printf(" Max Volumes : %d\n", orom->vpa);
|
||||||
|
|
||||||
|
|
||||||
for (hba = list; hba; hba = hba->next) {
|
for (hba = list; hba; hba = hba->next) {
|
||||||
printf(" I/O Controller : %s (%s)\n",
|
printf(" I/O Controller : %s (%s)\n",
|
||||||
hba->path, get_sys_dev_type(hba->type));
|
hba->path, get_sys_dev_type(hba->type));
|
||||||
|
@ -1427,8 +1425,14 @@ static int detail_platform_imsm(int verbose, int enumerate_only)
|
||||||
"ports on SATA controller at %s.", hba->pci_id);
|
"ports on SATA controller at %s.", hba->pci_id);
|
||||||
result |= 2;
|
result |= 2;
|
||||||
}
|
}
|
||||||
|
} else if (hba->type == SYS_DEV_SAS) {
|
||||||
|
if (verbose)
|
||||||
|
fprintf(stderr, Name ": failed to enumerate "
|
||||||
|
"devices on SAS controller at %s.", hba->pci_id);
|
||||||
|
result |= 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
free_sys_dev(&list);
|
free_sys_dev(&list);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue