FreeBSD/sys/dev/ixl/ixl_pf_main.c
/*********************************************************************
 *
 *  Allocate memory for the VSI (virtual station interface) and their
 *  associated queues, rings and the descriptors associated with each,
 *  called only once at attach.
 *
 **********************************************************************/
Allocate memory for the VSI (virtual station interface) and their
associated queues, rings and the descriptors associated with each,
called only once at attach.
Allocate memory for the VSI ( virtual station interface ) and their associated queues rings and the descriptors associated with each called only once at attach .
int
ixl_setup_stations(struct ixl_pf *pf)
{
	device_t		dev = pf->dev;
	struct ixl_vsi		*vsi;
	struct ixl_queue	*que;
	int			error = 0;
	vsi = &pf->vsi;
	vsi->back = (void *)pf;
	vsi->hw = &pf->hw;
	vsi->id = 0;
	vsi->num_vlans = 0;
	vsi->back = pf;
        if (!(vsi->queues =
            (struct ixl_queue *) malloc(sizeof(struct ixl_queue) *
            vsi->num_queues, M_DEVBUF, M_NOWAIT | M_ZERO))) {
                device_printf(dev, "Unable to allocate queue memory\n");
                error = ENOMEM;
                return (error);
        }
	for (int i = 0; i < vsi->num_queues; i++) {
		que = &vsi->queues[i];
		error = ixl_setup_queue(que, pf, i);
		if (error)
			return (error);
	}
	return (0);
}
int ixl_setup_stations ( struct ixl_pf * pf ) { device_t dev = pf -> dev ; struct ixl_vsi * vsi ; struct ixl_queue * que ; int error = 0 ; vsi = & pf -> vsi ; vsi -> back = ( void * ) pf ; vsi -> hw = & pf -> hw ; vsi -> id = 0 ; vsi -> num_vlans = 0 ; vsi -> back = pf ; if ( ! ( vsi -> queues = ( struct ixl_queue * ) malloc ( sizeof ( struct ixl_queue ) * vsi -> num_queues , M_DEVBUF , M_NOWAIT | M_ZERO ) ) ) { device_printf ( dev , " \n " ) ; error = ENOMEM ; return ( error ) ; } for ( int i = 0 ; i < vsi -> num_queues ; i ++ ) { que = & vsi -> queues [ i ] ; error = ixl_setup_queue ( que , pf , i ) ; if ( error ) return ( error ) ; } return ( 0 ) ; }
Allocate memory for the VSI (virtual station interface) and their
  associated queues, rings and the descriptors associated with each,
  called only once at attach.
Allocate memory for the VSI ( virtual station interface ) and their associated queues rings and the descriptors associated with each called only once at attach .
/* Get memory for the station queues */