lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-users] RE: [lwip] cs8900a driver - Wait for buffer space (Tx)


From: Michael Portmann
Subject: [lwip-users] RE: [lwip] cs8900a driver - Wait for buffer space (Tx)
Date: Thu, 09 Jan 2003 00:19:39 -0000

Tom,

   I think you shouldn't wait at all. What you should do is queue the packet 
internally and next time you get to try in your loop, see if you can send it 
then.

  The best time to try again would probably be just after reception of a packet 
because it is at that time you are likely to have free space in the chip for 
your transmission.

  I have not implemented this yet, but it is likely I will need to. I am using 
16 bit mode, but polled IO which is effectively the same as what you should be 
doing (My understanding is that the CS8900 interrupt mechanism does not work 
properly in 8 bit more)

  I started my code based on Leon Woestenberg's driver. Apart from this having 
a serious bug, and what he does is flush out any completly received packets so 
that there is space for the transmit. Whilst this does work it does cause my 
code some problems..

  I have written a new httpd server that supports CGI functions (with limited 
MIME parsing). The reason for this is to be able to upload large files to the 
web server, probably not something that been done with lwIP yet.

  The problem in using Leon's method (dropping RX'ed packets) is that if I 
determine that I don't want the file being uploaded and respond immediately 
then close the connection, the FIN/ACK packet gets lost because the other end 
is still sending a lot of data.

  Opera works ok, because it identifies that the page has been received, 
Netscape and IE sit there showing nothing and then timeout with an error ! All 
because the FIN packet got lost.

  My current workaround to this is to limit the TCP_WND to 1024 (less than the 
4k in the CS8900) in the hope that RXed packets will not need to be dropped.

Regards,
Michael Portmann

HYDRA Electronic Design Solutions Pty Ltd
140 Ashley Street, Underdale, SA 5032.
Ph. +61 8 8234-0477
Fx. +61 8 8234-1840



> -----Original Message-----
> From: Tom Hayes [mailto:address@hidden
> Sent: Friday, 2 August 2002 12:16 AM
> To: address@hidden
> Subject: [lwip] cs8900a driver - Wait for buffer space (Tx)
> 
> 
> Hi to all,
> 
> Can somebody tell me, how long should it be expected to 
> return to chek if 
> the buffer already has available space? for to transmit a 
> frame; y driver is 
> 8 bit mode.
> 
> for(i = 0; i < 8 ; i++) {
>     PACKETPP = 0x0138; /*  Bus Status Register   -
>                          bit7 TxBidErr, bit 8 Rdy4TxNow */
>     event = PPDATA;
>     if(event & 0x0100)
>       break ;
> 
>     /* Wait for buffer space to become avaliable. */
>     KS_unlock(CS8900_R);
>     KS_delay ((TASK)0,(TICKS)100/CLKTICK);
>     KS_lockw(CS8900_R);
>   }
> 
> Thank's advance.
> 
> Tom
> ****************************
> UNIVERSIDAD DE ANTIOQUIA
> DEPARTAMENTO DE ELECTRÓNICA
> MEDELLÍN - COLOMBIA
> ****************************
> 
> _________________________________________________________________
> MSN. Más Útil cada Día. http://www.msn.es/intmap/
> 
> [This message was sent through the lwip discussion list.]
> 
[This message was sent through the lwip discussion list.]




reply via email to

[Prev in Thread] Current Thread [Next in Thread]