FreeBSD/sys/dev/wl/if_wl.c
/*
 * wlbldru:
 *
 *	This function builds the linear linked lists of fd's and
 *	rbd's.  Based on page 4-32 of 1986 Intel microcom handbook.
 *
 */
This function builds the linear linked lists of fd's and
rbd's.  Based on page 4-32 of 1986 Intel microcom handbook.
This function builds the linear linked lists of fd ' s and rbd ' s . Based on page 4 - 32 of 1986 Intel microcom handbook .
static u_short
wlbldru(struct wl_softc *sc)
{
    fd_t	fd;
    rbd_t	rbd;
    u_short	fd_p = OFFSET_RU;
    u_short	rbd_p = OFFSET_RBD;
    int 	i;
    sc->begin_fd = fd_p;
    for (i = 0; i < N_FD; i++) {
	fd.status = 0;
	fd.command = 0;
	fd.link_offset = fd_p + sizeof(fd_t);
	fd.rbd_offset = I82586NULL;
	WL_WRITE_2(sc, PIOR1, fd_p);
	WL_WRITE_MULTI_2(sc, PIOP1, &fd, 8/2);
	fd_p = fd.link_offset;
    }
    fd_p -= sizeof(fd_t);
    sc->end_fd = fd_p;
    WL_WRITE_2(sc, PIOR1, fd_p + 2);
    WL_WRITE_2(sc, PIOP1, AC_CW_EL);	
    WL_WRITE_2(sc, PIOP1, I82586NULL);	
    fd_p = OFFSET_RU;
    WL_WRITE_2(sc, PIOR0, fd_p + 6);	
    WL_WRITE_2(sc, PIOP0, rbd_p);
    WL_WRITE_2(sc, PIOR1, rbd_p);
    for (i = 0; i < N_RBD; i++) {
	rbd.status = 0;
	rbd.buffer_addr = rbd_p + sizeof(rbd_t) + 2;
	rbd.buffer_base = 0;
	rbd.size = RCVBUFSIZE;
	if (i != N_RBD-1) {
	    rbd_p += sizeof(ru_t);
	    rbd.next_rbd_offset = rbd_p;
	} else {
	    rbd.next_rbd_offset = I82586NULL;
	    rbd.size |= AC_CW_EL;
	    sc->end_rbd = rbd_p;
	}
	WL_WRITE_MULTI_2(sc, PIOP1, &rbd, sizeof(rbd_t)/2);
	WL_WRITE_2(sc, PIOR1, rbd_p);
    }
    return sc->begin_fd;
}
static u_short wlbldru ( struct wl_softc * sc ) { fd_t fd ; rbd_t rbd ; u_short fd_p = OFFSET_RU ; u_short rbd_p = OFFSET_RBD ; int i ; sc -> begin_fd = fd_p ; for ( i = 0 ; i < N_FD ; i ++ ) { fd . status = 0 ; fd . command = 0 ; fd . link_offset = fd_p + sizeof ( fd_t ) ; fd . rbd_offset = I82586NULL ; WL_WRITE_2 ( sc , PIOR1 , fd_p ) ; WL_WRITE_MULTI_2 ( sc , PIOP1 , & fd , 8 / 2 ) ; fd_p = fd . link_offset ; } fd_p -= sizeof ( fd_t ) ; sc -> end_fd = fd_p ; WL_WRITE_2 ( sc , PIOR1 , fd_p + 2 ) ; WL_WRITE_2 ( sc , PIOP1 , AC_CW_EL ) ; WL_WRITE_2 ( sc , PIOP1 , I82586NULL ) ; fd_p = OFFSET_RU ; WL_WRITE_2 ( sc , PIOR0 , fd_p + 6 ) ; WL_WRITE_2 ( sc , PIOP0 , rbd_p ) ; WL_WRITE_2 ( sc , PIOR1 , rbd_p ) ; for ( i = 0 ; i < N_RBD ; i ++ ) { rbd . status = 0 ; rbd . buffer_addr = rbd_p + sizeof ( rbd_t ) + 2 ; rbd . buffer_base = 0 ; rbd . size = RCVBUFSIZE ; if ( i != N_RBD - 1 ) { rbd_p += sizeof ( ru_t ) ; rbd . next_rbd_offset = rbd_p ; } else { rbd . next_rbd_offset = I82586NULL ; rbd . size |= AC_CW_EL ; sc -> end_rbd = rbd_p ; } WL_WRITE_MULTI_2 ( sc , PIOP1 , & rbd , sizeof ( rbd_t ) / 2 ) ; WL_WRITE_2 ( sc , PIOR1 , rbd_p ) ; } return sc -> begin_fd ; }
wlbldru:
      This function builds the linear linked lists of fd's and
      rbd's.
wlbldru : This function builds the linear linked lists of fd ' s and rbd ' s .
/* command */ /* link_offset */ /* address of rbd_offset */