patch-2.3.45 linux/drivers/net/hamradio/yam.c
Next file: linux/drivers/net/hydra.c
Previous file: linux/drivers/net/hamradio/scc.c
Back to the patch index
Back to the overall index
- Lines: 93
- Date:
Sun Feb 13 18:20:21 2000
- Orig file:
v2.3.44/linux/drivers/net/hamradio/yam.c
- Orig date:
Tue Nov 23 22:42:20 1999
diff -u --recursive --new-file v2.3.44/linux/drivers/net/hamradio/yam.c linux/drivers/net/hamradio/yam.c
@@ -649,7 +649,7 @@
for (i = 0; i < NR_PORTS; i++) {
struct net_device *dev = &yam_ports[i].dev;
- if (dev->start)
+ if (test_bit(LINK_STATE_START, &dev->state))
yam_arbitrate(dev);
}
yam_timer.expires = jiffies + HZ / 100;
@@ -748,7 +748,7 @@
yp = &yam_ports[i];
dev = &yp->dev;
- if (!dev->start)
+ if (!test_bit(LINK_STATE_START, &dev->state))
continue;
while ((iir = IIR_MASK & inb(IIR(dev->base_addr))) != IIR_NOPEND) {
@@ -794,7 +794,7 @@
if (yam_ports[i].iobase == 0 || yam_ports[i].irq == 0)
continue;
len += sprintf(buffer + len, "Device %s\n", yam_ports[i].name);
- len += sprintf(buffer + len, " Up %d\n", yam_ports[i].dev.start);
+ len += sprintf(buffer + len, " Up %d\n", test_bit(LINK_STATE_START, &yam_ports[i].dev.state));
len += sprintf(buffer + len, " Speed %u\n", yam_ports[i].bitrate);
len += sprintf(buffer + len, " IoBase 0x%x\n", yam_ports[i].iobase);
len += sprintf(buffer + len, " BaudRate %u\n", yam_ports[i].baudrate);
@@ -903,7 +903,9 @@
request_region(dev->base_addr, YAM_EXTENT, dev->name);
yam_set_uart(dev);
- dev->start = 1;
+
+ netif_start_queue(dev);
+
yp->slotcnt = yp->slot / 10;
/* Reset overruns for all ports - FPGA programming makes overruns */
@@ -935,8 +937,7 @@
/* Remove IRQ handler if last */
free_irq(dev->irq, NULL);
release_region(dev->base_addr, YAM_EXTENT);
- dev->start = 0;
- dev->tbusy = 1;
+ netif_stop_queue(dev);
while ((skb = skb_dequeue(&yp->send_queue)))
dev_kfree_skb(skb);
@@ -973,7 +974,7 @@
return -EINVAL; /* unused */
case SIOCYAMSMCS:
- if (dev->start)
+ if (test_bit(LINK_STATE_START, &dev->state))
return -EINVAL; /* Cannot change this parameter when up */
ym = kmalloc(sizeof(struct yamdrv_ioctl_mcs), GFP_ATOMIC);
ym->bitrate = 9600;
@@ -989,13 +990,13 @@
if (copy_from_user(&yi, ifr->ifr_data, sizeof(struct yamdrv_ioctl_cfg)))
return -EFAULT;
- if ((yi.cfg.mask & YAM_IOBASE) && dev->start)
+ if ((yi.cfg.mask & YAM_IOBASE) && test_bit(LINK_STATE_START, &dev->state))
return -EINVAL; /* Cannot change this parameter when up */
- if ((yi.cfg.mask & YAM_IRQ) && dev->start)
+ if ((yi.cfg.mask & YAM_IRQ) && test_bit(LINK_STATE_START, &dev->state))
return -EINVAL; /* Cannot change this parameter when up */
- if ((yi.cfg.mask & YAM_BITRATE) && dev->start)
+ if ((yi.cfg.mask & YAM_BITRATE) && test_bit(LINK_STATE_START, &dev->state))
return -EINVAL; /* Cannot change this parameter when up */
- if ((yi.cfg.mask & YAM_BAUDRATE) && dev->start)
+ if ((yi.cfg.mask & YAM_BAUDRATE) && test_bit(LINK_STATE_START, &dev->state))
return -EINVAL; /* Cannot change this parameter when up */
if (yi.cfg.mask & YAM_IOBASE) {
@@ -1164,8 +1165,6 @@
dev->irq = yam_ports[i].irq;
dev->init = yam_probe;
dev->if_port = 0;
- dev->start = 0;
- dev->tbusy = 1;
if (register_netdev(dev)) {
printk(KERN_WARNING "yam: cannot register net device %s\n", dev->name);
@@ -1211,7 +1210,7 @@
struct net_device *dev = &yam_ports[i].dev;
if (!dev->priv)
continue;
- if (dev->start)
+ if (test_bit(LINK_STATE_START, &dev->state))
yam_close(dev);
unregister_netdev(dev);
}
FUNET's LINUX-ADM group, [email protected]
TCL-scripts by Sam Shen (who was at: [email protected])