Commit faca94ff authored by Karsten Keil's avatar Karsten Keil Committed by David S. Miller

[ISDN]: Remove local copy of device name to make sure renames work.

Signed-off-by: default avatarKarsten Keil <kkeil@suse.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f885c5b0
...@@ -328,7 +328,7 @@ isdn_net_autohup(void) ...@@ -328,7 +328,7 @@ isdn_net_autohup(void)
l->cps = (l->transcount * HZ) / (jiffies - last_jiffies); l->cps = (l->transcount * HZ) / (jiffies - last_jiffies);
l->transcount = 0; l->transcount = 0;
if (dev->net_verbose > 3) if (dev->net_verbose > 3)
printk(KERN_DEBUG "%s: %d bogocps\n", l->name, l->cps); printk(KERN_DEBUG "%s: %d bogocps\n", p->dev->name, l->cps);
if ((l->flags & ISDN_NET_CONNECTED) && (!l->dialstate)) { if ((l->flags & ISDN_NET_CONNECTED) && (!l->dialstate)) {
anymore = 1; anymore = 1;
l->huptimer++; l->huptimer++;
...@@ -350,12 +350,12 @@ isdn_net_autohup(void) ...@@ -350,12 +350,12 @@ isdn_net_autohup(void)
if (l->hupflags & ISDN_CHARGEHUP) { if (l->hupflags & ISDN_CHARGEHUP) {
if (l->hupflags & ISDN_WAITCHARGE) { if (l->hupflags & ISDN_WAITCHARGE) {
printk(KERN_DEBUG "isdn_net: Hupflags of %s are %X\n", printk(KERN_DEBUG "isdn_net: Hupflags of %s are %X\n",
l->name, l->hupflags); p->dev->name, l->hupflags);
isdn_net_hangup(p->dev); isdn_net_hangup(p->dev);
} else if (time_after(jiffies, l->chargetime + l->chargeint)) { } else if (time_after(jiffies, l->chargetime + l->chargeint)) {
printk(KERN_DEBUG printk(KERN_DEBUG
"isdn_net: %s: chtime = %lu, chint = %d\n", "isdn_net: %s: chtime = %lu, chint = %d\n",
l->name, l->chargetime, l->chargeint); p->dev->name, l->chargetime, l->chargeint);
isdn_net_hangup(p->dev); isdn_net_hangup(p->dev);
} }
} else } else
...@@ -442,8 +442,8 @@ isdn_net_stat_callback(int idx, isdn_ctrl *c) ...@@ -442,8 +442,8 @@ isdn_net_stat_callback(int idx, isdn_ctrl *c)
#endif #endif
isdn_net_lp_disconnected(lp); isdn_net_lp_disconnected(lp);
isdn_all_eaz(lp->isdn_device, lp->isdn_channel); isdn_all_eaz(lp->isdn_device, lp->isdn_channel);
printk(KERN_INFO "%s: remote hangup\n", lp->name); printk(KERN_INFO "%s: remote hangup\n", p->dev->name);
printk(KERN_INFO "%s: Chargesum is %d\n", lp->name, printk(KERN_INFO "%s: Chargesum is %d\n", p->dev->name,
lp->charge); lp->charge);
isdn_net_unbind_channel(lp); isdn_net_unbind_channel(lp);
return 1; return 1;
...@@ -487,7 +487,7 @@ isdn_net_stat_callback(int idx, isdn_ctrl *c) ...@@ -487,7 +487,7 @@ isdn_net_stat_callback(int idx, isdn_ctrl *c)
isdn_net_add_to_bundle(nd, lp); isdn_net_add_to_bundle(nd, lp);
} }
} }
printk(KERN_INFO "isdn_net: %s connected\n", lp->name); printk(KERN_INFO "isdn_net: %s connected\n", p->dev->name);
/* If first Chargeinfo comes before B-Channel connect, /* If first Chargeinfo comes before B-Channel connect,
* we correct the timestamp here. * we correct the timestamp here.
*/ */
...@@ -534,7 +534,7 @@ isdn_net_stat_callback(int idx, isdn_ctrl *c) ...@@ -534,7 +534,7 @@ isdn_net_stat_callback(int idx, isdn_ctrl *c)
lp->hupflags |= ISDN_HAVECHARGE; lp->hupflags |= ISDN_HAVECHARGE;
lp->chargetime = jiffies; lp->chargetime = jiffies;
printk(KERN_DEBUG "isdn_net: Got CINF chargetime of %s now %lu\n", printk(KERN_DEBUG "isdn_net: Got CINF chargetime of %s now %lu\n",
lp->name, lp->chargetime); p->dev->name, lp->chargetime);
return 1; return 1;
} }
} }
...@@ -565,7 +565,7 @@ isdn_net_dial(void) ...@@ -565,7 +565,7 @@ isdn_net_dial(void)
#ifdef ISDN_DEBUG_NET_DIAL #ifdef ISDN_DEBUG_NET_DIAL
if (lp->dialstate) if (lp->dialstate)
printk(KERN_DEBUG "%s: dialstate=%d\n", lp->name, lp->dialstate); printk(KERN_DEBUG "%s: dialstate=%d\n", p->dev->name, lp->dialstate);
#endif #endif
switch (lp->dialstate) { switch (lp->dialstate) {
case 0: case 0:
...@@ -578,7 +578,7 @@ isdn_net_dial(void) ...@@ -578,7 +578,7 @@ isdn_net_dial(void)
lp->dial = lp->phone[1]; lp->dial = lp->phone[1];
if (!lp->dial) { if (!lp->dial) {
printk(KERN_WARNING "%s: phone number deleted?\n", printk(KERN_WARNING "%s: phone number deleted?\n",
lp->name); p->dev->name);
isdn_net_hangup(p->dev); isdn_net_hangup(p->dev);
break; break;
} }
...@@ -632,13 +632,13 @@ isdn_net_dial(void) ...@@ -632,13 +632,13 @@ isdn_net_dial(void)
cmd.arg = lp->isdn_channel; cmd.arg = lp->isdn_channel;
if (!lp->dial) { if (!lp->dial) {
printk(KERN_WARNING "%s: phone number deleted?\n", printk(KERN_WARNING "%s: phone number deleted?\n",
lp->name); p->dev->name);
isdn_net_hangup(p->dev); isdn_net_hangup(p->dev);
break; break;
} }
if (!strncmp(lp->dial->num, "LEASED", strlen("LEASED"))) { if (!strncmp(lp->dial->num, "LEASED", strlen("LEASED"))) {
lp->dialstate = 4; lp->dialstate = 4;
printk(KERN_INFO "%s: Open leased line ...\n", lp->name); printk(KERN_INFO "%s: Open leased line ...\n", p->dev->name);
} else { } else {
if(lp->dialtimeout > 0) if(lp->dialtimeout > 0)
if (time_after(jiffies, lp->dialstarted + lp->dialtimeout)) { if (time_after(jiffies, lp->dialstarted + lp->dialtimeout)) {
...@@ -688,7 +688,7 @@ isdn_net_dial(void) ...@@ -688,7 +688,7 @@ isdn_net_dial(void)
dev->usage[i] |= ISDN_USAGE_OUTGOING; dev->usage[i] |= ISDN_USAGE_OUTGOING;
isdn_info_update(); isdn_info_update();
} }
printk(KERN_INFO "%s: dialing %d %s... %s\n", lp->name, printk(KERN_INFO "%s: dialing %d %s... %s\n", p->dev->name,
lp->dialretry, cmd.parm.setup.phone, lp->dialretry, cmd.parm.setup.phone,
(cmd.parm.setup.si1 == 1) ? "DOV" : ""); (cmd.parm.setup.si1 == 1) ? "DOV" : "");
lp->dtimer = 0; lp->dtimer = 0;
...@@ -797,7 +797,7 @@ isdn_net_dial(void) ...@@ -797,7 +797,7 @@ isdn_net_dial(void)
*/ */
if (lp->dtimer++ > lp->cbdelay) if (lp->dtimer++ > lp->cbdelay)
{ {
printk(KERN_INFO "%s: hangup waiting for callback ...\n", lp->name); printk(KERN_INFO "%s: hangup waiting for callback ...\n", p->dev->name);
lp->dtimer = 0; lp->dtimer = 0;
lp->dialstate = 4; lp->dialstate = 4;
cmd.driver = lp->isdn_device; cmd.driver = lp->isdn_device;
...@@ -810,7 +810,7 @@ isdn_net_dial(void) ...@@ -810,7 +810,7 @@ isdn_net_dial(void)
break; break;
default: default:
printk(KERN_WARNING "isdn_net: Illegal dialstate %d for device %s\n", printk(KERN_WARNING "isdn_net: Illegal dialstate %d for device %s\n",
lp->dialstate, lp->name); lp->dialstate, p->dev->name);
} }
p = (isdn_net_dev *) p->next; p = (isdn_net_dev *) p->next;
} }
...@@ -836,11 +836,11 @@ isdn_net_hangup(struct net_device *d) ...@@ -836,11 +836,11 @@ isdn_net_hangup(struct net_device *d)
if (slp->flags & ISDN_NET_CONNECTED) { if (slp->flags & ISDN_NET_CONNECTED) {
printk(KERN_INFO printk(KERN_INFO
"isdn_net: hang up slave %s before %s\n", "isdn_net: hang up slave %s before %s\n",
slp->name, lp->name); lp->slave->name, d->name);
isdn_net_hangup(lp->slave); isdn_net_hangup(lp->slave);
} }
} }
printk(KERN_INFO "isdn_net: local hangup %s\n", lp->name); printk(KERN_INFO "isdn_net: local hangup %s\n", d->name);
#ifdef CONFIG_ISDN_PPP #ifdef CONFIG_ISDN_PPP
if (lp->p_encap == ISDN_NET_ENCAP_SYNCPPP) if (lp->p_encap == ISDN_NET_ENCAP_SYNCPPP)
isdn_ppp_free(lp); isdn_ppp_free(lp);
...@@ -858,7 +858,7 @@ isdn_net_hangup(struct net_device *d) ...@@ -858,7 +858,7 @@ isdn_net_hangup(struct net_device *d)
cmd.command = ISDN_CMD_HANGUP; cmd.command = ISDN_CMD_HANGUP;
cmd.arg = lp->isdn_channel; cmd.arg = lp->isdn_channel;
isdn_command(&cmd); isdn_command(&cmd);
printk(KERN_INFO "%s: Chargesum is %d\n", lp->name, lp->charge); printk(KERN_INFO "%s: Chargesum is %d\n", d->name, lp->charge);
isdn_all_eaz(lp->isdn_device, lp->isdn_channel); isdn_all_eaz(lp->isdn_device, lp->isdn_channel);
} }
isdn_net_unbind_channel(lp); isdn_net_unbind_channel(lp);
...@@ -885,7 +885,7 @@ isdn_net_log_skb(struct sk_buff * skb, isdn_net_local * lp) ...@@ -885,7 +885,7 @@ isdn_net_log_skb(struct sk_buff * skb, isdn_net_local * lp)
/* fall back to old isdn_net_log_packet method() */ /* fall back to old isdn_net_log_packet method() */
char * buf = skb->data; char * buf = skb->data;
printk(KERN_DEBUG "isdn_net: protocol %04x is buggy, dev %s\n", skb->protocol, lp->name); printk(KERN_DEBUG "isdn_net: protocol %04x is buggy, dev %s\n", skb->protocol, lp->netdev->dev->name);
p = buf; p = buf;
proto = ETH_P_IP; proto = ETH_P_IP;
switch (lp->p_encap) { switch (lp->p_encap) {
...@@ -1023,7 +1023,7 @@ void isdn_net_writebuf_skb(isdn_net_local *lp, struct sk_buff *skb) ...@@ -1023,7 +1023,7 @@ void isdn_net_writebuf_skb(isdn_net_local *lp, struct sk_buff *skb)
ret = isdn_writebuf_skb_stub(lp->isdn_device, lp->isdn_channel, 1, skb); ret = isdn_writebuf_skb_stub(lp->isdn_device, lp->isdn_channel, 1, skb);
if (ret != len) { if (ret != len) {
/* we should never get here */ /* we should never get here */
printk(KERN_WARNING "%s: HL driver queue full\n", lp->name); printk(KERN_WARNING "%s: HL driver queue full\n", lp->netdev->dev->name);
goto error; goto error;
} }
...@@ -1461,7 +1461,7 @@ isdn_ciscohdlck_dev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) ...@@ -1461,7 +1461,7 @@ isdn_ciscohdlck_dev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
mod_timer(&lp->cisco_timer, expires); mod_timer(&lp->cisco_timer, expires);
printk(KERN_INFO "%s: Keepalive period set " printk(KERN_INFO "%s: Keepalive period set "
"to %d seconds.\n", "to %d seconds.\n",
lp->name, lp->cisco_keepalive_period); dev->name, lp->cisco_keepalive_period);
} }
break; break;
...@@ -1512,7 +1512,7 @@ isdn_net_ciscohdlck_slarp_send_keepalive(unsigned long data) ...@@ -1512,7 +1512,7 @@ isdn_net_ciscohdlck_slarp_send_keepalive(unsigned long data)
lp->cisco_line_state = 0; lp->cisco_line_state = 0;
printk (KERN_WARNING printk (KERN_WARNING
"UPDOWN: Line protocol on Interface %s," "UPDOWN: Line protocol on Interface %s,"
" changed state to down\n", lp->name); " changed state to down\n", lp->netdev->dev->name);
/* should stop routing higher-level data accross */ /* should stop routing higher-level data accross */
} else if ((!lp->cisco_line_state) && } else if ((!lp->cisco_line_state) &&
(myseq_diff >= 0) && (myseq_diff <= 2)) { (myseq_diff >= 0) && (myseq_diff <= 2)) {
...@@ -1520,14 +1520,14 @@ isdn_net_ciscohdlck_slarp_send_keepalive(unsigned long data) ...@@ -1520,14 +1520,14 @@ isdn_net_ciscohdlck_slarp_send_keepalive(unsigned long data)
lp->cisco_line_state = 1; lp->cisco_line_state = 1;
printk (KERN_WARNING printk (KERN_WARNING
"UPDOWN: Line protocol on Interface %s," "UPDOWN: Line protocol on Interface %s,"
" changed state to up\n", lp->name); " changed state to up\n", lp->netdev->dev->name);
/* restart routing higher-level data accross */ /* restart routing higher-level data accross */
} }
if (lp->cisco_debserint) if (lp->cisco_debserint)
printk (KERN_DEBUG "%s: HDLC " printk (KERN_DEBUG "%s: HDLC "
"myseq %lu, mineseen %lu%c, yourseen %lu, %s\n", "myseq %lu, mineseen %lu%c, yourseen %lu, %s\n",
lp->name, last_cisco_myseq, lp->cisco_mineseen, lp->netdev->dev->name, last_cisco_myseq, lp->cisco_mineseen,
((last_cisco_myseq == lp->cisco_mineseen) ? '*' : 040), ((last_cisco_myseq == lp->cisco_mineseen) ? '*' : 040),
lp->cisco_yourseq, lp->cisco_yourseq,
((lp->cisco_line_state) ? "line up" : "line down")); ((lp->cisco_line_state) ? "line up" : "line down"));
...@@ -1682,7 +1682,7 @@ isdn_net_ciscohdlck_slarp_in(isdn_net_local *lp, struct sk_buff *skb) ...@@ -1682,7 +1682,7 @@ isdn_net_ciscohdlck_slarp_in(isdn_net_local *lp, struct sk_buff *skb)
"remote ip: %d.%d.%d.%d, " "remote ip: %d.%d.%d.%d, "
"local ip: %d.%d.%d.%d " "local ip: %d.%d.%d.%d "
"mask: %d.%d.%d.%d\n", "mask: %d.%d.%d.%d\n",
lp->name, lp->netdev->dev->name,
HIPQUAD(addr), HIPQUAD(addr),
HIPQUAD(local), HIPQUAD(local),
HIPQUAD(mask)); HIPQUAD(mask));
...@@ -1690,7 +1690,7 @@ isdn_net_ciscohdlck_slarp_in(isdn_net_local *lp, struct sk_buff *skb) ...@@ -1690,7 +1690,7 @@ isdn_net_ciscohdlck_slarp_in(isdn_net_local *lp, struct sk_buff *skb)
slarp_reply_out: slarp_reply_out:
printk(KERN_INFO "%s: got invalid slarp " printk(KERN_INFO "%s: got invalid slarp "
"reply (%d.%d.%d.%d/%d.%d.%d.%d) " "reply (%d.%d.%d.%d/%d.%d.%d.%d) "
"- ignored\n", lp->name, "- ignored\n", lp->netdev->dev->name,
HIPQUAD(addr), HIPQUAD(mask)); HIPQUAD(addr), HIPQUAD(mask));
break; break;
case CISCO_SLARP_KEEPALIVE: case CISCO_SLARP_KEEPALIVE:
...@@ -1701,7 +1701,8 @@ isdn_net_ciscohdlck_slarp_in(isdn_net_local *lp, struct sk_buff *skb) ...@@ -1701,7 +1701,8 @@ isdn_net_ciscohdlck_slarp_in(isdn_net_local *lp, struct sk_buff *skb)
lp->cisco_last_slarp_in) { lp->cisco_last_slarp_in) {
printk(KERN_DEBUG "%s: Keepalive period mismatch - " printk(KERN_DEBUG "%s: Keepalive period mismatch - "
"is %d but should be %d.\n", "is %d but should be %d.\n",
lp->name, period, lp->cisco_keepalive_period); lp->netdev->dev->name, period,
lp->cisco_keepalive_period);
} }
lp->cisco_last_slarp_in = jiffies; lp->cisco_last_slarp_in = jiffies;
p += get_u32(p, &my_seq); p += get_u32(p, &my_seq);
...@@ -1732,12 +1733,12 @@ isdn_net_ciscohdlck_receive(isdn_net_local *lp, struct sk_buff *skb) ...@@ -1732,12 +1733,12 @@ isdn_net_ciscohdlck_receive(isdn_net_local *lp, struct sk_buff *skb)
if (addr != CISCO_ADDR_UNICAST && addr != CISCO_ADDR_BROADCAST) { if (addr != CISCO_ADDR_UNICAST && addr != CISCO_ADDR_BROADCAST) {
printk(KERN_WARNING "%s: Unknown Cisco addr 0x%02x\n", printk(KERN_WARNING "%s: Unknown Cisco addr 0x%02x\n",
lp->name, addr); lp->netdev->dev->name, addr);
goto out_free; goto out_free;
} }
if (ctrl != CISCO_CTRL) { if (ctrl != CISCO_CTRL) {
printk(KERN_WARNING "%s: Unknown Cisco ctrl 0x%02x\n", printk(KERN_WARNING "%s: Unknown Cisco ctrl 0x%02x\n",
lp->name, ctrl); lp->netdev->dev->name, ctrl);
goto out_free; goto out_free;
} }
...@@ -1748,7 +1749,8 @@ isdn_net_ciscohdlck_receive(isdn_net_local *lp, struct sk_buff *skb) ...@@ -1748,7 +1749,8 @@ isdn_net_ciscohdlck_receive(isdn_net_local *lp, struct sk_buff *skb)
case CISCO_TYPE_CDP: case CISCO_TYPE_CDP:
if (lp->cisco_debserint) if (lp->cisco_debserint)
printk(KERN_DEBUG "%s: Received CDP packet. use " printk(KERN_DEBUG "%s: Received CDP packet. use "
"\"no cdp enable\" on cisco.\n", lp->name); "\"no cdp enable\" on cisco.\n",
lp->netdev->dev->name);
goto out_free; goto out_free;
default: default:
/* no special cisco protocol */ /* no special cisco protocol */
...@@ -1843,7 +1845,7 @@ isdn_net_receive(struct net_device *ndev, struct sk_buff *skb) ...@@ -1843,7 +1845,7 @@ isdn_net_receive(struct net_device *ndev, struct sk_buff *skb)
}; };
#endif /* CONFIG_ISDN_X25 */ #endif /* CONFIG_ISDN_X25 */
printk(KERN_WARNING "%s: unknown encapsulation, dropping\n", printk(KERN_WARNING "%s: unknown encapsulation, dropping\n",
lp->name); lp->netdev->dev->name);
kfree_skb(skb); kfree_skb(skb);
return; return;
} }
...@@ -2174,7 +2176,7 @@ isdn_net_find_icall(int di, int ch, int idx, setup_parm *setup) ...@@ -2174,7 +2176,7 @@ isdn_net_find_icall(int di, int ch, int idx, setup_parm *setup)
wret = matchret; wret = matchret;
#ifdef ISDN_DEBUG_NET_ICALL #ifdef ISDN_DEBUG_NET_ICALL
printk(KERN_DEBUG "n_fi: if='%s', l.msn=%s, l.flags=%d, l.dstate=%d\n", printk(KERN_DEBUG "n_fi: if='%s', l.msn=%s, l.flags=%d, l.dstate=%d\n",
lp->name, lp->msn, lp->flags, lp->dialstate); p->dev->name, lp->msn, lp->flags, lp->dialstate);
#endif #endif
if ((!matchret) && /* EAZ is matching */ if ((!matchret) && /* EAZ is matching */
(((!(lp->flags & ISDN_NET_CONNECTED)) && /* but not connected */ (((!(lp->flags & ISDN_NET_CONNECTED)) && /* but not connected */
...@@ -2277,7 +2279,7 @@ isdn_net_find_icall(int di, int ch, int idx, setup_parm *setup) ...@@ -2277,7 +2279,7 @@ isdn_net_find_icall(int di, int ch, int idx, setup_parm *setup)
* */ * */
if (ISDN_NET_DIALMODE(*lp) == ISDN_NET_DM_OFF) { if (ISDN_NET_DIALMODE(*lp) == ISDN_NET_DM_OFF) {
printk(KERN_INFO "incoming call, interface %s `stopped' -> rejected\n", printk(KERN_INFO "incoming call, interface %s `stopped' -> rejected\n",
lp->name); p->dev->name);
return 3; return 3;
} }
/* /*
...@@ -2286,7 +2288,7 @@ isdn_net_find_icall(int di, int ch, int idx, setup_parm *setup) ...@@ -2286,7 +2288,7 @@ isdn_net_find_icall(int di, int ch, int idx, setup_parm *setup)
*/ */
if (!isdn_net_device_started(p)) { if (!isdn_net_device_started(p)) {
printk(KERN_INFO "%s: incoming call, interface down -> rejected\n", printk(KERN_INFO "%s: incoming call, interface down -> rejected\n",
lp->name); p->dev->name);
return 3; return 3;
} }
/* Interface is up, now see if it's a slave. If so, see if /* Interface is up, now see if it's a slave. If so, see if
...@@ -2294,8 +2296,8 @@ isdn_net_find_icall(int di, int ch, int idx, setup_parm *setup) ...@@ -2294,8 +2296,8 @@ isdn_net_find_icall(int di, int ch, int idx, setup_parm *setup)
*/ */
if (lp->master) { if (lp->master) {
isdn_net_local *mlp = (isdn_net_local *) lp->master->priv; isdn_net_local *mlp = (isdn_net_local *) lp->master->priv;
printk(KERN_DEBUG "ICALLslv: %s\n", lp->name); printk(KERN_DEBUG "ICALLslv: %s\n", p->dev->name);
printk(KERN_DEBUG "master=%s\n", mlp->name); printk(KERN_DEBUG "master=%s\n", lp->master->name);
if (mlp->flags & ISDN_NET_CONNECTED) { if (mlp->flags & ISDN_NET_CONNECTED) {
printk(KERN_DEBUG "master online\n"); printk(KERN_DEBUG "master online\n");
/* Master is online, find parent-slave (master if first slave) */ /* Master is online, find parent-slave (master if first slave) */
...@@ -2322,11 +2324,11 @@ isdn_net_find_icall(int di, int ch, int idx, setup_parm *setup) ...@@ -2322,11 +2324,11 @@ isdn_net_find_icall(int di, int ch, int idx, setup_parm *setup)
* */ * */
if (ISDN_NET_DIALMODE(*lp) == ISDN_NET_DM_OFF) { if (ISDN_NET_DIALMODE(*lp) == ISDN_NET_DM_OFF) {
printk(KERN_INFO "incoming call for callback, interface %s `off' -> rejected\n", printk(KERN_INFO "incoming call for callback, interface %s `off' -> rejected\n",
lp->name); p->dev->name);
return 3; return 3;
} }
printk(KERN_DEBUG "%s: call from %s -> %s, start callback\n", printk(KERN_DEBUG "%s: call from %s -> %s, start callback\n",
lp->name, nr, eaz); p->dev->name, nr, eaz);
if (lp->phone[1]) { if (lp->phone[1]) {
/* Grab a free ISDN-Channel */ /* Grab a free ISDN-Channel */
spin_lock_irqsave(&dev->lock, flags); spin_lock_irqsave(&dev->lock, flags);
...@@ -2340,7 +2342,8 @@ isdn_net_find_icall(int di, int ch, int idx, setup_parm *setup) ...@@ -2340,7 +2342,8 @@ isdn_net_find_icall(int di, int ch, int idx, setup_parm *setup)
lp->msn) lp->msn)
) < 0) { ) < 0) {
printk(KERN_WARNING "isdn_net_find_icall: No channel for %s\n", lp->name); printk(KERN_WARNING "isdn_net_find_icall: No channel for %s\n",
p->dev->name);
spin_unlock_irqrestore(&dev->lock, flags); spin_unlock_irqrestore(&dev->lock, flags);
return 0; return 0;
} }
...@@ -2361,11 +2364,12 @@ isdn_net_find_icall(int di, int ch, int idx, setup_parm *setup) ...@@ -2361,11 +2364,12 @@ isdn_net_find_icall(int di, int ch, int idx, setup_parm *setup)
/* Initiate dialing by returning 2 or 4 */ /* Initiate dialing by returning 2 or 4 */
return (lp->flags & ISDN_NET_CBHUP) ? 2 : 4; return (lp->flags & ISDN_NET_CBHUP) ? 2 : 4;
} else } else
printk(KERN_WARNING "isdn_net: %s: No phone number\n", lp->name); printk(KERN_WARNING "isdn_net: %s: No phone number\n",
p->dev->name);
return 0; return 0;
} else { } else {
printk(KERN_DEBUG "%s: call from %s -> %s accepted\n", lp->name, nr, printk(KERN_DEBUG "%s: call from %s -> %s accepted\n",
eaz); p->dev->name, nr, eaz);
/* if this interface is dialing, it does it probably on a different /* if this interface is dialing, it does it probably on a different
device, so free this device */ device, so free this device */
if ((lp->dialstate == 4) || (lp->dialstate == 12)) { if ((lp->dialstate == 4) || (lp->dialstate == 12)) {
...@@ -2424,7 +2428,7 @@ isdn_net_findif(char *name) ...@@ -2424,7 +2428,7 @@ isdn_net_findif(char *name)
isdn_net_dev *p = dev->netdev; isdn_net_dev *p = dev->netdev;
while (p) { while (p) {
if (!strcmp(p->local->name, name)) if (!strcmp(p->dev->name, name))
return p; return p;
p = (isdn_net_dev *) p->next; p = (isdn_net_dev *) p->next;
} }
...@@ -2453,7 +2457,8 @@ isdn_net_force_dial_lp(isdn_net_local * lp) ...@@ -2453,7 +2457,8 @@ isdn_net_force_dial_lp(isdn_net_local * lp)
lp->pre_device, lp->pre_device,
lp->pre_channel, lp->pre_channel,
lp->msn)) < 0) { lp->msn)) < 0) {
printk(KERN_WARNING "isdn_net_force_dial: No channel for %s\n", lp->name); printk(KERN_WARNING "isdn_net_force_dial: No channel for %s\n",
lp->netdev->dev->name);
spin_unlock_irqrestore(&dev->lock, flags); spin_unlock_irqrestore(&dev->lock, flags);
return -EAGAIN; return -EAGAIN;
} }
...@@ -2556,7 +2561,7 @@ isdn_net_new(char *name, struct net_device *master) ...@@ -2556,7 +2561,7 @@ isdn_net_new(char *name, struct net_device *master)
return NULL; return NULL;
} }
if (name == NULL) if (name == NULL)
name = " "; return NULL;
if (!(netdev = kzalloc(sizeof(isdn_net_dev), GFP_KERNEL))) { if (!(netdev = kzalloc(sizeof(isdn_net_dev), GFP_KERNEL))) {
printk(KERN_WARNING "isdn_net: Could not allocate net-device\n"); printk(KERN_WARNING "isdn_net: Could not allocate net-device\n");
return NULL; return NULL;
...@@ -2568,7 +2573,6 @@ isdn_net_new(char *name, struct net_device *master) ...@@ -2568,7 +2573,6 @@ isdn_net_new(char *name, struct net_device *master)
return NULL; return NULL;
} }
netdev->local = netdev->dev->priv; netdev->local = netdev->dev->priv;
strcpy(netdev->local->name, netdev->dev->name);
netdev->dev->init = isdn_net_init; netdev->dev->init = isdn_net_init;
if (master) { if (master) {
/* Device shall be a slave */ /* Device shall be a slave */
...@@ -2673,7 +2677,7 @@ isdn_net_setcfg(isdn_net_ioctl_cfg * cfg) ...@@ -2673,7 +2677,7 @@ isdn_net_setcfg(isdn_net_ioctl_cfg * cfg)
#endif #endif
if (isdn_net_device_started(p)) { if (isdn_net_device_started(p)) {
printk(KERN_WARNING "%s: cannot change encap when if is up\n", printk(KERN_WARNING "%s: cannot change encap when if is up\n",
lp->name); p->dev->name);
return -EBUSY; return -EBUSY;
} }
#ifdef CONFIG_ISDN_X25 #ifdef CONFIG_ISDN_X25
...@@ -2698,7 +2702,7 @@ isdn_net_setcfg(isdn_net_ioctl_cfg * cfg) ...@@ -2698,7 +2702,7 @@ isdn_net_setcfg(isdn_net_ioctl_cfg * cfg)
case ISDN_NET_ENCAP_SYNCPPP: case ISDN_NET_ENCAP_SYNCPPP:
#ifndef CONFIG_ISDN_PPP #ifndef CONFIG_ISDN_PPP
printk(KERN_WARNING "%s: SyncPPP support not configured\n", printk(KERN_WARNING "%s: SyncPPP support not configured\n",
lp->name); p->dev->name);
return -EINVAL; return -EINVAL;
#else #else
p->dev->type = ARPHRD_PPP; /* change ARP type */ p->dev->type = ARPHRD_PPP; /* change ARP type */
...@@ -2725,7 +2729,7 @@ isdn_net_setcfg(isdn_net_ioctl_cfg * cfg) ...@@ -2725,7 +2729,7 @@ isdn_net_setcfg(isdn_net_ioctl_cfg * cfg)
break; break;
printk(KERN_WARNING printk(KERN_WARNING
"%s: encapsulation protocol %d not supported\n", "%s: encapsulation protocol %d not supported\n",
p->local->name, cfg->p_encap); p->dev->name, cfg->p_encap);
return -EINVAL; return -EINVAL;
} }
if (strlen(cfg->drvid)) { if (strlen(cfg->drvid)) {
...@@ -2902,13 +2906,18 @@ isdn_net_getcfg(isdn_net_ioctl_cfg * cfg) ...@@ -2902,13 +2906,18 @@ isdn_net_getcfg(isdn_net_ioctl_cfg * cfg)
cfg->pppbind = lp->pppbind; cfg->pppbind = lp->pppbind;
cfg->dialtimeout = lp->dialtimeout >= 0 ? lp->dialtimeout / HZ : -1; cfg->dialtimeout = lp->dialtimeout >= 0 ? lp->dialtimeout / HZ : -1;
cfg->dialwait = lp->dialwait / HZ; cfg->dialwait = lp->dialwait / HZ;
if (lp->slave) if (lp->slave) {
strcpy(cfg->slave, ((isdn_net_local *) lp->slave->priv)->name); if (strlen(lp->slave->name) > 8)
else strcpy(cfg->slave, "too-long");
else
strcpy(cfg->slave, lp->slave->name);
} else
cfg->slave[0] = '\0'; cfg->slave[0] = '\0';
if (lp->master) if (lp->master) {
strcpy(cfg->master, ((isdn_net_local *) lp->master->priv)->name); if (strlen(lp->master->name) > 8)
else strcpy(cfg->master, "too-long");
strcpy(cfg->master, lp->master->name);
} else
cfg->master[0] = '\0'; cfg->master[0] = '\0';
return 0; return 0;
} }
...@@ -2978,7 +2987,8 @@ isdn_net_getpeer(isdn_net_ioctl_phone *phone, isdn_net_ioctl_phone __user *peer) ...@@ -2978,7 +2987,8 @@ isdn_net_getpeer(isdn_net_ioctl_phone *phone, isdn_net_ioctl_phone __user *peer)
isdn_net_dev *p = isdn_net_findif(phone->name); isdn_net_dev *p = isdn_net_findif(phone->name);
int ch, dv, idx; int ch, dv, idx;
if (!p) return -ENODEV; if (!p)
return -ENODEV;
/* /*
* Theoretical race: while this executes, the remote number might * Theoretical race: while this executes, the remote number might
* become invalid (hang up) or change (new connection), resulting * become invalid (hang up) or change (new connection), resulting
...@@ -2987,14 +2997,18 @@ isdn_net_getpeer(isdn_net_ioctl_phone *phone, isdn_net_ioctl_phone __user *peer) ...@@ -2987,14 +2997,18 @@ isdn_net_getpeer(isdn_net_ioctl_phone *phone, isdn_net_ioctl_phone __user *peer)
*/ */
ch = p->local->isdn_channel; ch = p->local->isdn_channel;
dv = p->local->isdn_device; dv = p->local->isdn_device;
if(ch<0 && dv<0) return -ENOTCONN; if(ch < 0 && dv < 0)
return -ENOTCONN;
idx = isdn_dc2minor(dv, ch); idx = isdn_dc2minor(dv, ch);
if (idx<0) return -ENODEV; if (idx <0 )
return -ENODEV;
/* for pre-bound channels, we need this extra check */ /* for pre-bound channels, we need this extra check */
if ( strncmp(dev->num[idx],"???",3) == 0 ) return -ENOTCONN; if (strncmp(dev->num[idx], "???", 3) == 0)
strncpy(phone->phone,dev->num[idx],ISDN_MSNLEN); return -ENOTCONN;
phone->outgoing=USG_OUTGOING(dev->usage[idx]); strncpy(phone->phone, dev->num[idx], ISDN_MSNLEN);
if ( copy_to_user(peer,phone,sizeof(*peer)) ) return -EFAULT; phone->outgoing = USG_OUTGOING(dev->usage[idx]);
if (copy_to_user(peer, phone, sizeof(*peer)))
return -EFAULT;
return 0; return 0;
} }
/* /*
...@@ -3113,18 +3127,18 @@ isdn_net_realrm(isdn_net_dev * p, isdn_net_dev * q) ...@@ -3113,18 +3127,18 @@ isdn_net_realrm(isdn_net_dev * p, isdn_net_dev * q)
dev->netdev = p->next; dev->netdev = p->next;
if (p->local->slave) { if (p->local->slave) {
/* If this interface has a slave, remove it also */ /* If this interface has a slave, remove it also */
char *slavename = ((isdn_net_local *) (p->local->slave->priv))->name; char *slavename = p->local->slave->name;
isdn_net_dev *n = dev->netdev; isdn_net_dev *n = dev->netdev;
q = NULL; q = NULL;
while (n) { while (n) {
if (!strcmp(n->local->name, slavename)) { if (!strcmp(n->dev->name, slavename)) {
spin_unlock_irqrestore(&dev->lock, flags); spin_unlock_irqrestore(&dev->lock, flags);
isdn_net_realrm(n, q); isdn_net_realrm(n, q);
spin_lock_irqsave(&dev->lock, flags); spin_lock_irqsave(&dev->lock, flags);
break; break;
} }
q = n; q = n;
n = (isdn_net_dev *) n->next; n = (isdn_net_dev *)n->next;
} }
} }
spin_unlock_irqrestore(&dev->lock, flags); spin_unlock_irqrestore(&dev->lock, flags);
...@@ -3152,7 +3166,7 @@ isdn_net_rm(char *name) ...@@ -3152,7 +3166,7 @@ isdn_net_rm(char *name)
p = dev->netdev; p = dev->netdev;
q = NULL; q = NULL;
while (p) { while (p) {
if (!strcmp(p->local->name, name)) { if (!strcmp(p->dev->name, name)) {
spin_unlock_irqrestore(&dev->lock, flags); spin_unlock_irqrestore(&dev->lock, flags);
return (isdn_net_realrm(p, q)); return (isdn_net_realrm(p, q));
} }
......
...@@ -190,9 +190,11 @@ isdn_ppp_bind(isdn_net_local * lp) ...@@ -190,9 +190,11 @@ isdn_ppp_bind(isdn_net_local * lp)
retval = -1; retval = -1;
goto out; goto out;
} }
unit = isdn_ppp_if_get_unit(lp->name); /* get unit number from interface name .. ugly! */ /* get unit number from interface name .. ugly! */
unit = isdn_ppp_if_get_unit(lp->netdev->dev->name);
if (unit < 0) { if (unit < 0) {
printk(KERN_ERR "isdn_ppp_bind: illegal interface name %s.\n", lp->name); printk(KERN_ERR "isdn_ppp_bind: illegal interface name %s.\n",
lp->netdev->dev->name);
retval = -1; retval = -1;
goto out; goto out;
} }
...@@ -507,7 +509,8 @@ isdn_ppp_ioctl(int min, struct file *file, unsigned int cmd, unsigned long arg) ...@@ -507,7 +509,8 @@ isdn_ppp_ioctl(int min, struct file *file, unsigned int cmd, unsigned long arg)
case PPPIOCGIFNAME: case PPPIOCGIFNAME:
if(!lp) if(!lp)
return -EINVAL; return -EINVAL;
if ((r = set_arg(argp, lp->name, strlen(lp->name)))) if ((r = set_arg(argp, lp->netdev->dev->name,
strlen(lp->netdev->dev->name))))
return r; return r;
break; break;
case PPPIOCGMPFLAGS: /* get configuration flags */ case PPPIOCGMPFLAGS: /* get configuration flags */
......
...@@ -286,7 +286,6 @@ typedef struct { ...@@ -286,7 +286,6 @@ typedef struct {
/* Local interface-data */ /* Local interface-data */
typedef struct isdn_net_local_s { typedef struct isdn_net_local_s {
ulong magic; ulong magic;
char name[10]; /* Name of device */
struct net_device_stats stats; /* Ethernet Statistics */ struct net_device_stats stats; /* Ethernet Statistics */
int isdn_device; /* Index to isdn-device */ int isdn_device; /* Index to isdn-device */
int isdn_channel; /* Index to isdn-channel */ int isdn_channel; /* Index to isdn-channel */
......
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