From patchwork Tue Sep 27 20:39:09 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rasesh Mody X-Patchwork-Id: 116664 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id D13F8B6F7E for ; Wed, 28 Sep 2011 06:39:50 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753762Ab1I0Ujm (ORCPT ); Tue, 27 Sep 2011 16:39:42 -0400 Received: from mx0b-000f0801.pphosted.com ([67.231.152.113]:58069 "EHLO mx0b-000f0801.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753665Ab1I0Ujl (ORCPT ); Tue, 27 Sep 2011 16:39:41 -0400 Received: from pps.filterd (m0000700 [127.0.0.1]) by mx0b-000f0801.pphosted.com (8.14.4/8.14.4) with SMTP id p8RKdbcf023697; Tue, 27 Sep 2011 13:39:38 -0700 Received: from hq1-exedge.brocade.com (hq1-exedge.brocade.com [144.49.140.11]) by mx0b-000f0801.pphosted.com with ESMTP id 103kfrg2tp-7 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Tue, 27 Sep 2011 13:39:38 -0700 Received: from HQ1WP-EXHUB01.corp.brocade.com (10.70.36.14) by HQ1WP-EXEDGE01.corp.brocade.com (144.49.140.11) with Microsoft SMTP Server (TLS) id 8.3.192.1; Tue, 27 Sep 2011 13:46:27 -0700 Received: from blc-10-4.brocade.com (10.70.4.104) by hq1-hub-1.brocade.com (10.70.36.12) with Microsoft SMTP Server (TLS) id 8.3.192.1; Tue, 27 Sep 2011 13:39:35 -0700 Received: from blc-10-4.brocade.com (localhost.localdomain [127.0.0.1]) by blc-10-4.brocade.com (8.13.1/8.13.8) with ESMTP id p8RKdZ34017977; Tue, 27 Sep 2011 13:39:35 -0700 Received: (from rmody@localhost) by blc-10-4.brocade.com (8.13.1/8.13.8/Submit) id p8RKdZsN017975; Tue, 27 Sep 2011 13:39:35 -0700 From: Rasesh Mody To: , CC: , Rasesh Mody , Gurunatha Karaje Subject: [net-next 5/7] bna: PLL Init Fix and Add Stats Attributes Date: Tue, 27 Sep 2011 13:39:09 -0700 Message-ID: <1317155951-17242-6-git-send-email-rmody@brocade.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1317155951-17242-1-git-send-email-rmody@brocade.com> References: <1317155951-17242-1-git-send-email-rmody@brocade.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.4.6813, 1.0.211, 0.0.0000 definitions=2011-09-27_10:2011-09-27, 2011-09-27, 1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 suspectscore=0 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=6.0.2-1012030000 definitions=main-1109270232 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Change details: - Fix to release soft reset in PLL init for HW - Added stats attributes and new bfi msg class - Removed some unused code and typo fixes Signed-off-by: Gurunatha Karaje Signed-off-by: Rasesh Mody --- drivers/net/ethernet/brocade/bna/bfa_defs_cna.h | 8 +++++++- drivers/net/ethernet/brocade/bna/bfa_ioc.c | 18 ++++++------------ drivers/net/ethernet/brocade/bna/bfa_ioc.h | 12 ++---------- drivers/net/ethernet/brocade/bna/bfa_ioc_ct.c | 9 ++++++++- drivers/net/ethernet/brocade/bna/bfi.h | 19 ++++++++++--------- 5 files changed, 33 insertions(+), 33 deletions(-) diff --git a/drivers/net/ethernet/brocade/bna/bfa_defs_cna.h b/drivers/net/ethernet/brocade/bna/bfa_defs_cna.h index 7e0a918..8ab33ee 100644 --- a/drivers/net/ethernet/brocade/bna/bfa_defs_cna.h +++ b/drivers/net/ethernet/brocade/bna/bfa_defs_cna.h @@ -15,7 +15,6 @@ * All rights reserved * www.brocade.com */ - #ifndef __BFA_DEFS_CNA_H__ #define __BFA_DEFS_CNA_H__ @@ -55,6 +54,9 @@ struct bfa_port_fc_stats { u64 bad_os_count; /*!< Invalid ordered sets */ u64 err_enc_out; /*!< Encoding err nonframe_8b10b */ u64 err_enc; /*!< Encoding err frame_8b10b */ + u64 bbsc_frames_lost; /*!< Credit Recovery-Frames Lost */ + u64 bbsc_credits_lost; /*!< Credit Recovery-Credits Lost */ + u64 bbsc_link_resets; /*!< Credit Recovery-Link Resets */ }; /** @@ -100,6 +102,10 @@ struct bfa_port_eth_stats { 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 */ + u64 rx_iscsi_pause; /*!< Rx iSCSI pause */ + u64 rx_iscsi_zero_pause; /*!< Rx iSCSI zero pause */ + u64 tx_iscsi_pause; /*!< Tx iSCSI pause */ + u64 tx_iscsi_zero_pause; /*!< Tx iSCSI zero pause */ }; /** diff --git a/drivers/net/ethernet/brocade/bna/bfa_ioc.c b/drivers/net/ethernet/brocade/bna/bfa_ioc.c index f89ac7a..e02d607 100644 --- a/drivers/net/ethernet/brocade/bna/bfa_ioc.c +++ b/drivers/net/ethernet/brocade/bna/bfa_ioc.c @@ -17,8 +17,6 @@ */ #include "bfa_ioc.h" -#include "cna.h" -#include "bfi.h" #include "bfi_reg.h" #include "bfa_defs.h" @@ -140,10 +138,6 @@ static struct bfa_sm_table ioc_sm_table[] = { {BFA_SM(bfa_ioc_sm_hwfail), BFA_IOC_HWFAIL}, }; -/** - * IOCPF state machine definitions/declarations - */ - /* * Forward declareations for iocpf state machine */ @@ -427,7 +421,7 @@ bfa_ioc_sm_disabling_entry(struct bfa_ioc *ioc) } /** - * IOC is being desabled + * IOC is being disabled */ static void bfa_ioc_sm_disabling(struct bfa_ioc *ioc, enum ioc_event event) @@ -457,7 +451,7 @@ bfa_ioc_sm_disabling(struct bfa_ioc *ioc, enum ioc_event event) } /** - * IOC desable completion entry. + * IOC disable completion entry. */ static void bfa_ioc_sm_disabled_entry(struct bfa_ioc *ioc) @@ -782,7 +776,7 @@ static void bfa_iocpf_sm_hwinit_entry(struct bfa_iocpf *iocpf) { iocpf->poll_time = 0; - bfa_ioc_reset(iocpf->ioc, 0); + bfa_ioc_reset(iocpf->ioc, false); } /** @@ -1759,6 +1753,9 @@ bfa_ioc_fail_notify(struct bfa_ioc *ioc) bfa_ioc_event_notify(ioc, BFA_IOC_E_FAILED); } +/** + * IOCPF to IOC interface + */ static void bfa_ioc_pf_enabled(struct bfa_ioc *ioc) { @@ -2292,9 +2289,6 @@ bfa_ioc_get_adapter_model(struct bfa_ioc *ioc, char *model) ioc_attr = ioc->attr; - /** - * model name - */ snprintf(model, BFA_ADAPTER_MODEL_NAME_LEN, "%s-%u", BFA_MFG_NAME, ioc_attr->card_type); } diff --git a/drivers/net/ethernet/brocade/bna/bfa_ioc.h b/drivers/net/ethernet/brocade/bna/bfa_ioc.h index c398170..d5a21f4 100644 --- a/drivers/net/ethernet/brocade/bna/bfa_ioc.h +++ b/drivers/net/ethernet/brocade/bna/bfa_ioc.h @@ -152,16 +152,7 @@ struct bfa_ioc_notify { }; /** - * Heartbeat failure notification queue element. - */ -struct bfa_ioc_hbfail_notify { - struct list_head qe; - bfa_ioc_hbfail_cbfn_t cbfn; - void *cbarg; -}; - -/** - * Initialize a heartbeat failure notification structure + * Initialize a IOC event notification structure */ #define bfa_ioc_notify_init(__notify, __cbfn, __cbarg) do { \ (__notify)->cbfn = (__cbfn); \ @@ -290,6 +281,7 @@ void bfa_nw_ioc_mbox_regisr(struct bfa_ioc *ioc, enum bfi_mclass mc, void bfa_nw_ioc_set_ct_hwif(struct bfa_ioc *ioc); void bfa_nw_ioc_set_ct2_hwif(struct bfa_ioc *ioc); +void bfa_ioc_ct2_poweron(struct bfa_ioc *ioc); void bfa_nw_ioc_attach(struct bfa_ioc *ioc, void *bfa, struct bfa_ioc_cbfn *cbfn); diff --git a/drivers/net/ethernet/brocade/bna/bfa_ioc_ct.c b/drivers/net/ethernet/brocade/bna/bfa_ioc_ct.c index bc9e598..c2d3b1a 100644 --- a/drivers/net/ethernet/brocade/bna/bfa_ioc_ct.c +++ b/drivers/net/ethernet/brocade/bna/bfa_ioc_ct.c @@ -850,10 +850,17 @@ bfa_ioc_ct2_pll_init(void __iomem *rb, enum bfi_asic_mode asic_mode) * release soft reset on s_clk & l_clk */ r32 = readl((rb + CT2_APP_PLL_SCLK_CTL_REG)); - writel((r32 & ~__APP_PLL_LCLK_LOGIC_SOFT_RESET), + writel((r32 & ~__APP_PLL_SCLK_LOGIC_SOFT_RESET), (rb + CT2_APP_PLL_SCLK_CTL_REG)); /* + * release soft reset on s_clk & l_clk + */ + r32 = readl((rb + CT2_APP_PLL_LCLK_CTL_REG)); + writel(r32 & ~__APP_PLL_LCLK_LOGIC_SOFT_RESET, + (rb + CT2_APP_PLL_LCLK_CTL_REG)); + + /* * Announce flash device presence, if flash was corrupted. */ if (wgn == (__WGN_READY | __GLBL_PF_VF_CFG_RDY)) { diff --git a/drivers/net/ethernet/brocade/bna/bfi.h b/drivers/net/ethernet/brocade/bna/bfi.h index 54bcafe..7a1393a 100644 --- a/drivers/net/ethernet/brocade/bna/bfi.h +++ b/drivers/net/ethernet/brocade/bna/bfi.h @@ -135,18 +135,22 @@ enum bfi_mclass { BFI_MC_SFP = 22, /*!< SFP module */ BFI_MC_MSGQ = 23, /*!< MSGQ */ BFI_MC_ENET = 24, /*!< ENET commands/responses */ - BFI_MC_MAX = 32 + BFI_MC_PHY = 25, /*!< External PHY message class */ + BFI_MC_NBOOT = 26, /*!< Network Boot */ + BFI_MC_TIO_READ = 27, /*!< read IO (Target mode) */ + BFI_MC_TIO_WRITE = 28, /*!< write IO (Target mode) */ + BFI_MC_TIO_DATA_XFERED = 29, /*!< ds transferred (target mode) */ + BFI_MC_TIO_IO = 30, /*!< IO (Target mode) */ + BFI_MC_TIO = 31, /*!< IO (target mode) */ + BFI_MC_MFG = 32, /*!< MFG/ASIC block commands */ + BFI_MC_EDMA = 33, /*!< EDMA copy commands */ + BFI_MC_MAX = 34 }; -#define BFI_IOC_MAX_CQS 4 -#define BFI_IOC_MAX_CQS_ASIC 8 #define BFI_IOC_MSGLEN_MAX 32 /* 32 bytes */ #define BFI_FWBOOT_ENV_OS 0 -#define BFI_BOOT_MEMTEST_RES_ADDR 0x900 -#define BFI_BOOT_MEMTEST_RES_SIG 0xA0A1A2A3 - /** *---------------------------------------------------------------------- * IOC @@ -280,9 +284,6 @@ enum bfi_port_mode { BFI_PORT_MODE_ETH = 2, }; -/** - * BFI_IOC_I2H_READY_EVENT message - */ struct bfi_ioc_hbeat { struct bfi_mhdr mh; /*!< common msg header */ u32 hb_count; /*!< current heart beat count */