Commit 9a812553 authored by Andreas Eversberg's avatar Andreas Eversberg Committed by Karsten Keil

mISDN: Correct busy device detection

Correct busy device detection.
This fix belongs to last commit.
Signed-off-by: default avatarAndreas Eversberg <andreas@eversberg.eu>
Signed-off-by: default avatarKarsten Keil <kkeil@suse.de>
parent 1b4d3312
...@@ -483,22 +483,24 @@ data_sock_bind(struct socket *sock, struct sockaddr *addr, int addr_len) ...@@ -483,22 +483,24 @@ data_sock_bind(struct socket *sock, struct sockaddr *addr, int addr_len)
goto done; goto done;
} }
read_lock_bh(&data_sockets.lock); if (sk->sk_protocol < ISDN_P_B_START) {
sk_for_each(csk, node, &data_sockets.head) { read_lock_bh(&data_sockets.lock);
if (sk == csk) sk_for_each(csk, node, &data_sockets.head) {
continue; if (sk == csk)
if (_pms(csk)->dev != _pms(sk)->dev) continue;
continue; if (_pms(csk)->dev != _pms(sk)->dev)
if (csk->sk_protocol >= ISDN_P_B_START) continue;
continue; if (csk->sk_protocol >= ISDN_P_B_START)
if (IS_ISDN_P_TE(csk->sk_protocol) continue;
== IS_ISDN_P_TE(sk->sk_protocol)) if (IS_ISDN_P_TE(csk->sk_protocol)
continue; == IS_ISDN_P_TE(sk->sk_protocol))
continue;
read_unlock_bh(&data_sockets.lock);
err = -EBUSY;
goto done;
}
read_unlock_bh(&data_sockets.lock); read_unlock_bh(&data_sockets.lock);
err = -EBUSY;
goto done;
} }
read_unlock_bh(&data_sockets.lock);
_pms(sk)->ch.send = mISDN_send; _pms(sk)->ch.send = mISDN_send;
_pms(sk)->ch.ctrl = mISDN_ctrl; _pms(sk)->ch.ctrl = mISDN_ctrl;
......
...@@ -446,7 +446,8 @@ connect_layer1(struct mISDNdevice *dev, struct mISDNchannel *ch, ...@@ -446,7 +446,8 @@ connect_layer1(struct mISDNdevice *dev, struct mISDNchannel *ch,
rq.protocol = protocol; rq.protocol = protocol;
rq.adr.channel = adr->channel; rq.adr.channel = adr->channel;
err = dev->D.ctrl(&dev->D, OPEN_CHANNEL, &rq); err = dev->D.ctrl(&dev->D, OPEN_CHANNEL, &rq);
printk(KERN_DEBUG "%s: ret 1 %d\n", __func__, err); printk(KERN_DEBUG "%s: ret %d (dev %d)\n", __func__, err,
dev->id);
if (err) if (err)
return err; return err;
write_lock_bh(&dev->D.st->l1sock.lock); write_lock_bh(&dev->D.st->l1sock.lock);
......
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