@@ -244,27 +244,14 @@ static void igc_ptp_enable_tstamp_all_rxqueues(struct igc_adapter *adapter,
244
244
* @adapter: networking device structure
245
245
* @config: hwtstamp configuration
246
246
*
247
- * Outgoing time stamping can be enabled and disabled. Play nice and
248
- * disable it when requested, although it shouldn't case any overhead
249
- * when no packet needs it. At most one packet in the queue may be
250
- * marked for time stamping, otherwise it would be impossible to tell
251
- * for sure to which packet the hardware time stamp belongs.
252
- *
253
- * Incoming time stamping has to be configured via the hardware
254
- * filters. Not all combinations are supported, in particular event
255
- * type has to be specified. Matching the kind of event packet is
256
- * not supported, with the exception of "all V2 events regardless of
257
- * level 2 or 4".
258
- *
247
+ * Return: 0 in case of success, negative errno code otherwise.
259
248
*/
260
249
static int igc_ptp_set_timestamp_mode (struct igc_adapter * adapter ,
261
250
struct hwtstamp_config * config )
262
251
{
263
252
u32 tsync_tx_ctl = IGC_TSYNCTXCTL_ENABLED ;
264
253
u32 tsync_rx_ctl = IGC_TSYNCRXCTL_ENABLED ;
265
254
struct igc_hw * hw = & adapter -> hw ;
266
- u32 tsync_rx_cfg = 0 ;
267
- bool is_l4 = false;
268
255
u32 regval ;
269
256
270
257
/* reserved for future extensions */
@@ -285,15 +272,7 @@ static int igc_ptp_set_timestamp_mode(struct igc_adapter *adapter,
285
272
tsync_rx_ctl = 0 ;
286
273
break ;
287
274
case HWTSTAMP_FILTER_PTP_V1_L4_SYNC :
288
- tsync_rx_ctl |= IGC_TSYNCRXCTL_TYPE_L4_V1 ;
289
- tsync_rx_cfg = IGC_TSYNCRXCFG_PTP_V1_SYNC_MESSAGE ;
290
- is_l4 = true;
291
- break ;
292
275
case HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ :
293
- tsync_rx_ctl |= IGC_TSYNCRXCTL_TYPE_L4_V1 ;
294
- tsync_rx_cfg = IGC_TSYNCRXCFG_PTP_V1_DELAY_REQ_MESSAGE ;
295
- is_l4 = true;
296
- break ;
297
276
case HWTSTAMP_FILTER_PTP_V2_EVENT :
298
277
case HWTSTAMP_FILTER_PTP_V2_L2_EVENT :
299
278
case HWTSTAMP_FILTER_PTP_V2_L4_EVENT :
@@ -303,32 +282,22 @@ static int igc_ptp_set_timestamp_mode(struct igc_adapter *adapter,
303
282
case HWTSTAMP_FILTER_PTP_V2_DELAY_REQ :
304
283
case HWTSTAMP_FILTER_PTP_V2_L2_DELAY_REQ :
305
284
case HWTSTAMP_FILTER_PTP_V2_L4_DELAY_REQ :
306
- tsync_rx_ctl |= IGC_TSYNCRXCTL_TYPE_EVENT_V2 ;
307
- config -> rx_filter = HWTSTAMP_FILTER_PTP_V2_EVENT ;
308
- is_l4 = true;
309
- break ;
310
285
case HWTSTAMP_FILTER_PTP_V1_L4_EVENT :
311
286
case HWTSTAMP_FILTER_NTP_ALL :
312
287
case HWTSTAMP_FILTER_ALL :
313
288
tsync_rx_ctl |= IGC_TSYNCRXCTL_TYPE_ALL ;
314
289
config -> rx_filter = HWTSTAMP_FILTER_ALL ;
315
290
break ;
316
- /* fall through */
317
291
default :
318
292
config -> rx_filter = HWTSTAMP_FILTER_NONE ;
319
293
return - ERANGE ;
320
294
}
321
295
322
- /* Per-packet timestamping only works if all packets are
323
- * timestamped, so enable timestamping in all packets as long
324
- * as one Rx filter was configured.
325
- */
326
296
if (tsync_rx_ctl ) {
327
297
tsync_rx_ctl = IGC_TSYNCRXCTL_ENABLED ;
328
298
tsync_rx_ctl |= IGC_TSYNCRXCTL_TYPE_ALL ;
329
299
tsync_rx_ctl |= IGC_TSYNCRXCTL_RXSYNSIG ;
330
300
config -> rx_filter = HWTSTAMP_FILTER_ALL ;
331
- is_l4 = true;
332
301
333
302
if (hw -> mac .type == igc_i225 ) {
334
303
regval = rd32 (IGC_RXPBS );
@@ -359,24 +328,6 @@ static int igc_ptp_set_timestamp_mode(struct igc_adapter *adapter,
359
328
regval |= tsync_rx_ctl ;
360
329
wr32 (IGC_TSYNCRXCTL , regval );
361
330
362
- /* define which PTP packets are time stamped */
363
- wr32 (IGC_TSYNCRXCFG , tsync_rx_cfg );
364
-
365
- /* L4 Queue Filter[3]: filter by destination port and protocol */
366
- if (is_l4 ) {
367
- u32 ftqf = (IPPROTO_UDP /* UDP */
368
- | IGC_FTQF_VF_BP /* VF not compared */
369
- | IGC_FTQF_1588_TIME_STAMP /* Enable Timestamp */
370
- | IGC_FTQF_MASK ); /* mask all inputs */
371
- ftqf &= ~IGC_FTQF_MASK_PROTO_BP ; /* enable protocol check */
372
-
373
- wr32 (IGC_IMIR (3 ), htons (PTP_EV_PORT ));
374
- wr32 (IGC_IMIREXT (3 ),
375
- (IGC_IMIREXT_SIZE_BP | IGC_IMIREXT_CTRL_BP ));
376
- wr32 (IGC_FTQF (3 ), ftqf );
377
- } else {
378
- wr32 (IGC_FTQF (3 ), IGC_FTQF_MASK );
379
- }
380
331
wrfl ();
381
332
382
333
/* clear TX time stamp registers, just to be sure */
0 commit comments