Commit 0bba2356 authored by Kai Germaschewski's avatar Kai Germaschewski

ISDN: Assorted cleanups

Remove the legacy functions
  
    isdn_slot_readbchan(int slot, u_char *, u_char *, int);
    isdn_slot_driver(int slot);
    isdn_slot_channel(int slot);
    isdn_slot_set_usage(int slot, int usage);
    isdn_drv_writebuf_skb(int di, int ch, int x, struct sk_buff *skb);
    isdn_drv_hdrlen(int di);
  
Most of their tasks have been taken over by isdn_common.c, or are
obsoleted by using the isdn_slot based approach.
parent 620a0018
......@@ -517,8 +517,6 @@ isdn_audio_eval_dtmf(modem_info * info)
dtmf_state *s;
int silence;
int i;
int di;
int ch;
unsigned long flags;
int grp[2];
char what;
......@@ -563,8 +561,6 @@ isdn_audio_eval_dtmf(modem_info * info)
ISDN_AUDIO_SKB_LOCK(skb) = 0;
save_flags(flags);
cli();
di = isdn_slot_driver(info->isdn_slot);
ch = isdn_slot_channel(info->isdn_slot);
isdn_tty_queue_tail(info, skb, 2);
restore_flags(flags);
/* Schedule dequeuing */
......@@ -658,8 +654,6 @@ isdn_audio_put_dle_code(modem_info * info, u_char code)
{
struct sk_buff *skb;
unsigned long flags;
int di;
int ch;
char *p;
skb = dev_alloc_skb(2);
......@@ -682,8 +676,6 @@ isdn_audio_put_dle_code(modem_info * info, u_char code)
ISDN_AUDIO_SKB_LOCK(skb) = 0;
save_flags(flags);
cli();
di = isdn_slot_driver(info->isdn_slot);
ch = isdn_slot_channel(info->isdn_slot);
isdn_tty_queue_tail(info, skb, 2);
restore_flags(flags);
/* Schedule dequeuing */
......
This diff is collapsed.
......@@ -86,12 +86,9 @@ extern int isdn_slot_command(int slot, int cmd, isdn_ctrl *);
extern int isdn_slot_dial(int slot, struct dial_info *dial);
extern char *isdn_slot_map_eaz2msn(int slot, char *msn);
extern int isdn_slot_write(int slot, struct sk_buff *);
extern int isdn_slot_readbchan(int slot, u_char *, u_char *, int);
extern int isdn_slot_hdrlen(int slot);
extern int isdn_slot_driver(int slot);
extern int isdn_slot_channel(int slot);
extern int isdn_slot_maxbufsize(int slot);
extern int isdn_slot_usage(int slot);
extern void isdn_slot_set_usage(int slot, int usage);
extern char *isdn_slot_num(int slot);
extern int isdn_slot_m_idx(int slot);
extern void isdn_slot_set_m_idx(int slot, int midx);
......@@ -99,8 +96,5 @@ extern void isdn_slot_set_priv(int sl, int usage, void *priv, int (*stat_cb)(in
extern void *isdn_slot_priv(int sl);
extern int isdn_hard_header_len(void);
int isdn_drv_maxbufsize(int di);
int isdn_drv_writebuf_skb(int di, int ch, int x, struct sk_buff *skb);
int isdn_drv_hdrlen(int di);
int isdn_drv_lookup(char *drvid);
char *isdn_drv_drvid(int di);
......@@ -1431,9 +1431,6 @@ isdn_net_dev_icall(isdn_net_dev *idev, int di, int ch, int si1,
if (*my_eaz == 'b' || *my_eaz == 'B')
my_eaz++; /* skip to allow a match */
}
if (!USG_NONE(isdn_slot_usage(slot))) // FIXME?
return 0;
/* check called number */
switch (isdn_msncmp(eaz, my_eaz)) {
case 1: /* no match */
......
......@@ -873,7 +873,6 @@ isdn_tty_suspend(char *id, modem_info * info, atemu * m)
cmd.parm.cmsg.Length = l+18;
cmd.parm.cmsg.Command = CAPI_FACILITY;
cmd.parm.cmsg.Subcommand = CAPI_REQ;
cmd.parm.cmsg.adr.Controller = isdn_slot_driver(info->isdn_slot) + 1;
cmd.parm.cmsg.para[0] = 3; /* 16 bit 0x0003 suplementary service */
cmd.parm.cmsg.para[1] = 0;
cmd.parm.cmsg.para[2] = l + 3;
......@@ -933,7 +932,6 @@ isdn_tty_resume(char *id, modem_info * info, atemu * m)
info->isdn_slot = i;
isdn_slot_set_m_idx(i, info->line);
isdn_slot_set_priv(i, ISDN_USAGE_MODEM, info, isdn_tty_stat_callback, isdn_tty_rcv_skb);
isdn_slot_set_usage(i, isdn_slot_usage(i) | ISDN_USAGE_OUTGOING);
info->last_dir = 1;
// strcpy(info->last_num, n);
restore_flags(flags);
......@@ -945,7 +943,6 @@ isdn_tty_resume(char *id, modem_info * info, atemu * m)
cmd.parm.cmsg.Length = l+18;
cmd.parm.cmsg.Command = CAPI_FACILITY;
cmd.parm.cmsg.Subcommand = CAPI_REQ;
cmd.parm.cmsg.adr.Controller = isdn_slot_driver(info->isdn_slot) + 1;
cmd.parm.cmsg.para[0] = 3; /* 16 bit 0x0003 suplementary service */
cmd.parm.cmsg.para[1] = 0;
cmd.parm.cmsg.para[2] = l+3;
......@@ -1010,7 +1007,6 @@ isdn_tty_send_msg(modem_info * info, atemu * m, char *msg)
info->isdn_slot = i;
isdn_slot_set_m_idx(i, info->line);
isdn_slot_set_priv(i, ISDN_USAGE_MODEM, info, isdn_tty_stat_callback, isdn_tty_rcv_skb);
isdn_slot_set_usage(i, isdn_slot_usage(i) | ISDN_USAGE_OUTGOING);
info->last_dir = 1;
restore_flags(flags);
info->last_l2 = l2;
......@@ -1021,7 +1017,6 @@ isdn_tty_send_msg(modem_info * info, atemu * m, char *msg)
cmd.parm.cmsg.Length = l+14;
cmd.parm.cmsg.Command = CAPI_MANUFACTURER;
cmd.parm.cmsg.Subcommand = CAPI_REQ;
cmd.parm.cmsg.adr.Controller = isdn_slot_driver(info->isdn_slot) + 1;
cmd.parm.cmsg.para[0] = l+1;
strncpy(&cmd.parm.cmsg.para[1], msg, l);
cmd.parm.cmsg.para[l+1] = 0xd;
......@@ -1193,7 +1188,6 @@ isdn_tty_write(struct tty_struct *tty, int from_user, const u_char * buf, int co
{
int c;
int total = 0;
int di;
modem_info *info = (modem_info *) tty->driver_data;
atemu *m = &info->emu;
......@@ -1207,12 +1201,8 @@ isdn_tty_write(struct tty_struct *tty, int from_user, const u_char * buf, int co
c = count;
if (c > info->xmit_size - info->xmit_count)
c = info->xmit_size - info->xmit_count;
if (info->isdn_slot >= 0)
di = isdn_slot_driver(info->isdn_slot);
else
di = -1;
if (di >= 0 && c > isdn_drv_maxbufsize(di))
c = isdn_drv_maxbufsize(di);
if (info->isdn_slot >= 0 && c > isdn_slot_maxbufsize(info->isdn_slot))
c = isdn_slot_maxbufsize(info->isdn_slot);
if (c <= 0)
break;
if ((info->online > 1)
......@@ -2295,13 +2285,12 @@ isdn_tty_find_icall(int di, int ch, int sl, setup_parm *setup)
if (!matchret) { /* EAZ is matching */
info->isdn_slot = idx;
isdn_slot_set_m_idx(idx, info->line);
isdn_slot_set_priv(idx, ISDN_USAGE_MODEM, info, isdn_tty_stat_callback, isdn_tty_rcv_skb);
isdn_slot_set_priv(idx, isdn_calc_usage(si1, info->emu.mdmreg[REG_L2PROT]), info, isdn_tty_stat_callback, isdn_tty_rcv_skb);
strcpy(isdn_slot_num(idx), nr);
strcpy(info->emu.cpn, eaz);
info->emu.mdmreg[REG_SI1I] = si2bit[si1];
info->emu.mdmreg[REG_PLAN] = setup->plan;
info->emu.mdmreg[REG_SCREEN] = setup->screen;
isdn_slot_set_usage(idx, (isdn_slot_usage(idx) & ISDN_USAGE_EXCLUSIVE) | isdn_calc_usage(si1, info->emu.mdmreg[REG_L2PROT]));
restore_flags(flags);
printk(KERN_INFO "isdn_tty: call from %s, -> RING on ttyI%d\n", nr,
info->line);
......@@ -2450,18 +2439,6 @@ isdn_tty_stat_callback(int i, isdn_ctrl *c)
return 1;
}
break;
case ISDN_STAT_UNLOAD:
#ifdef ISDN_TTY_STAT_DEBUG
printk(KERN_DEBUG "tty_STAT_UNLOAD ttyI%d\n", info->line);
#endif
for (i = 0; i < ISDN_MAX_CHANNELS; i++) {
info = &isdn_mdm.info[i];
if (isdn_slot_driver(info->isdn_slot) == c->driver) {
if (info->online)
isdn_tty_modem_hup(info, 1);
}
}
return 1;
#ifdef CONFIG_ISDN_TTY_FAX
case ISDN_STAT_FAXIND:
if (TTY_IS_ACTIVE(info)) {
......@@ -2508,7 +2485,6 @@ isdn_tty_at_cout(char *msg, modem_info * info)
ulong flags;
struct sk_buff *skb = 0;
char *sp = 0;
int di,ch;
if (!msg) {
printk(KERN_WARNING "isdn_tty: Null-Message in isdn_tty_at_cout\n");
......@@ -2524,11 +2500,6 @@ isdn_tty_at_cout(char *msg, modem_info * info)
/* use queue instead of direct flip, if online and */
/* data is in queue or flip buffer is full */
if (info->isdn_slot >= 0) {
di = isdn_slot_driver(info->isdn_slot); ch = isdn_slot_channel(info->isdn_slot);
} else {
di = -1; ch = -1;
}
if ((info->online) && (((tty->flip.count + strlen(msg)) >= TTY_FLIPBUF_SIZE) ||
(!skb_queue_empty(&info->rpqueue)))) {
skb = alloc_skb(strlen(msg)
......
......@@ -511,7 +511,7 @@ isdn_v110_encode(isdn_v110_stream * v, struct sk_buff *skb)
}
int
isdn_v110_stat_callback(struct isdn_v110 *iv110, isdn_ctrl *c)
isdn_v110_stat_callback(int sl, struct isdn_v110 *iv110, isdn_ctrl *c)
{
isdn_v110_stream *v = NULL;
int i;
......@@ -543,7 +543,7 @@ isdn_v110_stat_callback(struct isdn_v110 *iv110, isdn_ctrl *c)
else
skb = isdn_v110_idle(v);
if (skb) {
if (isdn_drv_writebuf_skb(c->driver, c->arg, 1, skb) <= 0) {
if (isdn_slot_write(sl, skb) <= 0) {
dev_kfree_skb(skb);
break;
} else {
......@@ -570,8 +570,8 @@ isdn_v110_stat_callback(struct isdn_v110 *iv110, isdn_ctrl *c)
break;
case ISDN_STAT_BCONN:
if (iv110->v110emu && (iv110->v110 == NULL)) {
int hdrlen = isdn_drv_hdrlen(c->driver);
int maxsize = isdn_drv_maxbufsize(c->driver);
int hdrlen = isdn_slot_hdrlen(sl);
int maxsize = isdn_slot_maxbufsize(sl);
atomic_inc(&iv110->v110use);
switch (iv110->v110emu) {
case ISDN_PROTO_L2_V11096:
......@@ -588,7 +588,7 @@ isdn_v110_stat_callback(struct isdn_v110 *iv110, isdn_ctrl *c)
if ((v = iv110->v110)) {
while (v->SyncInit) {
struct sk_buff *skb = isdn_v110_sync(v);
if (isdn_drv_writebuf_skb(c->driver, c->arg, 1, skb) <= 0) {
if (isdn_slot_write(sl, skb) <= 0) {
dev_kfree_skb(skb);
/* Unable to send, try later */
break;
......
......@@ -26,7 +26,7 @@ extern struct sk_buff *isdn_v110_encode(isdn_v110_stream *, struct sk_buff *);
*/
extern struct sk_buff *isdn_v110_decode(isdn_v110_stream *, struct sk_buff *);
extern int isdn_v110_stat_callback(struct isdn_v110 *v110, isdn_ctrl *);
extern int isdn_v110_stat_callback(int sl, struct isdn_v110 *v110, isdn_ctrl *);
extern void isdn_v110_close(isdn_v110_stream * v);
#endif
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