Commit 78032727 authored by Kai Germaschewski's avatar Kai Germaschewski

ISDN: Separate hard_start_xmit() for different types of ISDN net devices

Really use three different functions, which can call back into
library-type functions (isdn_net_autodial) as needed.
parent a296cbfb
...@@ -913,9 +913,12 @@ isdn_net_xmit(struct net_device *ndev, struct sk_buff *skb) ...@@ -913,9 +913,12 @@ isdn_net_xmit(struct net_device *ndev, struct sk_buff *skb)
{ {
isdn_net_dev *idev, *sdev; isdn_net_dev *idev, *sdev;
isdn_net_local *mlp = ndev->priv; isdn_net_local *mlp = ndev->priv;
int retv = 0;
mlp = ndev->priv; ndev->trans_start = jiffies;
if (list_empty(&mlp->online))
return isdn_net_autodial(skb, ndev);
/* For the other encaps the header has already been built */ /* For the other encaps the header has already been built */
if (mlp->p_encap == ISDN_NET_ENCAP_SYNCPPP) { if (mlp->p_encap == ISDN_NET_ENCAP_SYNCPPP) {
return isdn_ppp_xmit(skb, ndev); return isdn_ppp_xmit(skb, ndev);
...@@ -923,6 +926,7 @@ isdn_net_xmit(struct net_device *ndev, struct sk_buff *skb) ...@@ -923,6 +926,7 @@ isdn_net_xmit(struct net_device *ndev, struct sk_buff *skb)
idev = isdn_net_get_locked_dev(mlp); idev = isdn_net_get_locked_dev(mlp);
if (!idev) { if (!idev) {
printk(KERN_WARNING "%s: all channels busy - requeuing!\n", ndev->name); printk(KERN_WARNING "%s: all channels busy - requeuing!\n", ndev->name);
netif_stop_queue(ndev);
return 1; return 1;
} }
/* we have our idev locked from now on */ /* we have our idev locked from now on */
...@@ -970,8 +974,7 @@ isdn_net_xmit(struct net_device *ndev, struct sk_buff *skb) ...@@ -970,8 +974,7 @@ isdn_net_xmit(struct net_device *ndev, struct sk_buff *skb)
list_add_tail(&mlp->online, &idev->online); list_add_tail(&mlp->online, &idev->online);
} }
return retv; return 0;
} }
static void static void
...@@ -982,7 +985,7 @@ isdn_net_tx_timeout(struct net_device *dev) ...@@ -982,7 +985,7 @@ isdn_net_tx_timeout(struct net_device *dev)
netif_wake_queue(dev); netif_wake_queue(dev);
} }
static int int
isdn_net_autodial(struct sk_buff *skb, struct net_device *ndev) isdn_net_autodial(struct sk_buff *skb, struct net_device *ndev)
{ {
isdn_net_local *mlp = ndev->priv; isdn_net_local *mlp = ndev->priv;
...@@ -1034,27 +1037,14 @@ isdn_net_autodial(struct sk_buff *skb, struct net_device *ndev) ...@@ -1034,27 +1037,14 @@ isdn_net_autodial(struct sk_buff *skb, struct net_device *ndev)
static int static int
isdn_net_start_xmit(struct sk_buff *skb, struct net_device *ndev) isdn_net_start_xmit(struct sk_buff *skb, struct net_device *ndev)
{ {
isdn_net_local *mlp = ndev->priv;
int retval;
if (mlp->p_encap == ISDN_NET_ENCAP_X25IFACE) if (mlp->p_encap == ISDN_NET_ENCAP_X25IFACE)
return isdn_x25_start_xmit(skb, ndev); return isdn_x25_start_xmit(skb, ndev);
/* auto-dialing xmit function */
isdn_dumppkt("S:", skb->data, skb->len, 40);
if (list_empty(&mlp->online))
return isdn_net_autodial(skb, ndev);
/* Device is bound to an ISDN channel */
ndev->trans_start = jiffies;
/* ISDN connection is established, try sending */ /* ISDN connection is established, try sending */
retval = isdn_net_xmit(ndev, skb); if (mlp->p_encap == ISDN_NET_ENCAP_SYNCPPP)
if (retval) return isdn_ppp_xmit(skb, ndev);
netif_stop_queue(ndev);
return retval; return isdn_net_xmit(skb, ndev);
} }
/* /*
......
...@@ -56,6 +56,7 @@ extern int isdn_net_dial_req(isdn_net_dev *); ...@@ -56,6 +56,7 @@ extern int isdn_net_dial_req(isdn_net_dev *);
extern void isdn_net_writebuf_skb(isdn_net_dev *, struct sk_buff *skb); extern void isdn_net_writebuf_skb(isdn_net_dev *, struct sk_buff *skb);
extern void isdn_net_write_super(isdn_net_dev *, struct sk_buff *skb); extern void isdn_net_write_super(isdn_net_dev *, struct sk_buff *skb);
extern int isdn_net_online(isdn_net_dev *); extern int isdn_net_online(isdn_net_dev *);
extern int isdn_net_autodial(struct sk_buff *skb, struct net_device *ndev);
#define ISDN_NET_MAX_QUEUE_LENGTH 2 #define ISDN_NET_MAX_QUEUE_LENGTH 2
......
...@@ -1121,7 +1121,10 @@ isdn_ppp_xmit(struct sk_buff *skb, struct net_device *netdev) ...@@ -1121,7 +1121,10 @@ isdn_ppp_xmit(struct sk_buff *skb, struct net_device *netdev)
struct ippp_struct *ipt,*ipts; struct ippp_struct *ipt,*ipts;
int slot; int slot;
mlp = netdev->priv; ndev->trans_start = jiffies;
if (list_empty(&mlp->online))
return isdn_net_autodial(skb, ndev);
slot = idev->ppp_slot; slot = idev->ppp_slot;
if (slot < 0 || slot > ISDN_MAX_CHANNELS) { if (slot < 0 || slot > ISDN_MAX_CHANNELS) {
...@@ -1135,6 +1138,7 @@ isdn_ppp_xmit(struct sk_buff *skb, struct net_device *netdev) ...@@ -1135,6 +1138,7 @@ isdn_ppp_xmit(struct sk_buff *skb, struct net_device *netdev)
if (!(ipts->pppcfg & SC_ENABLE_IP)) { /* PPP connected ? */ if (!(ipts->pppcfg & SC_ENABLE_IP)) { /* PPP connected ? */
if (ipts->debug & 0x1) if (ipts->debug & 0x1)
printk(KERN_INFO "%s: IP frame delayed.\n", netdev->name); printk(KERN_INFO "%s: IP frame delayed.\n", netdev->name);
netif_stop_queue(ndev);
return 1; return 1;
} }
...@@ -1155,6 +1159,7 @@ isdn_ppp_xmit(struct sk_buff *skb, struct net_device *netdev) ...@@ -1155,6 +1159,7 @@ isdn_ppp_xmit(struct sk_buff *skb, struct net_device *netdev)
idev = isdn_net_get_locked_dev(mlp); idev = isdn_net_get_locked_dev(mlp);
if (!idev) { if (!idev) {
printk(KERN_WARNING "%s: all channels busy - requeuing!\n", netdev->name); printk(KERN_WARNING "%s: all channels busy - requeuing!\n", netdev->name);
netif_stop_queue(ndev);
return 1; return 1;
} }
/* we have our lp locked from now on */ /* we have our lp locked from now on */
......
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