Lines Matching refs:cmd

56 static void bnx2i_get_write_cmd_bd_idx(struct bnx2i_cmd *cmd, u32 buf_off,  in bnx2i_get_write_cmd_bd_idx()  argument
59 struct iscsi_bd *bd_tbl = cmd->io_tbl.bd_tbl; in bnx2i_get_write_cmd_bd_idx()
86 struct bnx2i_cmd *cmd = task->dd_data; in bnx2i_setup_write_cmd_bd_info() local
90 u32 cmd_len = cmd->req.total_data_transfer_length; in bnx2i_setup_write_cmd_bd_info()
104 bnx2i_get_write_cmd_bd_idx(cmd, buffer_offset, in bnx2i_setup_write_cmd_bd_info()
106 cmd->req.ud_buffer_offset = start_bd_offset; in bnx2i_setup_write_cmd_bd_info()
107 cmd->req.ud_start_bd_index = start_bd_idx; in bnx2i_setup_write_cmd_bd_info()
112 bnx2i_get_write_cmd_bd_idx(cmd, buffer_offset, in bnx2i_setup_write_cmd_bd_info()
115 (start_bd_idx > scsi_sg_count(cmd->scsi_cmd))) { in bnx2i_setup_write_cmd_bd_info()
121 buffer_offset, cmd->io_tbl.bd_valid, in bnx2i_setup_write_cmd_bd_info()
122 scsi_sg_count(cmd->scsi_cmd)); in bnx2i_setup_write_cmd_bd_info()
123 for (i = 0; i < cmd->io_tbl.bd_valid; i++) in bnx2i_setup_write_cmd_bd_info()
126 i, cmd->io_tbl.bd_tbl[i].\ in bnx2i_setup_write_cmd_bd_info()
129 cmd->req.sd_buffer_offset = start_bd_offset; in bnx2i_setup_write_cmd_bd_info()
130 cmd->req.sd_start_bd_index = start_bd_idx; in bnx2i_setup_write_cmd_bd_info()
143 static int bnx2i_map_scsi_sg(struct bnx2i_hba *hba, struct bnx2i_cmd *cmd) in bnx2i_map_scsi_sg() argument
145 struct scsi_cmnd *sc = cmd->scsi_cmd; in bnx2i_map_scsi_sg()
146 struct iscsi_bd *bd = cmd->io_tbl.bd_tbl; in bnx2i_map_scsi_sg()
186 static void bnx2i_iscsi_map_sg_list(struct bnx2i_cmd *cmd) in bnx2i_iscsi_map_sg_list() argument
190 bd_count = bnx2i_map_scsi_sg(cmd->conn->hba, cmd); in bnx2i_iscsi_map_sg_list()
192 struct iscsi_bd *bd = cmd->io_tbl.bd_tbl; in bnx2i_iscsi_map_sg_list()
197 cmd->io_tbl.bd_valid = bd_count; in bnx2i_iscsi_map_sg_list()
207 void bnx2i_iscsi_unmap_sg_list(struct bnx2i_cmd *cmd) in bnx2i_iscsi_unmap_sg_list() argument
209 struct scsi_cmnd *sc = cmd->scsi_cmd; in bnx2i_iscsi_unmap_sg_list()
211 if (cmd->io_tbl.bd_valid && sc) { in bnx2i_iscsi_unmap_sg_list()
213 cmd->io_tbl.bd_valid = 0; in bnx2i_iscsi_unmap_sg_list()
217 static void bnx2i_setup_cmd_wqe_template(struct bnx2i_cmd *cmd) in bnx2i_setup_cmd_wqe_template() argument
219 memset(&cmd->req, 0x00, sizeof(cmd->req)); in bnx2i_setup_cmd_wqe_template()
220 cmd->req.op_code = 0xFF; in bnx2i_setup_cmd_wqe_template()
221 cmd->req.bd_list_addr_lo = (u32) cmd->io_tbl.bd_tbl_dma; in bnx2i_setup_cmd_wqe_template()
222 cmd->req.bd_list_addr_hi = in bnx2i_setup_cmd_wqe_template()
223 (u32) ((u64) cmd->io_tbl.bd_tbl_dma >> 32); in bnx2i_setup_cmd_wqe_template()
445 struct bnx2i_cmd *cmd) in bnx2i_alloc_bdt() argument
447 struct io_bdt *io = &cmd->io_tbl; in bnx2i_alloc_bdt()
474 struct bnx2i_cmd *cmd = task->dd_data; in bnx2i_destroy_cmd_pool() local
476 if (cmd->io_tbl.bd_tbl) in bnx2i_destroy_cmd_pool()
480 cmd->io_tbl.bd_tbl, in bnx2i_destroy_cmd_pool()
481 cmd->io_tbl.bd_tbl_dma); in bnx2i_destroy_cmd_pool()
499 struct bnx2i_cmd *cmd = task->dd_data; in bnx2i_setup_cmd_pool() local
501 task->hdr = &cmd->hdr; in bnx2i_setup_cmd_pool()
504 if (bnx2i_alloc_bdt(hba, session, cmd)) in bnx2i_setup_cmd_pool()
1081 struct bnx2i_cmd *cmd = task->dd_data; in bnx2i_iscsi_send_generic_request() local
1082 struct bnx2i_conn *bnx2i_conn = cmd->conn; in bnx2i_iscsi_send_generic_request()
1129 static void bnx2i_cpy_scsi_cdb(struct scsi_cmnd *sc, struct bnx2i_cmd *cmd) in bnx2i_cpy_scsi_cdb() argument
1138 cmd->req.lun[0] = be32_to_cpu(scsi_lun[0]); in bnx2i_cpy_scsi_cdb()
1139 cmd->req.lun[1] = be32_to_cpu(scsi_lun[1]); in bnx2i_cpy_scsi_cdb()
1141 lpcnt = cmd->scsi_cmd->cmd_len / sizeof(dword); in bnx2i_cpy_scsi_cdb()
1143 dstp = (u32 *) cmd->req.cdb; in bnx2i_cpy_scsi_cdb()
1191 struct bnx2i_cmd *cmd = task->dd_data; in bnx2i_mtask_xmit() local
1195 bnx2i_setup_cmd_wqe_template(cmd); in bnx2i_mtask_xmit()
1208 cmd->conn = conn->dd_data; in bnx2i_mtask_xmit()
1209 cmd->scsi_cmd = NULL; in bnx2i_mtask_xmit()
1227 struct bnx2i_cmd *cmd = task->dd_data; in bnx2i_task_xmit() local
1240 bnx2i_setup_cmd_wqe_template(cmd); in bnx2i_task_xmit()
1241 cmd->req.op_code = ISCSI_OP_SCSI_CMD; in bnx2i_task_xmit()
1242 cmd->conn = bnx2i_conn; in bnx2i_task_xmit()
1243 cmd->scsi_cmd = sc; in bnx2i_task_xmit()
1244 cmd->req.total_data_transfer_length = scsi_bufflen(sc); in bnx2i_task_xmit()
1245 cmd->req.cmd_sn = be32_to_cpu(hdr->cmdsn); in bnx2i_task_xmit()
1247 bnx2i_iscsi_map_sg_list(cmd); in bnx2i_task_xmit()
1248 bnx2i_cpy_scsi_cdb(sc, cmd); in bnx2i_task_xmit()
1250 cmd->req.op_attr = ISCSI_ATTR_SIMPLE; in bnx2i_task_xmit()
1252 cmd->req.op_attr |= ISCSI_CMD_REQUEST_WRITE; in bnx2i_task_xmit()
1253 cmd->req.itt = task->itt | in bnx2i_task_xmit()
1258 cmd->req.op_attr |= ISCSI_CMD_REQUEST_READ; in bnx2i_task_xmit()
1259 cmd->req.itt = task->itt | in bnx2i_task_xmit()
1263 cmd->req.num_bds = cmd->io_tbl.bd_valid; in bnx2i_task_xmit()
1264 if (!cmd->io_tbl.bd_valid) { in bnx2i_task_xmit()
1265 cmd->req.bd_list_addr_lo = (u32) hba->mp_bd_dma; in bnx2i_task_xmit()
1266 cmd->req.bd_list_addr_hi = (u32) ((u64) hba->mp_bd_dma >> 32); in bnx2i_task_xmit()
1267 cmd->req.num_bds = 1; in bnx2i_task_xmit()
1270 bnx2i_send_iscsi_scsicmd(bnx2i_conn, cmd); in bnx2i_task_xmit()