@@ -76,11 +76,18 @@ int dev_ims_prepare(struct irq_domain *domain, struct device *dev, int nvec,
}
EXPORT_SYMBOL_GPL(dev_ims_prepare);
+void dev_ims_set_desc(msi_alloc_info_t *arg, struct msi_desc *desc)
+{
+ arg->msi_hwirq = dev_ims_calc_hwirq(desc);
+}
+EXPORT_SYMBOL_GPL(dev_ims_set_desc);
+
#ifdef CONFIG_IRQ_REMAP
static struct msi_domain_ops dev_ims_domain_ops = {
.get_hwirq = msi_get_hwirq,
.msi_prepare = dev_ims_prepare,
+ .set_desc = dev_ims_set_desc,
};
static struct irq_chip dev_ims_ir_controller = {
@@ -22,6 +22,15 @@ struct dev_ims_priv_data {
static DEFINE_IDA(dev_ims_devid_ida);
+irq_hw_number_t dev_ims_calc_hwirq(struct msi_desc *desc)
+{
+ u32 devid;
+
+ devid = desc->dev_ims.priv->devid;
+
+ return (devid << (32 - DEVIMS_ID_SHIFT)) | desc->dev_ims.ims_index;
+}
+
u32 __dev_ims_desc_mask_irq(struct msi_desc *desc, u32 flag)
{
u32 mask_bits = desc->dev_ims.masked;
@@ -237,6 +237,7 @@ void dev_ims_teardown_irqs(struct device *dev);
void dev_ims_restore_irqs(struct device *dev);
int dev_ims_alloc_irqs(struct device *dev, int nvec, struct dev_ims_ops *ops);
void dev_ims_free_irqs(struct device *dev);
+irq_hw_number_t dev_ims_calc_hwirq(struct msi_desc *desc);
/*
* The arch hooks to setup up msi irqs. Those functions are