Commit 6c8eea54 authored by James Smart's avatar James Smart Committed by James Bottomley

[SCSI] lpfc 8.3.12: T10-PI/DIF changes

Update driver for change in T10-PI interface on adapter
- Remove Profiles.
- Add new SLI Opcodes.
- Add new PDE structures used for BlockGuard.
Signed-off-by: default avatarAlex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: default avatarJames Smart <james.smart@emulex.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
parent 15672319
...@@ -1500,7 +1500,6 @@ typedef struct { /* FireFly BIU registers */ ...@@ -1500,7 +1500,6 @@ typedef struct { /* FireFly BIU registers */
#define MBXERR_BAD_RCV_LENGTH 14 #define MBXERR_BAD_RCV_LENGTH 14
#define MBXERR_DMA_ERROR 15 #define MBXERR_DMA_ERROR 15
#define MBXERR_ERROR 16 #define MBXERR_ERROR 16
#define MBXERR_UNKNOWN_CMD 18
#define MBXERR_LINK_DOWN 0x33 #define MBXERR_LINK_DOWN 0x33
#define MBX_NOT_FINISHED 255 #define MBX_NOT_FINISHED 255
...@@ -1566,95 +1565,83 @@ enum lpfc_protgrp_type { ...@@ -1566,95 +1565,83 @@ enum lpfc_protgrp_type {
}; };
/* PDE Descriptors */ /* PDE Descriptors */
#define LPFC_PDE1_DESCRIPTOR 0x81 #define LPFC_PDE5_DESCRIPTOR 0x85
#define LPFC_PDE2_DESCRIPTOR 0x82 #define LPFC_PDE6_DESCRIPTOR 0x86
#define LPFC_PDE3_DESCRIPTOR 0x83 #define LPFC_PDE7_DESCRIPTOR 0x87
/* BlockGuard Profiles */ /* BlockGuard Opcodes */
enum lpfc_bg_prof_codes { #define BG_OP_IN_NODIF_OUT_CRC 0x0
LPFC_PROF_INVALID, #define BG_OP_IN_CRC_OUT_NODIF 0x1
LPFC_PROF_A1 = 128, /* Full Protection */ #define BG_OP_IN_NODIF_OUT_CSUM 0x2
LPFC_PROF_A2, /* Disabled Protection Checks:A2~A4 */ #define BG_OP_IN_CSUM_OUT_NODIF 0x3
LPFC_PROF_A3, #define BG_OP_IN_CRC_OUT_CRC 0x4
LPFC_PROF_A4, #define BG_OP_IN_CSUM_OUT_CSUM 0x5
LPFC_PROF_B1, /* Embedded DIFs: B1~B3 */ #define BG_OP_IN_CRC_OUT_CSUM 0x6
LPFC_PROF_B2, #define BG_OP_IN_CSUM_OUT_CRC 0x7
LPFC_PROF_B3,
LPFC_PROF_C1, /* Separate DIFs: C1~C3 */ struct lpfc_pde5 {
LPFC_PROF_C2, uint32_t word0;
LPFC_PROF_C3, #define pde5_type_SHIFT 24
LPFC_PROF_D1, /* Full Protection */ #define pde5_type_MASK 0x000000ff
LPFC_PROF_D2, /* Partial Protection & Check Disabling */ #define pde5_type_WORD word0
LPFC_PROF_D3, #define pde5_rsvd0_SHIFT 0
LPFC_PROF_E1, /* E1~E4:out - check-only, in - update apptag */ #define pde5_rsvd0_MASK 0x00ffffff
LPFC_PROF_E2, #define pde5_rsvd0_WORD word0
LPFC_PROF_E3, uint32_t reftag; /* Reference Tag Value */
LPFC_PROF_E4, uint32_t reftagtr; /* Reference Tag Translation Value */
LPFC_PROF_F1, /* Full Translation - F1 Prot Descriptor */
/* F1 Translation BDE */
LPFC_PROF_ANT1, /* TCP checksum, DIF inline with data buffers */
LPFC_PROF_AST1, /* TCP checksum, DIF split from data buffer */
LPFC_PROF_ANT2,
LPFC_PROF_AST2
}; };
/* BlockGuard error-control defines */ struct lpfc_pde6 {
#define BG_EC_STOP_ERR 0x00 uint32_t word0;
#define BG_EC_CONT_ERR 0x01 #define pde6_type_SHIFT 24
#define BG_EC_IGN_UNINIT_STOP_ERR 0x10 #define pde6_type_MASK 0x000000ff
#define BG_EC_IGN_UNINIT_CONT_ERR 0x11 #define pde6_type_WORD word0
#define pde6_rsvd0_SHIFT 0
/* PDE (Protection Descriptor Entry) word 0 bit masks and shifts */ #define pde6_rsvd0_MASK 0x00ffffff
#define PDE_DESC_TYPE_MASK 0xff000000 #define pde6_rsvd0_WORD word0
#define PDE_DESC_TYPE_SHIFT 24 uint32_t word1;
#define PDE_BG_PROFILE_MASK 0x00ff0000 #define pde6_rsvd1_SHIFT 26
#define PDE_BG_PROFILE_SHIFT 16 #define pde6_rsvd1_MASK 0x0000003f
#define PDE_BLOCK_LEN_MASK 0x0000fffc #define pde6_rsvd1_WORD word1
#define PDE_BLOCK_LEN_SHIFT 2 #define pde6_na_SHIFT 25
#define PDE_ERR_CTRL_MASK 0x00000003 #define pde6_na_MASK 0x00000001
#define PDE_ERR_CTRL_SHIFT 0 #define pde6_na_WORD word1
/* PDE word 1 bit masks and shifts */ #define pde6_rsvd2_SHIFT 16
#define PDE_APPTAG_MASK_MASK 0xffff0000 #define pde6_rsvd2_MASK 0x000001FF
#define PDE_APPTAG_MASK_SHIFT 16 #define pde6_rsvd2_WORD word1
#define PDE_APPTAG_VAL_MASK 0x0000ffff #define pde6_apptagtr_SHIFT 0
#define PDE_APPTAG_VAL_SHIFT 0 #define pde6_apptagtr_MASK 0x0000ffff
struct lpfc_pde { #define pde6_apptagtr_WORD word1
uint32_t parms; /* bitfields of descriptor, prof, len, and ec */ uint32_t word2;
uint32_t apptag; /* bitfields of app tag maskand app tag value */ #define pde6_optx_SHIFT 28
uint32_t reftag; /* reference tag occupying all 32 bits */ #define pde6_optx_MASK 0x0000000f
#define pde6_optx_WORD word2
#define pde6_oprx_SHIFT 24
#define pde6_oprx_MASK 0x0000000f
#define pde6_oprx_WORD word2
#define pde6_nr_SHIFT 23
#define pde6_nr_MASK 0x00000001
#define pde6_nr_WORD word2
#define pde6_ce_SHIFT 22
#define pde6_ce_MASK 0x00000001
#define pde6_ce_WORD word2
#define pde6_re_SHIFT 21
#define pde6_re_MASK 0x00000001
#define pde6_re_WORD word2
#define pde6_ae_SHIFT 20
#define pde6_ae_MASK 0x00000001
#define pde6_ae_WORD word2
#define pde6_ai_SHIFT 19
#define pde6_ai_MASK 0x00000001
#define pde6_ai_WORD word2
#define pde6_bs_SHIFT 16
#define pde6_bs_MASK 0x00000007
#define pde6_bs_WORD word2
#define pde6_apptagval_SHIFT 0
#define pde6_apptagval_MASK 0x0000ffff
#define pde6_apptagval_WORD word2
}; };
/* inline function to set fields in parms of PDE */
static inline void
lpfc_pde_set_bg_parms(struct lpfc_pde *p, u8 desc, u8 prof, u16 len, u8 ec)
{
uint32_t *wp = &p->parms;
/* spec indicates that adapter appends two 0's to length field */
len = len >> 2;
*wp &= 0;
*wp |= ((desc << PDE_DESC_TYPE_SHIFT) & PDE_DESC_TYPE_MASK);
*wp |= ((prof << PDE_BG_PROFILE_SHIFT) & PDE_BG_PROFILE_MASK);
*wp |= ((len << PDE_BLOCK_LEN_SHIFT) & PDE_BLOCK_LEN_MASK);
*wp |= ((ec << PDE_ERR_CTRL_SHIFT) & PDE_ERR_CTRL_MASK);
*wp = le32_to_cpu(*wp);
}
/* inline function to set apptag and reftag fields of PDE */
static inline void
lpfc_pde_set_dif_parms(struct lpfc_pde *p, u16 apptagmask, u16 apptagval,
u32 reftag)
{
uint32_t *wp = &p->apptag;
*wp &= 0;
*wp |= ((apptagmask << PDE_APPTAG_MASK_SHIFT) & PDE_APPTAG_MASK_MASK);
*wp |= ((apptagval << PDE_APPTAG_VAL_SHIFT) & PDE_APPTAG_VAL_MASK);
*wp = le32_to_cpu(*wp);
wp = &p->reftag;
*wp = le32_to_cpu(reftag);
}
/* Structure for MB Command LOAD_SM and DOWN_LOAD */ /* Structure for MB Command LOAD_SM and DOWN_LOAD */
...@@ -2488,8 +2475,8 @@ typedef struct { ...@@ -2488,8 +2475,8 @@ typedef struct {
#define DMP_VPORT_REGION_SIZE 0x200 #define DMP_VPORT_REGION_SIZE 0x200
#define DMP_MBOX_OFFSET_WORD 0x5 #define DMP_MBOX_OFFSET_WORD 0x5
#define DMP_REGION_23 0x17 /* fcoe param and port state region */ #define DMP_REGION_23 0x17 /* fcoe param and port state region */
#define DMP_RGN23_SIZE 0x400 #define DMP_RGN23_SIZE 0x400
#define WAKE_UP_PARMS_REGION_ID 4 #define WAKE_UP_PARMS_REGION_ID 4
#define WAKE_UP_PARMS_WORD_SIZE 15 #define WAKE_UP_PARMS_WORD_SIZE 15
...@@ -2504,9 +2491,9 @@ struct vport_rec { ...@@ -2504,9 +2491,9 @@ struct vport_rec {
#define VPORT_INFO_REV 0x1 #define VPORT_INFO_REV 0x1
#define MAX_STATIC_VPORT_COUNT 16 #define MAX_STATIC_VPORT_COUNT 16
struct static_vport_info { struct static_vport_info {
uint32_t signature; uint32_t signature;
uint32_t rev; uint32_t rev;
struct vport_rec vport_list[MAX_STATIC_VPORT_COUNT]; struct vport_rec vport_list[MAX_STATIC_VPORT_COUNT];
uint32_t resvd[66]; uint32_t resvd[66];
}; };
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment