Skip to content
Snippets Groups Projects
Commit 06308753 authored by Shah, Nirint's avatar Shah, Nirint Committed by Kenneth Johansson
Browse files

Merge pull request #233 in SW_PON/linux from...

Merge pull request #233 in SW_PON/linux from bugfix/UGW_SW-21686-the-hw-checksum-offload-is-disabled-for-gx550 to xrx500

* commit '89ee28893562b5220cd2613fa85be10afb24c0f3':
  UGW_SW-21686: HW checksum enable for grx550 when TOE disable
parent 39d2408f
Branches
No related tags found
No related merge requests found
...@@ -119,6 +119,7 @@ static struct net_device *eth_dev[NUM_ETH_INF]; ...@@ -119,6 +119,7 @@ static struct net_device *eth_dev[NUM_ETH_INF];
static struct module g_ltq_eth_module[NUM_ETH_INF]; static struct module g_ltq_eth_module[NUM_ETH_INF];
static u32 g_rx_csum_offload; static u32 g_rx_csum_offload;
static u32 g_eth_switch_mode; static u32 g_eth_switch_mode;
static struct ltq_net_soc_data g_soc_data;
static const struct net_device_ops ltq_eth_drv_ops = { static const struct net_device_ops ltq_eth_drv_ops = {
.ndo_init = ltq_switch_init, .ndo_init = ltq_switch_init,
...@@ -1256,11 +1257,15 @@ static int xrx500_of_iface(struct xrx500_hw *hw, struct device_node *iface, ...@@ -1256,11 +1257,15 @@ static int xrx500_of_iface(struct xrx500_hw *hw, struct device_node *iface,
NETIF_F_HW_CSUM; NETIF_F_HW_CSUM;
hw->devs[hw->num_devs]->gso_max_size = GSO_MAX_SIZE; hw->devs[hw->num_devs]->gso_max_size = GSO_MAX_SIZE;
#else #else
/* temporary workaround for falcon mountain */
//hw->devs[hw->num_devs]->features = NETIF_F_SG | NETIF_F_HW_CSUM;
//hw->devs[hw->num_devs]->hw_features = NETIF_F_SG | NETIF_F_HW_CSUM;
hw->devs[hw->num_devs]->features = NETIF_F_SG; hw->devs[hw->num_devs]->features = NETIF_F_SG;
hw->devs[hw->num_devs]->hw_features = NETIF_F_SG; hw->devs[hw->num_devs]->hw_features = NETIF_F_SG;
if (g_soc_data.hw_checksum) {
hw->devs[hw->num_devs]->features |= NETIF_F_HW_CSUM;
hw->devs[hw->num_devs]->hw_features |= NETIF_F_HW_CSUM;
pr_debug("%s: hw csum offload is enabled!\n", __func__);
} else {
pr_debug("%s: hw csum offload is disable!\n", __func__);
}
#endif #endif
if (g_rx_csum_offload) { if (g_rx_csum_offload) {
...@@ -2100,6 +2105,7 @@ static int ltq_eth_drv_probe(struct platform_device *pdev) ...@@ -2100,6 +2105,7 @@ static int ltq_eth_drv_probe(struct platform_device *pdev)
if (soc_data->need_defer && !is_xway_gphy_fw_loaded()) if (soc_data->need_defer && !is_xway_gphy_fw_loaded())
return -EPROBE_DEFER; return -EPROBE_DEFER;
memcpy(&g_soc_data, soc_data, sizeof(*soc_data));
/* Just do the init */ /* Just do the init */
ltq_eth_drv_init(pdev); ltq_eth_drv_init(pdev);
register_netdevice_notifier(&netdevice_notifier); register_netdevice_notifier(&netdevice_notifier);
...@@ -2117,10 +2123,12 @@ static int ltq_eth_drv_remove(struct platform_device *pdev) ...@@ -2117,10 +2123,12 @@ static int ltq_eth_drv_remove(struct platform_device *pdev)
static const struct ltq_net_soc_data xrx500_net_data = { static const struct ltq_net_soc_data xrx500_net_data = {
.need_defer = true, .need_defer = true,
.hw_checksum = true,
}; };
static const struct ltq_net_soc_data falconmx_net_data = { static const struct ltq_net_soc_data falconmx_net_data = {
.need_defer = false, .need_defer = false,
.hw_checksum = false,
}; };
static const struct of_device_id ltq_eth_drv_match[] = { static const struct of_device_id ltq_eth_drv_match[] = {
......
...@@ -119,5 +119,6 @@ extern int g_xway_gphy_fw_loaded; ...@@ -119,5 +119,6 @@ extern int g_xway_gphy_fw_loaded;
struct ltq_net_soc_data { struct ltq_net_soc_data {
bool need_defer; bool need_defer;
bool hw_checksum;
}; };
#endif /* _LANTIQ_ETH_DRV_H_ */ #endif /* _LANTIQ_ETH_DRV_H_ */
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment