diff options
Diffstat (limited to 'drivers/scsi/be2iscsi/be_mgmt.c')
-rw-r--r-- | drivers/scsi/be2iscsi/be_mgmt.c | 177 |
1 files changed, 119 insertions, 58 deletions
diff --git a/drivers/scsi/be2iscsi/be_mgmt.c b/drivers/scsi/be2iscsi/be_mgmt.c index 12e644fc746e..e641922f20bc 100644 --- a/drivers/scsi/be2iscsi/be_mgmt.c +++ b/drivers/scsi/be2iscsi/be_mgmt.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /** | 1 | /** |
2 | * Copyright (C) 2005 - 2009 ServerEngines | 2 | * Copyright (C) 2005 - 2010 ServerEngines |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
5 | * This program is free software; you can redistribute it and/or | 5 | * This program is free software; you can redistribute it and/or |
@@ -35,7 +35,6 @@ unsigned char mgmt_get_fw_config(struct be_ctrl_info *ctrl, | |||
35 | 35 | ||
36 | be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON, | 36 | be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON, |
37 | OPCODE_COMMON_QUERY_FIRMWARE_CONFIG, sizeof(*req)); | 37 | OPCODE_COMMON_QUERY_FIRMWARE_CONFIG, sizeof(*req)); |
38 | |||
39 | status = be_mbox_notify(ctrl); | 38 | status = be_mbox_notify(ctrl); |
40 | if (!status) { | 39 | if (!status) { |
41 | struct be_fw_cfg *pfw_cfg; | 40 | struct be_fw_cfg *pfw_cfg; |
@@ -49,6 +48,14 @@ unsigned char mgmt_get_fw_config(struct be_ctrl_info *ctrl, | |||
49 | pfw_cfg->ulp[0].sq_base; | 48 | pfw_cfg->ulp[0].sq_base; |
50 | phba->fw_config.iscsi_cid_count = | 49 | phba->fw_config.iscsi_cid_count = |
51 | pfw_cfg->ulp[0].sq_count; | 50 | pfw_cfg->ulp[0].sq_count; |
51 | if (phba->fw_config.iscsi_cid_count > (BE2_MAX_SESSIONS / 2)) { | ||
52 | SE_DEBUG(DBG_LVL_8, | ||
53 | "FW reported MAX CXNS as %d \t" | ||
54 | "Max Supported = %d.\n", | ||
55 | phba->fw_config.iscsi_cid_count, | ||
56 | BE2_MAX_SESSIONS); | ||
57 | phba->fw_config.iscsi_cid_count = BE2_MAX_SESSIONS / 2; | ||
58 | } | ||
52 | } else { | 59 | } else { |
53 | shost_printk(KERN_WARNING, phba->shost, | 60 | shost_printk(KERN_WARNING, phba->shost, |
54 | "Failed in mgmt_get_fw_config \n"); | 61 | "Failed in mgmt_get_fw_config \n"); |
@@ -58,7 +65,8 @@ unsigned char mgmt_get_fw_config(struct be_ctrl_info *ctrl, | |||
58 | return status; | 65 | return status; |
59 | } | 66 | } |
60 | 67 | ||
61 | unsigned char mgmt_check_supported_fw(struct be_ctrl_info *ctrl) | 68 | unsigned char mgmt_check_supported_fw(struct be_ctrl_info *ctrl, |
69 | struct beiscsi_hba *phba) | ||
62 | { | 70 | { |
63 | struct be_dma_mem nonemb_cmd; | 71 | struct be_dma_mem nonemb_cmd; |
64 | struct be_mcc_wrb *wrb = wrb_from_mbox(&ctrl->mbox_mem); | 72 | struct be_mcc_wrb *wrb = wrb_from_mbox(&ctrl->mbox_mem); |
@@ -77,6 +85,7 @@ unsigned char mgmt_check_supported_fw(struct be_ctrl_info *ctrl) | |||
77 | } | 85 | } |
78 | nonemb_cmd.size = sizeof(struct be_mgmt_controller_attributes); | 86 | nonemb_cmd.size = sizeof(struct be_mgmt_controller_attributes); |
79 | req = nonemb_cmd.va; | 87 | req = nonemb_cmd.va; |
88 | memset(req, 0, sizeof(*req)); | ||
80 | spin_lock(&ctrl->mbox_lock); | 89 | spin_lock(&ctrl->mbox_lock); |
81 | memset(wrb, 0, sizeof(*wrb)); | 90 | memset(wrb, 0, sizeof(*wrb)); |
82 | be_wrb_hdr_prepare(wrb, sizeof(*req), false, 1); | 91 | be_wrb_hdr_prepare(wrb, sizeof(*req), false, 1); |
@@ -85,7 +94,6 @@ unsigned char mgmt_check_supported_fw(struct be_ctrl_info *ctrl) | |||
85 | sge->pa_hi = cpu_to_le32(upper_32_bits(nonemb_cmd.dma)); | 94 | sge->pa_hi = cpu_to_le32(upper_32_bits(nonemb_cmd.dma)); |
86 | sge->pa_lo = cpu_to_le32(nonemb_cmd.dma & 0xFFFFFFFF); | 95 | sge->pa_lo = cpu_to_le32(nonemb_cmd.dma & 0xFFFFFFFF); |
87 | sge->len = cpu_to_le32(nonemb_cmd.size); | 96 | sge->len = cpu_to_le32(nonemb_cmd.size); |
88 | |||
89 | status = be_mbox_notify(ctrl); | 97 | status = be_mbox_notify(ctrl); |
90 | if (!status) { | 98 | if (!status) { |
91 | struct be_mgmt_controller_attributes_resp *resp = nonemb_cmd.va; | 99 | struct be_mgmt_controller_attributes_resp *resp = nonemb_cmd.va; |
@@ -95,21 +103,25 @@ unsigned char mgmt_check_supported_fw(struct be_ctrl_info *ctrl) | |||
95 | resp->params.hba_attribs.firmware_version_string); | 103 | resp->params.hba_attribs.firmware_version_string); |
96 | SE_DEBUG(DBG_LVL_8, | 104 | SE_DEBUG(DBG_LVL_8, |
97 | "Developer Build, not performing version check...\n"); | 105 | "Developer Build, not performing version check...\n"); |
98 | 106 | phba->fw_config.iscsi_features = | |
107 | resp->params.hba_attribs.iscsi_features; | ||
108 | SE_DEBUG(DBG_LVL_8, " phba->fw_config.iscsi_features = %d\n", | ||
109 | phba->fw_config.iscsi_features); | ||
99 | } else | 110 | } else |
100 | SE_DEBUG(DBG_LVL_1, " Failed in mgmt_check_supported_fw\n"); | 111 | SE_DEBUG(DBG_LVL_1, " Failed in mgmt_check_supported_fw\n"); |
112 | spin_unlock(&ctrl->mbox_lock); | ||
101 | if (nonemb_cmd.va) | 113 | if (nonemb_cmd.va) |
102 | pci_free_consistent(ctrl->pdev, nonemb_cmd.size, | 114 | pci_free_consistent(ctrl->pdev, nonemb_cmd.size, |
103 | nonemb_cmd.va, nonemb_cmd.dma); | 115 | nonemb_cmd.va, nonemb_cmd.dma); |
104 | 116 | ||
105 | spin_unlock(&ctrl->mbox_lock); | ||
106 | return status; | 117 | return status; |
107 | } | 118 | } |
108 | 119 | ||
120 | |||
109 | unsigned char mgmt_epfw_cleanup(struct beiscsi_hba *phba, unsigned short chute) | 121 | unsigned char mgmt_epfw_cleanup(struct beiscsi_hba *phba, unsigned short chute) |
110 | { | 122 | { |
111 | struct be_ctrl_info *ctrl = &phba->ctrl; | 123 | struct be_ctrl_info *ctrl = &phba->ctrl; |
112 | struct be_mcc_wrb *wrb = wrb_from_mbox(&ctrl->mbox_mem); | 124 | struct be_mcc_wrb *wrb = wrb_from_mccq(phba); |
113 | struct iscsi_cleanup_req *req = embedded_payload(wrb); | 125 | struct iscsi_cleanup_req *req = embedded_payload(wrb); |
114 | int status = 0; | 126 | int status = 0; |
115 | 127 | ||
@@ -124,7 +136,7 @@ unsigned char mgmt_epfw_cleanup(struct beiscsi_hba *phba, unsigned short chute) | |||
124 | req->hdr_ring_id = 0; | 136 | req->hdr_ring_id = 0; |
125 | req->data_ring_id = 0; | 137 | req->data_ring_id = 0; |
126 | 138 | ||
127 | status = be_mbox_notify(ctrl); | 139 | status = be_mcc_notify_wait(phba); |
128 | if (status) | 140 | if (status) |
129 | shost_printk(KERN_WARNING, phba->shost, | 141 | shost_printk(KERN_WARNING, phba->shost, |
130 | " mgmt_epfw_cleanup , FAILED\n"); | 142 | " mgmt_epfw_cleanup , FAILED\n"); |
@@ -133,14 +145,22 @@ unsigned char mgmt_epfw_cleanup(struct beiscsi_hba *phba, unsigned short chute) | |||
133 | } | 145 | } |
134 | 146 | ||
135 | unsigned char mgmt_invalidate_icds(struct beiscsi_hba *phba, | 147 | unsigned char mgmt_invalidate_icds(struct beiscsi_hba *phba, |
136 | unsigned int icd, unsigned int cid) | 148 | struct invalidate_command_table *inv_tbl, |
149 | unsigned int num_invalidate, unsigned int cid) | ||
137 | { | 150 | { |
138 | struct be_dma_mem nonemb_cmd; | 151 | struct be_dma_mem nonemb_cmd; |
139 | struct be_ctrl_info *ctrl = &phba->ctrl; | 152 | struct be_ctrl_info *ctrl = &phba->ctrl; |
140 | struct be_mcc_wrb *wrb = wrb_from_mbox(&ctrl->mbox_mem); | 153 | struct be_mcc_wrb *wrb; |
141 | struct be_sge *sge = nonembedded_sgl(wrb); | 154 | struct be_sge *sge; |
142 | struct invalidate_commands_params_in *req; | 155 | struct invalidate_commands_params_in *req; |
143 | int status = 0; | 156 | unsigned int i, tag = 0; |
157 | |||
158 | spin_lock(&ctrl->mbox_lock); | ||
159 | tag = alloc_mcc_tag(phba); | ||
160 | if (!tag) { | ||
161 | spin_unlock(&ctrl->mbox_lock); | ||
162 | return tag; | ||
163 | } | ||
144 | 164 | ||
145 | nonemb_cmd.va = pci_alloc_consistent(ctrl->pdev, | 165 | nonemb_cmd.va = pci_alloc_consistent(ctrl->pdev, |
146 | sizeof(struct invalidate_commands_params_in), | 166 | sizeof(struct invalidate_commands_params_in), |
@@ -149,12 +169,15 @@ unsigned char mgmt_invalidate_icds(struct beiscsi_hba *phba, | |||
149 | SE_DEBUG(DBG_LVL_1, | 169 | SE_DEBUG(DBG_LVL_1, |
150 | "Failed to allocate memory for" | 170 | "Failed to allocate memory for" |
151 | "mgmt_invalidate_icds \n"); | 171 | "mgmt_invalidate_icds \n"); |
172 | spin_unlock(&ctrl->mbox_lock); | ||
152 | return -1; | 173 | return -1; |
153 | } | 174 | } |
154 | nonemb_cmd.size = sizeof(struct invalidate_commands_params_in); | 175 | nonemb_cmd.size = sizeof(struct invalidate_commands_params_in); |
155 | req = nonemb_cmd.va; | 176 | req = nonemb_cmd.va; |
156 | spin_lock(&ctrl->mbox_lock); | 177 | memset(req, 0, sizeof(*req)); |
157 | memset(wrb, 0, sizeof(*wrb)); | 178 | wrb = wrb_from_mccq(phba); |
179 | sge = nonembedded_sgl(wrb); | ||
180 | wrb->tag0 |= tag; | ||
158 | 181 | ||
159 | be_wrb_hdr_prepare(wrb, sizeof(*req), false, 1); | 182 | be_wrb_hdr_prepare(wrb, sizeof(*req), false, 1); |
160 | be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_ISCSI, | 183 | be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_ISCSI, |
@@ -162,21 +185,22 @@ unsigned char mgmt_invalidate_icds(struct beiscsi_hba *phba, | |||
162 | sizeof(*req)); | 185 | sizeof(*req)); |
163 | req->ref_handle = 0; | 186 | req->ref_handle = 0; |
164 | req->cleanup_type = CMD_ISCSI_COMMAND_INVALIDATE; | 187 | req->cleanup_type = CMD_ISCSI_COMMAND_INVALIDATE; |
165 | req->icd_count = 0; | 188 | for (i = 0; i < num_invalidate; i++) { |
166 | req->table[req->icd_count].icd = icd; | 189 | req->table[i].icd = inv_tbl->icd; |
167 | req->table[req->icd_count].cid = cid; | 190 | req->table[i].cid = inv_tbl->cid; |
191 | req->icd_count++; | ||
192 | inv_tbl++; | ||
193 | } | ||
168 | sge->pa_hi = cpu_to_le32(upper_32_bits(nonemb_cmd.dma)); | 194 | sge->pa_hi = cpu_to_le32(upper_32_bits(nonemb_cmd.dma)); |
169 | sge->pa_lo = cpu_to_le32(nonemb_cmd.dma & 0xFFFFFFFF); | 195 | sge->pa_lo = cpu_to_le32(nonemb_cmd.dma & 0xFFFFFFFF); |
170 | sge->len = cpu_to_le32(nonemb_cmd.size); | 196 | sge->len = cpu_to_le32(nonemb_cmd.size); |
171 | 197 | ||
172 | status = be_mbox_notify(ctrl); | 198 | be_mcc_notify(phba); |
173 | if (status) | ||
174 | SE_DEBUG(DBG_LVL_1, "ICDS Invalidation Failed\n"); | ||
175 | spin_unlock(&ctrl->mbox_lock); | 199 | spin_unlock(&ctrl->mbox_lock); |
176 | if (nonemb_cmd.va) | 200 | if (nonemb_cmd.va) |
177 | pci_free_consistent(ctrl->pdev, nonemb_cmd.size, | 201 | pci_free_consistent(ctrl->pdev, nonemb_cmd.size, |
178 | nonemb_cmd.va, nonemb_cmd.dma); | 202 | nonemb_cmd.va, nonemb_cmd.dma); |
179 | return status; | 203 | return tag; |
180 | } | 204 | } |
181 | 205 | ||
182 | unsigned char mgmt_invalidate_connection(struct beiscsi_hba *phba, | 206 | unsigned char mgmt_invalidate_connection(struct beiscsi_hba *phba, |
@@ -186,13 +210,19 @@ unsigned char mgmt_invalidate_connection(struct beiscsi_hba *phba, | |||
186 | unsigned short savecfg_flag) | 210 | unsigned short savecfg_flag) |
187 | { | 211 | { |
188 | struct be_ctrl_info *ctrl = &phba->ctrl; | 212 | struct be_ctrl_info *ctrl = &phba->ctrl; |
189 | struct be_mcc_wrb *wrb = wrb_from_mbox(&ctrl->mbox_mem); | 213 | struct be_mcc_wrb *wrb; |
190 | struct iscsi_invalidate_connection_params_in *req = | 214 | struct iscsi_invalidate_connection_params_in *req; |
191 | embedded_payload(wrb); | 215 | unsigned int tag = 0; |
192 | int status = 0; | ||
193 | 216 | ||
194 | spin_lock(&ctrl->mbox_lock); | 217 | spin_lock(&ctrl->mbox_lock); |
195 | memset(wrb, 0, sizeof(*wrb)); | 218 | tag = alloc_mcc_tag(phba); |
219 | if (!tag) { | ||
220 | spin_unlock(&ctrl->mbox_lock); | ||
221 | return tag; | ||
222 | } | ||
223 | wrb = wrb_from_mccq(phba); | ||
224 | wrb->tag0 |= tag; | ||
225 | req = embedded_payload(wrb); | ||
196 | 226 | ||
197 | be_wrb_hdr_prepare(wrb, sizeof(*req), true, 0); | 227 | be_wrb_hdr_prepare(wrb, sizeof(*req), true, 0); |
198 | be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_ISCSI_INI, | 228 | be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_ISCSI_INI, |
@@ -205,35 +235,37 @@ unsigned char mgmt_invalidate_connection(struct beiscsi_hba *phba, | |||
205 | else | 235 | else |
206 | req->cleanup_type = CMD_ISCSI_CONNECTION_INVALIDATE; | 236 | req->cleanup_type = CMD_ISCSI_CONNECTION_INVALIDATE; |
207 | req->save_cfg = savecfg_flag; | 237 | req->save_cfg = savecfg_flag; |
208 | status = be_mbox_notify(ctrl); | 238 | be_mcc_notify(phba); |
209 | if (status) | ||
210 | SE_DEBUG(DBG_LVL_1, "Invalidation Failed\n"); | ||
211 | |||
212 | spin_unlock(&ctrl->mbox_lock); | 239 | spin_unlock(&ctrl->mbox_lock); |
213 | return status; | 240 | return tag; |
214 | } | 241 | } |
215 | 242 | ||
216 | unsigned char mgmt_upload_connection(struct beiscsi_hba *phba, | 243 | unsigned char mgmt_upload_connection(struct beiscsi_hba *phba, |
217 | unsigned short cid, unsigned int upload_flag) | 244 | unsigned short cid, unsigned int upload_flag) |
218 | { | 245 | { |
219 | struct be_ctrl_info *ctrl = &phba->ctrl; | 246 | struct be_ctrl_info *ctrl = &phba->ctrl; |
220 | struct be_mcc_wrb *wrb = wrb_from_mbox(&ctrl->mbox_mem); | 247 | struct be_mcc_wrb *wrb; |
221 | struct tcp_upload_params_in *req = embedded_payload(wrb); | 248 | struct tcp_upload_params_in *req; |
222 | int status = 0; | 249 | unsigned int tag = 0; |
223 | 250 | ||
224 | spin_lock(&ctrl->mbox_lock); | 251 | spin_lock(&ctrl->mbox_lock); |
225 | memset(wrb, 0, sizeof(*wrb)); | 252 | tag = alloc_mcc_tag(phba); |
253 | if (!tag) { | ||
254 | spin_unlock(&ctrl->mbox_lock); | ||
255 | return tag; | ||
256 | } | ||
257 | wrb = wrb_from_mccq(phba); | ||
258 | req = embedded_payload(wrb); | ||
259 | wrb->tag0 |= tag; | ||
226 | 260 | ||
227 | be_wrb_hdr_prepare(wrb, sizeof(*req), true, 0); | 261 | be_wrb_hdr_prepare(wrb, sizeof(*req), true, 0); |
228 | be_cmd_hdr_prepare(&req->hdr, CMD_COMMON_TCP_UPLOAD, | 262 | be_cmd_hdr_prepare(&req->hdr, CMD_COMMON_TCP_UPLOAD, |
229 | OPCODE_COMMON_TCP_UPLOAD, sizeof(*req)); | 263 | OPCODE_COMMON_TCP_UPLOAD, sizeof(*req)); |
230 | req->id = (unsigned short)cid; | 264 | req->id = (unsigned short)cid; |
231 | req->upload_type = (unsigned char)upload_flag; | 265 | req->upload_type = (unsigned char)upload_flag; |
232 | status = be_mbox_notify(ctrl); | 266 | be_mcc_notify(phba); |
233 | if (status) | ||
234 | SE_DEBUG(DBG_LVL_1, "mgmt_upload_connection Failed\n"); | ||
235 | spin_unlock(&ctrl->mbox_lock); | 267 | spin_unlock(&ctrl->mbox_lock); |
236 | return status; | 268 | return tag; |
237 | } | 269 | } |
238 | 270 | ||
239 | int mgmt_open_connection(struct beiscsi_hba *phba, | 271 | int mgmt_open_connection(struct beiscsi_hba *phba, |
@@ -245,13 +277,14 @@ int mgmt_open_connection(struct beiscsi_hba *phba, | |||
245 | struct sockaddr_in *daddr_in = (struct sockaddr_in *)dst_addr; | 277 | struct sockaddr_in *daddr_in = (struct sockaddr_in *)dst_addr; |
246 | struct sockaddr_in6 *daddr_in6 = (struct sockaddr_in6 *)dst_addr; | 278 | struct sockaddr_in6 *daddr_in6 = (struct sockaddr_in6 *)dst_addr; |
247 | struct be_ctrl_info *ctrl = &phba->ctrl; | 279 | struct be_ctrl_info *ctrl = &phba->ctrl; |
248 | struct be_mcc_wrb *wrb = wrb_from_mbox(&ctrl->mbox_mem); | 280 | struct be_mcc_wrb *wrb; |
249 | struct tcp_connect_and_offload_in *req = embedded_payload(wrb); | 281 | struct tcp_connect_and_offload_in *req; |
250 | unsigned short def_hdr_id; | 282 | unsigned short def_hdr_id; |
251 | unsigned short def_data_id; | 283 | unsigned short def_data_id; |
252 | struct phys_addr template_address = { 0, 0 }; | 284 | struct phys_addr template_address = { 0, 0 }; |
253 | struct phys_addr *ptemplate_address; | 285 | struct phys_addr *ptemplate_address; |
254 | int status = 0; | 286 | unsigned int tag = 0; |
287 | unsigned int i; | ||
255 | unsigned short cid = beiscsi_ep->ep_cid; | 288 | unsigned short cid = beiscsi_ep->ep_cid; |
256 | 289 | ||
257 | phwi_ctrlr = phba->phwi_ctrlr; | 290 | phwi_ctrlr = phba->phwi_ctrlr; |
@@ -262,7 +295,14 @@ int mgmt_open_connection(struct beiscsi_hba *phba, | |||
262 | ptemplate_address = &template_address; | 295 | ptemplate_address = &template_address; |
263 | ISCSI_GET_PDU_TEMPLATE_ADDRESS(phba, ptemplate_address); | 296 | ISCSI_GET_PDU_TEMPLATE_ADDRESS(phba, ptemplate_address); |
264 | spin_lock(&ctrl->mbox_lock); | 297 | spin_lock(&ctrl->mbox_lock); |
265 | memset(wrb, 0, sizeof(*wrb)); | 298 | tag = alloc_mcc_tag(phba); |
299 | if (!tag) { | ||
300 | spin_unlock(&ctrl->mbox_lock); | ||
301 | return tag; | ||
302 | } | ||
303 | wrb = wrb_from_mccq(phba); | ||
304 | req = embedded_payload(wrb); | ||
305 | wrb->tag0 |= tag; | ||
266 | 306 | ||
267 | be_wrb_hdr_prepare(wrb, sizeof(*req), true, 0); | 307 | be_wrb_hdr_prepare(wrb, sizeof(*req), true, 0); |
268 | be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_ISCSI, | 308 | be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_ISCSI, |
@@ -296,26 +336,47 @@ int mgmt_open_connection(struct beiscsi_hba *phba, | |||
296 | 336 | ||
297 | } | 337 | } |
298 | req->cid = cid; | 338 | req->cid = cid; |
299 | req->cq_id = phwi_context->be_cq.id; | 339 | i = phba->nxt_cqid++; |
340 | if (phba->nxt_cqid == phba->num_cpus) | ||
341 | phba->nxt_cqid = 0; | ||
342 | req->cq_id = phwi_context->be_cq[i].id; | ||
343 | SE_DEBUG(DBG_LVL_8, "i=%d cq_id=%d \n", i, req->cq_id); | ||
300 | req->defq_id = def_hdr_id; | 344 | req->defq_id = def_hdr_id; |
301 | req->hdr_ring_id = def_hdr_id; | 345 | req->hdr_ring_id = def_hdr_id; |
302 | req->data_ring_id = def_data_id; | 346 | req->data_ring_id = def_data_id; |
303 | req->do_offload = 1; | 347 | req->do_offload = 1; |
304 | req->dataout_template_pa.lo = ptemplate_address->lo; | 348 | req->dataout_template_pa.lo = ptemplate_address->lo; |
305 | req->dataout_template_pa.hi = ptemplate_address->hi; | 349 | req->dataout_template_pa.hi = ptemplate_address->hi; |
306 | status = be_mbox_notify(ctrl); | 350 | be_mcc_notify(phba); |
307 | if (!status) { | ||
308 | struct iscsi_endpoint *ep; | ||
309 | struct tcp_connect_and_offload_out *ptcpcnct_out = | ||
310 | embedded_payload(wrb); | ||
311 | |||
312 | ep = phba->ep_array[ptcpcnct_out->cid]; | ||
313 | beiscsi_ep = ep->dd_data; | ||
314 | beiscsi_ep->fw_handle = 0; | ||
315 | beiscsi_ep->cid_vld = 1; | ||
316 | SE_DEBUG(DBG_LVL_8, "mgmt_open_connection Success\n"); | ||
317 | } else | ||
318 | SE_DEBUG(DBG_LVL_1, "mgmt_open_connection Failed\n"); | ||
319 | spin_unlock(&ctrl->mbox_lock); | 351 | spin_unlock(&ctrl->mbox_lock); |
320 | return status; | 352 | return tag; |
321 | } | 353 | } |
354 | |||
355 | unsigned int be_cmd_get_mac_addr(struct beiscsi_hba *phba) | ||
356 | { | ||
357 | struct be_ctrl_info *ctrl = &phba->ctrl; | ||
358 | struct be_mcc_wrb *wrb; | ||
359 | struct be_cmd_req_get_mac_addr *req; | ||
360 | unsigned int tag = 0; | ||
361 | |||
362 | SE_DEBUG(DBG_LVL_8, "In be_cmd_get_mac_addr\n"); | ||
363 | spin_lock(&ctrl->mbox_lock); | ||
364 | tag = alloc_mcc_tag(phba); | ||
365 | if (!tag) { | ||
366 | spin_unlock(&ctrl->mbox_lock); | ||
367 | return tag; | ||
368 | } | ||
369 | |||
370 | wrb = wrb_from_mccq(phba); | ||
371 | req = embedded_payload(wrb); | ||
372 | wrb->tag0 |= tag; | ||
373 | be_wrb_hdr_prepare(wrb, sizeof(*req), true, 0); | ||
374 | be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_ISCSI, | ||
375 | OPCODE_COMMON_ISCSI_NTWK_GET_NIC_CONFIG, | ||
376 | sizeof(*req)); | ||
377 | |||
378 | be_mcc_notify(phba); | ||
379 | spin_unlock(&ctrl->mbox_lock); | ||
380 | return tag; | ||
381 | } | ||
382 | |||