Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0152a7e9 authored by Jitendra Bhivare's avatar Jitendra Bhivare Committed by Martin K. Petersen
Browse files

scsi: be2iscsi: Fix release of DHCP IP in static mode



If BOOTPROTO is changed to static, the DHCP IP address should be released.
All cases are being handled mgmt_set_ip and mgmt_static_ip_modify.

Rearrange IFACE APIs to:
beiscsi_if_clr_ip
beiscsi_if_set_ip
beiscsi_if_en_static
beiscsi_if_en_dhcp

This simplifies release of DHCP IP when BOOTPROTO is set to static.

Signed-off-by: default avatarJitendra Bhivare <jitendra.bhivare@broadcom.com>
Reviewed-by: default avatarHannes Reinecke <hare@suse.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 37f21648
Loading
Loading
Loading
Loading
+46 −79
Original line number Original line Diff line number Diff line
@@ -302,58 +302,6 @@ void beiscsi_destroy_def_ifaces(struct beiscsi_hba *phba)
	}
	}
}
}


static int
beiscsi_set_static_ip(struct Scsi_Host *shost,
		struct iscsi_iface_param_info *iface_param,
		void *data, uint32_t dt_len)
{
	struct beiscsi_hba *phba = iscsi_host_priv(shost);
	struct iscsi_iface_param_info *iface_ip = NULL;
	struct iscsi_iface_param_info *iface_subnet = NULL;
	struct nlattr *nla;
	int ret;


	switch (iface_param->param) {
	case ISCSI_NET_PARAM_IPV4_BOOTPROTO:
		nla = nla_find(data, dt_len, ISCSI_NET_PARAM_IPV4_ADDR);
		if (nla)
			iface_ip = nla_data(nla);

		nla = nla_find(data, dt_len, ISCSI_NET_PARAM_IPV4_SUBNET);
		if (nla)
			iface_subnet = nla_data(nla);
		break;
	case ISCSI_NET_PARAM_IPV4_ADDR:
		iface_ip = iface_param;
		nla = nla_find(data, dt_len, ISCSI_NET_PARAM_IPV4_SUBNET);
		if (nla)
			iface_subnet = nla_data(nla);
		break;
	case ISCSI_NET_PARAM_IPV4_SUBNET:
		iface_subnet = iface_param;
		nla = nla_find(data, dt_len, ISCSI_NET_PARAM_IPV4_ADDR);
		if (nla)
			iface_ip = nla_data(nla);
		break;
	default:
		beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG,
			    "BS_%d : Unsupported param %d\n",
			    iface_param->param);
	}

	if (!iface_ip || !iface_subnet) {
		beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG,
			    "BS_%d : IP and Subnet Mask required\n");
		return -EINVAL;
	}

	ret = mgmt_set_ip(phba, iface_ip, iface_subnet,
			ISCSI_BOOTPROTO_STATIC);

	return ret;
}

/**
/**
 * beiscsi_set_vlan_tag()- Set the VLAN TAG
 * beiscsi_set_vlan_tag()- Set the VLAN TAG
 * @shost: Scsi Host for the driver instance
 * @shost: Scsi Host for the driver instance
@@ -401,17 +349,19 @@ beiscsi_set_vlan_tag(struct Scsi_Host *shost,




static int
static int
beiscsi_set_ipv4(struct Scsi_Host *shost,
beiscsi_iface_config_ipv4(struct Scsi_Host *shost,
		struct iscsi_iface_param_info *iface_param,
			  struct iscsi_iface_param_info *info,
			  void *data, uint32_t dt_len)
			  void *data, uint32_t dt_len)
{
{
	struct beiscsi_hba *phba = iscsi_host_priv(shost);
	struct beiscsi_hba *phba = iscsi_host_priv(shost);
	u8 *ip = NULL, *subnet = NULL, *gw;
	struct nlattr *nla;
	int ret = 0;
	int ret = 0;


	/* Check the param */
	/* Check the param */
	switch (iface_param->param) {
	switch (info->param) {
	case ISCSI_NET_PARAM_IFACE_ENABLE:
	case ISCSI_NET_PARAM_IFACE_ENABLE:
		if (iface_param->value[0] == ISCSI_IFACE_ENABLE)
		if (info->value[0] == ISCSI_IFACE_ENABLE)
			ret = beiscsi_create_ipv4_iface(phba);
			ret = beiscsi_create_ipv4_iface(phba);
		else {
		else {
			iscsi_destroy_iface(phba->ipv4_iface);
			iscsi_destroy_iface(phba->ipv4_iface);
@@ -419,40 +369,57 @@ beiscsi_set_ipv4(struct Scsi_Host *shost,
		}
		}
		break;
		break;
	case ISCSI_NET_PARAM_IPV4_GW:
	case ISCSI_NET_PARAM_IPV4_GW:
		ret = beiscsi_if_set_gw(phba, BE2_IPV4, iface_param->value);
		gw = info->value;
		ret = beiscsi_if_set_gw(phba, BE2_IPV4, gw);
		break;
		break;
	case ISCSI_NET_PARAM_IPV4_BOOTPROTO:
	case ISCSI_NET_PARAM_IPV4_BOOTPROTO:
		if (iface_param->value[0] == ISCSI_BOOTPROTO_DHCP)
		if (info->value[0] == ISCSI_BOOTPROTO_DHCP)
			ret = mgmt_set_ip(phba, iface_param,
			ret = beiscsi_if_en_dhcp(phba, BE2_IPV4);
					NULL, ISCSI_BOOTPROTO_DHCP);
		else if (info->value[0] == ISCSI_BOOTPROTO_STATIC)
		else if (iface_param->value[0] == ISCSI_BOOTPROTO_STATIC)
			/* release DHCP IP address */
			ret = beiscsi_set_static_ip(shost, iface_param,
			ret = beiscsi_if_en_static(phba, BE2_IPV4, NULL, NULL);
						    data, dt_len);
		else
		else
			beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG,
			beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG,
				    "BS_%d : Invalid BOOTPROTO: %d\n",
				    "BS_%d : Invalid BOOTPROTO: %d\n",
				    iface_param->value[0]);
				    info->value[0]);
		break;
		break;
	case ISCSI_NET_PARAM_IPV4_SUBNET:
	case ISCSI_NET_PARAM_IPV4_ADDR:
	case ISCSI_NET_PARAM_IPV4_ADDR:
		ret = beiscsi_set_static_ip(shost, iface_param,
		ip = info->value;
					    data, dt_len);
		nla = nla_find(data, dt_len, ISCSI_NET_PARAM_IPV4_SUBNET);
		if (nla) {
			info = nla_data(nla);
			subnet = info->value;
		}
		ret = beiscsi_if_en_static(phba, BE2_IPV4, ip, subnet);
		break;
	case ISCSI_NET_PARAM_IPV4_SUBNET:
		/*
		 * OPCODE_COMMON_ISCSI_NTWK_MODIFY_IP_ADDR ioctl needs IP
		 * and subnet both. Find IP to be applied for this subnet.
		 */
		subnet = info->value;
		nla = nla_find(data, dt_len, ISCSI_NET_PARAM_IPV4_ADDR);
		if (nla) {
			info = nla_data(nla);
			ip = info->value;
		}
		ret = beiscsi_if_en_static(phba, BE2_IPV4, ip, subnet);
		break;
		break;
	case ISCSI_NET_PARAM_VLAN_ENABLED:
	case ISCSI_NET_PARAM_VLAN_ENABLED:
	case ISCSI_NET_PARAM_VLAN_TAG:
	case ISCSI_NET_PARAM_VLAN_TAG:
		ret = beiscsi_set_vlan_tag(shost, iface_param);
		ret = beiscsi_set_vlan_tag(shost, info);
		break;
		break;
	default:
	default:
		beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG,
		beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG,
			    "BS_%d : Param %d not supported\n",
			    "BS_%d : Param %d not supported\n",
			    iface_param->param);
			    info->param);
	}
	}


	return ret;
	return ret;
}
}


static int
static int
beiscsi_set_ipv6(struct Scsi_Host *shost,
beiscsi_iface_config_ipv6(struct Scsi_Host *shost,
			  struct iscsi_iface_param_info *iface_param,
			  struct iscsi_iface_param_info *iface_param,
			  void *data, uint32_t dt_len)
			  void *data, uint32_t dt_len)
{
{
@@ -469,8 +436,8 @@ beiscsi_set_ipv6(struct Scsi_Host *shost,
		}
		}
		break;
		break;
	case ISCSI_NET_PARAM_IPV6_ADDR:
	case ISCSI_NET_PARAM_IPV6_ADDR:
		ret = mgmt_set_ip(phba, iface_param, NULL,
		ret = beiscsi_if_en_static(phba, BE2_IPV6,
				  ISCSI_BOOTPROTO_STATIC);
					   iface_param->value, NULL);
		break;
		break;
	case ISCSI_NET_PARAM_VLAN_ENABLED:
	case ISCSI_NET_PARAM_VLAN_ENABLED:
	case ISCSI_NET_PARAM_VLAN_TAG:
	case ISCSI_NET_PARAM_VLAN_TAG:
@@ -520,11 +487,11 @@ int be2iscsi_iface_set_param(struct Scsi_Host *shost,


		switch (iface_param->iface_type) {
		switch (iface_param->iface_type) {
		case ISCSI_IFACE_TYPE_IPV4:
		case ISCSI_IFACE_TYPE_IPV4:
			ret = beiscsi_set_ipv4(shost, iface_param,
			ret = beiscsi_iface_config_ipv4(shost, iface_param,
							data, dt_len);
							data, dt_len);
			break;
			break;
		case ISCSI_IFACE_TYPE_IPV6:
		case ISCSI_IFACE_TYPE_IPV6:
			ret = beiscsi_set_ipv6(shost, iface_param,
			ret = beiscsi_iface_config_ipv6(shost, iface_param,
							data, dt_len);
							data, dt_len);
			break;
			break;
		default:
		default:
+151 −141
Original line number Original line Diff line number Diff line
@@ -1004,61 +1004,6 @@ static int mgmt_alloc_cmd_data(struct beiscsi_hba *phba, struct be_dma_mem *cmd,
	return 0;
	return 0;
}
}


static int
mgmt_static_ip_modify(struct beiscsi_hba *phba,
		      struct be_cmd_get_if_info_resp *if_info,
		      struct iscsi_iface_param_info *ip_param,
		      struct iscsi_iface_param_info *subnet_param,
		      uint32_t ip_action)
{
	struct be_cmd_set_ip_addr_req *req;
	struct be_dma_mem nonemb_cmd;
	uint32_t ip_type;
	int rc;

	rc = mgmt_alloc_cmd_data(phba, &nonemb_cmd,
				 OPCODE_COMMON_ISCSI_NTWK_MODIFY_IP_ADDR,
				 sizeof(*req));
	if (rc)
		return rc;

	ip_type = (ip_param->param == ISCSI_NET_PARAM_IPV6_ADDR) ?
		BE2_IPV6 : BE2_IPV4 ;

	req = nonemb_cmd.va;
	req->ip_params.record_entry_count = 1;
	req->ip_params.ip_record.action = ip_action;
	req->ip_params.ip_record.interface_hndl =
		phba->interface_handle;
	req->ip_params.ip_record.ip_addr.size_of_structure =
		sizeof(struct be_ip_addr_subnet_format);
	req->ip_params.ip_record.ip_addr.ip_type = ip_type;

	if (ip_action == IP_ACTION_ADD) {
		memcpy(req->ip_params.ip_record.ip_addr.addr, ip_param->value,
		       sizeof(req->ip_params.ip_record.ip_addr.addr));

		if (subnet_param)
			memcpy(req->ip_params.ip_record.ip_addr.subnet_mask,
			       subnet_param->value,
			       sizeof(req->ip_params.ip_record.ip_addr.subnet_mask));
	} else {
		memcpy(req->ip_params.ip_record.ip_addr.addr,
		       if_info->ip_addr.addr,
		       sizeof(req->ip_params.ip_record.ip_addr.addr));

		memcpy(req->ip_params.ip_record.ip_addr.subnet_mask,
		       if_info->ip_addr.subnet_mask,
		       sizeof(req->ip_params.ip_record.ip_addr.subnet_mask));
	}

	rc = mgmt_exec_nonemb_cmd(phba, &nonemb_cmd, NULL, 0);
	if (rc < 0)
		beiscsi_log(phba, KERN_WARNING, BEISCSI_LOG_CONFIG,
			    "BG_%d : Failed to Modify existing IP Address\n");
	return rc;
}

static int beiscsi_if_mod_gw(struct beiscsi_hba *phba,
static int beiscsi_if_mod_gw(struct beiscsi_hba *phba,
			     u32 action, u32 ip_type, u8 *gw)
			     u32 action, u32 ip_type, u8 *gw)
{
{
@@ -1129,103 +1074,173 @@ int beiscsi_if_get_gw(struct beiscsi_hba *phba, u32 ip_type,
				    sizeof(*resp));
				    sizeof(*resp));
}
}


int mgmt_set_ip(struct beiscsi_hba *phba,
static int
		struct iscsi_iface_param_info *ip_param,
beiscsi_if_clr_ip(struct beiscsi_hba *phba,
		struct iscsi_iface_param_info *subnet_param,
		  struct be_cmd_get_if_info_resp *if_info)
		uint32_t boot_proto)
{
{
	struct be_cmd_get_def_gateway_resp gtway_addr_set;
	struct be_cmd_set_ip_addr_req *req;
	struct be_cmd_get_if_info_resp *if_info;
	struct be_cmd_set_dhcp_req *dhcpreq;
	struct be_cmd_rel_dhcp_req *reldhcp;
	struct be_dma_mem nonemb_cmd;
	struct be_dma_mem nonemb_cmd;
	uint8_t *gtway_addr;
	uint32_t ip_type;
	int rc;
	int rc;


	rc = mgmt_get_all_if_id(phba);
	rc = mgmt_alloc_cmd_data(phba, &nonemb_cmd,
				 OPCODE_COMMON_ISCSI_NTWK_MODIFY_IP_ADDR,
				 sizeof(*req));
	if (rc)
	if (rc)
		return rc;
		return rc;


	ip_type = (ip_param->param == ISCSI_NET_PARAM_IPV6_ADDR) ?
	req = nonemb_cmd.va;
		BE2_IPV6 : BE2_IPV4 ;
	req->ip_params.record_entry_count = 1;
	req->ip_params.ip_record.action = IP_ACTION_DEL;
	req->ip_params.ip_record.interface_hndl =
		phba->interface_handle;
	req->ip_params.ip_record.ip_addr.size_of_structure =
		sizeof(struct be_ip_addr_subnet_format);
	req->ip_params.ip_record.ip_addr.ip_type = if_info->ip_addr.ip_type;
	memcpy(req->ip_params.ip_record.ip_addr.addr,
	       if_info->ip_addr.addr,
	       sizeof(if_info->ip_addr.addr));
	memcpy(req->ip_params.ip_record.ip_addr.subnet_mask,
	       if_info->ip_addr.subnet_mask,
	       sizeof(if_info->ip_addr.subnet_mask));
	rc = mgmt_exec_nonemb_cmd(phba, &nonemb_cmd, NULL, 0);
	if (rc < 0 || req->ip_params.ip_record.status) {
		beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG,
			    "BG_%d : failed to clear IP: rc %d status %d\n",
			    rc, req->ip_params.ip_record.status);
	}
	return rc;
}


	rc = mgmt_get_if_info(phba, ip_type, &if_info);
static int
beiscsi_if_set_ip(struct beiscsi_hba *phba, u8 *ip,
		  u8 *subnet, u32 ip_type)
{
	struct be_cmd_set_ip_addr_req *req;
	struct be_dma_mem nonemb_cmd;
	uint32_t ip_len;
	int rc;

	rc = mgmt_alloc_cmd_data(phba, &nonemb_cmd,
				 OPCODE_COMMON_ISCSI_NTWK_MODIFY_IP_ADDR,
				 sizeof(*req));
	if (rc)
	if (rc)
		return rc;
		return rc;


	if (boot_proto == ISCSI_BOOTPROTO_DHCP) {
	req = nonemb_cmd.va;
		if (if_info->dhcp_state) {
	req->ip_params.record_entry_count = 1;
			beiscsi_log(phba, KERN_WARNING, BEISCSI_LOG_CONFIG,
	req->ip_params.ip_record.action = IP_ACTION_ADD;
				    "BG_%d : DHCP Already Enabled\n");
	req->ip_params.ip_record.interface_hndl =
			goto exit;
		phba->interface_handle;
		}
	req->ip_params.ip_record.ip_addr.size_of_structure =
		/* The ip_param->len is 1 in DHCP case. Setting
		sizeof(struct be_ip_addr_subnet_format);
		   proper IP len as this it is used while
	req->ip_params.ip_record.ip_addr.ip_type = ip_type;
		   freeing the Static IP.
	ip_len = ip_type == BE2_IPV4 ? IP_V4_LEN : IP_V6_LEN;
	memcpy(req->ip_params.ip_record.ip_addr.addr, ip, ip_len);
	if (subnet)
		memcpy(req->ip_params.ip_record.ip_addr.subnet_mask,
		       subnet, ip_len);

	rc = mgmt_exec_nonemb_cmd(phba, &nonemb_cmd, NULL, 0);
	/**
	 * In some cases, host needs to look into individual record status
	 * even though FW reported success for that IOCTL.
	 */
	 */
		ip_param->len = (ip_param->param == ISCSI_NET_PARAM_IPV6_ADDR) ?
	if (rc < 0 || req->ip_params.ip_record.status) {
				IP_V6_LEN : IP_V4_LEN;
		__beiscsi_log(phba, KERN_ERR,
			    "BG_%d : failed to set IP: rc %d status %d\n",
			    rc, req->ip_params.ip_record.status);
		if (req->ip_params.ip_record.status)
			rc = -EINVAL;
	}
	return rc;
}


	} else {
int beiscsi_if_en_static(struct beiscsi_hba *phba, u32 ip_type,
		if (if_info->dhcp_state) {
			 u8 *ip, u8 *subnet)
{
	struct be_cmd_get_if_info_resp *if_info;
	struct be_cmd_rel_dhcp_req *reldhcp;
	struct be_dma_mem nonemb_cmd;
	int rc;


			memset(if_info, 0, sizeof(*if_info));
	rc = mgmt_get_if_info(phba, ip_type, &if_info);
	if (rc)
		return rc;

	if (if_info->dhcp_state) {
		rc = mgmt_alloc_cmd_data(phba, &nonemb_cmd,
		rc = mgmt_alloc_cmd_data(phba, &nonemb_cmd,
				OPCODE_COMMON_ISCSI_NTWK_REL_STATELESS_IP_ADDR,
				OPCODE_COMMON_ISCSI_NTWK_REL_STATELESS_IP_ADDR,
				sizeof(*reldhcp));
				sizeof(*reldhcp));

		if (rc)
		if (rc)
			goto exit;
			goto exit;


		reldhcp = nonemb_cmd.va;
		reldhcp = nonemb_cmd.va;
		reldhcp->interface_hndl = phba->interface_handle;
		reldhcp->interface_hndl = phba->interface_handle;
		reldhcp->ip_type = ip_type;
		reldhcp->ip_type = ip_type;

		rc = mgmt_exec_nonemb_cmd(phba, &nonemb_cmd, NULL, 0);
		rc = mgmt_exec_nonemb_cmd(phba, &nonemb_cmd, NULL, 0);
		if (rc < 0) {
		if (rc < 0) {
				beiscsi_log(phba, KERN_WARNING,
			beiscsi_log(phba, KERN_WARNING, BEISCSI_LOG_CONFIG,
					    BEISCSI_LOG_CONFIG,
				    "BG_%d : failed to release existing DHCP: %d\n",
					    "BG_%d : Failed to Delete existing dhcp\n");
				    rc);
			goto exit;
			goto exit;
		}
		}
	}
	}

	/* first delete any old IP set */
	rc = beiscsi_if_clr_ip(phba, if_info);
	if (rc)
		goto exit;

	/* if ip == NULL then this is called just to release DHCP IP */
	if (ip)
		rc = beiscsi_if_set_ip(phba, ip, subnet, ip_type);
exit:
	kfree(if_info);
	return rc;
}
}


	/* Delete the Static IP Set */
int beiscsi_if_en_dhcp(struct beiscsi_hba *phba, u32 ip_type)
	if (if_info->ip_addr.addr[0]) {
{
		rc = mgmt_static_ip_modify(phba, if_info, ip_param, NULL,
	struct be_cmd_get_def_gateway_resp gw_resp;
					   IP_ACTION_DEL);
	struct be_cmd_get_if_info_resp *if_info;
	struct be_cmd_set_dhcp_req *dhcpreq;
	struct be_dma_mem nonemb_cmd;
	u8 *gw;
	int rc;

	rc = mgmt_get_if_info(phba, ip_type, &if_info);
	if (rc)
	if (rc)
		return rc;

	if (if_info->dhcp_state) {
		beiscsi_log(phba, KERN_WARNING, BEISCSI_LOG_CONFIG,
				"BG_%d : DHCP Already Enabled\n");
		goto exit;
		goto exit;
	}
	}


	/* Delete the Gateway settings if mode change is to DHCP */
	/* first delete any old static IP set */
	if (boot_proto == ISCSI_BOOTPROTO_DHCP) {
	rc = beiscsi_if_clr_ip(phba, if_info);
		memset(&gtway_addr_set, 0, sizeof(gtway_addr_set));
	if (rc)
		rc = beiscsi_if_get_gw(phba, BE2_IPV4, &gtway_addr_set);
		goto exit;

	/* delete gateway settings if mode change is to DHCP */
	memset(&gw_resp, 0, sizeof(gw_resp));
	/* use ip_type provided in if_info */
	rc = beiscsi_if_get_gw(phba, if_info->ip_addr.ip_type, &gw_resp);
	if (rc) {
	if (rc) {
		beiscsi_log(phba, KERN_WARNING, BEISCSI_LOG_CONFIG,
		beiscsi_log(phba, KERN_WARNING, BEISCSI_LOG_CONFIG,
			    "BG_%d : Failed to Get Gateway Addr\n");
			    "BG_%d : Failed to Get Gateway Addr\n");
		goto exit;
		goto exit;
	}
	}

	gw = (u8 *)&gw_resp.ip_addr.addr;
		if (gtway_addr_set.ip_addr.addr[0]) {
			gtway_addr = (uint8_t *)&gtway_addr_set.ip_addr.addr;
	rc = beiscsi_if_mod_gw(phba, IP_ACTION_DEL,
	rc = beiscsi_if_mod_gw(phba, IP_ACTION_DEL,
					       ip_type, gtway_addr);
			       if_info->ip_addr.ip_type, gw);

	if (rc) {
	if (rc) {
				beiscsi_log(phba, KERN_WARNING,
		beiscsi_log(phba, KERN_WARNING, BEISCSI_LOG_CONFIG,
					    BEISCSI_LOG_CONFIG,
				"BG_%d : Failed to clear Gateway Addr Set\n");
				"BG_%d : Failed to clear Gateway Addr Set\n");
		goto exit;
		goto exit;
	}
	}
		}
	}


	/* Set Adapter to DHCP/Static Mode */
	if (boot_proto == ISCSI_BOOTPROTO_DHCP) {
	rc = mgmt_alloc_cmd_data(phba, &nonemb_cmd,
	rc = mgmt_alloc_cmd_data(phba, &nonemb_cmd,
			OPCODE_COMMON_ISCSI_NTWK_CONFIG_STATELESS_IP_ADDR,
			OPCODE_COMMON_ISCSI_NTWK_CONFIG_STATELESS_IP_ADDR,
			sizeof(*dhcpreq));
			sizeof(*dhcpreq));
@@ -1236,13 +1251,8 @@ int mgmt_set_ip(struct beiscsi_hba *phba,
	dhcpreq->flags = BLOCKING;
	dhcpreq->flags = BLOCKING;
	dhcpreq->retry_count = 1;
	dhcpreq->retry_count = 1;
	dhcpreq->interface_hndl = phba->interface_handle;
	dhcpreq->interface_hndl = phba->interface_handle;
		dhcpreq->ip_type = BE2_DHCP_V4;
	dhcpreq->ip_type = ip_type;

	rc = mgmt_exec_nonemb_cmd(phba, &nonemb_cmd, NULL, 0);
	rc = mgmt_exec_nonemb_cmd(phba, &nonemb_cmd, NULL, 0);
	} else {
		rc = mgmt_static_ip_modify(phba, if_info, ip_param,
					     subnet_param, IP_ACTION_ADD);
	}


exit:
exit:
	kfree(if_info);
	kfree(if_info);
+4 −4
Original line number Original line Diff line number Diff line
@@ -277,10 +277,10 @@ unsigned int mgmt_invalidate_connection(struct beiscsi_hba *phba,
					 unsigned short issue_reset,
					 unsigned short issue_reset,
					 unsigned short savecfg_flag);
					 unsigned short savecfg_flag);


int mgmt_set_ip(struct beiscsi_hba *phba,
int beiscsi_if_en_dhcp(struct beiscsi_hba *phba, u32 ip_type);
		struct iscsi_iface_param_info *ip_param,

		struct iscsi_iface_param_info *subnet_param,
int beiscsi_if_en_static(struct beiscsi_hba *phba, u32 ip_type,
		uint32_t boot_proto);
			 u8 *ip, u8 *subnet);


unsigned int mgmt_get_boot_target(struct beiscsi_hba *phba);
unsigned int mgmt_get_boot_target(struct beiscsi_hba *phba);