tx timed out - resetting card

caeiro lcaeiro
Wed Sep 3 14:08:48 PDT 2003


Hi all,

Someone can help?
I'm trying to limit the stations tx period according to a local variable (local->qos_level). So, I have defined a scheduling period (beacon interval) that is splitted into several intervals.In the intervals the station cannot transmit the messages are buffered (tx_buf_qos) and just send when the allowed period begins.
I introduce some code in hostap driver but when I increase tx rate (with 1 Mbps) the card resets and appears the following message:

wlan0 Tx timed out! Resetting card
hostap_cs: wlan0: resetting card

and in dmesg it appears a lot of 

wlan0: TXEXC - status=0x0004 ([Discon]) tx_control=000e
    retry_count=0 tx_rate=0 fc=0x0108 (Data::0 ToDS)
    A1=00:90:d1:08:69:53  A2=00:90:d1:08:69:6e           
    A3=00:90:d1:08:69:53  A4=00:00:00:00:00:00

Here are the modifications I have done:

1- In hostap_ap.c in ap_tx_ret hostap_handle_sta_tx

ret = AP_TX_CONTINUE;
if (local->iw_mode != IW_MODE_MASTER || local->ap == NULL)
/*goto out;*/
{
if (local -> qos_level >= local -> window_on)
{
         if (!skb_queue_empty(&local->tx_buf_qos))
         { 
            if (skb_queue_len(&local->tx_buf_qos) >= MAX_TX_BUFFER_QOS)
            {
              PDEBUG(DEBUG_AP, "%s: No more space in  QOS buffer\n" , local->dev->name);
              ret = AP_TX_DROP;  /* message droped, can't be buffered*/
              goto out;
             }
             skb_queue_tail(&local->tx_buf_qos, skb);    /* message to buffer */
             ret = AP_TX_BUFFERED;  /* don't send the message, is buffered */
             goto out;
           }
           goto out; 
        }
/* Active qos window not STA qos_level, buffer frame for later delivery */
           if (skb_queue_len(&local->tx_buf_qos) >= MAX_TX_BUFFER_QOS) 
           {      
             PDEBUG(DEBUG_AP, "%s: No more space in  QOS buffer\n" , local->dev->name);
             ret = AP_TX_DROP;   /* message droped, can't be buffered*/
             goto out;
              }
              skb_queue_tail(&local->tx_buf_qos, skb); /* message to buffer */
            ret = AP_TX_BUFFERED;  /* don't send the message, is buffered */
              goto out;
      }

2 - In hostap_hw.c in static void prism2_transmit_cb

...
 if (netif_queue_stopped(dev) && local->cnt_msg<MAX_TX_BUF_CARD) {
           /* ready for next TX, so wake up queue that was stopped in
             * prism2_transmit() */
            hostap_netif_wake_queues(dev);
...

2 - In hostap_hw.c in static void prism2_transmit
 
...
if (test_and_set_bit(HOSTAP_BITS_TRANSMIT, &local->bits)) {
            printk(KERN_DEBUG "%s: driver bug - prism2_transmit() called "
                   "when previous TX was pending\n", dev->name);
            return -1;
      }
      if (local->iw_mode==IW_MODE_INFRA)
      {
         local->cnt_msg += 1;
      }

3 - In hostap_hw.c in static void prism2_tx_ev and prism2_txexc

...
struct sk_buff *skb;
if (local->iw_mode == IW_MODE_INFRA)
{
   local->cnt_msg -= 1;
   if (local->qos_level>=local->window_on && local->cnt_msg<MAX_TX_BUF_CARD)
   {  
     if (!test_bit(HOSTAP_BITS_TRANSMIT, &local->bits) && netif_queue_stopped(dev))
     {
        hostap_netif_wake_queues(dev);
     }
     if (!skb_queue_empty(&local->tx_buf_qos))
     {
        skb=skb_dequeue(&local->tx_buf_qos);
        local->from_buf=1;
        dev_queue_xmit(skb);
      }
    }
  }   

 4 - In hostap_hw.c in static void prism2_tx

...
data_txdesc_set:
   if ((to_assoc_ap) || local->from_buf)
   goto skip_ap_processing;

 5 - In hostap_hw.c I have also introduced a function associated yo the timer that control the tx periods:

static void update_qos_window (unsigned long data)
{
    int j;
    int i;
    int updated = 0;
    local_info_t *local = (local_info_t*) data;
    for (i=0; i < IW_NUM_QOS_LEVEL && !updated; i++) 
    {
       /* Is window Active? */
       if  (local->window_on == i) 
       {
           int n = i - 1;
            /* Assign new Window value */
            for (j = 0; j < IW_NUM_QOS_LEVEL && !updated ; j++)
            {
               if (n < 0)
               {
                    n = IW_NUM_QOS_LEVEL - 1;
                }
                if (local->qos_window_val [n] != 0)
                {
                    mod_timer (&local->timer_update_qos_window,jiffies+(local->qos_window_val[n]));
                    local->window_on=n;
                    updated=1;
                 }
                 else
                 {
                     n--;
                 }
              }
              if (local->qos_level == local->window_on)
              {
                  struct sk_buff *skb;
                  if (!skb_queue_empty(&local->tx_buf_qos) && local->cnt_msg<MAX_TX_BUF_CARD)
                  {
                       /* send buffered frames */
                       skb=skb_dequeue(&local->tx_buf_qos);
                       local->from_buf=1;
                       dev_queue_xmit(skb);
                   }
               }
         }
       }
 
 I'm trying to find where the error is. Can someone help me?

Thanks in advance

LC 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.shmoo.com/pipermail/hostap/attachments/20030903/ad8933bf/attachment.htm 



More information about the Hostap mailing list