[zaptel-commits] tzafrir: branch tzafrir/kernelmove_14 r2593 - in /team/tzafrir/kernelmove_14/...

zaptel-commits at lists.digium.com zaptel-commits at lists.digium.com
Fri Jun 8 04:52:02 MST 2007


Author: tzafrir
Date: Fri Jun  8 06:52:01 2007
New Revision: 2593

URL: http://svn.digium.com/view/zaptel?view=rev&rev=2593
Log:
Updated 1.4 up to rev. 2591.

Modified:
    team/tzafrir/kernelmove_14/kernel/wct4xxp/base.c
    team/tzafrir/kernelmove_14/kernel/wct4xxp/vpm450m.c
    team/tzafrir/kernelmove_14/kernel/xpp/card_fxo.c
    team/tzafrir/kernelmove_14/kernel/xpp/utils/xpp_fxloader
    team/tzafrir/kernelmove_14/kernel/zaptel-base.c

Modified: team/tzafrir/kernelmove_14/kernel/wct4xxp/base.c
URL: http://svn.digium.com/view/zaptel/team/tzafrir/kernelmove_14/kernel/wct4xxp/base.c?view=diff&rev=2593&r1=2592&r2=2593
==============================================================================
--- team/tzafrir/kernelmove_14/kernel/wct4xxp/base.c (original)
+++ team/tzafrir/kernelmove_14/kernel/wct4xxp/base.c Fri Jun  8 06:52:01 2007
@@ -220,6 +220,7 @@
 #define FLAG_VPM2GEN (1 << 5)
 #define FLAG_OCTOPT  (1 << 6)
 #define FLAG_3RDGEN  (1 << 7)
+#define FLAG_BURST  (1 << 8)
 
 #define CANARY 0xc0de
 
@@ -229,10 +230,12 @@
 };
 
 static struct devtype wct4xxp = { "Wildcard TE410P/TE405P (1st Gen)", 0 };
+static struct devtype wct420p4 = { "Wildcard TE420P (4th Gen)", FLAG_BURST | FLAG_2NDGEN | FLAG_3RDGEN };
 static struct devtype wct410p3 = { "Wildcard TE410P (3rd Gen)", FLAG_2NDGEN | FLAG_3RDGEN };
 static struct devtype wct405p3 = { "Wildcard TE405P (3rd Gen)", FLAG_2NDGEN | FLAG_3RDGEN };
 static struct devtype wct410p2 = { "Wildcard TE410P (2nd Gen)", FLAG_2NDGEN };
 static struct devtype wct405p2 = { "Wildcard TE405P (2nd Gen)", FLAG_2NDGEN };
+static struct devtype wct220p4 = { "Wildcard TE220P (4th Gen)", FLAG_BURST | FLAG_2NDGEN | FLAG_3RDGEN | FLAG_2PORT };
 static struct devtype wct205p3 = { "Wildcard TE205P (3rd Gen)", FLAG_2NDGEN | FLAG_3RDGEN | FLAG_2PORT };
 static struct devtype wct210p3 = { "Wildcard TE210P (3rd Gen)", FLAG_2NDGEN | FLAG_3RDGEN | FLAG_2PORT };
 static struct devtype wct205 = { "Wildcard TE205P ", FLAG_2NDGEN | FLAG_2PORT };
@@ -2036,7 +2039,7 @@
 #endif
 		/* Seed interrupt register */
 		__t4_pci_out(wc, WC_INTR, 0x0c);
-		if (noburst)
+		if (noburst && !(ts->spanflags & FLAG_BURST))
 			wc->dmactrl |= (1 << 26);
 		__t4_pci_out(wc, WC_DMACTRL, wc->dmactrl);
 		/* Startup HDLC controller too */
@@ -3431,12 +3434,12 @@
 	spin_unlock_irqrestore(&wc->reglock, flags);
 }
 
-static int t4_hardware_init_1(struct t4 *wc, int gen2)
+static int t4_hardware_init_1(struct t4 *wc, unsigned int cardflags)
 {
 	unsigned int version;
 
 	version = t4_pci_in(wc, WC_VERSION);
-	printk("TE%dXXP version %08x, burst %s, slip debug: %s\n", wc->numspans, version, noburst ? "OFF" : "ON", debugslips ? "ON" : "OFF");
+ 	printk("TE%dXXP version %08x, burst %s, slip debug: %s\n", wc->numspans, version, (!(cardflags & FLAG_BURST) && noburst) ? "OFF" : "ON", debugslips ? "ON" : "OFF");
 #ifdef ENABLE_WORKQUEUES
 	printk("TE%dXXP running with work queues.\n", wc->numspans);
 #endif
@@ -3452,7 +3455,7 @@
 	t4_pci_out(wc, WC_WRADDR, wc->writedma);
 
 	/* Setup counters, interrupt flags (ignored in Gen2) */
-	if (gen2) {
+	if (cardflags & FLAG_2NDGEN) {
 		t4_tsi_reset(wc);
 	} else {
 		t4_pci_out(wc, WC_COUNT, ((ZT_MAX_CHUNKSIZE * 2 * 32 - 1) << 18) | ((ZT_MAX_CHUNKSIZE * 2 * 32 - 1) << 2));
@@ -3619,7 +3622,7 @@
 			pci_set_drvdata(pdev, wc);
 
 			/* Initialize hardware */
-			t4_hardware_init_1(wc, dt->flags & FLAG_2NDGEN);
+			t4_hardware_init_1(wc, dt->flags);
 
 			for(x = 0; x < MAX_T4_CARDS; x++) {
 				if (!cards[x]) break;
@@ -3826,11 +3829,13 @@
 {
 	{ 0x10ee, 0x0314, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (unsigned long)&wct4xxp },
 
+ 	{ 0xd161, 0x0420, 0x0004,     PCI_ANY_ID, 0, 0, (unsigned long)&wct420p4 },
 	{ 0xd161, 0x0410, 0x0003,     PCI_ANY_ID, 0, 0, (unsigned long)&wct410p3 },
 	{ 0xd161, 0x0405, 0x0003,     PCI_ANY_ID, 0, 0, (unsigned long)&wct405p3 },
 	{ 0xd161, 0x0410, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (unsigned long)&wct410p2 },
 	{ 0xd161, 0x0405, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (unsigned long)&wct405p2 },
 
+ 	{ 0xd161, 0x0220, 0x0004,     PCI_ANY_ID, 0, 0, (unsigned long)&wct220p4 },
 	{ 0xd161, 0x0205, 0x0003,     PCI_ANY_ID, 0, 0, (unsigned long)&wct205p3 },
 	{ 0xd161, 0x0210, 0x0003,     PCI_ANY_ID, 0, 0, (unsigned long)&wct210p3 },
 	{ 0xd161, 0x0205, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (unsigned long)&wct205 },

Modified: team/tzafrir/kernelmove_14/kernel/wct4xxp/vpm450m.c
URL: http://svn.digium.com/view/zaptel/team/tzafrir/kernelmove_14/kernel/wct4xxp/vpm450m.c?view=diff&rev=2593&r1=2592&r2=2593
==============================================================================
--- team/tzafrir/kernelmove_14/kernel/wct4xxp/vpm450m.c (original)
+++ team/tzafrir/kernelmove_14/kernel/wct4xxp/vpm450m.c Fri Jun  8 06:52:01 2007
@@ -407,6 +407,7 @@
 	UINT32 ulResult;
 	struct vpm450m *vpm450m;
 	int x,y,law;
+	unsigned long flags;
 	
 	if (!(vpm450m = kmalloc(sizeof(struct vpm450m), GFP_KERNEL)))
 		return NULL;
@@ -476,9 +477,16 @@
 		return NULL;
 	}
 
+	/* I don't know what to curse more in this comment, the problems caused by
+	 * the 4K kernel stack limit change or the octasic API for being so darn
+	 * stack unfriendly.  Stupid, stupid, stupid.  So we disable IRQs so we
+	 * don't run the risk of overflowing the stack while we initialize the
+	 * octasic. */
+	local_irq_save(flags);
 	ulResult = Oct6100ChipOpen(vpm450m->pApiInstance, ChipOpen);
 	if (ulResult != cOCT6100_ERR_OK) {
 		printk("Failed to open chip, code %08x!\n", ulResult);
+		local_irq_restore(flags);
 		kfree(vpm450m);
 		kfree(ChipOpen);
 		kfree(ChannelOpen);
@@ -533,6 +541,7 @@
 		}
 	}
 
+	local_irq_restore(flags);
 	kfree(ChipOpen);
 	kfree(ChannelOpen);
 	return vpm450m;

Modified: team/tzafrir/kernelmove_14/kernel/xpp/card_fxo.c
URL: http://svn.digium.com/view/zaptel/team/tzafrir/kernelmove_14/kernel/xpp/card_fxo.c?view=diff&rev=2593&r1=2592&r2=2593
==============================================================================
--- team/tzafrir/kernelmove_14/kernel/xpp/card_fxo.c (original)
+++ team/tzafrir/kernelmove_14/kernel/xpp/card_fxo.c Fri Jun  8 06:52:01 2007
@@ -82,6 +82,9 @@
 #define	DAA_CURRENT_REGISTER	0x1C
 #define	DAA_RING_REGISTER	0x05
 
+#define	POWER_DENIAL_CURRENT	3
+#define	POWER_DENIAL_TIME	1000	/* ticks */
+
 struct FXO_priv_data {
 	struct proc_dir_entry	*regfile;
 	struct proc_dir_entry	*fxo_info;
@@ -210,7 +213,7 @@
 	xbus_t			*xbus;
 	struct FXO_priv_data	*priv;
 	int			ret = 0;
-	bool			value;
+	byte			value;
 
 	BUG_ON(!xpd);
 	BUG_ON(xpd->direction == TO_PHONE);		// We can SETHOOK state only on PSTN
@@ -708,9 +711,10 @@
 
 	priv = xpd->priv;
 	BUG_ON(!priv);
-	if (IS_SET(xpd->offhook, chipsel) && data_low < 3) {
+	if (IS_SET(xpd->offhook, chipsel) && data_low < POWER_DENIAL_CURRENT) {
+		/* Current dropped */
 		priv->current_counter[chipsel]++;
-		if (priv->current_counter[chipsel] >= 10) {
+		if (priv->current_counter[chipsel] * poll_battery_interval >= POWER_DENIAL_TIME) {
 			DBG("%s/%s/%d: Power Denial Hangup\n", xpd->xbus->busname, xpd->xpdname, chipsel);
 			priv->current_counter[chipsel] = 0;
 			do_sethook(xpd, chipsel, 0);

Modified: team/tzafrir/kernelmove_14/kernel/xpp/utils/xpp_fxloader
URL: http://svn.digium.com/view/zaptel/team/tzafrir/kernelmove_14/kernel/xpp/utils/xpp_fxloader?view=diff&rev=2593&r1=2592&r2=2593
==============================================================================
--- team/tzafrir/kernelmove_14/kernel/xpp/utils/xpp_fxloader (original)
+++ team/tzafrir/kernelmove_14/kernel/xpp/utils/xpp_fxloader Fri Jun  8 06:52:01 2007
@@ -215,7 +215,7 @@
 ##
 
 # allow disabling automatic hotplugging:
-if [ "$XPP_HOTPLUG_DISABLED" != '' ]; then return 0; fi
+if [ "$XPP_HOTPLUG_DISABLED" != '' ]; then exit 0; fi
 
 if [ "$ACTION" = "add" ] && [ -w "$DEVICE" ]
 then

Modified: team/tzafrir/kernelmove_14/kernel/zaptel-base.c
URL: http://svn.digium.com/view/zaptel/team/tzafrir/kernelmove_14/kernel/zaptel-base.c?view=diff&rev=2593&r1=2592&r2=2593
==============================================================================
--- team/tzafrir/kernelmove_14/kernel/zaptel-base.c (original)
+++ team/tzafrir/kernelmove_14/kernel/zaptel-base.c Fri Jun  8 06:52:01 2007
@@ -768,7 +768,6 @@
 	current->state = TASK_RUNNING;
 	remove_wait_queue(q, &wait);
 	if (signal_pending(current)) {
-		printk(KERN_WARNING "zaptel.c:%d (pid %d: %s) got signal %08lX\n", __LINE__, current->pid, current->comm, current->pending.signal.sig[0]);
 		return -ERESTARTSYS;
 	}
 	return(0);



More information about the zaptel-commits mailing list