FreeBSD/sys/dev/wl/if_wl.c
/*
 * wlrequeue:
 *
 *	This routine puts rbd's used in the last receive back onto the
 *	free list for the next receive.
 *
 */
This routine puts rbd's used in the last receive back onto the
free list for the next receive.
This routine puts rbd ' s used in the last receive back onto the free list for the next receive .
static int
wlrequeue(struct wl_softc *sc, u_short fd_p)
{
    fd_t		fd;
    u_short		l_rbdp, f_rbdp, rbd_offset;
    WL_WRITE_2(sc, PIOR0, fd_p + 6);
    rbd_offset = WL_READ_2(sc, PIOP0);
    if ((f_rbdp = rbd_offset) != I82586NULL) {
	l_rbdp = f_rbdp;
	for (;;) {
	    WL_WRITE_2(sc, PIOR0, l_rbdp + 0);	
	    if (WL_READ_2(sc, PIOP0) & RBD_SW_EOF)
		break;
	    WL_WRITE_2(sc, PIOP0, 0);
	    WL_WRITE_2(sc, PIOR0, l_rbdp + 2);	
	    if ((l_rbdp = WL_READ_2(sc, PIOP0)) == I82586NULL)
		break;
	}
	WL_WRITE_2(sc, PIOP0, 0);
	WL_WRITE_2(sc, PIOR0, l_rbdp + 2);		
	WL_WRITE_2(sc, PIOP0, I82586NULL);
	WL_WRITE_2(sc, PIOR0, l_rbdp + 8);		
	WL_WRITE_2(sc, PIOP0, WL_READ_2(sc, PIOP0) | AC_CW_EL);
	WL_WRITE_2(sc, PIOR0, sc->end_rbd + 2);
	WL_WRITE_2(sc, PIOP0, f_rbdp);		
	WL_WRITE_2(sc, PIOR0, sc->end_rbd + 8);	
	WL_WRITE_2(sc, PIOP0, WL_READ_2(sc, PIOP0) & ~AC_CW_EL);
	sc->end_rbd = l_rbdp;
    }
    fd.status = 0;
    fd.command = AC_CW_EL;
    fd.link_offset = I82586NULL;
    fd.rbd_offset = I82586NULL;
    WL_WRITE_2(sc, PIOR1, fd_p);
    WL_WRITE_MULTI_2(sc, PIOP1, &fd, 8/2);
    WL_WRITE_2(sc, PIOR1, sc->end_fd + 2);	
    WL_WRITE_2(sc, PIOP1, 0);		
    WL_WRITE_2(sc, PIOP1, fd_p);		
    sc->end_fd = fd_p;
    return 1;
}
static int wlrequeue ( struct wl_softc * sc , u_short fd_p ) { fd_t fd ; u_short l_rbdp , f_rbdp , rbd_offset ; WL_WRITE_2 ( sc , PIOR0 , fd_p + 6 ) ; rbd_offset = WL_READ_2 ( sc , PIOP0 ) ; if ( ( f_rbdp = rbd_offset ) != I82586NULL ) { l_rbdp = f_rbdp ; for ( ; ; ) { WL_WRITE_2 ( sc , PIOR0 , l_rbdp + 0 ) ; if ( WL_READ_2 ( sc , PIOP0 ) & RBD_SW_EOF ) break ; WL_WRITE_2 ( sc , PIOP0 , 0 ) ; WL_WRITE_2 ( sc , PIOR0 , l_rbdp + 2 ) ; if ( ( l_rbdp = WL_READ_2 ( sc , PIOP0 ) ) == I82586NULL ) break ; } WL_WRITE_2 ( sc , PIOP0 , 0 ) ; WL_WRITE_2 ( sc , PIOR0 , l_rbdp + 2 ) ; WL_WRITE_2 ( sc , PIOP0 , I82586NULL ) ; WL_WRITE_2 ( sc , PIOR0 , l_rbdp + 8 ) ; WL_WRITE_2 ( sc , PIOP0 , WL_READ_2 ( sc , PIOP0 ) | AC_CW_EL ) ; WL_WRITE_2 ( sc , PIOR0 , sc -> end_rbd + 2 ) ; WL_WRITE_2 ( sc , PIOP0 , f_rbdp ) ; WL_WRITE_2 ( sc , PIOR0 , sc -> end_rbd + 8 ) ; WL_WRITE_2 ( sc , PIOP0 , WL_READ_2 ( sc , PIOP0 ) & ~ AC_CW_EL ) ; sc -> end_rbd = l_rbdp ; } fd . status = 0 ; fd . command = AC_CW_EL ; fd . link_offset = I82586NULL ; fd . rbd_offset = I82586NULL ; WL_WRITE_2 ( sc , PIOR1 , fd_p ) ; WL_WRITE_MULTI_2 ( sc , PIOP1 , & fd , 8 / 2 ) ; WL_WRITE_2 ( sc , PIOR1 , sc -> end_fd + 2 ) ; WL_WRITE_2 ( sc , PIOP1 , 0 ) ; WL_WRITE_2 ( sc , PIOP1 , fd_p ) ; sc -> end_fd = fd_p ; return 1 ; }
wlrequeue:
      This routine puts rbd's used in the last receive back onto the
      free list for the next receive.
wlrequeue : This routine puts rbd ' s used in the last receive back onto the free list for the next receive .
/* address of status */ /* next_rbd_offset */ /* next_rbd_offset */ /* address of size */ /* end_rbd->next_rbd_offset */ /* size */ /* addr of command */ /* command = 0 */ /* end_fd->link_offset = fd_p */