|
@@ -435,16 +435,9 @@ static int stmmac_hwtstamp_ioctl(struct net_device *dev, struct ifreq *ifr)
|
|
|
if (config.flags)
|
|
|
return -EINVAL;
|
|
|
|
|
|
- switch (config.tx_type) {
|
|
|
- case HWTSTAMP_TX_OFF:
|
|
|
- priv->hwts_tx_en = 0;
|
|
|
- break;
|
|
|
- case HWTSTAMP_TX_ON:
|
|
|
- priv->hwts_tx_en = 1;
|
|
|
- break;
|
|
|
- default:
|
|
|
+ if (config.tx_type != HWTSTAMP_TX_OFF &&
|
|
|
+ config.tx_type != HWTSTAMP_TX_ON)
|
|
|
return -ERANGE;
|
|
|
- }
|
|
|
|
|
|
if (priv->adv_ts) {
|
|
|
switch (config.rx_filter) {
|
|
@@ -576,6 +569,7 @@ static int stmmac_hwtstamp_ioctl(struct net_device *dev, struct ifreq *ifr)
|
|
|
}
|
|
|
}
|
|
|
priv->hwts_rx_en = ((config.rx_filter == HWTSTAMP_FILTER_NONE) ? 0 : 1);
|
|
|
+ priv->hwts_tx_en = config.tx_type == HWTSTAMP_TX_ON;
|
|
|
|
|
|
if (!priv->hwts_tx_en && !priv->hwts_rx_en)
|
|
|
priv->hw->ptp->config_hw_tstamping(priv->ioaddr, 0);
|