Update of /cvsroot/linux-vax/kernel-2.4/drivers/net/appletalk
In directory usw-pr-cvs1:/tmp/cvs-serv30336/net/appletalk
Modified Files:
Config.in cops.c cops.h cops_ffdrv.h cops_ltdrv.h ipddp.c
ltpc.c
Log Message:
synch 2.4.15 commit 50
Index: Config.in
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/appletalk/Config.in,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- Config.in 14 Jan 2001 17:47:17 -0000 1.1.1.1
+++ Config.in 11 Apr 2002 12:37:47 -0000 1.2
@@ -6,14 +6,14 @@
mainmenu_option next_comment
comment 'Appletalk devices'
bool 'Appletalk interfaces support' CONFIG_APPLETALK
- if [ "$CONFIG_APPLETALK" != "n" ]; then
- dep_tristate ' Apple/Farallon LocalTalk PC support' CONFIG_LTPC $CONFIG_APPLETALK
- dep_tristate ' COPS LocalTalk PC support' CONFIG_COPS $CONFIG_APPLETALK
+ if [ "$CONFIG_ATALK" != "n" ]; then
+ dep_tristate ' Apple/Farallon LocalTalk PC support' CONFIG_LTPC $CONFIG_DEV_APPLETALK
+ dep_tristate ' COPS LocalTalk PC support' CONFIG_COPS $CONFIG_DEV_APPLETALK
if [ "$CONFIG_COPS" != "n" ]; then
bool ' Dayna firmware support' CONFIG_COPS_DAYNA
bool ' Tangent firmware support' CONFIG_COPS_TANGENT
fi
- dep_tristate ' Appletalk-IP driver support' CONFIG_IPDDP $CONFIG_APPLETALK
+ dep_tristate ' Appletalk-IP driver support' CONFIG_IPDDP $CONFIG_DEV_APPLETALK
if [ "$CONFIG_IPDDP" != "n" ]; then
bool ' IP to Appletalk-IP Encapsulation support' CONFIG_IPDDP_ENCAP
bool ' Appletalk-IP to IP Decapsulation support' CONFIG_IPDDP_DECAP
Index: cops.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/appletalk/cops.c,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
--- cops.c 25 Feb 2001 23:15:01 -0000 1.1.1.2
+++ cops.c 11 Apr 2002 12:37:47 -0000 1.2
@@ -1,7 +1,7 @@
/* cops.c: LocalTalk driver for Linux.
*
* Authors:
- * - Jay Schulist <js...@tu...>
+ * - Jay Schulist <js...@sa...>
*
* With more than a little help from;
* - Alan Cox <Ala...@li...>
@@ -34,7 +34,7 @@
*/
static const char *version =
-"cops.c:v0.04 6/7/98 Jay Schulist <js...@tu...>\n";
+"cops.c:v0.04 6/7/98 Jay Schulist <js...@sa...>\n";
/*
* Sources:
* COPS Localtalk SDK. This provides almost all of the information
@@ -98,7 +98,7 @@
static int io = 0x240; /* Default IO for Dayna */
static int irq = 5; /* Default IRQ */
#else
-static int io = 0; /* Default IO for Dayna */
+static int io; /* Default IO for Dayna */
#endif
/*
@@ -181,7 +181,7 @@
int board; /* Holds what board type is. */
int nodeid; /* Set to 1 once have nodeid. */
unsigned char node_acquire; /* Node ID when acquired. */
- struct at_addr node_addr; /* Full node addres */
+ struct at_addr node_addr; /* Full node address */
};
/* Index to functions, as function prototypes. */
@@ -752,8 +752,8 @@
{
int pkt_len = 0;
int rsp_type = 0;
- struct sk_buff *skb;
- struct cops_local *lp = (struct cops_local *)dev->priv;
+ struct sk_buff *skb = NULL;
+ struct cops_local *lp = dev->priv;
int ioaddr = dev->base_addr;
int boguscount = 0;
unsigned long flags;
@@ -771,6 +771,7 @@
/* Wait for DMA to turn around. */
while(++boguscount<1000000)
{
+ barrier();
if((inb(ioaddr+DAYNA_CARD_STATUS)&0x03)==DAYNA_RX_READY)
break;
}
@@ -801,6 +802,7 @@
lp->stats.rx_dropped++;
while(pkt_len--) /* Discard packet */
inb(ioaddr);
+ restore_flags(flags);
return;
}
skb->dev = dev;
@@ -820,7 +822,7 @@
printk(KERN_WARNING "%s: Bad packet length of %d bytes.\n",
dev->name, pkt_len);
lp->stats.tx_errors++;
- kfree_skb(skb);
+ dev_kfree_skb_any(skb);
return;
}
@@ -828,7 +830,7 @@
if(rsp_type == LAP_INIT_RSP)
{ /* Nodeid taken from received packet. */
lp->node_acquire = skb->data[0];
- kfree_skb(skb);
+ dev_kfree_skb_any(skb);
return;
}
@@ -837,7 +839,7 @@
{
printk(KERN_WARNING "%s: Bad packet type %d.\n", dev->name, rsp_type);
lp->stats.tx_errors++;
- kfree_skb(skb);
+ dev_kfree_skb_any(skb);
return;
}
@@ -1011,6 +1013,8 @@
#ifdef MODULE
static struct net_device cops0_dev = { init: cops_probe };
+
+MODULE_LICENSE("GPL");
MODULE_PARM(io, "i");
MODULE_PARM(irq, "i");
MODULE_PARM(board_type, "i");
Index: cops.h
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/appletalk/cops.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- cops.h 14 Jan 2001 17:47:21 -0000 1.1.1.1
+++ cops.h 11 Apr 2002 12:37:47 -0000 1.2
@@ -1,7 +1,7 @@
/* cops.h: LocalTalk driver for Linux.
*
* Authors:
- * - Jay Schulist <js...@tu...>
+ * - Jay Schulist <js...@sa...>
*/
#ifndef __LINUX_COPSLTALK_H
Index: cops_ffdrv.h
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/appletalk/cops_ffdrv.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- cops_ffdrv.h 14 Jan 2001 17:47:24 -0000 1.1.1.1
+++ cops_ffdrv.h 11 Apr 2002 12:37:47 -0000 1.2
@@ -21,7 +21,7 @@
/* cops_ffdrv.h: LocalTalk driver firmware dump for Linux.
*
* Authors:
- * - Jay Schulist <js...@tu...>
+ * - Jay Schulist <js...@sa...>
*/
#include <linux/config.h>
Index: cops_ltdrv.h
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/appletalk/cops_ltdrv.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- cops_ltdrv.h 14 Jan 2001 17:47:25 -0000 1.1.1.1
+++ cops_ltdrv.h 11 Apr 2002 12:37:47 -0000 1.2
@@ -20,7 +20,7 @@
/* cops_ltdrv.h: LocalTalk driver firmware dump for Linux.
*
* Authors:
- * - Jay Schulist <js...@tu...>
+ * - Jay Schulist <js...@sa...>
*/
#include <linux/config.h>
Index: ipddp.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/appletalk/ipddp.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- ipddp.c 14 Jan 2001 17:47:26 -0000 1.1.1.1
+++ ipddp.c 11 Apr 2002 12:37:47 -0000 1.2
@@ -4,7 +4,7 @@
*
* Authors:
* - DDP-IP Encap by: Bradford W. Johnson <joh...@ma...>
- * - DDP-IP Decap by: Jay Schulist <js...@tu...>
+ * - DDP-IP Decap by: Jay Schulist <js...@sa...>
*
* Derived from:
* - Almost all code already existed in net/appletalk/ddp.c I just
@@ -14,18 +14,15 @@
* Written 1993-94 by Donald Becker.
* - dummy.c: A dummy net driver. By Nick Holloway.
* - MacGate: A user space Daemon for Appletalk-IP Decap for
- * Linux by Jay Schulist <js...@tu...>
+ * Linux by Jay Schulist <js...@sa...>
*
* Copyright 1993 United States Government as represented by the
* Director, National Security Agency.
*
* This software may be used and distributed according to the terms
- * of the GNU Public License, incorporated herein by reference.
+ * of the GNU General Public License, incorporated herein by reference.
*/
-static const char *version =
- "ipddp.c:v0.01 8/28/97 Bradford W. Johnson <joh...@ma...>\n";
-
#include <linux/config.h>
#include <linux/module.h>
#include <linux/kernel.h>
@@ -39,7 +36,9 @@
#include "ipddp.h" /* Our stuff */
-static struct ipddp_route *ipddp_route_list = NULL;
+static const char version[] = KERN_INFO "ipddp.c:v0.01 8/28/97 Bradford W. Johnson <joh...@ma...>\n";
+
+static struct ipddp_route *ipddp_route_list;
#ifdef CONFIG_IPDDP_ENCAP
static int ipddp_mode = IPDDP_ENCAP;
@@ -47,12 +46,6 @@
static int ipddp_mode = IPDDP_DECAP;
#endif
-/* Use 0 for production, 1 for verification, 2 for debug, 3 for verbose debug */
-#ifndef IPDDP_DEBUG
-#define IPDDP_DEBUG 1
-#endif
-static unsigned int ipddp_debug = IPDDP_DEBUG;
-
/* Index to functions, as function prototypes. */
static int ipddp_xmit(struct sk_buff *skb, struct net_device *dev);
static struct net_device_stats *ipddp_get_stats(struct net_device *dev);
@@ -64,19 +57,19 @@
static int __init ipddp_init(struct net_device *dev)
{
- static unsigned version_printed = 0;
+ static unsigned version_printed;
SET_MODULE_OWNER(dev);
- if (ipddp_debug && version_printed++ == 0)
- printk("%s", version);
+ if (version_printed++ == 0)
+ printk(version);
/* Let the user now what mode we are in */
if(ipddp_mode == IPDDP_ENCAP)
printk("%s: Appletalk-IP Encap. mode by Bradford W. Johnson <joh...@ma...>\n",
dev->name);
if(ipddp_mode == IPDDP_DECAP)
- printk("%s: Appletalk-IP Decap. mode by Jay Schulist <js...@tu...>\n",
+ printk("%s: Appletalk-IP Decap. mode by Jay Schulist <js...@sa...>\n",
dev->name);
/* Fill in the device structure with ethernet-generic values. */
@@ -193,25 +186,23 @@
static int ipddp_create(struct ipddp_route *new_rt)
{
struct ipddp_route *rt =(struct ipddp_route*) kmalloc(sizeof(*rt), GFP_KERNEL);
- struct ipddp_route *test;
- if(rt == NULL)
+ if (rt == NULL)
return -ENOMEM;
rt->ip = new_rt->ip;
rt->at = new_rt->at;
rt->next = NULL;
- rt->dev = atrtr_get_dev(&rt->at);
- if(rt->dev == NULL)
- {
- kfree(rt);
- return (-ENETUNREACH);
+ if ((rt->dev = atrtr_get_dev(&rt->at)) == NULL) {
+ kfree(rt);
+ return -ENETUNREACH;
}
- test = ipddp_find_route(rt);
- if(test != NULL)
- return (-EEXIST);
-
+ if (ipddp_find_route(rt)) {
+ kfree(rt);
+ return -EEXIST;
+ }
+
rt->next = ipddp_route_list;
ipddp_route_list = rt;
@@ -264,22 +255,26 @@
static int ipddp_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
{
struct ipddp_route *rt = (struct ipddp_route *)ifr->ifr_data;
+ struct ipddp_route rcp;
if(!capable(CAP_NET_ADMIN))
return -EPERM;
+ if(copy_from_user(&rcp, rt, sizeof(rcp)))
+ return -EFAULT;
+
switch(cmd)
{
case SIOCADDIPDDPRT:
- return (ipddp_create(rt));
+ return (ipddp_create(&rcp));
case SIOCFINDIPDDPRT:
- if(copy_to_user(rt, ipddp_find_route(rt), sizeof(struct ipddp_route)))
+ if(copy_to_user(rt, ipddp_find_route(&rcp), sizeof(struct ipddp_route)))
return -EFAULT;
return 0;
case SIOCDELIPDDPRT:
- return (ipddp_delete(rt));
+ return (ipddp_delete(&rcp));
default:
return -EINVAL;
@@ -288,6 +283,7 @@
static struct net_device dev_ipddp;
+MODULE_LICENSE("GPL");
MODULE_PARM(ipddp_mode, "i");
static int __init ipddp_init_module(void)
@@ -307,11 +303,16 @@
static void __exit ipddp_cleanup_module(void)
{
+ struct ipddp_route *p;
+
unregister_netdev(&dev_ipddp);
kfree(dev_ipddp.priv);
- memset(&dev_ipddp, 0, sizeof(dev_ipddp));
- dev_ipddp.init = ipddp_init;
+ while (ipddp_route_list) {
+ p = ipddp_route_list->next;
+ kfree(ipddp_route_list);
+ ipddp_route_list = p;
+ }
}
module_init(ipddp_init_module);
Index: ltpc.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/appletalk/ltpc.c,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
--- ltpc.c 25 Feb 2001 23:15:01 -0000 1.1.1.2
+++ ltpc.c 11 Apr 2002 12:37:47 -0000 1.2
@@ -62,8 +62,8 @@
/***
*
* $Log$
- * Revision 1.1.1.2 2001/02/25 23:15:01 kenn
- * Import official 2.4.2 Linus tree
+ * Revision 1.2 2002/04/11 12:37:47 atp
+ * synch 2.4.15 commit 50
*
* Revision 1.1.2.1 2000/03/01 05:35:07 jgarzik
* at and tr cleanup
@@ -200,14 +200,14 @@
*/
/* insmod-tweakable variables */
-static int debug=0;
+static int debug;
#define DEBUG_VERBOSE 1
#define DEBUG_UPPER 2
#define DEBUG_LOWER 4
-static int io=0;
-static int irq=0;
-static int dma=0;
+static int io;
+static int irq;
+static int dma;
#include <linux/module.h>
#include <linux/kernel.h>
@@ -284,7 +284,7 @@
/* the transmit queue itself */
-static struct xmitQel *xmQhd=NULL,*xmQtl=NULL;
+static struct xmitQel *xmQhd, *xmQtl;
static void enQ(struct xmitQel *qel)
{
@@ -492,7 +492,7 @@
static unsigned char rescbuf[2] = {LT_GETRESULT,0};
static unsigned char resdbuf[2];
-static int QInIdle=0;
+static int QInIdle;
/* idle expects to be called with the IRQ line high -- either because of
* an interrupt, or because the line is tri-stated
@@ -913,7 +913,7 @@
return 0;
}
-static int ltpc_poll_counter = 0;
+static int ltpc_poll_counter;
static void ltpc_poll(unsigned long l)
{
@@ -1258,6 +1258,8 @@
static struct net_device dev_ltpc;
#ifdef MODULE
+
+MODULE_LICENSE("GPL");
MODULE_PARM(debug, "i");
MODULE_PARM(io, "i");
MODULE_PARM(irq, "i");
|