Re: [PATCH v2 01/13] mpt3sas: Update MPI Header

2017-08-03 Thread Sreekanth Reddy
On Thu, Aug 3, 2017 at 1:25 PM, Johannes Thumshirn  wrote:
> On Thu, Aug 03, 2017 at 08:24:59AM +0200, Hannes Reinecke wrote:
>> > +   U32
>> > +   IOCLogInfo; /*0x10 */
>> > +   U16
>> > +   ErrorResponseCount; /*0x14 */
>> > +   U16
>> > +   Reserved4;  /*0x16 */
>> > +} MPI26_NVME_ENCAPSULATED_ERROR_REPLY,
>> > +   *PTR_MPI26_NVME_ENCAPSULATED_ERROR_REPLY,
>> > +   Mpi26NVMeEncapsulatedErrorReply_t,
>> > +   *pMpi26NVMeEncapsulatedErrorReply_t;
>> > +
>> > +
>> > +#endif
>> > +
>> > +
>> Very odd indentation.
>> Please reformat to have type and variable on one line.
>
> And use Linux types and no CamelCase and no typedefs (especially not for
> pointers), you're not on Windows here.

We will reformat to have type and variable on one line as suggested by Hannes.

But it will be going have a huge change in the driver, if we want to
remove the CamelCase and typedefs. From legacy days onwards mpi
headers has the CamelCase type variable names and the same variables
are used in the code in large number of places. Also our MPI headers
are common across the OS platforms and so maintaining mpi headers
updates will be more difficult.

Thanks,
Sreekanth

>
> Thanks,
> Johannes
>
> --
> Johannes Thumshirn  Storage
> jthumsh...@suse.de+49 911 74053 689
> SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
> GF: Felix Imendörffer, Jane Smithard, Graham Norton
> HRB 21284 (AG Nürnberg)
> Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850


Re: [PATCH v2 01/13] mpt3sas: Update MPI Header

2017-08-03 Thread Johannes Thumshirn
On Thu, Aug 03, 2017 at 08:24:59AM +0200, Hannes Reinecke wrote:
> > +   U32
> > +   IOCLogInfo; /*0x10 */
> > +   U16
> > +   ErrorResponseCount; /*0x14 */
> > +   U16
> > +   Reserved4;  /*0x16 */
> > +} MPI26_NVME_ENCAPSULATED_ERROR_REPLY,
> > +   *PTR_MPI26_NVME_ENCAPSULATED_ERROR_REPLY,
> > +   Mpi26NVMeEncapsulatedErrorReply_t,
> > +   *pMpi26NVMeEncapsulatedErrorReply_t;
> > +
> > +
> > +#endif
> > +
> > +
> Very odd indentation.
> Please reformat to have type and variable on one line.

And use Linux types and no CamelCase and no typedefs (especially not for
pointers), you're not on Windows here.

Thanks,
Johannes

-- 
Johannes Thumshirn  Storage
jthumsh...@suse.de+49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850


Re: [PATCH v2 01/13] mpt3sas: Update MPI Header

2017-08-02 Thread Hannes Reinecke
On 07/14/2017 03:22 PM, Suganath Prabu S wrote:
> Update MPI Files for NVMe support
> 
> Signed-off-by: Chaitra P B 
> Signed-off-by: Suganath Prabu S 
> ---
>  drivers/scsi/mpt3sas/mpi/mpi2.h  |   43 +++-
>  drivers/scsi/mpt3sas/mpi/mpi2_cnfg.h |  647 
> +-
>  drivers/scsi/mpt3sas/mpi/mpi2_init.h |   11 +-
>  drivers/scsi/mpt3sas/mpi/mpi2_ioc.h  |  331 +-
>  drivers/scsi/mpt3sas/mpi/mpi2_pci.h  |  142 
>  drivers/scsi/mpt3sas/mpi/mpi2_tool.h |   14 +-
>  6 files changed, 1177 insertions(+), 11 deletions(-)
>  create mode 100644 drivers/scsi/mpt3sas/mpi/mpi2_pci.h
> 
> diff --git a/drivers/scsi/mpt3sas/mpi/mpi2.h b/drivers/scsi/mpt3sas/mpi/mpi2.h
> index a9a659f..bc59058 100644
> --- a/drivers/scsi/mpt3sas/mpi/mpi2.h
> +++ b/drivers/scsi/mpt3sas/mpi/mpi2.h
> @@ -8,7 +8,7 @@
>   * scatter/gather formats.
>   * Creation Date:  June 21, 2006
>   *
> - * mpi2.h Version:  02.00.42
> + * mpi2.h Version:  02.00.48
>   *
>   * NOTE: Names (typedefs, defines, etc.) beginning with an MPI25 or Mpi25
>   *   prefix are for use only on MPI v2.5 products, and must not be used
> @@ -103,6 +103,16 @@
>   * 08-25-15  02.00.40  Bumped MPI2_HEADER_VERSION_UNIT.
>   * 12-15-15  02.00.41  Bumped MPI_HEADER_VERSION_UNIT
>   * 01-01-16  02.00.42  Bumped MPI_HEADER_VERSION_UNIT
> + * 04-05-16  02.00.43  Modified  MPI26_DIAG_BOOT_DEVICE_SELECT defines
> + * to be unique within first 32 characters.
> + * Removed AHCI support.
> + * Removed SOP support.
> + * Bumped MPI2_HEADER_VERSION_UNIT.
> + * 04-10-16  02.00.44  Bumped MPI2_HEADER_VERSION_UNIT.
> + * 07-06-16  02.00.45  Bumped MPI2_HEADER_VERSION_UNIT.
> + * 09-02-16  02.00.46  Bumped MPI2_HEADER_VERSION_UNIT.
> + * 11-23-16  02.00.47  Bumped MPI2_HEADER_VERSION_UNIT.
> + * 02-03-17  02.00.48  Bumped MPI2_HEADER_VERSION_UNIT.
>   * --
>   */
>  
> @@ -142,7 +152,7 @@
>  #define MPI2_VERSION_02_06   (0x0206)
>  
>  /*Unit and Dev versioning for this MPI header set */
> -#define MPI2_HEADER_VERSION_UNIT(0x2A)
> +#define MPI2_HEADER_VERSION_UNIT(0x30)
>  #define MPI2_HEADER_VERSION_DEV (0x00)
>  #define MPI2_HEADER_VERSION_UNIT_MASK   (0xFF00)
>  #define MPI2_HEADER_VERSION_UNIT_SHIFT  (8)
> @@ -249,6 +259,12 @@ typedef volatile struct _MPI2_SYSTEM_INTERFACE_REGS {
>  #define MPI2_DIAG_BOOT_DEVICE_SELECT_DEFAULT(0x)
>  #define MPI2_DIAG_BOOT_DEVICE_SELECT_HCDW   (0x0800)
>  
> +/* Defines for V7A/V7R HostDiagnostic Register */
> +#define MPI26_DIAG_BOOT_DEVICE_SEL_64FLASH  (0x)
> +#define MPI26_DIAG_BOOT_DEVICE_SEL_64HCDW   (0x0800)
> +#define MPI26_DIAG_BOOT_DEVICE_SEL_32FLASH  (0x1000)
> +#define MPI26_DIAG_BOOT_DEVICE_SEL_32HCDW   (0x1800)
> +
>  #define MPI2_DIAG_CLEAR_FLASH_BAD_SIG   (0x0400)
>  #define MPI2_DIAG_FORCE_HCB_ON_RESET(0x0200)
>  #define MPI2_DIAG_HCB_MODE  (0x0100)
> @@ -367,6 +383,7 @@ typedef struct _MPI2_DEFAULT_REQUEST_DESCRIPTOR {
>  #define MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE(0x08)
>  #define MPI2_REQ_DESCRIPT_FLAGS_RAID_ACCELERATOR(0x0A)
>  #define MPI25_REQ_DESCRIPT_FLAGS_FAST_PATH_SCSI_IO  (0x0C)
> +#define MPI26_REQ_DESCRIPT_FLAGS_PCIE_ENCAPSULATED  (0x10)
>  
>  #define MPI2_REQ_DESCRIPT_FLAGS_IOC_FIFO_MARKER (0x01)
>  
> @@ -425,6 +442,13 @@ typedef MPI2_SCSI_IO_REQUEST_DESCRIPTOR
>   Mpi25FastPathSCSIIORequestDescriptor_t,
>   *pMpi25FastPathSCSIIORequestDescriptor_t;
>  
> +/*PCIe Encapsulated Request Descriptor */
> +typedef MPI2_SCSI_IO_REQUEST_DESCRIPTOR
> + MPI26_PCIE_ENCAPSULATED_REQUEST_DESCRIPTOR,
> + *PTR_MPI26_PCIE_ENCAPSULATED_REQUEST_DESCRIPTOR,
> + Mpi26PCIeEncapsulatedRequestDescriptor_t,
> + *pMpi26PCIeEncapsulatedRequestDescriptor_t;
> +
>  /*union of Request Descriptors */
>  typedef union _MPI2_REQUEST_DESCRIPTOR_UNION {
>   MPI2_DEFAULT_REQUEST_DESCRIPTOR Default;
> @@ -433,6 +457,7 @@ typedef union _MPI2_REQUEST_DESCRIPTOR_UNION {
>   MPI2_SCSI_TARGET_REQUEST_DESCRIPTOR SCSITarget;
>   MPI2_RAID_ACCEL_REQUEST_DESCRIPTOR RAIDAccelerator;
>   MPI25_FP_SCSI_IO_REQUEST_DESCRIPTOR FastPathSCSIIO;
> + MPI26_PCIE_ENCAPSULATED_REQUEST_DESCRIPTOR PCIeEncapsulated;
>   U64 Words;
>  } MPI2_REQUEST_DESCRIPTOR_UNION,
>   *PTR_MPI2_REQUEST_DESCRIPTOR_UNION,
> @@ -450,6 +475,7 @@ typedef union _MPI2_REQUEST_DESCRIPTOR_UNION {
>   *  Atomic SCSI Target Request Descriptor
>   *  Atomic RAID Accelerator Request Descriptor
>   *  Atomic Fast Path SCSI IO Request Descriptor
> + *  Atomic PCIe Encapsulated Request Descriptor
>   */
>  
>  /*Atomic Request Descriptor */
> @@ -487,6 +513,7 @@ typedef struct _MPI2_DEFAULT_REPLY_DESCRIPTOR {
>  #define MPI2_RPY_

[PATCH v2 01/13] mpt3sas: Update MPI Header

2017-07-14 Thread Suganath Prabu S
Update MPI Files for NVMe support

Signed-off-by: Chaitra P B 
Signed-off-by: Suganath Prabu S 
---
 drivers/scsi/mpt3sas/mpi/mpi2.h  |   43 +++-
 drivers/scsi/mpt3sas/mpi/mpi2_cnfg.h |  647 +-
 drivers/scsi/mpt3sas/mpi/mpi2_init.h |   11 +-
 drivers/scsi/mpt3sas/mpi/mpi2_ioc.h  |  331 +-
 drivers/scsi/mpt3sas/mpi/mpi2_pci.h  |  142 
 drivers/scsi/mpt3sas/mpi/mpi2_tool.h |   14 +-
 6 files changed, 1177 insertions(+), 11 deletions(-)
 create mode 100644 drivers/scsi/mpt3sas/mpi/mpi2_pci.h

diff --git a/drivers/scsi/mpt3sas/mpi/mpi2.h b/drivers/scsi/mpt3sas/mpi/mpi2.h
index a9a659f..bc59058 100644
--- a/drivers/scsi/mpt3sas/mpi/mpi2.h
+++ b/drivers/scsi/mpt3sas/mpi/mpi2.h
@@ -8,7 +8,7 @@
  * scatter/gather formats.
  * Creation Date:  June 21, 2006
  *
- * mpi2.h Version:  02.00.42
+ * mpi2.h Version:  02.00.48
  *
  * NOTE: Names (typedefs, defines, etc.) beginning with an MPI25 or Mpi25
  *   prefix are for use only on MPI v2.5 products, and must not be used
@@ -103,6 +103,16 @@
  * 08-25-15  02.00.40  Bumped MPI2_HEADER_VERSION_UNIT.
  * 12-15-15  02.00.41  Bumped MPI_HEADER_VERSION_UNIT
  * 01-01-16  02.00.42  Bumped MPI_HEADER_VERSION_UNIT
+ * 04-05-16  02.00.43  Modified  MPI26_DIAG_BOOT_DEVICE_SELECT defines
+ * to be unique within first 32 characters.
+ * Removed AHCI support.
+ * Removed SOP support.
+ * Bumped MPI2_HEADER_VERSION_UNIT.
+ * 04-10-16  02.00.44  Bumped MPI2_HEADER_VERSION_UNIT.
+ * 07-06-16  02.00.45  Bumped MPI2_HEADER_VERSION_UNIT.
+ * 09-02-16  02.00.46  Bumped MPI2_HEADER_VERSION_UNIT.
+ * 11-23-16  02.00.47  Bumped MPI2_HEADER_VERSION_UNIT.
+ * 02-03-17  02.00.48  Bumped MPI2_HEADER_VERSION_UNIT.
  * --
  */
 
@@ -142,7 +152,7 @@
 #define MPI2_VERSION_02_06 (0x0206)
 
 /*Unit and Dev versioning for this MPI header set */
-#define MPI2_HEADER_VERSION_UNIT(0x2A)
+#define MPI2_HEADER_VERSION_UNIT(0x30)
 #define MPI2_HEADER_VERSION_DEV (0x00)
 #define MPI2_HEADER_VERSION_UNIT_MASK   (0xFF00)
 #define MPI2_HEADER_VERSION_UNIT_SHIFT  (8)
@@ -249,6 +259,12 @@ typedef volatile struct _MPI2_SYSTEM_INTERFACE_REGS {
 #define MPI2_DIAG_BOOT_DEVICE_SELECT_DEFAULT(0x)
 #define MPI2_DIAG_BOOT_DEVICE_SELECT_HCDW   (0x0800)
 
+/* Defines for V7A/V7R HostDiagnostic Register */
+#define MPI26_DIAG_BOOT_DEVICE_SEL_64FLASH  (0x)
+#define MPI26_DIAG_BOOT_DEVICE_SEL_64HCDW   (0x0800)
+#define MPI26_DIAG_BOOT_DEVICE_SEL_32FLASH  (0x1000)
+#define MPI26_DIAG_BOOT_DEVICE_SEL_32HCDW   (0x1800)
+
 #define MPI2_DIAG_CLEAR_FLASH_BAD_SIG   (0x0400)
 #define MPI2_DIAG_FORCE_HCB_ON_RESET(0x0200)
 #define MPI2_DIAG_HCB_MODE  (0x0100)
@@ -367,6 +383,7 @@ typedef struct _MPI2_DEFAULT_REQUEST_DESCRIPTOR {
 #define MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE(0x08)
 #define MPI2_REQ_DESCRIPT_FLAGS_RAID_ACCELERATOR(0x0A)
 #define MPI25_REQ_DESCRIPT_FLAGS_FAST_PATH_SCSI_IO  (0x0C)
+#define MPI26_REQ_DESCRIPT_FLAGS_PCIE_ENCAPSULATED  (0x10)
 
 #define MPI2_REQ_DESCRIPT_FLAGS_IOC_FIFO_MARKER (0x01)
 
@@ -425,6 +442,13 @@ typedef MPI2_SCSI_IO_REQUEST_DESCRIPTOR
Mpi25FastPathSCSIIORequestDescriptor_t,
*pMpi25FastPathSCSIIORequestDescriptor_t;
 
+/*PCIe Encapsulated Request Descriptor */
+typedef MPI2_SCSI_IO_REQUEST_DESCRIPTOR
+   MPI26_PCIE_ENCAPSULATED_REQUEST_DESCRIPTOR,
+   *PTR_MPI26_PCIE_ENCAPSULATED_REQUEST_DESCRIPTOR,
+   Mpi26PCIeEncapsulatedRequestDescriptor_t,
+   *pMpi26PCIeEncapsulatedRequestDescriptor_t;
+
 /*union of Request Descriptors */
 typedef union _MPI2_REQUEST_DESCRIPTOR_UNION {
MPI2_DEFAULT_REQUEST_DESCRIPTOR Default;
@@ -433,6 +457,7 @@ typedef union _MPI2_REQUEST_DESCRIPTOR_UNION {
MPI2_SCSI_TARGET_REQUEST_DESCRIPTOR SCSITarget;
MPI2_RAID_ACCEL_REQUEST_DESCRIPTOR RAIDAccelerator;
MPI25_FP_SCSI_IO_REQUEST_DESCRIPTOR FastPathSCSIIO;
+   MPI26_PCIE_ENCAPSULATED_REQUEST_DESCRIPTOR PCIeEncapsulated;
U64 Words;
 } MPI2_REQUEST_DESCRIPTOR_UNION,
*PTR_MPI2_REQUEST_DESCRIPTOR_UNION,
@@ -450,6 +475,7 @@ typedef union _MPI2_REQUEST_DESCRIPTOR_UNION {
  *  Atomic SCSI Target Request Descriptor
  *  Atomic RAID Accelerator Request Descriptor
  *  Atomic Fast Path SCSI IO Request Descriptor
+ *  Atomic PCIe Encapsulated Request Descriptor
  */
 
 /*Atomic Request Descriptor */
@@ -487,6 +513,7 @@ typedef struct _MPI2_DEFAULT_REPLY_DESCRIPTOR {
 #define MPI2_RPY_DESCRIPT_FLAGS_TARGET_COMMAND_BUFFER   (0x03)
 #define MPI2_RPY_DESCRIPT_FLAGS_RAID_ACCELERATOR_SUCCESS(0x05)
 #define MPI25_RPY_DESCRIPT_FLAGS_FAST_PATH_SCSI_IO_SUCCESS  (0x06)
+#define MPI26_RPY_DESCRIPT_FLAGS_PCIE_ENCAPSULAT