aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx/qla_mid.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_mid.c')
-rw-r--r--drivers/scsi/qla2xxx/qla_mid.c40
1 files changed, 5 insertions, 35 deletions
diff --git a/drivers/scsi/qla2xxx/qla_mid.c b/drivers/scsi/qla2xxx/qla_mid.c
index 54dc415d8b53..821ee74aadc6 100644
--- a/drivers/scsi/qla2xxx/qla_mid.c
+++ b/drivers/scsi/qla2xxx/qla_mid.c
@@ -104,7 +104,7 @@ qla24xx_find_vhost_by_name(scsi_qla_host_t *ha, uint8_t *port_name)
104 * 104 *
105 * Context: 105 * Context:
106 */ 106 */
107void 107static void
108qla2x00_mark_vp_devices_dead(scsi_qla_host_t *vha) 108qla2x00_mark_vp_devices_dead(scsi_qla_host_t *vha)
109{ 109{
110 fc_port_t *fcport; 110 fc_port_t *fcport;
@@ -179,37 +179,7 @@ enable_failed:
179 return 1; 179 return 1;
180} 180}
181 181
182/** 182static void
183 * qla24xx_modify_vport() - Modifies the virtual fabric port's configuration
184 * @ha: HA context
185 * @vp: pointer to buffer of virtual port parameters.
186 * @ret_code: return error code:
187 *
188 * Returns the virtual port id, or MAX_VSAN_ID, if couldn't create.
189 */
190uint32_t
191qla24xx_modify_vhba(scsi_qla_host_t *ha, vport_params_t *vp, uint32_t *vp_id)
192{
193 scsi_qla_host_t *vha;
194
195 vha = qla24xx_find_vhost_by_name(ha, vp->port_name);
196 if (!vha) {
197 *vp_id = MAX_NUM_VPORT_LOOP;
198 return VP_RET_CODE_WWPN;
199 }
200
201 if (qla24xx_enable_vp(vha)) {
202 scsi_host_put(vha->host);
203 qla2x00_mem_free(vha);
204 *vp_id = MAX_NUM_VPORT_LOOP;
205 return VP_RET_CODE_RESOURCES;
206 }
207
208 *vp_id = vha->vp_idx;
209 return VP_RET_CODE_OK;
210}
211
212void
213qla24xx_configure_vp(scsi_qla_host_t *vha) 183qla24xx_configure_vp(scsi_qla_host_t *vha)
214{ 184{
215 struct fc_vport *fc_vport; 185 struct fc_vport *fc_vport;
@@ -363,7 +333,7 @@ qla2x00_do_dpc_all_vps(scsi_qla_host_t *ha)
363int 333int
364qla24xx_vport_create_req_sanity_check(struct fc_vport *fc_vport) 334qla24xx_vport_create_req_sanity_check(struct fc_vport *fc_vport)
365{ 335{
366 scsi_qla_host_t *ha = (scsi_qla_host_t *) fc_vport->shost->hostdata; 336 scsi_qla_host_t *ha = shost_priv(fc_vport->shost);
367 scsi_qla_host_t *vha; 337 scsi_qla_host_t *vha;
368 uint8_t port_name[WWN_SIZE]; 338 uint8_t port_name[WWN_SIZE];
369 339
@@ -397,7 +367,7 @@ qla24xx_vport_create_req_sanity_check(struct fc_vport *fc_vport)
397scsi_qla_host_t * 367scsi_qla_host_t *
398qla24xx_create_vhost(struct fc_vport *fc_vport) 368qla24xx_create_vhost(struct fc_vport *fc_vport)
399{ 369{
400 scsi_qla_host_t *ha = (scsi_qla_host_t *) fc_vport->shost->hostdata; 370 scsi_qla_host_t *ha = shost_priv(fc_vport->shost);
401 scsi_qla_host_t *vha; 371 scsi_qla_host_t *vha;
402 struct Scsi_Host *host; 372 struct Scsi_Host *host;
403 373
@@ -409,7 +379,7 @@ qla24xx_create_vhost(struct fc_vport *fc_vport)
409 return(NULL); 379 return(NULL);
410 } 380 }
411 381
412 vha = (scsi_qla_host_t *)host->hostdata; 382 vha = shost_priv(host);
413 383
414 /* clone the parent hba */ 384 /* clone the parent hba */
415 memcpy(vha, ha, sizeof (scsi_qla_host_t)); 385 memcpy(vha, ha, sizeof (scsi_qla_host_t));