| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-or-later */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Broadcom Starfighter2 private context |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * 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. |
|---|
| 10 | 6 | */ |
|---|
| 11 | 7 | |
|---|
| 12 | 8 | #ifndef __BCM_SF2_H |
|---|
| .. | .. |
|---|
| 22 | 18 | #include <linux/types.h> |
|---|
| 23 | 19 | #include <linux/bitops.h> |
|---|
| 24 | 20 | #include <linux/if_vlan.h> |
|---|
| 21 | +#include <linux/reset.h> |
|---|
| 25 | 22 | |
|---|
| 26 | 23 | #include <net/dsa.h> |
|---|
| 27 | 24 | |
|---|
| .. | .. |
|---|
| 48 | 45 | |
|---|
| 49 | 46 | struct bcm_sf2_port_status { |
|---|
| 50 | 47 | unsigned int link; |
|---|
| 48 | + bool enabled; |
|---|
| 51 | 49 | }; |
|---|
| 52 | 50 | |
|---|
| 53 | 51 | struct bcm_sf2_cfp_priv { |
|---|
| .. | .. |
|---|
| 56 | 54 | DECLARE_BITMAP(used, CFP_NUM_RULES); |
|---|
| 57 | 55 | DECLARE_BITMAP(unique, CFP_NUM_RULES); |
|---|
| 58 | 56 | unsigned int rules_cnt; |
|---|
| 57 | + struct list_head rules_list; |
|---|
| 59 | 58 | }; |
|---|
| 60 | 59 | |
|---|
| 61 | 60 | struct bcm_sf2_priv { |
|---|
| .. | .. |
|---|
| 66 | 65 | void __iomem *intrl2_1; |
|---|
| 67 | 66 | void __iomem *fcb; |
|---|
| 68 | 67 | void __iomem *acb; |
|---|
| 68 | + |
|---|
| 69 | + struct reset_control *rcdev; |
|---|
| 69 | 70 | |
|---|
| 70 | 71 | /* Register offsets indirection tables */ |
|---|
| 71 | 72 | u32 type; |
|---|
| .. | .. |
|---|
| 86 | 87 | /* Backing b53_device */ |
|---|
| 87 | 88 | struct b53_device *dev; |
|---|
| 88 | 89 | |
|---|
| 89 | | - /* Mutex protecting access to the MIB counters */ |
|---|
| 90 | | - struct mutex stats_mutex; |
|---|
| 91 | | - |
|---|
| 92 | 90 | struct bcm_sf2_hw_params hw_params; |
|---|
| 93 | 91 | |
|---|
| 94 | 92 | struct bcm_sf2_port_status port_sts[DSA_MAX_PORTS]; |
|---|
| 95 | 93 | |
|---|
| 96 | 94 | /* Mask of ports enabled for Wake-on-LAN */ |
|---|
| 97 | 95 | u32 wol_ports_mask; |
|---|
| 96 | + |
|---|
| 97 | + struct clk *clk; |
|---|
| 98 | + struct clk *clk_mdiv; |
|---|
| 98 | 99 | |
|---|
| 99 | 100 | /* MoCA port location */ |
|---|
| 100 | 101 | int moca_port; |
|---|
| .. | .. |
|---|
| 213 | 214 | int bcm_sf2_set_rxnfc(struct dsa_switch *ds, int port, |
|---|
| 214 | 215 | struct ethtool_rxnfc *nfc); |
|---|
| 215 | 216 | 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); |
|---|
| 216 | 224 | |
|---|
| 217 | 225 | #endif /* __BCM_SF2_H */ |
|---|