[En-Nut-Discussion] PPP on Ethernut

Dušan dferbas at solarmonitor.cz
Mon Feb 15 19:05:49 CET 2021


Hi Ole,

your commit [r5472] <https://sourceforge.net/p/ethernut/code/5472/> to 
Ethernut in 2013 added real file descriptors and select().
Reason for this was probably the select implementation, which cannot be 
done with NUTFILE * file descriptors.

I think you forgot to modify the net/pppout.c.
Strange is noone complained about it, however it was made in 2013 and 
Harald extended hdlc driver for 2 devices in [r5135] 
<https://sourceforge.net/p/ethernut/code/5135/>.

---
My fix follows, but crt/nut_io.h should be referenced for the __fds[] array.
Do you have any advice, how to include it outside crt subdirectory?

Do you recommend to add a getter in the crt directory?
Or can we stay just with a separate extern as you did in the 
os/nutinit.c and as it is below?

54a55,57
 > /* Filedescriptor list */
 > extern NUTFILE *__fds[FOPEN_MAX];    //defined in crt/nut_io.h
 >
64d66
<
114c116,119
<     if (nif->if_send && (*nif->if_send) ((((NUTFILE *) (uintptr_t) 
(dcb->dcb_fd)))->nf_dev, nb) == 0) {
---
 > //    if (nif->if_send && (*nif->if_send) ((((NUTFILE *) (uintptr_t) 
(dcb->dcb_fd)))->nf_dev, nb) == 0) {
 >
 >     NUTDEVICE *ll_dev =  __fds[dcb->dcb_fd]->nf_dev;
 >     if (nif->if_send && (*nif->if_send) (ll_dev, nb) == 0) {

-- 

*Dušan*



More information about the En-Nut-Discussion mailing list