[svn-commits] tzafrir: linux/trunk r8877 - /linux/trunk/drivers/dahdi/xpp/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Jul 13 03:33:03 CDT 2010


Author: tzafrir
Date: Tue Jul 13 03:33:00 2010
New Revision: 8877

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=8877
Log:
Fix building without CONFIG_PROC_FS defined

This changeset should have no functional changes.

Modified:
    linux/trunk/drivers/dahdi/xpp/card_bri.c
    linux/trunk/drivers/dahdi/xpp/card_fxo.c
    linux/trunk/drivers/dahdi/xpp/card_fxs.c
    linux/trunk/drivers/dahdi/xpp/xbus-core.c
    linux/trunk/drivers/dahdi/xpp/xbus-core.h
    linux/trunk/drivers/dahdi/xpp/xbus-pcm.c
    linux/trunk/drivers/dahdi/xpp/xbus-pcm.h
    linux/trunk/drivers/dahdi/xpp/xpp_dahdi.c
    linux/trunk/drivers/dahdi/xpp/xpp_usb.c

Modified: linux/trunk/drivers/dahdi/xpp/card_bri.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/xpp/card_bri.c?view=diff&rev=8877&r1=8876&r2=8877
==============================================================================
--- linux/trunk/drivers/dahdi/xpp/card_bri.c (original)
+++ linux/trunk/drivers/dahdi/xpp/card_bri.c Tue Jul 13 03:33:00 2010
@@ -56,6 +56,7 @@
 	ST_NT_DEACTIVTING	= 4,	/* G4	*/
 };
 
+#ifdef CONFIG_PROC_FS
 static const char *xhfc_state_name(bool is_nt, enum xhfc_states state)
 {
 	const char	*p;
@@ -92,6 +93,7 @@
 	}
 	return p;
 }
+#endif
 
 /* xhfc Layer1 physical commands */
 #define HFC_L1_ACTIVATE_TE		0x01
@@ -157,7 +159,9 @@
 static int write_state_register(xpd_t *xpd, byte value);
 static bool bri_packet_is_valid(xpacket_t *pack);
 static void bri_packet_dump(const char *msg, xpacket_t *pack);
+#ifdef	CONFIG_PROC_FS
 static int proc_bri_info_read(char *page, char **start, off_t off, int count, int *eof, void *data);
+#endif
 static int bri_spanconfig(struct dahdi_span *span, struct dahdi_lineconfig *lc);
 static int bri_chanconfig(struct dahdi_chan *chan, int sigtype);
 static int bri_startup(struct dahdi_span *span);
@@ -799,14 +803,12 @@
 	priv->bri_info = create_proc_read_entry(PROC_BRI_INFO_FNAME, 0444, xpd->proc_xpd_dir, proc_bri_info_read, xpd);
 	if(!priv->bri_info) {
 		XPD_ERR(xpd, "Failed to create proc file '%s'\n", PROC_BRI_INFO_FNAME);
-		goto err;
+		bri_proc_remove(xbus, xpd);
+		return -EINVAL;
 	}
 	SET_PROC_DIRENTRY_OWNER(priv->bri_info);
 #endif
 	return 0;
-err:
-	bri_proc_remove(xbus, xpd);
-	return -EINVAL;
 }
 
 static xpd_t *BRI_card_new(xbus_t *xbus, int unit, int subunit, const xproto_table_t *proto_table,
@@ -1694,6 +1696,7 @@
 }
 /*------------------------- REGISTER Handling --------------------------*/
 
+#ifdef	CONFIG_PROC_FS
 static int proc_bri_info_read(char *page, char **start, off_t off, int count, int *eof, void *data)
 {
 	int			len = 0;
@@ -1756,6 +1759,7 @@
 		len = 0;
 	return len;
 }
+#endif
 
 static DRIVER_ATTR_READER(dchan_hardhdlc_show, drv,buf)
 {

Modified: linux/trunk/drivers/dahdi/xpp/card_fxo.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/xpp/card_fxo.c?view=diff&rev=8877&r1=8876&r2=8877
==============================================================================
--- linux/trunk/drivers/dahdi/xpp/card_fxo.c (original)
+++ linux/trunk/drivers/dahdi/xpp/card_fxo.c Tue Jul 13 03:33:00 2010
@@ -87,9 +87,11 @@
 
 static bool fxo_packet_is_valid(xpacket_t *pack);
 static void fxo_packet_dump(const char *msg, xpacket_t *pack);
+#ifdef CONFIG_PROC_FS
 static int proc_fxo_info_read(char *page, char **start, off_t off, int count, int *eof, void *data);
 #ifdef	WITH_METERING
 static int proc_xpd_metering_read(char *page, char **start, off_t off, int count, int *eof, void *data);
+#endif
 #endif
 static void dahdi_report_battery(xpd_t *xpd, lineno_t chan);
 
@@ -403,7 +405,8 @@
 	priv->fxo_info = create_proc_read_entry(PROC_FXO_INFO_FNAME, 0444, xpd->proc_xpd_dir, proc_fxo_info_read, xpd);
 	if(!priv->fxo_info) {
 		XPD_ERR(xpd, "Failed to create proc file '%s'\n", PROC_FXO_INFO_FNAME);
-		goto err;
+		fxo_proc_remove(xbus, xpd);
+		return -EINVAL;
 	}
 	SET_PROC_DIRENTRY_OWNER(priv->fxo_info);
 #ifdef	WITH_METERING
@@ -412,14 +415,13 @@
 			proc_xpd_metering_read, xpd);
 	if(!priv->meteringfile) {
 		XPD_ERR(xpd, "Failed to create proc file '%s'\n", PROC_METERING_FNAME);
-		goto err;
+		fxo_proc_remove(xbus, xpd);
+		return -EINVAL;
 	}
 	SET_PROC_DIRENTRY_OWNER(priv->meteringfile);
 #endif
 #endif
 	return 0;
-err:
-	return -EINVAL;
 }
 
 static xpd_t *FXO_card_new(xbus_t *xbus, int unit, int subunit, const xproto_table_t *proto_table,
@@ -1157,6 +1159,7 @@
 
 /*------------------------- DAA Handling --------------------------*/
 
+#ifdef	CONFIG_PROC_FS
 static int proc_fxo_info_read(char *page, char **start, off_t off, int count, int *eof, void *data)
 {
 	int			len = 0;
@@ -1273,6 +1276,7 @@
 		len = 0;
 	return len;
 }
+#endif
 
 #ifdef	WITH_METERING
 static int proc_xpd_metering_read(char *page, char **start, off_t off, int count, int *eof, void *data)

Modified: linux/trunk/drivers/dahdi/xpp/card_fxs.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/xpp/card_fxs.c?view=diff&rev=8877&r1=8876&r2=8877
==============================================================================
--- linux/trunk/drivers/dahdi/xpp/card_fxs.c (original)
+++ linux/trunk/drivers/dahdi/xpp/card_fxs.c Tue Jul 13 03:33:00 2010
@@ -109,9 +109,11 @@
 
 static bool fxs_packet_is_valid(xpacket_t *pack);
 static void fxs_packet_dump(const char *msg, xpacket_t *pack);
+#ifdef CONFIG_PROC_FS
 static int proc_fxs_info_read(char *page, char **start, off_t off, int count, int *eof, void *data);
 #ifdef	WITH_METERING
 static int proc_xpd_metering_write(struct file *file, const char __user *buffer, unsigned long count, void *data);
+#endif
 #endif
 static void start_stop_vm_led(xbus_t *xbus, xpd_t *xpd, lineno_t pos);
 
@@ -356,7 +358,8 @@
 	priv->fxs_info = create_proc_read_entry(PROC_FXS_INFO_FNAME, 0444, xpd->proc_xpd_dir, proc_fxs_info_read, xpd);
 	if(!priv->fxs_info) {
 		XPD_ERR(xpd, "Failed to create proc file '%s'\n", PROC_FXS_INFO_FNAME);
-		goto err;
+		fxs_proc_remove(xbus, xpd);
+		return -EINVAL;
 	}
 	SET_PROC_DIRENTRY_OWNER(priv->fxs_info);
 #ifdef	WITH_METERING
@@ -364,7 +367,8 @@
 	priv->meteringfile = create_proc_entry(PROC_METERING_FNAME, 0200, xpd->proc_xpd_dir);
 	if(!priv->meteringfile) {
 		XPD_ERR(xpd, "Failed to create proc file '%s'\n", PROC_METERING_FNAME);
-		goto err;
+		fxs_proc_remove(xbus, xpd);
+		return -EINVAL;
 	}
 	SET_PROC_DIRENTRY_OWNER(priv->meteringfile);
 	priv->meteringfile->write_proc = proc_xpd_metering_write;
@@ -373,8 +377,6 @@
 #endif
 #endif
 	return 0;
-err:
-	return -EINVAL;
 }
 
 static xpd_t *FXS_card_new(xbus_t *xbus, int unit, int subunit, const xproto_table_t *proto_table,
@@ -1390,6 +1392,7 @@
 
 /*------------------------- SLIC Handling --------------------------*/
 
+#ifdef	CONFIG_PROC_FS
 static int proc_fxs_info_read(char *page, char **start, off_t off, int count, int *eof, void *data)
 {
 	int			len = 0;
@@ -1458,6 +1461,7 @@
 		len = 0;
 	return len;
 }
+#endif
 
 #ifdef	WITH_METERING
 static int proc_xpd_metering_write(struct file *file, const char __user *buffer, unsigned long count, void *data)

Modified: linux/trunk/drivers/dahdi/xpp/xbus-core.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/xpp/xbus-core.c?view=diff&rev=8877&r1=8876&r2=8877
==============================================================================
--- linux/trunk/drivers/dahdi/xpp/xbus-core.c (original)
+++ linux/trunk/drivers/dahdi/xpp/xbus-core.c Tue Jul 13 03:33:00 2010
@@ -56,8 +56,10 @@
 #endif
 
 #ifdef	PROTOCOL_DEBUG
+#ifdef	CONFIG_PROC_FS
 #define	PROC_XBUS_COMMAND	"command"
 static int proc_xbus_command_write(struct file *file, const char __user *buffer, unsigned long count, void *data);
+#endif
 #endif
 
 /* Command line parameters */
@@ -66,16 +68,20 @@
 static DEF_PARM(uint, poll_timeout, 1000, 0644, "Timeout (in jiffies) waiting for units to reply");
 static DEF_PARM_BOOL(rx_tasklet, 0, 0644, "Use receive tasklets");
 
+#ifdef	CONFIG_PROC_FS
 static int xbus_read_proc(char *page, char **start, off_t off, int count, int *eof, void *data);
 #ifdef	OLD_PROC
 static int xbus_read_waitfor_xpds(char *page, char **start, off_t off, int count, int *eof, void *data);
 #endif
+#endif
 static void transport_init(xbus_t *xbus, struct xbus_ops *ops, ushort max_send_size, struct device *transport_device, void *priv);
 static void transport_destroy(xbus_t *xbus);
 
 /* Data structures */
 static spinlock_t		xbuses_lock = SPIN_LOCK_UNLOCKED;
+#ifdef	CONFIG_PROC_FS
 static struct proc_dir_entry	*proc_xbuses = NULL;
+#endif
 
 static struct xbus_desc {
 	xbus_t			*xbus;
@@ -1457,7 +1463,73 @@
 	}
 }
 
-#if CONFIG_PROC_FS
+static bool xpds_done(xbus_t *xbus)
+{
+	struct xbus_workqueue	*worker;
+
+	if (XBUS_IS(xbus, FAIL))
+		return 1;	/* Nothing to wait for */
+	if (!XBUS_IS(xbus, RECVD_DESC))
+		return 1;	/* We are not in the initialization phase */
+	worker = xbus->worker;
+	if (worker->xpds_init_done)
+		return 1;	/* All good */
+	/* Keep waiting */
+	return 0;
+}
+
+int waitfor_xpds(xbus_t *xbus, char *buf)
+{
+	struct xbus_workqueue	*worker;
+	unsigned long		flags;
+	int			ret;
+	int			len = 0;
+
+	/*
+	 * FIXME: worker is created before ?????
+	 * So by now it exists and initialized.
+	 */
+	xbus = get_xbus(__func__, xbus); /* until end of waitfor_xpds_show() */
+	if (!xbus)
+		return -ENODEV;
+	worker = xbus->worker;
+	BUG_ON(!worker);
+	XBUS_DBG(DEVICES, xbus,
+		"Waiting for card initialization of %d XPD's max %d seconds\n",
+		worker->num_units,
+		INITIALIZATION_TIMEOUT/HZ);
+	ret = wait_event_interruptible_timeout(
+		worker->wait_for_xpd_initialization,
+		xpds_done(xbus),
+		INITIALIZATION_TIMEOUT);
+	if (ret == 0) {
+		XBUS_ERR(xbus, "Card Initialization Timeout\n");
+		len = -ETIMEDOUT;
+		goto out;
+	} else if (ret < 0) {
+		XBUS_ERR(xbus, "Card Initialization Interrupted %d\n", ret);
+		len = ret;
+		goto out;
+	} else
+		XBUS_DBG(DEVICES, xbus,
+			"Finished initialization of %d XPD's in %d seconds.\n",
+			worker->num_units_initialized,
+			(INITIALIZATION_TIMEOUT - ret)/HZ);
+	if (XBUS_IS(xbus, FAIL)) {
+		len += sprintf(buf, "FAILED: %s\n", xbus->busname);
+	} else {
+		spin_lock_irqsave(&xbus->lock, flags);
+		len += sprintf(buf, "XPDS_READY: %s: %d/%d\n",
+			xbus->busname,
+			worker->num_units_initialized, worker->num_units);
+		spin_unlock_irqrestore(&xbus->lock, flags);
+	}
+out:
+	put_xbus(__func__, xbus);	/* from start of waitfor_xpds_show() */
+	return len;
+}
+
+#ifdef CONFIG_PROC_FS
 
 static int xbus_fill_proc_queue(char *p, struct xframe_queue *q)
 {
@@ -1552,72 +1624,6 @@
 
 }
 
-static bool xpds_done(xbus_t *xbus)
-{
-	struct xbus_workqueue	*worker;
-
-	if(XBUS_IS(xbus, FAIL))
-		return 1;	/* Nothing to wait for */
-	if(!XBUS_IS(xbus, RECVD_DESC))
-		return 1;	/* We are not in the initialization phase */
-	worker = xbus->worker;
-	if(worker->xpds_init_done)
-		return 1;	/* All good */
-	/* Keep waiting */
-	return 0;
-}
-
-int waitfor_xpds(xbus_t *xbus, char *buf)
-{
-	struct xbus_workqueue	*worker;
-	unsigned long		flags;
-	int			ret;
-	int			len = 0;
-
-	/*
-	 * FIXME: worker is created before ?????
-	 * So by now it exists and initialized.
-	 */
-	xbus = get_xbus(__FUNCTION__, xbus);	/* until end of waitfor_xpds_show() */
-	if(!xbus)
-		return -ENODEV;
-	worker = xbus->worker;
-	BUG_ON(!worker);
-	XBUS_DBG(DEVICES, xbus,
-		"Waiting for card initialization of %d XPD's max %d seconds\n",
-		worker->num_units,
-		INITIALIZATION_TIMEOUT/HZ);
-	ret = wait_event_interruptible_timeout(
-		worker->wait_for_xpd_initialization,
-		xpds_done(xbus),
-		INITIALIZATION_TIMEOUT);
-	if(ret == 0) {
-		XBUS_ERR(xbus, "Card Initialization Timeout\n");
-		len = -ETIMEDOUT;
-		goto out;
-	} else if(ret < 0) {
-		XBUS_ERR(xbus, "Card Initialization Interrupted %d\n", ret);
-		len = ret;
-		goto out;
-	} else
-		XBUS_DBG(DEVICES, xbus,
-			"Finished initialization of %d XPD's in %d seconds.\n",
-			worker->num_units_initialized,
-			(INITIALIZATION_TIMEOUT - ret)/HZ);
-	if(XBUS_IS(xbus, FAIL)) {
-		len += sprintf(buf, "FAILED: %s\n", xbus->busname);
-	} else {
-		spin_lock_irqsave(&xbus->lock, flags);
-		len += sprintf(buf, "XPDS_READY: %s: %d/%d\n",
-			xbus->busname,
-			worker->num_units_initialized, worker->num_units);
-		spin_unlock_irqrestore(&xbus->lock, flags);
-	}
-out:
-	put_xbus(__FUNCTION__, xbus);	/* from start of waitfor_xpds_show() */
-	return len;
-}
-
 #ifdef	OLD_PROC
 static int xbus_read_waitfor_xpds(char *page, char **start, off_t off, int count, int *eof, void *data)
 {

Modified: linux/trunk/drivers/dahdi/xpp/xbus-core.h
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/xpp/xbus-core.h?view=diff&rev=8877&r1=8876&r2=8877
==============================================================================
--- linux/trunk/drivers/dahdi/xpp/xbus-core.h (original)
+++ linux/trunk/drivers/dahdi/xpp/xbus-core.h Tue Jul 13 03:33:00 2010
@@ -135,7 +135,11 @@
 	int			num_units;
 	int			num_units_initialized;
 	wait_queue_head_t	wait_for_xpd_initialization;
+#ifdef	CONFIG_PROC_FS
+#ifdef	OLD_PROC
 	struct proc_dir_entry	*proc_xbus_waitfor_xpds;
+#endif
+#endif
 	spinlock_t		worker_lock;
 };
 

Modified: linux/trunk/drivers/dahdi/xpp/xbus-pcm.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/xpp/xbus-pcm.c?view=diff&rev=8877&r1=8876&r2=8877
==============================================================================
--- linux/trunk/drivers/dahdi/xpp/xbus-pcm.c (original)
+++ linux/trunk/drivers/dahdi/xpp/xbus-pcm.c Tue Jul 13 03:33:00 2010
@@ -1234,7 +1234,7 @@
 #endif
 #endif	/* OLD_PROC */
 
-int xbus_pcm_init(struct proc_dir_entry *toplevel)
+int xbus_pcm_init(void *toplevel)
 {
 	int			ret = 0;
 

Modified: linux/trunk/drivers/dahdi/xpp/xbus-pcm.h
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/xpp/xbus-pcm.h?view=diff&rev=8877&r1=8876&r2=8877
==============================================================================
--- linux/trunk/drivers/dahdi/xpp/xbus-pcm.h (original)
+++ linux/trunk/drivers/dahdi/xpp/xbus-pcm.h Tue Jul 13 03:33:00 2010
@@ -99,7 +99,7 @@
 }
 
 
-int		xbus_pcm_init(struct proc_dir_entry *top);
+int		xbus_pcm_init(void *top);
 void		xbus_pcm_shutdown(void);
 int		send_pcm_frame(xbus_t *xbus, xframe_t *xframe);
 void		pcm_recompute(xpd_t *xpd, xpp_line_t tmp_pcm_mask);

Modified: linux/trunk/drivers/dahdi/xpp/xpp_dahdi.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/xpp/xpp_dahdi.c?view=diff&rev=8877&r1=8876&r2=8877
==============================================================================
--- linux/trunk/drivers/dahdi/xpp/xpp_dahdi.c (original)
+++ linux/trunk/drivers/dahdi/xpp/xpp_dahdi.c Tue Jul 13 03:33:00 2010
@@ -110,12 +110,14 @@
 	return atomic_read(&num_registered_spans);
 }
 
+#ifdef	CONFIG_PROC_FS
 static int xpd_read_proc(char *page, char **start, off_t off, int count, int *eof, void *data);
 #ifdef	OLD_PROC
 static int proc_xpd_ztregister_read(char *page, char **start, off_t off, int count, int *eof, void *data);
 static int proc_xpd_ztregister_write(struct file *file, const char __user *buffer, unsigned long count, void *data);
 static int proc_xpd_blink_read(char *page, char **start, off_t off, int count, int *eof, void *data);
 static int proc_xpd_blink_write(struct file *file, const char __user *buffer, unsigned long count, void *data);
+#endif
 #endif
 
 /*------------------------- XPD Management -------------------------*/
@@ -216,9 +218,11 @@
 #endif
 #endif
 	return 0;
+#ifdef	CONFIG_PROC_FS
 err:
 	xpd_proc_remove(xbus, xpd);
 	return -EFAULT;
+#endif
 }
 
 void xpd_free(xpd_t *xpd)
@@ -831,12 +835,6 @@
  */
 int xpp_open(struct dahdi_chan *chan)
 {
-#if 0
-	xpd_t		*xpd = chan->pvt;
-	xbus_t		*xbus = xpd->xbus;
-	int		pos = chan->chanpos - 1;
-	unsigned long	flags;
-#else
 	xpd_t		*xpd;
 	xbus_t		*xbus;
 	int		pos;
@@ -863,7 +861,6 @@
 		put_xpd(__FUNCTION__, xpd);
 		return -ENODEV;
 	}
-#endif
 	spin_lock_irqsave(&xbus->lock, flags);
 	atomic_inc(&xpd->open_counter);
 	LINE_DBG(DEVICES, xpd, pos, "%s[%d]: open_counter=%d\n",
@@ -1178,7 +1175,8 @@
 
 static int __init xpp_dahdi_init(void)
 {
-	int			ret = 0;
+	int	ret = 0;
+	void	*top = NULL;
 
 	INFO("revision %s MAX_XPDS=%d (%d*%d)\n", XPP_VERSION,
 			MAX_XPDS, MAX_UNIT, MAX_SUBUNIT);
@@ -1193,13 +1191,14 @@
 		ret = -EIO;
 		goto err;
 	}
+	top = xpp_proc_toplevel;
 #endif
 	ret = xbus_core_init();
 	if(ret) {
 		ERR("xbus_core_init failed (%d)\n", ret);
 		goto err;
 	}
-	ret = xbus_pcm_init(xpp_proc_toplevel);
+	ret = xbus_pcm_init(top);
 	if(ret) {
 		ERR("xbus_pcm_init failed (%d)\n", ret);
 		xbus_core_shutdown();

Modified: linux/trunk/drivers/dahdi/xpp/xpp_usb.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/xpp/xpp_usb.c?view=diff&rev=8877&r1=8876&r2=8877
==============================================================================
--- linux/trunk/drivers/dahdi/xpp/xpp_usb.c (original)
+++ linux/trunk/drivers/dahdi/xpp/xpp_usb.c Tue Jul 13 03:33:00 2010
@@ -266,7 +266,9 @@
 static void xpp_receive_callback(USB_PASS_CB(urb));
 static int xusb_probe		(struct usb_interface *interface, const struct usb_device_id *id);
 static void xusb_disconnect	(struct usb_interface *interface);
+#ifdef	CONFIG_PROC_FS
 static int xusb_read_proc(char *page, char **start, off_t off, int count, int *eof, void *data);
+#endif
 
 /*------------------------------------------------------------------*/
 
@@ -656,7 +658,9 @@
 	struct usb_host_interface	*iface_desc = usb_altnum_to_altsetting(interface, 0);
 	xusb_t			*xusb = NULL;
 	struct xusb_model_info	*model_info = (struct xusb_model_info*)id->driver_info;
+#ifdef CONFIG_PROC_FS
 	struct proc_dir_entry	*procsummary = NULL;
+#endif
 	xbus_t			*xbus = NULL;
 	unsigned long		flags;
 	int			retval = -ENOMEM;
@@ -784,11 +788,13 @@
 		KZFREE(xusb);
 	}
 	if(xbus) {
+#ifdef CONFIG_PROC_FS
 		if(procsummary) {
 			XBUS_DBG(PROC, xbus, "Remove proc_entry: " PROC_USBXPP_SUMMARY "\n");
 			remove_proc_entry(PROC_USBXPP_SUMMARY, xbus->proc_xbus_dir);
 			procsummary = NULL;
 		}
+#endif
 		ERR("Calling xbus_disconnect()\n");
 		xbus_disconnect(xbus);		// Blocking until fully deactivated!
 	}




More information about the svn-commits mailing list