Commit 70f3c073 authored by James Smart's avatar James Smart Committed by James Bottomley

[SCSI] lpfc 8.3.20: Implement the FC and SLI async event handlers

Implement the FC and SLI async event handlers:

- Updated MQ_CREATE_EXT mailbox structure to include fc and SLI async events.
- Added the SLI trailer code.
- Split physical field into type and number to reflect latest SLI spec.
- Changed lpfc_acqe_fcoe to lpfc_acqe_fip to reflect latest Spec changes.
- Added lpfc_acqe_fc_la structure for FC link attention async events.
- Added lpfc_acqe_sli structure for sli async events.
- Added lpfc_sli4_async_fc_evt routine to handle fc la async events.
- Added lpfc_sli4_async_sli routine to handle sli async events.
- Moved LPFC_TRAILER_CODE_FC to be handled by its own handler function.
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 be858b65
......@@ -1134,12 +1134,18 @@ struct lpfc_mbx_mq_create_ext {
#define lpfc_mbx_mq_create_ext_async_evt_link_SHIFT LPFC_TRAILER_CODE_LINK
#define lpfc_mbx_mq_create_ext_async_evt_link_MASK 0x00000001
#define lpfc_mbx_mq_create_ext_async_evt_link_WORD async_evt_bmap
#define lpfc_mbx_mq_create_ext_async_evt_fcfste_SHIFT LPFC_TRAILER_CODE_FCOE
#define lpfc_mbx_mq_create_ext_async_evt_fcfste_MASK 0x00000001
#define lpfc_mbx_mq_create_ext_async_evt_fcfste_WORD async_evt_bmap
#define lpfc_mbx_mq_create_ext_async_evt_fip_SHIFT LPFC_TRAILER_CODE_FCOE
#define lpfc_mbx_mq_create_ext_async_evt_fip_MASK 0x00000001
#define lpfc_mbx_mq_create_ext_async_evt_fip_WORD async_evt_bmap
#define lpfc_mbx_mq_create_ext_async_evt_group5_SHIFT LPFC_TRAILER_CODE_GRP5
#define lpfc_mbx_mq_create_ext_async_evt_group5_MASK 0x00000001
#define lpfc_mbx_mq_create_ext_async_evt_group5_WORD async_evt_bmap
#define lpfc_mbx_mq_create_ext_async_evt_fc_SHIFT LPFC_TRAILER_CODE_FC
#define lpfc_mbx_mq_create_ext_async_evt_fc_MASK 0x00000001
#define lpfc_mbx_mq_create_ext_async_evt_fc_WORD async_evt_bmap
#define lpfc_mbx_mq_create_ext_async_evt_sli_SHIFT LPFC_TRAILER_CODE_SLI
#define lpfc_mbx_mq_create_ext_async_evt_sli_MASK 0x00000001
#define lpfc_mbx_mq_create_ext_async_evt_sli_WORD async_evt_bmap
struct mq_context context;
struct dma_address page[LPFC_MAX_MQ_PAGE];
} request;
......@@ -1393,7 +1399,7 @@ struct lpfc_mbx_query_fw_cfg {
#define lpfc_function_mode_dal_WORD function_mode
#define lpfc_function_mode_lro_SHIFT 9
#define lpfc_function_mode_lro_MASK 0x00000001
#define lpfc_function_mode_lro_WORD function_mode9
#define lpfc_function_mode_lro_WORD function_mode
#define lpfc_function_mode_flex10_SHIFT 10
#define lpfc_function_mode_flex10_MASK 0x00000001
#define lpfc_function_mode_flex10_WORD function_mode
......@@ -2162,6 +2168,7 @@ struct lpfc_mcqe {
#define LPFC_TRAILER_CODE_DCBX 0x3
#define LPFC_TRAILER_CODE_GRP5 0x5
#define LPFC_TRAILER_CODE_FC 0x10
#define LPFC_TRAILER_CODE_SLI 0x11
};
struct lpfc_acqe_link {
......@@ -2187,11 +2194,12 @@ struct lpfc_acqe_link {
#define LPFC_ASYNC_LINK_STATUS_UP 0x1
#define LPFC_ASYNC_LINK_STATUS_LOGICAL_DOWN 0x2
#define LPFC_ASYNC_LINK_STATUS_LOGICAL_UP 0x3
#define lpfc_acqe_link_physical_SHIFT 0
#define lpfc_acqe_link_physical_MASK 0x000000FF
#define lpfc_acqe_link_physical_WORD word0
#define LPFC_ASYNC_LINK_PORT_A 0x0
#define LPFC_ASYNC_LINK_PORT_B 0x1
#define lpfc_acqe_link_type_SHIFT 6
#define lpfc_acqe_link_type_MASK 0x00000003
#define lpfc_acqe_link_type_WORD word0
#define lpfc_acqe_link_number_SHIFT 0
#define lpfc_acqe_link_number_MASK 0x0000003F
#define lpfc_acqe_link_number_WORD word0
uint32_t word1;
#define lpfc_acqe_link_fault_SHIFT 0
#define lpfc_acqe_link_fault_MASK 0x000000FF
......@@ -2199,29 +2207,31 @@ struct lpfc_acqe_link {
#define LPFC_ASYNC_LINK_FAULT_NONE 0x0
#define LPFC_ASYNC_LINK_FAULT_LOCAL 0x1
#define LPFC_ASYNC_LINK_FAULT_REMOTE 0x2
#define lpfc_acqe_qos_link_speed_SHIFT 16
#define lpfc_acqe_qos_link_speed_MASK 0x0000FFFF
#define lpfc_acqe_qos_link_speed_WORD word1
#define lpfc_acqe_logical_link_speed_SHIFT 16
#define lpfc_acqe_logical_link_speed_MASK 0x0000FFFF
#define lpfc_acqe_logical_link_speed_WORD word1
uint32_t event_tag;
uint32_t trailer;
#define LPFC_LINK_EVENT_TYPE_PHYSICAL 0x0
#define LPFC_LINK_EVENT_TYPE_VIRTUAL 0x1
};
struct lpfc_acqe_fcoe {
struct lpfc_acqe_fip {
uint32_t index;
uint32_t word1;
#define lpfc_acqe_fcoe_fcf_count_SHIFT 0
#define lpfc_acqe_fcoe_fcf_count_MASK 0x0000FFFF
#define lpfc_acqe_fcoe_fcf_count_WORD word1
#define lpfc_acqe_fcoe_event_type_SHIFT 16
#define lpfc_acqe_fcoe_event_type_MASK 0x0000FFFF
#define lpfc_acqe_fcoe_event_type_WORD word1
#define LPFC_FCOE_EVENT_TYPE_NEW_FCF 0x1
#define LPFC_FCOE_EVENT_TYPE_FCF_TABLE_FULL 0x2
#define LPFC_FCOE_EVENT_TYPE_FCF_DEAD 0x3
#define LPFC_FCOE_EVENT_TYPE_CVL 0x4
#define LPFC_FCOE_EVENT_TYPE_FCF_PARAM_MOD 0x5
#define lpfc_acqe_fip_fcf_count_SHIFT 0
#define lpfc_acqe_fip_fcf_count_MASK 0x0000FFFF
#define lpfc_acqe_fip_fcf_count_WORD word1
#define lpfc_acqe_fip_event_type_SHIFT 16
#define lpfc_acqe_fip_event_type_MASK 0x0000FFFF
#define lpfc_acqe_fip_event_type_WORD word1
uint32_t event_tag;
uint32_t trailer;
#define LPFC_FIP_EVENT_TYPE_NEW_FCF 0x1
#define LPFC_FIP_EVENT_TYPE_FCF_TABLE_FULL 0x2
#define LPFC_FIP_EVENT_TYPE_FCF_DEAD 0x3
#define LPFC_FIP_EVENT_TYPE_CVL 0x4
#define LPFC_FIP_EVENT_TYPE_FCF_PARAM_MOD 0x5
};
struct lpfc_acqe_dcbx {
......@@ -2233,9 +2243,12 @@ struct lpfc_acqe_dcbx {
struct lpfc_acqe_grp5 {
uint32_t word0;
#define lpfc_acqe_grp5_pport_SHIFT 0
#define lpfc_acqe_grp5_pport_MASK 0x000000FF
#define lpfc_acqe_grp5_pport_WORD word0
#define lpfc_acqe_grp5_type_SHIFT 6
#define lpfc_acqe_grp5_type_MASK 0x00000003
#define lpfc_acqe_grp5_type_WORD word0
#define lpfc_acqe_grp5_number_SHIFT 0
#define lpfc_acqe_grp5_number_MASK 0x0000003F
#define lpfc_acqe_grp5_number_WORD word0
uint32_t word1;
#define lpfc_acqe_grp5_llink_spd_SHIFT 16
#define lpfc_acqe_grp5_llink_spd_MASK 0x0000FFFF
......@@ -2244,6 +2257,68 @@ struct lpfc_acqe_grp5 {
uint32_t trailer;
};
struct lpfc_acqe_fc_la {
uint32_t word0;
#define lpfc_acqe_fc_la_speed_SHIFT 24
#define lpfc_acqe_fc_la_speed_MASK 0x000000FF
#define lpfc_acqe_fc_la_speed_WORD word0
#define LPFC_FC_LA_SPEED_UNKOWN 0x0
#define LPFC_FC_LA_SPEED_1G 0x1
#define LPFC_FC_LA_SPEED_2G 0x2
#define LPFC_FC_LA_SPEED_4G 0x4
#define LPFC_FC_LA_SPEED_8G 0x8
#define LPFC_FC_LA_SPEED_10G 0xA
#define LPFC_FC_LA_SPEED_16G 0x10
#define lpfc_acqe_fc_la_topology_SHIFT 16
#define lpfc_acqe_fc_la_topology_MASK 0x000000FF
#define lpfc_acqe_fc_la_topology_WORD word0
#define LPFC_FC_LA_TOP_UNKOWN 0x0
#define LPFC_FC_LA_TOP_P2P 0x1
#define LPFC_FC_LA_TOP_FCAL 0x2
#define LPFC_FC_LA_TOP_INTERNAL_LOOP 0x3
#define LPFC_FC_LA_TOP_SERDES_LOOP 0x4
#define lpfc_acqe_fc_la_att_type_SHIFT 8
#define lpfc_acqe_fc_la_att_type_MASK 0x000000FF
#define lpfc_acqe_fc_la_att_type_WORD word0
#define LPFC_FC_LA_TYPE_LINK_UP 0x1
#define LPFC_FC_LA_TYPE_LINK_DOWN 0x2
#define LPFC_FC_LA_TYPE_NO_HARD_ALPA 0x3
#define lpfc_acqe_fc_la_port_type_SHIFT 6
#define lpfc_acqe_fc_la_port_type_MASK 0x00000003
#define lpfc_acqe_fc_la_port_type_WORD word0
#define LPFC_LINK_TYPE_ETHERNET 0x0
#define LPFC_LINK_TYPE_FC 0x1
#define lpfc_acqe_fc_la_port_number_SHIFT 0
#define lpfc_acqe_fc_la_port_number_MASK 0x0000003F
#define lpfc_acqe_fc_la_port_number_WORD word0
uint32_t word1;
#define lpfc_acqe_fc_la_llink_spd_SHIFT 16
#define lpfc_acqe_fc_la_llink_spd_MASK 0x0000FFFF
#define lpfc_acqe_fc_la_llink_spd_WORD word1
#define lpfc_acqe_fc_la_fault_SHIFT 0
#define lpfc_acqe_fc_la_fault_MASK 0x000000FF
#define lpfc_acqe_fc_la_fault_WORD word1
#define LPFC_FC_LA_FAULT_NONE 0x0
#define LPFC_FC_LA_FAULT_LOCAL 0x1
#define LPFC_FC_LA_FAULT_REMOTE 0x2
uint32_t event_tag;
uint32_t trailer;
#define LPFC_FC_LA_EVENT_TYPE_FC_LINK 0x1
#define LPFC_FC_LA_EVENT_TYPE_SHARED_LINK 0x2
};
struct lpfc_acqe_sli {
uint32_t event_data1;
uint32_t event_data2;
uint32_t reserved;
uint32_t trailer;
#define LPFC_SLI_EVENT_TYPE_PORT_ERROR 0x1
#define LPFC_SLI_EVENT_TYPE_OVER_TEMP 0x2
#define LPFC_SLI_EVENT_TYPE_NORM_TEMP 0x3
#define LPFC_SLI_EVENT_TYPE_NVLOG_POST 0x4
#define LPFC_SLI_EVENT_TYPE_DIAG_DUMP 0x5
};
/*
* Define the bootstrap mailbox (bmbx) region used to communicate
* mailbox command between the host and port. The mailbox consists
......
This diff is collapsed.
......@@ -10561,16 +10561,20 @@ lpfc_mq_create(struct lpfc_hba *phba, struct lpfc_queue *mq,
length, LPFC_SLI4_MBX_EMBED);
mq_create_ext = &mbox->u.mqe.un.mq_create_ext;
bf_set(lpfc_mbx_mq_create_ext_num_pages, &mq_create_ext->u.request,
mq->page_count);
bf_set(lpfc_mbx_mq_create_ext_async_evt_link, &mq_create_ext->u.request,
1);
bf_set(lpfc_mbx_mq_create_ext_async_evt_fcfste,
bf_set(lpfc_mbx_mq_create_ext_num_pages,
&mq_create_ext->u.request, mq->page_count);
bf_set(lpfc_mbx_mq_create_ext_async_evt_link,
&mq_create_ext->u.request, 1);
bf_set(lpfc_mbx_mq_create_ext_async_evt_fip,
&mq_create_ext->u.request, 1);
bf_set(lpfc_mbx_mq_create_ext_async_evt_group5,
&mq_create_ext->u.request, 1);
bf_set(lpfc_mq_context_cq_id, &mq_create_ext->u.request.context,
cq->queue_id);
bf_set(lpfc_mbx_mq_create_ext_async_evt_fc,
&mq_create_ext->u.request, 1);
bf_set(lpfc_mbx_mq_create_ext_async_evt_sli,
&mq_create_ext->u.request, 1);
bf_set(lpfc_mq_context_cq_id,
&mq_create_ext->u.request.context, cq->queue_id);
bf_set(lpfc_mq_context_valid, &mq_create_ext->u.request.context, 1);
switch (mq->entry_count) {
default:
......
......@@ -34,9 +34,11 @@ struct lpfc_cq_event {
union {
struct lpfc_mcqe mcqe_cmpl;
struct lpfc_acqe_link acqe_link;
struct lpfc_acqe_fcoe acqe_fcoe;
struct lpfc_acqe_fip acqe_fip;
struct lpfc_acqe_dcbx acqe_dcbx;
struct lpfc_acqe_grp5 acqe_grp5;
struct lpfc_acqe_fc_la acqe_fc;
struct lpfc_acqe_sli acqe_sli;
struct lpfc_rcqe rcqe_cmpl;
struct sli4_wcqe_xri_aborted wcqe_axri;
struct lpfc_wcqe_complete wcqe_cmpl;
......
......@@ -137,9 +137,11 @@ struct lpfc_sli4_link {
uint8_t speed;
uint8_t duplex;
uint8_t status;
uint8_t physical;
uint8_t type;
uint8_t number;
uint8_t fault;
uint16_t logical_speed;
uint16_t topology;
};
struct lpfc_fcf_rec {
......
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