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