hc
2024-09-20 cf4ce59b3b70238352c7f1729f0f7223214828ad
kernel/drivers/net/dsa/bcm_sf2.h
....@@ -1,12 +1,8 @@
1
+/* SPDX-License-Identifier: GPL-2.0-or-later */
12 /*
23 * Broadcom Starfighter2 private context
34 *
45 * Copyright (C) 2014, Broadcom Corporation
5
- *
6
- * This program is free software; you can redistribute it and/or modify
7
- * it under the terms of the GNU General Public License as published by
8
- * the Free Software Foundation; either version 2 of the License, or
9
- * (at your option) any later version.
106 */
117
128 #ifndef __BCM_SF2_H
....@@ -22,6 +18,7 @@
2218 #include <linux/types.h>
2319 #include <linux/bitops.h>
2420 #include <linux/if_vlan.h>
21
+#include <linux/reset.h>
2522
2623 #include <net/dsa.h>
2724
....@@ -48,6 +45,7 @@
4845
4946 struct bcm_sf2_port_status {
5047 unsigned int link;
48
+ bool enabled;
5149 };
5250
5351 struct bcm_sf2_cfp_priv {
....@@ -56,6 +54,7 @@
5654 DECLARE_BITMAP(used, CFP_NUM_RULES);
5755 DECLARE_BITMAP(unique, CFP_NUM_RULES);
5856 unsigned int rules_cnt;
57
+ struct list_head rules_list;
5958 };
6059
6160 struct bcm_sf2_priv {
....@@ -66,6 +65,8 @@
6665 void __iomem *intrl2_1;
6766 void __iomem *fcb;
6867 void __iomem *acb;
68
+
69
+ struct reset_control *rcdev;
6970
7071 /* Register offsets indirection tables */
7172 u32 type;
....@@ -86,15 +87,15 @@
8687 /* Backing b53_device */
8788 struct b53_device *dev;
8889
89
- /* Mutex protecting access to the MIB counters */
90
- struct mutex stats_mutex;
91
-
9290 struct bcm_sf2_hw_params hw_params;
9391
9492 struct bcm_sf2_port_status port_sts[DSA_MAX_PORTS];
9593
9694 /* Mask of ports enabled for Wake-on-LAN */
9795 u32 wol_ports_mask;
96
+
97
+ struct clk *clk;
98
+ struct clk *clk_mdiv;
9899
99100 /* MoCA port location */
100101 int moca_port;
....@@ -213,5 +214,12 @@
213214 int bcm_sf2_set_rxnfc(struct dsa_switch *ds, int port,
214215 struct ethtool_rxnfc *nfc);
215216 int bcm_sf2_cfp_rst(struct bcm_sf2_priv *priv);
217
+void bcm_sf2_cfp_exit(struct dsa_switch *ds);
218
+int bcm_sf2_cfp_resume(struct dsa_switch *ds);
219
+void bcm_sf2_cfp_get_strings(struct dsa_switch *ds, int port,
220
+ u32 stringset, uint8_t *data);
221
+void bcm_sf2_cfp_get_ethtool_stats(struct dsa_switch *ds, int port,
222
+ uint64_t *data);
223
+int bcm_sf2_cfp_get_sset_count(struct dsa_switch *ds, int port, int sset);
216224
217225 #endif /* __BCM_SF2_H */