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

Reply via email to