summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/freescale/dpa
diff options
context:
space:
mode:
authorMadalin Bucur <madalin.bucur@freescale.com>2014-01-21 16:30:19 (GMT)
committerMadalin-Cristian Bucur <madalin.bucur@freescale.com>2014-02-06 17:12:53 (GMT)
commitbe6b5c9b3009cfffc84d84d08b82749d6aff54db (patch)
tree14f058e3de4997f70a73b2b50e43f87b5e760b4c /drivers/net/ethernet/freescale/dpa
parentfcb1e86c448a873768810be8487278ab9eaba04f (diff)
downloadlinux-fsl-qoriq-be6b5c9b3009cfffc84d84d08b82749d6aff54db.tar.xz
dpaa_eth: CONFIG_FSL_DPAA_1588 selects CONFIG_FSL_DPAA_TS
As there is a large common codebase between CONFIG_FSL_DPAA_1588 and CONFIG_FSL_DPAA_TS changed Kconfig to automatically select CONFIG_FSL_DPAA_TS when CONFIG_FSL_DPAA_1588 is selected. This simplifies the codebase and reduces the amount of changes in the code specific to CONFIG_FSL_DPAA_1588. Signed-off-by: Madalin Bucur <madalin.bucur@freescale.com> Change-Id: I28505dbc7fb291510b34050133d371c91cbe0128 Reviewed-on: http://git.am.freescale.net:8181/8560 Reviewed-by: Cristian-Constantin Sovaiala <Cristian.Sovaiala@freescale.com> (cherry picked from commit 8a5964eddea4133fa3c6a3750b7a5a2e458a253c) Reviewed-on: http://git.am.freescale.net:8181/8637
Diffstat (limited to 'drivers/net/ethernet/freescale/dpa')
-rw-r--r--drivers/net/ethernet/freescale/dpa/Kconfig15
-rw-r--r--drivers/net/ethernet/freescale/dpa/dpaa_eth_common.c13
-rw-r--r--drivers/net/ethernet/freescale/dpa/dpaa_eth_common.h4
-rw-r--r--drivers/net/ethernet/freescale/dpa/dpaa_eth_sg.c12
4 files changed, 19 insertions, 25 deletions
diff --git a/drivers/net/ethernet/freescale/dpa/Kconfig b/drivers/net/ethernet/freescale/dpa/Kconfig
index 2d4544e3..3d4347b 100644
--- a/drivers/net/ethernet/freescale/dpa/Kconfig
+++ b/drivers/net/ethernet/freescale/dpa/Kconfig
@@ -39,13 +39,6 @@ config FSL_DPAA_ETH_JUMBO_FRAME
significantly the driver's memory footprint and may even deplete
the system memory.
-config FSL_DPAA_1588
- tristate "IEEE 1588-compliant timestamping"
- depends on FSL_DPAA_ETH
- default n
- ---help---
- Enable IEEE1588 support code.
-
config FSL_DPAA_TS
tristate "Linux compliant timestamping"
depends on FSL_DPAA_ETH
@@ -53,6 +46,14 @@ config FSL_DPAA_TS
---help---
Enable Linux API compliant timestamping support.
+config FSL_DPAA_1588
+ tristate "IEEE 1588-compliant timestamping"
+ depends on FSL_DPAA_ETH
+ select FSL_DPAA_TS
+ default n
+ ---help---
+ Enable IEEE1588 support code.
+
config FSL_DPAA_ETH_USE_NDO_SELECT_QUEUE
bool "Use driver's Tx queue selection mechanism"
default y
diff --git a/drivers/net/ethernet/freescale/dpa/dpaa_eth_common.c b/drivers/net/ethernet/freescale/dpa/dpaa_eth_common.c
index e0f4ead..6994c5e 100644
--- a/drivers/net/ethernet/freescale/dpa/dpaa_eth_common.c
+++ b/drivers/net/ethernet/freescale/dpa/dpaa_eth_common.c
@@ -315,7 +315,7 @@ netdev_features_t dpa_fix_features(struct net_device *dev,
return features;
}
-#if defined(CONFIG_FSL_DPAA_1588) || defined(CONFIG_FSL_DPAA_TS)
+#ifdef CONFIG_FSL_DPAA_TS
u64 dpa_get_timestamp_ns(const struct dpa_priv_s *priv, enum port_type rx_tx,
const void *data)
{
@@ -332,8 +332,7 @@ u64 dpa_get_timestamp_ns(const struct dpa_priv_s *priv, enum port_type rx_tx,
return ns;
}
-#endif
-#ifdef CONFIG_FSL_DPAA_TS
+
int dpa_get_ts(const struct dpa_priv_s *priv, enum port_type rx_tx,
struct skb_shared_hwtstamps *shhwtstamps, const void *data)
{
@@ -454,8 +453,8 @@ int dpa_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
#endif
int ret = 0;
-/* at least one timestamping feature must be enabled to proceed */
-#if defined(CONFIG_FSL_DPAA_1588) || defined(CONFIG_FSL_DPAA_TS)
+ /* at least one timestamping feature must be enabled */
+#ifdef CONFIG_FSL_DPAA_TS
if (!netif_running(dev))
#endif
return -EINVAL;
@@ -653,7 +652,7 @@ void dpa_set_buffers_layout(struct mac_device *mac_dev,
layout[RX].priv_data_size = (uint16_t)DPA_RX_PRIV_DATA_SIZE;
layout[RX].parse_results = true;
layout[RX].hash_results = true;
-#if defined(CONFIG_FSL_DPAA_1588) || defined(CONFIG_FSL_DPAA_TS)
+#ifdef CONFIG_FSL_DPAA_TS
layout[RX].time_stamp = true;
#endif
fm_port_get_buff_layout_ext_params(mac_dev->port_dev[RX], &params);
@@ -667,7 +666,7 @@ void dpa_set_buffers_layout(struct mac_device *mac_dev,
layout[TX].priv_data_size = DPA_TX_PRIV_DATA_SIZE;
layout[TX].parse_results = true;
layout[TX].hash_results = true;
-#if defined(CONFIG_FSL_DPAA_1588) || defined(CONFIG_FSL_DPAA_TS)
+#ifdef CONFIG_FSL_DPAA_TS
layout[TX].time_stamp = true;
#endif
fm_port_get_buff_layout_ext_params(mac_dev->port_dev[TX], &params);
diff --git a/drivers/net/ethernet/freescale/dpa/dpaa_eth_common.h b/drivers/net/ethernet/freescale/dpa/dpaa_eth_common.h
index 1cf1b44..b7dc1af 100644
--- a/drivers/net/ethernet/freescale/dpa/dpaa_eth_common.h
+++ b/drivers/net/ethernet/freescale/dpa/dpaa_eth_common.h
@@ -150,11 +150,9 @@ int dpa_ndo_init(struct net_device *net_dev);
int dpa_set_features(struct net_device *dev, netdev_features_t features);
netdev_features_t dpa_fix_features(struct net_device *dev,
netdev_features_t features);
-#if defined(CONFIG_FSL_DPAA_1588) || defined(CONFIG_FSL_DPAA_TS)
+#ifdef CONFIG_FSL_DPAA_TS
u64 dpa_get_timestamp_ns(const struct dpa_priv_s *priv,
enum port_type rx_tx, const void *data);
-#endif
-#ifdef CONFIG_FSL_DPAA_TS
/* Updates the skb shared hw timestamp from the hardware timestamp */
int dpa_get_ts(const struct dpa_priv_s *priv, enum port_type rx_tx,
struct skb_shared_hwtstamps *shhwtstamps, const void *data);
diff --git a/drivers/net/ethernet/freescale/dpa/dpaa_eth_sg.c b/drivers/net/ethernet/freescale/dpa/dpaa_eth_sg.c
index 2859a09..9694f3e 100644
--- a/drivers/net/ethernet/freescale/dpa/dpaa_eth_sg.c
+++ b/drivers/net/ethernet/freescale/dpa/dpaa_eth_sg.c
@@ -274,7 +274,7 @@ struct sk_buff *_dpa_cleanup_tx_fd(const struct dpa_priv_s *priv,
/* Free the page frag that we allocated on Tx */
put_page(virt_to_head_page(sgt));
}
-#if defined(CONFIG_FSL_DPAA_1588) || defined(CONFIG_FSL_DPAA_TS)
+#ifdef CONFIG_FSL_DPAA_TS
else {
/* get the timestamp for non-SG frames */
#ifdef CONFIG_FSL_DPAA_1588
@@ -282,7 +282,6 @@ struct sk_buff *_dpa_cleanup_tx_fd(const struct dpa_priv_s *priv,
priv->tsu->hwts_tx_en_ioctl)
dpa_ptp_store_txstamp(priv, skb, (void *)skbh);
#endif
-#ifdef CONFIG_FSL_DPAA_TS
if (unlikely(priv->ts_tx_en &&
skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP)) {
struct skb_shared_hwtstamps shhwtstamps;
@@ -290,14 +289,13 @@ struct sk_buff *_dpa_cleanup_tx_fd(const struct dpa_priv_s *priv,
dpa_get_ts(priv, TX, &shhwtstamps, (void *)skbh);
skb_tstamp_tx(skb, &shhwtstamps);
}
-#endif
}
#endif
return skb;
}
-#if (!defined(CONFIG_FSL_DPAA_TS) && !defined(CONFIG_FSL_DPAA_1588))
+#ifndef CONFIG_FSL_DPAA_TS
static bool dpa_skb_is_recyclable(struct sk_buff *skb)
{
/* No recycling possible if skb buffer is kmalloc'ed */
@@ -345,8 +343,7 @@ static bool dpa_buf_is_recyclable(struct sk_buff *skb,
return false;
}
-#endif /* (!defined(CONFIG_FSL_DPAA_TS) && !defined(CONFIG_FSL_DPAA_1588)) */
-
+#endif
/* Build a linear skb around the received buffer.
* We are guaranteed there is enough room at the end of the data buffer to
@@ -626,8 +623,7 @@ static int __hot skb_to_contig_fd(struct dpa_priv_s *priv,
enum dma_data_direction dma_dir;
unsigned char *buffer_start;
-#if (!defined(CONFIG_FSL_DPAA_TS) && !defined(CONFIG_FSL_DPAA_1588))
-
+#ifndef CONFIG_FSL_DPAA_TS
/* Check recycling conditions; only if timestamp support is not
* enabled, otherwise we need the fd back on tx confirmation
*/