1 // SPDX-License-Identifier: GPL-2.0-only
3 * Copyright 2008 Cisco Systems, Inc. All rights reserved.
4 * Copyright 2007 Nuova Systems, Inc. All rights reserved.
7 #include <linux/kernel.h>
8 #include <linux/errno.h>
9 #include <linux/types.h>
10 #include <linux/pci.h>
11 #include <linux/delay.h>
13 #include "vnic_intr.h"
15 void vnic_intr_free(struct vnic_intr
*intr
)
20 int vnic_intr_alloc(struct vnic_dev
*vdev
, struct vnic_intr
*intr
,
26 intr
->ctrl
= vnic_dev_get_res(vdev
, RES_TYPE_INTR_CTRL
, index
);
28 printk(KERN_ERR
"Failed to hook INTR[%d].ctrl resource\n",
36 void vnic_intr_init(struct vnic_intr
*intr
, unsigned int coalescing_timer
,
37 unsigned int coalescing_type
, unsigned int mask_on_assertion
)
39 iowrite32(coalescing_timer
, &intr
->ctrl
->coalescing_timer
);
40 iowrite32(coalescing_type
, &intr
->ctrl
->coalescing_type
);
41 iowrite32(mask_on_assertion
, &intr
->ctrl
->mask_on_assertion
);
42 iowrite32(0, &intr
->ctrl
->int_credits
);
45 void vnic_intr_clean(struct vnic_intr
*intr
)
47 iowrite32(0, &intr
->ctrl
->int_credits
);