hpsa.c (609a70df07af1ff857257fb2e93c3ef281e30710) hpsa.c (2a80d5458a027f6d514987c09f0b51f45c3a5be4)
1/*
2 * Disk Array driver for HP Smart Array SAS controllers
3 * Copyright 2016 Microsemi Corporation
4 * Copyright 2014-2015 PMC-Sierra, Inc.
5 * Copyright 2000,2009-2015 Hewlett-Packard Development Company, L.P.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by

--- 3618 unchanged lines hidden (view full) ---

3627out:
3628 cmd_free(h, c);
3629 return rc;
3630}
3631
3632static inline int hpsa_scsi_do_report_phys_luns(struct ctlr_info *h,
3633 struct ReportExtendedLUNdata *buf, int bufsize)
3634{
1/*
2 * Disk Array driver for HP Smart Array SAS controllers
3 * Copyright 2016 Microsemi Corporation
4 * Copyright 2014-2015 PMC-Sierra, Inc.
5 * Copyright 2000,2009-2015 Hewlett-Packard Development Company, L.P.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by

--- 3618 unchanged lines hidden (view full) ---

3627out:
3628 cmd_free(h, c);
3629 return rc;
3630}
3631
3632static inline int hpsa_scsi_do_report_phys_luns(struct ctlr_info *h,
3633 struct ReportExtendedLUNdata *buf, int bufsize)
3634{
3635 return hpsa_scsi_do_report_luns(h, 0, buf, bufsize,
3636 HPSA_REPORT_PHYS_EXTENDED);
3635 int rc;
3636 struct ReportLUNdata *lbuf;
3637
3638 rc = hpsa_scsi_do_report_luns(h, 0, buf, bufsize,
3639 HPSA_REPORT_PHYS_EXTENDED);
3640 if (!rc || !hpsa_allow_any)
3641 return rc;
3642
3643 /* REPORT PHYS EXTENDED is not supported */
3644 lbuf = kzalloc(sizeof(*lbuf), GFP_KERNEL);
3645 if (!lbuf)
3646 return -ENOMEM;
3647
3648 rc = hpsa_scsi_do_report_luns(h, 0, lbuf, sizeof(*lbuf), 0);
3649 if (!rc) {
3650 int i;
3651 u32 nphys;
3652
3653 /* Copy ReportLUNdata header */
3654 memcpy(buf, lbuf, 8);
3655 nphys = be32_to_cpu(*((__be32 *)lbuf->LUNListLength)) / 8;
3656 for (i = 0; i < nphys; i++)
3657 memcpy(buf->LUN[i].lunid, lbuf->LUN[i], 8);
3658 }
3659 kfree(lbuf);
3660 return rc;
3637}
3638
3639static inline int hpsa_scsi_do_report_log_luns(struct ctlr_info *h,
3640 struct ReportLUNdata *buf, int bufsize)
3641{
3642 return hpsa_scsi_do_report_luns(h, 1, buf, bufsize, 0);
3643}
3644

--- 6366 unchanged lines hidden ---
3661}
3662
3663static inline int hpsa_scsi_do_report_log_luns(struct ctlr_info *h,
3664 struct ReportLUNdata *buf, int bufsize)
3665{
3666 return hpsa_scsi_do_report_luns(h, 1, buf, bufsize, 0);
3667}
3668

--- 6366 unchanged lines hidden ---