From: Krishna Gudipati <kgudipat@xxxxxxxxxxx> Change details: - This patch is part of the BFA cleanup. - bfa_cee.c, bfa_csdebug.c, bfa_iocfc_q.c code will be removed. - bfa_log.c and bfa_log_module.c will not be in use, will be using dev_printk. - bfa_module.c will be merged to bfa_drv.c in the subsequent patch. - bfa state machine and timer handling code will be merged to bfa_ioc.c. Signed-off-by: Krishna Gudipati <kgudipat@xxxxxxxxxxx> --- drivers/scsi/bfa/bfa_cee.c | 492 --------------------------------- drivers/scsi/bfa/bfa_csdebug.c | 58 ---- drivers/scsi/bfa/bfa_iocfc_q.c | 44 --- drivers/scsi/bfa/bfa_log.c | 346 ------------------------ drivers/scsi/bfa/bfa_log_module.c | 537 ------------------------------------- drivers/scsi/bfa/bfa_module.c | 90 ------ drivers/scsi/bfa/bfa_sm.c | 38 --- drivers/scsi/bfa/bfa_timer.c | 90 ------ 8 files changed, 0 insertions(+), 1695 deletions(-) delete mode 100644 drivers/scsi/bfa/bfa_cee.c delete mode 100644 drivers/scsi/bfa/bfa_csdebug.c delete mode 100644 drivers/scsi/bfa/bfa_iocfc_q.c delete mode 100644 drivers/scsi/bfa/bfa_log.c delete mode 100644 drivers/scsi/bfa/bfa_log_module.c delete mode 100644 drivers/scsi/bfa/bfa_module.c delete mode 100644 drivers/scsi/bfa/bfa_sm.c delete mode 100644 drivers/scsi/bfa/bfa_timer.c diff --git a/drivers/scsi/bfa/bfa_cee.c b/drivers/scsi/bfa/bfa_cee.c deleted file mode 100644 index 2b91779..0000000 --- a/drivers/scsi/bfa/bfa_cee.c +++ /dev/null @@ -1,492 +0,0 @@ -/* - * Copyright (c) 2005-2009 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. - */ - -#include <defs/bfa_defs_cee.h> -#include <cs/bfa_trc.h> -#include <cs/bfa_log.h> -#include <cs/bfa_debug.h> -#include <cee/bfa_cee.h> -#include <bfi/bfi_cee.h> -#include <bfi/bfi.h> -#include <bfa_ioc.h> -#include <cna/bfa_cna_trcmod.h> - -BFA_TRC_FILE(CNA, CEE); - -#define bfa_ioc_portid(__ioc) ((__ioc)->port_id) -#define bfa_lpuid(__arg) bfa_ioc_portid(&(__arg)->ioc) - -static void bfa_cee_format_lldp_cfg(struct bfa_cee_lldp_cfg_s *lldp_cfg); -static void bfa_cee_format_dcbcx_stats(struct bfa_cee_dcbx_stats_s - *dcbcx_stats); -static void bfa_cee_format_lldp_stats(struct bfa_cee_lldp_stats_s - *lldp_stats); -static void bfa_cee_format_cfg_stats(struct bfa_cee_cfg_stats_s *cfg_stats); -static void bfa_cee_format_cee_cfg(void *buffer); -static void bfa_cee_format_cee_stats(void *buffer); - -static void -bfa_cee_format_cee_stats(void *buffer) -{ - struct bfa_cee_stats_s *cee_stats = buffer; - bfa_cee_format_dcbcx_stats(&cee_stats->dcbx_stats); - bfa_cee_format_lldp_stats(&cee_stats->lldp_stats); - bfa_cee_format_cfg_stats(&cee_stats->cfg_stats); -} - -static void -bfa_cee_format_cee_cfg(void *buffer) -{ - struct bfa_cee_attr_s *cee_cfg = buffer; - bfa_cee_format_lldp_cfg(&cee_cfg->lldp_remote); -} - -static void -bfa_cee_format_dcbcx_stats(struct bfa_cee_dcbx_stats_s *dcbcx_stats) -{ - dcbcx_stats->subtlvs_unrecognized = - bfa_os_ntohl(dcbcx_stats->subtlvs_unrecognized); - dcbcx_stats->negotiation_failed = - bfa_os_ntohl(dcbcx_stats->negotiation_failed); - dcbcx_stats->remote_cfg_changed = - bfa_os_ntohl(dcbcx_stats->remote_cfg_changed); - dcbcx_stats->tlvs_received = bfa_os_ntohl(dcbcx_stats->tlvs_received); - dcbcx_stats->tlvs_invalid = bfa_os_ntohl(dcbcx_stats->tlvs_invalid); - dcbcx_stats->seqno = bfa_os_ntohl(dcbcx_stats->seqno); - dcbcx_stats->ackno = bfa_os_ntohl(dcbcx_stats->ackno); - dcbcx_stats->recvd_seqno = bfa_os_ntohl(dcbcx_stats->recvd_seqno); - dcbcx_stats->recvd_ackno = bfa_os_ntohl(dcbcx_stats->recvd_ackno); -} - -static void -bfa_cee_format_lldp_stats(struct bfa_cee_lldp_stats_s *lldp_stats) -{ - lldp_stats->frames_transmitted = - bfa_os_ntohl(lldp_stats->frames_transmitted); - lldp_stats->frames_aged_out = bfa_os_ntohl(lldp_stats->frames_aged_out); - lldp_stats->frames_discarded = - bfa_os_ntohl(lldp_stats->frames_discarded); - lldp_stats->frames_in_error = bfa_os_ntohl(lldp_stats->frames_in_error); - lldp_stats->frames_rcvd = bfa_os_ntohl(lldp_stats->frames_rcvd); - lldp_stats->tlvs_discarded = bfa_os_ntohl(lldp_stats->tlvs_discarded); - lldp_stats->tlvs_unrecognized = - bfa_os_ntohl(lldp_stats->tlvs_unrecognized); -} - -static void -bfa_cee_format_cfg_stats(struct bfa_cee_cfg_stats_s *cfg_stats) -{ - cfg_stats->cee_status_down = bfa_os_ntohl(cfg_stats->cee_status_down); - cfg_stats->cee_status_up = bfa_os_ntohl(cfg_stats->cee_status_up); - cfg_stats->cee_hw_cfg_changed = - bfa_os_ntohl(cfg_stats->cee_hw_cfg_changed); - cfg_stats->recvd_invalid_cfg = - bfa_os_ntohl(cfg_stats->recvd_invalid_cfg); -} - -static void -bfa_cee_format_lldp_cfg(struct bfa_cee_lldp_cfg_s *lldp_cfg) -{ - lldp_cfg->time_to_interval = bfa_os_ntohs(lldp_cfg->time_to_interval); - lldp_cfg->enabled_system_cap = - bfa_os_ntohs(lldp_cfg->enabled_system_cap); -} - -/** - * bfa_cee_attr_meminfo() - * - * - * @param[in] void - * - * @return Size of DMA region - */ -static u32 -bfa_cee_attr_meminfo(void) -{ - return BFA_ROUNDUP(sizeof(struct bfa_cee_attr_s), BFA_DMA_ALIGN_SZ); -} - -/** - * bfa_cee_stats_meminfo() - * - * - * @param[in] void - * - * @return Size of DMA region - */ -static u32 -bfa_cee_stats_meminfo(void) -{ - return BFA_ROUNDUP(sizeof(struct bfa_cee_stats_s), BFA_DMA_ALIGN_SZ); -} - -/** - * bfa_cee_get_attr_isr() - * - * - * @param[in] cee - Pointer to the CEE module - * status - Return status from the f/w - * - * @return void - */ -static void -bfa_cee_get_attr_isr(struct bfa_cee_s *cee, bfa_status_t status) -{ - cee->get_attr_status = status; - bfa_trc(cee, 0); - if (status == BFA_STATUS_OK) { - bfa_trc(cee, 0); - /* - * The requested data has been copied to the DMA area, *process - * it. - */ - memcpy(cee->attr, cee->attr_dma.kva, - sizeof(struct bfa_cee_attr_s)); - bfa_cee_format_cee_cfg(cee->attr); - } - cee->get_attr_pending = BFA_FALSE; - if (cee->cbfn.get_attr_cbfn) { - bfa_trc(cee, 0); - cee->cbfn.get_attr_cbfn(cee->cbfn.get_attr_cbarg, status); - } - bfa_trc(cee, 0); -} - -/** - * bfa_cee_get_attr_isr() - * - * - * @param[in] cee - Pointer to the CEE module - * status - Return status from the f/w - * - * @return void - */ -static void -bfa_cee_get_stats_isr(struct bfa_cee_s *cee, bfa_status_t status) -{ - cee->get_stats_status = status; - bfa_trc(cee, 0); - if (status == BFA_STATUS_OK) { - bfa_trc(cee, 0); - /* - * The requested data has been copied to the DMA area, process - * it. - */ - memcpy(cee->stats, cee->stats_dma.kva, - sizeof(struct bfa_cee_stats_s)); - bfa_cee_format_cee_stats(cee->stats); - } - cee->get_stats_pending = BFA_FALSE; - bfa_trc(cee, 0); - if (cee->cbfn.get_stats_cbfn) { - bfa_trc(cee, 0); - cee->cbfn.get_stats_cbfn(cee->cbfn.get_stats_cbarg, status); - } - bfa_trc(cee, 0); -} - -/** - * bfa_cee_get_attr_isr() - * - * - * @param[in] cee - Pointer to the CEE module - * status - Return status from the f/w - * - * @return void - */ -static void -bfa_cee_reset_stats_isr(struct bfa_cee_s *cee, bfa_status_t status) -{ - cee->reset_stats_status = status; - cee->reset_stats_pending = BFA_FALSE; - if (cee->cbfn.reset_stats_cbfn) - cee->cbfn.reset_stats_cbfn(cee->cbfn.reset_stats_cbarg, status); -} - -/** - * bfa_cee_meminfo() - * - * - * @param[in] void - * - * @return Size of DMA region - */ -u32 -bfa_cee_meminfo(void) -{ - return bfa_cee_attr_meminfo() + bfa_cee_stats_meminfo(); -} - -/** - * bfa_cee_mem_claim() - * - * - * @param[in] cee CEE module pointer - * dma_kva Kernel Virtual Address of CEE DMA Memory - * dma_pa Physical Address of CEE DMA Memory - * - * @return void - */ -void -bfa_cee_mem_claim(struct bfa_cee_s *cee, u8 *dma_kva, u64 dma_pa) -{ - cee->attr_dma.kva = dma_kva; - cee->attr_dma.pa = dma_pa; - cee->stats_dma.kva = dma_kva + bfa_cee_attr_meminfo(); - cee->stats_dma.pa = dma_pa + bfa_cee_attr_meminfo(); - cee->attr = (struct bfa_cee_attr_s *)dma_kva; - cee->stats = - (struct bfa_cee_stats_s *)(dma_kva + bfa_cee_attr_meminfo()); -} - -/** - * bfa_cee_get_attr() - * - * Send the request to the f/w to fetch CEE attributes. - * - * @param[in] Pointer to the CEE module data structure. - * - * @return Status - */ - -bfa_status_t -bfa_cee_get_attr(struct bfa_cee_s *cee, struct bfa_cee_attr_s *attr, - bfa_cee_get_attr_cbfn_t cbfn, void *cbarg) -{ - struct bfi_cee_get_req_s *cmd; - - bfa_assert((cee != NULL) && (cee->ioc != NULL)); - bfa_trc(cee, 0); - if (!bfa_ioc_is_operational(cee->ioc)) { - bfa_trc(cee, 0); - return BFA_STATUS_IOC_FAILURE; - } - if (cee->get_attr_pending == BFA_TRUE) { - bfa_trc(cee, 0); - return BFA_STATUS_DEVBUSY; - } - cee->get_attr_pending = BFA_TRUE; - cmd = (struct bfi_cee_get_req_s *)cee->get_cfg_mb.msg; - cee->attr = attr; - cee->cbfn.get_attr_cbfn = cbfn; - cee->cbfn.get_attr_cbarg = cbarg; - bfi_h2i_set(cmd->mh, BFI_MC_CEE, BFI_CEE_H2I_GET_CFG_REQ, - bfa_ioc_portid(cee->ioc)); - bfa_dma_be_addr_set(cmd->dma_addr, cee->attr_dma.pa); - bfa_ioc_mbox_queue(cee->ioc, &cee->get_cfg_mb); - bfa_trc(cee, 0); - - return BFA_STATUS_OK; -} - -/** - * bfa_cee_get_stats() - * - * Send the request to the f/w to fetch CEE statistics. - * - * @param[in] Pointer to the CEE module data structure. - * - * @return Status - */ - -bfa_status_t -bfa_cee_get_stats(struct bfa_cee_s *cee, struct bfa_cee_stats_s *stats, - bfa_cee_get_stats_cbfn_t cbfn, void *cbarg) -{ - struct bfi_cee_get_req_s *cmd; - - bfa_assert((cee != NULL) && (cee->ioc != NULL)); - - if (!bfa_ioc_is_operational(cee->ioc)) { - bfa_trc(cee, 0); - return BFA_STATUS_IOC_FAILURE; - } - if (cee->get_stats_pending == BFA_TRUE) { - bfa_trc(cee, 0); - return BFA_STATUS_DEVBUSY; - } - cee->get_stats_pending = BFA_TRUE; - cmd = (struct bfi_cee_get_req_s *)cee->get_stats_mb.msg; - cee->stats = stats; - cee->cbfn.get_stats_cbfn = cbfn; - cee->cbfn.get_stats_cbarg = cbarg; - bfi_h2i_set(cmd->mh, BFI_MC_CEE, BFI_CEE_H2I_GET_STATS_REQ, - bfa_ioc_portid(cee->ioc)); - bfa_dma_be_addr_set(cmd->dma_addr, cee->stats_dma.pa); - bfa_ioc_mbox_queue(cee->ioc, &cee->get_stats_mb); - bfa_trc(cee, 0); - - return BFA_STATUS_OK; -} - -/** - * bfa_cee_reset_stats() - * - * - * @param[in] Pointer to the CEE module data structure. - * - * @return Status - */ - -bfa_status_t -bfa_cee_reset_stats(struct bfa_cee_s *cee, bfa_cee_reset_stats_cbfn_t cbfn, - void *cbarg) -{ - struct bfi_cee_reset_stats_s *cmd; - - bfa_assert((cee != NULL) && (cee->ioc != NULL)); - if (!bfa_ioc_is_operational(cee->ioc)) { - bfa_trc(cee, 0); - return BFA_STATUS_IOC_FAILURE; - } - if (cee->reset_stats_pending == BFA_TRUE) { - bfa_trc(cee, 0); - return BFA_STATUS_DEVBUSY; - } - cee->reset_stats_pending = BFA_TRUE; - cmd = (struct bfi_cee_reset_stats_s *)cee->reset_stats_mb.msg; - cee->cbfn.reset_stats_cbfn = cbfn; - cee->cbfn.reset_stats_cbarg = cbarg; - bfi_h2i_set(cmd->mh, BFI_MC_CEE, BFI_CEE_H2I_RESET_STATS, - bfa_ioc_portid(cee->ioc)); - bfa_ioc_mbox_queue(cee->ioc, &cee->reset_stats_mb); - bfa_trc(cee, 0); - return BFA_STATUS_OK; -} - -/** - * bfa_cee_isrs() - * - * - * @param[in] Pointer to the CEE module data structure. - * - * @return void - */ - -void -bfa_cee_isr(void *cbarg, struct bfi_mbmsg_s *m) -{ - union bfi_cee_i2h_msg_u *msg; - struct bfi_cee_get_rsp_s *get_rsp; - struct bfa_cee_s *cee = (struct bfa_cee_s *)cbarg; - msg = (union bfi_cee_i2h_msg_u *)m; - get_rsp = (struct bfi_cee_get_rsp_s *)m; - bfa_trc(cee, msg->mh.msg_id); - switch (msg->mh.msg_id) { - case BFI_CEE_I2H_GET_CFG_RSP: - bfa_trc(cee, get_rsp->cmd_status); - bfa_cee_get_attr_isr(cee, get_rsp->cmd_status); - break; - case BFI_CEE_I2H_GET_STATS_RSP: - bfa_cee_get_stats_isr(cee, get_rsp->cmd_status); - break; - case BFI_CEE_I2H_RESET_STATS_RSP: - bfa_cee_reset_stats_isr(cee, get_rsp->cmd_status); - break; - default: - bfa_assert(0); - } -} - -/** - * bfa_cee_hbfail() - * - * - * @param[in] Pointer to the CEE module data structure. - * - * @return void - */ - -void -bfa_cee_hbfail(void *arg) -{ - struct bfa_cee_s *cee; - cee = (struct bfa_cee_s *)arg; - - if (cee->get_attr_pending == BFA_TRUE) { - cee->get_attr_status = BFA_STATUS_FAILED; - cee->get_attr_pending = BFA_FALSE; - if (cee->cbfn.get_attr_cbfn) { - cee->cbfn.get_attr_cbfn(cee->cbfn.get_attr_cbarg, - BFA_STATUS_FAILED); - } - } - if (cee->get_stats_pending == BFA_TRUE) { - cee->get_stats_status = BFA_STATUS_FAILED; - cee->get_stats_pending = BFA_FALSE; - if (cee->cbfn.get_stats_cbfn) { - cee->cbfn.get_stats_cbfn(cee->cbfn.get_stats_cbarg, - BFA_STATUS_FAILED); - } - } - if (cee->reset_stats_pending == BFA_TRUE) { - cee->reset_stats_status = BFA_STATUS_FAILED; - cee->reset_stats_pending = BFA_FALSE; - if (cee->cbfn.reset_stats_cbfn) { - cee->cbfn.reset_stats_cbfn(cee->cbfn.reset_stats_cbarg, - BFA_STATUS_FAILED); - } - } -} - -/** - * bfa_cee_attach() - * - * - * @param[in] cee - Pointer to the CEE module data structure - * ioc - Pointer to the ioc module data structure - * dev - Pointer to the device driver module data structure - * The device driver specific mbox ISR functions have - * this pointer as one of the parameters. - * trcmod - - * logmod - - * - * @return void - */ -void -bfa_cee_attach(struct bfa_cee_s *cee, struct bfa_ioc_s *ioc, void *dev, - struct bfa_trc_mod_s *trcmod, struct bfa_log_mod_s *logmod) -{ - bfa_assert(cee != NULL); - cee->dev = dev; - cee->trcmod = trcmod; - cee->logmod = logmod; - cee->ioc = ioc; - - bfa_ioc_mbox_regisr(cee->ioc, BFI_MC_CEE, bfa_cee_isr, cee); - bfa_ioc_hbfail_init(&cee->hbfail, bfa_cee_hbfail, cee); - bfa_ioc_hbfail_register(cee->ioc, &cee->hbfail); - bfa_trc(cee, 0); -} - -/** - * bfa_cee_detach() - * - * - * @param[in] cee - Pointer to the CEE module data structure - * - * @return void - */ -void -bfa_cee_detach(struct bfa_cee_s *cee) -{ - /* - * For now, just check if there is some ioctl pending and mark that as - * failed? - */ - /* bfa_cee_hbfail(cee); */ -} diff --git a/drivers/scsi/bfa/bfa_csdebug.c b/drivers/scsi/bfa/bfa_csdebug.c deleted file mode 100644 index caeb114..0000000 --- a/drivers/scsi/bfa/bfa_csdebug.c +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2005-2009 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. - */ - -#include <cs/bfa_debug.h> -#include <bfa_os_inc.h> -#include <cs/bfa_q.h> -#include <log/bfa_log_hal.h> - -/** - * cs_debug_api - */ - - -void -bfa_panic(int line, char *file, char *panicstr) -{ - bfa_log(NULL, BFA_LOG_HAL_ASSERT, file, line, panicstr); - bfa_os_panic(); -} - -void -bfa_sm_panic(struct bfa_log_mod_s *logm, int line, char *file, int event) -{ - bfa_log(logm, BFA_LOG_HAL_SM_ASSERT, file, line, event); - bfa_os_panic(); -} - -int -bfa_q_is_on_q_func(struct list_head *q, struct list_head *qe) -{ - struct list_head *tqe; - - tqe = bfa_q_next(q); - while (tqe != q) { - if (tqe == qe) - return 1; - tqe = bfa_q_next(tqe); - if (tqe == NULL) - break; - } - return 0; -} - - diff --git a/drivers/scsi/bfa/bfa_iocfc_q.c b/drivers/scsi/bfa/bfa_iocfc_q.c deleted file mode 100644 index 500a17d..0000000 --- a/drivers/scsi/bfa/bfa_iocfc_q.c +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2005-2009 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. - */ - -#include <bfa.h> -#include "bfa_intr_priv.h" - -BFA_TRC_FILE(HAL, IOCFC_Q); - -void -bfa_iocfc_updateq(struct bfa_s *bfa, u32 reqq_ba, u32 rspq_ba, - u32 reqq_sci, u32 rspq_spi, bfa_cb_iocfc_t cbfn, - void *cbarg) -{ - struct bfa_iocfc_s *iocfc = &bfa->iocfc; - struct bfi_iocfc_updateq_req_s updateq_req; - - iocfc->updateq_cbfn = cbfn; - iocfc->updateq_cbarg = cbarg; - - bfi_h2i_set(updateq_req.mh, BFI_MC_IOCFC, BFI_IOCFC_H2I_UPDATEQ_REQ, - bfa_lpuid(bfa)); - - updateq_req.reqq_ba = bfa_os_htonl(reqq_ba); - updateq_req.rspq_ba = bfa_os_htonl(rspq_ba); - updateq_req.reqq_sci = bfa_os_htonl(reqq_sci); - updateq_req.rspq_spi = bfa_os_htonl(rspq_spi); - - bfa_ioc_mbox_send(&bfa->ioc, &updateq_req, - sizeof(struct bfi_iocfc_updateq_req_s)); -} diff --git a/drivers/scsi/bfa/bfa_log.c b/drivers/scsi/bfa/bfa_log.c deleted file mode 100644 index e751401..0000000 --- a/drivers/scsi/bfa/bfa_log.c +++ /dev/null @@ -1,346 +0,0 @@ -/* - * Copyright (c) 2005-2009 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. - */ - -/** - * bfa_log.c BFA log library - */ - -#include <bfa_os_inc.h> -#include <cs/bfa_log.h> - -/* - * global log info structure - */ -struct bfa_log_info_s { - u32 start_idx; /* start index for a module */ - u32 total_count; /* total count for a module */ - enum bfa_log_severity level; /* global log level */ - bfa_log_cb_t cbfn; /* callback function */ -}; - -static struct bfa_log_info_s bfa_log_info[BFA_LOG_MODULE_ID_MAX + 1]; -static u32 bfa_log_msg_total_count; -static int bfa_log_initialized; - -static char *bfa_log_severity[] = - { "[none]", "[critical]", "[error]", "[warn]", "[info]", "" }; - -/** - * BFA log library initialization - * - * The log library initialization includes the following, - * - set log instance name and callback function - * - read the message array generated from xml files - * - calculate start index for each module - * - calculate message count for each module - * - perform error checking - * - * @param[in] log_mod - log module info - * @param[in] instance_name - instance name - * @param[in] cbfn - callback function - * - * It return 0 on success, or -1 on failure - */ -int -bfa_log_init(struct bfa_log_mod_s *log_mod, char *instance_name, - bfa_log_cb_t cbfn) -{ - struct bfa_log_msgdef_s *msg; - u32 pre_mod_id = 0; - u32 cur_mod_id = 0; - u32 i, pre_idx, idx, msg_id; - - /* - * set instance name - */ - if (log_mod) { - strncpy(log_mod->instance_info, instance_name, - sizeof(log_mod->instance_info)); - log_mod->cbfn = cbfn; - for (i = 0; i <= BFA_LOG_MODULE_ID_MAX; i++) - log_mod->log_level[i] = BFA_LOG_WARNING; - } - - if (bfa_log_initialized) - return 0; - - for (i = 0; i <= BFA_LOG_MODULE_ID_MAX; i++) { - bfa_log_info[i].start_idx = 0; - bfa_log_info[i].total_count = 0; - bfa_log_info[i].level = BFA_LOG_WARNING; - bfa_log_info[i].cbfn = cbfn; - } - - pre_idx = 0; - idx = 0; - msg = bfa_log_msg_array; - msg_id = BFA_LOG_GET_MSG_ID(msg); - pre_mod_id = BFA_LOG_GET_MOD_ID(msg_id); - while (msg_id != 0) { - cur_mod_id = BFA_LOG_GET_MOD_ID(msg_id); - - if (cur_mod_id > BFA_LOG_MODULE_ID_MAX) { - cbfn(log_mod, msg_id, - "%s%s log: module id %u out of range\n", - BFA_LOG_CAT_NAME, - bfa_log_severity[BFA_LOG_ERROR], - cur_mod_id); - return -1; - } - - if (pre_mod_id > BFA_LOG_MODULE_ID_MAX) { - cbfn(log_mod, msg_id, - "%s%s log: module id %u out of range\n", - BFA_LOG_CAT_NAME, - bfa_log_severity[BFA_LOG_ERROR], - pre_mod_id); - return -1; - } - - if (cur_mod_id != pre_mod_id) { - bfa_log_info[pre_mod_id].start_idx = pre_idx; - bfa_log_info[pre_mod_id].total_count = idx - pre_idx; - pre_mod_id = cur_mod_id; - pre_idx = idx; - } - - idx++; - msg++; - msg_id = BFA_LOG_GET_MSG_ID(msg); - } - - bfa_log_info[cur_mod_id].start_idx = pre_idx; - bfa_log_info[cur_mod_id].total_count = idx - pre_idx; - bfa_log_msg_total_count = idx; - - cbfn(log_mod, msg_id, "%s%s log: init OK, msg total count %u\n", - BFA_LOG_CAT_NAME, - bfa_log_severity[BFA_LOG_INFO], bfa_log_msg_total_count); - - bfa_log_initialized = 1; - - return 0; -} - -/** - * BFA log set log level for a module - * - * @param[in] log_mod - log module info - * @param[in] mod_id - module id - * @param[in] log_level - log severity level - * - * It return BFA_STATUS_OK on success, or > 0 on failure - */ -bfa_status_t -bfa_log_set_level(struct bfa_log_mod_s *log_mod, int mod_id, - enum bfa_log_severity log_level) -{ - if (mod_id <= BFA_LOG_UNUSED_ID || mod_id > BFA_LOG_MODULE_ID_MAX) - return BFA_STATUS_EINVAL; - - if (log_level <= BFA_LOG_INVALID || log_level > BFA_LOG_LEVEL_MAX) - return BFA_STATUS_EINVAL; - - if (log_mod) - log_mod->log_level[mod_id] = log_level; - else - bfa_log_info[mod_id].level = log_level; - - return BFA_STATUS_OK; -} - -/** - * BFA log set log level for all modules - * - * @param[in] log_mod - log module info - * @param[in] log_level - log severity level - * - * It return BFA_STATUS_OK on success, or > 0 on failure - */ -bfa_status_t -bfa_log_set_level_all(struct bfa_log_mod_s *log_mod, - enum bfa_log_severity log_level) -{ - int mod_id = BFA_LOG_UNUSED_ID + 1; - - if (log_level <= BFA_LOG_INVALID || log_level > BFA_LOG_LEVEL_MAX) - return BFA_STATUS_EINVAL; - - if (log_mod) { - for (; mod_id <= BFA_LOG_MODULE_ID_MAX; mod_id++) - log_mod->log_level[mod_id] = log_level; - } else { - for (; mod_id <= BFA_LOG_MODULE_ID_MAX; mod_id++) - bfa_log_info[mod_id].level = log_level; - } - - return BFA_STATUS_OK; -} - -/** - * BFA log set log level for all aen sub-modules - * - * @param[in] log_mod - log module info - * @param[in] log_level - log severity level - * - * It return BFA_STATUS_OK on success, or > 0 on failure - */ -bfa_status_t -bfa_log_set_level_aen(struct bfa_log_mod_s *log_mod, - enum bfa_log_severity log_level) -{ - int mod_id = BFA_LOG_AEN_MIN + 1; - - if (log_mod) { - for (; mod_id <= BFA_LOG_AEN_MAX; mod_id++) - log_mod->log_level[mod_id] = log_level; - } else { - for (; mod_id <= BFA_LOG_AEN_MAX; mod_id++) - bfa_log_info[mod_id].level = log_level; - } - - return BFA_STATUS_OK; -} - -/** - * BFA log get log level for a module - * - * @param[in] log_mod - log module info - * @param[in] mod_id - module id - * - * It returns log level or -1 on error - */ -enum bfa_log_severity -bfa_log_get_level(struct bfa_log_mod_s *log_mod, int mod_id) -{ - if (mod_id <= BFA_LOG_UNUSED_ID || mod_id > BFA_LOG_MODULE_ID_MAX) - return BFA_LOG_INVALID; - - if (log_mod) - return log_mod->log_level[mod_id]; - else - return bfa_log_info[mod_id].level; -} - -enum bfa_log_severity -bfa_log_get_msg_level(struct bfa_log_mod_s *log_mod, u32 msg_id) -{ - struct bfa_log_msgdef_s *msg; - u32 mod = BFA_LOG_GET_MOD_ID(msg_id); - u32 idx = BFA_LOG_GET_MSG_IDX(msg_id) - 1; - - if (!bfa_log_initialized) - return BFA_LOG_INVALID; - - if (mod > BFA_LOG_MODULE_ID_MAX) - return BFA_LOG_INVALID; - - if (idx >= bfa_log_info[mod].total_count) { - bfa_log_info[mod].cbfn(log_mod, msg_id, - "%s%s log: inconsistent idx %u vs. total count %u\n", - BFA_LOG_CAT_NAME, bfa_log_severity[BFA_LOG_ERROR], idx, - bfa_log_info[mod].total_count); - return BFA_LOG_INVALID; - } - - msg = bfa_log_msg_array + bfa_log_info[mod].start_idx + idx; - if (msg_id != BFA_LOG_GET_MSG_ID(msg)) { - bfa_log_info[mod].cbfn(log_mod, msg_id, - "%s%s log: inconsistent msg id %u array msg id %u\n", - BFA_LOG_CAT_NAME, bfa_log_severity[BFA_LOG_ERROR], - msg_id, BFA_LOG_GET_MSG_ID(msg)); - return BFA_LOG_INVALID; - } - - return BFA_LOG_GET_SEVERITY(msg); -} - -/** - * BFA log message handling - * - * BFA log message handling finds the message based on message id and prints - * out the message based on its format and arguments. It also does prefix - * the severity etc. - * - * @param[in] log_mod - log module info - * @param[in] msg_id - message id - * @param[in] ... - message arguments - * - * It return 0 on success, or -1 on errors - */ -int -bfa_log(struct bfa_log_mod_s *log_mod, u32 msg_id, ...) -{ - va_list ap; - char buf[256]; - struct bfa_log_msgdef_s *msg; - int log_level; - u32 mod = BFA_LOG_GET_MOD_ID(msg_id); - u32 idx = BFA_LOG_GET_MSG_IDX(msg_id) - 1; - - if (!bfa_log_initialized) - return -1; - - if (mod > BFA_LOG_MODULE_ID_MAX) - return -1; - - if (idx >= bfa_log_info[mod].total_count) { - bfa_log_info[mod]. - cbfn - (log_mod, msg_id, - "%s%s log: inconsistent idx %u vs. total count %u\n", - BFA_LOG_CAT_NAME, bfa_log_severity[BFA_LOG_ERROR], idx, - bfa_log_info[mod].total_count); - return -1; - } - - msg = bfa_log_msg_array + bfa_log_info[mod].start_idx + idx; - if (msg_id != BFA_LOG_GET_MSG_ID(msg)) { - bfa_log_info[mod]. - cbfn - (log_mod, msg_id, - "%s%s log: inconsistent msg id %u array msg id %u\n", - BFA_LOG_CAT_NAME, bfa_log_severity[BFA_LOG_ERROR], - msg_id, BFA_LOG_GET_MSG_ID(msg)); - return -1; - } - - log_level = log_mod ? log_mod->log_level[mod] : bfa_log_info[mod].level; - if ((BFA_LOG_GET_SEVERITY(msg) > log_level) && - (msg->attributes != BFA_LOG_ATTR_NONE)) - return 0; - - va_start(ap, msg_id); - bfa_os_vsprintf(buf, BFA_LOG_GET_MSG_FMT_STRING(msg), ap); - va_end(ap); - - if (log_mod) - log_mod->cbfn(log_mod, msg_id, "%s[%s]%s%s %s: %s\n", - BFA_LOG_CAT_NAME, log_mod->instance_info, - bfa_log_severity[BFA_LOG_GET_SEVERITY(msg)], - (msg->attributes & BFA_LOG_ATTR_AUDIT) - ? " (audit) " : "", msg->msg_value, buf); - else - bfa_log_info[mod].cbfn(log_mod, msg_id, "%s%s%s %s: %s\n", - BFA_LOG_CAT_NAME, - bfa_log_severity[BFA_LOG_GET_SEVERITY(msg)], - (msg->attributes & BFA_LOG_ATTR_AUDIT) ? - " (audit) " : "", msg->msg_value, buf); - - return 0; -} - diff --git a/drivers/scsi/bfa/bfa_log_module.c b/drivers/scsi/bfa/bfa_log_module.c deleted file mode 100644 index cf577ef..0000000 --- a/drivers/scsi/bfa/bfa_log_module.c +++ /dev/null @@ -1,537 +0,0 @@ -/* - * Copyright (c) 2005-2009 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. - */ - -#include <cs/bfa_log.h> -#include <aen/bfa_aen_adapter.h> -#include <aen/bfa_aen_audit.h> -#include <aen/bfa_aen_ethport.h> -#include <aen/bfa_aen_ioc.h> -#include <aen/bfa_aen_itnim.h> -#include <aen/bfa_aen_lport.h> -#include <aen/bfa_aen_port.h> -#include <aen/bfa_aen_rport.h> -#include <log/bfa_log_fcs.h> -#include <log/bfa_log_hal.h> -#include <log/bfa_log_linux.h> -#include <log/bfa_log_wdrv.h> - -struct bfa_log_msgdef_s bfa_log_msg_array[] = { - - -/* messages define for BFA_AEN_CAT_ADAPTER Module */ -{BFA_AEN_ADAPTER_ADD, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, BFA_LOG_INFO, - "BFA_AEN_ADAPTER_ADD", - "New adapter found: SN = %s, base port WWN = %s.", - ((BFA_LOG_S << BFA_LOG_ARG0) | (BFA_LOG_S << BFA_LOG_ARG1) | 0), 2}, - -{BFA_AEN_ADAPTER_REMOVE, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, - BFA_LOG_WARNING, "BFA_AEN_ADAPTER_REMOVE", - "Adapter removed: SN = %s.", - ((BFA_LOG_S << BFA_LOG_ARG0) | 0), 1}, - - - - -/* messages define for BFA_AEN_CAT_AUDIT Module */ -{BFA_AEN_AUDIT_AUTH_ENABLE, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, - BFA_LOG_INFO, "BFA_AEN_AUDIT_AUTH_ENABLE", - "Authentication enabled for base port: WWN = %s.", - ((BFA_LOG_S << BFA_LOG_ARG0) | 0), 1}, - -{BFA_AEN_AUDIT_AUTH_DISABLE, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, - BFA_LOG_INFO, "BFA_AEN_AUDIT_AUTH_DISABLE", - "Authentication disabled for base port: WWN = %s.", - ((BFA_LOG_S << BFA_LOG_ARG0) | 0), 1}, - - - - -/* messages define for BFA_AEN_CAT_ETHPORT Module */ -{BFA_AEN_ETHPORT_LINKUP, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, BFA_LOG_INFO, - "BFA_AEN_ETHPORT_LINKUP", - "Base port ethernet linkup: mac = %s.", - ((BFA_LOG_S << BFA_LOG_ARG0) | 0), 1}, - -{BFA_AEN_ETHPORT_LINKDOWN, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, BFA_LOG_INFO, - "BFA_AEN_ETHPORT_LINKDOWN", - "Base port ethernet linkdown: mac = %s.", - ((BFA_LOG_S << BFA_LOG_ARG0) | 0), 1}, - -{BFA_AEN_ETHPORT_ENABLE, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, BFA_LOG_INFO, - "BFA_AEN_ETHPORT_ENABLE", - "Base port ethernet interface enabled: mac = %s.", - ((BFA_LOG_S << BFA_LOG_ARG0) | 0), 1}, - -{BFA_AEN_ETHPORT_DISABLE, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, BFA_LOG_INFO, - "BFA_AEN_ETHPORT_DISABLE", - "Base port ethernet interface disabled: mac = %s.", - ((BFA_LOG_S << BFA_LOG_ARG0) | 0), 1}, - - - - -/* messages define for BFA_AEN_CAT_IOC Module */ -{BFA_AEN_IOC_HBGOOD, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, BFA_LOG_INFO, - "BFA_AEN_IOC_HBGOOD", - "Heart Beat of IOC %d is good.", - ((BFA_LOG_D << BFA_LOG_ARG0) | 0), 1}, - -{BFA_AEN_IOC_HBFAIL, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, BFA_LOG_CRITICAL, - "BFA_AEN_IOC_HBFAIL", - "Heart Beat of IOC %d has failed.", - ((BFA_LOG_D << BFA_LOG_ARG0) | 0), 1}, - -{BFA_AEN_IOC_ENABLE, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, BFA_LOG_INFO, - "BFA_AEN_IOC_ENABLE", - "IOC %d is enabled.", - ((BFA_LOG_D << BFA_LOG_ARG0) | 0), 1}, - -{BFA_AEN_IOC_DISABLE, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, BFA_LOG_INFO, - "BFA_AEN_IOC_DISABLE", - "IOC %d is disabled.", - ((BFA_LOG_D << BFA_LOG_ARG0) | 0), 1}, - -{BFA_AEN_IOC_FWMISMATCH, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, - BFA_LOG_CRITICAL, "BFA_AEN_IOC_FWMISMATCH", - "Running firmware version is incompatible with the driver version.", - (0), 0}, - -{BFA_AEN_IOC_FWCFG_ERROR, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, - BFA_LOG_CRITICAL, "BFA_AEN_IOC_FWCFG_ERROR", - "Link initialization failed due to firmware configuration read error:" - " WWN = %s.", - ((BFA_LOG_S << BFA_LOG_ARG0) | 0), 1}, - -{BFA_AEN_IOC_INVALID_VENDOR, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, - BFA_LOG_ERROR, "BFA_AEN_IOC_INVALID_VENDOR", - "Unsupported switch vendor. Link initialization failed: WWN = %s.", - ((BFA_LOG_S << BFA_LOG_ARG0) | 0), 1}, - -{BFA_AEN_IOC_INVALID_NWWN, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, - BFA_LOG_ERROR, "BFA_AEN_IOC_INVALID_NWWN", - "Invalid NWWN. Link initialization failed: NWWN = 00:00:00:00:00:00:00:00.", - (0), 0}, - -{BFA_AEN_IOC_INVALID_PWWN, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, - BFA_LOG_ERROR, "BFA_AEN_IOC_INVALID_PWWN", - "Invalid PWWN. Link initialization failed: PWWN = 00:00:00:00:00:00:00:00.", - (0), 0}, - - - - -/* messages define for BFA_AEN_CAT_ITNIM Module */ -{BFA_AEN_ITNIM_ONLINE, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, BFA_LOG_INFO, - "BFA_AEN_ITNIM_ONLINE", - "Target (WWN = %s) is online for initiator (WWN = %s).", - ((BFA_LOG_S << BFA_LOG_ARG0) | (BFA_LOG_S << BFA_LOG_ARG1) | 0), 2}, - -{BFA_AEN_ITNIM_OFFLINE, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, BFA_LOG_INFO, - "BFA_AEN_ITNIM_OFFLINE", - "Target (WWN = %s) offlined by initiator (WWN = %s).", - ((BFA_LOG_S << BFA_LOG_ARG0) | (BFA_LOG_S << BFA_LOG_ARG1) | 0), 2}, - -{BFA_AEN_ITNIM_DISCONNECT, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, - BFA_LOG_ERROR, "BFA_AEN_ITNIM_DISCONNECT", - "Target (WWN = %s) connectivity lost for initiator (WWN = %s).", - ((BFA_LOG_S << BFA_LOG_ARG0) | (BFA_LOG_S << BFA_LOG_ARG1) | 0), 2}, - - - - -/* messages define for BFA_AEN_CAT_LPORT Module */ -{BFA_AEN_LPORT_NEW, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, BFA_LOG_INFO, - "BFA_AEN_LPORT_NEW", - "New logical port created: WWN = %s, Role = %s.", - ((BFA_LOG_S << BFA_LOG_ARG0) | (BFA_LOG_S << BFA_LOG_ARG1) | 0), 2}, - -{BFA_AEN_LPORT_DELETE, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, BFA_LOG_INFO, - "BFA_AEN_LPORT_DELETE", - "Logical port deleted: WWN = %s, Role = %s.", - ((BFA_LOG_S << BFA_LOG_ARG0) | (BFA_LOG_S << BFA_LOG_ARG1) | 0), 2}, - -{BFA_AEN_LPORT_ONLINE, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, BFA_LOG_INFO, - "BFA_AEN_LPORT_ONLINE", - "Logical port online: WWN = %s, Role = %s.", - ((BFA_LOG_S << BFA_LOG_ARG0) | (BFA_LOG_S << BFA_LOG_ARG1) | 0), 2}, - -{BFA_AEN_LPORT_OFFLINE, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, BFA_LOG_INFO, - "BFA_AEN_LPORT_OFFLINE", - "Logical port taken offline: WWN = %s, Role = %s.", - ((BFA_LOG_S << BFA_LOG_ARG0) | (BFA_LOG_S << BFA_LOG_ARG1) | 0), 2}, - -{BFA_AEN_LPORT_DISCONNECT, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, - BFA_LOG_ERROR, "BFA_AEN_LPORT_DISCONNECT", - "Logical port lost fabric connectivity: WWN = %s, Role = %s.", - ((BFA_LOG_S << BFA_LOG_ARG0) | (BFA_LOG_S << BFA_LOG_ARG1) | 0), 2}, - -{BFA_AEN_LPORT_NEW_PROP, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, BFA_LOG_INFO, - "BFA_AEN_LPORT_NEW_PROP", - "New virtual port created using proprietary interface: WWN = %s, Role = %s.", - ((BFA_LOG_S << BFA_LOG_ARG0) | (BFA_LOG_S << BFA_LOG_ARG1) | 0), 2}, - -{BFA_AEN_LPORT_DELETE_PROP, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, - BFA_LOG_INFO, "BFA_AEN_LPORT_DELETE_PROP", - "Virtual port deleted using proprietary interface: WWN = %s, Role = %s.", - ((BFA_LOG_S << BFA_LOG_ARG0) | (BFA_LOG_S << BFA_LOG_ARG1) | 0), 2}, - -{BFA_AEN_LPORT_NEW_STANDARD, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, - BFA_LOG_INFO, "BFA_AEN_LPORT_NEW_STANDARD", - "New virtual port created using standard interface: WWN = %s, Role = %s.", - ((BFA_LOG_S << BFA_LOG_ARG0) | (BFA_LOG_S << BFA_LOG_ARG1) | 0), 2}, - -{BFA_AEN_LPORT_DELETE_STANDARD, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, - BFA_LOG_INFO, "BFA_AEN_LPORT_DELETE_STANDARD", - "Virtual port deleted using standard interface: WWN = %s, Role = %s.", - ((BFA_LOG_S << BFA_LOG_ARG0) | (BFA_LOG_S << BFA_LOG_ARG1) | 0), 2}, - -{BFA_AEN_LPORT_NPIV_DUP_WWN, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, - BFA_LOG_WARNING, "BFA_AEN_LPORT_NPIV_DUP_WWN", - "Virtual port login failed. Duplicate WWN = %s reported by fabric.", - ((BFA_LOG_S << BFA_LOG_ARG0) | 0), 1}, - -{BFA_AEN_LPORT_NPIV_FABRIC_MAX, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, - BFA_LOG_WARNING, "BFA_AEN_LPORT_NPIV_FABRIC_MAX", - "Virtual port (WWN = %s) login failed. Max NPIV ports already exist in" - " fabric/fport.", - ((BFA_LOG_S << BFA_LOG_ARG0) | 0), 1}, - -{BFA_AEN_LPORT_NPIV_UNKNOWN, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, - BFA_LOG_WARNING, "BFA_AEN_LPORT_NPIV_UNKNOWN", - "Virtual port (WWN = %s) login failed.", - ((BFA_LOG_S << BFA_LOG_ARG0) | 0), 1}, - - - - -/* messages define for BFA_AEN_CAT_PORT Module */ -{BFA_AEN_PORT_ONLINE, BFA_LOG_ATTR_NONE, BFA_LOG_INFO, "BFA_AEN_PORT_ONLINE", - "Base port online: WWN = %s.", - ((BFA_LOG_S << BFA_LOG_ARG0) | 0), 1}, - -{BFA_AEN_PORT_OFFLINE, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, BFA_LOG_WARNING, - "BFA_AEN_PORT_OFFLINE", - "Base port offline: WWN = %s.", - ((BFA_LOG_S << BFA_LOG_ARG0) | 0), 1}, - -{BFA_AEN_PORT_RLIR, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, BFA_LOG_INFO, - "BFA_AEN_PORT_RLIR", - "RLIR event not supported.", - (0), 0}, - -{BFA_AEN_PORT_SFP_INSERT, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, BFA_LOG_INFO, - "BFA_AEN_PORT_SFP_INSERT", - "New SFP found: WWN/MAC = %s.", - ((BFA_LOG_S << BFA_LOG_ARG0) | 0), 1}, - -{BFA_AEN_PORT_SFP_REMOVE, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, - BFA_LOG_WARNING, "BFA_AEN_PORT_SFP_REMOVE", - "SFP removed: WWN/MAC = %s.", - ((BFA_LOG_S << BFA_LOG_ARG0) | 0), 1}, - -{BFA_AEN_PORT_SFP_POM, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, BFA_LOG_WARNING, - "BFA_AEN_PORT_SFP_POM", - "SFP POM level to %s: WWN/MAC = %s.", - ((BFA_LOG_S << BFA_LOG_ARG0) | (BFA_LOG_S << BFA_LOG_ARG1) | 0), 2}, - -{BFA_AEN_PORT_ENABLE, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, BFA_LOG_INFO, - "BFA_AEN_PORT_ENABLE", - "Base port enabled: WWN = %s.", - ((BFA_LOG_S << BFA_LOG_ARG0) | 0), 1}, - -{BFA_AEN_PORT_DISABLE, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, BFA_LOG_INFO, - "BFA_AEN_PORT_DISABLE", - "Base port disabled: WWN = %s.", - ((BFA_LOG_S << BFA_LOG_ARG0) | 0), 1}, - -{BFA_AEN_PORT_AUTH_ON, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, BFA_LOG_INFO, - "BFA_AEN_PORT_AUTH_ON", - "Authentication successful for base port: WWN = %s.", - ((BFA_LOG_S << BFA_LOG_ARG0) | 0), 1}, - -{BFA_AEN_PORT_AUTH_OFF, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, BFA_LOG_ERROR, - "BFA_AEN_PORT_AUTH_OFF", - "Authentication unsuccessful for base port: WWN = %s.", - ((BFA_LOG_S << BFA_LOG_ARG0) | 0), 1}, - -{BFA_AEN_PORT_DISCONNECT, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, BFA_LOG_ERROR, - "BFA_AEN_PORT_DISCONNECT", - "Base port (WWN = %s) lost fabric connectivity.", - ((BFA_LOG_S << BFA_LOG_ARG0) | 0), 1}, - -{BFA_AEN_PORT_QOS_NEG, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, BFA_LOG_WARNING, - "BFA_AEN_PORT_QOS_NEG", - "QOS negotiation failed for base port: WWN = %s.", - ((BFA_LOG_S << BFA_LOG_ARG0) | 0), 1}, - -{BFA_AEN_PORT_FABRIC_NAME_CHANGE, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, - BFA_LOG_WARNING, "BFA_AEN_PORT_FABRIC_NAME_CHANGE", - "Base port WWN = %s, Fabric WWN = %s.", - ((BFA_LOG_S << BFA_LOG_ARG0) | (BFA_LOG_S << BFA_LOG_ARG1) | 0), 2}, - -{BFA_AEN_PORT_SFP_ACCESS_ERROR, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, - BFA_LOG_WARNING, "BFA_AEN_PORT_SFP_ACCESS_ERROR", - "SFP access error: WWN/MAC = %s.", - ((BFA_LOG_S << BFA_LOG_ARG0) | 0), 1}, - -{BFA_AEN_PORT_SFP_UNSUPPORT, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, - BFA_LOG_WARNING, "BFA_AEN_PORT_SFP_UNSUPPORT", - "Unsupported SFP found: WWN/MAC = %s.", - ((BFA_LOG_S << BFA_LOG_ARG0) | 0), 1}, - - - - -/* messages define for BFA_AEN_CAT_RPORT Module */ -{BFA_AEN_RPORT_ONLINE, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, BFA_LOG_INFO, - "BFA_AEN_RPORT_ONLINE", - "Remote port (WWN = %s) online for logical port (WWN = %s).", - ((BFA_LOG_S << BFA_LOG_ARG0) | (BFA_LOG_S << BFA_LOG_ARG1) | 0), 2}, - -{BFA_AEN_RPORT_OFFLINE, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, BFA_LOG_INFO, - "BFA_AEN_RPORT_OFFLINE", - "Remote port (WWN = %s) offlined by logical port (WWN = %s).", - ((BFA_LOG_S << BFA_LOG_ARG0) | (BFA_LOG_S << BFA_LOG_ARG1) | 0), 2}, - -{BFA_AEN_RPORT_DISCONNECT, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, - BFA_LOG_ERROR, "BFA_AEN_RPORT_DISCONNECT", - "Remote port (WWN = %s) connectivity lost for logical port (WWN = %s).", - ((BFA_LOG_S << BFA_LOG_ARG0) | (BFA_LOG_S << BFA_LOG_ARG1) | 0), 2}, - -{BFA_AEN_RPORT_QOS_PRIO, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, BFA_LOG_INFO, - "BFA_AEN_RPORT_QOS_PRIO", - "QOS priority changed to %s: RPWWN = %s and LPWWN = %s.", - ((BFA_LOG_S << BFA_LOG_ARG0) | (BFA_LOG_S << BFA_LOG_ARG1) | - (BFA_LOG_S << BFA_LOG_ARG2) | 0), 3}, - -{BFA_AEN_RPORT_QOS_FLOWID, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, BFA_LOG_INFO, - "BFA_AEN_RPORT_QOS_FLOWID", - "QOS flow ID changed to %d: RPWWN = %s and LPWWN = %s.", - ((BFA_LOG_D << BFA_LOG_ARG0) | (BFA_LOG_S << BFA_LOG_ARG1) | - (BFA_LOG_S << BFA_LOG_ARG2) | 0), 3}, - - - - -/* messages define for FCS Module */ -{BFA_LOG_FCS_FABRIC_NOSWITCH, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, - BFA_LOG_INFO, "FCS_FABRIC_NOSWITCH", - "No switched fabric presence is detected.", - (0), 0}, - -{BFA_LOG_FCS_FABRIC_ISOLATED, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, - BFA_LOG_INFO, "FCS_FABRIC_ISOLATED", - "Port is isolated due to VF_ID mismatch. PWWN: %s, Port VF_ID: %04x and" - " switch port VF_ID: %04x.", - ((BFA_LOG_S << BFA_LOG_ARG0) | (BFA_LOG_X << BFA_LOG_ARG1) | - (BFA_LOG_X << BFA_LOG_ARG2) | 0), 3}, - - - - -/* messages define for HAL Module */ -{BFA_LOG_HAL_ASSERT, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, BFA_LOG_ERROR, - "HAL_ASSERT", - "Assertion failure: %s:%d: %s", - ((BFA_LOG_S << BFA_LOG_ARG0) | (BFA_LOG_D << BFA_LOG_ARG1) | - (BFA_LOG_S << BFA_LOG_ARG2) | 0), 3}, - -{BFA_LOG_HAL_HEARTBEAT_FAILURE, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, - BFA_LOG_CRITICAL, "HAL_HEARTBEAT_FAILURE", - "Firmware heartbeat failure at %d", - ((BFA_LOG_D << BFA_LOG_ARG0) | 0), 1}, - -{BFA_LOG_HAL_FCPIM_PARM_INVALID, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, - BFA_LOG_INFO, "HAL_FCPIM_PARM_INVALID", - "Driver configuration %s value %d is invalid. Value should be within" - " %d and %d.", - ((BFA_LOG_S << BFA_LOG_ARG0) | (BFA_LOG_D << BFA_LOG_ARG1) | - (BFA_LOG_D << BFA_LOG_ARG2) | (BFA_LOG_D << BFA_LOG_ARG3) | 0), 4}, - -{BFA_LOG_HAL_SM_ASSERT, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, BFA_LOG_ERROR, - "HAL_SM_ASSERT", - "SM Assertion failure: %s:%d: event = %d", - ((BFA_LOG_S << BFA_LOG_ARG0) | (BFA_LOG_D << BFA_LOG_ARG1) | - (BFA_LOG_D << BFA_LOG_ARG2) | 0), 3}, - -{BFA_LOG_HAL_DRIVER_ERROR, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, - BFA_LOG_INFO, "HAL_DRIVER_ERROR", - "%s", - ((BFA_LOG_S << BFA_LOG_ARG0) | 0), 1}, - -{BFA_LOG_HAL_DRIVER_CONFIG_ERROR, - BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, BFA_LOG_INFO, - "HAL_DRIVER_CONFIG_ERROR", - "%s", - ((BFA_LOG_S << BFA_LOG_ARG0) | 0), 1}, - -{BFA_LOG_HAL_MBOX_ERROR, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, - BFA_LOG_INFO, "HAL_MBOX_ERROR", - "%s", - ((BFA_LOG_S << BFA_LOG_ARG0) | 0), 1}, - - - - -/* messages define for LINUX Module */ -{BFA_LOG_LINUX_DEVICE_CLAIMED, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, - BFA_LOG_INFO, "LINUX_DEVICE_CLAIMED", - "bfa device at %s claimed.", - ((BFA_LOG_S << BFA_LOG_ARG0) | 0), 1}, - -{BFA_LOG_LINUX_HASH_INIT_FAILED, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, - BFA_LOG_INFO, "LINUX_HASH_INIT_FAILED", - "Hash table initialization failure for the port %s.", - ((BFA_LOG_S << BFA_LOG_ARG0) | 0), 1}, - -{BFA_LOG_LINUX_SYSFS_FAILED, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, - BFA_LOG_INFO, "LINUX_SYSFS_FAILED", - "sysfs file creation failure for the port %s.", - ((BFA_LOG_S << BFA_LOG_ARG0) | 0), 1}, - -{BFA_LOG_LINUX_MEM_ALLOC_FAILED, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, - BFA_LOG_INFO, "LINUX_MEM_ALLOC_FAILED", - "Memory allocation failed: %s. ", - ((BFA_LOG_S << BFA_LOG_ARG0) | 0), 1}, - -{BFA_LOG_LINUX_DRIVER_REGISTRATION_FAILED, - BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, BFA_LOG_INFO, - "LINUX_DRIVER_REGISTRATION_FAILED", - "%s. ", - ((BFA_LOG_S << BFA_LOG_ARG0) | 0), 1}, - -{BFA_LOG_LINUX_ITNIM_FREE, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, BFA_LOG_INFO, - "LINUX_ITNIM_FREE", - "scsi%d: FCID: %s WWPN: %s", - ((BFA_LOG_D << BFA_LOG_ARG0) | (BFA_LOG_S << BFA_LOG_ARG1) | - (BFA_LOG_S << BFA_LOG_ARG2) | 0), 3}, - -{BFA_LOG_LINUX_ITNIM_ONLINE, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, - BFA_LOG_INFO, "LINUX_ITNIM_ONLINE", - "Target: %d:0:%d FCID: %s WWPN: %s", - ((BFA_LOG_D << BFA_LOG_ARG0) | (BFA_LOG_D << BFA_LOG_ARG1) | - (BFA_LOG_S << BFA_LOG_ARG2) | (BFA_LOG_S << BFA_LOG_ARG3) | 0), 4}, - -{BFA_LOG_LINUX_ITNIM_OFFLINE, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, - BFA_LOG_INFO, "LINUX_ITNIM_OFFLINE", - "Target: %d:0:%d FCID: %s WWPN: %s", - ((BFA_LOG_D << BFA_LOG_ARG0) | (BFA_LOG_D << BFA_LOG_ARG1) | - (BFA_LOG_S << BFA_LOG_ARG2) | (BFA_LOG_S << BFA_LOG_ARG3) | 0), 4}, - -{BFA_LOG_LINUX_SCSI_HOST_FREE, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, - BFA_LOG_INFO, "LINUX_SCSI_HOST_FREE", - "Free scsi%d", - ((BFA_LOG_D << BFA_LOG_ARG0) | 0), 1}, - -{BFA_LOG_LINUX_SCSI_ABORT, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, BFA_LOG_INFO, - "LINUX_SCSI_ABORT", - "scsi%d: abort cmnd %p, iotag %x", - ((BFA_LOG_D << BFA_LOG_ARG0) | (BFA_LOG_P << BFA_LOG_ARG1) | - (BFA_LOG_X << BFA_LOG_ARG2) | 0), 3}, - -{BFA_LOG_LINUX_SCSI_ABORT_COMP, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, - BFA_LOG_INFO, "LINUX_SCSI_ABORT_COMP", - "scsi%d: complete abort 0x%p, iotag 0x%x", - ((BFA_LOG_D << BFA_LOG_ARG0) | (BFA_LOG_P << BFA_LOG_ARG1) | - (BFA_LOG_X << BFA_LOG_ARG2) | 0), 3}, - -{BFA_LOG_LINUX_DRIVER_CONFIG_ERROR, - BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, BFA_LOG_INFO, - "LINUX_DRIVER_CONFIG_ERROR", - "%s", - ((BFA_LOG_S << BFA_LOG_ARG0) | 0), 1}, - -{BFA_LOG_LINUX_BNA_STATE_MACHINE, - BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, BFA_LOG_INFO, - "LINUX_BNA_STATE_MACHINE", - "%s", - ((BFA_LOG_S << BFA_LOG_ARG0) | 0), 1}, - -{BFA_LOG_LINUX_IOC_ERROR, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, - BFA_LOG_INFO, "LINUX_IOC_ERROR", - "%s", - ((BFA_LOG_S << BFA_LOG_ARG0) | 0), 1}, - -{BFA_LOG_LINUX_RESOURCE_ALLOC_ERROR, - BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, BFA_LOG_INFO, - "LINUX_RESOURCE_ALLOC_ERROR", - "%s", - ((BFA_LOG_S << BFA_LOG_ARG0) | 0), 1}, - -{BFA_LOG_LINUX_RING_BUFFER_ERROR, - BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, BFA_LOG_INFO, - "LINUX_RING_BUFFER_ERROR", - "%s", - ((BFA_LOG_S << BFA_LOG_ARG0) | 0), 1}, - -{BFA_LOG_LINUX_DRIVER_ERROR, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, - BFA_LOG_ERROR, "LINUX_DRIVER_ERROR", - "%s", - ((BFA_LOG_S << BFA_LOG_ARG0) | 0), 1}, - -{BFA_LOG_LINUX_DRIVER_INFO, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, - BFA_LOG_INFO, "LINUX_DRIVER_INFO", - "%s", - ((BFA_LOG_S << BFA_LOG_ARG0) | 0), 1}, - -{BFA_LOG_LINUX_DRIVER_DIAG, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, - BFA_LOG_INFO, "LINUX_DRIVER_DIAG", - "%s", - ((BFA_LOG_S << BFA_LOG_ARG0) | 0), 1}, - -{BFA_LOG_LINUX_DRIVER_AEN, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, - BFA_LOG_INFO, "LINUX_DRIVER_AEN", - "%s", - ((BFA_LOG_S << BFA_LOG_ARG0) | 0), 1}, - - - - -/* messages define for WDRV Module */ -{BFA_LOG_WDRV_IOC_INIT_ERROR, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, - BFA_LOG_INFO, "WDRV_IOC_INIT_ERROR", - "IOC initialization has failed.", - (0), 0}, - -{BFA_LOG_WDRV_IOC_INTERNAL_ERROR, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, - BFA_LOG_INFO, "WDRV_IOC_INTERNAL_ERROR", - "IOC internal error. ", - (0), 0}, - -{BFA_LOG_WDRV_IOC_START_ERROR, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, - BFA_LOG_INFO, "WDRV_IOC_START_ERROR", - "IOC could not be started. ", - (0), 0}, - -{BFA_LOG_WDRV_IOC_STOP_ERROR, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, - BFA_LOG_INFO, "WDRV_IOC_STOP_ERROR", - "IOC could not be stopped. ", - (0), 0}, - -{BFA_LOG_WDRV_INSUFFICIENT_RESOURCES, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, - BFA_LOG_INFO, "WDRV_INSUFFICIENT_RESOURCES", - "Insufficient memory. ", - (0), 0}, - -{BFA_LOG_WDRV_BASE_ADDRESS_MAP_ERROR, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, - BFA_LOG_INFO, "WDRV_BASE_ADDRESS_MAP_ERROR", - "Unable to map the IOC onto the system address space. ", - (0), 0}, - - -{0, 0, 0, "", "", 0, 0}, -}; diff --git a/drivers/scsi/bfa/bfa_module.c b/drivers/scsi/bfa/bfa_module.c deleted file mode 100644 index a7fcc80..0000000 --- a/drivers/scsi/bfa/bfa_module.c +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (c) 2005-2009 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. - */ -#include <bfa.h> -#include <defs/bfa_defs_pci.h> -#include <cs/bfa_debug.h> -#include <bfa_iocfc.h> - -/** - * BFA module list terminated by NULL - */ -struct bfa_module_s *hal_mods[] = { - &hal_mod_sgpg, - &hal_mod_fcport, - &hal_mod_fcxp, - &hal_mod_lps, - &hal_mod_uf, - &hal_mod_rport, - &hal_mod_fcpim, -#ifdef BFA_CFG_PBIND - &hal_mod_pbind, -#endif - NULL -}; - -/** - * Message handlers for various modules. - */ -bfa_isr_func_t bfa_isrs[BFI_MC_MAX] = { - bfa_isr_unhandled, /* NONE */ - bfa_isr_unhandled, /* BFI_MC_IOC */ - bfa_isr_unhandled, /* BFI_MC_DIAG */ - bfa_isr_unhandled, /* BFI_MC_FLASH */ - bfa_isr_unhandled, /* BFI_MC_CEE */ - bfa_fcport_isr, /* BFI_MC_FCPORT */ - bfa_isr_unhandled, /* BFI_MC_IOCFC */ - bfa_isr_unhandled, /* BFI_MC_LL */ - bfa_uf_isr, /* BFI_MC_UF */ - bfa_fcxp_isr, /* BFI_MC_FCXP */ - bfa_lps_isr, /* BFI_MC_LPS */ - bfa_rport_isr, /* BFI_MC_RPORT */ - bfa_itnim_isr, /* BFI_MC_ITNIM */ - bfa_isr_unhandled, /* BFI_MC_IOIM_READ */ - bfa_isr_unhandled, /* BFI_MC_IOIM_WRITE */ - bfa_isr_unhandled, /* BFI_MC_IOIM_IO */ - bfa_ioim_isr, /* BFI_MC_IOIM */ - bfa_ioim_good_comp_isr, /* BFI_MC_IOIM_IOCOM */ - bfa_tskim_isr, /* BFI_MC_TSKIM */ - bfa_isr_unhandled, /* BFI_MC_SBOOT */ - bfa_isr_unhandled, /* BFI_MC_IPFC */ - bfa_isr_unhandled, /* BFI_MC_PORT */ - bfa_isr_unhandled, /* --------- */ - bfa_isr_unhandled, /* --------- */ - bfa_isr_unhandled, /* --------- */ - bfa_isr_unhandled, /* --------- */ - bfa_isr_unhandled, /* --------- */ - bfa_isr_unhandled, /* --------- */ - bfa_isr_unhandled, /* --------- */ - bfa_isr_unhandled, /* --------- */ - bfa_isr_unhandled, /* --------- */ - bfa_isr_unhandled, /* --------- */ -}; - -/** - * Message handlers for mailbox command classes - */ -bfa_ioc_mbox_mcfunc_t bfa_mbox_isrs[BFI_MC_MAX] = { - NULL, - NULL, /* BFI_MC_IOC */ - NULL, /* BFI_MC_DIAG */ - NULL, /* BFI_MC_FLASH */ - NULL, /* BFI_MC_CEE */ - NULL, /* BFI_MC_PORT */ - bfa_iocfc_isr, /* BFI_MC_IOCFC */ - NULL, -}; - diff --git a/drivers/scsi/bfa/bfa_sm.c b/drivers/scsi/bfa/bfa_sm.c deleted file mode 100644 index 5420f4f..0000000 --- a/drivers/scsi/bfa/bfa_sm.c +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2005-2009 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. - */ - -/** - * bfasm.c BFA State machine utility functions - */ - -#include <cs/bfa_sm.h> - -/** - * cs_sm_api - */ - -int -bfa_sm_to_state(struct bfa_sm_table_s *smt, bfa_sm_t sm) -{ - int i = 0; - - while (smt[i].sm && smt[i].sm != sm) - i++; - return smt[i].state; -} - - diff --git a/drivers/scsi/bfa/bfa_timer.c b/drivers/scsi/bfa/bfa_timer.c deleted file mode 100644 index cb76481..0000000 --- a/drivers/scsi/bfa/bfa_timer.c +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (c) 2005-2009 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. - */ - -#include <bfa_timer.h> -#include <cs/bfa_debug.h> - -void -bfa_timer_init(struct bfa_timer_mod_s *mod) -{ - INIT_LIST_HEAD(&mod->timer_q); -} - -void -bfa_timer_beat(struct bfa_timer_mod_s *mod) -{ - struct list_head *qh = &mod->timer_q; - struct list_head *qe, *qe_next; - struct bfa_timer_s *elem; - struct list_head timedout_q; - - INIT_LIST_HEAD(&timedout_q); - - qe = bfa_q_next(qh); - - while (qe != qh) { - qe_next = bfa_q_next(qe); - - elem = (struct bfa_timer_s *) qe; - if (elem->timeout <= BFA_TIMER_FREQ) { - elem->timeout = 0; - list_del(&elem->qe); - list_add_tail(&elem->qe, &timedout_q); - } else { - elem->timeout -= BFA_TIMER_FREQ; - } - - qe = qe_next; /* go to next elem */ - } - - /* - * Pop all the timeout entries - */ - while (!list_empty(&timedout_q)) { - bfa_q_deq(&timedout_q, &elem); - elem->timercb(elem->arg); - } -} - -/** - * Should be called with lock protection - */ -void -bfa_timer_begin(struct bfa_timer_mod_s *mod, struct bfa_timer_s *timer, - void (*timercb) (void *), void *arg, unsigned int timeout) -{ - - bfa_assert(timercb != NULL); - bfa_assert(!bfa_q_is_on_q(&mod->timer_q, timer)); - - timer->timeout = timeout; - timer->timercb = timercb; - timer->arg = arg; - - list_add_tail(&timer->qe, &mod->timer_q); -} - -/** - * Should be called with lock protection - */ -void -bfa_timer_stop(struct bfa_timer_s *timer) -{ - bfa_assert(!list_empty(&timer->qe)); - - list_del(&timer->qe); -} -- 1.7.3.rc1 -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html