[svn-commits] sruffell: linux/trunk r7569 - in /linux/trunk/drivers/dahdi: voicebus/ wctdm2...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Nov 12 13:22:19 CST 2009


Author: sruffell
Date: Thu Nov 12 13:22:08 2009
New Revision: 7569

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=7569
Log:
voicebus: Use dev_xxx macro when printing vpm messages.

We also do not need the unused context member of the vpmadt032 structure.

Modified:
    linux/trunk/drivers/dahdi/voicebus/GpakCust.c
    linux/trunk/drivers/dahdi/voicebus/GpakCust.h
    linux/trunk/drivers/dahdi/wctdm24xxp/base.c
    linux/trunk/drivers/dahdi/wcte12xp/base.c

Modified: linux/trunk/drivers/dahdi/voicebus/GpakCust.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/voicebus/GpakCust.c?view=diff&rev=7569&r1=7568&r2=7569
==============================================================================
--- linux/trunk/drivers/dahdi/voicebus/GpakCust.c (original)
+++ linux/trunk/drivers/dahdi/voicebus/GpakCust.c Thu Nov 12 13:22:08 2009
@@ -52,6 +52,9 @@
 
 static rwlock_t ifacelock;
 static struct vpmadt032 *ifaces[MAX_DSP_CORES];
+
+#define vpm_info(vpm, format, arg...)         \
+        dev_info(&voicebus_get_pci_dev(vpm->vb)->dev , format , ## arg)
 
 static inline struct vpmadt032 *find_iface(const unsigned short dspid)
 {
@@ -241,13 +244,13 @@
 	if (vpm->options.debug & DEBUG_ECHOCAN) {
 		const char *law;
 		law = (control == EnableMuLawSwCompanding) ? "MuLaw" : "ALaw";
-		printk(KERN_DEBUG "Enabling ecan on channel: %d (%s)\n",
-				channel, law);
+		vpm_info(vpm, "Enabling ecan on channel: %d (%s)\n",
+			 channel, law);
 	}
 	res = gpakAlgControl(vpm->dspid, channel, control, &pstatus);
 	if (res) {
-		printk(KERN_WARNING "Unable to set SW Companding on " \
-			"channel %d (reason %d)\n", channel, res);
+		vpm_info(vpm, "Unable to set SW Companding on "
+			 "channel %d (reason %d)\n", channel, res);
 	}
 	res = gpakAlgControl(vpm->dspid, channel, EnableEcanA, &pstatus);
 	return res;
@@ -259,13 +262,13 @@
 	GPAK_AlgControlStat_t pstatus;
 
 	if (vpm->options.debug & DEBUG_ECHOCAN)
-		printk(KERN_DEBUG "Disabling ecan on channel: %d\n", channel);
+		vpm_info(vpm, "Disabling ecan on channel: %d\n", channel);
 
 	res = gpakAlgControl(vpm->dspid, channel, BypassSwCompanding, &pstatus);
 	if (res) {
-		printk(KERN_WARNING "Unable to disable sw companding on " \
-			"echo cancellation channel %d (reason %d)\n",
-			channel, res);
+		vpm_info(vpm, "Unable to disable sw companding on "
+			 "echo cancellation channel %d (reason %d)\n",
+			 channel, res);
 	}
 	res = gpakAlgControl(vpm->dspid, channel, BypassEcanA, &pstatus);
 	return res;
@@ -320,10 +323,10 @@
 	GpakChannelConfig_t chanconfig;
 
 	if (vpm->options.debug & DEBUG_ECHOCAN) {
-		printk(KERN_DEBUG "Reconfiguring chan %d for nlp %d, "
-		       "nlp_thresh %d, and max_supp %d\n", channel + 1,
-		       desired->nlp_type, desired->nlp_threshold,
-		       desired->nlp_max_suppress);
+		vpm_info(vpm, "Reconfiguring chan %d for nlp %d, "
+			 "nlp_thresh %d, and max_supp %d\n", channel + 1,
+			 desired->nlp_type, desired->nlp_threshold,
+			 desired->nlp_max_suppress);
 	}
 
 	vpm->setchanconfig_from_state(vpm, channel, &chanconfig);
@@ -341,9 +344,9 @@
 		res = gpakAlgControl(vpm->dspid, channel,
 				     BypassSwCompanding, &pstatus);
 		if (res) {
-			printk("Unable to disable sw companding on echo "
-			       "cancellation channel %d (reason %d)\n",
-			       channel, res);
+			vpm_info(vpm, "Unable to disable sw companding on "
+				 "echo cancellation channel %d (reason %d)\n",
+				 channel, res);
 		}
 		gpakAlgControl(vpm->dspid, channel, BypassEcanA, &pstatus);
 	}
@@ -430,8 +433,10 @@
 		return ret;
 	}
 
-	if (vpm->options.debug & DEBUG_ECHOCAN)
-		printk(KERN_DEBUG "echocan: Channel is %d length %d\n", channo, ecp->tap_length);
+	if (vpm->options.debug & DEBUG_ECHOCAN) {
+		vpm_info(vpm, "Channel is %d length %d\n",
+			 channo, ecp->tap_length);
+	}
 
 	/* The driver cannot control the number of taps on the VPMADT032
 	 * module. Instead, it uses tap_length to enable or disable the echo
@@ -460,7 +465,7 @@
 	order->channel = channo;
 
 	if (vpm->options.debug & DEBUG_ECHOCAN)
-		printk(KERN_DEBUG "echocan: Channel is %d length 0\n", channo);
+		vpm_info(vpm, "Channel is %d length 0\n", channo);
 
 	vpmadt032_check_and_schedule_update(vpm, order);
 }
@@ -529,8 +534,6 @@
 		kfree(vpm);
 		printk(KERN_NOTICE "Unable to initialize another vpmadt032 modules\n");
 		vpm = NULL;
-	} else if (vpm->options.debug & DEBUG_ECHOCAN) {
-		printk(KERN_DEBUG "Setting VPMADT032 DSP ID to %d\n", vpm->dspid);
 	}
 
 	return vpm;
@@ -547,6 +550,9 @@
 
 	BUG_ON(!vpm->setchanconfig_from_state);
 	BUG_ON(!vpm->wq);
+	BUG_ON(!vb);
+
+	vpm->vb = vb;
 
 	might_sleep();
 

Modified: linux/trunk/drivers/dahdi/voicebus/GpakCust.h
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/voicebus/GpakCust.h?view=diff&rev=7569&r1=7568&r2=7569
==============================================================================
--- linux/trunk/drivers/dahdi/voicebus/GpakCust.h (original)
+++ linux/trunk/drivers/dahdi/voicebus/GpakCust.h Thu Nov 12 13:22:08 2009
@@ -106,7 +106,7 @@
 struct GpakChannelConfig;
 
 struct vpmadt032 {
-	void *context;
+	struct voicebus *vb;
 	struct work_struct work;
 	struct workqueue_struct *wq;
 	int dspid;

Modified: linux/trunk/drivers/dahdi/wctdm24xxp/base.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/wctdm24xxp/base.c?view=diff&rev=7569&r1=7568&r2=7569
==============================================================================
--- linux/trunk/drivers/dahdi/wctdm24xxp/base.c (original)
+++ linux/trunk/drivers/dahdi/wctdm24xxp/base.c Thu Nov 12 13:22:08 2009
@@ -3658,7 +3658,6 @@
 			return -ENOMEM;
 
 		wc->vpmadt032->setchanconfig_from_state = setchanconfig_from_state;
-		wc->vpmadt032->context = wc;
 		wc->vpmadt032->options.channels = wc->span.channels;
 		get_default_portconfig(&portconfig);
 		res = vpmadt032_init(wc->vpmadt032, wc->vb);

Modified: linux/trunk/drivers/dahdi/wcte12xp/base.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/wcte12xp/base.c?view=diff&rev=7569&r1=7568&r2=7569
==============================================================================
--- linux/trunk/drivers/dahdi/wcte12xp/base.c (original)
+++ linux/trunk/drivers/dahdi/wcte12xp/base.c Thu Nov 12 13:22:08 2009
@@ -1371,7 +1371,6 @@
 		if (!wc->vpmadt032)
 			return -ENOMEM;
 
-		wc->vpmadt032->context = wc;
 		wc->vpmadt032->setchanconfig_from_state = setchanconfig_from_state;
 
 		res = vpmadt032_init(wc->vpmadt032, wc->vb);




More information about the svn-commits mailing list