Hi Jan
Ok, I have learnt how to make patch files.. here is the patch..
+++ rtmac/tdma/tdma_task.c Thu Aug 12 17:05:33 2004
@@ -41,7 +41,7 @@ void tdma_task_shutdown(struct rtmac_tdm
*/
rt_task_wakeup_sleeping(&tdma->tx_task);
#endif
-
+ rt_task_delete(&tdma->tx_task);
/*
* unblock all tasks
*/
@@ -115,7 +115,6 @@ void tdma_task_notify(int rtdev_id)
* wait 'till begin of next period
*/
rtos_task_wait_period();
-
/*
* transmit packet
*/
@@ -181,14 +180,16 @@ void tdma_task_config(int rtdev_id)
rtos_task_wait_period();
}
}
+ tdma_timer_start_sent_test(tdma, TDMA_MASTER_WAIT_TEST);
+ tdma_next_state(tdma, TDMA_MASTER_SENT_TEST);
+
+ while(tdma->flags.shutdown_task == 0)
+ rtos_task_wait_period(); TDMA_DEBUG(3, "RTmac: tdma: %s() shutdown complete\n",__FUNCTION__);
tdma->flags.task_active = 0;
tdma->flags.shutdown_task = 0;- tdma_timer_start_sent_test(tdma, TDMA_MASTER_WAIT_TEST);
- tdma_next_state(tdma, TDMA_MASTER_SENT_TEST);
-
return;out:
I did more testings today and found the TDMA to be working with example/rtmac/rtt .. with jitters of around +/- 5us. I was mislead by the instructions given from './run -h' as shown bellow, thats why i couldn't make it working
rtmac_dev="TDMA0" - rtnet-0.7.0 instead of
sof_sync="rteth0" - rtnet-0.6.2
This is what i changed
+++ ./run Thu Aug 12 18:02:14 2004
@@ -19,8 +19,12 @@ Usage:
run clientp <server-ip> [options...]
run stop
Options:
+ [MAC type]
+ (Conventional UDP)
cycle=<us>
- sof_sync={0|1}
+ (TDMA)
+ cycle=<times> (based on TDMA rtnet.conf 'TDMA_CYCLE')
+ rtmac_dev=<tdma_device> (e.g. TDMA0)
EOF
}As for the 'rtnet' executable.. it was working without any ajustments now.. so i guess it should be alright.
Since now that VNIC is ifconfiged.. how would i write some program that requires communcation with other stations that doesn't have RTAI installed. likewise how would the other stations acknowledge RTnet's existence? because I seem not to be getting anything from ping
p.s. now most of the time i can rmmod rtai_lxrt.o without system crash. I guess it was that rt_task_delete() missing all along for me ? but i am curious why the failure I was having never occured to you ?
p.s2 The university's system managering group seem to be tracking broadcasts from my rtnet server. is there anyway to turn it off ?
Thanks for all the help
Bret
On Wed, 11 Aug 2004, Bret Yen-Ting Lin wrote:
Hi
I am not at school at the moment, will have to wait till tomorrow to send them to you.
I am not familiar with generating patches... but here are the where i made changes with (+) and (-)
1st change..
void tdma_task_shutdown(struct rtmac_tdma *tdma) { if (tdma->flags.task_active == 1) { tdma->flags.shutdown_task = 1;
#if defined(CONFIG_RTAI_24) || defined(CONFIG_RTAI_30) || defined(CONFIG_RTAI_31)
/* RTAI-specific:
* In case the application has stopped the timer, it's
* likely that the tx_task will be waiting forever in
* rt_task_wait_period(). So we wakeup the task here for
* sure.
* -WY-
*/
rt_task_wakeup_sleeping(&tdma->tx_task);
#endif
(+) rt_task_delete(&tdma->tx_task);
/*
* unblock all tasks
*/
rtos_event_broadcast(&tdma->client_tx); /* tdma_task_client() */
}
}
the reason i add rt_task_delete is because upon calling rt_task_init again in tdma_task_change_con it fails to succeed even when task has terminated with 'return'
2nd change....
void tdma_task_config(int rtdev_id)
{
struct rtnet_device *rtdev = (struct rtnet_device *)rtdev_id;
struct rtmac_tdma *tdma = (struct rtmac_tdma *)rtdev->mac_priv->disc_priv;
struct rtskb *skb;
struct tdma_test_msg *test_msg;
void *data = &test_msg;
struct tdma_rt_entry *rt_entry;
struct list_head *lh;
int i, max;
rtos_time_t time_stamp;
max = TDMA_MASTER_MAX_TEST;
list_for_each(lh, &tdma->rt_list) { rt_entry = list_entry(lh, struct tdma_rt_entry, list);
if (rt_entry->state != RT_RCVD_CONF ) goto out;
TDMA_DEBUG(4, "RTmac: tdma: %s() sending %d test packets to %u.%u.%u.%u\n",
__FUNCTION__,max, NIPQUAD(rt_entry->arp.ip));
for (i = 0; i < max; i++) {
if (!(rt_entry->state == RT_RCVD_CONF || rt_entry->state == RT_RCVD_TEST))
goto out;
TDMA_DEBUG(6, "RTmac: tdma: %s() sending test packet #%d to %u.%u.%u.%u\n",
__FUNCTION__,i, NIPQUAD(rt_entry->arp.ip));
/*
* alloc skb, and put counter and time into it....
*/
skb = tdma_make_msg(rtdev, rt_entry->arp.dev_addr, REQUEST_TEST, data);
rt_entry->counter = test_msg->counter = i;
rt_entry->state = RT_SENT_TEST;
rtos_get_time(&time_stamp);
rt_entry->tx = test_msg->tx = rtos_time_to_nanosecs(&time_stamp);
/* * transmit packet */ rtmac_xmit(skb);
/* * wait */ rtos_task_wait_period(); } } (m) tdma_timer_start_sent_test(tdma, TDMA_MASTER_WAIT_TEST); (m) tdma_next_state(tdma, TDMA_MASTER_SENT_TEST);
(+) while(tdma->flags.shutdown_task == 0) (+) rtos_task_wait_period();
(m) TDMA_DEBUG(3, "RTmac: tdma: %s() shutdown complete\n",__FUNCTION__); (m) tdma->flags.task_active = 0; (m) tdma->flags.shutdown_task = 0;
return;
out:
TDMA_DEBUG(0, "RTmac: tdma: *** WARNING *** %s() received not ACK from station %d, IP %u.%u.%u.%u, going into DOWN state\n",
__FUNCTION__,rt_entry->station, NIPQUAD(rt_entry->arp.ip));
tdma_cleanup_master_rt(tdma);
tdma_next_state(tdma, TDMA_DOWN);
tdma->flags.task_active = 1; tdma->flags.shutdown_task = 0; TDMA_DEBUG(2, "RTmac: tdma: %s() shutdown complete\n",__FUNCTION__); }
here i added rtos_task_wait_period() is so tdma_task_shutdown may do its rt_task_delete.. like i mentioned before... rt_task_init fails even if the pointer to the RT_TASK has returned.. i am not sure why this is the case here ( i use rtai-3.0r4 -hal12). and the (m) is so the next state may be perform after end of while loop.
and for the kernel log and tcpdump.. i will try to send it to you tomorrow
Thank you so much in helping out Bret
On Tue, 10 Aug 2004, Jan Kiszka wrote:
Jan Kiszka wrote:
Bret Yen-Ting Lin wrote:
Hi
I am not sure if i have done something wrong with the installation, but I have only managed to get RTmac/TDMA working once which I informed Jan quite few weeks ago. Somehow it never worked since, and I didn't have the time to go into the codes and find out the reason until now.
I increased the TDMA_DEFAULT_DEBUG_LEVEL variable for detailed debugging.
Behavior 1 --------- I seem to be having a problem with task change. [...]
I cannot yet comment on your observation. It's foremost Marc's code, I will ask him for clarification.
Ok, we tried to follow your changes but had problems in understanding where they are exactly or why you did that.
Now, could you create a patch against the CVS or 0.7.0? And we would need the kernel log of the RTnet stations and a trace (e.g. rtcap+tcpdump) of your failing TDMA start-up phase, preferably taken on an uninvolved third station.
Jan
------------------------------------------------------- SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift. http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285 _______________________________________________ RTnet-users mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/rtnet-users

