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, 19 Jan 2017 14:40:41 -0800
From:   Florian Fainelli <f.fainelli@...il.com>
To:     Alexander Loktionov <Alexander.Loktionov@...antia.com>,
        netdev@...r.kernel.org, David VomLehn <vomlehn@...as.net>
Cc:     "David S . Miller" <davem@...emloft.net>,
        Simon Edelhaus <Simon.Edelhaus@...antia.com>,
        Dmitrii Tarakanov <Dmitrii.Tarakanov@...antia.com>,
        Pavel Belous <Pavel.Belous@...antia.com>,
        Dmitry Bezrukov <Dmitry.Bezrukov@...antia.com>
Subject: Re: [PATCH v7 10/13] net: ethernet: aquantia: Hardware interface and
 utility functions

On 01/19/2017 01:33 PM, Alexander Loktionov wrote:
> From: David VomLehn <vomlehn@...as.net>
> 
> Add functions to interface with the hardware and some utility functions.
> 
> Signed-off-by: Alexander Loktionov <Alexander.Loktionov@...antia.com>
> Signed-off-by: Dmitrii Tarakanov <Dmitrii.Tarakanov@...antia.com>
> Signed-off-by: Pavel Belous <Pavel.Belous@...antia.com>
> Signed-off-by: Dmitry Bezrukov <Dmitry.Bezrukov@...antia.com>
> Signed-off-by: David M. VomLehn <vomlehn@...as.net>
> ---

> +#ifndef AQ_HW_UTILS_H
> +#define AQ_HW_UTILS_H
> +
> +#include "aq_common.h"
> +
> +#ifndef HIDWORD
> +#define LODWORD(_qw)    ((u32)(_qw))
> +#define HIDWORD(_qw)    ((u32)(((_qw) >> 32) & 0xffffffff))
> +#endif

upper_32_bits() and lower_32_bits()?

> +
> +#define AQ_HW_SLEEP(_US_) mdelay(_US_)
> +
> +#define AQ_HW_WAIT_FOR(_B_, _US_, _N_) \
> +do { \
> +	unsigned int AQ_HW_WAIT_FOR_i; \
> +	for (AQ_HW_WAIT_FOR_i = _N_; (!(_B_)) && (AQ_HW_WAIT_FOR_i);\
> +	--AQ_HW_WAIT_FOR_i) {\
> +		udelay(_US_); \
> +	} \
> +	if (!AQ_HW_WAIT_FOR_i) {\
> +		err = ETIME; \
> +	} \
> +} while (0)

You might want to use readl_poll_timeout() or something similar, at the
very least this should be a function for which we can get proper type
checking.
-- 
Florian

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ