Commit 6f6770ab authored by Vladimir Oltean's avatar Vladimir Oltean Committed by David S. Miller

net: dsa: sja1105: remove hwts_tx_en from tagger data

This tagger property is in fact not used at all by the tagger, only by
the switch driver. Therefore it makes sense to be moved to
sja1105_private.
Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d38049bb
...@@ -249,6 +249,7 @@ struct sja1105_private { ...@@ -249,6 +249,7 @@ struct sja1105_private {
bool fixed_link[SJA1105_MAX_NUM_PORTS]; bool fixed_link[SJA1105_MAX_NUM_PORTS];
unsigned long ucast_egress_floods; unsigned long ucast_egress_floods;
unsigned long bcast_egress_floods; unsigned long bcast_egress_floods;
unsigned long hwts_tx_en;
const struct sja1105_info *info; const struct sja1105_info *info;
size_t max_xfer_len; size_t max_xfer_len;
struct spi_device *spidev; struct spi_device *spidev;
......
...@@ -98,10 +98,10 @@ int sja1105_hwtstamp_set(struct dsa_switch *ds, int port, struct ifreq *ifr) ...@@ -98,10 +98,10 @@ int sja1105_hwtstamp_set(struct dsa_switch *ds, int port, struct ifreq *ifr)
switch (config.tx_type) { switch (config.tx_type) {
case HWTSTAMP_TX_OFF: case HWTSTAMP_TX_OFF:
priv->ports[port].hwts_tx_en = false; priv->hwts_tx_en &= ~BIT(port);
break; break;
case HWTSTAMP_TX_ON: case HWTSTAMP_TX_ON:
priv->ports[port].hwts_tx_en = true; priv->hwts_tx_en |= BIT(port);
break; break;
default: default:
return -ERANGE; return -ERANGE;
...@@ -140,7 +140,7 @@ int sja1105_hwtstamp_get(struct dsa_switch *ds, int port, struct ifreq *ifr) ...@@ -140,7 +140,7 @@ int sja1105_hwtstamp_get(struct dsa_switch *ds, int port, struct ifreq *ifr)
struct hwtstamp_config config; struct hwtstamp_config config;
config.flags = 0; config.flags = 0;
if (priv->ports[port].hwts_tx_en) if (priv->hwts_tx_en & BIT(port))
config.tx_type = HWTSTAMP_TX_ON; config.tx_type = HWTSTAMP_TX_ON;
else else
config.tx_type = HWTSTAMP_TX_OFF; config.tx_type = HWTSTAMP_TX_OFF;
...@@ -486,10 +486,9 @@ void sja1110_txtstamp(struct dsa_switch *ds, int port, struct sk_buff *skb) ...@@ -486,10 +486,9 @@ void sja1110_txtstamp(struct dsa_switch *ds, int port, struct sk_buff *skb)
void sja1105_port_txtstamp(struct dsa_switch *ds, int port, struct sk_buff *skb) void sja1105_port_txtstamp(struct dsa_switch *ds, int port, struct sk_buff *skb)
{ {
struct sja1105_private *priv = ds->priv; struct sja1105_private *priv = ds->priv;
struct sja1105_port *sp = &priv->ports[port];
struct sk_buff *clone; struct sk_buff *clone;
if (!sp->hwts_tx_en) if (!(priv->hwts_tx_en & BIT(port)))
return; return;
clone = skb_clone_sk(skb); clone = skb_clone_sk(skb);
......
...@@ -74,7 +74,6 @@ struct sja1105_skb_cb { ...@@ -74,7 +74,6 @@ struct sja1105_skb_cb {
struct sja1105_port { struct sja1105_port {
struct sja1105_tagger_data *data; struct sja1105_tagger_data *data;
bool hwts_tx_en;
}; };
/* Timestamps are in units of 8 ns clock ticks (equivalent to /* Timestamps are in units of 8 ns clock ticks (equivalent to
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment