/* Locking: must be called with both the N_Port and VN_Port lp_mutex held  */
static void __fc_vport_setlink(struct fc_lport *n_port, struct fc_lport *vn_port)
/* Locking: must be called with both the N_Port and VN_Port lp_mutex held  */
static void __fc_vport_setlink(struct fc_lport *n_port, struct fc_lport *vn_port)
{
	struct fc_vport *vport = vn_port->vport;
	if (vn_port->state == LPORT_ST_DISABLED)
		return;
	if (n_port->state == LPORT_ST_READY) {
		if (n_port->npiv_enabled) {
			fc_vport_set_state(vport, FC_VPORT_INITIALIZING);
			__fc_linkup(vn_port);
		} else {
			fc_vport_set_state(vport, FC_VPORT_NO_FABRIC_SUPP);
			__fc_linkdown(vn_port);
		}
	} else {
		fc_vport_set_state(vport, FC_VPORT_LINKDOWN);
		__fc_linkdown(vn_port);
	}
}