1 // SPDX-License-Identifier: GPL-2.0-only
2 // Copyright 2014 Cisco Systems, Inc. All rights reserved.
4 #include <linux/kernel.h>
5 #include <linux/errno.h>
6 #include <linux/types.h>
8 #include <linux/delay.h>
10 #include "vnic_intr.h"
12 void svnic_intr_free(struct vnic_intr
*intr
)
17 int svnic_intr_alloc(struct vnic_dev
*vdev
, struct vnic_intr
*intr
,
23 intr
->ctrl
= svnic_dev_get_res(vdev
, RES_TYPE_INTR_CTRL
, index
);
25 pr_err("Failed to hook INTR[%d].ctrl resource\n",
33 void svnic_intr_init(struct vnic_intr
*intr
, unsigned int coalescing_timer
,
34 unsigned int coalescing_type
, unsigned int mask_on_assertion
)
36 iowrite32(coalescing_timer
, &intr
->ctrl
->coalescing_timer
);
37 iowrite32(coalescing_type
, &intr
->ctrl
->coalescing_type
);
38 iowrite32(mask_on_assertion
, &intr
->ctrl
->mask_on_assertion
);
39 iowrite32(0, &intr
->ctrl
->int_credits
);
42 void svnic_intr_clean(struct vnic_intr
*intr
)
44 iowrite32(0, &intr
->ctrl
->int_credits
);