List Info

Thread: tzafrir: branch 1.4 r3073 - /branches/1.4/ztdummy.c




tzafrir: branch 1.4 r3073 - /branches/1.4/ztdummy.c
user name
2007-09-21 17:14:34
Author: tzafrir
Date: Fri Sep 21 17:14:33 2007
New Revision: 3073

URL: http://svn.digium.com/view/zaptel?view=rev&rev=3073
Log:
Sort out print messages in ztdummy:
* Proper priority to every message.
* Remove a useless global.

Modified:
    branches/1.4/ztdummy.c

Modified: branches/1.4/ztdummy.c
URL: http://sv
n.digium.com/view/zaptel/branches/1.4/ztdummy.c?view=diff&am
p;rev=3073&r1=3072&r2=3073
============================================================
==================
--- branches/1.4/ztdummy.c (original)
+++ branches/1.4/ztdummy.c Fri Sep 21 17:14:33 2007
 -124,7
+124,6 
 /* Old UCHI stuff */
 static    uhci_desc_t  *td;
 static    uhci_t *s;
-static int check_int = 0;
 static int monitor = 0;
 
 /* exported kernel symbols */
 -154,12
+153,12 
 static void update_rtc_rate(struct ztdummy *ztd)
 {
 	if (((rtc_rate & (rtc_rate - 1)) != 0) || (rtc_rate
> 8192) || (rtc_rate < 2)) {
-		printk("Invalid RTC rate %d specifiedn",
rtc_rate);
+		printk(KERN_NOTICE "Invalid RTC rate %d
specifiedn", rtc_rate);
 		rtc_rate = current_rate;	/* Set default RTC rate */
 	}
 	if (!rtc_rate || (rtc_rate != current_rate)) {
 		rtc_control(&ztd->rtc_task, RTC_IRQP_SET,
current_rate = (rtc_rate ? rtc_rate : 1024));	/* 1024 Hz */
-		printk("ztdummy: RTC rate is %dn", rtc_rate);
+		printk(KERN_INFO "ztdummy: RTC rate is %dn",
rtc_rate);
 		ztd->counter = 0;
 	}
 }
 -247,11
+246,14 
 
 	status = inw (io_addr + USBSTS);
 	if (status != 0)  {	/* interrupt from our USB port */
+		static int check_int = 0;
 		zt_receive(&ztd->span);
 		zt_transmit(&ztd->span);
-		if (monitor && (check_int==0)) {      /* for
testing if interrupt gets triggered*/
+		/* TODO: What's the relation between monitor and
+		 * DEBUG_TICKS */
+		if (monitor && check_int) {
 			check_int = 1;
-			printk("ztdummy: interrupt triggered n");    

+			printk(KERN_NOTICE "ztdummy: interrupt triggered
n");     
 		}   
 	}
 	return;
 -292,26
+294,26 
 #endif
 	
 	if (uhci_devices==NULL) {
-		printk ("ztdummy: Uhci_devices pointer
error.n");
+		printk (KERN_ERR "ztdummy: Uhci_devices pointer
error.n");
 		return -ENODEV;
 	}
 	s=*uhci_devices;	/* uhci device */
 	if (s==NULL) {
-		printk ("ztdummy: No uhci_device found.n");
+		printk (KERN_ERR "ztdummy: No uhci_device
found.n");
 		return -ENODEV;
 	}
 #endif
 
 	ztd = kmalloc(sizeof(struct ztdummy), GFP_KERNEL);
 	if (ztd == NULL) {
-		printk("ztdummy: Unable to allocate
memoryn");
+		printk(KERN_ERR "ztdummy: Unable to allocate
memoryn");
 		return -ENOMEM;
 	}
 
 	memset(ztd, 0x0, sizeof(struct ztdummy));
 
 	if (ztdummy_initialize(ztd)) {
-		printk("ztdummy: Unable to intialize zaptel
drivern");
+		printk(KERN_ERR "ztdummy: Unable to intialize zaptel
drivern");
 		kfree(ztd);
 		return -ENODEV;
 	}
 -324,7
+326,7 
 	ztd->rtc_task.private_data = ztd;
 	err = rtc_register(&ztd->rtc_task);
 	if (err < 0) {
-		printk("ztdummy: Unable to register zaptel rtc
drivern");
+		printk(KERN_ERR "ztdummy: Unable to register zaptel
rtc drivern");
 		zt_unregister(&ztd->span);
 		kfree(ztd);
 		return err;
 -336,16
+338,16 
 	rtc_control(&ztd->rtc_task, RTC_PIE_ON, 0);
 	tasklet_init(&ztd_tlet, ztd_tasklet, 0);
 #elif defined(USE_HIGHRESTIMER)
-	printk("ztdummy: Trying to load High Resolution
Timern");
+	printk(KERN_DEBUG "ztdummy: Trying to load High
Resolution Timern");
 	hrtimer_init(&zaptimer, CLOCK_MONOTONIC,
HRTIMER_MODE_REL);
-	printk("ztdummy: Initialized High Resolution
Timern");
+	printk(KERN_DEBUG "ztdummy: Initialized High
Resolution Timern");
 
 	/* Set timer callback function */
 	zaptimer.function = ztdummy_hr_int;
 
-	printk("ztdummy: Starting High Resolution
Timern");
+	printk(KERN_DEBUG "ztdummy: Starting High Resolution
Timern");
 	hrtimer_start(&zaptimer, ktime_set(0, ZAPTEL_TIME_NS),
HRTIMER_MODE_REL);
-	printk("ztdummy: High Resolution Timer started, good
to gon");
+	printk(KERN_INFO "ztdummy: High Resolution Timer
started, good to gon");
 #else
 	init_timer(&timer);
 	timer.function = ztdummy_timer;
 -375,7
+377,7 
 #endif	
 
 	if (debug)
-		printk("ztdummy: init() finishedn");
+		printk(KERN_DEBUG "ztdummy: init()
finishedn");
 	return 0;
 }
 


_______________________________________________
--Bandwidth and Colocation Provided by http://www.api-digital.c
om--

zaptel-commits mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/zaptel-commits

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )