diff options
| author | David S. Miller <davem@davemloft.net> | 2021-09-23 12:45:07 +0100 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2021-09-23 12:45:07 +0100 |
| commit | a7597f79d3b1d040c347adfd50ec0d50483deba0 (patch) | |
| tree | 29aae616941036b8447c7b6c884e0b4fde003a24 /include | |
| parent | 68a81bb2eebdeaabb04ae04c4d89c3bb5bec3b32 (diff) | |
| parent | f5aef4241592765a868611509e5170bbe8c89ae7 (diff) | |
| download | cachepc-linux-a7597f79d3b1d040c347adfd50ec0d50483deba0.tar.gz cachepc-linux-a7597f79d3b1d040c347adfd50ec0d50483deba0.zip | |
Merge branch 'ja1105-deps'
Vladimir Oltean says:
====================
Fix circular dependency between sja1105 and tag_sja1105
As discussed here:
https://lore.kernel.org/netdev/20210908220834.d7gmtnwrorhharna@skbuf/
DSA tagging protocols cannot use symbols exported by switch drivers.
Eliminate the two instances of that from tag_sja1105, and that allows us
to have a working setup with modules again.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/dsa/sja1105.h | 40 |
1 files changed, 13 insertions, 27 deletions
diff --git a/include/linux/dsa/sja1105.h b/include/linux/dsa/sja1105.h index 71b69ec52108..e6c78be40bde 100644 --- a/include/linux/dsa/sja1105.h +++ b/include/linux/dsa/sja1105.h @@ -48,6 +48,10 @@ struct sja1105_tagger_data { spinlock_t meta_lock; unsigned long state; u8 ts_id; + /* Used on SJA1110 where meta frames are generated only for + * 2-step TX timestamps + */ + struct sk_buff_head skb_txtstamp_queue; }; struct sja1105_skb_cb { @@ -68,42 +72,24 @@ struct sja1105_port { bool hwts_tx_en; }; -enum sja1110_meta_tstamp { - SJA1110_META_TSTAMP_TX = 0, - SJA1110_META_TSTAMP_RX = 1, -}; - -#if IS_ENABLED(CONFIG_NET_DSA_SJA1105_PTP) - -void sja1110_process_meta_tstamp(struct dsa_switch *ds, int port, u8 ts_id, - enum sja1110_meta_tstamp dir, u64 tstamp); - -#else +/* Timestamps are in units of 8 ns clock ticks (equivalent to + * a fixed 125 MHz clock). + */ +#define SJA1105_TICK_NS 8 -static inline void sja1110_process_meta_tstamp(struct dsa_switch *ds, int port, - u8 ts_id, enum sja1110_meta_tstamp dir, - u64 tstamp) +static inline s64 ns_to_sja1105_ticks(s64 ns) { + return ns / SJA1105_TICK_NS; } -#endif /* IS_ENABLED(CONFIG_NET_DSA_SJA1105_PTP) */ - -#if IS_ENABLED(CONFIG_NET_DSA_SJA1105) - -extern const struct dsa_switch_ops sja1105_switch_ops; - -static inline bool dsa_port_is_sja1105(struct dsa_port *dp) +static inline s64 sja1105_ticks_to_ns(s64 ticks) { - return dp->ds->ops == &sja1105_switch_ops; + return ticks * SJA1105_TICK_NS; } -#else - static inline bool dsa_port_is_sja1105(struct dsa_port *dp) { - return false; + return true; } -#endif - #endif /* _NET_DSA_SJA1105_H */ |
