aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/isdn')
-rw-r--r--drivers/isdn/Kconfig2
-rw-r--r--drivers/isdn/capi/capi.c36
-rw-r--r--drivers/isdn/gigaset/common.c1
-rw-r--r--drivers/isdn/hisax/callc.c2
-rw-r--r--drivers/isdn/i4l/Kconfig2
-rw-r--r--drivers/isdn/i4l/isdn_common.c4
-rw-r--r--drivers/isdn/i4l/isdn_tty.c4
-rw-r--r--drivers/isdn/mISDN/l1oip_core.c5
-rw-r--r--drivers/isdn/mISDN/tei.c20
9 files changed, 36 insertions, 40 deletions
diff --git a/drivers/isdn/Kconfig b/drivers/isdn/Kconfig
index a233ed53913a..86cd75a0e84d 100644
--- a/drivers/isdn/Kconfig
+++ b/drivers/isdn/Kconfig
@@ -4,7 +4,7 @@
4 4
5menuconfig ISDN 5menuconfig ISDN
6 bool "ISDN support" 6 bool "ISDN support"
7 depends on NET 7 depends on NET && NETDEVICES
8 depends on !S390 && !UML 8 depends on !S390 && !UML
9 ---help--- 9 ---help---
10 ISDN ("Integrated Services Digital Network", called RNIS in France) 10 ISDN ("Integrated Services Digital Network", called RNIS in France)
diff --git a/drivers/isdn/capi/capi.c b/drivers/isdn/capi/capi.c
index c679867c2ccd..89562a845f6a 100644
--- a/drivers/isdn/capi/capi.c
+++ b/drivers/isdn/capi/capi.c
@@ -77,8 +77,6 @@ struct ackqueue_entry {
77}; 77};
78 78
79struct capiminor { 79struct capiminor {
80 struct kref kref;
81
82 unsigned int minor; 80 unsigned int minor;
83 81
84 struct capi20_appl *ap; 82 struct capi20_appl *ap;
@@ -190,7 +188,20 @@ static void capiminor_del_all_ack(struct capiminor *mp)
190 188
191/* -------- struct capiminor ---------------------------------------- */ 189/* -------- struct capiminor ---------------------------------------- */
192 190
193static const struct tty_port_operations capiminor_port_ops; /* we have none */ 191static void capiminor_destroy(struct tty_port *port)
192{
193 struct capiminor *mp = container_of(port, struct capiminor, port);
194
195 kfree_skb(mp->outskb);
196 skb_queue_purge(&mp->inqueue);
197 skb_queue_purge(&mp->outqueue);
198 capiminor_del_all_ack(mp);
199 kfree(mp);
200}
201
202static const struct tty_port_operations capiminor_port_ops = {
203 .destruct = capiminor_destroy,
204};
194 205
195static struct capiminor *capiminor_alloc(struct capi20_appl *ap, u32 ncci) 206static struct capiminor *capiminor_alloc(struct capi20_appl *ap, u32 ncci)
196{ 207{
@@ -204,8 +215,6 @@ static struct capiminor *capiminor_alloc(struct capi20_appl *ap, u32 ncci)
204 return NULL; 215 return NULL;
205 } 216 }
206 217
207 kref_init(&mp->kref);
208
209 mp->ap = ap; 218 mp->ap = ap;
210 mp->ncci = ncci; 219 mp->ncci = ncci;
211 INIT_LIST_HEAD(&mp->ackqueue); 220 INIT_LIST_HEAD(&mp->ackqueue);
@@ -247,21 +256,10 @@ err_out2:
247 spin_unlock(&capiminors_lock); 256 spin_unlock(&capiminors_lock);
248 257
249err_out1: 258err_out1:
250 kfree(mp); 259 tty_port_put(&mp->port);
251 return NULL; 260 return NULL;
252} 261}
253 262
254static void capiminor_destroy(struct kref *kref)
255{
256 struct capiminor *mp = container_of(kref, struct capiminor, kref);
257
258 kfree_skb(mp->outskb);
259 skb_queue_purge(&mp->inqueue);
260 skb_queue_purge(&mp->outqueue);
261 capiminor_del_all_ack(mp);
262 kfree(mp);
263}
264
265static struct capiminor *capiminor_get(unsigned int minor) 263static struct capiminor *capiminor_get(unsigned int minor)
266{ 264{
267 struct capiminor *mp; 265 struct capiminor *mp;
@@ -269,7 +267,7 @@ static struct capiminor *capiminor_get(unsigned int minor)
269 spin_lock(&capiminors_lock); 267 spin_lock(&capiminors_lock);
270 mp = capiminors[minor]; 268 mp = capiminors[minor];
271 if (mp) 269 if (mp)
272 kref_get(&mp->kref); 270 tty_port_get(&mp->port);
273 spin_unlock(&capiminors_lock); 271 spin_unlock(&capiminors_lock);
274 272
275 return mp; 273 return mp;
@@ -277,7 +275,7 @@ static struct capiminor *capiminor_get(unsigned int minor)
277 275
278static inline void capiminor_put(struct capiminor *mp) 276static inline void capiminor_put(struct capiminor *mp)
279{ 277{
280 kref_put(&mp->kref, capiminor_destroy); 278 tty_port_put(&mp->port);
281} 279}
282 280
283static void capiminor_free(struct capiminor *mp) 281static void capiminor_free(struct capiminor *mp)
diff --git a/drivers/isdn/gigaset/common.c b/drivers/isdn/gigaset/common.c
index 30a6b174fbb0..6849a11a1b24 100644
--- a/drivers/isdn/gigaset/common.c
+++ b/drivers/isdn/gigaset/common.c
@@ -507,6 +507,7 @@ void gigaset_freecs(struct cardstate *cs)
507 gig_dbg(DEBUG_INIT, "clearing at_state"); 507 gig_dbg(DEBUG_INIT, "clearing at_state");
508 clear_at_state(&cs->at_state); 508 clear_at_state(&cs->at_state);
509 dealloc_temp_at_states(cs); 509 dealloc_temp_at_states(cs);
510 tty_port_destroy(&cs->port);
510 511
511 /* fall through */ 512 /* fall through */
512 case 0: /* error in basic setup */ 513 case 0: /* error in basic setup */
diff --git a/drivers/isdn/hisax/callc.c b/drivers/isdn/hisax/callc.c
index a47637be0cc5..ddec47a911a0 100644
--- a/drivers/isdn/hisax/callc.c
+++ b/drivers/isdn/hisax/callc.c
@@ -35,7 +35,7 @@ static int chancount;
35/* experimental REJECT after ALERTING for CALLBACK to beat the 4s delay */ 35/* experimental REJECT after ALERTING for CALLBACK to beat the 4s delay */
36#define ALERT_REJECT 0 36#define ALERT_REJECT 0
37 37
38/* Value to delay the sending of the first B-channel paket after CONNECT 38/* Value to delay the sending of the first B-channel packet after CONNECT
39 * here is no value given by ITU, but experience shows that 300 ms will 39 * here is no value given by ITU, but experience shows that 300 ms will
40 * work on many networks, if you or your other side is behind local exchanges 40 * work on many networks, if you or your other side is behind local exchanges
41 * a greater value may be recommented. If the delay is to short the first paket 41 * a greater value may be recommented. If the delay is to short the first paket
diff --git a/drivers/isdn/i4l/Kconfig b/drivers/isdn/i4l/Kconfig
index 2302fbe70ac6..9c6650ea848e 100644
--- a/drivers/isdn/i4l/Kconfig
+++ b/drivers/isdn/i4l/Kconfig
@@ -6,7 +6,7 @@ if ISDN_I4L
6 6
7config ISDN_PPP 7config ISDN_PPP
8 bool "Support synchronous PPP" 8 bool "Support synchronous PPP"
9 depends on INET && NETDEVICES 9 depends on INET
10 select SLHC 10 select SLHC
11 help 11 help
12 Over digital connections such as ISDN, there is no need to 12 Over digital connections such as ISDN, there is no need to
diff --git a/drivers/isdn/i4l/isdn_common.c b/drivers/isdn/i4l/isdn_common.c
index 8c610fa6782b..e2a945ee9f05 100644
--- a/drivers/isdn/i4l/isdn_common.c
+++ b/drivers/isdn/i4l/isdn_common.c
@@ -1312,7 +1312,6 @@ isdn_ioctl(struct file *file, uint cmd, ulong arg)
1312 } else 1312 } else
1313 return -EINVAL; 1313 return -EINVAL;
1314 break; 1314 break;
1315#ifdef CONFIG_NETDEVICES
1316 case IIOCNETGPN: 1315 case IIOCNETGPN:
1317 /* Get peer phone number of a connected 1316 /* Get peer phone number of a connected
1318 * isdn network interface */ 1317 * isdn network interface */
@@ -1322,7 +1321,6 @@ isdn_ioctl(struct file *file, uint cmd, ulong arg)
1322 return isdn_net_getpeer(&phone, argp); 1321 return isdn_net_getpeer(&phone, argp);
1323 } else 1322 } else
1324 return -EINVAL; 1323 return -EINVAL;
1325#endif
1326 default: 1324 default:
1327 return -EINVAL; 1325 return -EINVAL;
1328 } 1326 }
@@ -1352,7 +1350,6 @@ isdn_ioctl(struct file *file, uint cmd, ulong arg)
1352 case IIOCNETLCR: 1350 case IIOCNETLCR:
1353 printk(KERN_INFO "INFO: ISDN_ABC_LCR_SUPPORT not enabled\n"); 1351 printk(KERN_INFO "INFO: ISDN_ABC_LCR_SUPPORT not enabled\n");
1354 return -ENODEV; 1352 return -ENODEV;
1355#ifdef CONFIG_NETDEVICES
1356 case IIOCNETAIF: 1353 case IIOCNETAIF:
1357 /* Add a network-interface */ 1354 /* Add a network-interface */
1358 if (arg) { 1355 if (arg) {
@@ -1491,7 +1488,6 @@ isdn_ioctl(struct file *file, uint cmd, ulong arg)
1491 return -EFAULT; 1488 return -EFAULT;
1492 return isdn_net_force_hangup(name); 1489 return isdn_net_force_hangup(name);
1493 break; 1490 break;
1494#endif /* CONFIG_NETDEVICES */
1495 case IIOCSETVER: 1491 case IIOCSETVER:
1496 dev->net_verbose = arg; 1492 dev->net_verbose = arg;
1497 printk(KERN_INFO "isdn: Verbose-Level is %d\n", dev->net_verbose); 1493 printk(KERN_INFO "isdn: Verbose-Level is %d\n", dev->net_verbose);
diff --git a/drivers/isdn/i4l/isdn_tty.c b/drivers/isdn/i4l/isdn_tty.c
index b817809f763c..e09dc8a5e743 100644
--- a/drivers/isdn/i4l/isdn_tty.c
+++ b/drivers/isdn/i4l/isdn_tty.c
@@ -1849,6 +1849,8 @@ err_unregister:
1849 kfree(info->fax); 1849 kfree(info->fax);
1850#endif 1850#endif
1851 kfree(info->port.xmit_buf - 4); 1851 kfree(info->port.xmit_buf - 4);
1852 info->port.xmit_buf = NULL;
1853 tty_port_destroy(&info->port);
1852 } 1854 }
1853 tty_unregister_driver(m->tty_modem); 1855 tty_unregister_driver(m->tty_modem);
1854err: 1856err:
@@ -1870,6 +1872,8 @@ isdn_tty_exit(void)
1870 kfree(info->fax); 1872 kfree(info->fax);
1871#endif 1873#endif
1872 kfree(info->port.xmit_buf - 4); 1874 kfree(info->port.xmit_buf - 4);
1875 info->port.xmit_buf = NULL;
1876 tty_port_destroy(&info->port);
1873 } 1877 }
1874 tty_unregister_driver(dev->mdm.tty_modem); 1878 tty_unregister_driver(dev->mdm.tty_modem);
1875 put_tty_driver(dev->mdm.tty_modem); 1879 put_tty_driver(dev->mdm.tty_modem);
diff --git a/drivers/isdn/mISDN/l1oip_core.c b/drivers/isdn/mISDN/l1oip_core.c
index db50f788855d..f8e405c383a0 100644
--- a/drivers/isdn/mISDN/l1oip_core.c
+++ b/drivers/isdn/mISDN/l1oip_core.c
@@ -277,7 +277,6 @@ l1oip_socket_send(struct l1oip *hc, u8 localcodec, u8 channel, u32 chanmask,
277 u16 timebase, u8 *buf, int len) 277 u16 timebase, u8 *buf, int len)
278{ 278{
279 u8 *p; 279 u8 *p;
280 int multi = 0;
281 u8 frame[len + 32]; 280 u8 frame[len + 32];
282 struct socket *socket = NULL; 281 struct socket *socket = NULL;
283 282
@@ -317,9 +316,7 @@ l1oip_socket_send(struct l1oip *hc, u8 localcodec, u8 channel, u32 chanmask,
317 *p++ = hc->id >> 8; 316 *p++ = hc->id >> 8;
318 *p++ = hc->id; 317 *p++ = hc->id;
319 } 318 }
320 *p++ = (multi == 1) ? 0x80 : 0x00 + channel; /* m-flag, channel */ 319 *p++ = 0x00 + channel; /* m-flag, channel */
321 if (multi == 1)
322 *p++ = len; /* length */
323 *p++ = timebase >> 8; /* time base */ 320 *p++ = timebase >> 8; /* time base */
324 *p++ = timebase; 321 *p++ = timebase;
325 322
diff --git a/drivers/isdn/mISDN/tei.c b/drivers/isdn/mISDN/tei.c
index be88728f1106..592f597d8951 100644
--- a/drivers/isdn/mISDN/tei.c
+++ b/drivers/isdn/mISDN/tei.c
@@ -250,7 +250,7 @@ tei_debug(struct FsmInst *fi, char *fmt, ...)
250static int 250static int
251get_free_id(struct manager *mgr) 251get_free_id(struct manager *mgr)
252{ 252{
253 u64 ids = 0; 253 DECLARE_BITMAP(ids, 64) = { [0 ... BITS_TO_LONGS(64) - 1] = 0 };
254 int i; 254 int i;
255 struct layer2 *l2; 255 struct layer2 *l2;
256 256
@@ -261,11 +261,11 @@ get_free_id(struct manager *mgr)
261 __func__); 261 __func__);
262 return -EBUSY; 262 return -EBUSY;
263 } 263 }
264 test_and_set_bit(l2->ch.nr, (u_long *)&ids); 264 __set_bit(l2->ch.nr, ids);
265 } 265 }
266 for (i = 1; i < 64; i++) 266 i = find_next_zero_bit(ids, 64, 1);
267 if (!test_bit(i, (u_long *)&ids)) 267 if (i < 64)
268 return i; 268 return i;
269 printk(KERN_WARNING "%s: more as 63 layer2 for one device\n", 269 printk(KERN_WARNING "%s: more as 63 layer2 for one device\n",
270 __func__); 270 __func__);
271 return -EBUSY; 271 return -EBUSY;
@@ -274,7 +274,7 @@ get_free_id(struct manager *mgr)
274static int 274static int
275get_free_tei(struct manager *mgr) 275get_free_tei(struct manager *mgr)
276{ 276{
277 u64 ids = 0; 277 DECLARE_BITMAP(ids, 64) = { [0 ... BITS_TO_LONGS(64) - 1] = 0 };
278 int i; 278 int i;
279 struct layer2 *l2; 279 struct layer2 *l2;
280 280
@@ -288,11 +288,11 @@ get_free_tei(struct manager *mgr)
288 continue; 288 continue;
289 i -= 64; 289 i -= 64;
290 290
291 test_and_set_bit(i, (u_long *)&ids); 291 __set_bit(i, ids);
292 } 292 }
293 for (i = 0; i < 64; i++) 293 i = find_first_zero_bit(ids, 64);
294 if (!test_bit(i, (u_long *)&ids)) 294 if (i < 64)
295 return i + 64; 295 return i + 64;
296 printk(KERN_WARNING "%s: more as 63 dynamic tei for one device\n", 296 printk(KERN_WARNING "%s: more as 63 dynamic tei for one device\n",
297 __func__); 297 __func__);
298 return -1; 298 return -1;