Link: https://lore.kernel.org/r/20260217200002.683975158@linuxfoundation.org Tested-by: Florian Fainelli <florian.fainelli@broadcom.com> Tested-by: Takeshi Ogasawara <takeshi.ogasawara@futuring-girl.com> Tested-by: Peter Schneider <pschneider1968@googlemail.com> Tested-by: Jon Hunter <jonathanh@nvidia.com> Tested-by: Salvatore Bonaccorso <carnil@debian.org> Tested-by: Brett A C Sheffield <bacs@librecast.net> Tested-by: Mark Brown <broonie@kernel.org> Tested-by: Luna Jernberg <droidbittin@gmail.com> Tested-by: Ronald Warsow <rwarsow@gmx.de> Tested-by: Justin M. Forbes <jforbes@fedoraproject.org> Tested-by: Ron Economos <re@w6rz.net> Tested-by: Miguel Ojeda <ojeda@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
44 lines
1.1 KiB
C
44 lines
1.1 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#include <linux/device.h>
|
|
#include <linux/mutex.h>
|
|
#include <linux/regmap.h>
|
|
#include <linux/workqueue.h>
|
|
#include <linux/u64_stats_sync.h>
|
|
#include <uapi/linux/if_link.h>
|
|
|
|
struct xrs700x_info {
|
|
unsigned int id;
|
|
const char *name;
|
|
size_t num_ports;
|
|
};
|
|
|
|
extern const struct xrs700x_info xrs7003e_info;
|
|
extern const struct xrs700x_info xrs7003f_info;
|
|
extern const struct xrs700x_info xrs7004e_info;
|
|
extern const struct xrs700x_info xrs7004f_info;
|
|
|
|
struct xrs700x_port {
|
|
struct mutex mib_mutex; /* protects mib_data */
|
|
u64 *mib_data;
|
|
struct rtnl_link_stats64 stats64;
|
|
struct u64_stats_sync syncp;
|
|
};
|
|
|
|
struct xrs700x {
|
|
struct dsa_switch *ds;
|
|
struct device *dev;
|
|
void *priv;
|
|
struct regmap *regmap;
|
|
struct regmap_field *ps_forward;
|
|
struct regmap_field *ps_management;
|
|
struct regmap_field *ps_sel_speed;
|
|
struct regmap_field *ps_cur_speed;
|
|
struct delayed_work mib_work;
|
|
struct xrs700x_port *ports;
|
|
};
|
|
|
|
struct xrs700x *xrs700x_switch_alloc(struct device *base, void *devpriv);
|
|
int xrs700x_switch_register(struct xrs700x *priv);
|
|
void xrs700x_switch_remove(struct xrs700x *priv);
|
|
void xrs700x_switch_shutdown(struct xrs700x *priv);
|