aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@pobox.com>2005-10-04 05:30:02 -0400
committerJeff Garzik <jgarzik@pobox.com>2005-10-04 05:30:02 -0400
commitd9e34325fd62310b7b49243d02b774f3ef2452db (patch)
treed356eab72377f2576ad356de66daec23f28529a5 /drivers/net
parent500f83abdc83d6bd472f3d103a9a9cd85df29a29 (diff)
parent832f8f0378ff1566f2a222352c7ad5df3f8d0d9d (diff)
Merge branch 'upstream-fixes'
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/Kconfig8
-rw-r--r--drivers/net/bonding/bond_main.c280
-rw-r--r--drivers/net/bonding/bonding.h4
-rw-r--r--drivers/net/ibm_emac/ibm_emac_core.c31
-rw-r--r--drivers/net/ns83820.c2
-rw-r--r--drivers/net/starfire.c46
-rw-r--r--drivers/net/sungem.h3
-rw-r--r--drivers/net/tulip/21142.c2
8 files changed, 134 insertions, 242 deletions
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 018b11a7a4ce..0a30368d2efc 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -1655,7 +1655,7 @@ config LAN_SAA9730
1655 1655
1656config NET_POCKET 1656config NET_POCKET
1657 bool "Pocket and portable adapters" 1657 bool "Pocket and portable adapters"
1658 depends on NET_ETHERNET && ISA 1658 depends on NET_ETHERNET && PARPORT
1659 ---help--- 1659 ---help---
1660 Cute little network (Ethernet) devices which attach to the parallel 1660 Cute little network (Ethernet) devices which attach to the parallel
1661 port ("pocket adapters"), commonly used with laptops. If you have 1661 port ("pocket adapters"), commonly used with laptops. If you have
@@ -1679,7 +1679,7 @@ config NET_POCKET
1679 1679
1680config ATP 1680config ATP
1681 tristate "AT-LAN-TEC/RealTek pocket adapter support" 1681 tristate "AT-LAN-TEC/RealTek pocket adapter support"
1682 depends on NET_POCKET && ISA && X86 1682 depends on NET_POCKET && PARPORT && X86
1683 select CRC32 1683 select CRC32
1684 ---help--- 1684 ---help---
1685 This is a network (Ethernet) device which attaches to your parallel 1685 This is a network (Ethernet) device which attaches to your parallel
@@ -1694,7 +1694,7 @@ config ATP
1694 1694
1695config DE600 1695config DE600
1696 tristate "D-Link DE600 pocket adapter support" 1696 tristate "D-Link DE600 pocket adapter support"
1697 depends on NET_POCKET && ISA 1697 depends on NET_POCKET && PARPORT
1698 ---help--- 1698 ---help---
1699 This is a network (Ethernet) device which attaches to your parallel 1699 This is a network (Ethernet) device which attaches to your parallel
1700 port. Read <file:Documentation/networking/DLINK.txt> as well as the 1700 port. Read <file:Documentation/networking/DLINK.txt> as well as the
@@ -1709,7 +1709,7 @@ config DE600
1709 1709
1710config DE620 1710config DE620
1711 tristate "D-Link DE620 pocket adapter support" 1711 tristate "D-Link DE620 pocket adapter support"
1712 depends on NET_POCKET && ISA 1712 depends on NET_POCKET && PARPORT
1713 ---help--- 1713 ---help---
1714 This is a network (Ethernet) device which attaches to your parallel 1714 This is a network (Ethernet) device which attaches to your parallel
1715 port. Read <file:Documentation/networking/DLINK.txt> as well as the 1715 port. Read <file:Documentation/networking/DLINK.txt> as well as the
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index bf81cd45e4d4..fd62e43a3510 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -487,6 +487,8 @@
487 * * Added xmit_hash_policy_layer34() 487 * * Added xmit_hash_policy_layer34()
488 * - Modified by Jay Vosburgh <fubar@us.ibm.com> to also support mode 4. 488 * - Modified by Jay Vosburgh <fubar@us.ibm.com> to also support mode 4.
489 * Set version to 2.6.3. 489 * Set version to 2.6.3.
490 * 2005/09/26 - Jay Vosburgh <fubar@us.ibm.com>
491 * - Removed backwards compatibility for old ifenslaves. Version 2.6.4.
490 */ 492 */
491 493
492//#define BONDING_DEBUG 1 494//#define BONDING_DEBUG 1
@@ -595,14 +597,7 @@ static int arp_ip_count = 0;
595static int bond_mode = BOND_MODE_ROUNDROBIN; 597static int bond_mode = BOND_MODE_ROUNDROBIN;
596static int xmit_hashtype= BOND_XMIT_POLICY_LAYER2; 598static int xmit_hashtype= BOND_XMIT_POLICY_LAYER2;
597static int lacp_fast = 0; 599static int lacp_fast = 0;
598static int app_abi_ver = 0; 600
599static int orig_app_abi_ver = -1; /* This is used to save the first ABI version
600 * we receive from the application. Once set,
601 * it won't be changed, and the module will
602 * refuse to enslave/release interfaces if the
603 * command comes from an application using
604 * another ABI version.
605 */
606struct bond_parm_tbl { 601struct bond_parm_tbl {
607 char *modename; 602 char *modename;
608 int mode; 603 int mode;
@@ -1702,51 +1697,29 @@ static int bond_enslave(struct net_device *bond_dev, struct net_device *slave_de
1702 } 1697 }
1703 } 1698 }
1704 1699
1705 if (app_abi_ver >= 1) { 1700 /*
1706 /* The application is using an ABI, which requires the 1701 * Old ifenslave binaries are no longer supported. These can
1707 * slave interface to be closed. 1702 * be identified with moderate accurary by the state of the slave:
1708 */ 1703 * the current ifenslave will set the interface down prior to
1709 if ((slave_dev->flags & IFF_UP)) { 1704 * enslaving it; the old ifenslave will not.
1710 printk(KERN_ERR DRV_NAME 1705 */
1711 ": Error: %s is up\n", 1706 if ((slave_dev->flags & IFF_UP)) {
1712 slave_dev->name); 1707 printk(KERN_ERR DRV_NAME ": %s is up. "
1713 res = -EPERM; 1708 "This may be due to an out of date ifenslave.\n",
1714 goto err_undo_flags; 1709 slave_dev->name);
1715 } 1710 res = -EPERM;
1716 1711 goto err_undo_flags;
1717 if (slave_dev->set_mac_address == NULL) { 1712 }
1718 printk(KERN_ERR DRV_NAME
1719 ": Error: The slave device you specified does "
1720 "not support setting the MAC address.\n");
1721 printk(KERN_ERR
1722 "Your kernel likely does not support slave "
1723 "devices.\n");
1724 1713
1725 res = -EOPNOTSUPP; 1714 if (slave_dev->set_mac_address == NULL) {
1726 goto err_undo_flags; 1715 printk(KERN_ERR DRV_NAME
1727 } 1716 ": Error: The slave device you specified does "
1728 } else { 1717 "not support setting the MAC address.\n");
1729 /* The application is not using an ABI, which requires the 1718 printk(KERN_ERR
1730 * slave interface to be open. 1719 "Your kernel likely does not support slave devices.\n");
1731 */
1732 if (!(slave_dev->flags & IFF_UP)) {
1733 printk(KERN_ERR DRV_NAME
1734 ": Error: %s is not running\n",
1735 slave_dev->name);
1736 res = -EINVAL;
1737 goto err_undo_flags;
1738 }
1739 1720
1740 if ((bond->params.mode == BOND_MODE_8023AD) || 1721 res = -EOPNOTSUPP;
1741 (bond->params.mode == BOND_MODE_TLB) || 1722 goto err_undo_flags;
1742 (bond->params.mode == BOND_MODE_ALB)) {
1743 printk(KERN_ERR DRV_NAME
1744 ": Error: to use %s mode, you must upgrade "
1745 "ifenslave.\n",
1746 bond_mode_name(bond->params.mode));
1747 res = -EOPNOTSUPP;
1748 goto err_undo_flags;
1749 }
1750 } 1723 }
1751 1724
1752 new_slave = kmalloc(sizeof(struct slave), GFP_KERNEL); 1725 new_slave = kmalloc(sizeof(struct slave), GFP_KERNEL);
@@ -1762,41 +1735,36 @@ static int bond_enslave(struct net_device *bond_dev, struct net_device *slave_de
1762 */ 1735 */
1763 new_slave->original_flags = slave_dev->flags; 1736 new_slave->original_flags = slave_dev->flags;
1764 1737
1765 if (app_abi_ver >= 1) { 1738 /*
1766 /* save slave's original ("permanent") mac address for 1739 * Save slave's original ("permanent") mac address for modes
1767 * modes that needs it, and for restoring it upon release, 1740 * that need it, and for restoring it upon release, and then
1768 * and then set it to the master's address 1741 * set it to the master's address
1769 */ 1742 */
1770 memcpy(new_slave->perm_hwaddr, slave_dev->dev_addr, ETH_ALEN); 1743 memcpy(new_slave->perm_hwaddr, slave_dev->dev_addr, ETH_ALEN);
1771 1744
1772 /* set slave to master's mac address 1745 /*
1773 * The application already set the master's 1746 * Set slave to master's mac address. The application already
1774 * mac address to that of the first slave 1747 * set the master's mac address to that of the first slave
1775 */ 1748 */
1776 memcpy(addr.sa_data, bond_dev->dev_addr, bond_dev->addr_len); 1749 memcpy(addr.sa_data, bond_dev->dev_addr, bond_dev->addr_len);
1777 addr.sa_family = slave_dev->type; 1750 addr.sa_family = slave_dev->type;
1778 res = dev_set_mac_address(slave_dev, &addr); 1751 res = dev_set_mac_address(slave_dev, &addr);
1779 if (res) { 1752 if (res) {
1780 dprintk("Error %d calling set_mac_address\n", res); 1753 dprintk("Error %d calling set_mac_address\n", res);
1781 goto err_free; 1754 goto err_free;
1782 } 1755 }
1783 1756
1784 /* open the slave since the application closed it */ 1757 /* open the slave since the application closed it */
1785 res = dev_open(slave_dev); 1758 res = dev_open(slave_dev);
1786 if (res) { 1759 if (res) {
1787 dprintk("Openning slave %s failed\n", slave_dev->name); 1760 dprintk("Openning slave %s failed\n", slave_dev->name);
1788 goto err_restore_mac; 1761 goto err_restore_mac;
1789 }
1790 } 1762 }
1791 1763
1792 res = netdev_set_master(slave_dev, bond_dev); 1764 res = netdev_set_master(slave_dev, bond_dev);
1793 if (res) { 1765 if (res) {
1794 dprintk("Error %d calling netdev_set_master\n", res); 1766 dprintk("Error %d calling netdev_set_master\n", res);
1795 if (app_abi_ver < 1) { 1767 goto err_close;
1796 goto err_free;
1797 } else {
1798 goto err_close;
1799 }
1800 } 1768 }
1801 1769
1802 new_slave->dev = slave_dev; 1770 new_slave->dev = slave_dev;
@@ -1997,39 +1965,6 @@ static int bond_enslave(struct net_device *bond_dev, struct net_device *slave_de
1997 1965
1998 write_unlock_bh(&bond->lock); 1966 write_unlock_bh(&bond->lock);
1999 1967
2000 if (app_abi_ver < 1) {
2001 /*
2002 * !!! This is to support old versions of ifenslave.
2003 * We can remove this in 2.5 because our ifenslave takes
2004 * care of this for us.
2005 * We check to see if the master has a mac address yet.
2006 * If not, we'll give it the mac address of our slave device.
2007 */
2008 int ndx = 0;
2009
2010 for (ndx = 0; ndx < bond_dev->addr_len; ndx++) {
2011 dprintk("Checking ndx=%d of bond_dev->dev_addr\n",
2012 ndx);
2013 if (bond_dev->dev_addr[ndx] != 0) {
2014 dprintk("Found non-zero byte at ndx=%d\n",
2015 ndx);
2016 break;
2017 }
2018 }
2019
2020 if (ndx == bond_dev->addr_len) {
2021 /*
2022 * We got all the way through the address and it was
2023 * all 0's.
2024 */
2025 dprintk("%s doesn't have a MAC address yet. \n",
2026 bond_dev->name);
2027 dprintk("Going to give assign it from %s.\n",
2028 slave_dev->name);
2029 bond_sethwaddr(bond_dev, slave_dev);
2030 }
2031 }
2032
2033 printk(KERN_INFO DRV_NAME 1968 printk(KERN_INFO DRV_NAME
2034 ": %s: enslaving %s as a%s interface with a%s link.\n", 1969 ": %s: enslaving %s as a%s interface with a%s link.\n",
2035 bond_dev->name, slave_dev->name, 1970 bond_dev->name, slave_dev->name,
@@ -2227,12 +2162,10 @@ static int bond_release(struct net_device *bond_dev, struct net_device *slave_de
2227 /* close slave before restoring its mac address */ 2162 /* close slave before restoring its mac address */
2228 dev_close(slave_dev); 2163 dev_close(slave_dev);
2229 2164
2230 if (app_abi_ver >= 1) { 2165 /* restore original ("permanent") mac address */
2231 /* restore original ("permanent") mac address */ 2166 memcpy(addr.sa_data, slave->perm_hwaddr, ETH_ALEN);
2232 memcpy(addr.sa_data, slave->perm_hwaddr, ETH_ALEN); 2167 addr.sa_family = slave_dev->type;
2233 addr.sa_family = slave_dev->type; 2168 dev_set_mac_address(slave_dev, &addr);
2234 dev_set_mac_address(slave_dev, &addr);
2235 }
2236 2169
2237 /* restore the original state of the 2170 /* restore the original state of the
2238 * IFF_NOARP flag that might have been 2171 * IFF_NOARP flag that might have been
@@ -2320,12 +2253,10 @@ static int bond_release_all(struct net_device *bond_dev)
2320 /* close slave before restoring its mac address */ 2253 /* close slave before restoring its mac address */
2321 dev_close(slave_dev); 2254 dev_close(slave_dev);
2322 2255
2323 if (app_abi_ver >= 1) { 2256 /* restore original ("permanent") mac address*/
2324 /* restore original ("permanent") mac address*/ 2257 memcpy(addr.sa_data, slave->perm_hwaddr, ETH_ALEN);
2325 memcpy(addr.sa_data, slave->perm_hwaddr, ETH_ALEN); 2258 addr.sa_family = slave_dev->type;
2326 addr.sa_family = slave_dev->type; 2259 dev_set_mac_address(slave_dev, &addr);
2327 dev_set_mac_address(slave_dev, &addr);
2328 }
2329 2260
2330 /* restore the original state of the IFF_NOARP flag that might have 2261 /* restore the original state of the IFF_NOARP flag that might have
2331 * been set by bond_set_slave_inactive_flags() 2262 * been set by bond_set_slave_inactive_flags()
@@ -2423,57 +2354,6 @@ static int bond_ioctl_change_active(struct net_device *bond_dev, struct net_devi
2423 return res; 2354 return res;
2424} 2355}
2425 2356
2426static int bond_ethtool_ioctl(struct net_device *bond_dev, struct ifreq *ifr)
2427{
2428 struct ethtool_drvinfo info;
2429 void __user *addr = ifr->ifr_data;
2430 uint32_t cmd;
2431
2432 if (get_user(cmd, (uint32_t __user *)addr)) {
2433 return -EFAULT;
2434 }
2435
2436 switch (cmd) {
2437 case ETHTOOL_GDRVINFO:
2438 if (copy_from_user(&info, addr, sizeof(info))) {
2439 return -EFAULT;
2440 }
2441
2442 if (strcmp(info.driver, "ifenslave") == 0) {
2443 int new_abi_ver;
2444 char *endptr;
2445
2446 new_abi_ver = simple_strtoul(info.fw_version,
2447 &endptr, 0);
2448 if (*endptr) {
2449 printk(KERN_ERR DRV_NAME
2450 ": Error: got invalid ABI "
2451 "version from application\n");
2452
2453 return -EINVAL;
2454 }
2455
2456 if (orig_app_abi_ver == -1) {
2457 orig_app_abi_ver = new_abi_ver;
2458 }
2459
2460 app_abi_ver = new_abi_ver;
2461 }
2462
2463 strncpy(info.driver, DRV_NAME, 32);
2464 strncpy(info.version, DRV_VERSION, 32);
2465 snprintf(info.fw_version, 32, "%d", BOND_ABI_VERSION);
2466
2467 if (copy_to_user(addr, &info, sizeof(info))) {
2468 return -EFAULT;
2469 }
2470
2471 return 0;
2472 default:
2473 return -EOPNOTSUPP;
2474 }
2475}
2476
2477static int bond_info_query(struct net_device *bond_dev, struct ifbond *info) 2357static int bond_info_query(struct net_device *bond_dev, struct ifbond *info)
2478{ 2358{
2479 struct bonding *bond = bond_dev->priv; 2359 struct bonding *bond = bond_dev->priv;
@@ -3442,16 +3322,11 @@ static void bond_info_show_slave(struct seq_file *seq, const struct slave *slave
3442 seq_printf(seq, "Link Failure Count: %d\n", 3322 seq_printf(seq, "Link Failure Count: %d\n",
3443 slave->link_failure_count); 3323 slave->link_failure_count);
3444 3324
3445 if (app_abi_ver >= 1) { 3325 seq_printf(seq,
3446 seq_printf(seq, 3326 "Permanent HW addr: %02x:%02x:%02x:%02x:%02x:%02x\n",
3447 "Permanent HW addr: %02x:%02x:%02x:%02x:%02x:%02x\n", 3327 slave->perm_hwaddr[0], slave->perm_hwaddr[1],
3448 slave->perm_hwaddr[0], 3328 slave->perm_hwaddr[2], slave->perm_hwaddr[3],
3449 slave->perm_hwaddr[1], 3329 slave->perm_hwaddr[4], slave->perm_hwaddr[5]);
3450 slave->perm_hwaddr[2],
3451 slave->perm_hwaddr[3],
3452 slave->perm_hwaddr[4],
3453 slave->perm_hwaddr[5]);
3454 }
3455 3330
3456 if (bond->params.mode == BOND_MODE_8023AD) { 3331 if (bond->params.mode == BOND_MODE_8023AD) {
3457 const struct aggregator *agg 3332 const struct aggregator *agg
@@ -4010,15 +3885,12 @@ static int bond_do_ioctl(struct net_device *bond_dev, struct ifreq *ifr, int cmd
4010 struct ifslave k_sinfo; 3885 struct ifslave k_sinfo;
4011 struct ifslave __user *u_sinfo = NULL; 3886 struct ifslave __user *u_sinfo = NULL;
4012 struct mii_ioctl_data *mii = NULL; 3887 struct mii_ioctl_data *mii = NULL;
4013 int prev_abi_ver = orig_app_abi_ver;
4014 int res = 0; 3888 int res = 0;
4015 3889
4016 dprintk("bond_ioctl: master=%s, cmd=%d\n", 3890 dprintk("bond_ioctl: master=%s, cmd=%d\n",
4017 bond_dev->name, cmd); 3891 bond_dev->name, cmd);
4018 3892
4019 switch (cmd) { 3893 switch (cmd) {
4020 case SIOCETHTOOL:
4021 return bond_ethtool_ioctl(bond_dev, ifr);
4022 case SIOCGMIIPHY: 3894 case SIOCGMIIPHY:
4023 mii = if_mii(ifr); 3895 mii = if_mii(ifr);
4024 if (!mii) { 3896 if (!mii) {
@@ -4090,21 +3962,6 @@ static int bond_do_ioctl(struct net_device *bond_dev, struct ifreq *ifr, int cmd
4090 return -EPERM; 3962 return -EPERM;
4091 } 3963 }
4092 3964
4093 if (orig_app_abi_ver == -1) {
4094 /* no orig_app_abi_ver was provided yet, so we'll use the
4095 * current one from now on, even if it's 0
4096 */
4097 orig_app_abi_ver = app_abi_ver;
4098
4099 } else if (orig_app_abi_ver != app_abi_ver) {
4100 printk(KERN_ERR DRV_NAME
4101 ": Error: already using ifenslave ABI version %d; to "
4102 "upgrade ifenslave to version %d, you must first "
4103 "reload bonding.\n",
4104 orig_app_abi_ver, app_abi_ver);
4105 return -EINVAL;
4106 }
4107
4108 slave_dev = dev_get_by_name(ifr->ifr_slave); 3965 slave_dev = dev_get_by_name(ifr->ifr_slave);
4109 3966
4110 dprintk("slave_dev=%p: \n", slave_dev); 3967 dprintk("slave_dev=%p: \n", slave_dev);
@@ -4137,14 +3994,6 @@ static int bond_do_ioctl(struct net_device *bond_dev, struct ifreq *ifr, int cmd
4137 dev_put(slave_dev); 3994 dev_put(slave_dev);
4138 } 3995 }
4139 3996
4140 if (res < 0) {
4141 /* The ioctl failed, so there's no point in changing the
4142 * orig_app_abi_ver. We'll restore it's value just in case
4143 * we've changed it earlier in this function.
4144 */
4145 orig_app_abi_ver = prev_abi_ver;
4146 }
4147
4148 return res; 3997 return res;
4149} 3998}
4150 3999
@@ -4578,9 +4427,18 @@ static inline void bond_set_mode_ops(struct bonding *bond, int mode)
4578 } 4427 }
4579} 4428}
4580 4429
4430static void bond_ethtool_get_drvinfo(struct net_device *bond_dev,
4431 struct ethtool_drvinfo *drvinfo)
4432{
4433 strncpy(drvinfo->driver, DRV_NAME, 32);
4434 strncpy(drvinfo->version, DRV_VERSION, 32);
4435 snprintf(drvinfo->fw_version, 32, "%d", BOND_ABI_VERSION);
4436}
4437
4581static struct ethtool_ops bond_ethtool_ops = { 4438static struct ethtool_ops bond_ethtool_ops = {
4582 .get_tx_csum = ethtool_op_get_tx_csum, 4439 .get_tx_csum = ethtool_op_get_tx_csum,
4583 .get_sg = ethtool_op_get_sg, 4440 .get_sg = ethtool_op_get_sg,
4441 .get_drvinfo = bond_ethtool_get_drvinfo,
4584}; 4442};
4585 4443
4586/* 4444/*
diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h
index 388196980862..bbf9da8af624 100644
--- a/drivers/net/bonding/bonding.h
+++ b/drivers/net/bonding/bonding.h
@@ -40,8 +40,8 @@
40#include "bond_3ad.h" 40#include "bond_3ad.h"
41#include "bond_alb.h" 41#include "bond_alb.h"
42 42
43#define DRV_VERSION "2.6.3" 43#define DRV_VERSION "2.6.4"
44#define DRV_RELDATE "June 8, 2005" 44#define DRV_RELDATE "September 26, 2005"
45#define DRV_NAME "bonding" 45#define DRV_NAME "bonding"
46#define DRV_DESCRIPTION "Ethernet Channel Bonding Driver" 46#define DRV_DESCRIPTION "Ethernet Channel Bonding Driver"
47 47
diff --git a/drivers/net/ibm_emac/ibm_emac_core.c b/drivers/net/ibm_emac/ibm_emac_core.c
index 0de3bb906174..14e9b6315f20 100644
--- a/drivers/net/ibm_emac/ibm_emac_core.c
+++ b/drivers/net/ibm_emac/ibm_emac_core.c
@@ -1875,6 +1875,9 @@ static int emac_init_device(struct ocp_device *ocpdev, struct ibm_ocp_mal *mal)
1875 rc = -ENODEV; 1875 rc = -ENODEV;
1876 goto bail; 1876 goto bail;
1877 } 1877 }
1878
1879 /* Disable any PHY features not supported by the platform */
1880 ep->phy_mii.def->features &= ~emacdata->phy_feat_exc;
1878 1881
1879 /* Setup initial PHY config & startup aneg */ 1882 /* Setup initial PHY config & startup aneg */
1880 if (ep->phy_mii.def->ops->init) 1883 if (ep->phy_mii.def->ops->init)
@@ -1882,6 +1885,34 @@ static int emac_init_device(struct ocp_device *ocpdev, struct ibm_ocp_mal *mal)
1882 netif_carrier_off(ndev); 1885 netif_carrier_off(ndev);
1883 if (ep->phy_mii.def->features & SUPPORTED_Autoneg) 1886 if (ep->phy_mii.def->features & SUPPORTED_Autoneg)
1884 ep->want_autoneg = 1; 1887 ep->want_autoneg = 1;
1888 else {
1889 ep->want_autoneg = 0;
1890
1891 /* Select highest supported speed/duplex */
1892 if (ep->phy_mii.def->features & SUPPORTED_1000baseT_Full) {
1893 ep->phy_mii.speed = SPEED_1000;
1894 ep->phy_mii.duplex = DUPLEX_FULL;
1895 } else if (ep->phy_mii.def->features &
1896 SUPPORTED_1000baseT_Half) {
1897 ep->phy_mii.speed = SPEED_1000;
1898 ep->phy_mii.duplex = DUPLEX_HALF;
1899 } else if (ep->phy_mii.def->features &
1900 SUPPORTED_100baseT_Full) {
1901 ep->phy_mii.speed = SPEED_100;
1902 ep->phy_mii.duplex = DUPLEX_FULL;
1903 } else if (ep->phy_mii.def->features &
1904 SUPPORTED_100baseT_Half) {
1905 ep->phy_mii.speed = SPEED_100;
1906 ep->phy_mii.duplex = DUPLEX_HALF;
1907 } else if (ep->phy_mii.def->features &
1908 SUPPORTED_10baseT_Full) {
1909 ep->phy_mii.speed = SPEED_10;
1910 ep->phy_mii.duplex = DUPLEX_FULL;
1911 } else {
1912 ep->phy_mii.speed = SPEED_10;
1913 ep->phy_mii.duplex = DUPLEX_HALF;
1914 }
1915 }
1885 emac_start_link(ep, NULL); 1916 emac_start_link(ep, NULL);
1886 1917
1887 /* read the MAC Address */ 1918 /* read the MAC Address */
diff --git a/drivers/net/ns83820.c b/drivers/net/ns83820.c
index bc354a80c099..a3ea69bca474 100644
--- a/drivers/net/ns83820.c
+++ b/drivers/net/ns83820.c
@@ -584,7 +584,7 @@ static inline int ns83820_add_rx_skb(struct ns83820 *dev, struct sk_buff *skb)
584 return 0; 584 return 0;
585} 585}
586 586
587static inline int rx_refill(struct net_device *ndev, unsigned int gfp) 587static inline int rx_refill(struct net_device *ndev, unsigned int __nocast gfp)
588{ 588{
589 struct ns83820 *dev = PRIV(ndev); 589 struct ns83820 *dev = PRIV(ndev);
590 unsigned i; 590 unsigned i;
diff --git a/drivers/net/starfire.c b/drivers/net/starfire.c
index 88b89dc95c77..efdb179ecc8c 100644
--- a/drivers/net/starfire.c
+++ b/drivers/net/starfire.c
@@ -133,14 +133,18 @@
133 - finally added firmware (GPL'ed by Adaptec) 133 - finally added firmware (GPL'ed by Adaptec)
134 - removed compatibility code for 2.2.x 134 - removed compatibility code for 2.2.x
135 135
136 LK1.4.2.1 (Ion Badulescu)
137 - fixed 32/64 bit issues on i386 + CONFIG_HIGHMEM
138 - added 32-bit padding to outgoing skb's, removed previous workaround
139
136TODO: - fix forced speed/duplexing code (broken a long time ago, when 140TODO: - fix forced speed/duplexing code (broken a long time ago, when
137 somebody converted the driver to use the generic MII code) 141 somebody converted the driver to use the generic MII code)
138 - fix VLAN support 142 - fix VLAN support
139*/ 143*/
140 144
141#define DRV_NAME "starfire" 145#define DRV_NAME "starfire"
142#define DRV_VERSION "1.03+LK1.4.2" 146#define DRV_VERSION "1.03+LK1.4.2.1"
143#define DRV_RELDATE "January 19, 2005" 147#define DRV_RELDATE "October 3, 2005"
144 148
145#include <linux/config.h> 149#include <linux/config.h>
146#include <linux/version.h> 150#include <linux/version.h>
@@ -165,6 +169,14 @@ TODO: - fix forced speed/duplexing code (broken a long time ago, when
165 * of length 1. If and when this is fixed, the #define below can be removed. 169 * of length 1. If and when this is fixed, the #define below can be removed.
166 */ 170 */
167#define HAS_BROKEN_FIRMWARE 171#define HAS_BROKEN_FIRMWARE
172
173/*
174 * If using the broken firmware, data must be padded to the next 32-bit boundary.
175 */
176#ifdef HAS_BROKEN_FIRMWARE
177#define PADDING_MASK 3
178#endif
179
168/* 180/*
169 * Define this if using the driver with the zero-copy patch 181 * Define this if using the driver with the zero-copy patch
170 */ 182 */
@@ -257,9 +269,10 @@ static int full_duplex[MAX_UNITS] = {0, };
257 * This SUCKS. 269 * This SUCKS.
258 * We need a much better method to determine if dma_addr_t is 64-bit. 270 * We need a much better method to determine if dma_addr_t is 64-bit.
259 */ 271 */
260#if (defined(__i386__) && defined(CONFIG_HIGHMEM) && (LINUX_VERSION_CODE > 0x20500 || defined(CONFIG_HIGHMEM64G))) || defined(__x86_64__) || defined (__ia64__) || defined(__mips64__) || (defined(__mips__) && defined(CONFIG_HIGHMEM) && defined(CONFIG_64BIT_PHYS_ADDR)) 272#if (defined(__i386__) && defined(CONFIG_HIGHMEM64G)) || defined(__x86_64__) || defined (__ia64__) || defined(__mips64__) || (defined(__mips__) && defined(CONFIG_HIGHMEM) && defined(CONFIG_64BIT_PHYS_ADDR))
261/* 64-bit dma_addr_t */ 273/* 64-bit dma_addr_t */
262#define ADDR_64BITS /* This chip uses 64 bit addresses. */ 274#define ADDR_64BITS /* This chip uses 64 bit addresses. */
275#define netdrv_addr_t u64
263#define cpu_to_dma(x) cpu_to_le64(x) 276#define cpu_to_dma(x) cpu_to_le64(x)
264#define dma_to_cpu(x) le64_to_cpu(x) 277#define dma_to_cpu(x) le64_to_cpu(x)
265#define RX_DESC_Q_ADDR_SIZE RxDescQAddr64bit 278#define RX_DESC_Q_ADDR_SIZE RxDescQAddr64bit
@@ -268,6 +281,7 @@ static int full_duplex[MAX_UNITS] = {0, };
268#define TX_COMPL_Q_ADDR_SIZE TxComplQAddr64bit 281#define TX_COMPL_Q_ADDR_SIZE TxComplQAddr64bit
269#define RX_DESC_ADDR_SIZE RxDescAddr64bit 282#define RX_DESC_ADDR_SIZE RxDescAddr64bit
270#else /* 32-bit dma_addr_t */ 283#else /* 32-bit dma_addr_t */
284#define netdrv_addr_t u32
271#define cpu_to_dma(x) cpu_to_le32(x) 285#define cpu_to_dma(x) cpu_to_le32(x)
272#define dma_to_cpu(x) le32_to_cpu(x) 286#define dma_to_cpu(x) le32_to_cpu(x)
273#define RX_DESC_Q_ADDR_SIZE RxDescQAddr32bit 287#define RX_DESC_Q_ADDR_SIZE RxDescQAddr32bit
@@ -1333,21 +1347,10 @@ static int start_tx(struct sk_buff *skb, struct net_device *dev)
1333 } 1347 }
1334 1348
1335#if defined(ZEROCOPY) && defined(HAS_BROKEN_FIRMWARE) 1349#if defined(ZEROCOPY) && defined(HAS_BROKEN_FIRMWARE)
1336 { 1350 if (skb->ip_summed == CHECKSUM_HW) {
1337 int has_bad_length = 0; 1351 skb = skb_padto(skb, (skb->len + PADDING_MASK) & ~PADDING_MASK);
1338 1352 if (skb == NULL)
1339 if (skb_first_frag_len(skb) == 1) 1353 return NETDEV_TX_OK;
1340 has_bad_length = 1;
1341 else {
1342 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++)
1343 if (skb_shinfo(skb)->frags[i].size == 1) {
1344 has_bad_length = 1;
1345 break;
1346 }
1347 }
1348
1349 if (has_bad_length)
1350 skb_checksum_help(skb, 0);
1351 } 1354 }
1352#endif /* ZEROCOPY && HAS_BROKEN_FIRMWARE */ 1355#endif /* ZEROCOPY && HAS_BROKEN_FIRMWARE */
1353 1356
@@ -2127,13 +2130,12 @@ static int __init starfire_init (void)
2127#endif 2130#endif
2128#endif 2131#endif
2129 2132
2130#ifndef ADDR_64BITS
2131 /* we can do this test only at run-time... sigh */ 2133 /* we can do this test only at run-time... sigh */
2132 if (sizeof(dma_addr_t) == sizeof(u64)) { 2134 if (sizeof(dma_addr_t) != sizeof(netdrv_addr_t)) {
2133 printk("This driver has not been ported to this 64-bit architecture yet\n"); 2135 printk("This driver has dma_addr_t issues, please send email to maintainer\n");
2134 return -ENODEV; 2136 return -ENODEV;
2135 } 2137 }
2136#endif /* not ADDR_64BITS */ 2138
2137 return pci_module_init (&starfire_driver); 2139 return pci_module_init (&starfire_driver);
2138} 2140}
2139 2141
diff --git a/drivers/net/sungem.h b/drivers/net/sungem.h
index ff8ae5f79970..16edbb1a4a7a 100644
--- a/drivers/net/sungem.h
+++ b/drivers/net/sungem.h
@@ -1035,7 +1035,8 @@ struct gem {
1035 1035
1036#define ALIGNED_RX_SKB_ADDR(addr) \ 1036#define ALIGNED_RX_SKB_ADDR(addr) \
1037 ((((unsigned long)(addr) + (64UL - 1UL)) & ~(64UL - 1UL)) - (unsigned long)(addr)) 1037 ((((unsigned long)(addr) + (64UL - 1UL)) & ~(64UL - 1UL)) - (unsigned long)(addr))
1038static __inline__ struct sk_buff *gem_alloc_skb(int size, int gfp_flags) 1038static __inline__ struct sk_buff *gem_alloc_skb(int size,
1039 unsigned int __nocast gfp_flags)
1039{ 1040{
1040 struct sk_buff *skb = alloc_skb(size + 64, gfp_flags); 1041 struct sk_buff *skb = alloc_skb(size + 64, gfp_flags);
1041 1042
diff --git a/drivers/net/tulip/21142.c b/drivers/net/tulip/21142.c
index 5db694c4eb02..683f14b01c06 100644
--- a/drivers/net/tulip/21142.c
+++ b/drivers/net/tulip/21142.c
@@ -172,7 +172,7 @@ void t21142_lnk_change(struct net_device *dev, int csr5)
172 int i; 172 int i;
173 for (i = 0; i < tp->mtable->leafcount; i++) 173 for (i = 0; i < tp->mtable->leafcount; i++)
174 if (tp->mtable->mleaf[i].media == dev->if_port) { 174 if (tp->mtable->mleaf[i].media == dev->if_port) {
175 int startup = ! ((tp->chip_id == DC21143 && tp->revision == 65)); 175 int startup = ! ((tp->chip_id == DC21143 && (tp->revision == 48 || tp->revision == 65)));
176 tp->cur_index = i; 176 tp->cur_index = i;
177 tulip_select_media(dev, startup); 177 tulip_select_media(dev, startup);
178 setup_done = 1; 178 setup_done = 1;