|
22 | 22 | #include <linux/if_ether.h> |
23 | 23 | #include <linux/dsa/8021q.h> |
24 | 24 | #include "sja1105.h" |
| 25 | +#include "sja1105_tas.h" |
25 | 26 |
|
26 | 27 | static void sja1105_hw_reset(struct gpio_desc *gpio, unsigned int pulse_len, |
27 | 28 | unsigned int startup_delay) |
@@ -1382,7 +1383,7 @@ static void sja1105_bridge_leave(struct dsa_switch *ds, int port, |
1382 | 1383 | * modify at runtime (currently only MAC) and restore them after uploading, |
1383 | 1384 | * such that this operation is relatively seamless. |
1384 | 1385 | */ |
1385 | | -static int sja1105_static_config_reload(struct sja1105_private *priv) |
| 1386 | +int sja1105_static_config_reload(struct sja1105_private *priv) |
1386 | 1387 | { |
1387 | 1388 | struct sja1105_mac_config_entry *mac; |
1388 | 1389 | int speed_mbps[SJA1105_NUM_PORTS]; |
@@ -1727,6 +1728,7 @@ static void sja1105_teardown(struct dsa_switch *ds) |
1727 | 1728 | { |
1728 | 1729 | struct sja1105_private *priv = ds->priv; |
1729 | 1730 |
|
| 1731 | + sja1105_tas_teardown(ds); |
1730 | 1732 | cancel_work_sync(&priv->tagger_data.rxtstamp_work); |
1731 | 1733 | skb_queue_purge(&priv->tagger_data.skb_rxtstamp_queue); |
1732 | 1734 | sja1105_ptp_clock_unregister(priv); |
@@ -2056,6 +2058,18 @@ static bool sja1105_port_txtstamp(struct dsa_switch *ds, int port, |
2056 | 2058 | return true; |
2057 | 2059 | } |
2058 | 2060 |
|
| 2061 | +static int sja1105_port_setup_tc(struct dsa_switch *ds, int port, |
| 2062 | + enum tc_setup_type type, |
| 2063 | + void *type_data) |
| 2064 | +{ |
| 2065 | + switch (type) { |
| 2066 | + case TC_SETUP_QDISC_TAPRIO: |
| 2067 | + return sja1105_setup_tc_taprio(ds, port, type_data); |
| 2068 | + default: |
| 2069 | + return -EOPNOTSUPP; |
| 2070 | + } |
| 2071 | +} |
| 2072 | + |
2059 | 2073 | static const struct dsa_switch_ops sja1105_switch_ops = { |
2060 | 2074 | .get_tag_protocol = sja1105_get_tag_protocol, |
2061 | 2075 | .setup = sja1105_setup, |
@@ -2088,6 +2102,7 @@ static const struct dsa_switch_ops sja1105_switch_ops = { |
2088 | 2102 | .port_hwtstamp_set = sja1105_hwtstamp_set, |
2089 | 2103 | .port_rxtstamp = sja1105_port_rxtstamp, |
2090 | 2104 | .port_txtstamp = sja1105_port_txtstamp, |
| 2105 | + .port_setup_tc = sja1105_port_setup_tc, |
2091 | 2106 | }; |
2092 | 2107 |
|
2093 | 2108 | static int sja1105_check_device_id(struct sja1105_private *priv) |
@@ -2197,6 +2212,8 @@ static int sja1105_probe(struct spi_device *spi) |
2197 | 2212 | } |
2198 | 2213 | mutex_init(&priv->mgmt_lock); |
2199 | 2214 |
|
| 2215 | + sja1105_tas_setup(ds); |
| 2216 | + |
2200 | 2217 | return dsa_register_switch(priv->ds); |
2201 | 2218 | } |
2202 | 2219 |
|
|
0 commit comments