nvethernet: use single API for ioctl

To reduce number of external OSI interface APIs,
consolidated all IOCTL API to one interface API.
OSD should use same for all interaction to OSI.

Bug 200671160

Change-Id: I2ada2746f29be6cf396709c2ec12dd96d4a5ca15
Signed-off-by: rakesh goyal <rgoyal@nvidia.com>
This commit is contained in:
rakesh goyal
2021-02-18 21:49:45 +05:30
committed by Revanth Kumar Uppala
parent d792dda9be
commit 1c87167250
6 changed files with 382 additions and 206 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018-2020, NVIDIA CORPORATION. All rights reserved.
* Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
@@ -470,6 +470,7 @@ static void ether_get_ethtool_stats(struct net_device *dev,
struct ether_priv_data *pdata = netdev_priv(dev);
struct osi_core_priv_data *osi_core = pdata->osi_core;
struct osi_dma_priv_data *osi_dma = pdata->osi_dma;
struct osi_ioctl ioctl_data = {};
int i, j = 0;
int ret;
@@ -479,7 +480,8 @@ static void ether_get_ethtool_stats(struct net_device *dev,
}
if (pdata->hw_feat.mmc_sel == 1U) {
ret = osi_read_mmc(osi_core);
ioctl_data.cmd = OSI_CMD_READ_MMC;
ret = osi_handle_ioctl(osi_core, &ioctl_data);
if (ret == -1) {
dev_err(pdata->dev, "Error in reading MMC counter\n");
return;
@@ -750,6 +752,7 @@ static int ether_set_pauseparam(struct net_device *ndev,
struct ethtool_pauseparam *pause)
{
struct ether_priv_data *pdata = netdev_priv(ndev);
struct osi_ioctl ioctl_data = {};
struct phy_device *phydev = pdata->phydev;
int curflow_ctrl = OSI_FLOW_CTRL_DISABLE;
int ret;
@@ -796,8 +799,13 @@ static int ether_set_pauseparam(struct net_device *ndev,
}
/* Configure current flow control settings */
ret = osi_configure_flow_control(pdata->osi_core,
pdata->osi_core->flow_ctrl);
ioctl_data.cmd = OSI_CMD_FLOW_CTRL;
ioctl_data.arg1_u32 = pdata->osi_core->flow_ctrl;
ret = osi_handle_ioctl(pdata->osi_core, &ioctl_data);
if (ret < 0) {
dev_err(pdata->dev, "Setting flow control failed\n");
return -EFAULT;
}
return ret;
}
@@ -1416,6 +1424,7 @@ static int ether_set_rxfh(struct net_device *ndev, const u32 *indir,
{
struct ether_priv_data *pdata = netdev_priv(ndev);
struct osi_core_priv_data *osi_core = pdata->osi_core;
struct osi_ioctl ioctl_data = {};
int i;
if (!netif_running(ndev)) {
@@ -1434,7 +1443,9 @@ static int ether_set_rxfh(struct net_device *ndev, const u32 *indir,
if (key)
memcpy(osi_core->rss.key, key, sizeof(osi_core->rss.key));
return osi_config_rss(osi_core);
ioctl_data.cmd = OSI_CMD_CONFIG_RSS;
return osi_handle_ioctl(pdata->osi_core, &ioctl_data);
}
/**