# This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1429 -> 1.1435 # drivers/net/wan/lmc/lmc_debug.c 1.3 -> 1.4 # drivers/net/wan/lmc/lmc_main.c 1.14 -> 1.15 # drivers/net/wan/lmc/lmc_var.h 1.4 -> 1.5 # drivers/net/wan/lmc/lmc_proto.c 1.7 -> 1.8 # drivers/net/sundance.c 1.42 -> 1.44 # drivers/net/eepro.c 1.17 -> 1.18 # drivers/net/bonding/bond_3ad.c 1.1 -> 1.2 # drivers/net/wan/lmc/lmc_media.c 1.5 -> 1.6 # drivers/net/bonding/bond_main.c 1.22 -> 1.23 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/05/27 shmulik.hen@intel.com 1.1430 # [netdrvr bonding] fix long failover in 802.3ad mode # # This patch fixes the bug reported by Jay on April 3rd regarding long # failover time when releasing the last slave in the active aggregator. The # fix, as suggested by Jay, is to follow the spec recommendation and send a # LACPDU to the partner saying this port is no longer aggregatable and # therefore trigger an immediate re-selection of a new aggregator instead of # waiting the entire expiration timeout. # -------------------------------------------- # 03/05/27 shmulik.hen@intel.com 1.1431 # [netdrvr bonding] fix ABI version control problem # # This fix makes bonding not commit to a specific ABI version if the ioctl # command is not supported by bonding. # # (It also removes the '\n' in the continuous printk reporting the link down # event in bond_mii_monitor - it got in there by mistake in our previous # patch set and caused log messages to appear funny in some situations). # -------------------------------------------- # 03/05/27 bunk@fs.tum.de 1.1432 # [wan lmc] remove 2.0.x-era code # # The patch below removes obsolete #if'd code for kernel 2.0 and 2.2 from # drivers/net/wan/lmc/* (this includes the expansion of some #define's # that were definded differently for different kernel versions). # -------------------------------------------- # 03/05/27 edward_peng@dlink.com.tw 1.1433 # [netdrvr sundance] fix flow control bug # -------------------------------------------- # 03/05/27 edward_peng@dlink.com.tw 1.1434 # [netdrvr sundance] fix another flow control bug # -------------------------------------------- # 03/05/27 jgarzik@redhat.com 1.1435 # [netdrvr eepro] update MODULE_AUTHOR per old-author request # -------------------------------------------- # diff -Nru a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c --- a/drivers/net/bonding/bond_3ad.c Tue May 27 01:20:58 2003 +++ b/drivers/net/bonding/bond_3ad.c Tue May 27 01:20:58 2003 @@ -721,7 +721,7 @@ } /** - * __detach_bond_to_agg + * __detach_bond_from_agg * @port: the port we're looking at * * Handle the detaching of the port's control parser/multiplexer from the @@ -828,6 +828,55 @@ return retval; } +/** + * __update_lacpdu_from_port - update a port's lacpdu fields + * @port: the port we're looking at + * + */ +static inline void __update_lacpdu_from_port(struct port *port) +{ + struct lacpdu *lacpdu = &port->lacpdu; + + /* update current actual Actor parameters */ + /* lacpdu->subtype initialized + * lacpdu->version_number initialized + * lacpdu->tlv_type_actor_info initialized + * lacpdu->actor_information_length initialized + */ + + lacpdu->actor_system_priority = port->actor_system_priority; + lacpdu->actor_system = port->actor_system; + lacpdu->actor_key = port->actor_oper_port_key; + lacpdu->actor_port_priority = port->actor_port_priority; + lacpdu->actor_port = port->actor_port_number; + lacpdu->actor_state = port->actor_oper_port_state; + + /* lacpdu->reserved_3_1 initialized + * lacpdu->tlv_type_partner_info initialized + * lacpdu->partner_information_length initialized + */ + + lacpdu->partner_system_priority = port->partner_oper_system_priority; + lacpdu->partner_system = port->partner_oper_system; + lacpdu->partner_key = port->partner_oper_key; + lacpdu->partner_port_priority = port->partner_oper_port_priority; + lacpdu->partner_port = port->partner_oper_port_number; + lacpdu->partner_state = port->partner_oper_port_state; + + /* lacpdu->reserved_3_2 initialized + * lacpdu->tlv_type_collector_info initialized + * lacpdu->collector_information_length initialized + * collector_max_delay initialized + * reserved_12[12] initialized + * tlv_type_terminator initialized + * terminator_length initialized + * reserved_50[50] initialized + */ + + /* Convert all non u8 parameters to Big Endian for transmit */ + __ntohs_lacpdu(lacpdu); +} + ////////////////////////////////////////////////////////////////////////////////////// // ================= main 802.3ad protocol code ====================================== ////////////////////////////////////////////////////////////////////////////////////// @@ -1177,43 +1226,11 @@ */ static void ad_tx_machine(struct port *port) { - struct lacpdu *lacpdu = &port->lacpdu; - // check if tx timer expired, to verify that we do not send more than 3 packets per second if (port->sm_tx_timer_counter && !(--port->sm_tx_timer_counter)) { // check if there is something to send if (port->ntt && (port->sm_vars & AD_PORT_LACP_ENABLED)) { - //update current actual Actor parameters - //lacpdu->subtype initialized - //lacpdu->version_number initialized - //lacpdu->tlv_type_actor_info initialized - //lacpdu->actor_information_length initialized - lacpdu->actor_system_priority = port->actor_system_priority; - lacpdu->actor_system = port->actor_system; - lacpdu->actor_key = port->actor_oper_port_key; - lacpdu->actor_port_priority = port->actor_port_priority; - lacpdu->actor_port = port->actor_port_number; - lacpdu->actor_state = port->actor_oper_port_state; - //lacpdu->reserved_3_1 initialized - //lacpdu->tlv_type_partner_info initialized - //lacpdu->partner_information_length initialized - lacpdu->partner_system_priority = port->partner_oper_system_priority; - lacpdu->partner_system = port->partner_oper_system; - lacpdu->partner_key = port->partner_oper_key; - lacpdu->partner_port_priority = port->partner_oper_port_priority; - lacpdu->partner_port = port->partner_oper_port_number; - lacpdu->partner_state = port->partner_oper_port_state; - //lacpdu->reserved_3_2 initialized - //lacpdu->tlv_type_collector_info initialized - //lacpdu->collector_information_length initialized - //collector_max_delay initialized - //reserved_12[12] initialized - //tlv_type_terminator initialized - //terminator_length initialized - //reserved_50[50] initialized - - // We need to convert all non u8 parameters to Big Endian for transmit - __ntohs_lacpdu(lacpdu); + __update_lacpdu_from_port(port); // send the lacpdu if (ad_lacpdu_send(port) >= 0) { BOND_PRINT_DBG(("Sent LACPDU on port %d", port->actor_port_number)); @@ -1971,13 +1988,13 @@ return; } - // disable the port - ad_disable_collecting_distributing(port); + BOND_PRINT_DBG(("Unbinding Link Aggregation Group %d", aggregator->aggregator_identifier)); - // deinitialize port's locks if necessary(os-specific) - __deinitialize_port_locks(port); + /* Tell the partner that this port is not suitable for aggregation */ + port->actor_oper_port_state &= ~AD_STATE_AGGREGATION; + __update_lacpdu_from_port(port); + ad_lacpdu_send(port); - BOND_PRINT_DBG(("Unbinding Link Aggregation Group %d", aggregator->aggregator_identifier)); // check if this aggregator is occupied if (aggregator->lag_ports) { // check if there are other ports related to this aggregator except diff -Nru a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c --- a/drivers/net/bonding/bond_main.c Tue May 27 01:20:58 2003 +++ b/drivers/net/bonding/bond_main.c Tue May 27 01:20:58 2003 @@ -2220,7 +2220,7 @@ } printk(KERN_INFO "%s: link status definitely down " - "for interface %s, disabling it\n", + "for interface %s, disabling it", master->name, dev->name); @@ -2994,6 +2994,7 @@ struct ifbond *u_binfo = NULL, k_binfo; struct ifslave *u_sinfo = NULL, k_sinfo; struct mii_ioctl_data *mii = NULL; + int prev_abi_ver = orig_app_abi_ver; int ret = 0; #ifdef BONDING_DEBUG @@ -3112,6 +3113,15 @@ } dev_put(slave_dev); } + + if (ret < 0) { + /* The ioctl failed, so there's no point in changing the + * orig_app_abi_ver. We'll restore it's value just in case + * we've changed it earlier in this function. + */ + orig_app_abi_ver = prev_abi_ver; + } + return ret; } diff -Nru a/drivers/net/eepro.c b/drivers/net/eepro.c --- a/drivers/net/eepro.c Tue May 27 01:20:58 2003 +++ b/drivers/net/eepro.c Tue May 27 01:20:58 2003 @@ -1715,7 +1715,7 @@ static int n_eepro; /* For linux 2.1.xx */ -MODULE_AUTHOR("Pascal Dupuis for the 2.1 stuff (locking,...)"); +MODULE_AUTHOR("Pascal Dupuis, and aris@cathedrallabs.org"); MODULE_DESCRIPTION("Intel i82595 ISA EtherExpressPro10/10+ driver"); MODULE_LICENSE("GPL"); diff -Nru a/drivers/net/sundance.c b/drivers/net/sundance.c --- a/drivers/net/sundance.c Tue May 27 01:20:58 2003 +++ b/drivers/net/sundance.c Tue May 27 01:20:58 2003 @@ -84,11 +84,14 @@ - Fix bug of custom mac address (StationAddr register only accept word write) + Version LK1.09 (D-Link): + - Fix the flowctrl bug. + - Set Pause bit in MII ANAR if flow control enabled. */ #define DRV_NAME "sundance" -#define DRV_VERSION "1.01+LK1.08a" -#define DRV_RELDATE "23-Apr-2003" +#define DRV_VERSION "1.01+LK1.09a" +#define DRV_RELDATE "16-May-2003" /* The user-configurable values. @@ -671,8 +674,8 @@ np->an_enable = 1; } } - if (flowctrl == 0) - np->flowctrl = 0; + if (flowctrl == 1) + np->flowctrl = 1; } /* Fibre PHY? */ @@ -687,6 +690,9 @@ /* Reset PHY */ mdio_write (dev, np->phys[0], MII_BMCR, BMCR_RESET); mdelay (300); + /* If flow control enabled, we need to advertise it.*/ + if (np->flowctrl) + mdio_write (dev, np->phys[0], MII_ADVERTISE, np->mii_if.advertising | 0x0400); mdio_write (dev, np->phys[0], MII_BMCR, BMCR_ANENABLE|BMCR_ANRESTART); /* Force media type */ if (!np->an_enable) { @@ -935,7 +941,7 @@ printk(KERN_INFO "%s: Setting %s-duplex based on MII #%d " "negotiated capability %4.4x.\n", dev->name, duplex ? "full" : "half", np->phys[0], negotiated); - writew(duplex ? 0x20 : 0, ioaddr + MACCtrl0); + writew(readw(ioaddr + MACCtrl0) | duplex ? 0x20 : 0, ioaddr + MACCtrl0); } } @@ -1455,9 +1461,12 @@ "full" : "half"); } check_duplex (dev); - if (np->flowctrl == 0) - writew(readw(ioaddr + MACCtrl0) & ~EnbFlowCtrl, + if (np->flowctrl && np->mii_if.full_duplex) { + writew(readw(ioaddr + MulticastFilter1+2) | 0x0200, + ioaddr + MulticastFilter1+2); + writew(readw(ioaddr + MACCtrl0) | EnbFlowCtrl, ioaddr + MACCtrl0); + } } if (intr_status & StatsMax) { get_stats(dev); @@ -1500,6 +1509,7 @@ static void set_rx_mode(struct net_device *dev) { long ioaddr = dev->base_addr; + struct netdev_private *np = dev->priv; u16 mc_filter[4]; /* Multicast hash filter */ u32 rx_mode; int i; @@ -1532,6 +1542,9 @@ writeb(AcceptBroadcast | AcceptMyPhys, ioaddr + RxMode); return; } + if (np->mii_if.full_duplex && np->flowctrl) + mc_filter[3] |= 0x0200; + for (i = 0; i < 4; i++) writew(mc_filter[i], ioaddr + MulticastFilter0 + i*2); writeb(rx_mode, ioaddr + RxMode); diff -Nru a/drivers/net/wan/lmc/lmc_debug.c b/drivers/net/wan/lmc/lmc_debug.c --- a/drivers/net/wan/lmc/lmc_debug.c Tue May 27 01:20:58 2003 +++ b/drivers/net/wan/lmc/lmc_debug.c Tue May 27 01:20:58 2003 @@ -2,9 +2,7 @@ #include #include #include -#include -#include "lmc_ver.h" #include "lmc_debug.h" /* diff -Nru a/drivers/net/wan/lmc/lmc_main.c b/drivers/net/wan/lmc/lmc_main.c --- a/drivers/net/wan/lmc/lmc_main.c Tue May 27 01:20:58 2003 +++ b/drivers/net/wan/lmc/lmc_main.c Tue May 27 01:20:58 2003 @@ -11,7 +11,7 @@ * With Help By: * David Boggs * Ron Crane - * Allan Cox + * Alan Cox * * This software may be used and distributed according to the terms * of the GNU General Public License version 2, incorporated herein by reference. @@ -38,7 +38,6 @@ /* $Id: lmc_main.c,v 1.36 2000/04/11 05:25:25 asj Exp $ */ -#include #include #include #include @@ -51,9 +50,6 @@ #include #include #include -#if LINUX_VERSION_CODE < 0x20155 -#include -#endif #include #include #include @@ -67,12 +63,8 @@ #include #include #include -#if LINUX_VERSION_CODE >= 0x20200 #include //#include -#else /* 2.0 kernel */ -#define ARPHRD_HDLC 513 -#endif #define DRIVER_MAJOR_VERSION 1 #define DRIVER_MINOR_VERSION 34 @@ -80,7 +72,6 @@ #define DRIVER_VERSION ((DRIVER_MAJOR_VERSION << 8) + DRIVER_MINOR_VERSION) -#include "lmc_ver.h" #include "lmc.h" #include "lmc_var.h" #include "lmc_ioctl.h" @@ -127,10 +118,8 @@ static int lmc_init(struct net_device * const); static void lmc_reset(lmc_softc_t * const sc); static void lmc_dec_reset(lmc_softc_t * const sc); -#if LINUX_VERSION_CODE >= 0x20363 static void lmc_driver_timeout(struct net_device *dev); int lmc_setup(void); -#endif /* @@ -165,7 +154,8 @@ * To date internally, just copy this out to the user. */ case LMCIOCGINFO: /*fold01*/ - LMC_COPY_TO_USER(ifr->ifr_data, &sc->ictl, sizeof (lmc_ctl_t)); + if (copy_to_user(ifr->ifr_data, &sc->ictl, sizeof (lmc_ctl_t))) + return -EFAULT; ret = 0; break; @@ -181,7 +171,8 @@ break; } - LMC_COPY_FROM_USER(&ctl, ifr->ifr_data, sizeof (lmc_ctl_t)); + if (copy_from_user(&ctl, ifr->ifr_data, sizeof (lmc_ctl_t))) + return -EFAULT; sc->lmc_media->set_status (sc, &ctl); @@ -211,7 +202,8 @@ break; } - LMC_COPY_FROM_USER(&new_type, ifr->ifr_data, sizeof(u_int16_t)); + if (copy_from_user(&new_type, ifr->ifr_data, sizeof(u_int16_t))) + return -EFAULT; if (new_type == old_type) @@ -248,8 +240,9 @@ sc->lmc_xinfo.Magic1 = 0xDEADBEEF; - LMC_COPY_TO_USER(ifr->ifr_data, &sc->lmc_xinfo, - sizeof (struct lmc_xinfo)); + if (copy_to_user(ifr->ifr_data, &sc->lmc_xinfo, + sizeof (struct lmc_xinfo))) + return -EFAULT; ret = 0; break; @@ -279,8 +272,9 @@ regVal & T1FRAMER_SEF_MASK; } - LMC_COPY_TO_USER(ifr->ifr_data, &sc->stats, - sizeof (struct lmc_statistics)); + if (copy_to_user(ifr->ifr_data, &sc->stats, + sizeof (struct lmc_statistics))) + return -EFAULT; ret = 0; break; @@ -310,7 +304,8 @@ break; } - LMC_COPY_FROM_USER(&ctl, ifr->ifr_data, sizeof (lmc_ctl_t)); + if (copy_from_user(&ctl, ifr->ifr_data, sizeof (lmc_ctl_t))) + return -EFAULT; sc->lmc_media->set_circuit_type(sc, ctl.circuit_type); sc->ictl.circuit_type = ctl.circuit_type; ret = 0; @@ -335,8 +330,10 @@ #ifdef DEBUG case LMCIOCDUMPEVENTLOG: - LMC_COPY_TO_USER(ifr->ifr_data, &lmcEventLogIndex, sizeof (u32)); - LMC_COPY_TO_USER(ifr->ifr_data + sizeof (u32), lmcEventLogBuf, sizeof (lmcEventLogBuf)); + if (copy_to_user(ifr->ifr_data, &lmcEventLogIndex, sizeof (u32))) + return -EFAULT; + if (copy_to_user(ifr->ifr_data + sizeof (u32), lmcEventLogBuf, sizeof (lmcEventLogBuf))) + return -EFAULT; ret = 0; break; @@ -359,9 +356,10 @@ /* * Stop the xwitter whlie we restart the hardware */ - LMC_XMITTER_BUSY(dev); + netif_stop_queue(dev); - LMC_COPY_FROM_USER(&xc, ifr->ifr_data, sizeof (struct lmc_xilinx_control)); + if (copy_from_user(&xc, ifr->ifr_data, sizeof (struct lmc_xilinx_control))) + return -EFAULT; switch(xc.command){ case lmc_xilinx_reset: /*fold02*/ { @@ -620,7 +618,7 @@ break; } - LMC_XMITTER_FREE(dev); + netif_wake_queue(dev); sc->lmc_txfull = 0; } @@ -646,7 +644,7 @@ lmc_softc_t *sc; int link_status; u_int32_t ticks; - LMC_SPIN_FLAGS; + unsigned long flags; sc = dev->priv; @@ -836,11 +834,7 @@ * Allocate our own device structure */ -#if LINUX_VERSION_CODE < 0x20363 - dev = kmalloc (sizeof (struct ppp_device)+8, GFP_KERNEL); -#else dev = kmalloc (sizeof (struct net_device)+8, GFP_KERNEL); -#endif if (dev == NULL){ printk (KERN_ERR "lmc: kmalloc for device failed\n"); return NULL; @@ -909,10 +903,8 @@ dev->get_stats = lmc_get_stats; dev->do_ioctl = lmc_ioctl; dev->set_config = lmc_set_config; -#if LINUX_VERSION_CODE >= 0x20363 dev->tx_timeout = lmc_driver_timeout; dev->watchdog_timeo = (HZ); /* 1 second */ -#endif /* * Why were we changing this??? @@ -923,8 +915,6 @@ spin_lock_init(&sc->lmc_lock); - LMC_SETUP_20_DEV; - printk ("%s: detected at %lx, irq %d\n", dev->name, ioaddr, dev->irq); if (register_netdev (dev) != 0) { @@ -1048,7 +1038,7 @@ * PCI bus, we are in trouble. */ - if (!LMC_PCI_PRESENT()) { + if (!pci_present()) { /* printk ("%s: We really want a pci bios!\n", dev->name);*/ return -1; } @@ -1124,11 +1114,7 @@ if (cards_found < 1) return -1; -#if LINUX_VERSION_CODE >= 0x20200 return foundaddr; -#else - return 0; -#endif } /* After this is called, packets can be sent. @@ -1199,11 +1185,7 @@ dev->do_ioctl = lmc_ioctl; - LMC_XMITTER_INIT(dev); - -#if LINUX_VERSION_CODE < 0x20363 - dev->start = 1; -#endif + netif_start_queue(dev); sc->stats.tx_tbusy0++ ; @@ -1277,7 +1259,7 @@ //dev->flags |= IFF_RUNNING; - LMC_XMITTER_FREE(dev); + netif_wake_queue(dev); sc->lmc_txfull = 0; sc->stats.tx_tbusy0++ ; @@ -1327,7 +1309,7 @@ /* Don't let anything else go on right now */ // dev->start = 0; - LMC_XMITTER_BUSY(dev); + netif_stop_queue(dev); sc->stats.tx_tbusy1++ ; /* stop interrupts */ @@ -1360,23 +1342,20 @@ sc->lmc_rxring[i].length = 0; sc->lmc_rxring[i].buffer1 = 0xDEADBEEF; if (skb != NULL) - { - LMC_SKB_FREE(skb, 1); - LMC_DEV_KFREE_SKB (skb); - } + dev_kfree_skb(skb); sc->lmc_rxq[i] = NULL; } for (i = 0; i < LMC_TXDESCS; i++) { if (sc->lmc_txq[i] != NULL) - LMC_DEV_KFREE_SKB (sc->lmc_txq[i]); + dev_kfree_skb(sc->lmc_txq[i]); sc->lmc_txq[i] = NULL; } lmc_led_off (sc, LMC_MII16_LED_ALL); - LMC_XMITTER_FREE(dev); + netif_wake_queue(dev); sc->stats.tx_tbusy0++ ; lmc_trace(dev, "lmc_ifdown out"); @@ -1496,14 +1475,12 @@ } else { -#if LINUX_VERSION_CODE >= 0x20200 sc->stats.tx_bytes += sc->lmc_txring[i].length & 0x7ff; -#endif sc->stats.tx_packets++; } - // LMC_DEV_KFREE_SKB (sc->lmc_txq[i]); + // dev_kfree_skb(sc->lmc_txq[i]); dev_kfree_skb_irq(sc->lmc_txq[i]); sc->lmc_txq[i] = 0; @@ -1518,20 +1495,14 @@ } LMC_EVENT_LOG(LMC_EVENT_TBUSY0, n_compl, 0); sc->lmc_txfull = 0; - LMC_XMITTER_FREE(dev); + netif_wake_queue(dev); sc->stats.tx_tbusy0++ ; -#if LINUX_VERSION_CODE < 0x20363 - mark_bh (NET_BH); /* Tell Linux to give me more packets */ -#endif #ifdef DEBUG sc->stats.dirtyTx = badtx; sc->stats.lmc_next_tx = sc->lmc_next_tx; sc->stats.lmc_txfull = sc->lmc_txfull; -#if LINUX_VERSION_CODE < 0x20363 - sc->stats.tbusy = dev->tbusy; -#endif #endif sc->lmc_taint_tx = badtx; @@ -1592,7 +1563,7 @@ u32 flag; int entry; int ret = 0; - LMC_SPIN_FLAGS; + unsigned long flags; lmc_trace(dev, "lmc_start_xmit in"); @@ -1600,60 +1571,6 @@ spin_lock_irqsave(&sc->lmc_lock, flags); - /* - * If the transmitter is busy - * this must be the 5 second polling - * from the kernel which called us. - * Poke the chip and try to get it running - * - */ -#if LINUX_VERSION_CODE < 0x20363 - if(dev->tbusy != 0){ - u32 csr6; - - printk("%s: Xmitter busy|\n", dev->name); - - sc->stats.tx_tbusy_calls++ ; - if (jiffies - dev->trans_start < TX_TIMEOUT) { - ret = 1; - goto lmc_start_xmit_bug_out; - } - - /* - * Chip seems to have locked up - * Reset it - * This whips out all our decriptor - * table and starts from scartch - */ - - LMC_EVENT_LOG(LMC_EVENT_XMTPRCTMO, - LMC_CSR_READ (sc, csr_status), - sc->stats.tx_ProcTimeout); - - lmc_running_reset (dev); - - LMC_EVENT_LOG(LMC_EVENT_RESET1, LMC_CSR_READ (sc, csr_status), 0); - LMC_EVENT_LOG(LMC_EVENT_RESET2, - lmc_mii_readreg (sc, 0, 16), - lmc_mii_readreg (sc, 0, 17)); - - /* restart the tx processes */ - csr6 = LMC_CSR_READ (sc, csr_command); - LMC_CSR_WRITE (sc, csr_command, csr6 | 0x0002); - LMC_CSR_WRITE (sc, csr_command, csr6 | 0x2002); - - /* immediate transmit */ - LMC_CSR_WRITE (sc, csr_txpoll, 0); - - sc->stats.tx_errors++; - sc->stats.tx_ProcTimeout++; /* -baz */ - - dev->trans_start = jiffies; - - ret = 1; - goto lmc_start_xmit_bug_out; - } -#endif /* normal path, tbusy known to be zero */ entry = sc->lmc_next_tx % LMC_TXDESCS; @@ -1669,26 +1586,26 @@ { /* Do not interrupt on completion of this packet */ flag = 0x60000000; - LMC_XMITTER_FREE(dev); + netif_wake_queue(dev); } else if (sc->lmc_next_tx - sc->lmc_taint_tx == LMC_TXDESCS / 2) { /* This generates an interrupt on completion of this packet */ flag = 0xe0000000; - LMC_XMITTER_FREE(dev); + netif_wake_queue(dev); } else if (sc->lmc_next_tx - sc->lmc_taint_tx < LMC_TXDESCS - 1) { /* Do not interrupt on completion of this packet */ flag = 0x60000000; - LMC_XMITTER_FREE(dev); + netif_wake_queue(dev); } else { /* This generates an interrupt on completion of this packet */ flag = 0xe0000000; sc->lmc_txfull = 1; - LMC_XMITTER_BUSY(dev); + netif_stop_queue(dev); } #else flag = LMC_TDES_INTERRUPT_ON_COMPLETION; @@ -1696,7 +1613,7 @@ if (sc->lmc_next_tx - sc->lmc_taint_tx >= LMC_TXDESCS - 1) { /* ring full, go busy */ sc->lmc_txfull = 1; - LMC_XMITTER_BUSY(dev); + netif_stop_queue(dev); sc->stats.tx_tbusy1++ ; LMC_EVENT_LOG(LMC_EVENT_TBUSY1, entry, 0); } @@ -1726,10 +1643,6 @@ dev->trans_start = jiffies; -#if LINUX_VERSION_CODE < 0x20363 -lmc_start_xmit_bug_out: -#endif - spin_unlock_irqrestore(&sc->lmc_lock, flags); lmc_trace(dev, "lmc_start_xmit_out"); @@ -1815,7 +1728,6 @@ if(skb == 0x0){ nsb = dev_alloc_skb (LMC_PKT_BUF_SZ + 2); if (nsb) { - LMC_SKB_FREE(nsb, 1); sc->lmc_rxq[i] = nsb; nsb->dev = dev; sc->lmc_rxring[i].buffer1 = virt_to_bus (nsb->tail); @@ -1859,7 +1771,6 @@ */ nsb = dev_alloc_skb (LMC_PKT_BUF_SZ + 2); if (nsb) { - LMC_SKB_FREE(nsb, 1); sc->lmc_rxq[i] = nsb; nsb->dev = dev; sc->lmc_rxring[i].buffer1 = virt_to_bus (nsb->tail); @@ -1948,7 +1859,7 @@ static struct net_device_stats *lmc_get_stats (struct net_device *dev) /*fold00*/ { lmc_softc_t *sc; - LMC_SPIN_FLAGS; + unsigned long flags; lmc_trace(dev, "lmc_get_stats in"); @@ -2148,7 +2059,6 @@ } skb->dev = sc->lmc_device; - LMC_SKB_FREE(skb, 1); /* owned by 21140 */ sc->lmc_rxring[i].status = 0x80000000; @@ -2367,11 +2277,10 @@ lmc_trace(sc->lmc_device, "lmc_initcsrs out"); } -#if LINUX_VERSION_CODE >= 0x20363 static void lmc_driver_timeout(struct net_device *dev) { /*fold00*/ lmc_softc_t *sc; u32 csr6; - LMC_SPIN_FLAGS; + unsigned long flags; lmc_trace(dev, "lmc_driver_timeout in"); @@ -2430,4 +2339,3 @@ return lmc_probe(NULL); } -#endif diff -Nru a/drivers/net/wan/lmc/lmc_media.c b/drivers/net/wan/lmc/lmc_media.c --- a/drivers/net/wan/lmc/lmc_media.c Tue May 27 01:20:58 2003 +++ b/drivers/net/wan/lmc/lmc_media.c Tue May 27 01:20:58 2003 @@ -1,6 +1,5 @@ /* $Id: lmc_media.c,v 1.13 2000/04/11 05:25:26 asj Exp $ */ -#include #include #include #include @@ -11,9 +10,6 @@ #include #include #include -#if LINUX_VERSION_CODE < 0x20155 -#include -#endif #include #include #include @@ -28,11 +24,8 @@ #include #include -#if LINUX_VERSION_CODE >= 0x20200 #include -#endif -#include "lmc_ver.h" #include "lmc.h" #include "lmc_var.h" #include "lmc_ioctl.h" diff -Nru a/drivers/net/wan/lmc/lmc_proto.c b/drivers/net/wan/lmc/lmc_proto.c --- a/drivers/net/wan/lmc/lmc_proto.c Tue May 27 01:20:58 2003 +++ b/drivers/net/wan/lmc/lmc_proto.c Tue May 27 01:20:58 2003 @@ -19,7 +19,6 @@ * Driver for the LanMedia LMC5200, LMC5245, LMC1000, LMC1200 cards. */ -#include #include #include #include @@ -46,7 +45,6 @@ #include #include -#include "lmc_ver.h" #include "lmc.h" #include "lmc_var.h" #include "lmc_debug.h" @@ -66,14 +64,6 @@ #define SPPP_attach(d) (void)0 #define SPPP_do_ioctl(d,i,c) -EOPNOTSUPP #else -#if LINUX_VERSION_CODE < 0x20363 -#define SPPP_attach(x) sppp_attach((struct ppp_device *)(x)->lmc_device) -#define SPPP_detach(x) sppp_detach((x)->lmc_device) -#define SPPP_open(x) sppp_open((x)->lmc_device) -#define SPPP_reopen(x) sppp_reopen((x)->lmc_device) -#define SPPP_close(x) sppp_close((x)->lmc_device) -#define SPPP_do_ioctl(x, y, z) sppp_do_ioctl((x)->lmc_device, (y), (z)) -#else #define SPPP_attach(x) sppp_attach((x)->pd) #define SPPP_detach(x) sppp_detach((x)->pd->dev) #define SPPP_open(x) sppp_open((x)->pd->dev) @@ -81,7 +71,6 @@ #define SPPP_close(x) sppp_close((x)->pd->dev) #define SPPP_do_ioctl(x, y, z) sppp_do_ioctl((x)->pd->dev, (y), (z)) #endif -#endif // init void lmc_proto_init(lmc_softc_t *sc) /*FOLD00*/ @@ -89,15 +78,12 @@ lmc_trace(sc->lmc_device, "lmc_proto_init in"); switch(sc->if_type){ case LMC_PPP: - -#if LINUX_VERSION_CODE >= 0x20363 sc->pd = kmalloc(sizeof(struct ppp_device), GFP_KERNEL); if (!sc->pd) { printk("lmc_proto_init(): kmalloc failure!\n"); return; } sc->pd->dev = sc->lmc_device; -#endif sc->if_ptr = sc->pd; break; case LMC_RAW: diff -Nru a/drivers/net/wan/lmc/lmc_var.h b/drivers/net/wan/lmc/lmc_var.h --- a/drivers/net/wan/lmc/lmc_var.h Tue May 27 01:20:58 2003 +++ b/drivers/net/wan/lmc/lmc_var.h Tue May 27 01:20:58 2003 @@ -48,9 +48,6 @@ #define u_int16_t u16 #define u_int8_t u8 #define tulip_uint32_t u32 -#if LINUX_VERSION_CODE < 0x20155 -#define u_int32_t u32 -#endif #define LMC_REG_RANGE 0x80 @@ -410,9 +407,7 @@ u32 last_int; u32 num_int; -#if LINUX_VERSION_CODE >= 0x20200 spinlock_t lmc_lock; -#endif u_int16_t if_type; /* PPP or NET */ struct ppp_device *pd; @@ -549,10 +544,6 @@ #define LMC_CRC_LEN_16 2 /* 16-bit CRC */ #define LMC_CRC_LEN_32 4 - -#if LINUX_VERSION_CODE < 0x20100 -#define test_and_set_bit(val, addr) set_bit(val, addr) -#endif #ifdef LMC_HDLC /* definition of an hdlc header. */