e1000e: cosmetic move of #defines and prototypes to the new 82571.h
authorBruce Allan <bruce.w.allan@intel.com>
Tue, 22 Jan 2013 08:44:04 +0000 (08:44 +0000)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Tue, 5 Feb 2013 07:24:41 +0000 (23:24 -0800)
Move #defines and function prototypes specific to the 8257x family of
devices (82571, 82572, 82573, 82574, 82583) to the new 82571.h header file
(the convention for Intel wired ethernet drivers is to use the name of the
first device in the family for related file and function names).  These
defines and function prototypes can be used by other files in the driver
and moving them to the 8257x-family-specific file makes it clearer to which
devices they are applicable.

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/82571.c
drivers/net/ethernet/intel/e1000e/82571.h [new file with mode: 0644]
drivers/net/ethernet/intel/e1000e/defines.h
drivers/net/ethernet/intel/e1000e/e1000.h
drivers/net/ethernet/intel/e1000e/hw.h
drivers/net/ethernet/intel/e1000e/netdev.c

index cf86090edd3b3c382cbf6e934391906ccb20aa58..1db7e3df43ea8cacdd497d07311c62eea10e1a37 100644 (file)
 
 #include "e1000.h"
 
-#define ID_LED_RESERVED_F746 0xF746
-#define ID_LED_DEFAULT_82573 ((ID_LED_DEF1_DEF2 << 12) | \
-                             (ID_LED_OFF1_ON2  <<  8) | \
-                             (ID_LED_DEF1_DEF2 <<  4) | \
-                             (ID_LED_DEF1_DEF2))
-
-#define E1000_GCR_L1_ACT_WITHOUT_L0S_RX 0x08000000
-#define AN_RETRY_COUNT          5 /* Autoneg Retry Count value */
-#define E1000_BASE1000T_STATUS          10
-#define E1000_IDLE_ERROR_COUNT_MASK     0xFF
-#define E1000_RECEIVE_ERROR_COUNTER     21
-#define E1000_RECEIVE_ERROR_MAX         0xFFFF
-
-#define E1000_NVM_INIT_CTRL2_MNGM 0x6000 /* Manageability Operation Mode mask */
-
 static s32 e1000_get_phy_id_82571(struct e1000_hw *hw);
 static s32 e1000_setup_copper_link_82571(struct e1000_hw *hw);
 static s32 e1000_setup_fiber_serdes_link_82571(struct e1000_hw *hw);
diff --git a/drivers/net/ethernet/intel/e1000e/82571.h b/drivers/net/ethernet/intel/e1000e/82571.h
new file mode 100644 (file)
index 0000000..85cb1a3
--- /dev/null
@@ -0,0 +1,58 @@
+/*******************************************************************************
+
+  Intel PRO/1000 Linux driver
+  Copyright(c) 1999 - 2013 Intel Corporation.
+
+  This program is free software; you can redistribute it and/or modify it
+  under the terms and conditions of the GNU General Public License,
+  version 2, as published by the Free Software Foundation.
+
+  This program is distributed in the hope it will be useful, but WITHOUT
+  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+  more details.
+
+  You should have received a copy of the GNU General Public License along with
+  this program; if not, write to the Free Software Foundation, Inc.,
+  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
+
+  The full GNU General Public License is included in this distribution in
+  the file called "COPYING".
+
+  Contact Information:
+  Linux NICS <linux.nics@intel.com>
+  e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
+  Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
+
+*******************************************************************************/
+
+#ifndef _E1000E_82571_H_
+#define _E1000E_82571_H_
+
+#define ID_LED_RESERVED_F746   0xF746
+#define ID_LED_DEFAULT_82573   ((ID_LED_DEF1_DEF2 << 12) | \
+                                (ID_LED_OFF1_ON2  <<  8) | \
+                                (ID_LED_DEF1_DEF2 <<  4) | \
+                                (ID_LED_DEF1_DEF2))
+
+#define E1000_GCR_L1_ACT_WITHOUT_L0S_RX        0x08000000
+#define AN_RETRY_COUNT         5       /* Autoneg Retry Count value */
+
+/* Intr Throttling - RW */
+#define E1000_EITR_82574(_n)   (0x000E8 + (0x4 * (_n)))
+
+#define E1000_EIAC_82574       0x000DC /* Ext. Interrupt Auto Clear - RW */
+#define E1000_EIAC_MASK_82574  0x01F00000
+
+/* Manageability Operation Mode mask */
+#define E1000_NVM_INIT_CTRL2_MNGM      0x6000
+
+#define E1000_BASE1000T_STATUS         10
+#define E1000_IDLE_ERROR_COUNT_MASK    0xFF
+#define E1000_RECEIVE_ERROR_COUNTER    21
+#define E1000_RECEIVE_ERROR_MAX                0xFFFF
+bool e1000_check_phy_82574(struct e1000_hw *hw);
+bool e1000e_get_laa_state_82571(struct e1000_hw *hw);
+void e1000e_set_laa_state_82571(struct e1000_hw *hw, bool state);
+
+#endif
index 615b900c0152f8d44f08cd9a6c4b32f2e9c5c857..b425544144ec0bdc98892a5bf2b626deddbdbd3e 100644 (file)
 #define NVM_ALT_MAC_ADDR_PTR       0x0037
 #define NVM_CHECKSUM_REG           0x003F
 
-#define E1000_NVM_INIT_CTRL2_MNGM 0x6000 /* Manageability Operation Mode mask */
-
 #define E1000_NVM_CFG_DONE_PORT_0  0x40000 /* MNG config cycle done */
 #define E1000_NVM_CFG_DONE_PORT_1  0x80000 /* ...for second port */
 
index 4b0bd9c225ccb14eb9654d3f9c753c3cd1a7e92f..12c5d404350524cd892b5b3f01620c79fc637c29 100644 (file)
@@ -579,9 +579,6 @@ extern s32 e1000_read_pba_string_generic(struct e1000_hw *hw, u8 *pba_num,
 
 extern bool e1000e_enable_mng_pass_thru(struct e1000_hw *hw);
 
-extern bool e1000e_get_laa_state_82571(struct e1000_hw *hw);
-extern void e1000e_set_laa_state_82571(struct e1000_hw *hw, bool state);
-
 extern void e1000e_write_protect_nvm_ich8lan(struct e1000_hw *hw);
 extern void e1000e_set_kmrn_lock_loss_workaround_ich8lan(struct e1000_hw *hw,
                                                 bool state);
@@ -703,7 +700,6 @@ extern s32 e1000_get_phy_info_ife(struct e1000_hw *hw);
 extern s32 e1000_check_polarity_ife(struct e1000_hw *hw);
 extern s32 e1000_phy_force_speed_duplex_ife(struct e1000_hw *hw);
 extern s32 e1000_check_polarity_igp(struct e1000_hw *hw);
-extern bool e1000_check_phy_82574(struct e1000_hw *hw);
 extern s32 e1000_read_emi_reg_locked(struct e1000_hw *hw, u16 addr, u16 *data);
 extern void e1000e_ptp_init(struct e1000_adapter *adapter);
 extern void e1000e_ptp_remove(struct e1000_adapter *adapter);
index f32b19af9a7204421a526812f8a21d50ace2612f..6f94437d8c0e17a33cb30402c20c4797b98425c7 100644 (file)
@@ -54,12 +54,9 @@ enum e1e_registers {
        E1000_ICS      = 0x000C8, /* Interrupt Cause Set - WO */
        E1000_IMS      = 0x000D0, /* Interrupt Mask Set - RW */
        E1000_IMC      = 0x000D8, /* Interrupt Mask Clear - WO */
-       E1000_EIAC_82574 = 0x000DC, /* Ext. Interrupt Auto Clear - RW */
        E1000_IAM      = 0x000E0, /* Interrupt Acknowledge Auto Mask */
        E1000_IVAR     = 0x000E4, /* Interrupt Vector Allocation - RW */
        E1000_FEXTNVM7  = 0x000E4, /* Future Extended NVM 7 - RW */
-       E1000_EITR_82574_BASE = 0x000E8, /* Interrupt Throttling - RW */
-#define E1000_EITR_82574(_n) (E1000_EITR_82574_BASE + (_n << 2))
        E1000_LPIC     = 0x000FC, /* Low Power Idle Control - RW */
        E1000_RCTL     = 0x00100, /* Rx Control - RW */
        E1000_FCTTV    = 0x00170, /* Flow Control Transmit Timer Value - RW */
@@ -1005,4 +1002,6 @@ struct e1000_hw {
        } dev_spec;
 };
 
+#include "82571.h"
+
 #endif
index e0eb5dddf3eae5b3f09b7acb0679270c3b0e6840..6fcf9e8008c0280e493810ef78a5d1a9f0dad4a4 100644 (file)
@@ -2024,7 +2024,6 @@ static void e1000_configure_msix(struct e1000_adapter *adapter)
        ctrl_ext |= E1000_CTRL_EXT_PBA_CLR;
 
        /* Auto-Mask Other interrupts upon ICR read */
-#define E1000_EIAC_MASK_82574   0x01F00000
        ew32(IAM, ~E1000_EIAC_MASK_82574 | E1000_IMS_OTHER);
        ctrl_ext |= E1000_CTRL_EXT_EIAME;
        ew32(CTRL_EXT, ctrl_ext);