[svn-commits] fjoe: freebsd/trunk r9191 - in /freebsd/trunk: ./ drivers/dahdi/wcb4xxp/base.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Aug 25 05:33:13 CDT 2010


Author: fjoe
Date: Wed Aug 25 05:33:12 2010
New Revision: 9191

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=9191
Log:
Merge from linux trunk up to rev. 9190

Modified:
    freebsd/trunk/   (props changed)
    freebsd/trunk/drivers/dahdi/wcb4xxp/base.c

Propchange: freebsd/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Aug 25 05:33:12 2010
@@ -1,1 +1,1 @@
-/linux/trunk:7418-9172
+/linux/trunk:7418-9190

Modified: freebsd/trunk/drivers/dahdi/wcb4xxp/base.c
URL: http://svnview.digium.com/svn/dahdi/freebsd/trunk/drivers/dahdi/wcb4xxp/base.c?view=diff&rev=9191&r1=9190&r2=9191
==============================================================================
--- freebsd/trunk/drivers/dahdi/wcb4xxp/base.c (original)
+++ freebsd/trunk/drivers/dahdi/wcb4xxp/base.c Wed Aug 25 05:33:12 2010
@@ -1240,6 +1240,7 @@
 		b = (port & V_SYNC_SEL_MASK) | V_MAN_SYNC;
 
 	b4xxp_setreg8(b4, R_ST_SYNC, b);
+	b4->syncspan = port;
 }
 
 /*
@@ -1266,6 +1267,41 @@
 	else
 		return src;
 }
+
+#if !defined(__FreeBSD__) && (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 18))
+static ssize_t b4_timing_master_show(struct device *dev,
+				     struct device_attribute *attr,
+				     char *buf)
+{
+	struct b4xxp *b4 = dev_get_drvdata(dev);
+	return sprintf(buf, "%d\n", b4->syncspan);
+}
+
+static DEVICE_ATTR(timing_master, 0400, b4_timing_master_show, NULL);
+
+static void create_sysfs_files(struct b4xxp *b4)
+{
+	int ret;
+	ret = device_create_file(b4->dev,
+				 &dev_attr_timing_master);
+	if (ret) {
+		dev_info(b4->dev,
+			"Failed to create device attributes.\n");
+	}
+}
+
+static void remove_sysfs_files(struct b4xxp *b4)
+{
+	device_remove_file(b4->dev,
+			   &dev_attr_timing_master);
+}
+
+#else
+
+static inline void create_sysfs_files(struct b4xxp *b4) { return; }
+static inline void remove_sysfs_files(struct b4xxp *b4) { return; }
+
+#endif /* LINUX_KERNEL > 2.6.18 */
 
 /*
  * allocates memory and pretty-prints a given S/T state engine state to it.
@@ -1967,6 +2003,8 @@
 	flush_pci();
 
 	udelay(100);				/* wait a bit for clock to settle */
+
+	create_sysfs_files(b4);
 }
 
 /*
@@ -2951,6 +2989,7 @@
 	}
 
 	b4xxp_init_stage1(b4);
+	remove_sysfs_files(b4);
 
 	spin_lock_destroy(&b4->reglock);
 	spin_lock_destroy(&b4->seqlock);




More information about the svn-commits mailing list