mirror of
https://github.com/coolsnowwolf/lede.git
synced 2025-06-13 13:32:04 +08:00

Also fix the limitation of the original makefile so that it can be compiled on arm. Fixes: eac26cc (ipq807x: add Redmi/Xiaomi support")
110 lines
2.5 KiB
Diff
110 lines
2.5 KiB
Diff
--- a/include/linux/switch.h
|
|
+++ b/include/linux/switch.h
|
|
@@ -45,6 +45,9 @@ enum switch_port_speed {
|
|
SWITCH_PORT_SPEED_10 = 10,
|
|
SWITCH_PORT_SPEED_100 = 100,
|
|
SWITCH_PORT_SPEED_1000 = 1000,
|
|
+ SWITCH_PORT_SPEED_2500 = 2500,
|
|
+ SWITCH_PORT_SPEED_5000 = 5000,
|
|
+ SWITCH_PORT_SPEED_10000 = 10000,
|
|
};
|
|
|
|
struct switch_port_link {
|
|
@@ -83,6 +86,10 @@ struct switch_port_stats {
|
|
*/
|
|
struct switch_dev_ops {
|
|
struct switch_attrlist attr_global, attr_port, attr_vlan;
|
|
+ struct switch_attrlist attr_reg;
|
|
+
|
|
+ int (*get_reg_val)(struct switch_dev *dev, int reg, int *val);
|
|
+ int (*set_reg_val)(struct switch_dev *dev, int reg, int val);
|
|
|
|
int (*get_vlan_ports)(struct switch_dev *dev, struct switch_val *val);
|
|
int (*set_vlan_ports)(struct switch_dev *dev, struct switch_val *val);
|
|
@@ -146,6 +153,12 @@ struct switch_portmap {
|
|
const char *s;
|
|
};
|
|
|
|
+struct switch_ext {
|
|
+ const char *option_name;
|
|
+ const char *option_value;
|
|
+ struct switch_ext *next;
|
|
+};
|
|
+
|
|
struct switch_val {
|
|
const struct switch_attr *attr;
|
|
unsigned int port_vlan;
|
|
@@ -155,6 +168,7 @@ struct switch_val {
|
|
u32 i;
|
|
struct switch_port *ports;
|
|
struct switch_port_link *link;
|
|
+ struct switch_ext *ext_val;
|
|
} value;
|
|
};
|
|
|
|
--- a/include/uapi/linux/switch.h
|
|
+++ b/include/uapi/linux/switch.h
|
|
@@ -47,13 +47,17 @@ enum {
|
|
SWITCH_ATTR_OP_NAME,
|
|
SWITCH_ATTR_OP_PORT,
|
|
SWITCH_ATTR_OP_VLAN,
|
|
+ SWITCH_ATTR_OP_REG,
|
|
SWITCH_ATTR_OP_VALUE_INT,
|
|
SWITCH_ATTR_OP_VALUE_STR,
|
|
SWITCH_ATTR_OP_VALUE_PORTS,
|
|
SWITCH_ATTR_OP_VALUE_LINK,
|
|
+ SWITCH_ATTR_OP_VALUE_EXT,
|
|
SWITCH_ATTR_OP_DESCRIPTION,
|
|
/* port lists */
|
|
SWITCH_ATTR_PORT,
|
|
+ /* switch_ext attribute */
|
|
+ SWITCH_ATTR_EXT,
|
|
SWITCH_ATTR_MAX
|
|
};
|
|
|
|
@@ -78,7 +82,10 @@ enum {
|
|
SWITCH_CMD_SET_PORT,
|
|
SWITCH_CMD_LIST_VLAN,
|
|
SWITCH_CMD_GET_VLAN,
|
|
- SWITCH_CMD_SET_VLAN
|
|
+ SWITCH_CMD_SET_VLAN,
|
|
+ SWITCH_CMD_LIST_REG,
|
|
+ SWITCH_CMD_GET_REG,
|
|
+ SWITCH_CMD_SET_REG,
|
|
};
|
|
|
|
/* data types */
|
|
@@ -88,6 +95,7 @@ enum switch_val_type {
|
|
SWITCH_TYPE_STRING,
|
|
SWITCH_TYPE_PORTS,
|
|
SWITCH_TYPE_LINK,
|
|
+ SWITCH_TYPE_EXT,
|
|
SWITCH_TYPE_NOVAL,
|
|
};
|
|
|
|
@@ -113,6 +121,14 @@ enum {
|
|
SWITCH_LINK_ATTR_MAX,
|
|
};
|
|
|
|
+/* switch_ext nested attributes */
|
|
+enum {
|
|
+ SWITCH_EXT_UNSPEC,
|
|
+ SWITCH_EXT_NAME,
|
|
+ SWITCH_EXT_VALUE,
|
|
+ SWITCH_EXT_ATTR_MAX
|
|
+};
|
|
+
|
|
#define SWITCH_ATTR_DEFAULTS_OFFSET 0x1000
|
|
|
|
|
|
--- a/include/net/ip_fib.h
|
|
+++ b/include/net/ip_fib.h
|
|
@@ -107,6 +107,7 @@ struct fib_nh {
|
|
#ifdef CONFIG_IP_ROUTE_CLASSID
|
|
__u32 nh_tclassid;
|
|
#endif
|
|
+ __be32 nh_gw; /* QCA SSDK Support */
|
|
__be32 nh_saddr;
|
|
int nh_saddr_genid;
|
|
#define fib_nh_family nh_common.nhc_family
|