Commit 06dd43c4 authored by Linus Torvalds's avatar Linus Torvalds

Merge bk://kernel.bkbits.net/jgarzik/net-drivers-2.5

into home.osdl.org:/home/torvalds/v2.5/linux
parents 293a4f60 aaca1f4f
...@@ -424,7 +424,7 @@ static int cops_open(struct net_device *dev) ...@@ -424,7 +424,7 @@ static int cops_open(struct net_device *dev)
init_timer(&cops_timer); init_timer(&cops_timer);
cops_timer.function = cops_poll; cops_timer.function = cops_poll;
cops_timer.data = (unsigned long)dev; cops_timer.data = (unsigned long)dev;
cops_timer.expires = jiffies + 5; cops_timer.expires = jiffies + HZ/20;
add_timer(&cops_timer); add_timer(&cops_timer);
} }
else else
...@@ -700,7 +700,8 @@ static void cops_poll(unsigned long ltdev) ...@@ -700,7 +700,8 @@ static void cops_poll(unsigned long ltdev)
status = inb(ioaddr+TANG_CARD_STATUS); status = inb(ioaddr+TANG_CARD_STATUS);
} while((++boguscount < 20) && (status&(TANG_RX_READY|TANG_TX_READY))); } while((++boguscount < 20) && (status&(TANG_RX_READY|TANG_TX_READY)));
cops_timer.expires = jiffies+5; /* poll 20 times per second */
cops_timer.expires = jiffies + HZ/20;
add_timer(&cops_timer); add_timer(&cops_timer);
return; return;
......
...@@ -926,8 +926,9 @@ static void ltpc_poll(unsigned long l) ...@@ -926,8 +926,9 @@ static void ltpc_poll(unsigned long l)
if (!dev) if (!dev)
return; /* we've been downed */ return; /* we've been downed */
/* poll 20 times per second */
idle(dev); idle(dev);
ltpc_timer.expires = jiffies+5; ltpc_timer.expires = jiffies + HZ/20;
add_timer(&ltpc_timer); add_timer(&ltpc_timer);
} }
...@@ -1217,7 +1218,7 @@ int __init ltpc_probe(struct net_device *dev) ...@@ -1217,7 +1218,7 @@ int __init ltpc_probe(struct net_device *dev)
ltpc_timer.function=ltpc_poll; ltpc_timer.function=ltpc_poll;
ltpc_timer.data = (unsigned long) dev; ltpc_timer.data = (unsigned long) dev;
ltpc_timer.expires = jiffies + 5; ltpc_timer.expires = jiffies + HZ/20;
add_timer(&ltpc_timer); add_timer(&ltpc_timer);
} }
......
...@@ -992,7 +992,7 @@ static void lance_set_multicast(struct net_device *dev) ...@@ -992,7 +992,7 @@ static void lance_set_multicast(struct net_device *dev)
return; return;
if (lp->tx_old != lp->tx_new) { if (lp->tx_old != lp->tx_new) {
mod_timer(&lp->multicast_timer, jiffies + 4); mod_timer(&lp->multicast_timer, jiffies + 4 * HZ/100);
netif_wake_queue(dev); netif_wake_queue(dev);
return; return;
} }
......
...@@ -1252,18 +1252,12 @@ dgrs_found_device( ...@@ -1252,18 +1252,12 @@ dgrs_found_device(
{ {
DGRS_PRIV *priv; DGRS_PRIV *priv;
struct net_device *dev, *aux; struct net_device *dev, *aux;
/* Allocate and fill new device structure. */
int dev_size = sizeof(struct net_device) + sizeof(DGRS_PRIV);
int i, ret; int i, ret;
dev = (struct net_device *) kmalloc(dev_size, GFP_KERNEL); dev = alloc_etherdev(sizeof(DGRS_PRIV));
if (!dev) if (!dev)
return -ENOMEM; return -ENOMEM;
memset(dev, 0, dev_size);
dev->priv = ((void *)dev) + sizeof(struct net_device);
priv = (DGRS_PRIV *)dev->priv; priv = (DGRS_PRIV *)dev->priv;
dev->base_addr = io; dev->base_addr = io;
...@@ -1279,7 +1273,7 @@ dgrs_found_device( ...@@ -1279,7 +1273,7 @@ dgrs_found_device(
dev->init = dgrs_probe1; dev->init = dgrs_probe1;
SET_MODULE_OWNER(dev); SET_MODULE_OWNER(dev);
ether_setup(dev);
if (register_netdev(dev) != 0) { if (register_netdev(dev) != 0) {
kfree(dev); kfree(dev);
return -EIO; return -EIO;
...@@ -1302,15 +1296,18 @@ dgrs_found_device( ...@@ -1302,15 +1296,18 @@ dgrs_found_device(
struct net_device *devN; struct net_device *devN;
DGRS_PRIV *privN; DGRS_PRIV *privN;
/* Allocate new dev and priv structures */ /* Allocate new dev and priv structures */
devN = (struct net_device *) kmalloc(dev_size, GFP_KERNEL); devN = alloc_etherdev(sizeof(DGRS_PRIV));
/* Make it an exact copy of dev[0]... */
ret = -ENOMEM; ret = -ENOMEM;
if (!devN) if (!devN)
goto fail; goto fail;
memcpy(devN, dev, dev_size);
memset(devN->name, 0, sizeof(devN->name)); /* Make it an exact copy of dev[0]... */
devN->priv = ((void *)devN) + sizeof(struct net_device); *devN = *dev;
/* copy the priv structure of dev[0] */
privN = (DGRS_PRIV *)devN->priv; privN = (DGRS_PRIV *)devN->priv;
*privN = *priv;
/* ... and zero out VM areas */ /* ... and zero out VM areas */
privN->vmem = 0; privN->vmem = 0;
privN->vplxdma = 0; privN->vplxdma = 0;
...@@ -1318,9 +1315,11 @@ dgrs_found_device( ...@@ -1318,9 +1315,11 @@ dgrs_found_device(
devN->irq = 0; devN->irq = 0;
/* ... and base MAC address off address of 1st port */ /* ... and base MAC address off address of 1st port */
devN->dev_addr[5] += i; devN->dev_addr[5] += i;
/* ... choose a new name */
strncpy(devN->name, "eth%d", IFNAMSIZ);
devN->init = dgrs_initclone; devN->init = dgrs_initclone;
SET_MODULE_OWNER(devN); SET_MODULE_OWNER(devN);
ether_setup(devN);
ret = -EIO; ret = -EIO;
if (register_netdev(devN)) { if (register_netdev(devN)) {
kfree(devN); kfree(devN);
......
...@@ -45,6 +45,13 @@ ...@@ -45,6 +45,13 @@
**********************************************************************/ **********************************************************************/
/* Change Log /* Change Log
*
* 2.3.18 07/08/03
* o Bug fix: read skb->len after freeing skb
* [Andrew Morton] akpm@zip.com.au
* o Bug fix: 82557 (with National PHY) timeout during init
* [Adam Kropelin] akropel1@rochester.rr.com
* o Feature add: allow to change Wake On LAN when EEPROM disabled
* *
* 2.3.13 05/08/03 * 2.3.13 05/08/03
* o Feature remove: /proc/net/PRO_LAN_Adapters support gone completely * o Feature remove: /proc/net/PRO_LAN_Adapters support gone completely
...@@ -65,20 +72,6 @@ ...@@ -65,20 +72,6 @@
* o Bug fix: statistic command failure would stop statistic collection. * o Bug fix: statistic command failure would stop statistic collection.
* *
* 2.2.21 02/11/03 * 2.2.21 02/11/03
* o Removed marketing brand strings. Instead, Using generic string
* "Intel(R) PRO/100 Network Connection" for all adapters.
* o Implemented ethtool -S option
* o Strip /proc/net/PRO_LAN_Adapters files for kernel driver
* o Bug fix: Read wrong byte in EEPROM when offset is odd number
* o Bug fix: PHY loopback test fails on ICH devices
* o Bug fix: System panic on e100_close when repeating Hot Remove and
* Add in a team
* o Bug fix: Linux Bonding driver claims adapter's link loss because of
* not updating last_rx field
* o Bug fix: e100 does not check validity of MAC address
* o New feature: added ICH5 support
*
* 2.1.27 11/20/02
*/ */
#include <linux/config.h> #include <linux/config.h>
...@@ -144,7 +137,7 @@ static void e100_non_tx_background(unsigned long); ...@@ -144,7 +137,7 @@ static void e100_non_tx_background(unsigned long);
static inline void e100_tx_skb_free(struct e100_private *bdp, tcb_t *tcb); static inline void e100_tx_skb_free(struct e100_private *bdp, tcb_t *tcb);
/* Global Data structures and variables */ /* Global Data structures and variables */
char e100_copyright[] __devinitdata = "Copyright (c) 2003 Intel Corporation"; char e100_copyright[] __devinitdata = "Copyright (c) 2003 Intel Corporation";
char e100_driver_version[]="2.3.13-k1"; char e100_driver_version[]="2.3.18-k1";
const char *e100_full_driver_name = "Intel(R) PRO/100 Network Driver"; const char *e100_full_driver_name = "Intel(R) PRO/100 Network Driver";
char e100_short_driver_name[] = "e100"; char e100_short_driver_name[] = "e100";
static int e100nics = 0; static int e100nics = 0;
...@@ -689,17 +682,16 @@ e100_found1(struct pci_dev *pcid, const struct pci_device_id *ent) ...@@ -689,17 +682,16 @@ e100_found1(struct pci_dev *pcid, const struct pci_device_id *ent)
bdp->wolsupported = 0; bdp->wolsupported = 0;
bdp->wolopts = 0; bdp->wolopts = 0;
if (bdp->rev_id >= D101A4_REV_ID)
bdp->wolsupported = WAKE_PHY | WAKE_MAGIC;
if (bdp->rev_id >= D101MA_REV_ID)
bdp->wolsupported |= WAKE_UCAST | WAKE_ARP;
/* Check if WoL is enabled on EEPROM */ /* Check if WoL is enabled on EEPROM */
if (e100_eeprom_read(bdp, EEPROM_ID_WORD) & BIT_5) { if (e100_eeprom_read(bdp, EEPROM_ID_WORD) & BIT_5) {
/* Magic Packet WoL is enabled on device by default */ /* Magic Packet WoL is enabled on device by default */
/* if EEPROM WoL bit is TRUE */ /* if EEPROM WoL bit is TRUE */
bdp->wolsupported = WAKE_MAGIC;
bdp->wolopts = WAKE_MAGIC; bdp->wolopts = WAKE_MAGIC;
if (bdp->rev_id >= D101A4_REV_ID)
bdp->wolsupported = WAKE_PHY | WAKE_MAGIC;
if (bdp->rev_id >= D101MA_REV_ID)
bdp->wolsupported |= WAKE_UCAST | WAKE_ARP;
} }
printk(KERN_NOTICE "\n"); printk(KERN_NOTICE "\n");
......
...@@ -919,6 +919,7 @@ e100_phy_reset(struct e100_private *bdp) ...@@ -919,6 +919,7 @@ e100_phy_reset(struct e100_private *bdp)
unsigned char __devinit unsigned char __devinit
e100_phy_init(struct e100_private *bdp) e100_phy_init(struct e100_private *bdp)
{ {
e100_phy_reset(bdp);
e100_phy_address_detect(bdp); e100_phy_address_detect(bdp);
e100_phy_isolate(bdp); e100_phy_isolate(bdp);
e100_phy_id_detect(bdp); e100_phy_id_detect(bdp);
...@@ -930,7 +931,6 @@ e100_phy_init(struct e100_private *bdp) ...@@ -930,7 +931,6 @@ e100_phy_init(struct e100_private *bdp)
bdp->PhyDelay = 0; bdp->PhyDelay = 0;
bdp->zlock_state = ZLOCK_INITIAL; bdp->zlock_state = ZLOCK_INITIAL;
e100_phy_reset(bdp);
e100_phy_set_speed_duplex(bdp, false); e100_phy_set_speed_duplex(bdp, false);
e100_fix_polarity(bdp); e100_fix_polarity(bdp);
......
...@@ -22,6 +22,8 @@ ...@@ -22,6 +22,8 @@
* Matthias (DG2FEF) Added support for FlexNet CRC (on special request) * Matthias (DG2FEF) Added support for FlexNet CRC (on special request)
* Fixed bug in ax25_close(): dev_lock_wait() was * Fixed bug in ax25_close(): dev_lock_wait() was
* called twice, causing a deadlock. * called twice, causing a deadlock.
* Jeroen (PE1RXQ) Removed old MKISS_MAGIC stuff and calls to
* MOD_*_USE_COUNT
*/ */
#include <linux/config.h> #include <linux/config.h>
...@@ -55,15 +57,6 @@ ...@@ -55,15 +57,6 @@
static char banner[] __initdata = KERN_INFO "mkiss: AX.25 Multikiss, Hans Albas PE1AYX\n"; static char banner[] __initdata = KERN_INFO "mkiss: AX.25 Multikiss, Hans Albas PE1AYX\n";
#define NR_MKISS 4
#define MKISS_SERIAL_TYPE_NORMAL 1
struct mkiss_channel {
int magic; /* magic word */
int init; /* channel exists? */
struct tty_struct *tty; /* link to tty control structure */
};
typedef struct ax25_ctrl { typedef struct ax25_ctrl {
struct ax_disp ctrl; /* */ struct ax_disp ctrl; /* */
struct net_device dev; /* the device */ struct net_device dev; /* the device */
...@@ -310,19 +303,11 @@ static inline void ax_unlock(struct ax_disp *ax) ...@@ -310,19 +303,11 @@ static inline void ax_unlock(struct ax_disp *ax)
/* Send one completely decapsulated AX.25 packet to the AX.25 layer. */ /* Send one completely decapsulated AX.25 packet to the AX.25 layer. */
static void ax_bump(struct ax_disp *ax) static void ax_bump(struct ax_disp *ax)
{ {
struct ax_disp *tmp_ax;
struct sk_buff *skb; struct sk_buff *skb;
struct mkiss_channel *mkiss;
int count; int count;
tmp_ax = ax;
if (ax->rbuff[0] > 0x0f) { if (ax->rbuff[0] > 0x0f) {
if (ax->mkiss != NULL) { if (ax->rbuff[0] & 0x20) {
mkiss= ax->mkiss->tty->driver_data;
if (mkiss->magic == MKISS_DRIVER_MAGIC)
tmp_ax = ax->mkiss;
} else if (ax->rbuff[0] & 0x20) {
ax->crcmode = CRC_MODE_FLEX; ax->crcmode = CRC_MODE_FLEX;
if (check_crc_flex(ax->rbuff, ax->rcount) < 0) { if (check_crc_flex(ax->rbuff, ax->rcount) < 0) {
ax->rx_errors++; ax->rx_errors++;
...@@ -346,14 +331,14 @@ static void ax_bump(struct ax_disp *ax) ...@@ -346,14 +331,14 @@ static void ax_bump(struct ax_disp *ax)
return; return;
} }
skb->dev = tmp_ax->dev; skb->dev = ax->dev;
memcpy(skb_put(skb,count), ax->rbuff, count); memcpy(skb_put(skb,count), ax->rbuff, count);
skb->mac.raw = skb->data; skb->mac.raw = skb->data;
skb->protocol = htons(ETH_P_AX25); skb->protocol = htons(ETH_P_AX25);
netif_rx(skb); netif_rx(skb);
tmp_ax->dev->last_rx = jiffies; ax->dev->last_rx = jiffies;
tmp_ax->rx_packets++; ax->rx_packets++;
tmp_ax->rx_bytes+=count; ax->rx_bytes+=count;
} }
/* Encapsulate one AX.25 packet and stuff into a TTY queue. */ /* Encapsulate one AX.25 packet and stuff into a TTY queue. */
...@@ -361,7 +346,6 @@ static void ax_encaps(struct ax_disp *ax, unsigned char *icp, int len) ...@@ -361,7 +346,6 @@ static void ax_encaps(struct ax_disp *ax, unsigned char *icp, int len)
{ {
unsigned char *p; unsigned char *p;
int actual, count; int actual, count;
struct mkiss_channel *mkiss = ax->tty->driver_data;
if (ax->mtu != ax->dev->mtu + 73) /* Someone has been ifconfigging */ if (ax->mtu != ax->dev->mtu + 73) /* Someone has been ifconfigging */
ax_changedmtu(ax); ax_changedmtu(ax);
...@@ -376,37 +360,26 @@ static void ax_encaps(struct ax_disp *ax, unsigned char *icp, int len) ...@@ -376,37 +360,26 @@ static void ax_encaps(struct ax_disp *ax, unsigned char *icp, int len)
p = icp; p = icp;
if (mkiss->magic != MKISS_DRIVER_MAGIC) { switch (ax->crcmode) {
switch (ax->crcmode) { unsigned short crc;
unsigned short crc;
case CRC_MODE_FLEX: case CRC_MODE_FLEX:
*p |= 0x20; *p |= 0x20;
crc = calc_crc_flex(p, len); crc = calc_crc_flex(p, len);
count = kiss_esc_crc(p, (unsigned char *)ax->xbuff, crc, len+2); count = kiss_esc_crc(p, (unsigned char *)ax->xbuff, crc, len+2);
break; break;
default: default:
count = kiss_esc(p, (unsigned char *)ax->xbuff, len); count = kiss_esc(p, (unsigned char *)ax->xbuff, len);
break; break;
}
ax->tty->flags |= (1 << TTY_DO_WRITE_WAKEUP);
actual = ax->tty->driver->write(ax->tty, 0, ax->xbuff, count);
ax->tx_packets++;
ax->tx_bytes+=actual;
ax->dev->trans_start = jiffies;
ax->xleft = count - actual;
ax->xhead = ax->xbuff + actual;
} else {
count = kiss_esc(p, (unsigned char *) ax->mkiss->xbuff, len);
ax->mkiss->tty->flags |= (1 << TTY_DO_WRITE_WAKEUP);
actual = ax->mkiss->tty->driver->write(ax->mkiss->tty, 0, ax->mkiss->xbuff, count);
ax->tx_packets++;
ax->tx_bytes+=actual;
ax->mkiss->dev->trans_start = jiffies;
ax->mkiss->xleft = count - actual;
ax->mkiss->xhead = ax->mkiss->xbuff + actual;
} }
ax->tty->flags |= (1 << TTY_DO_WRITE_WAKEUP);
actual = ax->tty->driver->write(ax->tty, 0, ax->xbuff, count);
ax->tx_packets++;
ax->tx_bytes+=actual;
ax->dev->trans_start = jiffies;
ax->xleft = count - actual;
ax->xhead = ax->xbuff + actual;
} }
/* /*
...@@ -417,7 +390,6 @@ static void ax25_write_wakeup(struct tty_struct *tty) ...@@ -417,7 +390,6 @@ static void ax25_write_wakeup(struct tty_struct *tty)
{ {
int actual; int actual;
struct ax_disp *ax = (struct ax_disp *) tty->disc_data; struct ax_disp *ax = (struct ax_disp *) tty->disc_data;
struct mkiss_channel *mkiss;
/* First make sure we're connected. */ /* First make sure we're connected. */
if (ax == NULL || ax->magic != AX25_MAGIC || !netif_running(ax->dev)) if (ax == NULL || ax->magic != AX25_MAGIC || !netif_running(ax->dev))
...@@ -428,12 +400,6 @@ static void ax25_write_wakeup(struct tty_struct *tty) ...@@ -428,12 +400,6 @@ static void ax25_write_wakeup(struct tty_struct *tty)
*/ */
tty->flags &= ~(1 << TTY_DO_WRITE_WAKEUP); tty->flags &= ~(1 << TTY_DO_WRITE_WAKEUP);
if (ax->mkiss != NULL) {
mkiss= ax->mkiss->tty->driver_data;
if (mkiss->magic == MKISS_DRIVER_MAGIC)
ax_unlock(ax->mkiss);
}
netif_wake_queue(ax->dev); netif_wake_queue(ax->dev);
return; return;
} }
...@@ -447,32 +413,12 @@ static void ax25_write_wakeup(struct tty_struct *tty) ...@@ -447,32 +413,12 @@ static void ax25_write_wakeup(struct tty_struct *tty)
static int ax_xmit(struct sk_buff *skb, struct net_device *dev) static int ax_xmit(struct sk_buff *skb, struct net_device *dev)
{ {
struct ax_disp *ax = (struct ax_disp *) dev->priv; struct ax_disp *ax = (struct ax_disp *) dev->priv;
struct mkiss_channel *mkiss = ax->tty->driver_data;
struct ax_disp *tmp_ax;
tmp_ax = NULL;
if (mkiss->magic == MKISS_DRIVER_MAGIC) {
if (skb->data[0] < 0x10)
skb->data[0] = skb->data[0] + 0x10;
tmp_ax = ax->mkiss;
}
if (!netif_running(dev)) { if (!netif_running(dev)) {
printk(KERN_ERR "mkiss: %s: xmit call when iface is down\n", dev->name); printk(KERN_ERR "mkiss: %s: xmit call when iface is down\n", dev->name);
return 1; return 1;
} }
if (tmp_ax != NULL)
if (netif_queue_stopped(tmp_ax->dev))
return 1;
if (tmp_ax != NULL)
if (netif_queue_stopped(dev)) {
printk(KERN_ERR "mkiss: dev busy while serial dev is free\n");
ax_unlock(ax);
}
if (netif_queue_stopped(dev)) { if (netif_queue_stopped(dev)) {
/* /*
* May be we must check transmitter timeout here ? * May be we must check transmitter timeout here ?
...@@ -495,8 +441,6 @@ static int ax_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -495,8 +441,6 @@ static int ax_xmit(struct sk_buff *skb, struct net_device *dev)
/* We were not busy, so we are now... :-) */ /* We were not busy, so we are now... :-) */
if (skb != NULL) { if (skb != NULL) {
ax_lock(ax); ax_lock(ax);
if (tmp_ax != NULL)
ax_lock(tmp_ax);
ax_encaps(ax, skb->data, skb->len); ax_encaps(ax, skb->data, skb->len);
kfree_skb(skb); kfree_skb(skb);
} }
...@@ -634,9 +578,7 @@ static void ax25_receive_buf(struct tty_struct *tty, const unsigned char *cp, ch ...@@ -634,9 +578,7 @@ static void ax25_receive_buf(struct tty_struct *tty, const unsigned char *cp, ch
static int ax25_open(struct tty_struct *tty) static int ax25_open(struct tty_struct *tty)
{ {
struct ax_disp *ax = (struct ax_disp *) tty->disc_data; struct ax_disp *ax = (struct ax_disp *) tty->disc_data;
struct ax_disp *tmp_ax; int err;
struct mkiss_channel *mkiss;
int err, cnt;
/* First make sure we're not already connected. */ /* First make sure we're not already connected. */
if (ax && ax->magic == AX25_MAGIC) if (ax && ax->magic == AX25_MAGIC)
...@@ -649,9 +591,6 @@ static int ax25_open(struct tty_struct *tty) ...@@ -649,9 +591,6 @@ static int ax25_open(struct tty_struct *tty)
ax->tty = tty; ax->tty = tty;
tty->disc_data = ax; tty->disc_data = ax;
ax->mkiss = NULL;
tmp_ax = NULL;
if (tty->driver->flush_buffer) if (tty->driver->flush_buffer)
tty->driver->flush_buffer(tty); tty->driver->flush_buffer(tty);
if (tty->ldisc.flush_buffer) if (tty->ldisc.flush_buffer)
...@@ -664,29 +603,6 @@ static int ax25_open(struct tty_struct *tty) ...@@ -664,29 +603,6 @@ static int ax25_open(struct tty_struct *tty)
if ((err = ax_open(ax->dev))) if ((err = ax_open(ax->dev)))
return err; return err;
mkiss = ax->tty->driver_data;
if (mkiss->magic == MKISS_DRIVER_MAGIC) {
for (cnt = 1; cnt < ax25_maxdev; cnt++) {
if (ax25_ctrls[cnt]) {
if (netif_running(&ax25_ctrls[cnt]->dev)) {
if (ax == &ax25_ctrls[cnt]->ctrl) {
cnt--;
tmp_ax = &ax25_ctrls[cnt]->ctrl;
break;
}
}
}
}
}
if (tmp_ax != NULL) {
ax->mkiss = tmp_ax;
tmp_ax->mkiss = ax;
}
MOD_INC_USE_COUNT;
/* Done. We have linked the TTY line to a channel. */ /* Done. We have linked the TTY line to a channel. */
return ax->dev->base_addr; return ax->dev->base_addr;
} }
...@@ -705,7 +621,6 @@ static void ax25_close(struct tty_struct *tty) ...@@ -705,7 +621,6 @@ static void ax25_close(struct tty_struct *tty)
ax->tty = NULL; ax->tty = NULL;
ax_free(ax); ax_free(ax);
MOD_DEC_USE_COUNT;
} }
......
...@@ -19,7 +19,6 @@ struct ax_disp { ...@@ -19,7 +19,6 @@ struct ax_disp {
/* Various fields. */ /* Various fields. */
struct tty_struct *tty; /* ptr to TTY structure */ struct tty_struct *tty; /* ptr to TTY structure */
struct net_device *dev; /* easy for intr handling */ struct net_device *dev; /* easy for intr handling */
struct ax_disp *mkiss; /* mkiss txport if mkiss channel*/
/* These are pointers to the malloc()ed frame buffers. */ /* These are pointers to the malloc()ed frame buffers. */
unsigned char *rbuff; /* receiver buffer */ unsigned char *rbuff; /* receiver buffer */
...@@ -60,4 +59,3 @@ struct ax_disp { ...@@ -60,4 +59,3 @@ struct ax_disp {
}; };
#define AX25_MAGIC 0x5316 #define AX25_MAGIC 0x5316
#define MKISS_DRIVER_MAGIC 1215
...@@ -1048,7 +1048,7 @@ static void media_check(unsigned long arg) ...@@ -1048,7 +1048,7 @@ static void media_check(unsigned long arg)
} }
if (lp->fast_poll) { if (lp->fast_poll) {
lp->fast_poll--; lp->fast_poll--;
lp->media.expires = jiffies + 2; lp->media.expires = jiffies + 2*HZ/100;
add_timer(&lp->media); add_timer(&lp->media);
return; return;
} }
......
...@@ -921,7 +921,7 @@ static void media_check(unsigned long arg) ...@@ -921,7 +921,7 @@ static void media_check(unsigned long arg)
} }
if (lp->fast_poll) { if (lp->fast_poll) {
lp->fast_poll--; lp->fast_poll--;
lp->media.expires = jiffies + 1; lp->media.expires = jiffies + HZ/100;
add_timer(&lp->media); add_timer(&lp->media);
return; return;
} }
......
...@@ -1996,7 +1996,7 @@ static void media_check(u_long arg) ...@@ -1996,7 +1996,7 @@ static void media_check(u_long arg)
} }
if (smc->fast_poll) { if (smc->fast_poll) {
smc->fast_poll--; smc->fast_poll--;
smc->media.expires = jiffies + 1; smc->media.expires = jiffies + HZ/100;
add_timer(&smc->media); add_timer(&smc->media);
SMC_SELECT_BANK(saved_bank); SMC_SELECT_BANK(saved_bank);
return; return;
......
...@@ -277,27 +277,10 @@ inline static unsigned char read_status (struct net_device *dev) ...@@ -277,27 +277,10 @@ inline static unsigned char read_status (struct net_device *dev)
then calls us here. then calls us here.
*/ */
int __init static int
plip_init_dev(struct net_device *dev, struct parport *pb) plip_init_netdev(struct net_device *dev)
{ {
struct net_local *nl; struct net_local *nl = dev->priv;
struct pardevice *pardev;
SET_MODULE_OWNER(dev);
dev->irq = pb->irq;
dev->base_addr = pb->base;
if (pb->irq == -1) {
printk(KERN_INFO "plip: %s has no IRQ. Using IRQ-less mode,"
"which is fairly inefficient!\n", pb->name);
}
pardev = parport_register_device(pb, dev->name, plip_preempt,
plip_wakeup, plip_interrupt,
0, dev);
if (!pardev)
return -ENODEV;
printk(KERN_INFO "%s", version); printk(KERN_INFO "%s", version);
if (dev->irq != -1) if (dev->irq != -1)
...@@ -307,9 +290,6 @@ plip_init_dev(struct net_device *dev, struct parport *pb) ...@@ -307,9 +290,6 @@ plip_init_dev(struct net_device *dev, struct parport *pb)
printk(KERN_INFO "%s: Parallel port at %#3lx, not using IRQ.\n", printk(KERN_INFO "%s: Parallel port at %#3lx, not using IRQ.\n",
dev->name, dev->base_addr); dev->name, dev->base_addr);
/* Fill in the generic fields of the device structure. */
ether_setup(dev);
/* Then, override parts of it */ /* Then, override parts of it */
dev->hard_start_xmit = plip_tx_packet; dev->hard_start_xmit = plip_tx_packet;
dev->open = plip_open; dev->open = plip_open;
...@@ -322,22 +302,12 @@ plip_init_dev(struct net_device *dev, struct parport *pb) ...@@ -322,22 +302,12 @@ plip_init_dev(struct net_device *dev, struct parport *pb)
memset(dev->dev_addr, 0xfc, ETH_ALEN); memset(dev->dev_addr, 0xfc, ETH_ALEN);
/* Set the private structure */ /* Set the private structure */
dev->priv = kmalloc(sizeof (struct net_local), GFP_KERNEL);
if (dev->priv == NULL) {
printk(KERN_ERR "%s: out of memory\n", dev->name);
parport_unregister_device(pardev);
return -ENOMEM;
}
memset(dev->priv, 0, sizeof(struct net_local));
nl = (struct net_local *) dev->priv;
nl->orig_hard_header = dev->hard_header; nl->orig_hard_header = dev->hard_header;
dev->hard_header = plip_hard_header; dev->hard_header = plip_hard_header;
nl->orig_hard_header_cache = dev->hard_header_cache; nl->orig_hard_header_cache = dev->hard_header_cache;
dev->hard_header_cache = plip_hard_header_cache; dev->hard_header_cache = plip_hard_header_cache;
nl->pardev = pardev;
nl->port_owner = 0; nl->port_owner = 0;
...@@ -1299,29 +1269,52 @@ plip_searchfor(int list[], int a) ...@@ -1299,29 +1269,52 @@ plip_searchfor(int list[], int a)
* available to use. */ * available to use. */
static void plip_attach (struct parport *port) static void plip_attach (struct parport *port)
{ {
static int i; static int unit;
struct net_device *dev;
struct net_local *nl;
char name[IFNAMSIZ];
if ((parport[0] == -1 && (!timid || !port->devices)) || if ((parport[0] == -1 && (!timid || !port->devices)) ||
plip_searchfor(parport, port->number)) { plip_searchfor(parport, port->number)) {
if (i == PLIP_MAX) { if (unit == PLIP_MAX) {
printk(KERN_ERR "plip: too many devices\n"); printk(KERN_ERR "plip: too many devices\n");
return; return;
} }
dev_plip[i] = kmalloc(sizeof(struct net_device),
GFP_KERNEL); sprintf(name, "plip%d", unit);
if (!dev_plip[i]) { dev = alloc_netdev(sizeof(struct net_local), name,
ether_setup);
if (!dev) {
printk(KERN_ERR "plip: memory squeeze\n"); printk(KERN_ERR "plip: memory squeeze\n");
return; return;
} }
memset(dev_plip[i], 0, sizeof(struct net_device));
sprintf(dev_plip[i]->name, "plip%d", i); dev->init = plip_init_netdev;
dev_plip[i]->priv = port;
if (plip_init_dev(dev_plip[i],port) || SET_MODULE_OWNER(dev);
register_netdev(dev_plip[i])) { dev->irq = port->irq;
kfree(dev_plip[i]); dev->base_addr = port->base;
dev_plip[i] = NULL; if (port->irq == -1) {
printk(KERN_INFO "plip: %s has no IRQ. Using IRQ-less mode,"
"which is fairly inefficient!\n", port->name);
}
nl = dev->priv;
nl->pardev = parport_register_device(port, name, plip_preempt,
plip_wakeup, plip_interrupt,
0, dev);
if (!nl->pardev) {
printk(KERN_ERR "%s: parport_register failed\n", name);
kfree(dev);
return;
}
if (register_netdev(dev)) {
printk(KERN_ERR "%s: network register failed\n", name);
kfree(dev);
} else { } else {
i++; dev_plip[unit++] = dev;
} }
} }
} }
...@@ -1341,20 +1334,19 @@ static struct parport_driver plip_driver = { ...@@ -1341,20 +1334,19 @@ static struct parport_driver plip_driver = {
static void __exit plip_cleanup_module (void) static void __exit plip_cleanup_module (void)
{ {
struct net_device *dev;
int i; int i;
parport_unregister_driver (&plip_driver); parport_unregister_driver (&plip_driver);
for (i=0; i < PLIP_MAX; i++) { for (i=0; i < PLIP_MAX; i++) {
if (dev_plip[i]) { if ((dev = dev_plip[i])) {
struct net_local *nl = struct net_local *nl = dev->priv;
(struct net_local *)dev_plip[i]->priv; unregister_netdev(dev);
unregister_netdev(dev_plip[i]);
if (nl->port_owner) if (nl->port_owner)
parport_release(nl->pardev); parport_release(nl->pardev);
parport_unregister_device(nl->pardev); parport_unregister_device(nl->pardev);
kfree(dev_plip[i]->priv); kfree(dev);
kfree(dev_plip[i]);
dev_plip[i] = NULL; dev_plip[i] = NULL;
} }
} }
......
...@@ -2493,7 +2493,7 @@ static int sbmac_open(struct net_device *dev) ...@@ -2493,7 +2493,7 @@ static int sbmac_open(struct net_device *dev)
/* Set the timer to check for link beat. */ /* Set the timer to check for link beat. */
init_timer(&sc->sbm_timer); init_timer(&sc->sbm_timer);
sc->sbm_timer.expires = jiffies + 2; sc->sbm_timer.expires = jiffies + 2 * HZ/100;
sc->sbm_timer.data = (unsigned long)dev; sc->sbm_timer.data = (unsigned long)dev;
sc->sbm_timer.function = &sbmac_timer; sc->sbm_timer.function = &sbmac_timer;
add_timer(&sc->sbm_timer); add_timer(&sc->sbm_timer);
......
...@@ -537,7 +537,7 @@ static int __init ProbeIRQ(struct SKMCA_NETDEV *dev) ...@@ -537,7 +537,7 @@ static int __init ProbeIRQ(struct SKMCA_NETDEV *dev)
ResetBoard(dev); ResetBoard(dev);
InitBoard(dev); InitBoard(dev);
njiffies = jiffies + 100; njiffies = jiffies + HZ;
do { do {
csr0val = GetLANCE(dev, LANCE_CSR0); csr0val = GetLANCE(dev, LANCE_CSR0);
} }
......
...@@ -87,11 +87,15 @@ ...@@ -87,11 +87,15 @@
Version LK1.09 (D-Link): Version LK1.09 (D-Link):
- Fix the flowctrl bug. - Fix the flowctrl bug.
- Set Pause bit in MII ANAR if flow control enabled. - Set Pause bit in MII ANAR if flow control enabled.
Version LK1.09a (ICPlus):
- Add the delay time in reading the contents of EEPROM
*/ */
#define DRV_NAME "sundance" #define DRV_NAME "sundance"
#define DRV_VERSION "1.01+LK1.09a" #define DRV_VERSION "1.01+LK1.09a"
#define DRV_RELDATE "16-May-2003" #define DRV_RELDATE "10-Jul-2003"
/* The user-configurable values. /* The user-configurable values.
...@@ -744,12 +748,14 @@ static int change_mtu(struct net_device *dev, int new_mtu) ...@@ -744,12 +748,14 @@ static int change_mtu(struct net_device *dev, int new_mtu)
return 0; return 0;
} }
#define eeprom_delay(ee_addr) readl(ee_addr)
/* Read the EEPROM and MII Management Data I/O (MDIO) interfaces. */ /* Read the EEPROM and MII Management Data I/O (MDIO) interfaces. */
static int __devinit eeprom_read(long ioaddr, int location) static int __devinit eeprom_read(long ioaddr, int location)
{ {
int boguscnt = 1000; /* Typical 190 ticks. */ int boguscnt = 10000; /* Typical 1900 ticks. */
writew(0x0200 | (location & 0xff), ioaddr + EECtrl); writew(0x0200 | (location & 0xff), ioaddr + EECtrl);
do { do {
eeprom_delay(ioaddr + EECtrl);
if (! (readw(ioaddr + EECtrl) & 0x8000)) { if (! (readw(ioaddr + EECtrl) & 0x8000)) {
return readw(ioaddr + EEData); return readw(ioaddr + EEData);
} }
......
...@@ -6679,10 +6679,9 @@ static int __devinit tg3_init_one(struct pci_dev *pdev, ...@@ -6679,10 +6679,9 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
} }
/* Configure DMA attributes. */ /* Configure DMA attributes. */
if (!pci_set_dma_mask(pdev, (u64) 0xffffffffffffffffULL)) { if (!pci_set_dma_mask(pdev, 0xffffffffffffffffULL)) {
pci_using_dac = 1; pci_using_dac = 1;
if (pci_set_consistent_dma_mask(pdev, if (pci_set_consistent_dma_mask(pdev, 0xffffffffffffffffULL)) {
(u64) 0xffffffffffffffff)) {
printk(KERN_ERR PFX "Unable to obtain 64 bit DMA " printk(KERN_ERR PFX "Unable to obtain 64 bit DMA "
"for consistent allocations\n"); "for consistent allocations\n");
goto err_out_free_res; goto err_out_free_res;
......
...@@ -464,7 +464,7 @@ static int xl_hw_reset(struct net_device *dev) ...@@ -464,7 +464,7 @@ static int xl_hw_reset(struct net_device *dev)
printk(KERN_INFO "3C359: Uploading Microcode: "); printk(KERN_INFO "3C359: Uploading Microcode: ");
for (i = start,j=0; (j < mc_size && i <= 0xffff) ; i++,j++) { for (i = start, j = 0; j < mc_size; i++, j++) {
writel(MEM_BYTE_WRITE | 0XD0000 | i, xl_mmio + MMIO_MAC_ACCESS_CMD) ; writel(MEM_BYTE_WRITE | 0XD0000 | i, xl_mmio + MMIO_MAC_ACCESS_CMD) ;
writeb(microcode[j],xl_mmio + MMIO_MACDATA) ; writeb(microcode[j],xl_mmio + MMIO_MACDATA) ;
if (j % 1024 == 0) if (j % 1024 == 0)
......
...@@ -401,7 +401,6 @@ static int __init setup_card(unsigned long io, unsigned irq, unsigned char dma) ...@@ -401,7 +401,6 @@ static int __init setup_card(unsigned long io, unsigned irq, unsigned char dma)
int init_module(void) int init_module(void)
{ {
int i, num; int i, num;
struct net_device *dev;
num = 0; num = 0;
if (io[0]) { /* Only probe addresses from command line */ if (io[0]) { /* Only probe addresses from command line */
......
...@@ -414,7 +414,6 @@ static int __init setup_card(unsigned long io, unsigned irq, unsigned char dma) ...@@ -414,7 +414,6 @@ static int __init setup_card(unsigned long io, unsigned irq, unsigned char dma)
int init_module(void) int init_module(void)
{ {
int i, num; int i, num;
struct net_device *dev;
num = 0; num = 0;
if (io[0]) { /* Only probe addresses from command line */ if (io[0]) { /* Only probe addresses from command line */
......
...@@ -1152,7 +1152,7 @@ static int via_rhine_open(struct net_device *dev) ...@@ -1152,7 +1152,7 @@ static int via_rhine_open(struct net_device *dev)
/* Set the timer to check for link beat. */ /* Set the timer to check for link beat. */
init_timer(&np->timer); init_timer(&np->timer);
np->timer.expires = jiffies + 2; np->timer.expires = jiffies + 2 * HZ/100;
np->timer.data = (unsigned long)dev; np->timer.data = (unsigned long)dev;
np->timer.function = &via_rhine_timer; /* timer handler */ np->timer.function = &via_rhine_timer; /* timer handler */
add_timer(&np->timer); add_timer(&np->timer);
......
...@@ -391,7 +391,7 @@ static void atmel_config(dev_link_t *link) ...@@ -391,7 +391,7 @@ static void atmel_config(dev_link_t *link)
local_info_t *dev; local_info_t *dev;
int last_fn, last_ret; int last_fn, last_ret;
u_char buf[64]; u_char buf[64];
int card_index = -1; int card_index = -1, done = 0;
handle = link->handle; handle = link->handle;
dev = link->priv; dev = link->priv;
...@@ -415,13 +415,13 @@ static void atmel_config(dev_link_t *link) ...@@ -415,13 +415,13 @@ static void atmel_config(dev_link_t *link)
manfid->manf == card_table[i].manf && manfid->manf == card_table[i].manf &&
manfid->card == card_table[i].card) { manfid->card == card_table[i].card) {
card_index = i; card_index = i;
goto done; done = 1;
} }
} }
} }
tuple.DesiredTuple = CISTPL_VERS_1; tuple.DesiredTuple = CISTPL_VERS_1;
if (CardServices(GetFirstTuple, handle, &tuple) == 0) { if (!done && (CardServices(GetFirstTuple, handle, &tuple) == 0)) {
int i, j, k; int i, j, k;
cistpl_vers_1_t *ver1; cistpl_vers_1_t *ver1;
CS_CHECK(GetTupleData, handle, &tuple); CS_CHECK(GetTupleData, handle, &tuple);
...@@ -446,12 +446,11 @@ static void atmel_config(dev_link_t *link) ...@@ -446,12 +446,11 @@ static void atmel_config(dev_link_t *link)
goto mismatch; goto mismatch;
} }
card_index = i; card_index = i;
goto done; break; /* done */
mismatch: mismatch:
j = 0; /* dummy stmt to shut up compiler */
} }
done:
} }
/* /*
......
...@@ -3730,8 +3730,8 @@ static int wv_check_ioaddr(unsigned long ioaddr, u8 * mac) ...@@ -3730,8 +3730,8 @@ static int wv_check_ioaddr(unsigned long ioaddr, u8 * mac)
int i; /* Loop counter */ int i; /* Loop counter */
/* Check if the base address if available. */ /* Check if the base address if available. */
if (check_region(ioaddr, sizeof(ha_t))) if (!request_region(ioaddr, sizeof(ha_t), "wavelan probe"))
return -EADDRINUSE; /* ioaddr already used */ return -EBUSY; /* ioaddr already used */
/* Reset host interface */ /* Reset host interface */
wv_hacr_reset(ioaddr); wv_hacr_reset(ioaddr);
...@@ -3740,6 +3740,8 @@ static int wv_check_ioaddr(unsigned long ioaddr, u8 * mac) ...@@ -3740,6 +3740,8 @@ static int wv_check_ioaddr(unsigned long ioaddr, u8 * mac)
psa_read(ioaddr, HACR_DEFAULT, psaoff(0, psa_univ_mac_addr), psa_read(ioaddr, HACR_DEFAULT, psaoff(0, psa_univ_mac_addr),
mac, 6); mac, 6);
release_region(ioaddr, sizeof(ha_t));
/* /*
* Check the first three octets of the address for the manufacturer's code. * Check the first three octets of the address for the manufacturer's code.
* Note: if this can't find your WaveLAN card, you've got a * Note: if this can't find your WaveLAN card, you've got a
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment