lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 6 Sep 2012 18:33:20 +0100
From:	Ben Hutchings <bhutchings@...arflare.com>
To:	Sony Chacko <sony.chacko@...gic.com>
CC:	<davem@...emloft.net>, <netdev@...r.kernel.org>,
	<Dept_NX_Linux_NIC_Driver@...gic.com>
Subject: Re: [PATCH 06/12] qlcnic: 83xx data path and HW interfaces routines

On Thu, 2012-09-06 at 02:22 -0400, Sony Chacko wrote:
> From: Sony Chacko <sony.chacko@...gic.com>
> 
> Modify 82xx driver to support new adapter - Qlogic 83XX CNA
> Create 83xx adapter data path and hardware interface routines
[...]
> --- /dev/null
> +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
[...]
> +int qlcnic_83xx_set_settings(struct qlcnic_adapter *adapter,
> +			     struct ethtool_cmd *ecmd)
> +{
> +	int status = 0;
> +	u32 config = adapter->ahw->port_config;
> +
> +	if (ecmd->autoneg)
> +		adapter->ahw->port_config |= BIT_15;
> +
> +	switch (ethtool_cmd_speed(ecmd)) {
> +	case SPEED_10:
> +		adapter->ahw->port_config |= BIT_8;
> +		break;
> +	case SPEED_100:
> +		adapter->ahw->port_config |= BIT_9;
> +		break;
> +	case SPEED_1000:
> +		adapter->ahw->port_config |= BIT_10;
> +		break;
> +	case SPEED_10000:
> +		adapter->ahw->port_config |= BIT_11;
> +		break;
> +	default:
> +		return -EIO;

Should be -EINVAL.

> +	}
> +
> +	status = qlcnic_83xx_set_port_config(adapter);
> +	if (status) {
> +		dev_info(&adapter->pdev->dev,
> +			 "Faild to Set Link Speed and autoneg.\n");
> +		adapter->ahw->port_config = config;
> +	}
> +	return status;
> +}
[...]
> +static u64*
> +qlcnic_83xx_fill_stats(struct qlcnic_adapter *adapter,
> +		       struct qlcnic_cmd_args *cmd, u64 *data, int type,
> +		       int *ret)
> +{
> +	int err, k, total_regs;
> +
> +	*ret = 0;
> +	err = qlcnic_issue_cmd(adapter, cmd);
> +	if (err != QLCNIC_RCODE_SUCCESS) {
> +		dev_info(&adapter->pdev->dev,
> +			 "Error in get statistics mailbox command\n");
> +		*ret = -EIO;
> +		return data;
> +	}
> +	total_regs = cmd->rsp.num;
> +	switch (type) {
[...]
> +	default:
> +		dev_info(&adapter->pdev->dev, "Unknown get statistics mode\n");

It seems like this default case can only be reached in case of a driver
bug, so WARN would be more appropriate.

> +		*ret = -EIO;
> +	}
> +	return data;
> +}
[...]

-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ