diff options
Diffstat (limited to 'drivers/isdn/isdn_net.c')
-rw-r--r-- | drivers/isdn/isdn_net.c | 106 |
1 files changed, 49 insertions, 57 deletions
diff --git a/drivers/isdn/isdn_net.c b/drivers/isdn/isdn_net.c index 9e4426af0..9d54f0127 100644 --- a/drivers/isdn/isdn_net.c +++ b/drivers/isdn/isdn_net.c @@ -1,4 +1,4 @@ -/* $Id: isdn_net.c,v 1.84 1999/04/18 14:06:55 fritz Exp $ +/* $Id: isdn_net.c,v 1.89 1999/08/22 20:26:03 calle Exp $ * Linux ISDN subsystem, network interfaces and related functions (linklevel). * @@ -21,6 +21,25 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * $Log: isdn_net.c,v $ + * Revision 1.89 1999/08/22 20:26:03 calle + * backported changes from kernel 2.3.14: + * - several #include "config.h" gone, others come. + * - "struct device" changed to "struct net_device" in 2.3.14, added a + * define in isdn_compat.h for older kernel versions. + * + * Revision 1.88 1999/07/07 10:13:31 detabc + * remove unused messages + * + * Revision 1.87 1999/07/06 07:53:53 calle + * calls to dev_alloc_skb waste 16 bytes of memory, if we calculate the + * right header space for the lowlevel driver. using alloc_skb instead. + * + * Revision 1.86 1999/06/09 10:12:05 paul + * thinko in previous patch + * + * Revision 1.85 1999/06/07 19:42:39 paul + * isdn_net_getpeer() fixed to return correct `outgoing' flag + * * Revision 1.84 1999/04/18 14:06:55 fritz * Removed TIMRU stuff. * @@ -68,7 +87,7 @@ * Added more locking stuff in tty_write. * * Revision 1.71 1998/06/18 22:43:08 fritz - * Bugfix: Setting ndev->do_ioctl had beed accidetly removed at abc-cleanup. + * Bugfix: Setting ndev->do_ioctl had beed accidetly removed at cleanup. * * Revision 1.70 1998/06/17 19:50:49 he * merged with 2.1.10[34] (cosmetics and udelay() -> mdelay()) @@ -80,40 +99,13 @@ * so autodial is suppressed for that device until it is switched on using * 'isdnctrl status dev-name on'. * - * Revision 1.68 1998/06/07 00:20:05 fritz - * abc cleanup. * - * Revision 1.67 1998/06/02 12:10:08 detabc - * wegen einer einstweiliger verfuegung gegen DW ist zur zeit - * die abc-extension bis zur klaerung der rechtslage nicht verfuegbar * * Revision 1.66 1998/05/26 22:39:24 he * sync'ed with 2.1.102 where appropriate (CAPABILITY changes) * concap typo * cleared dev.tbusy in isdn_net BCONN status callback * - * Revision 1.65 1998/05/22 10:01:11 detabc - * in case of a icmp-unreach condition the tcp-keepalive-entrys - * will be dropped from the internal double-link-list (only abc-extension). - * send icmp unreach only if the skb->protocol == ETH_P_IP - * speedup abc-no-dchan redial - * - * Revision 1.64 1998/05/07 19:58:39 detabc - * bugfix in abc_delayed_hangup - * optimize keepalive-tests for abc_rawip - * - * Revision 1.63 1998/05/05 23:23:36 detabc - * change ICMP_HOST_UNREACH to ICMP_NET_UNREACH (only abc-ext.) - * set dev->tbusy to zero in isdn_net_unreachable() (only abc-ext.) - * drop all new packets and send ICMP_NET_UNREACH for - * min. dialwait to max. dialwait * 6 time. (only abc-ext.) - * change random-deliver of packets (small first) from all emcapsulation - * to only rawip with ABC-Router-Flag enabled. - * - * Revision 1.62 1998/05/03 17:40:42 detabc - * Include abc-extension-support for >= 2.1.x Kernels in - * isdn_net.c and isdn_common.c. alpha-test OK and running ! - * * Revision 1.61 1998/04/16 19:19:42 keil * Fix from vger (tx max qlength) * @@ -371,17 +363,17 @@ /* Prototypes */ int isdn_net_force_dial_lp(isdn_net_local *); -static int isdn_net_start_xmit(struct sk_buff *, struct device *); -static int isdn_net_xmit(struct device *, isdn_net_local *, struct sk_buff *); +static int isdn_net_start_xmit(struct sk_buff *, struct net_device *); +static int isdn_net_xmit(struct net_device *, isdn_net_local *, struct sk_buff *); -char *isdn_net_revision = "$Revision: 1.84 $"; +char *isdn_net_revision = "$Revision: 1.89 $"; /* * Code for raw-networking over ISDN */ static void -isdn_net_unreachable(struct device *dev, struct sk_buff *skb, char *reason) +isdn_net_unreachable(struct net_device *dev, struct sk_buff *skb, char *reason) { if(skb) { @@ -403,7 +395,7 @@ isdn_net_unreachable(struct device *dev, struct sk_buff *skb, char *reason) } static void -isdn_net_reset(struct device *dev) +isdn_net_reset(struct net_device *dev) { #ifdef CONFIG_ISDN_X25 struct concap_device_ops * dops = @@ -426,10 +418,10 @@ isdn_net_reset(struct device *dev) /* Open/initialize the board. */ static int -isdn_net_open(struct device *dev) +isdn_net_open(struct net_device *dev) { int i; - struct device *p; + struct net_device *p; struct in_device *in_dev; isdn_net_reset(dev); @@ -616,7 +608,7 @@ isdn_net_stat_callback(int idx, isdn_ctrl *c) lp->stats.tx_packets++; lp->stats.tx_bytes += c->parm.length; if (lp->p_encap == ISDN_NET_ENCAP_SYNCPPP && lp->sav_skb) { - struct device *mdev; + struct net_device *mdev; if (lp->master) mdev = lp->master; else @@ -1060,7 +1052,7 @@ isdn_net_dial(void) * Perform hangup for a net-interface. */ void -isdn_net_hangup(struct device *d) +isdn_net_hangup(struct net_device *d) { isdn_net_local *lp = (isdn_net_local *) d->priv; isdn_ctrl cmd; @@ -1191,7 +1183,7 @@ isdn_net_log_skb(struct sk_buff * skb, isdn_net_local * lp) * Side-effects: ndev->tbusy is cleared on success. */ int -isdn_net_send_skb(struct device *ndev, isdn_net_local * lp, +isdn_net_send_skb(struct net_device *ndev, isdn_net_local * lp, struct sk_buff *skb) { int ret; @@ -1224,7 +1216,7 @@ isdn_net_send_skb(struct device *ndev, isdn_net_local * lp, */ static int -isdn_net_xmit(struct device *ndev, isdn_net_local * lp, struct sk_buff *skb) +isdn_net_xmit(struct net_device *ndev, isdn_net_local * lp, struct sk_buff *skb) { int ret; @@ -1280,7 +1272,7 @@ isdn_net_xmit(struct device *ndev, isdn_net_local * lp, struct sk_buff *skb) } static void -isdn_net_adjust_hdr(struct sk_buff *skb, struct device *dev) +isdn_net_adjust_hdr(struct sk_buff *skb, struct net_device *dev) { isdn_net_local *lp = (isdn_net_local *) dev->priv; if (!skb) @@ -1300,7 +1292,7 @@ isdn_net_adjust_hdr(struct sk_buff *skb, struct device *dev) * and start dialing. */ static int -isdn_net_start_xmit(struct sk_buff *skb, struct device *ndev) +isdn_net_start_xmit(struct sk_buff *skb, struct net_device *ndev) { isdn_net_local *lp = (isdn_net_local *) ndev->priv; #ifdef CONFIG_ISDN_X25 @@ -1452,9 +1444,9 @@ isdn_net_start_xmit(struct sk_buff *skb, struct device *ndev) * Shutdown a net-interface. */ static int -isdn_net_close(struct device *dev) +isdn_net_close(struct net_device *dev) { - struct device *p; + struct net_device *p; #ifdef CONFIG_ISDN_X25 struct concap_proto * cprot = ( (isdn_net_local *) dev->priv ) -> netdev -> cprot; @@ -1490,7 +1482,7 @@ isdn_net_close(struct device *dev) * Get statistics */ static struct enet_statistics * -isdn_net_get_stats(struct device *dev) +isdn_net_get_stats(struct net_device *dev) { isdn_net_local *lp = (isdn_net_local *) dev->priv; return &lp->stats; @@ -1506,7 +1498,7 @@ isdn_net_get_stats(struct device *dev) */ static unsigned short -isdn_net_type_trans(struct sk_buff *skb, struct device *dev) +isdn_net_type_trans(struct sk_buff *skb, struct net_device *dev) { struct ethhdr *eth; unsigned char *rawp; @@ -1553,7 +1545,7 @@ static void isdn_net_slarp_send(isdn_net_local *lp, int is_reply) { unsigned short hl = dev->drv[lp->isdn_device]->interface->hl_hdrlen; - struct sk_buff *skb = dev_alloc_skb(hl + sizeof(cisco_hdr) + sizeof(cisco_slarp)); + struct sk_buff *skb = alloc_skb(hl + sizeof(cisco_hdr) + sizeof(cisco_slarp), GFP_ATOMIC); unsigned long t = (jiffies / HZ * 1000000); int len; cisco_hdr *ch; @@ -1644,7 +1636,7 @@ isdn_net_slarp_out(void) * Got a packet from ISDN-Channel. */ static void -isdn_net_receive(struct device *ndev, struct sk_buff *skb) +isdn_net_receive(struct net_device *ndev, struct sk_buff *skb) { isdn_net_local *lp = (isdn_net_local *) ndev->priv; isdn_net_local *olp = lp; /* original 'lp' */ @@ -1793,7 +1785,7 @@ isdn_net_rcv_skb(int idx, struct sk_buff *skb) } static int -my_eth_header(struct sk_buff *skb, struct device *dev, unsigned short type, +my_eth_header(struct sk_buff *skb, struct net_device *dev, unsigned short type, void *daddr, void *saddr, unsigned len) { struct ethhdr *eth = (struct ethhdr *) skb_push(skb, ETH_HLEN); @@ -1838,7 +1830,7 @@ my_eth_header(struct sk_buff *skb, struct device *dev, unsigned short type, */ static int -isdn_net_header(struct sk_buff *skb, struct device *dev, unsigned short type, +isdn_net_header(struct sk_buff *skb, struct net_device *dev, unsigned short type, void *daddr, void *saddr, unsigned plen) { isdn_net_local *lp = dev->priv; @@ -1894,7 +1886,7 @@ isdn_net_header(struct sk_buff *skb, struct device *dev, unsigned short type, static int isdn_net_rebuild_header(struct sk_buff *skb) { - struct device *dev = skb->dev; + struct net_device *dev = skb->dev; isdn_net_local *lp = dev->priv; int ret = 0; @@ -1926,7 +1918,7 @@ isdn_net_rebuild_header(struct sk_buff *skb) * Interface-setup. (called just after registering a new interface) */ static int -isdn_net_init(struct device *ndev) +isdn_net_init(struct net_device *ndev) { ushort max_hlhdr_len = 0; isdn_net_local *lp = (isdn_net_local *) ndev->priv; @@ -2437,7 +2429,7 @@ isdn_net_force_dial(char *name) * Allocate a new network-interface and initialize its data structures. */ char * -isdn_net_new(char *name, struct device *master) +isdn_net_new(char *name, struct net_device *master) { isdn_net_dev *netdev; @@ -2466,8 +2458,8 @@ isdn_net_new(char *name, struct device *master) netdev->local->p_encap = ISDN_NET_ENCAP_RAWIP; if (master) { /* Device shall be a slave */ - struct device *p = (((isdn_net_local *) master->priv)->slave); - struct device *q = master; + struct net_device *p = (((isdn_net_local *) master->priv)->slave); + struct net_device *q = master; netdev->local->master = master; /* Put device at end of slave-chain */ @@ -2928,7 +2920,7 @@ isdn_net_getpeer(isdn_net_ioctl_phone *phone, isdn_net_ioctl_phone *peer) /* for pre-bound channels, we need this extra check */ if ( strncmp(dev->num[idx],"???",3) == 0 ) return -ENOTCONN; strncpy(phone->phone,dev->num[idx],ISDN_MSNLEN); - phone->outgoing=USG_OUTGOING(idx); + phone->outgoing=USG_OUTGOING(dev->usage[idx]); if ( copy_to_user(peer,phone,sizeof(*peer)) ) return -EFAULT; return 0; } @@ -3004,7 +2996,7 @@ int isdn_net_force_hangup(char *name) { isdn_net_dev *p = isdn_net_findif(name); - struct device *q; + struct net_device *q; if (p) { if (p->local->isdn_device < 0) |