diff options
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_hw.h')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_hw.h | 167 |
1 files changed, 77 insertions, 90 deletions
diff --git a/drivers/scsi/lpfc/lpfc_hw.h b/drivers/scsi/lpfc/lpfc_hw.h index 6ba1f307ccce..0cf9a2bd3469 100644 --- a/drivers/scsi/lpfc/lpfc_hw.h +++ b/drivers/scsi/lpfc/lpfc_hw.h | |||
@@ -1500,7 +1500,6 @@ typedef struct { /* FireFly BIU registers */ | |||
1500 | #define MBXERR_BAD_RCV_LENGTH 14 | 1500 | #define MBXERR_BAD_RCV_LENGTH 14 |
1501 | #define MBXERR_DMA_ERROR 15 | 1501 | #define MBXERR_DMA_ERROR 15 |
1502 | #define MBXERR_ERROR 16 | 1502 | #define MBXERR_ERROR 16 |
1503 | #define MBXERR_UNKNOWN_CMD 18 | ||
1504 | #define MBXERR_LINK_DOWN 0x33 | 1503 | #define MBXERR_LINK_DOWN 0x33 |
1505 | #define MBX_NOT_FINISHED 255 | 1504 | #define MBX_NOT_FINISHED 255 |
1506 | 1505 | ||
@@ -1566,95 +1565,83 @@ enum lpfc_protgrp_type { | |||
1566 | }; | 1565 | }; |
1567 | 1566 | ||
1568 | /* PDE Descriptors */ | 1567 | /* PDE Descriptors */ |
1569 | #define LPFC_PDE1_DESCRIPTOR 0x81 | 1568 | #define LPFC_PDE5_DESCRIPTOR 0x85 |
1570 | #define LPFC_PDE2_DESCRIPTOR 0x82 | 1569 | #define LPFC_PDE6_DESCRIPTOR 0x86 |
1571 | #define LPFC_PDE3_DESCRIPTOR 0x83 | 1570 | #define LPFC_PDE7_DESCRIPTOR 0x87 |
1572 | 1571 | ||
1573 | /* BlockGuard Profiles */ | 1572 | /* BlockGuard Opcodes */ |
1574 | enum lpfc_bg_prof_codes { | 1573 | #define BG_OP_IN_NODIF_OUT_CRC 0x0 |
1575 | LPFC_PROF_INVALID, | 1574 | #define BG_OP_IN_CRC_OUT_NODIF 0x1 |
1576 | LPFC_PROF_A1 = 128, /* Full Protection */ | 1575 | #define BG_OP_IN_NODIF_OUT_CSUM 0x2 |
1577 | LPFC_PROF_A2, /* Disabled Protection Checks:A2~A4 */ | 1576 | #define BG_OP_IN_CSUM_OUT_NODIF 0x3 |
1578 | LPFC_PROF_A3, | 1577 | #define BG_OP_IN_CRC_OUT_CRC 0x4 |
1579 | LPFC_PROF_A4, | 1578 | #define BG_OP_IN_CSUM_OUT_CSUM 0x5 |
1580 | LPFC_PROF_B1, /* Embedded DIFs: B1~B3 */ | 1579 | #define BG_OP_IN_CRC_OUT_CSUM 0x6 |
1581 | LPFC_PROF_B2, | 1580 | #define BG_OP_IN_CSUM_OUT_CRC 0x7 |
1582 | LPFC_PROF_B3, | 1581 | |
1583 | LPFC_PROF_C1, /* Separate DIFs: C1~C3 */ | 1582 | struct lpfc_pde5 { |
1584 | LPFC_PROF_C2, | 1583 | uint32_t word0; |
1585 | LPFC_PROF_C3, | 1584 | #define pde5_type_SHIFT 24 |
1586 | LPFC_PROF_D1, /* Full Protection */ | 1585 | #define pde5_type_MASK 0x000000ff |
1587 | LPFC_PROF_D2, /* Partial Protection & Check Disabling */ | 1586 | #define pde5_type_WORD word0 |
1588 | LPFC_PROF_D3, | 1587 | #define pde5_rsvd0_SHIFT 0 |
1589 | LPFC_PROF_E1, /* E1~E4:out - check-only, in - update apptag */ | 1588 | #define pde5_rsvd0_MASK 0x00ffffff |
1590 | LPFC_PROF_E2, | 1589 | #define pde5_rsvd0_WORD word0 |
1591 | LPFC_PROF_E3, | 1590 | uint32_t reftag; /* Reference Tag Value */ |
1592 | LPFC_PROF_E4, | 1591 | uint32_t reftagtr; /* Reference Tag Translation Value */ |
1593 | LPFC_PROF_F1, /* Full Translation - F1 Prot Descriptor */ | ||
1594 | /* F1 Translation BDE */ | ||
1595 | LPFC_PROF_ANT1, /* TCP checksum, DIF inline with data buffers */ | ||
1596 | LPFC_PROF_AST1, /* TCP checksum, DIF split from data buffer */ | ||
1597 | LPFC_PROF_ANT2, | ||
1598 | LPFC_PROF_AST2 | ||
1599 | }; | 1592 | }; |
1600 | 1593 | ||
1601 | /* BlockGuard error-control defines */ | 1594 | struct lpfc_pde6 { |
1602 | #define BG_EC_STOP_ERR 0x00 | 1595 | uint32_t word0; |
1603 | #define BG_EC_CONT_ERR 0x01 | 1596 | #define pde6_type_SHIFT 24 |
1604 | #define BG_EC_IGN_UNINIT_STOP_ERR 0x10 | 1597 | #define pde6_type_MASK 0x000000ff |
1605 | #define BG_EC_IGN_UNINIT_CONT_ERR 0x11 | 1598 | #define pde6_type_WORD word0 |
1606 | 1599 | #define pde6_rsvd0_SHIFT 0 | |
1607 | /* PDE (Protection Descriptor Entry) word 0 bit masks and shifts */ | 1600 | #define pde6_rsvd0_MASK 0x00ffffff |
1608 | #define PDE_DESC_TYPE_MASK 0xff000000 | 1601 | #define pde6_rsvd0_WORD word0 |
1609 | #define PDE_DESC_TYPE_SHIFT 24 | 1602 | uint32_t word1; |
1610 | #define PDE_BG_PROFILE_MASK 0x00ff0000 | 1603 | #define pde6_rsvd1_SHIFT 26 |
1611 | #define PDE_BG_PROFILE_SHIFT 16 | 1604 | #define pde6_rsvd1_MASK 0x0000003f |
1612 | #define PDE_BLOCK_LEN_MASK 0x0000fffc | 1605 | #define pde6_rsvd1_WORD word1 |
1613 | #define PDE_BLOCK_LEN_SHIFT 2 | 1606 | #define pde6_na_SHIFT 25 |
1614 | #define PDE_ERR_CTRL_MASK 0x00000003 | 1607 | #define pde6_na_MASK 0x00000001 |
1615 | #define PDE_ERR_CTRL_SHIFT 0 | 1608 | #define pde6_na_WORD word1 |
1616 | /* PDE word 1 bit masks and shifts */ | 1609 | #define pde6_rsvd2_SHIFT 16 |
1617 | #define PDE_APPTAG_MASK_MASK 0xffff0000 | 1610 | #define pde6_rsvd2_MASK 0x000001FF |
1618 | #define PDE_APPTAG_MASK_SHIFT 16 | 1611 | #define pde6_rsvd2_WORD word1 |
1619 | #define PDE_APPTAG_VAL_MASK 0x0000ffff | 1612 | #define pde6_apptagtr_SHIFT 0 |
1620 | #define PDE_APPTAG_VAL_SHIFT 0 | 1613 | #define pde6_apptagtr_MASK 0x0000ffff |
1621 | struct lpfc_pde { | 1614 | #define pde6_apptagtr_WORD word1 |
1622 | uint32_t parms; /* bitfields of descriptor, prof, len, and ec */ | 1615 | uint32_t word2; |
1623 | uint32_t apptag; /* bitfields of app tag maskand app tag value */ | 1616 | #define pde6_optx_SHIFT 28 |
1624 | uint32_t reftag; /* reference tag occupying all 32 bits */ | 1617 | #define pde6_optx_MASK 0x0000000f |
1618 | #define pde6_optx_WORD word2 | ||
1619 | #define pde6_oprx_SHIFT 24 | ||
1620 | #define pde6_oprx_MASK 0x0000000f | ||
1621 | #define pde6_oprx_WORD word2 | ||
1622 | #define pde6_nr_SHIFT 23 | ||
1623 | #define pde6_nr_MASK 0x00000001 | ||
1624 | #define pde6_nr_WORD word2 | ||
1625 | #define pde6_ce_SHIFT 22 | ||
1626 | #define pde6_ce_MASK 0x00000001 | ||
1627 | #define pde6_ce_WORD word2 | ||
1628 | #define pde6_re_SHIFT 21 | ||
1629 | #define pde6_re_MASK 0x00000001 | ||
1630 | #define pde6_re_WORD word2 | ||
1631 | #define pde6_ae_SHIFT 20 | ||
1632 | #define pde6_ae_MASK 0x00000001 | ||
1633 | #define pde6_ae_WORD word2 | ||
1634 | #define pde6_ai_SHIFT 19 | ||
1635 | #define pde6_ai_MASK 0x00000001 | ||
1636 | #define pde6_ai_WORD word2 | ||
1637 | #define pde6_bs_SHIFT 16 | ||
1638 | #define pde6_bs_MASK 0x00000007 | ||
1639 | #define pde6_bs_WORD word2 | ||
1640 | #define pde6_apptagval_SHIFT 0 | ||
1641 | #define pde6_apptagval_MASK 0x0000ffff | ||
1642 | #define pde6_apptagval_WORD word2 | ||
1625 | }; | 1643 | }; |
1626 | 1644 | ||
1627 | /* inline function to set fields in parms of PDE */ | ||
1628 | static inline void | ||
1629 | lpfc_pde_set_bg_parms(struct lpfc_pde *p, u8 desc, u8 prof, u16 len, u8 ec) | ||
1630 | { | ||
1631 | uint32_t *wp = &p->parms; | ||
1632 | |||
1633 | /* spec indicates that adapter appends two 0's to length field */ | ||
1634 | len = len >> 2; | ||
1635 | |||
1636 | *wp &= 0; | ||
1637 | *wp |= ((desc << PDE_DESC_TYPE_SHIFT) & PDE_DESC_TYPE_MASK); | ||
1638 | *wp |= ((prof << PDE_BG_PROFILE_SHIFT) & PDE_BG_PROFILE_MASK); | ||
1639 | *wp |= ((len << PDE_BLOCK_LEN_SHIFT) & PDE_BLOCK_LEN_MASK); | ||
1640 | *wp |= ((ec << PDE_ERR_CTRL_SHIFT) & PDE_ERR_CTRL_MASK); | ||
1641 | *wp = le32_to_cpu(*wp); | ||
1642 | } | ||
1643 | |||
1644 | /* inline function to set apptag and reftag fields of PDE */ | ||
1645 | static inline void | ||
1646 | lpfc_pde_set_dif_parms(struct lpfc_pde *p, u16 apptagmask, u16 apptagval, | ||
1647 | u32 reftag) | ||
1648 | { | ||
1649 | uint32_t *wp = &p->apptag; | ||
1650 | *wp &= 0; | ||
1651 | *wp |= ((apptagmask << PDE_APPTAG_MASK_SHIFT) & PDE_APPTAG_MASK_MASK); | ||
1652 | *wp |= ((apptagval << PDE_APPTAG_VAL_SHIFT) & PDE_APPTAG_VAL_MASK); | ||
1653 | *wp = le32_to_cpu(*wp); | ||
1654 | wp = &p->reftag; | ||
1655 | *wp = le32_to_cpu(reftag); | ||
1656 | } | ||
1657 | |||
1658 | 1645 | ||
1659 | /* Structure for MB Command LOAD_SM and DOWN_LOAD */ | 1646 | /* Structure for MB Command LOAD_SM and DOWN_LOAD */ |
1660 | 1647 | ||
@@ -2488,8 +2475,8 @@ typedef struct { | |||
2488 | #define DMP_VPORT_REGION_SIZE 0x200 | 2475 | #define DMP_VPORT_REGION_SIZE 0x200 |
2489 | #define DMP_MBOX_OFFSET_WORD 0x5 | 2476 | #define DMP_MBOX_OFFSET_WORD 0x5 |
2490 | 2477 | ||
2491 | #define DMP_REGION_23 0x17 /* fcoe param and port state region */ | 2478 | #define DMP_REGION_23 0x17 /* fcoe param and port state region */ |
2492 | #define DMP_RGN23_SIZE 0x400 | 2479 | #define DMP_RGN23_SIZE 0x400 |
2493 | 2480 | ||
2494 | #define WAKE_UP_PARMS_REGION_ID 4 | 2481 | #define WAKE_UP_PARMS_REGION_ID 4 |
2495 | #define WAKE_UP_PARMS_WORD_SIZE 15 | 2482 | #define WAKE_UP_PARMS_WORD_SIZE 15 |
@@ -2504,9 +2491,9 @@ struct vport_rec { | |||
2504 | #define VPORT_INFO_REV 0x1 | 2491 | #define VPORT_INFO_REV 0x1 |
2505 | #define MAX_STATIC_VPORT_COUNT 16 | 2492 | #define MAX_STATIC_VPORT_COUNT 16 |
2506 | struct static_vport_info { | 2493 | struct static_vport_info { |
2507 | uint32_t signature; | 2494 | uint32_t signature; |
2508 | uint32_t rev; | 2495 | uint32_t rev; |
2509 | struct vport_rec vport_list[MAX_STATIC_VPORT_COUNT]; | 2496 | struct vport_rec vport_list[MAX_STATIC_VPORT_COUNT]; |
2510 | uint32_t resvd[66]; | 2497 | uint32_t resvd[66]; |
2511 | }; | 2498 | }; |
2512 | 2499 | ||