From 8e6c8aa3b52e573a6db1f58b2ba9a9106a012963 Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Thu, 18 Apr 2019 22:45:09 +0200 Subject: isdn: gigaset: remove i4l support isdn4linux is getting removed, and the gigaset driver can still use the CAPI support, so this can all go away. Signed-off-by: Arnd Bergmann --- drivers/isdn/gigaset/Kconfig | 9 - drivers/isdn/gigaset/Makefile | 10 +- drivers/isdn/gigaset/i4l.c | 695 ------------------------------------------ 3 files changed, 7 insertions(+), 707 deletions(-) delete mode 100644 drivers/isdn/gigaset/i4l.c (limited to 'drivers/isdn') diff --git a/drivers/isdn/gigaset/Kconfig b/drivers/isdn/gigaset/Kconfig index fe41e9cfb672..c593105b3600 100644 --- a/drivers/isdn/gigaset/Kconfig +++ b/drivers/isdn/gigaset/Kconfig @@ -30,15 +30,6 @@ config GIGASET_CAPI Say N to build the old native ISDN4Linux variant. If unsure, say Y. -config GIGASET_I4L - bool - depends on ISDN_I4L='y'||(ISDN_I4L='m'&&ISDN_DRV_GIGASET='m') - default !GIGASET_CAPI - -config GIGASET_DUMMYLL - bool - default !GIGASET_CAPI&&!GIGASET_I4L - config GIGASET_BASE tristate "Gigaset base station support" depends on USB diff --git a/drivers/isdn/gigaset/Makefile b/drivers/isdn/gigaset/Makefile index ac45a2739f56..9c010891dcd7 100644 --- a/drivers/isdn/gigaset/Makefile +++ b/drivers/isdn/gigaset/Makefile @@ -1,8 +1,12 @@ # SPDX-License-Identifier: GPL-2.0 gigaset-y := common.o interface.o proc.o ev-layer.o asyncdata.o -gigaset-$(CONFIG_GIGASET_CAPI) += capi.o -gigaset-$(CONFIG_GIGASET_I4L) += i4l.o -gigaset-$(CONFIG_GIGASET_DUMMYLL) += dummyll.o + +ifdef CONFIG_GIGASET_CAPI +gigaset-y += capi.o +else +gigaset-y += dummyll.o +endif + usb_gigaset-y := usb-gigaset.o ser_gigaset-y := ser-gigaset.o bas_gigaset-y := bas-gigaset.o isocdata.o diff --git a/drivers/isdn/gigaset/i4l.c b/drivers/isdn/gigaset/i4l.c deleted file mode 100644 index b5b389e95edd..000000000000 --- a/drivers/isdn/gigaset/i4l.c +++ /dev/null @@ -1,695 +0,0 @@ -/* - * Stuff used by all variants of the driver - * - * Copyright (c) 2001 by Stefan Eilers, - * Hansjoerg Lipp , - * Tilman Schmidt . - * - * ===================================================================== - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * ===================================================================== - */ - -#include "gigaset.h" -#include -#include - -#define SBUFSIZE 4096 /* sk_buff payload size */ -#define TRANSBUFSIZE 768 /* bytes per skb for transparent receive */ -#define HW_HDR_LEN 2 /* Header size used to store ack info */ -#define MAX_BUF_SIZE (SBUFSIZE - HW_HDR_LEN) /* max data packet from LL */ - -/* == Handling of I4L IO =====================================================*/ - -/* writebuf_from_LL - * called by LL to transmit data on an open channel - * inserts the buffer data into the send queue and starts the transmission - * Note that this operation must not sleep! - * When the buffer is processed completely, gigaset_skb_sent() should be called. - * parameters: - * driverID driver ID as assigned by LL - * channel channel number - * ack if != 0 LL wants to be notified on completion via - * statcallb(ISDN_STAT_BSENT) - * skb skb containing data to send - * return value: - * number of accepted bytes - * 0 if temporarily unable to accept data (out of buffer space) - * <0 on error (eg. -EINVAL) - */ -static int writebuf_from_LL(int driverID, int channel, int ack, - struct sk_buff *skb) -{ - struct cardstate *cs = gigaset_get_cs_by_id(driverID); - struct bc_state *bcs; - unsigned char *ack_header; - unsigned len; - - if (!cs) { - pr_err("%s: invalid driver ID (%d)\n", __func__, driverID); - return -ENODEV; - } - if (channel < 0 || channel >= cs->channels) { - dev_err(cs->dev, "%s: invalid channel ID (%d)\n", - __func__, channel); - return -ENODEV; - } - bcs = &cs->bcs[channel]; - - /* can only handle linear sk_buffs */ - if (skb_linearize(skb) < 0) { - dev_err(cs->dev, "%s: skb_linearize failed\n", __func__); - return -ENOMEM; - } - len = skb->len; - - gig_dbg(DEBUG_LLDATA, - "Receiving data from LL (id: %d, ch: %d, ack: %d, sz: %d)", - driverID, channel, ack, len); - - if (!len) { - if (ack) - dev_notice(cs->dev, "%s: not ACKing empty packet\n", - __func__); - return 0; - } - if (len > MAX_BUF_SIZE) { - dev_err(cs->dev, "%s: packet too large (%d bytes)\n", - __func__, len); - return -EINVAL; - } - - /* set up acknowledgement header */ - if (skb_headroom(skb) < HW_HDR_LEN) { - /* should never happen */ - dev_err(cs->dev, "%s: insufficient skb headroom\n", __func__); - return -ENOMEM; - } - skb_set_mac_header(skb, -HW_HDR_LEN); - skb->mac_len = HW_HDR_LEN; - ack_header = skb_mac_header(skb); - if (ack) { - ack_header[0] = len & 0xff; - ack_header[1] = len >> 8; - } else { - ack_header[0] = ack_header[1] = 0; - } - gig_dbg(DEBUG_MCMD, "skb: len=%u, ack=%d: %02x %02x", - len, ack, ack_header[0], ack_header[1]); - - /* pass to device-specific module */ - return cs->ops->send_skb(bcs, skb); -} - -/** - * gigaset_skb_sent() - acknowledge sending an skb - * @bcs: B channel descriptor structure. - * @skb: sent data. - * - * Called by hardware module {bas,ser,usb}_gigaset when the data in a - * skb has been successfully sent, for signalling completion to the LL. - */ -void gigaset_skb_sent(struct bc_state *bcs, struct sk_buff *skb) -{ - isdn_if *iif = bcs->cs->iif; - unsigned char *ack_header = skb_mac_header(skb); - unsigned len; - isdn_ctrl response; - - ++bcs->trans_up; - - if (skb->len) - dev_warn(bcs->cs->dev, "%s: skb->len==%d\n", - __func__, skb->len); - - len = ack_header[0] + ((unsigned) ack_header[1] << 8); - if (len) { - gig_dbg(DEBUG_MCMD, "ACKing to LL (id: %d, ch: %d, sz: %u)", - bcs->cs->myid, bcs->channel, len); - - response.driver = bcs->cs->myid; - response.command = ISDN_STAT_BSENT; - response.arg = bcs->channel; - response.parm.length = len; - iif->statcallb(&response); - } -} -EXPORT_SYMBOL_GPL(gigaset_skb_sent); - -/** - * gigaset_skb_rcvd() - pass received skb to LL - * @bcs: B channel descriptor structure. - * @skb: received data. - * - * Called by hardware module {bas,ser,usb}_gigaset when user data has - * been successfully received, for passing to the LL. - * Warning: skb must not be accessed anymore! - */ -void gigaset_skb_rcvd(struct bc_state *bcs, struct sk_buff *skb) -{ - isdn_if *iif = bcs->cs->iif; - - iif->rcvcallb_skb(bcs->cs->myid, bcs->channel, skb); - bcs->trans_down++; -} -EXPORT_SYMBOL_GPL(gigaset_skb_rcvd); - -/** - * gigaset_isdn_rcv_err() - signal receive error - * @bcs: B channel descriptor structure. - * - * Called by hardware module {bas,ser,usb}_gigaset when a receive error - * has occurred, for signalling to the LL. - */ -void gigaset_isdn_rcv_err(struct bc_state *bcs) -{ - isdn_if *iif = bcs->cs->iif; - isdn_ctrl response; - - /* if currently ignoring packets, just count down */ - if (bcs->ignore) { - bcs->ignore--; - return; - } - - /* update statistics */ - bcs->corrupted++; - - /* error -> LL */ - gig_dbg(DEBUG_CMD, "sending L1ERR"); - response.driver = bcs->cs->myid; - response.command = ISDN_STAT_L1ERR; - response.arg = bcs->channel; - response.parm.errcode = ISDN_STAT_L1ERR_RECV; - iif->statcallb(&response); -} -EXPORT_SYMBOL_GPL(gigaset_isdn_rcv_err); - -/* This function will be called by LL to send commands - * NOTE: LL ignores the returned value, for commands other than ISDN_CMD_IOCTL, - * so don't put too much effort into it. - */ -static int command_from_LL(isdn_ctrl *cntrl) -{ - struct cardstate *cs; - struct bc_state *bcs; - int retval = 0; - char **commands; - int ch; - int i; - size_t l; - - gig_dbg(DEBUG_CMD, "driver: %d, command: %d, arg: 0x%lx", - cntrl->driver, cntrl->command, cntrl->arg); - - cs = gigaset_get_cs_by_id(cntrl->driver); - if (cs == NULL) { - pr_err("%s: invalid driver ID (%d)\n", __func__, cntrl->driver); - return -ENODEV; - } - ch = cntrl->arg & 0xff; - - switch (cntrl->command) { - case ISDN_CMD_IOCTL: - dev_warn(cs->dev, "ISDN_CMD_IOCTL not supported\n"); - return -EINVAL; - - case ISDN_CMD_DIAL: - gig_dbg(DEBUG_CMD, - "ISDN_CMD_DIAL (phone: %s, msn: %s, si1: %d, si2: %d)", - cntrl->parm.setup.phone, cntrl->parm.setup.eazmsn, - cntrl->parm.setup.si1, cntrl->parm.setup.si2); - - if (ch >= cs->channels) { - dev_err(cs->dev, - "ISDN_CMD_DIAL: invalid channel (%d)\n", ch); - return -EINVAL; - } - bcs = cs->bcs + ch; - if (gigaset_get_channel(bcs) < 0) { - dev_err(cs->dev, "ISDN_CMD_DIAL: channel not free\n"); - return -EBUSY; - } - switch (bcs->proto2) { - case L2_HDLC: - bcs->rx_bufsize = SBUFSIZE; - break; - default: /* assume transparent */ - bcs->rx_bufsize = TRANSBUFSIZE; - } - dev_kfree_skb(bcs->rx_skb); - gigaset_new_rx_skb(bcs); - - commands = kcalloc(AT_NUM, sizeof(*commands), GFP_ATOMIC); - if (!commands) { - gigaset_free_channel(bcs); - dev_err(cs->dev, "ISDN_CMD_DIAL: out of memory\n"); - return -ENOMEM; - } - - l = 3 + strlen(cntrl->parm.setup.phone); - commands[AT_DIAL] = kmalloc(l, GFP_ATOMIC); - if (!commands[AT_DIAL]) - goto oom; - if (cntrl->parm.setup.phone[0] == '*' && - cntrl->parm.setup.phone[1] == '*') { - /* internal call: translate ** prefix to CTP value */ - commands[AT_TYPE] = kstrdup("^SCTP=0\r", GFP_ATOMIC); - if (!commands[AT_TYPE]) - goto oom; - snprintf(commands[AT_DIAL], l, - "D%s\r", cntrl->parm.setup.phone + 2); - } else { - commands[AT_TYPE] = kstrdup("^SCTP=1\r", GFP_ATOMIC); - if (!commands[AT_TYPE]) - goto oom; - snprintf(commands[AT_DIAL], l, - "D%s\r", cntrl->parm.setup.phone); - } - - l = strlen(cntrl->parm.setup.eazmsn); - if (l) { - l += 8; - commands[AT_MSN] = kmalloc(l, GFP_ATOMIC); - if (!commands[AT_MSN]) - goto oom; - snprintf(commands[AT_MSN], l, "^SMSN=%s\r", - cntrl->parm.setup.eazmsn); - } - - switch (cntrl->parm.setup.si1) { - case 1: /* audio */ - /* BC = 9090A3: 3.1 kHz audio, A-law */ - commands[AT_BC] = kstrdup("^SBC=9090A3\r", GFP_ATOMIC); - if (!commands[AT_BC]) - goto oom; - break; - case 7: /* data */ - default: /* hope the app knows what it is doing */ - /* BC = 8890: unrestricted digital information */ - commands[AT_BC] = kstrdup("^SBC=8890\r", GFP_ATOMIC); - if (!commands[AT_BC]) - goto oom; - } - /* ToDo: other si1 values, inspect si2, set HLC/LLC */ - - commands[AT_PROTO] = kmalloc(9, GFP_ATOMIC); - if (!commands[AT_PROTO]) - goto oom; - snprintf(commands[AT_PROTO], 9, "^SBPR=%u\r", bcs->proto2); - - commands[AT_ISO] = kmalloc(9, GFP_ATOMIC); - if (!commands[AT_ISO]) - goto oom; - snprintf(commands[AT_ISO], 9, "^SISO=%u\r", - (unsigned) bcs->channel + 1); - - if (!gigaset_add_event(cs, &bcs->at_state, EV_DIAL, commands, - bcs->at_state.seq_index, NULL)) { - for (i = 0; i < AT_NUM; ++i) - kfree(commands[i]); - kfree(commands); - gigaset_free_channel(bcs); - return -ENOMEM; - } - gigaset_schedule_event(cs); - break; - case ISDN_CMD_ACCEPTD: - gig_dbg(DEBUG_CMD, "ISDN_CMD_ACCEPTD"); - if (ch >= cs->channels) { - dev_err(cs->dev, - "ISDN_CMD_ACCEPTD: invalid channel (%d)\n", ch); - return -EINVAL; - } - bcs = cs->bcs + ch; - switch (bcs->proto2) { - case L2_HDLC: - bcs->rx_bufsize = SBUFSIZE; - break; - default: /* assume transparent */ - bcs->rx_bufsize = TRANSBUFSIZE; - } - dev_kfree_skb(bcs->rx_skb); - gigaset_new_rx_skb(bcs); - if (!gigaset_add_event(cs, &bcs->at_state, - EV_ACCEPT, NULL, 0, NULL)) - return -ENOMEM; - gigaset_schedule_event(cs); - - break; - case ISDN_CMD_HANGUP: - gig_dbg(DEBUG_CMD, "ISDN_CMD_HANGUP"); - if (ch >= cs->channels) { - dev_err(cs->dev, - "ISDN_CMD_HANGUP: invalid channel (%d)\n", ch); - return -EINVAL; - } - bcs = cs->bcs + ch; - if (!gigaset_add_event(cs, &bcs->at_state, - EV_HUP, NULL, 0, NULL)) - return -ENOMEM; - gigaset_schedule_event(cs); - - break; - case ISDN_CMD_CLREAZ: /* Do not signal incoming signals */ - dev_info(cs->dev, "ignoring ISDN_CMD_CLREAZ\n"); - break; - case ISDN_CMD_SETEAZ: /* Signal incoming calls for given MSN */ - dev_info(cs->dev, "ignoring ISDN_CMD_SETEAZ (%s)\n", - cntrl->parm.num); - break; - case ISDN_CMD_SETL2: /* Set L2 to given protocol */ - if (ch >= cs->channels) { - dev_err(cs->dev, - "ISDN_CMD_SETL2: invalid channel (%d)\n", ch); - return -EINVAL; - } - bcs = cs->bcs + ch; - if (bcs->chstate & CHS_D_UP) { - dev_err(cs->dev, - "ISDN_CMD_SETL2: channel active (%d)\n", ch); - return -EINVAL; - } - switch (cntrl->arg >> 8) { - case ISDN_PROTO_L2_HDLC: - gig_dbg(DEBUG_CMD, "ISDN_CMD_SETL2: setting L2_HDLC"); - bcs->proto2 = L2_HDLC; - break; - case ISDN_PROTO_L2_TRANS: - gig_dbg(DEBUG_CMD, "ISDN_CMD_SETL2: setting L2_VOICE"); - bcs->proto2 = L2_VOICE; - break; - default: - dev_err(cs->dev, - "ISDN_CMD_SETL2: unsupported protocol (%lu)\n", - cntrl->arg >> 8); - return -EINVAL; - } - break; - case ISDN_CMD_SETL3: /* Set L3 to given protocol */ - gig_dbg(DEBUG_CMD, "ISDN_CMD_SETL3"); - if (ch >= cs->channels) { - dev_err(cs->dev, - "ISDN_CMD_SETL3: invalid channel (%d)\n", ch); - return -EINVAL; - } - - if (cntrl->arg >> 8 != ISDN_PROTO_L3_TRANS) { - dev_err(cs->dev, - "ISDN_CMD_SETL3: unsupported protocol (%lu)\n", - cntrl->arg >> 8); - return -EINVAL; - } - - break; - - default: - gig_dbg(DEBUG_CMD, "unknown command %d from LL", - cntrl->command); - return -EINVAL; - } - - return retval; - -oom: - dev_err(bcs->cs->dev, "out of memory\n"); - for (i = 0; i < AT_NUM; ++i) - kfree(commands[i]); - kfree(commands); - gigaset_free_channel(bcs); - return -ENOMEM; -} - -static void gigaset_i4l_cmd(struct cardstate *cs, int cmd) -{ - isdn_if *iif = cs->iif; - isdn_ctrl command; - - command.driver = cs->myid; - command.command = cmd; - command.arg = 0; - iif->statcallb(&command); -} - -static void gigaset_i4l_channel_cmd(struct bc_state *bcs, int cmd) -{ - isdn_if *iif = bcs->cs->iif; - isdn_ctrl command; - - command.driver = bcs->cs->myid; - command.command = cmd; - command.arg = bcs->channel; - iif->statcallb(&command); -} - -/** - * gigaset_isdn_icall() - signal incoming call - * @at_state: connection state structure. - * - * Called by main module to notify the LL that an incoming call has been - * received. @at_state contains the parameters of the call. - * - * Return value: call disposition (ICALL_*) - */ -int gigaset_isdn_icall(struct at_state_t *at_state) -{ - struct cardstate *cs = at_state->cs; - struct bc_state *bcs = at_state->bcs; - isdn_if *iif = cs->iif; - isdn_ctrl response; - int retval; - - /* fill ICALL structure */ - response.parm.setup.si1 = 0; /* default: unknown */ - response.parm.setup.si2 = 0; - response.parm.setup.screen = 0; - response.parm.setup.plan = 0; - if (!at_state->str_var[STR_ZBC]) { - /* no BC (internal call): assume speech, A-law */ - response.parm.setup.si1 = 1; - } else if (!strcmp(at_state->str_var[STR_ZBC], "8890")) { - /* unrestricted digital information */ - response.parm.setup.si1 = 7; - } else if (!strcmp(at_state->str_var[STR_ZBC], "8090A3")) { - /* speech, A-law */ - response.parm.setup.si1 = 1; - } else if (!strcmp(at_state->str_var[STR_ZBC], "9090A3")) { - /* 3,1 kHz audio, A-law */ - response.parm.setup.si1 = 1; - response.parm.setup.si2 = 2; - } else { - dev_warn(cs->dev, "RING ignored - unsupported BC %s\n", - at_state->str_var[STR_ZBC]); - return ICALL_IGNORE; - } - if (at_state->str_var[STR_NMBR]) { - strlcpy(response.parm.setup.phone, at_state->str_var[STR_NMBR], - sizeof response.parm.setup.phone); - } else - response.parm.setup.phone[0] = 0; - if (at_state->str_var[STR_ZCPN]) { - strlcpy(response.parm.setup.eazmsn, at_state->str_var[STR_ZCPN], - sizeof response.parm.setup.eazmsn); - } else - response.parm.setup.eazmsn[0] = 0; - - if (!bcs) { - dev_notice(cs->dev, "no channel for incoming call\n"); - response.command = ISDN_STAT_ICALLW; - response.arg = 0; - } else { - gig_dbg(DEBUG_CMD, "Sending ICALL"); - response.command = ISDN_STAT_ICALL; - response.arg = bcs->channel; - } - response.driver = cs->myid; - retval = iif->statcallb(&response); - gig_dbg(DEBUG_CMD, "Response: %d", retval); - switch (retval) { - case 0: /* no takers */ - return ICALL_IGNORE; - case 1: /* alerting */ - bcs->chstate |= CHS_NOTIFY_LL; - return ICALL_ACCEPT; - case 2: /* reject */ - return ICALL_REJECT; - case 3: /* incomplete */ - dev_warn(cs->dev, - "LL requested unsupported feature: Incomplete Number\n"); - return ICALL_IGNORE; - case 4: /* proceeding */ - /* Gigaset will send ALERTING anyway. - * There doesn't seem to be a way to avoid this. - */ - return ICALL_ACCEPT; - case 5: /* deflect */ - dev_warn(cs->dev, - "LL requested unsupported feature: Call Deflection\n"); - return ICALL_IGNORE; - default: - dev_err(cs->dev, "LL error %d on ICALL\n", retval); - return ICALL_IGNORE; - } -} - -/** - * gigaset_isdn_connD() - signal D channel connect - * @bcs: B channel descriptor structure. - * - * Called by main module to notify the LL that the D channel connection has - * been established. - */ -void gigaset_isdn_connD(struct bc_state *bcs) -{ - gig_dbg(DEBUG_CMD, "sending DCONN"); - gigaset_i4l_channel_cmd(bcs, ISDN_STAT_DCONN); -} - -/** - * gigaset_isdn_hupD() - signal D channel hangup - * @bcs: B channel descriptor structure. - * - * Called by main module to notify the LL that the D channel connection has - * been shut down. - */ -void gigaset_isdn_hupD(struct bc_state *bcs) -{ - gig_dbg(DEBUG_CMD, "sending DHUP"); - gigaset_i4l_channel_cmd(bcs, ISDN_STAT_DHUP); -} - -/** - * gigaset_isdn_connB() - signal B channel connect - * @bcs: B channel descriptor structure. - * - * Called by main module to notify the LL that the B channel connection has - * been established. - */ -void gigaset_isdn_connB(struct bc_state *bcs) -{ - gig_dbg(DEBUG_CMD, "sending BCONN"); - gigaset_i4l_channel_cmd(bcs, ISDN_STAT_BCONN); -} - -/** - * gigaset_isdn_hupB() - signal B channel hangup - * @bcs: B channel descriptor structure. - * - * Called by main module to notify the LL that the B channel connection has - * been shut down. - */ -void gigaset_isdn_hupB(struct bc_state *bcs) -{ - gig_dbg(DEBUG_CMD, "sending BHUP"); - gigaset_i4l_channel_cmd(bcs, ISDN_STAT_BHUP); -} - -/** - * gigaset_isdn_start() - signal device availability - * @cs: device descriptor structure. - * - * Called by main module to notify the LL that the device is available for - * use. - */ -void gigaset_isdn_start(struct cardstate *cs) -{ - gig_dbg(DEBUG_CMD, "sending RUN"); - gigaset_i4l_cmd(cs, ISDN_STAT_RUN); -} - -/** - * gigaset_isdn_stop() - signal device unavailability - * @cs: device descriptor structure. - * - * Called by main module to notify the LL that the device is no longer - * available for use. - */ -void gigaset_isdn_stop(struct cardstate *cs) -{ - gig_dbg(DEBUG_CMD, "sending STOP"); - gigaset_i4l_cmd(cs, ISDN_STAT_STOP); -} - -/** - * gigaset_isdn_regdev() - register to LL - * @cs: device descriptor structure. - * @isdnid: device name. - * - * Return value: 0 on success, error code < 0 on failure - */ -int gigaset_isdn_regdev(struct cardstate *cs, const char *isdnid) -{ - isdn_if *iif; - - iif = kmalloc(sizeof *iif, GFP_KERNEL); - if (!iif) { - pr_err("out of memory\n"); - return -ENOMEM; - } - - if (snprintf(iif->id, sizeof iif->id, "%s_%u", isdnid, cs->minor_index) - >= sizeof iif->id) { - pr_err("ID too long: %s\n", isdnid); - kfree(iif); - return -EINVAL; - } - - iif->owner = THIS_MODULE; - iif->channels = cs->channels; - iif->maxbufsize = MAX_BUF_SIZE; - iif->features = ISDN_FEATURE_L2_TRANS | - ISDN_FEATURE_L2_HDLC | - ISDN_FEATURE_L2_X75I | - ISDN_FEATURE_L3_TRANS | - ISDN_FEATURE_P_EURO; - iif->hl_hdrlen = HW_HDR_LEN; /* Area for storing ack */ - iif->command = command_from_LL; - iif->writebuf_skb = writebuf_from_LL; - iif->writecmd = NULL; /* Don't support isdnctrl */ - iif->readstat = NULL; /* Don't support isdnctrl */ - iif->rcvcallb_skb = NULL; /* Will be set by LL */ - iif->statcallb = NULL; /* Will be set by LL */ - - if (!register_isdn(iif)) { - pr_err("register_isdn failed\n"); - kfree(iif); - return -EINVAL; - } - - cs->iif = iif; - cs->myid = iif->channels; /* Set my device id */ - cs->hw_hdr_len = HW_HDR_LEN; - return 0; -} - -/** - * gigaset_isdn_unregdev() - unregister device from LL - * @cs: device descriptor structure. - */ -void gigaset_isdn_unregdev(struct cardstate *cs) -{ - gig_dbg(DEBUG_CMD, "sending UNLOAD"); - gigaset_i4l_cmd(cs, ISDN_STAT_UNLOAD); - kfree(cs->iif); - cs->iif = NULL; -} - -/** - * gigaset_isdn_regdrv() - register driver to LL - */ -void gigaset_isdn_regdrv(void) -{ - pr_info("ISDN4Linux interface\n"); - /* nothing to do */ -} - -/** - * gigaset_isdn_unregdrv() - unregister driver from LL - */ -void gigaset_isdn_unregdrv(void) -{ - /* nothing to do */ -} -- cgit v1.2.3 From 85993b8c9786fb24975dbcabebb1c75790d4fb6a Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Thu, 18 Apr 2019 22:47:35 +0200 Subject: isdn: remove hisax driver With the decline of ISDN, this seems to have become almost completely obsolete, and even in the past years before that, almost all remaining users appear to have used mISDN instead. Birger Harzenetter noted that he is still using i4l/hisax to take advantage of the 'divert' driver for call diversion, but otherwise uses mISDN on the same hardware. This is a rare edge case as far as I can tell, but we are still breaking an actively used work flow (see https://xkcd.com/1172/). We debated moving i4l/hisax to staging as an intermediate step, but as he is not likely to change the setup, and that would just delay breaking this use case. The alternatives here are to stay on stable kernels < 5.2, to create an external driver repository for isdn4linux, or to add divert functionality to mISDN. Cc: Birger Harzenetter Signed-off-by: Arnd Bergmann --- drivers/isdn/Makefile | 1 - drivers/isdn/hisax/Kconfig | 423 ----- drivers/isdn/hisax/Makefile | 60 - drivers/isdn/hisax/amd7930_fn.c | 794 --------- drivers/isdn/hisax/amd7930_fn.h | 37 - drivers/isdn/hisax/arcofi.c | 131 -- drivers/isdn/hisax/arcofi.h | 27 - drivers/isdn/hisax/asuscom.c | 423 ----- drivers/isdn/hisax/avm_a1.c | 307 ---- drivers/isdn/hisax/avm_a1p.c | 267 --- drivers/isdn/hisax/avm_pci.c | 904 ---------- drivers/isdn/hisax/avma1_cs.c | 162 -- drivers/isdn/hisax/bkm_a4t.c | 358 ---- drivers/isdn/hisax/bkm_a8.c | 433 ----- drivers/isdn/hisax/bkm_ax.h | 119 -- drivers/isdn/hisax/callc.c | 1792 ------------------- drivers/isdn/hisax/config.c | 1993 --------------------- drivers/isdn/hisax/diva.c | 1282 -------------- drivers/isdn/hisax/elsa.c | 1245 -------------- drivers/isdn/hisax/elsa_cs.c | 218 --- drivers/isdn/hisax/elsa_ser.c | 659 ------- drivers/isdn/hisax/enternow_pci.c | 420 ----- drivers/isdn/hisax/fsm.c | 161 -- drivers/isdn/hisax/fsm.h | 61 - drivers/isdn/hisax/gazel.c | 691 -------- drivers/isdn/hisax/hfc4s8s_l1.c | 1584 ----------------- drivers/isdn/hisax/hfc4s8s_l1.h | 89 - drivers/isdn/hisax/hfc_2bds0.c | 1078 ------------ drivers/isdn/hisax/hfc_2bds0.h | 128 -- drivers/isdn/hisax/hfc_2bs0.c | 591 ------- drivers/isdn/hisax/hfc_2bs0.h | 60 - drivers/isdn/hisax/hfc_pci.c | 1755 ------------------- drivers/isdn/hisax/hfc_pci.h | 235 --- drivers/isdn/hisax/hfc_sx.c | 1517 ---------------- drivers/isdn/hisax/hfc_sx.h | 196 --- drivers/isdn/hisax/hfc_usb.c | 1608 ----------------- drivers/isdn/hisax/hfc_usb.h | 208 --- drivers/isdn/hisax/hfcscard.c | 261 --- drivers/isdn/hisax/hisax.h | 1352 --------------- drivers/isdn/hisax/hisax_cfg.h | 66 - drivers/isdn/hisax/hisax_debug.h | 80 - drivers/isdn/hisax/hisax_fcpcipnp.c | 1024 ----------- drivers/isdn/hisax/hisax_fcpcipnp.h | 58 - drivers/isdn/hisax/hisax_if.h | 66 - drivers/isdn/hisax/hisax_isac.c | 895 ---------- drivers/isdn/hisax/hisax_isac.h | 46 - drivers/isdn/hisax/hscx.c | 277 --- drivers/isdn/hisax/hscx.h | 41 - drivers/isdn/hisax/hscx_irq.c | 294 ---- drivers/isdn/hisax/icc.c | 680 -------- drivers/isdn/hisax/icc.h | 72 - drivers/isdn/hisax/ipac.h | 29 - drivers/isdn/hisax/ipacx.c | 913 ---------- drivers/isdn/hisax/ipacx.h | 162 -- drivers/isdn/hisax/isac.c | 681 -------- drivers/isdn/hisax/isac.h | 70 - drivers/isdn/hisax/isar.c | 1910 --------------------- drivers/isdn/hisax/isar.h | 222 --- drivers/isdn/hisax/isdnl1.c | 930 ---------- drivers/isdn/hisax/isdnl1.h | 32 - drivers/isdn/hisax/isdnl2.c | 1839 -------------------- drivers/isdn/hisax/isdnl2.h | 25 - drivers/isdn/hisax/isdnl3.c | 594 ------- drivers/isdn/hisax/isdnl3.h | 42 - drivers/isdn/hisax/isurf.c | 305 ---- drivers/isdn/hisax/ix1_micro.c | 316 ---- drivers/isdn/hisax/jade.c | 305 ---- drivers/isdn/hisax/jade.h | 134 -- drivers/isdn/hisax/jade_irq.c | 238 --- drivers/isdn/hisax/l3_1tr6.c | 932 ---------- drivers/isdn/hisax/l3_1tr6.h | 164 -- drivers/isdn/hisax/l3dss1.c | 3227 ----------------------------------- drivers/isdn/hisax/l3dss1.h | 124 -- drivers/isdn/hisax/l3ni1.c | 3182 ---------------------------------- drivers/isdn/hisax/l3ni1.h | 136 -- drivers/isdn/hisax/lmgr.c | 50 - drivers/isdn/hisax/mic.c | 235 --- drivers/isdn/hisax/netjet.c | 985 ----------- drivers/isdn/hisax/netjet.h | 69 - drivers/isdn/hisax/niccy.c | 380 ----- drivers/isdn/hisax/nj_s.c | 294 ---- drivers/isdn/hisax/nj_u.c | 258 --- drivers/isdn/hisax/q931.c | 1513 ---------------- drivers/isdn/hisax/s0box.c | 260 --- drivers/isdn/hisax/saphir.c | 296 ---- drivers/isdn/hisax/sedlbauer.c | 873 ---------- drivers/isdn/hisax/sedlbauer_cs.c | 209 --- drivers/isdn/hisax/sportster.c | 267 --- drivers/isdn/hisax/st5481.h | 529 ------ drivers/isdn/hisax/st5481_b.c | 380 ----- drivers/isdn/hisax/st5481_d.c | 780 --------- drivers/isdn/hisax/st5481_init.c | 221 --- drivers/isdn/hisax/st5481_usb.c | 659 ------- drivers/isdn/hisax/tei.c | 465 ----- drivers/isdn/hisax/teleint.c | 334 ---- drivers/isdn/hisax/teles0.c | 364 ---- drivers/isdn/hisax/teles3.c | 498 ------ drivers/isdn/hisax/teles_cs.c | 201 --- drivers/isdn/hisax/telespci.c | 349 ---- drivers/isdn/hisax/w6692.c | 1085 ------------ drivers/isdn/hisax/w6692.h | 184 -- drivers/isdn/i4l/Kconfig | 2 - 102 files changed, 55481 deletions(-) delete mode 100644 drivers/isdn/hisax/Kconfig delete mode 100644 drivers/isdn/hisax/Makefile delete mode 100644 drivers/isdn/hisax/amd7930_fn.c delete mode 100644 drivers/isdn/hisax/amd7930_fn.h delete mode 100644 drivers/isdn/hisax/arcofi.c delete mode 100644 drivers/isdn/hisax/arcofi.h delete mode 100644 drivers/isdn/hisax/asuscom.c delete mode 100644 drivers/isdn/hisax/avm_a1.c delete mode 100644 drivers/isdn/hisax/avm_a1p.c delete mode 100644 drivers/isdn/hisax/avm_pci.c delete mode 100644 drivers/isdn/hisax/avma1_cs.c delete mode 100644 drivers/isdn/hisax/bkm_a4t.c delete mode 100644 drivers/isdn/hisax/bkm_a8.c delete mode 100644 drivers/isdn/hisax/bkm_ax.h delete mode 100644 drivers/isdn/hisax/callc.c delete mode 100644 drivers/isdn/hisax/config.c delete mode 100644 drivers/isdn/hisax/diva.c delete mode 100644 drivers/isdn/hisax/elsa.c delete mode 100644 drivers/isdn/hisax/elsa_cs.c delete mode 100644 drivers/isdn/hisax/elsa_ser.c delete mode 100644 drivers/isdn/hisax/enternow_pci.c delete mode 100644 drivers/isdn/hisax/fsm.c delete mode 100644 drivers/isdn/hisax/fsm.h delete mode 100644 drivers/isdn/hisax/gazel.c delete mode 100644 drivers/isdn/hisax/hfc4s8s_l1.c delete mode 100644 drivers/isdn/hisax/hfc4s8s_l1.h delete mode 100644 drivers/isdn/hisax/hfc_2bds0.c delete mode 100644 drivers/isdn/hisax/hfc_2bds0.h delete mode 100644 drivers/isdn/hisax/hfc_2bs0.c delete mode 100644 drivers/isdn/hisax/hfc_2bs0.h delete mode 100644 drivers/isdn/hisax/hfc_pci.c delete mode 100644 drivers/isdn/hisax/hfc_pci.h delete mode 100644 drivers/isdn/hisax/hfc_sx.c delete mode 100644 drivers/isdn/hisax/hfc_sx.h delete mode 100644 drivers/isdn/hisax/hfc_usb.c delete mode 100644 drivers/isdn/hisax/hfc_usb.h delete mode 100644 drivers/isdn/hisax/hfcscard.c delete mode 100644 drivers/isdn/hisax/hisax.h delete mode 100644 drivers/isdn/hisax/hisax_cfg.h delete mode 100644 drivers/isdn/hisax/hisax_debug.h delete mode 100644 drivers/isdn/hisax/hisax_fcpcipnp.c delete mode 100644 drivers/isdn/hisax/hisax_fcpcipnp.h delete mode 100644 drivers/isdn/hisax/hisax_if.h delete mode 100644 drivers/isdn/hisax/hisax_isac.c delete mode 100644 drivers/isdn/hisax/hisax_isac.h delete mode 100644 drivers/isdn/hisax/hscx.c delete mode 100644 drivers/isdn/hisax/hscx.h delete mode 100644 drivers/isdn/hisax/hscx_irq.c delete mode 100644 drivers/isdn/hisax/icc.c delete mode 100644 drivers/isdn/hisax/icc.h delete mode 100644 drivers/isdn/hisax/ipac.h delete mode 100644 drivers/isdn/hisax/ipacx.c delete mode 100644 drivers/isdn/hisax/ipacx.h delete mode 100644 drivers/isdn/hisax/isac.c delete mode 100644 drivers/isdn/hisax/isac.h delete mode 100644 drivers/isdn/hisax/isar.c delete mode 100644 drivers/isdn/hisax/isar.h delete mode 100644 drivers/isdn/hisax/isdnl1.c delete mode 100644 drivers/isdn/hisax/isdnl1.h delete mode 100644 drivers/isdn/hisax/isdnl2.c delete mode 100644 drivers/isdn/hisax/isdnl2.h delete mode 100644 drivers/isdn/hisax/isdnl3.c delete mode 100644 drivers/isdn/hisax/isdnl3.h delete mode 100644 drivers/isdn/hisax/isurf.c delete mode 100644 drivers/isdn/hisax/ix1_micro.c delete mode 100644 drivers/isdn/hisax/jade.c delete mode 100644 drivers/isdn/hisax/jade.h delete mode 100644 drivers/isdn/hisax/jade_irq.c delete mode 100644 drivers/isdn/hisax/l3_1tr6.c delete mode 100644 drivers/isdn/hisax/l3_1tr6.h delete mode 100644 drivers/isdn/hisax/l3dss1.c delete mode 100644 drivers/isdn/hisax/l3dss1.h delete mode 100644 drivers/isdn/hisax/l3ni1.c delete mode 100644 drivers/isdn/hisax/l3ni1.h delete mode 100644 drivers/isdn/hisax/lmgr.c delete mode 100644 drivers/isdn/hisax/mic.c delete mode 100644 drivers/isdn/hisax/netjet.c delete mode 100644 drivers/isdn/hisax/netjet.h delete mode 100644 drivers/isdn/hisax/niccy.c delete mode 100644 drivers/isdn/hisax/nj_s.c delete mode 100644 drivers/isdn/hisax/nj_u.c delete mode 100644 drivers/isdn/hisax/q931.c delete mode 100644 drivers/isdn/hisax/s0box.c delete mode 100644 drivers/isdn/hisax/saphir.c delete mode 100644 drivers/isdn/hisax/sedlbauer.c delete mode 100644 drivers/isdn/hisax/sedlbauer_cs.c delete mode 100644 drivers/isdn/hisax/sportster.c delete mode 100644 drivers/isdn/hisax/st5481.h delete mode 100644 drivers/isdn/hisax/st5481_b.c delete mode 100644 drivers/isdn/hisax/st5481_d.c delete mode 100644 drivers/isdn/hisax/st5481_init.c delete mode 100644 drivers/isdn/hisax/st5481_usb.c delete mode 100644 drivers/isdn/hisax/tei.c delete mode 100644 drivers/isdn/hisax/teleint.c delete mode 100644 drivers/isdn/hisax/teles0.c delete mode 100644 drivers/isdn/hisax/teles3.c delete mode 100644 drivers/isdn/hisax/teles_cs.c delete mode 100644 drivers/isdn/hisax/telespci.c delete mode 100644 drivers/isdn/hisax/w6692.c delete mode 100644 drivers/isdn/hisax/w6692.h (limited to 'drivers/isdn') diff --git a/drivers/isdn/Makefile b/drivers/isdn/Makefile index e7d3d8f2ad5a..7487f0bbe855 100644 --- a/drivers/isdn/Makefile +++ b/drivers/isdn/Makefile @@ -8,7 +8,6 @@ obj-$(CONFIG_ISDN_CAPI) += capi/ obj-$(CONFIG_MISDN) += mISDN/ obj-$(CONFIG_ISDN) += hardware/ obj-$(CONFIG_ISDN_DIVERSION) += divert/ -obj-$(CONFIG_ISDN_DRV_HISAX) += hisax/ obj-$(CONFIG_ISDN_DRV_LOOP) += isdnloop/ obj-$(CONFIG_HYSDN) += hysdn/ obj-$(CONFIG_ISDN_DRV_GIGASET) += gigaset/ diff --git a/drivers/isdn/hisax/Kconfig b/drivers/isdn/hisax/Kconfig deleted file mode 100644 index 43d98ccf5ff6..000000000000 --- a/drivers/isdn/hisax/Kconfig +++ /dev/null @@ -1,423 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0-only - -menu "Passive cards" - -config ISDN_DRV_HISAX - tristate "HiSax SiemensChipSet driver support" - select CRC_CCITT - ---help--- - This is a driver supporting the Siemens chipset on various - ISDN-cards (like AVM A1, Elsa ISDN cards, Teles S0-16.0, Teles - S0-16.3, Teles S0-8, Teles/Creatix PnP, ITK micro ix1 and many - compatibles). - - HiSax is just the name of this driver, not the name of any hardware. - - If you have a card with such a chipset, you should say Y here and - also to the configuration option of the driver for your particular - card, below. - -if ISDN_DRV_HISAX - -comment "D-channel protocol features" - -config HISAX_EURO - bool "HiSax Support for EURO/DSS1" - help - Say Y or N according to the D-channel protocol which your local - telephone service company provides. - - The call control protocol E-DSS1 is used in most European countries. - If unsure, say Y. - -config DE_AOC - bool "Support for german chargeinfo" - depends on HISAX_EURO - help - If you want that the HiSax hardware driver sends messages to the - upper level of the isdn code on each AOCD (Advice Of Charge, During - the call -- transmission of the fee information during a call) and - on each AOCE (Advice Of Charge, at the End of the call -- - transmission of fee information at the end of the call), say Y here. - This works only in Germany. - -config HISAX_NO_SENDCOMPLETE - bool "Disable sending complete" - depends on HISAX_EURO - help - If you have trouble with some ugly exchanges or you live in - Australia select this option. - -config HISAX_NO_LLC - bool "Disable sending low layer compatibility" - depends on HISAX_EURO - help - If you have trouble with some ugly exchanges try to select this - option. - -config HISAX_NO_KEYPAD - bool "Disable keypad protocol option" - depends on HISAX_EURO - help - If you like to send special dial strings including * or # without - using the keypad protocol, select this option. - -config HISAX_1TR6 - bool "HiSax Support for german 1TR6" - help - Say Y or N according to the D-channel protocol which your local - telephone service company provides. - - 1TR6 is an old call control protocol which was used in Germany - before E-DSS1 was established. Nowadays, all new lines in Germany - use E-DSS1. - -config HISAX_NI1 - bool "HiSax Support for US NI1" - help - Enable this if you like to use ISDN in US on a NI1 basic rate - interface. - -config HISAX_MAX_CARDS - int "Maximum number of cards supported by HiSax" - default "8" - help - This option allows you to specify the maximum number of cards which - the HiSax driver will be able to handle. - -comment "HiSax supported cards" - -config HISAX_16_0 - bool "Teles 16.0/8.0" - depends on ISA - help - This enables HiSax support for the Teles ISDN-cards S0-16.0, S0-8 - and many compatibles. - - See on how to configure it - using the different cards, a different D-channel protocol, or - non-standard IRQ/port/shmem settings. - -config HISAX_16_3 - bool "Teles 16.3 or PNP or PCMCIA" - help - This enables HiSax support for the Teles ISDN-cards S0-16.3 the - Teles/Creatix PnP and the Teles PCMCIA. - - See on how to configure it - using the different cards, a different D-channel protocol, or - non-standard IRQ/port settings. - -config HISAX_TELESPCI - bool "Teles PCI" - depends on PCI && (BROKEN || !(SPARC || PPC || PARISC || M68K || (MIPS && !CPU_LITTLE_ENDIAN) || (XTENSA && !CPU_LITTLE_ENDIAN))) - help - This enables HiSax support for the Teles PCI. - See on how to configure it. - -config HISAX_S0BOX - bool "Teles S0Box" - help - This enables HiSax support for the Teles/Creatix parallel port - S0BOX. See on how to - configure it. - -config HISAX_AVM_A1 - bool "AVM A1 (Fritz)" - depends on ISA - help - This enables HiSax support for the AVM A1 (aka "Fritz"). - - See on how to configure it - using the different cards, a different D-channel protocol, or - non-standard IRQ/port settings. - -config HISAX_FRITZPCI - bool "AVM PnP/PCI (Fritz!PnP/PCI)" - depends on BROKEN || !PPC64 - help - This enables HiSax support for the AVM "Fritz!PnP" and "Fritz!PCI". - See on how to configure it. - -config HISAX_AVM_A1_PCMCIA - bool "AVM A1 PCMCIA (Fritz)" - help - This enables HiSax support for the AVM A1 "Fritz!PCMCIA"). - See on how to configure it. - -config HISAX_ELSA - bool "Elsa cards" - help - This enables HiSax support for the Elsa Mircolink ISA cards, for the - Elsa Quickstep series cards and Elsa PCMCIA. - - See on how to configure it - using the different cards, a different D-channel protocol, or - non-standard IRQ/port settings. - -config HISAX_IX1MICROR2 - bool "ITK ix1-micro Revision 2" - depends on ISA - help - This enables HiSax support for the ITK ix1-micro Revision 2 card. - - See on how to configure it - using the different cards, a different D-channel protocol, or - non-standard IRQ/port settings. - -config HISAX_DIEHLDIVA - bool "Eicon.Diehl Diva cards" - help - This enables HiSax support for the Eicon.Diehl Diva none PRO - versions passive ISDN cards. - - See on how to configure it - using the different cards, a different D-channel protocol, or - non-standard IRQ/port settings. - -config HISAX_ASUSCOM - bool "ASUSCOM ISA cards" - depends on ISA - help - This enables HiSax support for the AsusCom and their OEM versions - passive ISDN ISA cards. - - See on how to configure it - using the different cards, a different D-channel protocol, or - non-standard IRQ/port settings. - -config HISAX_TELEINT - bool "TELEINT cards" - depends on ISA - help - This enables HiSax support for the TELEINT SA1 semiactiv ISDN card. - - See on how to configure it - using the different cards, a different D-channel protocol, or - non-standard IRQ/port settings. - -config HISAX_HFCS - bool "HFC-S based cards" - depends on ISA - help - This enables HiSax support for the HFC-S 2BDS0 based cards, like - teles 16.3c. - - See on how to configure it - using the different cards, a different D-channel protocol, or - non-standard IRQ/port settings. - -config HISAX_SEDLBAUER - bool "Sedlbauer cards" - help - This enables HiSax support for the Sedlbauer passive ISDN cards. - - See on how to configure it - using the different cards, a different D-channel protocol, or - non-standard IRQ/port settings. - -config HISAX_SPORTSTER - bool "USR Sportster internal TA" - depends on ISA - help - This enables HiSax support for the USR Sportster internal TA card. - - See on how to configure it - using a different D-channel protocol, or non-standard IRQ/port - settings. - -config HISAX_MIC - bool "MIC card" - depends on ISA - help - This enables HiSax support for the ITH MIC card. - - See on how to configure it - using a different D-channel protocol, or non-standard IRQ/port - settings. - -config HISAX_NETJET - bool "NETjet card" - depends on PCI && (BROKEN || !(PPC || PARISC || M68K || (MIPS && !CPU_LITTLE_ENDIAN) || (XTENSA && !CPU_LITTLE_ENDIAN) || MICROBLAZE)) - depends on VIRT_TO_BUS - help - This enables HiSax support for the NetJet from Traverse - Technologies. - - See on how to configure it - using a different D-channel protocol, or non-standard IRQ/port - settings. - -config HISAX_NETJET_U - bool "NETspider U card" - depends on PCI && (BROKEN || !(PPC || PARISC || M68K || (MIPS && !CPU_LITTLE_ENDIAN) || (XTENSA && !CPU_LITTLE_ENDIAN) || MICROBLAZE)) - depends on VIRT_TO_BUS - help - This enables HiSax support for the Netspider U interface ISDN card - from Traverse Technologies. - See on how to configure it - using a different D-channel protocol, or non-standard IRQ/port - settings. - -config HISAX_NICCY - bool "Niccy PnP/PCI card" - help - This enables HiSax support for the Dr. Neuhaus Niccy PnP or PCI. - - See on how to configure it - using a different D-channel protocol, or non-standard IRQ/port - settings. - -config HISAX_ISURF - bool "Siemens I-Surf card" - depends on ISA - help - This enables HiSax support for the Siemens I-Talk/I-Surf card with - ISAR chip. - See on how to configure it - using a different D-channel protocol, or non-standard IRQ/port - settings. - -config HISAX_HSTSAPHIR - bool "HST Saphir card" - depends on ISA - help - This enables HiSax support for the HST Saphir card. - - See on how to configure it - using a different D-channel protocol, or non-standard IRQ/port - settings. - -config HISAX_BKM_A4T - bool "Telekom A4T card" - depends on PCI - help - This enables HiSax support for the Telekom A4T card. - - See on how to configure it - using a different D-channel protocol, or non-standard IRQ/port - settings. - -config HISAX_SCT_QUADRO - bool "Scitel Quadro card" - depends on PCI - help - This enables HiSax support for the Scitel Quadro card. - - See on how to configure it - using a different D-channel protocol, or non-standard IRQ/port - settings. - -config HISAX_GAZEL - bool "Gazel cards" - help - This enables HiSax support for the Gazel cards. - - See on how to configure it - using a different D-channel protocol, or non-standard IRQ/port - settings. - -config HISAX_HFC_PCI - bool "HFC PCI-Bus cards" - depends on PCI && (BROKEN || !(SPARC || PPC || PARISC || M68K || (MIPS && !CPU_LITTLE_ENDIAN) || (XTENSA && !CPU_LITTLE_ENDIAN))) - help - This enables HiSax support for the HFC-S PCI 2BDS0 based cards. - - For more information see under - . - -config HISAX_W6692 - bool "Winbond W6692 based cards" - depends on PCI - help - This enables HiSax support for Winbond W6692 based PCI ISDN cards. - - See on how to configure it - using a different D-channel protocol, or non-standard IRQ/port - settings. - -config HISAX_HFC_SX - bool "HFC-S+, HFC-SP, HFC-PCMCIA cards" - help - This enables HiSax support for the HFC-S+, HFC-SP and HFC-PCMCIA - cards. This code is not finished yet. - -config HISAX_ENTERNOW_PCI - bool "Formula-n enter:now PCI card" - depends on HISAX_NETJET && PCI && (BROKEN || !(SPARC || PPC || PARISC || M68K || (MIPS && !CPU_LITTLE_ENDIAN) || (XTENSA && !CPU_LITTLE_ENDIAN))) - help - This enables HiSax support for the Formula-n enter:now PCI - ISDN card. - -config HISAX_DEBUG - bool "HiSax debugging" - help - This enables debugging code in the new-style HiSax drivers, i.e. - the ST5481 USB driver currently. - If in doubt, say yes. - -comment "HiSax PCMCIA card service modules" - -config HISAX_SEDLBAUER_CS - tristate "Sedlbauer PCMCIA cards" - depends on PCMCIA && HISAX_SEDLBAUER - help - This enables the PCMCIA client driver for the Sedlbauer Speed Star - and Speed Star II cards. - -config HISAX_ELSA_CS - tristate "ELSA PCMCIA MicroLink cards" - depends on PCMCIA && HISAX_ELSA - help - This enables the PCMCIA client driver for the Elsa PCMCIA MicroLink - card. - -config HISAX_AVM_A1_CS - tristate "AVM A1 PCMCIA cards" - depends on PCMCIA && ISDN_DRV_HISAX - help - This enables the PCMCIA client driver for the AVM A1 / Fritz!Card - PCMCIA cards. - -config HISAX_TELES_CS - tristate "TELES PCMCIA cards" - depends on PCMCIA && HISAX_16_3 - help - This enables the PCMCIA client driver for the Teles PCMCIA cards. - -comment "HiSax sub driver modules" - -config HISAX_ST5481 - tristate "ST5481 USB ISDN modem" - depends on USB - select ISDN_HDLC - select CRC_CCITT - select BITREVERSE - help - This enables the driver for ST5481 based USB ISDN adapters, - e.g. the BeWan Gazel 128 USB - -config HISAX_HFCUSB - tristate "HFC USB based ISDN modems" - depends on USB - help - This enables the driver for HFC USB based ISDN modems. - -config HISAX_HFC4S8S - tristate "HFC-4S/8S based ISDN cards" - help - This enables the driver for HFC-4S/8S based ISDN cards. - -config HISAX_FRITZ_PCIPNP - tristate "AVM Fritz!Card PCI/PCIv2/PnP support" - depends on PCI - help - This enables the driver for the AVM Fritz!Card PCI, - Fritz!Card PCI v2 and Fritz!Card PnP. - (the latter also needs you to select "ISA Plug and Play support" - from the menu "Plug and Play configuration") - -endif - -endmenu - diff --git a/drivers/isdn/hisax/Makefile b/drivers/isdn/hisax/Makefile deleted file mode 100644 index 3eca9d23f1c2..000000000000 --- a/drivers/isdn/hisax/Makefile +++ /dev/null @@ -1,60 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0 -# Makefile for the hisax ISDN device driver - -# The target object and module list name. - -# Define maximum number of cards - -ccflags-y := -DHISAX_MAX_CARDS=$(CONFIG_HISAX_MAX_CARDS) - -obj-$(CONFIG_ISDN_DRV_HISAX) += hisax.o -obj-$(CONFIG_HISAX_SEDLBAUER_CS) += sedlbauer_cs.o -obj-$(CONFIG_HISAX_ELSA_CS) += elsa_cs.o -obj-$(CONFIG_HISAX_AVM_A1_CS) += avma1_cs.o -obj-$(CONFIG_HISAX_TELES_CS) += teles_cs.o -obj-$(CONFIG_HISAX_ST5481) += hisax_st5481.o -obj-$(CONFIG_HISAX_HFCUSB) += hfc_usb.o -obj-$(CONFIG_HISAX_HFC4S8S) += hfc4s8s_l1.o -obj-$(CONFIG_HISAX_FRITZ_PCIPNP) += hisax_isac.o hisax_fcpcipnp.o - -# Multipart objects. - -hisax_st5481-y := st5481_init.o st5481_usb.o st5481_d.o \ - st5481_b.o - -hisax-y := config.o isdnl1.o tei.o isdnl2.o isdnl3.o \ - lmgr.o q931.o callc.o fsm.o -hisax-$(CONFIG_HISAX_EURO) += l3dss1.o -hisax-$(CONFIG_HISAX_NI1) += l3ni1.o -hisax-$(CONFIG_HISAX_1TR6) += l3_1tr6.o - -hisax-$(CONFIG_HISAX_16_0) += teles0.o isac.o arcofi.o hscx.o -hisax-$(CONFIG_HISAX_16_3) += teles3.o isac.o arcofi.o hscx.o -hisax-$(CONFIG_HISAX_TELESPCI) += telespci.o isac.o arcofi.o hscx.o -hisax-$(CONFIG_HISAX_S0BOX) += s0box.o isac.o arcofi.o hscx.o -hisax-$(CONFIG_HISAX_AVM_A1) += avm_a1.o isac.o arcofi.o hscx.o -hisax-$(CONFIG_HISAX_AVM_A1_PCMCIA) += avm_a1p.o isac.o arcofi.o hscx.o -hisax-$(CONFIG_HISAX_FRITZPCI) += avm_pci.o isac.o arcofi.o -hisax-$(CONFIG_HISAX_ELSA) += elsa.o isac.o arcofi.o hscx.o -hisax-$(CONFIG_HISAX_IX1MICROR2) += ix1_micro.o isac.o arcofi.o hscx.o -hisax-$(CONFIG_HISAX_DIEHLDIVA) += diva.o isac.o arcofi.o hscx.o ipacx.o -hisax-$(CONFIG_HISAX_ASUSCOM) += asuscom.o isac.o arcofi.o hscx.o -hisax-$(CONFIG_HISAX_TELEINT) += teleint.o isac.o arcofi.o hfc_2bs0.o -hisax-$(CONFIG_HISAX_SEDLBAUER) += sedlbauer.o isac.o arcofi.o hscx.o \ - isar.o -hisax-$(CONFIG_HISAX_SPORTSTER) += sportster.o isac.o arcofi.o hscx.o -hisax-$(CONFIG_HISAX_MIC) += mic.o isac.o arcofi.o hscx.o -hisax-$(CONFIG_HISAX_NETJET) += nj_s.o netjet.o isac.o arcofi.o -hisax-$(CONFIG_HISAX_NETJET_U) += nj_u.o netjet.o icc.o -hisax-$(CONFIG_HISAX_HFCS) += hfcscard.o hfc_2bds0.o -hisax-$(CONFIG_HISAX_HFC_PCI) += hfc_pci.o -hisax-$(CONFIG_HISAX_HFC_SX) += hfc_sx.o -hisax-$(CONFIG_HISAX_NICCY) += niccy.o isac.o arcofi.o hscx.o -hisax-$(CONFIG_HISAX_ISURF) += isurf.o isac.o arcofi.o isar.o -hisax-$(CONFIG_HISAX_HSTSAPHIR) += saphir.o isac.o arcofi.o hscx.o -hisax-$(CONFIG_HISAX_BKM_A4T) += bkm_a4t.o isac.o arcofi.o jade.o -hisax-$(CONFIG_HISAX_SCT_QUADRO) += bkm_a8.o isac.o arcofi.o hscx.o -hisax-$(CONFIG_HISAX_GAZEL) += gazel.o isac.o arcofi.o hscx.o -hisax-$(CONFIG_HISAX_W6692) += w6692.o -hisax-$(CONFIG_HISAX_ENTERNOW_PCI) += enternow_pci.o amd7930_fn.o - diff --git a/drivers/isdn/hisax/amd7930_fn.c b/drivers/isdn/hisax/amd7930_fn.c deleted file mode 100644 index 6c336366128c..000000000000 --- a/drivers/isdn/hisax/amd7930_fn.c +++ /dev/null @@ -1,794 +0,0 @@ -/* gerdes_amd7930.c,v 0.99 2001/10/02 - * - * gerdes_amd7930.c Amd 79C30A and 79C32A specific routines - * (based on HiSax driver by Karsten Keil) - * - * Author Christoph Ersfeld - * Formula-n Europe AG (www.formula-n.com) - * previously Gerdes AG - * - * - * This file is (c) under GNU PUBLIC LICENSE - * - * - * Notes: - * Version 0.99 is the first release of this driver and there are - * certainly a few bugs. - * - * Please don't report any malfunction to me without sending - * (compressed) debug-logs. - * It would be nearly impossible to retrace it. - * - * Log D-channel-processing as follows: - * - * 1. Load hisax with card-specific parameters, this example ist for - * Formula-n enter:now ISDN PCI and compatible - * (f.e. Gerdes Power ISDN PCI) - * - * modprobe hisax type=41 protocol=2 id=gerdes - * - * if you chose an other value for id, you need to modify the - * code below, too. - * - * 2. set debug-level - * - * hisaxctrl gerdes 1 0x3ff - * hisaxctrl gerdes 11 0x4f - * cat /dev/isdnctrl >> ~/log & - * - * Please take also a look into /var/log/messages if there is - * anything importand concerning HISAX. - * - * - * Credits: - * Programming the driver for Formula-n enter:now ISDN PCI and - * necessary this driver for the used Amd 7930 D-channel-controller - * was spnsored by Formula-n Europe AG. - * Thanks to Karsten Keil and Petr Novak, who gave me support in - * Hisax-specific questions. - * I want so say special thanks to Carl-Friedrich Braun, who had to - * answer a lot of questions about generally ISDN and about handling - * of the Amd-Chip. - * - */ - - -#include "hisax.h" -#include "isdnl1.h" -#include "isac.h" -#include "amd7930_fn.h" -#include -#include -#include - -static void Amd7930_new_ph(struct IsdnCardState *cs); - -static WORD initAMD[] = { - 0x0100, - - 0x00A5, 3, 0x01, 0x40, 0x58, // LPR, LMR1, LMR2 - 0x0086, 1, 0x0B, // DMR1 (D-Buffer TH-Interrupts on) - 0x0087, 1, 0xFF, // DMR2 - 0x0092, 1, 0x03, // EFCR (extended mode d-channel-fifo on) - 0x0090, 4, 0xFE, 0xFF, 0x02, 0x0F, // FRAR4, SRAR4, DMR3, DMR4 (address recognition ) - 0x0084, 2, 0x80, 0x00, // DRLR - 0x00C0, 1, 0x47, // PPCR1 - 0x00C8, 1, 0x01, // PPCR2 - - 0x0102, - 0x0107, - 0x01A1, 1, - 0x0121, 1, - 0x0189, 2, - - 0x0045, 4, 0x61, 0x72, 0x00, 0x00, // MCR1, MCR2, MCR3, MCR4 - 0x0063, 2, 0x08, 0x08, // GX - 0x0064, 2, 0x08, 0x08, // GR - 0x0065, 2, 0x99, 0x00, // GER - 0x0066, 2, 0x7C, 0x8B, // STG - 0x0067, 2, 0x00, 0x00, // FTGR1, FTGR2 - 0x0068, 2, 0x20, 0x20, // ATGR1, ATGR2 - 0x0069, 1, 0x4F, // MMR1 - 0x006A, 1, 0x00, // MMR2 - 0x006C, 1, 0x40, // MMR3 - 0x0021, 1, 0x02, // INIT - 0x00A3, 1, 0x40, // LMR1 - - 0xFFFF -}; - - -static void /* macro wWordAMD */ -WriteWordAmd7930(struct IsdnCardState *cs, BYTE reg, WORD val) -{ - wByteAMD(cs, 0x00, reg); - wByteAMD(cs, 0x01, LOBYTE(val)); - wByteAMD(cs, 0x01, HIBYTE(val)); -} - -static WORD /* macro rWordAMD */ -ReadWordAmd7930(struct IsdnCardState *cs, BYTE reg) -{ - WORD res; - /* direct access register */ - if (reg < 8) { - res = rByteAMD(cs, reg); - res += 256 * rByteAMD(cs, reg); - } - /* indirect access register */ - else { - wByteAMD(cs, 0x00, reg); - res = rByteAMD(cs, 0x01); - res += 256 * rByteAMD(cs, 0x01); - } - return (res); -} - - -static void -Amd7930_ph_command(struct IsdnCardState *cs, u_char command, char *s) -{ - if (cs->debug & L1_DEB_ISAC) - debugl1(cs, "AMD7930: %s: ph_command 0x%02X", s, command); - - cs->dc.amd7930.lmr1 = command; - wByteAMD(cs, 0xA3, command); -} - - - -static BYTE i430States[] = { -// to reset F3 F4 F5 F6 F7 F8 AR from - 0x01, 0x02, 0x00, 0x00, 0x00, 0x07, 0x05, 0x00, // init - 0x01, 0x02, 0x00, 0x00, 0x00, 0x07, 0x05, 0x00, // reset - 0x01, 0x02, 0x00, 0x00, 0x00, 0x09, 0x05, 0x04, // F3 - 0x01, 0x02, 0x00, 0x00, 0x1B, 0x00, 0x00, 0x00, // F4 - 0x01, 0x02, 0x00, 0x00, 0x1B, 0x00, 0x00, 0x00, // F5 - 0x01, 0x03, 0x00, 0x00, 0x00, 0x06, 0x05, 0x00, // F6 - 0x11, 0x13, 0x00, 0x00, 0x1B, 0x00, 0x15, 0x00, // F7 - 0x01, 0x03, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, // F8 - 0x01, 0x03, 0x00, 0x00, 0x00, 0x09, 0x00, 0x0A}; // AR - - -/* Row init - reset F3 F4 F5 F6 F7 F8 AR */ -static BYTE stateHelper[] = { 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; - - - - -static void -Amd7930_get_state(struct IsdnCardState *cs) { - BYTE lsr = rByteAMD(cs, 0xA1); - cs->dc.amd7930.ph_state = (lsr & 0x7) + 2; - Amd7930_new_ph(cs); -} - - - -static void -Amd7930_new_ph(struct IsdnCardState *cs) -{ - u_char index = stateHelper[cs->dc.amd7930.old_state] * 8 + stateHelper[cs->dc.amd7930.ph_state] - 1; - u_char message = i430States[index]; - - if (cs->debug & L1_DEB_ISAC) - debugl1(cs, "AMD7930: new_ph %d, old_ph %d, message %d, index %d", - cs->dc.amd7930.ph_state, cs->dc.amd7930.old_state, message & 0x0f, index); - - cs->dc.amd7930.old_state = cs->dc.amd7930.ph_state; - - /* abort transmit if nessesary */ - if ((message & 0xf0) && (cs->tx_skb)) { - wByteAMD(cs, 0x21, 0xC2); - wByteAMD(cs, 0x21, 0x02); - } - - switch (message & 0x0f) { - - case (1): - l1_msg(cs, HW_RESET | INDICATION, NULL); - Amd7930_get_state(cs); - break; - case (2): /* init, Card starts in F3 */ - l1_msg(cs, HW_DEACTIVATE | CONFIRM, NULL); - break; - case (3): - l1_msg(cs, HW_DEACTIVATE | INDICATION, NULL); - break; - case (4): - l1_msg(cs, HW_POWERUP | CONFIRM, NULL); - Amd7930_ph_command(cs, 0x50, "HW_ENABLE REQUEST"); - break; - case (5): - l1_msg(cs, HW_RSYNC | INDICATION, NULL); - break; - case (6): - l1_msg(cs, HW_INFO4_P8 | INDICATION, NULL); - break; - case (7): /* init, Card starts in F7 */ - l1_msg(cs, HW_RSYNC | INDICATION, NULL); - l1_msg(cs, HW_INFO4_P8 | INDICATION, NULL); - break; - case (8): - l1_msg(cs, HW_POWERUP | CONFIRM, NULL); - /* fall through */ - case (9): - Amd7930_ph_command(cs, 0x40, "HW_ENABLE REQ cleared if set"); - l1_msg(cs, HW_RSYNC | INDICATION, NULL); - l1_msg(cs, HW_INFO2 | INDICATION, NULL); - l1_msg(cs, HW_INFO4_P8 | INDICATION, NULL); - break; - case (10): - Amd7930_ph_command(cs, 0x40, "T3 expired, HW_ENABLE REQ cleared"); - cs->dc.amd7930.old_state = 3; - break; - case (11): - l1_msg(cs, HW_INFO2 | INDICATION, NULL); - break; - default: - break; - } -} - - - -static void -Amd7930_bh(struct work_struct *work) -{ - struct IsdnCardState *cs = - container_of(work, struct IsdnCardState, tqueue); - struct PStack *stptr; - - if (test_and_clear_bit(D_CLEARBUSY, &cs->event)) { - if (cs->debug) - debugl1(cs, "Amd7930: bh, D-Channel Busy cleared"); - stptr = cs->stlist; - while (stptr != NULL) { - stptr->l1.l1l2(stptr, PH_PAUSE | CONFIRM, NULL); - stptr = stptr->next; - } - } - if (test_and_clear_bit(D_L1STATECHANGE, &cs->event)) { - if (cs->debug & L1_DEB_ISAC) - debugl1(cs, "AMD7930: bh, D_L1STATECHANGE"); - Amd7930_new_ph(cs); - } - - if (test_and_clear_bit(D_RCVBUFREADY, &cs->event)) { - if (cs->debug & L1_DEB_ISAC) - debugl1(cs, "AMD7930: bh, D_RCVBUFREADY"); - DChannel_proc_rcv(cs); - } - - if (test_and_clear_bit(D_XMTBUFREADY, &cs->event)) { - if (cs->debug & L1_DEB_ISAC) - debugl1(cs, "AMD7930: bh, D_XMTBUFREADY"); - DChannel_proc_xmt(cs); - } -} - -static void -Amd7930_empty_Dfifo(struct IsdnCardState *cs, int flag) -{ - - BYTE stat, der; - BYTE *ptr; - struct sk_buff *skb; - - - if ((cs->debug & L1_DEB_ISAC) && !(cs->debug & L1_DEB_ISAC_FIFO)) - debugl1(cs, "Amd7930: empty_Dfifo"); - - - ptr = cs->rcvbuf + cs->rcvidx; - - /* AMD interrupts off */ - AmdIrqOff(cs); - - /* read D-Channel-Fifo*/ - stat = rByteAMD(cs, 0x07); // DSR2 - - /* while Data in Fifo ... */ - while ((stat & 2) && ((ptr-cs->rcvbuf) < MAX_DFRAME_LEN_L1)) { - *ptr = rByteAMD(cs, 0x04); // DCRB - ptr++; - stat = rByteAMD(cs, 0x07); // DSR2 - cs->rcvidx = ptr - cs->rcvbuf; - - /* Paket ready? */ - if (stat & 1) { - - der = rWordAMD(cs, 0x03); - - /* no errors, packet ok */ - if (!der && !flag) { - rWordAMD(cs, 0x89); // clear DRCR - - if ((cs->rcvidx) > 0) { - if (!(skb = alloc_skb(cs->rcvidx, GFP_ATOMIC))) - printk(KERN_WARNING "HiSax: Amd7930: empty_Dfifo, D receive out of memory!\n"); - else { - /* Debugging */ - if (cs->debug & L1_DEB_ISAC_FIFO) { - char *t = cs->dlog; - - t += sprintf(t, "Amd7930: empty_Dfifo cnt: %d |", cs->rcvidx); - QuickHex(t, cs->rcvbuf, cs->rcvidx); - debugl1(cs, "%s", cs->dlog); - } - /* moves received data in sk-buffer */ - skb_put_data(skb, cs->rcvbuf, - cs->rcvidx); - skb_queue_tail(&cs->rq, skb); - } - } - - } - /* throw damaged packets away, reset receive-buffer, indicate RX */ - ptr = cs->rcvbuf; - cs->rcvidx = 0; - schedule_event(cs, D_RCVBUFREADY); - } - } - /* Packet to long, overflow */ - if (cs->rcvidx >= MAX_DFRAME_LEN_L1) { - if (cs->debug & L1_DEB_WARN) - debugl1(cs, "AMD7930: empty_Dfifo L2-Framelength overrun"); - cs->rcvidx = 0; - return; - } - /* AMD interrupts on */ - AmdIrqOn(cs); -} - - -static void -Amd7930_fill_Dfifo(struct IsdnCardState *cs) -{ - - WORD dtcrr, dtcrw, len, count; - BYTE txstat, dmr3; - BYTE *ptr, *deb_ptr; - - if ((cs->debug & L1_DEB_ISAC) && !(cs->debug & L1_DEB_ISAC_FIFO)) - debugl1(cs, "Amd7930: fill_Dfifo"); - - if ((!cs->tx_skb) || (cs->tx_skb->len <= 0)) - return; - - dtcrw = 0; - if (!cs->dc.amd7930.tx_xmtlen) - /* new Frame */ - len = dtcrw = cs->tx_skb->len; - /* continue frame */ - else len = cs->dc.amd7930.tx_xmtlen; - - - /* AMD interrupts off */ - AmdIrqOff(cs); - - deb_ptr = ptr = cs->tx_skb->data; - - /* while free place in tx-fifo available and data in sk-buffer */ - txstat = 0x10; - while ((txstat & 0x10) && (cs->tx_cnt < len)) { - wByteAMD(cs, 0x04, *ptr); - ptr++; - cs->tx_cnt++; - txstat = rByteAMD(cs, 0x07); - } - count = ptr - cs->tx_skb->data; - skb_pull(cs->tx_skb, count); - - - dtcrr = rWordAMD(cs, 0x85); // DTCR - dmr3 = rByteAMD(cs, 0x8E); - - if (cs->debug & L1_DEB_ISAC) { - debugl1(cs, "Amd7930: fill_Dfifo, DMR3: 0x%02X, DTCR read: 0x%04X write: 0x%02X 0x%02X", dmr3, dtcrr, LOBYTE(dtcrw), HIBYTE(dtcrw)); - } - - /* writeing of dtcrw starts transmit */ - if (!cs->dc.amd7930.tx_xmtlen) { - wWordAMD(cs, 0x85, dtcrw); - cs->dc.amd7930.tx_xmtlen = dtcrw; - } - - if (test_and_set_bit(FLG_DBUSY_TIMER, &cs->HW_Flags)) { - debugl1(cs, "Amd7930: fill_Dfifo dbusytimer running"); - del_timer(&cs->dbusytimer); - } - cs->dbusytimer.expires = jiffies + ((DBUSY_TIMER_VALUE * HZ) / 1000); - add_timer(&cs->dbusytimer); - - if (cs->debug & L1_DEB_ISAC_FIFO) { - char *t = cs->dlog; - - t += sprintf(t, "Amd7930: fill_Dfifo cnt: %d |", count); - QuickHex(t, deb_ptr, count); - debugl1(cs, "%s", cs->dlog); - } - /* AMD interrupts on */ - AmdIrqOn(cs); -} - - -void Amd7930_interrupt(struct IsdnCardState *cs, BYTE irflags) -{ - BYTE dsr1, dsr2, lsr; - WORD der; - - while (irflags) - { - - dsr1 = rByteAMD(cs, 0x02); - der = rWordAMD(cs, 0x03); - dsr2 = rByteAMD(cs, 0x07); - lsr = rByteAMD(cs, 0xA1); - - if (cs->debug & L1_DEB_ISAC) - debugl1(cs, "Amd7930: interrupt: flags: 0x%02X, DSR1: 0x%02X, DSR2: 0x%02X, LSR: 0x%02X, DER=0x%04X", irflags, dsr1, dsr2, lsr, der); - - /* D error -> read DER and DSR2 bit 2 */ - if (der || (dsr2 & 4)) { - - if (cs->debug & L1_DEB_WARN) - debugl1(cs, "Amd7930: interrupt: D error DER=0x%04X", der); - - /* RX, TX abort if collision detected */ - if (der & 2) { - wByteAMD(cs, 0x21, 0xC2); - wByteAMD(cs, 0x21, 0x02); - if (test_and_clear_bit(FLG_DBUSY_TIMER, &cs->HW_Flags)) - del_timer(&cs->dbusytimer); - if (test_and_clear_bit(FLG_L1_DBUSY, &cs->HW_Flags)) - schedule_event(cs, D_CLEARBUSY); - /* restart frame */ - if (cs->tx_skb) { - skb_push(cs->tx_skb, cs->tx_cnt); - cs->tx_cnt = 0; - cs->dc.amd7930.tx_xmtlen = 0; - Amd7930_fill_Dfifo(cs); - } else { - printk(KERN_WARNING "HiSax: Amd7930 D-Collision, no skb\n"); - debugl1(cs, "Amd7930: interrupt: D-Collision, no skb"); - } - } - /* remove damaged data from fifo */ - Amd7930_empty_Dfifo(cs, 1); - - if (test_and_clear_bit(FLG_DBUSY_TIMER, &cs->HW_Flags)) - del_timer(&cs->dbusytimer); - if (test_and_clear_bit(FLG_L1_DBUSY, &cs->HW_Flags)) - schedule_event(cs, D_CLEARBUSY); - /* restart TX-Frame */ - if (cs->tx_skb) { - skb_push(cs->tx_skb, cs->tx_cnt); - cs->tx_cnt = 0; - cs->dc.amd7930.tx_xmtlen = 0; - Amd7930_fill_Dfifo(cs); - } - } - - /* D TX FIFO empty -> fill */ - if (irflags & 1) { - if (cs->debug & L1_DEB_ISAC) - debugl1(cs, "Amd7930: interrupt: clear Timer and fill D-TX-FIFO if data"); - - /* AMD interrupts off */ - AmdIrqOff(cs); - - if (test_and_clear_bit(FLG_DBUSY_TIMER, &cs->HW_Flags)) - del_timer(&cs->dbusytimer); - if (test_and_clear_bit(FLG_L1_DBUSY, &cs->HW_Flags)) - schedule_event(cs, D_CLEARBUSY); - if (cs->tx_skb) { - if (cs->tx_skb->len) - Amd7930_fill_Dfifo(cs); - } - /* AMD interrupts on */ - AmdIrqOn(cs); - } - - - /* D RX FIFO full or tiny packet in Fifo -> empty */ - if ((irflags & 2) || (dsr1 & 2)) { - if (cs->debug & L1_DEB_ISAC) - debugl1(cs, "Amd7930: interrupt: empty D-FIFO"); - Amd7930_empty_Dfifo(cs, 0); - } - - - /* D-Frame transmit complete */ - if (dsr1 & 64) { - if (cs->debug & L1_DEB_ISAC) { - debugl1(cs, "Amd7930: interrupt: transmit packet ready"); - } - /* AMD interrupts off */ - AmdIrqOff(cs); - - if (test_and_clear_bit(FLG_DBUSY_TIMER, &cs->HW_Flags)) - del_timer(&cs->dbusytimer); - if (test_and_clear_bit(FLG_L1_DBUSY, &cs->HW_Flags)) - schedule_event(cs, D_CLEARBUSY); - - if (cs->tx_skb) { - if (cs->debug & L1_DEB_ISAC) - debugl1(cs, "Amd7930: interrupt: TX-Packet ready, freeing skb"); - dev_kfree_skb_irq(cs->tx_skb); - cs->tx_cnt = 0; - cs->dc.amd7930.tx_xmtlen = 0; - cs->tx_skb = NULL; - } - if ((cs->tx_skb = skb_dequeue(&cs->sq))) { - if (cs->debug & L1_DEB_ISAC) - debugl1(cs, "Amd7930: interrupt: TX-Packet ready, next packet dequeued"); - cs->tx_cnt = 0; - cs->dc.amd7930.tx_xmtlen = 0; - Amd7930_fill_Dfifo(cs); - } - else - schedule_event(cs, D_XMTBUFREADY); - /* AMD interrupts on */ - AmdIrqOn(cs); - } - - /* LIU status interrupt -> read LSR, check statechanges */ - if (lsr & 0x38) { - /* AMD interrupts off */ - AmdIrqOff(cs); - - if (cs->debug & L1_DEB_ISAC) - debugl1(cs, "Amd: interrupt: LSR=0x%02X, LIU is in state %d", lsr, ((lsr & 0x7) + 2)); - - cs->dc.amd7930.ph_state = (lsr & 0x7) + 2; - - schedule_event(cs, D_L1STATECHANGE); - /* AMD interrupts on */ - AmdIrqOn(cs); - } - - /* reads Interrupt-Register again. If there is a new interrupt-flag: restart handler */ - irflags = rByteAMD(cs, 0x00); - } - -} - -static void -Amd7930_l1hw(struct PStack *st, int pr, void *arg) -{ - struct IsdnCardState *cs = (struct IsdnCardState *) st->l1.hardware; - struct sk_buff *skb = arg; - u_long flags; - - if (cs->debug & L1_DEB_ISAC) - debugl1(cs, "Amd7930: l1hw called, pr: 0x%04X", pr); - - switch (pr) { - case (PH_DATA | REQUEST): - if (cs->debug & DEB_DLOG_HEX) - LogFrame(cs, skb->data, skb->len); - if (cs->debug & DEB_DLOG_VERBOSE) - dlogframe(cs, skb, 0); - spin_lock_irqsave(&cs->lock, flags); - if (cs->tx_skb) { - skb_queue_tail(&cs->sq,