linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [2.6 patch] drivers/net/ixgb/: possible cleanups
@ 2005-05-06 21:18 Adrian Bunk
  2005-05-06 22:35 ` Ganesh Venkatesan
  0 siblings, 1 reply; 8+ messages in thread
From: Adrian Bunk @ 2005-05-06 21:18 UTC (permalink / raw)
  To: ayyappan.veeraiyan, ganesh.venkatesan, john.ronciak
  Cc: jgarzik, netdev, linux-kernel

This patch contains the following possible cleanups:
- make needlessly global code static
- remove the following unused global functions:
  - ixgb_ee.c: ixgb_get_ee_compatibility
  - ixgb_ee.c: ixgb_get_ee_init_ctrl_reg_1
  - ixgb_ee.c: ixgb_get_ee_init_ctrl_reg_2
  - ixgb_ee.c: ixgb_get_ee_subsystem_id
  - ixgb_ee.c: ixgb_get_ee_subvendor_id
  - ixgb_ee.c: ixgb_get_ee_vendor_id
  - ixgb_ee.c: ixgb_get_ee_swdpins_reg
  - ixgb_ee.c: ixgb_get_ee_d3_power
  - ixgb_ee.c: ixgb_get_ee_d0_power

Signed-off-by: Adrian Bunk <bunk@stusta.de>

---

A similar patch was already sent on:
- 17 Feb 2005

 drivers/net/ixgb/ixgb_ee.c      |  170 --------------------------------
 drivers/net/ixgb/ixgb_ethtool.c |    2 
 drivers/net/ixgb/ixgb_hw.c      |   26 +++-
 drivers/net/ixgb/ixgb_hw.h      |   26 ----
 drivers/net/ixgb/ixgb_main.c    |    6 -
 5 files changed, 21 insertions(+), 209 deletions(-)

--- linux-2.6.11-rc3-mm2-full/drivers/net/ixgb/ixgb_hw.h.old	2005-02-16 15:55:21.000000000 +0100
+++ linux-2.6.11-rc3-mm2-full/drivers/net/ixgb/ixgb_hw.h	2005-02-16 16:06:28.000000000 +0100
@@ -784,23 +784,8 @@
 extern boolean_t ixgb_adapter_stop(struct ixgb_hw *hw);
 extern boolean_t ixgb_init_hw(struct ixgb_hw *hw);
 extern boolean_t ixgb_adapter_start(struct ixgb_hw *hw);
-extern void ixgb_init_rx_addrs(struct ixgb_hw *hw);
 extern void ixgb_check_for_link(struct ixgb_hw *hw);
 extern boolean_t ixgb_check_for_bad_link(struct ixgb_hw *hw);
-extern boolean_t ixgb_setup_fc(struct ixgb_hw *hw);
-extern void ixgb_clear_hw_cntrs(struct ixgb_hw *hw);
-extern boolean_t mac_addr_valid(uint8_t *mac_addr);
-
-extern uint16_t ixgb_read_phy_reg(struct ixgb_hw *hw,
-				uint32_t reg_addr,
-				uint32_t phy_addr,
-				uint32_t device_type);
-
-extern void ixgb_write_phy_reg(struct ixgb_hw *hw,
-				uint32_t reg_addr,
-				uint32_t phy_addr,
-				uint32_t device_type,
-				uint16_t data);
 
 extern void ixgb_rar_set(struct ixgb_hw *hw,
 				uint8_t *addr,
@@ -818,21 +803,10 @@
 				 uint32_t offset,
 				 uint32_t value);
 
-extern void ixgb_clear_vfta(struct ixgb_hw *hw);
-
 /* Access functions to eeprom data */
 void ixgb_get_ee_mac_addr(struct ixgb_hw *hw, uint8_t *mac_addr);
-uint16_t ixgb_get_ee_compatibility(struct ixgb_hw *hw);
 uint32_t ixgb_get_ee_pba_number(struct ixgb_hw *hw);
-uint16_t ixgb_get_ee_init_ctrl_reg_1(struct ixgb_hw *hw);
-uint16_t ixgb_get_ee_init_ctrl_reg_2(struct ixgb_hw *hw);
-uint16_t ixgb_get_ee_subsystem_id(struct ixgb_hw *hw);
-uint16_t ixgb_get_ee_subvendor_id(struct ixgb_hw *hw);
 uint16_t ixgb_get_ee_device_id(struct ixgb_hw *hw);
-uint16_t ixgb_get_ee_vendor_id(struct ixgb_hw *hw);
-uint16_t ixgb_get_ee_swdpins_reg(struct ixgb_hw *hw);
-uint8_t ixgb_get_ee_d3_power(struct ixgb_hw *hw);
-uint8_t ixgb_get_ee_d0_power(struct ixgb_hw *hw);
 boolean_t ixgb_get_eeprom_data(struct ixgb_hw *hw);
 uint16_t ixgb_get_eeprom_word(struct ixgb_hw *hw, uint16_t index);
 
--- linux-2.6.11-rc3-mm2-full/drivers/net/ixgb/ixgb_ee.c.old	2005-02-16 15:55:34.000000000 +0100
+++ linux-2.6.11-rc3-mm2-full/drivers/net/ixgb/ixgb_ee.c	2005-02-16 15:58:37.000000000 +0100
@@ -560,25 +560,6 @@
 }
 
 /******************************************************************************
- * return the compatibility flags from EEPROM
- *
- * hw - Struct containing variables accessed by shared code
- *
- * Returns:
- *          compatibility flags if EEPROM contents are valid, 0 otherwise
- ******************************************************************************/
-uint16_t
-ixgb_get_ee_compatibility(struct ixgb_hw *hw)
-{
-	struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom;
-
-	if(ixgb_check_and_get_eeprom_data(hw) == TRUE)
-		return(ee_map->compatibility);
-
-	return(0);
-}
-
-/******************************************************************************
  * return the Printed Board Assembly number from EEPROM
  *
  * hw - Struct containing variables accessed by shared code
@@ -597,82 +578,6 @@
 }
 
 /******************************************************************************
- * return the Initialization Control Word 1 from EEPROM
- *
- * hw - Struct containing variables accessed by shared code
- *
- * Returns:
- *          Initialization Control Word 1 if EEPROM contents are valid, 0 otherwise
- ******************************************************************************/
-uint16_t
-ixgb_get_ee_init_ctrl_reg_1(struct ixgb_hw *hw)
-{
-	struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom;
-
-	if(ixgb_check_and_get_eeprom_data(hw) == TRUE)
-		return(ee_map->init_ctrl_reg_1);
-
-	return(0);
-}
-
-/******************************************************************************
- * return the Initialization Control Word 2 from EEPROM
- *
- * hw - Struct containing variables accessed by shared code
- *
- * Returns:
- *          Initialization Control Word 2 if EEPROM contents are valid, 0 otherwise
- ******************************************************************************/
-uint16_t
-ixgb_get_ee_init_ctrl_reg_2(struct ixgb_hw *hw)
-{
-	struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom;
-
-	if(ixgb_check_and_get_eeprom_data(hw) == TRUE)
-		return(ee_map->init_ctrl_reg_2);
-
-	return(0);
-}
-
-/******************************************************************************
- * return the Subsystem Id from EEPROM
- *
- * hw - Struct containing variables accessed by shared code
- *
- * Returns:
- *          Subsystem Id if EEPROM contents are valid, 0 otherwise
- ******************************************************************************/
-uint16_t
-ixgb_get_ee_subsystem_id(struct ixgb_hw *hw)
-{
-	struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom;
-
-	if(ixgb_check_and_get_eeprom_data(hw) == TRUE)
-	   return(ee_map->subsystem_id);
-
-	return(0);
-}
-
-/******************************************************************************
- * return the Sub Vendor Id from EEPROM
- *
- * hw - Struct containing variables accessed by shared code
- *
- * Returns:
- *          Sub Vendor Id if EEPROM contents are valid, 0 otherwise
- ******************************************************************************/
-uint16_t
-ixgb_get_ee_subvendor_id(struct ixgb_hw *hw)
-{
-	struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom;
-
-	if(ixgb_check_and_get_eeprom_data(hw) == TRUE)
-		return(ee_map->subvendor_id);
-
-	return(0);
-}
-
-/******************************************************************************
  * return the Device Id from EEPROM
  *
  * hw - Struct containing variables accessed by shared code
@@ -691,78 +596,3 @@
 	return(0);
 }
 
-/******************************************************************************
- * return the Vendor Id from EEPROM
- *
- * hw - Struct containing variables accessed by shared code
- *
- * Returns:
- *          Device Id if EEPROM contents are valid, 0 otherwise
- ******************************************************************************/
-uint16_t
-ixgb_get_ee_vendor_id(struct ixgb_hw *hw)
-{
-	struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom;
-
-	if(ixgb_check_and_get_eeprom_data(hw) == TRUE)
-		return(ee_map->vendor_id);
-
-	return(0);
-}
-
-/******************************************************************************
- * return the Software Defined Pins Register from EEPROM
- *
- * hw - Struct containing variables accessed by shared code
- *
- * Returns:
- *          SDP Register if EEPROM contents are valid, 0 otherwise
- ******************************************************************************/
-uint16_t
-ixgb_get_ee_swdpins_reg(struct ixgb_hw *hw)
-{
-	struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom;
-
-	if(ixgb_check_and_get_eeprom_data(hw) == TRUE)
-		return(ee_map->swdpins_reg);
-
-	return(0);
-}
-
-/******************************************************************************
- * return the D3 Power Management Bits from EEPROM
- *
- * hw - Struct containing variables accessed by shared code
- *
- * Returns:
- *          D3 Power Management Bits if EEPROM contents are valid, 0 otherwise
- ******************************************************************************/
-uint8_t
-ixgb_get_ee_d3_power(struct ixgb_hw *hw)
-{
-	struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom;
-
-	if(ixgb_check_and_get_eeprom_data(hw) == TRUE)
-		return(ee_map->d3_power);
-
-	return(0);
-}
-
-/******************************************************************************
- * return the D0 Power Management Bits from EEPROM
- *
- * hw - Struct containing variables accessed by shared code
- *
- * Returns:
- *          D0 Power Management Bits if EEPROM contents are valid, 0 otherwise
- ******************************************************************************/
-uint8_t
-ixgb_get_ee_d0_power(struct ixgb_hw *hw)
-{
-	struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom;
-
-	if(ixgb_check_and_get_eeprom_data(hw) == TRUE)
-		return(ee_map->d0_power);
-
-	return(0);
-}
--- linux-2.6.11-rc3-mm2-full/drivers/net/ixgb/ixgb_ethtool.c.old	2005-02-16 15:58:51.000000000 +0100
+++ linux-2.6.11-rc3-mm2-full/drivers/net/ixgb/ixgb_ethtool.c	2005-02-16 15:59:00.000000000 +0100
@@ -665,7 +665,7 @@
 	}
 }
 
-struct ethtool_ops ixgb_ethtool_ops = {
+static struct ethtool_ops ixgb_ethtool_ops = {
 	.get_settings = ixgb_get_settings,
 	.set_settings = ixgb_set_settings,
 	.get_drvinfo = ixgb_get_drvinfo,
--- linux-2.6.11-rc3-mm2-full/drivers/net/ixgb/ixgb_hw.c.old	2005-02-16 16:03:16.000000000 +0100
+++ linux-2.6.11-rc3-mm2-full/drivers/net/ixgb/ixgb_hw.c	2005-02-16 16:06:42.000000000 +0100
@@ -47,9 +47,17 @@
 
 static ixgb_phy_type ixgb_identify_phy(struct ixgb_hw *hw);
 
-uint32_t ixgb_mac_reset(struct ixgb_hw *hw);
+static void ixgb_clear_hw_cntrs(struct ixgb_hw *hw);
+static void ixgb_clear_vfta(struct ixgb_hw *hw);
+static void ixgb_init_rx_addrs(struct ixgb_hw *hw);
+static uint16_t ixgb_read_phy_reg(struct ixgb_hw *hw,
+				  uint32_t reg_address,
+				  uint32_t phy_address,
+				  uint32_t device_type);
+static boolean_t ixgb_setup_fc(struct ixgb_hw *hw);
+static boolean_t mac_addr_valid(uint8_t *mac_addr);
 
-uint32_t ixgb_mac_reset(struct ixgb_hw *hw)
+static uint32_t ixgb_mac_reset(struct ixgb_hw *hw)
 {
 	uint32_t ctrl_reg;
 
@@ -335,7 +343,7 @@
  * of the receive addresss registers. Clears the multicast table. Assumes
  * the receiver is in reset when the routine is called.
  *****************************************************************************/
-void
+static void
 ixgb_init_rx_addrs(struct ixgb_hw *hw)
 {
 	uint32_t i;
@@ -604,7 +612,7 @@
  *
  * hw - Struct containing variables accessed by shared code
  *****************************************************************************/
-void
+static void
 ixgb_clear_vfta(struct ixgb_hw *hw)
 {
 	uint32_t offset;
@@ -620,7 +628,7 @@
  * hw - Struct containing variables accessed by shared code
  *****************************************************************************/
 
-boolean_t
+static boolean_t
 ixgb_setup_fc(struct ixgb_hw *hw)
 {
 	uint32_t ctrl_reg;
@@ -722,7 +730,7 @@
  * This requires that first an address cycle command is sent, followed by a
  * read command.
  *****************************************************************************/
-uint16_t
+static uint16_t
 ixgb_read_phy_reg(struct ixgb_hw *hw,
 		uint32_t reg_address,
 		uint32_t phy_address,
@@ -815,7 +823,7 @@
  * This requires that first an address cycle command is sent, followed by a
  * write command.
  *****************************************************************************/
-void
+static void
 ixgb_write_phy_reg(struct ixgb_hw *hw,
 			uint32_t reg_address,
 			uint32_t phy_address,
@@ -959,7 +967,7 @@
  *
  * hw - Struct containing variables accessed by shared code
  *****************************************************************************/
-void
+static void
 ixgb_clear_hw_cntrs(struct ixgb_hw *hw)
 {
 	volatile uint32_t temp_reg;
@@ -1114,7 +1122,7 @@
  * mac_addr - pointer to MAC address.
  *
  *****************************************************************************/
-boolean_t
+static boolean_t
 mac_addr_valid(uint8_t *mac_addr)
 {
 	boolean_t is_valid = TRUE;
--- linux-2.6.12-rc3-mm3-full/drivers/net/ixgb/ixgb_main.c.old	2005-05-06 22:08:38.000000000 +0200
+++ linux-2.6.12-rc3-mm3-full/drivers/net/ixgb/ixgb_main.c	2005-05-06 22:09:29.000000000 +0200
@@ -40,7 +40,7 @@
  */
 
 char ixgb_driver_name[] = "ixgb";
-char ixgb_driver_string[] = "Intel(R) PRO/10GbE Network Driver";
+static char ixgb_driver_string[] = "Intel(R) PRO/10GbE Network Driver";
 
 #ifndef CONFIG_IXGB_NAPI
 #define DRIVERNAPI
@@ -49,7 +49,7 @@
 #endif
 #define DRV_VERSION "1.0.90-k2"DRIVERNAPI
 char ixgb_driver_version[] = DRV_VERSION;
-char ixgb_copyright[] = "Copyright (c) 1999-2005 Intel Corporation.";
+static char ixgb_copyright[] = "Copyright (c) 1999-2005 Intel Corporation.";
 
 /* ixgb_pci_tbl - PCI Device ID Table
  *
@@ -130,7 +130,7 @@
 static void ixgb_netpoll(struct net_device *dev);
 #endif
 
-struct notifier_block ixgb_notifier_reboot = {
+static struct notifier_block ixgb_notifier_reboot = {
 	.notifier_call = ixgb_notify_reboot,
 	.next = NULL,
 	.priority = 0

^ permalink raw reply	[flat|nested] 8+ messages in thread
* RE: [2.6 patch] drivers/net/ixgb/: possible cleanups
@ 2005-02-18 18:38 Venkatesan, Ganesh
  0 siblings, 0 replies; 8+ messages in thread
From: Venkatesan, Ganesh @ 2005-02-18 18:38 UTC (permalink / raw)
  To: Adrian Bunk, Veeraiyan, Ayyappan, Ronciak, John
  Cc: jgarzik, linux-net, linux-kernel

>
>This patch contains the following possible cleanups:

Thanks for the comments. Although all your comments are valid, we will
not be able to apply your patch as is. This is because of the way we
have set up our source code (some of which is shared with non-GPL code).
We will submit a patch that addresses all the issues you've raised here.

We will apply your patch to ixgb_main.c as is.

Thanks,
Ganesh.


^ permalink raw reply	[flat|nested] 8+ messages in thread
* [2.6 patch] drivers/net/ixgb/: possible cleanups
@ 2005-02-17 20:52 Adrian Bunk
  0 siblings, 0 replies; 8+ messages in thread
From: Adrian Bunk @ 2005-02-17 20:52 UTC (permalink / raw)
  To: ayyappan.veeraiyan, ganesh.venkatesan, john.ronciak
  Cc: jgarzik, linux-net, linux-kernel

This patch contains the following possible cleanups:
- make needlessly global code static
- remove the following unused global functions:
  - ixgb_ee.c: ixgb_get_ee_compatibility
  - ixgb_ee.c: ixgb_get_ee_init_ctrl_reg_1
  - ixgb_ee.c: ixgb_get_ee_init_ctrl_reg_2
  - ixgb_ee.c: ixgb_get_ee_subsystem_id
  - ixgb_ee.c: ixgb_get_ee_subvendor_id
  - ixgb_ee.c: ixgb_get_ee_vendor_id
  - ixgb_ee.c: ixgb_get_ee_swdpins_reg
  - ixgb_ee.c: ixgb_get_ee_d3_power
  - ixgb_ee.c: ixgb_get_ee_d0_power

Signed-off-by: Adrian Bunk <bunk@stusta.de>

---

 drivers/net/ixgb/ixgb_ee.c      |  170 --------------------------------
 drivers/net/ixgb/ixgb_ethtool.c |    2 
 drivers/net/ixgb/ixgb_hw.c      |   26 +++-
 drivers/net/ixgb/ixgb_hw.h      |   26 ----
 drivers/net/ixgb/ixgb_main.c    |    6 -
 5 files changed, 21 insertions(+), 209 deletions(-)

--- linux-2.6.11-rc3-mm2-full/drivers/net/ixgb/ixgb_hw.h.old	2005-02-16 15:55:21.000000000 +0100
+++ linux-2.6.11-rc3-mm2-full/drivers/net/ixgb/ixgb_hw.h	2005-02-16 16:06:28.000000000 +0100
@@ -784,23 +784,8 @@
 extern boolean_t ixgb_adapter_stop(struct ixgb_hw *hw);
 extern boolean_t ixgb_init_hw(struct ixgb_hw *hw);
 extern boolean_t ixgb_adapter_start(struct ixgb_hw *hw);
-extern void ixgb_init_rx_addrs(struct ixgb_hw *hw);
 extern void ixgb_check_for_link(struct ixgb_hw *hw);
 extern boolean_t ixgb_check_for_bad_link(struct ixgb_hw *hw);
-extern boolean_t ixgb_setup_fc(struct ixgb_hw *hw);
-extern void ixgb_clear_hw_cntrs(struct ixgb_hw *hw);
-extern boolean_t mac_addr_valid(uint8_t *mac_addr);
-
-extern uint16_t ixgb_read_phy_reg(struct ixgb_hw *hw,
-				uint32_t reg_addr,
-				uint32_t phy_addr,
-				uint32_t device_type);
-
-extern void ixgb_write_phy_reg(struct ixgb_hw *hw,
-				uint32_t reg_addr,
-				uint32_t phy_addr,
-				uint32_t device_type,
-				uint16_t data);
 
 extern void ixgb_rar_set(struct ixgb_hw *hw,
 				uint8_t *addr,
@@ -818,21 +803,10 @@
 				 uint32_t offset,
 				 uint32_t value);
 
-extern void ixgb_clear_vfta(struct ixgb_hw *hw);
-
 /* Access functions to eeprom data */
 void ixgb_get_ee_mac_addr(struct ixgb_hw *hw, uint8_t *mac_addr);
-uint16_t ixgb_get_ee_compatibility(struct ixgb_hw *hw);
 uint32_t ixgb_get_ee_pba_number(struct ixgb_hw *hw);
-uint16_t ixgb_get_ee_init_ctrl_reg_1(struct ixgb_hw *hw);
-uint16_t ixgb_get_ee_init_ctrl_reg_2(struct ixgb_hw *hw);
-uint16_t ixgb_get_ee_subsystem_id(struct ixgb_hw *hw);
-uint16_t ixgb_get_ee_subvendor_id(struct ixgb_hw *hw);
 uint16_t ixgb_get_ee_device_id(struct ixgb_hw *hw);
-uint16_t ixgb_get_ee_vendor_id(struct ixgb_hw *hw);
-uint16_t ixgb_get_ee_swdpins_reg(struct ixgb_hw *hw);
-uint8_t ixgb_get_ee_d3_power(struct ixgb_hw *hw);
-uint8_t ixgb_get_ee_d0_power(struct ixgb_hw *hw);
 boolean_t ixgb_get_eeprom_data(struct ixgb_hw *hw);
 uint16_t ixgb_get_eeprom_word(struct ixgb_hw *hw, uint16_t index);
 
--- linux-2.6.11-rc3-mm2-full/drivers/net/ixgb/ixgb_ee.c.old	2005-02-16 15:55:34.000000000 +0100
+++ linux-2.6.11-rc3-mm2-full/drivers/net/ixgb/ixgb_ee.c	2005-02-16 15:58:37.000000000 +0100
@@ -560,25 +560,6 @@
 }
 
 /******************************************************************************
- * return the compatibility flags from EEPROM
- *
- * hw - Struct containing variables accessed by shared code
- *
- * Returns:
- *          compatibility flags if EEPROM contents are valid, 0 otherwise
- ******************************************************************************/
-uint16_t
-ixgb_get_ee_compatibility(struct ixgb_hw *hw)
-{
-	struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom;
-
-	if(ixgb_check_and_get_eeprom_data(hw) == TRUE)
-		return(ee_map->compatibility);
-
-	return(0);
-}
-
-/******************************************************************************
  * return the Printed Board Assembly number from EEPROM
  *
  * hw - Struct containing variables accessed by shared code
@@ -597,82 +578,6 @@
 }
 
 /******************************************************************************
- * return the Initialization Control Word 1 from EEPROM
- *
- * hw - Struct containing variables accessed by shared code
- *
- * Returns:
- *          Initialization Control Word 1 if EEPROM contents are valid, 0 otherwise
- ******************************************************************************/
-uint16_t
-ixgb_get_ee_init_ctrl_reg_1(struct ixgb_hw *hw)
-{
-	struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom;
-
-	if(ixgb_check_and_get_eeprom_data(hw) == TRUE)
-		return(ee_map->init_ctrl_reg_1);
-
-	return(0);
-}
-
-/******************************************************************************
- * return the Initialization Control Word 2 from EEPROM
- *
- * hw - Struct containing variables accessed by shared code
- *
- * Returns:
- *          Initialization Control Word 2 if EEPROM contents are valid, 0 otherwise
- ******************************************************************************/
-uint16_t
-ixgb_get_ee_init_ctrl_reg_2(struct ixgb_hw *hw)
-{
-	struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom;
-
-	if(ixgb_check_and_get_eeprom_data(hw) == TRUE)
-		return(ee_map->init_ctrl_reg_2);
-
-	return(0);
-}
-
-/******************************************************************************
- * return the Subsystem Id from EEPROM
- *
- * hw - Struct containing variables accessed by shared code
- *
- * Returns:
- *          Subsystem Id if EEPROM contents are valid, 0 otherwise
- ******************************************************************************/
-uint16_t
-ixgb_get_ee_subsystem_id(struct ixgb_hw *hw)
-{
-	struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom;
-
-	if(ixgb_check_and_get_eeprom_data(hw) == TRUE)
-	   return(ee_map->subsystem_id);
-
-	return(0);
-}
-
-/******************************************************************************
- * return the Sub Vendor Id from EEPROM
- *
- * hw - Struct containing variables accessed by shared code
- *
- * Returns:
- *          Sub Vendor Id if EEPROM contents are valid, 0 otherwise
- ******************************************************************************/
-uint16_t
-ixgb_get_ee_subvendor_id(struct ixgb_hw *hw)
-{
-	struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom;
-
-	if(ixgb_check_and_get_eeprom_data(hw) == TRUE)
-		return(ee_map->subvendor_id);
-
-	return(0);
-}
-
-/******************************************************************************
  * return the Device Id from EEPROM
  *
  * hw - Struct containing variables accessed by shared code
@@ -691,78 +596,3 @@
 	return(0);
 }
 
-/******************************************************************************
- * return the Vendor Id from EEPROM
- *
- * hw - Struct containing variables accessed by shared code
- *
- * Returns:
- *          Device Id if EEPROM contents are valid, 0 otherwise
- ******************************************************************************/
-uint16_t
-ixgb_get_ee_vendor_id(struct ixgb_hw *hw)
-{
-	struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom;
-
-	if(ixgb_check_and_get_eeprom_data(hw) == TRUE)
-		return(ee_map->vendor_id);
-
-	return(0);
-}
-
-/******************************************************************************
- * return the Software Defined Pins Register from EEPROM
- *
- * hw - Struct containing variables accessed by shared code
- *
- * Returns:
- *          SDP Register if EEPROM contents are valid, 0 otherwise
- ******************************************************************************/
-uint16_t
-ixgb_get_ee_swdpins_reg(struct ixgb_hw *hw)
-{
-	struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom;
-
-	if(ixgb_check_and_get_eeprom_data(hw) == TRUE)
-		return(ee_map->swdpins_reg);
-
-	return(0);
-}
-
-/******************************************************************************
- * return the D3 Power Management Bits from EEPROM
- *
- * hw - Struct containing variables accessed by shared code
- *
- * Returns:
- *          D3 Power Management Bits if EEPROM contents are valid, 0 otherwise
- ******************************************************************************/
-uint8_t
-ixgb_get_ee_d3_power(struct ixgb_hw *hw)
-{
-	struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom;
-
-	if(ixgb_check_and_get_eeprom_data(hw) == TRUE)
-		return(ee_map->d3_power);
-
-	return(0);
-}
-
-/******************************************************************************
- * return the D0 Power Management Bits from EEPROM
- *
- * hw - Struct containing variables accessed by shared code
- *
- * Returns:
- *          D0 Power Management Bits if EEPROM contents are valid, 0 otherwise
- ******************************************************************************/
-uint8_t
-ixgb_get_ee_d0_power(struct ixgb_hw *hw)
-{
-	struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom;
-
-	if(ixgb_check_and_get_eeprom_data(hw) == TRUE)
-		return(ee_map->d0_power);
-
-	return(0);
-}
--- linux-2.6.11-rc3-mm2-full/drivers/net/ixgb/ixgb_ethtool.c.old	2005-02-16 15:58:51.000000000 +0100
+++ linux-2.6.11-rc3-mm2-full/drivers/net/ixgb/ixgb_ethtool.c	2005-02-16 15:59:00.000000000 +0100
@@ -665,7 +665,7 @@
 	}
 }
 
-struct ethtool_ops ixgb_ethtool_ops = {
+static struct ethtool_ops ixgb_ethtool_ops = {
 	.get_settings = ixgb_get_settings,
 	.set_settings = ixgb_set_settings,
 	.get_drvinfo = ixgb_get_drvinfo,
--- linux-2.6.11-rc3-mm2-full/drivers/net/ixgb/ixgb_hw.c.old	2005-02-16 16:03:16.000000000 +0100
+++ linux-2.6.11-rc3-mm2-full/drivers/net/ixgb/ixgb_hw.c	2005-02-16 16:06:42.000000000 +0100
@@ -47,9 +47,17 @@
 
 static ixgb_phy_type ixgb_identify_phy(struct ixgb_hw *hw);
 
-uint32_t ixgb_mac_reset(struct ixgb_hw *hw);
+static void ixgb_clear_hw_cntrs(struct ixgb_hw *hw);
+static void ixgb_clear_vfta(struct ixgb_hw *hw);
+static void ixgb_init_rx_addrs(struct ixgb_hw *hw);
+static uint16_t ixgb_read_phy_reg(struct ixgb_hw *hw,
+				  uint32_t reg_address,
+				  uint32_t phy_address,
+				  uint32_t device_type);
+static boolean_t ixgb_setup_fc(struct ixgb_hw *hw);
+static boolean_t mac_addr_valid(uint8_t *mac_addr);
 
-uint32_t ixgb_mac_reset(struct ixgb_hw *hw)
+static uint32_t ixgb_mac_reset(struct ixgb_hw *hw)
 {
 	uint32_t ctrl_reg;
 
@@ -335,7 +343,7 @@
  * of the receive addresss registers. Clears the multicast table. Assumes
  * the receiver is in reset when the routine is called.
  *****************************************************************************/
-void
+static void
 ixgb_init_rx_addrs(struct ixgb_hw *hw)
 {
 	uint32_t i;
@@ -604,7 +612,7 @@
  *
  * hw - Struct containing variables accessed by shared code
  *****************************************************************************/
-void
+static void
 ixgb_clear_vfta(struct ixgb_hw *hw)
 {
 	uint32_t offset;
@@ -620,7 +628,7 @@
  * hw - Struct containing variables accessed by shared code
  *****************************************************************************/
 
-boolean_t
+static boolean_t
 ixgb_setup_fc(struct ixgb_hw *hw)
 {
 	uint32_t ctrl_reg;
@@ -722,7 +730,7 @@
  * This requires that first an address cycle command is sent, followed by a
  * read command.
  *****************************************************************************/
-uint16_t
+static uint16_t
 ixgb_read_phy_reg(struct ixgb_hw *hw,
 		uint32_t reg_address,
 		uint32_t phy_address,
@@ -815,7 +823,7 @@
  * This requires that first an address cycle command is sent, followed by a
  * write command.
  *****************************************************************************/
-void
+static void
 ixgb_write_phy_reg(struct ixgb_hw *hw,
 			uint32_t reg_address,
 			uint32_t phy_address,
@@ -959,7 +967,7 @@
  *
  * hw - Struct containing variables accessed by shared code
  *****************************************************************************/
-void
+static void
 ixgb_clear_hw_cntrs(struct ixgb_hw *hw)
 {
 	volatile uint32_t temp_reg;
@@ -1114,7 +1122,7 @@
  * mac_addr - pointer to MAC address.
  *
  *****************************************************************************/
-boolean_t
+static boolean_t
 mac_addr_valid(uint8_t *mac_addr)
 {
 	boolean_t is_valid = TRUE;
--- linux-2.6.11-rc3-mm2-full/drivers/net/ixgb/ixgb_main.c.old	2005-02-16 16:06:54.000000000 +0100
+++ linux-2.6.11-rc3-mm2-full/drivers/net/ixgb/ixgb_main.c	2005-02-16 16:07:31.000000000 +0100
@@ -37,14 +37,14 @@
  */
 
 char ixgb_driver_name[] = "ixgb";
-char ixgb_driver_string[] = "Intel(R) PRO/10GbE Network Driver";
+static char ixgb_driver_string[] = "Intel(R) PRO/10GbE Network Driver";
 #ifndef CONFIG_IXGB_NAPI
 #define DRIVERNAPI
 #else
 #define DRIVERNAPI "-NAPI"
 #endif
 char ixgb_driver_version[] = "1.0.87-k2"DRIVERNAPI;
-char ixgb_copyright[] = "Copyright (c) 1999-2004 Intel Corporation.";
+static char ixgb_copyright[] = "Copyright (c) 1999-2004 Intel Corporation.";
 
 /* ixgb_pci_tbl - PCI Device ID Table
  *
@@ -125,7 +125,7 @@
 static void ixgb_netpoll(struct net_device *dev);
 #endif
 
-struct notifier_block ixgb_notifier_reboot = {
+static struct notifier_block ixgb_notifier_reboot = {
 	.notifier_call = ixgb_notify_reboot,
 	.next = NULL,
 	.priority = 0


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2005-05-07 13:09 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-06 21:18 [2.6 patch] drivers/net/ixgb/: possible cleanups Adrian Bunk
2005-05-06 22:35 ` Ganesh Venkatesan
2005-05-07 12:24   ` Arjan van de Ven
2005-05-07 12:38     ` Adrian Bunk
2005-05-07 13:09       ` Arjan van de Ven
2005-05-07 12:40   ` Christoph Hellwig
  -- strict thread matches above, loose matches on Subject: below --
2005-02-18 18:38 Venkatesan, Ganesh
2005-02-17 20:52 Adrian Bunk

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).