Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 21194
b: refs/heads/master
c: 0b310f3
h: refs/heads/master
v: v3
  • Loading branch information
Jeff Garzik committed Jan 31, 2006
1 parent 462b652 commit 5a93379
Show file tree
Hide file tree
Showing 58 changed files with 618 additions and 1,655 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2f633db5e9c57e07a971b65e9a72f090f59fd5f6
refs/heads/master: 0b310f36d7d96e27f6941ec0f9b95e15142f1e78
5 changes: 2 additions & 3 deletions trunk/arch/ppc/platforms/hdpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -319,11 +319,10 @@ static void __init hdpu_fixup_eth_pdata(struct platform_device *pd)
struct mv643xx_eth_platform_data *eth_pd;
eth_pd = pd->dev.platform_data;

eth_pd->port_serial_control =
mv64x60_read(&bh, MV643XX_ETH_PORT_SERIAL_CONTROL_REG(pd->id) & ~1);

eth_pd->force_phy_addr = 1;
eth_pd->phy_addr = pd->id;
eth_pd->speed = SPEED_100;
eth_pd->duplex = DUPLEX_FULL;
eth_pd->tx_queue_size = 400;
eth_pd->rx_queue_size = 800;
}
Expand Down
4 changes: 2 additions & 2 deletions trunk/arch/ppc/syslib/mv64x60.c
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ static struct platform_device mpsc1_device = {
};
#endif

#ifdef CONFIG_MV643XX_ETH
#if defined(CONFIG_MV643XX_ETH) || defined(CONFIG_MV643XX_ETH_MODULE)
static struct resource mv64x60_eth_shared_resources[] = {
[0] = {
.name = "ethernet shared base",
Expand Down Expand Up @@ -456,7 +456,7 @@ static struct platform_device *mv64x60_pd_devs[] __initdata = {
&mpsc0_device,
&mpsc1_device,
#endif
#ifdef CONFIG_MV643XX_ETH
#if defined(CONFIG_MV643XX_ETH) || defined(CONFIG_MV643XX_ETH_MODULE)
&mv64x60_eth_shared_device,
#endif
#ifdef CONFIG_MV643XX_ETH_0
Expand Down
9 changes: 5 additions & 4 deletions trunk/drivers/net/3c523.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
#include <linux/mca-legacy.h>
#include <linux/ethtool.h>
#include <linux/bitops.h>
#include <linux/jiffies.h>

#include <asm/uaccess.h>
#include <asm/processor.h>
Expand Down Expand Up @@ -658,7 +659,7 @@ static int init586(struct net_device *dev)

s = jiffies; /* warning: only active with interrupts on !! */
while (!(cfg_cmd->cmd_status & STAT_COMPL)) {
if (jiffies - s > 30*HZ/100)
if (time_after(jiffies, s + 30*HZ/100))
break;
}

Expand All @@ -684,7 +685,7 @@ static int init586(struct net_device *dev)

s = jiffies;
while (!(ias_cmd->cmd_status & STAT_COMPL)) {
if (jiffies - s > 30*HZ/100)
if (time_after(jiffies, s + 30*HZ/100))
break;
}

Expand All @@ -709,7 +710,7 @@ static int init586(struct net_device *dev)

s = jiffies;
while (!(tdr_cmd->cmd_status & STAT_COMPL)) {
if (jiffies - s > 30*HZ/100) {
if (time_after(jiffies, s + 30*HZ/100)) {
printk(KERN_WARNING "%s: %d Problems while running the TDR.\n", dev->name, __LINE__);
result = 1;
break;
Expand Down Expand Up @@ -798,7 +799,7 @@ static int init586(struct net_device *dev)
elmc_id_attn586();
s = jiffies;
while (!(mc_cmd->cmd_status & STAT_COMPL)) {
if (jiffies - s > 30*HZ/100)
if (time_after(jiffies, s + 30*HZ/100))
break;
}
if (!(mc_cmd->cmd_status & STAT_COMPL)) {
Expand Down
3 changes: 2 additions & 1 deletion trunk/drivers/net/3c59x.c
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ static int vortex_debug = 1;
#include <linux/highmem.h>
#include <linux/eisa.h>
#include <linux/bitops.h>
#include <linux/jiffies.h>
#include <asm/irq.h> /* For NR_IRQS only. */
#include <asm/io.h>
#include <asm/uaccess.h>
Expand Down Expand Up @@ -2717,7 +2718,7 @@ boomerang_rx(struct net_device *dev)
skb = dev_alloc_skb(PKT_BUF_SZ);
if (skb == NULL) {
static unsigned long last_jif;
if ((jiffies - last_jif) > 10 * HZ) {
if (time_after(jiffies, last_jif + 10 * HZ)) {
printk(KERN_WARNING "%s: memory shortage\n", dev->name);
last_jif = jiffies;
}
Expand Down
4 changes: 4 additions & 0 deletions trunk/drivers/net/acenic.c
Original file line number Diff line number Diff line change
Expand Up @@ -1002,6 +1002,8 @@ static int __devinit ace_init(struct net_device *dev)

mac1 = 0;
for(i = 0; i < 4; i++) {
int tmp;

mac1 = mac1 << 8;
tmp = read_eeprom_byte(dev, 0x8c+i);
if (tmp < 0) {
Expand All @@ -1012,6 +1014,8 @@ static int __devinit ace_init(struct net_device *dev)
}
mac2 = 0;
for(i = 4; i < 8; i++) {
int tmp;

mac2 = mac2 << 8;
tmp = read_eeprom_byte(dev, 0x8c+i);
if (tmp < 0) {
Expand Down
7 changes: 4 additions & 3 deletions trunk/drivers/net/apne.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include <linux/delay.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/jiffies.h>

#include <asm/system.h>
#include <asm/io.h>
Expand Down Expand Up @@ -216,7 +217,7 @@ static int __init apne_probe1(struct net_device *dev, int ioaddr)
outb(inb(ioaddr + NE_RESET), ioaddr + NE_RESET);

while ((inb(ioaddr + NE_EN0_ISR) & ENISR_RESET) == 0)
if (jiffies - reset_start_time > 2*HZ/100) {
if (time_after(jiffies, reset_start_time + 2*HZ/100)) {
printk(" not found (no reset ack).\n");
return -ENODEV;
}
Expand Down Expand Up @@ -382,7 +383,7 @@ apne_reset_8390(struct net_device *dev)

/* This check _should_not_ be necessary, omit eventually. */
while ((inb(NE_BASE+NE_EN0_ISR) & ENISR_RESET) == 0)
if (jiffies - reset_start_time > 2*HZ/100) {
if (time_after(jiffies, reset_start_time + 2*HZ/100)) {
printk("%s: ne_reset_8390() did not complete.\n", dev->name);
break;
}
Expand Down Expand Up @@ -530,7 +531,7 @@ apne_block_output(struct net_device *dev, int count,
dma_start = jiffies;

while ((inb(NE_BASE + NE_EN0_ISR) & ENISR_RDC) == 0)
if (jiffies - dma_start > 2*HZ/100) { /* 20ms */
if (time_after(jiffies, dma_start + 2*HZ/100)) { /* 20ms */
printk("%s: timeout waiting for Tx RDC.\n", dev->name);
apne_reset_8390(dev);
NS8390_init(dev,1);
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/net/arcnet/arc-rawmode.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ static int build_header(struct sk_buff *skb, struct net_device *dev,
static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length,
int bufnum);

struct ArcProto rawmode_proto =
static struct ArcProto rawmode_proto =
{
.suffix = 'r',
.mtu = XMTU,
Expand Down
20 changes: 12 additions & 8 deletions trunk/drivers/net/arcnet/arcnet.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
#include <net/arp.h>
#include <linux/init.h>
#include <linux/arcdevice.h>
#include <linux/jiffies.h>

/* "do nothing" functions for protocol drivers */
static void null_rx(struct net_device *dev, int bufnum,
Expand All @@ -61,6 +62,7 @@ static int null_build_header(struct sk_buff *skb, struct net_device *dev,
static int null_prepare_tx(struct net_device *dev, struct archdr *pkt,
int length, int bufnum);

static void arcnet_rx(struct net_device *dev, int bufnum);

/*
* one ArcProto per possible proto ID. None of the elements of
Expand All @@ -71,7 +73,7 @@ static int null_prepare_tx(struct net_device *dev, struct archdr *pkt,
struct ArcProto *arc_proto_map[256], *arc_proto_default,
*arc_bcast_proto, *arc_raw_proto;

struct ArcProto arc_proto_null =
static struct ArcProto arc_proto_null =
{
.suffix = '?',
.mtu = XMTU,
Expand All @@ -90,7 +92,6 @@ EXPORT_SYMBOL(arc_proto_map);
EXPORT_SYMBOL(arc_proto_default);
EXPORT_SYMBOL(arc_bcast_proto);
EXPORT_SYMBOL(arc_raw_proto);
EXPORT_SYMBOL(arc_proto_null);
EXPORT_SYMBOL(arcnet_unregister_proto);
EXPORT_SYMBOL(arcnet_debug);
EXPORT_SYMBOL(alloc_arcdev);
Expand Down Expand Up @@ -118,7 +119,7 @@ static int __init arcnet_init(void)

arcnet_debug = debug;

printk(VERSION);
printk("arcnet loaded.\n");

#ifdef ALPHA_WARNING
BUGLVL(D_EXTRA) {
Expand Down Expand Up @@ -178,8 +179,8 @@ EXPORT_SYMBOL(arcnet_dump_skb);
* Dump the contents of an ARCnet buffer
*/
#if (ARCNET_DEBUG_MAX & (D_RX | D_TX))
void arcnet_dump_packet(struct net_device *dev, int bufnum, char *desc,
int take_arcnet_lock)
static void arcnet_dump_packet(struct net_device *dev, int bufnum,
char *desc, int take_arcnet_lock)
{
struct arcnet_local *lp = dev->priv;
int i, length;
Expand Down Expand Up @@ -208,7 +209,10 @@ void arcnet_dump_packet(struct net_device *dev, int bufnum, char *desc,

}

EXPORT_SYMBOL(arcnet_dump_packet);
#else

#define arcnet_dump_packet(dev, bufnum, desc,take_arcnet_lock) do { } while (0)

#endif


Expand Down Expand Up @@ -733,7 +737,7 @@ static void arcnet_timeout(struct net_device *dev)

spin_unlock_irqrestore(&lp->lock, flags);

if (jiffies - lp->last_timeout > 10*HZ) {
if (time_after(jiffies, lp->last_timeout + 10*HZ)) {
BUGMSG(D_EXTRA, "tx timed out%s (status=%Xh, intmask=%Xh, dest=%02Xh)\n",
msg, status, lp->intmask, lp->lasttrans_dest);
lp->last_timeout = jiffies;
Expand Down Expand Up @@ -996,7 +1000,7 @@ irqreturn_t arcnet_interrupt(int irq, void *dev_id, struct pt_regs *regs)
* This is a generic packet receiver that calls arcnet??_rx depending on the
* protocol ID found.
*/
void arcnet_rx(struct net_device *dev, int bufnum)
static void arcnet_rx(struct net_device *dev, int bufnum)
{
struct arcnet_local *lp = dev->priv;
struct archdr pkt;
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/net/arcnet/rfc1051.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length,
int bufnum);


struct ArcProto rfc1051_proto =
static struct ArcProto rfc1051_proto =
{
.suffix = 's',
.mtu = XMTU - RFC1051_HDR_SIZE,
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/net/arcnet/rfc1201.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length,
int bufnum);
static int continue_tx(struct net_device *dev, int bufnum);

struct ArcProto rfc1201_proto =
static struct ArcProto rfc1201_proto =
{
.suffix = 'a',
.mtu = 1500, /* could be more, but some receivers can't handle it... */
Expand Down
3 changes: 2 additions & 1 deletion trunk/drivers/net/arm/etherh.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
#include <linux/device.h>
#include <linux/init.h>
#include <linux/bitops.h>
#include <linux/jiffies.h>

#include <asm/system.h>
#include <asm/ecard.h>
Expand Down Expand Up @@ -355,7 +356,7 @@ etherh_block_output (struct net_device *dev, int count, const unsigned char *buf
dma_start = jiffies;

while ((readb (addr + EN0_ISR) & ENISR_RDC) == 0)
if (jiffies - dma_start > 2*HZ/100) { /* 20ms */
if (time_after(jiffies, dma_start + 2*HZ/100)) { /* 20ms */
printk(KERN_ERR "%s: timeout waiting for TX RDC\n",
dev->name);
etherh_reset (dev);
Expand Down
5 changes: 3 additions & 2 deletions trunk/drivers/net/b44.c
Original file line number Diff line number Diff line change
Expand Up @@ -1399,7 +1399,6 @@ static int b44_open(struct net_device *dev)
b44_init_rings(bp);
b44_init_hw(bp);

netif_carrier_off(dev);
b44_check_phy(bp);

err = request_irq(dev->irq, b44_interrupt, SA_SHIRQ, dev->name, dev);
Expand Down Expand Up @@ -1464,7 +1463,7 @@ static int b44_close(struct net_device *dev)
#endif
b44_halt(bp);
b44_free_rings(bp);
netif_carrier_off(bp->dev);
netif_carrier_off(dev);

spin_unlock_irq(&bp->lock);

Expand Down Expand Up @@ -2000,6 +1999,8 @@ static int __devinit b44_init_one(struct pci_dev *pdev,
dev->irq = pdev->irq;
SET_ETHTOOL_OPS(dev, &b44_ethtool_ops);

netif_carrier_off(dev);

err = b44_get_invariants(bp);
if (err) {
printk(KERN_ERR PFX "Problem fetching invariants of chip, "
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/net/bonding/bond_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ static int bond_update_speed_duplex(struct slave *slave)
slave->duplex = DUPLEX_FULL;

if (slave_dev->ethtool_ops) {
u32 res;
int res;

if (!slave_dev->ethtool_ops->get_settings) {
return -1;
Expand Down
11 changes: 6 additions & 5 deletions trunk/drivers/net/eth16i.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ static char *version =
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
#include <linux/bitops.h>
#include <linux/jiffies.h>

#include <asm/system.h>
#include <asm/io.h>
Expand Down Expand Up @@ -754,7 +755,7 @@ static void eth16i_set_port(int ioaddr, int porttype)

static int eth16i_send_probe_packet(int ioaddr, unsigned char *b, int l)
{
int starttime;
unsigned long starttime;

outb(0xff, ioaddr + TX_STATUS_REG);

Expand All @@ -765,7 +766,7 @@ static int eth16i_send_probe_packet(int ioaddr, unsigned char *b, int l)
outb(TX_START | 1, ioaddr + TRANSMIT_START_REG);

while( (inb(ioaddr + TX_STATUS_REG) & 0x80) == 0) {
if( (jiffies - starttime) > TX_TIMEOUT) {
if( time_after(jiffies, starttime + TX_TIMEOUT)) {
return -1;
}
}
Expand All @@ -775,18 +776,18 @@ static int eth16i_send_probe_packet(int ioaddr, unsigned char *b, int l)

static int eth16i_receive_probe_packet(int ioaddr)
{
int starttime;
unsigned long starttime;

starttime = jiffies;

while((inb(ioaddr + TX_STATUS_REG) & 0x20) == 0) {
if( (jiffies - starttime) > TX_TIMEOUT) {
if( time_after(jiffies, starttime + TX_TIMEOUT)) {

if(eth16i_debug > 1)
printk(KERN_DEBUG "Timeout occurred waiting transmit packet received\n");
starttime = jiffies;
while((inb(ioaddr + RX_STATUS_REG) & 0x80) == 0) {
if( (jiffies - starttime) > TX_TIMEOUT) {
if( time_after(jiffies, starttime + TX_TIMEOUT)) {
if(eth16i_debug > 1)
printk(KERN_DEBUG "Timeout occurred waiting receive packet\n");
return -1;
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/net/hamradio/baycom_epp.c
Original file line number Diff line number Diff line change
Expand Up @@ -905,7 +905,7 @@ static int epp_open(struct net_device *dev)
/* autoprobe baud rate */
tstart = jiffies;
i = 0;
while ((signed)(jiffies-tstart-HZ/3) < 0) {
while (time_before(jiffies, tstart + HZ/3)) {
if (pp->ops->epp_read_addr(pp, &stat, 1, 0) != 1)
goto epptimeout;
if ((stat & (EPP_NRAEF|EPP_NRHF)) == EPP_NRHF) {
Expand Down
5 changes: 3 additions & 2 deletions trunk/drivers/net/hp100.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@
#include <linux/delay.h>
#include <linux/init.h>
#include <linux/bitops.h>
#include <linux/jiffies.h>

#include <asm/io.h>

Expand Down Expand Up @@ -1499,7 +1500,7 @@ static int hp100_start_xmit_bm(struct sk_buff *skb, struct net_device *dev)
printk("hp100: %s: start_xmit_bm: No TX PDL available.\n", dev->name);
#endif
/* not waited long enough since last tx? */
if (jiffies - dev->trans_start < HZ)
if (time_before(jiffies, dev->trans_start + HZ))
return -EAGAIN;

if (hp100_check_lan(dev))
Expand Down Expand Up @@ -1652,7 +1653,7 @@ static int hp100_start_xmit(struct sk_buff *skb, struct net_device *dev)
printk("hp100: %s: start_xmit: tx free mem = 0x%x\n", dev->name, i);
#endif
/* not waited long enough since last failed tx try? */
if (jiffies - dev->trans_start < HZ) {
if (time_before(jiffies, dev->trans_start + HZ)) {
#ifdef HP100_DEBUG
printk("hp100: %s: trans_start timing problem\n",
dev->name);
Expand Down
Loading

0 comments on commit 5a93379

Please sign in to comment.