diff options
author | Vladimir Oltean <olteanv@gmail.com> | 2019-06-08 15:04:40 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-06-08 15:20:40 -0700 |
commit | 844d7edc6a34ae3a8236f1306e4f2615c8db1eac (patch) | |
tree | 5da175f1b127d764059a4d649f548d20805f1188 /include | |
parent | e53e18a6fe4d3ae04c28ca2327ef7e7656cb07ce (diff) |
net: dsa: sja1105: Add a global sja1105_tagger_data structure
This will be used to keep state for RX timestamping. It is global
because the switch serializes timestampable and meta frames when
trapping them towards the CPU port (lower port indices have higher
priority) and therefore having one state machine per port would create
unnecessary complications.
Signed-off-by: Vladimir Oltean <olteanv@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/dsa/sja1105.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/linux/dsa/sja1105.h b/include/linux/dsa/sja1105.h index cc4a909d1007..2c4fce4eaf0d 100644 --- a/include/linux/dsa/sja1105.h +++ b/include/linux/dsa/sja1105.h @@ -31,7 +31,22 @@ #define SJA1105_META_SMAC 0x222222222222ull #define SJA1105_META_DMAC 0x0180C200000Eull +/* Global tagger data: each struct sja1105_port has a reference to + * the structure defined in struct sja1105_private. + */ +struct sja1105_tagger_data { + struct sk_buff_head skb_rxtstamp_queue; + struct work_struct rxtstamp_work; + struct sk_buff *stampable_skb; + /* Protects concurrent access to the meta state machine + * from taggers running on multiple ports on SMP systems + */ + spinlock_t meta_lock; + bool hwts_rx_en; +}; + struct sja1105_port { + struct sja1105_tagger_data *data; struct dsa_port *dp; bool hwts_tx_en; int mgmt_slot; |