mISDN update for linux-next
cover mISDN update for linux-next
This is a update of the mISDN driver for linux-next. It syncs the mISDN driver with the development on git.misdn.org. More updates (new hardware support) will follow.
You can pull it fromgit://master.kernel.org/pub/scm/linux/kernel/git/kkeil/ISDN-2.6-next.git master
Andreas Eversberg (14):
Add XHFC support for embedded Speech-Design board to hfcmulti Fix bug in XHFC registering
Add PCI ID for Junghanns 8S card
Add watchdog functionality to hfcmulti driver
DSP now uses ring buffer for echo canceler
Fix hfcmulti's PCI IRQ bug during init
Echo canceler now gets delay information from hardware Fixed missing spin lock on pipeline process
Added layer-1-hold feature
Fix DTMF locking bug issue
Hardware acceleration is now possible in conjunction with audio
recording
Fix TEI and SAPI handling
Add "sapi" information to debug messages
Added PCI ID for new Junghanns.net Single E1 cards.
Frank Seidel (2):
Reduce stack size in dsp_cmx_send()
Add allocation of recvbuf[1500] at run time to reduce stack size
Karsten Keil (2):
Fix skb leak in error cases
Cleanup debug messages
Roel Kluin (1):
isdn: get_free_devid() failure ignored
drivers/isdn/hardware/mISDN/hfc_multi.h | 75 +++- drivers/isdn/hardware/mISDN/hfcmulti.c | 711 +++++++++++++++++++++++-------- drivers/isdn/hardware/mISDN/hfcpci.c | 98 +++-- drivers/isdn/hardware/mISDN/hfcsusb.c | 4 +- drivers/isdn/mISDN/core.c | 8 +- drivers/isdn/mISDN/dsp.h | 18 +- drivers/isdn/mISDN/dsp_audio.c | 5 +- drivers/isdn/mISDN/dsp_cmx.c | 115 ++++-- drivers/isdn/mISDN/dsp_core.c | 70 ++-- drivers/isdn/mISDN/dsp_ecdis.h | 2 +- drivers/isdn/mISDN/dsp_pipeline.c | 5 +- drivers/isdn/mISDN/dsp_tones.c | 23 +- drivers/isdn/mISDN/hwchannel.c | 4 +- drivers/isdn/mISDN/l1oip_codec.c | 1 + drivers/isdn/mISDN/l1oip_core.c | 51 ++- drivers/isdn/mISDN/layer2.c | 37 +- drivers/isdn/mISDN/layer2.h | 2 +- drivers/isdn/mISDN/socket.c | 45 ++- drivers/isdn/mISDN/tei.c | 80 +++-- drivers/isdn/mISDN/timerdev.c | 2 +- include/linux/mISDNdsp.h | 4 +- include/linux/mISDNhw.h | 2 +- include/linux/mISDNif.h | 19 +- include/linux/pci_ids.h | 2 + 24 files changed, 965 insertions(+), 418 deletions(-)
PATCH 1/19 Add XHFC support for embedded Speech-Design board to hfcmulti
From: Andreas Eversberg <[email protected]>
Features like DTMF or hardware conference will not be available, so I expanded DSP's feature flags.
--- drivers/isdn/hardware/mISDN/hfc_multi.h | 73 ++++- drivers/isdn/hardware/mISDN/hfcmulti.c | 536 ++++++++++++++++++++++++------- drivers/isdn/mISDN/dsp_cmx.c | 4 + include/linux/mISDNdsp.h | 1 + 4 files changed, 495 insertions(+), 119 deletions(-)
drivers/isdn/hardware/mISDN/hfc_multi.h +63 -10
@@ -18,6 +18,46 @@#define PCI_ENA_MEMIO 0x02/* +* Defines for the SDG embedded board using the XHFC-4SU chip +*/ +#ifdef CONFIG_8xx +#include <asm/8xx_immap.h> +#else +/* +* Dummy defines to make the compiler work for other architectures +*/ +#define IMAP_ADDR 0xFFF00000 + +struct io_port { +ushort iop_padir; +ushort iop_papar; +ushort iop_paodr; +ushort iop_padat; +}; + +struct comm_proc { +uint cp_pbdir; +uint cp_pbpar; +ushort cp_pbodr; +uint cp_pbdat; +}; + +struct immap { +struct io_port im_ioport; +struct comm_proc im_cpm; +}; +#endif /* CONFIG_8xx */ +#define XHFC_IRQ 4/* SIU_IRQ2 */ +#define XHFC_MEMBASE 0xFE000000 +#define XHFC_MEMSIZE 0x00001000 +#define XHFC_OFFSET 0x00001000 +#define PA_XHFC_A0 0x0020/* PA10 */ +#define PB_XHFC_IRQ1 0x00000100/* PB23 */ +#define PB_XHFC_IRQ2 0x00000200/* PB22 */ +#define PB_XHFC_IRQ3 0x00000400/* PB21 */ +#define PB_XHFC_IRQ4 0x00000800/* PB20 */ + +/* * NOTE: some registers are assigned multiple times due to different modes * also registers are assigned differen for HFC-4s/8s and HFC-E1 */
@@ -79,6 +119,11 @@ struct hfcm_hw {#define HFC_CFG_CRC4 10/* disable CRC-4 Multiframe mode, */ /* use double frame instead. */ +#define HFC_TYPE_E1 1/* controller is HFC-E1 */ +#define HFC_TYPE_4S 4/* controller is HFC-4S */ +#define HFC_TYPE_8S 8/* controller is HFC-8S */ +#define HFC_TYPE_XHFC 5/* controller is XHFC */ +#define HFC_CHIP_EXRAM_128 0/* external ram 128k */ #define HFC_CHIP_EXRAM_512 1/* external ram 256k */ #define HFC_CHIP_REVISION0 2/* old fifo handling */
@@ -86,19 +131,22 @@ struct hfcm_hw {#define HFC_CHIP_PCM_MASTER 4/* PCM is master */ #define HFC_CHIP_RX_SYNC 5/* disable pll sync for pcm */ #define HFC_CHIP_DTMF 6/* DTMF decoding is enabled */ -#define HFC_CHIP_ULAW 7/* ULAW mode */ -#define HFC_CHIP_CLOCK2 8/* double clock mode */ -#define HFC_CHIP_E1CLOCK_GET 9/* always get clock from E1 interface */ -#define HFC_CHIP_E1CLOCK_PUT 10/* always put clock from E1 interface */ -#define HFC_CHIP_WATCHDOG 11/* whether we should send signals */ +#define HFC_CHIP_CONF 7/* conference handling is enabled */ +#define HFC_CHIP_ULAW 8/* ULAW mode */ +#define HFC_CHIP_CLOCK2 9/* double clock mode */ +#define HFC_CHIP_E1CLOCK_GET 10/* always get clock from E1 interface */ +#define HFC_CHIP_E1CLOCK_PUT 11/* always put clock from E1 interface */ +#define HFC_CHIP_WATCHDOG 12/* whether we should send signals */ /* to the watchdog */ -#define HFC_CHIP_B410P 12/* whether we have a b410p with echocan in */ +#define HFC_CHIP_B410P 13/* whether we have a b410p with echocan in */ /* hw */ -#define HFC_CHIP_PLXSD 13/* whether we have a Speech-Design PLX */ +#define HFC_CHIP_PLXSD 14/* whether we have a Speech-Design PLX */ +#define HFC_CHIP_EMBSD 15/* whether we have a SD Embedded board */ #define HFC_IO_MODE_PCIMEM 0x00/* normal memory mapped IO */ #define HFC_IO_MODE_REGIO 0x01/* PCI io access */ #define HFC_IO_MODE_PLXSD 0x02/* access HFC via PLX9030 */ +#define HFC_IO_MODE_EMBSD 0x03/* direct access */ /* table entry in the PCI devices list */ struct hm_map {
@@ -111,6 +159,7 @@ struct hm_map {int opticalsupport;int dip_type;int io_mode; +int irq; };struct hfc_multi {
@@ -118,7 +167,7 @@ struct hfc_multi {struct hm_map *mtyp;int id;int pcm;/* id of pcm bus */ -int type; +int ctype;/* controller type */ int ports;u_int irq;/* irq used by card */
@@ -158,10 +207,14 @@ struct hfc_multi { int len);void (*write_fifo)(struct hfc_multi *hc,u_char *data,int len); -u_long pci_origmembase, plx_origmembase, dsp_origmembase; +u_long pci_origmembase, plx_origmembase;void __iomem *pci_membase;/* PCI memory */ void __iomem *plx_membase;/* PLX memory */ -u_char *dsp_membase;/* DSP on PLX */ +u_long xhfc_origmembase; +u_char *xhfc_membase; +u_long *xhfc_memaddr, *xhfc_memdata; +struct immap *immap; +u_long pb_irqmsk;/* Portbit mask to check the IRQ line */ u_long pci_iobase;/* PCI IO */ struct hfcm_hw hw;/* remember data of write-only-registers */
drivers/isdn/hardware/mISDN/hfcmulti.c +427 -109
1,035 lines not on this page · raw message
drivers/isdn/mISDN/dsp_cmx.c +4 -0
@@ -937,6 +937,10 @@ conf_software:if (current_conf >=0 ) { join_members:list_for_each_entry (member, &conf->mlist, list) { +/* if no conference engine on our chip, change to +* software */ +if (!member->dsp->features.hfc_conf) + goto conf_software;/* in case of hdlc, change to software */ if (member->dsp->hdlc) goto conf_software;
include/linux/mISDNdsp.h +1 -0
@@ -24,6 +24,7 @@ extern void mISDN_dsp_element_unregister(struct mISDN_dsp_element *elem);struct dsp_features {int hfc_id;/* unique id to identify the chip (or -1) */ int hfc_dtmf;/* set if HFCmulti card supports dtmf */ +int hfc_conf;/* set if HFCmulti card supports conferences */ int hfc_loops;/* set if card supports tone loops */ int hfc_echocanhw;/* set if card supports echocancelation*/ int pcm_id;/* unique id to identify the pcm bus (or -1) */
Signature · 1 line
1.6.0.2
Re: [PATCH 01/19] Add XHFC support for embedded Speech-Design board to hfcmulti
I have been applying some gigaset patches into the net-next-2.6 and I would therefore suggest that you push ISDN changes bound for the next kernel release via the networking tree as well.
In fact I'm very surprised that you're not at least CC:'ing [email protected] with these patches. Not only would they get review for networking specific issues they would also get your patches tracked automatically at:
http://patchwork.ozlabs.org/project/netdev/list/
Can you at least state how you intend to manage the ISDN changes you queue up? Are you going to submit them independantly and straight to Linus or are you going to play along and get them in via my net-next-2.6 tree in order to avoid all of the merge hassles?
Thanks.
Re: [PATCH 01/19] Add XHFC support for embedded Speech-Design board to hfcmulti
Hi Karsten,
Quoted 9 lines
I have been applying some gigaset patches into the net-next-2.6 and I would therefore suggest that you push ISDN changes bound for the next kernel release via the networking tree as well.
In fact I'm very surprised that you're not at least CC:'ing [email protected] with these patches. Not only would they get review for networking specific issues they would also get your patches tracked automatically at:
Quoted 6 lines
http://patchwork.ozlabs.org/project/netdev/list/
Can you at least state how you intend to manage the ISDN changes you queue up? Are you going to submit them independantly and straight to Linus or are you going to play along and get them in via my net-next-2.6 tree in order to avoid all of the merge hassles?
since mISDN uses AF_ISDN and sockets, I personally would prefer if they go via net-2.6 and net-next-2.6 trees. This makes it a lot simpler in case of merge conflicts during the merge windows.
Regards
Marcel
Re: [PATCH 01/19] Add XHFC support for embedded Speech-Design board to hfcmulti
Hi Marcel,
Hi Dave,
Quoted 10 lines · On Mittwoch, 20. Mai 2009 05:13:01 Marcel Holtmann wrote:
Hi Karsten,
Quoted 8 lines
I have been applying some gigaset patches into the net-next-2.6 and I would therefore suggest that you push ISDN changes bound for the next kernel release via the networking tree as well.
In fact I'm very surprised that you're not at least CC:'ing [email protected] with these patches. Not only would they get review for networking specific issues they would also get your patches tracked automatically at:
My idea was to not send it on too much lists, but I think you are right, [email protected] should be used here and since it should go via the net tree it should be the default.
Quoted 12 lines
Quoted 7 lines
http://patchwork.ozlabs.org/project/netdev/list/
Can you at least state how you intend to manage the ISDN changes you queue up? Are you going to submit them independantly and straight to Linus or are you going to play along and get them in via my net-next-2.6 tree in order to avoid all of the merge hassles?
since mISDN uses
AF_ISDNand sockets, I personally would prefer if they go via net-2.6 and net-next-2.6 trees. This makes it a lot simpler in case of merge conflicts during the merge windows.
Yes, you are right, I queued it for linux-next because I was remembering that somebody did suggest this in the past, but this was not really a good idea. I will setup a new merge tree based on net-2.6-next (or better net-2.6) ?
Karsten
Re: [PATCH 01/19] Add XHFC support for embedded Speech-Design board to hfcmulti
From: Karsten Keil <[email protected]>
Date: Wed, 20 May 2009 11:12:21 +0200
Quoted 3 lines
Yes, you are right, I queued it for linux-next because I was remembering that somebody did suggest this in the past, but this was not really a good idea. I will setup a new merge tree based on net-2.6-next (or better net-2.6) ?
For this stuff, net-next-2.6 would be the most appropriate.
Re: [PATCH 01/19] Add XHFC support for embedded Speech-Design board to hfcmulti
In reply to Karsten Keildrivers/isdn/hardware/mISDN/hfc_multi.h line 23
Quoted 9 lines · Karsten Keil
drivers/isdn/hardware/mISDN/hfc_multi.h +3
-0@@ -18,6 +18,46 @@#define PCI_ENA_MEMIO 0x02/* +* Defines for the SDG embedded board using the XHFC-4SU chip +*/ +#ifdef CONFIG_8xx
This seems like a awfully generic name for a (likely global) CONFIG. Can you add a descriptive prefix?
-Andi
Signature · 1 line
[email protected] -- Speaking for myself only.
Re: [PATCH 01/19] Add XHFC support for embedded Speech-Design board to hfcmulti
Hi Andi,
Quoted 14 lines · On Mittwoch, 20. Mai 2009 09:56:44 Andi Kleen wrote:
drivers/isdn/hardware/mISDN/hfc_multi.h line 23
Quoted 9 lines · Karsten Keil
drivers/isdn/hardware/mISDN/hfc_multi.h +3
-0@@ -18,6 +18,46 @@#define PCI_ENA_MEMIO 0x02/* +* Defines for the SDG embedded board using the XHFC-4SU chip +*/ +#ifdef CONFIG_8xxThis seems like a awfully generic name for a (likely global) CONFIG. Can you add a descriptive prefix?
Quoted 1 line
-Andi
This config is not set by mISDN, it is set by somepowerpc sub arch.
Karsten
Re: [PATCH 01/19] Add XHFC support for embedded Speech-Design board to hfcmulti
Hi Karsten,
Quoted 2 lines
This config is not set by mISDN, it is set by somepowerpc sub arch.
That still seems like a rather quirky way to do this then, making drivers dependent on specific architectures. This kind of thing lead to ifdef jungles in the past, hopefully not done again in new drivers.
Standard ways to handle this:
- If the driver needs something special only this architecture can provide make the architecture set a special HAS... config option.
- Provide a special asm include file that is stubbed out
by other architectures.
- Put the arch specific code in another file and make that dependent on the HAS_... symbol in the Makefile.
-Andi
Signature · 1 line
[email protected] -- Speaking for myself only.
Re: [PATCH 01/19] Add XHFC support for embedded Speech-Design board to hfcmulti
Quoted 8 lines · On Mittwoch, 20. Mai 2009 13:38:13 Andi Kleen wrote:
Hi Karsten,
Quoted 1 line
This config is not set by mISDN, it is set by somepowerpc sub arch.
That still seems like a rather quirky way to do this then, making drivers dependent on specific architectures. This kind of thing lead to ifdef jungles in the past, hopefully not done again in new drivers.
Andy, thanks for you comments.
Yes I did not like this part as well and this was the reason why I did not include this patch in my previous update in January. I only fixed some codestyle issues now.
Let discuss this with the author (CC'ed now).
Quoted 8 lines
Standard ways to handle this:
- If the driver needs something special only this architecture can provide make the architecture set a special HAS... config option.
- Provide a special asm include file that is stubbed out
by other architectures.
- Put the arch specific code in another file and make that dependent on theHAS_... symbol in theMakefile.
Do you have a pointer to a good example here ?
It seems that this architecture (used by an existing embedded board) have very specific IO method to this hardware so this should go into a separate file.
Karsten
Re: [PATCH 01/19] Add XHFC support for embedded Speech-Design board to hfcmulti
Quoted 10 lines · On Mittwoch, 20. Mai 2009 14:18:14 Karsten Keil wrote:
Quoted 8 lines · On Mittwoch, 20. Mai 2009 13:38:13 Andi Kleen wrote:
Hi Karsten,
Quoted 1 line
This config is not set by mISDN, it is set by somepowerpc sub arch.
That still seems like a rather quirky way to do this then, making drivers dependent on specific architectures. This kind of thing lead to ifdef jungles in the past, hopefully not done again in new drivers.
What about this patch (not tested yet) ?
Quoted 1 line
From
7192f421a348d756c8a7cf21aa3964e67ee0a3b5Mon Sep 17 00:00:00 2001
From: Karsten Keil <[email protected]>
Date: Wed, 20 May 2009 18:54:07 +0200
Subject: [PATCH] Add XHFC support for embedded Speech-Design board to hfcmulti
New version without emulating arch specific stuff for the other architectures.
Features like DTMF or hardware conference will not be available, so I expanded DSP's feature flags.
--- drivers/isdn/hardware/mISDN/Kconfig | 8 + drivers/isdn/hardware/mISDN/hfc_multi.h | 45 +++- drivers/isdn/hardware/mISDN/hfc_multi_emb.h | 177 +++++++++++++ drivers/isdn/hardware/mISDN/hfcmulti.c | 360 +++++++++++++++++++-------- drivers/isdn/mISDN/dsp_cmx.c | 4 + include/linux/mISDNdsp.h | 1 + 6 files changed, 483 insertions(+), 112 deletions(-) create mode 100644 drivers/isdn/hardware/mISDN/hfc_multi_emb.h
(quoted diff) +0 -0
b/drivers/isdn/hardware/mISDN/Kconfig
index fd112ae..a6ba4d5 100644
drivers/isdn/hardware/mISDN/Kconfig +8 -0
@@ -23,6 +23,14 @@ config MISDN_HFCMULTI * HFC-8S (8 S/T interfaces on one chip) * HFC-E1 (E1 interface for 2Mbit ISDN) +config MISDN_HFCMULTI_EMB + boolean "Support for XHFC embedded board in HFC multiport driver" + depends on MISDN + depends on MISDN_HFCMULTI + depends on 8xx + help + Enable support for the XHFC embedded solution from Speech Design. + config MISDN_HFCUSB tristate "Support for HFC-S USB based TAs" depends on USB
(quoted diff) +0 -0
b/drivers/isdn/hardware/mISDN/hfc_multi.h
index c4878cc..511eb21 100644
drivers/isdn/hardware/mISDN/hfc_multi.h +35 -10
89 lines not on this page · raw message
(quoted diff) +0 -0
b/drivers/isdn/hardware/mISDN/hfc_multi_emb.h
new file mode 100644
index 0000000..2c39991
drivers/isdn/hardware/mISDN/hfc_multi_emb.h new file +26 -0
@@ -0,0 +1,177 @@ +/* +* For License see notice in hfc_multi.c +* +* special IO and init functions for the embedded XHFC board +* from Speech Design +* +*/ + +#include <asm/8xx_immap.h> + +static void +#ifdef HFC_REGISTER_DEBUG +HFC_outb_embsd(struct hfc_multi *hc, u_char reg, u_char val, + const char *function, int line) +#else +HFC_outb_embsd(struct hfc_multi *hc, u_char reg, u_char val) +#endif +{ + hc->immap->im_ioport.iop_padat |=PA_XHFC_A0 ; +writeb (reg, hc->xhfc_memaddr); + hc->immap->im_ioport.iop_padat &= ~(PA_XHFC_A0 ); +writeb (val, hc->xhfc_memdata); +} +static u_char +#ifdef HFC_REGISTER_DEBUG +HFC_inb_embsd(struct hfc_multi *hc, u_char reg, const char *function, int
line)
+#else
+HFC_inb_embsd(struct hfc_multi *hc, u_char reg)
+#endif
+{
+ hc->immap->im_ioport.iop_padat |= PA_XHFC_A0;
+ writeb(reg, hc->xhfc_memaddr);
+ hc->immap->im_ioport.iop_padat &= ~(PA_XHFC_A0);
+ return readb(hc->xhfc_memdata);
+}
+static u_short
+#ifdef HFC_REGISTER_DEBUG
+HFC_inw_embsd(struct hfc_multi *hc, u_char reg, const char *function, int line)
+#else
+HFC_inw_embsd(struct hfc_multi *hc, u_char reg)
+#endif
+{
+ hc->immap->im_ioport.iop_padat |= PA_XHFC_A0;
+ writeb(reg, hc->xhfc_memaddr);
+ hc->immap->im_ioport.iop_padat &= ~(PA_XHFC_A0);
+ return readb(hc->xhfc_memdata);
+}
+static void
+#ifdef HFC_REGISTER_DEBUG
+HFC_wait_embsd(struct hfc_multi *hc, const char *function, int line) +#else
+HFC_wait_embsd(struct hfc_multi *hc)
+#endif
+{
+ hc->immap->im_ioport.iop_padat |= PA_XHFC_A0;
+ writeb(R_STATUS, hc->xhfc_memaddr);
+ hc->immap->im_ioport.iop_padat &= ~(PA_XHFC_A0);
+ while (readb(hc->xhfc_memdata) & V_BUSY)
+ cpu_relax();
+}
+
+/* write fifo data (EMBSD) */
+void
+write_fifo_embsd(struct hfc_multi *hc, u_char *data, int len) +{
+ hc->immap->im_ioport.iop_padat |= PA_XHFC_A0;
+ *hc->xhfc_memaddr = A_FIFO_DATA0;
+ hc->immap->im_ioport.iop_padat &= ~(PA_XHFC_A0);
+ while (len) {
+ *hc->xhfc_memdata = *data;
+ data++;
+ len--;
+ }
+}
+
+/* read fifo data (EMBSD) */
+void
+read_fifo_embsd(struct hfc_multi *hc, u_char *data, int len) +{
+ hc->immap->im_ioport.iop_padat |= PA_XHFC_A0;
+ *hc->xhfc_memaddr = A_FIFO_DATA0;
+ hc->immap->im_ioport.iop_padat &= ~(PA_XHFC_A0);
+ while (len) {
+ *data = (u_char)(*hc->xhfc_memdata);
+ data++;
+ len--;
+ }
+}
+
+static int
+setup_embedded(struct hfc_multi *hc, struct hm_map *m)
+{
+ printk(KERN_INFO
+ "HFC-multi: card manufacturer: '%s' card name: '%s' clock: %s\n",
+ m->vendor_name, m->card_name, m->clock2 ? "double" : "normal");
+
+ hc->pci_dev = NULL;
+ if (m->clock2)
+ test_and_set_bit(HFC_CHIP_CLOCK2, &hc->chip);
+
+ hc->leds = m->leds;
+ hc->ledstate = 0xAFFEAFFE;
+ hc->opticalsupport = m->opticalsupport;
+
+ /* set memory access methods */
+ if (m->io_mode) /* use mode from card config */
+ hc->io_mode = m->io_mode;
+ switch (hc->io_mode) {
+ case HFC_IO_MODE_EMBSD:
+ test_and_set_bit(HFC_CHIP_EMBSD, &hc->chip);
+ hc->slots = 128; /* required */
+ /* fall through */
+ hc->HFC_outb = HFC_outb_embsd;
+ hc->HFC_inb = HFC_inb_embsd;
+ hc->HFC_inw = HFC_inw_embsd;
+ hc->HFC_wait = HFC_wait_embsd;
+ hc->read_fifo = read_fifo_embsd;
+ hc->write_fifo = write_fifo_embsd;
+ break;
+ default:
+ printk(KERN_WARNING "HFC-multi: Invalid IO mode.\n");
+ return -EIO;
+ }
+ hc->HFC_outb_nodebug = hc->HFC_outb;
+ hc->HFC_inb_nodebug = hc->HFC_inb;
+ hc->HFC_inw_nodebug = hc->HFC_inw;
+ hc->HFC_wait_nodebug = hc->HFC_wait;
+#ifdef HFC_REGISTER_DEBUG
+ hc->HFC_outb = HFC_outb_debug;
+ hc->HFC_inb = HFC_inb_debug;
+ hc->HFC_inw = HFC_inw_debug;
+ hc->HFC_wait = HFC_wait_debug;
+#endif
+ hc->pci_iobase = 0;
+ hc->pci_membase = 0;
+ hc->xhfc_membase = NULL;
+ hc->xhfc_memaddr = NULL;
+ hc->xhfc_memdata = NULL;
+
+ switch (hc->io_mode) {
+ case HFC_IO_MODE_EMBSD:
+ hc->xhfc_origmembase = XHFC_MEMBASE + XHFC_OFFSET * hc->id;
+ hc->xhfc_membase = (u_char *)ioremap(hc->xhfc_origmembase,
+ XHFC_MEMSIZE);
+ if (!hc->xhfc_membase) {
+ printk(KERN_WARNING
+ "HFC-multi: failed to remap xhfc address space. "
+ "(internal error)\n");
+ return -EIO;
+ }
+ hc->xhfc_memaddr = (u_long *)(hc->xhfc_membase + 4);
+ hc->xhfc_memdata = (u_long *)(hc->xhfc_membase);
+ printk(KERN_INFO
+ "HFC-multi: xhfc_membase:%#lx xhfc_origmembase:%#lx " + "xhfc_memaddr:%#lx xhfc_memdata:%#lx\n", + (u_long)hc->xhfc_membase, hc->xhfc_origmembase, + (u_long)hc->xhfc_memaddr, (u_long)hc->xhfc_memdata);
+ break;
+ }
+
+ /* Prepare the MPC8XX PortA 10 as output (address/data selector) */
+ hc->immap = (struct immap *)(IMAP_ADDR);
+ hc->immap->im_ioport.iop_papar &= ~(PA_XHFC_A0);
+ hc->immap->im_ioport.iop_paodr &= ~(PA_XHFC_A0);
+ hc->immap->im_ioport.iop_padir |= PA_XHFC_A0;
+
+ /* Prepare the MPC8xx PortB __X__ as input (ISDN__X__IRQ) */
+ hc->pb_irqmsk = (PB_XHFC_IRQ1 << hc->id);
+ hc->immap->im_cpm.cp_pbpar &= ~(hc->pb_irqmsk);
+ hc->immap->im_cpm.cp_pbodr &= ~(hc->pb_irqmsk);
+ hc->immap->im_cpm.cp_pbdir &= ~(hc->pb_irqmsk);
+
+ /* At this point the needed config is done */
+ /* fifos are still not enabled */
+ return 0;
+}
+
(quoted diff) +0 -0
b/drivers/isdn/hardware/mISDN/hfcmulti.c
index 11982c5..498c024 100644
drivers/isdn/hardware/mISDN/hfcmulti.c +14 -0
@@ -139,6 +139,10 @@* Selects interface with clock source for mISDN and applications. * Set to card number starting with 1. Set to -1 to disable. * By default, the first card is used as clock source. +* +* hwid: +* NOTE: only one hwid value must be given once +* Enable special embedded devices with XHFC controllers. */ /*
@@ -206,6 +210,11 @@ static int clock;static uint timer;static uint clockdelay_te =CLKDEL_TE ;static uint clockdelay_nt =CLKDEL_NT ; +#define HWID_NONE 0 +#define HWID_MINIP4 1 +#define HWID_MINIP8 2 +#define HWID_MINIP16 3 +static uint hwid =HWID_NONE ;static int HFC_cnt, Port_cnt, PCM_cnt =99 ;
@@ -223,6 +232,7 @@ module_param_array(pcm, int, NULL, S_IRUGO | S_IWUSR);module_param_array (dslot, int,NULL ,S_IRUGO |S_IWUSR );module_param_array (iomode, uint,NULL ,S_IRUGO |S_IWUSR );module_param_array (port, uint,NULL ,S_IRUGO |S_IWUSR ); +module_param (hwid, uint,S_IRUGO |S_IWUSR );/* The hardware ID */ #ifdef HFC_REGISTER_DEBUG #define HFC_outb (hc, reg, val) \
@@ -252,6 +262,10 @@ module_param_array(port, uint, NULL, S_IRUGO | S_IWUSR);#define HFC_wait_nodebug (hc) (hc->HFC_wait_nodebug(hc))#endif +#ifdef CONFIG_MISDN_HFCMULTI_EMB +#include "hfc_multi_emb.h" +#endif +/* HFC_IO_MODE_PCIMEM */ static void #ifdef HFC_REGISTER_DEBUG
@@ -928,7 +942,7 @@ hfcmulti_resync(struct hfc_multi *locked, struct hfc_multi
*newmaster, int rm)
writel(pv, plx_acc_32);
if (test_bit(HFC_CHIP_PCM_MASTER, &hc->chip)) {
pcmmaster = hc;
- if (hc->type == 1) {
+ if (hc->ctype == HFC_TYPE_E1) {
if (debug & DEBUG_HFCMULTI_PLXSD)
printk(KERN_DEBUG
"Schedule SYNC_I\n");
@@ -949,7 +963,8 @@ hfcmulti_resync(struct hfc_multi *locked, struct hfc_multi *newmaster, int rm)
pv |= PLX_SYNC_O_EN;
writel(pv, plx_acc_32);
/* switch to jatt PLL, if not disabled by RX_SYNC */
- if (hc->type == 1 && !test_bit(HFC_CHIP_RX_SYNC, &hc->chip)) {
+ if (hc->ctype == HFC_TYPE_E1
+ && !test_bit(HFC_CHIP_RX_SYNC, &hc->chip)) {
if (debug & DEBUG_HFCMULTI_PLXSD)
printk(KERN_DEBUG "Schedule jatt PLL\n");
hc->e1_resync |= 2; /* switch to jatt */
@@ -961,7 +976,7 @@ hfcmulti_resync(struct hfc_multi *locked, struct hfc_multi *newmaster, int rm)
printk(KERN_DEBUG
"id=%d (0x%p) = PCM master syncronized " "with QUARTZ\n", hc->id, hc);
- if (hc->type == 1) {
+ if (hc->ctype == HFC_TYPE_E1) {
/* Use the crystal clock for the PCM
master card */
if (debug & DEBUG_HFCMULTI_PLXSD)
@@ -972,7 +987,7 @@ hfcmulti_resync(struct hfc_multi *locked, struct hfc_multi *newmaster, int rm)
if (debug & DEBUG_HFCMULTI_PLXSD)
printk(KERN_DEBUG
"QUARTZ is automatically "
- "enabled by HFC-%dS\n", hc->type);
+ "enabled by HFC-%dS\n", hc->ctype);
}
plx_acc_32 = hc->plx_membase + PLX_GPIOC; pv = readl(plx_acc_32);
@@ -1060,13 +1075,16 @@ release_io_hfcmulti(struct hfc_multi *hc)
/* disable memory mapped ports / io ports */ test_and_clear_bit(HFC_CHIP_PLXSD, &hc->chip); /* prevent resync */
- pci_write_config_word(hc->pci_dev, PCI_COMMAND, 0);
+ if (hc->pci_dev)
+ pci_write_config_word(hc->pci_dev, PCI_COMMAND, 0);
if (hc->pci_membase)
iounmap(hc->pci_membase);
if (hc->plx_membase)
iounmap(hc->plx_membase);
if (hc->pci_iobase)
release_region(hc->pci_iobase, 8);
+ if (hc->xhfc_membase)
+ iounmap((void *)hc->xhfc_membase);
if (hc->pci_dev) {
pci_disable_device(hc->pci_dev);
@@ -1100,8 +1118,9 @@ init_chip(struct hfc_multi *hc)
/* revision check */
if (debug & DEBUG_HFCMULTI_INIT)
printk(KERN_DEBUG "%s: entered\n", __func__);
- val = HFC_inb(hc, R_CHIP_ID)>>4;
- if (val != 0x8 && val != 0xc && val != 0xe) {
+ val = HFC_inb(hc, R_CHIP_ID);
+ if ((val>>4) != 0x8 && (val>>4) != 0xc && (val>>4) != 0xe
+ && (val>>1) != 0x31) {
printk(KERN_INFO "HFC_multi: unknown CHIP_ID:%x\n", (u_int)val); err = -EIO;
goto out;
@@ -1109,8 +1128,9 @@ init_chip(struct hfc_multi *hc)
rev = HFC_inb(hc, R_CHIP_RV);
printk(KERN_INFO
"HFC_multi: detected HFC with chip ID=0x%lx revision=%ld%s\n",
- val, rev, (rev == 0) ? " (old FIFO handling)" : "");
- if (rev == 0) {
+ val, rev, (rev == 0 && (hc->ctype != HFC_TYPE_XHFC)) ?
+ " (old FIFO handling)" : "");
+ if (hc->ctype != HFC_TYPE_XHFC && rev == 0) {
test_and_set_bit(HFC_CHIP_REVISION0, &hc->chip); printk(KERN_WARNING
"HFC_multi: NOTE: Your chip is revision 0, "
@@ -1152,6 +1172,12 @@ init_chip(struct hfc_multi *hc)
hc->Zlen = 8000;
hc->DTMFbase = 0x2000;
}
+ if (hc->ctype == HFC_TYPE_XHFC) {
+ hc->Flen = 0x8;
+ hc->Zmin = 0x0;
+ hc->Zlen = 64;
+ hc->DTMFbase = 0x0;
+ }
hc->max_trans = poll << 1;
if (hc->max_trans > hc->Zlen)
hc->max_trans = hc->Zlen;
@@ -1211,6 +1237,9 @@ init_chip(struct hfc_multi *hc)
hc->hw.r_pcm_md0 = V_F0_LEN; /* shift clock for DSP */
}
+ if (test_bit(HFC_CHIP_EMBSD, &hc->chip))
+ hc->hw.r_pcm_md0 = V_F0_LEN; /* shift clock for DSP */
+
/* we only want the real Z2 read-pointer for revision > 0 */ if (!test_bit(HFC_CHIP_REVISION0, &hc->chip))
hc->hw.r_ram_sz |= V_FZ_MD;
@@ -1234,15 +1263,24 @@ init_chip(struct hfc_multi *hc)
/* soft reset */
HFC_outb(hc, R_CTRL, hc->hw.r_ctrl);
- HFC_outb(hc, R_RAM_SZ, hc->hw.r_ram_sz);
+ if (hc->ctype == HFC_TYPE_XHFC)
+ HFC_outb(hc, 0x0C /* R_FIFO_THRES */,
+ 0x11 /* 16 Bytes TX/RX */);
+ else
+ HFC_outb(hc, R_RAM_SZ, hc->hw.r_ram_sz);
HFC_outb(hc, R_FIFO_MD, 0);
- hc->hw.r_cirm = V_SRES | V_HFCRES | V_PCMRES | V_STRES | V_RLD_EPR;
+ if (hc->ctype == HFC_TYPE_XHFC)
+ hc->hw.r_cirm = V_SRES | V_HFCRES | V_PCMRES | V_STRES;
+ else
+ hc->hw.r_cirm = V_SRES | V_HFCRES | V_PCMRES | V_STRES
+ | V_RLD_EPR;
HFC_outb(hc, R_CIRM, hc->hw.r_cirm);
udelay(100);
hc->hw.r_cirm = 0;
HFC_outb(hc, R_CIRM, hc->hw.r_cirm);
udelay(100);
- HFC_outb(hc, R_RAM_SZ, hc->hw.r_ram_sz);
+ if (hc->ctype != HFC_TYPE_XHFC)
+ HFC_outb(hc, R_RAM_SZ, hc->hw.r_ram_sz);
/* Speech Design PLX bridge pcm and sync mode */
if (test_bit(HFC_CHIP_PLXSD, &hc->chip)) {
@@ -1278,13 +1316,16 @@ init_chip(struct hfc_multi *hc)
HFC_outb(hc, R_PCM_MD0, hc->hw.r_pcm_md0 | 0xa0);
if (test_bit(HFC_CHIP_PLXSD, &hc->chip))
HFC_outb(hc, R_PCM_MD2, V_SYNC_SRC); /* sync via SYNC_I / O */
+ else if (test_bit(HFC_CHIP_EMBSD, &hc->chip))
+ HFC_outb(hc, R_PCM_MD2, 0x10); /* V_C2O_EN */
else
HFC_outb(hc, R_PCM_MD2, 0x00); /* sync from interface */
HFC_outb(hc, R_PCM_MD0, hc->hw.r_pcm_md0 | 0x00);
for (i = 0; i < 256; i++) {
HFC_outb_nodebug(hc, R_SLOT, i); HFC_outb_nodebug(hc, A_SL_CFG, 0);
- HFC_outb_nodebug(hc, A_CONF, 0);
+ if (hc->ctype != HFC_TYPE_XHFC)
+ HFC_outb_nodebug(hc, A_CONF, 0);
hc->slot_owner[i] = -1;
}
@@ -1296,6 +1337,9 @@ init_chip(struct hfc_multi *hc)
HFC_outb(hc, R_BRG_PCM_CFG, V_PCM_CLK);
}
+ if (test_bit(HFC_CHIP_EMBSD, &hc->chip))
+ HFC_outb(hc, 0x02 /* R_CLK_CFG */, 0x40 /* V_CLKO_OFF */);
+
/* B410P GPIO */
if (test_bit(HFC_CHIP_B410P, &hc->chip)) {
printk(KERN_NOTICE "Setting GPIOs\n");
@@ -1424,7 +1468,7 @@ controller_fail:
hc->hw.r_irqmsk_misc |= V_TI_IRQMSK;
/* set E1 state machine IRQ */
- if (hc->type == 1)
+ if (hc->ctype == HFC_TYPE_E1)
hc->hw.r_irqmsk_misc |= V_STA_IRQMSK;
/* set DTMF detection */
@@ -1444,7 +1488,8 @@ controller_fail:
r_conf_en = V_CONF_EN | V_ULAW;
else
r_conf_en = V_CONF_EN;
- HFC_outb(hc, R_CONF_EN, r_conf_en);
+ if (hc->ctype != HFC_TYPE_XHFC)
+ HFC_outb(hc, R_CONF_EN, r_conf_en);
/* setting leds */
switch (hc->leds) {
@@ -1468,16 +1513,23 @@ controller_fail:
break;
}
+ if (test_bit(HFC_CHIP_EMBSD, &hc->chip)) {
+ hc->hw.r_st_sync = 0x10; /* V_AUTO_SYNCI */
+ HFC_outb(hc, R_ST_SYNC, hc->hw.r_st_sync);
+ }
+
/* set master clock */
if (hc->masterclk >= 0) {
if (debug & DEBUG_HFCMULTI_INIT)
printk(KERN_DEBUG "%s: setting ST master clock "
"to port %d (0..%d)\n", __func__, hc->masterclk, hc->ports-1);
- hc->hw.r_st_sync = hc->masterclk | V_AUTO_SYNC;
+ hc->hw.r_st_sync |= (hc->masterclk | V_AUTO_SYNC);
HFC_outb(hc, R_ST_SYNC, hc->hw.r_st_sync);
}
+
+
/* setting misc irq */
HFC_outb(hc, R_IRQMSK_MISC, hc->hw.r_irqmsk_misc);
if (debug & DEBUG_HFCMULTI_INIT)
@@ -1929,7 +1981,7 @@ next_frame:
Fspace = 1;
}
/* one frame only for ST D-channels, to allow resending */
- if (hc->type != 1 && dch) {
+ if (hc->ctype != HFC_TYPE_E1 && dch) {
if (f1 != f2)
Fspace = 0;
}
@@ -1971,12 +2023,22 @@ next_frame:
"slot_tx %d\n", __func__, ch, slot_tx);
/* connect slot */
- HFC_outb(hc, A_CON_HDLC, 0xc0 | 0x00 |
- V_HDLC_TRP | V_IFF);
+ if (hc->ctype == HFC_TYPE_XHFC)
+ HFC_outb(hc, A_CON_HDLC, 0xc0
+ | 0x07 << 2 | V_HDLC_TRP | V_IFF);
+ /* Enable FIFO, no interrupt */
+ else
+ HFC_outb(hc, A_CON_HDLC, 0xc0 | 0x00 |
+ V_HDLC_TRP | V_IFF);
HFC_outb_nodebug(hc, R_FIFO, ch<<1 | 1); HFC_wait_nodebug(hc);
- HFC_outb(hc, A_CON_HDLC, 0xc0 | 0x00 |
- V_HDLC_TRP | V_IFF);
+ if (hc->ctype == HFC_TYPE_XHFC)
+ HFC_outb(hc, A_CON_HDLC, 0xc0
+ | 0x07 << 2 | V_HDLC_TRP | V_IFF);
+ /* Enable FIFO, no interrupt */
+ else
+ HFC_outb(hc, A_CON_HDLC, 0xc0 | 0x00 |
+ V_HDLC_TRP | V_IFF);
HFC_outb_nodebug(hc, R_FIFO, ch<<1); HFC_wait_nodebug(hc);
}
@@ -2004,10 +2066,22 @@ next_frame:
"FIFO data: channel %d slot_tx %d\n", __func__, ch, slot_tx);
/* disconnect slot */
- HFC_outb(hc, A_CON_HDLC, 0x80 | 0x00 | V_HDLC_TRP | V_IFF);
+ if (hc->ctype == HFC_TYPE_XHFC)
+ HFC_outb(hc, A_CON_HDLC, 0x80
+ | 0x07 << 2 | V_HDLC_TRP | V_IFF);
+ /* Enable FIFO, no interrupt */
+ else
+ HFC_outb(hc, A_CON_HDLC, 0x80 | 0x00 |
+ V_HDLC_TRP | V_IFF);
HFC_outb_nodebug(hc, R_FIFO, ch<<1 | 1); HFC_wait_nodebug(hc);
- HFC_outb(hc, A_CON_HDLC, 0x80 | 0x00 | V_HDLC_TRP | V_IFF);
+ if (hc->ctype == HFC_TYPE_XHFC)
+ HFC_outb(hc, A_CON_HDLC, 0x80
+ | 0x07 << 2 | V_HDLC_TRP | V_IFF);
+ /* Enable FIFO, no interrupt */
+ else
+ HFC_outb(hc, A_CON_HDLC, 0x80 | 0x00 |
+ V_HDLC_TRP | V_IFF);
HFC_outb_nodebug(hc, R_FIFO, ch<<1); HFC_wait_nodebug(hc);
}
@@ -2327,7 +2401,7 @@ handle_timer_irq(struct hfc_multi *hc)
spin_unlock_irqrestore(&HFClock, flags);
}
- if (hc->type != 1 || hc->e1_state == 1)
+ if (hc->ctype != HFC_TYPE_E1 || hc->e1_state == 1)
for (ch = 0; ch <= 31; ch++) {
if (hc->created[hc->chan[ch].port]) {
hfcmulti_tx(hc, ch);
@@ -2350,7 +2424,7 @@ handle_timer_irq(struct hfc_multi *hc)
}
}
}
- if (hc->type == 1 && hc->created[0]) {
+ if (hc->ctype == HFC_TYPE_E1 && hc->created[0]) {
dch = hc->chan[hc->dslot].dch;
if (test_bit(HFC_CFG_REPORT_LOS, &hc->chan[hc->dslot].cfg)) {
/* LOS */
@@ -2610,7 +2684,10 @@ hfcmulti_interrupt(int intno, void *dev_id)
"card %d, this is no bug.\n", hc->id + 1, irqsem);
irqsem = hc->id + 1;
#endif
-
+#ifdef CONFIG_MISDN_HFCMULTI_EMB
+ if (hc->immap->im_cpm.cp_pbdat & hc->pb_irqmsk)
+ goto irq_notforus;
+#endif
if (test_bit(HFC_CHIP_PLXSD, &hc->chip)) {
spin_lock_irqsave(&plx_lock, flags);
plx_acc = hc->plx_membase + PLX_INTCSR;
@@ -2650,7 +2727,7 @@ hfcmulti_interrupt(int intno, void *dev_id)
}
hc->irqcnt++;
if (r_irq_statech) {
- if (hc->type != 1)
+ if (hc->ctype != HFC_TYPE_E1)
ph_state_irq(hc, r_irq_statech);
}
if (status & V_EXT_IRQSTA)
@@ -2664,7 +2741,7 @@ hfcmulti_interrupt(int intno, void *dev_id)
r_irq_misc = HFC_inb_nodebug(hc, R_IRQ_MISC); r_irq_misc &= hc->hw.r_irqmsk_misc; /* ignore disabled irqs */ if (r_irq_misc & V_STA_IRQ) {
- if (hc->type == 1) {
+ if (hc->ctype == HFC_TYPE_E1) {
/* state machine */
dch = hc->chan[hc->dslot].dch; e1_syncsta = HFC_inb_nodebug(hc, R_SYNC_STA);
@@ -2703,9 +2780,9 @@ hfcmulti_interrupt(int intno, void *dev_id)
handle_timer_irq(hc);
}
- if (r_irq_misc & V_DTMF_IRQ) {
+ if (r_irq_misc & V_DTMF_IRQ)
hfcmulti_dtmf(hc);
- }
+
if (r_irq_misc & V_IRQ_PROC) {
static int irq_proc_cnt;
if (!irq_proc_cnt++)
@@ -2786,7 +2863,8 @@ mode_hfcmulti(struct hfc_multi *hc, int ch, int protocol, int slot_tx,
if (hc->slot_owner[oslot_tx<<1] == ch) {
HFC_outb(hc, R_SLOT, oslot_tx << 1); HFC_outb(hc, A_SL_CFG, 0);
- HFC_outb(hc, A_CONF, 0);
+ if (hc->ctype != HFC_TYPE_XHFC)
+ HFC_outb(hc, A_CONF, 0);
hc->slot_owner[oslot_tx<<1] = -1;
} else {
if (debug & DEBUG_HFCMULTI_MODE)
@@ -2839,7 +2917,9 @@ mode_hfcmulti(struct hfc_multi *hc, int ch, int protocol, int slot_tx,
flow_tx, routing, conf);
HFC_outb(hc, R_SLOT, slot_tx << 1);
HFC_outb(hc, A_SL_CFG, (ch<<1) | routing);
- HFC_outb(hc, A_CONF, (conf < 0) ? 0 : (conf | V_CONF_SL));
+ if (hc->ctype != HFC_TYPE_XHFC)
+ HFC_outb(hc, A_CONF,
+ (conf < 0) ? 0 : (conf | V_CONF_SL));
hc->slot_owner[slot_tx << 1] = ch; hc->chan[ch].slot_tx = slot_tx; hc->chan[ch].bank_tx = bank_tx;
@@ -2889,7 +2969,7 @@ mode_hfcmulti(struct hfc_multi *hc, int ch, int protocol, int slot_tx,
HFC_outb(hc, A_IRQ_MSK, 0);
HFC_outb(hc, R_INC_RES_FIFO, V_RES_F); HFC_wait(hc);
- if (hc->chan[ch].bch && hc->type != 1) {
+ if (hc->chan[ch].bch && hc->ctype != HFC_TYPE_E1) {
hc->hw.a_st_ctrl0[hc->chan[ch].port] &=
((ch & 0x3) == 0)? ~V_B1_EN: ~V_B2_EN;
HFC_outb(hc, R_ST_SEL, hc->chan[ch].port);
@@ -2965,8 +3045,13 @@ mode_hfcmulti(struct hfc_multi *hc, int ch, int protocol, int slot_tx,
/* enable TX fifo */
HFC_outb(hc, R_FIFO, ch << 1); HFC_wait(hc);
- HFC_outb(hc, A_CON_HDLC, flow_tx | 0x00 |
- V_HDLC_TRP | V_IFF);
+ if (hc->ctype == HFC_TYPE_XHFC)
+ HFC_outb(hc, A_CON_HDLC, flow_tx | 0x07 << 2 |
+ V_HDLC_TRP | V_IFF);
+ /* Enable FIFO, no interrupt */
+ else
+ HFC_outb(hc, A_CON_HDLC, flow_tx | 0x00 |
+ V_HDLC_TRP | V_IFF);
HFC_outb(hc, A_SUBCH_CFG, 0); HFC_outb(hc, A_IRQ_MSK, 0);
HFC_outb(hc, R_INC_RES_FIFO, V_RES_F);
@@ -2976,13 +3061,19 @@ mode_hfcmulti(struct hfc_multi *hc, int ch, int protocol, int slot_tx,
/* enable RX fifo */
HFC_outb(hc, R_FIFO, (ch<<1)|1); HFC_wait(hc);
- HFC_outb(hc, A_CON_HDLC, flow_rx | 0x00 | V_HDLC_TRP);
+ if (hc->ctype == HFC_TYPE_XHFC)
+ HFC_outb(hc, A_CON_HDLC, flow_rx | 0x07 << 2 |
+ V_HDLC_TRP);
+ /* Enable FIFO, no interrupt*/
+ else
+ HFC_outb(hc, A_CON_HDLC, flow_rx | 0x00 |
+ V_HDLC_TRP);
HFC_outb(hc, A_SUBCH_CFG, 0); HFC_outb(hc, A_IRQ_MSK, 0);
HFC_outb(hc, R_INC_RES_FIFO, V_RES_F); HFC_wait(hc);
}
- if (hc->type != 1) {
+ if (hc->ctype != HFC_TYPE_E1) {
hc->hw.a_st_ctrl0[hc->chan[ch].port] |=
((ch & 0x3) == 0) ? V_B1_EN : V_B2_EN;
HFC_outb(hc, R_ST_SEL, hc->chan[ch].port);
@@ -3003,7 +3094,7 @@ mode_hfcmulti(struct hfc_multi *hc, int ch, int protocol, int slot_tx,
/* enable TX fifo */
HFC_outb(hc, R_FIFO, ch<<1);
HFC_wait(hc);
- if (hc->type == 1 || hc->chan[ch].bch) {
+ if (hc->ctype == HFC_TYPE_E1 || hc->chan[ch].bch) {
/* E1 or B-channel */
HFC_outb(hc, A_CON_HDLC, flow_tx | 0x04); HFC_outb(hc, A_SUBCH_CFG, 0);
@@ -3019,7 +3110,7 @@ mode_hfcmulti(struct hfc_multi *hc, int ch, int protocol, int slot_tx,
HFC_outb(hc, R_FIFO, (ch<<1)|1);
HFC_wait(hc);
HFC_outb(hc, A_CON_HDLC, flow_rx | 0x04);
- if (hc->type == 1 || hc->chan[ch].bch)
+ if (hc->ctype == HFC_TYPE_E1 || hc->chan[ch].bch)
HFC_outb(hc, A_SUBCH_CFG, 0); /* full 8 bits */
else
HFC_outb(hc, A_SUBCH_CFG, 2); /* 2 bits dchannel */
@@ -3028,7 +3119,7 @@ mode_hfcmulti(struct hfc_multi *hc, int ch, int protocol, int slot_tx,
HFC_wait(hc);
if (hc->chan[ch].bch) {
test_and_set_bit(FLG_HDLC, &hc->chan[ch].bch->Flags);
- if (hc->type != 1) {
+ if (hc->ctype != HFC_TYPE_E1) {
hc->hw.a_st_ctrl0[hc->chan[ch].port] |=
((ch&0x3) == 0) ? V_B1_EN : V_B2_EN;
HFC_outb(hc, R_ST_SEL, hc->chan[ch].port);
@@ -3108,7 +3199,7 @@ hfcm_l1callback(struct dchannel *dch, u_int cmd)
case HW_RESET_REQ:
/* start activation */ spin_lock_irqsave(&hc->lock, flags);
- if (hc->type == 1) {
+ if (hc->ctype == HFC_TYPE_E1) {
if (debug & DEBUG_HFCMULTI_MSG)
printk(KERN_DEBUG
"%s: HW_RESET_REQ no BRI\n",
@@ -3129,7 +3220,7 @@ hfcm_l1callback(struct dchannel *dch, u_int cmd)
case HW_DEACT_REQ:
/* start deactivation */ spin_lock_irqsave(&hc->lock, flags);
- if (hc->type == 1) {
+ if (hc->ctype == HFC_TYPE_E1) {
if (debug & DEBUG_HFCMULTI_MSG)
printk(KERN_DEBUG
"%s: HW_DEACT_REQ no BRI\n",
@@ -3163,7 +3254,7 @@ hfcm_l1callback(struct dchannel *dch, u_int cmd)
break;
case HW_POWERUP_REQ:
spin_lock_irqsave(&hc->lock, flags);
- if (hc->type == 1) {
+ if (hc->ctype == HFC_TYPE_E1) {
if (debug & DEBUG_HFCMULTI_MSG)
printk(KERN_DEBUG
"%s: HW_POWERUP_REQ no BRI\n",
@@ -3240,7 +3331,7 @@ handle_dmsg(struct mISDNchannel *ch, struct sk_buff *skb)
__func__, hc->chan[dch->slot].port, hc->ports-1);
/* start activation */
- if (hc->type == 1) {
+ if (hc->ctype == HFC_TYPE_E1) {
ph_state_change(dch);
if (debug & DEBUG_HFCMULTI_STATE)
printk(KERN_DEBUG
@@ -3273,7 +3364,7 @@ handle_dmsg(struct mISDNchannel *ch, struct sk_buff *skb)
__func__, hc->chan[dch->slot].port, hc->ports-1);
/* start deactivation */
- if (hc->type == 1) {
+ if (hc->ctype == HFC_TYPE_E1) {
if (debug & DEBUG_HFCMULTI_MSG)
printk(KERN_DEBUG
"%s: PH_DEACTIVATE no BRI\n",
@@ -3493,6 +3584,8 @@ channel_bctrl(struct bchannel *bch, struct mISDN_ctrl_req *cq)
features->hfc_id = hc->id;
if (test_bit(HFC_CHIP_DTMF, &hc->chip))
features->hfc_dtmf = 1;
+ if (test_bit(HFC_CHIP_CONF, &hc->chip))
+ features->hfc_conf = 1;
features->hfc_loops = 0;
if (test_bit(HFC_CHIP_B410P, &hc->chip)) {
features->hfc_echocanhw = 1;
@@ -3630,7 +3723,7 @@ ph_state_change(struct dchannel *dch)
hc = dch->hw;
ch = dch->slot;
- if (hc->type == 1) {
+ if (hc->ctype == HFC_TYPE_E1) {
if (dch->dev.D.protocol == ISDN_P_TE_E1) {
if (debug & DEBUG_HFCMULTI_STATE)
printk(KERN_DEBUG
@@ -3755,7 +3848,7 @@ hfcmulti_initmode(struct dchannel *dch)
if (debug & DEBUG_HFCMULTI_INIT)
printk(KERN_DEBUG "%s: entered\n", __func__);
- if (hc->type == 1) {
+ if (hc->ctype == HFC_TYPE_E1) {
hc->chan[hc->dslot].slot_tx = -1; hc->chan[hc->dslot].slot_rx = -1; hc->chan[hc->dslot].conf = -1;
@@ -3904,6 +3997,11 @@ hfcmulti_initmode(struct dchannel *dch)
}
if (!test_bit(HFC_CFG_NONCAP_TX, &hc->chan[i].cfg))
hc->hw.a_st_ctrl0[pt] |= V_TX_LI;
+ if (hc->ctype == HFC_TYPE_XHFC) {
+ hc->hw.a_st_ctrl0[pt] |= 0x40 /* V_ST_PU_CTRL */;
+ HFC_outb(hc, 0x35 /* A_ST_CTRL3 */,
+ 0x7c << 1 /* V_ST_PULSE */);
+ }
/* line setup */
HFC_outb(hc, A_ST_CTRL0, hc->hw.a_st_ctrl0[pt]); /* disable E-channel */
@@ -3990,7 +4088,7 @@ open_bchannel(struct hfc_multi *hc, struct dchannel *dch,
return -EINVAL;
if (rq->protocol == ISDN_P_NONE)
return -EINVAL;
- if (hc->type == 1)
+ if (hc->ctype == HFC_TYPE_E1)
ch = rq->adr.channel;
else
ch = (rq->adr.channel - 1) + (dch->slot - 2);
@@ -4081,7 +4179,7 @@ hfcm_dctrl(struct mISDNchannel *ch, u_int cmd, void *arg)
switch (rq->protocol) {
case ISDN_P_TE_S0:
case ISDN_P_NT_S0:
- if (hc->type == 1) {
+ if (hc->ctype == HFC_TYPE_E1) {
err = -EINVAL;
break;
}
@@ -4089,7 +4187,7 @@ hfcm_dctrl(struct mISDNchannel *ch, u_int cmd, void *arg)
break;
case ISDN_P_TE_E1:
case ISDN_P_NT_E1:
- if (hc->type != 1) {
+ if (hc->ctype != HFC_TYPE_E1) {
err = -EINVAL;
break;
}
@@ -4156,13 +4254,13 @@ init_card(struct hfc_multi *hc)
disable_hwirq(hc);
spin_unlock_irqrestore(&hc->lock, flags);
- if (request_irq(hc->pci_dev->irq, hfcmulti_interrupt, IRQF_SHARED,
+ if (request_irq(hc->irq, hfcmulti_interrupt, IRQF_SHARED,
"HFC-multi", hc)) {
printk(KERN_WARNING "mISDN: Could not get interrupt %d.\n",
- hc->pci_dev->irq);
+ hc->irq);
+ hc->irq = 0;
return -EIO;
}
- hc->irq = hc->pci_dev->irq;
if (test_bit(HFC_CHIP_PLXSD, &hc->chip)) {
spin_lock_irqsave(&plx_lock, plx_flags);
@@ -4377,8 +4475,8 @@ setup_pci(struct hfc_multi *hc, struct pci_dev *pdev,
pci_disable_device(hc->pci_dev);
return -EIO;
}
- printk(KERN_INFO "card %d: defined at MEMBASE %#lx (%#lx) IRQ %d "
- "HZ %d leds-type %d\n", hc->id, (u_long)hc->pci_membase,
+ printk(KERN_INFO "card %d: defined at MEMBASE %#lx (%#lx) IRQ "
+ "%d HZ %d leds-type %d\n", hc->id, (u_long)hc->pci_membase,
hc->pci_origmembase, hc->pci_dev->irq, HZ, hc->leds);
pci_write_config_word(hc->pci_dev, PCI_COMMAND, PCI_ENA_MEMIO); break;
@@ -4464,7 +4562,7 @@ release_port(struct hfc_multi *hc, struct dchannel *dch)
dch->timer.function = NULL;
}
- if (hc->type == 1) { /* E1 */
+ if (hc->ctype == HFC_TYPE_E1) { /* E1 */
/* remove sync */
if (test_bit(HFC_CHIP_PLXSD, &hc->chip)) {
hc->syncronized = 0;
@@ -4863,9 +4961,15 @@ init_multi_port(struct hfc_multi *hc, int pt)
test_and_set_bit(HFC_CFG_DIS_ECHANNEL,
&hc->chan[i + 2].cfg);
}
- snprintf(name, MISDN_MAX_IDLEN - 1, "hfc-%ds.%d-%d",
- hc->type, HFC_cnt + 1, pt + 1);
- ret = mISDN_register_device(&dch->dev, &hc->pci_dev->dev, name);
+ if (hc->ctype == HFC_TYPE_XHFC) {
+ snprintf(name, MISDN_MAX_IDLEN - 1, "xhfc.%d-%d",
+ HFC_cnt + 1, pt + 1);
+ ret = mISDN_register_device(&dch->dev, NULL, name);
+ } else {
+ snprintf(name, MISDN_MAX_IDLEN - 1, "hfc-%ds.%d-%d",
+ hc->ctype, HFC_cnt + 1, pt + 1);
+ ret = mISDN_register_device(&dch->dev, &hc->pci_dev->dev, name);
+ }
if (ret)
goto free_chan;
hc->created[pt] = 1;
@@ -4876,9 +4980,9 @@ free_chan:
}
static int
-hfcmulti_init(struct pci_dev *pdev, const struct pci_device_id *ent) +hfcmulti_init(struct hm_map *m, struct pci_dev *pdev,
+ const struct pci_device_id *ent)
{
- struct hm_map *m = (struct hm_map *)ent->driver_data;
int ret_err = 0;
int pt;
struct hfc_multi *hc;
@@ -4913,16 +5017,18 @@ hfcmulti_init(struct pci_dev *pdev, const struct pci_device_id *ent)
}
spin_lock_init(&hc->lock);
hc->mtyp = m;
- hc->type = m->type;
+ hc->ctype = m->type;
hc->ports = m->ports;
hc->id = HFC_cnt;
hc->pcm = pcm[HFC_cnt];
hc->io_mode = iomode[HFC_cnt];
- if (dslot[HFC_cnt] < 0 && hc->type == 1) {
+ if (dslot[HFC_cnt] < 0 && hc->ctype == HFC_TYPE_E1) {
hc->dslot = 0;
printk(KERN_INFO "HFC-E1 card has disabled D-channel, but "
"31 B-channels\n");
- } if (dslot[HFC_cnt] > 0 && dslot[HFC_cnt] < 32 && hc->type == 1) {
+ }
+ if (dslot[HFC_cnt] > 0 && dslot[HFC_cnt] < 32
+ && hc->ctype == HFC_TYPE_E1) {
hc->dslot = dslot[HFC_cnt];
printk(KERN_INFO "HFC-E1 card has alternating D-channel on "
"time slot %d\n", dslot[HFC_cnt]);
@@ -4944,8 +5050,11 @@ hfcmulti_init(struct pci_dev *pdev, const struct pci_device_id *ent)
for (i = 0; i < (poll >> 1); i++)
hc->silence_data[i] = hc->silence;
- if (!(type[HFC_cnt] & 0x200))
- test_and_set_bit(HFC_CHIP_DTMF, &hc->chip);
+ if (hc->ctype != HFC_TYPE_XHFC) {
+ if (!(type[HFC_cnt] & 0x200))
+ test_and_set_bit(HFC_CHIP_DTMF, &hc->chip);
+ test_and_set_bit(HFC_CHIP_CONF, &hc->chip);
+ }
if (type[HFC_cnt] & 0x800)
test_and_set_bit(HFC_CHIP_PCM_SLAVE, &hc->chip);
@@ -4969,8 +5078,18 @@ hfcmulti_init(struct pci_dev *pdev, const struct pci_device_id *ent)
printk(KERN_NOTICE "Watchdog enabled\n");
}
- /* setup pci, hc->slots may change due to PLXSD */
- ret_err = setup_pci(hc, pdev, ent);
+ if (pdev && ent)
+ /* setup pci, hc->slots may change due to PLXSD */
+ ret_err = setup_pci(hc, pdev, ent);
+ else
+#ifdef CONFIG_MISDN_HFCMULTI_EMB
+ ret_err = setup_embedded(hc, m);
+#else
+ {
+ printk(KERN_WARNING "Embedded IO Mode not selected\n");
+ ret_err = -EIO;
+ }
+#endif
if (ret_err) {
if (hc == syncmaster)
syncmaster = NULL;
@@ -4986,7 +5105,7 @@ hfcmulti_init(struct pci_dev *pdev, const struct pci_device_id *ent)
ret_err = -EINVAL;
goto free_card;
}
- if (hc->type == 1)
+ if (hc->ctype == HFC_TYPE_E1)
ret_err = init_e1_port(hc, m);
else
ret_err = init_multi_port(hc, pt);
@@ -5070,6 +5189,7 @@ hfcmulti_init(struct pci_dev *pdev, const struct pci_device_id *ent)
hc->iclock = mISDN_register_clock("HFCMulti", 0, clockctl, hc);
/* initialize hardware */
+ hc->irq = (m->irq) ? : hc->pci_dev->irq;
ret_err = init_card(hc);
if (ret_err) {
printk(KERN_ERR "init card returns %d\n", ret_err);
@@ -5120,45 +5240,47 @@ static void __devexit hfc_remove_pci(struct pci_dev *pdev)
#define VENDOR_PRIM "PrimuX"
static const struct hm_map hfcm_map[] = {
-/*0*/ {VENDOR_BN, "HFC-1S Card (mini PCI)", 4, 1, 1, 3, 0, DIP_4S, 0},
-/*1*/ {VENDOR_BN, "HFC-2S Card", 4, 2, 1, 3, 0, DIP_4S, 0},
-/*2*/ {VENDOR_BN, "HFC-2S Card (mini PCI)", 4, 2, 1, 3, 0, DIP_4S, 0},
-/*3*/ {VENDOR_BN, "HFC-4S Card", 4, 4, 1, 2, 0, DIP_4S, 0},
-/*4*/ {VENDOR_BN, "HFC-4S Card (mini PCI)", 4, 4, 1, 2, 0, 0, 0},
-/*5*/ {VENDOR_CCD, "HFC-4S Eval (old)", 4, 4, 0, 0, 0, 0, 0},
-/*6*/ {VENDOR_CCD, "HFC-4S IOB4ST", 4, 4, 1, 2, 0, DIP_4S, 0},
-/*7*/ {VENDOR_CCD, "HFC-4S", 4, 4, 1, 2, 0, 0, 0},
-/*8*/ {VENDOR_DIG, "HFC-4S Card", 4, 4, 0, 2, 0, 0, HFC_IO_MODE_REGIO},
-/*9*/ {VENDOR_CCD, "HFC-4S Swyx 4xS0 SX2 QuadBri", 4, 4, 1, 2, 0, 0, 0},
-/*10*/ {VENDOR_JH, "HFC-4S (junghanns 2.0)", 4, 4, 1, 2, 0, 0, 0},
-/*11*/ {VENDOR_PRIM, "HFC-2S Primux Card", 4, 2, 0, 0, 0, 0, 0},
-
-/*12*/ {VENDOR_BN, "HFC-8S Card", 8, 8, 1, 0, 0, 0, 0},
+/*0*/ {VENDOR_BN, "HFC-1S Card (mini PCI)", 4, 1, 1, 3, 0, DIP_4S, 0, 0},
+/*1*/ {VENDOR_BN, "HFC-2S Card", 4, 2, 1, 3, 0, DIP_4S, 0, 0},
+/*2*/ {VENDOR_BN, "HFC-2S Card (mini PCI)", 4, 2, 1, 3, 0, DIP_4S, 0, 0},
+/*3*/ {VENDOR_BN, "HFC-4S Card", 4, 4, 1, 2, 0, DIP_4S, 0, 0},
+/*4*/ {VENDOR_BN, "HFC-4S Card (mini PCI)", 4, 4, 1, 2, 0, 0, 0, 0},
+/*5*/ {VENDOR_CCD, "HFC-4S Eval (old)", 4, 4, 0, 0, 0, 0, 0, 0},
+/*6*/ {VENDOR_CCD, "HFC-4S IOB4ST", 4, 4, 1, 2, 0, DIP_4S, 0, 0},
+/*7*/ {VENDOR_CCD, "HFC-4S", 4, 4, 1, 2, 0, 0, 0, 0},
+/*8*/ {VENDOR_DIG, "HFC-4S Card", 4, 4, 0, 2, 0, 0, HFC_IO_MODE_REGIO, 0},
+/*9*/ {VENDOR_CCD, "HFC-4S Swyx 4xS0 SX2 QuadBri", 4, 4, 1, 2, 0, 0, 0, 0},
+/*10*/ {VENDOR_JH, "HFC-4S (junghanns 2.0)", 4, 4, 1, 2, 0, 0, 0, 0},
+/*11*/ {VENDOR_PRIM, "HFC-2S Primux Card", 4, 2, 0, 0, 0, 0, 0, 0},
+
+/*12*/ {VENDOR_BN, "HFC-8S Card", 8, 8, 1, 0, 0, 0, 0, 0},
/*13*/ {VENDOR_BN, "HFC-8S Card (+)", 8, 8, 1, 8, 0, DIP_8S,
- HFC_IO_MODE_REGIO},
-/*14*/ {VENDOR_CCD, "HFC-8S Eval (old)", 8, 8, 0, 0, 0, 0, 0},
-/*15*/ {VENDOR_CCD, "HFC-8S IOB4ST Recording", 8, 8, 1, 0, 0, 0, 0},
+ HFC_IO_MODE_REGIO, 0},
+/*14*/ {VENDOR_CCD, "HFC-8S Eval (old)", 8, 8, 0, 0, 0, 0, 0, 0},
+/*15*/ {VENDOR_CCD, "HFC-8S IOB4ST Recording", 8, 8, 1, 0, 0, 0, 0, 0},
-/*16*/ {VENDOR_CCD, "HFC-8S IOB8ST", 8, 8, 1, 0, 0, 0, 0},
-/*17*/ {VENDOR_CCD, "HFC-8S", 8, 8, 1, 0, 0, 0, 0},
-/*18*/ {VENDOR_CCD, "HFC-8S", 8, 8, 1, 0, 0, 0, 0},
+/*16*/ {VENDOR_CCD, "HFC-8S IOB8ST", 8, 8, 1, 0, 0, 0, 0, 0},
+/*17*/ {VENDOR_CCD, "HFC-8S", 8, 8, 1, 0, 0, 0, 0, 0},
+/*18*/ {VENDOR_CCD, "HFC-8S", 8, 8, 1, 0, 0, 0, 0, 0},
-/*19*/ {VENDOR_BN, "HFC-E1 Card", 1, 1, 0, 1, 0, DIP_E1, 0},
-/*20*/ {VENDOR_BN, "HFC-E1 Card (mini PCI)", 1, 1, 0, 1, 0, 0, 0},
-/*21*/ {VENDOR_BN, "HFC-E1+ Card (Dual)", 1, 1, 0, 1, 0, DIP_E1, 0},
-/*22*/ {VENDOR_BN, "HFC-E1 Card (Dual)", 1, 1, 0, 1, 0, DIP_E1, 0},
+/*19*/ {VENDOR_BN, "HFC-E1 Card", 1, 1, 0, 1, 0, DIP_E1, 0, 0},
+/*20*/ {VENDOR_BN, "HFC-E1 Card (mini PCI)", 1, 1, 0, 1, 0, 0, 0, 0},
+/*21*/ {VENDOR_BN, "HFC-E1+ Card (Dual)", 1, 1, 0, 1, 0, DIP_E1, 0, 0},
+/*22*/ {VENDOR_BN, "HFC-E1 Card (Dual)", 1, 1, 0, 1, 0, DIP_E1, 0, 0},
-/*23*/ {VENDOR_CCD, "HFC-E1 Eval (old)", 1, 1, 0, 0, 0, 0, 0},
-/*24*/ {VENDOR_CCD, "HFC-E1 IOB1E1", 1, 1, 0, 1, 0, 0, 0},
-/*25*/ {VENDOR_CCD, "HFC-E1", 1, 1, 0, 1, 0, 0, 0},
+/*23*/ {VENDOR_CCD, "HFC-E1 Eval (old)", 1, 1, 0, 0, 0, 0, 0, 0},
+/*24*/ {VENDOR_CCD, "HFC-E1 IOB1E1", 1, 1, 0, 1, 0, 0, 0, 0},
+/*25*/ {VENDOR_CCD, "HFC-E1", 1, 1, 0, 1, 0, 0, 0, 0},
/*26*/ {VENDOR_CCD, "HFC-4S Speech Design", 4, 4, 0, 0, 0, 0,
- HFC_IO_MODE_PLXSD},
+ HFC_IO_MODE_PLXSD, 0},
/*27*/ {VENDOR_CCD, "HFC-E1 Speech Design", 1, 1, 0, 0, 0, 0,
- HFC_IO_MODE_PLXSD},
-/*28*/ {VENDOR_CCD, "HFC-4S OpenVox", 4, 4, 1, 0, 0, 0, 0},
-/*29*/ {VENDOR_CCD, "HFC-2S OpenVox", 4, 2, 1, 0, 0, 0, 0},
-/*30*/ {VENDOR_CCD, "HFC-8S OpenVox", 8, 8, 1, 0, 0, 0, 0},
+ HFC_IO_MODE_PLXSD, 0},
+/*28*/ {VENDOR_CCD, "HFC-4S OpenVox", 4, 4, 1, 0, 0, 0, 0, 0},
+/*29*/ {VENDOR_CCD, "HFC-2S OpenVox", 4, 2, 1, 0, 0, 0, 0, 0},
+/*30*/ {VENDOR_CCD, "HFC-8S OpenVox", 8, 8, 1, 0, 0, 0, 0, 0},
+/*31*/ {VENDOR_CCD, "XHFC-4S Speech Design", 5, 4, 0, 0, 0, 0,
+ HFC_IO_MODE_EMBSD, XHFC_IRQ},
};
#undef H
@@ -5269,7 +5391,7 @@ hfcmulti_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
"Please contact the driver maintainer for support.\n");
return -ENODEV;
}
- ret = hfcmulti_init(pdev, ent);
+ ret = hfcmulti_init(m, pdev, ent);
if (ret)
return ret;
HFC_cnt++;
@@ -5299,6 +5421,8 @@ static int __init
HFCmulti_init(void)
{
int err;
+ int i, xhfc = 0;
+ struct hm_map m;
printk(KERN_INFO "mISDN: HFC-multi driver %s\n", HFC_MULTI_VERSION);
@@ -5346,11 +5470,43 @@ HFCmulti_init(void)
if (!clock)
clock = 1;
+ /* Register the embedded devices.
+ * This should be done before the PCI cards registration */
+ switch (hwid) {
+ case HWID_MINIP4:
+ xhfc = 1;
+ m = hfcm_map[31];
+ break;
+ case HWID_MINIP8:
+ xhfc = 2;
+ m = hfcm_map[31];
+ break;
+ case HWID_MINIP16:
+ xhfc = 4;
+ m = hfcm_map[31];
+ break;
+ default:
+ xhfc = 0;
+ }
+
+ for (i = 0; i < xhfc; ++i) {
+ err = hfcmulti_init(&m, NULL, NULL);
+ if (err) {
+ printk(KERN_ERR "error registering embedded driver: "
+ "%x\n", err);
+ return -err;
+ }
+ HFC_cnt++;
+ printk(KERN_INFO "%d devices registered\n", HFC_cnt);
+ }
+
+ /* Register the PCI cards */
err = pci_register_driver(&hfcmultipci_driver);
if (err < 0) {
printk(KERN_ERR "error registering pci driver: %x\n", err); return err;
}
+
return 0;
}
drivers/isdn/mISDN/dsp_cmx.c +4 -0
@@ -947,6 +947,10 @@ conf_software:if (current_conf >=0 ) { join_members:list_for_each_entry (member, &conf->mlist, list) { +/* if no conference engine on our chip, change to +* software */ +if (!member->dsp->features.hfc_conf) + goto conf_software;/* in case of hdlc, change to software */ if (member->dsp->hdlc) goto conf_software;
include/linux/mISDNdsp.h +0 -0
@@ -25,6 +25,7 @@ extern void mISDN_dsp_element_unregister(struct
mISDN_dsp_element *elem);
struct dsp_features {
int hfc_id; /* unique id to identify the chip (or -1) */
int hfc_dtmf; /* set if HFCmulti card supports dtmf */
+ int hfc_conf; /* set if HFCmulti card supports conferences */
int hfc_loops; /* set if card supports tone loops */
int hfc_echocanhw; /* set if card supports echocancelation*/
int pcm_id; /* unique id to identify the pcm bus (or -1) */
Signature · 1 line
1.6.0.2
PATCH 2/19 Fix bug in XHFC registering
In reply to Karsten KeilFrom: Andreas Eversberg <[email protected]>
Calling mISDN_register_device() without pci device for the XHFC case.
--- drivers/isdn/hardware/mISDN/hfcmulti.c | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-)
drivers/isdn/hardware/mISDN/hfcmulti.c +5 -3
@@ -5096,13 +5096,15 @@ init_multi_port(struct hfc_multi *hc, int pt)test_and_set_bit (HFC_CFG_DIS_ECHANNEL , &hc->chan[i +2 ].cfg); } -if (hc->ctype ==HFC_TYPE_XHFC ) +if (hc->ctype ==HFC_TYPE_XHFC ) {snprintf (name,MISDN_MAX_IDLEN -1 ,"xhfc.%d-%d" , HFC_cnt +1 , pt +1 ); -else + ret =mISDN_register_device (&dch->dev,NULL , name); + }else {snprintf (name,MISDN_MAX_IDLEN -1 ,"hfc-%ds.%d-%d" , hc->ctype, HFC_cnt +1 , pt +1 ); - ret =mISDN_register_device (&dch->dev, &hc->pci_dev->dev, name); + ret =mISDN_register_device (&dch->dev, &hc->pci_dev->dev, name); + }if (ret) goto free_chan; hc->created[pt] =1 ;
Signature · 1 line
1.6.0.2
PATCH 3/19 Add PCI ID for Junghanns 8S card
In reply to Karsten KeilFrom: Andreas Eversberg <[email protected]>
new id for HFC-8S
--- drivers/isdn/hardware/mISDN/hfcmulti.c | 3 +++ include/linux/pci_ids.h | 1 + 2 files changed, 4 insertions(+), 0 deletions(-)
drivers/isdn/hardware/mISDN/hfcmulti.c +3 -0
@@ -5410,6 +5410,7 @@ static const struct hm_map hfcm_map[] = { /*30*/ {VENDOR_CCD, "HFC-8S OpenVox", 8, 8, 1, 0, 0, 0, 0, 0}, /*31*/ {VENDOR_CCD, "XHFC-4S Speech Design", 5, 4, 0, 0, 0, 0, HFC_IO_MODE_EMBSD, XHFC_IRQ}, +/*32*/ {VENDOR_JH, "HFC-8S (junghanns)", 8, 8, 1, 0, 0, 0, 0, 0}, };#undef H
@@ -5463,6 +5464,8 @@ static struct pci_device_id hfmultipci_ids[] __devinitdata = { PCI_SUBDEVICE_ID_CCD_HFC8S, 0, 0, H(18)}, /* 8S */ { PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_HFC8S, PCI_VENDOR_ID_CCD, PCI_SUBDEVICE_ID_CCD_OV8S, 0, 0, H(30)}, /* OpenVox 8 */ + { PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_HFC8S, PCI_VENDOR_ID_CCD, + PCI_SUBDEVICE_ID_CCD_JH8S, 0, 0, H(32)}, /* Junganns 8S */ /* Cards with HFC-E1 Chip */
include/linux/pci_ids.h +1 -0
@@ -1927,6 +1927,7 @@#define PCI_SUBDEVICE_ID_CCD_SWYX4S 0xB540#define PCI_SUBDEVICE_ID_CCD_JH4S20 0xB550#define PCI_SUBDEVICE_ID_CCD_IOB8ST_1 0xB552 +#define PCI_SUBDEVICE_ID_CCD_JH8S 0xB55B#define PCI_SUBDEVICE_ID_CCD_BN4S 0xB560#define PCI_SUBDEVICE_ID_CCD_BN8S 0xB562#define PCI_SUBDEVICE_ID_CCD_BNE1 0xB563
Signature · 1 line
1.6.0.2
PATCH 4/19 Add watchdog functionality to hfcmulti driver
In reply to Karsten KeilFrom: Andreas Eversberg <[email protected]>
This patch was made by Titus Moldovan and provides IOCTL functions for enabling and disabling the controller's built in watchdog. The use is optional.
--- drivers/isdn/hardware/mISDN/hfc_multi.h | 1 + drivers/isdn/hardware/mISDN/hfcmulti.c | 32 ++++++++++++++++++++++++++++++- include/linux/mISDNif.h | 3 +- 3 files changed, 34 insertions(+), 2 deletions(-)
drivers/isdn/hardware/mISDN/hfc_multi.h +1 -0
@@ -102,6 +102,7 @@ struct hfcm_hw {u_char r_sci_msk;u_char r_tx0, r_tx1;u_char a_st_ctrl0[8 ]; +u_char r_bert_wd_md;timer_t timer; };
drivers/isdn/hardware/mISDN/hfcmulti.c +31 -1
@@ -4191,11 +4191,41 @@ open_bchannel(struct hfc_multi *hc, struct dchannel *dch,static int channel_dctrl (struct dchannel *dch,struct mISDN_ctrl_req *cq) { +struct hfc_multi *hc = dch->hw;int ret =0 ; +int wd_mode, wd_cnt;switch (cq->op) {case MISDN_CTRL_GETOP : - cq->op =0 ; + cq->op =MISDN_CTRL_HFC_OP ; +break ; +case MISDN_CTRL_HFC_WD_INIT :/* init the watchdog */ + wd_cnt = cq->p1 &0xf ; + wd_mode = !!(cq->p1 >>4 ); +if (debug &DEBUG_HFCMULTI_MSG ) +printk (KERN_DEBUG +"%s: MISDN_CTRL_HFC_WD_INIT mode %s counter 0x%x\n" , + __func__, wd_mode ?"AUTO" :"MANUAL" , wd_cnt); +/* set the watchdog timer */ +HFC_outb (hc,R_TI_WD , poll_timer | (wd_cnt <<4 )); + hc->hw.r_bert_wd_md = (wd_mode ?V_AUTO_WD_RES :0 ); +if (hc->ctype ==HFC_TYPE_XHFC ) + hc->hw.r_bert_wd_md |=0x40 /* V_WD_EN */ ; +/* init the watchdog register and reset the counter */ +HFC_outb (hc,R_BERT_WD_MD , hc->hw.r_bert_wd_md |V_WD_RES ); +if (test_bit (HFC_CHIP_PLXSD , &hc->chip)) { +/* enable the watchdog output for Speech-Design */ +HFC_outb (hc,R_GPIO_SEL ,V_GPIO_SEL7 ); +HFC_outb (hc,R_GPIO_EN1 ,V_GPIO_EN15 ); +HFC_outb (hc,R_GPIO_OUT1 ,0 ); +HFC_outb (hc,R_GPIO_OUT1 ,V_GPIO_OUT15 ); + } +break ; +case MISDN_CTRL_HFC_WD_RESET :/* reset the watchdog counter */ +if (debug &DEBUG_HFCMULTI_MSG ) +printk (KERN_DEBUG "%s: MISDN_CTRL_HFC_WD_RESET\n" , + __func__); +HFC_outb (hc,R_BERT_WD_MD , hc->hw.r_bert_wd_md |V_WD_RES );break ;default : printk(KERN_WARNING "%s: unknown Op %x\n",
include/linux/mISDNif.h +2 -1
@@ -362,7 +362,8 @@ clear_channelmap(u_int nr, u_char *map)#define MISDN_CTRL_HFC_RECEIVE_ON 0x4006#define MISDN_CTRL_HFC_ECHOCAN_ON 0x4007#define MISDN_CTRL_HFC_ECHOCAN_OFF 0x4008 - +#define MISDN_CTRL_HFC_WD_INIT 0x4009 +#define MISDN_CTRL_HFC_WD_RESET 0x400A/* socket options */ #define MISDN_TIME_STAMP 0x0001
Signature · 1 line
1.6.0.2
PATCH 5/19 DSP now uses ring buffer for echo canceler
In reply to Karsten KeilFrom: Andreas Eversberg <[email protected]>
DSP now uses ring buffer for echo canceler.
Added missing include in l1oip_codec.c
--- drivers/isdn/mISDN/dsp.h | 3 ++- drivers/isdn/mISDN/l1oip_codec.c | 1 + 2 files changed, 3 insertions(+), 1 deletions(-)
drivers/isdn/mISDN/dsp.h +2 -1
@@ -112,7 +112,8 @@ struct dsp_conf {#define DSP_DTMF_NPOINTS 102 -#define ECHOCAN_BUFLEN (4*128) +#define ECHOCAN_BUFF_SIZE 0x400/* must be 2**n */ +#define ECHOCAN_BUFF_MASK 0x3ff/* -1 */ struct dsp_dtmf {int treshold;/* above this is dtmf (square of) */
drivers/isdn/mISDN/l1oip_codec.c +1 -0
@@ -48,6 +48,7 @@ NOTE: The bytes are handled as they are law-encoded.#include <linux/vmalloc.h> #include <linux/mISDNif.h> +#include <linux/in.h> #include "core.h" #include "l1oip.h"
Signature · 1 line
1.6.0.2
PATCH 6/19 Fix hfcmulti's PCI IRQ bug during init
In reply to Karsten KeilFrom: Andreas Eversberg <[email protected]>
Not all devices have a hc->pci_dev.
--- drivers/isdn/hardware/mISDN/hfcmulti.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-)
drivers/isdn/hardware/mISDN/hfcmulti.c +1 -2
@@ -5348,7 +5348,7 @@ hfcmulti_init(struct hm_map *m, struct pci_dev *pdev, hc->iclock =mISDN_register_clock ("HFCMulti" ,0 , clockctl, hc);/* initialize hardware */ - hc->irq = m->irq; + hc->irq = (m->irq) ? : hc->pci_dev->irq; ret_err =init_card (hc);if (ret_err) {printk (KERN_ERR "init card returns %d\n" , ret_err);
@@ -5549,7 +5549,6 @@ hfcmulti_probe(struct pci_dev *pdev, const struct pci_device_id *ent) "Please contact the driver maintainer for support.\n");return -ENODEV ; } - m->irq = pdev->irq; ret =hfcmulti_init (m, pdev, ent);if (ret)return ret;
Signature · 1 line
1.6.0.2
PATCH 7/19 Echo canceler now gets delay information from hardware
In reply to Karsten KeilFrom: Andreas Eversberg <[email protected]>
Added tx-fifo information for calculation of current delay to sync tx and rx streams for echo canceler.
--- drivers/isdn/hardware/mISDN/hfc_multi.h | 1 + drivers/isdn/hardware/mISDN/hfcmulti.c | 8 +++- drivers/isdn/hardware/mISDN/hfcpci.c | 70 ++++++++++++++++++------------- drivers/isdn/hardware/mISDN/hfcsusb.c | 4 +- drivers/isdn/mISDN/dsp.h | 2 +- drivers/isdn/mISDN/dsp_core.c | 2 +- drivers/isdn/mISDN/dsp_pipeline.c | 5 +- drivers/isdn/mISDN/hwchannel.c | 4 +- include/linux/mISDNdsp.h | 3 +- include/linux/mISDNhw.h | 2 +- 10 files changed, 60 insertions(+), 41 deletions(-)
drivers/isdn/hardware/mISDN/hfc_multi.h +1 -0
@@ -84,6 +84,7 @@ struct hfc_chan {int conf;/* conference setting of TX slot */ int txpending;/* if there is currently data in */ /* the FIFO 0=no, 1=yes, 2=splloop */ +int Zfill;/* rx-fifo level on last hfcmulti_tx */ int rx_off;/* set to turn fifo receive off */ int coeff_count;/* curren coeff block */ s32 *coeff;/* memory pointer to 8 coeff blocks */
drivers/isdn/hardware/mISDN/hfcmulti.c +6 -2
@@ -2075,6 +2075,9 @@ next_frame: "%d!=%d\n", __func__, hc->id + 1, temp, z2); z2 = temp;/* repeat unti Z2 is equal */ } + hc->chan[ch].Zfill = z1 - z2; +if (hc->chan[ch].Zfill <0 ) + hc->chan[ch].Zfill += hc->Zlen; Zspace = z2 - z1;if (Zspace <=0 ) Zspace += hc->Zlen;
@@ -2183,6 +2186,7 @@ next_frame:/* Have to prep the audio data */ hc->write_fifo (hc, d, ii - i); + hc->chan[ch].Zfill += ii - i; *idxp = ii;/* if not all data has been written */
@@ -2378,7 +2382,7 @@ next_frame:if (dch)recv_Dchannel (dch);else -recv_Bchannel (bch); +recv_Bchannel (bch,MISDN_ID_ANY ); *sp = skb; again++; goto next_frame;
@@ -2410,7 +2414,7 @@ next_frame:"(z1=%04x, z2=%04x) TRANS\n" , __func__, hc->id + 1, ch, Zsize, z1, z2);/* only bch is transparent */ -recv_Bchannel (bch); +recv_Bchannel (bch, hc->chan[ch].Zfill); *sp = skb; } }
drivers/isdn/hardware/mISDN/hfcpci.c +41 -29
138 lines not on this page · raw message
drivers/isdn/hardware/mISDN/hfcsusb.c +2 -2
@@ -947,7 +947,7 @@ hfcsusb_rx_frame(struct usb_fifo *fifo, __u8 *data, unsigned int len,if (fifo->dch)recv_Dchannel (fifo->dch);if (fifo->bch) -recv_Bchannel (fifo->bch); +recv_Bchannel (fifo->bch,MISDN_ID_ANY );if (fifo->ech)recv_Echannel (fifo->ech, &hw->dch);
@@ -969,7 +969,7 @@ hfcsusb_rx_frame(struct usb_fifo *fifo, __u8 *data, unsigned int len, }else {/* deliver transparent data to layer2 */ if (rx_skb->len >= poll) -recv_Bchannel (fifo->bch); +recv_Bchannel (fifo->bch,MISDN_ID_ANY ); }spin_unlock (&hw->lock); }
drivers/isdn/mISDN/dsp.h +1 -1
@@ -262,5 +262,5 @@ extern int dsp_pipeline_build(struct dsp_pipeline *pipeline, const char *cfg);extern void dsp_pipeline_process_tx (struct dsp_pipeline *pipeline,u8 *data,int len);extern void dsp_pipeline_process_rx (struct dsp_pipeline *pipeline,u8 *data, -int len); +int len,unsigned int txlen);
drivers/isdn/mISDN/dsp_core.c +1 -1
@@ -710,7 +710,7 @@ dsp_function(struct mISDNchannel *ch, struct sk_buff *skb)/* pipeline */ if (dsp->pipeline.inuse)dsp_pipeline_process_rx (&dsp->pipeline, skb->data, - skb->len); + skb->len, hh->id);/* change volume if requested */ if (dsp->rx_volume)dsp_change_volume (skb, dsp->rx_volume);
drivers/isdn/mISDN/dsp_pipeline.c +3 -2
@@ -347,7 +347,8 @@ void dsp_pipeline_process_tx(struct dsp_pipeline *pipeline, u8 *data, int len) entry->elem->process_tx (entry->p, data, len); } -void dsp_pipeline_process_rx (struct dsp_pipeline *pipeline,u8 *data,int len) +void dsp_pipeline_process_rx (struct dsp_pipeline *pipeline,u8 *data,int len, +unsigned int txlen) {struct dsp_pipeline_entry *entry;
@@ -356,7 +357,7 @@ void dsp_pipeline_process_rx(struct dsp_pipeline *pipeline, u8 *data, int len)list_for_each_entry_reverse (entry, &pipeline->list, list)if (entry->elem->process_rx) - entry->elem->process_rx (entry->p, data, len); + entry->elem->process_rx (entry->p, data, len, txlen); }
drivers/isdn/mISDN/hwchannel.c +2 -2
@@ -185,13 +185,13 @@ recv_Echannel(struct dchannel *ech, struct dchannel *dch)EXPORT_SYMBOL (recv_Echannel);void -recv_Bchannel (struct bchannel *bch) +recv_Bchannel (struct bchannel *bch,unsigned int id) {struct mISDNhead *hh; hh =mISDN_HEAD_P (bch->rx_skb); hh->prim =PH_DATA_IND ; - hh->id =MISDN_ID_ANY ; + hh->id = id;if (bch->rcount >=64 ) {printk (KERN_WARNING "B-channel %p receive queue overflow, " "fushing!\n" , bch);
include/linux/mISDNdsp.h +2 -1
@@ -12,7 +12,8 @@ struct mISDN_dsp_element {void *(*new)(const char *arg);void (*free)(void *p);void (*process_tx)(void *p,unsigned char *data,int len); -void (*process_rx)(void *p,unsigned char *data,int len); +void (*process_rx)(void *p,unsigned char *data,int len, +unsigned int txlen);int num_args;struct mISDN_dsp_element_arg *args;
include/linux/mISDNhw.h +1 -1
@@ -185,7 +185,7 @@ extern int dchannel_senddata(struct dchannel *, struct sk_buff *);extern int bchannel_senddata (struct bchannel *,struct sk_buff *);extern void recv_Dchannel (struct dchannel *);extern void recv_Echannel (struct dchannel *,struct dchannel *); -extern void recv_Bchannel (struct bchannel *); +extern void recv_Bchannel (struct bchannel *,unsigned int id);extern void recv_Dchannel_skb (struct dchannel *,struct sk_buff *);extern void recv_Bchannel_skb (struct bchannel *,struct sk_buff *);extern void confirm_Bsend (struct bchannel *bch);
Signature · 1 line
1.6.0.2
PATCH 8/19 Fixed missing spin lock on pipeline process
In reply to Karsten KeilFrom: Andreas Eversberg <[email protected]>
Need to protect the complete pipeline.
--- drivers/isdn/mISDN/dsp_core.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
drivers/isdn/mISDN/dsp_core.c +3 -1
@@ -704,6 +704,8 @@ dsp_function(struct mISDNchannel *ch, struct sk_buff *skb)break ; } +spin_lock_irqsave (&dsp_lock, flags); +/* decrypt if enabled */ if (dsp->bf_enable)dsp_bf_decrypt (dsp, skb->data, skb->len);
@@ -741,11 +743,11 @@ dsp_function(struct mISDNchannel *ch, struct sk_buff *skb) } }/* we need to process receive data if software */ -spin_lock_irqsave (&dsp_lock, flags);if (dsp->pcm_slot_tx <0 && dsp->pcm_slot_rx <0 ) {/* process data from card at cmx */ dsp_cmx_receive (dsp, skb); } +spin_unlock_irqrestore (&dsp_lock, flags);if (dsp->rx_disabled) {
Signature · 1 line
1.6.0.2
PATCH 9/19 Reduce stack size in dsp_cmx_send()
In reply to Karsten KeilFrom: Frank Seidel <[email protected]>
Reduce stack size memory footprint of mISDN_dsp. (From 1468 bytes for dsp_cmx_send on i386 down to 44).
--- drivers/isdn/hardware/mISDN/hfcmulti.c | 2 +- drivers/isdn/mISDN/dsp_cmx.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-)
drivers/isdn/hardware/mISDN/hfcmulti.c +1 -1
@@ -104,7 +104,7 @@* If unsure, don't give this parameter. * * dslot: -* NOTE: only one poll value must be given for every card. +* NOTE: only one dslot value must be given for every card. * Also this value must be given for non-E1 cards. If omitted, the E1 * card has D-channel on time slot 16, which is default. * If 1..15 or 17..31, an alternate time slot is used for D-channel.
drivers/isdn/mISDN/dsp_cmx.c +2 -1
@@ -1596,7 +1596,8 @@ dsp_cmx_send(void *arg)struct dsp_conf_member *member;struct dsp *dsp;int mustmix, members; -s32 mixbuffer[MAX_POLL +100 ], *c; +static s32 mixbuffer[MAX_POLL +100 ]; +s32 *c;u8 *p, *q;int r, rr;int jittercheck =0 , delay, i;
Signature · 1 line
1.6.0.2
PATCH 10/19 Added layer-1-hold feature
In reply to Karsten KeilFrom: Andreas Eversberg <[email protected]>
Add IMHOLD_L1 ioctl.
The feature will be disabled on closing.
--- drivers/isdn/mISDN/socket.c | 21 ++++++++++++++++++--- drivers/isdn/mISDN/tei.c | 43 +++++++++++++++++++++++++++++++------------ include/linux/mISDNif.h | 2 ++ 3 files changed, 51 insertions(+), 15 deletions(-)
drivers/isdn/mISDN/socket.c +18 -3
@@ -292,7 +292,7 @@ static int data_sock_ioctl_bound(struct sock *sk, unsigned int cmd, void __user *p) { struct mISDN_ctrl_req cq; -int err = -EINVAL , val; +int err = -EINVAL , val[2 ];struct mISDNchannel *bchan, *next;lock_sock (sk);
@@ -328,12 +328,27 @@ data_sock_ioctl_bound(struct sock *sk, unsigned int cmd, void __user *p) err = -EINVAL ;break ; } -if (get_user (val, (int __user *)p)) { + val[0 ] = cmd; +if (get_user (val[1 ], (int __user *)p)) { err = -EFAULT ;break ; } err =_pms (sk)->dev->teimgr->ctrl (_pms (sk)->dev->teimgr, -CONTROL_CHANNEL , &val); +CONTROL_CHANNEL , val); +break ; +case IMHOLD_L1 : +if (sk->sk_protocol !=ISDN_P_LAPD_NT + && sk->sk_protocol !=ISDN_P_LAPD_TE ) { + err = -EINVAL ; +break ; + } + val[0 ] = cmd; +if (get_user (val[1 ], (int __user *)p)) { + err = -EFAULT ; +break ; + } + err =_pms (sk)->dev->teimgr->ctrl (_pms (sk)->dev->teimgr, +CONTROL_CHANNEL , val);break ;default : err = -EINVAL ;
drivers/isdn/mISDN/tei.c +31 -12
67 lines not on this page · raw message
include/linux/mISDNif.h +2 -0
@@ -229,6 +229,7 @@#define OPTION_L2_PTP 2#define OPTION_L2_FIXEDTEI 3#define OPTION_L2_CLEANUP 4 +#define OPTION_L1_HOLD 5/* should be in sync with linux/kobject.h:KOBJ_NAME_LEN */ #define MISDN_MAX_IDLEN 20
@@ -317,6 +318,7 @@ struct ph_info {#define IMCTRLREQ _IOR('I', 69, int)#define IMCLEAR_L2 _IOR('I', 70, int)#define IMSETDEVNAME _IOR('I', 71, struct mISDN_devrename) +#define IMHOLD_L1 _IOR('I', 72, int)static inline int test_channelmap (u_int nr,u_char *map)
Signature · 1 line
1.6.0.2
PATCH 11/19 Fix DTMF locking bug issue
In reply to Karsten KeilFrom: Andreas Eversberg <[email protected]>
DTMF digits were sent up to socket in locked state. Receive audio stream was not enabled in certain condition.
--- drivers/isdn/hardware/mISDN/hfcmulti.c | 4 +- drivers/isdn/mISDN/dsp.h | 2 +- drivers/isdn/mISDN/dsp_core.c | 37 +++++++++++++++++-------------- 3 files changed, 23 insertions(+), 20 deletions(-)
drivers/isdn/hardware/mISDN/hfcmulti.c +2 -2
@@ -1947,8 +1947,8 @@ hfcmulti_dtmf(struct hfc_multi *hc) coeff[(co<<1 )|1 ] = mantissa; }if (debug &DEBUG_HFCMULTI_DTMF ) -printk ("%s: DTMF ready %08x %08x %08x %08x " -"%08x %08x %08x %08x\n" , __func__, +printk (" DTMF ready %08x %08x %08x %08x " +"%08x %08x %08x %08x\n" , coeff[0 ], coeff[1 ], coeff[2 ], coeff[3 ], coeff[4 ], coeff[5 ], coeff[6 ], coeff[7 ]); hc->chan[ch].coeff_count++;
drivers/isdn/mISDN/dsp.h +1 -1
@@ -124,7 +124,7 @@ struct dsp_dtmf {/* buffers one full dtmf frame */ u8 lastwhat, lastdigit;int count; -u8 digits[16 ];/* just the dtmf result */ +u8 digits[16 ];/* dtmf result */ };
drivers/isdn/mISDN/dsp_core.c +20 -17
@@ -311,6 +311,7 @@ dsp_control_req(struct dsp *dsp, struct mISDNhead *hh, struct sk_buff *skb)/* check dtmf hardware */ dsp_dtmf_hardware (dsp); +dsp_rx_off (dsp);break ;case DTMF_TONE_STOP :/* turn off DTMF */ if (dsp_debug &DEBUG_DSP_CORE )
@@ -657,11 +658,10 @@ get_features(struct mISDNchannel *ch)static int dsp_function (struct mISDNchannel *ch,struct sk_buff *skb) { - struct dsp *dsp = container_of(ch, struct dsp, ch); + struct dsp *dsp = container_of(ch, struct dsp, ch);struct mISDNhead *hh;int ret =0 ; -u8 *digits; -int cont; +u8 *digits =NULL ;u_long flags; hh =mISDN_HEAD_P (skb);
@@ -716,40 +716,43 @@ dsp_function(struct mISDNchannel *ch, struct sk_buff *skb)/* change volume if requested */ if (dsp->rx_volume)dsp_change_volume (skb, dsp->rx_volume); -/* check if dtmf soft decoding is turned on */ if (dsp->dtmf.software) { digits =dsp_dtmf_goertzel_decode (dsp, skb->data, skb->len, (dsp_options&DSP_OPT_ULAW )?1 :0 ); + } +/* we need to process receive data if software */ +if (dsp->pcm_slot_tx <0 && dsp->pcm_slot_rx <0 ) { +/* process data from card at cmx */ +dsp_cmx_receive (dsp, skb); + } + +spin_unlock_irqrestore (&dsp_lock, flags); + +/* send dtmf result, if any */ +if (digits) {while (*digits) { +int k;struct sk_buff *nskb;if (dsp_debug &DEBUG_DSP_DTMF )printk (KERN_DEBUG "%s: digit" "(%c) to layer %s\n" , __func__, *digits, dsp->name); - cont =DTMF_TONE_VAL | *digits; + k = *digits |DTMF_TONE_VAL ; nskb =_alloc_mISDN_skb (PH_CONTROL_IND , -MISDN_ID_ANY ,sizeof (int ), &cont, -GFP_ATOMIC ); +MISDN_ID_ANY ,sizeof (int ), &k, +GFP_ATOMIC );if (nskb) {if (dsp->up) {if (dsp->up->send ( dsp->up, nskb)) -dev_kfree_skb (nskb); +dev_kfree_skb (nskb); }else dev_kfree_skb (nskb); } digits++; } } -/* we need to process receive data if software */ -if (dsp->pcm_slot_tx <0 && dsp->pcm_slot_rx <0 ) { -/* process data from card at cmx */ -dsp_cmx_receive (dsp, skb); - } - -spin_unlock_irqrestore (&dsp_lock, flags); -if (dsp->rx_disabled) {/* if receive is not allowed */ break ;
@@ -789,7 +792,7 @@ dsp_function(struct mISDNchannel *ch, struct sk_buff *skb)if (dsp->up) {if (dsp->up->send ( dsp->up, nskb)) -dev_kfree_skb (nskb); +dev_kfree_skb (nskb); }else dev_kfree_skb (nskb); }
Signature · 1 line
1.6.0.2
PATCH 12/19 Hardware acceleration is now possible in conjunction with audio recording
In reply to Karsten KeilFrom: Andreas Eversberg <[email protected]>
Audio recording requires software audio processing.
Both hardware and software processing is simultaniously possible now.
--- drivers/isdn/mISDN/dsp.h | 11 ++++- drivers/isdn/mISDN/dsp_cmx.c | 101 ++++++++++++++++++++++++++--------------- drivers/isdn/mISDN/dsp_core.c | 17 ++++--- 3 files changed, 84 insertions(+), 45 deletions(-)
drivers/isdn/mISDN/dsp.h +10 -1
@@ -151,6 +151,15 @@ struct dsp_tone {struct timer_list tl; }; +/*************** +* echo stuff * +***************/ + +struct dsp_echo { +int software;/* echo is generated by software */ +int hardware;/* echo is generated by hardware */ +}; +/***************** * general stuff * *****************/
@@ -161,7 +170,7 @@ struct dsp {struct mISDNchannel *up;unsigned char name[64 ];int b_active; -int echo;/* echo is enabled */ +struct dsp_echo echo;int rx_disabled;/* what the user wants */ int rx_is_off;/* what the card is */ int tx_mix;
drivers/isdn/mISDN/dsp_cmx.c +65 -36
238 lines not on this page · raw message
drivers/isdn/mISDN/dsp_core.c +9 -8
@@ -203,13 +203,13 @@ dsp_rx_off_member(struct dsp *dsp)else if (dsp->dtmf.software) rx_off =0 ;/* echo in software */ -else if (dsp->echo && dsp->pcm_slot_tx <0 ) +else if (dsp->echo.software) rx_off =0 ;/* bridge in software */ -else if (dsp->conf) { -if (dsp->conf->software) - rx_off =0 ; - } +else if (dsp->conf && dsp->conf->software) + rx_off =0 ; +/* data is not required by user space and not required +* for echo dtmf detection, soft-echo, soft-bridging */ if (rx_off == dsp->rx_is_off)return ;
@@ -415,7 +415,7 @@ tone_off:dsp_rx_off (dsp);break ;case DSP_ECHO_ON :/* enable echo */ - dsp->echo =1 ;/* soft echo */ + dsp->echo.software =1 ;/* soft echo */ if (dsp_debug &DEBUG_DSP_CORE )printk (KERN_DEBUG "%s: enable cmx-echo\n" , __func__);dsp_cmx_hardware (dsp->conf, dsp);
@@ -424,7 +424,8 @@ tone_off:dsp_cmx_debug (dsp);break ;case DSP_ECHO_OFF :/* disable echo */ - dsp->echo =0 ; + dsp->echo.software =0 ; + dsp->echo.hardware =0 ;if (dsp_debug &DEBUG_DSP_CORE )printk (KERN_DEBUG "%s: disable cmx-echo\n" , __func__);dsp_cmx_hardware (dsp->conf, dsp);
@@ -722,7 +723,7 @@ dsp_function(struct mISDNchannel *ch, struct sk_buff *skb) skb->len, (dsp_options&DSP_OPT_ULAW)?1:0); }/* we need to process receive data if software */ -if (dsp->pcm_slot_tx <0 && dsp->pcm_slot_rx <0 ) { +if (dsp->conf && dsp->conf->software) {/* process data from card at cmx */ dsp_cmx_receive (dsp, skb); }
Signature · 1 line
1.6.0.2
PATCH 13/19 Fix TEI and SAPI handling
In reply to Karsten KeilFrom: Andreas Eversberg <[email protected]>
Added SAPI value to use SAPIs different than 0.
Now fixed TEIs work in NT mode. This allows PTP endpoint to be connected to PTMP ports together with other PTMP endpoints.
--- drivers/isdn/mISDN/layer2.c | 13 +++++++------ drivers/isdn/mISDN/layer2.h | 2 +- drivers/isdn/mISDN/tei.c | 25 ++++++++++++------------- 3 files changed, 20 insertions(+), 20 deletions(-)
drivers/isdn/mISDN/layer2.c +7 -6
@@ -2068,7 +2068,8 @@ l2_ctrl(struct mISDNchannel *ch, u_int cmd, void *arg) }struct layer2 * -create_l2 (struct mISDNchannel *ch,u_int protocol,u_long options,u_long arg) +create_l2 (struct mISDNchannel *ch,u_int protocol,u_long options,u_int tei, +u_int sapi) {struct layer2 *l2;struct channel_req rq;
@@ -2089,7 +2090,7 @@ create_l2(struct mISDNchannel *ch, u_int protocol, u_long options, u_long arg)test_and_set_bit (FLG_LAPD , &l2->flag);test_and_set_bit (FLG_LAPD_NET , &l2->flag);test_and_set_bit (FLG_MOD128 , &l2->flag); - l2->sapi =0 ; + l2->sapi = sapi; l2->maxlen =MAX_DFRAME_LEN ;if (test_bit (OPTION_L2_PMX , &options)) l2->window =7 ;
@@ -2099,7 +2100,7 @@ create_l2(struct mISDNchannel *ch, u_int protocol, u_long options, u_long arg)test_and_set_bit (FLG_PTP , &l2->flag);if (test_bit (OPTION_L2_FIXEDTEI , &options))test_and_set_bit (FLG_FIXED_TEI , &l2->flag); - l2->tei = (u_int )arg; + l2->tei = tei; l2->T200 =1000 ; l2->N200 =3 ; l2->T203 =10000 ;
@@ -2114,7 +2115,7 @@ create_l2(struct mISDNchannel *ch, u_int protocol, u_long options, u_long arg)test_and_set_bit (FLG_LAPD , &l2->flag);test_and_set_bit (FLG_MOD128 , &l2->flag);test_and_set_bit (FLG_ORIG , &l2->flag); - l2->sapi =0 ; + l2->sapi = sapi; l2->maxlen =MAX_DFRAME_LEN ;if (test_bit (OPTION_L2_PMX , &options)) l2->window =7 ;
@@ -2124,7 +2125,7 @@ create_l2(struct mISDNchannel *ch, u_int protocol, u_long options, u_long arg)test_and_set_bit (FLG_PTP , &l2->flag);if (test_bit (OPTION_L2_FIXEDTEI , &options))test_and_set_bit (FLG_FIXED_TEI , &l2->flag); - l2->tei = (u_int )arg; + l2->tei = tei; l2->T200 =1000 ; l2->N200 =3 ; l2->T203 =10000 ;
@@ -2180,7 +2181,7 @@ x75create(struct channel_req *crq)if (crq->protocol !=ISDN_P_B_X75SLP )return -EPROTONOSUPPORT ; - l2 =create_l2 (crq->ch, crq->protocol,0 ,0 ); + l2 =create_l2 (crq->ch, crq->protocol,0 ,0 ,0 );if (!l2)return -ENOMEM ; crq->ch = &l2->ch;
drivers/isdn/mISDN/layer2.h +1 -1
@@ -90,7 +90,7 @@ enum {#define L2_STATE_COUNT (ST_L2_8+1)extern struct layer2 *create_l2 (struct mISDNchannel *,u_int , -u_long ,u_long ); +u_long ,u_int ,u_int );extern int tei_l2 (struct layer2 *,u_int ,u_long arg);
drivers/isdn/mISDN/tei.c +12 -13
@@ -777,7 +777,7 @@ tei_ph_data_ind(struct teimgr *tm, u_int mt, u_char *dp, int len) }static struct layer2 * -create_new_tei (struct manager *mgr,int tei) +create_new_tei (struct manager *mgr,int tei,int sapi) {u_long opt =0 ;u_long flags;
@@ -791,7 +791,7 @@ create_new_tei(struct manager *mgr, int tei)if (mgr->ch.st->dev->Dprotocols & ((1 <<ISDN_P_TE_E1 ) | (1 <<ISDN_P_NT_E1 )))test_and_set_bit (OPTION_L2_PMX , &opt); - l2 =create_l2 (mgr->up,ISDN_P_LAPD_NT , (u_int )opt, (u_long )tei); + l2 =create_l2 (mgr->up,ISDN_P_LAPD_NT , (u_int )opt, tei, sapi);if (!l2) {printk (KERN_WARNING "%s:no memory for layer2\n" , __func__);return NULL ;
@@ -839,12 +839,15 @@ new_tei_req(struct manager *mgr, u_char *dp) ri += dp[1 ];if (!mgr->up) goto denied; - tei =get_free_tei (mgr); +if (dp[3 ] !=0xff ) + tei = dp[3 ] >>1 ;/* 3GPP TS 08.56 6.1.11.2 */ +else + tei =get_free_tei (mgr);if (tei <0 ) {printk (KERN_WARNING "%s:No free tei\n" , __func__); goto denied; } - l2 =create_new_tei (mgr, tei); + l2 =create_new_tei (mgr, tei,0 );if (!l2) goto denied;else
@@ -976,8 +979,6 @@ create_teimgr(struct manager *mgr, struct channel_req *crq) __func__,dev_name (&mgr->ch.st->dev->dev), crq->protocol, crq->adr.dev, crq->adr.channel, crq->adr.sapi, crq->adr.tei); -if (crq->adr.sapi !=0 )/* not supported yet */ -return -EINVAL ;if (crq->adr.tei >GROUP_TEI )return -EINVAL ;if (crq->adr.tei <64 )
@@ -1025,7 +1026,7 @@ create_teimgr(struct manager *mgr, struct channel_req *crq)return 0 ; } l2 =create_l2 (crq->ch, crq->protocol, (u_int )opt, - (u_long )crq->adr.tei); + crq->adr.tei, crq->adr.sapi);if (!l2)return -ENOMEM ; l2->tm =kzalloc (sizeof (struct teimgr ),GFP_KERNEL );
@@ -1166,7 +1167,7 @@ static int check_data(struct manager *mgr, struct sk_buff *skb) { struct mISDNhead *hh = mISDN_HEAD_P(skb); -int ret, tei; +int ret, tei, sapi;struct layer2 *l2;if (*debug &DEBUG_L2_CTRL )
@@ -1178,18 +1179,16 @@ check_data(struct manager *mgr, struct sk_buff *skb)return -ENOTCONN ;if (skb->len !=3 )return -ENOTCONN ; -if (skb->data[0 ] !=0 ) -/* only SAPI 0 command */ -return -ENOTCONN ; + sapi = skb->data[0 ] >>2 ;if (!(skb->data[1 ] &1 ))/* invalid EA1 */ return -EINVAL ; - tei = skb->data[1 ] >>0 ; + tei = skb->data[1 ] >>1 ;if (tei >63 )/* not a fixed tei */ return -ENOTCONN ;if ((skb->data[2 ] & ~0x10 ) !=SABME )return -ENOTCONN ;/* We got a SABME for a fixed TEI */ - l2 =create_new_tei (mgr, tei); + l2 =create_new_tei (mgr, tei, sapi);if (!l2)return -ENOMEM ; ret = l2->ch.send (&l2->ch, skb);
Signature · 1 line
1.6.0.2
PATCH 14/19 Add "sapi" information to debug messages
In reply to Karsten KeilFrom: Andreas Eversberg <[email protected]>
Using sapi values other than 0 work now.
The "OpenBSC" project does not require special kernel patch anymore.
--- drivers/isdn/mISDN/layer2.c | 24 +++++++++++------------- drivers/isdn/mISDN/tei.c | 11 +++++++++-- 2 files changed, 20 insertions(+), 15 deletions(-)
drivers/isdn/mISDN/layer2.c +11 -13
@@ -99,7 +99,7 @@ l2m_debug(struct FsmInst *fi, char *fmt, ...)if (!(*debug &DEBUG_L2_FSM ))return ;va_start (va, fmt); -printk (KERN_DEBUG "l2 (tei %d): " , l2->tei); +printk (KERN_DEBUG "l2 (sapi %d tei %d): " , l2->sapi, l2->tei);vprintk (fmt, va);printk ("\n" );va_end (va);
@@ -1859,20 +1859,18 @@ ph_data_indication(struct layer2 *l2, struct mISDNhead *hh, struct sk_buff *skb) psapi >>=2 ; ptei >>=1 ;if (psapi != l2->sapi) { -/* not our bussiness -* printk(KERN_DEBUG "%s: sapi %d/%d sapi mismatch\n", -* __func__, -* psapi, l2->sapi); -*/ +/* not our bussiness */ +if (*debug &DEBUG_L2 ) +printk (KERN_DEBUG "%s: sapi %d/%d mismatch\n" , + __func__, psapi, l2->sapi);dev_kfree_skb (skb);return 0 ; }if ((ptei != l2->tei) && (ptei !=GROUP_TEI )) { -/* not our bussiness -* printk(KERN_DEBUG "%s: tei %d/%d sapi %d mismatch\n", -* __func__, -* ptei, l2->tei, psapi); -*/ +/* not our bussiness */ +if (*debug &DEBUG_L2 ) +printk (KERN_DEBUG "%s: tei %d/%d mismatch\n" , + __func__, ptei, l2->tei);dev_kfree_skb (skb);return 0 ; }
@@ -1927,8 +1925,8 @@ l2_send(struct mISDNchannel *ch, struct sk_buff *skb)int ret = -EINVAL ;if (*debug &DEBUG_L2_RECV ) -printk (KERN_DEBUG "%s: prim(%x) id(%x) tei(%d)\n" , - __func__, hh->prim, hh->id, l2->tei); +printk (KERN_DEBUG "%s: prim(%x) id(%x) sapi(%d) tei(%d)\n" , + __func__, hh->prim, hh->id, l2->sapi, l2->tei);switch (hh->prim) {case PH_DATA_IND : ret =ph_data_indication (l2, hh, skb);
drivers/isdn/mISDN/tei.c +9 -2
@@ -227,7 +227,7 @@ tei_debug(struct FsmInst *fi, char *fmt, ...)if (!(*debug &DEBUG_L2_TEIFSM ))return ;va_start (va, fmt); -printk (KERN_DEBUG "tei(%d): " , tm->l2->tei); +printk (KERN_DEBUG "sapi(%d) tei(%d): " , tm->l2->sapi, tm->l2->tei);vprintk (fmt, va);printk ("\n" );va_end (va);
@@ -1188,9 +1188,16 @@ check_data(struct manager *mgr, struct sk_buff *skb)if ((skb->data[2 ] & ~0x10 ) !=SABME )return -ENOTCONN ;/* We got a SABME for a fixed TEI */ +if (*debug &DEBUG_L2_CTRL ) +printk (KERN_DEBUG "%s: SABME sapi(%d) tei(%d)\n" , + __func__, sapi, tei); l2 =create_new_tei (mgr, tei, sapi); -if (!l2) +if (!l2) { +if (*debug &DEBUG_L2_CTRL ) +printk (KERN_DEBUG "%s: failed to create new tei\n" , + __func__);return -ENOMEM ; + } ret = l2->ch.send (&l2->ch, skb);return ret; }
Signature · 1 line
1.6.0.2
PATCH 15/19 Added PCI ID for new Junghanns.net Single E1 cards.
In reply to Karsten KeilFrom: Andreas Eversberg <[email protected]>
The new ID is validated by Cologne Chip.
LEDs control is also supported.
--- drivers/isdn/hardware/mISDN/hfcmulti.c | 4 ++++ include/linux/pci_ids.h | 1 + 2 files changed, 5 insertions(+), 0 deletions(-)
drivers/isdn/hardware/mISDN/hfcmulti.c +4 -0
@@ -5523,6 +5523,10 @@ static struct pci_device_id hfmultipci_ids[] __devinitdata = { PCI_SUBDEVICE_ID_CCD_SPD4S, 0, 0, H(26)}, /* PLX PCI Bridge */ { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9030, PCI_VENDOR_ID_CCD, PCI_SUBDEVICE_ID_CCD_SPDE1, 0, 0, H(27)}, /* PLX PCI Bridge */ + + { PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_HFCE1, PCI_VENDOR_ID_CCD, + PCI_SUBDEVICE_ID_CCD_JHSE1, 0, 0, H(25)}, /* Junghanns E1 */ + { PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_HFC4S, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, { PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_HFC8S, PCI_ANY_ID, PCI_ANY_ID,
include/linux/pci_ids.h +1 -0
@@ -1927,6 +1927,7 @@#define PCI_SUBDEVICE_ID_CCD_SWYX4S 0xB540#define PCI_SUBDEVICE_ID_CCD_JH4S20 0xB550#define PCI_SUBDEVICE_ID_CCD_IOB8ST_1 0xB552 +#define PCI_SUBDEVICE_ID_CCD_JHSE1 0xB553#define PCI_SUBDEVICE_ID_CCD_JH8S 0xB55B#define PCI_SUBDEVICE_ID_CCD_BN4S 0xB560#define PCI_SUBDEVICE_ID_CCD_BN8S 0xB562
Signature · 1 line
1.6.0.2
PATCH 16/19 Add allocation of recvbuf[1500] at run time to reduce stack size
In reply to Karsten KeilFrom: Frank Seidel <[email protected]>
Reduce stack usage.
modified by Andreas Eversberg,
--- drivers/isdn/mISDN/l1oip_core.c | 21 +++++++++++++++++---- 1 files changed, 17 insertions(+), 4 deletions(-)
drivers/isdn/mISDN/l1oip_core.c +17 -4
@@ -663,18 +663,28 @@ l1oip_socket_thread(void *data)struct iovec iov;mm_segment_t oldfs;struct sockaddr_in sin_rx; -unsigned char recvbuf[1500 ]; +unsigned char *recvbuf; +size_t recvbuf_size =1500 ;int recvlen;struct socket *socket =NULL ;DECLARE_COMPLETION (wait); +/* allocate buffer memory */ + recvbuf =kmalloc (recvbuf_size,GFP_KERNEL ); +if (!recvbuf) { +printk (KERN_ERR "%s: Failed to alloc recvbuf.\n" , __func__); + ret = -ENOMEM ; + goto fail; + } +/* make daemon */ allow_signal (SIGTERM );/* create socket */ if (sock_create (PF_INET ,SOCK_DGRAM ,IPPROTO_UDP , &socket)) {printk (KERN_ERR "%s: Failed to create socket.\n" , __func__); -return -EIO ; + ret = -EIO ; + goto fail; }/* set incoming address */
@@ -730,10 +740,10 @@ l1oip_socket_thread(void *data) __func__);while (!signal_pending (current)) { iov.iov_base = recvbuf; - iov.iov_len =sizeof (recvbuf); + iov.iov_len = recvbuf_size; oldfs =get_fs ();set_fs (KERNEL_DS ); - recvlen =sock_recvmsg (socket, &msg,sizeof (recvbuf),0 ); + recvlen =sock_recvmsg (socket, &msg, recvbuf_size,0 );set_fs (oldfs);if (recvlen >0 ) {l1oip_socket_parse (hc, &sin_rx, recvbuf, recvlen);
@@ -760,6 +770,9 @@ l1oip_socket_thread(void *data) __func__); fail: +/* free recvbuf */ +kfree (recvbuf); +/* close socket */ if (socket)sock_release (socket);
Signature · 1 line
1.6.0.2
PATCH 17/19 Fix skb leak in error cases
In reply to Karsten KeilIf the channel receive function returns an error the skb must be freed.
--- drivers/isdn/mISDN/socket.c | 22 ++++++++++++---------- 1 files changed, 12 insertions(+), 10 deletions(-)
drivers/isdn/mISDN/socket.c +12 -10
@@ -209,7 +209,7 @@ mISDN_sock_sendmsg(struct kiocb *iocb, struct socket *sock,if (memcpy_fromiovec (skb_put (skb, len), msg->msg_iov, len)) { err = -EFAULT ; - goto drop; + goto done; }memcpy (mISDN_HEAD_P (skb), skb->data,MISDN_HEADER_LEN );
@@ -230,19 +230,21 @@ mISDN_sock_sendmsg(struct kiocb *iocb, struct socket *sock, __func__, mISDN_HEAD_ID(skb)); err = -ENODEV ; -if (!_pms (sk)->ch.peer || - (err =_pms (sk)->ch.recv (_pms (sk)->ch.peer, skb))) - goto drop; - - err = len; +if (!_pms (sk)->ch.peer) + goto done; + err =_pms (sk)->ch.recv (_pms (sk)->ch.peer, skb); +if (err) + goto done; +else { + skb =NULL ; + err = len; + } done: +if (skb) +kfree_skb (skb);release_sock (sk);return err; - -drop: -kfree_skb (skb); - goto done; } static int
Signature · 1 line
1.6.0.2
PATCH 18/19 Cleanup debug messages
In reply to Karsten KeilThis patch make debug printk's KERN_DEBUG and also fix some codestyle issues.
--- drivers/isdn/hardware/mISDN/hfcmulti.c | 133 ++++++++++++++++---------------- drivers/isdn/hardware/mISDN/hfcpci.c | 28 ++++--- drivers/isdn/mISDN/dsp_audio.c | 5 +- drivers/isdn/mISDN/dsp_cmx.c | 7 +- drivers/isdn/mISDN/dsp_core.c | 14 ++-- drivers/isdn/mISDN/dsp_ecdis.h | 2 +- drivers/isdn/mISDN/dsp_tones.c | 23 ++++-- drivers/isdn/mISDN/l1oip_core.c | 30 ++++---- drivers/isdn/mISDN/socket.c | 2 +- drivers/isdn/mISDN/tei.c | 1 - drivers/isdn/mISDN/timerdev.c | 2 +- include/linux/mISDNif.h | 14 ++-- 12 files changed, 134 insertions(+), 127 deletions(-)
drivers/isdn/hardware/mISDN/hfcmulti.c +67 -66
@@ -414,14 +414,14 @@ HFC_outb_debug(struct hfc_multi *hc, u_char reg, u_char val,if (regname[0 ] =='\0' )strcpy (regname,"register" ); - bits[7 ] ='0' +(!!(val&1 )); - bits[6 ] ='0' +(!!(val&2 )); - bits[5 ] ='0' +(!!(val&4 )); - bits[4 ] ='0' +(!!(val&8 )); - bits[3 ] ='0' +(!!(val&16 )); - bits[2 ] ='0' +(!!(val&32 )); - bits[1 ] ='0' +(!!(val&64 )); - bits[0 ] ='0' +(!!(val&128 )); + bits[7 ] ='0' + (!!(val &1 )); + bits[6 ] ='0' + (!!(val &2 )); + bits[5 ] ='0' + (!!(val &4 )); + bits[4 ] ='0' + (!!(val &8 )); + bits[3 ] ='0' + (!!(val &16 )); + bits[2 ] ='0' + (!!(val &32 )); + bits[1 ] ='0' + (!!(val &64 )); + bits[0 ] ='0' + (!!(val &128 ));printk (KERN_DEBUG "HFC_outb(chip %d, %02x=%s, 0x%02x=%s); in %s() line %d\n" , hc->id, reg, regname, val, bits, function, line);
@@ -444,14 +444,14 @@ HFC_inb_debug(struct hfc_multi *hc, u_char reg, const char *function, int line)if (regname[0 ] =='\0' )strcpy (regname,"register" ); - bits[7 ] ='0' +(!!(val&1 )); - bits[6 ] ='0' +(!!(val&2 )); - bits[5 ] ='0' +(!!(val&4 )); - bits[4 ] ='0' +(!!(val&8 )); - bits[3 ] ='0' +(!!(val&16 )); - bits[2 ] ='0' +(!!(val&32 )); - bits[1 ] ='0' +(!!(val&64 )); - bits[0 ] ='0' +(!!(val&128 )); + bits[7 ] ='0' + (!!(val &1 )); + bits[6 ] ='0' + (!!(val &2 )); + bits[5 ] ='0' + (!!(val &4 )); + bits[4 ] ='0' + (!!(val &8 )); + bits[3 ] ='0' + (!!(val &16 )); + bits[2 ] ='0' + (!!(val &32 )); + bits[1 ] ='0' + (!!(val &64 )); + bits[0 ] ='0' + (!!(val &128 ));printk (KERN_DEBUG "HFC_inb(chip %d, %02x=%s) = 0x%02x=%s; in %s() line %d\n" , hc->id, reg, regname, val, bits, function, line);
@@ -1089,7 +1089,7 @@ plxsd_checksync(struct hfc_multi *hc, int rm)if (hc->syncronized) {if (syncmaster ==NULL ) {if (debug &DEBUG_HFCMULTI_PLXSD ) -printk (KERN_WARNING "%s: GOT sync on card %d" +printk (KERN_DEBUG "%s: GOT sync on card %d" " (id=%d)\n" , __func__, hc->id +1 , hc->id);hfcmulti_resync (hc, hc, rm);
@@ -1097,7 +1097,7 @@ plxsd_checksync(struct hfc_multi *hc, int rm) }else {if (syncmaster == hc) {if (debug &DEBUG_HFCMULTI_PLXSD ) -printk (KERN_WARNING "%s: LOST sync on card %d" +printk (KERN_DEBUG "%s: LOST sync on card %d" " (id=%d)\n" , __func__, hc->id +1 , hc->id);hfcmulti_resync (hc,NULL , rm);
@@ -1146,7 +1146,7 @@ release_io_hfcmulti(struct hfc_multi *hc) pv &= ~PLX_DSP_RES_N ;writel (pv, plx_acc_32);if (debug &DEBUG_HFCMULTI_INIT ) -printk (KERN_WARNING "%s: PCM off: PLX_GPIO=%x\n" , +printk (KERN_DEBUG "%s: PCM off: PLX_GPIO=%x\n" , __func__, pv);spin_unlock_irqrestore (&plx_lock, plx_flags); }
@@ -1197,8 +1197,8 @@ init_chip(struct hfc_multi *hc)if (debug &DEBUG_HFCMULTI_INIT )printk (KERN_DEBUG "%s: entered\n" , __func__); val =HFC_inb (hc,R_CHIP_ID ); -if ((val>>4 ) !=0x8 && (val>>4 ) !=0xc && (val>>4 ) !=0xe - && (val>>1 ) !=0x31 ) { +if ((val >>4 ) !=0x8 && (val >>4 ) !=0xc && (val >>4 ) !=0xe && + (val >>1 ) !=0x31 ) {printk (KERN_INFO "HFC_multi: unknown CHIP_ID:%x\n" , (u_int )val); err = -EIO ; goto out;
@@ -1280,7 +1280,7 @@ init_chip(struct hfc_multi *hc)writel (pv, plx_acc_32);spin_unlock_irqrestore (&plx_lock, plx_flags);if (debug &DEBUG_HFCMULTI_INIT ) -printk (KERN_WARNING "%s: slave/term: PLX_GPIO=%x\n" , +printk (KERN_DEBUG "%s: slave/term: PLX_GPIO=%x\n" , __func__, pv);/* * If we are the 3rd PLXSD card or higher, we must turn
@@ -1308,8 +1308,9 @@ init_chip(struct hfc_multi *hc)writel (pv, plx_acc_32);spin_unlock_irqrestore (&plx_lock, plx_flags);if (debug &DEBUG_HFCMULTI_INIT ) -printk (KERN_WARNING "%s: term off: PLX_GPIO=%x\n" , - __func__, pv); +printk (KERN_DEBUG +"%s: term off: PLX_GPIO=%x\n" , + __func__, pv); }spin_unlock_irqrestore (&HFClock, hfc_flags); hc->hw.r_pcm_md0 =V_F0_LEN ;/* shift clock for DSP */
@@ -1370,13 +1371,13 @@ init_chip(struct hfc_multi *hc) pv |=PLX_MASTER_EN |PLX_SLAVE_EN_N ; pv |=PLX_SYNC_O_EN ;if (debug &DEBUG_HFCMULTI_INIT ) -printk (KERN_WARNING "%s: master: PLX_GPIO=%x\n" , +printk (KERN_DEBUG "%s: master: PLX_GPIO=%x\n" , __func__, pv); }else { pv &= ~(PLX_MASTER_EN |PLX_SLAVE_EN_N ); pv &= ~PLX_SYNC_O_EN ;if (debug &DEBUG_HFCMULTI_INIT ) -printk (KERN_WARNING "%s: slave: PLX_GPIO=%x\n" , +printk (KERN_DEBUG "%s: slave: PLX_GPIO=%x\n" , __func__, pv); }writel (pv, plx_acc_32);
@@ -1488,8 +1489,8 @@ controller_fail:writel (pv, plx_acc_32);spin_unlock_irqrestore (&plx_lock, plx_flags);if (debug &DEBUG_HFCMULTI_INIT ) -printk (KERN_WARNING "%s: master: PLX_GPIO" -"=%x\n" , __func__, pv); +printk (KERN_DEBUG "%s: master: " +"PLX_GPIO=%x\n" , __func__, pv); } hc->hw.r_pcm_md0 |=V_PCM_MD ;HFC_outb (hc,R_PCM_MD0 , hc->hw.r_pcm_md0 |0x00 );
@@ -1523,7 +1524,7 @@ controller_fail:writel (pv, plx_acc_32);spin_unlock_irqrestore (&plx_lock, plx_flags);if (debug &DEBUG_HFCMULTI_INIT ) -printk (KERN_WARNING "%s: reset off: PLX_GPIO=%x\n" , +printk (KERN_DEBUG "%s: reset off: PLX_GPIO=%x\n" , __func__, pv); }
@@ -1956,7 +1957,7 @@ hfcmulti_dtmf(struct hfc_multi *hc) hc->chan[ch].coeff_count =0 ; skb =mI_alloc_skb (512 ,GFP_ATOMIC );if (!skb) { -printk (KERN_WARNING "%s: No memory for skb\n" , +printk (KERN_DEBUG "%s: No memory for skb\n" , __func__);continue ; }
@@ -2182,7 +2183,7 @@ next_frame:printk (KERN_DEBUG "%s(card %d): fifo(%d) has %d bytes space " "left (z1=%04x, z2=%04x) sending %d of %d bytes %s\n" , __func__, hc->id +1 , ch, Zspace, z1, z2, ii-i, len-i, - temp ?"HDLC" :"TRANS" ); + temp ?"HDLC" :"TRANS" );/* Have to prep the audio data */ hc->write_fifo (hc, d, ii - i);
@@ -2866,7 +2867,7 @@ hfcmulti_interrupt(int intno, void *dev_id)if (r_irq_misc &V_IRQ_PROC ) {static int irq_proc_cnt;if (!irq_proc_cnt++) -printk (KERN_WARNING "%s: got V_IRQ_PROC -" +printk (KERN_DEBUG "%s: got V_IRQ_PROC -" " this should not happen\n" , __func__); }
@@ -3016,7 +3017,7 @@ mode_hfcmulti(struct hfc_multi *hc, int ch, int protocol, int slot_tx,else flow_rx =0xc0 ;/* ST->(FIFO,PCM) */ /* put on slot */ - routing = bank_rx?0x80 :0xc0 ;/* reversed */ + routing = bank_rx ?0x80 :0xc0 ;/* reversed */ if (conf >=0 || bank_rx >1 ) routing =0x40 ;/* loop */ if (debug &DEBUG_HFCMULTI_MODE )
@@ -3051,7 +3052,7 @@ mode_hfcmulti(struct hfc_multi *hc, int ch, int protocol, int slot_tx,HFC_wait (hc);if (hc->chan[ch].bch && hc->ctype !=HFC_TYPE_E1 ) { hc->hw.a_st_ctrl0[hc->chan[ch].port] &= - ((ch &0x3 ) ==0 )? ~V_B1_EN : ~V_B2_EN ; + ((ch &0x3 ) ==0 ) ? ~V_B1_EN : ~V_B2_EN ;HFC_outb (hc,R_ST_SEL , hc->chan[ch].port);/* undocumented: delay after R_ST_SEL */ udelay (1 );
@@ -3585,9 +3586,9 @@ handle_bmsg(struct mISDNchannel *ch, struct sk_buff *skb)switch (hh->id) {case HFC_SPL_LOOP_ON :/* set sample loop */ if (debug &DEBUG_HFCMULTI_MSG ) -printk (KERN_DEBUG -"%s: HFC_SPL_LOOP_ON (len = %d)\n" , - __func__, skb->len); +printk (KERN_DEBUG +"%s: HFC_SPL_LOOP_ON (len = %d)\n" , + __func__, skb->len); ret =0 ;break ;case HFC_SPL_LOOP_OFF :/* set silence */
@@ -3796,8 +3797,7 @@ ph_state_change(struct dchannel *dch)int ch, i;if (!dch) { -printk (KERN_WARNING "%s: ERROR given dch is NULL\n" , - __func__); +printk (KERN_WARNING "%s: ERROR given dch is NULL\n" , __func__);return ; } hc = dch->hw;
@@ -3818,14 +3818,15 @@ ph_state_change(struct dchannel *dch)switch (dch->state) {case (1 ):if (hc->e1_state !=1 ) { -for (i =1 ; i <=31 ; i++) { -/* reset fifos on e1 activation */ -HFC_outb_nodebug (hc,R_FIFO , (i <<1 ) |1 ); -HFC_wait_nodebug (hc); -HFC_outb_nodebug (hc, -R_INC_RES_FIFO ,V_RES_F ); -HFC_wait_nodebug (hc); - } +for (i =1 ; i <=31 ; i++) { +/* reset fifos on e1 activation */ +HFC_outb_nodebug (hc,R_FIFO , + (i <<1 ) |1 ); +HFC_wait_nodebug (hc); +HFC_outb_nodebug (hc,R_INC_RES_FIFO , +V_RES_F ); +HFC_wait_nodebug (hc); + } }test_and_set_bit (FLG_ACTIVE , &dch->Flags); _queue_data(&dch->dev.D, PH_ACTIVATE_IND,
@@ -4125,12 +4126,12 @@ open_dchannel(struct hfc_multi *hc, struct dchannel *dch,return -EINVAL ;if ((dch->dev.D.protocol !=ISDN_P_NONE ) && (dch->dev.D.protocol != rq->protocol)) { -if (debug &DEBUG_HFCMULTI_MODE ) -printk (KERN_WARNING "%s: change protocol %x to %x\n" , - __func__, dch->dev.D.protocol, rq->protocol); +if (debug &DEBUG_HFCMULTI_MODE ) +printk (KERN_DEBUG "%s: change protocol %x to %x\n" , + __func__, dch->dev.D.protocol, rq->protocol); } -if ((dch->dev.D.protocol ==ISDN_P_TE_S0 ) - && (rq->protocol !=ISDN_P_TE_S0 )) +if ((dch->dev.D.protocol ==ISDN_P_TE_S0 ) && + (rq->protocol !=ISDN_P_TE_S0 ))l1_event (dch->l1,CLOSE_CHANNEL );if (dch->dev.D.protocol != rq->protocol) {if (rq->protocol ==ISDN_P_TE_S0 ) {
@@ -4207,9 +4208,9 @@ channel_dctrl(struct dchannel *dch, struct mISDN_ctrl_req *cq) wd_cnt = cq->p1 &0xf ; wd_mode = !!(cq->p1 >>4 );if (debug &DEBUG_HFCMULTI_MSG ) -printk (KERN_DEBUG -"%s: MISDN_CTRL_HFC_WD_INIT mode %s counter 0x%x\n" , - __func__, wd_mode ?"AUTO" :"MANUAL" , wd_cnt); +printk (KERN_DEBUG "%s: MISDN_CTRL_HFC_WD_INIT mode %s" +", counter 0x%x\n" , __func__, + wd_mode ?"AUTO" :"MANUAL" , wd_cnt);/* set the watchdog timer */ HFC_outb (hc,R_TI_WD , poll_timer | (wd_cnt <<4 )); hc->hw.r_bert_wd_md = (wd_mode ?V_AUTO_WD_RES :0 );
@@ -4219,8 +4220,8 @@ channel_dctrl(struct dchannel *dch, struct mISDN_ctrl_req *cq)HFC_outb (hc,R_BERT_WD_MD , hc->hw.r_bert_wd_md |V_WD_RES );if (test_bit (HFC_CHIP_PLXSD , &hc->chip)) {/* enable the watchdog output for Speech-Design */ -HFC_outb (hc,R_GPIO_SEL ,V_GPIO_SEL7 ); -HFC_outb (hc,R_GPIO_EN1 ,V_GPIO_EN15 ); +HFC_outb (hc,R_GPIO_SEL ,V_GPIO_SEL7 ); +HFC_outb (hc,R_GPIO_EN1 ,V_GPIO_EN15 );HFC_outb (hc,R_GPIO_OUT1 ,0 );HFC_outb (hc,R_GPIO_OUT1 ,V_GPIO_OUT15 ); }
@@ -4399,7 +4400,7 @@ error: }if (debug &DEBUG_HFCMULTI_INIT ) -printk (KERN_WARNING "%s: free irq %d\n" , __func__, hc->irq); +printk (KERN_DEBUG "%s: free irq %d\n" , __func__, hc->irq);if (hc->irq) {free_irq (hc->irq, hc); hc->irq =0 ;
@@ -4809,7 +4810,7 @@ release_card(struct hfc_multi *hc)int ch;if (debug &DEBUG_HFCMULTI_INIT ) -printk (KERN_WARNING "%s: release card (%d) entered\n" , +printk (KERN_DEBUG "%s: release card (%d) entered\n" , __func__, hc->id);/* unregister clock source */
@@ -4838,7 +4839,7 @@ release_card(struct hfc_multi *hc)/* release hardware & irq */ if (hc->irq) {if (debug &DEBUG_HFCMULTI_INIT ) -printk (KERN_WARNING "%s: free irq %d\n" , +printk (KERN_DEBUG "%s: free irq %d\n" , __func__, hc->irq);free_irq (hc->irq, hc); hc->irq =0 ;
@@ -4847,17 +4848,17 @@ release_card(struct hfc_multi *hc)release_io_hfcmulti (hc);if (debug &DEBUG_HFCMULTI_INIT ) -printk (KERN_WARNING "%s: remove instance from list\n" , +printk (KERN_DEBUG "%s: remove instance from list\n" , __func__);list_del (&hc->list);if (debug &DEBUG_HFCMULTI_INIT ) -printk (KERN_WARNING "%s: delete instance\n" , __func__); +printk (KERN_DEBUG "%s: delete instance\n" , __func__);if (hc == syncmaster) syncmaster =NULL ;kfree (hc);if (debug &DEBUG_HFCMULTI_INIT ) -printk (KERN_WARNING "%s: card successfully removed\n" , +printk (KERN_DEBUG "%s: card successfully removed\n" , __func__); }
@@ -4880,7 +4881,7 @@ init_e1_port(struct hfc_multi *hc, struct hm_map *m) (1 << (ISDN_P_B_HDLC &ISDN_P_B_MASK )); dch->dev.D.send = handle_dmsg; dch->dev.D.ctrl = hfcm_dctrl; - dch->dev.nrbchan = (hc->dslot)?30 :31 ; + dch->dev.nrbchan = (hc->dslot) ?30 :31 ; dch->slot = hc->dslot; hc->chan[hc->dslot].dch = dch; hc->chan[hc->dslot].port =0 ;
@@ -5122,7 +5123,7 @@ init_multi_port(struct hfc_multi *hc, int pt) }/* disable E-channel */ if (port[Port_cnt] &0x004 ) { -if (debug &DEBUG_HFCMULTI_INIT ) +if (debug &DEBUG_HFCMULTI_INIT ) printk(KERN_DEBUG "%s: PROTOCOL disable E-channel: " "card(%d) port(%d)\n",
@@ -5391,7 +5392,7 @@ static void __devexit hfc_remove_pci(struct pci_dev *pdev)spin_unlock_irqrestore (&HFClock, flags); }else {if (debug) -printk (KERN_WARNING "%s: drvdata allready removed\n" , +printk (KERN_DEBUG "%s: drvdata allready removed\n" , __func__); } }
drivers/isdn/hardware/mISDN/hfcpci.c +15 -13
@@ -257,7 +257,7 @@ reset_hfcpci(struct hfc_pci *hc)Write_hfc (hc,HFCPCI_INT_M1 , hc->hw.int_m1);/* Clear already pending ints */ -if (Read_hfc (hc,HFCPCI_INT_S1 )); + val =Read_hfc (hc,HFCPCI_INT_S1 );/* set NT/TE mode */ hfcpci_setmode (hc);
@@ -499,7 +499,8 @@ receive_dmsg(struct hfc_pci *hc) df->f2 = ((df->f2 +1 ) &MAX_D_FRAMES ) | (MAX_D_FRAMES +1 );/* next buffer */ df->za[df->f2 &D_FREG_MASK ].z2 = -cpu_to_le16 ((le16_to_cpu (zp->z2) + rcnt) & (D_FIFO_SIZE -1 )); +cpu_to_le16 ((le16_to_cpu (zp->z2) + rcnt) & + (D_FIFO_SIZE -1 )); }else { dch->rx_skb =mI_alloc_skb (rcnt -3 ,GFP_ATOMIC );if (!dch->rx_skb) {
@@ -966,6 +967,7 @@ static void ph_state_nt(struct dchannel *dch) {struct hfc_pci *hc = dch->hw; +u_char val;if (dch->debug) printk(KERN_DEBUG "%s: NT newstate %x\n",
@@ -979,7 +981,7 @@ ph_state_nt(struct dchannel *dch) hc->hw.int_m1 &= ~HFCPCI_INTS_TIMER ;Write_hfc (hc,HFCPCI_INT_M1 , hc->hw.int_m1);/* Clear already pending ints */ -if (Read_hfc (hc,HFCPCI_INT_S1 )); + val =Read_hfc (hc,HFCPCI_INT_S1 );Write_hfc (hc,HFCPCI_STATES ,4 |HFCPCI_LOAD_STATE );udelay (10 );Write_hfc (hc,HFCPCI_STATES ,4 );
@@ -1268,8 +1270,7 @@ mode_hfcpci(struct bchannel *bch, int bc, int protocol) rx_slot = (bc>>8 ) &0xff ; tx_slot = (bc>>16 ) &0xff ; bc = bc &0xff ; - }else if (test_bit (HFC_CFG_PCM , &hc->cfg) && - (protocol >ISDN_P_NONE )) + }else if (test_bit (HFC_CFG_PCM , &hc->cfg) && (protocol >ISDN_P_NONE ))printk (KERN_WARNING "%s: no pcm channel id but HFC_CFG_PCM\n" , __func__);if (hc->chanlimit >1 ) {
@@ -1327,8 +1328,8 @@ mode_hfcpci(struct bchannel *bch, int bc, int protocol)case (ISDN_P_B_RAW ): bch->state = protocol; bch->nr = bc; -hfcpci_clear_fifo_rx (hc, (fifo2 &2 )?1 :0 ); -hfcpci_clear_fifo_tx (hc, (fifo2 &2 )?1 :0 ); +hfcpci_clear_fifo_rx (hc, (fifo2 &2 ) ?1 :0 ); +hfcpci_clear_fifo_tx (hc, (fifo2 &2 ) ?1 :0 );if (bc &2 ) { hc->hw.sctrl |=SCTRL_B2_ENA ; hc->hw.sctrl_r |=SCTRL_B2_ENA ;
@@ -1362,8 +1363,8 @@ mode_hfcpci(struct bchannel *bch, int bc, int protocol)case (ISDN_P_B_HDLC ): bch->state = protocol; bch->nr = bc; -hfcpci_clear_fifo_rx (hc, (fifo2 &2 )?1 :0 ); -hfcpci_clear_fifo_tx (hc, (fifo2 &2 )?1 :0 ); +hfcpci_clear_fifo_rx (hc, (fifo2 &2 ) ?1 :0 ); +hfcpci_clear_fifo_tx (hc, (fifo2 &2 ) ?1 :0 );if (bc &2 ) { hc->hw.sctrl |=SCTRL_B2_ENA ; hc->hw.sctrl_r |=SCTRL_B2_ENA ;
@@ -1457,7 +1458,7 @@ set_hfcpci_rxtest(struct bchannel *bch, int protocol, int chan)switch (protocol) {case (ISDN_P_B_RAW ): bch->state = protocol; -hfcpci_clear_fifo_rx (hc, (chan &2 )?1 :0 ); +hfcpci_clear_fifo_rx (hc, (chan &2 ) ?1 :0 );if (chan &2 ) { hc->hw.sctrl_r |=SCTRL_B2_ENA ; hc->hw.fifo_en |=HFCPCI_FIFOEN_B2RX ;
@@ -1482,7 +1483,7 @@ set_hfcpci_rxtest(struct bchannel *bch, int protocol, int chan)break ;case (ISDN_P_B_HDLC ): bch->state = protocol; -hfcpci_clear_fifo_rx (hc, (chan &2 )?1 :0 ); +hfcpci_clear_fifo_rx (hc, (chan &2 ) ?1 :0 );if (chan &2 ) { hc->hw.sctrl_r |=SCTRL_B2_ENA ; hc->hw.last_bfifo_cnt[1 ] =0 ;
@@ -2047,7 +2048,8 @@ setup_hw(struct hfc_pci *hc)printk (KERN_WARNING "HFC-PCI: No IRQ for PCI card found\n" );return 1 ; } - hc->hw.pci_io = (char __iomem *)(unsigned long )hc->pdev->resource[1 ].start; + hc->hw.pci_io = + (char __iomem *)(unsigned long )hc->pdev->resource[1 ].start;if (!hc->hw.pci_io) {printk (KERN_WARNING "HFC-PCI: No IO-Mem for PCI card found\n" );
@@ -2289,7 +2291,7 @@ hfc_remove_pci(struct pci_dev *pdev)release_card (card); else if (debug) - printk(KERN_WARNING "%s: drvdata already removed\n", + printk(KERN_DEBUG "%s: drvdata already removed\n", __func__); }
drivers/isdn/mISDN/dsp_audio.c +2 -3
@@ -210,9 +210,8 @@ dsp_audio_generate_seven(void) j =0 ;for (k =0 ; k <256 ; k++) {if (dsp_audio_alaw_to_s32[k] - < dsp_audio_alaw_to_s32[i]) { - j++; - } + < dsp_audio_alaw_to_s32[i]) + j++; } sorted_alaw[j] = i; }
drivers/isdn/mISDN/dsp_cmx.c +4 -3
@@ -238,7 +238,7 @@ dsp_cmx_add_conf_member(struct dsp *dsp, struct dsp_conf *conf) member =kzalloc (sizeof (struct dsp_conf_member ),GFP_ATOMIC );if (!member) { -printk (KERN_ERR "kmalloc struct dsp_conf_member failed\n" ); +printk (KERN_ERR "kzalloc struct dsp_conf_member failed\n" );return -ENOMEM ; } member->dsp = dsp;
@@ -317,7 +317,7 @@ static struct dsp_conf conf =kzalloc (sizeof (struct dsp_conf ),GFP_ATOMIC );if (!conf) { -printk (KERN_ERR "kmalloc struct dsp_conf failed\n" ); +printk (KERN_ERR "kzalloc struct dsp_conf failed\n" );return NULL ; }INIT_LIST_HEAD (&conf->mlist);
@@ -1389,7 +1389,8 @@ dsp_cmx_send_member(struct dsp *dsp, int len, s32 *c, int members)while (r != rr && t != tt) {#ifdef CMX_TX_DEBUG if (strlen (debugbuf) <48 ) -sprintf (debugbuf+strlen (debugbuf)," %02x" , p[t]); +sprintf (debugbuf+strlen (debugbuf)," %02x" , + p[t]);#endif *d++ = p[t];/* write tx_buff */ t = (t+1 ) &CMX_BUFF_MASK ;
drivers/isdn/mISDN/dsp_core.c +7 -7
@@ -280,7 +280,7 @@ dsp_fill_empty(struct dsp *dsp)static int dsp_control_req (struct dsp *dsp,struct mISDNhead *hh,struct sk_buff *skb) { -struct sk_buff *nskb; +struct sk_buff *nskb;int ret =0 ;int cont;u8 *data;
@@ -558,7 +558,7 @@ tone_off: dsp->pipeline.inuse =1 ;dsp_cmx_hardware (dsp->conf, dsp); ret =dsp_pipeline_build (&dsp->pipeline, - len >0 ? (char *)data :NULL ); + len >0 ? data :NULL );dsp_cmx_hardware (dsp->conf, dsp);dsp_rx_off (dsp); }
@@ -720,7 +720,7 @@ dsp_function(struct mISDNchannel *ch, struct sk_buff *skb)/* check if dtmf soft decoding is turned on */ if (dsp->dtmf.software) { digits =dsp_dtmf_goertzel_decode (dsp, skb->data, - skb->len, (dsp_options&DSP_OPT_ULAW )?1 :0 ); + skb->len, (dsp_options&DSP_OPT_ULAW ) ?1 :0 ); }/* we need to process receive data if software */ if (dsp->conf && dsp->conf->software) {
@@ -952,7 +952,7 @@ dsp_ctrl(struct mISDNchannel *ch, u_int cmd, void *arg)int err =0 ;if (debug &DEBUG_DSP_CTRL ) -printk (KERN_DEBUG "%s:(%x)\n" , __func__, cmd); +printk (KERN_DEBUG "%s:(%x)\n" , __func__, cmd);switch (cmd) {case OPEN_CHANNEL :
@@ -1175,9 +1175,9 @@ static int dsp_init(void)/* init conversion tables */ dsp_audio_generate_law_tables (); - dsp_silence = (dsp_options&DSP_OPT_ULAW )?0xff :0x2a ; - dsp_audio_law_to_s32 = (dsp_options&DSP_OPT_ULAW )?dsp_audio_ulaw_to_s32: - dsp_audio_alaw_to_s32; + dsp_silence = (dsp_options&DSP_OPT_ULAW ) ?0xff :0x2a ; + dsp_audio_law_to_s32 = (dsp_options&DSP_OPT_ULAW ) ? + dsp_audio_ulaw_to_s32 : dsp_audio_alaw_to_s32;dsp_audio_generate_s2law_table ();dsp_audio_generate_seven ();dsp_audio_generate_mix_table ();
drivers/isdn/mISDN/dsp_ecdis.h +1 -1
@@ -91,7 +91,7 @@ int16_t amp) && det->tone_cycle_duration <= 475*8) { det->good_cycles++;if (det->good_cycles >2 ) - det->hit = TRUE; + det->hit = TRUE; } det->tone_cycle_duration =0 ; }
drivers/isdn/mISDN/dsp_tones.c +14 -9
@@ -253,18 +253,24 @@ static struct pattern { {8000, 0, 0, 0, 0, 0, 0, 0, 0, 0} }, {TONE_GERMAN_DIALPBX, - {DATA_GA, DATA_S, DATA_GA, DATA_S, DATA_GA, DATA_S, NULL, NULL, NULL, NULL}, - {SIZE_GA, SIZE_S, SIZE_GA, SIZE_S, SIZE_GA, SIZE_S, NULL, NULL, NULL, NULL}, + {DATA_GA, DATA_S, DATA_GA, DATA_S, DATA_GA, DATA_S, NULL, NULL, NULL, + NULL}, + {SIZE_GA, SIZE_S, SIZE_GA, SIZE_S, SIZE_GA, SIZE_S, NULL, NULL, NULL, + NULL}, {2000, 2000, 2000, 2000, 2000, 12000, 0, 0, 0, 0} }, {TONE_GERMAN_OLDDIALPBX, - {DATA_GO, DATA_S, DATA_GO, DATA_S, DATA_GO, DATA_S, NULL, NULL, NULL, NULL}, - {SIZE_GO, SIZE_S, SIZE_GO, SIZE_S, SIZE_GO, SIZE_S, NULL, NULL, NULL, NULL}, + {DATA_GO, DATA_S, DATA_GO, DATA_S, DATA_GO, DATA_S, NULL, NULL, NULL, + NULL}, + {SIZE_GO, SIZE_S, SIZE_GO, SIZE_S, SIZE_GO, SIZE_S, NULL, NULL, NULL, + NULL}, {2000, 2000, 2000, 2000, 2000, 12000, 0, 0, 0, 0} }, {TONE_AMERICAN_DIALPBX, - {DATA_DT, DATA_S, DATA_DT, DATA_S, DATA_DT, DATA_S, NULL, NULL, NULL, NULL}, - {SIZE_DT, SIZE_S, SIZE_DT, SIZE_S, SIZE_DT, SIZE_S, NULL, NULL, NULL, NULL}, + {DATA_DT, DATA_S, DATA_DT, DATA_S, DATA_DT, DATA_S, NULL, NULL, NULL, + NULL}, + {SIZE_DT, SIZE_S, SIZE_DT, SIZE_S, SIZE_DT, SIZE_S, NULL, NULL, NULL, + NULL}, {2000, 2000, 2000, 2000, 2000, 12000, 0, 0, 0, 0} }, {TONE_GERMAN_RINGING,
@@ -434,7 +440,7 @@ dsp_tone_hw_message(struct dsp *dsp, u8 *sample, int len)/* unlocking is not required, because we don't expect a response */ nskb =_alloc_mISDN_skb (PH_CONTROL_REQ , - (len)?HFC_SPL_LOOP_ON :HFC_SPL_LOOP_OFF , len, sample, + (len) ?HFC_SPL_LOOP_ON :HFC_SPL_LOOP_OFF , len, sample,GFP_ATOMIC );if (nskb) {if (dsp->ch.peer) {
@@ -498,8 +504,7 @@ dsp_tone(struct dsp *dsp, int tone)/* we turn off the tone */ if (!tone) { -if (dsp->features.hfc_loops) -if (timer_pending (&tonet->tl)) +if (dsp->features.hfc_loops &&timer_pending (&tonet->tl))del_timer (&tonet->tl);if (dsp->features.hfc_loops)dsp_tone_hw_message (dsp,NULL ,0 );
drivers/isdn/mISDN/l1oip_core.c +15 -15
@@ -308,8 +308,8 @@ l1oip_socket_send(struct l1oip *hc, u8 localcodec, u8 channel, u32 chanmask,/* assemble frame */ *p++ = (L1OIP_VERSION <<6 )/* version and coding */ - | (hc->pri?0x20 :0x00 )/* type */ - | (hc->id?0x10 :0x00 )/* id */ + | (hc->pri ?0x20 :0x00 )/* type */ + | (hc->id ?0x10 :0x00 )/* id */ | localcodec;if (hc->id) { *p++ = hc->id>>24 ;/* id */
@@ -317,7 +317,7 @@ l1oip_socket_send(struct l1oip *hc, u8 localcodec, u8 channel, u32 chanmask, *p++ = hc->id>>8 ; *p++ = hc->id; } - *p++ = (multi ==1 )?0x80 :0x00 + channel;/* m-flag, channel */ + *p++ = (multi ==1 ) ?0x80 :0x00 + channel;/* m-flag, channel */ if (multi ==1 ) *p++ = len;/* length */ *p++ = timebase>>8 ;/* time base */
@@ -401,12 +401,12 @@ l1oip_socket_recv(struct l1oip *hc, u8 remotecodec, u8 channel, u16 timebase, }/* prepare message */ - nskb =mI_alloc_skb ((remotecodec ==3 )?(len<<1 ):len,GFP_ATOMIC ); + nskb =mI_alloc_skb ((remotecodec ==3 ) ? (len<<1 ) : len,GFP_ATOMIC );if (!nskb) {printk (KERN_ERR "%s: No mem for skb.\n" , __func__);return ; } - p =skb_put (nskb, (remotecodec ==3 )?(len<<1 ):len); + p =skb_put (nskb, (remotecodec ==3 ) ? (len<<1 ) : len);if (remotecodec ==1 && ulaw)l1oip_alaw_to_ulaw (buf, len, p);
@@ -458,7 +458,7 @@ l1oip_socket_recv(struct l1oip *hc, u8 remotecodec, u8 channel, u16 timebase, hc->chan[channel].disorder_flag ^=1 ; if (nskb)#endif -queue_ch_frame (&bch->ch,PH_DATA_IND , rx_counter, nskb); +queue_ch_frame (&bch->ch,PH_DATA_IND , rx_counter, nskb); } }
@@ -749,8 +749,8 @@ l1oip_socket_thread(void *data)l1oip_socket_parse (hc, &sin_rx, recvbuf, recvlen); }else {if (debug &DEBUG_L1OIP_SOCKET ) -printk (KERN_WARNING "%s: broken pipe on socket\n" , - __func__); +printk (KERN_WARNING +"%s: broken pipe on socket\n" , __func__); } }
@@ -925,7 +925,7 @@ handle_dmsg(struct mISDNchannel *ch, struct sk_buff *skb) p = skb->data; l = skb->len;while (l) { - ll = (l <L1OIP_MAX_PERFRAME )?l:L1OIP_MAX_PERFRAME ; + ll = (l <L1OIP_MAX_PERFRAME ) ? l :L1OIP_MAX_PERFRAME ;l1oip_socket_send (hc,0 , dch->slot,0 , hc->chan[dch->slot].tx_counter++, p, ll); p += ll;
@@ -1173,7 +1173,7 @@ handle_bmsg(struct mISDNchannel *ch, struct sk_buff *skb) p = skb->data; l = skb->len;while (l) { - ll = (l <L1OIP_MAX_PERFRAME )?l:L1OIP_MAX_PERFRAME ; + ll = (l <L1OIP_MAX_PERFRAME ) ? l :L1OIP_MAX_PERFRAME ;l1oip_socket_send (hc, hc->codec, bch->slot,0 , hc->chan[bch->slot].tx_counter, p, ll); hc->chan[bch->slot].tx_counter += ll;
@@ -1331,8 +1331,8 @@ init_card(struct l1oip *hc, int pri, int bundle)spin_lock_init (&hc->socket_lock); hc->idx = l1oip_cnt; hc->pri = pri; - hc->d_idx = pri?16 :3 ; - hc->b_num = pri?30 :2 ; + hc->d_idx = pri ?16 :3 ; + hc->b_num = pri ?30 :2 ; hc->bundle = bundle;if (hc->pri)sprintf (hc->name,"l1oip-e1.%d" , l1oip_cnt +1 );
@@ -1517,9 +1517,9 @@ l1oip_init(void)if (debug &DEBUG_L1OIP_INIT )printk (KERN_DEBUG "%s: interface %d is %s with %s.\n" , - __func__, l1oip_cnt, pri?"PRI" :"BRI" , - bundle?"bundled IP packet for all B-channels" - :"seperate IP packets for every B-channel" ); + __func__, l1oip_cnt, pri ?"PRI" :"BRI" , + bundle ?"bundled IP packet for all B-channels" : +"seperate IP packets for every B-channel" ); hc =kzalloc (sizeof (struct l1oip ),GFP_ATOMIC );if (!hc) {
drivers/isdn/mISDN/socket.c +1 -1
@@ -222,7 +222,7 @@ mISDN_sock_sendmsg(struct kiocb *iocb, struct socket *sock, }else {/* use default for L2 messages */ if ((sk->sk_protocol ==ISDN_P_LAPD_TE ) || (sk->sk_protocol ==ISDN_P_LAPD_NT )) -mISDN_HEAD_ID (skb) =_pms (sk)->ch.nr; +mISDN_HEAD_ID (skb) =_pms (sk)->ch.nr; }if (*debug &DEBUG_SOCKET )
drivers/isdn/mISDN/tei.c +0 -1
@@ -871,7 +871,6 @@ ph_data_ind(struct manager *mgr, struct sk_buff *skb) __func__, skb->len); goto done; } -if (*debug &DEBUG_L2_TEI )if ((skb->data[0 ] >>2 ) !=TEI_SAPI )/* not for us */ goto done;
drivers/isdn/mISDN/timerdev.c +1 -1
@@ -259,7 +259,7 @@ mISDN_ioctl(struct inode *inode, struct file *filep, unsigned int cmd,return ret; } -static struct file_operations mISDN_fops = { +static const struct file_operations mISDN_fops = { .read = mISDN_read, .poll = mISDN_poll, .ioctl = mISDN_ioctl,
include/linux/mISDNif.h +7 -7
@@ -292,19 +292,19 @@ struct mISDN_devrename {/* MPH_INFORMATION_REQ payload */ struct ph_info_ch { -__u32 protocol; -__u64 Flags; +__u32 protocol; +__u64 Flags; };struct ph_info_dch { -struct ph_info_ch ch; -__u16 state; -__u16 num_bch; +struct ph_info_ch ch; +__u16 state; +__u16 num_bch; };struct ph_info { -struct ph_info_dch dch; -struct ph_info_ch bch[]; +struct ph_info_dch dch; +struct ph_info_ch bch[]; };/* timer device ioctl */
Signature · 1 line
1.6.0.2
PATCH 19/19 isdn: get_free_devid() failure ignored
In reply to Karsten KeilFrom: Roel Kluin <[email protected]>
dev->id is unsigned so a get_free_devid() error is ignored.
--- drivers/isdn/mISDN/core.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)
drivers/isdn/mISDN/core.c +4 -4
@@ -214,7 +214,7 @@ get_free_devid(void)if (!test_and_set_bit (i, (u_long *)&device_ids))break ;if (i >MAX_DEVICE_ID ) -return -1 ; +return -EBUSY ;return i; }
@@ -224,10 +224,10 @@ mISDN_register_device(struct mISDNdevice *dev, {int err; - dev->id =get_free_devid (); - err = -EBUSY ; -if (dev->id <0 ) + err =get_free_devid (); +if (err <0 ) goto error1; + dev->id = err;device_initialize (&dev->dev);if (name && name[0 ])
Signature · 1 line
1.6.0.2
Hi Karsten,
Quoted 7 lines · Karsten Keil
This is a update of the mISDN driver for linux-next. It syncs the mISDN driver with the development on git.misdn.org. More updates (new hardware support) will follow.
You can pull it from
git://master.kernel.org/pub/scm/linux/kernel/git/kkeil/ISDN-2.6-next.git
master
Should I take this as a request to add that tree to the linux-next tree?
Signature · 2 lines
Cheers, Stephen Rothwell
Hi Karsten,
Quoted 11 lines · On Wed, 20 May 2009 08:22:11 +1000 (EST) "Stephen Rothwell"…
Quoted 7 lines · Karsten Keil
This is a update of the mISDN driver for linux-next. It syncs the mISDN driver with the development on git.misdn.org. More updates (new hardware support) will follow.
You can pull it from
git://master.kernel.org/pub/scm/linux/kernel/git/kkeil/ISDN-2.6-next.git
masterShould I take this as a request to add that tree to the linux-next tree?
Actually, I have now looked at that tree and it is based on linux-next (of yesterday). I cannot incorporate such a tree into linux-next (since linux-next effectively rebases every day and such a tree would drag in old versions of other trees). All the trees in linux-next must be based on other trees that do not rebase - usually Linus' tree, but the net tree is also a possibility.
Signature · 3 lines
Cheers, Stephen Rothwell [email protected] http://www.canb.auug.org.au/~sfr/