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

Commit e9a47700 authored by Rajesh Borundia's avatar Rajesh Borundia Committed by David S. Miller
Browse files

qlcnic: eswitch config fixes



o remove validation before deleting vlan id
o Add missing 'break' while deleting vlan id.

Signed-off-by: default avatarRajesh Borundia <rajesh.borundia@qlogic.com>
Signed-off-by: default avatarAmit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e569aa78
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -1160,6 +1160,7 @@ int qlcnic_config_switch_port(struct qlcnic_adapter *adapter,
	case QLCNIC_DEL_VLAN:
	case QLCNIC_DEL_VLAN:
			arg1 |= (BIT_3 | BIT_5);
			arg1 |= (BIT_3 | BIT_5);
			arg1 &= ~(0x0ffff << 16);
			arg1 &= ~(0x0ffff << 16);
			break;
	default:
	default:
		return err;
		return err;
	}
	}
+14 −12
Original line number Original line Diff line number Diff line
@@ -3301,8 +3301,6 @@ validate_esw_config(struct qlcnic_adapter *adapter,
				return QL_STATUS_INVALID_PARAM;
				return QL_STATUS_INVALID_PARAM;
			break;
			break;
		case QLCNIC_DEL_VLAN:
		case QLCNIC_DEL_VLAN:
			if (!IS_VALID_VLAN(esw_cfg[i].vlan_id))
				return QL_STATUS_INVALID_PARAM;
			if (!esw_cfg[i].op_type)
			if (!esw_cfg[i].op_type)
				return QL_STATUS_INVALID_PARAM;
				return QL_STATUS_INVALID_PARAM;
			break;
			break;
@@ -3338,21 +3336,25 @@ qlcnic_sysfs_write_esw_config(struct file *file, struct kobject *kobj,
		if (adapter->op_mode == QLCNIC_MGMT_FUNC)
		if (adapter->op_mode == QLCNIC_MGMT_FUNC)
			if (qlcnic_config_switch_port(adapter, &esw_cfg[i]))
			if (qlcnic_config_switch_port(adapter, &esw_cfg[i]))
				return QL_STATUS_INVALID_PARAM;
				return QL_STATUS_INVALID_PARAM;
		if (adapter->ahw.pci_func == esw_cfg[i].pci_func)

		if (adapter->ahw.pci_func != esw_cfg[i].pci_func)
			continue;

		op_mode = esw_cfg[i].op_mode;
		op_mode = esw_cfg[i].op_mode;
		qlcnic_get_eswitch_port_config(adapter, &esw_cfg[i]);
		qlcnic_get_eswitch_port_config(adapter, &esw_cfg[i]);
		esw_cfg[i].op_mode = op_mode;
		esw_cfg[i].op_mode = op_mode;
		esw_cfg[i].pci_func = adapter->ahw.pci_func;
		esw_cfg[i].pci_func = adapter->ahw.pci_func;

		switch (esw_cfg[i].op_mode) {
		switch (esw_cfg[i].op_mode) {
		case QLCNIC_PORT_DEFAULTS:
		case QLCNIC_PORT_DEFAULTS:
				qlcnic_set_eswitch_port_features(adapter,
			qlcnic_set_eswitch_port_features(adapter, &esw_cfg[i]);
								&esw_cfg[i]);
			break;
			break;
		}
		}
	}
	}


	if (adapter->op_mode != QLCNIC_MGMT_FUNC)
	if (adapter->op_mode != QLCNIC_MGMT_FUNC)
		goto out;
		goto out;

	for (i = 0; i < count; i++) {
	for (i = 0; i < count; i++) {
		pci_func = esw_cfg[i].pci_func;
		pci_func = esw_cfg[i].pci_func;
		npar = &adapter->npars[pci_func];
		npar = &adapter->npars[pci_func];