Commit 8f7dcd21 authored by Kai Germaschewski's avatar Kai Germaschewski

ISDN/PPP: Adapt sync-PPP

Make sync PPP compile with the latest changes to the ISDN net device
layer - PPP negotiations work again after this patch.
parent 9a36fb68
...@@ -35,6 +35,8 @@ int isdn_net_hangup(isdn_net_dev *); ...@@ -35,6 +35,8 @@ int isdn_net_hangup(isdn_net_dev *);
int isdn_net_dial_req(isdn_net_dev *); int isdn_net_dial_req(isdn_net_dev *);
void isdn_net_writebuf_skb(isdn_net_dev *, struct sk_buff *skb); void isdn_net_writebuf_skb(isdn_net_dev *, struct sk_buff *skb);
void isdn_net_write_super(isdn_net_dev *, struct sk_buff *skb); void isdn_net_write_super(isdn_net_dev *, struct sk_buff *skb);
int isdn_net_autodial(struct sk_buff *skb, struct net_device *ndev);
isdn_net_dev *isdn_net_get_xmit_dev(isdn_net_local *mlp);
static inline int static inline int
put_u8(unsigned char *p, u8 x) put_u8(unsigned char *p, u8 x)
......
...@@ -221,7 +221,8 @@ isdn_net_set_encap(isdn_net_local *lp, int encap) ...@@ -221,7 +221,8 @@ isdn_net_set_encap(isdn_net_local *lp, int encap)
if (lp->ops && lp->ops->cleanup) if (lp->ops && lp->ops->cleanup)
lp->ops->cleanup(lp); lp->ops->cleanup(lp);
if (encap < 0 || encap >= ISDN_NET_ENCAP_NR) { if (encap < 0 || encap >= ISDN_NET_ENCAP_NR ||
!isdn_netif_ops[encap]) {
lp->p_encap = -1; lp->p_encap = -1;
lp->ops = NULL; lp->ops = NULL;
retval = -EINVAL; retval = -EINVAL;
...@@ -1063,7 +1064,7 @@ isdn_net_open(struct net_device *dev) ...@@ -1063,7 +1064,7 @@ isdn_net_open(struct net_device *dev)
if (lp->ops->open) if (lp->ops->open)
retval = lp->ops->open(lp); retval = lp->ops->open(lp);
if (!retval) if (retval)
return retval; return retval;
netif_start_queue(dev); netif_start_queue(dev);
...@@ -1079,7 +1080,6 @@ isdn_net_open(struct net_device *dev) ...@@ -1079,7 +1080,6 @@ isdn_net_open(struct net_device *dev)
/* /*
* Shutdown a net-interface. * Shutdown a net-interface.
*/ */
// FIXME share?
static int static int
isdn_net_close(struct net_device *dev) isdn_net_close(struct net_device *dev)
{ {
...@@ -1093,14 +1093,14 @@ isdn_net_close(struct net_device *dev) ...@@ -1093,14 +1093,14 @@ isdn_net_close(struct net_device *dev)
netif_stop_queue(dev); netif_stop_queue(dev);
list_for_each_safe(l, n, &lp->online) { list_for_each_safe(l, n, &lp->slaves) {
sdev = list_entry(l, isdn_net_dev, online); sdev = list_entry(l, isdn_net_dev, slaves);
isdn_net_hangup(sdev); isdn_net_hangup(sdev);
} }
/* The hangup will make the refcnt drop back to /* The hangup will make the refcnt drop back to
* 1 (referenced by list only) soon. */ * 1 (referenced by list only) soon. */
spin_lock_irqsave(&running_devs_lock, flags); spin_lock_irqsave(&running_devs_lock, flags);
while (atomic_read(&dev->refcnt) != 1) { while (atomic_read(&lp->refcnt) != 1) {
spin_unlock_irqrestore(&running_devs_lock, flags); spin_unlock_irqrestore(&running_devs_lock, flags);
set_current_state(TASK_UNINTERRUPTIBLE); set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(HZ/10); schedule_timeout(HZ/10);
...@@ -1878,7 +1878,6 @@ isdn_net_stat_callback(int idx, isdn_ctrl *c) ...@@ -1878,7 +1878,6 @@ isdn_net_stat_callback(int idx, isdn_ctrl *c)
isdn_net_dev *idev = isdn_slot_idev(idx); isdn_net_dev *idev = isdn_slot_idev(idx);
if (!idev) { if (!idev) {
HERE;
return 0; return 0;
} }
switch (c->command) { switch (c->command) {
...@@ -2018,8 +2017,9 @@ isdn_net_local_busy(isdn_net_local *mlp) ...@@ -2018,8 +2017,9 @@ isdn_net_local_busy(isdn_net_local *mlp)
/* /*
* For the given net device, this will get a non-busy channel out of the * For the given net device, this will get a non-busy channel out of the
* corresponding bundle. * corresponding bundle.
* must hold mlp->xmit_lock
*/ */
static inline isdn_net_dev * isdn_net_dev *
isdn_net_get_xmit_dev(isdn_net_local *mlp) isdn_net_get_xmit_dev(isdn_net_local *mlp)
{ {
isdn_net_dev *idev; isdn_net_dev *idev;
...@@ -2041,7 +2041,7 @@ isdn_net_inc_frame_cnt(isdn_net_dev *idev) ...@@ -2041,7 +2041,7 @@ isdn_net_inc_frame_cnt(isdn_net_dev *idev)
{ {
isdn_net_local *mlp = idev->mlp; isdn_net_local *mlp = idev->mlp;
if (isdn_net_local_busy(mlp)) if (isdn_net_dev_busy(idev))
isdn_BUG(); isdn_BUG();
idev->frame_cnt++; idev->frame_cnt++;
...@@ -2060,7 +2060,7 @@ isdn_net_dec_frame_cnt(isdn_net_dev *idev) ...@@ -2060,7 +2060,7 @@ isdn_net_dec_frame_cnt(isdn_net_dev *idev)
idev->frame_cnt--; idev->frame_cnt--;
if (isdn_net_local_busy(mlp)) if (isdn_net_dev_busy(idev))
isdn_BUG(); isdn_BUG();
if (!was_busy) if (!was_busy)
......
This diff is collapsed.
...@@ -11,11 +11,12 @@ ...@@ -11,11 +11,12 @@
#include <linux/config.h> #include <linux/config.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/interrupt.h>
#include <linux/init.h> #include <linux/init.h>
#include "isdnloop.h" #include "isdnloop.h"
static char *revision = "$Revision: 1.11.6.7 $"; static char *revision = "$Revision: 1.11.6.7 $";
static char *isdnloop_id; static char *isdnloop_id = "loop0";
MODULE_DESCRIPTION("ISDN4Linux: Pseudo Driver that simulates an ISDN card"); MODULE_DESCRIPTION("ISDN4Linux: Pseudo Driver that simulates an ISDN card");
MODULE_AUTHOR("Fritz Elfert"); MODULE_AUTHOR("Fritz Elfert");
......
...@@ -342,9 +342,9 @@ typedef struct isdn_net_local_s { ...@@ -342,9 +342,9 @@ typedef struct isdn_net_local_s {
protected by serializing config protected by serializing config
ioctls / no change allowed when ioctls / no change allowed when
interface is running */ interface is running */
struct list_head online; /* circular list of all bundled struct list_head online; /* list of all bundled channels
channels, which are currently which can be used for actual
online data (IP) transfer
protected by xmit_lock */ protected by xmit_lock */
spinlock_t xmit_lock; /* used to protect the xmit path of spinlock_t xmit_lock; /* used to protect the xmit path of
......
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