From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: davem@davemloft.net
Cc: "Akeem G. Abodunrin" <akeem.g.abodunrin@intel.com>,
netdev@vger.kernel.org, gospo@redhat.com, sassmann@redhat.com,
Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: [net-next 07/12] igb: SerDes flow control setting
Date: Tue, 21 May 2013 15:03:15 -0700 [thread overview]
Message-ID: <1369173800-20326-8-git-send-email-jeffrey.t.kirsher@intel.com> (raw)
In-Reply-To: <1369173800-20326-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: "Akeem G. Abodunrin" <akeem.g.abodunrin@intel.com>
This path allows users to get appropriate flow control setting on SerDes
devices, based on original implementation for Copper devices.
Also, since 100baseFX does not support setting flow control, so exclude
it from the setting mechanism.
Signed-off-by: Akeem G Abodunrin <akeem.g.abodunrin@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/igb/igb_ethtool.c | 34 ++++++++++++++++------------
1 file changed, 19 insertions(+), 15 deletions(-)
diff --git a/drivers/net/ethernet/intel/igb/igb_ethtool.c b/drivers/net/ethernet/intel/igb/igb_ethtool.c
index 4e54f84..7b25ee2 100644
--- a/drivers/net/ethernet/intel/igb/igb_ethtool.c
+++ b/drivers/net/ethernet/intel/igb/igb_ethtool.c
@@ -164,21 +164,6 @@ static int igb_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
ecmd->advertising |= hw->phy.autoneg_advertised;
}
- if (hw->mac.autoneg != 1)
- ecmd->advertising &= ~(ADVERTISED_Pause |
- ADVERTISED_Asym_Pause);
-
- if (hw->fc.requested_mode == e1000_fc_full)
- ecmd->advertising |= ADVERTISED_Pause;
- else if (hw->fc.requested_mode == e1000_fc_rx_pause)
- ecmd->advertising |= (ADVERTISED_Pause |
- ADVERTISED_Asym_Pause);
- else if (hw->fc.requested_mode == e1000_fc_tx_pause)
- ecmd->advertising |= ADVERTISED_Asym_Pause;
- else
- ecmd->advertising &= ~(ADVERTISED_Pause |
- ADVERTISED_Asym_Pause);
-
ecmd->port = PORT_TP;
ecmd->phy_address = hw->phy.addr;
ecmd->transceiver = XCVR_INTERNAL;
@@ -206,6 +191,21 @@ static int igb_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
ecmd->transceiver = XCVR_EXTERNAL;
}
+ if (hw->mac.autoneg != 1)
+ ecmd->advertising &= ~(ADVERTISED_Pause |
+ ADVERTISED_Asym_Pause);
+
+ if (hw->fc.requested_mode == e1000_fc_full)
+ ecmd->advertising |= ADVERTISED_Pause;
+ else if (hw->fc.requested_mode == e1000_fc_rx_pause)
+ ecmd->advertising |= (ADVERTISED_Pause |
+ ADVERTISED_Asym_Pause);
+ else if (hw->fc.requested_mode == e1000_fc_tx_pause)
+ ecmd->advertising |= ADVERTISED_Asym_Pause;
+ else
+ ecmd->advertising &= ~(ADVERTISED_Pause |
+ ADVERTISED_Asym_Pause);
+
status = rd32(E1000_STATUS);
if (status & E1000_STATUS_LU) {
@@ -386,6 +386,10 @@ static int igb_set_pauseparam(struct net_device *netdev,
struct e1000_hw *hw = &adapter->hw;
int retval = 0;
+ /* 100basefx does not support setting link flow control */
+ if (hw->dev_spec._82575.eth_flags.e100_base_fx)
+ return -EINVAL;
+
adapter->fc_autoneg = pause->autoneg;
while (test_and_set_bit(__IGB_RESETTING, &adapter->state))
--
1.7.11.7
next prev parent reply other threads:[~2013-05-21 22:03 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-21 22:03 [net-next 00/12][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
2013-05-21 22:03 ` [net-next 01/12] e1000e: cleanup whitespace Jeff Kirsher
2013-05-21 22:03 ` [net-next 02/12] e1000e: prevent warning from -Wunused-parameter Jeff Kirsher
2013-05-21 22:03 ` [net-next 03/12] e1000e: Release mutex lock only if it has been initially acquired Jeff Kirsher
2013-05-21 22:03 ` [net-next 04/12] igb: Changed LEDs blink mechanism to include designs using cathode Jeff Kirsher
2013-05-21 22:03 ` [net-next 05/12] igb: Add update to last_rx_timestamp in Rx rings Jeff Kirsher
2013-05-21 22:03 ` [net-next 06/12] igb: Support for SFP modules discovery Jeff Kirsher
2013-05-21 22:03 ` Jeff Kirsher [this message]
2013-05-21 22:03 ` [net-next 08/12] igb: Fix set_ethtool function to call update nvm for entire image Jeff Kirsher
2013-05-21 22:03 ` [net-next 09/12] igb: Fix possible panic caused by Rx traffic arrival while interface is down Jeff Kirsher
2013-05-21 22:03 ` [net-next 10/12] igb: Implementation of i210/i211 LED support Jeff Kirsher
2013-05-21 22:03 ` [net-next 11/12] igb: Removed unused i2c function Jeff Kirsher
2013-05-21 22:03 ` [net-next 12/12] IXGBE: Set the SW prio_tc values at initialization to the HW setting Jeff Kirsher
2013-05-22 20:57 ` [net-next 00/12][pull request] Intel Wired LAN Driver Updates David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1369173800-20326-8-git-send-email-jeffrey.t.kirsher@intel.com \
--to=jeffrey.t.kirsher@intel.com \
--cc=akeem.g.abodunrin@intel.com \
--cc=davem@davemloft.net \
--cc=gospo@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=sassmann@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).