FreeBSD/sys/dev/ixl/ixl_pf_main.c
/*********************************************************************
 *
 *  Setup MSIX Interrupt resources and handlers for the VSI
 *
 **********************************************************************/
Setup MSIX Interrupt resources and handlers for the VSI
Setup MSIX Interrupt resources and handlers for the VSI
int
ixl_assign_vsi_legacy(struct ixl_pf *pf)
{
	device_t        dev = pf->dev;
	struct 		ixl_vsi *vsi = &pf->vsi;
	struct		ixl_queue *que = vsi->queues;
	int 		error, rid = 0;
	if (pf->msix == 1)
		rid = 1;
	pf->res = bus_alloc_resource_any(dev, SYS_RES_IRQ,
	    &rid, RF_SHAREABLE | RF_ACTIVE);
	if (pf->res == NULL) {
		device_printf(dev, "Unable to allocate"
		    " bus resource: vsi legacy/msi interrupt\n");
		return (ENXIO);
	}
	error = bus_setup_intr(dev, pf->res,
	    INTR_TYPE_NET | INTR_MPSAFE, NULL,
	    ixl_intr, pf, &pf->tag);
	if (error) {
		pf->res = NULL;
		device_printf(dev, "Failed to register legacy/msi handler\n");
		return (error);
	}
	bus_describe_intr(dev, pf->res, pf->tag, "irq0");
	TASK_INIT(&que->tx_task, 0, ixl_deferred_mq_start, que);
	TASK_INIT(&que->task, 0, ixl_handle_que, que);
	que->tq = taskqueue_create_fast("ixl_que", M_NOWAIT,
	    taskqueue_thread_enqueue, &que->tq);
	taskqueue_start_threads(&que->tq, 1, PI_NET, "%s que",
	    device_get_nameunit(dev));
	TASK_INIT(&pf->adminq, 0, ixl_do_adminq, pf);
	pf->tq = taskqueue_create_fast("ixl_adm", M_NOWAIT,
	    taskqueue_thread_enqueue, &pf->tq);
	taskqueue_start_threads(&pf->tq, 1, PI_NET, "%s adminq",
	    device_get_nameunit(dev));
	return (0);
}
int ixl_assign_vsi_legacy ( struct ixl_pf * pf ) { device_t dev = pf -> dev ; struct ixl_vsi * vsi = & pf -> vsi ; struct ixl_queue * que = vsi -> queues ; int error , rid = 0 ; if ( pf -> msix == 1 ) rid = 1 ; pf -> res = bus_alloc_resource_any ( dev , SYS_RES_IRQ , & rid , RF_SHAREABLE | RF_ACTIVE ) ; if ( pf -> res == NULL ) { device_printf ( dev , " " " \n " ) ; return ( ENXIO ) ; } error = bus_setup_intr ( dev , pf -> res , INTR_TYPE_NET | INTR_MPSAFE , NULL , ixl_intr , pf , & pf -> tag ) ; if ( error ) { pf -> res = NULL ; device_printf ( dev , " \n " ) ; return ( error ) ; } bus_describe_intr ( dev , pf -> res , pf -> tag , " " ) ; TASK_INIT ( & que -> tx_task , 0 , ixl_deferred_mq_start , que ) ; TASK_INIT ( & que -> task , 0 , ixl_handle_que , que ) ; que -> tq = taskqueue_create_fast ( " " , M_NOWAIT , taskqueue_thread_enqueue , & que -> tq ) ; taskqueue_start_threads ( & que -> tq , 1 , PI_NET , " " , device_get_nameunit ( dev ) ) ; TASK_INIT ( & pf -> adminq , 0 , ixl_do_adminq , pf ) ; pf -> tq = taskqueue_create_fast ( " " , M_NOWAIT , taskqueue_thread_enqueue , & pf -> tq ) ; taskqueue_start_threads ( & pf -> tq , 1 , PI_NET , " " , device_get_nameunit ( dev ) ) ; return ( 0 ) ; }
Setup MSIX Interrupt resources and handlers for the VSI
Setup MSIX Interrupt resources and handlers for the VSI
/* Set the handler function */