diff options
Diffstat (limited to 'drivers/net')
| -rw-r--r-- | drivers/net/Kconfig | 8 | ||||
| -rw-r--r-- | drivers/net/bonding/bond_main.c | 285 | ||||
| -rw-r--r-- | drivers/net/bonding/bonding.h | 4 | ||||
| -rw-r--r-- | drivers/net/ibm_emac/ibm_emac_core.c | 31 | ||||
| -rw-r--r-- | drivers/net/ns83820.c | 2 | ||||
| -rw-r--r-- | drivers/net/pcmcia/smc91c92_cs.c | 2 | ||||
| -rw-r--r-- | drivers/net/skge.c | 24 | ||||
| -rw-r--r-- | drivers/net/starfire.c | 46 | ||||
| -rw-r--r-- | drivers/net/sungem.h | 3 | ||||
| -rw-r--r-- | drivers/net/tokenring/ibmtr.c | 5 | ||||
| -rw-r--r-- | drivers/net/tulip/21142.c | 2 | ||||
| -rw-r--r-- | drivers/net/wireless/orinoco.c | 14 |
12 files changed, 163 insertions, 263 deletions
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index 2a908c4690a7..c748b0e16419 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig | |||
| @@ -1655,7 +1655,7 @@ config LAN_SAA9730 | |||
| 1655 | 1655 | ||
| 1656 | config NET_POCKET | 1656 | config 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 | ||
| 1680 | config ATP | 1680 | config 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 | ||
| 1695 | config DE600 | 1695 | config 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 | ||
| 1710 | config DE620 | 1710 | config 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..f0a5b772a386 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; | |||
| 595 | static int bond_mode = BOND_MODE_ROUNDROBIN; | 597 | static int bond_mode = BOND_MODE_ROUNDROBIN; |
| 596 | static int xmit_hashtype= BOND_XMIT_POLICY_LAYER2; | 598 | static int xmit_hashtype= BOND_XMIT_POLICY_LAYER2; |
| 597 | static int lacp_fast = 0; | 599 | static int lacp_fast = 0; |
| 598 | static int app_abi_ver = 0; | 600 | |
| 599 | static 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 | */ | ||
| 606 | struct bond_parm_tbl { | 601 | struct bond_parm_tbl { |
| 607 | char *modename; | 602 | char *modename; |
| 608 | int mode; | 603 | int mode; |
| @@ -1294,12 +1289,13 @@ static void bond_mc_list_destroy(struct bonding *bond) | |||
| 1294 | /* | 1289 | /* |
| 1295 | * Copy all the Multicast addresses from src to the bonding device dst | 1290 | * Copy all the Multicast addresses from src to the bonding device dst |
| 1296 | */ | 1291 | */ |
| 1297 | static int bond_mc_list_copy(struct dev_mc_list *mc_list, struct bonding *bond, int gpf_flag) | 1292 | static int bond_mc_list_copy(struct dev_mc_list *mc_list, struct bonding *bond, |
| 1293 | unsigned int __nocast gfp_flag) | ||
| 1298 | { | 1294 | { |
| 1299 | struct dev_mc_list *dmi, *new_dmi; | 1295 | struct dev_mc_list *dmi, *new_dmi; |
| 1300 | 1296 | ||
| 1301 | for (dmi = mc_list; dmi; dmi = dmi->next) { | 1297 | for (dmi = mc_list; dmi; dmi = dmi->next) { |
| 1302 | new_dmi = kmalloc(sizeof(struct dev_mc_list), gpf_flag); | 1298 | new_dmi = kmalloc(sizeof(struct dev_mc_list), gfp_flag); |
| 1303 | 1299 | ||
| 1304 | if (!new_dmi) { | 1300 | if (!new_dmi) { |
| 1305 | /* FIXME: Potential memory leak !!! */ | 1301 | /* FIXME: Potential memory leak !!! */ |
| @@ -1702,51 +1698,29 @@ static int bond_enslave(struct net_device *bond_dev, struct net_device *slave_de | |||
| 1702 | } | 1698 | } |
| 1703 | } | 1699 | } |
| 1704 | 1700 | ||
| 1705 | if (app_abi_ver >= 1) { | 1701 | /* |
| 1706 | /* The application is using an ABI, which requires the | 1702 | * Old ifenslave binaries are no longer supported. These can |
| 1707 | * slave interface to be closed. | 1703 | * be identified with moderate accurary by the state of the slave: |
| 1708 | */ | 1704 | * the current ifenslave will set the interface down prior to |
| 1709 | if ((slave_dev->flags & IFF_UP)) { | 1705 | * enslaving it; the old ifenslave will not. |
| 1710 | printk(KERN_ERR DRV_NAME | 1706 | */ |
| 1711 | ": Error: %s is up\n", | 1707 | if ((slave_dev->flags & IFF_UP)) { |
| 1712 | slave_dev->name); | 1708 | printk(KERN_ERR DRV_NAME ": %s is up. " |
| 1713 | res = -EPERM; | 1709 | "This may be due to an out of date ifenslave.\n", |
| 1714 | goto err_undo_flags; | 1710 | slave_dev->name); |
| 1715 | } | 1711 | res = -EPERM; |
| 1716 | 1712 | goto err_undo_flags; | |
| 1717 | if (slave_dev->set_mac_address == NULL) { | 1713 | } |
| 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 | 1714 | ||
| 1725 | res = -EOPNOTSUPP; | 1715 | if (slave_dev->set_mac_address == NULL) { |
| 1726 | goto err_undo_flags; | 1716 | printk(KERN_ERR DRV_NAME |
| 1727 | } | 1717 | ": Error: The slave device you specified does " |
| 1728 | } else { | 1718 | "not support setting the MAC address.\n"); |
| 1729 | /* The application is not using an ABI, which requires the | 1719 | printk(KERN_ERR |
| 1730 | * slave interface to be open. | 1720 | "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 | 1721 | ||
| 1740 | if ((bond->params.mode == BOND_MODE_8023AD) || | 1722 | res = -EOPNOTSUPP; |
| 1741 | (bond->params.mode == BOND_MODE_TLB) || | 1723 | 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 | } | 1724 | } |
| 1751 | 1725 | ||
| 1752 | new_slave = kmalloc(sizeof(struct slave), GFP_KERNEL); | 1726 | new_slave = kmalloc(sizeof(struct slave), GFP_KERNEL); |
| @@ -1762,41 +1736,36 @@ static int bond_enslave(struct net_device *bond_dev, struct net_device *slave_de | |||
| 1762 | */ | 1736 | */ |
| 1763 | new_slave->original_flags = slave_dev->flags; | 1737 | new_slave->original_flags = slave_dev->flags; |
| 1764 | 1738 | ||
| 1765 | if (app_abi_ver >= 1) { | 1739 | /* |
| 1766 | /* save slave's original ("permanent") mac address for | 1740 | * Save slave's original ("permanent") mac address for modes |
| 1767 | * modes that needs it, and for restoring it upon release, | 1741 | * that need it, and for restoring it upon release, and then |
| 1768 | * and then set it to the master's address | 1742 | * set it to the master's address |
| 1769 | */ | 1743 | */ |
| 1770 | memcpy(new_slave->perm_hwaddr, slave_dev->dev_addr, ETH_ALEN); | 1744 | memcpy(new_slave->perm_hwaddr, slave_dev->dev_addr, ETH_ALEN); |
| 1771 | 1745 | ||
| 1772 | /* set slave to master's mac address | 1746 | /* |
| 1773 | * The application already set the master's | 1747 | * Set slave to master's mac address. The application already |
| 1774 | * mac address to that of the first slave | 1748 | * set the master's mac address to that of the first slave |
| 1775 | */ | 1749 | */ |
| 1776 | memcpy(addr.sa_data, bond_dev->dev_addr, bond_dev->addr_len); | 1750 | memcpy(addr.sa_data, bond_dev->dev_addr, bond_dev->addr_len); |
| 1777 | addr.sa_family = slave_dev->type; | 1751 | addr.sa_family = slave_dev->type; |
| 1778 | res = dev_set_mac_address(slave_dev, &addr); | 1752 | res = dev_set_mac_address(slave_dev, &addr); |
| 1779 | if (res) { | 1753 | if (res) { |
| 1780 | dprintk("Error %d calling set_mac_address\n", res); | 1754 | dprintk("Error %d calling set_mac_address\n", res); |
| 1781 | goto err_free; | 1755 | goto err_free; |
| 1782 | } | 1756 | } |
| 1783 | 1757 | ||
| 1784 | /* open the slave since the application closed it */ | 1758 | /* open the slave since the application closed it */ |
| 1785 | res = dev_open(slave_dev); | 1759 | res = dev_open(slave_dev); |
| 1786 | if (res) { | 1760 | if (res) { |
| 1787 | dprintk("Openning slave %s failed\n", slave_dev->name); | 1761 | dprintk("Openning slave %s failed\n", slave_dev->name); |
| 1788 | goto err_restore_mac; | 1762 | goto err_restore_mac; |
| 1789 | } | ||
| 1790 | } | 1763 | } |
| 1791 | 1764 | ||
| 1792 | res = netdev_set_master(slave_dev, bond_dev); | 1765 | res = netdev_set_master(slave_dev, bond_dev); |
| 1793 | if (res) { | 1766 | if (res) { |
| 1794 | dprintk("Error %d calling netdev_set_master\n", res); | 1767 | dprintk("Error %d calling netdev_set_master\n", res); |
| 1795 | if (app_abi_ver < 1) { | 1768 | goto err_close; |
| 1796 | goto err_free; | ||
| 1797 | } else { | ||
| 1798 | goto err_close; | ||
| 1799 | } | ||
| 1800 | } | 1769 | } |
| 1801 | 1770 | ||
| 1802 | new_slave->dev = slave_dev; | 1771 | new_slave->dev = slave_dev; |
| @@ -1997,39 +1966,6 @@ static int bond_enslave(struct net_device *bond_dev, struct net_device *slave_de | |||
| 1997 | 1966 | ||
| 1998 | write_unlock_bh(&bond->lock); | 1967 | write_unlock_bh(&bond->lock); |
| 1999 | 1968 | ||
| 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 | 1969 | printk(KERN_INFO DRV_NAME |
| 2034 | ": %s: enslaving %s as a%s interface with a%s link.\n", | 1970 | ": %s: enslaving %s as a%s interface with a%s link.\n", |
| 2035 | bond_dev->name, slave_dev->name, | 1971 | bond_dev->name, slave_dev->name, |
| @@ -2227,12 +2163,10 @@ static int bond_release(struct net_device *bond_dev, struct net_device *slave_de | |||
| 2227 | /* close slave before restoring its mac address */ | 2163 | /* close slave before restoring its mac address */ |
| 2228 | dev_close(slave_dev); | 2164 | dev_close(slave_dev); |
| 2229 | 2165 | ||
| 2230 | if (app_abi_ver >= 1) { | 2166 | /* restore original ("permanent") mac address */ |
| 2231 | /* restore original ("permanent") mac address */ | 2167 | memcpy(addr.sa_data, slave->perm_hwaddr, ETH_ALEN); |
| 2232 | memcpy(addr.sa_data, slave->perm_hwaddr, ETH_ALEN); | 2168 | addr.sa_family = slave_dev->type; |
| 2233 | addr.sa_family = slave_dev->type; | 2169 | dev_set_mac_address(slave_dev, &addr); |
| 2234 | dev_set_mac_address(slave_dev, &addr); | ||
| 2235 | } | ||
| 2236 | 2170 | ||
| 2237 | /* restore the original state of the | 2171 | /* restore the original state of the |
| 2238 | * IFF_NOARP flag that might have been | 2172 | * IFF_NOARP flag that might have been |
| @@ -2320,12 +2254,10 @@ static int bond_release_all(struct net_device *bond_dev) | |||
| 2320 | /* close slave before restoring its mac address */ | 2254 | /* close slave before restoring its mac address */ |
| 2321 | dev_close(slave_dev); | 2255 | dev_close(slave_dev); |
| 2322 | 2256 | ||
| 2323 | if (app_abi_ver >= 1) { | 2257 | /* restore original ("permanent") mac address*/ |
| 2324 | /* restore original ("permanent") mac address*/ | 2258 | memcpy(addr.sa_data, slave->perm_hwaddr, ETH_ALEN); |
| 2325 | memcpy(addr.sa_data, slave->perm_hwaddr, ETH_ALEN); | 2259 | addr.sa_family = slave_dev->type; |
| 2326 | addr.sa_family = slave_dev->type; | 2260 | dev_set_mac_address(slave_dev, &addr); |
| 2327 | dev_set_mac_address(slave_dev, &addr); | ||
| 2328 | } | ||
| 2329 | 2261 | ||
| 2330 | /* restore the original state of the IFF_NOARP flag that might have | 2262 | /* restore the original state of the IFF_NOARP flag that might have |
| 2331 | * been set by bond_set_slave_inactive_flags() | 2263 | * been set by bond_set_slave_inactive_flags() |
| @@ -2423,57 +2355,6 @@ static int bond_ioctl_change_active(struct net_device *bond_dev, struct net_devi | |||
| 2423 | return res; | 2355 | return res; |
| 2424 | } | 2356 | } |
| 2425 | 2357 | ||
| 2426 | static 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 | |||
| 2477 | static int bond_info_query(struct net_device *bond_dev, struct ifbond *info) | 2358 | static int bond_info_query(struct net_device *bond_dev, struct ifbond *info) |
| 2478 | { | 2359 | { |
| 2479 | struct bonding *bond = bond_dev->priv; | 2360 | struct bonding *bond = bond_dev->priv; |
| @@ -3442,16 +3323,11 @@ static void bond_info_show_slave(struct seq_file *seq, const struct slave *slave | |||
| 3442 | seq_printf(seq, "Link Failure Count: %d\n", | 3323 | seq_printf(seq, "Link Failure Count: %d\n", |
| 3443 | slave->link_failure_count); | 3324 | slave->link_failure_count); |
| 3444 | 3325 | ||
| 3445 | if (app_abi_ver >= 1) { | 3326 | seq_printf(seq, |
| 3446 | seq_printf(seq, | 3327 | "Permanent HW addr: %02x:%02x:%02x:%02x:%02x:%02x\n", |
| 3447 | "Permanent HW addr: %02x:%02x:%02x:%02x:%02x:%02x\n", | 3328 | slave->perm_hwaddr[0], slave->perm_hwaddr[1], |
| 3448 | slave->perm_hwaddr[0], | 3329 | slave->perm_hwaddr[2], slave->perm_hwaddr[3], |
| 3449 | slave->perm_hwaddr[1], | 3330 | 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 | 3331 | ||
| 3456 | if (bond->params.mode == BOND_MODE_8023AD) { | 3332 | if (bond->params.mode == BOND_MODE_8023AD) { |
| 3457 | const struct aggregator *agg | 3333 | const struct aggregator *agg |
| @@ -4010,15 +3886,12 @@ static int bond_do_ioctl(struct net_device *bond_dev, struct ifreq *ifr, int cmd | |||
| 4010 | struct ifslave k_sinfo; | 3886 | struct ifslave k_sinfo; |
| 4011 | struct ifslave __user *u_sinfo = NULL; | 3887 | struct ifslave __user *u_sinfo = NULL; |
| 4012 | struct mii_ioctl_data *mii = NULL; | 3888 | struct mii_ioctl_data *mii = NULL; |
| 4013 | int prev_abi_ver = orig_app_abi_ver; | ||
| 4014 | int res = 0; | 3889 | int res = 0; |
| 4015 | 3890 | ||
| 4016 | dprintk("bond_ioctl: master=%s, cmd=%d\n", | 3891 | dprintk("bond_ioctl: master=%s, cmd=%d\n", |
| 4017 | bond_dev->name, cmd); | 3892 | bond_dev->name, cmd); |
| 4018 | 3893 | ||
| 4019 | switch (cmd) { | 3894 | switch (cmd) { |
| 4020 | case SIOCETHTOOL: | ||
| 4021 | return bond_ethtool_ioctl(bond_dev, ifr); | ||
| 4022 | case SIOCGMIIPHY: | 3895 | case SIOCGMIIPHY: |
| 4023 | mii = if_mii(ifr); | 3896 | mii = if_mii(ifr); |
| 4024 | if (!mii) { | 3897 | if (!mii) { |
| @@ -4090,21 +3963,6 @@ static int bond_do_ioctl(struct net_device *bond_dev, struct ifreq *ifr, int cmd | |||
| 4090 | return -EPERM; | 3963 | return -EPERM; |
| 4091 | } | 3964 | } |
| 4092 | 3965 | ||
| 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); | 3966 | slave_dev = dev_get_by_name(ifr->ifr_slave); |
| 4109 | 3967 | ||
| 4110 | dprintk("slave_dev=%p: \n", slave_dev); | 3968 | dprintk("slave_dev=%p: \n", slave_dev); |
| @@ -4137,14 +3995,6 @@ static int bond_do_ioctl(struct net_device *bond_dev, struct ifreq *ifr, int cmd | |||
| 4137 | dev_put(slave_dev); | 3995 | dev_put(slave_dev); |
| 4138 | } | 3996 | } |
| 4139 | 3997 | ||
| 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; | 3998 | return res; |
| 4149 | } | 3999 | } |
| 4150 | 4000 | ||
| @@ -4578,9 +4428,18 @@ static inline void bond_set_mode_ops(struct bonding *bond, int mode) | |||
| 4578 | } | 4428 | } |
| 4579 | } | 4429 | } |
| 4580 | 4430 | ||
| 4431 | static void bond_ethtool_get_drvinfo(struct net_device *bond_dev, | ||
| 4432 | struct ethtool_drvinfo *drvinfo) | ||
| 4433 | { | ||
| 4434 | strncpy(drvinfo->driver, DRV_NAME, 32); | ||
| 4435 | strncpy(drvinfo->version, DRV_VERSION, 32); | ||
| 4436 | snprintf(drvinfo->fw_version, 32, "%d", BOND_ABI_VERSION); | ||
| 4437 | } | ||
| 4438 | |||
| 4581 | static struct ethtool_ops bond_ethtool_ops = { | 4439 | static struct ethtool_ops bond_ethtool_ops = { |
| 4582 | .get_tx_csum = ethtool_op_get_tx_csum, | 4440 | .get_tx_csum = ethtool_op_get_tx_csum, |
| 4583 | .get_sg = ethtool_op_get_sg, | 4441 | .get_sg = ethtool_op_get_sg, |
| 4442 | .get_drvinfo = bond_ethtool_get_drvinfo, | ||
| 4584 | }; | 4443 | }; |
| 4585 | 4444 | ||
| 4586 | /* | 4445 | /* |
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 e64df4d0800b..83334db2921c 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 | ||
| 587 | static inline int rx_refill(struct net_device *ndev, int gfp) | 587 | static 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/pcmcia/smc91c92_cs.c b/drivers/net/pcmcia/smc91c92_cs.c index d652e1eddb45..c7cca842e5ee 100644 --- a/drivers/net/pcmcia/smc91c92_cs.c +++ b/drivers/net/pcmcia/smc91c92_cs.c | |||
| @@ -1832,7 +1832,7 @@ static void fill_multicast_tbl(int count, struct dev_mc_list *addrs, | |||
| 1832 | { | 1832 | { |
| 1833 | struct dev_mc_list *mc_addr; | 1833 | struct dev_mc_list *mc_addr; |
| 1834 | 1834 | ||
| 1835 | for (mc_addr = addrs; mc_addr && --count > 0; mc_addr = mc_addr->next) { | 1835 | for (mc_addr = addrs; mc_addr && count-- > 0; mc_addr = mc_addr->next) { |
| 1836 | u_int position = ether_crc(6, mc_addr->dmi_addr); | 1836 | u_int position = ether_crc(6, mc_addr->dmi_addr); |
| 1837 | #ifndef final_version /* Verify multicast address. */ | 1837 | #ifndef final_version /* Verify multicast address. */ |
| 1838 | if ((mc_addr->dmi_addr[0] & 1) == 0) | 1838 | if ((mc_addr->dmi_addr[0] & 1) == 0) |
diff --git a/drivers/net/skge.c b/drivers/net/skge.c index fd398da4993b..c2e6484ef138 100644 --- a/drivers/net/skge.c +++ b/drivers/net/skge.c | |||
| @@ -2837,21 +2837,29 @@ static void skge_netpoll(struct net_device *dev) | |||
| 2837 | static int skge_set_mac_address(struct net_device *dev, void *p) | 2837 | static int skge_set_mac_address(struct net_device *dev, void *p) |
| 2838 | { | 2838 | { |
| 2839 | struct skge_port *skge = netdev_priv(dev); | 2839 | struct skge_port *skge = netdev_priv(dev); |
| 2840 | struct sockaddr *addr = p; | 2840 | struct skge_hw *hw = skge->hw; |
| 2841 | int err = 0; | 2841 | unsigned port = skge->port; |
| 2842 | const struct sockaddr *addr = p; | ||
| 2842 | 2843 | ||
| 2843 | if (!is_valid_ether_addr(addr->sa_data)) | 2844 | if (!is_valid_ether_addr(addr->sa_data)) |
| 2844 | return -EADDRNOTAVAIL; | 2845 | return -EADDRNOTAVAIL; |
| 2845 | 2846 | ||
| 2846 | skge_down(dev); | 2847 | spin_lock_bh(&hw->phy_lock); |
| 2847 | memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN); | 2848 | memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN); |
| 2848 | memcpy_toio(skge->hw->regs + B2_MAC_1 + skge->port*8, | 2849 | memcpy_toio(hw->regs + B2_MAC_1 + port*8, |
| 2849 | dev->dev_addr, ETH_ALEN); | 2850 | dev->dev_addr, ETH_ALEN); |
| 2850 | memcpy_toio(skge->hw->regs + B2_MAC_2 + skge->port*8, | 2851 | memcpy_toio(hw->regs + B2_MAC_2 + port*8, |
| 2851 | dev->dev_addr, ETH_ALEN); | 2852 | dev->dev_addr, ETH_ALEN); |
| 2852 | if (dev->flags & IFF_UP) | 2853 | |
| 2853 | err = skge_up(dev); | 2854 | if (hw->chip_id == CHIP_ID_GENESIS) |
| 2854 | return err; | 2855 | xm_outaddr(hw, port, XM_SA, dev->dev_addr); |
| 2856 | else { | ||
| 2857 | gma_set_addr(hw, port, GM_SRC_ADDR_1L, dev->dev_addr); | ||
| 2858 | gma_set_addr(hw, port, GM_SRC_ADDR_2L, dev->dev_addr); | ||
| 2859 | } | ||
| 2860 | spin_unlock_bh(&hw->phy_lock); | ||
| 2861 | |||
| 2862 | return 0; | ||
| 2855 | } | 2863 | } |
| 2856 | 2864 | ||
| 2857 | static const struct { | 2865 | static const struct { |
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 | |||
| 136 | TODO: - fix forced speed/duplexing code (broken a long time ago, when | 140 | TODO: - 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)) |
| 1038 | static __inline__ struct sk_buff *gem_alloc_skb(int size, int gfp_flags) | 1038 | static __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/tokenring/ibmtr.c b/drivers/net/tokenring/ibmtr.c index e7b001017b9a..32057e65808b 100644 --- a/drivers/net/tokenring/ibmtr.c +++ b/drivers/net/tokenring/ibmtr.c | |||
| @@ -531,7 +531,6 @@ static int __devinit ibmtr_probe1(struct net_device *dev, int PIOaddr) | |||
| 531 | if (!time_after(jiffies, timeout)) continue; | 531 | if (!time_after(jiffies, timeout)) continue; |
| 532 | DPRINTK( "Hardware timeout during initialization.\n"); | 532 | DPRINTK( "Hardware timeout during initialization.\n"); |
| 533 | iounmap(t_mmio); | 533 | iounmap(t_mmio); |
| 534 | kfree(ti); | ||
| 535 | return -ENODEV; | 534 | return -ENODEV; |
| 536 | } | 535 | } |
| 537 | ti->sram_phys = | 536 | ti->sram_phys = |
| @@ -645,7 +644,6 @@ static int __devinit ibmtr_probe1(struct net_device *dev, int PIOaddr) | |||
| 645 | DPRINTK("Unknown shared ram paging info %01X\n", | 644 | DPRINTK("Unknown shared ram paging info %01X\n", |
| 646 | ti->shared_ram_paging); | 645 | ti->shared_ram_paging); |
| 647 | iounmap(t_mmio); | 646 | iounmap(t_mmio); |
| 648 | kfree(ti); | ||
| 649 | return -ENODEV; | 647 | return -ENODEV; |
| 650 | break; | 648 | break; |
| 651 | } /*end switch shared_ram_paging */ | 649 | } /*end switch shared_ram_paging */ |
| @@ -675,7 +673,6 @@ static int __devinit ibmtr_probe1(struct net_device *dev, int PIOaddr) | |||
| 675 | "driver limit (%05x), adapter not started.\n", | 673 | "driver limit (%05x), adapter not started.\n", |
| 676 | chk_base, ibmtr_mem_base + IBMTR_SHARED_RAM_SIZE); | 674 | chk_base, ibmtr_mem_base + IBMTR_SHARED_RAM_SIZE); |
| 677 | iounmap(t_mmio); | 675 | iounmap(t_mmio); |
| 678 | kfree(ti); | ||
| 679 | return -ENODEV; | 676 | return -ENODEV; |
| 680 | } else { /* seems cool, record what we have figured out */ | 677 | } else { /* seems cool, record what we have figured out */ |
| 681 | ti->sram_base = new_base >> 12; | 678 | ti->sram_base = new_base >> 12; |
| @@ -690,7 +687,6 @@ static int __devinit ibmtr_probe1(struct net_device *dev, int PIOaddr) | |||
| 690 | DPRINTK("Could not grab irq %d. Halting Token Ring driver.\n", | 687 | DPRINTK("Could not grab irq %d. Halting Token Ring driver.\n", |
| 691 | irq); | 688 | irq); |
| 692 | iounmap(t_mmio); | 689 | iounmap(t_mmio); |
| 693 | kfree(ti); | ||
| 694 | return -ENODEV; | 690 | return -ENODEV; |
| 695 | } | 691 | } |
| 696 | /*?? Now, allocate some of the PIO PORTs for this driver.. */ | 692 | /*?? Now, allocate some of the PIO PORTs for this driver.. */ |
| @@ -699,7 +695,6 @@ static int __devinit ibmtr_probe1(struct net_device *dev, int PIOaddr) | |||
| 699 | DPRINTK("Could not grab PIO range. Halting driver.\n"); | 695 | DPRINTK("Could not grab PIO range. Halting driver.\n"); |
| 700 | free_irq(dev->irq, dev); | 696 | free_irq(dev->irq, dev); |
| 701 | iounmap(t_mmio); | 697 | iounmap(t_mmio); |
| 702 | kfree(ti); | ||
| 703 | return -EBUSY; | 698 | return -EBUSY; |
| 704 | } | 699 | } |
| 705 | 700 | ||
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; |
diff --git a/drivers/net/wireless/orinoco.c b/drivers/net/wireless/orinoco.c index 6deb7cc810cc..cf3daaa1b369 100644 --- a/drivers/net/wireless/orinoco.c +++ b/drivers/net/wireless/orinoco.c | |||
| @@ -503,9 +503,14 @@ static int orinoco_xmit(struct sk_buff *skb, struct net_device *dev) | |||
| 503 | return 0; | 503 | return 0; |
| 504 | } | 504 | } |
| 505 | 505 | ||
| 506 | /* Length of the packet body */ | 506 | /* Check packet length, pad short packets, round up odd length */ |
| 507 | /* FIXME: what if the skb is smaller than this? */ | 507 | len = max_t(int, ALIGN(skb->len, 2), ETH_ZLEN); |
| 508 | len = max_t(int,skb->len - ETH_HLEN, ETH_ZLEN - ETH_HLEN); | 508 | if (skb->len < len) { |
| 509 | skb = skb_padto(skb, len); | ||
| 510 | if (skb == NULL) | ||
| 511 | goto fail; | ||
| 512 | } | ||
| 513 | len -= ETH_HLEN; | ||
| 509 | 514 | ||
| 510 | eh = (struct ethhdr *)skb->data; | 515 | eh = (struct ethhdr *)skb->data; |
| 511 | 516 | ||
| @@ -557,8 +562,7 @@ static int orinoco_xmit(struct sk_buff *skb, struct net_device *dev) | |||
| 557 | p = skb->data; | 562 | p = skb->data; |
| 558 | } | 563 | } |
| 559 | 564 | ||
| 560 | /* Round up for odd length packets */ | 565 | err = hermes_bap_pwrite(hw, USER_BAP, p, data_len, |
| 561 | err = hermes_bap_pwrite(hw, USER_BAP, p, ALIGN(data_len, 2), | ||
| 562 | txfid, data_off); | 566 | txfid, data_off); |
| 563 | if (err) { | 567 | if (err) { |
| 564 | printk(KERN_ERR "%s: Error %d writing packet to BAP\n", | 568 | printk(KERN_ERR "%s: Error %d writing packet to BAP\n", |
