aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-02-24 20:57:16 -0500
committerDavid S. Miller <davem@davemloft.net>2008-02-24 20:57:16 -0500
commit323dbaba2cfab170c656f5d68986ff0ced5b421c (patch)
tree99d2ef0d64df0036a4a9d2ef054b5bf20dd7fbd5 /drivers
parentbfa274e2436fc7ef72ef51c878083647f1cfd429 (diff)
parent3bf319a787a881aa6ad8213b98b93b8de2b6f0e0 (diff)
Merge branch 'upstream-davem' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/cs89x0.c12
-rw-r--r--drivers/net/e1000e/82571.c22
-rw-r--r--drivers/net/e1000e/defines.h10
-rw-r--r--drivers/net/e1000e/e1000.h3
-rw-r--r--drivers/net/e1000e/hw.h4
-rw-r--r--drivers/net/e1000e/ich8lan.c24
-rw-r--r--drivers/net/e1000e/lib.c50
-rw-r--r--drivers/net/e1000e/netdev.c18
-rw-r--r--drivers/net/e1000e/phy.c10
-rw-r--r--drivers/net/ehea/ehea.h34
-rw-r--r--drivers/net/ehea/ehea_main.c281
-rw-r--r--drivers/net/fs_enet/fs_enet-main.c7
-rw-r--r--drivers/net/gianfar.c14
-rw-r--r--drivers/net/igb/igb_main.c15
-rw-r--r--drivers/net/ixgb/ixgb_ethtool.c1
-rw-r--r--drivers/net/macb.c2
-rw-r--r--drivers/net/pcmcia/pcnet_cs.c10
-rw-r--r--drivers/net/phy/mdio_bus.c4
-rw-r--r--drivers/net/sis190.c15
-rw-r--r--drivers/net/sky2.c123
-rw-r--r--drivers/net/sky2.h27
-rw-r--r--drivers/net/tlan.c64
-rw-r--r--drivers/net/tulip/uli526x.c12
-rw-r--r--drivers/net/via-rhine.c2
-rw-r--r--drivers/net/virtio_net.c2
-rw-r--r--drivers/s390/net/claw.c39
26 files changed, 524 insertions, 281 deletions
diff --git a/drivers/net/cs89x0.c b/drivers/net/cs89x0.c
index 571750975137..348371fda597 100644
--- a/drivers/net/cs89x0.c
+++ b/drivers/net/cs89x0.c
@@ -172,30 +172,30 @@ static char version[] __initdata =
172 them to system IRQ numbers. This mapping is card specific and is set to 172 them to system IRQ numbers. This mapping is card specific and is set to
173 the configuration of the Cirrus Eval board for this chip. */ 173 the configuration of the Cirrus Eval board for this chip. */
174#ifdef CONFIG_ARCH_CLPS7500 174#ifdef CONFIG_ARCH_CLPS7500
175static unsigned int netcard_portlist[] __initdata = 175static unsigned int netcard_portlist[] __used __initdata =
176 { 0x80090303, 0x300, 0x320, 0x340, 0x360, 0x200, 0x220, 0x240, 0x260, 0x280, 0x2a0, 0x2c0, 0x2e0, 0}; 176 { 0x80090303, 0x300, 0x320, 0x340, 0x360, 0x200, 0x220, 0x240, 0x260, 0x280, 0x2a0, 0x2c0, 0x2e0, 0};
177static unsigned int cs8900_irq_map[] = {12,0,0,0}; 177static unsigned int cs8900_irq_map[] = {12,0,0,0};
178#elif defined(CONFIG_SH_HICOSH4) 178#elif defined(CONFIG_SH_HICOSH4)
179static unsigned int netcard_portlist[] __initdata = 179static unsigned int netcard_portlist[] __used __initdata =
180 { 0x0300, 0}; 180 { 0x0300, 0};
181static unsigned int cs8900_irq_map[] = {1,0,0,0}; 181static unsigned int cs8900_irq_map[] = {1,0,0,0};
182#elif defined(CONFIG_MACH_IXDP2351) 182#elif defined(CONFIG_MACH_IXDP2351)
183static unsigned int netcard_portlist[] __initdata = {IXDP2351_VIRT_CS8900_BASE, 0}; 183static unsigned int netcard_portlist[] __used __initdata = {IXDP2351_VIRT_CS8900_BASE, 0};
184static unsigned int cs8900_irq_map[] = {IRQ_IXDP2351_CS8900, 0, 0, 0}; 184static unsigned int cs8900_irq_map[] = {IRQ_IXDP2351_CS8900, 0, 0, 0};
185#include <asm/irq.h> 185#include <asm/irq.h>
186#elif defined(CONFIG_ARCH_IXDP2X01) 186#elif defined(CONFIG_ARCH_IXDP2X01)
187#include <asm/irq.h> 187#include <asm/irq.h>
188static unsigned int netcard_portlist[] __initdata = {IXDP2X01_CS8900_VIRT_BASE, 0}; 188static unsigned int netcard_portlist[] __used __initdata = {IXDP2X01_CS8900_VIRT_BASE, 0};
189static unsigned int cs8900_irq_map[] = {IRQ_IXDP2X01_CS8900, 0, 0, 0}; 189static unsigned int cs8900_irq_map[] = {IRQ_IXDP2X01_CS8900, 0, 0, 0};
190#elif defined(CONFIG_ARCH_PNX010X) 190#elif defined(CONFIG_ARCH_PNX010X)
191#include <asm/irq.h> 191#include <asm/irq.h>
192#include <asm/arch/gpio.h> 192#include <asm/arch/gpio.h>
193#define CIRRUS_DEFAULT_BASE IO_ADDRESS(EXT_STATIC2_s0_BASE + 0x200000) /* = Physical address 0x48200000 */ 193#define CIRRUS_DEFAULT_BASE IO_ADDRESS(EXT_STATIC2_s0_BASE + 0x200000) /* = Physical address 0x48200000 */
194#define CIRRUS_DEFAULT_IRQ VH_INTC_INT_NUM_CASCADED_INTERRUPT_1 /* Event inputs bank 1 - ID 35/bit 3 */ 194#define CIRRUS_DEFAULT_IRQ VH_INTC_INT_NUM_CASCADED_INTERRUPT_1 /* Event inputs bank 1 - ID 35/bit 3 */
195static unsigned int netcard_portlist[] __initdata = {CIRRUS_DEFAULT_BASE, 0}; 195static unsigned int netcard_portlist[] __used __initdata = {CIRRUS_DEFAULT_BASE, 0};
196static unsigned int cs8900_irq_map[] = {CIRRUS_DEFAULT_IRQ, 0, 0, 0}; 196static unsigned int cs8900_irq_map[] = {CIRRUS_DEFAULT_IRQ, 0, 0, 0};
197#else 197#else
198static unsigned int netcard_portlist[] __initdata = 198static unsigned int netcard_portlist[] __used __initdata =
199 { 0x300, 0x320, 0x340, 0x360, 0x200, 0x220, 0x240, 0x260, 0x280, 0x2a0, 0x2c0, 0x2e0, 0}; 199 { 0x300, 0x320, 0x340, 0x360, 0x200, 0x220, 0x240, 0x260, 0x280, 0x2a0, 0x2c0, 0x2e0, 0};
200static unsigned int cs8900_irq_map[] = {10,11,12,5}; 200static unsigned int cs8900_irq_map[] = {10,11,12,5};
201#endif 201#endif
diff --git a/drivers/net/e1000e/82571.c b/drivers/net/e1000e/82571.c
index 3beace55b58d..7fe20310eb5f 100644
--- a/drivers/net/e1000e/82571.c
+++ b/drivers/net/e1000e/82571.c
@@ -438,7 +438,7 @@ static void e1000_release_nvm_82571(struct e1000_hw *hw)
438 * For non-82573 silicon, write data to EEPROM at offset using SPI interface. 438 * For non-82573 silicon, write data to EEPROM at offset using SPI interface.
439 * 439 *
440 * If e1000e_update_nvm_checksum is not called after this function, the 440 * If e1000e_update_nvm_checksum is not called after this function, the
441 * EEPROM will most likley contain an invalid checksum. 441 * EEPROM will most likely contain an invalid checksum.
442 **/ 442 **/
443static s32 e1000_write_nvm_82571(struct e1000_hw *hw, u16 offset, u16 words, 443static s32 e1000_write_nvm_82571(struct e1000_hw *hw, u16 offset, u16 words,
444 u16 *data) 444 u16 *data)
@@ -547,7 +547,7 @@ static s32 e1000_validate_nvm_checksum_82571(struct e1000_hw *hw)
547 * poll for completion. 547 * poll for completion.
548 * 548 *
549 * If e1000e_update_nvm_checksum is not called after this function, the 549 * If e1000e_update_nvm_checksum is not called after this function, the
550 * EEPROM will most likley contain an invalid checksum. 550 * EEPROM will most likely contain an invalid checksum.
551 **/ 551 **/
552static s32 e1000_write_nvm_eewr_82571(struct e1000_hw *hw, u16 offset, 552static s32 e1000_write_nvm_eewr_82571(struct e1000_hw *hw, u16 offset,
553 u16 words, u16 *data) 553 u16 words, u16 *data)
@@ -1053,7 +1053,7 @@ static s32 e1000_setup_fiber_serdes_link_82571(struct e1000_hw *hw)
1053 /* If SerDes loopback mode is entered, there is no form 1053 /* If SerDes loopback mode is entered, there is no form
1054 * of reset to take the adapter out of that mode. So we 1054 * of reset to take the adapter out of that mode. So we
1055 * have to explicitly take the adapter out of loopback 1055 * have to explicitly take the adapter out of loopback
1056 * mode. This prevents drivers from twidling their thumbs 1056 * mode. This prevents drivers from twiddling their thumbs
1057 * if another tool failed to take it out of loopback mode. 1057 * if another tool failed to take it out of loopback mode.
1058 */ 1058 */
1059 ew32(SCTL, 1059 ew32(SCTL,
@@ -1098,7 +1098,7 @@ static s32 e1000_valid_led_default_82571(struct e1000_hw *hw, u16 *data)
1098 * e1000e_get_laa_state_82571 - Get locally administered address state 1098 * e1000e_get_laa_state_82571 - Get locally administered address state
1099 * @hw: pointer to the HW structure 1099 * @hw: pointer to the HW structure
1100 * 1100 *
1101 * Retrieve and return the current locally administed address state. 1101 * Retrieve and return the current locally administered address state.
1102 **/ 1102 **/
1103bool e1000e_get_laa_state_82571(struct e1000_hw *hw) 1103bool e1000e_get_laa_state_82571(struct e1000_hw *hw)
1104{ 1104{
@@ -1113,7 +1113,7 @@ bool e1000e_get_laa_state_82571(struct e1000_hw *hw)
1113 * @hw: pointer to the HW structure 1113 * @hw: pointer to the HW structure
1114 * @state: enable/disable locally administered address 1114 * @state: enable/disable locally administered address
1115 * 1115 *
1116 * Enable/Disable the current locally administed address state. 1116 * Enable/Disable the current locally administers address state.
1117 **/ 1117 **/
1118void e1000e_set_laa_state_82571(struct e1000_hw *hw, bool state) 1118void e1000e_set_laa_state_82571(struct e1000_hw *hw, bool state)
1119{ 1119{
@@ -1281,16 +1281,6 @@ static struct e1000_phy_operations e82_phy_ops_m88 = {
1281 1281
1282static struct e1000_nvm_operations e82571_nvm_ops = { 1282static struct e1000_nvm_operations e82571_nvm_ops = {
1283 .acquire_nvm = e1000_acquire_nvm_82571, 1283 .acquire_nvm = e1000_acquire_nvm_82571,
1284 .read_nvm = e1000e_read_nvm_spi,
1285 .release_nvm = e1000_release_nvm_82571,
1286 .update_nvm = e1000_update_nvm_checksum_82571,
1287 .valid_led_default = e1000_valid_led_default_82571,
1288 .validate_nvm = e1000_validate_nvm_checksum_82571,
1289 .write_nvm = e1000_write_nvm_82571,
1290};
1291
1292static struct e1000_nvm_operations e82573_nvm_ops = {
1293 .acquire_nvm = e1000_acquire_nvm_82571,
1294 .read_nvm = e1000e_read_nvm_eerd, 1284 .read_nvm = e1000e_read_nvm_eerd,
1295 .release_nvm = e1000_release_nvm_82571, 1285 .release_nvm = e1000_release_nvm_82571,
1296 .update_nvm = e1000_update_nvm_checksum_82571, 1286 .update_nvm = e1000_update_nvm_checksum_82571,
@@ -1355,6 +1345,6 @@ struct e1000_info e1000_82573_info = {
1355 .get_invariants = e1000_get_invariants_82571, 1345 .get_invariants = e1000_get_invariants_82571,
1356 .mac_ops = &e82571_mac_ops, 1346 .mac_ops = &e82571_mac_ops,
1357 .phy_ops = &e82_phy_ops_m88, 1347 .phy_ops = &e82_phy_ops_m88,
1358 .nvm_ops = &e82573_nvm_ops, 1348 .nvm_ops = &e82571_nvm_ops,
1359}; 1349};
1360 1350
diff --git a/drivers/net/e1000e/defines.h b/drivers/net/e1000e/defines.h
index 6232c3e96689..a4f511f549f7 100644
--- a/drivers/net/e1000e/defines.h
+++ b/drivers/net/e1000e/defines.h
@@ -66,7 +66,7 @@
66#define E1000_WUFC_ARP 0x00000020 /* ARP Request Packet Wakeup Enable */ 66#define E1000_WUFC_ARP 0x00000020 /* ARP Request Packet Wakeup Enable */
67 67
68/* Extended Device Control */ 68/* Extended Device Control */
69#define E1000_CTRL_EXT_SDP7_DATA 0x00000080 /* Value of SW Defineable Pin 7 */ 69#define E1000_CTRL_EXT_SDP7_DATA 0x00000080 /* Value of SW Definable Pin 7 */
70#define E1000_CTRL_EXT_EE_RST 0x00002000 /* Reinitialize from EEPROM */ 70#define E1000_CTRL_EXT_EE_RST 0x00002000 /* Reinitialize from EEPROM */
71#define E1000_CTRL_EXT_RO_DIS 0x00020000 /* Relaxed Ordering disable */ 71#define E1000_CTRL_EXT_RO_DIS 0x00020000 /* Relaxed Ordering disable */
72#define E1000_CTRL_EXT_LINK_MODE_MASK 0x00C00000 72#define E1000_CTRL_EXT_LINK_MODE_MASK 0x00C00000
@@ -75,12 +75,12 @@
75#define E1000_CTRL_EXT_IAME 0x08000000 /* Interrupt acknowledge Auto-mask */ 75#define E1000_CTRL_EXT_IAME 0x08000000 /* Interrupt acknowledge Auto-mask */
76#define E1000_CTRL_EXT_INT_TIMER_CLR 0x20000000 /* Clear Interrupt timers after IMS clear */ 76#define E1000_CTRL_EXT_INT_TIMER_CLR 0x20000000 /* Clear Interrupt timers after IMS clear */
77 77
78/* Receive Decriptor bit definitions */ 78/* Receive Descriptor bit definitions */
79#define E1000_RXD_STAT_DD 0x01 /* Descriptor Done */ 79#define E1000_RXD_STAT_DD 0x01 /* Descriptor Done */
80#define E1000_RXD_STAT_EOP 0x02 /* End of Packet */ 80#define E1000_RXD_STAT_EOP 0x02 /* End of Packet */
81#define E1000_RXD_STAT_IXSM 0x04 /* Ignore checksum */ 81#define E1000_RXD_STAT_IXSM 0x04 /* Ignore checksum */
82#define E1000_RXD_STAT_VP 0x08 /* IEEE VLAN Packet */ 82#define E1000_RXD_STAT_VP 0x08 /* IEEE VLAN Packet */
83#define E1000_RXD_STAT_UDPCS 0x10 /* UDP xsum caculated */ 83#define E1000_RXD_STAT_UDPCS 0x10 /* UDP xsum calculated */
84#define E1000_RXD_STAT_TCPCS 0x20 /* TCP xsum calculated */ 84#define E1000_RXD_STAT_TCPCS 0x20 /* TCP xsum calculated */
85#define E1000_RXD_ERR_CE 0x01 /* CRC Error */ 85#define E1000_RXD_ERR_CE 0x01 /* CRC Error */
86#define E1000_RXD_ERR_SE 0x02 /* Symbol Error */ 86#define E1000_RXD_ERR_SE 0x02 /* Symbol Error */
@@ -223,7 +223,7 @@
223#define E1000_STATUS_LAN_INIT_DONE 0x00000200 /* Lan Init Completion by NVM */ 223#define E1000_STATUS_LAN_INIT_DONE 0x00000200 /* Lan Init Completion by NVM */
224#define E1000_STATUS_GIO_MASTER_ENABLE 0x00080000 /* Status of Master requests. */ 224#define E1000_STATUS_GIO_MASTER_ENABLE 0x00080000 /* Status of Master requests. */
225 225
226/* Constants used to intrepret the masked PCI-X bus speed. */ 226/* Constants used to interpret the masked PCI-X bus speed. */
227 227
228#define HALF_DUPLEX 1 228#define HALF_DUPLEX 1
229#define FULL_DUPLEX 2 229#define FULL_DUPLEX 2
@@ -517,7 +517,7 @@
517/* PHY 1000 MII Register/Bit Definitions */ 517/* PHY 1000 MII Register/Bit Definitions */
518/* PHY Registers defined by IEEE */ 518/* PHY Registers defined by IEEE */
519#define PHY_CONTROL 0x00 /* Control Register */ 519#define PHY_CONTROL 0x00 /* Control Register */
520#define PHY_STATUS 0x01 /* Status Regiser */ 520#define PHY_STATUS 0x01 /* Status Register */
521#define PHY_ID1 0x02 /* Phy Id Reg (word 1) */ 521#define PHY_ID1 0x02 /* Phy Id Reg (word 1) */
522#define PHY_ID2 0x03 /* Phy Id Reg (word 2) */ 522#define PHY_ID2 0x03 /* Phy Id Reg (word 2) */
523#define PHY_AUTONEG_ADV 0x04 /* Autoneg Advertisement */ 523#define PHY_AUTONEG_ADV 0x04 /* Autoneg Advertisement */
diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h
index 8b88c226e858..327c0620da31 100644
--- a/drivers/net/e1000e/e1000.h
+++ b/drivers/net/e1000e/e1000.h
@@ -42,8 +42,7 @@
42struct e1000_info; 42struct e1000_info;
43 43
44#define ndev_printk(level, netdev, format, arg...) \ 44#define ndev_printk(level, netdev, format, arg...) \
45 printk(level "%s: %s: " format, (netdev)->dev.parent->bus_id, \ 45 printk(level "%s: " format, (netdev)->name, ## arg)
46 (netdev)->name, ## arg)
47 46
48#ifdef DEBUG 47#ifdef DEBUG
49#define ndev_dbg(netdev, format, arg...) \ 48#define ndev_dbg(netdev, format, arg...) \
diff --git a/drivers/net/e1000e/hw.h b/drivers/net/e1000e/hw.h
index 3c5862f97dbf..916025b30fc3 100644
--- a/drivers/net/e1000e/hw.h
+++ b/drivers/net/e1000e/hw.h
@@ -184,7 +184,7 @@ enum e1e_registers {
184 E1000_ICRXDMTC = 0x04120, /* Irq Cause Rx Desc MinThreshold Count */ 184 E1000_ICRXDMTC = 0x04120, /* Irq Cause Rx Desc MinThreshold Count */
185 E1000_ICRXOC = 0x04124, /* Irq Cause Receiver Overrun Count */ 185 E1000_ICRXOC = 0x04124, /* Irq Cause Receiver Overrun Count */
186 E1000_RXCSUM = 0x05000, /* RX Checksum Control - RW */ 186 E1000_RXCSUM = 0x05000, /* RX Checksum Control - RW */
187 E1000_RFCTL = 0x05008, /* Receive Filter Control*/ 187 E1000_RFCTL = 0x05008, /* Receive Filter Control */
188 E1000_MTA = 0x05200, /* Multicast Table Array - RW Array */ 188 E1000_MTA = 0x05200, /* Multicast Table Array - RW Array */
189 E1000_RA = 0x05400, /* Receive Address - RW Array */ 189 E1000_RA = 0x05400, /* Receive Address - RW Array */
190 E1000_VFTA = 0x05600, /* VLAN Filter Table Array - RW Array */ 190 E1000_VFTA = 0x05600, /* VLAN Filter Table Array - RW Array */
@@ -202,7 +202,7 @@ enum e1e_registers {
202 E1000_FACTPS = 0x05B30, /* Function Active and Power State to MNG */ 202 E1000_FACTPS = 0x05B30, /* Function Active and Power State to MNG */
203 E1000_SWSM = 0x05B50, /* SW Semaphore */ 203 E1000_SWSM = 0x05B50, /* SW Semaphore */
204 E1000_FWSM = 0x05B54, /* FW Semaphore */ 204 E1000_FWSM = 0x05B54, /* FW Semaphore */
205 E1000_HICR = 0x08F00, /* Host Inteface Control */ 205 E1000_HICR = 0x08F00, /* Host Interface Control */
206}; 206};
207 207
208/* RSS registers */ 208/* RSS registers */
diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
index 8f8139de1f48..0ae39550768d 100644
--- a/drivers/net/e1000e/ich8lan.c
+++ b/drivers/net/e1000e/ich8lan.c
@@ -671,7 +671,7 @@ static s32 e1000_get_phy_info_ich8lan(struct e1000_hw *hw)
671 * e1000_check_polarity_ife_ich8lan - Check cable polarity for IFE PHY 671 * e1000_check_polarity_ife_ich8lan - Check cable polarity for IFE PHY
672 * @hw: pointer to the HW structure 672 * @hw: pointer to the HW structure
673 * 673 *
674 * Polarity is determined on the polarity reveral feature being enabled. 674 * Polarity is determined on the polarity reversal feature being enabled.
675 * This function is only called by other family-specific 675 * This function is only called by other family-specific
676 * routines. 676 * routines.
677 **/ 677 **/
@@ -947,7 +947,7 @@ static s32 e1000_flash_cycle_init_ich8lan(struct e1000_hw *hw)
947 /* Either we should have a hardware SPI cycle in progress 947 /* Either we should have a hardware SPI cycle in progress
948 * bit to check against, in order to start a new cycle or 948 * bit to check against, in order to start a new cycle or
949 * FDONE bit should be changed in the hardware so that it 949 * FDONE bit should be changed in the hardware so that it
950 * is 1 after harware reset, which can then be used as an 950 * is 1 after hardware reset, which can then be used as an
951 * indication whether a cycle is in progress or has been 951 * indication whether a cycle is in progress or has been
952 * completed. 952 * completed.
953 */ 953 */
@@ -1155,7 +1155,7 @@ static s32 e1000_write_nvm_ich8lan(struct e1000_hw *hw, u16 offset, u16 words,
1155 * which writes the checksum to the shadow ram. The changes in the shadow 1155 * which writes the checksum to the shadow ram. The changes in the shadow
1156 * ram are then committed to the EEPROM by processing each bank at a time 1156 * ram are then committed to the EEPROM by processing each bank at a time
1157 * checking for the modified bit and writing only the pending changes. 1157 * checking for the modified bit and writing only the pending changes.
1158 * After a succesful commit, the shadow ram is cleared and is ready for 1158 * After a successful commit, the shadow ram is cleared and is ready for
1159 * future writes. 1159 * future writes.
1160 **/ 1160 **/
1161static s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw) 1161static s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw)
@@ -1680,7 +1680,7 @@ static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw)
1680 * - initialize LED identification 1680 * - initialize LED identification
1681 * - setup receive address registers 1681 * - setup receive address registers
1682 * - setup flow control 1682 * - setup flow control
1683 * - setup transmit discriptors 1683 * - setup transmit descriptors
1684 * - clear statistics 1684 * - clear statistics
1685 **/ 1685 **/
1686static s32 e1000_init_hw_ich8lan(struct e1000_hw *hw) 1686static s32 e1000_init_hw_ich8lan(struct e1000_hw *hw)
@@ -1961,7 +1961,7 @@ static s32 e1000_kmrn_lock_loss_workaround_ich8lan(struct e1000_hw *hw)
1961 E1000_PHY_CTRL_NOND0A_GBE_DISABLE); 1961 E1000_PHY_CTRL_NOND0A_GBE_DISABLE);
1962 ew32(PHY_CTRL, phy_ctrl); 1962 ew32(PHY_CTRL, phy_ctrl);
1963 1963
1964 /* Call gig speed drop workaround on Giga disable before accessing 1964 /* Call gig speed drop workaround on Gig disable before accessing
1965 * any PHY registers */ 1965 * any PHY registers */
1966 e1000e_gig_downshift_workaround_ich8lan(hw); 1966 e1000e_gig_downshift_workaround_ich8lan(hw);
1967 1967
@@ -1972,7 +1972,7 @@ static s32 e1000_kmrn_lock_loss_workaround_ich8lan(struct e1000_hw *hw)
1972/** 1972/**
1973 * e1000_set_kmrn_lock_loss_workaound_ich8lan - Set Kumeran workaround state 1973 * e1000_set_kmrn_lock_loss_workaound_ich8lan - Set Kumeran workaround state
1974 * @hw: pointer to the HW structure 1974 * @hw: pointer to the HW structure
1975 * @state: boolean value used to set the current Kumaran workaround state 1975 * @state: boolean value used to set the current Kumeran workaround state
1976 * 1976 *
1977 * If ICH8, set the current Kumeran workaround state (enabled - TRUE 1977 * If ICH8, set the current Kumeran workaround state (enabled - TRUE
1978 * /disabled - FALSE). 1978 * /disabled - FALSE).
@@ -2017,7 +2017,7 @@ void e1000e_igp3_phy_powerdown_workaround_ich8lan(struct e1000_hw *hw)
2017 E1000_PHY_CTRL_NOND0A_GBE_DISABLE); 2017 E1000_PHY_CTRL_NOND0A_GBE_DISABLE);
2018 ew32(PHY_CTRL, reg); 2018 ew32(PHY_CTRL, reg);
2019 2019
2020 /* Call gig speed drop workaround on Giga disable before 2020 /* Call gig speed drop workaround on Gig disable before
2021 * accessing any PHY registers */ 2021 * accessing any PHY registers */
2022 if (hw->mac.type == e1000_ich8lan) 2022 if (hw->mac.type == e1000_ich8lan)
2023 e1000e_gig_downshift_workaround_ich8lan(hw); 2023 e1000e_gig_downshift_workaround_ich8lan(hw);
@@ -2045,7 +2045,7 @@ void e1000e_igp3_phy_powerdown_workaround_ich8lan(struct e1000_hw *hw)
2045 * @hw: pointer to the HW structure 2045 * @hw: pointer to the HW structure
2046 * 2046 *
2047 * Steps to take when dropping from 1Gb/s (eg. link cable removal (LSC), 2047 * Steps to take when dropping from 1Gb/s (eg. link cable removal (LSC),
2048 * LPLU, Giga disable, MDIC PHY reset): 2048 * LPLU, Gig disable, MDIC PHY reset):
2049 * 1) Set Kumeran Near-end loopback 2049 * 1) Set Kumeran Near-end loopback
2050 * 2) Clear Kumeran Near-end loopback 2050 * 2) Clear Kumeran Near-end loopback
2051 * Should only be called for ICH8[m] devices with IGP_3 Phy. 2051 * Should only be called for ICH8[m] devices with IGP_3 Phy.
@@ -2089,10 +2089,10 @@ static s32 e1000_cleanup_led_ich8lan(struct e1000_hw *hw)
2089} 2089}
2090 2090
2091/** 2091/**
2092 * e1000_led_on_ich8lan - Turn LED's on 2092 * e1000_led_on_ich8lan - Turn LEDs on
2093 * @hw: pointer to the HW structure 2093 * @hw: pointer to the HW structure
2094 * 2094 *
2095 * Turn on the LED's. 2095 * Turn on the LEDs.
2096 **/ 2096 **/
2097static s32 e1000_led_on_ich8lan(struct e1000_hw *hw) 2097static s32 e1000_led_on_ich8lan(struct e1000_hw *hw)
2098{ 2098{
@@ -2105,10 +2105,10 @@ static s32 e1000_led_on_ich8lan(struct e1000_hw *hw)
2105} 2105}
2106 2106
2107/** 2107/**
2108 * e1000_led_off_ich8lan - Turn LED's off 2108 * e1000_led_off_ich8lan - Turn LEDs off
2109 * @hw: pointer to the HW structure 2109 * @hw: pointer to the HW structure
2110 * 2110 *
2111 * Turn off the LED's. 2111 * Turn off the LEDs.
2112 **/ 2112 **/
2113static s32 e1000_led_off_ich8lan(struct e1000_hw *hw) 2113static s32 e1000_led_off_ich8lan(struct e1000_hw *hw)
2114{ 2114{
diff --git a/drivers/net/e1000e/lib.c b/drivers/net/e1000e/lib.c
index 16f35fadb74b..95f75a43c9f9 100644
--- a/drivers/net/e1000e/lib.c
+++ b/drivers/net/e1000e/lib.c
@@ -589,9 +589,6 @@ static s32 e1000_set_default_fc_generic(struct e1000_hw *hw)
589 s32 ret_val; 589 s32 ret_val;
590 u16 nvm_data; 590 u16 nvm_data;
591 591
592 if (mac->fc != e1000_fc_default)
593 return 0;
594
595 /* Read and store word 0x0F of the EEPROM. This word contains bits 592 /* Read and store word 0x0F of the EEPROM. This word contains bits
596 * that determine the hardware's default PAUSE (flow control) mode, 593 * that determine the hardware's default PAUSE (flow control) mode,
597 * a bit that determines whether the HW defaults to enabling or 594 * a bit that determines whether the HW defaults to enabling or
@@ -1107,34 +1104,13 @@ s32 e1000e_config_fc_after_link_up(struct e1000_hw *hw)
1107 (mii_nway_lp_ability_reg & NWAY_LPAR_ASM_DIR)) { 1104 (mii_nway_lp_ability_reg & NWAY_LPAR_ASM_DIR)) {
1108 mac->fc = e1000_fc_rx_pause; 1105 mac->fc = e1000_fc_rx_pause;
1109 hw_dbg(hw, "Flow Control = RX PAUSE frames only.\r\n"); 1106 hw_dbg(hw, "Flow Control = RX PAUSE frames only.\r\n");
1110 } 1107 } else {
1111 /* Per the IEEE spec, at this point flow control should be 1108 /*
1112 * disabled. However, we want to consider that we could 1109 * Per the IEEE spec, at this point flow control
1113 * be connected to a legacy switch that doesn't advertise 1110 * should be disabled.
1114 * desired flow control, but can be forced on the link 1111 */
1115 * partner. So if we advertised no flow control, that is
1116 * what we will resolve to. If we advertised some kind of
1117 * receive capability (Rx Pause Only or Full Flow Control)
1118 * and the link partner advertised none, we will configure
1119 * ourselves to enable Rx Flow Control only. We can do
1120 * this safely for two reasons: If the link partner really
1121 * didn't want flow control enabled, and we enable Rx, no
1122 * harm done since we won't be receiving any PAUSE frames
1123 * anyway. If the intent on the link partner was to have
1124 * flow control enabled, then by us enabling RX only, we
1125 * can at least receive pause frames and process them.
1126 * This is a good idea because in most cases, since we are
1127 * predominantly a server NIC, more times than not we will
1128 * be asked to delay transmission of packets than asking
1129 * our link partner to pause transmission of frames.
1130 */
1131 else if ((mac->original_fc == e1000_fc_none) ||
1132 (mac->original_fc == e1000_fc_tx_pause)) {
1133 mac->fc = e1000_fc_none; 1112 mac->fc = e1000_fc_none;
1134 hw_dbg(hw, "Flow Control = NONE.\r\n"); 1113 hw_dbg(hw, "Flow Control = NONE.\r\n");
1135 } else {
1136 mac->fc = e1000_fc_rx_pause;
1137 hw_dbg(hw, "Flow Control = RX PAUSE frames only.\r\n");
1138 } 1114 }
1139 1115
1140 /* Now we need to do one last check... If we auto- 1116 /* Now we need to do one last check... If we auto-
@@ -1164,7 +1140,7 @@ s32 e1000e_config_fc_after_link_up(struct e1000_hw *hw)
1164} 1140}
1165 1141
1166/** 1142/**
1167 * e1000e_get_speed_and_duplex_copper - Retreive current speed/duplex 1143 * e1000e_get_speed_and_duplex_copper - Retrieve current speed/duplex
1168 * @hw: pointer to the HW structure 1144 * @hw: pointer to the HW structure
1169 * @speed: stores the current speed 1145 * @speed: stores the current speed
1170 * @duplex: stores the current duplex 1146 * @duplex: stores the current duplex
@@ -1200,7 +1176,7 @@ s32 e1000e_get_speed_and_duplex_copper(struct e1000_hw *hw, u16 *speed, u16 *dup
1200} 1176}
1201 1177
1202/** 1178/**
1203 * e1000e_get_speed_and_duplex_fiber_serdes - Retreive current speed/duplex 1179 * e1000e_get_speed_and_duplex_fiber_serdes - Retrieve current speed/duplex
1204 * @hw: pointer to the HW structure 1180 * @hw: pointer to the HW structure
1205 * @speed: stores the current speed 1181 * @speed: stores the current speed
1206 * @duplex: stores the current duplex 1182 * @duplex: stores the current duplex
@@ -1410,7 +1386,7 @@ s32 e1000e_cleanup_led_generic(struct e1000_hw *hw)
1410 * e1000e_blink_led - Blink LED 1386 * e1000e_blink_led - Blink LED
1411 * @hw: pointer to the HW structure 1387 * @hw: pointer to the HW structure
1412 * 1388 *
1413 * Blink the led's which are set to be on. 1389 * Blink the LEDs which are set to be on.
1414 **/ 1390 **/
1415s32 e1000e_blink_led(struct e1000_hw *hw) 1391s32 e1000e_blink_led(struct e1000_hw *hw)
1416{ 1392{
@@ -1515,7 +1491,7 @@ void e1000e_set_pcie_no_snoop(struct e1000_hw *hw, u32 no_snoop)
1515 * @hw: pointer to the HW structure 1491 * @hw: pointer to the HW structure
1516 * 1492 *
1517 * Returns 0 if successful, else returns -10 1493 * Returns 0 if successful, else returns -10
1518 * (-E1000_ERR_MASTER_REQUESTS_PENDING) if master disable bit has not casued 1494 * (-E1000_ERR_MASTER_REQUESTS_PENDING) if master disable bit has not caused
1519 * the master requests to be disabled. 1495 * the master requests to be disabled.
1520 * 1496 *
1521 * Disables PCI-Express master access and verifies there are no pending 1497 * Disables PCI-Express master access and verifies there are no pending
@@ -1876,7 +1852,7 @@ static s32 e1000_ready_nvm_eeprom(struct e1000_hw *hw)
1876} 1852}
1877 1853
1878/** 1854/**
1879 * e1000e_read_nvm_spi - Read EEPROM's using SPI 1855 * e1000e_read_nvm_spi - Reads EEPROM using SPI
1880 * @hw: pointer to the HW structure 1856 * @hw: pointer to the HW structure
1881 * @offset: offset of word in the EEPROM to read 1857 * @offset: offset of word in the EEPROM to read
1882 * @words: number of words to read 1858 * @words: number of words to read
@@ -1980,7 +1956,7 @@ s32 e1000e_read_nvm_eerd(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
1980 * Writes data to EEPROM at offset using SPI interface. 1956 * Writes data to EEPROM at offset using SPI interface.
1981 * 1957 *
1982 * If e1000e_update_nvm_checksum is not called after this function , the 1958 * If e1000e_update_nvm_checksum is not called after this function , the
1983 * EEPROM will most likley contain an invalid checksum. 1959 * EEPROM will most likely contain an invalid checksum.
1984 **/ 1960 **/
1985s32 e1000e_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data) 1961s32 e1000e_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
1986{ 1962{
@@ -2222,7 +2198,7 @@ static u8 e1000_calculate_checksum(u8 *buffer, u32 length)
2222 * 2198 *
2223 * Returns E1000_success upon success, else E1000_ERR_HOST_INTERFACE_COMMAND 2199 * Returns E1000_success upon success, else E1000_ERR_HOST_INTERFACE_COMMAND
2224 * 2200 *
2225 * This function checks whether the HOST IF is enabled for command operaton 2201 * This function checks whether the HOST IF is enabled for command operation
2226 * and also checks whether the previous command is completed. It busy waits 2202 * and also checks whether the previous command is completed. It busy waits
2227 * in case of previous command is not completed. 2203 * in case of previous command is not completed.
2228 **/ 2204 **/
@@ -2254,7 +2230,7 @@ static s32 e1000_mng_enable_host_if(struct e1000_hw *hw)
2254} 2230}
2255 2231
2256/** 2232/**
2257 * e1000e_check_mng_mode - check managament mode 2233 * e1000e_check_mng_mode - check management mode
2258 * @hw: pointer to the HW structure 2234 * @hw: pointer to the HW structure
2259 * 2235 *
2260 * Reads the firmware semaphore register and returns true (>0) if 2236 * Reads the firmware semaphore register and returns true (>0) if
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
index 3031d6d16247..fc5c63f4f578 100644
--- a/drivers/net/e1000e/netdev.c
+++ b/drivers/net/e1000e/netdev.c
@@ -1006,7 +1006,7 @@ static void e1000_irq_enable(struct e1000_adapter *adapter)
1006 * e1000_get_hw_control - get control of the h/w from f/w 1006 * e1000_get_hw_control - get control of the h/w from f/w
1007 * @adapter: address of board private structure 1007 * @adapter: address of board private structure
1008 * 1008 *
1009 * e1000_get_hw_control sets {CTRL_EXT|FWSM}:DRV_LOAD bit. 1009 * e1000_get_hw_control sets {CTRL_EXT|SWSM}:DRV_LOAD bit.
1010 * For ASF and Pass Through versions of f/w this means that 1010 * For ASF and Pass Through versions of f/w this means that
1011 * the driver is loaded. For AMT version (only with 82573) 1011 * the driver is loaded. For AMT version (only with 82573)
1012 * of the f/w this means that the network i/f is open. 1012 * of the f/w this means that the network i/f is open.
@@ -1032,7 +1032,7 @@ static void e1000_get_hw_control(struct e1000_adapter *adapter)
1032 * e1000_release_hw_control - release control of the h/w to f/w 1032 * e1000_release_hw_control - release control of the h/w to f/w
1033 * @adapter: address of board private structure 1033 * @adapter: address of board private structure
1034 * 1034 *
1035 * e1000_release_hw_control resets {CTRL_EXT|FWSM}:DRV_LOAD bit. 1035 * e1000_release_hw_control resets {CTRL_EXT|SWSM}:DRV_LOAD bit.
1036 * For ASF and Pass Through versions of f/w this means that the 1036 * For ASF and Pass Through versions of f/w this means that the
1037 * driver is no longer loaded. For AMT version (only with 82573) i 1037 * driver is no longer loaded. For AMT version (only with 82573) i
1038 * of the f/w this means that the network i/f is closed. 1038 * of the f/w this means that the network i/f is closed.
@@ -1241,6 +1241,11 @@ void e1000e_free_rx_resources(struct e1000_adapter *adapter)
1241 1241
1242/** 1242/**
1243 * e1000_update_itr - update the dynamic ITR value based on statistics 1243 * e1000_update_itr - update the dynamic ITR value based on statistics
1244 * @adapter: pointer to adapter
1245 * @itr_setting: current adapter->itr
1246 * @packets: the number of packets during this measurement interval
1247 * @bytes: the number of bytes during this measurement interval
1248 *
1244 * Stores a new ITR value based on packets and byte 1249 * Stores a new ITR value based on packets and byte
1245 * counts during the last interrupt. The advantage of per interrupt 1250 * counts during the last interrupt. The advantage of per interrupt
1246 * computation is faster updates and more accurate ITR for the current 1251 * computation is faster updates and more accurate ITR for the current
@@ -1250,10 +1255,6 @@ void e1000e_free_rx_resources(struct e1000_adapter *adapter)
1250 * while increasing bulk throughput. 1255 * while increasing bulk throughput.
1251 * this functionality is controlled by the InterruptThrottleRate module 1256 * this functionality is controlled by the InterruptThrottleRate module
1252 * parameter (see e1000_param.c) 1257 * parameter (see e1000_param.c)
1253 * @adapter: pointer to adapter
1254 * @itr_setting: current adapter->itr
1255 * @packets: the number of packets during this measurement interval
1256 * @bytes: the number of bytes during this measurement interval
1257 **/ 1258 **/
1258static unsigned int e1000_update_itr(struct e1000_adapter *adapter, 1259static unsigned int e1000_update_itr(struct e1000_adapter *adapter,
1259 u16 itr_setting, int packets, 1260 u16 itr_setting, int packets,
@@ -1366,6 +1367,7 @@ set_itr_now:
1366/** 1367/**
1367 * e1000_clean - NAPI Rx polling callback 1368 * e1000_clean - NAPI Rx polling callback
1368 * @adapter: board private structure 1369 * @adapter: board private structure
1370 * @budget: amount of packets driver is allowed to process this poll
1369 **/ 1371 **/
1370static int e1000_clean(struct napi_struct *napi, int budget) 1372static int e1000_clean(struct napi_struct *napi, int budget)
1371{ 1373{
@@ -2000,7 +2002,7 @@ static void e1000_power_down_phy(struct e1000_adapter *adapter)
2000 e1000_check_reset_block(hw)) 2002 e1000_check_reset_block(hw))
2001 return; 2003 return;
2002 2004
2003 /* managebility (AMT) is enabled */ 2005 /* manageability (AMT) is enabled */
2004 if (er32(MANC) & E1000_MANC_SMBUS_EN) 2006 if (er32(MANC) & E1000_MANC_SMBUS_EN)
2005 return; 2007 return;
2006 2008
@@ -3488,7 +3490,6 @@ static int e1000_suspend(struct pci_dev *pdev, pm_message_t state)
3488static void e1000e_disable_l1aspm(struct pci_dev *pdev) 3490static void e1000e_disable_l1aspm(struct pci_dev *pdev)
3489{ 3491{
3490 int pos; 3492 int pos;
3491 u32 cap;
3492 u16 val; 3493 u16 val;
3493 3494
3494 /* 3495 /*
@@ -3503,7 +3504,6 @@ static void e1000e_disable_l1aspm(struct pci_dev *pdev)
3503 * active. 3504 * active.
3504 */ 3505 */
3505 pos = pci_find_capability(pdev, PCI_CAP_ID_EXP); 3506 pos = pci_find_capability(pdev, PCI_CAP_ID_EXP);
3506 pci_read_config_dword(pdev, pos + PCI_EXP_LNKCAP, &cap);
3507 pci_read_config_word(pdev, pos + PCI_EXP_LNKCTL, &val); 3507 pci_read_config_word(pdev, pos + PCI_EXP_LNKCTL, &val);
3508 if (val & 0x2) { 3508 if (val & 0x2) {
3509 dev_warn(&pdev->dev, "Disabling L1 ASPM\n"); 3509 dev_warn(&pdev->dev, "Disabling L1 ASPM\n");
diff --git a/drivers/net/e1000e/phy.c b/drivers/net/e1000e/phy.c
index fc6fee112f1c..dab3c468a768 100644
--- a/drivers/net/e1000e/phy.c
+++ b/drivers/net/e1000e/phy.c
@@ -121,7 +121,7 @@ s32 e1000e_phy_reset_dsp(struct e1000_hw *hw)
121 * @offset: register offset to be read 121 * @offset: register offset to be read
122 * @data: pointer to the read data 122 * @data: pointer to the read data
123 * 123 *
124 * Reads the MDI control regsiter in the PHY at offset and stores the 124 * Reads the MDI control register in the PHY at offset and stores the
125 * information read to data. 125 * information read to data.
126 **/ 126 **/
127static s32 e1000_read_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 *data) 127static s32 e1000_read_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 *data)
@@ -1172,7 +1172,7 @@ s32 e1000e_set_d3_lplu_state(struct e1000_hw *hw, bool active)
1172} 1172}
1173 1173
1174/** 1174/**
1175 * e1000e_check_downshift - Checks whether a downshift in speed occured 1175 * e1000e_check_downshift - Checks whether a downshift in speed occurred
1176 * @hw: pointer to the HW structure 1176 * @hw: pointer to the HW structure
1177 * 1177 *
1178 * Success returns 0, Failure returns 1 1178 * Success returns 0, Failure returns 1
@@ -1388,8 +1388,8 @@ s32 e1000e_get_cable_length_m88(struct e1000_hw *hw)
1388 * 1388 *
1389 * The automatic gain control (agc) normalizes the amplitude of the 1389 * The automatic gain control (agc) normalizes the amplitude of the
1390 * received signal, adjusting for the attenuation produced by the 1390 * received signal, adjusting for the attenuation produced by the
1391 * cable. By reading the AGC registers, which reperesent the 1391 * cable. By reading the AGC registers, which represent the
1392 * cobination of course and fine gain value, the value can be put 1392 * combination of course and fine gain value, the value can be put
1393 * into a lookup table to obtain the approximate cable length 1393 * into a lookup table to obtain the approximate cable length
1394 * for each channel. 1394 * for each channel.
1395 **/ 1395 **/
@@ -1619,7 +1619,7 @@ s32 e1000e_phy_sw_reset(struct e1000_hw *hw)
1619 * Verify the reset block is not blocking us from resetting. Acquire 1619 * Verify the reset block is not blocking us from resetting. Acquire
1620 * semaphore (if necessary) and read/set/write the device control reset 1620 * semaphore (if necessary) and read/set/write the device control reset
1621 * bit in the PHY. Wait the appropriate delay time for the device to 1621 * bit in the PHY. Wait the appropriate delay time for the device to
1622 * reset and relase the semaphore (if necessary). 1622 * reset and release the semaphore (if necessary).
1623 **/ 1623 **/
1624s32 e1000e_phy_hw_reset_generic(struct e1000_hw *hw) 1624s32 e1000e_phy_hw_reset_generic(struct e1000_hw *hw)
1625{ 1625{
diff --git a/drivers/net/ehea/ehea.h b/drivers/net/ehea/ehea.h
index 88fb53eba715..7c4ead35cfa2 100644
--- a/drivers/net/ehea/ehea.h
+++ b/drivers/net/ehea/ehea.h
@@ -40,7 +40,7 @@
40#include <asm/io.h> 40#include <asm/io.h>
41 41
42#define DRV_NAME "ehea" 42#define DRV_NAME "ehea"
43#define DRV_VERSION "EHEA_0083" 43#define DRV_VERSION "EHEA_0087"
44 44
45/* eHEA capability flags */ 45/* eHEA capability flags */
46#define DLPAR_PORT_ADD_REM 1 46#define DLPAR_PORT_ADD_REM 1
@@ -386,6 +386,13 @@ struct ehea_port_res {
386 386
387 387
388#define EHEA_MAX_PORTS 16 388#define EHEA_MAX_PORTS 16
389
390#define EHEA_NUM_PORTRES_FW_HANDLES 6 /* QP handle, SendCQ handle,
391 RecvCQ handle, EQ handle,
392 SendMR handle, RecvMR handle */
393#define EHEA_NUM_PORT_FW_HANDLES 1 /* EQ handle */
394#define EHEA_NUM_ADAPTER_FW_HANDLES 2 /* MR handle, NEQ handle */
395
389struct ehea_adapter { 396struct ehea_adapter {
390 u64 handle; 397 u64 handle;
391 struct of_device *ofdev; 398 struct of_device *ofdev;
@@ -405,6 +412,31 @@ struct ehea_mc_list {
405 u64 macaddr; 412 u64 macaddr;
406}; 413};
407 414
415/* kdump support */
416struct ehea_fw_handle_entry {
417 u64 adh; /* Adapter Handle */
418 u64 fwh; /* Firmware Handle */
419};
420
421struct ehea_fw_handle_array {
422 struct ehea_fw_handle_entry *arr;
423 int num_entries;
424 struct semaphore lock;
425};
426
427struct ehea_bcmc_reg_entry {
428 u64 adh; /* Adapter Handle */
429 u32 port_id; /* Logical Port Id */
430 u8 reg_type; /* Registration Type */
431 u64 macaddr;
432};
433
434struct ehea_bcmc_reg_array {
435 struct ehea_bcmc_reg_entry *arr;
436 int num_entries;
437 struct semaphore lock;
438};
439
408#define EHEA_PORT_UP 1 440#define EHEA_PORT_UP 1
409#define EHEA_PORT_DOWN 0 441#define EHEA_PORT_DOWN 0
410#define EHEA_PHY_LINK_UP 1 442#define EHEA_PHY_LINK_UP 1
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c
index c051c7e09b9a..21af674b764e 100644
--- a/drivers/net/ehea/ehea_main.c
+++ b/drivers/net/ehea/ehea_main.c
@@ -35,6 +35,7 @@
35#include <linux/if_ether.h> 35#include <linux/if_ether.h>
36#include <linux/notifier.h> 36#include <linux/notifier.h>
37#include <linux/reboot.h> 37#include <linux/reboot.h>
38#include <asm/kexec.h>
38 39
39#include <net/ip.h> 40#include <net/ip.h>
40 41
@@ -98,8 +99,10 @@ static int port_name_cnt;
98static LIST_HEAD(adapter_list); 99static LIST_HEAD(adapter_list);
99u64 ehea_driver_flags; 100u64 ehea_driver_flags;
100struct work_struct ehea_rereg_mr_task; 101struct work_struct ehea_rereg_mr_task;
101
102struct semaphore dlpar_mem_lock; 102struct semaphore dlpar_mem_lock;
103struct ehea_fw_handle_array ehea_fw_handles;
104struct ehea_bcmc_reg_array ehea_bcmc_regs;
105
103 106
104static int __devinit ehea_probe_adapter(struct of_device *dev, 107static int __devinit ehea_probe_adapter(struct of_device *dev,
105 const struct of_device_id *id); 108 const struct of_device_id *id);
@@ -132,6 +135,160 @@ void ehea_dump(void *adr, int len, char *msg)
132 } 135 }
133} 136}
134 137
138static void ehea_update_firmware_handles(void)
139{
140 struct ehea_fw_handle_entry *arr = NULL;
141 struct ehea_adapter *adapter;
142 int num_adapters = 0;
143 int num_ports = 0;
144 int num_portres = 0;
145 int i = 0;
146 int num_fw_handles, k, l;
147
148 /* Determine number of handles */
149 list_for_each_entry(adapter, &adapter_list, list) {
150 num_adapters++;
151
152 for (k = 0; k < EHEA_MAX_PORTS; k++) {
153 struct ehea_port *port = adapter->port[k];
154
155 if (!port || (port->state != EHEA_PORT_UP))
156 continue;
157
158 num_ports++;
159 num_portres += port->num_def_qps + port->num_add_tx_qps;
160 }
161 }
162
163 num_fw_handles = num_adapters * EHEA_NUM_ADAPTER_FW_HANDLES +
164 num_ports * EHEA_NUM_PORT_FW_HANDLES +
165 num_portres * EHEA_NUM_PORTRES_FW_HANDLES;
166
167 if (num_fw_handles) {
168 arr = kzalloc(num_fw_handles * sizeof(*arr), GFP_KERNEL);
169 if (!arr)
170 return; /* Keep the existing array */
171 } else
172 goto out_update;
173
174 list_for_each_entry(adapter, &adapter_list, list) {
175 for (k = 0; k < EHEA_MAX_PORTS; k++) {
176 struct ehea_port *port = adapter->port[k];
177
178 if (!port || (port->state != EHEA_PORT_UP))
179 continue;
180
181 for (l = 0;
182 l < port->num_def_qps + port->num_add_tx_qps;
183 l++) {
184 struct ehea_port_res *pr = &port->port_res[l];
185
186 arr[i].adh = adapter->handle;
187 arr[i++].fwh = pr->qp->fw_handle;
188 arr[i].adh = adapter->handle;
189 arr[i++].fwh = pr->send_cq->fw_handle;
190 arr[i].adh = adapter->handle;
191 arr[i++].fwh = pr->recv_cq->fw_handle;
192 arr[i].adh = adapter->handle;
193 arr[i++].fwh = pr->eq->fw_handle;
194 arr[i].adh = adapter->handle;
195 arr[i++].fwh = pr->send_mr.handle;
196 arr[i].adh = adapter->handle;
197 arr[i++].fwh = pr->recv_mr.handle;
198 }
199 arr[i].adh = adapter->handle;
200 arr[i++].fwh = port->qp_eq->fw_handle;
201 }
202
203 arr[i].adh = adapter->handle;
204 arr[i++].fwh = adapter->neq->fw_handle;
205
206 if (adapter->mr.handle) {
207 arr[i].adh = adapter->handle;
208 arr[i++].fwh = adapter->mr.handle;
209 }
210 }
211
212out_update:
213 kfree(ehea_fw_handles.arr);
214 ehea_fw_handles.arr = arr;
215 ehea_fw_handles.num_entries = i;
216}
217
218static void ehea_update_bcmc_registrations(void)
219{
220 struct ehea_bcmc_reg_entry *arr = NULL;
221 struct ehea_adapter *adapter;
222 struct ehea_mc_list *mc_entry;
223 int num_registrations = 0;
224 int i = 0;
225 int k;
226
227 /* Determine number of registrations */
228 list_for_each_entry(adapter, &adapter_list, list)
229 for (k = 0; k < EHEA_MAX_PORTS; k++) {
230 struct ehea_port *port = adapter->port[k];
231
232 if (!port || (port->state != EHEA_PORT_UP))
233 continue;
234
235 num_registrations += 2; /* Broadcast registrations */
236
237 list_for_each_entry(mc_entry, &port->mc_list->list,list)
238 num_registrations += 2;
239 }
240
241 if (num_registrations) {
242 arr = kzalloc(num_registrations * sizeof(*arr), GFP_KERNEL);
243 if (!arr)
244 return; /* Keep the existing array */
245 } else
246 goto out_update;
247
248 list_for_each_entry(adapter, &adapter_list, list) {
249 for (k = 0; k < EHEA_MAX_PORTS; k++) {
250 struct ehea_port *port = adapter->port[k];
251
252 if (!port || (port->state != EHEA_PORT_UP))
253 continue;
254
255 arr[i].adh = adapter->handle;
256 arr[i].port_id = port->logical_port_id;
257 arr[i].reg_type = EHEA_BCMC_BROADCAST |
258 EHEA_BCMC_UNTAGGED;
259 arr[i++].macaddr = port->mac_addr;
260
261 arr[i].adh = adapter->handle;
262 arr[i].port_id = port->logical_port_id;
263 arr[i].reg_type = EHEA_BCMC_BROADCAST |
264 EHEA_BCMC_VLANID_ALL;
265 arr[i++].macaddr = port->mac_addr;
266
267 list_for_each_entry(mc_entry,
268 &port->mc_list->list, list) {
269 arr[i].adh = adapter->handle;
270 arr[i].port_id = port->logical_port_id;
271 arr[i].reg_type = EHEA_BCMC_SCOPE_ALL |
272 EHEA_BCMC_MULTICAST |
273 EHEA_BCMC_UNTAGGED;
274 arr[i++].macaddr = mc_entry->macaddr;
275
276 arr[i].adh = adapter->handle;
277 arr[i].port_id = port->logical_port_id;
278 arr[i].reg_type = EHEA_BCMC_SCOPE_ALL |
279 EHEA_BCMC_MULTICAST |
280 EHEA_BCMC_VLANID_ALL;
281 arr[i++].macaddr = mc_entry->macaddr;
282 }
283 }
284 }
285
286out_update:
287 kfree(ehea_bcmc_regs.arr);
288 ehea_bcmc_regs.arr = arr;
289 ehea_bcmc_regs.num_entries = i;
290}
291
135static struct net_device_stats *ehea_get_stats(struct net_device *dev) 292static struct net_device_stats *ehea_get_stats(struct net_device *dev)
136{ 293{
137 struct ehea_port *port = netdev_priv(dev); 294 struct ehea_port *port = netdev_priv(dev);
@@ -1601,19 +1758,25 @@ static int ehea_set_mac_addr(struct net_device *dev, void *sa)
1601 1758
1602 memcpy(dev->dev_addr, mac_addr->sa_data, dev->addr_len); 1759 memcpy(dev->dev_addr, mac_addr->sa_data, dev->addr_len);
1603 1760
1761 down(&ehea_bcmc_regs.lock);
1762
1604 /* Deregister old MAC in pHYP */ 1763 /* Deregister old MAC in pHYP */
1605 ret = ehea_broadcast_reg_helper(port, H_DEREG_BCMC); 1764 ret = ehea_broadcast_reg_helper(port, H_DEREG_BCMC);
1606 if (ret) 1765 if (ret)
1607 goto out_free; 1766 goto out_upregs;
1608 1767
1609 port->mac_addr = cb0->port_mac_addr << 16; 1768 port->mac_addr = cb0->port_mac_addr << 16;
1610 1769
1611 /* Register new MAC in pHYP */ 1770 /* Register new MAC in pHYP */
1612 ret = ehea_broadcast_reg_helper(port, H_REG_BCMC); 1771 ret = ehea_broadcast_reg_helper(port, H_REG_BCMC);
1613 if (ret) 1772 if (ret)
1614 goto out_free; 1773 goto out_upregs;
1615 1774
1616 ret = 0; 1775 ret = 0;
1776
1777out_upregs:
1778 ehea_update_bcmc_registrations();
1779 up(&ehea_bcmc_regs.lock);
1617out_free: 1780out_free:
1618 kfree(cb0); 1781 kfree(cb0);
1619out: 1782out:
@@ -1775,9 +1938,11 @@ static void ehea_set_multicast_list(struct net_device *dev)
1775 } 1938 }
1776 ehea_promiscuous(dev, 0); 1939 ehea_promiscuous(dev, 0);
1777 1940
1941 down(&ehea_bcmc_regs.lock);
1942
1778 if (dev->flags & IFF_ALLMULTI) { 1943 if (dev->flags & IFF_ALLMULTI) {
1779 ehea_allmulti(dev, 1); 1944 ehea_allmulti(dev, 1);
1780 return; 1945 goto out;
1781 } 1946 }
1782 ehea_allmulti(dev, 0); 1947 ehea_allmulti(dev, 0);
1783 1948
@@ -1803,6 +1968,8 @@ static void ehea_set_multicast_list(struct net_device *dev)
1803 1968
1804 } 1969 }
1805out: 1970out:
1971 ehea_update_bcmc_registrations();
1972 up(&ehea_bcmc_regs.lock);
1806 return; 1973 return;
1807} 1974}
1808 1975
@@ -2285,6 +2452,8 @@ static int ehea_up(struct net_device *dev)
2285 if (port->state == EHEA_PORT_UP) 2452 if (port->state == EHEA_PORT_UP)
2286 return 0; 2453 return 0;
2287 2454
2455 down(&ehea_fw_handles.lock);
2456
2288 ret = ehea_port_res_setup(port, port->num_def_qps, 2457 ret = ehea_port_res_setup(port, port->num_def_qps,
2289 port->num_add_tx_qps); 2458 port->num_add_tx_qps);
2290 if (ret) { 2459 if (ret) {
@@ -2321,8 +2490,17 @@ static int ehea_up(struct net_device *dev)
2321 } 2490 }
2322 } 2491 }
2323 2492
2324 ret = 0; 2493 down(&ehea_bcmc_regs.lock);
2494
2495 ret = ehea_broadcast_reg_helper(port, H_REG_BCMC);
2496 if (ret) {
2497 ret = -EIO;
2498 goto out_free_irqs;
2499 }
2500
2325 port->state = EHEA_PORT_UP; 2501 port->state = EHEA_PORT_UP;
2502
2503 ret = 0;
2326 goto out; 2504 goto out;
2327 2505
2328out_free_irqs: 2506out_free_irqs:
@@ -2334,6 +2512,12 @@ out:
2334 if (ret) 2512 if (ret)
2335 ehea_info("Failed starting %s. ret=%i", dev->name, ret); 2513 ehea_info("Failed starting %s. ret=%i", dev->name, ret);
2336 2514
2515 ehea_update_bcmc_registrations();
2516 up(&ehea_bcmc_regs.lock);
2517
2518 ehea_update_firmware_handles();
2519 up(&ehea_fw_handles.lock);
2520
2337 return ret; 2521 return ret;
2338} 2522}
2339 2523
@@ -2382,16 +2566,27 @@ static int ehea_down(struct net_device *dev)
2382 if (port->state == EHEA_PORT_DOWN) 2566 if (port->state == EHEA_PORT_DOWN)
2383 return 0; 2567 return 0;
2384 2568
2569 down(&ehea_bcmc_regs.lock);
2385 ehea_drop_multicast_list(dev); 2570 ehea_drop_multicast_list(dev);
2571 ehea_broadcast_reg_helper(port, H_DEREG_BCMC);
2572
2386 ehea_free_interrupts(dev); 2573 ehea_free_interrupts(dev);
2387 2574
2575 down(&ehea_fw_handles.lock);
2576
2388 port->state = EHEA_PORT_DOWN; 2577 port->state = EHEA_PORT_DOWN;
2389 2578
2579 ehea_update_bcmc_registrations();
2580 up(&ehea_bcmc_regs.lock);
2581
2390 ret = ehea_clean_all_portres(port); 2582 ret = ehea_clean_all_portres(port);
2391 if (ret) 2583 if (ret)
2392 ehea_info("Failed freeing resources for %s. ret=%i", 2584 ehea_info("Failed freeing resources for %s. ret=%i",
2393 dev->name, ret); 2585 dev->name, ret);
2394 2586
2587 ehea_update_firmware_handles();
2588 up(&ehea_fw_handles.lock);
2589
2395 return ret; 2590 return ret;
2396} 2591}
2397 2592
@@ -2920,19 +3115,12 @@ struct ehea_port *ehea_setup_single_port(struct ehea_adapter *adapter,
2920 dev->watchdog_timeo = EHEA_WATCH_DOG_TIMEOUT; 3115 dev->watchdog_timeo = EHEA_WATCH_DOG_TIMEOUT;
2921 3116
2922 INIT_WORK(&port->reset_task, ehea_reset_port); 3117 INIT_WORK(&port->reset_task, ehea_reset_port);
2923
2924 ret = ehea_broadcast_reg_helper(port, H_REG_BCMC);
2925 if (ret) {
2926 ret = -EIO;
2927 goto out_unreg_port;
2928 }
2929
2930 ehea_set_ethtool_ops(dev); 3118 ehea_set_ethtool_ops(dev);
2931 3119
2932 ret = register_netdev(dev); 3120 ret = register_netdev(dev);
2933 if (ret) { 3121 if (ret) {
2934 ehea_error("register_netdev failed. ret=%d", ret); 3122 ehea_error("register_netdev failed. ret=%d", ret);
2935 goto out_dereg_bc; 3123 goto out_unreg_port;
2936 } 3124 }
2937 3125
2938 port->lro_max_aggr = lro_max_aggr; 3126 port->lro_max_aggr = lro_max_aggr;
@@ -2949,9 +3137,6 @@ struct ehea_port *ehea_setup_single_port(struct ehea_adapter *adapter,
2949 3137
2950 return port; 3138 return port;
2951 3139
2952out_dereg_bc:
2953 ehea_broadcast_reg_helper(port, H_DEREG_BCMC);
2954
2955out_unreg_port: 3140out_unreg_port:
2956 ehea_unregister_port(port); 3141 ehea_unregister_port(port);
2957 3142
@@ -2971,7 +3156,6 @@ static void ehea_shutdown_single_port(struct ehea_port *port)
2971{ 3156{
2972 unregister_netdev(port->netdev); 3157 unregister_netdev(port->netdev);
2973 ehea_unregister_port(port); 3158 ehea_unregister_port(port);
2974 ehea_broadcast_reg_helper(port, H_DEREG_BCMC);
2975 kfree(port->mc_list); 3159 kfree(port->mc_list);
2976 free_netdev(port->netdev); 3160 free_netdev(port->netdev);
2977 port->adapter->active_ports--; 3161 port->adapter->active_ports--;
@@ -3014,7 +3198,6 @@ static int ehea_setup_ports(struct ehea_adapter *adapter)
3014 3198
3015 i++; 3199 i++;
3016 }; 3200 };
3017
3018 return 0; 3201 return 0;
3019} 3202}
3020 3203
@@ -3159,6 +3342,7 @@ static int __devinit ehea_probe_adapter(struct of_device *dev,
3159 ehea_error("Invalid ibmebus device probed"); 3342 ehea_error("Invalid ibmebus device probed");
3160 return -EINVAL; 3343 return -EINVAL;
3161 } 3344 }
3345 down(&ehea_fw_handles.lock);
3162 3346
3163 adapter = kzalloc(sizeof(*adapter), GFP_KERNEL); 3347 adapter = kzalloc(sizeof(*adapter), GFP_KERNEL);
3164 if (!adapter) { 3348 if (!adapter) {
@@ -3239,7 +3423,10 @@ out_kill_eq:
3239 3423
3240out_free_ad: 3424out_free_ad:
3241 kfree(adapter); 3425 kfree(adapter);
3426
3242out: 3427out:
3428 ehea_update_firmware_handles();
3429 up(&ehea_fw_handles.lock);
3243 return ret; 3430 return ret;
3244} 3431}
3245 3432
@@ -3258,18 +3445,41 @@ static int __devexit ehea_remove(struct of_device *dev)
3258 3445
3259 flush_scheduled_work(); 3446 flush_scheduled_work();
3260 3447
3448 down(&ehea_fw_handles.lock);
3449
3261 ibmebus_free_irq(adapter->neq->attr.ist1, adapter); 3450 ibmebus_free_irq(adapter->neq->attr.ist1, adapter);
3262 tasklet_kill(&adapter->neq_tasklet); 3451 tasklet_kill(&adapter->neq_tasklet);
3263 3452
3264 ehea_destroy_eq(adapter->neq); 3453 ehea_destroy_eq(adapter->neq);
3265 ehea_remove_adapter_mr(adapter); 3454 ehea_remove_adapter_mr(adapter);
3266 list_del(&adapter->list); 3455 list_del(&adapter->list);
3267
3268 kfree(adapter); 3456 kfree(adapter);
3269 3457
3458 ehea_update_firmware_handles();
3459 up(&ehea_fw_handles.lock);
3460
3270 return 0; 3461 return 0;
3271} 3462}
3272 3463
3464void ehea_crash_handler(void)
3465{
3466 int i;
3467
3468 if (ehea_fw_handles.arr)
3469 for (i = 0; i < ehea_fw_handles.num_entries; i++)
3470 ehea_h_free_resource(ehea_fw_handles.arr[i].adh,
3471 ehea_fw_handles.arr[i].fwh,
3472 FORCE_FREE);
3473
3474 if (ehea_bcmc_regs.arr)
3475 for (i = 0; i < ehea_bcmc_regs.num_entries; i++)
3476 ehea_h_reg_dereg_bcmc(ehea_bcmc_regs.arr[i].adh,
3477 ehea_bcmc_regs.arr[i].port_id,
3478 ehea_bcmc_regs.arr[i].reg_type,
3479 ehea_bcmc_regs.arr[i].macaddr,
3480 0, H_DEREG_BCMC);
3481}
3482
3273static int ehea_reboot_notifier(struct notifier_block *nb, 3483static int ehea_reboot_notifier(struct notifier_block *nb,
3274 unsigned long action, void *unused) 3484 unsigned long action, void *unused)
3275{ 3485{
@@ -3330,7 +3540,12 @@ int __init ehea_module_init(void)
3330 3540
3331 3541
3332 INIT_WORK(&ehea_rereg_mr_task, ehea_rereg_mrs); 3542 INIT_WORK(&ehea_rereg_mr_task, ehea_rereg_mrs);
3543 memset(&ehea_fw_handles, 0, sizeof(ehea_fw_handles));
3544 memset(&ehea_bcmc_regs, 0, sizeof(ehea_bcmc_regs));
3545
3333 sema_init(&dlpar_mem_lock, 1); 3546 sema_init(&dlpar_mem_lock, 1);
3547 sema_init(&ehea_fw_handles.lock, 1);
3548 sema_init(&ehea_bcmc_regs.lock, 1);
3334 3549
3335 ret = check_module_parm(); 3550 ret = check_module_parm();
3336 if (ret) 3551 if (ret)
@@ -3340,12 +3555,18 @@ int __init ehea_module_init(void)
3340 if (ret) 3555 if (ret)
3341 goto out; 3556 goto out;
3342 3557
3343 register_reboot_notifier(&ehea_reboot_nb); 3558 ret = register_reboot_notifier(&ehea_reboot_nb);
3559 if (ret)
3560 ehea_info("failed registering reboot notifier");
3561
3562 ret = crash_shutdown_register(&ehea_crash_handler);
3563 if (ret)
3564 ehea_info("failed registering crash handler");
3344 3565
3345 ret = ibmebus_register_driver(&ehea_driver); 3566 ret = ibmebus_register_driver(&ehea_driver);
3346 if (ret) { 3567 if (ret) {
3347 ehea_error("failed registering eHEA device driver on ebus"); 3568 ehea_error("failed registering eHEA device driver on ebus");
3348 goto out; 3569 goto out2;
3349 } 3570 }
3350 3571
3351 ret = driver_create_file(&ehea_driver.driver, 3572 ret = driver_create_file(&ehea_driver.driver,
@@ -3353,21 +3574,33 @@ int __init ehea_module_init(void)
3353 if (ret) { 3574 if (ret) {
3354 ehea_error("failed to register capabilities attribute, ret=%d", 3575 ehea_error("failed to register capabilities attribute, ret=%d",
3355 ret); 3576 ret);
3356 unregister_reboot_notifier(&ehea_reboot_nb); 3577 goto out3;
3357 ibmebus_unregister_driver(&ehea_driver);
3358 goto out;
3359 } 3578 }
3360 3579
3580 return ret;
3581
3582out3:
3583 ibmebus_unregister_driver(&ehea_driver);
3584out2:
3585 unregister_reboot_notifier(&ehea_reboot_nb);
3586 crash_shutdown_unregister(&ehea_crash_handler);
3361out: 3587out:
3362 return ret; 3588 return ret;
3363} 3589}
3364 3590
3365static void __exit ehea_module_exit(void) 3591static void __exit ehea_module_exit(void)
3366{ 3592{
3593 int ret;
3594
3367 flush_scheduled_work(); 3595 flush_scheduled_work();
3368 driver_remove_file(&ehea_driver.driver, &driver_attr_capabilities); 3596 driver_remove_file(&ehea_driver.driver, &driver_attr_capabilities);
3369 ibmebus_unregister_driver(&ehea_driver); 3597 ibmebus_unregister_driver(&ehea_driver);
3370 unregister_reboot_notifier(&ehea_reboot_nb); 3598 unregister_reboot_notifier(&ehea_reboot_nb);
3599 ret = crash_shutdown_unregister(&ehea_crash_handler);
3600 if (ret)
3601 ehea_info("failed unregistering crash handler");
3602 kfree(ehea_fw_handles.arr);
3603 kfree(ehea_bcmc_regs.arr);
3371 ehea_destroy_busmap(); 3604 ehea_destroy_busmap();
3372} 3605}
3373 3606
diff --git a/drivers/net/fs_enet/fs_enet-main.c b/drivers/net/fs_enet/fs_enet-main.c
index 42d94edeee26..af869cf9ae7d 100644
--- a/drivers/net/fs_enet/fs_enet-main.c
+++ b/drivers/net/fs_enet/fs_enet-main.c
@@ -946,16 +946,11 @@ static int fs_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
946{ 946{
947 struct fs_enet_private *fep = netdev_priv(dev); 947 struct fs_enet_private *fep = netdev_priv(dev);
948 struct mii_ioctl_data *mii = (struct mii_ioctl_data *)&rq->ifr_data; 948 struct mii_ioctl_data *mii = (struct mii_ioctl_data *)&rq->ifr_data;
949 unsigned long flags;
950 int rc;
951 949
952 if (!netif_running(dev)) 950 if (!netif_running(dev))
953 return -EINVAL; 951 return -EINVAL;
954 952
955 spin_lock_irqsave(&fep->lock, flags); 953 return phy_mii_ioctl(fep->phydev, mii, cmd);
956 rc = phy_mii_ioctl(fep->phydev, mii, cmd);
957 spin_unlock_irqrestore(&fep->lock, flags);
958 return rc;
959} 954}
960 955
961extern int fs_mii_connect(struct net_device *dev); 956extern int fs_mii_connect(struct net_device *dev);
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
index 4244fc282f21..718cf77e345a 100644
--- a/drivers/net/gianfar.c
+++ b/drivers/net/gianfar.c
@@ -605,7 +605,7 @@ void stop_gfar(struct net_device *dev)
605 605
606 free_skb_resources(priv); 606 free_skb_resources(priv);
607 607
608 dma_free_coherent(NULL, 608 dma_free_coherent(&dev->dev,
609 sizeof(struct txbd8)*priv->tx_ring_size 609 sizeof(struct txbd8)*priv->tx_ring_size
610 + sizeof(struct rxbd8)*priv->rx_ring_size, 610 + sizeof(struct rxbd8)*priv->rx_ring_size,
611 priv->tx_bd_base, 611 priv->tx_bd_base,
@@ -626,7 +626,7 @@ static void free_skb_resources(struct gfar_private *priv)
626 for (i = 0; i < priv->tx_ring_size; i++) { 626 for (i = 0; i < priv->tx_ring_size; i++) {
627 627
628 if (priv->tx_skbuff[i]) { 628 if (priv->tx_skbuff[i]) {
629 dma_unmap_single(NULL, txbdp->bufPtr, 629 dma_unmap_single(&priv->dev->dev, txbdp->bufPtr,
630 txbdp->length, 630 txbdp->length,
631 DMA_TO_DEVICE); 631 DMA_TO_DEVICE);
632 dev_kfree_skb_any(priv->tx_skbuff[i]); 632 dev_kfree_skb_any(priv->tx_skbuff[i]);
@@ -643,7 +643,7 @@ static void free_skb_resources(struct gfar_private *priv)
643 if(priv->rx_skbuff != NULL) { 643 if(priv->rx_skbuff != NULL) {
644 for (i = 0; i < priv->rx_ring_size; i++) { 644 for (i = 0; i < priv->rx_ring_size; i++) {
645 if (priv->rx_skbuff[i]) { 645 if (priv->rx_skbuff[i]) {
646 dma_unmap_single(NULL, rxbdp->bufPtr, 646 dma_unmap_single(&priv->dev->dev, rxbdp->bufPtr,
647 priv->rx_buffer_size, 647 priv->rx_buffer_size,
648 DMA_FROM_DEVICE); 648 DMA_FROM_DEVICE);
649 649
@@ -708,7 +708,7 @@ int startup_gfar(struct net_device *dev)
708 gfar_write(&regs->imask, IMASK_INIT_CLEAR); 708 gfar_write(&regs->imask, IMASK_INIT_CLEAR);
709 709
710 /* Allocate memory for the buffer descriptors */ 710 /* Allocate memory for the buffer descriptors */
711 vaddr = (unsigned long) dma_alloc_coherent(NULL, 711 vaddr = (unsigned long) dma_alloc_coherent(&dev->dev,
712 sizeof (struct txbd8) * priv->tx_ring_size + 712 sizeof (struct txbd8) * priv->tx_ring_size +
713 sizeof (struct rxbd8) * priv->rx_ring_size, 713 sizeof (struct rxbd8) * priv->rx_ring_size,
714 &addr, GFP_KERNEL); 714 &addr, GFP_KERNEL);
@@ -919,7 +919,7 @@ err_irq_fail:
919rx_skb_fail: 919rx_skb_fail:
920 free_skb_resources(priv); 920 free_skb_resources(priv);
921tx_skb_fail: 921tx_skb_fail:
922 dma_free_coherent(NULL, 922 dma_free_coherent(&dev->dev,
923 sizeof(struct txbd8)*priv->tx_ring_size 923 sizeof(struct txbd8)*priv->tx_ring_size
924 + sizeof(struct rxbd8)*priv->rx_ring_size, 924 + sizeof(struct rxbd8)*priv->rx_ring_size,
925 priv->tx_bd_base, 925 priv->tx_bd_base,
@@ -1053,7 +1053,7 @@ static int gfar_start_xmit(struct sk_buff *skb, struct net_device *dev)
1053 1053
1054 /* Set buffer length and pointer */ 1054 /* Set buffer length and pointer */
1055 txbdp->length = skb->len; 1055 txbdp->length = skb->len;
1056 txbdp->bufPtr = dma_map_single(NULL, skb->data, 1056 txbdp->bufPtr = dma_map_single(&dev->dev, skb->data,
1057 skb->len, DMA_TO_DEVICE); 1057 skb->len, DMA_TO_DEVICE);
1058 1058
1059 /* Save the skb pointer so we can free it later */ 1059 /* Save the skb pointer so we can free it later */
@@ -1332,7 +1332,7 @@ struct sk_buff * gfar_new_skb(struct net_device *dev, struct rxbd8 *bdp)
1332 */ 1332 */
1333 skb_reserve(skb, alignamount); 1333 skb_reserve(skb, alignamount);
1334 1334
1335 bdp->bufPtr = dma_map_single(NULL, skb->data, 1335 bdp->bufPtr = dma_map_single(&dev->dev, skb->data,
1336 priv->rx_buffer_size, DMA_FROM_DEVICE); 1336 priv->rx_buffer_size, DMA_FROM_DEVICE);
1337 1337
1338 bdp->length = 0; 1338 bdp->length = 0;
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
index bff280eff5e3..6a1f23092099 100644
--- a/drivers/net/igb/igb_main.c
+++ b/drivers/net/igb/igb_main.c
@@ -439,7 +439,7 @@ static int igb_request_irq(struct igb_adapter *adapter)
439 err = igb_request_msix(adapter); 439 err = igb_request_msix(adapter);
440 if (!err) { 440 if (!err) {
441 /* enable IAM, auto-mask, 441 /* enable IAM, auto-mask,
442 * DO NOT USE EIAME or IAME in legacy mode */ 442 * DO NOT USE EIAM or IAM in legacy mode */
443 wr32(E1000_IAM, IMS_ENABLE_MASK); 443 wr32(E1000_IAM, IMS_ENABLE_MASK);
444 goto request_done; 444 goto request_done;
445 } 445 }
@@ -465,14 +465,9 @@ static int igb_request_irq(struct igb_adapter *adapter)
465 err = request_irq(adapter->pdev->irq, &igb_intr, IRQF_SHARED, 465 err = request_irq(adapter->pdev->irq, &igb_intr, IRQF_SHARED,
466 netdev->name, netdev); 466 netdev->name, netdev);
467 467
468 if (err) { 468 if (err)
469 dev_err(&adapter->pdev->dev, "Error %d getting interrupt\n", 469 dev_err(&adapter->pdev->dev, "Error %d getting interrupt\n",
470 err); 470 err);
471 goto request_done;
472 }
473
474 /* enable IAM, auto-mask */
475 wr32(E1000_IAM, IMS_ENABLE_MASK);
476 471
477request_done: 472request_done:
478 return err; 473 return err;
@@ -821,7 +816,8 @@ void igb_reset(struct igb_adapter *adapter)
821 wr32(E1000_VET, ETHERNET_IEEE_VLAN_TYPE); 816 wr32(E1000_VET, ETHERNET_IEEE_VLAN_TYPE);
822 817
823 igb_reset_adaptive(&adapter->hw); 818 igb_reset_adaptive(&adapter->hw);
824 adapter->hw.phy.ops.get_phy_info(&adapter->hw); 819 if (adapter->hw.phy.ops.get_phy_info)
820 adapter->hw.phy.ops.get_phy_info(&adapter->hw);
825} 821}
826 822
827/** 823/**
@@ -2057,7 +2053,8 @@ static void igb_set_multi(struct net_device *netdev)
2057static void igb_update_phy_info(unsigned long data) 2053static void igb_update_phy_info(unsigned long data)
2058{ 2054{
2059 struct igb_adapter *adapter = (struct igb_adapter *) data; 2055 struct igb_adapter *adapter = (struct igb_adapter *) data;
2060 adapter->hw.phy.ops.get_phy_info(&adapter->hw); 2056 if (adapter->hw.phy.ops.get_phy_info)
2057 adapter->hw.phy.ops.get_phy_info(&adapter->hw);
2061} 2058}
2062 2059
2063/** 2060/**
diff --git a/drivers/net/ixgb/ixgb_ethtool.c b/drivers/net/ixgb/ixgb_ethtool.c
index 53a9fd086f96..75f3a68ee354 100644
--- a/drivers/net/ixgb/ixgb_ethtool.c
+++ b/drivers/net/ixgb/ixgb_ethtool.c
@@ -67,6 +67,7 @@ static struct ixgb_stats ixgb_gstrings_stats[] = {
67 {"rx_over_errors", IXGB_STAT(net_stats.rx_over_errors)}, 67 {"rx_over_errors", IXGB_STAT(net_stats.rx_over_errors)},
68 {"rx_crc_errors", IXGB_STAT(net_stats.rx_crc_errors)}, 68 {"rx_crc_errors", IXGB_STAT(net_stats.rx_crc_errors)},
69 {"rx_frame_errors", IXGB_STAT(net_stats.rx_frame_errors)}, 69 {"rx_frame_errors", IXGB_STAT(net_stats.rx_frame_errors)},
70 {"rx_no_buffer_count", IXGB_STAT(stats.rnbc)},
70 {"rx_fifo_errors", IXGB_STAT(net_stats.rx_fifo_errors)}, 71 {"rx_fifo_errors", IXGB_STAT(net_stats.rx_fifo_errors)},
71 {"rx_missed_errors", IXGB_STAT(net_stats.rx_missed_errors)}, 72 {"rx_missed_errors", IXGB_STAT(net_stats.rx_missed_errors)},
72 {"tx_aborted_errors", IXGB_STAT(net_stats.tx_aborted_errors)}, 73 {"tx_aborted_errors", IXGB_STAT(net_stats.tx_aborted_errors)},
diff --git a/drivers/net/macb.c b/drivers/net/macb.c
index 81bf005ff280..1d210ed46130 100644
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
@@ -148,7 +148,7 @@ static void macb_handle_link_change(struct net_device *dev)
148 148
149 if (phydev->duplex) 149 if (phydev->duplex)
150 reg |= MACB_BIT(FD); 150 reg |= MACB_BIT(FD);
151 if (phydev->speed) 151 if (phydev->speed == SPEED_100)
152 reg |= MACB_BIT(SPD); 152 reg |= MACB_BIT(SPD);
153 153
154 macb_writel(bp, NCFGR, reg); 154 macb_writel(bp, NCFGR, reg);
diff --git a/drivers/net/pcmcia/pcnet_cs.c b/drivers/net/pcmcia/pcnet_cs.c
index 6323988dfa1d..fd8158a86f64 100644
--- a/drivers/net/pcmcia/pcnet_cs.c
+++ b/drivers/net/pcmcia/pcnet_cs.c
@@ -590,6 +590,13 @@ static int pcnet_config(struct pcmcia_device *link)
590 dev->if_port = 0; 590 dev->if_port = 0;
591 } 591 }
592 592
593 if ((link->conf.ConfigBase == 0x03c0)
594 && (link->manf_id == 0x149) && (link->card_id = 0xc1ab)) {
595 printk(KERN_INFO "pcnet_cs: this is an AX88190 card!\n");
596 printk(KERN_INFO "pcnet_cs: use axnet_cs instead.\n");
597 goto failed;
598 }
599
593 local_hw_info = get_hwinfo(link); 600 local_hw_info = get_hwinfo(link);
594 if (local_hw_info == NULL) 601 if (local_hw_info == NULL)
595 local_hw_info = get_prom(link); 602 local_hw_info = get_prom(link);
@@ -1567,12 +1574,11 @@ static struct pcmcia_device_id pcnet_ids[] = {
1567 PCMCIA_DEVICE_MANF_CARD(0x0104, 0x0145), 1574 PCMCIA_DEVICE_MANF_CARD(0x0104, 0x0145),
1568 PCMCIA_DEVICE_MANF_CARD(0x0149, 0x0230), 1575 PCMCIA_DEVICE_MANF_CARD(0x0149, 0x0230),
1569 PCMCIA_DEVICE_MANF_CARD(0x0149, 0x4530), 1576 PCMCIA_DEVICE_MANF_CARD(0x0149, 0x4530),
1570/* PCMCIA_DEVICE_MANF_CARD(0x0149, 0xc1ab), conflict with axnet_cs */ 1577 PCMCIA_DEVICE_MANF_CARD(0x0149, 0xc1ab),
1571 PCMCIA_DEVICE_MANF_CARD(0x0186, 0x0110), 1578 PCMCIA_DEVICE_MANF_CARD(0x0186, 0x0110),
1572 PCMCIA_DEVICE_MANF_CARD(0x01bf, 0x2328), 1579 PCMCIA_DEVICE_MANF_CARD(0x01bf, 0x2328),
1573 PCMCIA_DEVICE_MANF_CARD(0x01bf, 0x8041), 1580 PCMCIA_DEVICE_MANF_CARD(0x01bf, 0x8041),
1574 PCMCIA_DEVICE_MANF_CARD(0x0213, 0x2452), 1581 PCMCIA_DEVICE_MANF_CARD(0x0213, 0x2452),
1575/* PCMCIA_DEVICE_MANF_CARD(0x021b, 0x0202), conflict with axnet_cs */
1576 PCMCIA_DEVICE_MANF_CARD(0x026f, 0x0300), 1582 PCMCIA_DEVICE_MANF_CARD(0x026f, 0x0300),
1577 PCMCIA_DEVICE_MANF_CARD(0x026f, 0x0307), 1583 PCMCIA_DEVICE_MANF_CARD(0x026f, 0x0307),
1578 PCMCIA_DEVICE_MANF_CARD(0x026f, 0x030a), 1584 PCMCIA_DEVICE_MANF_CARD(0x026f, 0x030a),
diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c
index 6e9f619c491f..963630c65ca9 100644
--- a/drivers/net/phy/mdio_bus.c
+++ b/drivers/net/phy/mdio_bus.c
@@ -49,13 +49,13 @@ int mdiobus_register(struct mii_bus *bus)
49 int i; 49 int i;
50 int err = 0; 50 int err = 0;
51 51
52 mutex_init(&bus->mdio_lock);
53
54 if (NULL == bus || NULL == bus->name || 52 if (NULL == bus || NULL == bus->name ||
55 NULL == bus->read || 53 NULL == bus->read ||
56 NULL == bus->write) 54 NULL == bus->write)
57 return -EINVAL; 55 return -EINVAL;
58 56
57 mutex_init(&bus->mdio_lock);
58
59 if (bus->reset) 59 if (bus->reset)
60 bus->reset(bus); 60 bus->reset(bus);
61 61
diff --git a/drivers/net/sis190.c b/drivers/net/sis190.c
index 202fdf356621..20745fd4e973 100644
--- a/drivers/net/sis190.c
+++ b/drivers/net/sis190.c
@@ -1633,13 +1633,18 @@ static inline void sis190_init_rxfilter(struct net_device *dev)
1633static int __devinit sis190_get_mac_addr(struct pci_dev *pdev, 1633static int __devinit sis190_get_mac_addr(struct pci_dev *pdev,
1634 struct net_device *dev) 1634 struct net_device *dev)
1635{ 1635{
1636 u8 from; 1636 int rc;
1637
1638 rc = sis190_get_mac_addr_from_eeprom(pdev, dev);
1639 if (rc < 0) {
1640 u8 reg;
1637 1641
1638 pci_read_config_byte(pdev, 0x73, &from); 1642 pci_read_config_byte(pdev, 0x73, &reg);
1639 1643
1640 return (from & 0x00000001) ? 1644 if (reg & 0x00000001)
1641 sis190_get_mac_addr_from_apc(pdev, dev) : 1645 rc = sis190_get_mac_addr_from_apc(pdev, dev);
1642 sis190_get_mac_addr_from_eeprom(pdev, dev); 1646 }
1647 return rc;
1643} 1648}
1644 1649
1645static void sis190_set_speed_auto(struct net_device *dev) 1650static void sis190_set_speed_auto(struct net_device *dev)
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index 9a6295909e43..54c662690f65 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -572,8 +572,9 @@ static void sky2_phy_init(struct sky2_hw *hw, unsigned port)
572 default: 572 default:
573 /* set Tx LED (LED_TX) to blink mode on Rx OR Tx activity */ 573 /* set Tx LED (LED_TX) to blink mode on Rx OR Tx activity */
574 ledctrl |= PHY_M_LED_BLINK_RT(BLINK_84MS) | PHY_M_LEDC_TX_CTRL; 574 ledctrl |= PHY_M_LED_BLINK_RT(BLINK_84MS) | PHY_M_LEDC_TX_CTRL;
575
575 /* turn off the Rx LED (LED_RX) */ 576 /* turn off the Rx LED (LED_RX) */
576 ledover &= ~PHY_M_LED_MO_RX; 577 ledover |= PHY_M_LED_MO_RX(MO_LED_OFF);
577 } 578 }
578 579
579 if (hw->chip_id == CHIP_ID_YUKON_EC_U && 580 if (hw->chip_id == CHIP_ID_YUKON_EC_U &&
@@ -602,7 +603,7 @@ static void sky2_phy_init(struct sky2_hw *hw, unsigned port)
602 603
603 if (sky2->autoneg == AUTONEG_DISABLE || sky2->speed == SPEED_100) { 604 if (sky2->autoneg == AUTONEG_DISABLE || sky2->speed == SPEED_100) {
604 /* turn on 100 Mbps LED (LED_LINK100) */ 605 /* turn on 100 Mbps LED (LED_LINK100) */
605 ledover |= PHY_M_LED_MO_100; 606 ledover |= PHY_M_LED_MO_100(MO_LED_ON);
606 } 607 }
607 608
608 if (ledover) 609 if (ledover)
@@ -3322,82 +3323,80 @@ static void sky2_set_multicast(struct net_device *dev)
3322/* Can have one global because blinking is controlled by 3323/* Can have one global because blinking is controlled by
3323 * ethtool and that is always under RTNL mutex 3324 * ethtool and that is always under RTNL mutex
3324 */ 3325 */
3325static void sky2_led(struct sky2_hw *hw, unsigned port, int on) 3326static void sky2_led(struct sky2_port *sky2, enum led_mode mode)
3326{ 3327{
3327 u16 pg; 3328 struct sky2_hw *hw = sky2->hw;
3329 unsigned port = sky2->port;
3328 3330
3329 switch (hw->chip_id) { 3331 spin_lock_bh(&sky2->phy_lock);
3330 case CHIP_ID_YUKON_XL: 3332 if (hw->chip_id == CHIP_ID_YUKON_EC_U ||
3333 hw->chip_id == CHIP_ID_YUKON_EX ||
3334 hw->chip_id == CHIP_ID_YUKON_SUPR) {
3335 u16 pg;
3331 pg = gm_phy_read(hw, port, PHY_MARV_EXT_ADR); 3336 pg = gm_phy_read(hw, port, PHY_MARV_EXT_ADR);
3332 gm_phy_write(hw, port, PHY_MARV_EXT_ADR, 3); 3337 gm_phy_write(hw, port, PHY_MARV_EXT_ADR, 3);
3333 gm_phy_write(hw, port, PHY_MARV_PHY_CTRL,
3334 on ? (PHY_M_LEDC_LOS_CTRL(1) |
3335 PHY_M_LEDC_INIT_CTRL(7) |
3336 PHY_M_LEDC_STA1_CTRL(7) |
3337 PHY_M_LEDC_STA0_CTRL(7))
3338 : 0);
3339 3338
3340 gm_phy_write(hw, port, PHY_MARV_EXT_ADR, pg); 3339 switch (mode) {
3341 break; 3340 case MO_LED_OFF:
3341 gm_phy_write(hw, port, PHY_MARV_PHY_CTRL,
3342 PHY_M_LEDC_LOS_CTRL(8) |
3343 PHY_M_LEDC_INIT_CTRL(8) |
3344 PHY_M_LEDC_STA1_CTRL(8) |
3345 PHY_M_LEDC_STA0_CTRL(8));
3346 break;
3347 case MO_LED_ON:
3348 gm_phy_write(hw, port, PHY_MARV_PHY_CTRL,
3349 PHY_M_LEDC_LOS_CTRL(9) |
3350 PHY_M_LEDC_INIT_CTRL(9) |
3351 PHY_M_LEDC_STA1_CTRL(9) |
3352 PHY_M_LEDC_STA0_CTRL(9));
3353 break;
3354 case MO_LED_BLINK:
3355 gm_phy_write(hw, port, PHY_MARV_PHY_CTRL,
3356 PHY_M_LEDC_LOS_CTRL(0xa) |
3357 PHY_M_LEDC_INIT_CTRL(0xa) |
3358 PHY_M_LEDC_STA1_CTRL(0xa) |
3359 PHY_M_LEDC_STA0_CTRL(0xa));
3360 break;
3361 case MO_LED_NORM:
3362 gm_phy_write(hw, port, PHY_MARV_PHY_CTRL,
3363 PHY_M_LEDC_LOS_CTRL(1) |
3364 PHY_M_LEDC_INIT_CTRL(8) |
3365 PHY_M_LEDC_STA1_CTRL(7) |
3366 PHY_M_LEDC_STA0_CTRL(7));
3367 }
3342 3368
3343 default: 3369 gm_phy_write(hw, port, PHY_MARV_EXT_ADR, pg);
3344 gm_phy_write(hw, port, PHY_MARV_LED_CTRL, 0); 3370 } else
3345 gm_phy_write(hw, port, PHY_MARV_LED_OVER, 3371 gm_phy_write(hw, port, PHY_MARV_LED_OVER,
3346 on ? PHY_M_LED_ALL : 0); 3372 PHY_M_LED_MO_DUP(mode) |
3347 } 3373 PHY_M_LED_MO_10(mode) |
3374 PHY_M_LED_MO_100(mode) |
3375 PHY_M_LED_MO_1000(mode) |
3376 PHY_M_LED_MO_RX(mode) |
3377 PHY_M_LED_MO_TX(mode));
3378
3379 spin_unlock_bh(&sky2->phy_lock);
3348} 3380}
3349 3381
3350/* blink LED's for finding board */ 3382/* blink LED's for finding board */
3351static int sky2_phys_id(struct net_device *dev, u32 data) 3383static int sky2_phys_id(struct net_device *dev, u32 data)
3352{ 3384{
3353 struct sky2_port *sky2 = netdev_priv(dev); 3385 struct sky2_port *sky2 = netdev_priv(dev);
3354 struct sky2_hw *hw = sky2->hw; 3386 unsigned int i;
3355 unsigned port = sky2->port;
3356 u16 ledctrl, ledover = 0;
3357 long ms;
3358 int interrupted;
3359 int onoff = 1;
3360 3387
3361 if (!data || data > (u32) (MAX_SCHEDULE_TIMEOUT / HZ)) 3388 if (data == 0)
3362 ms = jiffies_to_msecs(MAX_SCHEDULE_TIMEOUT); 3389 data = UINT_MAX;
3363 else
3364 ms = data * 1000;
3365
3366 /* save initial values */
3367 spin_lock_bh(&sky2->phy_lock);
3368 if (hw->chip_id == CHIP_ID_YUKON_XL) {
3369 u16 pg = gm_phy_read(hw, port, PHY_MARV_EXT_ADR);
3370 gm_phy_write(hw, port, PHY_MARV_EXT_ADR, 3);
3371 ledctrl = gm_phy_read(hw, port, PHY_MARV_PHY_CTRL);
3372 gm_phy_write(hw, port, PHY_MARV_EXT_ADR, pg);
3373 } else {
3374 ledctrl = gm_phy_read(hw, port, PHY_MARV_LED_CTRL);
3375 ledover = gm_phy_read(hw, port, PHY_MARV_LED_OVER);
3376 }
3377
3378 interrupted = 0;
3379 while (!interrupted && ms > 0) {
3380 sky2_led(hw, port, onoff);
3381 onoff = !onoff;
3382
3383 spin_unlock_bh(&sky2->phy_lock);
3384 interrupted = msleep_interruptible(250);
3385 spin_lock_bh(&sky2->phy_lock);
3386
3387 ms -= 250;
3388 }
3389 3390
3390 /* resume regularly scheduled programming */ 3391 for (i = 0; i < data; i++) {
3391 if (hw->chip_id == CHIP_ID_YUKON_XL) { 3392 sky2_led(sky2, MO_LED_ON);
3392 u16 pg = gm_phy_read(hw, port, PHY_MARV_EXT_ADR); 3393 if (msleep_interruptible(500))
3393 gm_phy_write(hw, port, PHY_MARV_EXT_ADR, 3); 3394 break;
3394 gm_phy_write(hw, port, PHY_MARV_PHY_CTRL, ledctrl); 3395 sky2_led(sky2, MO_LED_OFF);
3395 gm_phy_write(hw, port, PHY_MARV_EXT_ADR, pg); 3396 if (msleep_interruptible(500))
3396 } else { 3397 break;
3397 gm_phy_write(hw, port, PHY_MARV_LED_CTRL, ledctrl);
3398 gm_phy_write(hw, port, PHY_MARV_LED_OVER, ledover);
3399 } 3398 }
3400 spin_unlock_bh(&sky2->phy_lock); 3399 sky2_led(sky2, MO_LED_NORM);
3401 3400
3402 return 0; 3401 return 0;
3403} 3402}
diff --git a/drivers/net/sky2.h b/drivers/net/sky2.h
index 5ab5c1c7c5aa..7bb3ba9bcbd8 100644
--- a/drivers/net/sky2.h
+++ b/drivers/net/sky2.h
@@ -1318,18 +1318,21 @@ enum {
1318 BLINK_670MS = 4,/* 670 ms */ 1318 BLINK_670MS = 4,/* 670 ms */
1319}; 1319};
1320 1320
1321/**** PHY_MARV_LED_OVER 16 bit r/w LED control */ 1321/***** PHY_MARV_LED_OVER 16 bit r/w Manual LED Override Reg *****/
1322enum { 1322#define PHY_M_LED_MO_SGMII(x) ((x)<<14) /* Bit 15..14: SGMII AN Timer */
1323 PHY_M_LED_MO_DUP = 3<<10,/* Bit 11..10: Duplex */ 1323
1324 PHY_M_LED_MO_10 = 3<<8, /* Bit 9.. 8: Link 10 */ 1324#define PHY_M_LED_MO_DUP(x) ((x)<<10) /* Bit 11..10: Duplex */
1325 PHY_M_LED_MO_100 = 3<<6, /* Bit 7.. 6: Link 100 */ 1325#define PHY_M_LED_MO_10(x) ((x)<<8) /* Bit 9.. 8: Link 10 */
1326 PHY_M_LED_MO_1000 = 3<<4, /* Bit 5.. 4: Link 1000 */ 1326#define PHY_M_LED_MO_100(x) ((x)<<6) /* Bit 7.. 6: Link 100 */
1327 PHY_M_LED_MO_RX = 3<<2, /* Bit 3.. 2: Rx */ 1327#define PHY_M_LED_MO_1000(x) ((x)<<4) /* Bit 5.. 4: Link 1000 */
1328 PHY_M_LED_MO_TX = 3<<0, /* Bit 1.. 0: Tx */ 1328#define PHY_M_LED_MO_RX(x) ((x)<<2) /* Bit 3.. 2: Rx */
1329 1329#define PHY_M_LED_MO_TX(x) ((x)<<0) /* Bit 1.. 0: Tx */
1330 PHY_M_LED_ALL = PHY_M_LED_MO_DUP | PHY_M_LED_MO_10 1330
1331 | PHY_M_LED_MO_100 | PHY_M_LED_MO_1000 1331enum led_mode {
1332 | PHY_M_LED_MO_RX, 1332 MO_LED_NORM = 0,
1333 MO_LED_BLINK = 1,
1334 MO_LED_OFF = 2,
1335 MO_LED_ON = 3,
1333}; 1336};
1334 1337
1335/***** PHY_MARV_EXT_CTRL_2 16 bit r/w Ext. PHY Specific Ctrl 2 *****/ 1338/***** PHY_MARV_EXT_CTRL_2 16 bit r/w Ext. PHY Specific Ctrl 2 *****/
diff --git a/drivers/net/tlan.c b/drivers/net/tlan.c
index 3af5b92b48c8..0166407d7061 100644
--- a/drivers/net/tlan.c
+++ b/drivers/net/tlan.c
@@ -1400,7 +1400,7 @@ static void TLan_SetMulticastList( struct net_device *dev )
1400 * 1400 *
1401 **************************************************************/ 1401 **************************************************************/
1402 1402
1403u32 TLan_HandleInvalid( struct net_device *dev, u16 host_int ) 1403static u32 TLan_HandleInvalid( struct net_device *dev, u16 host_int )
1404{ 1404{
1405 /* printk( "TLAN: Invalid interrupt on %s.\n", dev->name ); */ 1405 /* printk( "TLAN: Invalid interrupt on %s.\n", dev->name ); */
1406 return 0; 1406 return 0;
@@ -1432,7 +1432,7 @@ u32 TLan_HandleInvalid( struct net_device *dev, u16 host_int )
1432 * 1432 *
1433 **************************************************************/ 1433 **************************************************************/
1434 1434
1435u32 TLan_HandleTxEOF( struct net_device *dev, u16 host_int ) 1435static u32 TLan_HandleTxEOF( struct net_device *dev, u16 host_int )
1436{ 1436{
1437 TLanPrivateInfo *priv = netdev_priv(dev); 1437 TLanPrivateInfo *priv = netdev_priv(dev);
1438 int eoc = 0; 1438 int eoc = 0;
@@ -1518,7 +1518,7 @@ u32 TLan_HandleTxEOF( struct net_device *dev, u16 host_int )
1518 * 1518 *
1519 **************************************************************/ 1519 **************************************************************/
1520 1520
1521u32 TLan_HandleStatOverflow( struct net_device *dev, u16 host_int ) 1521static u32 TLan_HandleStatOverflow( struct net_device *dev, u16 host_int )
1522{ 1522{
1523 TLan_ReadAndClearStats( dev, TLAN_RECORD ); 1523 TLan_ReadAndClearStats( dev, TLAN_RECORD );
1524 1524
@@ -1554,7 +1554,7 @@ u32 TLan_HandleStatOverflow( struct net_device *dev, u16 host_int )
1554 * 1554 *
1555 **************************************************************/ 1555 **************************************************************/
1556 1556
1557u32 TLan_HandleRxEOF( struct net_device *dev, u16 host_int ) 1557static u32 TLan_HandleRxEOF( struct net_device *dev, u16 host_int )
1558{ 1558{
1559 TLanPrivateInfo *priv = netdev_priv(dev); 1559 TLanPrivateInfo *priv = netdev_priv(dev);
1560 u32 ack = 0; 1560 u32 ack = 0;
@@ -1689,7 +1689,7 @@ u32 TLan_HandleRxEOF( struct net_device *dev, u16 host_int )
1689 * 1689 *
1690 **************************************************************/ 1690 **************************************************************/
1691 1691
1692u32 TLan_HandleDummy( struct net_device *dev, u16 host_int ) 1692static u32 TLan_HandleDummy( struct net_device *dev, u16 host_int )
1693{ 1693{
1694 printk( "TLAN: Test interrupt on %s.\n", dev->name ); 1694 printk( "TLAN: Test interrupt on %s.\n", dev->name );
1695 return 1; 1695 return 1;
@@ -1719,7 +1719,7 @@ u32 TLan_HandleDummy( struct net_device *dev, u16 host_int )
1719 * 1719 *
1720 **************************************************************/ 1720 **************************************************************/
1721 1721
1722u32 TLan_HandleTxEOC( struct net_device *dev, u16 host_int ) 1722static u32 TLan_HandleTxEOC( struct net_device *dev, u16 host_int )
1723{ 1723{
1724 TLanPrivateInfo *priv = netdev_priv(dev); 1724 TLanPrivateInfo *priv = netdev_priv(dev);
1725 TLanList *head_list; 1725 TLanList *head_list;
@@ -1767,7 +1767,7 @@ u32 TLan_HandleTxEOC( struct net_device *dev, u16 host_int )
1767 * 1767 *
1768 **************************************************************/ 1768 **************************************************************/
1769 1769
1770u32 TLan_HandleStatusCheck( struct net_device *dev, u16 host_int ) 1770static u32 TLan_HandleStatusCheck( struct net_device *dev, u16 host_int )
1771{ 1771{
1772 TLanPrivateInfo *priv = netdev_priv(dev); 1772 TLanPrivateInfo *priv = netdev_priv(dev);
1773 u32 ack; 1773 u32 ack;
@@ -1842,7 +1842,7 @@ u32 TLan_HandleStatusCheck( struct net_device *dev, u16 host_int )
1842 * 1842 *
1843 **************************************************************/ 1843 **************************************************************/
1844 1844
1845u32 TLan_HandleRxEOC( struct net_device *dev, u16 host_int ) 1845static u32 TLan_HandleRxEOC( struct net_device *dev, u16 host_int )
1846{ 1846{
1847 TLanPrivateInfo *priv = netdev_priv(dev); 1847 TLanPrivateInfo *priv = netdev_priv(dev);
1848 dma_addr_t head_list_phys; 1848 dma_addr_t head_list_phys;
@@ -1902,7 +1902,7 @@ u32 TLan_HandleRxEOC( struct net_device *dev, u16 host_int )
1902 * 1902 *
1903 **************************************************************/ 1903 **************************************************************/
1904 1904
1905void TLan_Timer( unsigned long data ) 1905static void TLan_Timer( unsigned long data )
1906{ 1906{
1907 struct net_device *dev = (struct net_device *) data; 1907 struct net_device *dev = (struct net_device *) data;
1908 TLanPrivateInfo *priv = netdev_priv(dev); 1908 TLanPrivateInfo *priv = netdev_priv(dev);
@@ -1983,7 +1983,7 @@ void TLan_Timer( unsigned long data )
1983 * 1983 *
1984 **************************************************************/ 1984 **************************************************************/
1985 1985
1986void TLan_ResetLists( struct net_device *dev ) 1986static void TLan_ResetLists( struct net_device *dev )
1987{ 1987{
1988 TLanPrivateInfo *priv = netdev_priv(dev); 1988 TLanPrivateInfo *priv = netdev_priv(dev);
1989 int i; 1989 int i;
@@ -2043,7 +2043,7 @@ void TLan_ResetLists( struct net_device *dev )
2043} /* TLan_ResetLists */ 2043} /* TLan_ResetLists */
2044 2044
2045 2045
2046void TLan_FreeLists( struct net_device *dev ) 2046static void TLan_FreeLists( struct net_device *dev )
2047{ 2047{
2048 TLanPrivateInfo *priv = netdev_priv(dev); 2048 TLanPrivateInfo *priv = netdev_priv(dev);
2049 int i; 2049 int i;
@@ -2092,7 +2092,7 @@ void TLan_FreeLists( struct net_device *dev )
2092 * 2092 *
2093 **************************************************************/ 2093 **************************************************************/
2094 2094
2095void TLan_PrintDio( u16 io_base ) 2095static void TLan_PrintDio( u16 io_base )
2096{ 2096{
2097 u32 data0, data1; 2097 u32 data0, data1;
2098 int i; 2098 int i;
@@ -2127,7 +2127,7 @@ void TLan_PrintDio( u16 io_base )
2127 * 2127 *
2128 **************************************************************/ 2128 **************************************************************/
2129 2129
2130void TLan_PrintList( TLanList *list, char *type, int num) 2130static void TLan_PrintList( TLanList *list, char *type, int num)
2131{ 2131{
2132 int i; 2132 int i;
2133 2133
@@ -2163,7 +2163,7 @@ void TLan_PrintList( TLanList *list, char *type, int num)
2163 * 2163 *
2164 **************************************************************/ 2164 **************************************************************/
2165 2165
2166void TLan_ReadAndClearStats( struct net_device *dev, int record ) 2166static void TLan_ReadAndClearStats( struct net_device *dev, int record )
2167{ 2167{
2168 TLanPrivateInfo *priv = netdev_priv(dev); 2168 TLanPrivateInfo *priv = netdev_priv(dev);
2169 u32 tx_good, tx_under; 2169 u32 tx_good, tx_under;
@@ -2238,7 +2238,7 @@ void TLan_ReadAndClearStats( struct net_device *dev, int record )
2238 * 2238 *
2239 **************************************************************/ 2239 **************************************************************/
2240 2240
2241void 2241static void
2242TLan_ResetAdapter( struct net_device *dev ) 2242TLan_ResetAdapter( struct net_device *dev )
2243{ 2243{
2244 TLanPrivateInfo *priv = netdev_priv(dev); 2244 TLanPrivateInfo *priv = netdev_priv(dev);
@@ -2324,7 +2324,7 @@ TLan_ResetAdapter( struct net_device *dev )
2324 2324
2325 2325
2326 2326
2327void 2327static void
2328TLan_FinishReset( struct net_device *dev ) 2328TLan_FinishReset( struct net_device *dev )
2329{ 2329{
2330 TLanPrivateInfo *priv = netdev_priv(dev); 2330 TLanPrivateInfo *priv = netdev_priv(dev);
@@ -2448,7 +2448,7 @@ TLan_FinishReset( struct net_device *dev )
2448 * 2448 *
2449 **************************************************************/ 2449 **************************************************************/
2450 2450
2451void TLan_SetMac( struct net_device *dev, int areg, char *mac ) 2451static void TLan_SetMac( struct net_device *dev, int areg, char *mac )
2452{ 2452{
2453 int i; 2453 int i;
2454 2454
@@ -2490,7 +2490,7 @@ void TLan_SetMac( struct net_device *dev, int areg, char *mac )
2490 * 2490 *
2491 ********************************************************************/ 2491 ********************************************************************/
2492 2492
2493void TLan_PhyPrint( struct net_device *dev ) 2493static void TLan_PhyPrint( struct net_device *dev )
2494{ 2494{
2495 TLanPrivateInfo *priv = netdev_priv(dev); 2495 TLanPrivateInfo *priv = netdev_priv(dev);
2496 u16 i, data0, data1, data2, data3, phy; 2496 u16 i, data0, data1, data2, data3, phy;
@@ -2539,7 +2539,7 @@ void TLan_PhyPrint( struct net_device *dev )
2539 * 2539 *
2540 ********************************************************************/ 2540 ********************************************************************/
2541 2541
2542void TLan_PhyDetect( struct net_device *dev ) 2542static void TLan_PhyDetect( struct net_device *dev )
2543{ 2543{
2544 TLanPrivateInfo *priv = netdev_priv(dev); 2544 TLanPrivateInfo *priv = netdev_priv(dev);
2545 u16 control; 2545 u16 control;
@@ -2586,7 +2586,7 @@ void TLan_PhyDetect( struct net_device *dev )
2586 2586
2587 2587
2588 2588
2589void TLan_PhyPowerDown( struct net_device *dev ) 2589static void TLan_PhyPowerDown( struct net_device *dev )
2590{ 2590{
2591 TLanPrivateInfo *priv = netdev_priv(dev); 2591 TLanPrivateInfo *priv = netdev_priv(dev);
2592 u16 value; 2592 u16 value;
@@ -2611,7 +2611,7 @@ void TLan_PhyPowerDown( struct net_device *dev )
2611 2611
2612 2612
2613 2613
2614void TLan_PhyPowerUp( struct net_device *dev ) 2614static void TLan_PhyPowerUp( struct net_device *dev )
2615{ 2615{
2616 TLanPrivateInfo *priv = netdev_priv(dev); 2616 TLanPrivateInfo *priv = netdev_priv(dev);
2617 u16 value; 2617 u16 value;
@@ -2632,7 +2632,7 @@ void TLan_PhyPowerUp( struct net_device *dev )
2632 2632
2633 2633
2634 2634
2635void TLan_PhyReset( struct net_device *dev ) 2635static void TLan_PhyReset( struct net_device *dev )
2636{ 2636{
2637 TLanPrivateInfo *priv = netdev_priv(dev); 2637 TLanPrivateInfo *priv = netdev_priv(dev);
2638 u16 phy; 2638 u16 phy;
@@ -2660,7 +2660,7 @@ void TLan_PhyReset( struct net_device *dev )
2660 2660
2661 2661
2662 2662
2663void TLan_PhyStartLink( struct net_device *dev ) 2663static void TLan_PhyStartLink( struct net_device *dev )
2664{ 2664{
2665 TLanPrivateInfo *priv = netdev_priv(dev); 2665 TLanPrivateInfo *priv = netdev_priv(dev);
2666 u16 ability; 2666 u16 ability;
@@ -2747,7 +2747,7 @@ void TLan_PhyStartLink( struct net_device *dev )
2747 2747
2748 2748
2749 2749
2750void TLan_PhyFinishAutoNeg( struct net_device *dev ) 2750static void TLan_PhyFinishAutoNeg( struct net_device *dev )
2751{ 2751{
2752 TLanPrivateInfo *priv = netdev_priv(dev); 2752 TLanPrivateInfo *priv = netdev_priv(dev);
2753 u16 an_adv; 2753 u16 an_adv;
@@ -2903,7 +2903,7 @@ void TLan_PhyMonitor( struct net_device *dev )
2903 * 2903 *
2904 **************************************************************/ 2904 **************************************************************/
2905 2905
2906int TLan_MiiReadReg( struct net_device *dev, u16 phy, u16 reg, u16 *val ) 2906static int TLan_MiiReadReg( struct net_device *dev, u16 phy, u16 reg, u16 *val )
2907{ 2907{
2908 u8 nack; 2908 u8 nack;
2909 u16 sio, tmp; 2909 u16 sio, tmp;
@@ -2993,7 +2993,7 @@ int TLan_MiiReadReg( struct net_device *dev, u16 phy, u16 reg, u16 *val )
2993 * 2993 *
2994 **************************************************************/ 2994 **************************************************************/
2995 2995
2996void TLan_MiiSendData( u16 base_port, u32 data, unsigned num_bits ) 2996static void TLan_MiiSendData( u16 base_port, u32 data, unsigned num_bits )
2997{ 2997{
2998 u16 sio; 2998 u16 sio;
2999 u32 i; 2999 u32 i;
@@ -3035,7 +3035,7 @@ void TLan_MiiSendData( u16 base_port, u32 data, unsigned num_bits )
3035 * 3035 *
3036 **************************************************************/ 3036 **************************************************************/
3037 3037
3038void TLan_MiiSync( u16 base_port ) 3038static void TLan_MiiSync( u16 base_port )
3039{ 3039{
3040 int i; 3040 int i;
3041 u16 sio; 3041 u16 sio;
@@ -3074,7 +3074,7 @@ void TLan_MiiSync( u16 base_port )
3074 * 3074 *
3075 **************************************************************/ 3075 **************************************************************/
3076 3076
3077void TLan_MiiWriteReg( struct net_device *dev, u16 phy, u16 reg, u16 val ) 3077static void TLan_MiiWriteReg( struct net_device *dev, u16 phy, u16 reg, u16 val )
3078{ 3078{
3079 u16 sio; 3079 u16 sio;
3080 int minten; 3080 int minten;
@@ -3144,7 +3144,7 @@ void TLan_MiiWriteReg( struct net_device *dev, u16 phy, u16 reg, u16 val )
3144 * 3144 *
3145 **************************************************************/ 3145 **************************************************************/
3146 3146
3147void TLan_EeSendStart( u16 io_base ) 3147static void TLan_EeSendStart( u16 io_base )
3148{ 3148{
3149 u16 sio; 3149 u16 sio;
3150 3150
@@ -3184,7 +3184,7 @@ void TLan_EeSendStart( u16 io_base )
3184 * 3184 *
3185 **************************************************************/ 3185 **************************************************************/
3186 3186
3187int TLan_EeSendByte( u16 io_base, u8 data, int stop ) 3187static int TLan_EeSendByte( u16 io_base, u8 data, int stop )
3188{ 3188{
3189 int err; 3189 int err;
3190 u8 place; 3190 u8 place;
@@ -3245,7 +3245,7 @@ int TLan_EeSendByte( u16 io_base, u8 data, int stop )
3245 * 3245 *
3246 **************************************************************/ 3246 **************************************************************/
3247 3247
3248void TLan_EeReceiveByte( u16 io_base, u8 *data, int stop ) 3248static void TLan_EeReceiveByte( u16 io_base, u8 *data, int stop )
3249{ 3249{
3250 u8 place; 3250 u8 place;
3251 u16 sio; 3251 u16 sio;
@@ -3303,7 +3303,7 @@ void TLan_EeReceiveByte( u16 io_base, u8 *data, int stop )
3303 * 3303 *
3304 **************************************************************/ 3304 **************************************************************/
3305 3305
3306int TLan_EeReadByte( struct net_device *dev, u8 ee_addr, u8 *data ) 3306static int TLan_EeReadByte( struct net_device *dev, u8 ee_addr, u8 *data )
3307{ 3307{
3308 int err; 3308 int err;
3309 TLanPrivateInfo *priv = netdev_priv(dev); 3309 TLanPrivateInfo *priv = netdev_priv(dev);
diff --git a/drivers/net/tulip/uli526x.c b/drivers/net/tulip/uli526x.c
index a7afeea156bd..a59c1f224aa8 100644
--- a/drivers/net/tulip/uli526x.c
+++ b/drivers/net/tulip/uli526x.c
@@ -482,9 +482,11 @@ static void uli526x_init(struct net_device *dev)
482 struct uli526x_board_info *db = netdev_priv(dev); 482 struct uli526x_board_info *db = netdev_priv(dev);
483 unsigned long ioaddr = db->ioaddr; 483 unsigned long ioaddr = db->ioaddr;
484 u8 phy_tmp; 484 u8 phy_tmp;
485 u8 timeout;
485 u16 phy_value; 486 u16 phy_value;
486 u16 phy_reg_reset; 487 u16 phy_reg_reset;
487 488
489
488 ULI526X_DBUG(0, "uli526x_init()", 0); 490 ULI526X_DBUG(0, "uli526x_init()", 0);
489 491
490 /* Reset M526x MAC controller */ 492 /* Reset M526x MAC controller */
@@ -509,11 +511,19 @@ static void uli526x_init(struct net_device *dev)
509 /* Parser SROM and media mode */ 511 /* Parser SROM and media mode */
510 db->media_mode = uli526x_media_mode; 512 db->media_mode = uli526x_media_mode;
511 513
512 /* Phyxcer capability setting */ 514 /* phyxcer capability setting */
513 phy_reg_reset = phy_read(db->ioaddr, db->phy_addr, 0, db->chip_id); 515 phy_reg_reset = phy_read(db->ioaddr, db->phy_addr, 0, db->chip_id);
514 phy_reg_reset = (phy_reg_reset | 0x8000); 516 phy_reg_reset = (phy_reg_reset | 0x8000);
515 phy_write(db->ioaddr, db->phy_addr, 0, phy_reg_reset, db->chip_id); 517 phy_write(db->ioaddr, db->phy_addr, 0, phy_reg_reset, db->chip_id);
518
519 /* See IEEE 802.3-2002.pdf (Section 2, Chapter "22.2.4 Management
520 * functions") or phy data sheet for details on phy reset
521 */
516 udelay(500); 522 udelay(500);
523 timeout = 10;
524 while (timeout-- &&
525 phy_read(db->ioaddr, db->phy_addr, 0, db->chip_id) & 0x8000)
526 udelay(100);
517 527
518 /* Process Phyxcer Media Mode */ 528 /* Process Phyxcer Media Mode */
519 uli526x_set_phyxcer(db); 529 uli526x_set_phyxcer(db);
diff --git a/drivers/net/via-rhine.c b/drivers/net/via-rhine.c
index 7c851b1e6daa..8c9d6ae2bb31 100644
--- a/drivers/net/via-rhine.c
+++ b/drivers/net/via-rhine.c
@@ -1893,7 +1893,7 @@ static void rhine_shutdown (struct pci_dev *pdev)
1893 1893
1894 /* Make sure we use pattern 0, 1 and not 4, 5 */ 1894 /* Make sure we use pattern 0, 1 and not 4, 5 */
1895 if (rp->quirks & rq6patterns) 1895 if (rp->quirks & rq6patterns)
1896 iowrite8(0x04, ioaddr + 0xA7); 1896 iowrite8(0x04, ioaddr + WOLcgClr);
1897 1897
1898 if (rp->wolopts & WAKE_MAGIC) { 1898 if (rp->wolopts & WAKE_MAGIC) {
1899 iowrite8(WOLmagic, ioaddr + WOLcrSet); 1899 iowrite8(WOLmagic, ioaddr + WOLcrSet);
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index fdc23678117b..19fd4cb0ddf8 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -361,6 +361,7 @@ static int virtnet_probe(struct virtio_device *vdev)
361 netif_napi_add(dev, &vi->napi, virtnet_poll, napi_weight); 361 netif_napi_add(dev, &vi->napi, virtnet_poll, napi_weight);
362 vi->dev = dev; 362 vi->dev = dev;
363 vi->vdev = vdev; 363 vi->vdev = vdev;
364 vdev->priv = vi;
364 365
365 /* We expect two virtqueues, receive then send. */ 366 /* We expect two virtqueues, receive then send. */
366 vi->rvq = vdev->config->find_vq(vdev, 0, skb_recv_done); 367 vi->rvq = vdev->config->find_vq(vdev, 0, skb_recv_done);
@@ -395,7 +396,6 @@ static int virtnet_probe(struct virtio_device *vdev)
395 } 396 }
396 397
397 pr_debug("virtnet: registered device %s\n", dev->name); 398 pr_debug("virtnet: registered device %s\n", dev->name);
398 vdev->priv = vi;
399 return 0; 399 return 0;
400 400
401unregister: 401unregister:
diff --git a/drivers/s390/net/claw.c b/drivers/s390/net/claw.c
index c3076217871e..d8a5c229c5a7 100644
--- a/drivers/s390/net/claw.c
+++ b/drivers/s390/net/claw.c
@@ -1851,8 +1851,7 @@ claw_hw_tx(struct sk_buff *skb, struct net_device *dev, long linkid)
1851 } 1851 }
1852 } 1852 }
1853 /* See how many write buffers are required to hold this data */ 1853 /* See how many write buffers are required to hold this data */
1854 numBuffers= ( skb->len + privptr->p_env->write_size - 1) / 1854 numBuffers = DIV_ROUND_UP(skb->len, privptr->p_env->write_size);
1855 ( privptr->p_env->write_size);
1856 1855
1857 /* If that number of buffers isn't available, give up for now */ 1856 /* If that number of buffers isn't available, give up for now */
1858 if (privptr->write_free_count < numBuffers || 1857 if (privptr->write_free_count < numBuffers ||
@@ -2114,8 +2113,7 @@ init_ccw_bk(struct net_device *dev)
2114 */ 2113 */
2115 ccw_blocks_perpage= PAGE_SIZE / CCWBK_SIZE; 2114 ccw_blocks_perpage= PAGE_SIZE / CCWBK_SIZE;
2116 ccw_pages_required= 2115 ccw_pages_required=
2117 (ccw_blocks_required+ccw_blocks_perpage -1) / 2116 DIV_ROUND_UP(ccw_blocks_required, ccw_blocks_perpage);
2118 ccw_blocks_perpage;
2119 2117
2120#ifdef DEBUGMSG 2118#ifdef DEBUGMSG
2121 printk(KERN_INFO "%s: %s() > ccw_blocks_perpage=%d\n", 2119 printk(KERN_INFO "%s: %s() > ccw_blocks_perpage=%d\n",
@@ -2131,30 +2129,29 @@ init_ccw_bk(struct net_device *dev)
2131 * provide good performance. With packing buffers support 32k 2129 * provide good performance. With packing buffers support 32k
2132 * buffers are used. 2130 * buffers are used.
2133 */ 2131 */
2134 if (privptr->p_env->read_size < PAGE_SIZE) { 2132 if (privptr->p_env->read_size < PAGE_SIZE) {
2135 claw_reads_perpage= PAGE_SIZE / privptr->p_env->read_size; 2133 claw_reads_perpage = PAGE_SIZE / privptr->p_env->read_size;
2136 claw_read_pages= (privptr->p_env->read_buffers + 2134 claw_read_pages = DIV_ROUND_UP(privptr->p_env->read_buffers,
2137 claw_reads_perpage -1) / claw_reads_perpage; 2135 claw_reads_perpage);
2138 } 2136 }
2139 else { /* > or equal */ 2137 else { /* > or equal */
2140 privptr->p_buff_pages_perread= 2138 privptr->p_buff_pages_perread =
2141 (privptr->p_env->read_size + PAGE_SIZE - 1) / PAGE_SIZE; 2139 DIV_ROUND_UP(privptr->p_env->read_size, PAGE_SIZE);
2142 claw_read_pages= 2140 claw_read_pages = privptr->p_env->read_buffers *
2143 privptr->p_env->read_buffers * privptr->p_buff_pages_perread; 2141 privptr->p_buff_pages_perread;
2144 } 2142 }
2145 if (privptr->p_env->write_size < PAGE_SIZE) { 2143 if (privptr->p_env->write_size < PAGE_SIZE) {
2146 claw_writes_perpage= 2144 claw_writes_perpage =
2147 PAGE_SIZE / privptr->p_env->write_size; 2145 PAGE_SIZE / privptr->p_env->write_size;
2148 claw_write_pages= 2146 claw_write_pages = DIV_ROUND_UP(privptr->p_env->write_buffers,
2149 (privptr->p_env->write_buffers + claw_writes_perpage -1) / 2147 claw_writes_perpage);
2150 claw_writes_perpage;
2151 2148
2152 } 2149 }
2153 else { /* > or equal */ 2150 else { /* > or equal */
2154 privptr->p_buff_pages_perwrite= 2151 privptr->p_buff_pages_perwrite =
2155 (privptr->p_env->read_size + PAGE_SIZE - 1) / PAGE_SIZE; 2152 DIV_ROUND_UP(privptr->p_env->read_size, PAGE_SIZE);
2156 claw_write_pages= 2153 claw_write_pages = privptr->p_env->write_buffers *
2157 privptr->p_env->write_buffers * privptr->p_buff_pages_perwrite; 2154 privptr->p_buff_pages_perwrite;
2158 } 2155 }
2159#ifdef DEBUGMSG 2156#ifdef DEBUGMSG
2160 if (privptr->p_env->read_size < PAGE_SIZE) { 2157 if (privptr->p_env->read_size < PAGE_SIZE) {