dsa.h (a3a4de056ed5cfb22085173d8f0f13b0ca6b6d60) dsa.h (f50f212749e8a28803af3628acbeb85ee0458ed5)
1/*
2 * include/net/dsa.h - Driver for Distributed Switch Architecture switch chips
3 * Copyright (c) 2008-2009 Marvell Semiconductor
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.

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

15#include <linux/list.h>
16#include <linux/timer.h>
17#include <linux/workqueue.h>
18#include <linux/of.h>
19#include <linux/phy.h>
20#include <linux/phy_fixed.h>
21#include <linux/ethtool.h>
22
1/*
2 * include/net/dsa.h - Driver for Distributed Switch Architecture switch chips
3 * Copyright (c) 2008-2009 Marvell Semiconductor
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.

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

15#include <linux/list.h>
16#include <linux/timer.h>
17#include <linux/workqueue.h>
18#include <linux/of.h>
19#include <linux/phy.h>
20#include <linux/phy_fixed.h>
21#include <linux/ethtool.h>
22
23struct tc_action;
24
23enum dsa_tag_protocol {
24 DSA_TAG_PROTO_NONE = 0,
25 DSA_TAG_PROTO_DSA,
26 DSA_TAG_PROTO_TRAILER,
27 DSA_TAG_PROTO_EDSA,
28 DSA_TAG_PROTO_BRCM,
29 DSA_TAG_PROTO_QCA,
30 DSA_TAG_LAST, /* MUST BE LAST */

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

134
135 /*
136 * Tagging protocol operations for adding and removing an
137 * encapsulation tag.
138 */
139 const struct dsa_device_ops *tag_ops;
140};
141
25enum dsa_tag_protocol {
26 DSA_TAG_PROTO_NONE = 0,
27 DSA_TAG_PROTO_DSA,
28 DSA_TAG_PROTO_TRAILER,
29 DSA_TAG_PROTO_EDSA,
30 DSA_TAG_PROTO_BRCM,
31 DSA_TAG_PROTO_QCA,
32 DSA_TAG_LAST, /* MUST BE LAST */

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

136
137 /*
138 * Tagging protocol operations for adding and removing an
139 * encapsulation tag.
140 */
141 const struct dsa_device_ops *tag_ops;
142};
143
144/* TC matchall action types, only mirroring for now */
145enum dsa_port_mall_action_type {
146 DSA_PORT_MALL_MIRROR,
147};
148
149/* TC mirroring entry */
150struct dsa_mall_mirror_tc_entry {
151 u8 to_local_port;
152 bool ingress;
153};
154
155/* TC matchall entry */
156struct dsa_mall_tc_entry {
157 struct list_head list;
158 unsigned long cookie;
159 enum dsa_port_mall_action_type type;
160 union {
161 struct dsa_mall_mirror_tc_entry mirror;
162 };
163};
164
165
142struct dsa_port {
143 struct dsa_switch *ds;
144 unsigned int index;
145 struct net_device *netdev;
146 struct device_node *dn;
147 unsigned int ageing_time;
148 u8 stp_state;
149 struct net_device *bridge_dev;

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

380
381 /*
382 * RXNFC
383 */
384 int (*get_rxnfc)(struct dsa_switch *ds, int port,
385 struct ethtool_rxnfc *nfc, u32 *rule_locs);
386 int (*set_rxnfc)(struct dsa_switch *ds, int port,
387 struct ethtool_rxnfc *nfc);
166struct dsa_port {
167 struct dsa_switch *ds;
168 unsigned int index;
169 struct net_device *netdev;
170 struct device_node *dn;
171 unsigned int ageing_time;
172 u8 stp_state;
173 struct net_device *bridge_dev;

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

404
405 /*
406 * RXNFC
407 */
408 int (*get_rxnfc)(struct dsa_switch *ds, int port,
409 struct ethtool_rxnfc *nfc, u32 *rule_locs);
410 int (*set_rxnfc)(struct dsa_switch *ds, int port,
411 struct ethtool_rxnfc *nfc);
412
413 /*
414 * TC integration
415 */
416 int (*port_mirror_add)(struct dsa_switch *ds, int port,
417 struct dsa_mall_mirror_tc_entry *mirror,
418 bool ingress);
419 void (*port_mirror_del)(struct dsa_switch *ds, int port,
420 struct dsa_mall_mirror_tc_entry *mirror);
388};
389
390struct dsa_switch_driver {
391 struct list_head list;
392 const struct dsa_switch_ops *ops;
393};
394
395void register_switch_driver(struct dsa_switch_driver *type);

--- 26 unchanged lines hidden ---
421};
422
423struct dsa_switch_driver {
424 struct list_head list;
425 const struct dsa_switch_ops *ops;
426};
427
428void register_switch_driver(struct dsa_switch_driver *type);

--- 26 unchanged lines hidden ---