diff options
Diffstat (limited to 'drivers/net/ethernet/broadcom/tg3.c')
-rw-r--r-- | drivers/net/ethernet/broadcom/tg3.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c index 00c5be8c55b8..a9e068423ba0 100644 --- a/drivers/net/ethernet/broadcom/tg3.c +++ b/drivers/net/ethernet/broadcom/tg3.c | |||
@@ -13618,16 +13618,9 @@ static int tg3_hwtstamp_ioctl(struct net_device *dev, | |||
13618 | if (stmpconf.flags) | 13618 | if (stmpconf.flags) |
13619 | return -EINVAL; | 13619 | return -EINVAL; |
13620 | 13620 | ||
13621 | switch (stmpconf.tx_type) { | 13621 | if (stmpconf.tx_type != HWTSTAMP_TX_ON && |
13622 | case HWTSTAMP_TX_ON: | 13622 | stmpconf.tx_type != HWTSTAMP_TX_OFF) |
13623 | tg3_flag_set(tp, TX_TSTAMP_EN); | ||
13624 | break; | ||
13625 | case HWTSTAMP_TX_OFF: | ||
13626 | tg3_flag_clear(tp, TX_TSTAMP_EN); | ||
13627 | break; | ||
13628 | default: | ||
13629 | return -ERANGE; | 13623 | return -ERANGE; |
13630 | } | ||
13631 | 13624 | ||
13632 | switch (stmpconf.rx_filter) { | 13625 | switch (stmpconf.rx_filter) { |
13633 | case HWTSTAMP_FILTER_NONE: | 13626 | case HWTSTAMP_FILTER_NONE: |
@@ -13689,6 +13682,11 @@ static int tg3_hwtstamp_ioctl(struct net_device *dev, | |||
13689 | tw32(TG3_RX_PTP_CTL, | 13682 | tw32(TG3_RX_PTP_CTL, |
13690 | tp->rxptpctl | TG3_RX_PTP_CTL_HWTS_INTERLOCK); | 13683 | tp->rxptpctl | TG3_RX_PTP_CTL_HWTS_INTERLOCK); |
13691 | 13684 | ||
13685 | if (stmpconf.tx_type == HWTSTAMP_TX_ON) | ||
13686 | tg3_flag_set(tp, TX_TSTAMP_EN); | ||
13687 | else | ||
13688 | tg3_flag_clear(tp, TX_TSTAMP_EN); | ||
13689 | |||
13692 | return copy_to_user(ifr->ifr_data, &stmpconf, sizeof(stmpconf)) ? | 13690 | return copy_to_user(ifr->ifr_data, &stmpconf, sizeof(stmpconf)) ? |
13693 | -EFAULT : 0; | 13691 | -EFAULT : 0; |
13694 | } | 13692 | } |