* [net-next 00/11][pull request] Intel Wired LAN Driver Updates
@ 2012-02-25 5:49 Jeff Kirsher
2012-02-25 5:49 ` [net-next 01/11] e1000e: cleanup: rename e1000e_id_led_init() and call as function pointer Jeff Kirsher
` (11 more replies)
0 siblings, 12 replies; 14+ messages in thread
From: Jeff Kirsher @ 2012-02-25 5:49 UTC (permalink / raw)
To: davem; +Cc: Jeff Kirsher, netdev, gospo, sassmann
This series of patches contains cleanups of the e1000e driver.
The following are changes since commit 5d74f1757001f5b9a7739c2a9053435e16ce516b:
Staging: wlags49_h2: print MAC via printk format specifier
and are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-next master
Bruce Allan (11):
e1000e: cleanup: rename e1000e_id_led_init() and call as function
pointer
e1000e: cleanup: rename e1000e_setup_link() and call as function
pointer
e1000e: cleanup use of check_mng_mode function pointer
e1000e: cleanup use of check_reset_block function pointer
e1000e: cleanup calls to setup_physical_interface function pointer
e1000e: comment correction in
e1000e_set_kmrn_lock_loss_workaround_ich8lan
e1000e: rename e1000e_config_collision_dist() and call as function
pointer
e1000e: cleanup comment in e1000_hash_mc_addr()
e1000e: use true/false for boolean send_xon, do not assume always
true
e1000e: cleanup - remove unnecessary variable
e1000e: rename e1000e_reload_nvm() and call as function pointer
drivers/net/ethernet/intel/e1000e/80003es2lan.c | 12 +++++---
drivers/net/ethernet/intel/e1000e/82571.c | 10 ++++---
drivers/net/ethernet/intel/e1000e/e1000.h | 18 +++----------
drivers/net/ethernet/intel/e1000e/ethtool.c | 6 +++-
drivers/net/ethernet/intel/e1000e/hw.h | 2 +
drivers/net/ethernet/intel/e1000e/ich8lan.c | 32 ++++++++++++----------
drivers/net/ethernet/intel/e1000e/mac.c | 31 ++++++++++-----------
drivers/net/ethernet/intel/e1000e/manage.c | 4 +-
drivers/net/ethernet/intel/e1000e/netdev.c | 8 +++---
drivers/net/ethernet/intel/e1000e/nvm.c | 4 +-
drivers/net/ethernet/intel/e1000e/phy.c | 6 ++--
11 files changed, 66 insertions(+), 67 deletions(-)
--
1.7.7.6
^ permalink raw reply [flat|nested] 14+ messages in thread
* [net-next 01/11] e1000e: cleanup: rename e1000e_id_led_init() and call as function pointer
2012-02-25 5:49 [net-next 00/11][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
@ 2012-02-25 5:49 ` Jeff Kirsher
2012-02-25 5:49 ` [net-next 02/11] e1000e: cleanup: rename e1000e_setup_link() " Jeff Kirsher
` (10 subsequent siblings)
11 siblings, 0 replies; 14+ messages in thread
From: Jeff Kirsher @ 2012-02-25 5:49 UTC (permalink / raw)
To: davem; +Cc: Bruce Allan, netdev, gospo, sassmann, Jeff Kirsher
From: Bruce Allan <bruce.w.allan@intel.com>
Rename e1000e_id_led_init() to e1000e_id_led_init_generic() to signify the
function is used for more than one MAC-family type. For the ich8lan MAC
family, some MACs use the generic function and others use the function
e1000_id_led_init_pchlan(). In all cases where e1000e_id_led_init() was
called directly, change to call the function pointer to be consistent with
the driver design.
Signed-off-by: Bruce Allan <bruce.w.allan@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/e1000e/80003es2lan.c | 4 ++--
drivers/net/ethernet/intel/e1000e/82571.c | 4 ++--
drivers/net/ethernet/intel/e1000e/e1000.h | 2 +-
drivers/net/ethernet/intel/e1000e/ich8lan.c | 5 ++---
drivers/net/ethernet/intel/e1000e/mac.c | 4 ++--
5 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/drivers/net/ethernet/intel/e1000e/80003es2lan.c b/drivers/net/ethernet/intel/e1000e/80003es2lan.c
index 1f8f852..c146484 100644
--- a/drivers/net/ethernet/intel/e1000e/80003es2lan.c
+++ b/drivers/net/ethernet/intel/e1000e/80003es2lan.c
@@ -820,7 +820,7 @@ static s32 e1000_init_hw_80003es2lan(struct e1000_hw *hw)
e1000_initialize_hw_bits_80003es2lan(hw);
/* Initialize identification LED */
- ret_val = e1000e_id_led_init(hw);
+ ret_val = mac->ops.id_led_init(hw);
if (ret_val)
e_dbg("Error initializing identification LED\n");
/* This is not fatal and we should not stop init due to this */
@@ -1413,7 +1413,7 @@ static void e1000_clear_hw_cntrs_80003es2lan(struct e1000_hw *hw)
static const struct e1000_mac_operations es2_mac_ops = {
.read_mac_addr = e1000_read_mac_addr_80003es2lan,
- .id_led_init = e1000e_id_led_init,
+ .id_led_init = e1000e_id_led_init_generic,
.blink_led = e1000e_blink_led_generic,
.check_mng_mode = e1000e_check_mng_mode_generic,
/* check_for_link dependent on media type */
diff --git a/drivers/net/ethernet/intel/e1000e/82571.c b/drivers/net/ethernet/intel/e1000e/82571.c
index b6b7bc4..2ca6377 100644
--- a/drivers/net/ethernet/intel/e1000e/82571.c
+++ b/drivers/net/ethernet/intel/e1000e/82571.c
@@ -1118,7 +1118,7 @@ static s32 e1000_init_hw_82571(struct e1000_hw *hw)
e1000_initialize_hw_bits_82571(hw);
/* Initialize identification LED */
- ret_val = e1000e_id_led_init(hw);
+ ret_val = mac->ops.id_led_init(hw);
if (ret_val)
e_dbg("Error initializing identification LED\n");
/* This is not fatal and we should not stop init due to this */
@@ -1911,7 +1911,7 @@ static void e1000_clear_hw_cntrs_82571(struct e1000_hw *hw)
static const struct e1000_mac_operations e82571_mac_ops = {
/* .check_mng_mode: mac type dependent */
/* .check_for_link: media type dependent */
- .id_led_init = e1000e_id_led_init,
+ .id_led_init = e1000e_id_led_init_generic,
.cleanup_led = e1000e_cleanup_led_generic,
.clear_hw_cntrs = e1000_clear_hw_cntrs_82571,
.get_bus_info = e1000e_get_bus_info_pcie,
diff --git a/drivers/net/ethernet/intel/e1000e/e1000.h b/drivers/net/ethernet/intel/e1000e/e1000.h
index 04a21fc..2a0d658 100644
--- a/drivers/net/ethernet/intel/e1000e/e1000.h
+++ b/drivers/net/ethernet/intel/e1000e/e1000.h
@@ -559,7 +559,7 @@ extern s32 e1000e_get_speed_and_duplex_copper(struct e1000_hw *hw, u16 *speed, u
extern s32 e1000e_get_speed_and_duplex_fiber_serdes(struct e1000_hw *hw, u16 *speed, u16 *duplex);
extern s32 e1000e_disable_pcie_master(struct e1000_hw *hw);
extern s32 e1000e_get_auto_rd_done(struct e1000_hw *hw);
-extern s32 e1000e_id_led_init(struct e1000_hw *hw);
+extern s32 e1000e_id_led_init_generic(struct e1000_hw *hw);
extern void e1000e_clear_hw_cntrs_base(struct e1000_hw *hw);
extern s32 e1000e_setup_fiber_serdes_link(struct e1000_hw *hw);
extern s32 e1000e_copper_link_setup_m88(struct e1000_hw *hw);
diff --git a/drivers/net/ethernet/intel/e1000e/ich8lan.c b/drivers/net/ethernet/intel/e1000e/ich8lan.c
index f3282dc..7d3a7fb 100644
--- a/drivers/net/ethernet/intel/e1000e/ich8lan.c
+++ b/drivers/net/ethernet/intel/e1000e/ich8lan.c
@@ -580,7 +580,7 @@ static s32 e1000_init_mac_params_ich8lan(struct e1000_hw *hw)
/* check management mode */
mac->ops.check_mng_mode = e1000_check_mng_mode_ich8lan;
/* ID LED init */
- mac->ops.id_led_init = e1000e_id_led_init;
+ mac->ops.id_led_init = e1000e_id_led_init_generic;
/* blink LED */
mac->ops.blink_led = e1000e_blink_led_generic;
/* setup LED */
@@ -2962,7 +2962,7 @@ static s32 e1000_valid_led_default_ich8lan(struct e1000_hw *hw, u16 *data)
*
* PCH also does not have an "always on" or "always off" mode which
* complicates the ID feature. Instead of using the "on" mode to indicate
- * in ledctl_mode2 the LEDs to use for ID (see e1000e_id_led_init()),
+ * in ledctl_mode2 the LEDs to use for ID (see e1000e_id_led_init_generic()),
* use "link_up" mode. The LEDs will still ID on request if there is no
* link based on logic in e1000_led_[on|off]_pchlan().
**/
@@ -4006,7 +4006,6 @@ release:
}
static const struct e1000_mac_operations ich8_mac_ops = {
- .id_led_init = e1000e_id_led_init,
/* check_mng_mode dependent on mac type */
.check_for_link = e1000_check_for_copper_link_ich8lan,
/* cleanup_led dependent on mac type */
diff --git a/drivers/net/ethernet/intel/e1000e/mac.c b/drivers/net/ethernet/intel/e1000e/mac.c
index 17991e6..aaf4a4d 100644
--- a/drivers/net/ethernet/intel/e1000e/mac.c
+++ b/drivers/net/ethernet/intel/e1000e/mac.c
@@ -1399,11 +1399,11 @@ s32 e1000e_valid_led_default(struct e1000_hw *hw, u16 *data)
}
/**
- * e1000e_id_led_init -
+ * e1000e_id_led_init_generic -
* @hw: pointer to the HW structure
*
**/
-s32 e1000e_id_led_init(struct e1000_hw *hw)
+s32 e1000e_id_led_init_generic(struct e1000_hw *hw)
{
struct e1000_mac_info *mac = &hw->mac;
s32 ret_val;
--
1.7.7.6
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [net-next 02/11] e1000e: cleanup: rename e1000e_setup_link() and call as function pointer
2012-02-25 5:49 [net-next 00/11][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
2012-02-25 5:49 ` [net-next 01/11] e1000e: cleanup: rename e1000e_id_led_init() and call as function pointer Jeff Kirsher
@ 2012-02-25 5:49 ` Jeff Kirsher
2012-02-27 10:25 ` David Laight
2012-02-25 5:49 ` [net-next 03/11] e1000e: cleanup use of check_mng_mode " Jeff Kirsher
` (9 subsequent siblings)
11 siblings, 1 reply; 14+ messages in thread
From: Jeff Kirsher @ 2012-02-25 5:49 UTC (permalink / raw)
To: davem; +Cc: Bruce Allan, netdev, gospo, sassmann, Jeff Kirsher
From: Bruce Allan <bruce.w.allan@intel.com>
Rename e1000e_setup_link() to e1000e_setup_link_generic() to signify the
function is used for more than one MAC-family type. The 82571-family has
a custom setup_link function which also calls the generic function. The
ich8lan-family has a custom function which should just be called via the
function pointer. The 80003es2lan-family just uses the generic function.
Signed-off-by: Bruce Allan <bruce.w.allan@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/e1000e/80003es2lan.c | 4 ++--
drivers/net/ethernet/intel/e1000e/82571.c | 4 ++--
drivers/net/ethernet/intel/e1000e/e1000.h | 2 +-
drivers/net/ethernet/intel/e1000e/ich8lan.c | 2 +-
drivers/net/ethernet/intel/e1000e/mac.c | 4 ++--
5 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/net/ethernet/intel/e1000e/80003es2lan.c b/drivers/net/ethernet/intel/e1000e/80003es2lan.c
index c146484..e1cbead 100644
--- a/drivers/net/ethernet/intel/e1000e/80003es2lan.c
+++ b/drivers/net/ethernet/intel/e1000e/80003es2lan.c
@@ -838,7 +838,7 @@ static s32 e1000_init_hw_80003es2lan(struct e1000_hw *hw)
E1000_WRITE_REG_ARRAY(hw, E1000_MTA, i, 0);
/* Setup link and flow control */
- ret_val = e1000e_setup_link(hw);
+ ret_val = mac->ops.setup_link(hw);
/* Disable IBIST slave mode (far-end loopback) */
e1000_read_kmrn_reg_80003es2lan(hw, E1000_KMRNCTRLSTA_INBAND_PARAM,
@@ -1429,7 +1429,7 @@ static const struct e1000_mac_operations es2_mac_ops = {
.clear_vfta = e1000_clear_vfta_generic,
.reset_hw = e1000_reset_hw_80003es2lan,
.init_hw = e1000_init_hw_80003es2lan,
- .setup_link = e1000e_setup_link,
+ .setup_link = e1000e_setup_link_generic,
/* setup_physical_interface dependent on media type */
.setup_led = e1000e_setup_led_generic,
};
diff --git a/drivers/net/ethernet/intel/e1000e/82571.c b/drivers/net/ethernet/intel/e1000e/82571.c
index 2ca6377..721c203 100644
--- a/drivers/net/ethernet/intel/e1000e/82571.c
+++ b/drivers/net/ethernet/intel/e1000e/82571.c
@@ -1143,7 +1143,7 @@ static s32 e1000_init_hw_82571(struct e1000_hw *hw)
E1000_WRITE_REG_ARRAY(hw, E1000_MTA, i, 0);
/* Setup link and flow control */
- ret_val = e1000_setup_link_82571(hw);
+ ret_val = mac->ops.setup_link(hw);
/* Set the transmit descriptor write-back policy */
reg_data = er32(TXDCTL(0));
@@ -1455,7 +1455,7 @@ static s32 e1000_setup_link_82571(struct e1000_hw *hw)
break;
}
- return e1000e_setup_link(hw);
+ return e1000e_setup_link_generic(hw);
}
/**
diff --git a/drivers/net/ethernet/intel/e1000e/e1000.h b/drivers/net/ethernet/intel/e1000e/e1000.h
index 2a0d658..22e03e5 100644
--- a/drivers/net/ethernet/intel/e1000e/e1000.h
+++ b/drivers/net/ethernet/intel/e1000e/e1000.h
@@ -564,7 +564,7 @@ extern void e1000e_clear_hw_cntrs_base(struct e1000_hw *hw);
extern s32 e1000e_setup_fiber_serdes_link(struct e1000_hw *hw);
extern s32 e1000e_copper_link_setup_m88(struct e1000_hw *hw);
extern s32 e1000e_copper_link_setup_igp(struct e1000_hw *hw);
-extern s32 e1000e_setup_link(struct e1000_hw *hw);
+extern s32 e1000e_setup_link_generic(struct e1000_hw *hw);
extern void e1000_clear_vfta_generic(struct e1000_hw *hw);
extern void e1000e_init_rx_addrs(struct e1000_hw *hw, u16 rar_count);
extern void e1000e_update_mc_addr_list_generic(struct e1000_hw *hw,
diff --git a/drivers/net/ethernet/intel/e1000e/ich8lan.c b/drivers/net/ethernet/intel/e1000e/ich8lan.c
index 7d3a7fb..8b9bf94 100644
--- a/drivers/net/ethernet/intel/e1000e/ich8lan.c
+++ b/drivers/net/ethernet/intel/e1000e/ich8lan.c
@@ -3212,7 +3212,7 @@ static s32 e1000_init_hw_ich8lan(struct e1000_hw *hw)
}
/* Setup link and flow control */
- ret_val = e1000_setup_link_ich8lan(hw);
+ ret_val = mac->ops.setup_link(hw);
/* Set the transmit descriptor write-back policy for both queues */
txdctl = er32(TXDCTL(0));
diff --git a/drivers/net/ethernet/intel/e1000e/mac.c b/drivers/net/ethernet/intel/e1000e/mac.c
index aaf4a4d..6e48895 100644
--- a/drivers/net/ethernet/intel/e1000e/mac.c
+++ b/drivers/net/ethernet/intel/e1000e/mac.c
@@ -693,7 +693,7 @@ static s32 e1000_set_default_fc_generic(struct e1000_hw *hw)
}
/**
- * e1000e_setup_link - Setup flow control and link settings
+ * e1000e_setup_link_generic - Setup flow control and link settings
* @hw: pointer to the HW structure
*
* Determines which flow control settings to use, then configures flow
@@ -702,7 +702,7 @@ static s32 e1000_set_default_fc_generic(struct e1000_hw *hw)
* should be established. Assumes the hardware has previously been reset
* and the transmitter and receiver are not enabled.
**/
-s32 e1000e_setup_link(struct e1000_hw *hw)
+s32 e1000e_setup_link_generic(struct e1000_hw *hw)
{
struct e1000_mac_info *mac = &hw->mac;
s32 ret_val;
--
1.7.7.6
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [net-next 03/11] e1000e: cleanup use of check_mng_mode function pointer
2012-02-25 5:49 [net-next 00/11][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
2012-02-25 5:49 ` [net-next 01/11] e1000e: cleanup: rename e1000e_id_led_init() and call as function pointer Jeff Kirsher
2012-02-25 5:49 ` [net-next 02/11] e1000e: cleanup: rename e1000e_setup_link() " Jeff Kirsher
@ 2012-02-25 5:49 ` Jeff Kirsher
2012-02-25 5:49 ` [net-next 04/11] e1000e: cleanup use of check_reset_block " Jeff Kirsher
` (8 subsequent siblings)
11 siblings, 0 replies; 14+ messages in thread
From: Jeff Kirsher @ 2012-02-25 5:49 UTC (permalink / raw)
To: davem; +Cc: Bruce Allan, netdev, gospo, sassmann, Jeff Kirsher
From: Bruce Allan <bruce.w.allan@intel.com>
Replace e1000_check_mng_mode() inline function with calls to the MAC ops
check_mng_mode function pointer.
Signed-off-by: Bruce Allan <bruce.w.allan@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/e1000e/80003es2lan.c | 2 +-
drivers/net/ethernet/intel/e1000e/e1000.h | 5 -----
drivers/net/ethernet/intel/e1000e/manage.c | 4 ++--
3 files changed, 3 insertions(+), 8 deletions(-)
diff --git a/drivers/net/ethernet/intel/e1000e/80003es2lan.c b/drivers/net/ethernet/intel/e1000e/80003es2lan.c
index e1cbead..0ea3e7e 100644
--- a/drivers/net/ethernet/intel/e1000e/80003es2lan.c
+++ b/drivers/net/ethernet/intel/e1000e/80003es2lan.c
@@ -1056,7 +1056,7 @@ static s32 e1000_copper_link_setup_gg82563_80003es2lan(struct e1000_hw *hw)
* firmware will have already initialized them. We only initialize
* them if the HW is not in IAMT mode.
*/
- if (!e1000e_check_mng_mode(hw)) {
+ if (!hw->mac.ops.check_mng_mode(hw)) {
/* Enable Electrical Idle on the PHY */
data |= GG82563_PMCR_ENABLE_ELECTRICAL_IDLE;
ret_val = e1e_wphy(hw, GG82563_PHY_PWR_MGMT_CTRL, data);
diff --git a/drivers/net/ethernet/intel/e1000e/e1000.h b/drivers/net/ethernet/intel/e1000e/e1000.h
index 22e03e5..bae094b 100644
--- a/drivers/net/ethernet/intel/e1000e/e1000.h
+++ b/drivers/net/ethernet/intel/e1000e/e1000.h
@@ -725,11 +725,6 @@ static inline s32 e1000_get_phy_info(struct e1000_hw *hw)
return hw->phy.ops.get_info(hw);
}
-static inline s32 e1000e_check_mng_mode(struct e1000_hw *hw)
-{
- return hw->mac.ops.check_mng_mode(hw);
-}
-
extern bool e1000e_check_mng_mode_generic(struct e1000_hw *hw);
extern bool e1000e_enable_tx_pkt_filtering(struct e1000_hw *hw);
extern s32 e1000e_mng_write_dhcp_info(struct e1000_hw *hw, u8 *buffer, u16 length);
diff --git a/drivers/net/ethernet/intel/e1000e/manage.c b/drivers/net/ethernet/intel/e1000e/manage.c
index 0d24b13..473f8e7 100644
--- a/drivers/net/ethernet/intel/e1000e/manage.c
+++ b/drivers/net/ethernet/intel/e1000e/manage.c
@@ -106,7 +106,7 @@ static s32 e1000_mng_enable_host_if(struct e1000_hw *hw)
}
/**
- * e1000e_check_mng_mode_generic - check management mode
+ * e1000e_check_mng_mode_generic - Generic check management mode
* @hw: pointer to the HW structure
*
* Reads the firmware semaphore register and returns true (>0) if
@@ -138,7 +138,7 @@ bool e1000e_enable_tx_pkt_filtering(struct e1000_hw *hw)
hw->mac.tx_pkt_filtering = true;
/* No manageability, no filtering */
- if (!e1000e_check_mng_mode(hw)) {
+ if (!hw->mac.ops.check_mng_mode(hw)) {
hw->mac.tx_pkt_filtering = false;
return hw->mac.tx_pkt_filtering;
}
--
1.7.7.6
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [net-next 04/11] e1000e: cleanup use of check_reset_block function pointer
2012-02-25 5:49 [net-next 00/11][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
` (2 preceding siblings ...)
2012-02-25 5:49 ` [net-next 03/11] e1000e: cleanup use of check_mng_mode " Jeff Kirsher
@ 2012-02-25 5:49 ` Jeff Kirsher
2012-02-25 5:49 ` [net-next 05/11] e1000e: cleanup calls to setup_physical_interface " Jeff Kirsher
` (7 subsequent siblings)
11 siblings, 0 replies; 14+ messages in thread
From: Jeff Kirsher @ 2012-02-25 5:49 UTC (permalink / raw)
To: davem; +Cc: Bruce Allan, netdev, gospo, sassmann, Jeff Kirsher
From: Bruce Allan <bruce.w.allan@intel.com>
Replace e1000_check_reset_block() inline function with calls to the PHY ops
check_reset_block function pointer.
Signed-off-by: Bruce Allan <bruce.w.allan@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/e1000e/e1000.h | 5 -----
drivers/net/ethernet/intel/e1000e/ethtool.c | 6 ++++--
drivers/net/ethernet/intel/e1000e/ich8lan.c | 15 ++++++++-------
drivers/net/ethernet/intel/e1000e/mac.c | 2 +-
drivers/net/ethernet/intel/e1000e/netdev.c | 4 ++--
drivers/net/ethernet/intel/e1000e/phy.c | 2 +-
6 files changed, 16 insertions(+), 18 deletions(-)
diff --git a/drivers/net/ethernet/intel/e1000e/e1000.h b/drivers/net/ethernet/intel/e1000e/e1000.h
index bae094b..f93d7a4 100644
--- a/drivers/net/ethernet/intel/e1000e/e1000.h
+++ b/drivers/net/ethernet/intel/e1000e/e1000.h
@@ -662,11 +662,6 @@ static inline s32 e1000_phy_hw_reset(struct e1000_hw *hw)
return hw->phy.ops.reset(hw);
}
-static inline s32 e1000_check_reset_block(struct e1000_hw *hw)
-{
- return hw->phy.ops.check_reset_block(hw);
-}
-
static inline s32 e1e_rphy(struct e1000_hw *hw, u32 offset, u16 *data)
{
return hw->phy.ops.read_reg(hw, offset, data);
diff --git a/drivers/net/ethernet/intel/e1000e/ethtool.c b/drivers/net/ethernet/intel/e1000e/ethtool.c
index b1f5d74..db35dd5 100644
--- a/drivers/net/ethernet/intel/e1000e/ethtool.c
+++ b/drivers/net/ethernet/intel/e1000e/ethtool.c
@@ -258,7 +258,7 @@ static int e1000_set_settings(struct net_device *netdev,
* When SoL/IDER sessions are active, autoneg/speed/duplex
* cannot be changed
*/
- if (e1000_check_reset_block(hw)) {
+ if (hw->phy.ops.check_reset_block(hw)) {
e_err("Cannot change link characteristics when SoL/IDER is "
"active.\n");
return -EINVAL;
@@ -1598,11 +1598,13 @@ static int e1000_run_loopback_test(struct e1000_adapter *adapter)
static int e1000_loopback_test(struct e1000_adapter *adapter, u64 *data)
{
+ struct e1000_hw *hw = &adapter->hw;
+
/*
* PHY loopback cannot be performed if SoL/IDER
* sessions are active
*/
- if (e1000_check_reset_block(&adapter->hw)) {
+ if (hw->phy.ops.check_reset_block(hw)) {
e_err("Cannot do PHY loopback test when SoL/IDER is active.\n");
*data = 0;
goto out;
diff --git a/drivers/net/ethernet/intel/e1000e/ich8lan.c b/drivers/net/ethernet/intel/e1000e/ich8lan.c
index 8b9bf94..da89e2b 100644
--- a/drivers/net/ethernet/intel/e1000e/ich8lan.c
+++ b/drivers/net/ethernet/intel/e1000e/ich8lan.c
@@ -324,7 +324,7 @@ static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw)
phy->ops.power_down = e1000_power_down_phy_copper_ich8lan;
phy->autoneg_mask = AUTONEG_ADVERTISE_SPEED_DEFAULT;
- if (!e1000_check_reset_block(hw)) {
+ if (!hw->phy.ops.check_reset_block(hw)) {
u32 fwsm = er32(FWSM);
/*
@@ -1314,7 +1314,7 @@ static s32 e1000_oem_bits_config_ich8lan(struct e1000_hw *hw, bool d0_state)
oem_reg |= HV_OEM_BITS_LPLU;
/* Set Restart auto-neg to activate the bits */
- if (!e1000_check_reset_block(hw))
+ if (!hw->phy.ops.check_reset_block(hw))
oem_reg |= HV_OEM_BITS_RESTART_AN;
} else {
if (mac_reg & (E1000_PHY_CTRL_GBE_DISABLE |
@@ -1788,7 +1788,7 @@ static s32 e1000_post_phy_reset_ich8lan(struct e1000_hw *hw)
s32 ret_val = 0;
u16 reg;
- if (e1000_check_reset_block(hw))
+ if (hw->phy.ops.check_reset_block(hw))
return 0;
/* Allow time for h/w to get to quiescent state after reset */
@@ -1897,7 +1897,7 @@ static s32 e1000_set_lplu_state_pchlan(struct e1000_hw *hw, bool active)
else
oem_reg &= ~HV_OEM_BITS_LPLU;
- if (!e1000_check_reset_block(hw))
+ if (!hw->phy.ops.check_reset_block(hw))
oem_reg |= HV_OEM_BITS_RESTART_AN;
return e1e_wphy(hw, HV_OEM_BITS, oem_reg);
@@ -3109,7 +3109,7 @@ static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw)
ctrl = er32(CTRL);
- if (!e1000_check_reset_block(hw)) {
+ if (!hw->phy.ops.check_reset_block(hw)) {
/*
* Full-chip reset requires MAC and PHY reset at the same
* time to make sure the interface between MAC and the
@@ -3327,7 +3327,7 @@ static s32 e1000_setup_link_ich8lan(struct e1000_hw *hw)
{
s32 ret_val;
- if (e1000_check_reset_block(hw))
+ if (hw->phy.ops.check_reset_block(hw))
return 0;
/*
@@ -3707,7 +3707,8 @@ void e1000_resume_workarounds_pchlan(struct e1000_hw *hw)
u16 phy_id1, phy_id2;
s32 ret_val;
- if ((hw->mac.type != e1000_pch2lan) || e1000_check_reset_block(hw))
+ if ((hw->mac.type != e1000_pch2lan) ||
+ hw->phy.ops.check_reset_block(hw))
return;
ret_val = hw->phy.ops.acquire(hw);
diff --git a/drivers/net/ethernet/intel/e1000e/mac.c b/drivers/net/ethernet/intel/e1000e/mac.c
index 6e48895..011d83d 100644
--- a/drivers/net/ethernet/intel/e1000e/mac.c
+++ b/drivers/net/ethernet/intel/e1000e/mac.c
@@ -711,7 +711,7 @@ s32 e1000e_setup_link_generic(struct e1000_hw *hw)
* In the case of the phy reset being blocked, we already have a link.
* We do not need to set it up again.
*/
- if (e1000_check_reset_block(hw))
+ if (hw->phy.ops.check_reset_block(hw))
return 0;
/*
diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
index c30e99e..3975ed1 100644
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -6236,7 +6236,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
adapter->hw.phy.ms_type = e1000_ms_hw_default;
}
- if (e1000_check_reset_block(&adapter->hw))
+ if (hw->phy.ops.check_reset_block(hw))
e_info("PHY reset is blocked due to SOL/IDER session.\n");
/* Set initial default active device features */
@@ -6403,7 +6403,7 @@ err_register:
if (!(adapter->flags & FLAG_HAS_AMT))
e1000e_release_hw_control(adapter);
err_eeprom:
- if (!e1000_check_reset_block(&adapter->hw))
+ if (!hw->phy.ops.check_reset_block(hw))
e1000_phy_hw_reset(&adapter->hw);
err_hw_init:
kfree(adapter->tx_ring);
diff --git a/drivers/net/ethernet/intel/e1000e/phy.c b/drivers/net/ethernet/intel/e1000e/phy.c
index d4dbbe7..d10b27f 100644
--- a/drivers/net/ethernet/intel/e1000e/phy.c
+++ b/drivers/net/ethernet/intel/e1000e/phy.c
@@ -2133,7 +2133,7 @@ s32 e1000e_phy_hw_reset_generic(struct e1000_hw *hw)
s32 ret_val;
u32 ctrl;
- ret_val = e1000_check_reset_block(hw);
+ ret_val = phy->ops.check_reset_block(hw);
if (ret_val)
return 0;
--
1.7.7.6
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [net-next 05/11] e1000e: cleanup calls to setup_physical_interface function pointer
2012-02-25 5:49 [net-next 00/11][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
` (3 preceding siblings ...)
2012-02-25 5:49 ` [net-next 04/11] e1000e: cleanup use of check_reset_block " Jeff Kirsher
@ 2012-02-25 5:49 ` Jeff Kirsher
2012-02-25 5:49 ` [net-next 06/11] e1000e: comment correction in e1000e_set_kmrn_lock_loss_workaround_ich8lan Jeff Kirsher
` (6 subsequent siblings)
11 siblings, 0 replies; 14+ messages in thread
From: Jeff Kirsher @ 2012-02-25 5:49 UTC (permalink / raw)
To: davem; +Cc: Bruce Allan, netdev, gospo, sassmann, Jeff Kirsher
From: Bruce Allan <bruce.w.allan@intel.com>
Call the MAC ops setup_physical_interface function pointer instead of the
MAC-family-specific function to conform to the rest of the driver design.
Signed-off-by: Bruce Allan <bruce.w.allan@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/e1000e/ich8lan.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/ethernet/intel/e1000e/ich8lan.c b/drivers/net/ethernet/intel/e1000e/ich8lan.c
index da89e2b..fdc3be9 100644
--- a/drivers/net/ethernet/intel/e1000e/ich8lan.c
+++ b/drivers/net/ethernet/intel/e1000e/ich8lan.c
@@ -3353,7 +3353,7 @@ static s32 e1000_setup_link_ich8lan(struct e1000_hw *hw)
hw->fc.current_mode);
/* Continue to configure the copper link. */
- ret_val = e1000_setup_copper_link_ich8lan(hw);
+ ret_val = hw->mac.ops.setup_physical_interface(hw);
if (ret_val)
return ret_val;
--
1.7.7.6
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [net-next 06/11] e1000e: comment correction in e1000e_set_kmrn_lock_loss_workaround_ich8lan
2012-02-25 5:49 [net-next 00/11][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
` (4 preceding siblings ...)
2012-02-25 5:49 ` [net-next 05/11] e1000e: cleanup calls to setup_physical_interface " Jeff Kirsher
@ 2012-02-25 5:49 ` Jeff Kirsher
2012-02-25 5:49 ` [net-next 07/11] e1000e: rename e1000e_config_collision_dist() and call as function pointer Jeff Kirsher
` (5 subsequent siblings)
11 siblings, 0 replies; 14+ messages in thread
From: Jeff Kirsher @ 2012-02-25 5:49 UTC (permalink / raw)
To: davem; +Cc: Bruce Allan, netdev, gospo, sassmann, Jeff Kirsher
From: Bruce Allan <bruce.w.allan@intel.com>
Signed-off-by: Bruce Allan <bruce.w.allan@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/e1000e/ich8lan.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/ethernet/intel/e1000e/ich8lan.c b/drivers/net/ethernet/intel/e1000e/ich8lan.c
index fdc3be9..1436682 100644
--- a/drivers/net/ethernet/intel/e1000e/ich8lan.c
+++ b/drivers/net/ethernet/intel/e1000e/ich8lan.c
@@ -3555,7 +3555,7 @@ static s32 e1000_kmrn_lock_loss_workaround_ich8lan(struct e1000_hw *hw)
}
/**
- * e1000_set_kmrn_lock_loss_workaround_ich8lan - Set Kumeran workaround state
+ * e1000e_set_kmrn_lock_loss_workaround_ich8lan - Set Kumeran workaround state
* @hw: pointer to the HW structure
* @state: boolean value used to set the current Kumeran workaround state
*
--
1.7.7.6
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [net-next 07/11] e1000e: rename e1000e_config_collision_dist() and call as function pointer
2012-02-25 5:49 [net-next 00/11][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
` (5 preceding siblings ...)
2012-02-25 5:49 ` [net-next 06/11] e1000e: comment correction in e1000e_set_kmrn_lock_loss_workaround_ich8lan Jeff Kirsher
@ 2012-02-25 5:49 ` Jeff Kirsher
2012-02-25 5:49 ` [net-next 08/11] e1000e: cleanup comment in e1000_hash_mc_addr() Jeff Kirsher
` (4 subsequent siblings)
11 siblings, 0 replies; 14+ messages in thread
From: Jeff Kirsher @ 2012-02-25 5:49 UTC (permalink / raw)
To: davem; +Cc: Bruce Allan, netdev, gospo, sassmann, Jeff Kirsher
From: Bruce Allan <bruce.w.allan@intel.com>
Rename e1000e_config_collision_dist() to
e1000e_config_collision_dist_generic() to signify the function is used for
more than one MAC-family type, and set and use it as a MAC ops function
pointer to be consistent with the driver design.
Signed-off-by: Bruce Allan <bruce.w.allan@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/e1000e/80003es2lan.c | 1 +
drivers/net/ethernet/intel/e1000e/82571.c | 1 +
drivers/net/ethernet/intel/e1000e/e1000.h | 2 +-
drivers/net/ethernet/intel/e1000e/hw.h | 1 +
drivers/net/ethernet/intel/e1000e/ich8lan.c | 3 ++-
drivers/net/ethernet/intel/e1000e/mac.c | 11 +++++------
drivers/net/ethernet/intel/e1000e/netdev.c | 2 +-
drivers/net/ethernet/intel/e1000e/phy.c | 4 ++--
8 files changed, 14 insertions(+), 11 deletions(-)
diff --git a/drivers/net/ethernet/intel/e1000e/80003es2lan.c b/drivers/net/ethernet/intel/e1000e/80003es2lan.c
index 0ea3e7e..6e58e94 100644
--- a/drivers/net/ethernet/intel/e1000e/80003es2lan.c
+++ b/drivers/net/ethernet/intel/e1000e/80003es2lan.c
@@ -1432,6 +1432,7 @@ static const struct e1000_mac_operations es2_mac_ops = {
.setup_link = e1000e_setup_link_generic,
/* setup_physical_interface dependent on media type */
.setup_led = e1000e_setup_led_generic,
+ .config_collision_dist = e1000e_config_collision_dist_generic,
};
static const struct e1000_phy_operations es2_phy_ops = {
diff --git a/drivers/net/ethernet/intel/e1000e/82571.c b/drivers/net/ethernet/intel/e1000e/82571.c
index 721c203..7f44ab76 100644
--- a/drivers/net/ethernet/intel/e1000e/82571.c
+++ b/drivers/net/ethernet/intel/e1000e/82571.c
@@ -1927,6 +1927,7 @@ static const struct e1000_mac_operations e82571_mac_ops = {
.setup_link = e1000_setup_link_82571,
/* .setup_physical_interface: media type dependent */
.setup_led = e1000e_setup_led_generic,
+ .config_collision_dist = e1000e_config_collision_dist_generic,
.read_mac_addr = e1000_read_mac_addr_82571,
};
diff --git a/drivers/net/ethernet/intel/e1000e/e1000.h b/drivers/net/ethernet/intel/e1000e/e1000.h
index f93d7a4..9f3a268 100644
--- a/drivers/net/ethernet/intel/e1000e/e1000.h
+++ b/drivers/net/ethernet/intel/e1000e/e1000.h
@@ -575,7 +575,7 @@ extern s32 e1000e_set_fc_watermarks(struct e1000_hw *hw);
extern void e1000e_set_pcie_no_snoop(struct e1000_hw *hw, u32 no_snoop);
extern s32 e1000e_get_hw_semaphore(struct e1000_hw *hw);
extern s32 e1000e_valid_led_default(struct e1000_hw *hw, u16 *data);
-extern void e1000e_config_collision_dist(struct e1000_hw *hw);
+extern void e1000e_config_collision_dist_generic(struct e1000_hw *hw);
extern s32 e1000e_config_fc_after_link_up(struct e1000_hw *hw);
extern s32 e1000e_force_mac_fc(struct e1000_hw *hw);
extern s32 e1000e_blink_led_generic(struct e1000_hw *hw);
diff --git a/drivers/net/ethernet/intel/e1000e/hw.h b/drivers/net/ethernet/intel/e1000e/hw.h
index 197059b..50e114b 100644
--- a/drivers/net/ethernet/intel/e1000e/hw.h
+++ b/drivers/net/ethernet/intel/e1000e/hw.h
@@ -781,6 +781,7 @@ struct e1000_mac_operations {
s32 (*setup_physical_interface)(struct e1000_hw *);
s32 (*setup_led)(struct e1000_hw *);
void (*write_vfta)(struct e1000_hw *, u32, u32);
+ void (*config_collision_dist)(struct e1000_hw *);
s32 (*read_mac_addr)(struct e1000_hw *);
};
diff --git a/drivers/net/ethernet/intel/e1000e/ich8lan.c b/drivers/net/ethernet/intel/e1000e/ich8lan.c
index 1436682..df91c42 100644
--- a/drivers/net/ethernet/intel/e1000e/ich8lan.c
+++ b/drivers/net/ethernet/intel/e1000e/ich8lan.c
@@ -746,7 +746,7 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw)
* of MAC speed/duplex configuration. So we only need to
* configure Collision Distance in the MAC.
*/
- e1000e_config_collision_dist(hw);
+ mac->ops.config_collision_dist(hw);
/*
* Configure Flow Control now that Auto-Neg has completed.
@@ -4022,6 +4022,7 @@ static const struct e1000_mac_operations ich8_mac_ops = {
.setup_link = e1000_setup_link_ich8lan,
.setup_physical_interface= e1000_setup_copper_link_ich8lan,
/* id_led_init dependent on mac type */
+ .config_collision_dist = e1000e_config_collision_dist_generic,
};
static const struct e1000_phy_operations ich8_phy_ops = {
diff --git a/drivers/net/ethernet/intel/e1000e/mac.c b/drivers/net/ethernet/intel/e1000e/mac.c
index 011d83d..f16a611 100644
--- a/drivers/net/ethernet/intel/e1000e/mac.c
+++ b/drivers/net/ethernet/intel/e1000e/mac.c
@@ -465,7 +465,7 @@ s32 e1000e_check_for_copper_link(struct e1000_hw *hw)
* of MAC speed/duplex configuration. So we only need to
* configure Collision Distance in the MAC.
*/
- e1000e_config_collision_dist(hw);
+ mac->ops.config_collision_dist(hw);
/*
* Configure Flow Control now that Auto-Neg has completed.
@@ -890,7 +890,7 @@ s32 e1000e_setup_fiber_serdes_link(struct e1000_hw *hw)
/* Take the link out of reset */
ctrl &= ~E1000_CTRL_LRST;
- e1000e_config_collision_dist(hw);
+ hw->mac.ops.config_collision_dist(hw);
ret_val = e1000_commit_fc_settings_generic(hw);
if (ret_val)
@@ -925,14 +925,13 @@ s32 e1000e_setup_fiber_serdes_link(struct e1000_hw *hw)
}
/**
- * e1000e_config_collision_dist - Configure collision distance
+ * e1000e_config_collision_dist_generic - Configure collision distance
* @hw: pointer to the HW structure
*
* Configures the collision distance to the default value and is used
- * during link setup. Currently no func pointer exists and all
- * implementations are handled in the generic version of this function.
+ * during link setup.
**/
-void e1000e_config_collision_dist(struct e1000_hw *hw)
+void e1000e_config_collision_dist_generic(struct e1000_hw *hw)
{
u32 tctl;
diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
index 3975ed1..56c1aec 100644
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -2855,7 +2855,7 @@ static void e1000_configure_tx(struct e1000_adapter *adapter)
/* enable Report Status bit */
adapter->txd_cmd |= E1000_TXD_CMD_RS;
- e1000e_config_collision_dist(hw);
+ hw->mac.ops.config_collision_dist(hw);
}
/**
diff --git a/drivers/net/ethernet/intel/e1000e/phy.c b/drivers/net/ethernet/intel/e1000e/phy.c
index d10b27f..683abac 100644
--- a/drivers/net/ethernet/intel/e1000e/phy.c
+++ b/drivers/net/ethernet/intel/e1000e/phy.c
@@ -1181,7 +1181,7 @@ s32 e1000e_setup_copper_link(struct e1000_hw *hw)
if (link) {
e_dbg("Valid link established!!!\n");
- e1000e_config_collision_dist(hw);
+ hw->mac.ops.config_collision_dist(hw);
ret_val = e1000e_config_fc_after_link_up(hw);
} else {
e_dbg("Unable to establish link!!!\n");
@@ -1489,7 +1489,7 @@ void e1000e_phy_force_speed_duplex_setup(struct e1000_hw *hw, u16 *phy_ctrl)
e_dbg("Forcing 10mb\n");
}
- e1000e_config_collision_dist(hw);
+ hw->mac.ops.config_collision_dist(hw);
ew32(CTRL, ctrl);
}
--
1.7.7.6
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [net-next 08/11] e1000e: cleanup comment in e1000_hash_mc_addr()
2012-02-25 5:49 [net-next 00/11][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
` (6 preceding siblings ...)
2012-02-25 5:49 ` [net-next 07/11] e1000e: rename e1000e_config_collision_dist() and call as function pointer Jeff Kirsher
@ 2012-02-25 5:49 ` Jeff Kirsher
2012-02-25 5:49 ` [net-next 09/11] e1000e: use true/false for boolean send_xon, do not assume always true Jeff Kirsher
` (3 subsequent siblings)
11 siblings, 0 replies; 14+ messages in thread
From: Jeff Kirsher @ 2012-02-25 5:49 UTC (permalink / raw)
To: davem; +Cc: Bruce Allan, netdev, gospo, sassmann, Jeff Kirsher
From: Bruce Allan <bruce.w.allan@intel.com>
Remove reference to non-existant function.
Signed-off-by: Bruce Allan <bruce.w.allan@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/e1000e/mac.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/intel/e1000e/mac.c b/drivers/net/ethernet/intel/e1000e/mac.c
index f16a611..4130134 100644
--- a/drivers/net/ethernet/intel/e1000e/mac.c
+++ b/drivers/net/ethernet/intel/e1000e/mac.c
@@ -263,8 +263,7 @@ void e1000e_rar_set(struct e1000_hw *hw, u8 *addr, u32 index)
* @mc_addr: pointer to a multicast address
*
* Generates a multicast address hash value which is used to determine
- * the multicast filter table array address and new table value. See
- * e1000_mta_set_generic()
+ * the multicast filter table array address and new table value.
**/
static u32 e1000_hash_mc_addr(struct e1000_hw *hw, u8 *mc_addr)
{
--
1.7.7.6
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [net-next 09/11] e1000e: use true/false for boolean send_xon, do not assume always true
2012-02-25 5:49 [net-next 00/11][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
` (7 preceding siblings ...)
2012-02-25 5:49 ` [net-next 08/11] e1000e: cleanup comment in e1000_hash_mc_addr() Jeff Kirsher
@ 2012-02-25 5:49 ` Jeff Kirsher
2012-02-25 5:49 ` [net-next 10/11] e1000e: cleanup - remove unnecessary variable Jeff Kirsher
` (2 subsequent siblings)
11 siblings, 0 replies; 14+ messages in thread
From: Jeff Kirsher @ 2012-02-25 5:49 UTC (permalink / raw)
To: davem; +Cc: Bruce Allan, netdev, gospo, sassmann, Jeff Kirsher
From: Bruce Allan <bruce.w.allan@intel.com>
Signed-off-by: Bruce Allan <bruce.w.allan@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/e1000e/mac.c | 4 +++-
drivers/net/ethernet/intel/e1000e/netdev.c | 2 +-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/intel/e1000e/mac.c b/drivers/net/ethernet/intel/e1000e/mac.c
index 4130134..d55f588 100644
--- a/drivers/net/ethernet/intel/e1000e/mac.c
+++ b/drivers/net/ethernet/intel/e1000e/mac.c
@@ -969,7 +969,9 @@ s32 e1000e_set_fc_watermarks(struct e1000_hw *hw)
* XON frames.
*/
fcrtl = hw->fc.low_water;
- fcrtl |= E1000_FCRTL_XONE;
+ if (hw->fc.send_xon)
+ fcrtl |= E1000_FCRTL_XONE;
+
fcrth = hw->fc.high_water;
}
ew32(FCRTL, fcrtl);
diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
index 56c1aec..8b62870 100644
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -3464,7 +3464,7 @@ void e1000e_reset(struct e1000_adapter *adapter)
fc->pause_time = 0xFFFF;
else
fc->pause_time = E1000_FC_PAUSE_TIME;
- fc->send_xon = 1;
+ fc->send_xon = true;
fc->current_mode = fc->requested_mode;
switch (hw->mac.type) {
--
1.7.7.6
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [net-next 10/11] e1000e: cleanup - remove unnecessary variable
2012-02-25 5:49 [net-next 00/11][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
` (8 preceding siblings ...)
2012-02-25 5:49 ` [net-next 09/11] e1000e: use true/false for boolean send_xon, do not assume always true Jeff Kirsher
@ 2012-02-25 5:49 ` Jeff Kirsher
2012-02-25 5:50 ` [net-next 11/11] e1000e: rename e1000e_reload_nvm() and call as function pointer Jeff Kirsher
2012-02-26 1:31 ` [net-next 00/11][pull request] Intel Wired LAN Driver Updates David Miller
11 siblings, 0 replies; 14+ messages in thread
From: Jeff Kirsher @ 2012-02-25 5:49 UTC (permalink / raw)
To: davem; +Cc: Bruce Allan, netdev, gospo, sassmann, Jeff Kirsher
From: Bruce Allan <bruce.w.allan@intel.com>
Signed-off-by: Bruce Allan <bruce.w.allan@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/e1000e/mac.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/intel/e1000e/mac.c b/drivers/net/ethernet/intel/e1000e/mac.c
index d55f588..59ac9f6 100644
--- a/drivers/net/ethernet/intel/e1000e/mac.c
+++ b/drivers/net/ethernet/intel/e1000e/mac.c
@@ -703,7 +703,6 @@ static s32 e1000_set_default_fc_generic(struct e1000_hw *hw)
**/
s32 e1000e_setup_link_generic(struct e1000_hw *hw)
{
- struct e1000_mac_info *mac = &hw->mac;
s32 ret_val;
/*
@@ -732,7 +731,7 @@ s32 e1000e_setup_link_generic(struct e1000_hw *hw)
e_dbg("After fix-ups FlowControl is now = %x\n", hw->fc.current_mode);
/* Call the necessary media_type subroutine to configure the link. */
- ret_val = mac->ops.setup_physical_interface(hw);
+ ret_val = hw->mac.ops.setup_physical_interface(hw);
if (ret_val)
return ret_val;
--
1.7.7.6
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [net-next 11/11] e1000e: rename e1000e_reload_nvm() and call as function pointer
2012-02-25 5:49 [net-next 00/11][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
` (9 preceding siblings ...)
2012-02-25 5:49 ` [net-next 10/11] e1000e: cleanup - remove unnecessary variable Jeff Kirsher
@ 2012-02-25 5:50 ` Jeff Kirsher
2012-02-26 1:31 ` [net-next 00/11][pull request] Intel Wired LAN Driver Updates David Miller
11 siblings, 0 replies; 14+ messages in thread
From: Jeff Kirsher @ 2012-02-25 5:50 UTC (permalink / raw)
To: davem; +Cc: Bruce Allan, netdev, gospo, sassmann, Jeff Kirsher
From: Bruce Allan <bruce.w.allan@intel.com>
Rename e1000e_reload_nvm() to e1000e_reload_nvm_generic() to signify the
function is used for more than one MAC-family type, and set and use it as a
MAC ops function pointer to be consistent with the driver design.
Signed-off-by: Bruce Allan <bruce.w.allan@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/e1000e/80003es2lan.c | 1 +
drivers/net/ethernet/intel/e1000e/82571.c | 1 +
drivers/net/ethernet/intel/e1000e/e1000.h | 2 +-
drivers/net/ethernet/intel/e1000e/hw.h | 1 +
drivers/net/ethernet/intel/e1000e/ich8lan.c | 3 ++-
drivers/net/ethernet/intel/e1000e/nvm.c | 4 ++--
6 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/intel/e1000e/80003es2lan.c b/drivers/net/ethernet/intel/e1000e/80003es2lan.c
index 6e58e94..bac9dda 100644
--- a/drivers/net/ethernet/intel/e1000e/80003es2lan.c
+++ b/drivers/net/ethernet/intel/e1000e/80003es2lan.c
@@ -1457,6 +1457,7 @@ static const struct e1000_nvm_operations es2_nvm_ops = {
.acquire = e1000_acquire_nvm_80003es2lan,
.read = e1000e_read_nvm_eerd,
.release = e1000_release_nvm_80003es2lan,
+ .reload = e1000e_reload_nvm_generic,
.update = e1000e_update_nvm_checksum_generic,
.valid_led_default = e1000e_valid_led_default,
.validate = e1000e_validate_nvm_checksum_generic,
diff --git a/drivers/net/ethernet/intel/e1000e/82571.c b/drivers/net/ethernet/intel/e1000e/82571.c
index 7f44ab76..086dad7 100644
--- a/drivers/net/ethernet/intel/e1000e/82571.c
+++ b/drivers/net/ethernet/intel/e1000e/82571.c
@@ -1989,6 +1989,7 @@ static const struct e1000_nvm_operations e82571_nvm_ops = {
.acquire = e1000_acquire_nvm_82571,
.read = e1000e_read_nvm_eerd,
.release = e1000_release_nvm_82571,
+ .reload = e1000e_reload_nvm_generic,
.update = e1000_update_nvm_checksum_82571,
.valid_led_default = e1000_valid_led_default_82571,
.validate = e1000_validate_nvm_checksum_82571,
diff --git a/drivers/net/ethernet/intel/e1000e/e1000.h b/drivers/net/ethernet/intel/e1000e/e1000.h
index 9f3a268..86cdd47 100644
--- a/drivers/net/ethernet/intel/e1000e/e1000.h
+++ b/drivers/net/ethernet/intel/e1000e/e1000.h
@@ -684,7 +684,7 @@ extern s32 e1000e_poll_eerd_eewr_done(struct e1000_hw *hw, int ee_reg);
extern s32 e1000e_read_nvm_eerd(struct e1000_hw *hw, u16 offset, u16 words, u16 *data);
extern s32 e1000e_validate_nvm_checksum_generic(struct e1000_hw *hw);
extern void e1000e_release_nvm(struct e1000_hw *hw);
-extern void e1000e_reload_nvm(struct e1000_hw *hw);
+extern void e1000e_reload_nvm_generic(struct e1000_hw *hw);
extern s32 e1000_read_mac_addr_generic(struct e1000_hw *hw);
static inline s32 e1000e_read_mac_addr(struct e1000_hw *hw)
diff --git a/drivers/net/ethernet/intel/e1000e/hw.h b/drivers/net/ethernet/intel/e1000e/hw.h
index 50e114b..f82ecf5 100644
--- a/drivers/net/ethernet/intel/e1000e/hw.h
+++ b/drivers/net/ethernet/intel/e1000e/hw.h
@@ -830,6 +830,7 @@ struct e1000_nvm_operations {
s32 (*acquire)(struct e1000_hw *);
s32 (*read)(struct e1000_hw *, u16, u16, u16 *);
void (*release)(struct e1000_hw *);
+ void (*reload)(struct e1000_hw *);
s32 (*update)(struct e1000_hw *);
s32 (*valid_led_default)(struct e1000_hw *, u16 *);
s32 (*validate)(struct e1000_hw *);
diff --git a/drivers/net/ethernet/intel/e1000e/ich8lan.c b/drivers/net/ethernet/intel/e1000e/ich8lan.c
index df91c42..8e9af62 100644
--- a/drivers/net/ethernet/intel/e1000e/ich8lan.c
+++ b/drivers/net/ethernet/intel/e1000e/ich8lan.c
@@ -2609,7 +2609,7 @@ release:
* until after the next adapter reset.
*/
if (!ret_val) {
- e1000e_reload_nvm(hw);
+ nvm->ops.reload(hw);
usleep_range(10000, 20000);
}
@@ -4043,6 +4043,7 @@ static const struct e1000_nvm_operations ich8_nvm_ops = {
.acquire = e1000_acquire_nvm_ich8lan,
.read = e1000_read_nvm_ich8lan,
.release = e1000_release_nvm_ich8lan,
+ .reload = e1000e_reload_nvm_generic,
.update = e1000_update_nvm_checksum_ich8lan,
.valid_led_default = e1000_valid_led_default_ich8lan,
.validate = e1000_validate_nvm_checksum_ich8lan,
diff --git a/drivers/net/ethernet/intel/e1000e/nvm.c b/drivers/net/ethernet/intel/e1000e/nvm.c
index 24b7930..a969f1a 100644
--- a/drivers/net/ethernet/intel/e1000e/nvm.c
+++ b/drivers/net/ethernet/intel/e1000e/nvm.c
@@ -625,13 +625,13 @@ s32 e1000e_update_nvm_checksum_generic(struct e1000_hw *hw)
}
/**
- * e1000e_reload_nvm - Reloads EEPROM
+ * e1000e_reload_nvm_generic - Reloads EEPROM
* @hw: pointer to the HW structure
*
* Reloads the EEPROM by setting the "Reinitialize from EEPROM" bit in the
* extended control register.
**/
-void e1000e_reload_nvm(struct e1000_hw *hw)
+void e1000e_reload_nvm_generic(struct e1000_hw *hw)
{
u32 ctrl_ext;
--
1.7.7.6
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [net-next 00/11][pull request] Intel Wired LAN Driver Updates
2012-02-25 5:49 [net-next 00/11][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
` (10 preceding siblings ...)
2012-02-25 5:50 ` [net-next 11/11] e1000e: rename e1000e_reload_nvm() and call as function pointer Jeff Kirsher
@ 2012-02-26 1:31 ` David Miller
11 siblings, 0 replies; 14+ messages in thread
From: David Miller @ 2012-02-26 1:31 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: netdev, gospo, sassmann
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Fri, 24 Feb 2012 21:49:49 -0800
> This series of patches contains cleanups of the e1000e driver.
>
> The following are changes since commit 5d74f1757001f5b9a7739c2a9053435e16ce516b:
> Staging: wlags49_h2: print MAC via printk format specifier
> and are available in the git repository at:
> git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-next master
Pulled, thanks Jeff.
^ permalink raw reply [flat|nested] 14+ messages in thread
* RE: [net-next 02/11] e1000e: cleanup: rename e1000e_setup_link() and call as function pointer
2012-02-25 5:49 ` [net-next 02/11] e1000e: cleanup: rename e1000e_setup_link() " Jeff Kirsher
@ 2012-02-27 10:25 ` David Laight
0 siblings, 0 replies; 14+ messages in thread
From: David Laight @ 2012-02-27 10:25 UTC (permalink / raw)
To: Jeff Kirsher, davem; +Cc: Bruce Allan, netdev, gospo, sassmann
> From: Bruce Allan <bruce.w.allan@intel.com>
>
> Rename e1000e_setup_link() to e1000e_setup_link_generic() to signify
the
> function is used for more than one MAC-family type. The 82571-family
has
> a custom setup_link function which also calls the generic function.
The
> ich8lan-family has a custom function which should just be called via
the
> function pointer. The 80003es2lan-family just uses the generic
function.
Wouldn't it be better to add a suffix to the family-specific
functions instead of adding a lot of unnecessary churn?
David
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2012-02-27 10:26 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-25 5:49 [net-next 00/11][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
2012-02-25 5:49 ` [net-next 01/11] e1000e: cleanup: rename e1000e_id_led_init() and call as function pointer Jeff Kirsher
2012-02-25 5:49 ` [net-next 02/11] e1000e: cleanup: rename e1000e_setup_link() " Jeff Kirsher
2012-02-27 10:25 ` David Laight
2012-02-25 5:49 ` [net-next 03/11] e1000e: cleanup use of check_mng_mode " Jeff Kirsher
2012-02-25 5:49 ` [net-next 04/11] e1000e: cleanup use of check_reset_block " Jeff Kirsher
2012-02-25 5:49 ` [net-next 05/11] e1000e: cleanup calls to setup_physical_interface " Jeff Kirsher
2012-02-25 5:49 ` [net-next 06/11] e1000e: comment correction in e1000e_set_kmrn_lock_loss_workaround_ich8lan Jeff Kirsher
2012-02-25 5:49 ` [net-next 07/11] e1000e: rename e1000e_config_collision_dist() and call as function pointer Jeff Kirsher
2012-02-25 5:49 ` [net-next 08/11] e1000e: cleanup comment in e1000_hash_mc_addr() Jeff Kirsher
2012-02-25 5:49 ` [net-next 09/11] e1000e: use true/false for boolean send_xon, do not assume always true Jeff Kirsher
2012-02-25 5:49 ` [net-next 10/11] e1000e: cleanup - remove unnecessary variable Jeff Kirsher
2012-02-25 5:50 ` [net-next 11/11] e1000e: rename e1000e_reload_nvm() and call as function pointer Jeff Kirsher
2012-02-26 1:31 ` [net-next 00/11][pull request] Intel Wired LAN Driver Updates David Miller
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).