mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-07 13:43:51 +00:00
Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (69 commits) [SCSI] scsi_transport_fc: Fix synchronization issue while deleting vport [SCSI] bfa: Update the driver version to 2.1.2.1. [SCSI] bfa: Remove unused header files and did some cleanup. [SCSI] bfa: Handle SCSI IO underrun case. [SCSI] bfa: FCS and include file changes. [SCSI] bfa: Modified the portstats get/clear logic [SCSI] bfa: Replace bfa_get_attr() with specific APIs [SCSI] bfa: New portlog entries for events (FIP/FLOGI/FDISC/LOGO). [SCSI] bfa: Rename pport to fcport in BFA FCS. [SCSI] bfa: IOC fixes, check for IOC down condition. [SCSI] bfa: In MSIX mode, ignore spurious RME interrupts when FCoE ports are in FW mismatch state. [SCSI] bfa: Fix Command Queue (CPE) full condition check and ack CPE interrupt. [SCSI] bfa: IOC recovery fix in fcmode. [SCSI] bfa: AEN and byte alignment fixes. [SCSI] bfa: Introduce a link notification state machine. [SCSI] bfa: Added firmware save clear feature for BFA driver. [SCSI] bfa: FCS authentication related changes. [SCSI] bfa: PCI VPD, FIP and include file changes. [SCSI] bfa: Fix to copy fpma MAC when requested by user space application. [SCSI] bfa: RPORT state machine: direct attach mode fix. ...
This commit is contained in:
commit
961cde93de
@ -613,7 +613,7 @@ static struct scsi_host_template iscsi_iser_sht = {
|
||||
.cmd_per_lun = ISER_DEF_CMD_PER_LUN,
|
||||
.eh_abort_handler = iscsi_eh_abort,
|
||||
.eh_device_reset_handler= iscsi_eh_device_reset,
|
||||
.eh_target_reset_handler= iscsi_eh_target_reset,
|
||||
.eh_target_reset_handler = iscsi_eh_recover_target,
|
||||
.target_alloc = iscsi_target_alloc,
|
||||
.use_clustering = DISABLE_CLUSTERING,
|
||||
.proc_name = "iscsi_iser",
|
||||
|
@ -1,9 +1,15 @@
|
||||
menu "SCSI device support"
|
||||
|
||||
config SCSI_MOD
|
||||
tristate
|
||||
default y if SCSI=n || SCSI=y
|
||||
default m if SCSI=m
|
||||
|
||||
config RAID_ATTRS
|
||||
tristate "RAID Transport Class"
|
||||
default n
|
||||
depends on BLOCK
|
||||
depends on SCSI_MOD
|
||||
---help---
|
||||
Provides RAID
|
||||
|
||||
|
@ -32,18 +32,11 @@ void be_mcc_notify(struct beiscsi_hba *phba)
|
||||
unsigned int alloc_mcc_tag(struct beiscsi_hba *phba)
|
||||
{
|
||||
unsigned int tag = 0;
|
||||
unsigned int num = 0;
|
||||
|
||||
mcc_tag_rdy:
|
||||
if (phba->ctrl.mcc_tag_available) {
|
||||
tag = phba->ctrl.mcc_tag[phba->ctrl.mcc_alloc_index];
|
||||
phba->ctrl.mcc_tag[phba->ctrl.mcc_alloc_index] = 0;
|
||||
phba->ctrl.mcc_numtag[tag] = 0;
|
||||
} else {
|
||||
udelay(100);
|
||||
num++;
|
||||
if (num < mcc_timeout)
|
||||
goto mcc_tag_rdy;
|
||||
}
|
||||
if (tag) {
|
||||
phba->ctrl.mcc_tag_available--;
|
||||
|
@ -482,7 +482,7 @@ static int beiscsi_open_conn(struct iscsi_endpoint *ep,
|
||||
tag = mgmt_open_connection(phba, dst_addr, beiscsi_ep);
|
||||
if (!tag) {
|
||||
SE_DEBUG(DBG_LVL_1,
|
||||
"mgmt_invalidate_connection Failed for cid=%d \n",
|
||||
"mgmt_open_connection Failed for cid=%d \n",
|
||||
beiscsi_ep->ep_cid);
|
||||
} else {
|
||||
wait_event_interruptible(phba->ctrl.mcc_wait[tag],
|
||||
@ -701,7 +701,7 @@ void beiscsi_conn_stop(struct iscsi_cls_conn *cls_conn, int flag)
|
||||
if (!tag) {
|
||||
SE_DEBUG(DBG_LVL_1,
|
||||
"mgmt_invalidate_connection Failed for cid=%d \n",
|
||||
beiscsi_ep->ep_cid);
|
||||
beiscsi_ep->ep_cid);
|
||||
} else {
|
||||
wait_event_interruptible(phba->ctrl.mcc_wait[tag],
|
||||
phba->ctrl.mcc_numtag[tag]);
|
||||
|
@ -58,6 +58,123 @@ static int beiscsi_slave_configure(struct scsi_device *sdev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int beiscsi_eh_abort(struct scsi_cmnd *sc)
|
||||
{
|
||||
struct iscsi_cls_session *cls_session;
|
||||
struct iscsi_task *aborted_task = (struct iscsi_task *)sc->SCp.ptr;
|
||||
struct beiscsi_io_task *aborted_io_task;
|
||||
struct iscsi_conn *conn;
|
||||
struct beiscsi_conn *beiscsi_conn;
|
||||
struct beiscsi_hba *phba;
|
||||
struct iscsi_session *session;
|
||||
struct invalidate_command_table *inv_tbl;
|
||||
unsigned int cid, tag, num_invalidate;
|
||||
|
||||
cls_session = starget_to_session(scsi_target(sc->device));
|
||||
session = cls_session->dd_data;
|
||||
|
||||
spin_lock_bh(&session->lock);
|
||||
if (!aborted_task || !aborted_task->sc) {
|
||||
/* we raced */
|
||||
spin_unlock_bh(&session->lock);
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
aborted_io_task = aborted_task->dd_data;
|
||||
if (!aborted_io_task->scsi_cmnd) {
|
||||
/* raced or invalid command */
|
||||
spin_unlock_bh(&session->lock);
|
||||
return SUCCESS;
|
||||
}
|
||||
spin_unlock_bh(&session->lock);
|
||||
conn = aborted_task->conn;
|
||||
beiscsi_conn = conn->dd_data;
|
||||
phba = beiscsi_conn->phba;
|
||||
|
||||
/* invalidate iocb */
|
||||
cid = beiscsi_conn->beiscsi_conn_cid;
|
||||
inv_tbl = phba->inv_tbl;
|
||||
memset(inv_tbl, 0x0, sizeof(*inv_tbl));
|
||||
inv_tbl->cid = cid;
|
||||
inv_tbl->icd = aborted_io_task->psgl_handle->sgl_index;
|
||||
num_invalidate = 1;
|
||||
tag = mgmt_invalidate_icds(phba, inv_tbl, num_invalidate, cid);
|
||||
if (!tag) {
|
||||
shost_printk(KERN_WARNING, phba->shost,
|
||||
"mgmt_invalidate_icds could not be"
|
||||
" submitted\n");
|
||||
return FAILED;
|
||||
} else {
|
||||
wait_event_interruptible(phba->ctrl.mcc_wait[tag],
|
||||
phba->ctrl.mcc_numtag[tag]);
|
||||
free_mcc_tag(&phba->ctrl, tag);
|
||||
}
|
||||
|
||||
return iscsi_eh_abort(sc);
|
||||
}
|
||||
|
||||
static int beiscsi_eh_device_reset(struct scsi_cmnd *sc)
|
||||
{
|
||||
struct iscsi_task *abrt_task;
|
||||
struct beiscsi_io_task *abrt_io_task;
|
||||
struct iscsi_conn *conn;
|
||||
struct beiscsi_conn *beiscsi_conn;
|
||||
struct beiscsi_hba *phba;
|
||||
struct iscsi_session *session;
|
||||
struct iscsi_cls_session *cls_session;
|
||||
struct invalidate_command_table *inv_tbl;
|
||||
unsigned int cid, tag, i, num_invalidate;
|
||||
int rc = FAILED;
|
||||
|
||||
/* invalidate iocbs */
|
||||
cls_session = starget_to_session(scsi_target(sc->device));
|
||||
session = cls_session->dd_data;
|
||||
spin_lock_bh(&session->lock);
|
||||
if (!session->leadconn || session->state != ISCSI_STATE_LOGGED_IN)
|
||||
goto unlock;
|
||||
|
||||
conn = session->leadconn;
|
||||
beiscsi_conn = conn->dd_data;
|
||||
phba = beiscsi_conn->phba;
|
||||
cid = beiscsi_conn->beiscsi_conn_cid;
|
||||
inv_tbl = phba->inv_tbl;
|
||||
memset(inv_tbl, 0x0, sizeof(*inv_tbl) * BE2_CMDS_PER_CXN);
|
||||
num_invalidate = 0;
|
||||
for (i = 0; i < conn->session->cmds_max; i++) {
|
||||
abrt_task = conn->session->cmds[i];
|
||||
abrt_io_task = abrt_task->dd_data;
|
||||
if (!abrt_task->sc || abrt_task->state == ISCSI_TASK_FREE)
|
||||
continue;
|
||||
|
||||
if (abrt_task->sc->device->lun != abrt_task->sc->device->lun)
|
||||
continue;
|
||||
|
||||
inv_tbl->cid = cid;
|
||||
inv_tbl->icd = abrt_io_task->psgl_handle->sgl_index;
|
||||
num_invalidate++;
|
||||
inv_tbl++;
|
||||
}
|
||||
spin_unlock_bh(&session->lock);
|
||||
inv_tbl = phba->inv_tbl;
|
||||
|
||||
tag = mgmt_invalidate_icds(phba, inv_tbl, num_invalidate, cid);
|
||||
if (!tag) {
|
||||
shost_printk(KERN_WARNING, phba->shost,
|
||||
"mgmt_invalidate_icds could not be"
|
||||
" submitted\n");
|
||||
return FAILED;
|
||||
} else {
|
||||
wait_event_interruptible(phba->ctrl.mcc_wait[tag],
|
||||
phba->ctrl.mcc_numtag[tag]);
|
||||
free_mcc_tag(&phba->ctrl, tag);
|
||||
}
|
||||
|
||||
return iscsi_eh_device_reset(sc);
|
||||
unlock:
|
||||
spin_unlock_bh(&session->lock);
|
||||
return rc;
|
||||
}
|
||||
|
||||
/*------------------- PCI Driver operations and data ----------------- */
|
||||
static DEFINE_PCI_DEVICE_TABLE(beiscsi_pci_id_table) = {
|
||||
{ PCI_DEVICE(BE_VENDOR_ID, BE_DEVICE_ID1) },
|
||||
@ -74,12 +191,12 @@ static struct scsi_host_template beiscsi_sht = {
|
||||
.name = "ServerEngines 10Gbe open-iscsi Initiator Driver",
|
||||
.proc_name = DRV_NAME,
|
||||
.queuecommand = iscsi_queuecommand,
|
||||
.eh_abort_handler = iscsi_eh_abort,
|
||||
.change_queue_depth = iscsi_change_queue_depth,
|
||||
.slave_configure = beiscsi_slave_configure,
|
||||
.target_alloc = iscsi_target_alloc,
|
||||
.eh_device_reset_handler = iscsi_eh_device_reset,
|
||||
.eh_target_reset_handler = iscsi_eh_target_reset,
|
||||
.eh_abort_handler = beiscsi_eh_abort,
|
||||
.eh_device_reset_handler = beiscsi_eh_device_reset,
|
||||
.eh_target_reset_handler = iscsi_eh_session_reset,
|
||||
.sg_tablesize = BEISCSI_SGLIST_ELEMENTS,
|
||||
.can_queue = BE2_IO_DEPTH,
|
||||
.this_id = -1,
|
||||
@ -242,7 +359,7 @@ static void beiscsi_get_params(struct beiscsi_hba *phba)
|
||||
+ BE2_TMFS
|
||||
+ BE2_NOPOUT_REQ));
|
||||
phba->params.cxns_per_ctrl = phba->fw_config.iscsi_cid_count;
|
||||
phba->params.asyncpdus_per_ctrl = phba->fw_config.iscsi_cid_count;;
|
||||
phba->params.asyncpdus_per_ctrl = phba->fw_config.iscsi_cid_count * 2;
|
||||
phba->params.icds_per_ctrl = phba->fw_config.iscsi_icd_count;;
|
||||
phba->params.num_sge_per_io = BE2_SGE;
|
||||
phba->params.defpdu_hdr_sz = BE2_DEFPDU_HDR_SZ;
|
||||
@ -946,14 +1063,18 @@ static void hwi_complete_cmd(struct beiscsi_conn *beiscsi_conn,
|
||||
case HWH_TYPE_IO:
|
||||
case HWH_TYPE_IO_RD:
|
||||
if ((task->hdr->opcode & ISCSI_OPCODE_MASK) ==
|
||||
ISCSI_OP_NOOP_OUT) {
|
||||
ISCSI_OP_NOOP_OUT)
|
||||
be_complete_nopin_resp(beiscsi_conn, task, psol);
|
||||
} else
|
||||
else
|
||||
be_complete_io(beiscsi_conn, task, psol);
|
||||
break;
|
||||
|
||||
case HWH_TYPE_LOGOUT:
|
||||
be_complete_logout(beiscsi_conn, task, psol);
|
||||
if ((task->hdr->opcode & ISCSI_OPCODE_MASK) == ISCSI_OP_LOGOUT)
|
||||
be_complete_logout(beiscsi_conn, task, psol);
|
||||
else
|
||||
be_complete_tmf(beiscsi_conn, task, psol);
|
||||
|
||||
break;
|
||||
|
||||
case HWH_TYPE_LOGIN:
|
||||
@ -962,10 +1083,6 @@ static void hwi_complete_cmd(struct beiscsi_conn *beiscsi_conn,
|
||||
"- Solicited path \n");
|
||||
break;
|
||||
|
||||
case HWH_TYPE_TMF:
|
||||
be_complete_tmf(beiscsi_conn, task, psol);
|
||||
break;
|
||||
|
||||
case HWH_TYPE_NOP:
|
||||
be_complete_nopin_resp(beiscsi_conn, task, psol);
|
||||
break;
|
||||
@ -2052,7 +2169,7 @@ static void beiscsi_init_wrb_handle(struct beiscsi_hba *phba)
|
||||
num_cxn_wrb = (mem_descr_wrb->mem_array[idx].size) /
|
||||
((sizeof(struct iscsi_wrb) *
|
||||
phba->params.wrbs_per_cxn));
|
||||
for (index = 0; index < phba->params.cxns_per_ctrl; index += 2) {
|
||||
for (index = 0; index < phba->params.cxns_per_ctrl * 2; index += 2) {
|
||||
pwrb_context = &phwi_ctrlr->wrb_context[index];
|
||||
if (num_cxn_wrb) {
|
||||
for (j = 0; j < phba->params.wrbs_per_cxn; j++) {
|
||||
@ -3073,14 +3190,18 @@ static unsigned char hwi_enable_intr(struct beiscsi_hba *phba)
|
||||
reg |= MEMBAR_CTRL_INT_CTRL_HOSTINTR_MASK;
|
||||
SE_DEBUG(DBG_LVL_8, "reg =x%08x addr=%p \n", reg, addr);
|
||||
iowrite32(reg, addr);
|
||||
for (i = 0; i <= phba->num_cpus; i++) {
|
||||
eq = &phwi_context->be_eq[i].q;
|
||||
if (!phba->msix_enabled) {
|
||||
eq = &phwi_context->be_eq[0].q;
|
||||
SE_DEBUG(DBG_LVL_8, "eq->id=%d \n", eq->id);
|
||||
hwi_ring_eq_db(phba, eq->id, 0, 0, 1, 1);
|
||||
} else {
|
||||
for (i = 0; i <= phba->num_cpus; i++) {
|
||||
eq = &phwi_context->be_eq[i].q;
|
||||
SE_DEBUG(DBG_LVL_8, "eq->id=%d \n", eq->id);
|
||||
hwi_ring_eq_db(phba, eq->id, 0, 0, 1, 1);
|
||||
}
|
||||
}
|
||||
} else
|
||||
shost_printk(KERN_WARNING, phba->shost,
|
||||
"In hwi_enable_intr, Not Enabled \n");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -3476,19 +3597,13 @@ static int beiscsi_iotask(struct iscsi_task *task, struct scatterlist *sg,
|
||||
|
||||
static int beiscsi_mtask(struct iscsi_task *task)
|
||||
{
|
||||
struct beiscsi_io_task *aborted_io_task, *io_task = task->dd_data;
|
||||
struct beiscsi_io_task *io_task = task->dd_data;
|
||||
struct iscsi_conn *conn = task->conn;
|
||||
struct beiscsi_conn *beiscsi_conn = conn->dd_data;
|
||||
struct beiscsi_hba *phba = beiscsi_conn->phba;
|
||||
struct iscsi_session *session;
|
||||
struct iscsi_wrb *pwrb = NULL;
|
||||
struct hwi_controller *phwi_ctrlr;
|
||||
struct hwi_wrb_context *pwrb_context;
|
||||
struct wrb_handle *pwrb_handle;
|
||||
unsigned int doorbell = 0;
|
||||
unsigned int i, cid;
|
||||
struct iscsi_task *aborted_task;
|
||||
unsigned int tag;
|
||||
unsigned int cid;
|
||||
|
||||
cid = beiscsi_conn->beiscsi_conn_cid;
|
||||
pwrb = io_task->pwrb_handle->pwrb;
|
||||
@ -3499,6 +3614,7 @@ static int beiscsi_mtask(struct iscsi_task *task)
|
||||
io_task->pwrb_handle->wrb_index);
|
||||
AMAP_SET_BITS(struct amap_iscsi_wrb, sgl_icd_idx, pwrb,
|
||||
io_task->psgl_handle->sgl_index);
|
||||
|
||||
switch (task->hdr->opcode & ISCSI_OPCODE_MASK) {
|
||||
case ISCSI_OP_LOGIN:
|
||||
AMAP_SET_BITS(struct amap_iscsi_wrb, type, pwrb,
|
||||
@ -3523,33 +3639,6 @@ static int beiscsi_mtask(struct iscsi_task *task)
|
||||
hwi_write_buffer(pwrb, task);
|
||||
break;
|
||||
case ISCSI_OP_SCSI_TMFUNC:
|
||||
session = conn->session;
|
||||
i = ((struct iscsi_tm *)task->hdr)->rtt;
|
||||
phwi_ctrlr = phba->phwi_ctrlr;
|
||||
pwrb_context = &phwi_ctrlr->wrb_context[cid -
|
||||
phba->fw_config.iscsi_cid_start];
|
||||
pwrb_handle = pwrb_context->pwrb_handle_basestd[be32_to_cpu(i)
|
||||
>> 16];
|
||||
aborted_task = pwrb_handle->pio_handle;
|
||||
if (!aborted_task)
|
||||
return 0;
|
||||
|
||||
aborted_io_task = aborted_task->dd_data;
|
||||
if (!aborted_io_task->scsi_cmnd)
|
||||
return 0;
|
||||
|
||||
tag = mgmt_invalidate_icds(phba,
|
||||
aborted_io_task->psgl_handle->sgl_index,
|
||||
cid);
|
||||
if (!tag) {
|
||||
shost_printk(KERN_WARNING, phba->shost,
|
||||
"mgmt_invalidate_icds could not be"
|
||||
" submitted\n");
|
||||
} else {
|
||||
wait_event_interruptible(phba->ctrl.mcc_wait[tag],
|
||||
phba->ctrl.mcc_numtag[tag]);
|
||||
free_mcc_tag(&phba->ctrl, tag);
|
||||
}
|
||||
AMAP_SET_BITS(struct amap_iscsi_wrb, type, pwrb,
|
||||
INI_TMF_CMD);
|
||||
AMAP_SET_BITS(struct amap_iscsi_wrb, dmsg, pwrb, 0);
|
||||
@ -3558,7 +3647,7 @@ static int beiscsi_mtask(struct iscsi_task *task)
|
||||
case ISCSI_OP_LOGOUT:
|
||||
AMAP_SET_BITS(struct amap_iscsi_wrb, dmsg, pwrb, 0);
|
||||
AMAP_SET_BITS(struct amap_iscsi_wrb, type, pwrb,
|
||||
HWH_TYPE_LOGOUT);
|
||||
HWH_TYPE_LOGOUT);
|
||||
hwi_write_buffer(pwrb, task);
|
||||
break;
|
||||
|
||||
@ -3584,17 +3673,12 @@ static int beiscsi_mtask(struct iscsi_task *task)
|
||||
|
||||
static int beiscsi_task_xmit(struct iscsi_task *task)
|
||||
{
|
||||
struct iscsi_conn *conn = task->conn;
|
||||
struct beiscsi_io_task *io_task = task->dd_data;
|
||||
struct scsi_cmnd *sc = task->sc;
|
||||
struct beiscsi_conn *beiscsi_conn = conn->dd_data;
|
||||
struct scatterlist *sg;
|
||||
int num_sg;
|
||||
unsigned int writedir = 0, xferlen = 0;
|
||||
|
||||
SE_DEBUG(DBG_LVL_4, "\n cid=%d In beiscsi_task_xmit task=%p conn=%p \t"
|
||||
"beiscsi_conn=%p \n", beiscsi_conn->beiscsi_conn_cid,
|
||||
task, conn, beiscsi_conn);
|
||||
if (!sc)
|
||||
return beiscsi_mtask(task);
|
||||
|
||||
@ -3699,7 +3783,6 @@ static int __devinit beiscsi_dev_probe(struct pci_dev *pcidev,
|
||||
" Failed in beiscsi_hba_alloc \n");
|
||||
goto disable_pci;
|
||||
}
|
||||
SE_DEBUG(DBG_LVL_8, " phba = %p \n", phba);
|
||||
|
||||
switch (pcidev->device) {
|
||||
case BE_DEVICE_ID1:
|
||||
|
@ -257,6 +257,11 @@ struct hba_parameters {
|
||||
unsigned int num_sge;
|
||||
};
|
||||
|
||||
struct invalidate_command_table {
|
||||
unsigned short icd;
|
||||
unsigned short cid;
|
||||
} __packed;
|
||||
|
||||
struct beiscsi_hba {
|
||||
struct hba_parameters params;
|
||||
struct hwi_controller *phwi_ctrlr;
|
||||
@ -329,6 +334,8 @@ struct beiscsi_hba {
|
||||
struct work_struct work_cqs; /* The work being queued */
|
||||
struct be_ctrl_info ctrl;
|
||||
unsigned int generation;
|
||||
struct invalidate_command_table inv_tbl[128];
|
||||
|
||||
};
|
||||
|
||||
struct beiscsi_session {
|
||||
@ -491,8 +498,6 @@ struct hwi_async_entry {
|
||||
struct list_head data_busy_list;
|
||||
};
|
||||
|
||||
#define BE_MIN_ASYNC_ENTRIES 128
|
||||
|
||||
struct hwi_async_pdu_context {
|
||||
struct {
|
||||
struct be_bus_address pa_base;
|
||||
@ -533,7 +538,7 @@ struct hwi_async_pdu_context {
|
||||
* This is a varying size list! Do not add anything
|
||||
* after this entry!!
|
||||
*/
|
||||
struct hwi_async_entry async_entry[BE_MIN_ASYNC_ENTRIES];
|
||||
struct hwi_async_entry async_entry[BE2_MAX_SESSIONS * 2];
|
||||
};
|
||||
|
||||
#define PDUCQE_CODE_MASK 0x0000003F
|
||||
|
@ -145,14 +145,15 @@ unsigned char mgmt_epfw_cleanup(struct beiscsi_hba *phba, unsigned short chute)
|
||||
}
|
||||
|
||||
unsigned char mgmt_invalidate_icds(struct beiscsi_hba *phba,
|
||||
unsigned int icd, unsigned int cid)
|
||||
struct invalidate_command_table *inv_tbl,
|
||||
unsigned int num_invalidate, unsigned int cid)
|
||||
{
|
||||
struct be_dma_mem nonemb_cmd;
|
||||
struct be_ctrl_info *ctrl = &phba->ctrl;
|
||||
struct be_mcc_wrb *wrb;
|
||||
struct be_sge *sge;
|
||||
struct invalidate_commands_params_in *req;
|
||||
unsigned int tag = 0;
|
||||
unsigned int i, tag = 0;
|
||||
|
||||
spin_lock(&ctrl->mbox_lock);
|
||||
tag = alloc_mcc_tag(phba);
|
||||
@ -183,9 +184,12 @@ unsigned char mgmt_invalidate_icds(struct beiscsi_hba *phba,
|
||||
sizeof(*req));
|
||||
req->ref_handle = 0;
|
||||
req->cleanup_type = CMD_ISCSI_COMMAND_INVALIDATE;
|
||||
req->icd_count = 0;
|
||||
req->table[req->icd_count].icd = icd;
|
||||
req->table[req->icd_count].cid = cid;
|
||||
for (i = 0; i < num_invalidate; i++) {
|
||||
req->table[i].icd = inv_tbl->icd;
|
||||
req->table[i].cid = inv_tbl->cid;
|
||||
req->icd_count++;
|
||||
inv_tbl++;
|
||||
}
|
||||
sge->pa_hi = cpu_to_le32(upper_32_bits(nonemb_cmd.dma));
|
||||
sge->pa_lo = cpu_to_le32(nonemb_cmd.dma & 0xFFFFFFFF);
|
||||
sge->len = cpu_to_le32(nonemb_cmd.size);
|
||||
|
@ -94,7 +94,8 @@ unsigned char mgmt_upload_connection(struct beiscsi_hba *phba,
|
||||
unsigned short cid,
|
||||
unsigned int upload_flag);
|
||||
unsigned char mgmt_invalidate_icds(struct beiscsi_hba *phba,
|
||||
unsigned int icd, unsigned int cid);
|
||||
struct invalidate_command_table *inv_tbl,
|
||||
unsigned int num_invalidate, unsigned int cid);
|
||||
|
||||
struct iscsi_invalidate_connection_params_in {
|
||||
struct be_cmd_req_hdr hdr;
|
||||
@ -116,11 +117,6 @@ union iscsi_invalidate_connection_params {
|
||||
struct iscsi_invalidate_connection_params_out response;
|
||||
} __packed;
|
||||
|
||||
struct invalidate_command_table {
|
||||
unsigned short icd;
|
||||
unsigned short cid;
|
||||
} __packed;
|
||||
|
||||
struct invalidate_commands_params_in {
|
||||
struct be_cmd_req_hdr hdr;
|
||||
unsigned int ref_handle;
|
||||
|
@ -2,14 +2,14 @@ obj-$(CONFIG_SCSI_BFA_FC) := bfa.o
|
||||
|
||||
bfa-y := bfad.o bfad_intr.o bfad_os.o bfad_im.o bfad_attr.o bfad_fwimg.o
|
||||
|
||||
bfa-y += bfa_core.o bfa_ioc.o bfa_iocfc.o bfa_fcxp.o bfa_lps.o
|
||||
bfa-y += bfa_hw_cb.o bfa_hw_ct.o bfa_intr.o bfa_timer.o bfa_rport.o
|
||||
bfa-y += bfa_core.o bfa_ioc.o bfa_ioc_ct.o bfa_ioc_cb.o bfa_iocfc.o bfa_fcxp.o
|
||||
bfa-y += bfa_lps.o bfa_hw_cb.o bfa_hw_ct.o bfa_intr.o bfa_timer.o bfa_rport.o
|
||||
bfa-y += bfa_fcport.o bfa_port.o bfa_uf.o bfa_sgpg.o bfa_module.o bfa_ioim.o
|
||||
bfa-y += bfa_itnim.o bfa_fcpim.o bfa_tskim.o bfa_log.o bfa_log_module.o
|
||||
bfa-y += bfa_csdebug.o bfa_sm.o plog.o
|
||||
|
||||
bfa-y += fcbuild.o fabric.o fcpim.o vfapi.o fcptm.o bfa_fcs.o bfa_fcs_port.o
|
||||
bfa-y += fcbuild.o fabric.o fcpim.o vfapi.o fcptm.o bfa_fcs.o bfa_fcs_port.o
|
||||
bfa-y += bfa_fcs_uf.o bfa_fcs_lport.o fab.o fdmi.o ms.o ns.o scn.o loop.o
|
||||
bfa-y += lport_api.o n2n.o rport.o rport_api.o rport_ftrs.o vport.o
|
||||
|
||||
ccflags-y := -I$(obj) -I$(obj)/include -I$(obj)/include/cna
|
||||
ccflags-y := -I$(obj) -I$(obj)/include -I$(obj)/include/cna -DBFA_PERF_BUILD
|
||||
|
@ -384,6 +384,15 @@ bfa_debug_fwsave(struct bfa_s *bfa, void *trcdata, int *trclen)
|
||||
return bfa_ioc_debug_fwsave(&bfa->ioc, trcdata, trclen);
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear the saved firmware trace information of an IOC.
|
||||
*/
|
||||
void
|
||||
bfa_debug_fwsave_clear(struct bfa_s *bfa)
|
||||
{
|
||||
bfa_ioc_debug_fwsave_clear(&bfa->ioc);
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch firmware trace data.
|
||||
*
|
||||
@ -399,4 +408,14 @@ bfa_debug_fwtrc(struct bfa_s *bfa, void *trcdata, int *trclen)
|
||||
{
|
||||
return bfa_ioc_debug_fwtrc(&bfa->ioc, trcdata, trclen);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset hw semaphore & usage cnt regs and initialize.
|
||||
*/
|
||||
void
|
||||
bfa_chip_reset(struct bfa_s *bfa)
|
||||
{
|
||||
bfa_ioc_ownership_reset(&bfa->ioc);
|
||||
bfa_ioc_pll_init(&bfa->ioc);
|
||||
}
|
||||
#endif
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -36,6 +36,7 @@
|
||||
* FCS sub-modules
|
||||
*/
|
||||
struct bfa_fcs_mod_s {
|
||||
void (*attach) (struct bfa_fcs_s *fcs);
|
||||
void (*modinit) (struct bfa_fcs_s *fcs);
|
||||
void (*modexit) (struct bfa_fcs_s *fcs);
|
||||
};
|
||||
@ -43,12 +44,10 @@ struct bfa_fcs_mod_s {
|
||||
#define BFA_FCS_MODULE(_mod) { _mod ## _modinit, _mod ## _modexit }
|
||||
|
||||
static struct bfa_fcs_mod_s fcs_modules[] = {
|
||||
BFA_FCS_MODULE(bfa_fcs_pport),
|
||||
BFA_FCS_MODULE(bfa_fcs_uf),
|
||||
BFA_FCS_MODULE(bfa_fcs_fabric),
|
||||
BFA_FCS_MODULE(bfa_fcs_vport),
|
||||
BFA_FCS_MODULE(bfa_fcs_rport),
|
||||
BFA_FCS_MODULE(bfa_fcs_fcpim),
|
||||
{ bfa_fcs_pport_attach, NULL, NULL },
|
||||
{ bfa_fcs_uf_attach, NULL, NULL },
|
||||
{ bfa_fcs_fabric_attach, bfa_fcs_fabric_modinit,
|
||||
bfa_fcs_fabric_modexit },
|
||||
};
|
||||
|
||||
/**
|
||||
@ -71,16 +70,10 @@ bfa_fcs_exit_comp(void *fcs_cbarg)
|
||||
*/
|
||||
|
||||
/**
|
||||
* FCS instance initialization.
|
||||
*
|
||||
* param[in] fcs FCS instance
|
||||
* param[in] bfa BFA instance
|
||||
* param[in] bfad BFA driver instance
|
||||
*
|
||||
* return None
|
||||
* fcs attach -- called once to initialize data structures at driver attach time
|
||||
*/
|
||||
void
|
||||
bfa_fcs_init(struct bfa_fcs_s *fcs, struct bfa_s *bfa, struct bfad_s *bfad,
|
||||
bfa_fcs_attach(struct bfa_fcs_s *fcs, struct bfa_s *bfa, struct bfad_s *bfad,
|
||||
bfa_boolean_t min_cfg)
|
||||
{
|
||||
int i;
|
||||
@ -95,7 +88,24 @@ bfa_fcs_init(struct bfa_fcs_s *fcs, struct bfa_s *bfa, struct bfad_s *bfad,
|
||||
|
||||
for (i = 0; i < sizeof(fcs_modules) / sizeof(fcs_modules[0]); i++) {
|
||||
mod = &fcs_modules[i];
|
||||
mod->modinit(fcs);
|
||||
if (mod->attach)
|
||||
mod->attach(fcs);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* fcs initialization, called once after bfa initialization is complete
|
||||
*/
|
||||
void
|
||||
bfa_fcs_init(struct bfa_fcs_s *fcs)
|
||||
{
|
||||
int i;
|
||||
struct bfa_fcs_mod_s *mod;
|
||||
|
||||
for (i = 0; i < sizeof(fcs_modules) / sizeof(fcs_modules[0]); i++) {
|
||||
mod = &fcs_modules[i];
|
||||
if (mod->modinit)
|
||||
mod->modinit(fcs);
|
||||
}
|
||||
}
|
||||
|
||||
@ -126,6 +136,23 @@ bfa_fcs_driver_info_init(struct bfa_fcs_s *fcs,
|
||||
bfa_fcs_fabric_psymb_init(&fcs->fabric);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief
|
||||
* FCS FDMI Driver Parameter Initialization
|
||||
*
|
||||
* @param[in] fcs FCS instance
|
||||
* @param[in] fdmi_enable TRUE/FALSE
|
||||
*
|
||||
* @return None
|
||||
*/
|
||||
void
|
||||
bfa_fcs_set_fdmi_param(struct bfa_fcs_s *fcs, bfa_boolean_t fdmi_enable)
|
||||
{
|
||||
|
||||
fcs->fdmi_enabled = fdmi_enable;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* FCS instance cleanup and exit.
|
||||
*
|
||||
@ -143,10 +170,12 @@ bfa_fcs_exit(struct bfa_fcs_s *fcs)
|
||||
nmods = sizeof(fcs_modules) / sizeof(fcs_modules[0]);
|
||||
|
||||
for (i = 0; i < nmods; i++) {
|
||||
bfa_wc_up(&fcs->wc);
|
||||
|
||||
mod = &fcs_modules[i];
|
||||
mod->modexit(fcs);
|
||||
if (mod->modexit) {
|
||||
bfa_wc_up(&fcs->wc);
|
||||
mod->modexit(fcs);
|
||||
}
|
||||
}
|
||||
|
||||
bfa_wc_wait(&fcs->wc);
|
||||
|
@ -114,7 +114,7 @@ bfa_fcs_port_sm_uninit(struct bfa_fcs_port_s *port,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(port->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -136,7 +136,7 @@ bfa_fcs_port_sm_init(struct bfa_fcs_port_s *port, enum bfa_fcs_port_event event)
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(port->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -176,7 +176,7 @@ bfa_fcs_port_sm_online(struct bfa_fcs_port_s *port,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(port->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -214,7 +214,7 @@ bfa_fcs_port_sm_offline(struct bfa_fcs_port_s *port,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(port->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -234,7 +234,7 @@ bfa_fcs_port_sm_deleting(struct bfa_fcs_port_s *port,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(port->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -263,30 +263,8 @@ bfa_fcs_port_aen_post(struct bfa_fcs_port_s *port,
|
||||
|
||||
bfa_assert(role <= BFA_PORT_ROLE_FCP_MAX);
|
||||
|
||||
switch (event) {
|
||||
case BFA_LPORT_AEN_ONLINE:
|
||||
bfa_log(logmod, BFA_AEN_LPORT_ONLINE, lpwwn_ptr,
|
||||
role_str[role / 2]);
|
||||
break;
|
||||
case BFA_LPORT_AEN_OFFLINE:
|
||||
bfa_log(logmod, BFA_AEN_LPORT_OFFLINE, lpwwn_ptr,
|
||||
role_str[role / 2]);
|
||||
break;
|
||||
case BFA_LPORT_AEN_NEW:
|
||||
bfa_log(logmod, BFA_AEN_LPORT_NEW, lpwwn_ptr,
|
||||
role_str[role / 2]);
|
||||
break;
|
||||
case BFA_LPORT_AEN_DELETE:
|
||||
bfa_log(logmod, BFA_AEN_LPORT_DELETE, lpwwn_ptr,
|
||||
role_str[role / 2]);
|
||||
break;
|
||||
case BFA_LPORT_AEN_DISCONNECT:
|
||||
bfa_log(logmod, BFA_AEN_LPORT_DISCONNECT, lpwwn_ptr,
|
||||
role_str[role / 2]);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
bfa_log(logmod, BFA_LOG_CREATE_ID(BFA_AEN_CAT_LPORT, event), lpwwn_ptr,
|
||||
role_str[role/2]);
|
||||
|
||||
aen_data.lport.vf_id = port->fabric->vf_id;
|
||||
aen_data.lport.roles = role;
|
||||
@ -873,36 +851,46 @@ bfa_fcs_port_is_online(struct bfa_fcs_port_s *port)
|
||||
}
|
||||
|
||||
/**
|
||||
* Logical port initialization of base or virtual port.
|
||||
* Called by fabric for base port or by vport for virtual ports.
|
||||
* Attach time initialization of logical ports.
|
||||
*/
|
||||
void
|
||||
bfa_fcs_lport_init(struct bfa_fcs_port_s *lport, struct bfa_fcs_s *fcs,
|
||||
u16 vf_id, struct bfa_port_cfg_s *port_cfg,
|
||||
struct bfa_fcs_vport_s *vport)
|
||||
bfa_fcs_lport_attach(struct bfa_fcs_port_s *lport, struct bfa_fcs_s *fcs,
|
||||
uint16_t vf_id, struct bfa_fcs_vport_s *vport)
|
||||
{
|
||||
lport->fcs = fcs;
|
||||
lport->fabric = bfa_fcs_vf_lookup(fcs, vf_id);
|
||||
bfa_os_assign(lport->port_cfg, *port_cfg);
|
||||
lport->vport = vport;
|
||||
lport->lp_tag = (vport) ? bfa_lps_get_tag(vport->lps) :
|
||||
bfa_lps_get_tag(lport->fabric->lps);
|
||||
|
||||
INIT_LIST_HEAD(&lport->rport_q);
|
||||
lport->num_rports = 0;
|
||||
}
|
||||
|
||||
lport->bfad_port =
|
||||
bfa_fcb_port_new(fcs->bfad, lport, lport->port_cfg.roles,
|
||||
/**
|
||||
* Logical port initialization of base or virtual port.
|
||||
* Called by fabric for base port or by vport for virtual ports.
|
||||
*/
|
||||
|
||||
void
|
||||
bfa_fcs_lport_init(struct bfa_fcs_port_s *lport,
|
||||
struct bfa_port_cfg_s *port_cfg)
|
||||
{
|
||||
struct bfa_fcs_vport_s *vport = lport->vport;
|
||||
|
||||
bfa_os_assign(lport->port_cfg, *port_cfg);
|
||||
|
||||
lport->bfad_port = bfa_fcb_port_new(lport->fcs->bfad, lport,
|
||||
lport->port_cfg.roles,
|
||||
lport->fabric->vf_drv,
|
||||
vport ? vport->vport_drv : NULL);
|
||||
|
||||
bfa_fcs_port_aen_post(lport, BFA_LPORT_AEN_NEW);
|
||||
|
||||
bfa_sm_set_state(lport, bfa_fcs_port_sm_uninit);
|
||||
bfa_sm_send_event(lport, BFA_FCS_PORT_SM_CREATE);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* fcs_lport_api
|
||||
*/
|
||||
@ -921,13 +909,20 @@ bfa_fcs_port_get_attr(struct bfa_fcs_port_s *port,
|
||||
if (port->fabric) {
|
||||
port_attr->port_type = bfa_fcs_fabric_port_type(port->fabric);
|
||||
port_attr->loopback = bfa_fcs_fabric_is_loopback(port->fabric);
|
||||
port_attr->authfail =
|
||||
bfa_fcs_fabric_is_auth_failed(port->fabric);
|
||||
port_attr->fabric_name = bfa_fcs_port_get_fabric_name(port);
|
||||
memcpy(port_attr->fabric_ip_addr,
|
||||
bfa_fcs_port_get_fabric_ipaddr(port),
|
||||
BFA_FCS_FABRIC_IPADDR_SZ);
|
||||
|
||||
if (port->vport != NULL)
|
||||
if (port->vport != NULL) {
|
||||
port_attr->port_type = BFA_PPORT_TYPE_VPORT;
|
||||
port_attr->fpma_mac =
|
||||
bfa_lps_get_lp_mac(port->vport->lps);
|
||||
} else
|
||||
port_attr->fpma_mac =
|
||||
bfa_lps_get_lp_mac(port->fabric->lps);
|
||||
|
||||
} else {
|
||||
port_attr->port_type = BFA_PPORT_TYPE_UNKNOWN;
|
||||
|
@ -55,14 +55,7 @@ bfa_fcs_pport_event_handler(void *cbarg, bfa_pport_event_t event)
|
||||
}
|
||||
|
||||
void
|
||||
bfa_fcs_pport_modinit(struct bfa_fcs_s *fcs)
|
||||
bfa_fcs_pport_attach(struct bfa_fcs_s *fcs)
|
||||
{
|
||||
bfa_pport_event_register(fcs->bfa, bfa_fcs_pport_event_handler,
|
||||
fcs);
|
||||
}
|
||||
|
||||
void
|
||||
bfa_fcs_pport_modexit(struct bfa_fcs_s *fcs)
|
||||
{
|
||||
bfa_fcs_modexit_comp(fcs);
|
||||
bfa_fcport_event_register(fcs->bfa, bfa_fcs_pport_event_handler, fcs);
|
||||
}
|
||||
|
@ -93,13 +93,7 @@ bfa_fcs_uf_recv(void *cbarg, struct bfa_uf_s *uf)
|
||||
}
|
||||
|
||||
void
|
||||
bfa_fcs_uf_modinit(struct bfa_fcs_s *fcs)
|
||||
bfa_fcs_uf_attach(struct bfa_fcs_s *fcs)
|
||||
{
|
||||
bfa_uf_recv_register(fcs->bfa, bfa_fcs_uf_recv, fcs);
|
||||
}
|
||||
|
||||
void
|
||||
bfa_fcs_uf_modexit(struct bfa_fcs_s *fcs)
|
||||
{
|
||||
bfa_fcs_modexit_comp(fcs);
|
||||
}
|
||||
|
@ -52,6 +52,18 @@ bfa_hwcb_reginit(struct bfa_s *bfa)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
bfa_hwcb_reqq_ack(struct bfa_s *bfa, int reqq)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
bfa_hwcb_reqq_ack_msix(struct bfa_s *bfa, int reqq)
|
||||
{
|
||||
bfa_reg_write(bfa->iocfc.bfa_regs.intr_status,
|
||||
__HFN_INT_CPE_Q0 << CPE_Q_NUM(bfa_ioc_pcifn(&bfa->ioc), reqq));
|
||||
}
|
||||
|
||||
void
|
||||
bfa_hwcb_rspq_ack(struct bfa_s *bfa, int rspq)
|
||||
{
|
||||
@ -136,6 +148,7 @@ bfa_hwcb_msix_uninstall(struct bfa_s *bfa)
|
||||
void
|
||||
bfa_hwcb_isr_mode_set(struct bfa_s *bfa, bfa_boolean_t msix)
|
||||
{
|
||||
bfa->iocfc.hwif.hw_reqq_ack = bfa_hwcb_reqq_ack_msix;
|
||||
bfa->iocfc.hwif.hw_rspq_ack = bfa_hwcb_rspq_ack_msix;
|
||||
}
|
||||
|
||||
|
@ -84,6 +84,15 @@ bfa_hwct_reginit(struct bfa_s *bfa)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
bfa_hwct_reqq_ack(struct bfa_s *bfa, int reqq)
|
||||
{
|
||||
u32 r32;
|
||||
|
||||
r32 = bfa_reg_read(bfa->iocfc.bfa_regs.cpe_q_ctrl[reqq]);
|
||||
bfa_reg_write(bfa->iocfc.bfa_regs.cpe_q_ctrl[reqq], r32);
|
||||
}
|
||||
|
||||
void
|
||||
bfa_hwct_rspq_ack(struct bfa_s *bfa, int rspq)
|
||||
{
|
||||
|
@ -15,7 +15,7 @@
|
||||
* General Public License for more details.
|
||||
*/
|
||||
#include <bfa.h>
|
||||
#include <bfi/bfi_cbreg.h>
|
||||
#include <bfi/bfi_ctreg.h>
|
||||
#include <bfa_port_priv.h>
|
||||
#include <bfa_intr_priv.h>
|
||||
#include <cs/bfa_debug.h>
|
||||
@ -34,6 +34,26 @@ bfa_msix_lpu(struct bfa_s *bfa)
|
||||
bfa_ioc_mbox_isr(&bfa->ioc);
|
||||
}
|
||||
|
||||
static void
|
||||
bfa_reqq_resume(struct bfa_s *bfa, int qid)
|
||||
{
|
||||
struct list_head *waitq, *qe, *qen;
|
||||
struct bfa_reqq_wait_s *wqe;
|
||||
|
||||
waitq = bfa_reqq(bfa, qid);
|
||||
list_for_each_safe(qe, qen, waitq) {
|
||||
/**
|
||||
* Callback only as long as there is room in request queue
|
||||
*/
|
||||
if (bfa_reqq_full(bfa, qid))
|
||||
break;
|
||||
|
||||
list_del(qe);
|
||||
wqe = (struct bfa_reqq_wait_s *) qe;
|
||||
wqe->qresume(wqe->cbarg);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
bfa_msix_all(struct bfa_s *bfa, int vec)
|
||||
{
|
||||
@ -96,7 +116,8 @@ bfa_isr_enable(struct bfa_s *bfa)
|
||||
|
||||
bfa_msix_install(bfa);
|
||||
intr_unmask = (__HFN_INT_ERR_EMC | __HFN_INT_ERR_LPU0 |
|
||||
__HFN_INT_ERR_LPU1 | __HFN_INT_ERR_PSS);
|
||||
__HFN_INT_ERR_LPU1 | __HFN_INT_ERR_PSS |
|
||||
__HFN_INT_LL_HALT);
|
||||
|
||||
if (pci_func == 0)
|
||||
intr_unmask |= (__HFN_INT_CPE_Q0 | __HFN_INT_CPE_Q1 |
|
||||
@ -127,23 +148,18 @@ bfa_isr_disable(struct bfa_s *bfa)
|
||||
void
|
||||
bfa_msix_reqq(struct bfa_s *bfa, int qid)
|
||||
{
|
||||
struct list_head *waitq, *qe, *qen;
|
||||
struct bfa_reqq_wait_s *wqe;
|
||||
struct list_head *waitq;
|
||||
|
||||
qid &= (BFI_IOC_MAX_CQS - 1);
|
||||
|
||||
waitq = bfa_reqq(bfa, qid);
|
||||
list_for_each_safe(qe, qen, waitq) {
|
||||
/**
|
||||
* Callback only as long as there is room in request queue
|
||||
*/
|
||||
if (bfa_reqq_full(bfa, qid))
|
||||
break;
|
||||
bfa->iocfc.hwif.hw_reqq_ack(bfa, qid);
|
||||
|
||||
list_del(qe);
|
||||
wqe = (struct bfa_reqq_wait_s *) qe;
|
||||
wqe->qresume(wqe->cbarg);
|
||||
}
|
||||
/**
|
||||
* Resume any pending requests in the corresponding reqq.
|
||||
*/
|
||||
waitq = bfa_reqq(bfa, qid);
|
||||
if (!list_empty(waitq))
|
||||
bfa_reqq_resume(bfa, qid);
|
||||
}
|
||||
|
||||
void
|
||||
@ -157,26 +173,27 @@ bfa_isr_unhandled(struct bfa_s *bfa, struct bfi_msg_s *m)
|
||||
}
|
||||
|
||||
void
|
||||
bfa_msix_rspq(struct bfa_s *bfa, int rsp_qid)
|
||||
bfa_msix_rspq(struct bfa_s *bfa, int qid)
|
||||
{
|
||||
struct bfi_msg_s *m;
|
||||
u32 pi, ci;
|
||||
struct bfi_msg_s *m;
|
||||
u32 pi, ci;
|
||||
struct list_head *waitq;
|
||||
|
||||
bfa_trc_fp(bfa, rsp_qid);
|
||||
bfa_trc_fp(bfa, qid);
|
||||
|
||||
rsp_qid &= (BFI_IOC_MAX_CQS - 1);
|
||||
qid &= (BFI_IOC_MAX_CQS - 1);
|
||||
|
||||
bfa->iocfc.hwif.hw_rspq_ack(bfa, rsp_qid);
|
||||
bfa->iocfc.hwif.hw_rspq_ack(bfa, qid);
|
||||
|
||||
ci = bfa_rspq_ci(bfa, rsp_qid);
|
||||
pi = bfa_rspq_pi(bfa, rsp_qid);
|
||||
ci = bfa_rspq_ci(bfa, qid);
|
||||
pi = bfa_rspq_pi(bfa, qid);
|
||||
|
||||
bfa_trc_fp(bfa, ci);
|
||||
bfa_trc_fp(bfa, pi);
|
||||
|
||||
if (bfa->rme_process) {
|
||||
while (ci != pi) {
|
||||
m = bfa_rspq_elem(bfa, rsp_qid, ci);
|
||||
m = bfa_rspq_elem(bfa, qid, ci);
|
||||
bfa_assert_fp(m->mhdr.msg_class < BFI_MC_MAX);
|
||||
|
||||
bfa_isrs[m->mhdr.msg_class] (bfa, m);
|
||||
@ -188,25 +205,59 @@ bfa_msix_rspq(struct bfa_s *bfa, int rsp_qid)
|
||||
/**
|
||||
* update CI
|
||||
*/
|
||||
bfa_rspq_ci(bfa, rsp_qid) = pi;
|
||||
bfa_reg_write(bfa->iocfc.bfa_regs.rme_q_ci[rsp_qid], pi);
|
||||
bfa_rspq_ci(bfa, qid) = pi;
|
||||
bfa_reg_write(bfa->iocfc.bfa_regs.rme_q_ci[qid], pi);
|
||||
bfa_os_mmiowb();
|
||||
|
||||
/**
|
||||
* Resume any pending requests in the corresponding reqq.
|
||||
*/
|
||||
waitq = bfa_reqq(bfa, qid);
|
||||
if (!list_empty(waitq))
|
||||
bfa_reqq_resume(bfa, qid);
|
||||
}
|
||||
|
||||
void
|
||||
bfa_msix_lpu_err(struct bfa_s *bfa, int vec)
|
||||
{
|
||||
u32 intr;
|
||||
u32 intr, curr_value;
|
||||
|
||||
intr = bfa_reg_read(bfa->iocfc.bfa_regs.intr_status);
|
||||
|
||||
if (intr & (__HFN_INT_MBOX_LPU0 | __HFN_INT_MBOX_LPU1))
|
||||
bfa_msix_lpu(bfa);
|
||||
|
||||
if (intr & (__HFN_INT_ERR_EMC |
|
||||
__HFN_INT_ERR_LPU0 | __HFN_INT_ERR_LPU1 |
|
||||
__HFN_INT_ERR_PSS))
|
||||
intr &= (__HFN_INT_ERR_EMC | __HFN_INT_ERR_LPU0 |
|
||||
__HFN_INT_ERR_LPU1 | __HFN_INT_ERR_PSS | __HFN_INT_LL_HALT);
|
||||
|
||||
if (intr) {
|
||||
if (intr & __HFN_INT_LL_HALT) {
|
||||
/**
|
||||
* If LL_HALT bit is set then FW Init Halt LL Port
|
||||
* Register needs to be cleared as well so Interrupt
|
||||
* Status Register will be cleared.
|
||||
*/
|
||||
curr_value = bfa_reg_read(bfa->ioc.ioc_regs.ll_halt);
|
||||
curr_value &= ~__FW_INIT_HALT_P;
|
||||
bfa_reg_write(bfa->ioc.ioc_regs.ll_halt, curr_value);
|
||||
}
|
||||
|
||||
if (intr & __HFN_INT_ERR_PSS) {
|
||||
/**
|
||||
* ERR_PSS bit needs to be cleared as well in case
|
||||
* interrups are shared so driver's interrupt handler is
|
||||
* still called eventhough it is already masked out.
|
||||
*/
|
||||
curr_value = bfa_reg_read(
|
||||
bfa->ioc.ioc_regs.pss_err_status_reg);
|
||||
curr_value &= __PSS_ERR_STATUS_SET;
|
||||
bfa_reg_write(bfa->ioc.ioc_regs.pss_err_status_reg,
|
||||
curr_value);
|
||||
}
|
||||
|
||||
bfa_reg_write(bfa->iocfc.bfa_regs.intr_status, intr);
|
||||
bfa_msix_errint(bfa, intr);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -74,15 +74,18 @@ struct bfa_ioc_regs_s {
|
||||
bfa_os_addr_t lpu_mbox_cmd;
|
||||
bfa_os_addr_t lpu_mbox;
|
||||
bfa_os_addr_t pss_ctl_reg;
|
||||
bfa_os_addr_t pss_err_status_reg;
|
||||
bfa_os_addr_t app_pll_fast_ctl_reg;
|
||||
bfa_os_addr_t app_pll_slow_ctl_reg;
|
||||
bfa_os_addr_t ioc_sem_reg;
|
||||
bfa_os_addr_t ioc_usage_sem_reg;
|
||||
bfa_os_addr_t ioc_init_sem_reg;
|
||||
bfa_os_addr_t ioc_usage_reg;
|
||||
bfa_os_addr_t host_page_num_fn;
|
||||
bfa_os_addr_t heartbeat;
|
||||
bfa_os_addr_t ioc_fwstate;
|
||||
bfa_os_addr_t ll_halt;
|
||||
bfa_os_addr_t err_set;
|
||||
bfa_os_addr_t shirq_isr_next;
|
||||
bfa_os_addr_t shirq_msk_next;
|
||||
bfa_os_addr_t smem_page_start;
|
||||
@ -154,7 +157,6 @@ struct bfa_ioc_s {
|
||||
struct bfa_timer_s ioc_timer;
|
||||
struct bfa_timer_s sem_timer;
|
||||
u32 hb_count;
|
||||
u32 hb_fail;
|
||||
u32 retry_count;
|
||||
struct list_head hb_notify_q;
|
||||
void *dbg_fwsave;
|
||||
@ -177,6 +179,22 @@ struct bfa_ioc_s {
|
||||
struct bfi_ioc_attr_s *attr;
|
||||
struct bfa_ioc_cbfn_s *cbfn;
|
||||
struct bfa_ioc_mbox_mod_s mbox_mod;
|
||||
struct bfa_ioc_hwif_s *ioc_hwif;
|
||||
};
|
||||
|
||||
struct bfa_ioc_hwif_s {
|
||||
bfa_status_t (*ioc_pll_init) (struct bfa_ioc_s *ioc);
|
||||
bfa_boolean_t (*ioc_firmware_lock) (struct bfa_ioc_s *ioc);
|
||||
void (*ioc_firmware_unlock) (struct bfa_ioc_s *ioc);
|
||||
u32 * (*ioc_fwimg_get_chunk) (struct bfa_ioc_s *ioc,
|
||||
u32 off);
|
||||
u32 (*ioc_fwimg_get_size) (struct bfa_ioc_s *ioc);
|
||||
void (*ioc_reg_init) (struct bfa_ioc_s *ioc);
|
||||
void (*ioc_map_port) (struct bfa_ioc_s *ioc);
|
||||
void (*ioc_isr_mode_set) (struct bfa_ioc_s *ioc,
|
||||
bfa_boolean_t msix);
|
||||
void (*ioc_notify_hbfail) (struct bfa_ioc_s *ioc);
|
||||
void (*ioc_ownership_reset) (struct bfa_ioc_s *ioc);
|
||||
};
|
||||
|
||||
#define bfa_ioc_pcifn(__ioc) ((__ioc)->pcidev.pci_func)
|
||||
@ -191,6 +209,15 @@ struct bfa_ioc_s {
|
||||
#define bfa_ioc_rx_bbcredit(__ioc) ((__ioc)->attr->rx_bbcredit)
|
||||
#define bfa_ioc_speed_sup(__ioc) \
|
||||
BFI_ADAPTER_GETP(SPEED, (__ioc)->attr->adapter_prop)
|
||||
#define bfa_ioc_get_nports(__ioc) \
|
||||
BFI_ADAPTER_GETP(NPORTS, (__ioc)->attr->adapter_prop)
|
||||
|
||||
#define bfa_ioc_stats(_ioc, _stats) ((_ioc)->stats._stats++)
|
||||
#define BFA_IOC_FWIMG_MINSZ (16 * 1024)
|
||||
|
||||
#define BFA_IOC_FLASH_CHUNK_NO(off) (off / BFI_FLASH_CHUNK_SZ_WORDS)
|
||||
#define BFA_IOC_FLASH_OFFSET_IN_CHUNK(off) (off % BFI_FLASH_CHUNK_SZ_WORDS)
|
||||
#define BFA_IOC_FLASH_CHUNK_ADDR(chunkno) (chunkno * BFI_FLASH_CHUNK_SZ_WORDS)
|
||||
|
||||
/**
|
||||
* IOC mailbox interface
|
||||
@ -207,6 +234,14 @@ void bfa_ioc_mbox_regisr(struct bfa_ioc_s *ioc, enum bfi_mclass mc,
|
||||
/**
|
||||
* IOC interfaces
|
||||
*/
|
||||
#define bfa_ioc_pll_init(__ioc) ((__ioc)->ioc_hwif->ioc_pll_init(__ioc))
|
||||
#define bfa_ioc_isr_mode_set(__ioc, __msix) \
|
||||
((__ioc)->ioc_hwif->ioc_isr_mode_set(__ioc, __msix))
|
||||
#define bfa_ioc_ownership_reset(__ioc) \
|
||||
((__ioc)->ioc_hwif->ioc_ownership_reset(__ioc))
|
||||
|
||||
void bfa_ioc_set_ct_hwif(struct bfa_ioc_s *ioc);
|
||||
void bfa_ioc_set_cb_hwif(struct bfa_ioc_s *ioc);
|
||||
void bfa_ioc_attach(struct bfa_ioc_s *ioc, void *bfa,
|
||||
struct bfa_ioc_cbfn_s *cbfn, struct bfa_timer_mod_s *timer_mod,
|
||||
struct bfa_trc_mod_s *trcmod,
|
||||
@ -223,13 +258,21 @@ bfa_boolean_t bfa_ioc_intx_claim(struct bfa_ioc_s *ioc);
|
||||
void bfa_ioc_boot(struct bfa_ioc_s *ioc, u32 boot_type, u32 boot_param);
|
||||
void bfa_ioc_isr(struct bfa_ioc_s *ioc, struct bfi_mbmsg_s *msg);
|
||||
void bfa_ioc_error_isr(struct bfa_ioc_s *ioc);
|
||||
void bfa_ioc_isr_mode_set(struct bfa_ioc_s *ioc, bfa_boolean_t intx);
|
||||
bfa_status_t bfa_ioc_pll_init(struct bfa_ioc_s *ioc);
|
||||
bfa_boolean_t bfa_ioc_is_operational(struct bfa_ioc_s *ioc);
|
||||
bfa_boolean_t bfa_ioc_is_disabled(struct bfa_ioc_s *ioc);
|
||||
bfa_boolean_t bfa_ioc_fw_mismatch(struct bfa_ioc_s *ioc);
|
||||
bfa_boolean_t bfa_ioc_adapter_is_disabled(struct bfa_ioc_s *ioc);
|
||||
void bfa_ioc_cfg_complete(struct bfa_ioc_s *ioc);
|
||||
enum bfa_ioc_type_e bfa_ioc_get_type(struct bfa_ioc_s *ioc);
|
||||
void bfa_ioc_get_adapter_serial_num(struct bfa_ioc_s *ioc, char *serial_num);
|
||||
void bfa_ioc_get_adapter_fw_ver(struct bfa_ioc_s *ioc, char *fw_ver);
|
||||
void bfa_ioc_get_adapter_optrom_ver(struct bfa_ioc_s *ioc, char *optrom_ver);
|
||||
void bfa_ioc_get_adapter_model(struct bfa_ioc_s *ioc, char *model);
|
||||
void bfa_ioc_get_adapter_manufacturer(struct bfa_ioc_s *ioc,
|
||||
char *manufacturer);
|
||||
void bfa_ioc_get_pci_chip_rev(struct bfa_ioc_s *ioc, char *chip_rev);
|
||||
enum bfa_ioc_state bfa_ioc_get_state(struct bfa_ioc_s *ioc);
|
||||
|
||||
void bfa_ioc_get_attr(struct bfa_ioc_s *ioc, struct bfa_ioc_attr_s *ioc_attr);
|
||||
void bfa_ioc_get_adapter_attr(struct bfa_ioc_s *ioc,
|
||||
struct bfa_adapter_attr_s *ad_attr);
|
||||
@ -237,6 +280,7 @@ int bfa_ioc_debug_trcsz(bfa_boolean_t auto_recover);
|
||||
void bfa_ioc_debug_memclaim(struct bfa_ioc_s *ioc, void *dbg_fwsave);
|
||||
bfa_status_t bfa_ioc_debug_fwsave(struct bfa_ioc_s *ioc, void *trcdata,
|
||||
int *trclen);
|
||||
void bfa_ioc_debug_fwsave_clear(struct bfa_ioc_s *ioc);
|
||||
bfa_status_t bfa_ioc_debug_fwtrc(struct bfa_ioc_s *ioc, void *trcdata,
|
||||
int *trclen);
|
||||
u32 bfa_ioc_smem_pgnum(struct bfa_ioc_s *ioc, u32 fmaddr);
|
||||
@ -245,6 +289,13 @@ void bfa_ioc_set_fcmode(struct bfa_ioc_s *ioc);
|
||||
bfa_boolean_t bfa_ioc_get_fcmode(struct bfa_ioc_s *ioc);
|
||||
void bfa_ioc_hbfail_register(struct bfa_ioc_s *ioc,
|
||||
struct bfa_ioc_hbfail_notify_s *notify);
|
||||
bfa_boolean_t bfa_ioc_sem_get(bfa_os_addr_t sem_reg);
|
||||
void bfa_ioc_sem_release(bfa_os_addr_t sem_reg);
|
||||
void bfa_ioc_hw_sem_release(struct bfa_ioc_s *ioc);
|
||||
void bfa_ioc_fwver_get(struct bfa_ioc_s *ioc,
|
||||
struct bfi_ioc_image_hdr_s *fwhdr);
|
||||
bfa_boolean_t bfa_ioc_fwver_cmp(struct bfa_ioc_s *ioc,
|
||||
struct bfi_ioc_image_hdr_s *fwhdr);
|
||||
|
||||
/*
|
||||
* bfa mfg wwn API functions
|
||||
|
274
drivers/scsi/bfa/bfa_ioc_cb.c
Normal file
274
drivers/scsi/bfa/bfa_ioc_cb.c
Normal file
@ -0,0 +1,274 @@
|
||||
/*
|
||||
* 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_ioc.h>
|
||||
#include <bfa_fwimg_priv.h>
|
||||
#include <cna/bfa_cna_trcmod.h>
|
||||
#include <cs/bfa_debug.h>
|
||||
#include <bfi/bfi_ioc.h>
|
||||
#include <bfi/bfi_cbreg.h>
|
||||
#include <log/bfa_log_hal.h>
|
||||
#include <defs/bfa_defs_pci.h>
|
||||
|
||||
BFA_TRC_FILE(CNA, IOC_CB);
|
||||
|
||||
/*
|
||||
* forward declarations
|
||||
*/
|
||||
static bfa_status_t bfa_ioc_cb_pll_init(struct bfa_ioc_s *ioc);
|
||||
static bfa_boolean_t bfa_ioc_cb_firmware_lock(struct bfa_ioc_s *ioc);
|
||||
static void bfa_ioc_cb_firmware_unlock(struct bfa_ioc_s *ioc);
|
||||
static u32 *bfa_ioc_cb_fwimg_get_chunk(struct bfa_ioc_s *ioc, u32 off);
|
||||
static u32 bfa_ioc_cb_fwimg_get_size(struct bfa_ioc_s *ioc);
|
||||
static void bfa_ioc_cb_reg_init(struct bfa_ioc_s *ioc);
|
||||
static void bfa_ioc_cb_map_port(struct bfa_ioc_s *ioc);
|
||||
static void bfa_ioc_cb_isr_mode_set(struct bfa_ioc_s *ioc, bfa_boolean_t msix);
|
||||
static void bfa_ioc_cb_notify_hbfail(struct bfa_ioc_s *ioc);
|
||||
static void bfa_ioc_cb_ownership_reset(struct bfa_ioc_s *ioc);
|
||||
|
||||
struct bfa_ioc_hwif_s hwif_cb = {
|
||||
bfa_ioc_cb_pll_init,
|
||||
bfa_ioc_cb_firmware_lock,
|
||||
bfa_ioc_cb_firmware_unlock,
|
||||
bfa_ioc_cb_fwimg_get_chunk,
|
||||
bfa_ioc_cb_fwimg_get_size,
|
||||
bfa_ioc_cb_reg_init,
|
||||
bfa_ioc_cb_map_port,
|
||||
bfa_ioc_cb_isr_mode_set,
|
||||
bfa_ioc_cb_notify_hbfail,
|
||||
bfa_ioc_cb_ownership_reset,
|
||||
};
|
||||
|
||||
/**
|
||||
* Called from bfa_ioc_attach() to map asic specific calls.
|
||||
*/
|
||||
void
|
||||
bfa_ioc_set_cb_hwif(struct bfa_ioc_s *ioc)
|
||||
{
|
||||
ioc->ioc_hwif = &hwif_cb;
|
||||
}
|
||||
|
||||
static u32 *
|
||||
bfa_ioc_cb_fwimg_get_chunk(struct bfa_ioc_s *ioc, u32 off)
|
||||
{
|
||||
return bfi_image_cb_get_chunk(off);
|
||||
}
|
||||
|
||||
static u32
|
||||
bfa_ioc_cb_fwimg_get_size(struct bfa_ioc_s *ioc)
|
||||
{
|
||||
return bfi_image_cb_size;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if firmware of current driver matches the running firmware.
|
||||
*/
|
||||
static bfa_boolean_t
|
||||
bfa_ioc_cb_firmware_lock(struct bfa_ioc_s *ioc)
|
||||
{
|
||||
return BFA_TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
bfa_ioc_cb_firmware_unlock(struct bfa_ioc_s *ioc)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Notify other functions on HB failure.
|
||||
*/
|
||||
static void
|
||||
bfa_ioc_cb_notify_hbfail(struct bfa_ioc_s *ioc)
|
||||
{
|
||||
bfa_reg_write(ioc->ioc_regs.err_set, __PSS_ERR_STATUS_SET);
|
||||
bfa_reg_read(ioc->ioc_regs.err_set);
|
||||
}
|
||||
|
||||
/**
|
||||
* Host to LPU mailbox message addresses
|
||||
*/
|
||||
static struct { u32 hfn_mbox, lpu_mbox, hfn_pgn; } iocreg_fnreg[] = {
|
||||
{ HOSTFN0_LPU_MBOX0_0, LPU_HOSTFN0_MBOX0_0, HOST_PAGE_NUM_FN0 },
|
||||
{ HOSTFN1_LPU_MBOX0_8, LPU_HOSTFN1_MBOX0_8, HOST_PAGE_NUM_FN1 }
|
||||
};
|
||||
|
||||
/**
|
||||
* Host <-> LPU mailbox command/status registers
|
||||
*/
|
||||
static struct { u32 hfn, lpu; } iocreg_mbcmd[] = {
|
||||
{ HOSTFN0_LPU0_CMD_STAT, LPU0_HOSTFN0_CMD_STAT },
|
||||
{ HOSTFN1_LPU1_CMD_STAT, LPU1_HOSTFN1_CMD_STAT }
|
||||
};
|
||||
|
||||
static void
|
||||
bfa_ioc_cb_reg_init(struct bfa_ioc_s *ioc)
|
||||
{
|
||||
bfa_os_addr_t rb;
|
||||
int pcifn = bfa_ioc_pcifn(ioc);
|
||||
|
||||
rb = bfa_ioc_bar0(ioc);
|
||||
|
||||
ioc->ioc_regs.hfn_mbox = rb + iocreg_fnreg[pcifn].hfn_mbox;
|
||||
ioc->ioc_regs.lpu_mbox = rb + iocreg_fnreg[pcifn].lpu_mbox;
|
||||
ioc->ioc_regs.host_page_num_fn = rb + iocreg_fnreg[pcifn].hfn_pgn;
|
||||
|
||||
if (ioc->port_id == 0) {
|
||||
ioc->ioc_regs.heartbeat = rb + BFA_IOC0_HBEAT_REG;
|
||||
ioc->ioc_regs.ioc_fwstate = rb + BFA_IOC0_STATE_REG;
|
||||
} else {
|
||||
ioc->ioc_regs.heartbeat = (rb + BFA_IOC1_HBEAT_REG);
|
||||
ioc->ioc_regs.ioc_fwstate = (rb + BFA_IOC1_STATE_REG);
|
||||
}
|
||||
|
||||
/**
|
||||
* Host <-> LPU mailbox command/status registers
|
||||
*/
|
||||
ioc->ioc_regs.hfn_mbox_cmd = rb + iocreg_mbcmd[pcifn].hfn;
|
||||
ioc->ioc_regs.lpu_mbox_cmd = rb + iocreg_mbcmd[pcifn].lpu;
|
||||
|
||||
/*
|
||||
* PSS control registers
|
||||
*/
|
||||
ioc->ioc_regs.pss_ctl_reg = (rb + PSS_CTL_REG);
|
||||
ioc->ioc_regs.pss_err_status_reg = (rb + PSS_ERR_STATUS_REG);
|
||||
ioc->ioc_regs.app_pll_fast_ctl_reg = (rb + APP_PLL_400_CTL_REG);
|
||||
ioc->ioc_regs.app_pll_slow_ctl_reg = (rb + APP_PLL_212_CTL_REG);
|
||||
|
||||
/*
|
||||
* IOC semaphore registers and serialization
|
||||
*/
|
||||
ioc->ioc_regs.ioc_sem_reg = (rb + HOST_SEM0_REG);
|
||||
ioc->ioc_regs.ioc_init_sem_reg = (rb + HOST_SEM2_REG);
|
||||
|
||||
/**
|
||||
* sram memory access
|
||||
*/
|
||||
ioc->ioc_regs.smem_page_start = (rb + PSS_SMEM_PAGE_START);
|
||||
ioc->ioc_regs.smem_pg0 = BFI_IOC_SMEM_PG0_CB;
|
||||
|
||||
/*
|
||||
* err set reg : for notification of hb failure
|
||||
*/
|
||||
ioc->ioc_regs.err_set = (rb + ERR_SET_REG);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize IOC to port mapping.
|
||||
*/
|
||||
static void
|
||||
bfa_ioc_cb_map_port(struct bfa_ioc_s *ioc)
|
||||
{
|
||||
/**
|
||||
* For crossbow, port id is same as pci function.
|
||||
*/
|
||||
ioc->port_id = bfa_ioc_pcifn(ioc);
|
||||
bfa_trc(ioc, ioc->port_id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set interrupt mode for a function: INTX or MSIX
|
||||
*/
|
||||
static void
|
||||
bfa_ioc_cb_isr_mode_set(struct bfa_ioc_s *ioc, bfa_boolean_t msix)
|
||||
{
|
||||
}
|
||||
|
||||
static bfa_status_t
|
||||
bfa_ioc_cb_pll_init(struct bfa_ioc_s *ioc)
|
||||
{
|
||||
bfa_os_addr_t rb = ioc->pcidev.pci_bar_kva;
|
||||
u32 pll_sclk, pll_fclk;
|
||||
|
||||
/*
|
||||
* Hold semaphore so that nobody can access the chip during init.
|
||||
*/
|
||||
bfa_ioc_sem_get(ioc->ioc_regs.ioc_init_sem_reg);
|
||||
|
||||
pll_sclk = __APP_PLL_212_ENABLE | __APP_PLL_212_LRESETN |
|
||||
__APP_PLL_212_P0_1(3U) |
|
||||
__APP_PLL_212_JITLMT0_1(3U) |
|
||||
__APP_PLL_212_CNTLMT0_1(3U);
|
||||
pll_fclk = __APP_PLL_400_ENABLE | __APP_PLL_400_LRESETN |
|
||||
__APP_PLL_400_RSEL200500 | __APP_PLL_400_P0_1(3U) |
|
||||
__APP_PLL_400_JITLMT0_1(3U) |
|
||||
__APP_PLL_400_CNTLMT0_1(3U);
|
||||
|
||||
bfa_reg_write((rb + BFA_IOC0_STATE_REG), BFI_IOC_UNINIT);
|
||||
bfa_reg_write((rb + BFA_IOC1_STATE_REG), BFI_IOC_UNINIT);
|
||||
|
||||
bfa_reg_write((rb + HOSTFN0_INT_MSK), 0xffffffffU);
|
||||
bfa_reg_write((rb + HOSTFN1_INT_MSK), 0xffffffffU);
|
||||
bfa_reg_write((rb + HOSTFN0_INT_STATUS), 0xffffffffU);
|
||||
bfa_reg_write((rb + HOSTFN1_INT_STATUS), 0xffffffffU);
|
||||
bfa_reg_write((rb + HOSTFN0_INT_MSK), 0xffffffffU);
|
||||
bfa_reg_write((rb + HOSTFN1_INT_MSK), 0xffffffffU);
|
||||
|
||||
bfa_reg_write(ioc->ioc_regs.app_pll_slow_ctl_reg,
|
||||
__APP_PLL_212_LOGIC_SOFT_RESET);
|
||||
bfa_reg_write(ioc->ioc_regs.app_pll_slow_ctl_reg,
|
||||
__APP_PLL_212_BYPASS |
|
||||
__APP_PLL_212_LOGIC_SOFT_RESET);
|
||||
bfa_reg_write(ioc->ioc_regs.app_pll_fast_ctl_reg,
|
||||
__APP_PLL_400_LOGIC_SOFT_RESET);
|
||||
bfa_reg_write(ioc->ioc_regs.app_pll_fast_ctl_reg,
|
||||
__APP_PLL_400_BYPASS |
|
||||
__APP_PLL_400_LOGIC_SOFT_RESET);
|
||||
bfa_os_udelay(2);
|
||||
bfa_reg_write(ioc->ioc_regs.app_pll_slow_ctl_reg,
|
||||
__APP_PLL_212_LOGIC_SOFT_RESET);
|
||||
bfa_reg_write(ioc->ioc_regs.app_pll_fast_ctl_reg,
|
||||
__APP_PLL_400_LOGIC_SOFT_RESET);
|
||||
|
||||
bfa_reg_write(ioc->ioc_regs.app_pll_slow_ctl_reg,
|
||||
pll_sclk | __APP_PLL_212_LOGIC_SOFT_RESET);
|
||||
bfa_reg_write(ioc->ioc_regs.app_pll_fast_ctl_reg,
|
||||
pll_fclk | __APP_PLL_400_LOGIC_SOFT_RESET);
|
||||
|
||||
/**
|
||||
* Wait for PLLs to lock.
|
||||
*/
|
||||
bfa_os_udelay(2000);
|
||||
bfa_reg_write((rb + HOSTFN0_INT_STATUS), 0xffffffffU);
|
||||
bfa_reg_write((rb + HOSTFN1_INT_STATUS), 0xffffffffU);
|
||||
|
||||
bfa_reg_write(ioc->ioc_regs.app_pll_slow_ctl_reg, pll_sclk);
|
||||
bfa_reg_write(ioc->ioc_regs.app_pll_fast_ctl_reg, pll_fclk);
|
||||
|
||||
/*
|
||||
* release semaphore.
|
||||
*/
|
||||
bfa_ioc_sem_release(ioc->ioc_regs.ioc_init_sem_reg);
|
||||
|
||||
return BFA_STATUS_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* Cleanup hw semaphore and usecnt registers
|
||||
*/
|
||||
static void
|
||||
bfa_ioc_cb_ownership_reset(struct bfa_ioc_s *ioc)
|
||||
{
|
||||
|
||||
/*
|
||||
* Read the hw sem reg to make sure that it is locked
|
||||
* before we clear it. If it is not locked, writing 1
|
||||
* will lock it instead of clearing it.
|
||||
*/
|
||||
bfa_reg_read(ioc->ioc_regs.ioc_sem_reg);
|
||||
bfa_ioc_hw_sem_release(ioc);
|
||||
}
|
423
drivers/scsi/bfa/bfa_ioc_ct.c
Normal file
423
drivers/scsi/bfa/bfa_ioc_ct.c
Normal file
@ -0,0 +1,423 @@
|
||||
/*
|
||||
* 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_ioc.h>
|
||||
#include <bfa_fwimg_priv.h>
|
||||
#include <cna/bfa_cna_trcmod.h>
|
||||
#include <cs/bfa_debug.h>
|
||||
#include <bfi/bfi_ioc.h>
|
||||
#include <bfi/bfi_ctreg.h>
|
||||
#include <log/bfa_log_hal.h>
|
||||
#include <defs/bfa_defs_pci.h>
|
||||
|
||||
BFA_TRC_FILE(CNA, IOC_CT);
|
||||
|
||||
/*
|
||||
* forward declarations
|
||||
*/
|
||||
static bfa_status_t bfa_ioc_ct_pll_init(struct bfa_ioc_s *ioc);
|
||||
static bfa_boolean_t bfa_ioc_ct_firmware_lock(struct bfa_ioc_s *ioc);
|
||||
static void bfa_ioc_ct_firmware_unlock(struct bfa_ioc_s *ioc);
|
||||
static u32* bfa_ioc_ct_fwimg_get_chunk(struct bfa_ioc_s *ioc,
|
||||
u32 off);
|
||||
static u32 bfa_ioc_ct_fwimg_get_size(struct bfa_ioc_s *ioc);
|
||||
static void bfa_ioc_ct_reg_init(struct bfa_ioc_s *ioc);
|
||||
static void bfa_ioc_ct_map_port(struct bfa_ioc_s *ioc);
|
||||
static void bfa_ioc_ct_isr_mode_set(struct bfa_ioc_s *ioc, bfa_boolean_t msix);
|
||||
static void bfa_ioc_ct_notify_hbfail(struct bfa_ioc_s *ioc);
|
||||
static void bfa_ioc_ct_ownership_reset(struct bfa_ioc_s *ioc);
|
||||
|
||||
struct bfa_ioc_hwif_s hwif_ct = {
|
||||
bfa_ioc_ct_pll_init,
|
||||
bfa_ioc_ct_firmware_lock,
|
||||
bfa_ioc_ct_firmware_unlock,
|
||||
bfa_ioc_ct_fwimg_get_chunk,
|
||||
bfa_ioc_ct_fwimg_get_size,
|
||||
bfa_ioc_ct_reg_init,
|
||||
bfa_ioc_ct_map_port,
|
||||
bfa_ioc_ct_isr_mode_set,
|
||||
bfa_ioc_ct_notify_hbfail,
|
||||
bfa_ioc_ct_ownership_reset,
|
||||
};
|
||||
|
||||
/**
|
||||
* Called from bfa_ioc_attach() to map asic specific calls.
|
||||
*/
|
||||
void
|
||||
bfa_ioc_set_ct_hwif(struct bfa_ioc_s *ioc)
|
||||
{
|
||||
ioc->ioc_hwif = &hwif_ct;
|
||||
}
|
||||
|
||||
static u32*
|
||||
bfa_ioc_ct_fwimg_get_chunk(struct bfa_ioc_s *ioc, u32 off)
|
||||
{
|
||||
return bfi_image_ct_get_chunk(off);
|
||||
}
|
||||
|
||||
static u32
|
||||
bfa_ioc_ct_fwimg_get_size(struct bfa_ioc_s *ioc)
|
||||
{
|
||||
return bfi_image_ct_size;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if firmware of current driver matches the running firmware.
|
||||
*/
|
||||
static bfa_boolean_t
|
||||
bfa_ioc_ct_firmware_lock(struct bfa_ioc_s *ioc)
|
||||
{
|
||||
enum bfi_ioc_state ioc_fwstate;
|
||||
u32 usecnt;
|
||||
struct bfi_ioc_image_hdr_s fwhdr;
|
||||
|
||||
/**
|
||||
* Firmware match check is relevant only for CNA.
|
||||
*/
|
||||
if (!ioc->cna)
|
||||
return BFA_TRUE;
|
||||
|
||||
/**
|
||||
* If bios boot (flash based) -- do not increment usage count
|
||||
*/
|
||||
if (bfa_ioc_ct_fwimg_get_size(ioc) < BFA_IOC_FWIMG_MINSZ)
|
||||
return BFA_TRUE;
|
||||
|
||||
bfa_ioc_sem_get(ioc->ioc_regs.ioc_usage_sem_reg);
|
||||
usecnt = bfa_reg_read(ioc->ioc_regs.ioc_usage_reg);
|
||||
|
||||
/**
|
||||
* If usage count is 0, always return TRUE.
|
||||
*/
|
||||
if (usecnt == 0) {
|
||||
bfa_reg_write(ioc->ioc_regs.ioc_usage_reg, 1);
|
||||
bfa_ioc_sem_release(ioc->ioc_regs.ioc_usage_sem_reg);
|
||||
bfa_trc(ioc, usecnt);
|
||||
return BFA_TRUE;
|
||||
}
|
||||
|
||||
ioc_fwstate = bfa_reg_read(ioc->ioc_regs.ioc_fwstate);
|
||||
bfa_trc(ioc, ioc_fwstate);
|
||||
|
||||
/**
|
||||
* Use count cannot be non-zero and chip in uninitialized state.
|
||||
*/
|
||||
bfa_assert(ioc_fwstate != BFI_IOC_UNINIT);
|
||||
|
||||
/**
|
||||
* Check if another driver with a different firmware is active
|
||||
*/
|
||||
bfa_ioc_fwver_get(ioc, &fwhdr);
|
||||
if (!bfa_ioc_fwver_cmp(ioc, &fwhdr)) {
|
||||
bfa_ioc_sem_release(ioc->ioc_regs.ioc_usage_sem_reg);
|
||||
bfa_trc(ioc, usecnt);
|
||||
return BFA_FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Same firmware version. Increment the reference count.
|
||||
*/
|
||||
usecnt++;
|
||||
bfa_reg_write(ioc->ioc_regs.ioc_usage_reg, usecnt);
|
||||
bfa_ioc_sem_release(ioc->ioc_regs.ioc_usage_sem_reg);
|
||||
bfa_trc(ioc, usecnt);
|
||||
return BFA_TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
bfa_ioc_ct_firmware_unlock(struct bfa_ioc_s *ioc)
|
||||
{
|
||||
u32 usecnt;
|
||||
|
||||
/**
|
||||
* Firmware lock is relevant only for CNA.
|
||||
* If bios boot (flash based) -- do not decrement usage count
|
||||
*/
|
||||
if (!ioc->cna || bfa_ioc_ct_fwimg_get_size(ioc) < BFA_IOC_FWIMG_MINSZ)
|
||||
return;
|
||||
|
||||
/**
|
||||
* decrement usage count
|
||||
*/
|
||||
bfa_ioc_sem_get(ioc->ioc_regs.ioc_usage_sem_reg);
|
||||
usecnt = bfa_reg_read(ioc->ioc_regs.ioc_usage_reg);
|
||||
bfa_assert(usecnt > 0);
|
||||
|
||||
usecnt--;
|
||||
bfa_reg_write(ioc->ioc_regs.ioc_usage_reg, usecnt);
|
||||
bfa_trc(ioc, usecnt);
|
||||
|
||||
bfa_ioc_sem_release(ioc->ioc_regs.ioc_usage_sem_reg);
|
||||
}
|
||||
|
||||
/**
|
||||
* Notify other functions on HB failure.
|
||||
*/
|
||||
static void
|
||||
bfa_ioc_ct_notify_hbfail(struct bfa_ioc_s *ioc)
|
||||
{
|
||||
if (ioc->cna) {
|
||||
bfa_reg_write(ioc->ioc_regs.ll_halt, __FW_INIT_HALT_P);
|
||||
/* Wait for halt to take effect */
|
||||
bfa_reg_read(ioc->ioc_regs.ll_halt);
|
||||
} else {
|
||||
bfa_reg_write(ioc->ioc_regs.err_set, __PSS_ERR_STATUS_SET);
|
||||
bfa_reg_read(ioc->ioc_regs.err_set);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Host to LPU mailbox message addresses
|
||||
*/
|
||||
static struct { u32 hfn_mbox, lpu_mbox, hfn_pgn; } iocreg_fnreg[] = {
|
||||
{ HOSTFN0_LPU_MBOX0_0, LPU_HOSTFN0_MBOX0_0, HOST_PAGE_NUM_FN0 },
|
||||
{ HOSTFN1_LPU_MBOX0_8, LPU_HOSTFN1_MBOX0_8, HOST_PAGE_NUM_FN1 },
|
||||
{ HOSTFN2_LPU_MBOX0_0, LPU_HOSTFN2_MBOX0_0, HOST_PAGE_NUM_FN2 },
|
||||
{ HOSTFN3_LPU_MBOX0_8, LPU_HOSTFN3_MBOX0_8, HOST_PAGE_NUM_FN3 }
|
||||
};
|
||||
|
||||
/**
|
||||
* Host <-> LPU mailbox command/status registers - port 0
|
||||
*/
|
||||
static struct { u32 hfn, lpu; } iocreg_mbcmd_p0[] = {
|
||||
{ HOSTFN0_LPU0_MBOX0_CMD_STAT, LPU0_HOSTFN0_MBOX0_CMD_STAT },
|
||||
{ HOSTFN1_LPU0_MBOX0_CMD_STAT, LPU0_HOSTFN1_MBOX0_CMD_STAT },
|
||||
{ HOSTFN2_LPU0_MBOX0_CMD_STAT, LPU0_HOSTFN2_MBOX0_CMD_STAT },
|
||||
{ HOSTFN3_LPU0_MBOX0_CMD_STAT, LPU0_HOSTFN3_MBOX0_CMD_STAT }
|
||||
};
|
||||
|
||||
/**
|
||||
* Host <-> LPU mailbox command/status registers - port 1
|
||||
*/
|
||||
static struct { u32 hfn, lpu; } iocreg_mbcmd_p1[] = {
|
||||
{ HOSTFN0_LPU1_MBOX0_CMD_STAT, LPU1_HOSTFN0_MBOX0_CMD_STAT },
|
||||
{ HOSTFN1_LPU1_MBOX0_CMD_STAT, LPU1_HOSTFN1_MBOX0_CMD_STAT },
|
||||
{ HOSTFN2_LPU1_MBOX0_CMD_STAT, LPU1_HOSTFN2_MBOX0_CMD_STAT },
|
||||
{ HOSTFN3_LPU1_MBOX0_CMD_STAT, LPU1_HOSTFN3_MBOX0_CMD_STAT }
|
||||
};
|
||||
|
||||
static void
|
||||
bfa_ioc_ct_reg_init(struct bfa_ioc_s *ioc)
|
||||
{
|
||||
bfa_os_addr_t rb;
|
||||
int pcifn = bfa_ioc_pcifn(ioc);
|
||||
|
||||
rb = bfa_ioc_bar0(ioc);
|
||||
|
||||
ioc->ioc_regs.hfn_mbox = rb + iocreg_fnreg[pcifn].hfn_mbox;
|
||||
ioc->ioc_regs.lpu_mbox = rb + iocreg_fnreg[pcifn].lpu_mbox;
|
||||
ioc->ioc_regs.host_page_num_fn = rb + iocreg_fnreg[pcifn].hfn_pgn;
|
||||
|
||||
if (ioc->port_id == 0) {
|
||||
ioc->ioc_regs.heartbeat = rb + BFA_IOC0_HBEAT_REG;
|
||||
ioc->ioc_regs.ioc_fwstate = rb + BFA_IOC0_STATE_REG;
|
||||
ioc->ioc_regs.hfn_mbox_cmd = rb + iocreg_mbcmd_p0[pcifn].hfn;
|
||||
ioc->ioc_regs.lpu_mbox_cmd = rb + iocreg_mbcmd_p0[pcifn].lpu;
|
||||
ioc->ioc_regs.ll_halt = rb + FW_INIT_HALT_P0;
|
||||
} else {
|
||||
ioc->ioc_regs.heartbeat = (rb + BFA_IOC1_HBEAT_REG);
|
||||
ioc->ioc_regs.ioc_fwstate = (rb + BFA_IOC1_STATE_REG);
|
||||
ioc->ioc_regs.hfn_mbox_cmd = rb + iocreg_mbcmd_p1[pcifn].hfn;
|
||||
ioc->ioc_regs.lpu_mbox_cmd = rb + iocreg_mbcmd_p1[pcifn].lpu;
|
||||
ioc->ioc_regs.ll_halt = rb + FW_INIT_HALT_P1;
|
||||
}
|
||||
|
||||
/*
|
||||
* PSS control registers
|
||||
*/
|
||||
ioc->ioc_regs.pss_ctl_reg = (rb + PSS_CTL_REG);
|
||||
ioc->ioc_regs.pss_err_status_reg = (rb + PSS_ERR_STATUS_REG);
|
||||
ioc->ioc_regs.app_pll_fast_ctl_reg = (rb + APP_PLL_425_CTL_REG);
|
||||
ioc->ioc_regs.app_pll_slow_ctl_reg = (rb + APP_PLL_312_CTL_REG);
|
||||
|
||||
/*
|
||||
* IOC semaphore registers and serialization
|
||||
*/
|
||||
ioc->ioc_regs.ioc_sem_reg = (rb + HOST_SEM0_REG);
|
||||
ioc->ioc_regs.ioc_usage_sem_reg = (rb + HOST_SEM1_REG);
|
||||
ioc->ioc_regs.ioc_init_sem_reg = (rb + HOST_SEM2_REG);
|
||||
ioc->ioc_regs.ioc_usage_reg = (rb + BFA_FW_USE_COUNT);
|
||||
|
||||
/**
|
||||
* sram memory access
|
||||
*/
|
||||
ioc->ioc_regs.smem_page_start = (rb + PSS_SMEM_PAGE_START);
|
||||
ioc->ioc_regs.smem_pg0 = BFI_IOC_SMEM_PG0_CT;
|
||||
|
||||
/*
|
||||
* err set reg : for notification of hb failure in fcmode
|
||||
*/
|
||||
ioc->ioc_regs.err_set = (rb + ERR_SET_REG);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize IOC to port mapping.
|
||||
*/
|
||||
|
||||
#define FNC_PERS_FN_SHIFT(__fn) ((__fn) * 8)
|
||||
static void
|
||||
bfa_ioc_ct_map_port(struct bfa_ioc_s *ioc)
|
||||
{
|
||||
bfa_os_addr_t rb = ioc->pcidev.pci_bar_kva;
|
||||
u32 r32;
|
||||
|
||||
/**
|
||||
* For catapult, base port id on personality register and IOC type
|
||||
*/
|
||||
r32 = bfa_reg_read(rb + FNC_PERS_REG);
|
||||
r32 >>= FNC_PERS_FN_SHIFT(bfa_ioc_pcifn(ioc));
|
||||
ioc->port_id = (r32 & __F0_PORT_MAP_MK) >> __F0_PORT_MAP_SH;
|
||||
|
||||
bfa_trc(ioc, bfa_ioc_pcifn(ioc));
|
||||
bfa_trc(ioc, ioc->port_id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set interrupt mode for a function: INTX or MSIX
|
||||
*/
|
||||
static void
|
||||
bfa_ioc_ct_isr_mode_set(struct bfa_ioc_s *ioc, bfa_boolean_t msix)
|
||||
{
|
||||
bfa_os_addr_t rb = ioc->pcidev.pci_bar_kva;
|
||||
u32 r32, mode;
|
||||
|
||||
r32 = bfa_reg_read(rb + FNC_PERS_REG);
|
||||
bfa_trc(ioc, r32);
|
||||
|
||||
mode = (r32 >> FNC_PERS_FN_SHIFT(bfa_ioc_pcifn(ioc))) &
|
||||
__F0_INTX_STATUS;
|
||||
|
||||
/**
|
||||
* If already in desired mode, do not change anything
|
||||
*/
|
||||
if (!msix && mode)
|
||||
return;
|
||||
|
||||
if (msix)
|
||||
mode = __F0_INTX_STATUS_MSIX;
|
||||
else
|
||||
mode = __F0_INTX_STATUS_INTA;
|
||||
|
||||
r32 &= ~(__F0_INTX_STATUS << FNC_PERS_FN_SHIFT(bfa_ioc_pcifn(ioc)));
|
||||
r32 |= (mode << FNC_PERS_FN_SHIFT(bfa_ioc_pcifn(ioc)));
|
||||
bfa_trc(ioc, r32);
|
||||
|
||||
bfa_reg_write(rb + FNC_PERS_REG, r32);
|
||||
}
|
||||
|
||||
static bfa_status_t
|
||||
bfa_ioc_ct_pll_init(struct bfa_ioc_s *ioc)
|
||||
{
|
||||
bfa_os_addr_t rb = ioc->pcidev.pci_bar_kva;
|
||||
u32 pll_sclk, pll_fclk, r32;
|
||||
|
||||
/*
|
||||
* Hold semaphore so that nobody can access the chip during init.
|
||||
*/
|
||||
bfa_ioc_sem_get(ioc->ioc_regs.ioc_init_sem_reg);
|
||||
|
||||
pll_sclk = __APP_PLL_312_LRESETN | __APP_PLL_312_ENARST |
|
||||
__APP_PLL_312_RSEL200500 | __APP_PLL_312_P0_1(3U) |
|
||||
__APP_PLL_312_JITLMT0_1(3U) |
|
||||
__APP_PLL_312_CNTLMT0_1(1U);
|
||||
pll_fclk = __APP_PLL_425_LRESETN | __APP_PLL_425_ENARST |
|
||||
__APP_PLL_425_RSEL200500 | __APP_PLL_425_P0_1(3U) |
|
||||
__APP_PLL_425_JITLMT0_1(3U) |
|
||||
__APP_PLL_425_CNTLMT0_1(1U);
|
||||
|
||||
/**
|
||||
* For catapult, choose operational mode FC/FCoE
|
||||
*/
|
||||
if (ioc->fcmode) {
|
||||
bfa_reg_write((rb + OP_MODE), 0);
|
||||
bfa_reg_write((rb + ETH_MAC_SER_REG),
|
||||
__APP_EMS_CMLCKSEL |
|
||||
__APP_EMS_REFCKBUFEN2 |
|
||||
__APP_EMS_CHANNEL_SEL);
|
||||
} else {
|
||||
ioc->pllinit = BFA_TRUE;
|
||||
bfa_reg_write((rb + OP_MODE), __GLOBAL_FCOE_MODE);
|
||||
bfa_reg_write((rb + ETH_MAC_SER_REG),
|
||||
__APP_EMS_REFCKBUFEN1);
|
||||
}
|
||||
|
||||
bfa_reg_write((rb + BFA_IOC0_STATE_REG), BFI_IOC_UNINIT);
|
||||
bfa_reg_write((rb + BFA_IOC1_STATE_REG), BFI_IOC_UNINIT);
|
||||
|
||||
bfa_reg_write((rb + HOSTFN0_INT_MSK), 0xffffffffU);
|
||||
bfa_reg_write((rb + HOSTFN1_INT_MSK), 0xffffffffU);
|
||||
bfa_reg_write((rb + HOSTFN0_INT_STATUS), 0xffffffffU);
|
||||
bfa_reg_write((rb + HOSTFN1_INT_STATUS), 0xffffffffU);
|
||||
bfa_reg_write((rb + HOSTFN0_INT_MSK), 0xffffffffU);
|
||||
bfa_reg_write((rb + HOSTFN1_INT_MSK), 0xffffffffU);
|
||||
|
||||
bfa_reg_write(ioc->ioc_regs.app_pll_slow_ctl_reg, pll_sclk |
|
||||
__APP_PLL_312_LOGIC_SOFT_RESET);
|
||||
bfa_reg_write(ioc->ioc_regs.app_pll_fast_ctl_reg, pll_fclk |
|
||||
__APP_PLL_425_LOGIC_SOFT_RESET);
|
||||
bfa_reg_write(ioc->ioc_regs.app_pll_slow_ctl_reg, pll_sclk |
|
||||
__APP_PLL_312_LOGIC_SOFT_RESET | __APP_PLL_312_ENABLE);
|
||||
bfa_reg_write(ioc->ioc_regs.app_pll_fast_ctl_reg, pll_fclk |
|
||||
__APP_PLL_425_LOGIC_SOFT_RESET | __APP_PLL_425_ENABLE);
|
||||
|
||||
/**
|
||||
* Wait for PLLs to lock.
|
||||
*/
|
||||
bfa_reg_read(rb + HOSTFN0_INT_MSK);
|
||||
bfa_os_udelay(2000);
|
||||
bfa_reg_write((rb + HOSTFN0_INT_STATUS), 0xffffffffU);
|
||||
bfa_reg_write((rb + HOSTFN1_INT_STATUS), 0xffffffffU);
|
||||
|
||||
bfa_reg_write(ioc->ioc_regs.app_pll_slow_ctl_reg, pll_sclk |
|
||||
__APP_PLL_312_ENABLE);
|
||||
bfa_reg_write(ioc->ioc_regs.app_pll_fast_ctl_reg, pll_fclk |
|
||||
__APP_PLL_425_ENABLE);
|
||||
|
||||
bfa_reg_write((rb + MBIST_CTL_REG), __EDRAM_BISTR_START);
|
||||
bfa_os_udelay(1000);
|
||||
r32 = bfa_reg_read((rb + MBIST_STAT_REG));
|
||||
bfa_trc(ioc, r32);
|
||||
/*
|
||||
* release semaphore.
|
||||
*/
|
||||
bfa_ioc_sem_release(ioc->ioc_regs.ioc_init_sem_reg);
|
||||
|
||||
return BFA_STATUS_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* Cleanup hw semaphore and usecnt registers
|
||||
*/
|
||||
static void
|
||||
bfa_ioc_ct_ownership_reset(struct bfa_ioc_s *ioc)
|
||||
{
|
||||
|
||||
if (ioc->cna) {
|
||||
bfa_ioc_sem_get(ioc->ioc_regs.ioc_usage_sem_reg);
|
||||
bfa_reg_write(ioc->ioc_regs.ioc_usage_reg, 0);
|
||||
bfa_ioc_sem_release(ioc->ioc_regs.ioc_usage_sem_reg);
|
||||
}
|
||||
|
||||
/*
|
||||
* Read the hw sem reg to make sure that it is locked
|
||||
* before we clear it. If it is not locked, writing 1
|
||||
* will lock it instead of clearing it.
|
||||
*/
|
||||
bfa_reg_read(ioc->ioc_regs.ioc_sem_reg);
|
||||
bfa_ioc_hw_sem_release(ioc);
|
||||
}
|
@ -172,6 +172,7 @@ bfa_iocfc_init_mem(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg,
|
||||
*/
|
||||
if (bfa_ioc_devid(&bfa->ioc) == BFA_PCI_DEVICE_ID_CT) {
|
||||
iocfc->hwif.hw_reginit = bfa_hwct_reginit;
|
||||
iocfc->hwif.hw_reqq_ack = bfa_hwct_reqq_ack;
|
||||
iocfc->hwif.hw_rspq_ack = bfa_hwct_rspq_ack;
|
||||
iocfc->hwif.hw_msix_init = bfa_hwct_msix_init;
|
||||
iocfc->hwif.hw_msix_install = bfa_hwct_msix_install;
|
||||
@ -180,6 +181,7 @@ bfa_iocfc_init_mem(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg,
|
||||
iocfc->hwif.hw_msix_getvecs = bfa_hwct_msix_getvecs;
|
||||
} else {
|
||||
iocfc->hwif.hw_reginit = bfa_hwcb_reginit;
|
||||
iocfc->hwif.hw_reqq_ack = bfa_hwcb_reqq_ack;
|
||||
iocfc->hwif.hw_rspq_ack = bfa_hwcb_rspq_ack;
|
||||
iocfc->hwif.hw_msix_init = bfa_hwcb_msix_init;
|
||||
iocfc->hwif.hw_msix_install = bfa_hwcb_msix_install;
|
||||
@ -336,8 +338,10 @@ bfa_iocfc_init_cb(void *bfa_arg, bfa_boolean_t complete)
|
||||
bfa_cb_init(bfa->bfad, BFA_STATUS_OK);
|
||||
else
|
||||
bfa_cb_init(bfa->bfad, BFA_STATUS_FAILED);
|
||||
} else
|
||||
bfa->iocfc.action = BFA_IOCFC_ACT_NONE;
|
||||
} else {
|
||||
if (bfa->iocfc.cfgdone)
|
||||
bfa->iocfc.action = BFA_IOCFC_ACT_NONE;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
@ -619,8 +623,6 @@ bfa_iocfc_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg,
|
||||
|
||||
bfa_ioc_attach(&bfa->ioc, bfa, &bfa_iocfc_cbfn, &bfa->timer_mod,
|
||||
bfa->trcmod, bfa->aen, bfa->logm);
|
||||
bfa_ioc_pci_init(&bfa->ioc, pcidev, BFI_MC_IOCFC);
|
||||
bfa_ioc_mbox_register(&bfa->ioc, bfa_mbox_isrs);
|
||||
|
||||
/**
|
||||
* Choose FC (ssid: 0x1C) v/s FCoE (ssid: 0x14) mode.
|
||||
@ -628,6 +630,9 @@ bfa_iocfc_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg,
|
||||
if (0)
|
||||
bfa_ioc_set_fcmode(&bfa->ioc);
|
||||
|
||||
bfa_ioc_pci_init(&bfa->ioc, pcidev, BFI_MC_IOCFC);
|
||||
bfa_ioc_mbox_register(&bfa->ioc, bfa_mbox_isrs);
|
||||
|
||||
bfa_iocfc_init_mem(bfa, bfad, cfg, pcidev);
|
||||
bfa_iocfc_mem_claim(bfa, cfg, meminfo);
|
||||
bfa_timer_init(&bfa->timer_mod);
|
||||
@ -654,7 +659,6 @@ bfa_iocfc_init(struct bfa_s *bfa)
|
||||
{
|
||||
bfa->iocfc.action = BFA_IOCFC_ACT_INIT;
|
||||
bfa_ioc_enable(&bfa->ioc);
|
||||
bfa_msix_install(bfa);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -797,6 +801,11 @@ bfa_iocfc_get_stats(struct bfa_s *bfa, struct bfa_iocfc_stats_s *stats,
|
||||
return BFA_STATUS_DEVBUSY;
|
||||
}
|
||||
|
||||
if (!bfa_iocfc_is_operational(bfa)) {
|
||||
bfa_trc(bfa, 0);
|
||||
return BFA_STATUS_IOC_NON_OP;
|
||||
}
|
||||
|
||||
iocfc->stats_busy = BFA_TRUE;
|
||||
iocfc->stats_ret = stats;
|
||||
iocfc->stats_cbfn = cbfn;
|
||||
@ -817,6 +826,11 @@ bfa_iocfc_clear_stats(struct bfa_s *bfa, bfa_cb_ioc_t cbfn, void *cbarg)
|
||||
return BFA_STATUS_DEVBUSY;
|
||||
}
|
||||
|
||||
if (!bfa_iocfc_is_operational(bfa)) {
|
||||
bfa_trc(bfa, 0);
|
||||
return BFA_STATUS_IOC_NON_OP;
|
||||
}
|
||||
|
||||
iocfc->stats_busy = BFA_TRUE;
|
||||
iocfc->stats_cbfn = cbfn;
|
||||
iocfc->stats_cbarg = cbarg;
|
||||
|
@ -54,6 +54,7 @@ struct bfa_msix_s {
|
||||
*/
|
||||
struct bfa_hwif_s {
|
||||
void (*hw_reginit)(struct bfa_s *bfa);
|
||||
void (*hw_reqq_ack)(struct bfa_s *bfa, int reqq);
|
||||
void (*hw_rspq_ack)(struct bfa_s *bfa, int rspq);
|
||||
void (*hw_msix_init)(struct bfa_s *bfa, int nvecs);
|
||||
void (*hw_msix_install)(struct bfa_s *bfa);
|
||||
@ -143,6 +144,7 @@ void bfa_msix_rspq(struct bfa_s *bfa, int vec);
|
||||
void bfa_msix_lpu_err(struct bfa_s *bfa, int vec);
|
||||
|
||||
void bfa_hwcb_reginit(struct bfa_s *bfa);
|
||||
void bfa_hwcb_reqq_ack(struct bfa_s *bfa, int rspq);
|
||||
void bfa_hwcb_rspq_ack(struct bfa_s *bfa, int rspq);
|
||||
void bfa_hwcb_msix_init(struct bfa_s *bfa, int nvecs);
|
||||
void bfa_hwcb_msix_install(struct bfa_s *bfa);
|
||||
@ -151,6 +153,7 @@ void bfa_hwcb_isr_mode_set(struct bfa_s *bfa, bfa_boolean_t msix);
|
||||
void bfa_hwcb_msix_getvecs(struct bfa_s *bfa, u32 *vecmap,
|
||||
u32 *nvecs, u32 *maxvec);
|
||||
void bfa_hwct_reginit(struct bfa_s *bfa);
|
||||
void bfa_hwct_reqq_ack(struct bfa_s *bfa, int rspq);
|
||||
void bfa_hwct_rspq_ack(struct bfa_s *bfa, int rspq);
|
||||
void bfa_hwct_msix_init(struct bfa_s *bfa, int nvecs);
|
||||
void bfa_hwct_msix_install(struct bfa_s *bfa);
|
||||
|
@ -149,7 +149,7 @@ bfa_ioim_sm_uninit(struct bfa_ioim_s *ioim, enum bfa_ioim_event event)
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(ioim->bfa, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -194,7 +194,7 @@ bfa_ioim_sm_sgalloc(struct bfa_ioim_s *ioim, enum bfa_ioim_event event)
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(ioim->bfa, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -259,7 +259,7 @@ bfa_ioim_sm_active(struct bfa_ioim_s *ioim, enum bfa_ioim_event event)
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(ioim->bfa, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -317,7 +317,7 @@ bfa_ioim_sm_abort(struct bfa_ioim_s *ioim, enum bfa_ioim_event event)
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(ioim->bfa, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -377,7 +377,7 @@ bfa_ioim_sm_cleanup(struct bfa_ioim_s *ioim, enum bfa_ioim_event event)
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(ioim->bfa, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -419,7 +419,7 @@ bfa_ioim_sm_qfull(struct bfa_ioim_s *ioim, enum bfa_ioim_event event)
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(ioim->bfa, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -467,7 +467,7 @@ bfa_ioim_sm_abort_qfull(struct bfa_ioim_s *ioim, enum bfa_ioim_event event)
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(ioim->bfa, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -516,7 +516,7 @@ bfa_ioim_sm_cleanup_qfull(struct bfa_ioim_s *ioim, enum bfa_ioim_event event)
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(ioim->bfa, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -544,7 +544,7 @@ bfa_ioim_sm_hcb(struct bfa_ioim_s *ioim, enum bfa_ioim_event event)
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(ioim->bfa, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -577,7 +577,7 @@ bfa_ioim_sm_hcb_free(struct bfa_ioim_s *ioim, enum bfa_ioim_event event)
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(ioim->bfa, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -605,7 +605,7 @@ bfa_ioim_sm_resfree(struct bfa_ioim_s *ioim, enum bfa_ioim_event event)
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(ioim->bfa, event);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -144,7 +144,7 @@ bfa_itnim_sm_uninit(struct bfa_itnim_s *itnim, enum bfa_itnim_event event)
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(itnim->bfa, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -175,7 +175,7 @@ bfa_itnim_sm_created(struct bfa_itnim_s *itnim, enum bfa_itnim_event event)
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(itnim->bfa, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -212,7 +212,7 @@ bfa_itnim_sm_fwcreate(struct bfa_itnim_s *itnim, enum bfa_itnim_event event)
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(itnim->bfa, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -247,7 +247,7 @@ bfa_itnim_sm_fwcreate_qfull(struct bfa_itnim_s *itnim,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(itnim->bfa, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -275,7 +275,7 @@ bfa_itnim_sm_delete_pending(struct bfa_itnim_s *itnim,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(itnim->bfa, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -317,7 +317,7 @@ bfa_itnim_sm_online(struct bfa_itnim_s *itnim, enum bfa_itnim_event event)
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(itnim->bfa, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -348,7 +348,7 @@ bfa_itnim_sm_sler(struct bfa_itnim_s *itnim, enum bfa_itnim_event event)
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(itnim->bfa, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -385,7 +385,7 @@ bfa_itnim_sm_cleanup_offline(struct bfa_itnim_s *itnim,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(itnim->bfa, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -413,7 +413,7 @@ bfa_itnim_sm_cleanup_delete(struct bfa_itnim_s *itnim,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(itnim->bfa, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -442,7 +442,7 @@ bfa_itnim_sm_fwdelete(struct bfa_itnim_s *itnim, enum bfa_itnim_event event)
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(itnim->bfa, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -470,7 +470,7 @@ bfa_itnim_sm_fwdelete_qfull(struct bfa_itnim_s *itnim,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(itnim->bfa, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -502,7 +502,7 @@ bfa_itnim_sm_offline(struct bfa_itnim_s *itnim, enum bfa_itnim_event event)
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(itnim->bfa, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -538,7 +538,7 @@ bfa_itnim_sm_iocdisable(struct bfa_itnim_s *itnim,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(itnim->bfa, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -559,7 +559,7 @@ bfa_itnim_sm_deleting(struct bfa_itnim_s *itnim, enum bfa_itnim_event event)
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(itnim->bfa, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -583,7 +583,7 @@ bfa_itnim_sm_deleting_qfull(struct bfa_itnim_s *itnim,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(itnim->bfa, event);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include <bfa.h>
|
||||
#include <bfi/bfi_lps.h>
|
||||
#include <cs/bfa_debug.h>
|
||||
#include <defs/bfa_defs_pci.h>
|
||||
|
||||
BFA_TRC_FILE(HAL, LPS);
|
||||
BFA_MODULE(lps);
|
||||
@ -25,6 +26,12 @@ BFA_MODULE(lps);
|
||||
#define BFA_LPS_MIN_LPORTS (1)
|
||||
#define BFA_LPS_MAX_LPORTS (256)
|
||||
|
||||
/*
|
||||
* Maximum Vports supported per physical port or vf.
|
||||
*/
|
||||
#define BFA_LPS_MAX_VPORTS_SUPP_CB 255
|
||||
#define BFA_LPS_MAX_VPORTS_SUPP_CT 190
|
||||
|
||||
/**
|
||||
* forward declarations
|
||||
*/
|
||||
@ -49,7 +56,7 @@ static void bfa_lps_send_login(struct bfa_lps_s *lps);
|
||||
static void bfa_lps_send_logout(struct bfa_lps_s *lps);
|
||||
static void bfa_lps_login_comp(struct bfa_lps_s *lps);
|
||||
static void bfa_lps_logout_comp(struct bfa_lps_s *lps);
|
||||
|
||||
static void bfa_lps_cvl_event(struct bfa_lps_s *lps);
|
||||
|
||||
/**
|
||||
* lps_pvt BFA LPS private functions
|
||||
@ -62,6 +69,7 @@ enum bfa_lps_event {
|
||||
BFA_LPS_SM_RESUME = 4, /* space present in reqq queue */
|
||||
BFA_LPS_SM_DELETE = 5, /* lps delete from user */
|
||||
BFA_LPS_SM_OFFLINE = 6, /* Link is offline */
|
||||
BFA_LPS_SM_RX_CVL = 7, /* Rx clear virtual link */
|
||||
};
|
||||
|
||||
static void bfa_lps_sm_init(struct bfa_lps_s *lps, enum bfa_lps_event event);
|
||||
@ -91,6 +99,12 @@ bfa_lps_sm_init(struct bfa_lps_s *lps, enum bfa_lps_event event)
|
||||
bfa_sm_set_state(lps, bfa_lps_sm_login);
|
||||
bfa_lps_send_login(lps);
|
||||
}
|
||||
if (lps->fdisc)
|
||||
bfa_plog_str(lps->bfa->plog, BFA_PL_MID_LPS,
|
||||
BFA_PL_EID_LOGIN, 0, "FDISC Request");
|
||||
else
|
||||
bfa_plog_str(lps->bfa->plog, BFA_PL_MID_LPS,
|
||||
BFA_PL_EID_LOGIN, 0, "FLOGI Request");
|
||||
break;
|
||||
|
||||
case BFA_LPS_SM_LOGOUT:
|
||||
@ -101,6 +115,7 @@ bfa_lps_sm_init(struct bfa_lps_s *lps, enum bfa_lps_event event)
|
||||
bfa_lps_free(lps);
|
||||
break;
|
||||
|
||||
case BFA_LPS_SM_RX_CVL:
|
||||
case BFA_LPS_SM_OFFLINE:
|
||||
break;
|
||||
|
||||
@ -112,7 +127,7 @@ bfa_lps_sm_init(struct bfa_lps_s *lps, enum bfa_lps_event event)
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(lps->bfa, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -127,10 +142,25 @@ bfa_lps_sm_login(struct bfa_lps_s *lps, enum bfa_lps_event event)
|
||||
|
||||
switch (event) {
|
||||
case BFA_LPS_SM_FWRSP:
|
||||
if (lps->status == BFA_STATUS_OK)
|
||||
if (lps->status == BFA_STATUS_OK) {
|
||||
bfa_sm_set_state(lps, bfa_lps_sm_online);
|
||||
else
|
||||
if (lps->fdisc)
|
||||
bfa_plog_str(lps->bfa->plog, BFA_PL_MID_LPS,
|
||||
BFA_PL_EID_LOGIN, 0, "FDISC Accept");
|
||||
else
|
||||
bfa_plog_str(lps->bfa->plog, BFA_PL_MID_LPS,
|
||||
BFA_PL_EID_LOGIN, 0, "FLOGI Accept");
|
||||
} else {
|
||||
bfa_sm_set_state(lps, bfa_lps_sm_init);
|
||||
if (lps->fdisc)
|
||||
bfa_plog_str(lps->bfa->plog, BFA_PL_MID_LPS,
|
||||
BFA_PL_EID_LOGIN, 0,
|
||||
"FDISC Fail (RJT or timeout)");
|
||||
else
|
||||
bfa_plog_str(lps->bfa->plog, BFA_PL_MID_LPS,
|
||||
BFA_PL_EID_LOGIN, 0,
|
||||
"FLOGI Fail (RJT or timeout)");
|
||||
}
|
||||
bfa_lps_login_comp(lps);
|
||||
break;
|
||||
|
||||
@ -139,7 +169,7 @@ bfa_lps_sm_login(struct bfa_lps_s *lps, enum bfa_lps_event event)
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(lps->bfa, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -162,8 +192,16 @@ bfa_lps_sm_loginwait(struct bfa_lps_s *lps, enum bfa_lps_event event)
|
||||
bfa_reqq_wcancel(&lps->wqe);
|
||||
break;
|
||||
|
||||
case BFA_LPS_SM_RX_CVL:
|
||||
/*
|
||||
* Login was not even sent out; so when getting out
|
||||
* of this state, it will appear like a login retry
|
||||
* after Clear virtual link
|
||||
*/
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(lps->bfa, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -185,6 +223,17 @@ bfa_lps_sm_online(struct bfa_lps_s *lps, enum bfa_lps_event event)
|
||||
bfa_sm_set_state(lps, bfa_lps_sm_logout);
|
||||
bfa_lps_send_logout(lps);
|
||||
}
|
||||
bfa_plog_str(lps->bfa->plog, BFA_PL_MID_LPS,
|
||||
BFA_PL_EID_LOGO, 0, "Logout");
|
||||
break;
|
||||
|
||||
case BFA_LPS_SM_RX_CVL:
|
||||
bfa_sm_set_state(lps, bfa_lps_sm_init);
|
||||
|
||||
/* Let the vport module know about this event */
|
||||
bfa_lps_cvl_event(lps);
|
||||
bfa_plog_str(lps->bfa->plog, BFA_PL_MID_LPS,
|
||||
BFA_PL_EID_FIP_FCF_CVL, 0, "FCF Clear Virt. Link Rx");
|
||||
break;
|
||||
|
||||
case BFA_LPS_SM_OFFLINE:
|
||||
@ -193,7 +242,7 @@ bfa_lps_sm_online(struct bfa_lps_s *lps, enum bfa_lps_event event)
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(lps->bfa, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -217,7 +266,7 @@ bfa_lps_sm_logout(struct bfa_lps_s *lps, enum bfa_lps_event event)
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(lps->bfa, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -242,7 +291,7 @@ bfa_lps_sm_logowait(struct bfa_lps_s *lps, enum bfa_lps_event event)
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(lps->bfa, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -395,6 +444,20 @@ bfa_lps_logout_rsp(struct bfa_s *bfa, struct bfi_lps_logout_rsp_s *rsp)
|
||||
bfa_sm_send_event(lps, BFA_LPS_SM_FWRSP);
|
||||
}
|
||||
|
||||
/**
|
||||
* Firmware received a Clear virtual link request (for FCoE)
|
||||
*/
|
||||
static void
|
||||
bfa_lps_rx_cvl_event(struct bfa_s *bfa, struct bfi_lps_cvl_event_s *cvl)
|
||||
{
|
||||
struct bfa_lps_mod_s *mod = BFA_LPS_MOD(bfa);
|
||||
struct bfa_lps_s *lps;
|
||||
|
||||
lps = BFA_LPS_FROM_TAG(mod, cvl->lp_tag);
|
||||
|
||||
bfa_sm_send_event(lps, BFA_LPS_SM_RX_CVL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Space is available in request queue, resume queueing request to firmware.
|
||||
*/
|
||||
@ -531,7 +594,48 @@ bfa_lps_logout_comp(struct bfa_lps_s *lps)
|
||||
bfa_cb_lps_flogo_comp(lps->bfa->bfad, lps->uarg);
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear virtual link completion handler for non-fcs
|
||||
*/
|
||||
static void
|
||||
bfa_lps_cvl_event_cb(void *arg, bfa_boolean_t complete)
|
||||
{
|
||||
struct bfa_lps_s *lps = arg;
|
||||
|
||||
if (!complete)
|
||||
return;
|
||||
|
||||
/* Clear virtual link to base port will result in link down */
|
||||
if (lps->fdisc)
|
||||
bfa_cb_lps_cvl_event(lps->bfa->bfad, lps->uarg);
|
||||
}
|
||||
|
||||
/**
|
||||
* Received Clear virtual link event --direct call for fcs,
|
||||
* queue for others
|
||||
*/
|
||||
static void
|
||||
bfa_lps_cvl_event(struct bfa_lps_s *lps)
|
||||
{
|
||||
if (!lps->bfa->fcs) {
|
||||
bfa_cb_queue(lps->bfa, &lps->hcb_qe, bfa_lps_cvl_event_cb,
|
||||
lps);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Clear virtual link to base port will result in link down */
|
||||
if (lps->fdisc)
|
||||
bfa_cb_lps_cvl_event(lps->bfa->bfad, lps->uarg);
|
||||
}
|
||||
|
||||
u32
|
||||
bfa_lps_get_max_vport(struct bfa_s *bfa)
|
||||
{
|
||||
if (bfa_ioc_devid(&bfa->ioc) == BFA_PCI_DEVICE_ID_CT)
|
||||
return BFA_LPS_MAX_VPORTS_SUPP_CT;
|
||||
else
|
||||
return BFA_LPS_MAX_VPORTS_SUPP_CB;
|
||||
}
|
||||
|
||||
/**
|
||||
* lps_public BFA LPS public functions
|
||||
@ -752,6 +856,14 @@ bfa_lps_get_lsrjt_expl(struct bfa_lps_s *lps)
|
||||
return lps->lsrjt_expl;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return fpma/spma MAC for lport
|
||||
*/
|
||||
struct mac_s
|
||||
bfa_lps_get_lp_mac(struct bfa_lps_s *lps)
|
||||
{
|
||||
return lps->lp_mac;
|
||||
}
|
||||
|
||||
/**
|
||||
* LPS firmware message class handler.
|
||||
@ -773,6 +885,10 @@ bfa_lps_isr(struct bfa_s *bfa, struct bfi_msg_s *m)
|
||||
bfa_lps_logout_rsp(bfa, msg.logout_rsp);
|
||||
break;
|
||||
|
||||
case BFI_LPS_H2I_CVL_EVENT:
|
||||
bfa_lps_rx_cvl_event(bfa, msg.cvl_event);
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_trc(bfa, m->mhdr.msg_id);
|
||||
bfa_assert(0);
|
||||
|
@ -24,7 +24,7 @@
|
||||
*/
|
||||
struct bfa_module_s *hal_mods[] = {
|
||||
&hal_mod_sgpg,
|
||||
&hal_mod_pport,
|
||||
&hal_mod_fcport,
|
||||
&hal_mod_fcxp,
|
||||
&hal_mod_lps,
|
||||
&hal_mod_uf,
|
||||
@ -45,7 +45,7 @@ bfa_isr_func_t bfa_isrs[BFI_MC_MAX] = {
|
||||
bfa_isr_unhandled, /* BFI_MC_DIAG */
|
||||
bfa_isr_unhandled, /* BFI_MC_FLASH */
|
||||
bfa_isr_unhandled, /* BFI_MC_CEE */
|
||||
bfa_pport_isr, /* BFI_MC_PORT */
|
||||
bfa_fcport_isr, /* BFI_MC_FCPORT */
|
||||
bfa_isr_unhandled, /* BFI_MC_IOCFC */
|
||||
bfa_isr_unhandled, /* BFI_MC_LL */
|
||||
bfa_uf_isr, /* BFI_MC_UF */
|
||||
|
@ -29,7 +29,7 @@
|
||||
|
||||
|
||||
struct bfa_modules_s {
|
||||
struct bfa_pport_s pport; /* physical port module */
|
||||
struct bfa_fcport_s fcport; /* fc port module */
|
||||
struct bfa_fcxp_mod_s fcxp_mod; /* fcxp module */
|
||||
struct bfa_lps_mod_s lps_mod; /* fcxp module */
|
||||
struct bfa_uf_mod_s uf_mod; /* unsolicited frame module */
|
||||
|
@ -23,9 +23,19 @@
|
||||
#include "bfa_intr_priv.h"
|
||||
|
||||
/**
|
||||
* BFA physical port data structure
|
||||
* Link notification data structure
|
||||
*/
|
||||
struct bfa_pport_s {
|
||||
struct bfa_fcport_ln_s {
|
||||
struct bfa_fcport_s *fcport;
|
||||
bfa_sm_t sm;
|
||||
struct bfa_cb_qe_s ln_qe; /* BFA callback queue elem for ln */
|
||||
enum bfa_pport_linkstate ln_event; /* ln event for callback */
|
||||
};
|
||||
|
||||
/**
|
||||
* BFA FC port data structure
|
||||
*/
|
||||
struct bfa_fcport_s {
|
||||
struct bfa_s *bfa; /* parent BFA instance */
|
||||
bfa_sm_t sm; /* port state machine */
|
||||
wwn_t nwwn; /* node wwn of physical port */
|
||||
@ -36,6 +46,8 @@ struct bfa_pport_s {
|
||||
enum bfa_pport_topology topology; /* current topology */
|
||||
u8 myalpa; /* my ALPA in LOOP topology */
|
||||
u8 rsvd[3];
|
||||
u32 mypid:24;
|
||||
u32 rsvd_b:8;
|
||||
struct bfa_pport_cfg_s cfg; /* current port configuration */
|
||||
struct bfa_qos_attr_s qos_attr; /* QoS Attributes */
|
||||
struct bfa_qos_vc_attr_s qos_vc_attr; /* VC info from ELP */
|
||||
@ -49,42 +61,31 @@ struct bfa_pport_s {
|
||||
void (*event_cbfn) (void *cbarg,
|
||||
bfa_pport_event_t event);
|
||||
union {
|
||||
union bfi_pport_i2h_msg_u i2hmsg;
|
||||
union bfi_fcport_i2h_msg_u i2hmsg;
|
||||
} event_arg;
|
||||
void *bfad; /* BFA driver handle */
|
||||
struct bfa_fcport_ln_s ln; /* Link Notification */
|
||||
struct bfa_cb_qe_s hcb_qe; /* BFA callback queue elem */
|
||||
enum bfa_pport_linkstate hcb_event;
|
||||
/* link event for callback */
|
||||
struct bfa_timer_s timer; /* timer */
|
||||
u32 msgtag; /* fimrware msg tag for reply */
|
||||
u8 *stats_kva;
|
||||
u64 stats_pa;
|
||||
union bfa_pport_stats_u *stats; /* pport stats */
|
||||
u32 mypid:24;
|
||||
u32 rsvd_b:8;
|
||||
struct bfa_timer_s timer; /* timer */
|
||||
union bfa_pport_stats_u *stats_ret;
|
||||
/* driver stats location */
|
||||
bfa_status_t stats_status;
|
||||
/* stats/statsclr status */
|
||||
bfa_boolean_t stats_busy;
|
||||
/* outstanding stats/statsclr */
|
||||
bfa_boolean_t stats_qfull;
|
||||
bfa_boolean_t diag_busy;
|
||||
/* diag busy status */
|
||||
bfa_boolean_t beacon;
|
||||
/* port beacon status */
|
||||
bfa_boolean_t link_e2e_beacon;
|
||||
/* link beacon status */
|
||||
bfa_cb_pport_t stats_cbfn;
|
||||
/* driver callback function */
|
||||
void *stats_cbarg;
|
||||
/* *!< user callback arg */
|
||||
union bfa_fcport_stats_u *stats;
|
||||
union bfa_fcport_stats_u *stats_ret; /* driver stats location */
|
||||
bfa_status_t stats_status; /* stats/statsclr status */
|
||||
bfa_boolean_t stats_busy; /* outstanding stats/statsclr */
|
||||
bfa_boolean_t stats_qfull;
|
||||
bfa_cb_pport_t stats_cbfn; /* driver callback function */
|
||||
void *stats_cbarg; /* *!< user callback arg */
|
||||
bfa_boolean_t diag_busy; /* diag busy status */
|
||||
bfa_boolean_t beacon; /* port beacon status */
|
||||
bfa_boolean_t link_e2e_beacon; /* link beacon status */
|
||||
};
|
||||
|
||||
#define BFA_PORT_MOD(__bfa) (&(__bfa)->modules.pport)
|
||||
#define BFA_FCPORT_MOD(__bfa) (&(__bfa)->modules.fcport)
|
||||
|
||||
/*
|
||||
* public functions
|
||||
*/
|
||||
void bfa_pport_isr(struct bfa_s *bfa, struct bfi_msg_s *msg);
|
||||
void bfa_fcport_isr(struct bfa_s *bfa, struct bfi_msg_s *msg);
|
||||
#endif /* __BFA_PORT_PRIV_H__ */
|
||||
|
@ -101,7 +101,7 @@ extern bfa_boolean_t bfa_auto_recover;
|
||||
extern struct bfa_module_s hal_mod_flash;
|
||||
extern struct bfa_module_s hal_mod_fcdiag;
|
||||
extern struct bfa_module_s hal_mod_sgpg;
|
||||
extern struct bfa_module_s hal_mod_pport;
|
||||
extern struct bfa_module_s hal_mod_fcport;
|
||||
extern struct bfa_module_s hal_mod_fcxp;
|
||||
extern struct bfa_module_s hal_mod_lps;
|
||||
extern struct bfa_module_s hal_mod_uf;
|
||||
|
@ -114,7 +114,7 @@ bfa_rport_sm_uninit(struct bfa_rport_s *rp, enum bfa_rport_event event)
|
||||
|
||||
default:
|
||||
bfa_stats(rp, sm_un_unexp);
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(rp->bfa, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -146,7 +146,7 @@ bfa_rport_sm_created(struct bfa_rport_s *rp, enum bfa_rport_event event)
|
||||
|
||||
default:
|
||||
bfa_stats(rp, sm_cr_unexp);
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(rp->bfa, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -183,7 +183,7 @@ bfa_rport_sm_fwcreate(struct bfa_rport_s *rp, enum bfa_rport_event event)
|
||||
|
||||
default:
|
||||
bfa_stats(rp, sm_fwc_unexp);
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(rp->bfa, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -224,7 +224,7 @@ bfa_rport_sm_fwcreate_qfull(struct bfa_rport_s *rp, enum bfa_rport_event event)
|
||||
|
||||
default:
|
||||
bfa_stats(rp, sm_fwc_unexp);
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(rp->bfa, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -296,7 +296,7 @@ bfa_rport_sm_online(struct bfa_rport_s *rp, enum bfa_rport_event event)
|
||||
|
||||
default:
|
||||
bfa_stats(rp, sm_on_unexp);
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(rp->bfa, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -329,7 +329,7 @@ bfa_rport_sm_fwdelete(struct bfa_rport_s *rp, enum bfa_rport_event event)
|
||||
|
||||
default:
|
||||
bfa_stats(rp, sm_fwd_unexp);
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(rp->bfa, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -359,7 +359,7 @@ bfa_rport_sm_fwdelete_qfull(struct bfa_rport_s *rp, enum bfa_rport_event event)
|
||||
|
||||
default:
|
||||
bfa_stats(rp, sm_fwd_unexp);
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(rp->bfa, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -394,7 +394,7 @@ bfa_rport_sm_offline(struct bfa_rport_s *rp, enum bfa_rport_event event)
|
||||
|
||||
default:
|
||||
bfa_stats(rp, sm_off_unexp);
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(rp->bfa, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -421,7 +421,7 @@ bfa_rport_sm_deleting(struct bfa_rport_s *rp, enum bfa_rport_event event)
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(rp->bfa, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -446,7 +446,7 @@ bfa_rport_sm_deleting_qfull(struct bfa_rport_s *rp, enum bfa_rport_event event)
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(rp->bfa, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -477,7 +477,7 @@ bfa_rport_sm_delete_pending(struct bfa_rport_s *rp,
|
||||
|
||||
default:
|
||||
bfa_stats(rp, sm_delp_unexp);
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(rp->bfa, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -512,7 +512,7 @@ bfa_rport_sm_offline_pending(struct bfa_rport_s *rp,
|
||||
|
||||
default:
|
||||
bfa_stats(rp, sm_offp_unexp);
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(rp->bfa, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -550,7 +550,7 @@ bfa_rport_sm_iocdisable(struct bfa_rport_s *rp, enum bfa_rport_event event)
|
||||
|
||||
default:
|
||||
bfa_stats(rp, sm_iocd_unexp);
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(rp->bfa, event);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -29,38 +29,36 @@
|
||||
* !!! needed between trace utility and driver version
|
||||
*/
|
||||
enum {
|
||||
BFA_TRC_HAL_IOC = 1,
|
||||
BFA_TRC_HAL_INTR = 2,
|
||||
BFA_TRC_HAL_FCXP = 3,
|
||||
BFA_TRC_HAL_UF = 4,
|
||||
BFA_TRC_HAL_DIAG = 5,
|
||||
BFA_TRC_HAL_RPORT = 6,
|
||||
BFA_TRC_HAL_FCPIM = 7,
|
||||
BFA_TRC_HAL_IOIM = 8,
|
||||
BFA_TRC_HAL_TSKIM = 9,
|
||||
BFA_TRC_HAL_ITNIM = 10,
|
||||
BFA_TRC_HAL_PPORT = 11,
|
||||
BFA_TRC_HAL_SGPG = 12,
|
||||
BFA_TRC_HAL_FLASH = 13,
|
||||
BFA_TRC_HAL_DEBUG = 14,
|
||||
BFA_TRC_HAL_WWN = 15,
|
||||
BFA_TRC_HAL_FLASH_RAW = 16,
|
||||
BFA_TRC_HAL_SBOOT = 17,
|
||||
BFA_TRC_HAL_SBOOT_IO = 18,
|
||||
BFA_TRC_HAL_SBOOT_INTR = 19,
|
||||
BFA_TRC_HAL_SBTEST = 20,
|
||||
BFA_TRC_HAL_IPFC = 21,
|
||||
BFA_TRC_HAL_IOCFC = 22,
|
||||
BFA_TRC_HAL_FCPTM = 23,
|
||||
BFA_TRC_HAL_IOTM = 24,
|
||||
BFA_TRC_HAL_TSKTM = 25,
|
||||
BFA_TRC_HAL_TIN = 26,
|
||||
BFA_TRC_HAL_LPS = 27,
|
||||
BFA_TRC_HAL_FCDIAG = 28,
|
||||
BFA_TRC_HAL_PBIND = 29,
|
||||
BFA_TRC_HAL_IOCFC_CT = 30,
|
||||
BFA_TRC_HAL_IOCFC_CB = 31,
|
||||
BFA_TRC_HAL_IOCFC_Q = 32,
|
||||
BFA_TRC_HAL_INTR = 1,
|
||||
BFA_TRC_HAL_FCXP = 2,
|
||||
BFA_TRC_HAL_UF = 3,
|
||||
BFA_TRC_HAL_RPORT = 4,
|
||||
BFA_TRC_HAL_FCPIM = 5,
|
||||
BFA_TRC_HAL_IOIM = 6,
|
||||
BFA_TRC_HAL_TSKIM = 7,
|
||||
BFA_TRC_HAL_ITNIM = 8,
|
||||
BFA_TRC_HAL_FCPORT = 9,
|
||||
BFA_TRC_HAL_SGPG = 10,
|
||||
BFA_TRC_HAL_FLASH = 11,
|
||||
BFA_TRC_HAL_DEBUG = 12,
|
||||
BFA_TRC_HAL_WWN = 13,
|
||||
BFA_TRC_HAL_FLASH_RAW = 14,
|
||||
BFA_TRC_HAL_SBOOT = 15,
|
||||
BFA_TRC_HAL_SBOOT_IO = 16,
|
||||
BFA_TRC_HAL_SBOOT_INTR = 17,
|
||||
BFA_TRC_HAL_SBTEST = 18,
|
||||
BFA_TRC_HAL_IPFC = 19,
|
||||
BFA_TRC_HAL_IOCFC = 20,
|
||||
BFA_TRC_HAL_FCPTM = 21,
|
||||
BFA_TRC_HAL_IOTM = 22,
|
||||
BFA_TRC_HAL_TSKTM = 23,
|
||||
BFA_TRC_HAL_TIN = 24,
|
||||
BFA_TRC_HAL_LPS = 25,
|
||||
BFA_TRC_HAL_FCDIAG = 26,
|
||||
BFA_TRC_HAL_PBIND = 27,
|
||||
BFA_TRC_HAL_IOCFC_CT = 28,
|
||||
BFA_TRC_HAL_IOCFC_CB = 29,
|
||||
BFA_TRC_HAL_IOCFC_Q = 30,
|
||||
};
|
||||
|
||||
#endif /* __BFA_TRCMOD_PRIV_H__ */
|
||||
|
@ -110,7 +110,7 @@ bfa_tskim_sm_uninit(struct bfa_tskim_s *tskim, enum bfa_tskim_event event)
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(tskim->bfa, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -146,7 +146,7 @@ bfa_tskim_sm_active(struct bfa_tskim_s *tskim, enum bfa_tskim_event event)
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(tskim->bfa, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -178,7 +178,7 @@ bfa_tskim_sm_cleanup(struct bfa_tskim_s *tskim, enum bfa_tskim_event event)
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(tskim->bfa, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -207,7 +207,7 @@ bfa_tskim_sm_iocleanup(struct bfa_tskim_s *tskim, enum bfa_tskim_event event)
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(tskim->bfa, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -242,7 +242,7 @@ bfa_tskim_sm_qfull(struct bfa_tskim_s *tskim, enum bfa_tskim_event event)
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(tskim->bfa, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -277,7 +277,7 @@ bfa_tskim_sm_cleanup_qfull(struct bfa_tskim_s *tskim,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(tskim->bfa, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -303,7 +303,7 @@ bfa_tskim_sm_hcb(struct bfa_tskim_s *tskim, enum bfa_tskim_event event)
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(tskim->bfa, event);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -20,6 +20,7 @@
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/kthread.h>
|
||||
#include "bfad_drv.h"
|
||||
#include "bfad_im.h"
|
||||
#include "bfad_tm.h"
|
||||
@ -53,6 +54,7 @@ static int log_level = BFA_LOG_WARNING;
|
||||
static int ioc_auto_recover = BFA_TRUE;
|
||||
static int ipfc_enable = BFA_FALSE;
|
||||
static int ipfc_mtu = -1;
|
||||
static int fdmi_enable = BFA_TRUE;
|
||||
int bfa_lun_queue_depth = BFAD_LUN_QUEUE_DEPTH;
|
||||
int bfa_linkup_delay = -1;
|
||||
|
||||
@ -74,6 +76,7 @@ module_param(log_level, int, S_IRUGO | S_IWUSR);
|
||||
module_param(ioc_auto_recover, int, S_IRUGO | S_IWUSR);
|
||||
module_param(ipfc_enable, int, S_IRUGO | S_IWUSR);
|
||||
module_param(ipfc_mtu, int, S_IRUGO | S_IWUSR);
|
||||
module_param(fdmi_enable, int, S_IRUGO | S_IWUSR);
|
||||
module_param(bfa_linkup_delay, int, S_IRUGO | S_IWUSR);
|
||||
|
||||
/*
|
||||
@ -95,6 +98,8 @@ bfad_fc4_probe(struct bfad_s *bfad)
|
||||
|
||||
if (ipfc_enable)
|
||||
bfad_ipfc_probe(bfad);
|
||||
|
||||
bfad->bfad_flags |= BFAD_FC4_PROBE_DONE;
|
||||
ext:
|
||||
return rc;
|
||||
}
|
||||
@ -106,6 +111,7 @@ bfad_fc4_probe_undo(struct bfad_s *bfad)
|
||||
bfad_tm_probe_undo(bfad);
|
||||
if (ipfc_enable)
|
||||
bfad_ipfc_probe_undo(bfad);
|
||||
bfad->bfad_flags &= ~BFAD_FC4_PROBE_DONE;
|
||||
}
|
||||
|
||||
static void
|
||||
@ -173,9 +179,19 @@ bfa_cb_init(void *drv, bfa_status_t init_status)
|
||||
{
|
||||
struct bfad_s *bfad = drv;
|
||||
|
||||
if (init_status == BFA_STATUS_OK)
|
||||
if (init_status == BFA_STATUS_OK) {
|
||||
bfad->bfad_flags |= BFAD_HAL_INIT_DONE;
|
||||
|
||||
/* If BFAD_HAL_INIT_FAIL flag is set:
|
||||
* Wake up the kernel thread to start
|
||||
* the bfad operations after HAL init done
|
||||
*/
|
||||
if ((bfad->bfad_flags & BFAD_HAL_INIT_FAIL)) {
|
||||
bfad->bfad_flags &= ~BFAD_HAL_INIT_FAIL;
|
||||
wake_up_process(bfad->bfad_tsk);
|
||||
}
|
||||
}
|
||||
|
||||
complete(&bfad->comp);
|
||||
}
|
||||
|
||||
@ -648,7 +664,7 @@ bfad_fcs_port_cfg(struct bfad_s *bfad)
|
||||
|
||||
sprintf(symname, "%s-%d", BFAD_DRIVER_NAME, bfad->inst_no);
|
||||
memcpy(port_cfg.sym_name.symname, symname, strlen(symname));
|
||||
bfa_pport_get_attr(&bfad->bfa, &attr);
|
||||
bfa_fcport_get_attr(&bfad->bfa, &attr);
|
||||
port_cfg.nwwn = attr.nwwn;
|
||||
port_cfg.pwwn = attr.pwwn;
|
||||
|
||||
@ -661,7 +677,6 @@ bfad_drv_init(struct bfad_s *bfad)
|
||||
bfa_status_t rc;
|
||||
unsigned long flags;
|
||||
struct bfa_fcs_driver_info_s driver_info;
|
||||
int i;
|
||||
|
||||
bfad->cfg_data.rport_del_timeout = rport_del_timeout;
|
||||
bfad->cfg_data.lun_queue_depth = bfa_lun_queue_depth;
|
||||
@ -681,12 +696,7 @@ bfad_drv_init(struct bfad_s *bfad)
|
||||
bfa_init_log(&bfad->bfa, bfad->logmod);
|
||||
bfa_init_trc(&bfad->bfa, bfad->trcmod);
|
||||
bfa_init_aen(&bfad->bfa, bfad->aen);
|
||||
INIT_LIST_HEAD(&bfad->file_q);
|
||||
INIT_LIST_HEAD(&bfad->file_free_q);
|
||||
for (i = 0; i < BFAD_AEN_MAX_APPS; i++) {
|
||||
bfa_q_qe_init(&bfad->file_buf[i].qe);
|
||||
list_add_tail(&bfad->file_buf[i].qe, &bfad->file_free_q);
|
||||
}
|
||||
memset(bfad->file_map, 0, sizeof(bfad->file_map));
|
||||
bfa_init_plog(&bfad->bfa, &bfad->plog_buf);
|
||||
bfa_plog_init(&bfad->plog_buf);
|
||||
bfa_plog_str(&bfad->plog_buf, BFA_PL_MID_DRVR, BFA_PL_EID_DRIVER_START,
|
||||
@ -746,8 +756,16 @@ bfad_drv_init(struct bfad_s *bfad)
|
||||
bfa_fcs_log_init(&bfad->bfa_fcs, bfad->logmod);
|
||||
bfa_fcs_trc_init(&bfad->bfa_fcs, bfad->trcmod);
|
||||
bfa_fcs_aen_init(&bfad->bfa_fcs, bfad->aen);
|
||||
bfa_fcs_init(&bfad->bfa_fcs, &bfad->bfa, bfad, BFA_FALSE);
|
||||
bfa_fcs_attach(&bfad->bfa_fcs, &bfad->bfa, bfad, BFA_FALSE);
|
||||
|
||||
/* Do FCS init only when HAL init is done */
|
||||
if ((bfad->bfad_flags & BFAD_HAL_INIT_DONE)) {
|
||||
bfa_fcs_init(&bfad->bfa_fcs);
|
||||
bfad->bfad_flags |= BFAD_FCS_INIT_DONE;
|
||||
}
|
||||
|
||||
bfa_fcs_driver_info_init(&bfad->bfa_fcs, &driver_info);
|
||||
bfa_fcs_set_fdmi_param(&bfad->bfa_fcs, fdmi_enable);
|
||||
spin_unlock_irqrestore(&bfad->bfad_lock, flags);
|
||||
|
||||
bfad->bfad_flags |= BFAD_DRV_INIT_DONE;
|
||||
@ -763,12 +781,21 @@ bfad_drv_init(struct bfad_s *bfad)
|
||||
void
|
||||
bfad_drv_uninit(struct bfad_s *bfad)
|
||||
{
|
||||
unsigned long flags;
|
||||
|
||||
spin_lock_irqsave(&bfad->bfad_lock, flags);
|
||||
init_completion(&bfad->comp);
|
||||
bfa_stop(&bfad->bfa);
|
||||
spin_unlock_irqrestore(&bfad->bfad_lock, flags);
|
||||
wait_for_completion(&bfad->comp);
|
||||
|
||||
del_timer_sync(&bfad->hal_tmo);
|
||||
bfa_isr_disable(&bfad->bfa);
|
||||
bfa_detach(&bfad->bfa);
|
||||
bfad_remove_intr(bfad);
|
||||
bfa_assert(list_empty(&bfad->file_q));
|
||||
bfad_hal_mem_release(bfad);
|
||||
|
||||
bfad->bfad_flags &= ~BFAD_DRV_INIT_DONE;
|
||||
}
|
||||
|
||||
void
|
||||
@ -859,6 +886,86 @@ bfad_drv_log_level_set(struct bfad_s *bfad)
|
||||
bfa_log_set_level_all(&bfad->log_data, log_level);
|
||||
}
|
||||
|
||||
bfa_status_t
|
||||
bfad_start_ops(struct bfad_s *bfad)
|
||||
{
|
||||
int retval;
|
||||
|
||||
/* PPORT FCS config */
|
||||
bfad_fcs_port_cfg(bfad);
|
||||
|
||||
retval = bfad_cfg_pport(bfad, BFA_PORT_ROLE_FCP_IM);
|
||||
if (retval != BFA_STATUS_OK)
|
||||
goto out_cfg_pport_failure;
|
||||
|
||||
/* BFAD level FC4 (IM/TM/IPFC) specific resource allocation */
|
||||
retval = bfad_fc4_probe(bfad);
|
||||
if (retval != BFA_STATUS_OK) {
|
||||
printk(KERN_WARNING "bfad_fc4_probe failed\n");
|
||||
goto out_fc4_probe_failure;
|
||||
}
|
||||
|
||||
bfad_drv_start(bfad);
|
||||
|
||||
/*
|
||||
* If bfa_linkup_delay is set to -1 default; try to retrive the
|
||||
* value using the bfad_os_get_linkup_delay(); else use the
|
||||
* passed in module param value as the bfa_linkup_delay.
|
||||
*/
|
||||
if (bfa_linkup_delay < 0) {
|
||||
|
||||
bfa_linkup_delay = bfad_os_get_linkup_delay(bfad);
|
||||
bfad_os_rport_online_wait(bfad);
|
||||
bfa_linkup_delay = -1;
|
||||
|
||||
} else {
|
||||
bfad_os_rport_online_wait(bfad);
|
||||
}
|
||||
|
||||
bfa_log(bfad->logmod, BFA_LOG_LINUX_DEVICE_CLAIMED, bfad->pci_name);
|
||||
|
||||
return BFA_STATUS_OK;
|
||||
|
||||
out_fc4_probe_failure:
|
||||
bfad_fc4_probe_undo(bfad);
|
||||
bfad_uncfg_pport(bfad);
|
||||
out_cfg_pport_failure:
|
||||
return BFA_STATUS_FAILED;
|
||||
}
|
||||
|
||||
int
|
||||
bfad_worker (void *ptr)
|
||||
{
|
||||
struct bfad_s *bfad;
|
||||
unsigned long flags;
|
||||
|
||||
bfad = (struct bfad_s *)ptr;
|
||||
|
||||
while (!kthread_should_stop()) {
|
||||
|
||||
/* Check if the FCS init is done from bfad_drv_init;
|
||||
* if not done do FCS init and set the flag.
|
||||
*/
|
||||
if (!(bfad->bfad_flags & BFAD_FCS_INIT_DONE)) {
|
||||
spin_lock_irqsave(&bfad->bfad_lock, flags);
|
||||
bfa_fcs_init(&bfad->bfa_fcs);
|
||||
bfad->bfad_flags |= BFAD_FCS_INIT_DONE;
|
||||
spin_unlock_irqrestore(&bfad->bfad_lock, flags);
|
||||
}
|
||||
|
||||
/* Start the bfad operations after HAL init done */
|
||||
bfad_start_ops(bfad);
|
||||
|
||||
spin_lock_irqsave(&bfad->bfad_lock, flags);
|
||||
bfad->bfad_tsk = NULL;
|
||||
spin_unlock_irqrestore(&bfad->bfad_lock, flags);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* PCI_entry PCI driver entries * {
|
||||
*/
|
||||
@ -871,7 +978,6 @@ bfad_pci_probe(struct pci_dev *pdev, const struct pci_device_id *pid)
|
||||
{
|
||||
struct bfad_s *bfad;
|
||||
int error = -ENODEV, retval;
|
||||
char buf[16];
|
||||
|
||||
/*
|
||||
* For single port cards - only claim function 0
|
||||
@ -902,8 +1008,7 @@ bfad_pci_probe(struct pci_dev *pdev, const struct pci_device_id *pid)
|
||||
bfa_trc(bfad, bfad_inst);
|
||||
|
||||
bfad->logmod = &bfad->log_data;
|
||||
sprintf(buf, "%d", bfad_inst);
|
||||
bfa_log_init(bfad->logmod, buf, bfa_os_printf);
|
||||
bfa_log_init(bfad->logmod, (char *)pci_name(pdev), bfa_os_printf);
|
||||
|
||||
bfad_drv_log_level_set(bfad);
|
||||
|
||||
@ -933,57 +1038,39 @@ bfad_pci_probe(struct pci_dev *pdev, const struct pci_device_id *pid)
|
||||
bfad->ref_count = 0;
|
||||
bfad->pport.bfad = bfad;
|
||||
|
||||
bfad->bfad_tsk = kthread_create(bfad_worker, (void *) bfad, "%s",
|
||||
"bfad_worker");
|
||||
if (IS_ERR(bfad->bfad_tsk)) {
|
||||
printk(KERN_INFO "bfad[%d]: Kernel thread"
|
||||
" creation failed!\n",
|
||||
bfad->inst_no);
|
||||
goto out_kthread_create_failure;
|
||||
}
|
||||
|
||||
retval = bfad_drv_init(bfad);
|
||||
if (retval != BFA_STATUS_OK)
|
||||
goto out_drv_init_failure;
|
||||
if (!(bfad->bfad_flags & BFAD_HAL_INIT_DONE)) {
|
||||
bfad->bfad_flags |= BFAD_HAL_INIT_FAIL;
|
||||
printk(KERN_WARNING "bfad%d: hal init failed\n", bfad->inst_no);
|
||||
goto ok;
|
||||
}
|
||||
|
||||
/*
|
||||
* PPORT FCS config
|
||||
*/
|
||||
bfad_fcs_port_cfg(bfad);
|
||||
|
||||
retval = bfad_cfg_pport(bfad, BFA_PORT_ROLE_FCP_IM);
|
||||
retval = bfad_start_ops(bfad);
|
||||
if (retval != BFA_STATUS_OK)
|
||||
goto out_cfg_pport_failure;
|
||||
goto out_start_ops_failure;
|
||||
|
||||
/*
|
||||
* BFAD level FC4 (IM/TM/IPFC) specific resource allocation
|
||||
*/
|
||||
retval = bfad_fc4_probe(bfad);
|
||||
if (retval != BFA_STATUS_OK) {
|
||||
printk(KERN_WARNING "bfad_fc4_probe failed\n");
|
||||
goto out_fc4_probe_failure;
|
||||
}
|
||||
kthread_stop(bfad->bfad_tsk);
|
||||
bfad->bfad_tsk = NULL;
|
||||
|
||||
bfad_drv_start(bfad);
|
||||
|
||||
/*
|
||||
* If bfa_linkup_delay is set to -1 default; try to retrive the
|
||||
* value using the bfad_os_get_linkup_delay(); else use the
|
||||
* passed in module param value as the bfa_linkup_delay.
|
||||
*/
|
||||
if (bfa_linkup_delay < 0) {
|
||||
bfa_linkup_delay = bfad_os_get_linkup_delay(bfad);
|
||||
bfad_os_rport_online_wait(bfad);
|
||||
bfa_linkup_delay = -1;
|
||||
} else {
|
||||
bfad_os_rport_online_wait(bfad);
|
||||
}
|
||||
|
||||
bfa_log(bfad->logmod, BFA_LOG_LINUX_DEVICE_CLAIMED, bfad->pci_name);
|
||||
ok:
|
||||
return 0;
|
||||
|
||||
out_fc4_probe_failure:
|
||||
bfad_fc4_probe_undo(bfad);
|
||||
bfad_uncfg_pport(bfad);
|
||||
out_cfg_pport_failure:
|
||||
out_start_ops_failure:
|
||||
bfad_drv_uninit(bfad);
|
||||
out_drv_init_failure:
|
||||
kthread_stop(bfad->bfad_tsk);
|
||||
out_kthread_create_failure:
|
||||
mutex_lock(&bfad_mutex);
|
||||
bfad_inst--;
|
||||
list_del(&bfad->list_entry);
|
||||
@ -1008,6 +1095,11 @@ bfad_pci_remove(struct pci_dev *pdev)
|
||||
|
||||
bfa_trc(bfad, bfad->inst_no);
|
||||
|
||||
spin_lock_irqsave(&bfad->bfad_lock, flags);
|
||||
if (bfad->bfad_tsk != NULL)
|
||||
kthread_stop(bfad->bfad_tsk);
|
||||
spin_unlock_irqrestore(&bfad->bfad_lock, flags);
|
||||
|
||||
if ((bfad->bfad_flags & BFAD_DRV_INIT_DONE)
|
||||
&& !(bfad->bfad_flags & BFAD_HAL_INIT_DONE)) {
|
||||
|
||||
@ -1024,13 +1116,25 @@ bfad_pci_remove(struct pci_dev *pdev)
|
||||
goto remove_sysfs;
|
||||
}
|
||||
|
||||
if (bfad->bfad_flags & BFAD_HAL_START_DONE)
|
||||
if (bfad->bfad_flags & BFAD_HAL_START_DONE) {
|
||||
bfad_drv_stop(bfad);
|
||||
} else if (bfad->bfad_flags & BFAD_DRV_INIT_DONE) {
|
||||
/* Invoking bfa_stop() before bfa_detach
|
||||
* when HAL and DRV init are success
|
||||
* but HAL start did not occur.
|
||||
*/
|
||||
spin_lock_irqsave(&bfad->bfad_lock, flags);
|
||||
init_completion(&bfad->comp);
|
||||
bfa_stop(&bfad->bfa);
|
||||
spin_unlock_irqrestore(&bfad->bfad_lock, flags);
|
||||
wait_for_completion(&bfad->comp);
|
||||
}
|
||||
|
||||
bfad_remove_intr(bfad);
|
||||
|
||||
del_timer_sync(&bfad->hal_tmo);
|
||||
bfad_fc4_probe_undo(bfad);
|
||||
|
||||
if (bfad->bfad_flags & BFAD_FC4_PROBE_DONE)
|
||||
bfad_fc4_probe_undo(bfad);
|
||||
|
||||
if (bfad->bfad_flags & BFAD_CFG_PPORT_DONE)
|
||||
bfad_uncfg_pport(bfad);
|
||||
|
@ -141,7 +141,7 @@ bfad_im_get_host_port_type(struct Scsi_Host *shost)
|
||||
struct bfad_s *bfad = im_port->bfad;
|
||||
struct bfa_pport_attr_s attr;
|
||||
|
||||
bfa_pport_get_attr(&bfad->bfa, &attr);
|
||||
bfa_fcport_get_attr(&bfad->bfa, &attr);
|
||||
|
||||
switch (attr.port_type) {
|
||||
case BFA_PPORT_TYPE_NPORT:
|
||||
@ -173,7 +173,7 @@ bfad_im_get_host_port_state(struct Scsi_Host *shost)
|
||||
struct bfad_s *bfad = im_port->bfad;
|
||||
struct bfa_pport_attr_s attr;
|
||||
|
||||
bfa_pport_get_attr(&bfad->bfa, &attr);
|
||||
bfa_fcport_get_attr(&bfad->bfa, &attr);
|
||||
|
||||
switch (attr.port_state) {
|
||||
case BFA_PPORT_ST_LINKDOWN:
|
||||
@ -229,8 +229,10 @@ bfad_im_get_host_speed(struct Scsi_Host *shost)
|
||||
(struct bfad_im_port_s *) shost->hostdata[0];
|
||||
struct bfad_s *bfad = im_port->bfad;
|
||||
struct bfa_pport_attr_s attr;
|
||||
unsigned long flags;
|
||||
|
||||
bfa_pport_get_attr(&bfad->bfa, &attr);
|
||||
spin_lock_irqsave(shost->host_lock, flags);
|
||||
bfa_fcport_get_attr(&bfad->bfa, &attr);
|
||||
switch (attr.speed) {
|
||||
case BFA_PPORT_SPEED_8GBPS:
|
||||
fc_host_speed(shost) = FC_PORTSPEED_8GBIT;
|
||||
@ -248,6 +250,7 @@ bfad_im_get_host_speed(struct Scsi_Host *shost)
|
||||
fc_host_speed(shost) = FC_PORTSPEED_UNKNOWN;
|
||||
break;
|
||||
}
|
||||
spin_unlock_irqrestore(shost->host_lock, flags);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -285,7 +288,7 @@ bfad_im_get_stats(struct Scsi_Host *shost)
|
||||
init_completion(&fcomp.comp);
|
||||
spin_lock_irqsave(&bfad->bfad_lock, flags);
|
||||
memset(hstats, 0, sizeof(struct fc_host_statistics));
|
||||
rc = bfa_pport_get_stats(&bfad->bfa,
|
||||
rc = bfa_port_get_stats(BFA_FCPORT(&bfad->bfa),
|
||||
(union bfa_pport_stats_u *) hstats,
|
||||
bfad_hcb_comp, &fcomp);
|
||||
spin_unlock_irqrestore(&bfad->bfad_lock, flags);
|
||||
@ -312,7 +315,8 @@ bfad_im_reset_stats(struct Scsi_Host *shost)
|
||||
|
||||
init_completion(&fcomp.comp);
|
||||
spin_lock_irqsave(&bfad->bfad_lock, flags);
|
||||
rc = bfa_pport_clear_stats(&bfad->bfa, bfad_hcb_comp, &fcomp);
|
||||
rc = bfa_port_clear_stats(BFA_FCPORT(&bfad->bfa), bfad_hcb_comp,
|
||||
&fcomp);
|
||||
spin_unlock_irqrestore(&bfad->bfad_lock, flags);
|
||||
|
||||
if (rc != BFA_STATUS_OK)
|
||||
@ -421,12 +425,10 @@ bfad_im_serial_num_show(struct device *dev, struct device_attribute *attr,
|
||||
struct bfad_im_port_s *im_port =
|
||||
(struct bfad_im_port_s *) shost->hostdata[0];
|
||||
struct bfad_s *bfad = im_port->bfad;
|
||||
struct bfa_ioc_attr_s ioc_attr;
|
||||
char serial_num[BFA_ADAPTER_SERIAL_NUM_LEN];
|
||||
|
||||
memset(&ioc_attr, 0, sizeof(ioc_attr));
|
||||
bfa_get_attr(&bfad->bfa, &ioc_attr);
|
||||
return snprintf(buf, PAGE_SIZE, "%s\n",
|
||||
ioc_attr.adapter_attr.serial_num);
|
||||
bfa_get_adapter_serial_num(&bfad->bfa, serial_num);
|
||||
return snprintf(buf, PAGE_SIZE, "%s\n", serial_num);
|
||||
}
|
||||
|
||||
static ssize_t
|
||||
@ -437,11 +439,10 @@ bfad_im_model_show(struct device *dev, struct device_attribute *attr,
|
||||
struct bfad_im_port_s *im_port =
|
||||
(struct bfad_im_port_s *) shost->hostdata[0];
|
||||
struct bfad_s *bfad = im_port->bfad;
|
||||
struct bfa_ioc_attr_s ioc_attr;
|
||||
char model[BFA_ADAPTER_MODEL_NAME_LEN];
|
||||
|
||||
memset(&ioc_attr, 0, sizeof(ioc_attr));
|
||||
bfa_get_attr(&bfad->bfa, &ioc_attr);
|
||||
return snprintf(buf, PAGE_SIZE, "%s\n", ioc_attr.adapter_attr.model);
|
||||
bfa_get_adapter_model(&bfad->bfa, model);
|
||||
return snprintf(buf, PAGE_SIZE, "%s\n", model);
|
||||
}
|
||||
|
||||
static ssize_t
|
||||
@ -452,12 +453,10 @@ bfad_im_model_desc_show(struct device *dev, struct device_attribute *attr,
|
||||
struct bfad_im_port_s *im_port =
|
||||
(struct bfad_im_port_s *) shost->hostdata[0];
|
||||
struct bfad_s *bfad = im_port->bfad;
|
||||
struct bfa_ioc_attr_s ioc_attr;
|
||||
char model_descr[BFA_ADAPTER_MODEL_DESCR_LEN];
|
||||
|
||||
memset(&ioc_attr, 0, sizeof(ioc_attr));
|
||||
bfa_get_attr(&bfad->bfa, &ioc_attr);
|
||||
return snprintf(buf, PAGE_SIZE, "%s\n",
|
||||
ioc_attr.adapter_attr.model_descr);
|
||||
bfa_get_adapter_model(&bfad->bfa, model_descr);
|
||||
return snprintf(buf, PAGE_SIZE, "%s\n", model_descr);
|
||||
}
|
||||
|
||||
static ssize_t
|
||||
@ -482,14 +481,13 @@ bfad_im_symbolic_name_show(struct device *dev, struct device_attribute *attr,
|
||||
struct bfad_im_port_s *im_port =
|
||||
(struct bfad_im_port_s *) shost->hostdata[0];
|
||||
struct bfad_s *bfad = im_port->bfad;
|
||||
struct bfa_ioc_attr_s ioc_attr;
|
||||
|
||||
memset(&ioc_attr, 0, sizeof(ioc_attr));
|
||||
bfa_get_attr(&bfad->bfa, &ioc_attr);
|
||||
char model[BFA_ADAPTER_MODEL_NAME_LEN];
|
||||
char fw_ver[BFA_VERSION_LEN];
|
||||
|
||||
bfa_get_adapter_model(&bfad->bfa, model);
|
||||
bfa_get_adapter_fw_ver(&bfad->bfa, fw_ver);
|
||||
return snprintf(buf, PAGE_SIZE, "Brocade %s FV%s DV%s\n",
|
||||
ioc_attr.adapter_attr.model,
|
||||
ioc_attr.adapter_attr.fw_ver, BFAD_DRIVER_VERSION);
|
||||
model, fw_ver, BFAD_DRIVER_VERSION);
|
||||
}
|
||||
|
||||
static ssize_t
|
||||
@ -500,11 +498,10 @@ bfad_im_hw_version_show(struct device *dev, struct device_attribute *attr,
|
||||
struct bfad_im_port_s *im_port =
|
||||
(struct bfad_im_port_s *) shost->hostdata[0];
|
||||
struct bfad_s *bfad = im_port->bfad;
|
||||
struct bfa_ioc_attr_s ioc_attr;
|
||||
char hw_ver[BFA_VERSION_LEN];
|
||||
|
||||
memset(&ioc_attr, 0, sizeof(ioc_attr));
|
||||
bfa_get_attr(&bfad->bfa, &ioc_attr);
|
||||
return snprintf(buf, PAGE_SIZE, "%s\n", ioc_attr.adapter_attr.hw_ver);
|
||||
bfa_get_pci_chip_rev(&bfad->bfa, hw_ver);
|
||||
return snprintf(buf, PAGE_SIZE, "%s\n", hw_ver);
|
||||
}
|
||||
|
||||
static ssize_t
|
||||
@ -522,12 +519,10 @@ bfad_im_optionrom_version_show(struct device *dev,
|
||||
struct bfad_im_port_s *im_port =
|
||||
(struct bfad_im_port_s *) shost->hostdata[0];
|
||||
struct bfad_s *bfad = im_port->bfad;
|
||||
struct bfa_ioc_attr_s ioc_attr;
|
||||
char optrom_ver[BFA_VERSION_LEN];
|
||||
|
||||
memset(&ioc_attr, 0, sizeof(ioc_attr));
|
||||
bfa_get_attr(&bfad->bfa, &ioc_attr);
|
||||
return snprintf(buf, PAGE_SIZE, "%s\n",
|
||||
ioc_attr.adapter_attr.optrom_ver);
|
||||
bfa_get_adapter_optrom_ver(&bfad->bfa, optrom_ver);
|
||||
return snprintf(buf, PAGE_SIZE, "%s\n", optrom_ver);
|
||||
}
|
||||
|
||||
static ssize_t
|
||||
@ -538,11 +533,10 @@ bfad_im_fw_version_show(struct device *dev, struct device_attribute *attr,
|
||||
struct bfad_im_port_s *im_port =
|
||||
(struct bfad_im_port_s *) shost->hostdata[0];
|
||||
struct bfad_s *bfad = im_port->bfad;
|
||||
struct bfa_ioc_attr_s ioc_attr;
|
||||
char fw_ver[BFA_VERSION_LEN];
|
||||
|
||||
memset(&ioc_attr, 0, sizeof(ioc_attr));
|
||||
bfa_get_attr(&bfad->bfa, &ioc_attr);
|
||||
return snprintf(buf, PAGE_SIZE, "%s\n", ioc_attr.adapter_attr.fw_ver);
|
||||
bfa_get_adapter_fw_ver(&bfad->bfa, fw_ver);
|
||||
return snprintf(buf, PAGE_SIZE, "%s\n", fw_ver);
|
||||
}
|
||||
|
||||
static ssize_t
|
||||
@ -553,11 +547,9 @@ bfad_im_num_of_ports_show(struct device *dev, struct device_attribute *attr,
|
||||
struct bfad_im_port_s *im_port =
|
||||
(struct bfad_im_port_s *) shost->hostdata[0];
|
||||
struct bfad_s *bfad = im_port->bfad;
|
||||
struct bfa_ioc_attr_s ioc_attr;
|
||||
|
||||
memset(&ioc_attr, 0, sizeof(ioc_attr));
|
||||
bfa_get_attr(&bfad->bfa, &ioc_attr);
|
||||
return snprintf(buf, PAGE_SIZE, "%d\n", ioc_attr.adapter_attr.nports);
|
||||
return snprintf(buf, PAGE_SIZE, "%d\n",
|
||||
bfa_get_nports(&bfad->bfa));
|
||||
}
|
||||
|
||||
static ssize_t
|
||||
|
@ -17,9 +17,6 @@
|
||||
|
||||
#ifndef __BFAD_ATTR_H__
|
||||
#define __BFAD_ATTR_H__
|
||||
/**
|
||||
* bfad_attr.h VMware driver configuration interface module.
|
||||
*/
|
||||
|
||||
/**
|
||||
* FC_transport_template FC transport template
|
||||
@ -52,12 +49,6 @@ bfad_im_get_starget_port_name(struct scsi_target *starget);
|
||||
void
|
||||
bfad_im_get_host_port_id(struct Scsi_Host *shost);
|
||||
|
||||
/**
|
||||
* FC transport template entry, issue a LIP.
|
||||
*/
|
||||
int
|
||||
bfad_im_issue_fc_host_lip(struct Scsi_Host *shost);
|
||||
|
||||
struct Scsi_Host*
|
||||
bfad_os_starget_to_shost(struct scsi_target *starget);
|
||||
|
||||
|
@ -46,7 +46,7 @@
|
||||
#ifdef BFA_DRIVER_VERSION
|
||||
#define BFAD_DRIVER_VERSION BFA_DRIVER_VERSION
|
||||
#else
|
||||
#define BFAD_DRIVER_VERSION "2.0.0.0"
|
||||
#define BFAD_DRIVER_VERSION "2.1.2.1"
|
||||
#endif
|
||||
|
||||
|
||||
@ -62,7 +62,9 @@
|
||||
#define BFAD_HAL_START_DONE 0x00000010
|
||||
#define BFAD_PORT_ONLINE 0x00000020
|
||||
#define BFAD_RPORT_ONLINE 0x00000040
|
||||
|
||||
#define BFAD_FCS_INIT_DONE 0x00000080
|
||||
#define BFAD_HAL_INIT_FAIL 0x00000100
|
||||
#define BFAD_FC4_PROBE_DONE 0x00000200
|
||||
#define BFAD_PORT_DELETE 0x00000001
|
||||
|
||||
/*
|
||||
@ -137,12 +139,16 @@ struct bfad_cfg_param_s {
|
||||
u32 binding_method;
|
||||
};
|
||||
|
||||
#define BFAD_AEN_MAX_APPS 8
|
||||
struct bfad_aen_file_s {
|
||||
struct list_head qe;
|
||||
struct bfad_s *bfad;
|
||||
s32 ri;
|
||||
s32 app_id;
|
||||
union bfad_tmp_buf {
|
||||
/* From struct bfa_adapter_attr_s */
|
||||
char manufacturer[BFA_ADAPTER_MFG_NAME_LEN];
|
||||
char serial_num[BFA_ADAPTER_SERIAL_NUM_LEN];
|
||||
char model[BFA_ADAPTER_MODEL_NAME_LEN];
|
||||
char fw_ver[BFA_VERSION_LEN];
|
||||
char optrom_ver[BFA_VERSION_LEN];
|
||||
|
||||
/* From struct bfa_ioc_pci_attr_s */
|
||||
u8 chip_rev[BFA_IOC_CHIP_REV_LEN]; /* chip revision */
|
||||
};
|
||||
|
||||
/*
|
||||
@ -168,6 +174,7 @@ struct bfad_s {
|
||||
u32 inst_no; /* BFAD instance number */
|
||||
u32 bfad_flags;
|
||||
spinlock_t bfad_lock;
|
||||
struct task_struct *bfad_tsk;
|
||||
struct bfad_cfg_param_s cfg_data;
|
||||
struct bfad_msix_s msix_tab[MAX_MSIX_ENTRY];
|
||||
int nvec;
|
||||
@ -183,18 +190,12 @@ struct bfad_s {
|
||||
struct bfa_log_mod_s *logmod;
|
||||
struct bfa_aen_s *aen;
|
||||
struct bfa_aen_s aen_buf;
|
||||
struct bfad_aen_file_s file_buf[BFAD_AEN_MAX_APPS];
|
||||
struct list_head file_q;
|
||||
struct list_head file_free_q;
|
||||
void *file_map[BFA_AEN_MAX_APP];
|
||||
struct bfa_plog_s plog_buf;
|
||||
int ref_count;
|
||||
bfa_boolean_t ipfc_enabled;
|
||||
union bfad_tmp_buf tmp_buf;
|
||||
struct fc_host_statistics link_stats;
|
||||
|
||||
struct kobject *bfa_kobj;
|
||||
struct kobject *ioc_kobj;
|
||||
struct kobject *pport_kobj;
|
||||
struct kobject *lport_kobj;
|
||||
};
|
||||
|
||||
/*
|
||||
@ -258,6 +259,7 @@ bfa_status_t bfad_vf_create(struct bfad_s *bfad, u16 vf_id,
|
||||
struct bfa_port_cfg_s *port_cfg);
|
||||
bfa_status_t bfad_cfg_pport(struct bfad_s *bfad, enum bfa_port_role role);
|
||||
bfa_status_t bfad_drv_init(struct bfad_s *bfad);
|
||||
bfa_status_t bfad_start_ops(struct bfad_s *bfad);
|
||||
void bfad_drv_start(struct bfad_s *bfad);
|
||||
void bfad_uncfg_pport(struct bfad_s *bfad);
|
||||
void bfad_drv_stop(struct bfad_s *bfad);
|
||||
@ -279,6 +281,7 @@ void bfad_drv_uninit(struct bfad_s *bfad);
|
||||
void bfad_drv_log_level_set(struct bfad_s *bfad);
|
||||
bfa_status_t bfad_fc4_module_init(void);
|
||||
void bfad_fc4_module_exit(void);
|
||||
int bfad_worker (void *ptr);
|
||||
|
||||
void bfad_pci_remove(struct pci_dev *pdev);
|
||||
int bfad_pci_probe(struct pci_dev *pdev, const struct pci_device_id *pid);
|
||||
|
@ -43,11 +43,11 @@ bfa_cb_ioim_done(void *drv, struct bfad_ioim_s *dio,
|
||||
struct bfad_s *bfad = drv;
|
||||
struct bfad_itnim_data_s *itnim_data;
|
||||
struct bfad_itnim_s *itnim;
|
||||
u8 host_status = DID_OK;
|
||||
|
||||
switch (io_status) {
|
||||
case BFI_IOIM_STS_OK:
|
||||
bfa_trc(bfad, scsi_status);
|
||||
cmnd->result = ScsiResult(DID_OK, scsi_status);
|
||||
scsi_set_resid(cmnd, 0);
|
||||
|
||||
if (sns_len > 0) {
|
||||
@ -56,8 +56,18 @@ bfa_cb_ioim_done(void *drv, struct bfad_ioim_s *dio,
|
||||
sns_len = SCSI_SENSE_BUFFERSIZE;
|
||||
memcpy(cmnd->sense_buffer, sns_info, sns_len);
|
||||
}
|
||||
if (residue > 0)
|
||||
if (residue > 0) {
|
||||
bfa_trc(bfad, residue);
|
||||
scsi_set_resid(cmnd, residue);
|
||||
if (!sns_len && (scsi_status == SAM_STAT_GOOD) &&
|
||||
(scsi_bufflen(cmnd) - residue) <
|
||||
cmnd->underflow) {
|
||||
bfa_trc(bfad, 0);
|
||||
host_status = DID_ERROR;
|
||||
}
|
||||
}
|
||||
cmnd->result = ScsiResult(host_status, scsi_status);
|
||||
|
||||
break;
|
||||
|
||||
case BFI_IOIM_STS_ABORTED:
|
||||
@ -167,17 +177,15 @@ bfad_im_info(struct Scsi_Host *shost)
|
||||
static char bfa_buf[256];
|
||||
struct bfad_im_port_s *im_port =
|
||||
(struct bfad_im_port_s *) shost->hostdata[0];
|
||||
struct bfa_ioc_attr_s ioc_attr;
|
||||
struct bfad_s *bfad = im_port->bfad;
|
||||
char model[BFA_ADAPTER_MODEL_NAME_LEN];
|
||||
|
||||
memset(&ioc_attr, 0, sizeof(ioc_attr));
|
||||
bfa_get_attr(&bfad->bfa, &ioc_attr);
|
||||
bfa_get_adapter_model(&bfad->bfa, model);
|
||||
|
||||
memset(bfa_buf, 0, sizeof(bfa_buf));
|
||||
snprintf(bfa_buf, sizeof(bfa_buf),
|
||||
"Brocade FC/FCOE Adapter, " "model: %s hwpath: %s driver: %s",
|
||||
ioc_attr.adapter_attr.model, bfad->pci_name,
|
||||
BFAD_DRIVER_VERSION);
|
||||
"Brocade FC/FCOE Adapter, " "model: %s hwpath: %s driver: %s",
|
||||
model, bfad->pci_name, BFAD_DRIVER_VERSION);
|
||||
return bfa_buf;
|
||||
}
|
||||
|
||||
@ -500,16 +508,6 @@ void bfa_fcb_itnim_tov(struct bfad_itnim_s *itnim)
|
||||
itnim->state = ITNIM_STATE_TIMEOUT;
|
||||
}
|
||||
|
||||
/**
|
||||
* Path TOV processing begin notification -- dummy for linux
|
||||
*/
|
||||
void
|
||||
bfa_fcb_itnim_tov_begin(struct bfad_itnim_s *itnim)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Allocate a Scsi_Host for a port.
|
||||
*/
|
||||
@ -931,10 +929,9 @@ bfad_os_fc_host_init(struct bfad_im_port_s *im_port)
|
||||
struct Scsi_Host *host = im_port->shost;
|
||||
struct bfad_s *bfad = im_port->bfad;
|
||||
struct bfad_port_s *port = im_port->port;
|
||||
union attr {
|
||||
struct bfa_pport_attr_s pattr;
|
||||
struct bfa_ioc_attr_s ioc_attr;
|
||||
} attr;
|
||||
struct bfa_pport_attr_s pattr;
|
||||
char model[BFA_ADAPTER_MODEL_NAME_LEN];
|
||||
char fw_ver[BFA_VERSION_LEN];
|
||||
|
||||
fc_host_node_name(host) =
|
||||
bfa_os_htonll((bfa_fcs_port_get_nwwn(port->fcs_port)));
|
||||
@ -954,20 +951,18 @@ bfad_os_fc_host_init(struct bfad_im_port_s *im_port)
|
||||
/* For fibre channel services type 0x20 */
|
||||
fc_host_supported_fc4s(host)[7] = 1;
|
||||
|
||||
memset(&attr.ioc_attr, 0, sizeof(attr.ioc_attr));
|
||||
bfa_get_attr(&bfad->bfa, &attr.ioc_attr);
|
||||
bfa_get_adapter_model(&bfad->bfa, model);
|
||||
bfa_get_adapter_fw_ver(&bfad->bfa, fw_ver);
|
||||
sprintf(fc_host_symbolic_name(host), "Brocade %s FV%s DV%s",
|
||||
attr.ioc_attr.adapter_attr.model,
|
||||
attr.ioc_attr.adapter_attr.fw_ver, BFAD_DRIVER_VERSION);
|
||||
model, fw_ver, BFAD_DRIVER_VERSION);
|
||||
|
||||
fc_host_supported_speeds(host) = 0;
|
||||
fc_host_supported_speeds(host) |=
|
||||
FC_PORTSPEED_8GBIT | FC_PORTSPEED_4GBIT | FC_PORTSPEED_2GBIT |
|
||||
FC_PORTSPEED_1GBIT;
|
||||
|
||||
memset(&attr.pattr, 0, sizeof(attr.pattr));
|
||||
bfa_pport_get_attr(&bfad->bfa, &attr.pattr);
|
||||
fc_host_maxframe_size(host) = attr.pattr.pport_cfg.maxfrsize;
|
||||
bfa_fcport_get_attr(&bfad->bfa, &pattr);
|
||||
fc_host_maxframe_size(host) = pattr.pport_cfg.maxfrsize;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -23,7 +23,6 @@
|
||||
|
||||
#define FCPI_NAME " fcpim"
|
||||
|
||||
void bfad_flags_set(struct bfad_s *bfad, u32 flags);
|
||||
bfa_status_t bfad_im_module_init(void);
|
||||
void bfad_im_module_exit(void);
|
||||
bfa_status_t bfad_im_probe(struct bfad_s *bfad);
|
||||
@ -126,7 +125,6 @@ bfa_status_t bfad_os_thread_workq(struct bfad_s *bfad);
|
||||
void bfad_os_destroy_workq(struct bfad_im_s *im);
|
||||
void bfad_os_itnim_process(struct bfad_itnim_s *itnim_drv);
|
||||
void bfad_os_fc_host_init(struct bfad_im_port_s *im_port);
|
||||
void bfad_os_init_work(struct bfad_im_port_s *im_port);
|
||||
void bfad_os_scsi_host_free(struct bfad_s *bfad,
|
||||
struct bfad_im_port_s *im_port);
|
||||
void bfad_os_ramp_up_qdepth(struct bfad_itnim_s *itnim,
|
||||
@ -136,9 +134,6 @@ struct bfad_itnim_s *bfad_os_get_itnim(struct bfad_im_port_s *im_port, int id);
|
||||
int bfad_os_scsi_add_host(struct Scsi_Host *shost,
|
||||
struct bfad_im_port_s *im_port, struct bfad_s *bfad);
|
||||
|
||||
/*
|
||||
* scsi_host_template entries
|
||||
*/
|
||||
void bfad_im_itnim_unmap(struct bfad_im_port_s *im_port,
|
||||
struct bfad_itnim_s *itnim);
|
||||
|
||||
|
@ -23,8 +23,10 @@ BFA_TRC_FILE(LDRV, INTR);
|
||||
/**
|
||||
* bfa_isr BFA driver interrupt functions
|
||||
*/
|
||||
static int msix_disable;
|
||||
module_param(msix_disable, int, S_IRUGO | S_IWUSR);
|
||||
static int msix_disable_cb;
|
||||
static int msix_disable_ct;
|
||||
module_param(msix_disable_cb, int, S_IRUGO | S_IWUSR);
|
||||
module_param(msix_disable_ct, int, S_IRUGO | S_IWUSR);
|
||||
/**
|
||||
* Line based interrupt handler.
|
||||
*/
|
||||
@ -141,6 +143,7 @@ bfad_setup_intr(struct bfad_s *bfad)
|
||||
int error = 0;
|
||||
u32 mask = 0, i, num_bit = 0, max_bit = 0;
|
||||
struct msix_entry msix_entries[MAX_MSIX_ENTRY];
|
||||
struct pci_dev *pdev = bfad->pcidev;
|
||||
|
||||
/* Call BFA to get the msix map for this PCI function. */
|
||||
bfa_msix_getvecs(&bfad->bfa, &mask, &num_bit, &max_bit);
|
||||
@ -148,7 +151,9 @@ bfad_setup_intr(struct bfad_s *bfad)
|
||||
/* Set up the msix entry table */
|
||||
bfad_init_msix_entry(bfad, msix_entries, mask, max_bit);
|
||||
|
||||
if (!msix_disable) {
|
||||
if ((pdev->device == BFA_PCI_DEVICE_ID_CT && !msix_disable_ct) ||
|
||||
(pdev->device != BFA_PCI_DEVICE_ID_CT && !msix_disable_cb)) {
|
||||
|
||||
error = pci_enable_msix(bfad->pcidev, msix_entries, bfad->nvec);
|
||||
if (error) {
|
||||
/*
|
||||
|
@ -37,7 +37,7 @@ BFA_TRC_FILE(FCS, FABRIC);
|
||||
#define BFA_FCS_FABRIC_CLEANUP_DELAY (10000) /* Milliseconds */
|
||||
|
||||
#define bfa_fcs_fabric_set_opertype(__fabric) do { \
|
||||
if (bfa_pport_get_topology((__fabric)->fcs->bfa) \
|
||||
if (bfa_fcport_get_topology((__fabric)->fcs->bfa) \
|
||||
== BFA_PPORT_TOPOLOGY_P2P) \
|
||||
(__fabric)->oper_type = BFA_PPORT_TYPE_NPORT; \
|
||||
else \
|
||||
@ -136,8 +136,7 @@ bfa_fcs_fabric_sm_uninit(struct bfa_fcs_fabric_s *fabric,
|
||||
case BFA_FCS_FABRIC_SM_CREATE:
|
||||
bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_created);
|
||||
bfa_fcs_fabric_init(fabric);
|
||||
bfa_fcs_lport_init(&fabric->bport, fabric->fcs, FC_VF_ID_NULL,
|
||||
&fabric->bport.port_cfg, NULL);
|
||||
bfa_fcs_lport_init(&fabric->bport, &fabric->bport.port_cfg);
|
||||
break;
|
||||
|
||||
case BFA_FCS_FABRIC_SM_LINK_UP:
|
||||
@ -161,7 +160,7 @@ bfa_fcs_fabric_sm_created(struct bfa_fcs_fabric_s *fabric,
|
||||
|
||||
switch (event) {
|
||||
case BFA_FCS_FABRIC_SM_START:
|
||||
if (bfa_pport_is_linkup(fabric->fcs->bfa)) {
|
||||
if (bfa_fcport_is_linkup(fabric->fcs->bfa)) {
|
||||
bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_flogi);
|
||||
bfa_fcs_fabric_login(fabric);
|
||||
} else
|
||||
@ -225,7 +224,7 @@ bfa_fcs_fabric_sm_flogi(struct bfa_fcs_fabric_s *fabric,
|
||||
switch (event) {
|
||||
case BFA_FCS_FABRIC_SM_CONT_OP:
|
||||
|
||||
bfa_pport_set_tx_bbcredit(fabric->fcs->bfa, fabric->bb_credit);
|
||||
bfa_fcport_set_tx_bbcredit(fabric->fcs->bfa, fabric->bb_credit);
|
||||
fabric->fab_type = BFA_FCS_FABRIC_SWITCHED;
|
||||
|
||||
if (fabric->auth_reqd && fabric->is_auth) {
|
||||
@ -252,7 +251,7 @@ bfa_fcs_fabric_sm_flogi(struct bfa_fcs_fabric_s *fabric,
|
||||
|
||||
case BFA_FCS_FABRIC_SM_NO_FABRIC:
|
||||
fabric->fab_type = BFA_FCS_FABRIC_N2N;
|
||||
bfa_pport_set_tx_bbcredit(fabric->fcs->bfa, fabric->bb_credit);
|
||||
bfa_fcport_set_tx_bbcredit(fabric->fcs->bfa, fabric->bb_credit);
|
||||
bfa_fcs_fabric_notify_online(fabric);
|
||||
bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_nofabric);
|
||||
break;
|
||||
@ -419,7 +418,7 @@ bfa_fcs_fabric_sm_nofabric(struct bfa_fcs_fabric_s *fabric,
|
||||
|
||||
case BFA_FCS_FABRIC_SM_NO_FABRIC:
|
||||
bfa_trc(fabric->fcs, fabric->bb_credit);
|
||||
bfa_pport_set_tx_bbcredit(fabric->fcs->bfa, fabric->bb_credit);
|
||||
bfa_fcport_set_tx_bbcredit(fabric->fcs->bfa, fabric->bb_credit);
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -563,17 +562,15 @@ void
|
||||
bfa_fcs_fabric_psymb_init(struct bfa_fcs_fabric_s *fabric)
|
||||
{
|
||||
struct bfa_port_cfg_s *port_cfg = &fabric->bport.port_cfg;
|
||||
struct bfa_adapter_attr_s adapter_attr;
|
||||
char model[BFA_ADAPTER_MODEL_NAME_LEN] = {0};
|
||||
struct bfa_fcs_driver_info_s *driver_info = &fabric->fcs->driver_info;
|
||||
|
||||
bfa_os_memset((void *)&adapter_attr, 0,
|
||||
sizeof(struct bfa_adapter_attr_s));
|
||||
bfa_ioc_get_adapter_attr(&fabric->fcs->bfa->ioc, &adapter_attr);
|
||||
bfa_ioc_get_adapter_model(&fabric->fcs->bfa->ioc, model);
|
||||
|
||||
/*
|
||||
* Model name/number
|
||||
*/
|
||||
strncpy((char *)&port_cfg->sym_name, adapter_attr.model,
|
||||
strncpy((char *)&port_cfg->sym_name, model,
|
||||
BFA_FCS_PORT_SYMBNAME_MODEL_SZ);
|
||||
strncat((char *)&port_cfg->sym_name, BFA_FCS_PORT_SYMBNAME_SEPARATOR,
|
||||
sizeof(BFA_FCS_PORT_SYMBNAME_SEPARATOR));
|
||||
@ -719,10 +716,10 @@ bfa_fcs_fabric_login(struct bfa_fcs_fabric_s *fabric)
|
||||
struct bfa_port_cfg_s *pcfg = &fabric->bport.port_cfg;
|
||||
u8 alpa = 0;
|
||||
|
||||
if (bfa_pport_get_topology(bfa) == BFA_PPORT_TOPOLOGY_LOOP)
|
||||
alpa = bfa_pport_get_myalpa(bfa);
|
||||
if (bfa_fcport_get_topology(bfa) == BFA_PPORT_TOPOLOGY_LOOP)
|
||||
alpa = bfa_fcport_get_myalpa(bfa);
|
||||
|
||||
bfa_lps_flogi(fabric->lps, fabric, alpa, bfa_pport_get_maxfrsize(bfa),
|
||||
bfa_lps_flogi(fabric->lps, fabric, alpa, bfa_fcport_get_maxfrsize(bfa),
|
||||
pcfg->pwwn, pcfg->nwwn, fabric->auth_reqd);
|
||||
|
||||
fabric->stats.flogi_sent++;
|
||||
@ -814,10 +811,10 @@ bfa_fcs_fabric_delete_comp(void *cbarg)
|
||||
*/
|
||||
|
||||
/**
|
||||
* Module initialization
|
||||
* Attach time initialization
|
||||
*/
|
||||
void
|
||||
bfa_fcs_fabric_modinit(struct bfa_fcs_s *fcs)
|
||||
bfa_fcs_fabric_attach(struct bfa_fcs_s *fcs)
|
||||
{
|
||||
struct bfa_fcs_fabric_s *fabric;
|
||||
|
||||
@ -841,7 +838,13 @@ bfa_fcs_fabric_modinit(struct bfa_fcs_s *fcs)
|
||||
bfa_wc_up(&fabric->wc); /* For the base port */
|
||||
|
||||
bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_uninit);
|
||||
bfa_sm_send_event(fabric, BFA_FCS_FABRIC_SM_CREATE);
|
||||
bfa_fcs_lport_attach(&fabric->bport, fabric->fcs, FC_VF_ID_NULL, NULL);
|
||||
}
|
||||
|
||||
void
|
||||
bfa_fcs_fabric_modinit(struct bfa_fcs_s *fcs)
|
||||
{
|
||||
bfa_sm_send_event(&fcs->fabric, BFA_FCS_FABRIC_SM_CREATE);
|
||||
bfa_trc(fcs, 0);
|
||||
}
|
||||
|
||||
@ -890,6 +893,12 @@ bfa_fcs_fabric_is_loopback(struct bfa_fcs_fabric_s *fabric)
|
||||
return bfa_sm_cmp_state(fabric, bfa_fcs_fabric_sm_loopback);
|
||||
}
|
||||
|
||||
bfa_boolean_t
|
||||
bfa_fcs_fabric_is_auth_failed(struct bfa_fcs_fabric_s *fabric)
|
||||
{
|
||||
return bfa_sm_cmp_state(fabric, bfa_fcs_fabric_sm_auth_failed);
|
||||
}
|
||||
|
||||
enum bfa_pport_type
|
||||
bfa_fcs_fabric_port_type(struct bfa_fcs_fabric_s *fabric)
|
||||
{
|
||||
@ -1165,8 +1174,8 @@ bfa_fcs_fabric_send_flogi_acc(struct bfa_fcs_fabric_s *fabric)
|
||||
reqlen = fc_flogi_acc_build(&fchs, bfa_fcxp_get_reqbuf(fcxp),
|
||||
bfa_os_hton3b(FC_FABRIC_PORT),
|
||||
n2n_port->reply_oxid, pcfg->pwwn,
|
||||
pcfg->nwwn, bfa_pport_get_maxfrsize(bfa),
|
||||
bfa_pport_get_rx_bbcredit(bfa));
|
||||
pcfg->nwwn, bfa_fcport_get_maxfrsize(bfa),
|
||||
bfa_fcport_get_rx_bbcredit(bfa));
|
||||
|
||||
bfa_fcxp_send(fcxp, NULL, fabric->vf_id, bfa_lps_get_tag(fabric->lps),
|
||||
BFA_FALSE, FC_CLASS_3, reqlen, &fchs,
|
||||
@ -1224,14 +1233,8 @@ bfa_fcs_fabric_aen_post(struct bfa_fcs_port_s *port,
|
||||
wwn2str(pwwn_ptr, pwwn);
|
||||
wwn2str(fwwn_ptr, fwwn);
|
||||
|
||||
switch (event) {
|
||||
case BFA_PORT_AEN_FABRIC_NAME_CHANGE:
|
||||
bfa_log(logmod, BFA_AEN_PORT_FABRIC_NAME_CHANGE, pwwn_ptr,
|
||||
fwwn_ptr);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
bfa_log(logmod, BFA_LOG_CREATE_ID(BFA_AEN_CAT_PORT, event),
|
||||
pwwn_ptr, fwwn_ptr);
|
||||
|
||||
aen_data.port.pwwn = pwwn;
|
||||
aen_data.port.fwwn = fwwn;
|
||||
|
@ -72,6 +72,9 @@ fc_rpsc_operspeed_to_bfa_speed(enum fc_rpsc_op_speed_s speed)
|
||||
case RPSC_OP_SPEED_8G:
|
||||
return BFA_PPORT_SPEED_8GBPS;
|
||||
|
||||
case RPSC_OP_SPEED_10G:
|
||||
return BFA_PPORT_SPEED_10GBPS;
|
||||
|
||||
default:
|
||||
return BFA_PPORT_SPEED_UNKNOWN;
|
||||
}
|
||||
@ -97,6 +100,9 @@ fc_bfa_speed_to_rpsc_operspeed(enum bfa_pport_speed op_speed)
|
||||
case BFA_PPORT_SPEED_8GBPS:
|
||||
return RPSC_OP_SPEED_8G;
|
||||
|
||||
case BFA_PPORT_SPEED_10GBPS:
|
||||
return RPSC_OP_SPEED_10G;
|
||||
|
||||
default:
|
||||
return RPSC_OP_SPEED_NOT_EST;
|
||||
}
|
||||
|
@ -126,7 +126,7 @@ bfa_fcs_itnim_sm_offline(struct bfa_fcs_itnim_s *itnim,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(itnim->fcs, event);
|
||||
}
|
||||
|
||||
}
|
||||
@ -161,7 +161,7 @@ bfa_fcs_itnim_sm_prli_send(struct bfa_fcs_itnim_s *itnim,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(itnim->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -205,7 +205,7 @@ bfa_fcs_itnim_sm_prli(struct bfa_fcs_itnim_s *itnim,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(itnim->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -240,7 +240,7 @@ bfa_fcs_itnim_sm_prli_retry(struct bfa_fcs_itnim_s *itnim,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(itnim->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -270,7 +270,7 @@ bfa_fcs_itnim_sm_hcb_online(struct bfa_fcs_itnim_s *itnim,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(itnim->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -298,7 +298,7 @@ bfa_fcs_itnim_sm_online(struct bfa_fcs_itnim_s *itnim,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(itnim->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -321,7 +321,7 @@ bfa_fcs_itnim_sm_hcb_offline(struct bfa_fcs_itnim_s *itnim,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(itnim->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -354,7 +354,7 @@ bfa_fcs_itnim_sm_initiator(struct bfa_fcs_itnim_s *itnim,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(itnim->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -385,19 +385,8 @@ bfa_fcs_itnim_aen_post(struct bfa_fcs_itnim_s *itnim,
|
||||
wwn2str(lpwwn_ptr, lpwwn);
|
||||
wwn2str(rpwwn_ptr, rpwwn);
|
||||
|
||||
switch (event) {
|
||||
case BFA_ITNIM_AEN_ONLINE:
|
||||
bfa_log(logmod, BFA_AEN_ITNIM_ONLINE, rpwwn_ptr, lpwwn_ptr);
|
||||
break;
|
||||
case BFA_ITNIM_AEN_OFFLINE:
|
||||
bfa_log(logmod, BFA_AEN_ITNIM_OFFLINE, rpwwn_ptr, lpwwn_ptr);
|
||||
break;
|
||||
case BFA_ITNIM_AEN_DISCONNECT:
|
||||
bfa_log(logmod, BFA_AEN_ITNIM_DISCONNECT, rpwwn_ptr, lpwwn_ptr);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
bfa_log(logmod, BFA_LOG_CREATE_ID(BFA_AEN_CAT_ITNIM, event),
|
||||
rpwwn_ptr, lpwwn_ptr);
|
||||
|
||||
aen_data.itnim.vf_id = rport->port->fabric->vf_id;
|
||||
aen_data.itnim.ppwwn =
|
||||
@ -689,7 +678,6 @@ bfa_cb_itnim_tov_begin(void *cb_arg)
|
||||
struct bfa_fcs_itnim_s *itnim = (struct bfa_fcs_itnim_s *)cb_arg;
|
||||
|
||||
bfa_trc(itnim->fcs, itnim->rport->pwwn);
|
||||
bfa_fcb_itnim_tov_begin(itnim->itnim_drv);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -822,22 +810,3 @@ void
|
||||
bfa_fcs_itnim_resume(struct bfa_fcs_itnim_s *itnim)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Module initialization
|
||||
*/
|
||||
void
|
||||
bfa_fcs_fcpim_modinit(struct bfa_fcs_s *fcs)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Module cleanup
|
||||
*/
|
||||
void
|
||||
bfa_fcs_fcpim_modexit(struct bfa_fcs_s *fcs)
|
||||
{
|
||||
bfa_fcs_modexit_comp(fcs);
|
||||
}
|
||||
|
||||
|
||||
|
@ -29,6 +29,7 @@
|
||||
/*
|
||||
* fcs friend functions: only between fcs modules
|
||||
*/
|
||||
void bfa_fcs_fabric_attach(struct bfa_fcs_s *fcs);
|
||||
void bfa_fcs_fabric_modinit(struct bfa_fcs_s *fcs);
|
||||
void bfa_fcs_fabric_modexit(struct bfa_fcs_s *fcs);
|
||||
void bfa_fcs_fabric_modsusp(struct bfa_fcs_s *fcs);
|
||||
@ -46,6 +47,7 @@ void bfa_fcs_fabric_uf_recv(struct bfa_fcs_fabric_s *fabric,
|
||||
struct fchs_s *fchs, u16 len);
|
||||
u16 bfa_fcs_fabric_vport_count(struct bfa_fcs_fabric_s *fabric);
|
||||
bfa_boolean_t bfa_fcs_fabric_is_loopback(struct bfa_fcs_fabric_s *fabric);
|
||||
bfa_boolean_t bfa_fcs_fabric_is_auth_failed(struct bfa_fcs_fabric_s *fabric);
|
||||
enum bfa_pport_type bfa_fcs_fabric_port_type(struct bfa_fcs_fabric_s *fabric);
|
||||
void bfa_fcs_fabric_psymb_init(struct bfa_fcs_fabric_s *fabric);
|
||||
void bfa_fcs_fabric_port_delete_comp(struct bfa_fcs_fabric_s *fabric);
|
||||
|
@ -34,11 +34,6 @@ void bfa_fcs_itnim_is_initiator(struct bfa_fcs_itnim_s *itnim);
|
||||
void bfa_fcs_itnim_pause(struct bfa_fcs_itnim_s *itnim);
|
||||
void bfa_fcs_itnim_resume(struct bfa_fcs_itnim_s *itnim);
|
||||
|
||||
/*
|
||||
* Modudle init/cleanup routines.
|
||||
*/
|
||||
void bfa_fcs_fcpim_modinit(struct bfa_fcs_s *fcs);
|
||||
void bfa_fcs_fcpim_modexit(struct bfa_fcs_s *fcs);
|
||||
void bfa_fcs_fcpim_uf_recv(struct bfa_fcs_itnim_s *itnim, struct fchs_s *fchs,
|
||||
u16 len);
|
||||
#endif /* __FCS_FCPIM_H__ */
|
||||
|
@ -84,9 +84,10 @@ void bfa_fcs_port_uf_recv(struct bfa_fcs_port_s *lport, struct fchs_s *fchs,
|
||||
* Following routines will be called by Fabric to indicate port
|
||||
* online/offline to vport.
|
||||
*/
|
||||
void bfa_fcs_lport_init(struct bfa_fcs_port_s *lport, struct bfa_fcs_s *fcs,
|
||||
u16 vf_id, struct bfa_port_cfg_s *port_cfg,
|
||||
struct bfa_fcs_vport_s *vport);
|
||||
void bfa_fcs_lport_attach(struct bfa_fcs_port_s *lport, struct bfa_fcs_s *fcs,
|
||||
uint16_t vf_id, struct bfa_fcs_vport_s *vport);
|
||||
void bfa_fcs_lport_init(struct bfa_fcs_port_s *lport,
|
||||
struct bfa_port_cfg_s *port_cfg);
|
||||
void bfa_fcs_port_online(struct bfa_fcs_port_s *port);
|
||||
void bfa_fcs_port_offline(struct bfa_fcs_port_s *port);
|
||||
void bfa_fcs_port_delete(struct bfa_fcs_port_s *port);
|
||||
|
@ -26,7 +26,6 @@
|
||||
/*
|
||||
* fcs friend functions: only between fcs modules
|
||||
*/
|
||||
void bfa_fcs_pport_modinit(struct bfa_fcs_s *fcs);
|
||||
void bfa_fcs_pport_modexit(struct bfa_fcs_s *fcs);
|
||||
void bfa_fcs_pport_attach(struct bfa_fcs_s *fcs);
|
||||
|
||||
#endif /* __FCS_PPORT_H__ */
|
||||
|
@ -24,9 +24,6 @@
|
||||
|
||||
#include <fcs/bfa_fcs_rport.h>
|
||||
|
||||
void bfa_fcs_rport_modinit(struct bfa_fcs_s *fcs);
|
||||
void bfa_fcs_rport_modexit(struct bfa_fcs_s *fcs);
|
||||
|
||||
void bfa_fcs_rport_uf_recv(struct bfa_fcs_rport_s *rport, struct fchs_s *fchs,
|
||||
u16 len);
|
||||
void bfa_fcs_rport_scn(struct bfa_fcs_rport_s *rport);
|
||||
|
@ -26,7 +26,6 @@
|
||||
/*
|
||||
* fcs friend functions: only between fcs modules
|
||||
*/
|
||||
void bfa_fcs_uf_modinit(struct bfa_fcs_s *fcs);
|
||||
void bfa_fcs_uf_modexit(struct bfa_fcs_s *fcs);
|
||||
void bfa_fcs_uf_attach(struct bfa_fcs_s *fcs);
|
||||
|
||||
#endif /* __FCS_UF_H__ */
|
||||
|
@ -22,18 +22,10 @@
|
||||
#include <fcs/bfa_fcs_vport.h>
|
||||
#include <defs/bfa_defs_pci.h>
|
||||
|
||||
/*
|
||||
* Modudle init/cleanup routines.
|
||||
*/
|
||||
|
||||
void bfa_fcs_vport_modinit(struct bfa_fcs_s *fcs);
|
||||
void bfa_fcs_vport_modexit(struct bfa_fcs_s *fcs);
|
||||
|
||||
void bfa_fcs_vport_cleanup(struct bfa_fcs_vport_s *vport);
|
||||
void bfa_fcs_vport_online(struct bfa_fcs_vport_s *vport);
|
||||
void bfa_fcs_vport_offline(struct bfa_fcs_vport_s *vport);
|
||||
void bfa_fcs_vport_delete_comp(struct bfa_fcs_vport_s *vport);
|
||||
u32 bfa_fcs_vport_get_max(struct bfa_fcs_s *fcs);
|
||||
|
||||
#endif /* __FCS_VPORT_H__ */
|
||||
|
||||
|
@ -116,6 +116,9 @@ static void bfa_fcs_port_fdmi_sm_rpa_retry(struct bfa_fcs_port_fdmi_s *fdmi,
|
||||
enum port_fdmi_event event);
|
||||
static void bfa_fcs_port_fdmi_sm_online(struct bfa_fcs_port_fdmi_s *fdmi,
|
||||
enum port_fdmi_event event);
|
||||
static void bfa_fcs_port_fdmi_sm_disabled(struct bfa_fcs_port_fdmi_s *fdmi,
|
||||
enum port_fdmi_event event);
|
||||
|
||||
/**
|
||||
* Start in offline state - awaiting MS to send start.
|
||||
*/
|
||||
@ -155,7 +158,7 @@ bfa_fcs_port_fdmi_sm_offline(struct bfa_fcs_port_fdmi_s *fdmi,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(port->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -180,7 +183,7 @@ bfa_fcs_port_fdmi_sm_sending_rhba(struct bfa_fcs_port_fdmi_s *fdmi,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(port->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -227,7 +230,7 @@ bfa_fcs_port_fdmi_sm_rhba(struct bfa_fcs_port_fdmi_s *fdmi,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(port->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -255,7 +258,7 @@ bfa_fcs_port_fdmi_sm_rhba_retry(struct bfa_fcs_port_fdmi_s *fdmi,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(port->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -283,7 +286,7 @@ bfa_fcs_port_fdmi_sm_sending_rprt(struct bfa_fcs_port_fdmi_s *fdmi,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(port->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -328,7 +331,7 @@ bfa_fcs_port_fdmi_sm_rprt(struct bfa_fcs_port_fdmi_s *fdmi,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(port->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -356,7 +359,7 @@ bfa_fcs_port_fdmi_sm_rprt_retry(struct bfa_fcs_port_fdmi_s *fdmi,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(port->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -384,7 +387,7 @@ bfa_fcs_port_fdmi_sm_sending_rpa(struct bfa_fcs_port_fdmi_s *fdmi,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(port->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -428,7 +431,7 @@ bfa_fcs_port_fdmi_sm_rpa(struct bfa_fcs_port_fdmi_s *fdmi,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(port->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -456,7 +459,7 @@ bfa_fcs_port_fdmi_sm_rpa_retry(struct bfa_fcs_port_fdmi_s *fdmi,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(port->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -475,10 +478,24 @@ bfa_fcs_port_fdmi_sm_online(struct bfa_fcs_port_fdmi_s *fdmi,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(port->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* FDMI is disabled state.
|
||||
*/
|
||||
static void
|
||||
bfa_fcs_port_fdmi_sm_disabled(struct bfa_fcs_port_fdmi_s *fdmi,
|
||||
enum port_fdmi_event event)
|
||||
{
|
||||
struct bfa_fcs_port_s *port = fdmi->ms->port;
|
||||
|
||||
bfa_trc(port->fcs, port->port_cfg.pwwn);
|
||||
bfa_trc(port->fcs, event);
|
||||
|
||||
/* No op State. It can only be enabled at Driver Init. */
|
||||
}
|
||||
|
||||
/**
|
||||
* RHBA : Register HBA Attributes.
|
||||
@ -1097,36 +1114,23 @@ bfa_fcs_fdmi_get_hbaattr(struct bfa_fcs_port_fdmi_s *fdmi,
|
||||
{
|
||||
struct bfa_fcs_port_s *port = fdmi->ms->port;
|
||||
struct bfa_fcs_driver_info_s *driver_info = &port->fcs->driver_info;
|
||||
struct bfa_adapter_attr_s adapter_attr;
|
||||
|
||||
bfa_os_memset(hba_attr, 0, sizeof(struct bfa_fcs_fdmi_hba_attr_s));
|
||||
bfa_os_memset(&adapter_attr, 0, sizeof(struct bfa_adapter_attr_s));
|
||||
|
||||
bfa_ioc_get_adapter_attr(&port->fcs->bfa->ioc, &adapter_attr);
|
||||
|
||||
strncpy(hba_attr->manufacturer, adapter_attr.manufacturer,
|
||||
sizeof(adapter_attr.manufacturer));
|
||||
|
||||
strncpy(hba_attr->serial_num, adapter_attr.serial_num,
|
||||
sizeof(adapter_attr.serial_num));
|
||||
|
||||
strncpy(hba_attr->model, adapter_attr.model, sizeof(hba_attr->model));
|
||||
|
||||
strncpy(hba_attr->model_desc, adapter_attr.model_descr,
|
||||
sizeof(hba_attr->model_desc));
|
||||
|
||||
strncpy(hba_attr->hw_version, adapter_attr.hw_ver,
|
||||
sizeof(hba_attr->hw_version));
|
||||
bfa_ioc_get_adapter_manufacturer(&port->fcs->bfa->ioc,
|
||||
hba_attr->manufacturer);
|
||||
bfa_ioc_get_adapter_serial_num(&port->fcs->bfa->ioc,
|
||||
hba_attr->serial_num);
|
||||
bfa_ioc_get_adapter_model(&port->fcs->bfa->ioc, hba_attr->model);
|
||||
bfa_ioc_get_adapter_model(&port->fcs->bfa->ioc, hba_attr->model_desc);
|
||||
bfa_ioc_get_pci_chip_rev(&port->fcs->bfa->ioc, hba_attr->hw_version);
|
||||
bfa_ioc_get_adapter_optrom_ver(&port->fcs->bfa->ioc,
|
||||
hba_attr->option_rom_ver);
|
||||
bfa_ioc_get_adapter_fw_ver(&port->fcs->bfa->ioc, hba_attr->fw_version);
|
||||
|
||||
strncpy(hba_attr->driver_version, (char *)driver_info->version,
|
||||
sizeof(hba_attr->driver_version));
|
||||
|
||||
strncpy(hba_attr->option_rom_ver, adapter_attr.optrom_ver,
|
||||
sizeof(hba_attr->option_rom_ver));
|
||||
|
||||
strncpy(hba_attr->fw_version, adapter_attr.fw_ver,
|
||||
sizeof(hba_attr->fw_version));
|
||||
|
||||
strncpy(hba_attr->os_name, driver_info->host_os_name,
|
||||
sizeof(hba_attr->os_name));
|
||||
|
||||
@ -1158,7 +1162,7 @@ bfa_fcs_fdmi_get_portattr(struct bfa_fcs_port_fdmi_s *fdmi,
|
||||
/*
|
||||
* get pport attributes from hal
|
||||
*/
|
||||
bfa_pport_get_attr(port->fcs->bfa, &pport_attr);
|
||||
bfa_fcport_get_attr(port->fcs->bfa, &pport_attr);
|
||||
|
||||
/*
|
||||
* get FC4 type Bitmask
|
||||
@ -1201,7 +1205,10 @@ bfa_fcs_port_fdmi_init(struct bfa_fcs_port_ms_s *ms)
|
||||
struct bfa_fcs_port_fdmi_s *fdmi = &ms->fdmi;
|
||||
|
||||
fdmi->ms = ms;
|
||||
bfa_sm_set_state(fdmi, bfa_fcs_port_fdmi_sm_offline);
|
||||
if (ms->port->fcs->fdmi_enabled)
|
||||
bfa_sm_set_state(fdmi, bfa_fcs_port_fdmi_sm_offline);
|
||||
else
|
||||
bfa_sm_set_state(fdmi, bfa_fcs_port_fdmi_sm_disabled);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -18,21 +18,24 @@
|
||||
#define __BFA_AEN_H__
|
||||
|
||||
#include "defs/bfa_defs_aen.h"
|
||||
#include "defs/bfa_defs_status.h"
|
||||
#include "cs/bfa_debug.h"
|
||||
|
||||
#define BFA_AEN_MAX_ENTRY 512
|
||||
#define BFA_AEN_MAX_ENTRY 512
|
||||
|
||||
extern s32 bfa_aen_max_cfg_entry;
|
||||
extern int bfa_aen_max_cfg_entry;
|
||||
struct bfa_aen_s {
|
||||
void *bfad;
|
||||
s32 max_entry;
|
||||
s32 write_index;
|
||||
s32 read_index;
|
||||
u32 bfad_num;
|
||||
u32 seq_num;
|
||||
int max_entry;
|
||||
int write_index;
|
||||
int read_index;
|
||||
int bfad_num;
|
||||
int seq_num;
|
||||
void (*aen_cb_notify)(void *bfad);
|
||||
void (*gettimeofday)(struct bfa_timeval_s *tv);
|
||||
struct bfa_trc_mod_s *trcmod;
|
||||
struct bfa_aen_entry_s list[BFA_AEN_MAX_ENTRY]; /* Must be the last */
|
||||
struct bfa_trc_mod_s *trcmod;
|
||||
int app_ri[BFA_AEN_MAX_APP]; /* For multiclient support */
|
||||
struct bfa_aen_entry_s list[BFA_AEN_MAX_ENTRY]; /* Must be the last */
|
||||
};
|
||||
|
||||
|
||||
@ -45,48 +48,49 @@ bfa_aen_set_max_cfg_entry(int max_entry)
|
||||
bfa_aen_max_cfg_entry = max_entry;
|
||||
}
|
||||
|
||||
static inline s32
|
||||
static inline int
|
||||
bfa_aen_get_max_cfg_entry(void)
|
||||
{
|
||||
return bfa_aen_max_cfg_entry;
|
||||
}
|
||||
|
||||
static inline s32
|
||||
static inline int
|
||||
bfa_aen_get_meminfo(void)
|
||||
{
|
||||
return sizeof(struct bfa_aen_entry_s) * bfa_aen_get_max_cfg_entry();
|
||||
}
|
||||
|
||||
static inline s32
|
||||
static inline int
|
||||
bfa_aen_get_wi(struct bfa_aen_s *aen)
|
||||
{
|
||||
return aen->write_index;
|
||||
}
|
||||
|
||||
static inline s32
|
||||
static inline int
|
||||
bfa_aen_get_ri(struct bfa_aen_s *aen)
|
||||
{
|
||||
return aen->read_index;
|
||||
}
|
||||
|
||||
static inline s32
|
||||
bfa_aen_fetch_count(struct bfa_aen_s *aen, s32 read_index)
|
||||
static inline int
|
||||
bfa_aen_fetch_count(struct bfa_aen_s *aen, enum bfa_aen_app app_id)
|
||||
{
|
||||
return ((aen->write_index + aen->max_entry) - read_index)
|
||||
bfa_assert((app_id < BFA_AEN_MAX_APP) && (app_id >= bfa_aen_app_bcu));
|
||||
return ((aen->write_index + aen->max_entry) - aen->app_ri[app_id])
|
||||
% aen->max_entry;
|
||||
}
|
||||
|
||||
s32 bfa_aen_init(struct bfa_aen_s *aen, struct bfa_trc_mod_s *trcmod,
|
||||
void *bfad, u32 inst_id, void (*aen_cb_notify)(void *),
|
||||
int bfa_aen_init(struct bfa_aen_s *aen, struct bfa_trc_mod_s *trcmod,
|
||||
void *bfad, int bfad_num, void (*aen_cb_notify)(void *),
|
||||
void (*gettimeofday)(struct bfa_timeval_s *));
|
||||
|
||||
s32 bfa_aen_post(struct bfa_aen_s *aen, enum bfa_aen_category aen_category,
|
||||
void bfa_aen_post(struct bfa_aen_s *aen, enum bfa_aen_category aen_category,
|
||||
int aen_type, union bfa_aen_data_u *aen_data);
|
||||
|
||||
s32 bfa_aen_fetch(struct bfa_aen_s *aen, struct bfa_aen_entry_s *aen_entry,
|
||||
s32 entry_space, s32 rii, s32 *ri_arr,
|
||||
s32 ri_arr_cnt);
|
||||
bfa_status_t bfa_aen_fetch(struct bfa_aen_s *aen,
|
||||
struct bfa_aen_entry_s *aen_entry,
|
||||
int entry_req, enum bfa_aen_app app_id, int *entry_ret);
|
||||
|
||||
s32 bfa_aen_get_inst(struct bfa_aen_s *aen);
|
||||
int bfa_aen_get_inst(struct bfa_aen_s *aen);
|
||||
|
||||
#endif /* __BFA_AEN_H__ */
|
||||
|
@ -106,6 +106,26 @@ struct bfa_sge_s {
|
||||
bfa_ioc_fetch_stats(&(__bfa)->ioc, __ioc_stats)
|
||||
#define bfa_ioc_clear_stats(__bfa) \
|
||||
bfa_ioc_clr_stats(&(__bfa)->ioc)
|
||||
#define bfa_get_nports(__bfa) \
|
||||
bfa_ioc_get_nports(&(__bfa)->ioc)
|
||||
#define bfa_get_adapter_manufacturer(__bfa, __manufacturer) \
|
||||
bfa_ioc_get_adapter_manufacturer(&(__bfa)->ioc, __manufacturer)
|
||||
#define bfa_get_adapter_model(__bfa, __model) \
|
||||
bfa_ioc_get_adapter_model(&(__bfa)->ioc, __model)
|
||||
#define bfa_get_adapter_serial_num(__bfa, __serial_num) \
|
||||
bfa_ioc_get_adapter_serial_num(&(__bfa)->ioc, __serial_num)
|
||||
#define bfa_get_adapter_fw_ver(__bfa, __fw_ver) \
|
||||
bfa_ioc_get_adapter_fw_ver(&(__bfa)->ioc, __fw_ver)
|
||||
#define bfa_get_adapter_optrom_ver(__bfa, __optrom_ver) \
|
||||
bfa_ioc_get_adapter_optrom_ver(&(__bfa)->ioc, __optrom_ver)
|
||||
#define bfa_get_pci_chip_rev(__bfa, __chip_rev) \
|
||||
bfa_ioc_get_pci_chip_rev(&(__bfa)->ioc, __chip_rev)
|
||||
#define bfa_get_ioc_state(__bfa) \
|
||||
bfa_ioc_get_state(&(__bfa)->ioc)
|
||||
#define bfa_get_type(__bfa) \
|
||||
bfa_ioc_get_type(&(__bfa)->ioc)
|
||||
#define bfa_get_mac(__bfa) \
|
||||
bfa_ioc_get_mac(&(__bfa)->ioc)
|
||||
|
||||
/*
|
||||
* bfa API functions
|
||||
@ -161,6 +181,7 @@ bfa_status_t bfa_iocfc_israttr_set(struct bfa_s *bfa,
|
||||
void bfa_iocfc_enable(struct bfa_s *bfa);
|
||||
void bfa_iocfc_disable(struct bfa_s *bfa);
|
||||
void bfa_ioc_auto_recover(bfa_boolean_t auto_recover);
|
||||
void bfa_chip_reset(struct bfa_s *bfa);
|
||||
void bfa_cb_ioc_disable(void *bfad);
|
||||
void bfa_timer_tick(struct bfa_s *bfa);
|
||||
#define bfa_timer_start(_bfa, _timer, _timercb, _arg, _timeout) \
|
||||
@ -171,6 +192,7 @@ void bfa_timer_tick(struct bfa_s *bfa);
|
||||
*/
|
||||
bfa_status_t bfa_debug_fwtrc(struct bfa_s *bfa, void *trcdata, int *trclen);
|
||||
bfa_status_t bfa_debug_fwsave(struct bfa_s *bfa, void *trcdata, int *trclen);
|
||||
void bfa_debug_fwsave_clear(struct bfa_s *bfa);
|
||||
|
||||
#include "bfa_priv.h"
|
||||
|
||||
|
@ -26,6 +26,7 @@ struct bfa_fcxp_s;
|
||||
#include <defs/bfa_defs_pport.h>
|
||||
#include <defs/bfa_defs_rport.h>
|
||||
#include <defs/bfa_defs_qos.h>
|
||||
#include <defs/bfa_defs_fcport.h>
|
||||
#include <cs/bfa_sm.h>
|
||||
#include <bfa.h>
|
||||
|
||||
@ -35,7 +36,7 @@ struct bfa_fcxp_s;
|
||||
struct bfa_rport_info_s {
|
||||
u16 max_frmsz; /* max rcv pdu size */
|
||||
u32 pid:24, /* remote port ID */
|
||||
lp_tag:8;
|
||||
lp_tag:8; /* tag */
|
||||
u32 local_pid:24, /* local port ID */
|
||||
cisc:8; /* CIRO supported */
|
||||
u8 fc_class; /* supported FC classes. enum fc_cos */
|
||||
@ -54,7 +55,7 @@ struct bfa_rport_s {
|
||||
void *rport_drv; /* fcs/driver rport object */
|
||||
u16 fw_handle; /* firmware rport handle */
|
||||
u16 rport_tag; /* BFA rport tag */
|
||||
struct bfa_rport_info_s rport_info; /* rport info from *fcs/driver */
|
||||
struct bfa_rport_info_s rport_info; /* rport info from fcs/driver */
|
||||
struct bfa_reqq_wait_s reqq_wait; /* to wait for room in reqq */
|
||||
struct bfa_cb_qe_s hcb_qe; /* BFA callback qelem */
|
||||
struct bfa_rport_hal_stats_s stats; /* BFA rport statistics */
|
||||
@ -101,7 +102,7 @@ struct bfa_uf_buf_s {
|
||||
struct bfa_uf_s {
|
||||
struct list_head qe; /* queue element */
|
||||
struct bfa_s *bfa; /* bfa instance */
|
||||
u16 uf_tag; /* identifying tag f/w messages */
|
||||
u16 uf_tag; /* identifying tag fw msgs */
|
||||
u16 vf_id;
|
||||
u16 src_rport_handle;
|
||||
u16 rsvd;
|
||||
@ -127,7 +128,7 @@ struct bfa_lps_s {
|
||||
u8 reqq; /* lport request queue */
|
||||
u8 alpa; /* ALPA for loop topologies */
|
||||
u32 lp_pid; /* lport port ID */
|
||||
bfa_boolean_t fdisc; /* send FDISC instead of FLOGI*/
|
||||
bfa_boolean_t fdisc; /* send FDISC instead of FLOGI */
|
||||
bfa_boolean_t auth_en; /* enable authentication */
|
||||
bfa_boolean_t auth_req; /* authentication required */
|
||||
bfa_boolean_t npiv_en; /* NPIV is allowed by peer */
|
||||
@ -151,60 +152,69 @@ struct bfa_lps_s {
|
||||
bfa_eproto_status_t ext_status;
|
||||
};
|
||||
|
||||
#define BFA_FCPORT(_bfa) (&((_bfa)->modules.port))
|
||||
|
||||
/*
|
||||
* bfa pport API functions
|
||||
*/
|
||||
bfa_status_t bfa_pport_enable(struct bfa_s *bfa);
|
||||
bfa_status_t bfa_pport_disable(struct bfa_s *bfa);
|
||||
bfa_status_t bfa_pport_cfg_speed(struct bfa_s *bfa,
|
||||
bfa_status_t bfa_fcport_enable(struct bfa_s *bfa);
|
||||
bfa_status_t bfa_fcport_disable(struct bfa_s *bfa);
|
||||
bfa_status_t bfa_fcport_cfg_speed(struct bfa_s *bfa,
|
||||
enum bfa_pport_speed speed);
|
||||
enum bfa_pport_speed bfa_pport_get_speed(struct bfa_s *bfa);
|
||||
bfa_status_t bfa_pport_cfg_topology(struct bfa_s *bfa,
|
||||
enum bfa_pport_speed bfa_fcport_get_speed(struct bfa_s *bfa);
|
||||
bfa_status_t bfa_fcport_cfg_topology(struct bfa_s *bfa,
|
||||
enum bfa_pport_topology topo);
|
||||
enum bfa_pport_topology bfa_pport_get_topology(struct bfa_s *bfa);
|
||||
bfa_status_t bfa_pport_cfg_hardalpa(struct bfa_s *bfa, u8 alpa);
|
||||
bfa_boolean_t bfa_pport_get_hardalpa(struct bfa_s *bfa, u8 *alpa);
|
||||
u8 bfa_pport_get_myalpa(struct bfa_s *bfa);
|
||||
bfa_status_t bfa_pport_clr_hardalpa(struct bfa_s *bfa);
|
||||
bfa_status_t bfa_pport_cfg_maxfrsize(struct bfa_s *bfa, u16 maxsize);
|
||||
u16 bfa_pport_get_maxfrsize(struct bfa_s *bfa);
|
||||
u32 bfa_pport_mypid(struct bfa_s *bfa);
|
||||
u8 bfa_pport_get_rx_bbcredit(struct bfa_s *bfa);
|
||||
bfa_status_t bfa_pport_trunk_enable(struct bfa_s *bfa, u8 bitmap);
|
||||
bfa_status_t bfa_pport_trunk_disable(struct bfa_s *bfa);
|
||||
bfa_boolean_t bfa_pport_trunk_query(struct bfa_s *bfa, u32 *bitmap);
|
||||
void bfa_pport_get_attr(struct bfa_s *bfa, struct bfa_pport_attr_s *attr);
|
||||
wwn_t bfa_pport_get_wwn(struct bfa_s *bfa, bfa_boolean_t node);
|
||||
bfa_status_t bfa_pport_get_stats(struct bfa_s *bfa,
|
||||
union bfa_pport_stats_u *stats,
|
||||
bfa_cb_pport_t cbfn, void *cbarg);
|
||||
bfa_status_t bfa_pport_clear_stats(struct bfa_s *bfa, bfa_cb_pport_t cbfn,
|
||||
void *cbarg);
|
||||
void bfa_pport_event_register(struct bfa_s *bfa,
|
||||
enum bfa_pport_topology bfa_fcport_get_topology(struct bfa_s *bfa);
|
||||
bfa_status_t bfa_fcport_cfg_hardalpa(struct bfa_s *bfa, u8 alpa);
|
||||
bfa_boolean_t bfa_fcport_get_hardalpa(struct bfa_s *bfa, u8 *alpa);
|
||||
u8 bfa_fcport_get_myalpa(struct bfa_s *bfa);
|
||||
bfa_status_t bfa_fcport_clr_hardalpa(struct bfa_s *bfa);
|
||||
bfa_status_t bfa_fcport_cfg_maxfrsize(struct bfa_s *bfa, u16 maxsize);
|
||||
u16 bfa_fcport_get_maxfrsize(struct bfa_s *bfa);
|
||||
u32 bfa_fcport_mypid(struct bfa_s *bfa);
|
||||
u8 bfa_fcport_get_rx_bbcredit(struct bfa_s *bfa);
|
||||
bfa_status_t bfa_fcport_trunk_enable(struct bfa_s *bfa, u8 bitmap);
|
||||
bfa_status_t bfa_fcport_trunk_disable(struct bfa_s *bfa);
|
||||
bfa_boolean_t bfa_fcport_trunk_query(struct bfa_s *bfa, u32 *bitmap);
|
||||
void bfa_fcport_get_attr(struct bfa_s *bfa, struct bfa_pport_attr_s *attr);
|
||||
wwn_t bfa_fcport_get_wwn(struct bfa_s *bfa, bfa_boolean_t node);
|
||||
void bfa_fcport_event_register(struct bfa_s *bfa,
|
||||
void (*event_cbfn) (void *cbarg,
|
||||
bfa_pport_event_t event), void *event_cbarg);
|
||||
bfa_boolean_t bfa_pport_is_disabled(struct bfa_s *bfa);
|
||||
void bfa_pport_cfg_qos(struct bfa_s *bfa, bfa_boolean_t on_off);
|
||||
void bfa_pport_cfg_ratelim(struct bfa_s *bfa, bfa_boolean_t on_off);
|
||||
bfa_status_t bfa_pport_cfg_ratelim_speed(struct bfa_s *bfa,
|
||||
bfa_boolean_t bfa_fcport_is_disabled(struct bfa_s *bfa);
|
||||
void bfa_fcport_cfg_qos(struct bfa_s *bfa, bfa_boolean_t on_off);
|
||||
void bfa_fcport_cfg_ratelim(struct bfa_s *bfa, bfa_boolean_t on_off);
|
||||
bfa_status_t bfa_fcport_cfg_ratelim_speed(struct bfa_s *bfa,
|
||||
enum bfa_pport_speed speed);
|
||||
enum bfa_pport_speed bfa_pport_get_ratelim_speed(struct bfa_s *bfa);
|
||||
enum bfa_pport_speed bfa_fcport_get_ratelim_speed(struct bfa_s *bfa);
|
||||
|
||||
void bfa_pport_set_tx_bbcredit(struct bfa_s *bfa, u16 tx_bbcredit);
|
||||
void bfa_pport_busy(struct bfa_s *bfa, bfa_boolean_t status);
|
||||
void bfa_pport_beacon(struct bfa_s *bfa, bfa_boolean_t beacon,
|
||||
void bfa_fcport_set_tx_bbcredit(struct bfa_s *bfa, u16 tx_bbcredit);
|
||||
void bfa_fcport_busy(struct bfa_s *bfa, bfa_boolean_t status);
|
||||
void bfa_fcport_beacon(struct bfa_s *bfa, bfa_boolean_t beacon,
|
||||
bfa_boolean_t link_e2e_beacon);
|
||||
void bfa_cb_pport_event(void *cbarg, bfa_pport_event_t event);
|
||||
void bfa_pport_qos_get_attr(struct bfa_s *bfa, struct bfa_qos_attr_s *qos_attr);
|
||||
void bfa_pport_qos_get_vc_attr(struct bfa_s *bfa,
|
||||
void bfa_fcport_qos_get_attr(struct bfa_s *bfa,
|
||||
struct bfa_qos_attr_s *qos_attr);
|
||||
void bfa_fcport_qos_get_vc_attr(struct bfa_s *bfa,
|
||||
struct bfa_qos_vc_attr_s *qos_vc_attr);
|
||||
bfa_status_t bfa_pport_get_qos_stats(struct bfa_s *bfa,
|
||||
union bfa_pport_stats_u *stats,
|
||||
bfa_status_t bfa_fcport_get_qos_stats(struct bfa_s *bfa,
|
||||
union bfa_fcport_stats_u *stats,
|
||||
bfa_cb_pport_t cbfn, void *cbarg);
|
||||
bfa_status_t bfa_pport_clear_qos_stats(struct bfa_s *bfa, bfa_cb_pport_t cbfn,
|
||||
bfa_status_t bfa_fcport_clear_qos_stats(struct bfa_s *bfa, bfa_cb_pport_t cbfn,
|
||||
void *cbarg);
|
||||
bfa_boolean_t bfa_pport_is_ratelim(struct bfa_s *bfa);
|
||||
bfa_boolean_t bfa_pport_is_linkup(struct bfa_s *bfa);
|
||||
bfa_status_t bfa_fcport_get_fcoe_stats(struct bfa_s *bfa,
|
||||
union bfa_fcport_stats_u *stats,
|
||||
bfa_cb_pport_t cbfn, void *cbarg);
|
||||
bfa_status_t bfa_fcport_clear_fcoe_stats(struct bfa_s *bfa, bfa_cb_pport_t cbfn,
|
||||
void *cbarg);
|
||||
|
||||
bfa_boolean_t bfa_fcport_is_ratelim(struct bfa_s *bfa);
|
||||
bfa_boolean_t bfa_fcport_is_linkup(struct bfa_s *bfa);
|
||||
bfa_status_t bfa_fcport_get_stats(struct bfa_s *bfa,
|
||||
union bfa_fcport_stats_u *stats,
|
||||
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 rport API functions
|
||||
@ -293,6 +303,7 @@ void bfa_uf_free(struct bfa_uf_s *uf);
|
||||
* bfa lport service api
|
||||
*/
|
||||
|
||||
u32 bfa_lps_get_max_vport(struct bfa_s *bfa);
|
||||
struct bfa_lps_s *bfa_lps_alloc(struct bfa_s *bfa);
|
||||
void bfa_lps_delete(struct bfa_lps_s *lps);
|
||||
void bfa_lps_discard(struct bfa_lps_s *lps);
|
||||
@ -315,10 +326,12 @@ wwn_t bfa_lps_get_peer_pwwn(struct bfa_lps_s *lps);
|
||||
wwn_t bfa_lps_get_peer_nwwn(struct bfa_lps_s *lps);
|
||||
u8 bfa_lps_get_lsrjt_rsn(struct bfa_lps_s *lps);
|
||||
u8 bfa_lps_get_lsrjt_expl(struct bfa_lps_s *lps);
|
||||
mac_t bfa_lps_get_lp_mac(struct bfa_lps_s *lps);
|
||||
void bfa_cb_lps_flogi_comp(void *bfad, void *uarg, bfa_status_t status);
|
||||
void bfa_cb_lps_flogo_comp(void *bfad, void *uarg);
|
||||
void bfa_cb_lps_fdisc_comp(void *bfad, void *uarg, bfa_status_t status);
|
||||
void bfa_cb_lps_fdisclogo_comp(void *bfad, void *uarg);
|
||||
void bfa_cb_lps_cvl_event(void *bfad, void *uarg);
|
||||
|
||||
#endif /* __BFA_SVC_H__ */
|
||||
|
||||
|
@ -41,7 +41,7 @@ struct bfa_timer_mod_s {
|
||||
struct list_head timer_q;
|
||||
};
|
||||
|
||||
#define BFA_TIMER_FREQ 500 /**< specified in millisecs */
|
||||
#define BFA_TIMER_FREQ 200 /**< specified in millisecs */
|
||||
|
||||
void bfa_timer_beat(struct bfa_timer_mod_s *mod);
|
||||
void bfa_timer_init(struct bfa_timer_mod_s *mod);
|
||||
|
@ -143,8 +143,8 @@ enum bfi_mclass {
|
||||
BFI_MC_IOC = 1, /* IO Controller (IOC) */
|
||||
BFI_MC_DIAG = 2, /* Diagnostic Msgs */
|
||||
BFI_MC_FLASH = 3, /* Flash message class */
|
||||
BFI_MC_CEE = 4,
|
||||
BFI_MC_FC_PORT = 5, /* FC port */
|
||||
BFI_MC_CEE = 4, /* CEE */
|
||||
BFI_MC_FCPORT = 5, /* FC port */
|
||||
BFI_MC_IOCFC = 6, /* FC - IO Controller (IOC) */
|
||||
BFI_MC_LL = 7, /* Link Layer */
|
||||
BFI_MC_UF = 8, /* Unsolicited frame receive */
|
||||
|
@ -177,7 +177,21 @@
|
||||
#define __PSS_LMEM_INIT_EN 0x00000100
|
||||
#define __PSS_LPU1_RESET 0x00000002
|
||||
#define __PSS_LPU0_RESET 0x00000001
|
||||
|
||||
#define PSS_ERR_STATUS_REG 0x00018810
|
||||
#define __PSS_LMEM1_CORR_ERR 0x00000800
|
||||
#define __PSS_LMEM0_CORR_ERR 0x00000400
|
||||
#define __PSS_LMEM1_UNCORR_ERR 0x00000200
|
||||
#define __PSS_LMEM0_UNCORR_ERR 0x00000100
|
||||
#define __PSS_BAL_PERR 0x00000080
|
||||
#define __PSS_DIP_IF_ERR 0x00000040
|
||||
#define __PSS_IOH_IF_ERR 0x00000020
|
||||
#define __PSS_TDS_IF_ERR 0x00000010
|
||||
#define __PSS_RDS_IF_ERR 0x00000008
|
||||
#define __PSS_SGM_IF_ERR 0x00000004
|
||||
#define __PSS_LPU1_RAM_ERR 0x00000002
|
||||
#define __PSS_LPU0_RAM_ERR 0x00000001
|
||||
#define ERR_SET_REG 0x00018818
|
||||
#define __PSS_ERR_STATUS_SET 0x00000fff
|
||||
|
||||
/*
|
||||
* These definitions are either in error/missing in spec. Its auto-generated
|
||||
|
@ -430,6 +430,31 @@ enum {
|
||||
#define __PSS_LMEM_INIT_EN 0x00000100
|
||||
#define __PSS_LPU1_RESET 0x00000002
|
||||
#define __PSS_LPU0_RESET 0x00000001
|
||||
#define PSS_ERR_STATUS_REG 0x00018810
|
||||
#define __PSS_LPU1_TCM_READ_ERR 0x00200000
|
||||
#define __PSS_LPU0_TCM_READ_ERR 0x00100000
|
||||
#define __PSS_LMEM5_CORR_ERR 0x00080000
|
||||
#define __PSS_LMEM4_CORR_ERR 0x00040000
|
||||
#define __PSS_LMEM3_CORR_ERR 0x00020000
|
||||
#define __PSS_LMEM2_CORR_ERR 0x00010000
|
||||
#define __PSS_LMEM1_CORR_ERR 0x00008000
|
||||
#define __PSS_LMEM0_CORR_ERR 0x00004000
|
||||
#define __PSS_LMEM5_UNCORR_ERR 0x00002000
|
||||
#define __PSS_LMEM4_UNCORR_ERR 0x00001000
|
||||
#define __PSS_LMEM3_UNCORR_ERR 0x00000800
|
||||
#define __PSS_LMEM2_UNCORR_ERR 0x00000400
|
||||
#define __PSS_LMEM1_UNCORR_ERR 0x00000200
|
||||
#define __PSS_LMEM0_UNCORR_ERR 0x00000100
|
||||
#define __PSS_BAL_PERR 0x00000080
|
||||
#define __PSS_DIP_IF_ERR 0x00000040
|
||||
#define __PSS_IOH_IF_ERR 0x00000020
|
||||
#define __PSS_TDS_IF_ERR 0x00000010
|
||||
#define __PSS_RDS_IF_ERR 0x00000008
|
||||
#define __PSS_SGM_IF_ERR 0x00000004
|
||||
#define __PSS_LPU1_RAM_ERR 0x00000002
|
||||
#define __PSS_LPU0_RAM_ERR 0x00000001
|
||||
#define ERR_SET_REG 0x00018818
|
||||
#define __PSS_ERR_STATUS_SET 0x003fffff
|
||||
#define HQM_QSET0_RXQ_DRBL_P0 0x00038000
|
||||
#define __RXQ0_ADD_VECTORS_P 0x80000000
|
||||
#define __RXQ0_STOP_P 0x40000000
|
||||
@ -589,6 +614,7 @@ enum {
|
||||
#define __HFN_INT_MBOX_LPU1 0x00200000U
|
||||
#define __HFN_INT_MBOX1_LPU0 0x00400000U
|
||||
#define __HFN_INT_MBOX1_LPU1 0x00800000U
|
||||
#define __HFN_INT_LL_HALT 0x01000000U
|
||||
#define __HFN_INT_CPE_MASK 0x000000ffU
|
||||
#define __HFN_INT_RME_MASK 0x0000ff00U
|
||||
|
||||
|
@ -123,7 +123,7 @@ enum bfi_ioc_state {
|
||||
BFI_IOC_DISABLING = 5, /* IOC is being disabled */
|
||||
BFI_IOC_DISABLED = 6, /* IOC is disabled */
|
||||
BFI_IOC_CFG_DISABLED = 7, /* IOC is being disabled;transient */
|
||||
BFI_IOC_HBFAIL = 8, /* IOC heart-beat failure */
|
||||
BFI_IOC_FAIL = 8, /* IOC heart-beat failure */
|
||||
BFI_IOC_MEMTEST = 9, /* IOC is doing memtest */
|
||||
};
|
||||
|
||||
|
@ -30,6 +30,7 @@ enum bfi_lps_h2i_msgs {
|
||||
enum bfi_lps_i2h_msgs {
|
||||
BFI_LPS_H2I_LOGIN_RSP = BFA_I2HM(1),
|
||||
BFI_LPS_H2I_LOGOUT_RSP = BFA_I2HM(2),
|
||||
BFI_LPS_H2I_CVL_EVENT = BFA_I2HM(3),
|
||||
};
|
||||
|
||||
struct bfi_lps_login_req_s {
|
||||
@ -77,6 +78,12 @@ struct bfi_lps_logout_rsp_s {
|
||||
u8 rsvd[2];
|
||||
};
|
||||
|
||||
struct bfi_lps_cvl_event_s {
|
||||
struct bfi_mhdr_s mh; /* common msg header */
|
||||
u8 lp_tag;
|
||||
u8 rsvd[3];
|
||||
};
|
||||
|
||||
union bfi_lps_h2i_msg_u {
|
||||
struct bfi_mhdr_s *msg;
|
||||
struct bfi_lps_login_req_s *login_req;
|
||||
@ -87,6 +94,7 @@ union bfi_lps_i2h_msg_u {
|
||||
struct bfi_msg_s *msg;
|
||||
struct bfi_lps_login_rsp_s *login_rsp;
|
||||
struct bfi_lps_logout_rsp_s *logout_rsp;
|
||||
struct bfi_lps_cvl_event_s *cvl_event;
|
||||
};
|
||||
|
||||
#pragma pack()
|
||||
|
@ -22,163 +22,97 @@
|
||||
|
||||
#pragma pack(1)
|
||||
|
||||
enum bfi_pport_h2i {
|
||||
BFI_PPORT_H2I_ENABLE_REQ = (1),
|
||||
BFI_PPORT_H2I_DISABLE_REQ = (2),
|
||||
BFI_PPORT_H2I_GET_STATS_REQ = (3),
|
||||
BFI_PPORT_H2I_CLEAR_STATS_REQ = (4),
|
||||
BFI_PPORT_H2I_SET_SVC_PARAMS_REQ = (5),
|
||||
BFI_PPORT_H2I_ENABLE_RX_VF_TAG_REQ = (6),
|
||||
BFI_PPORT_H2I_ENABLE_TX_VF_TAG_REQ = (7),
|
||||
BFI_PPORT_H2I_GET_QOS_STATS_REQ = (8),
|
||||
BFI_PPORT_H2I_CLEAR_QOS_STATS_REQ = (9),
|
||||
enum bfi_fcport_h2i {
|
||||
BFI_FCPORT_H2I_ENABLE_REQ = (1),
|
||||
BFI_FCPORT_H2I_DISABLE_REQ = (2),
|
||||
BFI_FCPORT_H2I_SET_SVC_PARAMS_REQ = (3),
|
||||
BFI_FCPORT_H2I_STATS_GET_REQ = (4),
|
||||
BFI_FCPORT_H2I_STATS_CLEAR_REQ = (5),
|
||||
};
|
||||
|
||||
enum bfi_pport_i2h {
|
||||
BFI_PPORT_I2H_ENABLE_RSP = BFA_I2HM(1),
|
||||
BFI_PPORT_I2H_DISABLE_RSP = BFA_I2HM(2),
|
||||
BFI_PPORT_I2H_GET_STATS_RSP = BFA_I2HM(3),
|
||||
BFI_PPORT_I2H_CLEAR_STATS_RSP = BFA_I2HM(4),
|
||||
BFI_PPORT_I2H_SET_SVC_PARAMS_RSP = BFA_I2HM(5),
|
||||
BFI_PPORT_I2H_ENABLE_RX_VF_TAG_RSP = BFA_I2HM(6),
|
||||
BFI_PPORT_I2H_ENABLE_TX_VF_TAG_RSP = BFA_I2HM(7),
|
||||
BFI_PPORT_I2H_EVENT = BFA_I2HM(8),
|
||||
BFI_PPORT_I2H_GET_QOS_STATS_RSP = BFA_I2HM(9),
|
||||
BFI_PPORT_I2H_CLEAR_QOS_STATS_RSP = BFA_I2HM(10),
|
||||
enum bfi_fcport_i2h {
|
||||
BFI_FCPORT_I2H_ENABLE_RSP = BFA_I2HM(1),
|
||||
BFI_FCPORT_I2H_DISABLE_RSP = BFA_I2HM(2),
|
||||
BFI_FCPORT_I2H_SET_SVC_PARAMS_RSP = BFA_I2HM(3),
|
||||
BFI_FCPORT_I2H_STATS_GET_RSP = BFA_I2HM(4),
|
||||
BFI_FCPORT_I2H_STATS_CLEAR_RSP = BFA_I2HM(5),
|
||||
BFI_FCPORT_I2H_EVENT = BFA_I2HM(6),
|
||||
};
|
||||
|
||||
/**
|
||||
* Generic REQ type
|
||||
*/
|
||||
struct bfi_pport_generic_req_s {
|
||||
struct bfi_fcport_req_s {
|
||||
struct bfi_mhdr_s mh; /* msg header */
|
||||
u32 msgtag; /* msgtag for reply */
|
||||
u32 msgtag; /* msgtag for reply */
|
||||
};
|
||||
|
||||
/**
|
||||
* Generic RSP type
|
||||
*/
|
||||
struct bfi_pport_generic_rsp_s {
|
||||
struct bfi_fcport_rsp_s {
|
||||
struct bfi_mhdr_s mh; /* common msg header */
|
||||
u8 status; /* port enable status */
|
||||
u8 rsvd[3];
|
||||
u32 msgtag; /* msgtag for reply */
|
||||
u8 status; /* port enable status */
|
||||
u8 rsvd[3];
|
||||
u32 msgtag; /* msgtag for reply */
|
||||
};
|
||||
|
||||
/**
|
||||
* BFI_PPORT_H2I_ENABLE_REQ
|
||||
* BFI_FCPORT_H2I_ENABLE_REQ
|
||||
*/
|
||||
struct bfi_pport_enable_req_s {
|
||||
struct bfi_fcport_enable_req_s {
|
||||
struct bfi_mhdr_s mh; /* msg header */
|
||||
u32 rsvd1;
|
||||
wwn_t nwwn; /* node wwn of physical port */
|
||||
wwn_t pwwn; /* port wwn of physical port */
|
||||
struct bfa_pport_cfg_s port_cfg; /* port configuration */
|
||||
union bfi_addr_u stats_dma_addr; /* DMA address for stats */
|
||||
u32 msgtag; /* msgtag for reply */
|
||||
u32 rsvd2;
|
||||
u32 rsvd1;
|
||||
wwn_t nwwn; /* node wwn of physical port */
|
||||
wwn_t pwwn; /* port wwn of physical port */
|
||||
struct bfa_pport_cfg_s port_cfg; /* port configuration */
|
||||
union bfi_addr_u stats_dma_addr; /* DMA address for stats */
|
||||
u32 msgtag; /* msgtag for reply */
|
||||
u32 rsvd2;
|
||||
};
|
||||
|
||||
/**
|
||||
* BFI_PPORT_I2H_ENABLE_RSP
|
||||
* BFI_FCPORT_H2I_SET_SVC_PARAMS_REQ
|
||||
*/
|
||||
#define bfi_pport_enable_rsp_t struct bfi_pport_generic_rsp_s
|
||||
|
||||
/**
|
||||
* BFI_PPORT_H2I_DISABLE_REQ
|
||||
*/
|
||||
#define bfi_pport_disable_req_t struct bfi_pport_generic_req_s
|
||||
|
||||
/**
|
||||
* BFI_PPORT_I2H_DISABLE_RSP
|
||||
*/
|
||||
#define bfi_pport_disable_rsp_t struct bfi_pport_generic_rsp_s
|
||||
|
||||
/**
|
||||
* BFI_PPORT_H2I_GET_STATS_REQ
|
||||
*/
|
||||
#define bfi_pport_get_stats_req_t struct bfi_pport_generic_req_s
|
||||
|
||||
/**
|
||||
* BFI_PPORT_I2H_GET_STATS_RSP
|
||||
*/
|
||||
#define bfi_pport_get_stats_rsp_t struct bfi_pport_generic_rsp_s
|
||||
|
||||
/**
|
||||
* BFI_PPORT_H2I_CLEAR_STATS_REQ
|
||||
*/
|
||||
#define bfi_pport_clear_stats_req_t struct bfi_pport_generic_req_s
|
||||
|
||||
/**
|
||||
* BFI_PPORT_I2H_CLEAR_STATS_RSP
|
||||
*/
|
||||
#define bfi_pport_clear_stats_rsp_t struct bfi_pport_generic_rsp_s
|
||||
|
||||
/**
|
||||
* BFI_PPORT_H2I_GET_QOS_STATS_REQ
|
||||
*/
|
||||
#define bfi_pport_get_qos_stats_req_t struct bfi_pport_generic_req_s
|
||||
|
||||
/**
|
||||
* BFI_PPORT_H2I_GET_QOS_STATS_RSP
|
||||
*/
|
||||
#define bfi_pport_get_qos_stats_rsp_t struct bfi_pport_generic_rsp_s
|
||||
|
||||
/**
|
||||
* BFI_PPORT_H2I_CLEAR_QOS_STATS_REQ
|
||||
*/
|
||||
#define bfi_pport_clear_qos_stats_req_t struct bfi_pport_generic_req_s
|
||||
|
||||
/**
|
||||
* BFI_PPORT_H2I_CLEAR_QOS_STATS_RSP
|
||||
*/
|
||||
#define bfi_pport_clear_qos_stats_rsp_t struct bfi_pport_generic_rsp_s
|
||||
|
||||
/**
|
||||
* BFI_PPORT_H2I_SET_SVC_PARAMS_REQ
|
||||
*/
|
||||
struct bfi_pport_set_svc_params_req_s {
|
||||
struct bfi_fcport_set_svc_params_req_s {
|
||||
struct bfi_mhdr_s mh; /* msg header */
|
||||
u16 tx_bbcredit; /* Tx credits */
|
||||
u16 rsvd;
|
||||
u16 tx_bbcredit; /* Tx credits */
|
||||
u16 rsvd;
|
||||
};
|
||||
|
||||
/**
|
||||
* BFI_PPORT_I2H_SET_SVC_PARAMS_RSP
|
||||
* BFI_FCPORT_I2H_EVENT
|
||||
*/
|
||||
|
||||
/**
|
||||
* BFI_PPORT_I2H_EVENT
|
||||
*/
|
||||
struct bfi_pport_event_s {
|
||||
struct bfi_fcport_event_s {
|
||||
struct bfi_mhdr_s mh; /* common msg header */
|
||||
struct bfa_pport_link_s link_state;
|
||||
};
|
||||
|
||||
union bfi_pport_h2i_msg_u {
|
||||
/**
|
||||
* fcport H2I message
|
||||
*/
|
||||
union bfi_fcport_h2i_msg_u {
|
||||
struct bfi_mhdr_s *mhdr;
|
||||
struct bfi_pport_enable_req_s *penable;
|
||||
struct bfi_pport_generic_req_s *pdisable;
|
||||
struct bfi_pport_generic_req_s *pgetstats;
|
||||
struct bfi_pport_generic_req_s *pclearstats;
|
||||
struct bfi_pport_set_svc_params_req_s *psetsvcparams;
|
||||
struct bfi_pport_get_qos_stats_req_s *pgetqosstats;
|
||||
struct bfi_pport_generic_req_s *pclearqosstats;
|
||||
struct bfi_fcport_enable_req_s *penable;
|
||||
struct bfi_fcport_req_s *pdisable;
|
||||
struct bfi_fcport_set_svc_params_req_s *psetsvcparams;
|
||||
struct bfi_fcport_req_s *pstatsget;
|
||||
struct bfi_fcport_req_s *pstatsclear;
|
||||
};
|
||||
|
||||
union bfi_pport_i2h_msg_u {
|
||||
/**
|
||||
* fcport I2H message
|
||||
*/
|
||||
union bfi_fcport_i2h_msg_u {
|
||||
struct bfi_msg_s *msg;
|
||||
struct bfi_pport_generic_rsp_s *enable_rsp;
|
||||
struct bfi_pport_disable_rsp_s *disable_rsp;
|
||||
struct bfi_pport_generic_rsp_s *getstats_rsp;
|
||||
struct bfi_pport_clear_stats_rsp_s *clearstats_rsp;
|
||||
struct bfi_pport_set_svc_params_rsp_s *setsvcparasm_rsp;
|
||||
struct bfi_pport_get_qos_stats_rsp_s *getqosstats_rsp;
|
||||
struct bfi_pport_clear_qos_stats_rsp_s *clearqosstats_rsp;
|
||||
struct bfi_pport_event_s *event;
|
||||
struct bfi_fcport_rsp_s *penable_rsp;
|
||||
struct bfi_fcport_rsp_s *pdisable_rsp;
|
||||
struct bfi_fcport_rsp_s *psetsvcparams_rsp;
|
||||
struct bfi_fcport_rsp_s *pstatsget_rsp;
|
||||
struct bfi_fcport_rsp_s *pstatsclear_rsp;
|
||||
struct bfi_fcport_event_s *event;
|
||||
};
|
||||
|
||||
#pragma pack()
|
||||
|
||||
#endif /* __BFI_PPORT_H__ */
|
||||
|
||||
|
@ -31,6 +31,10 @@
|
||||
enum {
|
||||
BFA_TRC_CNA_CEE = 1,
|
||||
BFA_TRC_CNA_PORT = 2,
|
||||
BFA_TRC_CNA_IOC = 3,
|
||||
BFA_TRC_CNA_DIAG = 4,
|
||||
BFA_TRC_CNA_IOC_CB = 5,
|
||||
BFA_TRC_CNA_IOC_CT = 6,
|
||||
};
|
||||
|
||||
#endif /* __BFA_CNA_TRCMOD_H__ */
|
||||
|
@ -157,7 +157,7 @@ typedef void (*bfa_log_cb_t)(struct bfa_log_mod_s *log_mod, u32 msg_id,
|
||||
|
||||
|
||||
struct bfa_log_mod_s {
|
||||
char instance_info[16]; /* instance info */
|
||||
char instance_info[BFA_STRING_32]; /* instance info */
|
||||
int log_level[BFA_LOG_MODULE_ID_MAX + 1];
|
||||
/* log level for modules */
|
||||
bfa_log_cb_t cbfn; /* callback function */
|
||||
|
@ -80,7 +80,8 @@ enum bfa_plog_mid {
|
||||
BFA_PL_MID_HAL_FCXP = 4,
|
||||
BFA_PL_MID_HAL_UF = 5,
|
||||
BFA_PL_MID_FCS = 6,
|
||||
BFA_PL_MID_MAX = 7
|
||||
BFA_PL_MID_LPS = 7,
|
||||
BFA_PL_MID_MAX = 8
|
||||
};
|
||||
|
||||
#define BFA_PL_MID_STRLEN 8
|
||||
@ -118,7 +119,11 @@ enum bfa_plog_eid {
|
||||
BFA_PL_EID_RSCN = 17,
|
||||
BFA_PL_EID_DEBUG = 18,
|
||||
BFA_PL_EID_MISC = 19,
|
||||
BFA_PL_EID_MAX = 20
|
||||
BFA_PL_EID_FIP_FCF_DISC = 20,
|
||||
BFA_PL_EID_FIP_FCF_CVL = 21,
|
||||
BFA_PL_EID_LOGIN = 22,
|
||||
BFA_PL_EID_LOGO = 23,
|
||||
BFA_PL_EID_MAX = 24
|
||||
};
|
||||
|
||||
#define BFA_PL_ENAME_STRLEN 8
|
||||
|
@ -23,6 +23,14 @@
|
||||
#define __BFA_SM_H__
|
||||
|
||||
typedef void (*bfa_sm_t)(void *sm, int event);
|
||||
/**
|
||||
* oc - object class eg. bfa_ioc
|
||||
* st - state, eg. reset
|
||||
* otype - object type, eg. struct bfa_ioc_s
|
||||
* etype - object type, eg. enum ioc_event
|
||||
*/
|
||||
#define bfa_sm_state_decl(oc, st, otype, etype) \
|
||||
static void oc ## _sm_ ## st(otype * fsm, etype event)
|
||||
|
||||
#define bfa_sm_set_state(_sm, _state) ((_sm)->sm = (bfa_sm_t)(_state))
|
||||
#define bfa_sm_send_event(_sm, _event) ((_sm)->sm((_sm), (_event)))
|
||||
|
@ -30,6 +30,16 @@
|
||||
#include <defs/bfa_defs_audit.h>
|
||||
#include <defs/bfa_defs_ethport.h>
|
||||
|
||||
#define BFA_AEN_MAX_APP 5
|
||||
|
||||
enum bfa_aen_app {
|
||||
bfa_aen_app_bcu = 0, /* No thread for bcu */
|
||||
bfa_aen_app_hcm = 1,
|
||||
bfa_aen_app_cim = 2,
|
||||
bfa_aen_app_snia = 3,
|
||||
bfa_aen_app_test = 4, /* To be removed after unit test */
|
||||
};
|
||||
|
||||
enum bfa_aen_category {
|
||||
BFA_AEN_CAT_ADAPTER = 1,
|
||||
BFA_AEN_CAT_PORT = 2,
|
||||
|
@ -23,6 +23,7 @@
|
||||
#define PRIVATE_KEY 19009
|
||||
#define KEY_LEN 32399
|
||||
#define BFA_AUTH_SECRET_STRING_LEN 256
|
||||
#define BFA_AUTH_FAIL_NO_PASSWORD 0xFE
|
||||
#define BFA_AUTH_FAIL_TIMEOUT 0xFF
|
||||
|
||||
/**
|
||||
@ -41,6 +42,27 @@ enum bfa_auth_status {
|
||||
BFA_AUTH_STATUS_UNKNOWN = 9, /* authentication status unknown */
|
||||
};
|
||||
|
||||
enum bfa_auth_rej_code {
|
||||
BFA_AUTH_RJT_CODE_AUTH_FAILURE = 1, /* auth failure */
|
||||
BFA_AUTH_RJT_CODE_LOGICAL_ERR = 2, /* logical error */
|
||||
};
|
||||
|
||||
/**
|
||||
* Authentication reject codes
|
||||
*/
|
||||
enum bfa_auth_rej_code_exp {
|
||||
BFA_AUTH_MECH_NOT_USABLE = 1, /* auth. mechanism not usable */
|
||||
BFA_AUTH_DH_GROUP_NOT_USABLE = 2, /* DH Group not usable */
|
||||
BFA_AUTH_HASH_FUNC_NOT_USABLE = 3, /* hash Function not usable */
|
||||
BFA_AUTH_AUTH_XACT_STARTED = 4, /* auth xact started */
|
||||
BFA_AUTH_AUTH_FAILED = 5, /* auth failed */
|
||||
BFA_AUTH_INCORRECT_PLD = 6, /* incorrect payload */
|
||||
BFA_AUTH_INCORRECT_PROTO_MSG = 7, /* incorrect proto msg */
|
||||
BFA_AUTH_RESTART_AUTH_PROTO = 8, /* restart auth protocol */
|
||||
BFA_AUTH_AUTH_CONCAT_NOT_SUPP = 9, /* auth concat not supported */
|
||||
BFA_AUTH_PROTO_VER_NOT_SUPP = 10,/* proto version not supported */
|
||||
};
|
||||
|
||||
struct auth_proto_stats_s {
|
||||
u32 auth_rjts;
|
||||
u32 auth_negs;
|
||||
|
@ -28,10 +28,6 @@
|
||||
|
||||
#define BFA_CEE_LLDP_MAX_STRING_LEN (128)
|
||||
|
||||
|
||||
/* FIXME: this is coming from the protocol spec. Can the host & apps share the
|
||||
protocol .h files ?
|
||||
*/
|
||||
#define BFA_CEE_LLDP_SYS_CAP_OTHER 0x0001
|
||||
#define BFA_CEE_LLDP_SYS_CAP_REPEATER 0x0002
|
||||
#define BFA_CEE_LLDP_SYS_CAP_MAC_BRIDGE 0x0004
|
||||
@ -94,9 +90,10 @@ struct bfa_cee_dcbx_cfg_s {
|
||||
/* CEE status */
|
||||
/* Making this to tri-state for the benefit of port list command */
|
||||
enum bfa_cee_status_e {
|
||||
CEE_PHY_DOWN = 0,
|
||||
CEE_PHY_UP = 1,
|
||||
CEE_UP = 2,
|
||||
CEE_UP = 0,
|
||||
CEE_PHY_UP = 1,
|
||||
CEE_LOOPBACK = 2,
|
||||
CEE_PHY_DOWN = 3,
|
||||
};
|
||||
|
||||
/* CEE Query */
|
||||
@ -107,7 +104,8 @@ struct bfa_cee_attr_s {
|
||||
struct bfa_cee_dcbx_cfg_s dcbx_remote;
|
||||
mac_t src_mac;
|
||||
u8 link_speed;
|
||||
u8 filler[3];
|
||||
u8 nw_priority;
|
||||
u8 filler[2];
|
||||
};
|
||||
|
||||
|
||||
|
@ -21,6 +21,7 @@
|
||||
/**
|
||||
* Driver statistics
|
||||
*/
|
||||
struct bfa_driver_stats_s {
|
||||
u16 tm_io_abort;
|
||||
u16 tm_io_abort_comp;
|
||||
u16 tm_lun_reset;
|
||||
@ -34,7 +35,7 @@
|
||||
u64 output_req;
|
||||
u64 input_words;
|
||||
u64 output_words;
|
||||
} bfa_driver_stats_t;
|
||||
};
|
||||
|
||||
|
||||
#endif /* __BFA_DEFS_DRIVER_H__ */
|
||||
|
@ -19,6 +19,7 @@
|
||||
#define __BFA_DEFS_ETHPORT_H__
|
||||
|
||||
#include <defs/bfa_defs_status.h>
|
||||
#include <defs/bfa_defs_port.h>
|
||||
#include <protocol/types.h>
|
||||
#include <cna/pstats/phyport_defs.h>
|
||||
#include <cna/pstats/ethport_defs.h>
|
||||
|
94
drivers/scsi/bfa/include/defs/bfa_defs_fcport.h
Normal file
94
drivers/scsi/bfa/include/defs/bfa_defs_fcport.h
Normal file
@ -0,0 +1,94 @@
|
||||
/*
|
||||
* Copyright (c) 2005-2009 Brocade Communications Systems, Inc.
|
||||
* All rights reserved
|
||||
* www.brocade.com
|
||||
*
|
||||
* bfa_defs_fcport.h
|
||||
*
|
||||
* 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 __BFA_DEFS_FCPORT_H__
|
||||
#define __BFA_DEFS_FCPORT_H__
|
||||
|
||||
#include <defs/bfa_defs_types.h>
|
||||
#include <protocol/types.h>
|
||||
|
||||
#pragma pack(1)
|
||||
|
||||
/**
|
||||
* FCoE statistics
|
||||
*/
|
||||
struct bfa_fcoe_stats_s {
|
||||
u64 secs_reset; /* Seconds since stats reset */
|
||||
u64 cee_linkups; /* CEE link up */
|
||||
u64 cee_linkdns; /* CEE link down */
|
||||
u64 fip_linkups; /* FIP link up */
|
||||
u64 fip_linkdns; /* FIP link down */
|
||||
u64 fip_fails; /* FIP failures */
|
||||
u64 mac_invalids; /* Invalid mac assignments */
|
||||
u64 vlan_req; /* Vlan requests */
|
||||
u64 vlan_notify; /* Vlan notifications */
|
||||
u64 vlan_err; /* Vlan notification errors */
|
||||
u64 vlan_timeouts; /* Vlan request timeouts */
|
||||
u64 vlan_invalids; /* Vlan invalids */
|
||||
u64 disc_req; /* Discovery requests */
|
||||
u64 disc_rsp; /* Discovery responses */
|
||||
u64 disc_err; /* Discovery error frames */
|
||||
u64 disc_unsol; /* Discovery unsolicited */
|
||||
u64 disc_timeouts; /* Discovery timeouts */
|
||||
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 clrvlink_req; /* Clear virtual link requests */
|
||||
u64 op_unsupp; /* FIP operation unsupp. */
|
||||
u64 untagged; /* FIP untagged frames */
|
||||
u64 txf_ucast; /* Tx FCoE unicast frames */
|
||||
u64 txf_ucast_vlan; /* Tx FCoE unicast vlan frames */
|
||||
u64 txf_ucast_octets; /* Tx FCoE unicast octets */
|
||||
u64 txf_mcast; /* Tx FCoE mutlicast frames */
|
||||
u64 txf_mcast_vlan; /* Tx FCoE mutlicast vlan frames */
|
||||
u64 txf_mcast_octets; /* Tx FCoE multicast octets */
|
||||
u64 txf_bcast; /* Tx FCoE broadcast frames */
|
||||
u64 txf_bcast_vlan; /* Tx FCoE broadcast vlan frames */
|
||||
u64 txf_bcast_octets; /* Tx FCoE broadcast octets */
|
||||
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 */
|
||||
};
|
||||
|
||||
/**
|
||||
* QoS or FCoE stats (fcport stats excluding physical FC port stats)
|
||||
*/
|
||||
union bfa_fcport_stats_u {
|
||||
struct bfa_qos_stats_s fcqos;
|
||||
struct bfa_fcoe_stats_s fcoe;
|
||||
};
|
||||
|
||||
#pragma pack()
|
||||
|
||||
#endif /* __BFA_DEFS_FCPORT_H__ */
|
@ -1,32 +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.
|
||||
*/
|
||||
|
||||
#ifndef __BFA_DEFS_IM_COMMON_H__
|
||||
#define __BFA_DEFS_IM_COMMON_H__
|
||||
|
||||
#define BFA_ADAPTER_NAME_LEN 256
|
||||
#define BFA_ADAPTER_GUID_LEN 256
|
||||
#define RESERVED_VLAN_NAME L"PORT VLAN"
|
||||
#define PASSTHRU_VLAN_NAME L"PASSTHRU VLAN"
|
||||
|
||||
u64 tx_pkt_cnt;
|
||||
u64 rx_pkt_cnt;
|
||||
u32 duration;
|
||||
u8 status;
|
||||
} bfa_im_stats_t, *pbfa_im_stats_t;
|
||||
|
||||
#endif /* __BFA_DEFS_IM_COMMON_H__ */
|
@ -1,72 +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.
|
||||
*/
|
||||
|
||||
#ifndef __BFA_DEFS_IM_TEAM_H__
|
||||
#define __BFA_DEFS_IM_TEAM_H__
|
||||
|
||||
#include <protocol/types.h>
|
||||
|
||||
#define BFA_TEAM_MAX_PORTS 8
|
||||
#define BFA_TEAM_NAME_LEN 256
|
||||
#define BFA_MAX_NUM_TEAMS 16
|
||||
#define BFA_TEAM_INVALID_DELAY -1
|
||||
|
||||
BFA_LACP_RATE_SLOW = 1,
|
||||
BFA_LACP_RATE_FAST
|
||||
} bfa_im_lacp_rate_t;
|
||||
|
||||
BFA_TEAM_MODE_FAIL_OVER = 1,
|
||||
BFA_TEAM_MODE_FAIL_BACK,
|
||||
BFA_TEAM_MODE_LACP,
|
||||
BFA_TEAM_MODE_NONE
|
||||
} bfa_im_team_mode_t;
|
||||
|
||||
BFA_XMIT_POLICY_L2 = 1,
|
||||
BFA_XMIT_POLICY_L3_L4
|
||||
} bfa_im_xmit_policy_t;
|
||||
|
||||
bfa_im_team_mode_t team_mode;
|
||||
bfa_im_lacp_rate_t lacp_rate;
|
||||
bfa_im_xmit_policy_t xmit_policy;
|
||||
int delay;
|
||||
wchar_t primary[BFA_ADAPTER_NAME_LEN];
|
||||
wchar_t preferred_primary[BFA_ADAPTER_NAME_LEN];
|
||||
mac_t mac;
|
||||
u16 num_ports;
|
||||
u16 num_vlans;
|
||||
u16 vlan_list[BFA_MAX_VLANS_PER_PORT];
|
||||
wchar_t team_guid_list[BFA_TEAM_MAX_PORTS][BFA_ADAPTER_GUID_LEN];
|
||||
wchar_t ioc_name_list[BFA_TEAM_MAX_PORTS][BFA_ADAPTER_NAME_LEN];
|
||||
} bfa_im_team_attr_t;
|
||||
|
||||
wchar_t team_name[BFA_TEAM_NAME_LEN];
|
||||
bfa_im_xmit_policy_t xmit_policy;
|
||||
int delay;
|
||||
wchar_t primary[BFA_ADAPTER_NAME_LEN];
|
||||
wchar_t preferred_primary[BFA_ADAPTER_NAME_LEN];
|
||||
} bfa_im_team_edit_t, *pbfa_im_team_edit_t;
|
||||
|
||||
wchar_t team_name[BFA_TEAM_NAME_LEN];
|
||||
bfa_im_team_mode_t team_mode;
|
||||
mac_t mac;
|
||||
} bfa_im_team_info_t;
|
||||
|
||||
bfa_im_team_info_t team_info[BFA_MAX_NUM_TEAMS];
|
||||
u16 num_teams;
|
||||
} bfa_im_team_list_t, *pbfa_im_team_list_t;
|
||||
|
||||
#endif /* __BFA_DEFS_IM_TEAM_H__ */
|
@ -126,6 +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 */
|
||||
};
|
||||
|
||||
/**
|
||||
@ -143,8 +144,8 @@ enum bfa_ioc_aen_event {
|
||||
* BFA IOC level event data, now just a place holder
|
||||
*/
|
||||
struct bfa_ioc_aen_data_s {
|
||||
enum bfa_ioc_type_e ioc_type;
|
||||
wwn_t pwwn;
|
||||
s16 ioc_type;
|
||||
mac_t mac;
|
||||
};
|
||||
|
||||
|
@ -26,6 +26,8 @@
|
||||
|
||||
#define BFA_IOCFC_INTR_DELAY 1125
|
||||
#define BFA_IOCFC_INTR_LATENCY 225
|
||||
#define BFA_IOCFCOE_INTR_DELAY 25
|
||||
#define BFA_IOCFCOE_INTR_LATENCY 5
|
||||
|
||||
/**
|
||||
* Interrupt coalescing configuration.
|
||||
@ -50,7 +52,7 @@ struct bfa_iocfc_fwcfg_s {
|
||||
u16 num_fcxp_reqs; /* unassisted FC exchanges */
|
||||
u16 num_uf_bufs; /* unsolicited recv buffers */
|
||||
u8 num_cqs;
|
||||
u8 rsvd;
|
||||
u8 rsvd[5];
|
||||
};
|
||||
|
||||
struct bfa_iocfc_drvcfg_s {
|
||||
@ -224,18 +226,24 @@ struct bfa_fw_port_physm_stats_s {
|
||||
|
||||
|
||||
struct bfa_fw_fip_stats_s {
|
||||
u32 vlan_req; /* vlan discovery requests */
|
||||
u32 vlan_notify; /* vlan notifications */
|
||||
u32 vlan_err; /* vlan response error */
|
||||
u32 vlan_timeouts; /* vlan disvoery timeouts */
|
||||
u32 vlan_invalids; /* invalid vlan in discovery advert. */
|
||||
u32 disc_req; /* Discovery solicit requests */
|
||||
u32 disc_rsp; /* Discovery solicit response */
|
||||
u32 disc_err; /* Discovery advt. parse errors */
|
||||
u32 disc_unsol; /* Discovery unsolicited */
|
||||
u32 disc_timeouts; /* Discovery timeouts */
|
||||
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 clrvlink_req; /* Clear virtual link req */
|
||||
u32 op_unsupp; /* Unsupported FIP operation */
|
||||
u32 untagged; /* Untagged frames (ignored) */
|
||||
u32 rsvd;
|
||||
u32 invalid_version; /*!< Invalid FIP version */
|
||||
};
|
||||
|
||||
|
||||
|
@ -59,8 +59,8 @@ enum bfa_lport_aen_event {
|
||||
*/
|
||||
struct bfa_lport_aen_data_s {
|
||||
u16 vf_id; /* vf_id of this logical port */
|
||||
u16 rsvd;
|
||||
enum bfa_port_role roles; /* Logical port mode,IM/TM/IP etc */
|
||||
s16 roles; /* Logical port mode,IM/TM/IP etc */
|
||||
u32 rsvd;
|
||||
wwn_t ppwwn; /* WWN of its physical port */
|
||||
wwn_t lpwwn; /* WWN of this logical port */
|
||||
};
|
||||
|
@ -22,7 +22,47 @@
|
||||
/**
|
||||
* Manufacturing block version
|
||||
*/
|
||||
#define BFA_MFG_VERSION 1
|
||||
#define BFA_MFG_VERSION 2
|
||||
|
||||
/**
|
||||
* 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 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
|
||||
@ -30,29 +70,74 @@
|
||||
#define BFA_MFG_SERIALNUM_SIZE 11
|
||||
#define BFA_MFG_PARTNUM_SIZE 14
|
||||
#define BFA_MFG_SUPPLIER_ID_SIZE 10
|
||||
#define BFA_MFG_SUPPLIER_PARTNUM_SIZE 20
|
||||
#define BFA_MFG_SUPPLIER_SERIALNUM_SIZE 20
|
||||
#define BFA_MFG_SUPPLIER_REVISION_SIZE 4
|
||||
#define BFA_MFG_SUPPLIER_PARTNUM_SIZE 20
|
||||
#define BFA_MFG_SUPPLIER_SERIALNUM_SIZE 20
|
||||
#define BFA_MFG_SUPPLIER_REVISION_SIZE 4
|
||||
#define STRSZ(_n) (((_n) + 4) & ~3)
|
||||
|
||||
/**
|
||||
* Manufacturing card type
|
||||
*/
|
||||
enum {
|
||||
BFA_MFG_TYPE_CB_MAX = 825, /* Crossbow card type max */
|
||||
BFA_MFG_TYPE_FC8P2 = 825, /* 8G 2port FC card */
|
||||
BFA_MFG_TYPE_FC8P1 = 815, /* 8G 1port FC card */
|
||||
BFA_MFG_TYPE_FC4P2 = 425, /* 4G 2port FC card */
|
||||
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 */
|
||||
};
|
||||
|
||||
#pragma pack(1)
|
||||
|
||||
/**
|
||||
* Card type to port number conversion
|
||||
*/
|
||||
#define bfa_mfg_type2port_num(card_type) (((card_type) / 10) % 10)
|
||||
|
||||
|
||||
/**
|
||||
* All numerical fields are in big-endian format.
|
||||
*/
|
||||
struct bfa_mfg_block_s {
|
||||
};
|
||||
|
||||
/**
|
||||
* VPD data length
|
||||
*/
|
||||
#define BFA_MFG_VPD_LEN 256
|
||||
#define BFA_MFG_VPD_LEN 512
|
||||
|
||||
#define BFA_MFG_VPD_PCI_HDR_OFF 137
|
||||
#define BFA_MFG_VPD_PCI_VER_MASK 0x07 /* version mask 3 bits */
|
||||
#define BFA_MFG_VPD_PCI_VDR_MASK 0xf8 /* vendor mask 5 bits */
|
||||
|
||||
/**
|
||||
* VPD vendor tag
|
||||
*/
|
||||
enum {
|
||||
BFA_MFG_VPD_UNKNOWN = 0, /* vendor unknown */
|
||||
BFA_MFG_VPD_IBM = 1, /* vendor IBM */
|
||||
BFA_MFG_VPD_HP = 2, /* vendor HP */
|
||||
BFA_MFG_VPD_DELL = 3, /* vendor DELL */
|
||||
BFA_MFG_VPD_PCI_IBM = 0x08, /* PCI VPD IBM */
|
||||
BFA_MFG_VPD_PCI_HP = 0x10, /* PCI VPD HP */
|
||||
BFA_MFG_VPD_PCI_DELL = 0x20, /* PCI VPD DELL */
|
||||
BFA_MFG_VPD_PCI_BRCD = 0xf8, /* PCI VPD Brocade */
|
||||
};
|
||||
|
||||
/**
|
||||
* All numerical fields are in big-endian format.
|
||||
*/
|
||||
struct bfa_mfg_vpd_s {
|
||||
u8 version; /* vpd data version */
|
||||
u8 vpd_sig[3]; /* characters 'V', 'P', 'D' */
|
||||
u8 chksum; /* u8 checksum */
|
||||
u8 vendor; /* vendor */
|
||||
u8 len; /* vpd data length excluding header */
|
||||
u8 rsv;
|
||||
u8 data[BFA_MFG_VPD_LEN]; /* vpd data */
|
||||
u8 version; /* vpd data version */
|
||||
u8 vpd_sig[3]; /* characters 'V', 'P', 'D' */
|
||||
u8 chksum; /* u8 checksum */
|
||||
u8 vendor; /* vendor */
|
||||
u8 len; /* vpd data length excluding header */
|
||||
u8 rsv;
|
||||
u8 data[BFA_MFG_VPD_LEN]; /* vpd data */
|
||||
};
|
||||
|
||||
#pragma pack(1)
|
||||
#pragma pack()
|
||||
|
||||
#endif /* __BFA_DEFS_MFG_H__ */
|
||||
|
@ -185,6 +185,8 @@ struct bfa_port_attr_s {
|
||||
wwn_t fabric_name; /* attached switch's nwwn */
|
||||
u8 fabric_ip_addr[BFA_FCS_FABRIC_IPADDR_SZ]; /* attached
|
||||
* fabric's ip addr */
|
||||
struct mac_s fpma_mac; /* Lport's FPMA Mac address */
|
||||
u16 authfail; /* auth failed state */
|
||||
};
|
||||
|
||||
/**
|
||||
@ -232,14 +234,15 @@ enum bfa_port_aen_sfp_pom {
|
||||
};
|
||||
|
||||
struct bfa_port_aen_data_s {
|
||||
enum bfa_ioc_type_e ioc_type;
|
||||
wwn_t pwwn; /* WWN of the physical port */
|
||||
wwn_t fwwn; /* WWN of the fabric port */
|
||||
mac_t mac; /* MAC addres of the ethernet port,
|
||||
* applicable to CNA port only */
|
||||
int phy_port_num; /*! For SFP related events */
|
||||
enum bfa_port_aen_sfp_pom level; /* Only transitions will
|
||||
* be informed */
|
||||
wwn_t pwwn; /* WWN of the physical port */
|
||||
wwn_t fwwn; /* WWN of the fabric port */
|
||||
s32 phy_port_num; /*! For SFP related events */
|
||||
s16 ioc_type;
|
||||
s16 level; /* Only transitions will
|
||||
* be informed */
|
||||
struct mac_s mac; /* MAC address of the ethernet port,
|
||||
* applicable to CNA port only */
|
||||
s16 rsvd;
|
||||
};
|
||||
|
||||
#endif /* __BFA_DEFS_PORT_H__ */
|
||||
|
@ -232,7 +232,7 @@ struct bfa_pport_attr_s {
|
||||
u32 pid; /* port ID */
|
||||
enum bfa_pport_type port_type; /* current topology */
|
||||
u32 loopback; /* external loopback */
|
||||
u32 rsvd1;
|
||||
u32 authfail; /* auth fail state */
|
||||
u32 rsvd2; /* padding for 64 bit */
|
||||
};
|
||||
|
||||
@ -240,73 +240,79 @@ struct bfa_pport_attr_s {
|
||||
* FC Port statistics.
|
||||
*/
|
||||
struct bfa_pport_fc_stats_s {
|
||||
u64 secs_reset; /* seconds since stats is reset */
|
||||
u64 tx_frames; /* transmitted frames */
|
||||
u64 tx_words; /* transmitted words */
|
||||
u64 rx_frames; /* received frames */
|
||||
u64 rx_words; /* received words */
|
||||
u64 lip_count; /* LIPs seen */
|
||||
u64 nos_count; /* NOS count */
|
||||
u64 error_frames; /* errored frames (sent?) */
|
||||
u64 dropped_frames; /* dropped frames */
|
||||
u64 link_failures; /* link failure count */
|
||||
u64 loss_of_syncs; /* loss of sync count */
|
||||
u64 loss_of_signals;/* loss of signal count */
|
||||
u64 primseq_errs; /* primitive sequence protocol */
|
||||
u64 bad_os_count; /* invalid ordered set */
|
||||
u64 err_enc_out; /* Encoding error outside frame */
|
||||
u64 invalid_crcs; /* frames received with invalid CRC*/
|
||||
u64 undersized_frm; /* undersized frames */
|
||||
u64 oversized_frm; /* oversized frames */
|
||||
u64 bad_eof_frm; /* frames with bad EOF */
|
||||
struct bfa_qos_stats_s qos_stats; /* QoS statistics */
|
||||
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_nos; /* Tx NOS */
|
||||
u64 tx_ols; /* Tx OLS */
|
||||
u64 tx_lr; /* Tx LR */
|
||||
u64 tx_lrr; /* Tx LRR */
|
||||
u64 rx_frames; /* Rx frames */
|
||||
u64 rx_words; /* Rx words */
|
||||
u64 lip_count; /* Rx LIP */
|
||||
u64 nos_count; /* Rx NOS */
|
||||
u64 ols_count; /* Rx OLS */
|
||||
u64 lr_count; /* Rx LR */
|
||||
u64 lrr_count; /* Rx LRR */
|
||||
u64 invalid_crcs; /* Rx CRC err frames */
|
||||
u64 invalid_crc_gd_eof; /* Rx CRC err good EOF frames */
|
||||
u64 undersized_frm; /* Rx undersized frames */
|
||||
u64 oversized_frm; /* Rx oversized frames */
|
||||
u64 bad_eof_frm; /* Rx frames with bad EOF */
|
||||
u64 error_frames; /* Errored frames */
|
||||
u64 dropped_frames; /* Dropped frames */
|
||||
u64 link_failures; /* Link Failure (LF) count */
|
||||
u64 loss_of_syncs; /* Loss of sync count */
|
||||
u64 loss_of_signals;/* Loss of signal count */
|
||||
u64 primseq_errs; /* Primitive sequence protocol err. */
|
||||
u64 bad_os_count; /* Invalid ordered sets */
|
||||
u64 err_enc_out; /* Encoding err nonframe_8b10b */
|
||||
u64 err_enc; /* Encoding err frame_8b10b */
|
||||
};
|
||||
|
||||
/**
|
||||
* Eth Port statistics.
|
||||
*/
|
||||
struct bfa_pport_eth_stats_s {
|
||||
u64 secs_reset; /* seconds since stats is reset */
|
||||
u64 frame_64; /* both rx and tx counter */
|
||||
u64 frame_65_127; /* both rx and tx counter */
|
||||
u64 frame_128_255; /* both rx and tx counter */
|
||||
u64 frame_256_511; /* both rx and tx counter */
|
||||
u64 frame_512_1023; /* both rx and tx counter */
|
||||
u64 frame_1024_1518; /* both rx and tx counter */
|
||||
u64 frame_1519_1522; /* both rx and tx counter */
|
||||
|
||||
u64 tx_bytes;
|
||||
u64 tx_packets;
|
||||
u64 tx_mcast_packets;
|
||||
u64 tx_bcast_packets;
|
||||
u64 tx_control_frame;
|
||||
u64 tx_drop;
|
||||
u64 tx_jabber;
|
||||
u64 tx_fcs_error;
|
||||
u64 tx_fragments;
|
||||
|
||||
u64 rx_bytes;
|
||||
u64 rx_packets;
|
||||
u64 rx_mcast_packets;
|
||||
u64 rx_bcast_packets;
|
||||
u64 rx_control_frames;
|
||||
u64 rx_unknown_opcode;
|
||||
u64 rx_drop;
|
||||
u64 rx_jabber;
|
||||
u64 rx_fcs_error;
|
||||
u64 rx_alignment_error;
|
||||
u64 rx_frame_length_error;
|
||||
u64 rx_code_error;
|
||||
u64 rx_fragments;
|
||||
|
||||
u64 rx_pause; /* BPC */
|
||||
u64 rx_zero_pause; /* BPC Pause cancellation */
|
||||
u64 tx_pause; /* BPC */
|
||||
u64 tx_zero_pause; /* BPC Pause cancellation */
|
||||
u64 rx_fcoe_pause; /* BPC */
|
||||
u64 rx_fcoe_zero_pause; /* BPC Pause cancellation */
|
||||
u64 tx_fcoe_pause; /* BPC */
|
||||
u64 tx_fcoe_zero_pause; /* BPC Pause cancellation */
|
||||
u64 secs_reset; /* Seconds since stats is reset */
|
||||
u64 frame_64; /* Frames 64 bytes */
|
||||
u64 frame_65_127; /* Frames 65-127 bytes */
|
||||
u64 frame_128_255; /* Frames 128-255 bytes */
|
||||
u64 frame_256_511; /* Frames 256-511 bytes */
|
||||
u64 frame_512_1023; /* Frames 512-1023 bytes */
|
||||
u64 frame_1024_1518; /* Frames 1024-1518 bytes */
|
||||
u64 frame_1519_1522; /* Frames 1519-1522 bytes */
|
||||
u64 tx_bytes; /* Tx bytes */
|
||||
u64 tx_packets; /* Tx packets */
|
||||
u64 tx_mcast_packets; /* Tx multicast packets */
|
||||
u64 tx_bcast_packets; /* Tx broadcast packets */
|
||||
u64 tx_control_frame; /* Tx control frame */
|
||||
u64 tx_drop; /* Tx drops */
|
||||
u64 tx_jabber; /* Tx jabber */
|
||||
u64 tx_fcs_error; /* Tx FCS error */
|
||||
u64 tx_fragments; /* Tx fragments */
|
||||
u64 rx_bytes; /* Rx bytes */
|
||||
u64 rx_packets; /* Rx packets */
|
||||
u64 rx_mcast_packets; /* Rx multicast packets */
|
||||
u64 rx_bcast_packets; /* Rx broadcast packets */
|
||||
u64 rx_control_frames; /* Rx control frames */
|
||||
u64 rx_unknown_opcode; /* Rx unknown opcode */
|
||||
u64 rx_drop; /* Rx drops */
|
||||
u64 rx_jabber; /* Rx jabber */
|
||||
u64 rx_fcs_error; /* Rx FCS errors */
|
||||
u64 rx_alignment_error; /* Rx alignment errors */
|
||||
u64 rx_frame_length_error; /* Rx frame len errors */
|
||||
u64 rx_code_error; /* Rx code errors */
|
||||
u64 rx_fragments; /* Rx fragments */
|
||||
u64 rx_pause; /* Rx pause */
|
||||
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_zero_pause; /* Rx FCoE zero pause */
|
||||
u64 tx_fcoe_pause; /* Tx FCoE pause */
|
||||
u64 tx_fcoe_zero_pause; /* Tx FCoE zero pause */
|
||||
};
|
||||
|
||||
/**
|
||||
@ -333,8 +339,7 @@ struct bfa_pport_fcpmap_s {
|
||||
};
|
||||
|
||||
/**
|
||||
* Port RNID info.
|
||||
*/
|
||||
* Port RNI */
|
||||
struct bfa_pport_rnid_s {
|
||||
wwn_t wwn;
|
||||
u32 unittype;
|
||||
@ -347,6 +352,23 @@ struct bfa_pport_rnid_s {
|
||||
u16 topologydiscoveryflags;
|
||||
};
|
||||
|
||||
struct bfa_fcport_fcf_s {
|
||||
wwn_t name; /* FCF name */
|
||||
wwn_t fabric_name; /* Fabric Name */
|
||||
u8 fipenabled; /* FIP enabled or not */
|
||||
u8 fipfailed; /* FIP failed or not */
|
||||
u8 resv[2];
|
||||
u8 pri; /* FCF priority */
|
||||
u8 version; /* FIP version used */
|
||||
u8 available; /* Available for login */
|
||||
u8 fka_disabled; /* FKA is disabled */
|
||||
u8 maxsz_verified; /* FCoE max size verified */
|
||||
u8 fc_map[3]; /* FC map */
|
||||
u16 vlan; /* FCoE vlan tag/priority */
|
||||
u32 fka_adv_per; /* FIP ka advert. period */
|
||||
struct mac_s mac; /* FCF mac */
|
||||
};
|
||||
|
||||
/**
|
||||
* Link state information
|
||||
*/
|
||||
@ -378,6 +400,7 @@ struct bfa_pport_link_s {
|
||||
struct fc_alpabm_s alpabm; /* alpa bitmap */
|
||||
} loop_info;
|
||||
} tl;
|
||||
struct bfa_fcport_fcf_s fcf; /*!< FCF information (for FCoE) */
|
||||
};
|
||||
|
||||
#endif /* __BFA_DEFS_PPORT_H__ */
|
||||
|
@ -180,8 +180,8 @@ enum bfa_status {
|
||||
BFA_STATUS_IM_ADAPT_ALREADY_IN_TEAM = 114, /* Given adapter is part
|
||||
* of another team */
|
||||
BFA_STATUS_IM_ADAPT_HAS_VLANS = 115, /* Adapter has VLANs configured.
|
||||
* Delete all VLANs before
|
||||
* creating team */
|
||||
* Delete all VLANs to become
|
||||
* part of the team */
|
||||
BFA_STATUS_IM_PVID_MISMATCH = 116, /* Mismatching PVIDs configured
|
||||
* for adapters */
|
||||
BFA_STATUS_IM_LINK_SPEED_MISMATCH = 117, /* Mismatching link speeds
|
||||
@ -213,7 +213,7 @@ 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, /* Storage/Ethernet driver not 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 */
|
||||
@ -228,8 +228,7 @@ enum bfa_status {
|
||||
BFA_STATUS_IM_GET_INETCFG_FAILED = 142, /* Acquiring Network Subsytem
|
||||
* handle Failed. Please try
|
||||
* after some time */
|
||||
BFA_STATUS_IM_NOT_BOUND = 143, /* Brocade 10G Ethernet Service is not
|
||||
* Enabled on this port */
|
||||
BFA_STATUS_IM_NOT_BOUND = 143, /* IM driver is not active */
|
||||
BFA_STATUS_INSUFFICIENT_PERMS = 144, /* User doesn't have sufficient
|
||||
* permissions to execute the BCU
|
||||
* application */
|
||||
@ -242,6 +241,14 @@ enum bfa_status {
|
||||
* failed */
|
||||
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 */
|
||||
BFA_STATUS_IM_VLAN_NOT_FOUND = 151, /* VLAN ID doesn't exists */
|
||||
BFA_STATUS_IM_TEAM_NOT_FOUND = 152, /* Teaming configuration doesn't
|
||||
* exists */
|
||||
BFA_STATUS_IM_TEAM_CFG_NOT_ALLOWED = 153, /* Given settings are not
|
||||
* allowed for the current
|
||||
* Teaming mode */
|
||||
BFA_STATUS_MAX_VAL /* Unknown error code */
|
||||
};
|
||||
#define bfa_status_t enum bfa_status
|
||||
|
@ -70,7 +70,6 @@ void bfa_fcb_itnim_online(struct bfad_itnim_s *itnim_drv);
|
||||
*/
|
||||
void bfa_fcb_itnim_offline(struct bfad_itnim_s *itnim_drv);
|
||||
|
||||
void bfa_fcb_itnim_tov_begin(struct bfad_itnim_s *itnim_drv);
|
||||
void bfa_fcb_itnim_tov(struct bfad_itnim_s *itnim_drv);
|
||||
|
||||
#endif /* __BFAD_FCB_FCPIM_H__ */
|
||||
|
@ -49,6 +49,7 @@ struct bfa_fcs_s {
|
||||
struct bfa_trc_mod_s *trcmod; /* tracing module */
|
||||
struct bfa_aen_s *aen; /* aen component */
|
||||
bfa_boolean_t vf_enabled; /* VF mode is enabled */
|
||||
bfa_boolean_t fdmi_enabled; /*!< FDMI is enabled */
|
||||
bfa_boolean_t min_cfg; /* min cfg enabled/disabled */
|
||||
u16 port_vfid; /* port default VF ID */
|
||||
struct bfa_fcs_driver_info_s driver_info;
|
||||
@ -60,10 +61,12 @@ struct bfa_fcs_s {
|
||||
/*
|
||||
* bfa fcs API functions
|
||||
*/
|
||||
void bfa_fcs_init(struct bfa_fcs_s *fcs, struct bfa_s *bfa, struct bfad_s *bfad,
|
||||
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);
|
||||
void bfa_fcs_set_fdmi_param(struct bfa_fcs_s *fcs, bfa_boolean_t fdmi_enable);
|
||||
void bfa_fcs_exit(struct bfa_fcs_s *fcs);
|
||||
void bfa_fcs_trc_init(struct bfa_fcs_s *fcs, struct bfa_trc_mod_s *trcmod);
|
||||
void bfa_fcs_log_init(struct bfa_fcs_s *fcs, struct bfa_log_mod_s *logmod);
|
||||
|
@ -34,14 +34,6 @@ struct bfa_fcs_s;
|
||||
struct bfa_fcs_fabric_s;
|
||||
|
||||
/*
|
||||
* @todo : need to move to a global config file.
|
||||
* Maximum Vports supported per physical port or vf.
|
||||
*/
|
||||
#define BFA_FCS_MAX_VPORTS_SUPP_CB 255
|
||||
#define BFA_FCS_MAX_VPORTS_SUPP_CT 191
|
||||
|
||||
/*
|
||||
* @todo : need to move to a global config file.
|
||||
* Maximum Rports supported per port (physical/logical).
|
||||
*/
|
||||
#define BFA_FCS_MAX_RPORTS_SUPP 256 /* @todo : tentative value */
|
||||
|
@ -27,4 +27,10 @@
|
||||
(((u32) BFA_LOG_HAL_ID << BFA_LOG_MODID_OFFSET) | 3)
|
||||
#define BFA_LOG_HAL_SM_ASSERT \
|
||||
(((u32) BFA_LOG_HAL_ID << BFA_LOG_MODID_OFFSET) | 4)
|
||||
#define BFA_LOG_HAL_DRIVER_ERROR \
|
||||
(((u32) BFA_LOG_HAL_ID << BFA_LOG_MODID_OFFSET) | 5)
|
||||
#define BFA_LOG_HAL_DRIVER_CONFIG_ERROR \
|
||||
(((u32) BFA_LOG_HAL_ID << BFA_LOG_MODID_OFFSET) | 6)
|
||||
#define BFA_LOG_HAL_MBOX_ERROR \
|
||||
(((u32) BFA_LOG_HAL_ID << BFA_LOG_MODID_OFFSET) | 7)
|
||||
#endif
|
||||
|
@ -41,4 +41,20 @@
|
||||
(((u32) BFA_LOG_LINUX_ID << BFA_LOG_MODID_OFFSET) | 10)
|
||||
#define BFA_LOG_LINUX_SCSI_ABORT_COMP \
|
||||
(((u32) BFA_LOG_LINUX_ID << BFA_LOG_MODID_OFFSET) | 11)
|
||||
#define BFA_LOG_LINUX_DRIVER_CONFIG_ERROR \
|
||||
(((u32) BFA_LOG_LINUX_ID << BFA_LOG_MODID_OFFSET) | 12)
|
||||
#define BFA_LOG_LINUX_BNA_STATE_MACHINE \
|
||||
(((u32) BFA_LOG_LINUX_ID << BFA_LOG_MODID_OFFSET) | 13)
|
||||
#define BFA_LOG_LINUX_IOC_ERROR \
|
||||
(((u32) BFA_LOG_LINUX_ID << BFA_LOG_MODID_OFFSET) | 14)
|
||||
#define BFA_LOG_LINUX_RESOURCE_ALLOC_ERROR \
|
||||
(((u32) BFA_LOG_LINUX_ID << BFA_LOG_MODID_OFFSET) | 15)
|
||||
#define BFA_LOG_LINUX_RING_BUFFER_ERROR \
|
||||
(((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 \
|
||||
(((u32) BFA_LOG_LINUX_ID << BFA_LOG_MODID_OFFSET) | 18)
|
||||
#define BFA_LOG_LINUX_DRIVER_AEN \
|
||||
(((u32) BFA_LOG_LINUX_ID << BFA_LOG_MODID_OFFSET) | 19)
|
||||
#endif
|
||||
|
@ -50,6 +50,11 @@ struct fchs_s {
|
||||
|
||||
u32 ro; /* relative offset */
|
||||
};
|
||||
|
||||
#define FC_SOF_LEN 4
|
||||
#define FC_EOF_LEN 4
|
||||
#define FC_CRC_LEN 4
|
||||
|
||||
/*
|
||||
* Fibre Channel BB_E Header Structure
|
||||
*/
|
||||
|
@ -1,75 +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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* pcifw.h PCI FW related headers
|
||||
*/
|
||||
|
||||
#ifndef __PCIFW_H__
|
||||
#define __PCIFW_H__
|
||||
|
||||
#pragma pack(1)
|
||||
|
||||
struct pnp_hdr_s{
|
||||
u32 signature; /* "$PnP" */
|
||||
u8 rev; /* Struct revision */
|
||||
u8 len; /* Header structure len in multiples
|
||||
* of 16 bytes */
|
||||
u16 off; /* Offset to next header 00 if none */
|
||||
u8 rsvd; /* Reserved byte */
|
||||
u8 cksum; /* 8-bit checksum for this header */
|
||||
u32 pnp_dev_id; /* PnP Device Id */
|
||||
u16 mfstr; /* Pointer to manufacturer string */
|
||||
u16 prstr; /* Pointer to product string */
|
||||
u8 devtype[3]; /* Device Type Code */
|
||||
u8 devind; /* Device Indicator */
|
||||
u16 bcventr; /* Bootstrap entry vector */
|
||||
u16 rsvd2; /* Reserved */
|
||||
u16 sriv; /* Static resource information vector */
|
||||
};
|
||||
|
||||
struct pci_3_0_ds_s{
|
||||
u32 sig; /* Signature "PCIR" */
|
||||
u16 vendid; /* Vendor ID */
|
||||
u16 devid; /* Device ID */
|
||||
u16 devlistoff; /* Device List Offset */
|
||||
u16 len; /* PCI Data Structure Length */
|
||||
u8 rev; /* PCI Data Structure Revision */
|
||||
u8 clcode[3]; /* Class Code */
|
||||
u16 imglen; /* Code image length in multiples of
|
||||
* 512 bytes */
|
||||
u16 coderev; /* Revision level of code/data */
|
||||
u8 codetype; /* Code type 0x00 - BIOS */
|
||||
u8 indr; /* Last image indicator */
|
||||
u16 mrtimglen; /* Max Run Time Image Length */
|
||||
u16 cuoff; /* Config Utility Code Header Offset */
|
||||
u16 dmtfclp; /* DMTF CLP entry point offset */
|
||||
};
|
||||
|
||||
struct pci_optrom_hdr_s{
|
||||
u16 sig; /* Signature 0x55AA */
|
||||
u8 len; /* Option ROM length in units of 512 bytes */
|
||||
u8 inivec[3]; /* Initialization vector */
|
||||
u8 rsvd[16]; /* Reserved field */
|
||||
u16 verptr; /* Pointer to version string - private */
|
||||
u16 pcids; /* Pointer to PCI data structure */
|
||||
u16 pnphdr; /* Pointer to PnP expansion header */
|
||||
};
|
||||
|
||||
#pragma pack()
|
||||
|
||||
#endif
|
@ -162,7 +162,7 @@ bfa_fcs_port_loop_send_plogi(struct bfa_fcs_port_s *port, u8 alpa)
|
||||
len = fc_plogi_build(&fchs, bfa_fcxp_get_reqbuf(fcxp), alpa,
|
||||
bfa_fcs_port_get_fcid(port), 0,
|
||||
port->port_cfg.pwwn, port->port_cfg.nwwn,
|
||||
bfa_pport_get_maxfrsize(port->fcs->bfa));
|
||||
bfa_fcport_get_maxfrsize(port->fcs->bfa));
|
||||
|
||||
bfa_fcxp_send(fcxp, NULL, port->fabric->vf_id, port->lp_tag, BFA_FALSE,
|
||||
FC_CLASS_3, len, &fchs,
|
||||
|
@ -156,7 +156,7 @@ bfa_fcs_port_get_rport_max_speed(struct bfa_fcs_port_s *port)
|
||||
/*
|
||||
* Get Physical port's current speed
|
||||
*/
|
||||
bfa_pport_get_attr(port->fcs->bfa, &pport_attr);
|
||||
bfa_fcport_get_attr(port->fcs->bfa, &pport_attr);
|
||||
pport_speed = pport_attr.speed;
|
||||
bfa_trc(fcs, pport_speed);
|
||||
|
||||
@ -235,7 +235,8 @@ bfa_fcs_port_get_info(struct bfa_fcs_port_s *port,
|
||||
port_info->port_wwn = bfa_fcs_port_get_pwwn(port);
|
||||
port_info->node_wwn = bfa_fcs_port_get_nwwn(port);
|
||||
|
||||
port_info->max_vports_supp = bfa_fcs_vport_get_max(port->fcs);
|
||||
port_info->max_vports_supp =
|
||||
bfa_lps_get_max_vport(port->fcs->bfa);
|
||||
port_info->num_vports_inuse =
|
||||
bfa_fcs_fabric_vport_count(port->fabric);
|
||||
port_info->max_rports_supp = BFA_FCS_MAX_RPORTS_SUPP;
|
||||
|
@ -118,7 +118,7 @@ bfa_fcs_port_ms_sm_offline(struct bfa_fcs_port_ms_s *ms,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(ms->port->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -141,7 +141,7 @@ bfa_fcs_port_ms_sm_plogi_sending(struct bfa_fcs_port_ms_s *ms,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(ms->port->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -190,7 +190,7 @@ bfa_fcs_port_ms_sm_plogi(struct bfa_fcs_port_ms_s *ms, enum port_ms_event event)
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(ms->port->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -216,7 +216,7 @@ bfa_fcs_port_ms_sm_plogi_retry(struct bfa_fcs_port_ms_s *ms,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(ms->port->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -230,10 +230,6 @@ bfa_fcs_port_ms_sm_online(struct bfa_fcs_port_ms_s *ms,
|
||||
switch (event) {
|
||||
case MSSM_EVENT_PORT_OFFLINE:
|
||||
bfa_sm_set_state(ms, bfa_fcs_port_ms_sm_offline);
|
||||
/*
|
||||
* now invoke MS related sub-modules
|
||||
*/
|
||||
bfa_fcs_port_fdmi_offline(ms);
|
||||
break;
|
||||
|
||||
case MSSM_EVENT_PORT_FABRIC_RSCN:
|
||||
@ -243,7 +239,7 @@ bfa_fcs_port_ms_sm_online(struct bfa_fcs_port_ms_s *ms,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(ms->port->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -266,7 +262,7 @@ bfa_fcs_port_ms_sm_gmal_sending(struct bfa_fcs_port_ms_s *ms,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(ms->port->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -304,7 +300,7 @@ bfa_fcs_port_ms_sm_gmal(struct bfa_fcs_port_ms_s *ms, enum port_ms_event event)
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(ms->port->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -330,7 +326,7 @@ bfa_fcs_port_ms_sm_gmal_retry(struct bfa_fcs_port_ms_s *ms,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(ms->port->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -466,7 +462,7 @@ bfa_fcs_port_ms_sm_gfn_sending(struct bfa_fcs_port_ms_s *ms,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(ms->port->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -502,7 +498,7 @@ bfa_fcs_port_ms_sm_gfn(struct bfa_fcs_port_ms_s *ms, enum port_ms_event event)
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(ms->port->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -528,7 +524,7 @@ bfa_fcs_port_ms_sm_gfn_retry(struct bfa_fcs_port_ms_s *ms,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(ms->port->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -637,7 +633,7 @@ bfa_fcs_port_ms_send_plogi(void *ms_cbarg, struct bfa_fcxp_s *fcxp_alloced)
|
||||
bfa_os_hton3b(FC_MGMT_SERVER),
|
||||
bfa_fcs_port_get_fcid(port), 0,
|
||||
port->port_cfg.pwwn, port->port_cfg.nwwn,
|
||||
bfa_pport_get_maxfrsize(port->fcs->bfa));
|
||||
bfa_fcport_get_maxfrsize(port->fcs->bfa));
|
||||
|
||||
bfa_fcxp_send(fcxp, NULL, port->fabric->vf_id, port->lp_tag, BFA_FALSE,
|
||||
FC_CLASS_3, len, &fchs, bfa_fcs_port_ms_plogi_response,
|
||||
@ -735,6 +731,7 @@ bfa_fcs_port_ms_offline(struct bfa_fcs_port_s *port)
|
||||
|
||||
ms->port = port;
|
||||
bfa_sm_send_event(ms, MSSM_EVENT_PORT_OFFLINE);
|
||||
bfa_fcs_port_fdmi_offline(ms);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -164,7 +164,7 @@ bfa_fcs_port_ns_sm_offline(struct bfa_fcs_port_ns_s *ns,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(ns->port->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -187,7 +187,7 @@ bfa_fcs_port_ns_sm_plogi_sending(struct bfa_fcs_port_ns_s *ns,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(ns->port->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -221,7 +221,7 @@ bfa_fcs_port_ns_sm_plogi(struct bfa_fcs_port_ns_s *ns,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(ns->port->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -247,7 +247,7 @@ bfa_fcs_port_ns_sm_plogi_retry(struct bfa_fcs_port_ns_s *ns,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(ns->port->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -270,7 +270,7 @@ bfa_fcs_port_ns_sm_sending_rspn_id(struct bfa_fcs_port_ns_s *ns,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(ns->port->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -304,7 +304,7 @@ bfa_fcs_port_ns_sm_rspn_id(struct bfa_fcs_port_ns_s *ns,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(ns->port->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -330,7 +330,7 @@ bfa_fcs_port_ns_sm_rspn_id_retry(struct bfa_fcs_port_ns_s *ns,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(ns->port->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -353,7 +353,7 @@ bfa_fcs_port_ns_sm_sending_rft_id(struct bfa_fcs_port_ns_s *ns,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(ns->port->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -390,7 +390,7 @@ bfa_fcs_port_ns_sm_rft_id(struct bfa_fcs_port_ns_s *ns,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(ns->port->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -413,7 +413,7 @@ bfa_fcs_port_ns_sm_rft_id_retry(struct bfa_fcs_port_ns_s *ns,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(ns->port->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -436,7 +436,7 @@ bfa_fcs_port_ns_sm_sending_rff_id(struct bfa_fcs_port_ns_s *ns,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(ns->port->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -494,7 +494,7 @@ bfa_fcs_port_ns_sm_rff_id(struct bfa_fcs_port_ns_s *ns,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(ns->port->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -517,7 +517,7 @@ bfa_fcs_port_ns_sm_rff_id_retry(struct bfa_fcs_port_ns_s *ns,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(ns->port->fcs, event);
|
||||
}
|
||||
}
|
||||
static void
|
||||
@ -539,7 +539,7 @@ bfa_fcs_port_ns_sm_sending_gid_ft(struct bfa_fcs_port_ns_s *ns,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(ns->port->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -575,7 +575,7 @@ bfa_fcs_port_ns_sm_gid_ft(struct bfa_fcs_port_ns_s *ns,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(ns->port->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -598,7 +598,7 @@ bfa_fcs_port_ns_sm_gid_ft_retry(struct bfa_fcs_port_ns_s *ns,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(ns->port->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -626,7 +626,7 @@ bfa_fcs_port_ns_sm_online(struct bfa_fcs_port_ns_s *ns,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(ns->port->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -660,7 +660,7 @@ bfa_fcs_port_ns_send_plogi(void *ns_cbarg, struct bfa_fcxp_s *fcxp_alloced)
|
||||
bfa_os_hton3b(FC_NAME_SERVER),
|
||||
bfa_fcs_port_get_fcid(port), 0,
|
||||
port->port_cfg.pwwn, port->port_cfg.nwwn,
|
||||
bfa_pport_get_maxfrsize(port->fcs->bfa));
|
||||
bfa_fcport_get_maxfrsize(port->fcs->bfa));
|
||||
|
||||
bfa_fcxp_send(fcxp, NULL, port->fabric->vf_id, port->lp_tag, BFA_FALSE,
|
||||
FC_CLASS_3, len, &fchs, bfa_fcs_port_ns_plogi_response,
|
||||
|
@ -224,7 +224,7 @@ bfa_fcs_rport_sm_uninit(struct bfa_fcs_rport_s *rport, enum rport_event event)
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(rport->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -276,7 +276,7 @@ bfa_fcs_rport_sm_plogi_sending(struct bfa_fcs_rport_s *rport,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(rport->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -332,7 +332,7 @@ bfa_fcs_rport_sm_plogiacc_sending(struct bfa_fcs_rport_s *rport,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(rport->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -406,7 +406,7 @@ bfa_fcs_rport_sm_plogi_retry(struct bfa_fcs_rport_s *rport,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(rport->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -481,7 +481,7 @@ bfa_fcs_rport_sm_plogi(struct bfa_fcs_rport_s *rport, enum rport_event event)
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(rport->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -534,7 +534,7 @@ bfa_fcs_rport_sm_hal_online(struct bfa_fcs_rport_s *rport,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(rport->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -589,7 +589,7 @@ bfa_fcs_rport_sm_online(struct bfa_fcs_rport_s *rport, enum rport_event event)
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(rport->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -646,7 +646,7 @@ bfa_fcs_rport_sm_nsquery_sending(struct bfa_fcs_rport_s *rport,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(rport->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -704,7 +704,7 @@ bfa_fcs_rport_sm_nsquery(struct bfa_fcs_rport_s *rport, enum rport_event event)
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(rport->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -754,7 +754,7 @@ bfa_fcs_rport_sm_adisc_sending(struct bfa_fcs_rport_s *rport,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(rport->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -816,7 +816,7 @@ bfa_fcs_rport_sm_adisc(struct bfa_fcs_rport_s *rport, enum rport_event event)
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(rport->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -846,7 +846,7 @@ bfa_fcs_rport_sm_fc4_logorcv(struct bfa_fcs_rport_s *rport,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(rport->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -869,7 +869,7 @@ bfa_fcs_rport_sm_fc4_logosend(struct bfa_fcs_rport_s *rport,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(rport->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -905,7 +905,7 @@ bfa_fcs_rport_sm_fc4_offline(struct bfa_fcs_rport_s *rport,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(rport->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -925,10 +925,17 @@ bfa_fcs_rport_sm_hcb_offline(struct bfa_fcs_rport_s *rport,
|
||||
case RPSM_EVENT_HCB_OFFLINE:
|
||||
case RPSM_EVENT_ADDRESS_CHANGE:
|
||||
if (bfa_fcs_port_is_online(rport->port)) {
|
||||
bfa_sm_set_state(rport,
|
||||
bfa_fcs_rport_sm_nsdisc_sending);
|
||||
rport->ns_retries = 0;
|
||||
bfa_fcs_rport_send_gidpn(rport, NULL);
|
||||
if (bfa_fcs_fabric_is_switched(rport->port->fabric)) {
|
||||
bfa_sm_set_state(rport,
|
||||
bfa_fcs_rport_sm_nsdisc_sending);
|
||||
rport->ns_retries = 0;
|
||||
bfa_fcs_rport_send_gidpn(rport, NULL);
|
||||
} else {
|
||||
bfa_sm_set_state(rport,
|
||||
bfa_fcs_rport_sm_plogi_sending);
|
||||
rport->plogi_retries = 0;
|
||||
bfa_fcs_rport_send_plogi(rport, NULL);
|
||||
}
|
||||
} else {
|
||||
rport->pid = 0;
|
||||
bfa_sm_set_state(rport, bfa_fcs_rport_sm_offline);
|
||||
@ -951,7 +958,7 @@ bfa_fcs_rport_sm_hcb_offline(struct bfa_fcs_rport_s *rport,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(rport->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1011,7 +1018,7 @@ bfa_fcs_rport_sm_hcb_logorcv(struct bfa_fcs_rport_s *rport,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(rport->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1038,7 +1045,7 @@ bfa_fcs_rport_sm_hcb_logosend(struct bfa_fcs_rport_s *rport,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(rport->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1073,7 +1080,7 @@ bfa_fcs_rport_sm_logo_sending(struct bfa_fcs_rport_s *rport,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(rport->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1132,7 +1139,7 @@ bfa_fcs_rport_sm_offline(struct bfa_fcs_rport_s *rport, enum rport_event event)
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(rport->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1188,7 +1195,7 @@ bfa_fcs_rport_sm_nsdisc_sending(struct bfa_fcs_rport_s *rport,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(rport->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1249,7 +1256,7 @@ bfa_fcs_rport_sm_nsdisc_retry(struct bfa_fcs_rport_s *rport,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(rport->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1334,7 +1341,7 @@ bfa_fcs_rport_sm_nsdisc_sent(struct bfa_fcs_rport_s *rport,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(rport->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1366,7 +1373,7 @@ bfa_fcs_rport_send_plogi(void *rport_cbarg, struct bfa_fcxp_s *fcxp_alloced)
|
||||
len = fc_plogi_build(&fchs, bfa_fcxp_get_reqbuf(fcxp), rport->pid,
|
||||
bfa_fcs_port_get_fcid(port), 0,
|
||||
port->port_cfg.pwwn, port->port_cfg.nwwn,
|
||||
bfa_pport_get_maxfrsize(port->fcs->bfa));
|
||||
bfa_fcport_get_maxfrsize(port->fcs->bfa));
|
||||
|
||||
bfa_fcxp_send(fcxp, NULL, port->fabric->vf_id, port->lp_tag, BFA_FALSE,
|
||||
FC_CLASS_3, len, &fchs, bfa_fcs_rport_plogi_response,
|
||||
@ -1478,7 +1485,7 @@ bfa_fcs_rport_send_plogiacc(void *rport_cbarg, struct bfa_fcxp_s *fcxp_alloced)
|
||||
len = fc_plogi_acc_build(&fchs, bfa_fcxp_get_reqbuf(fcxp), rport->pid,
|
||||
bfa_fcs_port_get_fcid(port), rport->reply_oxid,
|
||||
port->port_cfg.pwwn, port->port_cfg.nwwn,
|
||||
bfa_pport_get_maxfrsize(port->fcs->bfa));
|
||||
bfa_fcport_get_maxfrsize(port->fcs->bfa));
|
||||
|
||||
bfa_fcxp_send(fcxp, NULL, port->fabric->vf_id, port->lp_tag, BFA_FALSE,
|
||||
FC_CLASS_3, len, &fchs, NULL, NULL, FC_MAX_PDUSZ, 0);
|
||||
@ -1813,7 +1820,7 @@ bfa_fcs_rport_process_rpsc(struct bfa_fcs_rport_s *rport,
|
||||
/*
|
||||
* get curent speed from pport attributes from BFA
|
||||
*/
|
||||
bfa_pport_get_attr(port->fcs->bfa, &pport_attr);
|
||||
bfa_fcport_get_attr(port->fcs->bfa, &pport_attr);
|
||||
|
||||
speeds.port_op_speed = fc_bfa_speed_to_rpsc_operspeed(pport_attr.speed);
|
||||
|
||||
@ -2032,13 +2039,10 @@ bfa_fcs_rport_aen_post(struct bfa_fcs_rport_s *rport,
|
||||
|
||||
switch (event) {
|
||||
case BFA_RPORT_AEN_ONLINE:
|
||||
bfa_log(logmod, BFA_AEN_RPORT_ONLINE, rpwwn_ptr, lpwwn_ptr);
|
||||
break;
|
||||
case BFA_RPORT_AEN_OFFLINE:
|
||||
bfa_log(logmod, BFA_AEN_RPORT_OFFLINE, rpwwn_ptr, lpwwn_ptr);
|
||||
break;
|
||||
case BFA_RPORT_AEN_DISCONNECT:
|
||||
bfa_log(logmod, BFA_AEN_RPORT_DISCONNECT, rpwwn_ptr, lpwwn_ptr);
|
||||
bfa_log(logmod, BFA_LOG_CREATE_ID(BFA_AEN_CAT_RPORT, event),
|
||||
rpwwn_ptr, lpwwn_ptr);
|
||||
break;
|
||||
case BFA_RPORT_AEN_QOS_PRIO:
|
||||
aen_data.rport.priv.qos = data->priv.qos;
|
||||
@ -2164,7 +2168,7 @@ bfa_fcs_rport_update(struct bfa_fcs_rport_s *rport, struct fc_logi_s *plogi)
|
||||
bfa_trc(port->fcs, port->fabric->bb_credit);
|
||||
|
||||
port->fabric->bb_credit = bfa_os_ntohs(plogi->csp.bbcred);
|
||||
bfa_pport_set_tx_bbcredit(port->fcs->bfa,
|
||||
bfa_fcport_set_tx_bbcredit(port->fcs->bfa,
|
||||
port->fabric->bb_credit);
|
||||
}
|
||||
|
||||
@ -2574,23 +2578,6 @@ bfa_fcs_rport_send_ls_rjt(struct bfa_fcs_rport_s *rport, struct fchs_s *rx_fchs,
|
||||
FC_CLASS_3, len, &fchs, NULL, NULL, FC_MAX_PDUSZ, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Module initialization
|
||||
*/
|
||||
void
|
||||
bfa_fcs_rport_modinit(struct bfa_fcs_s *fcs)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Module cleanup
|
||||
*/
|
||||
void
|
||||
bfa_fcs_rport_modexit(struct bfa_fcs_s *fcs)
|
||||
{
|
||||
bfa_fcs_modexit_comp(fcs);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return state of rport.
|
||||
*/
|
||||
|
@ -102,7 +102,7 @@ bfa_fcs_rport_get_attr(struct bfa_fcs_rport_s *rport,
|
||||
rport_attr->qos_attr = qos_attr;
|
||||
|
||||
rport_attr->trl_enforced = BFA_FALSE;
|
||||
if (bfa_pport_is_ratelim(port->fcs->bfa)) {
|
||||
if (bfa_fcport_is_ratelim(port->fcs->bfa)) {
|
||||
if ((rport->rpf.rpsc_speed == BFA_PPORT_SPEED_UNKNOWN) ||
|
||||
(rport->rpf.rpsc_speed <
|
||||
bfa_fcs_port_get_rport_max_speed(port)))
|
||||
|
@ -91,7 +91,7 @@ bfa_fcs_rpf_sm_uninit(struct bfa_fcs_rpf_s *rpf, enum rpf_event event)
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(rport->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -114,7 +114,7 @@ bfa_fcs_rpf_sm_rpsc_sending(struct bfa_fcs_rpf_s *rpf, enum rpf_event event)
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(rport->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -160,7 +160,7 @@ bfa_fcs_rpf_sm_rpsc(struct bfa_fcs_rpf_s *rpf, enum rpf_event event)
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(rport->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -186,7 +186,7 @@ bfa_fcs_rpf_sm_rpsc_retry(struct bfa_fcs_rpf_s *rpf, enum rpf_event event)
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(rport->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -206,7 +206,7 @@ bfa_fcs_rpf_sm_online(struct bfa_fcs_rpf_s *rpf, enum rpf_event event)
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(rport->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -229,7 +229,7 @@ bfa_fcs_rpf_sm_offline(struct bfa_fcs_rpf_s *rpf, enum rpf_event event)
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(rport->fcs, event);
|
||||
}
|
||||
}
|
||||
/**
|
||||
|
@ -90,7 +90,7 @@ bfa_fcs_port_scn_sm_offline(struct bfa_fcs_port_scn_s *scn,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(scn->port->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -109,7 +109,7 @@ bfa_fcs_port_scn_sm_sending_scr(struct bfa_fcs_port_scn_s *scn,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(scn->port->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -137,7 +137,7 @@ bfa_fcs_port_scn_sm_scr(struct bfa_fcs_port_scn_s *scn,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(scn->port->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -157,7 +157,7 @@ bfa_fcs_port_scn_sm_scr_retry(struct bfa_fcs_port_scn_s *scn,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(scn->port->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -171,7 +171,7 @@ bfa_fcs_port_scn_sm_online(struct bfa_fcs_port_scn_s *scn,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(scn->port->fcs, event);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -122,7 +122,7 @@ bfa_fcs_vport_sm_uninit(struct bfa_fcs_vport_s *vport,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(__vport_fcs(vport), event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -165,7 +165,7 @@ bfa_fcs_vport_sm_created(struct bfa_fcs_vport_s *vport,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(__vport_fcs(vport), event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -202,7 +202,7 @@ bfa_fcs_vport_sm_offline(struct bfa_fcs_vport_s *vport,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(__vport_fcs(vport), event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -249,7 +249,7 @@ bfa_fcs_vport_sm_fdisc(struct bfa_fcs_vport_s *vport,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(__vport_fcs(vport), event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -283,7 +283,7 @@ bfa_fcs_vport_sm_fdisc_retry(struct bfa_fcs_vport_s *vport,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(__vport_fcs(vport), event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -310,7 +310,7 @@ bfa_fcs_vport_sm_online(struct bfa_fcs_vport_s *vport,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(__vport_fcs(vport), event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -339,7 +339,7 @@ bfa_fcs_vport_sm_deleting(struct bfa_fcs_vport_s *vport,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(__vport_fcs(vport), event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -387,7 +387,7 @@ bfa_fcs_vport_sm_cleanup(struct bfa_fcs_vport_s *vport,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(__vport_fcs(vport), event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -419,7 +419,7 @@ bfa_fcs_vport_sm_logo(struct bfa_fcs_vport_s *vport,
|
||||
break;
|
||||
|
||||
default:
|
||||
bfa_assert(0);
|
||||
bfa_sm_fault(__vport_fcs(vport), event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -447,22 +447,8 @@ bfa_fcs_vport_aen_post(bfa_fcs_lport_t *port, enum bfa_lport_aen_event event)
|
||||
|
||||
bfa_assert(role <= BFA_PORT_ROLE_FCP_MAX);
|
||||
|
||||
switch (event) {
|
||||
case BFA_LPORT_AEN_NPIV_DUP_WWN:
|
||||
bfa_log(logmod, BFA_AEN_LPORT_NPIV_DUP_WWN, lpwwn_ptr,
|
||||
role_str[role / 2]);
|
||||
break;
|
||||
case BFA_LPORT_AEN_NPIV_FABRIC_MAX:
|
||||
bfa_log(logmod, BFA_AEN_LPORT_NPIV_FABRIC_MAX, lpwwn_ptr,
|
||||
role_str[role / 2]);
|
||||
break;
|
||||
case BFA_LPORT_AEN_NPIV_UNKNOWN:
|
||||
bfa_log(logmod, BFA_AEN_LPORT_NPIV_UNKNOWN, lpwwn_ptr,
|
||||
role_str[role / 2]);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
bfa_log(logmod, BFA_LOG_CREATE_ID(BFA_AEN_CAT_LPORT, event), lpwwn_ptr,
|
||||
role_str[role/2]);
|
||||
|
||||
aen_data.lport.vf_id = port->fabric->vf_id;
|
||||
aen_data.lport.roles = role;
|
||||
@ -478,7 +464,7 @@ static void
|
||||
bfa_fcs_vport_do_fdisc(struct bfa_fcs_vport_s *vport)
|
||||
{
|
||||
bfa_lps_fdisc(vport->lps, vport,
|
||||
bfa_pport_get_maxfrsize(__vport_bfa(vport)),
|
||||
bfa_fcport_get_maxfrsize(__vport_bfa(vport)),
|
||||
__vport_pwwn(vport), __vport_nwwn(vport));
|
||||
vport->vport_stats.fdisc_sent++;
|
||||
}
|
||||
@ -616,38 +602,6 @@ bfa_fcs_vport_delete_comp(struct bfa_fcs_vport_s *vport)
|
||||
bfa_sm_send_event(vport, BFA_FCS_VPORT_SM_DELCOMP);
|
||||
}
|
||||
|
||||
/**
|
||||
* Module initialization
|
||||
*/
|
||||
void
|
||||
bfa_fcs_vport_modinit(struct bfa_fcs_s *fcs)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Module cleanup
|
||||
*/
|
||||
void
|
||||
bfa_fcs_vport_modexit(struct bfa_fcs_s *fcs)
|
||||
{
|
||||
bfa_fcs_modexit_comp(fcs);
|
||||
}
|
||||
|
||||
u32
|
||||
bfa_fcs_vport_get_max(struct bfa_fcs_s *fcs)
|
||||
{
|
||||
struct bfa_ioc_attr_s ioc_attr;
|
||||
|
||||
bfa_get_attr(fcs->bfa, &ioc_attr);
|
||||
|
||||
if (ioc_attr.pci_attr.device_id == BFA_PCI_DEVICE_ID_CT)
|
||||
return BFA_FCS_MAX_VPORTS_SUPP_CT;
|
||||
else
|
||||
return BFA_FCS_MAX_VPORTS_SUPP_CB;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* fcs_vport_api Virtual port API
|
||||
*/
|
||||
@ -684,7 +638,7 @@ bfa_fcs_vport_create(struct bfa_fcs_vport_s *vport, struct bfa_fcs_s *fcs,
|
||||
return BFA_STATUS_VPORT_EXISTS;
|
||||
|
||||
if (bfa_fcs_fabric_vport_count(&fcs->fabric) ==
|
||||
bfa_fcs_vport_get_max(fcs))
|
||||
bfa_lps_get_max_vport(fcs->bfa))
|
||||
return BFA_STATUS_VPORT_MAX;
|
||||
|
||||
vport->lps = bfa_lps_alloc(fcs->bfa);
|
||||
@ -694,7 +648,8 @@ bfa_fcs_vport_create(struct bfa_fcs_vport_s *vport, struct bfa_fcs_s *fcs,
|
||||
vport->vport_drv = vport_drv;
|
||||
bfa_sm_set_state(vport, bfa_fcs_vport_sm_uninit);
|
||||
|
||||
bfa_fcs_lport_init(&vport->lport, fcs, vf_id, vport_cfg, vport);
|
||||
bfa_fcs_lport_attach(&vport->lport, fcs, vf_id, vport);
|
||||
bfa_fcs_lport_init(&vport->lport, vport_cfg);
|
||||
|
||||
bfa_sm_send_event(vport, BFA_FCS_VPORT_SM_CREATE);
|
||||
|
||||
@ -888,4 +843,15 @@ bfa_cb_lps_fdisclogo_comp(void *bfad, void *uarg)
|
||||
bfa_sm_send_event(vport, BFA_FCS_VPORT_SM_RSP_OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* Received clear virtual link
|
||||
*/
|
||||
void
|
||||
bfa_cb_lps_cvl_event(void *bfad, void *uarg)
|
||||
{
|
||||
struct bfa_fcs_vport_s *vport = uarg;
|
||||
|
||||
/* Send an Offline followed by an ONLINE */
|
||||
bfa_sm_send_event(vport, BFA_FCS_VPORT_SM_OFFLINE);
|
||||
bfa_sm_send_event(vport, BFA_FCS_VPORT_SM_ONLINE);
|
||||
}
|
||||
|
@ -1989,7 +1989,7 @@ static struct scsi_host_template bnx2i_host_template = {
|
||||
.queuecommand = iscsi_queuecommand,
|
||||
.eh_abort_handler = iscsi_eh_abort,
|
||||
.eh_device_reset_handler = iscsi_eh_device_reset,
|
||||
.eh_target_reset_handler = iscsi_eh_target_reset,
|
||||
.eh_target_reset_handler = iscsi_eh_recover_target,
|
||||
.change_queue_depth = iscsi_change_queue_depth,
|
||||
.can_queue = 1024,
|
||||
.max_sectors = 127,
|
||||
|
@ -915,7 +915,7 @@ static struct scsi_host_template cxgb3i_host_template = {
|
||||
.cmd_per_lun = ISCSI_DEF_CMD_PER_LUN,
|
||||
.eh_abort_handler = iscsi_eh_abort,
|
||||
.eh_device_reset_handler = iscsi_eh_device_reset,
|
||||
.eh_target_reset_handler = iscsi_eh_target_reset,
|
||||
.eh_target_reset_handler = iscsi_eh_recover_target,
|
||||
.target_alloc = iscsi_target_alloc,
|
||||
.use_clustering = DISABLE_CLUSTERING,
|
||||
.this_id = -1,
|
||||
|
@ -272,7 +272,7 @@ static struct request *get_req(struct scsi_device *sdev, int cmd,
|
||||
int len = 0;
|
||||
|
||||
rq = blk_get_request(sdev->request_queue,
|
||||
(cmd == MODE_SELECT) ? WRITE : READ, GFP_NOIO);
|
||||
(cmd != INQUIRY) ? WRITE : READ, GFP_NOIO);
|
||||
if (!rq) {
|
||||
sdev_printk(KERN_INFO, sdev, "get_req: blk_get_request failed");
|
||||
return NULL;
|
||||
@ -286,14 +286,17 @@ static struct request *get_req(struct scsi_device *sdev, int cmd,
|
||||
len = sizeof(short_trespass);
|
||||
rq->cmd_flags |= REQ_RW;
|
||||
rq->cmd[1] = 0x10;
|
||||
rq->cmd[4] = len;
|
||||
break;
|
||||
case MODE_SELECT_10:
|
||||
len = sizeof(long_trespass);
|
||||
rq->cmd_flags |= REQ_RW;
|
||||
rq->cmd[1] = 0x10;
|
||||
rq->cmd[8] = len;
|
||||
break;
|
||||
case INQUIRY:
|
||||
len = CLARIION_BUFFER_SIZE;
|
||||
rq->cmd[4] = len;
|
||||
memset(buffer, 0, len);
|
||||
break;
|
||||
default:
|
||||
@ -301,7 +304,6 @@ static struct request *get_req(struct scsi_device *sdev, int cmd,
|
||||
break;
|
||||
}
|
||||
|
||||
rq->cmd[4] = len;
|
||||
rq->cmd_type = REQ_TYPE_BLOCK_PC;
|
||||
rq->cmd_flags |= REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT |
|
||||
REQ_FAILFAST_DRIVER;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user