From 293f82d59ed8b6d61d242e40ee7a6a146fae5eaa Mon Sep 17 00:00:00 2001 From: Jing Huang Date: Thu, 8 Jul 2010 19:45:20 -0700 Subject: [SCSI] bfa: enable new hardware This patch enables support of new mezzanine cards for HP and IBM blade server. - Add new pciids for HP and IBM mezzanine card. - Add a new firmware image for HP mezzanine card, which is running in FC only mode. Rename firmware image to reflect the difference. Change the firmware download code accordingly for the above changes. Signed-off-by: Jing Huang Signed-off-by: James Bottomley --- drivers/scsi/bfa/include/bfi/bfi_ioc.h | 1 + drivers/scsi/bfa/include/defs/bfa_defs_mfg.h | 3 +++ drivers/scsi/bfa/include/defs/bfa_defs_pci.h | 11 +++++++++-- 3 files changed, 13 insertions(+), 2 deletions(-) (limited to 'drivers/scsi/bfa/include') diff --git a/drivers/scsi/bfa/include/bfi/bfi_ioc.h b/drivers/scsi/bfa/include/bfi/bfi_ioc.h index a0158aac0024..03a9c9408ca5 100644 --- a/drivers/scsi/bfa/include/bfi/bfi_ioc.h +++ b/drivers/scsi/bfa/include/bfi/bfi_ioc.h @@ -63,6 +63,7 @@ struct bfi_ioc_attr_s { char fw_version[BFA_VERSION_LEN]; char optrom_version[BFA_VERSION_LEN]; struct bfa_mfg_vpd_s vpd; + uint32_t card_type; /* card type */ }; /** diff --git a/drivers/scsi/bfa/include/defs/bfa_defs_mfg.h b/drivers/scsi/bfa/include/defs/bfa_defs_mfg.h index c5bd9c36ad4d..bfb50eb2124d 100644 --- a/drivers/scsi/bfa/include/defs/bfa_defs_mfg.h +++ b/drivers/scsi/bfa/include/defs/bfa_defs_mfg.h @@ -86,6 +86,9 @@ enum { BFA_MFG_TYPE_FC4P1 = 415, /* 4G 1port FC card */ BFA_MFG_TYPE_CNA10P2 = 1020, /* 10G 2port CNA card */ BFA_MFG_TYPE_CNA10P1 = 1010, /* 10G 1port CNA card */ + BFA_MFG_TYPE_JAYHAWK = 804, /* Jayhawk mezz card */ + BFA_MFG_TYPE_WANCHESE = 1007, /* Wanchese mezz card */ + BFA_MFG_TYPE_INVALID = 0, /* Invalid card type */ }; #pragma pack(1) diff --git a/drivers/scsi/bfa/include/defs/bfa_defs_pci.h b/drivers/scsi/bfa/include/defs/bfa_defs_pci.h index c9b83321694b..ea7d89bbc0bb 100644 --- a/drivers/scsi/bfa/include/defs/bfa_defs_pci.h +++ b/drivers/scsi/bfa/include/defs/bfa_defs_pci.h @@ -26,8 +26,13 @@ enum { BFA_PCI_DEVICE_ID_FC_8G2P = 0x13, BFA_PCI_DEVICE_ID_FC_8G1P = 0x17, BFA_PCI_DEVICE_ID_CT = 0x14, + BFA_PCI_DEVICE_ID_CT_FC = 0x21, }; +#define bfa_asic_id_ct(devid) \ + ((devid) == BFA_PCI_DEVICE_ID_CT || \ + (devid) == BFA_PCI_DEVICE_ID_CT_FC) + /** * PCI sub-system device and vendor ID information */ @@ -35,7 +40,9 @@ enum { BFA_PCI_FCOE_SSDEVICE_ID = 0x14, }; -#define BFA_PCI_ACCESS_RANGES 1 /* Maximum number of device address ranges - * mapped through different BAR(s). */ +/** + * Maximum number of device address ranges mapped through different BAR(s) + */ +#define BFA_PCI_ACCESS_RANGES 1 #endif /* __BFA_DEFS_PCI_H__ */ -- cgit v1.2.3 From ed96932470e4ca3aab29518a748dc1162853b456 Mon Sep 17 00:00:00 2001 From: Jing Huang Date: Thu, 8 Jul 2010 19:45:56 -0700 Subject: [SCSI] bfa: enable basic PBC support The patch includes the driver side changes to enable basic PBC (PreBoot Configuration) feature. - Data structure changes and new definitions for PBC. - APIs to access PBC info. - Remove unused code. Signed-off-by: Jing Huang Signed-off-by: James Bottomley --- drivers/scsi/bfa/include/bfi/bfi_iocfc.h | 2 + drivers/scsi/bfa/include/bfi/bfi_pbc.h | 62 ++++++++++++++++++++++++ drivers/scsi/bfa/include/defs/bfa_defs_adapter.h | 3 +- drivers/scsi/bfa/include/defs/bfa_defs_boot.h | 10 ++++ drivers/scsi/bfa/include/defs/bfa_defs_mfg.h | 38 +++++++-------- drivers/scsi/bfa/include/defs/bfa_defs_pport.h | 3 ++ 6 files changed, 97 insertions(+), 21 deletions(-) create mode 100644 drivers/scsi/bfa/include/bfi/bfi_pbc.h (limited to 'drivers/scsi/bfa/include') diff --git a/drivers/scsi/bfa/include/bfi/bfi_iocfc.h b/drivers/scsi/bfa/include/bfi/bfi_iocfc.h index c3760df72575..ccdfcc5d7e0b 100644 --- a/drivers/scsi/bfa/include/bfi/bfi_iocfc.h +++ b/drivers/scsi/bfa/include/bfi/bfi_iocfc.h @@ -19,6 +19,7 @@ #define __BFI_IOCFC_H__ #include "bfi.h" +#include #include #include #include @@ -78,6 +79,7 @@ struct bfi_iocfc_cfgrsp_s { struct bfa_iocfc_fwcfg_s fwcfg; struct bfa_iocfc_intr_attr_s intr_attr; struct bfi_iocfc_bootwwns bootwwns; + struct bfi_pbc_s pbc_cfg; }; /** diff --git a/drivers/scsi/bfa/include/bfi/bfi_pbc.h b/drivers/scsi/bfa/include/bfi/bfi_pbc.h new file mode 100644 index 000000000000..88a4154c30c0 --- /dev/null +++ b/drivers/scsi/bfa/include/bfi/bfi_pbc.h @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2005-2010 Brocade Communications Systems, Inc. + * All rights reserved + * www.brocade.com + * + * Linux driver for Brocade Fibre Channel Host Bus Adapter. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License (GPL) Version 2 as + * published by the Free Software Foundation + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + */ + +#ifndef __BFI_PBC_H__ +#define __BFI_PBC_H__ + +#pragma pack(1) + +#define BFI_PBC_MAX_BLUNS 8 +#define BFI_PBC_MAX_VPORTS 16 + +#define BFI_PBC_PORT_DISABLED 2 +/** + * PBC boot lun configuration + */ +struct bfi_pbc_blun_s { + wwn_t tgt_pwwn; + lun_t tgt_lun; +}; + +/** + * PBC virtual port configuration + */ +struct bfi_pbc_vport_s { + wwn_t vp_pwwn; + wwn_t vp_nwwn; +}; + +/** + * BFI pre-boot configuration information + */ +struct bfi_pbc_s { + u8 port_enabled; + u8 boot_enabled; + u8 nbluns; + u8 nvports; + u8 port_speed; + u8 rsvd_a; + u16 hss; + wwn_t pbc_pwwn; + wwn_t pbc_nwwn; + struct bfi_pbc_blun_s blun[BFI_PBC_MAX_BLUNS]; + struct bfi_pbc_vport_s vport[BFI_PBC_MAX_VPORTS]; +}; + +#pragma pack() + +#endif /* __BFI_PBC_H__ */ diff --git a/drivers/scsi/bfa/include/defs/bfa_defs_adapter.h b/drivers/scsi/bfa/include/defs/bfa_defs_adapter.h index 8c208fc8e329..aea0360d67d5 100644 --- a/drivers/scsi/bfa/include/defs/bfa_defs_adapter.h +++ b/drivers/scsi/bfa/include/defs/bfa_defs_adapter.h @@ -39,7 +39,7 @@ enum { struct bfa_adapter_attr_s { char manufacturer[BFA_ADAPTER_MFG_NAME_LEN]; char serial_num[BFA_ADAPTER_SERIAL_NUM_LEN]; - u32 rsvd1; + u32 card_type; char model[BFA_ADAPTER_MODEL_NAME_LEN]; char model_descr[BFA_ADAPTER_MODEL_DESCR_LEN]; wwn_t pwwn; @@ -60,6 +60,7 @@ struct bfa_adapter_attr_s { u8 pcie_lanes_orig; u8 pcie_lanes; u8 cna_capable; + u8 is_mezz; }; /** diff --git a/drivers/scsi/bfa/include/defs/bfa_defs_boot.h b/drivers/scsi/bfa/include/defs/bfa_defs_boot.h index 6f4aa5283545..0fca10b6ad10 100644 --- a/drivers/scsi/bfa/include/defs/bfa_defs_boot.h +++ b/drivers/scsi/bfa/include/defs/bfa_defs_boot.h @@ -24,6 +24,8 @@ enum { BFA_BOOT_BOOTLUN_MAX = 4, /* maximum boot lun per IOC */ + BFA_PREBOOT_BOOTLUN_MAX = 8, /* maximum preboot lun per IOC */ + }; #define BOOT_CFG_REV1 1 @@ -67,5 +69,13 @@ struct bfa_boot_cfg_s { struct bfa_boot_bootlun_s blun_disc[BFA_BOOT_BOOTLUN_MAX]; }; +struct bfa_boot_pbc_s { + u8 enable; /* enable/disable SAN boot */ + u8 speed; /* boot speed settings */ + u8 topology; /* boot topology setting */ + u8 rsvd1; + u32 nbluns; /* number of boot luns */ + struct bfa_boot_bootlun_s pblun[BFA_PREBOOT_BOOTLUN_MAX]; +}; #endif /* __BFA_DEFS_BOOT_H__ */ diff --git a/drivers/scsi/bfa/include/defs/bfa_defs_mfg.h b/drivers/scsi/bfa/include/defs/bfa_defs_mfg.h index bfb50eb2124d..d22fb7909643 100644 --- a/drivers/scsi/bfa/include/defs/bfa_defs_mfg.h +++ b/drivers/scsi/bfa/include/defs/bfa_defs_mfg.h @@ -44,26 +44,6 @@ */ #define BFA_MFG_CHKSUM_SIZE 16 -/** - * Manufacturing block encrypted version - */ -#define BFA_MFG_ENC_VER 2 - -/** - * Manufacturing block version 1 length - */ -#define BFA_MFG_VER1_LEN 128 - -/** - * Manufacturing block header length - */ -#define BFA_MFG_HDR_LEN 4 - -/** - * Checksum size - */ -#define BFA_MFG_CHKSUM_SIZE 16 - /** * Manufacturing block format */ @@ -98,6 +78,24 @@ enum { */ #define bfa_mfg_type2port_num(card_type) (((card_type) / 10) % 10) +/** + * Check if Mezz card + */ +#define bfa_mfg_is_mezz(type) (( \ + (type) == BFA_MFG_TYPE_JAYHAWK || \ + (type) == BFA_MFG_TYPE_WANCHESE)) + +/** + * Check if card type valid + */ +#define bfa_mfg_is_card_type_valid(type) (( \ + (type) == BFA_MFG_TYPE_FC8P2 || \ + (type) == BFA_MFG_TYPE_FC8P1 || \ + (type) == BFA_MFG_TYPE_FC4P2 || \ + (type) == BFA_MFG_TYPE_FC4P1 || \ + (type) == BFA_MFG_TYPE_CNA10P2 || \ + (type) == BFA_MFG_TYPE_CNA10P1 || \ + bfa_mfg_is_mezz(type))) /** * All numerical fields are in big-endian format. diff --git a/drivers/scsi/bfa/include/defs/bfa_defs_pport.h b/drivers/scsi/bfa/include/defs/bfa_defs_pport.h index 26e5cc78095d..de6181cf9677 100644 --- a/drivers/scsi/bfa/include/defs/bfa_defs_pport.h +++ b/drivers/scsi/bfa/include/defs/bfa_defs_pport.h @@ -38,6 +38,7 @@ enum bfa_pport_states { BFA_PPORT_ST_IOCDOWN = 10, BFA_PPORT_ST_IOCDIS = 11, BFA_PPORT_ST_FWMISMATCH = 12, + BFA_PPORT_ST_PREBOOT_DISABLED = 13, BFA_PPORT_ST_MAX_STATE, }; @@ -203,6 +204,8 @@ struct bfa_pport_attr_s { */ wwn_t nwwn; /* node wwn */ wwn_t pwwn; /* port wwn */ + wwn_t factorynwwn; /* factory node wwn */ + wwn_t factorypwwn; /* factory port wwn */ enum fc_cos cos_supported; /* supported class of services */ u32 rsvd; struct fc_symname_s port_symname; /* port symbolic name */ -- cgit v1.2.3 From d9883548a0b0afec4786e6c5cd8d03d43a30b779 Mon Sep 17 00:00:00 2001 From: Jing Huang Date: Thu, 8 Jul 2010 19:46:26 -0700 Subject: [SCSI] bfa: PBC vport create This patch enables creating PBC vport. During fcs init, fcs will read PBC vport using bfa iocfc API and invoke fcb callback to add the pbc vport entries into a list. The pbc vport list will be traversed in the subsequent pci probe process and vport will be created using fc transport provided vport create function. Signed-off-by: Jing Huang Signed-off-by: James Bottomley --- drivers/scsi/bfa/include/defs/bfa_defs_port.h | 12 ++++++------ drivers/scsi/bfa/include/defs/bfa_defs_status.h | 5 ++++- drivers/scsi/bfa/include/fcb/bfa_fcb_vport.h | 3 ++- drivers/scsi/bfa/include/fcs/bfa_fcs.h | 4 ++-- drivers/scsi/bfa/include/fcs/bfa_fcs_vport.h | 4 ++++ 5 files changed, 18 insertions(+), 10 deletions(-) (limited to 'drivers/scsi/bfa/include') diff --git a/drivers/scsi/bfa/include/defs/bfa_defs_port.h b/drivers/scsi/bfa/include/defs/bfa_defs_port.h index 501bc9739d9d..752a81293d5a 100644 --- a/drivers/scsi/bfa/include/defs/bfa_defs_port.h +++ b/drivers/scsi/bfa/include/defs/bfa_defs_port.h @@ -50,12 +50,12 @@ enum bfa_port_role { * FCS port configuration. */ struct bfa_port_cfg_s { - wwn_t pwwn; /* port wwn */ - wwn_t nwwn; /* node wwn */ - struct bfa_port_symname_s sym_name; /* vm port symbolic name */ - enum bfa_port_role roles; /* FCS port roles */ - u32 rsvd; - u8 tag[16]; /* opaque tag from application */ + wwn_t pwwn; /* port wwn */ + wwn_t nwwn; /* node wwn */ + struct bfa_port_symname_s sym_name; /* vm port symbolic name */ + bfa_boolean_t preboot_vp; /* vport created from PBC */ + enum bfa_port_role roles; /* FCS port roles */ + u8 tag[16]; /* opaque tag from application */ }; /** diff --git a/drivers/scsi/bfa/include/defs/bfa_defs_status.h b/drivers/scsi/bfa/include/defs/bfa_defs_status.h index ec78b4cb121a..819db5abf461 100644 --- a/drivers/scsi/bfa/include/defs/bfa_defs_status.h +++ b/drivers/scsi/bfa/include/defs/bfa_defs_status.h @@ -213,7 +213,8 @@ enum bfa_status { * loaded */ BFA_STATUS_CARD_TYPE_MISMATCH = 131, /* Card type mismatch */ BFA_STATUS_BAD_ASICBLK = 132, /* Bad ASIC block */ - BFA_STATUS_NO_DRIVER = 133, /* Brocade adapter/driver not installed or loaded */ + BFA_STATUS_NO_DRIVER = 133, /* Brocade adapter/driver not installed + * or loaded */ BFA_STATUS_INVALID_MAC = 134, /* Invalid mac address */ BFA_STATUS_IM_NO_VLAN = 135, /* No VLANs configured on the adapter */ BFA_STATUS_IM_ETH_LB_FAILED = 136, /* Ethernet loopback test failed */ @@ -249,6 +250,8 @@ enum bfa_status { BFA_STATUS_IM_TEAM_CFG_NOT_ALLOWED = 153, /* Given settings are not * allowed for the current * Teaming mode */ + BFA_STATUS_PBC = 154, /* Operation not allowed for pre-boot + * configuration */ BFA_STATUS_MAX_VAL /* Unknown error code */ }; #define bfa_status_t enum bfa_status diff --git a/drivers/scsi/bfa/include/fcb/bfa_fcb_vport.h b/drivers/scsi/bfa/include/fcb/bfa_fcb_vport.h index a39f474c2fcf..cfd6ba7c47ec 100644 --- a/drivers/scsi/bfa/include/fcb/bfa_fcb_vport.h +++ b/drivers/scsi/bfa/include/fcb/bfa_fcb_vport.h @@ -40,7 +40,8 @@ struct bfad_vport_s; * * @return None */ -void bfa_fcb_vport_delete(struct bfad_vport_s *vport_drv); +void bfa_fcb_vport_delete(struct bfad_vport_s *vport_drv); +void bfa_fcb_pbc_vport_create(struct bfad_s *bfad, struct bfi_pbc_vport_s); diff --git a/drivers/scsi/bfa/include/fcs/bfa_fcs.h b/drivers/scsi/bfa/include/fcs/bfa_fcs.h index f2fd35fdee28..54e5b81ab2a3 100644 --- a/drivers/scsi/bfa/include/fcs/bfa_fcs.h +++ b/drivers/scsi/bfa/include/fcs/bfa_fcs.h @@ -61,8 +61,8 @@ struct bfa_fcs_s { /* * bfa fcs API functions */ -void bfa_fcs_attach(struct bfa_fcs_s *fcs, struct bfa_s *bfa, struct bfad_s *bfad, - bfa_boolean_t min_cfg); +void bfa_fcs_attach(struct bfa_fcs_s *fcs, struct bfa_s *bfa, + struct bfad_s *bfad, bfa_boolean_t min_cfg); void bfa_fcs_init(struct bfa_fcs_s *fcs); void bfa_fcs_driver_info_init(struct bfa_fcs_s *fcs, struct bfa_fcs_driver_info_s *driver_info); diff --git a/drivers/scsi/bfa/include/fcs/bfa_fcs_vport.h b/drivers/scsi/bfa/include/fcs/bfa_fcs_vport.h index cd33f2cd5c34..0af262430860 100644 --- a/drivers/scsi/bfa/include/fcs/bfa_fcs_vport.h +++ b/drivers/scsi/bfa/include/fcs/bfa_fcs_vport.h @@ -49,6 +49,10 @@ bfa_status_t bfa_fcs_vport_create(struct bfa_fcs_vport_s *vport, struct bfa_fcs_s *fcs, u16 vf_id, struct bfa_port_cfg_s *port_cfg, struct bfad_vport_s *vport_drv); +bfa_status_t bfa_fcs_pbc_vport_create(struct bfa_fcs_vport_s *vport, + struct bfa_fcs_s *fcs, uint16_t vf_id, + struct bfa_port_cfg_s *port_cfg, + struct bfad_vport_s *vport_drv); bfa_status_t bfa_fcs_vport_delete(struct bfa_fcs_vport_s *vport); bfa_status_t bfa_fcs_vport_start(struct bfa_fcs_vport_s *vport); bfa_status_t bfa_fcs_vport_stop(struct bfa_fcs_vport_s *vport); -- cgit v1.2.3 From 15b64a835def4c784c6e62ad762677f5cb56eba2 Mon Sep 17 00:00:00 2001 From: Jing Huang Date: Thu, 8 Jul 2010 19:48:12 -0700 Subject: [SCSI] bfa: ioc attributes fix This patch fixes the APIs to obtain ioc attributes - fix API to obtain wwpn, wwnn, and mac. - add API to get mfg wwpn, wwnn, and mac. - fix API to obtain wwn of boot target. Signed-off-by: Jing Huang Signed-off-by: James Bottomley --- drivers/scsi/bfa/include/bfi/bfi_ioc.h | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'drivers/scsi/bfa/include') diff --git a/drivers/scsi/bfa/include/bfi/bfi_ioc.h b/drivers/scsi/bfa/include/bfi/bfi_ioc.h index 03a9c9408ca5..7c5e6d5716df 100644 --- a/drivers/scsi/bfa/include/bfi/bfi_ioc.h +++ b/drivers/scsi/bfa/include/bfi/bfi_ioc.h @@ -48,9 +48,14 @@ struct bfi_ioc_getattr_req_s { }; struct bfi_ioc_attr_s { - wwn_t mfg_wwn; + wwn_t mfg_pwwn; /* Mfg port wwn */ + wwn_t mfg_nwwn; /* Mfg node wwn */ mac_t mfg_mac; - u16 rsvd_a; + u16 rsvd_a; + wwn_t pwwn; + wwn_t nwwn; + mac_t mac; /* PBC or Mfg mac */ + u16 rsvd_b; char brcd_serialnum[STRSZ(BFA_MFG_SERIALNUM_SIZE)]; u8 pcie_gen; u8 pcie_lanes_orig; @@ -58,12 +63,12 @@ struct bfi_ioc_attr_s { u8 rx_bbcredit; /* receive buffer credits */ u32 adapter_prop; /* adapter properties */ u16 maxfrsize; /* max receive frame size */ - char asic_rev; - u8 rsvd_b; - char fw_version[BFA_VERSION_LEN]; - char optrom_version[BFA_VERSION_LEN]; + char asic_rev; + u8 rsvd_c; + char fw_version[BFA_VERSION_LEN]; + char optrom_version[BFA_VERSION_LEN]; struct bfa_mfg_vpd_s vpd; - uint32_t card_type; /* card type */ + u32 card_type; /* card type */ }; /** -- cgit v1.2.3 From b85d045ee866011df535565bf12d684e8e5b7a9d Mon Sep 17 00:00:00 2001 From: Jing Huang Date: Thu, 8 Jul 2010 19:48:49 -0700 Subject: [SCSI] bfa: statistics and typo fix - Added time stamp for fcport stats reset - Added new fileds to the statistics data structures. - Typo removal and minor cleanup. Signed-off-by: Jing Huang Signed-off-by: James Bottomley --- drivers/scsi/bfa/include/bfa.h | 2 ++ drivers/scsi/bfa/include/cna/port/bfa_port.h | 1 + drivers/scsi/bfa/include/defs/bfa_defs_auth.h | 6 +++--- drivers/scsi/bfa/include/defs/bfa_defs_fcport.h | 26 ++++++++++--------------- drivers/scsi/bfa/include/defs/bfa_defs_iocfc.h | 12 ++++++++---- drivers/scsi/bfa/include/defs/bfa_defs_itnim.h | 10 ++++++++++ drivers/scsi/bfa/include/defs/bfa_defs_port.h | 2 +- drivers/scsi/bfa/include/defs/bfa_defs_pport.h | 4 ++-- drivers/scsi/bfa/include/defs/bfa_defs_status.h | 24 ++++++++++++----------- 9 files changed, 50 insertions(+), 37 deletions(-) (limited to 'drivers/scsi/bfa/include') diff --git a/drivers/scsi/bfa/include/bfa.h b/drivers/scsi/bfa/include/bfa.h index 1f5966cfbd16..9519a6d81045 100644 --- a/drivers/scsi/bfa/include/bfa.h +++ b/drivers/scsi/bfa/include/bfa.h @@ -126,6 +126,8 @@ struct bfa_sge_s { bfa_ioc_get_type(&(__bfa)->ioc) #define bfa_get_mac(__bfa) \ bfa_ioc_get_mac(&(__bfa)->ioc) +#define bfa_get_fw_clock_res(__bfa) \ + ((__bfa)->iocfc.cfgrsp->fwcfg.fw_tick_res) /* * bfa API functions diff --git a/drivers/scsi/bfa/include/cna/port/bfa_port.h b/drivers/scsi/bfa/include/cna/port/bfa_port.h index 7cbf17d3141b..d7babaf97848 100644 --- a/drivers/scsi/bfa/include/cna/port/bfa_port.h +++ b/drivers/scsi/bfa/include/cna/port/bfa_port.h @@ -37,6 +37,7 @@ struct bfa_port_s { bfa_port_stats_cbfn_t stats_cbfn; void *stats_cbarg; bfa_status_t stats_status; + u32 stats_reset_time; union bfa_pport_stats_u *stats; struct bfa_dma_s stats_dma; bfa_boolean_t endis_pending; diff --git a/drivers/scsi/bfa/include/defs/bfa_defs_auth.h b/drivers/scsi/bfa/include/defs/bfa_defs_auth.h index 45df32820911..f56ed871bb99 100644 --- a/drivers/scsi/bfa/include/defs/bfa_defs_auth.h +++ b/drivers/scsi/bfa/include/defs/bfa_defs_auth.h @@ -125,10 +125,10 @@ struct bfa_auth_attr_s { enum bfa_auth_status status; enum bfa_auth_algo algo; enum bfa_auth_group dh_grp; - u16 rjt_code; - u16 rjt_code_exp; + enum bfa_auth_rej_code rjt_code; + enum bfa_auth_rej_code_exp rjt_code_exp; u8 secret_set; - u8 resv[7]; + u8 resv[3]; }; #endif /* __BFA_DEFS_AUTH_H__ */ diff --git a/drivers/scsi/bfa/include/defs/bfa_defs_fcport.h b/drivers/scsi/bfa/include/defs/bfa_defs_fcport.h index a07ef4a3cd78..af86a6396439 100644 --- a/drivers/scsi/bfa/include/defs/bfa_defs_fcport.h +++ b/drivers/scsi/bfa/include/defs/bfa_defs_fcport.h @@ -48,7 +48,7 @@ struct bfa_fcoe_stats_s { u64 disc_fcf_unavail; /* Discovery FCF not avail */ u64 linksvc_unsupp; /* FIP link service req unsupp. */ u64 linksvc_err; /* FIP link service req errors */ - u64 logo_req; /* FIP logo */ + u64 logo_req; /* FIP logos received */ u64 clrvlink_req; /* Clear virtual link requests */ u64 op_unsupp; /* FIP operation unsupp. */ u64 untagged; /* FIP untagged frames */ @@ -64,21 +64,15 @@ struct bfa_fcoe_stats_s { u64 txf_timeout; /* Tx timeouts */ u64 txf_parity_errors; /* Transmit parity err */ u64 txf_fid_parity_errors; /* Transmit FID parity err */ - u64 tx_pause; /* Tx pause frames */ - u64 tx_zero_pause; /* Tx zero pause frames */ - u64 tx_first_pause; /* Tx first pause frames */ - u64 rx_pause; /* Rx pause frames */ - u64 rx_zero_pause; /* Rx zero pause frames */ - u64 rx_first_pause; /* Rx first pause frames */ - u64 rxf_ucast_octets; /* Rx unicast octets */ - u64 rxf_ucast; /* Rx unicast frames */ - u64 rxf_ucast_vlan; /* Rx unicast vlan frames */ - u64 rxf_mcast_octets; /* Rx multicast octets */ - u64 rxf_mcast; /* Rx multicast frames */ - u64 rxf_mcast_vlan; /* Rx multicast vlan frames */ - u64 rxf_bcast_octets; /* Rx broadcast octests */ - u64 rxf_bcast; /* Rx broadcast frames */ - u64 rxf_bcast_vlan; /* Rx broadcast vlan frames */ + u64 rxf_ucast_octets; /* Rx FCoE unicast octets */ + u64 rxf_ucast; /* Rx FCoE unicast frames */ + u64 rxf_ucast_vlan; /* Rx FCoE unicast vlan frames */ + u64 rxf_mcast_octets; /* Rx FCoE multicast octets */ + u64 rxf_mcast; /* Rx FCoE multicast frames */ + u64 rxf_mcast_vlan; /* Rx FCoE multicast vlan frames */ + u64 rxf_bcast_octets; /* Rx FCoE broadcast octets */ + u64 rxf_bcast; /* Rx FCoE broadcast frames */ + u64 rxf_bcast_vlan; /* Rx FCoE broadcast vlan frames */ }; /** diff --git a/drivers/scsi/bfa/include/defs/bfa_defs_iocfc.h b/drivers/scsi/bfa/include/defs/bfa_defs_iocfc.h index c290fb13d2d1..31e728a631ed 100644 --- a/drivers/scsi/bfa/include/defs/bfa_defs_iocfc.h +++ b/drivers/scsi/bfa/include/defs/bfa_defs_iocfc.h @@ -51,8 +51,10 @@ struct bfa_iocfc_fwcfg_s { u16 num_tsktm_reqs; /* TM task management requests*/ u16 num_fcxp_reqs; /* unassisted FC exchanges */ u16 num_uf_bufs; /* unsolicited recv buffers */ - u8 num_cqs; - u8 rsvd[5]; + u8 num_cqs; + u8 fw_tick_res; /*!< FW clock resolution in ms */ + u8 rsvd[4]; + }; struct bfa_iocfc_drvcfg_s { @@ -176,10 +178,10 @@ struct bfa_fw_port_fpg_stats_s { u32 nos_rx; u32 lip_rx; u32 arbf0_rx; + u32 arb_rx; u32 mrk_rx; u32 const_mrk_rx; u32 prim_unknown; - u32 rsvd; }; @@ -200,6 +202,8 @@ struct bfa_fw_port_lksm_stats_s { u32 lrr_tx; /* No. of times LRR tx started */ u32 ols_tx; /* No. of times OLS tx started */ u32 nos_tx; /* No. of times NOS tx started */ + u32 hwsm_lrr_rx; /* No. of times LRR rx-ed by HWSM */ + u32 hwsm_lr_rx; /* No. of times LR rx-ed by HWSM */ }; @@ -239,7 +243,7 @@ struct bfa_fw_fip_stats_s { u32 disc_fcf_unavail; /* Discovery FCF Not Avail. */ u32 linksvc_unsupp; /* Unsupported link service req */ u32 linksvc_err; /* Parse error in link service req */ - u32 logo_req; /* Number of FIP logos received */ + u32 logo_req; /* FIP logos received */ u32 clrvlink_req; /* Clear virtual link req */ u32 op_unsupp; /* Unsupported FIP operation */ u32 untagged; /* Untagged frames (ignored) */ diff --git a/drivers/scsi/bfa/include/defs/bfa_defs_itnim.h b/drivers/scsi/bfa/include/defs/bfa_defs_itnim.h index 2ec769903d24..d77788b3999a 100644 --- a/drivers/scsi/bfa/include/defs/bfa_defs_itnim.h +++ b/drivers/scsi/bfa/include/defs/bfa_defs_itnim.h @@ -34,6 +34,15 @@ enum bfa_itnim_state { BFA_ITNIM_INITIATIOR = 7, /* initiator */ }; +struct bfa_itnim_latency_s { + u32 min; + u32 max; + u32 count; + u32 clock_res; + u32 avg; + u32 rsvd; +}; + struct bfa_itnim_hal_stats_s { u32 onlines; /* ITN nexus onlines (PRLI done) */ u32 offlines; /* ITN Nexus offlines */ @@ -91,6 +100,7 @@ struct bfa_itnim_attr_s { u8 task_retry_id; /* task retry ident support */ u8 rec_support; /* REC supported */ u8 conf_comp; /* confirmed completion supp */ + struct bfa_itnim_latency_s io_latency; /* IO latency */ }; /** diff --git a/drivers/scsi/bfa/include/defs/bfa_defs_port.h b/drivers/scsi/bfa/include/defs/bfa_defs_port.h index 752a81293d5a..ebdf0d1731a4 100644 --- a/drivers/scsi/bfa/include/defs/bfa_defs_port.h +++ b/drivers/scsi/bfa/include/defs/bfa_defs_port.h @@ -159,7 +159,7 @@ struct bfa_port_stats_s { u32 ms_plogi_rsp_err; u32 ms_plogi_acc_err; u32 ms_plogi_accepts; - u32 ms_rejects; /* NS command rejects */ + u32 ms_rejects; /* MS command rejects */ u32 ms_plogi_unknown_rsp; u32 ms_plogi_alloc_wait; diff --git a/drivers/scsi/bfa/include/defs/bfa_defs_pport.h b/drivers/scsi/bfa/include/defs/bfa_defs_pport.h index de6181cf9677..2c2cec5ee278 100644 --- a/drivers/scsi/bfa/include/defs/bfa_defs_pport.h +++ b/drivers/scsi/bfa/include/defs/bfa_defs_pport.h @@ -246,7 +246,7 @@ struct bfa_pport_fc_stats_s { u64 secs_reset; /* Seconds since stats is reset */ u64 tx_frames; /* Tx frames */ u64 tx_words; /* Tx words */ - u64 tx_lip; /* TX LIP */ + u64 tx_lip; /* Tx LIP */ u64 tx_nos; /* Tx NOS */ u64 tx_ols; /* Tx OLS */ u64 tx_lr; /* Tx LR */ @@ -312,7 +312,7 @@ struct bfa_pport_eth_stats_s { u64 rx_zero_pause; /* Rx zero pause */ u64 tx_pause; /* Tx pause */ u64 tx_zero_pause; /* Tx zero pause */ - u64 rx_fcoe_pause; /* Rx fcoe pause */ + u64 rx_fcoe_pause; /* Rx FCoE pause */ u64 rx_fcoe_zero_pause; /* Rx FCoE zero pause */ u64 tx_fcoe_pause; /* Tx FCoE pause */ u64 tx_fcoe_zero_pause; /* Tx FCoE zero pause */ diff --git a/drivers/scsi/bfa/include/defs/bfa_defs_status.h b/drivers/scsi/bfa/include/defs/bfa_defs_status.h index 819db5abf461..7cef900707c5 100644 --- a/drivers/scsi/bfa/include/defs/bfa_defs_status.h +++ b/drivers/scsi/bfa/include/defs/bfa_defs_status.h @@ -84,8 +84,9 @@ enum bfa_status { BFA_STATUS_BADFRMHDR = 48, /* Bad frame header */ BFA_STATUS_BADFRMSZ = 49, /* Bad frame size check and replace * SFP/cable */ - BFA_STATUS_MISSINGFRM = 50, /* Missing frame check and replace - * SFP/cable */ + BFA_STATUS_MISSINGFRM = 50, /* Missing frame check and replace + * SFP/cable or for Mezz card check and + * replace pass through module */ BFA_STATUS_LINKTIMEOUT = 51, /* Link timeout check and replace * SFP/cable */ BFA_STATUS_NO_FCPIM_NEXUS = 52, /* No FCP Nexus exists with the @@ -173,7 +174,7 @@ enum bfa_status { BFA_STATUS_LEDTEST_OP = 109, /* LED test is operating */ BFA_STATUS_CEE_NOT_DN = 110, /* eth port is not at down state, please * bring down first */ - BFA_STATUS_10G_SPD = 111, /* Speed setting not valid for 10G HBA */ + BFA_STATUS_10G_SPD = 111, /* Speed setting not valid for 10G CNA */ BFA_STATUS_IM_INV_TEAM_NAME = 112, /* Invalid team name */ BFA_STATUS_IM_DUP_TEAM_NAME = 113, /* Given team name already * exists */ @@ -215,11 +216,11 @@ enum bfa_status { BFA_STATUS_BAD_ASICBLK = 132, /* Bad ASIC block */ BFA_STATUS_NO_DRIVER = 133, /* Brocade adapter/driver not installed * or loaded */ - BFA_STATUS_INVALID_MAC = 134, /* Invalid mac address */ + BFA_STATUS_INVALID_MAC = 134, /* Invalid MAC address */ BFA_STATUS_IM_NO_VLAN = 135, /* No VLANs configured on the adapter */ BFA_STATUS_IM_ETH_LB_FAILED = 136, /* Ethernet loopback test failed */ - BFA_STATUS_IM_PVID_REMOVE = 137, /* Cannot remove port vlan (PVID) */ - BFA_STATUS_IM_PVID_EDIT = 138, /* Cannot edit port vlan (PVID) */ + BFA_STATUS_IM_PVID_REMOVE = 137, /* Cannot remove port VLAN (PVID) */ + BFA_STATUS_IM_PVID_EDIT = 138, /* Cannot edit port VLAN (PVID) */ BFA_STATUS_CNA_NO_BOOT = 139, /* Boot upload not allowed for CNA */ BFA_STATUS_IM_PVID_NON_ZERO = 140, /* Port VLAN ID (PVID) is Set to * Non-Zero Value */ @@ -233,14 +234,15 @@ enum bfa_status { BFA_STATUS_INSUFFICIENT_PERMS = 144, /* User doesn't have sufficient * permissions to execute the BCU * application */ - BFA_STATUS_IM_INV_VLAN_NAME = 145, /* Invalid/Reserved Vlan name + BFA_STATUS_IM_INV_VLAN_NAME = 145, /* Invalid/Reserved VLAN name * string. The name is not allowed - * for the normal Vlans */ + * for the normal VLAN */ BFA_STATUS_CMD_NOTSUPP_CNA = 146, /* Command not supported for CNA */ - BFA_STATUS_IM_PASSTHRU_EDIT = 147, /* Can not edit passthru vlan id */ - BFA_STATUS_IM_BIND_FAILED = 148, /*! < IM Driver bind operation + BFA_STATUS_IM_PASSTHRU_EDIT = 147, /* Can not edit passthrough VLAN + * id */ + BFA_STATUS_IM_BIND_FAILED = 148, /* IM Driver bind operation * failed */ - BFA_STATUS_IM_UNBIND_FAILED = 149, /* ! < IM Driver unbind operation + BFA_STATUS_IM_UNBIND_FAILED = 149, /* IM Driver unbind operation * failed */ BFA_STATUS_IM_PORT_IN_TEAM = 150, /* Port is already part of the * team */ -- cgit v1.2.3 From 4f1806bc3c409395de4dab5984f7a235dc4a0eda Mon Sep 17 00:00:00 2001 From: Jing Huang Date: Thu, 8 Jul 2010 19:50:15 -0700 Subject: [SCSI] bfa: use standards defined timeout for ELS/CT Use standards defined 2 * RA_TOV as a timeout for ELS Request retries. And standards defined 3 * RA_TOV as a timeout for FC-CT Request retries. Also, added a check to send RPSC2 to a Brocade Fabric only. Signed-off-by: Jing Huang Signed-off-by: James Bottomley --- drivers/scsi/bfa/include/protocol/fc.h | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/scsi/bfa/include') diff --git a/drivers/scsi/bfa/include/protocol/fc.h b/drivers/scsi/bfa/include/protocol/fc.h index 8d1038035a76..436dd7c5643a 100644 --- a/drivers/scsi/bfa/include/protocol/fc.h +++ b/drivers/scsi/bfa/include/protocol/fc.h @@ -1080,6 +1080,7 @@ struct fc_alpabm_s{ #define FC_REC_TOV (FC_ED_TOV + 1) #define FC_RA_TOV 10 #define FC_ELS_TOV (2 * FC_RA_TOV) +#define FC_FCCT_TOV (3 * FC_RA_TOV) /* * virtual fabric related defines -- cgit v1.2.3 From 41188cf5a60a24bf54df5be70142f0928f413788 Mon Sep 17 00:00:00 2001 From: Jing Huang Date: Thu, 8 Jul 2010 19:52:00 -0700 Subject: [SCSI] bfa: fix prli retry issues Add a max retry limit for PRLI retries. Max retry limit (5) is same as used in rport PLOGI. Once the retries are exhausted, invoke rport offline so that existing logic of rport re-discovery can kick-in. Also fixed a bug in rport.c where one less retry was happening. Signed-off-by: Jing Huang Signed-off-by: James Bottomley --- drivers/scsi/bfa/include/fcs/bfa_fcs_fcpim.h | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/scsi/bfa/include') diff --git a/drivers/scsi/bfa/include/fcs/bfa_fcs_fcpim.h b/drivers/scsi/bfa/include/fcs/bfa_fcs_fcpim.h index e719f2c3eb35..9a35ecf5cdf0 100644 --- a/drivers/scsi/bfa/include/fcs/bfa_fcs_fcpim.h +++ b/drivers/scsi/bfa/include/fcs/bfa_fcs_fcpim.h @@ -41,6 +41,7 @@ struct bfa_fcs_itnim_s { struct bfa_fcs_s *fcs; /* fcs instance */ struct bfa_timer_s timer; /* timer functions */ struct bfa_itnim_s *bfa_itnim; /* BFA itnim struct */ + u32 prli_retries; /* max prli retry attempts */ bfa_boolean_t seq_rec; /* seq recovery support */ bfa_boolean_t rec_support; /* REC supported */ bfa_boolean_t conf_comp; /* FCP_CONF support */ -- cgit v1.2.3 From 9aeb6802ddc06b66fc1a58a882fa54bba37040b3 Mon Sep 17 00:00:00 2001 From: Jing Huang Date: Thu, 8 Jul 2010 19:53:40 -0700 Subject: [SCSI] bfa: update to support firmware configuation Update related data structures to support firmeare configuration. Add AEN events related to firmware configuation. Signed-off-by: Jing Huang Signed-off-by: James Bottomley --- drivers/scsi/bfa/include/aen/bfa_aen_ioc.h | 8 ++++++++ drivers/scsi/bfa/include/cs/bfa_debug.h | 3 ++- drivers/scsi/bfa/include/defs/bfa_defs_ioc.h | 7 ++++++- drivers/scsi/bfa/include/defs/bfa_defs_status.h | 3 +++ drivers/scsi/bfa/include/log/bfa_log_linux.h | 6 ++++-- 5 files changed, 23 insertions(+), 4 deletions(-) (limited to 'drivers/scsi/bfa/include') diff --git a/drivers/scsi/bfa/include/aen/bfa_aen_ioc.h b/drivers/scsi/bfa/include/aen/bfa_aen_ioc.h index 71378b446b69..4daf96faa266 100644 --- a/drivers/scsi/bfa/include/aen/bfa_aen_ioc.h +++ b/drivers/scsi/bfa/include/aen/bfa_aen_ioc.h @@ -32,6 +32,14 @@ BFA_LOG_CREATE_ID(BFA_AEN_CAT_IOC, BFA_IOC_AEN_DISABLE) #define BFA_AEN_IOC_FWMISMATCH \ BFA_LOG_CREATE_ID(BFA_AEN_CAT_IOC, BFA_IOC_AEN_FWMISMATCH) +#define BFA_AEN_IOC_FWCFG_ERROR \ + BFA_LOG_CREATE_ID(BFA_AEN_CAT_IOC, BFA_IOC_AEN_FWCFG_ERROR) +#define BFA_AEN_IOC_INVALID_VENDOR \ + BFA_LOG_CREATE_ID(BFA_AEN_CAT_IOC, BFA_IOC_AEN_INVALID_VENDOR) +#define BFA_AEN_IOC_INVALID_NWWN \ + BFA_LOG_CREATE_ID(BFA_AEN_CAT_IOC, BFA_IOC_AEN_INVALID_NWWN) +#define BFA_AEN_IOC_INVALID_PWWN \ + BFA_LOG_CREATE_ID(BFA_AEN_CAT_IOC, BFA_IOC_AEN_INVALID_PWWN) #endif diff --git a/drivers/scsi/bfa/include/cs/bfa_debug.h b/drivers/scsi/bfa/include/cs/bfa_debug.h index 441be86b1b0f..75a911ea7936 100644 --- a/drivers/scsi/bfa/include/cs/bfa_debug.h +++ b/drivers/scsi/bfa/include/cs/bfa_debug.h @@ -28,7 +28,8 @@ } while (0) #define bfa_sm_fault(__mod, __event) do { \ - bfa_sm_panic((__mod)->logm, __LINE__, __FILE__, __event); \ + bfa_trc(__mod, (((uint32_t)0xDEAD << 16) | __event)); \ + bfa_sm_panic((__mod)->logm, __LINE__, __FILE__, __event); \ } while (0) #ifndef BFA_PERF_BUILD diff --git a/drivers/scsi/bfa/include/defs/bfa_defs_ioc.h b/drivers/scsi/bfa/include/defs/bfa_defs_ioc.h index 8d8e6a966537..add0a05d941d 100644 --- a/drivers/scsi/bfa/include/defs/bfa_defs_ioc.h +++ b/drivers/scsi/bfa/include/defs/bfa_defs_ioc.h @@ -126,7 +126,7 @@ struct bfa_ioc_attr_s { struct bfa_ioc_driver_attr_s driver_attr; /* driver attr */ struct bfa_ioc_pci_attr_s pci_attr; u8 port_id; /* port number */ - u8 rsvd[7]; /*!< 64bit align */ + u8 rsvd[7]; /* 64bit align */ }; /** @@ -138,6 +138,11 @@ enum bfa_ioc_aen_event { BFA_IOC_AEN_ENABLE = 3, /* IOC enabled event */ BFA_IOC_AEN_DISABLE = 4, /* IOC disabled event */ BFA_IOC_AEN_FWMISMATCH = 5, /* IOC firmware mismatch */ + BFA_IOC_AEN_FWCFG_ERROR = 6, /* IOC firmware config error */ + BFA_IOC_AEN_INVALID_VENDOR = 7, + BFA_IOC_AEN_INVALID_NWWN = 8, /* Zero NWWN */ + BFA_IOC_AEN_INVALID_PWWN = 9 /* Zero PWWN */ + }; /** diff --git a/drivers/scsi/bfa/include/defs/bfa_defs_status.h b/drivers/scsi/bfa/include/defs/bfa_defs_status.h index 7cef900707c5..c8bc60ad2df6 100644 --- a/drivers/scsi/bfa/include/defs/bfa_defs_status.h +++ b/drivers/scsi/bfa/include/defs/bfa_defs_status.h @@ -254,6 +254,9 @@ enum bfa_status { * Teaming mode */ BFA_STATUS_PBC = 154, /* Operation not allowed for pre-boot * configuration */ + BFA_STATUS_DEVID_MISSING = 155, /* Boot image is not for the adapter(s) + * installed */ + BFA_STATUS_BAD_FWCFG = 156, /* Bad firmware configuration */ BFA_STATUS_MAX_VAL /* Unknown error code */ }; #define bfa_status_t enum bfa_status diff --git a/drivers/scsi/bfa/include/log/bfa_log_linux.h b/drivers/scsi/bfa/include/log/bfa_log_linux.h index bd451db4c30a..44bc89768bda 100644 --- a/drivers/scsi/bfa/include/log/bfa_log_linux.h +++ b/drivers/scsi/bfa/include/log/bfa_log_linux.h @@ -53,8 +53,10 @@ (((u32) BFA_LOG_LINUX_ID << BFA_LOG_MODID_OFFSET) | 16) #define BFA_LOG_LINUX_DRIVER_ERROR \ (((u32) BFA_LOG_LINUX_ID << BFA_LOG_MODID_OFFSET) | 17) -#define BFA_LOG_LINUX_DRIVER_DIAG \ +#define BFA_LOG_LINUX_DRIVER_INFO \ (((u32) BFA_LOG_LINUX_ID << BFA_LOG_MODID_OFFSET) | 18) -#define BFA_LOG_LINUX_DRIVER_AEN \ +#define BFA_LOG_LINUX_DRIVER_DIAG \ (((u32) BFA_LOG_LINUX_ID << BFA_LOG_MODID_OFFSET) | 19) +#define BFA_LOG_LINUX_DRIVER_AEN \ + (((u32) BFA_LOG_LINUX_ID << BFA_LOG_MODID_OFFSET) | 20) #endif -- cgit v1.2.3 From df2a52a6c8c4995e0bec0b739ddb2f51664837dd Mon Sep 17 00:00:00 2001 From: Jing Huang Date: Thu, 8 Jul 2010 19:54:39 -0700 Subject: [SCSI] bfa: fix chip and memory initialization Clear PSS memory reset that is set as part of power-on-reset (pci reset). Complete PMM memory reset before BISTR start. Clear EDRAM BISTR start bit after fixed delay. BISTR DONE bit status is not getting set. Use a fixed 1ms delay for BISTR now. Expose PMM IT memory definitions to host. Signed-off-by: Jing Huang Signed-off-by: James Bottomley --- drivers/scsi/bfa/include/bfi/bfi_ctreg.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'drivers/scsi/bfa/include') diff --git a/drivers/scsi/bfa/include/bfi/bfi_ctreg.h b/drivers/scsi/bfa/include/bfi/bfi_ctreg.h index 57a8497105af..c0ef5a93b797 100644 --- a/drivers/scsi/bfa/include/bfi/bfi_ctreg.h +++ b/drivers/scsi/bfa/include/bfi/bfi_ctreg.h @@ -455,6 +455,9 @@ enum { #define __PSS_LPU0_RAM_ERR 0x00000001 #define ERR_SET_REG 0x00018818 #define __PSS_ERR_STATUS_SET 0x003fffff +#define PMM_1T_RESET_REG_P0 0x0002381c +#define __PMM_1T_RESET_P 0x00000001 +#define PMM_1T_RESET_REG_P1 0x00023c1c #define HQM_QSET0_RXQ_DRBL_P0 0x00038000 #define __RXQ0_ADD_VECTORS_P 0x80000000 #define __RXQ0_STOP_P 0x40000000 -- cgit v1.2.3 From 4b5e759dca9fb26d921c1267283350004dbf197b Mon Sep 17 00:00:00 2001 From: Jing Huang Date: Thu, 8 Jul 2010 19:55:41 -0700 Subject: [SCSI] bfa: fix uf post and rport fcpim state machine BFA UF module did not hold lock when seding uf post buffer message to firmware causing CPE-Q corruption. Fix is to check present of FCS and if FCS present hold lock while posting UF buffers. Handle PRLO with sending acc to it and relogin with rport. Discard fcxp before any state change. Signed-off-by: Jing Huang Signed-off-by: James Bottomley --- drivers/scsi/bfa/include/fcs/bfa_fcs_rport.h | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/scsi/bfa/include') diff --git a/drivers/scsi/bfa/include/fcs/bfa_fcs_rport.h b/drivers/scsi/bfa/include/fcs/bfa_fcs_rport.h index 702b95b76c2d..3027fc6c7722 100644 --- a/drivers/scsi/bfa/include/fcs/bfa_fcs_rport.h +++ b/drivers/scsi/bfa/include/fcs/bfa_fcs_rport.h @@ -58,6 +58,7 @@ struct bfa_fcs_rport_s { u16 reply_oxid; /* OX_ID of inbound requests */ enum fc_cos fc_cos; /* FC classes of service supp */ bfa_boolean_t cisc; /* CISC capable device */ + bfa_boolean_t prlo; /* processing prlo or LOGO */ wwn_t pwwn; /* port wwn of rport */ wwn_t nwwn; /* node wwn of rport */ struct bfa_rport_symname_s psym_name; /* port symbolic name */ -- cgit v1.2.3 From 36d345a703b7b3f80a56ee37abb7908c52d1cd67 Mon Sep 17 00:00:00 2001 From: Jing Huang Date: Thu, 8 Jul 2010 19:57:33 -0700 Subject: [SCSI] bfa: add dynamic queue selection Add new bfa functionality to support dynamic queue selection (IO redirection). IO redirection can only be enabled when QoS is disabled. Signed-off-by: Jing Huang Signed-off-by: James Bottomley --- drivers/scsi/bfa/include/bfa_fcpim.h | 20 +++++++++++++++++++- drivers/scsi/bfa/include/bfa_svc.h | 1 + drivers/scsi/bfa/include/defs/bfa_defs_driver.h | 2 +- 3 files changed, 21 insertions(+), 2 deletions(-) (limited to 'drivers/scsi/bfa/include') diff --git a/drivers/scsi/bfa/include/bfa_fcpim.h b/drivers/scsi/bfa/include/bfa_fcpim.h index 04789795fa53..4bc9453081df 100644 --- a/drivers/scsi/bfa/include/bfa_fcpim.h +++ b/drivers/scsi/bfa/include/bfa_fcpim.h @@ -42,6 +42,24 @@ u16 bfa_fcpim_qdepth_get(struct bfa_s *bfa); bfa_status_t bfa_fcpim_get_modstats(struct bfa_s *bfa, struct bfa_fcpim_stats_s *modstats); bfa_status_t bfa_fcpim_clr_modstats(struct bfa_s *bfa); +void bfa_fcpim_set_ioredirect(struct bfa_s *bfa, bfa_boolean_t state); +void bfa_fcpim_update_ioredirect(struct bfa_s *bfa); +void bfa_cb_ioredirect_state_change(void *hcb_bfad, bfa_boolean_t ioredirect); + +#define bfa_fcpim_ioredirect_enabled(__bfa) \ + (((struct bfa_fcpim_mod_s *)(BFA_FCPIM_MOD(__bfa)))->ioredirect) + +#define bfa_fcpim_get_next_reqq(__bfa, __qid) \ +{ \ + struct bfa_fcpim_mod_s *__fcpim = BFA_FCPIM_MOD(__bfa); \ + __fcpim->reqq++; \ + __fcpim->reqq &= (BFI_IOC_MAX_CQS - 1); \ + *(__qid) = __fcpim->reqq; \ +} + +#define bfa_iocfc_map_msg_to_qid(__msg, __qid) \ + *(__qid) = (u8)((__msg) & (BFI_IOC_MAX_CQS - 1)); + /* * bfa itnim API functions @@ -56,6 +74,7 @@ void bfa_itnim_get_stats(struct bfa_itnim_s *itnim, struct bfa_itnim_hal_stats_s *stats); void bfa_itnim_clear_stats(struct bfa_itnim_s *itnim); +#define bfa_itnim_get_reqq(__ioim) (((struct bfa_ioim_s *)__ioim)->itnim->reqq) /** * BFA completion callback for bfa_itnim_online(). @@ -156,4 +175,3 @@ void bfa_cb_tskim_done(void *bfad, struct bfad_tskim_s *dtsk, enum bfi_tskim_status tsk_status); #endif /* __BFA_FCPIM_H__ */ - diff --git a/drivers/scsi/bfa/include/bfa_svc.h b/drivers/scsi/bfa/include/bfa_svc.h index 1349b99a3c6d..7840943d73b0 100644 --- a/drivers/scsi/bfa/include/bfa_svc.h +++ b/drivers/scsi/bfa/include/bfa_svc.h @@ -215,6 +215,7 @@ bfa_status_t bfa_fcport_get_stats(struct bfa_s *bfa, bfa_cb_pport_t cbfn, void *cbarg); bfa_status_t bfa_fcport_clear_stats(struct bfa_s *bfa, bfa_cb_pport_t cbfn, void *cbarg); +bfa_boolean_t bfa_fcport_is_qos_enabled(struct bfa_s *bfa); /* * bfa rport API functions diff --git a/drivers/scsi/bfa/include/defs/bfa_defs_driver.h b/drivers/scsi/bfa/include/defs/bfa_defs_driver.h index 50382dd2ab41..7d00d00d3969 100644 --- a/drivers/scsi/bfa/include/defs/bfa_defs_driver.h +++ b/drivers/scsi/bfa/include/defs/bfa_defs_driver.h @@ -29,7 +29,7 @@ struct bfa_driver_stats_s { u16 tm_target_reset; u16 tm_bus_reset; u16 ioc_restart; /* IOC restart count */ - u16 io_pending; /* outstanding io count per-IOC */ + u16 rsvd; u64 control_req; u64 input_req; u64 output_req; -- cgit v1.2.3 From db954c04cbebd7d719927118c7f58eddd8dd9913 Mon Sep 17 00:00:00 2001 From: Jing Huang Date: Thu, 8 Jul 2010 19:58:01 -0700 Subject: [SCSI] bfa: fix link state structure When the FCoE Linkup event is sent to the host, the link_state (struct bfa_pport_link_s) structure is copied to the RME buf to be sent to the host. But the size of this structure(164 bytes) is larger than the reserved RME buffer size(128 byes). The following changes reduce the size of the structure to be less than RME buffer size(128 bytes): - Remove the trunk and loop info from link_state structure, because both trunk and loop are not supported. - Combine qos_vc_attr and fcf into an union. Signed-off-by: Jing Huang Signed-off-by: James Bottomley --- drivers/scsi/bfa/include/defs/bfa_defs_pport.h | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) (limited to 'drivers/scsi/bfa/include') diff --git a/drivers/scsi/bfa/include/defs/bfa_defs_pport.h b/drivers/scsi/bfa/include/defs/bfa_defs_pport.h index 2c2cec5ee278..2de675839c2f 100644 --- a/drivers/scsi/bfa/include/defs/bfa_defs_pport.h +++ b/drivers/scsi/bfa/include/defs/bfa_defs_pport.h @@ -384,26 +384,10 @@ struct bfa_pport_link_s { u8 trunked; /* Trunked or not (1 or 0) */ u8 resvd[3]; struct bfa_qos_attr_s qos_attr; /* QoS Attributes */ - struct bfa_qos_vc_attr_s qos_vc_attr; /* VC info from ELP */ union { - struct { - u8 tmaster;/* Trunk Master or - * not (1 or 0) */ - u8 tlinks; /* Trunk links bitmap - * (linkup) */ - u8 resv1; /* Reserved */ - } trunk_info; - - struct { - u8 myalpa; /* alpa claimed */ - u8 login_req; /* Login required or - * not (1 or 0) */ - u8 alpabm_val;/* alpa bitmap valid - * or not (1 or 0) */ - struct fc_alpabm_s alpabm; /* alpa bitmap */ - } loop_info; - } tl; - struct bfa_fcport_fcf_s fcf; /*!< FCF information (for FCoE) */ + struct bfa_qos_vc_attr_s qos_vc_attr; /* VC info from ELP */ + struct bfa_fcport_fcf_s fcf; /* FCF information (for FCoE) */ + } vc_fcf; }; #endif /* __BFA_DEFS_PPORT_H__ */ -- cgit v1.2.3 From 07b2838669dc7704e02e079b1a96602656893d78 Mon Sep 17 00:00:00 2001 From: Jing Huang Date: Thu, 8 Jul 2010 19:59:24 -0700 Subject: [SCSI] bfa: update to support BOFM Update bfa driver API and data structure to support BOFM (IBM BladeCenter Open Fabric Manager). Signed-off-by: Jing Huang Signed-off-by: James Bottomley --- drivers/scsi/bfa/include/bfa.h | 2 ++ drivers/scsi/bfa/include/bfi/bfi_ioc.h | 2 +- drivers/scsi/bfa/include/defs/bfa_defs_status.h | 16 ++++++++++++++-- 3 files changed, 17 insertions(+), 3 deletions(-) (limited to 'drivers/scsi/bfa/include') diff --git a/drivers/scsi/bfa/include/bfa.h b/drivers/scsi/bfa/include/bfa.h index 9519a6d81045..d52b32f5695c 100644 --- a/drivers/scsi/bfa/include/bfa.h +++ b/drivers/scsi/bfa/include/bfa.h @@ -126,6 +126,8 @@ struct bfa_sge_s { bfa_ioc_get_type(&(__bfa)->ioc) #define bfa_get_mac(__bfa) \ bfa_ioc_get_mac(&(__bfa)->ioc) +#define bfa_get_mfg_mac(__bfa) \ + bfa_ioc_get_mfg_mac(&(__bfa)->ioc) #define bfa_get_fw_clock_res(__bfa) \ ((__bfa)->iocfc.cfgrsp->fwcfg.fw_tick_res) diff --git a/drivers/scsi/bfa/include/bfi/bfi_ioc.h b/drivers/scsi/bfa/include/bfi/bfi_ioc.h index 7c5e6d5716df..450ded6e9bc2 100644 --- a/drivers/scsi/bfa/include/bfi/bfi_ioc.h +++ b/drivers/scsi/bfa/include/bfi/bfi_ioc.h @@ -50,7 +50,7 @@ struct bfi_ioc_getattr_req_s { struct bfi_ioc_attr_s { wwn_t mfg_pwwn; /* Mfg port wwn */ wwn_t mfg_nwwn; /* Mfg node wwn */ - mac_t mfg_mac; + mac_t mfg_mac; /* Mfg mac */ u16 rsvd_a; wwn_t pwwn; wwn_t nwwn; diff --git a/drivers/scsi/bfa/include/defs/bfa_defs_status.h b/drivers/scsi/bfa/include/defs/bfa_defs_status.h index c8bc60ad2df6..6eb4e62096fc 100644 --- a/drivers/scsi/bfa/include/defs/bfa_defs_status.h +++ b/drivers/scsi/bfa/include/defs/bfa_defs_status.h @@ -256,8 +256,20 @@ enum bfa_status { * configuration */ BFA_STATUS_DEVID_MISSING = 155, /* Boot image is not for the adapter(s) * installed */ - BFA_STATUS_BAD_FWCFG = 156, /* Bad firmware configuration */ - BFA_STATUS_MAX_VAL /* Unknown error code */ + BFA_STATUS_BAD_FWCFG = 156, /* Bad firmware configuration */ + BFA_STATUS_CREATE_FILE = 157, /* Failed to create temporary file */ + BFA_STATUS_INVALID_VENDOR = 158, /* Invalid switch vendor */ + BFA_STATUS_SFP_NOT_READY = 159, /* SFP info is not ready. Retry */ + BFA_STATUS_NO_TOPOLOGY_FOR_CNA = 160, /* Topology command not + * applicable to CNA */ + BFA_STATUS_BOOT_CODE_UPDATED = 161, /* reboot -- -r is needed after + * boot code updated */ + BFA_STATUS_BOOT_VERSION = 162, /* Boot code version not compatible with + * the driver installed */ + BFA_STATUS_CARDTYPE_MISSING = 163, /* Boot image is not for the + * adapter(s) installed */ + BFA_STATUS_INVALID_CARDTYPE = 164, /* Invalid card type provided */ + BFA_STATUS_MAX_VAL /* Unknown error code */ }; #define bfa_status_t enum bfa_status -- cgit v1.2.3