1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * aQuantia Corporation Network Driver
4 * Copyright (C) 2014-2017 aQuantia Corporation. All rights reserved
7 /* File aq_hw_utils.h: Declaration of helper functions used across hardware
14 #include <linux/iopoll.h>
16 #include "aq_common.h"
19 #define LODWORD(_qw) ((u32)(_qw))
20 #define HIDWORD(_qw) ((u32)(((_qw) >> 32) & 0xffffffff))
23 #define AQ_HW_SLEEP(_US_) mdelay(_US_)
25 #define aq_pr_err(...) pr_err(AQ_CFG_DRV_NAME ": " __VA_ARGS__)
26 #define aq_pr_trace(...) pr_info(AQ_CFG_DRV_NAME ": " __VA_ARGS__)
30 void aq_hw_write_reg_bit(struct aq_hw_s
*aq_hw
, u32 addr
, u32 msk
,
32 u32
aq_hw_read_reg_bit(struct aq_hw_s
*aq_hw
, u32 addr
, u32 msk
, u32 shift
);
33 u32
aq_hw_read_reg(struct aq_hw_s
*hw
, u32 reg
);
34 void aq_hw_write_reg(struct aq_hw_s
*hw
, u32 reg
, u32 value
);
35 u64
aq_hw_read_reg64(struct aq_hw_s
*hw
, u32 reg
);
36 int aq_hw_err_from_flags(struct aq_hw_s
*hw
);
38 #endif /* AQ_HW_UTILS_H */