Commit da111000 authored by Kai Germaschewski's avatar Kai Germaschewski

ISDN: Move dial/hangup related stuff to isdn_net_dev

Keeping track of dialing / auto hangup is per ISDN channel, so should
go into isdn_net_dev.
parent 890ca7d1
...@@ -371,7 +371,7 @@ isdn_ciscohdlck_receive(isdn_net_dev *idev, isdn_net_local *olp, ...@@ -371,7 +371,7 @@ isdn_ciscohdlck_receive(isdn_net_dev *idev, isdn_net_local *olp,
goto out_free; goto out_free;
default: default:
/* no special cisco protocol */ /* no special cisco protocol */
isdn_net_reset_huptimer(lp, olp); isdn_net_reset_huptimer(idev, olp->netdev);
skb->protocol = htons(type); skb->protocol = htons(type);
netif_rx(skb); netif_rx(skb);
return; return;
......
This diff is collapsed.
...@@ -58,10 +58,10 @@ extern void isdn_net_write_super(isdn_net_local *lp, struct sk_buff *skb); ...@@ -58,10 +58,10 @@ extern void isdn_net_write_super(isdn_net_local *lp, struct sk_buff *skb);
extern int isdn_net_online(isdn_net_dev *idev); extern int isdn_net_online(isdn_net_dev *idev);
static inline void static inline void
isdn_net_reset_huptimer(isdn_net_local *lp, isdn_net_local *olp) isdn_net_reset_huptimer(isdn_net_dev *idev, isdn_net_dev *idev2)
{ {
olp->huptimer = 0; idev->huptimer = 0;
lp->huptimer = 0; idev2->huptimer = 0;
} }
#define ISDN_NET_MAX_QUEUE_LENGTH 2 #define ISDN_NET_MAX_QUEUE_LENGTH 2
......
...@@ -495,7 +495,7 @@ isdn_ppp_ioctl(struct inode *ino, struct file *file, unsigned int cmd, unsigned ...@@ -495,7 +495,7 @@ isdn_ppp_ioctl(struct inode *ino, struct file *file, unsigned int cmd, unsigned
case PPPIOCGIDLE: /* get idle time information */ case PPPIOCGIDLE: /* get idle time information */
if (idev) { if (idev) {
struct ppp_idle pidle; struct ppp_idle pidle;
pidle.xmit_idle = pidle.recv_idle = idev->local.huptimer; pidle.xmit_idle = pidle.recv_idle = idev->huptimer;
if ((r = set_arg((void *) arg, &pidle,sizeof(struct ppp_idle)))) if ((r = set_arg((void *) arg, &pidle,sizeof(struct ppp_idle))))
return r; return r;
} }
...@@ -570,13 +570,13 @@ isdn_ppp_ioctl(struct inode *ino, struct file *file, unsigned int cmd, unsigned ...@@ -570,13 +570,13 @@ isdn_ppp_ioctl(struct inode *ino, struct file *file, unsigned int cmd, unsigned
strncpy(pci.local_num,idev->local.msn,63); strncpy(pci.local_num,idev->local.msn,63);
i = 0; i = 0;
list_for_each_entry(phone, &idev->local.phone[1], list) { list_for_each_entry(phone, &idev->local.phone[1], list) {
if (i++ == idev->local.dial) { if (i++ == idev->dial) {
strncpy(pci.remote_num,phone->num,63); strncpy(pci.remote_num,phone->num,63);
break; break;
} }
} }
pci.charge_units = idev->local.charge; pci.charge_units = idev->charge;
if(idev->local.outgoing) if(idev->outgoing)
pci.calltype = CALLTYPE_OUTGOING; pci.calltype = CALLTYPE_OUTGOING;
else else
pci.calltype = CALLTYPE_INCOMING; pci.calltype = CALLTYPE_INCOMING;
...@@ -798,7 +798,7 @@ isdn_ppp_write(struct file *file, const char *buf, size_t count, loff_t *off) ...@@ -798,7 +798,7 @@ isdn_ppp_write(struct file *file, const char *buf, size_t count, loff_t *off)
} }
proto = PPP_PROTOCOL(protobuf); proto = PPP_PROTOCOL(protobuf);
if (proto != PPP_LCP) if (proto != PPP_LCP)
idev->local.huptimer = 0; idev->huptimer = 0;
if (idev->isdn_slot < 0) { if (idev->isdn_slot < 0) {
retval = 0; retval = 0;
...@@ -976,7 +976,7 @@ static void isdn_ppp_receive(isdn_net_dev *net_dev, isdn_net_local *lp, ...@@ -976,7 +976,7 @@ static void isdn_ppp_receive(isdn_net_dev *net_dev, isdn_net_local *lp,
* huptimer on LCP packets. * huptimer on LCP packets.
*/ */
if (PPP_PROTOCOL(skb->data) != PPP_LCP) if (PPP_PROTOCOL(skb->data) != PPP_LCP)
isdn_net_reset_huptimer(&net_dev->local,lp); isdn_net_reset_huptimer(net_dev,lp->netdev);
slot = idev->ppp_slot; slot = idev->ppp_slot;
if (slot < 0 || slot > ISDN_MAX_CHANNELS) { if (slot < 0 || slot > ISDN_MAX_CHANNELS) {
...@@ -1137,7 +1137,7 @@ isdn_ppp_push_higher(isdn_net_dev * net_dev, isdn_net_local * lp, struct sk_buff ...@@ -1137,7 +1137,7 @@ isdn_ppp_push_higher(isdn_net_dev * net_dev, isdn_net_local * lp, struct sk_buff
} }
/* Reset hangup-timer */ /* Reset hangup-timer */
lp->huptimer = 0; idev->huptimer = 0;
skb->dev = dev; skb->dev = dev;
skb->mac.raw = skb->data; skb->mac.raw = skb->data;
...@@ -1241,7 +1241,7 @@ isdn_ppp_xmit(struct sk_buff *skb, struct net_device *netdev) ...@@ -1241,7 +1241,7 @@ isdn_ppp_xmit(struct sk_buff *skb, struct net_device *netdev)
return 0; return 0;
} }
ipt = ippp_table[slot]; ipt = ippp_table[slot];
lp->huptimer = 0; idev->huptimer = 0;
/* /*
* after this line .. requeueing in the device queue is no longer allowed!!! * after this line .. requeueing in the device queue is no longer allowed!!!
...@@ -2037,7 +2037,7 @@ isdn_ppp_hangup_slave(char *name) ...@@ -2037,7 +2037,7 @@ isdn_ppp_hangup_slave(char *name)
if (!sdev) if (!sdev)
return 2; return 2;
isdn_net_hangup(mlp); isdn_net_hangup(mlp->netdev);
return 0; return 0;
#else #else
return -1; return -1;
......
...@@ -315,40 +315,20 @@ typedef struct isdn_net_local_s { ...@@ -315,40 +315,20 @@ typedef struct isdn_net_local_s {
int flags; /* Connection-flags */ int flags; /* Connection-flags */
int dialretry; /* Counter for Dialout-retries */ int dialretry; /* Counter for Dialout-retries */
int dialmax; /* Max. Number of Dial-retries */ int dialmax; /* Max. Number of Dial-retries */
int dialtimeout; /* How long shall we try on dialing */
int dialwait; /* wait after failed attempt */
int cbdelay; /* Delay before Callback starts */ int cbdelay; /* Delay before Callback starts */
char msn[ISDN_MSNLEN]; /* MSNs/EAZs for this interface */ char msn[ISDN_MSNLEN]; /* MSNs/EAZs for this interface */
u_char cbhup; /* Flag: Reject Call before Callback*/ u_char cbhup; /* Flag: Reject Call before Callback*/
int hupflags; /* Flags for charge-unit-hangup: */
int onhtime; /* Time to keep link up */
u_char p_encap; /* Packet encapsulation */ u_char p_encap; /* Packet encapsulation */
/* 0 = Ethernet over ISDN */
/* 1 = RAW-IP */
/* 2 = IP with type field */
u_char l2_proto; /* Layer-2-protocol */ u_char l2_proto; /* Layer-2-protocol */
/* See ISDN_PROTO_L2..-constants in */
/* isdnif.h */
/* 0 = X75/LAPB with I-Frames */
/* 1 = X75/LAPB with UI-Frames */
/* 2 = X75/LAPB with BUI-Frames */
/* 3 = HDLC */
u_char l3_proto; /* Layer-3-protocol */ u_char l3_proto; /* Layer-3-protocol */
/* See ISDN_PROTO_L3..-constants in */
/* isdnif.h */
/* 0 = Transparent */
int huptimer; /* Timeout-counter for auto-hangup */
int charge; /* Counter for charging units */
int charge_state; /* ChargeInfo state machine */
ulong chargetime; /* Timer for Charging info */
int hupflags; /* Flags for charge-unit-hangup: */
/* bit0: chargeint is invalid */
/* bit1: Getting charge-interval */
/* bit2: Do charge-unit-hangup */
/* bit3: Do hangup even on incoming */
int outgoing; /* Flag: outgoing call */
int onhtime; /* Time to keep link up */
int chargeint; /* Interval between charge-infos */
int onum; /* Flag: at least 1 outgoing number */
int cps; /* current speed of this interface */
int transcount; /* byte-counter for cps-calculation */
int last_jiffies; /* when transcount was reset */
int sqfull; /* Flag: netdev-queue overloaded */ int sqfull; /* Flag: netdev-queue overloaded */
ulong sqfull_stamp; /* Start-Time of overload */ ulong sqfull_stamp; /* Start-Time of overload */
ulong slavedelay; /* Dynamic bundling delaytime */ ulong slavedelay; /* Dynamic bundling delaytime */
...@@ -356,7 +336,6 @@ typedef struct isdn_net_local_s { ...@@ -356,7 +336,6 @@ typedef struct isdn_net_local_s {
struct list_head phone[2]; /* List of remote-phonenumbers */ struct list_head phone[2]; /* List of remote-phonenumbers */
/* phone[0] = Incoming Numbers */ /* phone[0] = Incoming Numbers */
/* phone[1] = Outgoing Numbers */ /* phone[1] = Outgoing Numbers */
int dial; /* # of phone number just dialed */
struct net_device *master; /* Ptr to Master device for slaves */ struct net_device *master; /* Ptr to Master device for slaves */
struct net_device *slave; /* Ptr to Slave device for masters */ struct net_device *slave; /* Ptr to Slave device for masters */
struct isdn_net_local_s *next; /* Ptr to next link in bundle */ struct isdn_net_local_s *next; /* Ptr to next link in bundle */
...@@ -371,11 +350,6 @@ typedef struct isdn_net_local_s { ...@@ -371,11 +350,6 @@ typedef struct isdn_net_local_s {
/* a particular channel (including */ /* a particular channel (including */
/* the frame_cnt */ /* the frame_cnt */
int dialtimeout; /* How long shall we try on dialing? (jiffies) */
int dialwait; /* How long shall we wait after failed attempt? (jiffies) */
ulong dialstarted; /* jiffies of first dialing-attempt */
ulong dialwait_timer; /* jiffies of earliest next dialing-attempt */
int huptimeout; /* How long will the connection be up? (seconds) */
#ifdef CONFIG_ISDN_X25 #ifdef CONFIG_ISDN_X25
struct concap_device_ops *dops; /* callbacks used by encapsulator */ struct concap_device_ops *dops; /* callbacks used by encapsulator */
#endif #endif
...@@ -404,7 +378,21 @@ typedef struct isdn_net_dev_s { ...@@ -404,7 +378,21 @@ typedef struct isdn_net_dev_s {
struct timer_list dial_timer; /* dial events timer */ struct timer_list dial_timer; /* dial events timer */
int dial_event; /* event in case of timer expiry */ int dial_event; /* event in case of timer expiry */
int dialstate; /* State for dialing */ int dialstate; /* State for dialing */
int dial; /* # of phone number just dialed */
int outgoing; /* Flag: outgoing call */
unsigned long dialstarted; /* first dialing-attempt */
unsigned long dialwait_timer;/* earliest next dialing-attempt */
int cps; /* current speed of this interface */
int transcount; /* byte-counter for cps-calculation */
int last_jiffies; /* when transcount was reset */
struct timer_list hup_timer; /* auto hangup timer */ struct timer_list hup_timer; /* auto hangup timer */
int huptimer; /* Timeout-counter for auto-hangup */
int charge; /* Counter for charging units */
int charge_state; /* ChargeInfo state machine */
unsigned long chargetime; /* Timer for Charging info */
int chargeint; /* Interval between charge-infos */
int pppbind; /* ippp device for bindings */ int pppbind; /* ippp device for bindings */
int ppp_slot; /* PPPD device slot number */ int ppp_slot; /* PPPD device slot number */
......
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