Lines Matching +full:ctrl +full:- +full:len

16  * OR NON-INFRINGEMENT, ARE DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH
22 * linux-drivers@broadcom.com
26 #include <linux/bsg-lib.h>
33 unsigned int mgmt_vendor_specific_fw_cmd(struct be_ctrl_info *ctrl, in mgmt_vendor_specific_fw_cmd() argument
41 struct iscsi_bsg_request *bsg_req = job->request; in mgmt_vendor_specific_fw_cmd()
42 struct be_bsg_vendor_cmd *req = nonemb_cmd->va; in mgmt_vendor_specific_fw_cmd()
45 nonemb_cmd->size = job->request_payload.payload_len; in mgmt_vendor_specific_fw_cmd()
46 memset(nonemb_cmd->va, 0, nonemb_cmd->size); in mgmt_vendor_specific_fw_cmd()
47 region = bsg_req->rqst_data.h_vendor.vendor_cmd[1]; in mgmt_vendor_specific_fw_cmd()
48 sector_size = bsg_req->rqst_data.h_vendor.vendor_cmd[2]; in mgmt_vendor_specific_fw_cmd()
49 sector = bsg_req->rqst_data.h_vendor.vendor_cmd[3]; in mgmt_vendor_specific_fw_cmd()
50 offset = bsg_req->rqst_data.h_vendor.vendor_cmd[4]; in mgmt_vendor_specific_fw_cmd()
51 req->region = region; in mgmt_vendor_specific_fw_cmd()
52 req->sector = sector; in mgmt_vendor_specific_fw_cmd()
53 req->offset = offset; in mgmt_vendor_specific_fw_cmd()
55 if (mutex_lock_interruptible(&ctrl->mbox_lock)) in mgmt_vendor_specific_fw_cmd()
57 switch (bsg_req->rqst_data.h_vendor.vendor_cmd[0]) { in mgmt_vendor_specific_fw_cmd()
60 be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_ISCSI, in mgmt_vendor_specific_fw_cmd()
62 sg_copy_to_buffer(job->request_payload.sg_list, in mgmt_vendor_specific_fw_cmd()
63 job->request_payload.sg_cnt, in mgmt_vendor_specific_fw_cmd()
64 nonemb_cmd->va + offset, job->request_len); in mgmt_vendor_specific_fw_cmd()
67 be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_ISCSI, in mgmt_vendor_specific_fw_cmd()
73 bsg_req->rqst_data.h_vendor.vendor_cmd[0]); in mgmt_vendor_specific_fw_cmd()
75 mutex_unlock(&ctrl->mbox_lock); in mgmt_vendor_specific_fw_cmd()
76 return -EPERM; in mgmt_vendor_specific_fw_cmd()
81 mutex_unlock(&ctrl->mbox_lock); in mgmt_vendor_specific_fw_cmd()
86 be_wrb_hdr_prepare(wrb, nonemb_cmd->size, false, in mgmt_vendor_specific_fw_cmd()
87 job->request_payload.sg_cnt); in mgmt_vendor_specific_fw_cmd()
88 mcc_sge->pa_hi = cpu_to_le32(upper_32_bits(nonemb_cmd->dma)); in mgmt_vendor_specific_fw_cmd()
89 mcc_sge->pa_lo = cpu_to_le32(nonemb_cmd->dma & 0xFFFFFFFF); in mgmt_vendor_specific_fw_cmd()
90 mcc_sge->len = cpu_to_le32(nonemb_cmd->size); in mgmt_vendor_specific_fw_cmd()
94 mutex_unlock(&ctrl->mbox_lock); in mgmt_vendor_specific_fw_cmd()
99 * mgmt_open_connection()- Establish a TCP CXN
118 struct be_ctrl_info *ctrl = &phba->ctrl; in mgmt_open_connection() local
127 unsigned short cid = beiscsi_ep->ep_cid; in mgmt_open_connection()
130 if (dst_addr->sa_family != PF_INET && dst_addr->sa_family != PF_INET6) { in mgmt_open_connection()
133 dst_addr->sa_family); in mgmt_open_connection()
137 phwi_ctrlr = phba->phwi_ctrlr; in mgmt_open_connection()
138 phwi_context = phwi_ctrlr->phwi_ctxt; in mgmt_open_connection()
140 ulp_num = phwi_ctrlr->wrb_context[BE_GET_CRI_FROM_CID(cid)].ulp_num; in mgmt_open_connection()
147 if (mutex_lock_interruptible(&ctrl->mbox_lock)) in mgmt_open_connection()
151 mutex_unlock(&ctrl->mbox_lock); in mgmt_open_connection()
156 req = nonemb_cmd->va; in mgmt_open_connection()
159 be_wrb_hdr_prepare(wrb, nonemb_cmd->size, false, 1); in mgmt_open_connection()
160 be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_ISCSI, in mgmt_open_connection()
162 nonemb_cmd->size); in mgmt_open_connection()
163 if (dst_addr->sa_family == PF_INET) { in mgmt_open_connection()
164 __be32 s_addr = daddr_in->sin_addr.s_addr; in mgmt_open_connection()
165 req->ip_address.ip_type = BEISCSI_IP_TYPE_V4; in mgmt_open_connection()
166 req->ip_address.addr[0] = s_addr & 0x000000ff; in mgmt_open_connection()
167 req->ip_address.addr[1] = (s_addr & 0x0000ff00) >> 8; in mgmt_open_connection()
168 req->ip_address.addr[2] = (s_addr & 0x00ff0000) >> 16; in mgmt_open_connection()
169 req->ip_address.addr[3] = (s_addr & 0xff000000) >> 24; in mgmt_open_connection()
170 req->tcp_port = ntohs(daddr_in->sin_port); in mgmt_open_connection()
171 beiscsi_ep->dst_addr = daddr_in->sin_addr.s_addr; in mgmt_open_connection()
172 beiscsi_ep->dst_tcpport = ntohs(daddr_in->sin_port); in mgmt_open_connection()
173 beiscsi_ep->ip_type = BEISCSI_IP_TYPE_V4; in mgmt_open_connection()
176 req->ip_address.ip_type = BEISCSI_IP_TYPE_V6; in mgmt_open_connection()
177 memcpy(&req->ip_address.addr, in mgmt_open_connection()
178 &daddr_in6->sin6_addr.in6_u.u6_addr8, 16); in mgmt_open_connection()
179 req->tcp_port = ntohs(daddr_in6->sin6_port); in mgmt_open_connection()
180 beiscsi_ep->dst_tcpport = ntohs(daddr_in6->sin6_port); in mgmt_open_connection()
181 memcpy(&beiscsi_ep->dst6_addr, in mgmt_open_connection()
182 &daddr_in6->sin6_addr.in6_u.u6_addr8, 16); in mgmt_open_connection()
183 beiscsi_ep->ip_type = BEISCSI_IP_TYPE_V6; in mgmt_open_connection()
185 req->cid = cid; in mgmt_open_connection()
186 i = phba->nxt_cqid++; in mgmt_open_connection()
187 if (phba->nxt_cqid == phba->num_cpus) in mgmt_open_connection()
188 phba->nxt_cqid = 0; in mgmt_open_connection()
189 req->cq_id = phwi_context->be_cq[i].id; in mgmt_open_connection()
191 "BG_%d : i=%d cq_id=%d\n", i, req->cq_id); in mgmt_open_connection()
192 req->defq_id = def_hdr_id; in mgmt_open_connection()
193 req->hdr_ring_id = def_hdr_id; in mgmt_open_connection()
194 req->data_ring_id = def_data_id; in mgmt_open_connection()
195 req->do_offload = 1; in mgmt_open_connection()
196 req->dataout_template_pa.lo = ptemplate_address->lo; in mgmt_open_connection()
197 req->dataout_template_pa.hi = ptemplate_address->hi; in mgmt_open_connection()
198 sge->pa_hi = cpu_to_le32(upper_32_bits(nonemb_cmd->dma)); in mgmt_open_connection()
199 sge->pa_lo = cpu_to_le32(nonemb_cmd->dma & 0xFFFFFFFF); in mgmt_open_connection()
200 sge->len = cpu_to_le32(nonemb_cmd->size); in mgmt_open_connection()
203 req->hdr.version = MBX_CMD_VER1; in mgmt_open_connection()
204 req->tcp_window_size = 0x8000; in mgmt_open_connection()
205 req->tcp_window_scale_count = 2; in mgmt_open_connection()
209 mutex_unlock(&ctrl->mbox_lock); in mgmt_open_connection()
214 * beiscsi_exec_nemb_cmd()- execute non-embedded MBX cmd
228 struct be_ctrl_info *ctrl = &phba->ctrl; in beiscsi_exec_nemb_cmd() local
234 mutex_lock(&ctrl->mbox_lock); in beiscsi_exec_nemb_cmd()
237 mutex_unlock(&ctrl->mbox_lock); in beiscsi_exec_nemb_cmd()
238 return -ENOMEM; in beiscsi_exec_nemb_cmd()
242 be_wrb_hdr_prepare(wrb, nonemb_cmd->size, false, 1); in beiscsi_exec_nemb_cmd()
243 sge->pa_hi = cpu_to_le32(upper_32_bits(nonemb_cmd->dma)); in beiscsi_exec_nemb_cmd()
244 sge->pa_lo = cpu_to_le32(lower_32_bits(nonemb_cmd->dma)); in beiscsi_exec_nemb_cmd()
245 sge->len = cpu_to_le32(nonemb_cmd->size); in beiscsi_exec_nemb_cmd()
250 set_bit(MCC_TAG_STATE_ASYNC, &ctrl->ptag_state[tag].tag_state); in beiscsi_exec_nemb_cmd()
251 ctrl->ptag_state[tag].cbfn = cbfn; in beiscsi_exec_nemb_cmd()
252 tag_mem = &phba->ctrl.ptag_state[tag].tag_mem_state; in beiscsi_exec_nemb_cmd()
255 tag_mem->size = nonemb_cmd->size; in beiscsi_exec_nemb_cmd()
256 tag_mem->va = nonemb_cmd->va; in beiscsi_exec_nemb_cmd()
257 tag_mem->dma = nonemb_cmd->dma; in beiscsi_exec_nemb_cmd()
260 mutex_unlock(&ctrl->mbox_lock); in beiscsi_exec_nemb_cmd()
270 memcpy(resp_buf, nonemb_cmd->va, resp_buf_len); in beiscsi_exec_nemb_cmd()
278 cmd->va = dma_alloc_coherent(&phba->ctrl.pdev->dev, size, &cmd->dma, in beiscsi_prep_nemb_cmd()
280 if (!cmd->va) { in beiscsi_prep_nemb_cmd()
283 return -ENOMEM; in beiscsi_prep_nemb_cmd()
285 cmd->size = size; in beiscsi_prep_nemb_cmd()
286 be_cmd_hdr_prepare(cmd->va, subsystem, opcode, size); in beiscsi_prep_nemb_cmd()
300 if (rc == -EBUSY) in beiscsi_free_nemb_cmd()
303 dma_free_coherent(&phba->ctrl.pdev->dev, cmd->size, cmd->va, cmd->dma); in beiscsi_free_nemb_cmd()
312 tag_mem = &phba->ctrl.ptag_state[tag].tag_mem_state; in __beiscsi_eq_delay_compl()
313 if (tag_mem->size) { in __beiscsi_eq_delay_compl()
314 dma_free_coherent(&phba->pcidev->dev, tag_mem->size, in __beiscsi_eq_delay_compl()
315 tag_mem->va, tag_mem->dma); in __beiscsi_eq_delay_compl()
316 tag_mem->size = 0; in __beiscsi_eq_delay_compl()
333 req->num_eq = cpu_to_le32(num); in beiscsi_modify_eq_delay()
335 req->delay[i].eq_id = cpu_to_le32(set_eqd[i].eq_id); in beiscsi_modify_eq_delay()
336 req->delay[i].phase = 0; in beiscsi_modify_eq_delay()
337 req->delay[i].delay_multiplier = in beiscsi_modify_eq_delay()
345 * Only free on failure. Async cmds are handled like -EBUSY in beiscsi_modify_eq_delay()
354 * beiscsi_get_initiator_name - read initiator name from flash
374 req->hdr.version = 1; in beiscsi_get_initiator_name()
390 struct be_ctrl_info *ctrl = &phba->ctrl; in beiscsi_if_get_handle() local
397 if (mutex_lock_interruptible(&ctrl->mbox_lock)) in beiscsi_if_get_handle()
398 return -EINTR; in beiscsi_if_get_handle()
401 mutex_unlock(&ctrl->mbox_lock); in beiscsi_if_get_handle()
402 return -ENOMEM; in beiscsi_if_get_handle()
407 be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_ISCSI, in beiscsi_if_get_handle()
411 mutex_unlock(&ctrl->mbox_lock); in beiscsi_if_get_handle()
417 return -EBUSY; in beiscsi_if_get_handle()
422 phba->interface_handle = pbe_allid->if_hndl_list[0]; in beiscsi_if_get_handle()
429 u32 len; in beiscsi_if_zero_ip() local
431 len = (ip_type < BEISCSI_IP_TYPE_V6) ? IP_V4_LEN : IP_V6_LEN; in beiscsi_if_zero_ip()
432 while (len && !ip[len - 1]) in beiscsi_if_zero_ip()
433 len--; in beiscsi_if_zero_ip()
434 return (len == 0); in beiscsi_if_zero_ip()
451 req->action = action; in beiscsi_if_mod_gw()
452 req->ip_addr.ip_type = ip_type; in beiscsi_if_mod_gw()
453 memcpy(req->ip_addr.addr, gw, in beiscsi_if_mod_gw()
505 req->ip_type = ip_type; in beiscsi_if_get_gw()
528 req->ip_params.record_entry_count = 1; in beiscsi_if_clr_ip()
529 req->ip_params.ip_record.action = IP_ACTION_DEL; in beiscsi_if_clr_ip()
530 req->ip_params.ip_record.interface_hndl = in beiscsi_if_clr_ip()
531 phba->interface_handle; in beiscsi_if_clr_ip()
532 req->ip_params.ip_record.ip_addr.size_of_structure = in beiscsi_if_clr_ip()
534 req->ip_params.ip_record.ip_addr.ip_type = if_info->ip_addr.ip_type; in beiscsi_if_clr_ip()
535 memcpy(req->ip_params.ip_record.ip_addr.addr, in beiscsi_if_clr_ip()
536 if_info->ip_addr.addr, in beiscsi_if_clr_ip()
537 sizeof(if_info->ip_addr.addr)); in beiscsi_if_clr_ip()
538 memcpy(req->ip_params.ip_record.ip_addr.subnet_mask, in beiscsi_if_clr_ip()
539 if_info->ip_addr.subnet_mask, in beiscsi_if_clr_ip()
540 sizeof(if_info->ip_addr.subnet_mask)); in beiscsi_if_clr_ip()
542 if (rc < 0 || req->ip_params.ip_record.status) { in beiscsi_if_clr_ip()
545 rc, req->ip_params.ip_record.status); in beiscsi_if_clr_ip()
567 req->ip_params.record_entry_count = 1; in beiscsi_if_set_ip()
568 req->ip_params.ip_record.action = IP_ACTION_ADD; in beiscsi_if_set_ip()
569 req->ip_params.ip_record.interface_hndl = in beiscsi_if_set_ip()
570 phba->interface_handle; in beiscsi_if_set_ip()
571 req->ip_params.ip_record.ip_addr.size_of_structure = in beiscsi_if_set_ip()
573 req->ip_params.ip_record.ip_addr.ip_type = ip_type; in beiscsi_if_set_ip()
575 memcpy(req->ip_params.ip_record.ip_addr.addr, ip, ip_len); in beiscsi_if_set_ip()
577 memcpy(req->ip_params.ip_record.ip_addr.subnet_mask, in beiscsi_if_set_ip()
585 if (rc < 0 || req->ip_params.ip_record.status) { in beiscsi_if_set_ip()
588 rc, req->ip_params.ip_record.status); in beiscsi_if_set_ip()
589 if (req->ip_params.ip_record.status) in beiscsi_if_set_ip()
590 rc = -EINVAL; in beiscsi_if_set_ip()
608 if (if_info->dhcp_state) { in beiscsi_if_en_static()
617 reldhcp->interface_hndl = phba->interface_handle; in beiscsi_if_en_static()
618 reldhcp->ip_type = ip_type; in beiscsi_if_en_static()
630 if (!beiscsi_if_zero_ip(if_info->ip_addr.addr, ip_type)) { in beiscsi_if_en_static()
657 if (if_info->dhcp_state) { in beiscsi_if_en_dhcp()
664 if (!beiscsi_if_zero_ip(if_info->ip_addr.addr, ip_type)) { in beiscsi_if_en_dhcp()
673 rc = beiscsi_if_get_gw(phba, if_info->ip_addr.ip_type, &gw_resp); in beiscsi_if_en_dhcp()
680 if (!beiscsi_if_zero_ip(gw, if_info->ip_addr.ip_type)) { in beiscsi_if_en_dhcp()
682 if_info->ip_addr.ip_type, gw); in beiscsi_if_en_dhcp()
697 dhcpreq->flags = 1; /* 1 - blocking; 0 - non-blocking */ in beiscsi_if_en_dhcp()
698 dhcpreq->retry_count = 1; in beiscsi_if_en_dhcp()
699 dhcpreq->interface_hndl = phba->interface_handle; in beiscsi_if_en_dhcp()
700 dhcpreq->ip_type = ip_type; in beiscsi_if_en_dhcp()
709 * beiscsi_if_set_vlan()- Issue and wait for CMD completion
718 * Failure: Non-Xero Value
730 return -EBUSY; in beiscsi_if_set_vlan()
765 req->interface_hndl = phba->interface_handle; in beiscsi_if_get_info()
766 req->ip_type = ip_type; in beiscsi_if_get_info()
776 -ENOMEM); in beiscsi_if_get_info()
777 return -ENOMEM; in beiscsi_if_get_info()
784 if (rc == -EAGAIN) { in beiscsi_if_get_info()
788 nonemb_cmd.va)->actual_resp_len; in beiscsi_if_get_info()
829 if (!test_bit(BEISCSI_HBA_BOOT_WORK, &phba->state)) { in beiscsi_boot_process_compl()
832 __func__, phba->state); in beiscsi_boot_process_compl()
836 if (phba->boot_struct.tag != tag) { in beiscsi_boot_process_compl()
839 __func__, tag, phba->boot_struct.tag); in beiscsi_boot_process_compl()
842 bs = &phba->boot_struct; in beiscsi_boot_process_compl()
845 switch (bs->action) { in beiscsi_boot_process_compl()
849 bs->action = BEISCSI_BOOT_GET_SHANDLE; in beiscsi_boot_process_compl()
851 bs->retry--; in beiscsi_boot_process_compl()
857 bs->s_handle = boot_resp->boot_session_handle; in beiscsi_boot_process_compl()
859 if (bs->s_handle == BE_BOOT_INVALID_SHANDLE) { in beiscsi_boot_process_compl()
860 bs->action = BEISCSI_BOOT_REOPEN_SESS; in beiscsi_boot_process_compl()
861 bs->retry--; in beiscsi_boot_process_compl()
863 bs->action = BEISCSI_BOOT_GET_SINFO; in beiscsi_boot_process_compl()
868 &bs->nonemb_cmd); in beiscsi_boot_process_compl()
870 sess_resp = bs->nonemb_cmd.va; in beiscsi_boot_process_compl()
871 memcpy(&bs->boot_sess, &sess_resp->session_info, in beiscsi_boot_process_compl()
873 bs->action = BEISCSI_BOOT_LOGOUT_SESS; in beiscsi_boot_process_compl()
880 dma_free_coherent(&phba->ctrl.pdev->dev, bs->nonemb_cmd.size, in beiscsi_boot_process_compl()
881 bs->nonemb_cmd.va, bs->nonemb_cmd.dma); in beiscsi_boot_process_compl()
882 bs->nonemb_cmd.va = NULL; in beiscsi_boot_process_compl()
888 if (logo_resp->session_status != BE_SESS_STATUS_CLOSE) { in beiscsi_boot_process_compl()
891 logo_resp->session_status); in beiscsi_boot_process_compl()
895 bs->action = BEISCSI_BOOT_CREATE_KSET; in beiscsi_boot_process_compl()
902 bs->tag = 0; in beiscsi_boot_process_compl()
903 if (!bs->retry) { in beiscsi_boot_process_compl()
907 status, bs->action); in beiscsi_boot_process_compl()
911 clear_bit(BEISCSI_HBA_BOOT_WORK, &phba->state); in beiscsi_boot_process_compl()
914 schedule_work(&phba->boot_work); in beiscsi_boot_process_compl()
918 * beiscsi_boot_logout_sess()- Logout from boot FW session
927 struct be_ctrl_info *ctrl = &phba->ctrl; in beiscsi_boot_logout_sess() local
932 mutex_lock(&ctrl->mbox_lock); in beiscsi_boot_logout_sess()
935 mutex_unlock(&ctrl->mbox_lock); in beiscsi_boot_logout_sess()
941 be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_ISCSI_INI, in beiscsi_boot_logout_sess()
945 req->session_handle = phba->boot_struct.boot_sess.session_handle; in beiscsi_boot_logout_sess()
947 phba->boot_struct.tag = tag; in beiscsi_boot_logout_sess()
948 set_bit(MCC_TAG_STATE_ASYNC, &ctrl->ptag_state[tag].tag_state); in beiscsi_boot_logout_sess()
949 ctrl->ptag_state[tag].cbfn = beiscsi_boot_process_compl; in beiscsi_boot_logout_sess()
952 mutex_unlock(&ctrl->mbox_lock); in beiscsi_boot_logout_sess()
957 * beiscsi_boot_reopen_sess()- Reopen boot session
966 struct be_ctrl_info *ctrl = &phba->ctrl; in beiscsi_boot_reopen_sess() local
971 mutex_lock(&ctrl->mbox_lock); in beiscsi_boot_reopen_sess()
974 mutex_unlock(&ctrl->mbox_lock); in beiscsi_boot_reopen_sess()
980 be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_ISCSI_INI, in beiscsi_boot_reopen_sess()
983 req->reopen_type = BE_REOPEN_BOOT_SESSIONS; in beiscsi_boot_reopen_sess()
984 req->session_handle = BE_BOOT_INVALID_SHANDLE; in beiscsi_boot_reopen_sess()
986 phba->boot_struct.tag = tag; in beiscsi_boot_reopen_sess()
987 set_bit(MCC_TAG_STATE_ASYNC, &ctrl->ptag_state[tag].tag_state); in beiscsi_boot_reopen_sess()
988 ctrl->ptag_state[tag].cbfn = beiscsi_boot_process_compl; in beiscsi_boot_reopen_sess()
991 mutex_unlock(&ctrl->mbox_lock); in beiscsi_boot_reopen_sess()
997 * beiscsi_boot_get_sinfo()- Get boot session info
1007 struct be_ctrl_info *ctrl = &phba->ctrl; in beiscsi_boot_get_sinfo() local
1014 mutex_lock(&ctrl->mbox_lock); in beiscsi_boot_get_sinfo()
1017 mutex_unlock(&ctrl->mbox_lock); in beiscsi_boot_get_sinfo()
1021 nonemb_cmd = &phba->boot_struct.nonemb_cmd; in beiscsi_boot_get_sinfo()
1022 nonemb_cmd->size = sizeof(struct be_cmd_get_session_resp); in beiscsi_boot_get_sinfo()
1023 nonemb_cmd->va = dma_alloc_coherent(&phba->ctrl.pdev->dev, in beiscsi_boot_get_sinfo()
1024 nonemb_cmd->size, in beiscsi_boot_get_sinfo()
1025 &nonemb_cmd->dma, in beiscsi_boot_get_sinfo()
1027 if (!nonemb_cmd->va) { in beiscsi_boot_get_sinfo()
1028 mutex_unlock(&ctrl->mbox_lock); in beiscsi_boot_get_sinfo()
1032 req = nonemb_cmd->va; in beiscsi_boot_get_sinfo()
1036 be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_ISCSI_INI, in beiscsi_boot_get_sinfo()
1039 req->session_handle = phba->boot_struct.s_handle; in beiscsi_boot_get_sinfo()
1040 sge->pa_hi = cpu_to_le32(upper_32_bits(nonemb_cmd->dma)); in beiscsi_boot_get_sinfo()
1041 sge->pa_lo = cpu_to_le32(nonemb_cmd->dma & 0xFFFFFFFF); in beiscsi_boot_get_sinfo()
1042 sge->len = cpu_to_le32(nonemb_cmd->size); in beiscsi_boot_get_sinfo()
1044 phba->boot_struct.tag = tag; in beiscsi_boot_get_sinfo()
1045 set_bit(MCC_TAG_STATE_ASYNC, &ctrl->ptag_state[tag].tag_state); in beiscsi_boot_get_sinfo()
1046 ctrl->ptag_state[tag].cbfn = beiscsi_boot_process_compl; in beiscsi_boot_get_sinfo()
1049 mutex_unlock(&ctrl->mbox_lock); in beiscsi_boot_get_sinfo()
1055 struct be_ctrl_info *ctrl = &phba->ctrl; in __beiscsi_boot_get_shandle() local
1060 mutex_lock(&ctrl->mbox_lock); in __beiscsi_boot_get_shandle()
1063 mutex_unlock(&ctrl->mbox_lock); in __beiscsi_boot_get_shandle()
1069 be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_ISCSI_INI, in __beiscsi_boot_get_shandle()
1074 phba->boot_struct.tag = tag; in __beiscsi_boot_get_shandle()
1075 set_bit(MCC_TAG_STATE_ASYNC, &ctrl->ptag_state[tag].tag_state); in __beiscsi_boot_get_shandle()
1076 ctrl->ptag_state[tag].cbfn = beiscsi_boot_process_compl; in __beiscsi_boot_get_shandle()
1080 mutex_unlock(&ctrl->mbox_lock); in __beiscsi_boot_get_shandle()
1085 * beiscsi_boot_get_shandle()- Get boot session handle
1108 return -EAGAIN; in beiscsi_boot_get_shandle()
1116 return -EBUSY; in beiscsi_boot_get_shandle()
1121 if (!boot_resp->boot_session_count) { in beiscsi_boot_get_shandle()
1124 return -ENXIO; in beiscsi_boot_get_shandle()
1128 *s_handle = boot_resp->boot_session_handle; in beiscsi_boot_get_shandle()
1133 * beiscsi_drvr_ver_disp()- Display the driver Name and Version
1149 * beiscsi_fw_ver_disp()- Display Firmware Version
1164 return snprintf(buf, PAGE_SIZE, "%s\n", phba->fw_ver_str); in beiscsi_fw_ver_disp()
1168 * beiscsi_active_session_disp()- Display Sessions Active
1182 uint16_t avlbl_cids = 0, ulp_num, len = 0, total_cids = 0; in beiscsi_active_session_disp() local
1185 if (test_bit(ulp_num, (void *)&phba->fw_config.ulp_supported)) { in beiscsi_active_session_disp()
1188 len += scnprintf(buf+len, PAGE_SIZE - len, in beiscsi_active_session_disp()
1190 (total_cids - avlbl_cids)); in beiscsi_active_session_disp()
1192 len += scnprintf(buf+len, PAGE_SIZE - len, in beiscsi_active_session_disp()
1196 return len; in beiscsi_active_session_disp()
1200 * beiscsi_free_session_disp()- Display Avaliable Session
1214 uint16_t ulp_num, len = 0; in beiscsi_free_session_disp() local
1217 if (test_bit(ulp_num, (void *)&phba->fw_config.ulp_supported)) in beiscsi_free_session_disp()
1218 len += scnprintf(buf+len, PAGE_SIZE - len, in beiscsi_free_session_disp()
1222 len += scnprintf(buf+len, PAGE_SIZE - len, in beiscsi_free_session_disp()
1226 return len; in beiscsi_free_session_disp()
1230 * beiscsi_adap_family_disp()- Display adapter family.
1246 dev_id = phba->pcidev->device; in beiscsi_adap_family_disp()
1255 return snprintf(buf, PAGE_SIZE, "BE3-R Adapter Family\n"); in beiscsi_adap_family_disp()
1257 return snprintf(buf, PAGE_SIZE, "Skyhawk-R Adapter Family\n"); in beiscsi_adap_family_disp()
1265 * beiscsi_phys_port_disp()- Display Physical Port Identifier
1281 phba->fw_config.phys_port); in beiscsi_phys_port_disp()
1289 struct iscsi_wrb *pwrb = pwrb_handle->pwrb; in beiscsi_offload_cxn_v0()
1293 params->dw[offsetof(struct amap_beiscsi_offload_params, in beiscsi_offload_cxn_v0()
1300 params->dw[offsetof(struct amap_beiscsi_offload_params, in beiscsi_offload_cxn_v0()
1303 (params->dw[offsetof(struct amap_beiscsi_offload_params, in beiscsi_offload_cxn_v0()
1306 (params->dw[offsetof(struct amap_beiscsi_offload_params, in beiscsi_offload_cxn_v0()
1309 (params->dw[offsetof(struct amap_beiscsi_offload_params, in beiscsi_offload_cxn_v0()
1312 (params->dw[offsetof(struct amap_beiscsi_offload_params, in beiscsi_offload_cxn_v0()
1315 (params->dw[offsetof(struct amap_beiscsi_offload_params, in beiscsi_offload_cxn_v0()
1319 (params->dw[offsetof(struct amap_beiscsi_offload_params, in beiscsi_offload_cxn_v0()
1322 pwrb, pwrb_handle->wrb_index); in beiscsi_offload_cxn_v0()
1325 max_burst_length, pwrb, params->dw[offsetof in beiscsi_offload_cxn_v0()
1330 pwrb, pwrb_handle->wrb_index); in beiscsi_offload_cxn_v0()
1331 if (pwrb_context->plast_wrb) in beiscsi_offload_cxn_v0()
1334 pwrb_context->plast_wrb, in beiscsi_offload_cxn_v0()
1335 pwrb_handle->wrb_index); in beiscsi_offload_cxn_v0()
1336 pwrb_context->plast_wrb = pwrb; in beiscsi_offload_cxn_v0()
1350 mem_descr->mem_array[0].bus_address.u.a32.address_hi); in beiscsi_offload_cxn_v0()
1353 mem_descr->mem_array[0].bus_address.u.a32.address_lo); in beiscsi_offload_cxn_v0()
1360 struct iscsi_wrb *pwrb = pwrb_handle->pwrb; in beiscsi_offload_cxn_v2()
1363 max_burst_length, pwrb, params->dw[offsetof in beiscsi_offload_cxn_v2()
1371 pwrb, pwrb_handle->wrb_index); in beiscsi_offload_cxn_v2()
1372 if (pwrb_context->plast_wrb) in beiscsi_offload_cxn_v2()
1375 pwrb_context->plast_wrb, in beiscsi_offload_cxn_v2()
1376 pwrb_handle->wrb_index); in beiscsi_offload_cxn_v2()
1377 pwrb_context->plast_wrb = pwrb; in beiscsi_offload_cxn_v2()
1380 pwrb, pwrb_handle->wrb_index); in beiscsi_offload_cxn_v2()
1383 params->dw[offsetof(struct amap_beiscsi_offload_params, in beiscsi_offload_cxn_v2()
1387 params->dw[offsetof(struct amap_beiscsi_offload_params, in beiscsi_offload_cxn_v2()
1391 params->dw[offsetof(struct amap_beiscsi_offload_params, in beiscsi_offload_cxn_v2()
1396 (params->dw[offsetof(struct amap_beiscsi_offload_params, in beiscsi_offload_cxn_v2()
1399 (params->dw[offsetof(struct amap_beiscsi_offload_params, in beiscsi_offload_cxn_v2()
1402 (params->dw[offsetof(struct amap_beiscsi_offload_params, in beiscsi_offload_cxn_v2()
1406 (params->dw[offsetof(struct amap_beiscsi_offload_params, in beiscsi_offload_cxn_v2()
1409 (params->dw[offsetof(struct amap_beiscsi_offload_params, in beiscsi_offload_cxn_v2()
1414 (params->dw[offsetof(struct amap_beiscsi_offload_params, in beiscsi_offload_cxn_v2()
1420 (params->dw[offsetof(struct amap_beiscsi_offload_params, in beiscsi_offload_cxn_v2()
1425 (params->dw[offsetof(struct amap_beiscsi_offload_params, in beiscsi_offload_cxn_v2()
1430 (params->dw[offsetof(struct amap_beiscsi_offload_params, in beiscsi_offload_cxn_v2()
1438 struct be_ctrl_info *ctrl = &phba->ctrl; in beiscsi_invalidate_cxn() local
1442 mutex_lock(&ctrl->mbox_lock); in beiscsi_invalidate_cxn()
1445 mutex_unlock(&ctrl->mbox_lock); in beiscsi_invalidate_cxn()
1452 be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_ISCSI_INI, in beiscsi_invalidate_cxn()
1455 req->session_handle = beiscsi_ep->fw_handle; in beiscsi_invalidate_cxn()
1456 req->cid = beiscsi_ep->ep_cid; in beiscsi_invalidate_cxn()
1457 if (beiscsi_ep->conn) in beiscsi_invalidate_cxn()
1458 req->cleanup_type = BE_CLEANUP_TYPE_INVALIDATE; in beiscsi_invalidate_cxn()
1460 req->cleanup_type = BE_CLEANUP_TYPE_ISSUE_TCP_RST; in beiscsi_invalidate_cxn()
1462 * 0 - non-persistent targets in beiscsi_invalidate_cxn()
1463 * 1 - save session info on flash in beiscsi_invalidate_cxn()
1465 req->save_cfg = 0; in beiscsi_invalidate_cxn()
1467 mutex_unlock(&ctrl->mbox_lock); in beiscsi_invalidate_cxn()
1474 struct be_ctrl_info *ctrl = &phba->ctrl; in beiscsi_upload_cxn() local
1479 mutex_lock(&ctrl->mbox_lock); in beiscsi_upload_cxn()
1482 mutex_unlock(&ctrl->mbox_lock); in beiscsi_upload_cxn()
1488 be_cmd_hdr_prepare(&req->hdr, CMD_COMMON_TCP_UPLOAD, in beiscsi_upload_cxn()
1490 req->id = beiscsi_ep->ep_cid; in beiscsi_upload_cxn()
1491 if (beiscsi_ep->conn) in beiscsi_upload_cxn()
1492 req->upload_type = BE_UPLOAD_TYPE_GRACEFUL; in beiscsi_upload_cxn()
1494 req->upload_type = BE_UPLOAD_TYPE_ABORT; in beiscsi_upload_cxn()
1496 mutex_unlock(&ctrl->mbox_lock); in beiscsi_upload_cxn()
1504 struct be_ctrl_info *ctrl = &phba->ctrl; in beiscsi_mgmt_invalidate_icds() local
1513 return -EINVAL; in beiscsi_mgmt_invalidate_icds()
1516 nonemb_cmd.va = dma_alloc_coherent(&phba->ctrl.pdev->dev, in beiscsi_mgmt_invalidate_icds()
1522 return -ENOMEM; in beiscsi_mgmt_invalidate_icds()
1525 mutex_lock(&ctrl->mbox_lock); in beiscsi_mgmt_invalidate_icds()
1528 mutex_unlock(&ctrl->mbox_lock); in beiscsi_mgmt_invalidate_icds()
1529 dma_free_coherent(&phba->ctrl.pdev->dev, nonemb_cmd.size, in beiscsi_mgmt_invalidate_icds()
1531 return -ENOMEM; in beiscsi_mgmt_invalidate_icds()
1536 be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_ISCSI, in beiscsi_mgmt_invalidate_icds()
1539 req->ref_handle = 0; in beiscsi_mgmt_invalidate_icds()
1540 req->cleanup_type = CMD_ISCSI_COMMAND_INVALIDATE; in beiscsi_mgmt_invalidate_icds()
1542 req->table[i].icd = inv_tbl[i].icd; in beiscsi_mgmt_invalidate_icds()
1543 req->table[i].cid = inv_tbl[i].cid; in beiscsi_mgmt_invalidate_icds()
1544 req->icd_count++; in beiscsi_mgmt_invalidate_icds()
1547 sge->pa_hi = cpu_to_le32(upper_32_bits(nonemb_cmd.dma)); in beiscsi_mgmt_invalidate_icds()
1548 sge->pa_lo = cpu_to_le32(lower_32_bits(nonemb_cmd.dma)); in beiscsi_mgmt_invalidate_icds()
1549 sge->len = cpu_to_le32(nonemb_cmd.size); in beiscsi_mgmt_invalidate_icds()
1552 mutex_unlock(&ctrl->mbox_lock); in beiscsi_mgmt_invalidate_icds()
1555 if (rc != -EBUSY) in beiscsi_mgmt_invalidate_icds()
1556 dma_free_coherent(&phba->ctrl.pdev->dev, nonemb_cmd.size, in beiscsi_mgmt_invalidate_icds()