|
@@ -187,8 +187,6 @@ static void xgbe_get_strings(struct net_device *netdev, u32 stringset, u8 *data)
|
|
{
|
|
{
|
|
int i;
|
|
int i;
|
|
|
|
|
|
- DBGPR("-->%s\n", __func__);
|
|
|
|
-
|
|
|
|
switch (stringset) {
|
|
switch (stringset) {
|
|
case ETH_SS_STATS:
|
|
case ETH_SS_STATS:
|
|
for (i = 0; i < XGBE_STATS_COUNT; i++) {
|
|
for (i = 0; i < XGBE_STATS_COUNT; i++) {
|
|
@@ -198,8 +196,6 @@ static void xgbe_get_strings(struct net_device *netdev, u32 stringset, u8 *data)
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
-
|
|
|
|
- DBGPR("<--%s\n", __func__);
|
|
|
|
}
|
|
}
|
|
|
|
|
|
static void xgbe_get_ethtool_stats(struct net_device *netdev,
|
|
static void xgbe_get_ethtool_stats(struct net_device *netdev,
|
|
@@ -209,23 +205,17 @@ static void xgbe_get_ethtool_stats(struct net_device *netdev,
|
|
u8 *stat;
|
|
u8 *stat;
|
|
int i;
|
|
int i;
|
|
|
|
|
|
- DBGPR("-->%s\n", __func__);
|
|
|
|
-
|
|
|
|
pdata->hw_if.read_mmc_stats(pdata);
|
|
pdata->hw_if.read_mmc_stats(pdata);
|
|
for (i = 0; i < XGBE_STATS_COUNT; i++) {
|
|
for (i = 0; i < XGBE_STATS_COUNT; i++) {
|
|
stat = (u8 *)pdata + xgbe_gstring_stats[i].stat_offset;
|
|
stat = (u8 *)pdata + xgbe_gstring_stats[i].stat_offset;
|
|
*data++ = *(u64 *)stat;
|
|
*data++ = *(u64 *)stat;
|
|
}
|
|
}
|
|
-
|
|
|
|
- DBGPR("<--%s\n", __func__);
|
|
|
|
}
|
|
}
|
|
|
|
|
|
static int xgbe_get_sset_count(struct net_device *netdev, int stringset)
|
|
static int xgbe_get_sset_count(struct net_device *netdev, int stringset)
|
|
{
|
|
{
|
|
int ret;
|
|
int ret;
|
|
|
|
|
|
- DBGPR("-->%s\n", __func__);
|
|
|
|
-
|
|
|
|
switch (stringset) {
|
|
switch (stringset) {
|
|
case ETH_SS_STATS:
|
|
case ETH_SS_STATS:
|
|
ret = XGBE_STATS_COUNT;
|
|
ret = XGBE_STATS_COUNT;
|
|
@@ -235,8 +225,6 @@ static int xgbe_get_sset_count(struct net_device *netdev, int stringset)
|
|
ret = -EOPNOTSUPP;
|
|
ret = -EOPNOTSUPP;
|
|
}
|
|
}
|
|
|
|
|
|
- DBGPR("<--%s\n", __func__);
|
|
|
|
-
|
|
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -245,13 +233,9 @@ static void xgbe_get_pauseparam(struct net_device *netdev,
|
|
{
|
|
{
|
|
struct xgbe_prv_data *pdata = netdev_priv(netdev);
|
|
struct xgbe_prv_data *pdata = netdev_priv(netdev);
|
|
|
|
|
|
- DBGPR("-->xgbe_get_pauseparam\n");
|
|
|
|
-
|
|
|
|
pause->autoneg = pdata->phy.pause_autoneg;
|
|
pause->autoneg = pdata->phy.pause_autoneg;
|
|
pause->tx_pause = pdata->phy.tx_pause;
|
|
pause->tx_pause = pdata->phy.tx_pause;
|
|
pause->rx_pause = pdata->phy.rx_pause;
|
|
pause->rx_pause = pdata->phy.rx_pause;
|
|
-
|
|
|
|
- DBGPR("<--xgbe_get_pauseparam\n");
|
|
|
|
}
|
|
}
|
|
|
|
|
|
static int xgbe_set_pauseparam(struct net_device *netdev,
|
|
static int xgbe_set_pauseparam(struct net_device *netdev,
|
|
@@ -260,13 +244,11 @@ static int xgbe_set_pauseparam(struct net_device *netdev,
|
|
struct xgbe_prv_data *pdata = netdev_priv(netdev);
|
|
struct xgbe_prv_data *pdata = netdev_priv(netdev);
|
|
int ret = 0;
|
|
int ret = 0;
|
|
|
|
|
|
- DBGPR("-->xgbe_set_pauseparam\n");
|
|
|
|
-
|
|
|
|
- DBGPR(" autoneg = %d, tx_pause = %d, rx_pause = %d\n",
|
|
|
|
- pause->autoneg, pause->tx_pause, pause->rx_pause);
|
|
|
|
-
|
|
|
|
- if (pause->autoneg && (pdata->phy.autoneg != AUTONEG_ENABLE))
|
|
|
|
|
|
+ if (pause->autoneg && (pdata->phy.autoneg != AUTONEG_ENABLE)) {
|
|
|
|
+ netdev_err(netdev,
|
|
|
|
+ "autoneg disabled, pause autoneg not avialable\n");
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
|
|
+ }
|
|
|
|
|
|
pdata->phy.pause_autoneg = pause->autoneg;
|
|
pdata->phy.pause_autoneg = pause->autoneg;
|
|
pdata->phy.tx_pause = pause->tx_pause;
|
|
pdata->phy.tx_pause = pause->tx_pause;
|
|
@@ -286,8 +268,6 @@ static int xgbe_set_pauseparam(struct net_device *netdev,
|
|
if (netif_running(netdev))
|
|
if (netif_running(netdev))
|
|
ret = pdata->phy_if.phy_config_aneg(pdata);
|
|
ret = pdata->phy_if.phy_config_aneg(pdata);
|
|
|
|
|
|
- DBGPR("<--xgbe_set_pauseparam\n");
|
|
|
|
-
|
|
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -296,8 +276,6 @@ static int xgbe_get_settings(struct net_device *netdev,
|
|
{
|
|
{
|
|
struct xgbe_prv_data *pdata = netdev_priv(netdev);
|
|
struct xgbe_prv_data *pdata = netdev_priv(netdev);
|
|
|
|
|
|
- DBGPR("-->xgbe_get_settings\n");
|
|
|
|
-
|
|
|
|
cmd->phy_address = pdata->phy.address;
|
|
cmd->phy_address = pdata->phy.address;
|
|
|
|
|
|
cmd->supported = pdata->phy.supported;
|
|
cmd->supported = pdata->phy.supported;
|
|
@@ -311,8 +289,6 @@ static int xgbe_get_settings(struct net_device *netdev,
|
|
cmd->port = PORT_NONE;
|
|
cmd->port = PORT_NONE;
|
|
cmd->transceiver = XCVR_INTERNAL;
|
|
cmd->transceiver = XCVR_INTERNAL;
|
|
|
|
|
|
- DBGPR("<--xgbe_get_settings\n");
|
|
|
|
-
|
|
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -323,16 +299,20 @@ static int xgbe_set_settings(struct net_device *netdev,
|
|
u32 speed;
|
|
u32 speed;
|
|
int ret;
|
|
int ret;
|
|
|
|
|
|
- DBGPR("-->xgbe_set_settings\n");
|
|
|
|
-
|
|
|
|
speed = ethtool_cmd_speed(cmd);
|
|
speed = ethtool_cmd_speed(cmd);
|
|
|
|
|
|
- if (cmd->phy_address != pdata->phy.address)
|
|
|
|
|
|
+ if (cmd->phy_address != pdata->phy.address) {
|
|
|
|
+ netdev_err(netdev, "invalid phy address %hhu\n",
|
|
|
|
+ cmd->phy_address);
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
|
|
+ }
|
|
|
|
|
|
if ((cmd->autoneg != AUTONEG_ENABLE) &&
|
|
if ((cmd->autoneg != AUTONEG_ENABLE) &&
|
|
- (cmd->autoneg != AUTONEG_DISABLE))
|
|
|
|
|
|
+ (cmd->autoneg != AUTONEG_DISABLE)) {
|
|
|
|
+ netdev_err(netdev, "unsupported autoneg %hhu\n",
|
|
|
|
+ cmd->autoneg);
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
|
|
+ }
|
|
|
|
|
|
if (cmd->autoneg == AUTONEG_DISABLE) {
|
|
if (cmd->autoneg == AUTONEG_DISABLE) {
|
|
switch (speed) {
|
|
switch (speed) {
|
|
@@ -341,16 +321,27 @@ static int xgbe_set_settings(struct net_device *netdev,
|
|
case SPEED_1000:
|
|
case SPEED_1000:
|
|
break;
|
|
break;
|
|
default:
|
|
default:
|
|
|
|
+ netdev_err(netdev, "unsupported speed %u\n", speed);
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
}
|
|
}
|
|
|
|
|
|
- if (cmd->duplex != DUPLEX_FULL)
|
|
|
|
|
|
+ if (cmd->duplex != DUPLEX_FULL) {
|
|
|
|
+ netdev_err(netdev, "unsupported duplex %hhu\n",
|
|
|
|
+ cmd->duplex);
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ netif_dbg(pdata, link, netdev,
|
|
|
|
+ "requested advertisement %#x, phy supported %#x\n",
|
|
|
|
+ cmd->advertising, pdata->phy.supported);
|
|
|
|
+
|
|
cmd->advertising &= pdata->phy.supported;
|
|
cmd->advertising &= pdata->phy.supported;
|
|
- if ((cmd->autoneg == AUTONEG_ENABLE) && !cmd->advertising)
|
|
|
|
|
|
+ if ((cmd->autoneg == AUTONEG_ENABLE) && !cmd->advertising) {
|
|
|
|
+ netdev_err(netdev,
|
|
|
|
+ "unsupported requested advertisement\n");
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
|
|
+ }
|
|
|
|
|
|
ret = 0;
|
|
ret = 0;
|
|
pdata->phy.autoneg = cmd->autoneg;
|
|
pdata->phy.autoneg = cmd->autoneg;
|
|
@@ -366,8 +357,6 @@ static int xgbe_set_settings(struct net_device *netdev,
|
|
if (netif_running(netdev))
|
|
if (netif_running(netdev))
|
|
ret = pdata->phy_if.phy_config_aneg(pdata);
|
|
ret = pdata->phy_if.phy_config_aneg(pdata);
|
|
|
|
|
|
- DBGPR("<--xgbe_set_settings\n");
|
|
|
|
-
|
|
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -407,8 +396,6 @@ static int xgbe_get_coalesce(struct net_device *netdev,
|
|
{
|
|
{
|
|
struct xgbe_prv_data *pdata = netdev_priv(netdev);
|
|
struct xgbe_prv_data *pdata = netdev_priv(netdev);
|
|
|
|
|
|
- DBGPR("-->xgbe_get_coalesce\n");
|
|
|
|
-
|
|
|
|
memset(ec, 0, sizeof(struct ethtool_coalesce));
|
|
memset(ec, 0, sizeof(struct ethtool_coalesce));
|
|
|
|
|
|
ec->rx_coalesce_usecs = pdata->rx_usecs;
|
|
ec->rx_coalesce_usecs = pdata->rx_usecs;
|
|
@@ -416,8 +403,6 @@ static int xgbe_get_coalesce(struct net_device *netdev,
|
|
|
|
|
|
ec->tx_max_coalesced_frames = pdata->tx_frames;
|
|
ec->tx_max_coalesced_frames = pdata->tx_frames;
|
|
|
|
|
|
- DBGPR("<--xgbe_get_coalesce\n");
|
|
|
|
-
|
|
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -429,8 +414,6 @@ static int xgbe_set_coalesce(struct net_device *netdev,
|
|
unsigned int rx_frames, rx_riwt, rx_usecs;
|
|
unsigned int rx_frames, rx_riwt, rx_usecs;
|
|
unsigned int tx_frames;
|
|
unsigned int tx_frames;
|
|
|
|
|
|
- DBGPR("-->xgbe_set_coalesce\n");
|
|
|
|
-
|
|
|
|
/* Check for not supported parameters */
|
|
/* Check for not supported parameters */
|
|
if ((ec->rx_coalesce_usecs_irq) ||
|
|
if ((ec->rx_coalesce_usecs_irq) ||
|
|
(ec->rx_max_coalesced_frames_irq) ||
|
|
(ec->rx_max_coalesced_frames_irq) ||
|
|
@@ -450,8 +433,10 @@ static int xgbe_set_coalesce(struct net_device *netdev,
|
|
(ec->rx_max_coalesced_frames_high) ||
|
|
(ec->rx_max_coalesced_frames_high) ||
|
|
(ec->tx_coalesce_usecs_high) ||
|
|
(ec->tx_coalesce_usecs_high) ||
|
|
(ec->tx_max_coalesced_frames_high) ||
|
|
(ec->tx_max_coalesced_frames_high) ||
|
|
- (ec->rate_sample_interval))
|
|
|
|
|
|
+ (ec->rate_sample_interval)) {
|
|
|
|
+ netdev_err(netdev, "unsupported coalescing parameter\n");
|
|
return -EOPNOTSUPP;
|
|
return -EOPNOTSUPP;
|
|
|
|
+ }
|
|
|
|
|
|
rx_riwt = hw_if->usec_to_riwt(pdata, ec->rx_coalesce_usecs);
|
|
rx_riwt = hw_if->usec_to_riwt(pdata, ec->rx_coalesce_usecs);
|
|
rx_usecs = ec->rx_coalesce_usecs;
|
|
rx_usecs = ec->rx_coalesce_usecs;
|
|
@@ -463,13 +448,13 @@ static int xgbe_set_coalesce(struct net_device *netdev,
|
|
|
|
|
|
/* Check the bounds of values for Rx */
|
|
/* Check the bounds of values for Rx */
|
|
if (rx_riwt > XGMAC_MAX_DMA_RIWT) {
|
|
if (rx_riwt > XGMAC_MAX_DMA_RIWT) {
|
|
- netdev_alert(netdev, "rx-usec is limited to %d usecs\n",
|
|
|
|
- hw_if->riwt_to_usec(pdata, XGMAC_MAX_DMA_RIWT));
|
|
|
|
|
|
+ netdev_err(netdev, "rx-usec is limited to %d usecs\n",
|
|
|
|
+ hw_if->riwt_to_usec(pdata, XGMAC_MAX_DMA_RIWT));
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
}
|
|
}
|
|
if (rx_frames > pdata->rx_desc_count) {
|
|
if (rx_frames > pdata->rx_desc_count) {
|
|
- netdev_alert(netdev, "rx-frames is limited to %d frames\n",
|
|
|
|
- pdata->rx_desc_count);
|
|
|
|
|
|
+ netdev_err(netdev, "rx-frames is limited to %d frames\n",
|
|
|
|
+ pdata->rx_desc_count);
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -477,8 +462,8 @@ static int xgbe_set_coalesce(struct net_device *netdev,
|
|
|
|
|
|
/* Check the bounds of values for Tx */
|
|
/* Check the bounds of values for Tx */
|
|
if (tx_frames > pdata->tx_desc_count) {
|
|
if (tx_frames > pdata->tx_desc_count) {
|
|
- netdev_alert(netdev, "tx-frames is limited to %d frames\n",
|
|
|
|
- pdata->tx_desc_count);
|
|
|
|
|
|
+ netdev_err(netdev, "tx-frames is limited to %d frames\n",
|
|
|
|
+ pdata->tx_desc_count);
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -490,8 +475,6 @@ static int xgbe_set_coalesce(struct net_device *netdev,
|
|
pdata->tx_frames = tx_frames;
|
|
pdata->tx_frames = tx_frames;
|
|
hw_if->config_tx_coalesce(pdata);
|
|
hw_if->config_tx_coalesce(pdata);
|
|
|
|
|
|
- DBGPR("<--xgbe_set_coalesce\n");
|
|
|
|
-
|
|
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -553,8 +536,10 @@ static int xgbe_set_rxfh(struct net_device *netdev, const u32 *indir,
|
|
struct xgbe_hw_if *hw_if = &pdata->hw_if;
|
|
struct xgbe_hw_if *hw_if = &pdata->hw_if;
|
|
unsigned int ret;
|
|
unsigned int ret;
|
|
|
|
|
|
- if (hfunc != ETH_RSS_HASH_NO_CHANGE && hfunc != ETH_RSS_HASH_TOP)
|
|
|
|
|
|
+ if (hfunc != ETH_RSS_HASH_NO_CHANGE && hfunc != ETH_RSS_HASH_TOP) {
|
|
|
|
+ netdev_err(netdev, "unsupported hash function\n");
|
|
return -EOPNOTSUPP;
|
|
return -EOPNOTSUPP;
|
|
|
|
+ }
|
|
|
|
|
|
if (indir) {
|
|
if (indir) {
|
|
ret = hw_if->set_rss_lookup_table(pdata, indir);
|
|
ret = hw_if->set_rss_lookup_table(pdata, indir);
|