sja1105.h (94f94d4acfb2a5e978f98d924be33c981e2f86c6) sja1105.h (b70bb8d4ab2c0a4992e4692f07e9b91056b30c88)
1/* SPDX-License-Identifier: GPL-2.0 */
2/* Copyright (c) 2018, Sensor-Technik Wiedemann GmbH
3 * Copyright (c) 2018-2019, Vladimir Oltean <olteanv@gmail.com>
4 */
5#ifndef _SJA1105_H
6#define _SJA1105_H
7
8#include <linux/ptp_clock_kernel.h>

--- 83 unchanged lines hidden (view full) ---

92 const unsigned char *addr, u16 vid);
93 int (*fdb_del_cmd)(struct dsa_switch *ds, int port,
94 const unsigned char *addr, u16 vid);
95 void (*ptp_cmd_packing)(u8 *buf, struct sja1105_ptp_cmd *cmd,
96 enum packing_op op);
97 const char *name;
98};
99
1/* SPDX-License-Identifier: GPL-2.0 */
2/* Copyright (c) 2018, Sensor-Technik Wiedemann GmbH
3 * Copyright (c) 2018-2019, Vladimir Oltean <olteanv@gmail.com>
4 */
5#ifndef _SJA1105_H
6#define _SJA1105_H
7
8#include <linux/ptp_clock_kernel.h>

--- 83 unchanged lines hidden (view full) ---

92 const unsigned char *addr, u16 vid);
93 int (*fdb_del_cmd)(struct dsa_switch *ds, int port,
94 const unsigned char *addr, u16 vid);
95 void (*ptp_cmd_packing)(u8 *buf, struct sja1105_ptp_cmd *cmd,
96 enum packing_op op);
97 const char *name;
98};
99
100enum sja1105_key_type {
101 SJA1105_KEY_BCAST,
102 SJA1105_KEY_TC,
103 SJA1105_KEY_VLAN_UNAWARE_VL,
104 SJA1105_KEY_VLAN_AWARE_VL,
105};
106
107struct sja1105_key {
108 enum sja1105_key_type type;
109
110 union {
111 /* SJA1105_KEY_TC */
112 struct {
113 int pcp;
114 } tc;
115
116 /* SJA1105_KEY_VLAN_UNAWARE_VL */
117 /* SJA1105_KEY_VLAN_AWARE_VL */
118 struct {
119 u64 dmac;
120 u16 vid;
121 u16 pcp;
122 } vl;
123 };
124};
125
100enum sja1105_rule_type {
101 SJA1105_RULE_BCAST_POLICER,
102 SJA1105_RULE_TC_POLICER,
103};
104
105struct sja1105_rule {
106 struct list_head list;
107 unsigned long cookie;
108 unsigned long port_mask;
126enum sja1105_rule_type {
127 SJA1105_RULE_BCAST_POLICER,
128 SJA1105_RULE_TC_POLICER,
129};
130
131struct sja1105_rule {
132 struct list_head list;
133 unsigned long cookie;
134 unsigned long port_mask;
135 struct sja1105_key key;
109 enum sja1105_rule_type type;
110
111 union {
112 /* SJA1105_RULE_BCAST_POLICER */
113 struct {
114 int sharindx;
115 } bcast_pol;
116
117 /* SJA1105_RULE_TC_POLICER */
118 struct {
119 int sharindx;
136 enum sja1105_rule_type type;
137
138 union {
139 /* SJA1105_RULE_BCAST_POLICER */
140 struct {
141 int sharindx;
142 } bcast_pol;
143
144 /* SJA1105_RULE_TC_POLICER */
145 struct {
146 int sharindx;
120 int tc;
121 } tc_pol;
122 };
123};
124
125struct sja1105_flow_block {
126 struct list_head rules;
127 bool l2_policer_used[SJA1105_NUM_L2_POLICERS];
128};

--- 140 unchanged lines hidden ---
147 } tc_pol;
148 };
149};
150
151struct sja1105_flow_block {
152 struct list_head rules;
153 bool l2_policer_used[SJA1105_NUM_L2_POLICERS];
154};

--- 140 unchanged lines hidden ---