diff options
Diffstat (limited to 'drivers/scsi/be2iscsi/be_main.c')
-rw-r--r-- | drivers/scsi/be2iscsi/be_main.c | 69 |
1 files changed, 8 insertions, 61 deletions
diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c index 6aef05f78449..9e669cec3424 100644 --- a/drivers/scsi/be2iscsi/be_main.c +++ b/drivers/scsi/be2iscsi/be_main.c | |||
@@ -4087,8 +4087,6 @@ beiscsi_offload_connection(struct beiscsi_conn *beiscsi_conn, | |||
4087 | struct beiscsi_offload_params *params) | 4087 | struct beiscsi_offload_params *params) |
4088 | { | 4088 | { |
4089 | struct wrb_handle *pwrb_handle; | 4089 | struct wrb_handle *pwrb_handle; |
4090 | struct iscsi_target_context_update_wrb *pwrb = NULL; | ||
4091 | struct be_mem_descriptor *mem_descr; | ||
4092 | struct beiscsi_hba *phba = beiscsi_conn->phba; | 4090 | struct beiscsi_hba *phba = beiscsi_conn->phba; |
4093 | struct iscsi_task *task = beiscsi_conn->task; | 4091 | struct iscsi_task *task = beiscsi_conn->task; |
4094 | struct iscsi_session *session = task->conn->session; | 4092 | struct iscsi_session *session = task->conn->session; |
@@ -4105,67 +4103,16 @@ beiscsi_offload_connection(struct beiscsi_conn *beiscsi_conn, | |||
4105 | 4103 | ||
4106 | pwrb_handle = alloc_wrb_handle(phba, (beiscsi_conn->beiscsi_conn_cid - | 4104 | pwrb_handle = alloc_wrb_handle(phba, (beiscsi_conn->beiscsi_conn_cid - |
4107 | phba->fw_config.iscsi_cid_start)); | 4105 | phba->fw_config.iscsi_cid_start)); |
4108 | pwrb = (struct iscsi_target_context_update_wrb *)pwrb_handle->pwrb; | ||
4109 | memset(pwrb, 0, sizeof(*pwrb)); | ||
4110 | AMAP_SET_BITS(struct amap_iscsi_target_context_update_wrb, | ||
4111 | max_burst_length, pwrb, params->dw[offsetof | ||
4112 | (struct amap_beiscsi_offload_params, | ||
4113 | max_burst_length) / 32]); | ||
4114 | AMAP_SET_BITS(struct amap_iscsi_target_context_update_wrb, | ||
4115 | max_send_data_segment_length, pwrb, | ||
4116 | params->dw[offsetof(struct amap_beiscsi_offload_params, | ||
4117 | max_send_data_segment_length) / 32]); | ||
4118 | AMAP_SET_BITS(struct amap_iscsi_target_context_update_wrb, | ||
4119 | first_burst_length, | ||
4120 | pwrb, | ||
4121 | params->dw[offsetof(struct amap_beiscsi_offload_params, | ||
4122 | first_burst_length) / 32]); | ||
4123 | |||
4124 | AMAP_SET_BITS(struct amap_iscsi_target_context_update_wrb, erl, pwrb, | ||
4125 | (params->dw[offsetof(struct amap_beiscsi_offload_params, | ||
4126 | erl) / 32] & OFFLD_PARAMS_ERL)); | ||
4127 | AMAP_SET_BITS(struct amap_iscsi_target_context_update_wrb, dde, pwrb, | ||
4128 | (params->dw[offsetof(struct amap_beiscsi_offload_params, | ||
4129 | dde) / 32] & OFFLD_PARAMS_DDE) >> 2); | ||
4130 | AMAP_SET_BITS(struct amap_iscsi_target_context_update_wrb, hde, pwrb, | ||
4131 | (params->dw[offsetof(struct amap_beiscsi_offload_params, | ||
4132 | hde) / 32] & OFFLD_PARAMS_HDE) >> 3); | ||
4133 | AMAP_SET_BITS(struct amap_iscsi_target_context_update_wrb, ir2t, pwrb, | ||
4134 | (params->dw[offsetof(struct amap_beiscsi_offload_params, | ||
4135 | ir2t) / 32] & OFFLD_PARAMS_IR2T) >> 4); | ||
4136 | AMAP_SET_BITS(struct amap_iscsi_target_context_update_wrb, imd, pwrb, | ||
4137 | (params->dw[offsetof(struct amap_beiscsi_offload_params, | ||
4138 | imd) / 32] & OFFLD_PARAMS_IMD) >> 5); | ||
4139 | AMAP_SET_BITS(struct amap_iscsi_target_context_update_wrb, stat_sn, | ||
4140 | pwrb, | ||
4141 | (params->dw[offsetof(struct amap_beiscsi_offload_params, | ||
4142 | exp_statsn) / 32] + 1)); | ||
4143 | AMAP_SET_BITS(struct amap_iscsi_target_context_update_wrb, type, pwrb, | ||
4144 | 0x7); | ||
4145 | AMAP_SET_BITS(struct amap_iscsi_target_context_update_wrb, wrb_idx, | ||
4146 | pwrb, pwrb_handle->wrb_index); | ||
4147 | AMAP_SET_BITS(struct amap_iscsi_target_context_update_wrb, ptr2nextwrb, | ||
4148 | pwrb, pwrb_handle->nxt_wrb_index); | ||
4149 | AMAP_SET_BITS(struct amap_iscsi_target_context_update_wrb, | ||
4150 | session_state, pwrb, 0); | ||
4151 | AMAP_SET_BITS(struct amap_iscsi_target_context_update_wrb, compltonack, | ||
4152 | pwrb, 1); | ||
4153 | AMAP_SET_BITS(struct amap_iscsi_target_context_update_wrb, notpredblq, | ||
4154 | pwrb, 0); | ||
4155 | AMAP_SET_BITS(struct amap_iscsi_target_context_update_wrb, mode, pwrb, | ||
4156 | 0); | ||
4157 | |||
4158 | mem_descr = phba->init_mem; | ||
4159 | mem_descr += ISCSI_MEM_GLOBAL_HEADER; | ||
4160 | 4106 | ||
4161 | AMAP_SET_BITS(struct amap_iscsi_target_context_update_wrb, | 4107 | /* Check for the adapter family */ |
4162 | pad_buffer_addr_hi, pwrb, | 4108 | if (chip_skh_r(phba->pcidev)) |
4163 | mem_descr->mem_array[0].bus_address.u.a32.address_hi); | 4109 | beiscsi_offload_cxn_v2(params, pwrb_handle); |
4164 | AMAP_SET_BITS(struct amap_iscsi_target_context_update_wrb, | 4110 | else |
4165 | pad_buffer_addr_lo, pwrb, | 4111 | beiscsi_offload_cxn_v0(params, pwrb_handle, |
4166 | mem_descr->mem_array[0].bus_address.u.a32.address_lo); | 4112 | phba->init_mem); |
4167 | 4113 | ||
4168 | be_dws_le_to_cpu(pwrb, sizeof(struct iscsi_target_context_update_wrb)); | 4114 | be_dws_le_to_cpu(pwrb_handle->pwrb, |
4115 | sizeof(struct iscsi_target_context_update_wrb)); | ||
4169 | 4116 | ||
4170 | doorbell |= beiscsi_conn->beiscsi_conn_cid & DB_WRB_POST_CID_MASK; | 4117 | doorbell |= beiscsi_conn->beiscsi_conn_cid & DB_WRB_POST_CID_MASK; |
4171 | doorbell |= (pwrb_handle->wrb_index & DB_DEF_PDU_WRB_INDEX_MASK) | 4118 | doorbell |= (pwrb_handle->wrb_index & DB_DEF_PDU_WRB_INDEX_MASK) |