Yeoh Chun Yeow wrote: > Dear Jan, > > --> Would be nice to see it inside drivers/, and to have the required > changes to the build system done as well - when time permits. Then generate > a true patch from your changes (just like here [1]) and repost.
Please fix your mail client to use standard style for citing the original message! > I have managed to create Makefile for my driver in the RTnet tree and build > successfully in rtnet/driver/at91/ directory but not in the rtnet/ > directory. Could you help on this? I can, but I can't promise when I will be able to do this. Why not look out for patterns: Pick some existing driver, say rt_pcnet32, search for string occurrences of "pcnet32" (case-independent, of course), and duplicate&adopt them to your driver. That's what I would do as well :), as I don't add driver to the tree every day. > > The printk statements in the do_request_cal_job are as follow: > > static struct tdma_job *do_request_cal_job(struct tdma_priv *tdma, struct > tdma_request_cal *job, rtdm_lockctx_t lockctx) > { > struct rt_proc_call *call; > struct tdma_job *prev_job; > int err; > > printk("[Debug] callibration start 1\n"); > > if ((job->period != 1) && > (tdma->current_cycle % job->period != job->phasing)) > return &job->head; > > printk("[Debug] callibration start 2\n"); > > /* remove job until we get a reply */ > __list_del(job->head.entry.prev, job->head.entry.next); > job->head.ref_count--; > prev_job = tdma->current_job = > list_entry(job->head.entry.prev, struct tdma_job, entry); > prev_job->ref_count++; > tdma->job_list_revision++; > > printk("[Debug] callibration start 3\n"); > > rtdm_lock_put_irqrestore(&tdma->lock, lockctx); > > printk("[Debug] callibration start 4 [delay] %lld\n", > tdma->current_cycle_start + job->offset); > > rtdm_task_sleep_until(tdma->current_cycle_start + job->offset); > > printk("[Debug] callibration start 5\n"); > > err = tdma_xmit_request_cal_frame(tdma, > tdma->current_cycle + job->period, job->offset); > > rtdm_lock_get_irqsave(&tdma->lock, lockctx); > > printk("delay: %lld\n", tdma->current_cycle_start + job->offset - > rtdm_clock_read()); > > /* terminate call on error */ > if (err < 0) { > call = tdma->calibration_call; > tdma->calibration_call = NULL; > > if (call) { > rtdm_lock_put_irqrestore(&tdma->lock, lockctx); > rtpc_complete_call(call, err); > rtdm_lock_get_irqsave(&tdma->lock, lockctx); > } > } > > return prev_job; > } > Result of Kernel Message: > [Debug] Req Cal Stage > [Debug] callibration start 1 > [Debug] callibration start 2 > [Debug] callibration start 3 > [Debug] callibration start 4 [delay] 1189571585923819617 Ah, that's more logical than the earlier report! > RTcfg: rtcfg_do_main_event() rtdev=1, event=RTCFG_FRM_STAGE_1_CFG, > state=RTCFG_MAIN_CLIENT_1 > > Is this because of the delay is too long? Any ideas? That delay is definitely too long (1 billion seconds...). Please look closer which component of the calculation is borken. I guess it is current_cycle_start, but it may also be the job offset. Then look at their origin: job offset should come unmodified from the ioctl, ie. tdmacfg, current_cycle_start is calculated here [1]. Regarding the latter: it will be interesting to check what timestamp your driver took for the related Sync frame. Please also check this. Thanks, Jan [1]http://www.rts.uni-hannover.de/rtnet/lxr/source/stack/rtmac/tdma/tdma_proto.c#246 PS: Already thought about subscribing to rtnet-users...?
signature.asc
Description: OpenPGP digital signature
------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________ RTnet-users mailing list RTnet-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rtnet-users