summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/aquantia/atlantic/aq_hw.h
diff options
context:
space:
mode:
authorIgor Russkikh <igor.russkikh@aquantia.com>2018-01-19 17:03:24 +0300
committerDavid S. Miller <davem@davemloft.net>2018-01-21 18:19:03 -0500
commit0c58c35f02c2e99bb10137b32e8ec96dcbdcc705 (patch)
tree4bd8efa8d6b9a52a297bdce7d2fa0edeeff3678a /drivers/net/ethernet/aquantia/atlantic/aq_hw.h
parent76c19c6cfa8f7e4f8c7d5407f77237b80095e5d9 (diff)
net: aquantia: Introduce firmware ops callbacks
New AQC cards will have an updated firmware with new binary interface. This patch extracts firmware specific operations into a separate table and prepares for the introduction of new fw 2.x and 3.x Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/aquantia/atlantic/aq_hw.h')
-rw-r--r--drivers/net/ethernet/aquantia/atlantic/aq_hw.h27
1 files changed, 17 insertions, 10 deletions
diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_hw.h b/drivers/net/ethernet/aquantia/atlantic/aq_hw.h
index a8bf38791079..33a7c14c3bc6 100644
--- a/drivers/net/ethernet/aquantia/atlantic/aq_hw.h
+++ b/drivers/net/ethernet/aquantia/atlantic/aq_hw.h
@@ -102,6 +102,7 @@ struct aq_stats_s {
struct aq_hw_s {
atomic_t flags;
struct aq_nic_cfg_s *aq_nic_cfg;
+ const struct aq_fw_ops *aq_fw_ops;
void __iomem *mmio;
struct aq_hw_link_status_s aq_link_status;
struct hw_aq_atl_utils_mbox mbox;
@@ -121,7 +122,6 @@ struct aq_hw_s {
struct aq_ring_s;
struct aq_ring_param_s;
-struct aq_nic_cfg_s;
struct sk_buff;
struct aq_hw_ops {
@@ -138,15 +138,8 @@ struct aq_hw_ops {
int (*hw_ring_tx_head_update)(struct aq_hw_s *self,
struct aq_ring_s *aq_ring);
- int (*hw_get_mac_permanent)(struct aq_hw_s *self,
- u8 *mac);
-
int (*hw_set_mac_address)(struct aq_hw_s *self, u8 *mac_addr);
- int (*hw_get_link_status)(struct aq_hw_s *self);
-
- int (*hw_set_link_speed)(struct aq_hw_s *self, u32 speed);
-
int (*hw_reset)(struct aq_hw_s *self);
int (*hw_init)(struct aq_hw_s *self, u8 *mac_addr);
@@ -200,8 +193,6 @@ struct aq_hw_ops {
const struct aq_hw_caps_s *aq_hw_caps,
u32 *regs_buff);
- int (*hw_update_stats)(struct aq_hw_s *self);
-
struct aq_stats_s *(*hw_get_hw_stats)(struct aq_hw_s *self);
int (*hw_get_fw_version)(struct aq_hw_s *self, u32 *fw_version);
@@ -211,4 +202,20 @@ struct aq_hw_ops {
int (*hw_set_power)(struct aq_hw_s *self, unsigned int power_state);
};
+struct aq_fw_ops {
+ int (*init)(struct aq_hw_s *self);
+
+ int (*reset)(struct aq_hw_s *self);
+
+ int (*get_mac_permanent)(struct aq_hw_s *self, u8 *mac);
+
+ int (*set_link_speed)(struct aq_hw_s *self, u32 speed);
+
+ int (*set_state)(struct aq_hw_s *self, enum hal_atl_utils_fw_state_e state);
+
+ int (*update_link_status)(struct aq_hw_s *self);
+
+ int (*update_stats)(struct aq_hw_s *self);
+};
+
#endif /* AQ_HW_H */