[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d00b973a-e211-2b31-3725-d63c45406af6@gmail.com>
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