Lines Matching defs:phba

88 struct be_mcc_wrb *alloc_mcc_wrb(struct beiscsi_hba *phba,
91 struct be_queue_info *mccq = &phba->ctrl.mcc_obj.q;
95 spin_lock(&phba->ctrl.mcc_lock);
97 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT |
100 mccq->used, phba->ctrl.mcc_tag_available);
104 if (!phba->ctrl.mcc_tag_available)
107 tag = phba->ctrl.mcc_tag[phba->ctrl.mcc_alloc_index];
109 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT |
112 phba->ctrl.mcc_tag_available,
113 phba->ctrl.mcc_alloc_index);
119 phba->ctrl.mcc_tag[phba->ctrl.mcc_alloc_index] = 0;
120 phba->ctrl.mcc_tag_status[tag] = 0;
121 phba->ctrl.ptag_state[tag].tag_state = 0;
122 phba->ctrl.ptag_state[tag].cbfn = NULL;
123 phba->ctrl.mcc_tag_available--;
124 if (phba->ctrl.mcc_alloc_index == (MAX_MCC_CMD - 1))
125 phba->ctrl.mcc_alloc_index = 0;
127 phba->ctrl.mcc_alloc_index++;
137 spin_unlock(&phba->ctrl.mcc_lock);
159 * @phba: Driver private structure
168 int __beiscsi_mcc_compl_status(struct beiscsi_hba *phba,
173 struct be_queue_info *mccq = &phba->ctrl.mcc_obj.q;
181 mcc_tag_status = phba->ctrl.mcc_tag_status[tag];
199 beiscsi_log(phba, KERN_WARNING,
208 beiscsi_log(phba, KERN_WARNING,
223 * @phba: Driver private structure
234 int beiscsi_mccq_compl_wait(struct beiscsi_hba *phba,
242 __beiscsi_log(phba, KERN_ERR,
247 if (beiscsi_hba_in_error(phba)) {
249 &phba->ctrl.ptag_state[tag].tag_state);
254 rc = wait_event_interruptible_timeout(phba->ctrl.mcc_wait[tag],
255 phba->ctrl.mcc_tag_status[tag],
263 if (!test_bit(BEISCSI_HBA_ONLINE, &phba->state)) {
265 &phba->ctrl.ptag_state[tag].tag_state);
282 tag_mem = &phba->ctrl.ptag_state[tag].tag_mem_state;
293 &phba->ctrl.ptag_state[tag].tag_state);
295 beiscsi_log(phba, KERN_ERR,
302 rc = __beiscsi_mcc_compl_status(phba, tag, wrb, mbx_cmd_mem);
304 free_mcc_wrb(&phba->ctrl, tag);
323 struct beiscsi_hba *phba = pci_get_drvdata(ctrl->pdev);
333 beiscsi_log(phba, KERN_ERR,
356 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG | BEISCSI_LOG_MBOX,
362 static void beiscsi_process_async_link(struct beiscsi_hba *phba,
369 phba->port_speed = evt->port_speed;
375 set_bit(BEISCSI_HBA_LINK_UP, &phba->state);
376 if (test_bit(BEISCSI_HBA_BOOT_FOUND, &phba->state))
377 beiscsi_start_boot_work(phba, BE_BOOT_INVALID_SHANDLE);
378 __beiscsi_log(phba, KERN_ERR,
382 clear_bit(BEISCSI_HBA_LINK_UP, &phba->state);
383 __beiscsi_log(phba, KERN_ERR,
386 iscsi_host_for_each_session(phba->shost,
400 static void beiscsi_process_async_sli(struct beiscsi_hba *phba,
417 (phba->fw_config.phys_port * 8) & 0xff;
419 (phba->fw_config.phys_port * 8) & 0xff;
421 old_state = phba->optic_state;
422 phba->optic_state = state;
426 __beiscsi_log(phba, KERN_ERR,
428 phba->port_name, async_sli->event_data1);
446 if (old_state != phba->optic_state)
447 __beiscsi_log(phba, sev, "BC_%d : Port %c: %s%s\n",
448 phba->port_name,
453 void beiscsi_process_async_event(struct beiscsi_hba *phba,
464 beiscsi_process_async_link(phba, compl);
467 if (test_bit(BEISCSI_HBA_BOOT_FOUND, &phba->state))
468 beiscsi_start_boot_work(phba, BE_BOOT_INVALID_SHANDLE);
472 beiscsi_process_async_sli(phba, compl);
479 beiscsi_log(phba, sev, BEISCSI_LOG_CONFIG | BEISCSI_LOG_MBOX,
487 struct beiscsi_hba *phba = pci_get_drvdata(ctrl->pdev);
498 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_MBOX |
508 beiscsi_log(phba, KERN_WARNING,
542 ctrl->ptag_state[tag].cbfn(phba, tag);
544 __beiscsi_log(phba, KERN_ERR,
552 __beiscsi_mcc_compl_status(phba, tag, NULL, NULL);
561 void be_mcc_notify(struct beiscsi_hba *phba, unsigned int tag)
563 struct be_queue_info *mccq = &phba->ctrl.mcc_obj.q;
566 set_bit(MCC_TAG_STATE_RUNNING, &phba->ctrl.ptag_state[tag].tag_state);
571 iowrite32(val, phba->db_va + DB_MCCQ_OFFSET);
590 struct beiscsi_hba *phba = pci_get_drvdata(ctrl->pdev);
600 if (beiscsi_hba_in_error(phba))
617 beiscsi_log(phba, KERN_ERR,
620 set_bit(BEISCSI_HBA_FW_TIMEOUT, &phba->state);
782 struct beiscsi_hba *phba = pci_get_drvdata(ctrl->pdev);
796 if (is_chip_be2_be3r(phba)) {
833 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT,
850 int beiscsi_cmd_mccq_create(struct beiscsi_hba *phba,
861 mutex_lock(&phba->ctrl.mbox_lock);
862 ctrl = &phba->ctrl;
879 PCI_FUNC(phba->pcidev->devfn));
895 mutex_unlock(&phba->ctrl.mbox_lock);
905 struct beiscsi_hba *phba = pci_get_drvdata(ctrl->pdev);
909 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_INIT,
983 struct beiscsi_hba *phba = pci_get_drvdata(ctrl->pdev);
996 if (phba->fw_config.dual_ulp_aware) {
1002 if (is_chip_be2_be3r(phba)) {
1044 defq_ring = &phba->phwi_ctrlr->default_pdu_hdr[ulp_num];
1046 defq_ring = &phba->phwi_ctrlr->
1051 if (!phba->fw_config.dual_ulp_aware) {
1084 struct beiscsi_hba *phba = pci_get_drvdata(ctrl->pdev);
1096 if (phba->fw_config.dual_ulp_aware) {
1110 if (!phba->fw_config.dual_ulp_aware) {
1173 struct beiscsi_hba *phba = pci_get_drvdata(ctrl->pdev);
1202 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT,
1217 * @phba: device priv structure instance
1225 int be_cmd_set_vlan(struct beiscsi_hba *phba,
1231 struct be_ctrl_info *ctrl = &phba->ctrl;
1235 wrb = alloc_mcc_wrb(phba, &tag);
1247 req->interface_hndl = phba->interface_handle;
1250 be_mcc_notify(phba, tag);
1257 struct beiscsi_hba *phba)
1269 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT,
1289 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_INIT,
1298 phba->fw_config.iscsi_features =
1300 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_INIT,
1301 "BM_%d : phba->fw_config.iscsi_features = %d\n",
1302 phba->fw_config.iscsi_features);
1303 memcpy(phba->fw_ver_str, resp->params.hba_attribs.
1306 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT,
1319 * @phba: ptr to the dev priv structure
1329 struct beiscsi_hba *phba)
1346 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT,
1352 phba->fw_config.phys_port = pfw_cfg->phys_port;
1353 if (phba->fw_config.phys_port >= BEISCSI_PHYS_PORT_MAX) {
1354 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT,
1356 phba->fw_config.phys_port);
1361 if (!is_chip_be2_be3r(phba)) {
1362 phba->fw_config.eqid_count = pfw_cfg->eqid_count;
1363 phba->fw_config.cqid_count = pfw_cfg->cqid_count;
1364 if (phba->fw_config.eqid_count == 0 ||
1365 phba->fw_config.eqid_count > 2048) {
1366 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT,
1368 phba->fw_config.eqid_count);
1371 if (phba->fw_config.cqid_count == 0 ||
1372 phba->fw_config.cqid_count > 4096) {
1373 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT,
1375 phba->fw_config.cqid_count);
1378 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_INIT,
1380 phba->fw_config.eqid_count,
1381 phba->fw_config.cqid_count);
1393 set_bit(ulp_num, &phba->fw_config.ulp_supported);
1396 phba->fw_config.iscsi_cid_start[ulp_num] =
1398 phba->fw_config.iscsi_cid_count[ulp_num] =
1401 phba->fw_config.iscsi_icd_start[ulp_num] =
1403 phba->fw_config.iscsi_icd_count[ulp_num] =
1406 phba->fw_config.iscsi_chain_start[ulp_num] =
1408 phba->fw_config.iscsi_chain_count[ulp_num] =
1411 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_INIT,
1418 phba->fw_config.
1420 phba->fw_config.
1422 phba->fw_config.
1424 phba->fw_config.
1429 if (phba->fw_config.ulp_supported == 0) {
1430 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT,
1441 if (test_bit(ulp_num, &phba->fw_config.ulp_supported))
1443 icd_count = phba->fw_config.iscsi_icd_count[ulp_num];
1445 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT,
1450 cid_count = BEISCSI_GET_CID_COUNT(phba, BEISCSI_ULP0) +
1451 BEISCSI_GET_CID_COUNT(phba, BEISCSI_ULP1);
1453 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT,
1462 phba->fw_config.dual_ulp_aware = (pfw_cfg->function_mode &
1465 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_INIT,
1467 phba->fw_config.dual_ulp_aware);
1479 * @phba: ptr to the dev priv structure
1484 int beiscsi_get_port_name(struct be_ctrl_info *ctrl, struct beiscsi_hba *phba)
1500 phba->port_name = 0;
1502 phba->port_name = ioctl->p.resp.port_names >>
1503 (phba->fw_config.phys_port * 8) & 0xff;
1505 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_INIT,
1510 if (phba->port_name == 0)
1511 phba->port_name = '?';
1517 int beiscsi_set_host_data(struct beiscsi_hba *phba)
1519 struct be_ctrl_info *ctrl = &phba->ctrl;
1524 if (is_chip_be2_be3r(phba))
1546 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_INIT,
1555 __beiscsi_log(phba, KERN_INFO,
1563 int beiscsi_set_uer_feature(struct beiscsi_hba *phba)
1565 struct be_ctrl_info *ctrl = &phba->ctrl;
1584 phba->ue2rp = ioctl->param.resp.ue2rp;
1585 set_bit(BEISCSI_HBA_UER_SUPP, &phba->state);
1586 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_INIT,
1595 __beiscsi_log(phba, KERN_INFO,
1603 static u32 beiscsi_get_post_stage(struct beiscsi_hba *phba)
1607 if (is_chip_be2_be3r(phba))
1608 sem = ioread32(phba->csr_va + SLIPORT_SEMAPHORE_OFFSET_BEx);
1610 pci_read_config_dword(phba->pcidev,
1615 int beiscsi_check_fw_rdy(struct beiscsi_hba *phba)
1621 post = beiscsi_get_post_stage(phba);
1632 __beiscsi_log(phba, KERN_ERR,
1639 int beiscsi_cmd_function_reset(struct beiscsi_hba *phba)
1641 struct be_ctrl_info *ctrl = &phba->ctrl;
1661 struct beiscsi_hba *phba = pci_get_drvdata(ctrl->pdev);
1694 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_INIT,
1700 int beiscsi_init_sliport(struct beiscsi_hba *phba)
1705 status = beiscsi_check_fw_rdy(phba);
1710 phba->state &= ~BEISCSI_HBA_IN_ERR;
1713 phba->state &= ~BEISCSI_HBA_UER_SUPP;
1719 status = beiscsi_cmd_function_reset(phba);
1721 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT,
1727 return beiscsi_cmd_special_wrb(&phba->ctrl, 1);
1732 * @phba: pointer to dev priv structure
1739 int beiscsi_cmd_iscsi_cleanup(struct beiscsi_hba *phba, unsigned short ulp)
1741 struct be_ctrl_info *ctrl = &phba->ctrl;
1751 hdr_ring_id = HWI_GET_DEF_HDRQ_ID(phba, ulp);
1752 data_ring_id = HWI_GET_DEF_BUFQ_ID(phba, ulp);
1753 if (is_chip_be2_be3r(phba)) {
1776 beiscsi_log(phba, KERN_WARNING, BEISCSI_LOG_INIT,
1784 * @phba: Driver priv structure
1788 int beiscsi_detect_ue(struct beiscsi_hba *phba)
1795 pci_read_config_dword(phba->pcidev,
1797 pci_read_config_dword(phba->pcidev,
1800 pci_read_config_dword(phba->pcidev,
1803 pci_read_config_dword(phba->pcidev,
1812 set_bit(BEISCSI_HBA_IN_UE, &phba->state);
1813 __beiscsi_log(phba, KERN_ERR,
1821 __beiscsi_log(phba, KERN_ERR,
1830 __beiscsi_log(phba, KERN_ERR,
1840 * @phba: Driver priv structure
1845 int beiscsi_detect_tpe(struct beiscsi_hba *phba)
1850 post = beiscsi_get_post_stage(phba);
1854 set_bit(BEISCSI_HBA_IN_TPE, &phba->state);
1855 __beiscsi_log(phba, KERN_INFO,
1859 __beiscsi_log(phba, KERN_INFO,