File: xrs700x.h

package info (click to toggle)
linux 6.12.8-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,673,568 kB
  • sloc: ansic: 25,888,630; asm: 268,782; sh: 136,481; python: 64,809; makefile: 55,668; perl: 38,052; xml: 19,270; cpp: 5,893; yacc: 4,923; lex: 2,939; awk: 1,592; sed: 28; ruby: 25
file content (43 lines) | stat: -rw-r--r-- 1,176 bytes parent folder | download | duplicates (17)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/* 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);