comparison packages/io/eth/current/src/net/eth_drv.c @ 130:eb9fd8c04db3 ecos-sw-2000-10-23

Merge from eCos master repository on 2000-10-23-17:01:37-BST
author jlarmour
date Mon, 23 Oct 2000 17:10:57 +0000
parents 0c2b7be0d798
children 2e9a636d9de9
comparison
equal deleted inserted replaced
129:605a0fc6f385 130:eb9fd8c04db3
603 #endif 603 #endif
604 604
605 /* Pull packet off interface. */ 605 /* Pull packet off interface. */
606 MGETHDR(m, M_DONTWAIT, MT_DATA); 606 MGETHDR(m, M_DONTWAIT, MT_DATA);
607 if (m == 0) { 607 if (m == 0) {
608 #ifdef CYGPKG_IO_ETH_DRIVERS_WARN_NO_MBUFS
608 diag_printf("warning: eth_recv out of MBUFs\n"); 609 diag_printf("warning: eth_recv out of MBUFs\n");
610 #endif
609 } 611 }
610 612
611 // Set up buffers 613 // Set up buffers
612 // Unload ethernet header separately so IP/UDP/TCP headers are aligned 614 // Unload ethernet header separately so IP/UDP/TCP headers are aligned
613 sg_list[0].buf = (CYG_ADDRESS)eh; 615 sg_list[0].buf = (CYG_ADDRESS)eh;
634 while (total_len > 0) { 636 while (total_len > 0) {
635 if (top) { 637 if (top) {
636 MGET(m, M_DONTWAIT, MT_DATA); 638 MGET(m, M_DONTWAIT, MT_DATA);
637 if (m == 0) { 639 if (m == 0) {
638 m_freem(top); 640 m_freem(top);
639 panic("out of MBUFs [2]"); 641 #ifdef CYGPKG_IO_ETH_DRIVERS_WARN_NO_MBUFS
642 diag_printf("out of MBUFs [2]");
643 #endif
644 sg_list[sg_len].buf = (CYG_ADDRESS)0;
645 sg_list[sg_len].len = 0;
646 sg_len = 1;
647 break;
640 } 648 }
641 mlen = MLEN; 649 mlen = MLEN;
642 } 650 }
643 if (total_len >= MINCLSIZE) { 651 if (total_len >= MINCLSIZE) {
644 MCLGET(m, M_DONTWAIT); 652 MCLGET(m, M_DONTWAIT);
645 if ((m->m_flags & M_EXT) == 0) { 653 if ((m->m_flags & M_EXT) == 0) {
646 m_freem(top); 654 m_freem(top);
655 #ifdef CYGPKG_IO_ETH_DRIVERS_WARN_NO_MBUFS
647 diag_printf("warning: eth_recv out of MBUFs\n"); 656 diag_printf("warning: eth_recv out of MBUFs\n");
657 #endif
648 sg_list[sg_len].buf = (CYG_ADDRESS)0; 658 sg_list[sg_len].buf = (CYG_ADDRESS)0;
649 sg_list[sg_len].len = min(total_len, MCLBYTES); 659 sg_list[sg_len].len = min(total_len, MCLBYTES);
650 sg_len++; 660 sg_len++;
651 top = 0; 661 top = 0;
652 break; 662 break;