1
1
// SPDX-License-Identifier: GPL-2.0-only
2
- /*
3
- * aQuantia Corporation Network Driver
4
- * Copyright (C) 2014-2019 aQuantia Corporation. All rights reserved
2
+ /* Atlantic Network Driver
3
+ *
4
+ * Copyright (C) 2014-2019 aQuantia Corporation
5
+ * Copyright (C) 2019-2020 Marvell International Ltd.
5
6
*/
6
7
7
8
/* File aq_main.c: Main file for aQuantia Linux driver. */
@@ -98,6 +99,7 @@ static int aq_ndev_start_xmit(struct sk_buff *skb, struct net_device *ndev)
98
99
{
99
100
struct aq_nic_s * aq_nic = netdev_priv (ndev );
100
101
102
+ #if IS_REACHABLE (CONFIG_PTP_1588_CLOCK )
101
103
if (unlikely (aq_utils_obj_test (& aq_nic -> flags , AQ_NIC_PTP_DPATH_UP ))) {
102
104
/* Hardware adds the Timestamp for PTPv2 802.AS1
103
105
* and PTPv2 IPv4 UDP.
@@ -114,6 +116,7 @@ static int aq_ndev_start_xmit(struct sk_buff *skb, struct net_device *ndev)
114
116
unlikely (eth_hdr (skb )-> h_proto == htons (ETH_P_1588 )))
115
117
return aq_ptp_xmit (aq_nic , skb );
116
118
}
119
+ #endif
117
120
118
121
skb_tx_timestamp (skb );
119
122
return aq_nic_xmit (aq_nic , skb );
@@ -222,6 +225,7 @@ static void aq_ndev_set_multicast_settings(struct net_device *ndev)
222
225
(void )aq_nic_set_multicast_list (aq_nic , ndev );
223
226
}
224
227
228
+ #if IS_REACHABLE (CONFIG_PTP_1588_CLOCK )
225
229
static int aq_ndev_config_hwtstamp (struct aq_nic_s * aq_nic ,
226
230
struct hwtstamp_config * config )
227
231
{
@@ -256,26 +260,31 @@ static int aq_ndev_config_hwtstamp(struct aq_nic_s *aq_nic,
256
260
257
261
return aq_ptp_hwtstamp_config_set (aq_nic -> aq_ptp , config );
258
262
}
263
+ #endif
259
264
260
265
static int aq_ndev_hwtstamp_set (struct aq_nic_s * aq_nic , struct ifreq * ifr )
261
266
{
262
267
struct hwtstamp_config config ;
268
+ #if IS_REACHABLE (CONFIG_PTP_1588_CLOCK )
263
269
int ret_val ;
270
+ #endif
264
271
265
272
if (!aq_nic -> aq_ptp )
266
273
return - EOPNOTSUPP ;
267
274
268
275
if (copy_from_user (& config , ifr -> ifr_data , sizeof (config )))
269
276
return - EFAULT ;
270
-
277
+ #if IS_REACHABLE ( CONFIG_PTP_1588_CLOCK )
271
278
ret_val = aq_ndev_config_hwtstamp (aq_nic , & config );
272
279
if (ret_val )
273
280
return ret_val ;
281
+ #endif
274
282
275
283
return copy_to_user (ifr -> ifr_data , & config , sizeof (config )) ?
276
284
- EFAULT : 0 ;
277
285
}
278
286
287
+ #if IS_REACHABLE (CONFIG_PTP_1588_CLOCK )
279
288
static int aq_ndev_hwtstamp_get (struct aq_nic_s * aq_nic , struct ifreq * ifr )
280
289
{
281
290
struct hwtstamp_config config ;
@@ -287,6 +296,7 @@ static int aq_ndev_hwtstamp_get(struct aq_nic_s *aq_nic, struct ifreq *ifr)
287
296
return copy_to_user (ifr -> ifr_data , & config , sizeof (config )) ?
288
297
- EFAULT : 0 ;
289
298
}
299
+ #endif
290
300
291
301
static int aq_ndev_ioctl (struct net_device * netdev , struct ifreq * ifr , int cmd )
292
302
{
@@ -296,8 +306,10 @@ static int aq_ndev_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
296
306
case SIOCSHWTSTAMP :
297
307
return aq_ndev_hwtstamp_set (aq_nic , ifr );
298
308
309
+ #if IS_REACHABLE (CONFIG_PTP_1588_CLOCK )
299
310
case SIOCGHWTSTAMP :
300
311
return aq_ndev_hwtstamp_get (aq_nic , ifr );
312
+ #endif
301
313
}
302
314
303
315
return - EOPNOTSUPP ;
0 commit comments