[PATCH 2.5.72] Red Creek VPN update

STALE8441d

2 messages, 2 authors, 2003-09-05 · open the first message on its own page

[PATCH 2.5.72] Red Creek VPN update

From: Stephen Hemminger <hidden>
Date: 2003-06-17 23:31:16

Some cleanup's to Red Creek VPN driver.  
	- use alloc_etherdev instead of init_etherdev
	- don't decrement module ref count negative in case of error.

Don't have the hardware to actually test the real thing. But the driver builds
and loads fine.


diff -Nru a/drivers/net/rcpci45.c b/drivers/net/rcpci45.c
--- a/drivers/net/rcpci45.c	Tue Jun 17 15:25:17 2003
+++ b/drivers/net/rcpci45.c	Tue Jun 17 15:25:17 2003
@@ -171,13 +171,14 @@
 	 * will be assigned to the LAN API layer.
 	 */
 
-	dev = init_etherdev (NULL, sizeof (*pDpa));
+	dev = alloc_etherdev(sizeof(*pDpa));
 	if (!dev) {
 		printk (KERN_ERR
-			"(rcpci45 driver:) init_etherdev alloc failed\n");
+			"(rcpci45 driver:) alloc_etherdev alloc failed\n");
 		error = -ENOMEM;
 		goto err_out;
 	}
+
 	SET_MODULE_OWNER(dev);
 	SET_NETDEV_DEV(dev, &pdev->dev);
 
@@ -257,6 +258,9 @@
 	dev->do_ioctl = &RCioctl;
 	dev->set_config = &RCconfig;
 
+	if ((error = register_netdev(dev)))
+		goto err_out_free_region;
+
 	return 0;		/* success */
 
 err_out_free_region:
@@ -265,7 +269,6 @@
 	pci_free_consistent (pdev, MSG_BUF_SIZE, pDpa->msgbuf,
 			     pDpa->msgbuf_dma);
 err_out_free_dev:
-	unregister_netdev (dev);
 	kfree (dev);
 err_out:
 	card_idx--;
@@ -717,11 +720,9 @@
 
 		if (retry > REBOOT_REINIT_RETRY_LIMIT) {
 			printk (KERN_WARNING "%s unable to reinitialize adapter after reboot\n", dev->name);
-			printk (KERN_WARNING "%s decrementing driver and closing interface\n", dev->name);
+			printk (KERN_WARNING "%s shutting down interface\n", dev->name);
 			RCDisableI2OInterrupts (dev);
 			dev->flags &= ~IFF_UP;
-			MOD_DEC_USE_COUNT;
-			/* FIXME: kill MOD_DEC_USE_COUNT, use dev_put */
 		} else {
 			printk (KERN_INFO "%s: rescheduling timer...\n",
 					dev->name);

Re: [PATCH 2.5.72] Red Creek VPN update

From: Matthew G. Marsh <hidden>
Date: 2003-09-05 14:08:58

On Tue, 17 Jun 2003, Stephen Hemminger wrote:
Some cleanup's to Red Creek VPN driver.
	- use alloc_etherdev instead of init_etherdev
	- don't decrement module ref count negative in case of error.

Don't have the hardware to actually test the real thing. But the driver builds
and loads fine.
Hi - sorry for the late response - I have 57 of these in production. I am
now trying to get together a 2.6test machine and this is one of the first
parts I will test.

How would you like bug reports? I will try to gen patches where possible
but I don't have bk.

Thank you for your work on this!

--------------------------------------------------
Matthew G. Marsh,  President
Paktronix Systems LLC
1506 North 59th Street
Omaha  NE  68104
Phone: (402) 553-2288
Email: mgm@paktronix.com
WWW:  http://www.paktronix.com
--------------------------------------------------
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help