{
if ( c->u.pirq == add->u.pirq )
{
+ if ( c->sid[0] == sid )
+ break;
printk("%s: Duplicate pirq %d\n", __FUNCTION__, add->u.pirq);
- ret = -EINVAL;
+ ret = -EEXIST;
break;
}
c = c->next;
if (c && c->u.ioport.low_ioport <= high)
{
+ if (c->u.ioport.low_ioport == low &&
+ c->u.ioport.high_ioport == high && c->sid[0] == sid)
+ break;
+
printk("%s: IO Port overlap with entry 0x%x - 0x%x\n",
__FUNCTION__, c->u.ioport.low_ioport,
c->u.ioport.high_ioport);
- ret = -EINVAL;
+ ret = -EEXIST;
break;
}
if (c && c->u.iomem.low_iomem <= high)
{
+ if (c->u.iomem.low_iomem == low &&
+ c->u.iomem.high_iomem == high && c->sid[0] == sid)
+ break;
+
printk("%s: IO Memory overlap with entry 0x%x - 0x%x\n",
__FUNCTION__, c->u.iomem.low_iomem,
c->u.iomem.high_iomem);
- ret = -EINVAL;
+ ret = -EEXIST;
break;
}
{
if ( c->u.device == add->u.device )
{
+ if ( c->sid[0] == sid )
+ break;
+
printk("%s: Duplicate PCI Device 0x%x\n", __FUNCTION__,
add->u.device);
- ret = -EINVAL;
+ ret = -EEXIST;
break;
}
c = c->next;
}
printk("%s: ocontext not found: pirq %d\n", __FUNCTION__, low);
- ret = -EINVAL;
+ ret = -ENOENT;
break;
case OCON_IOPORT:
printk("%s: ocontext not found: ioport 0x%x - 0x%x\n", __FUNCTION__,
low, high);
- ret = -EINVAL;
+ ret = -ENOENT;
break;
case OCON_IOMEM:
printk("%s: ocontext not found: iomem 0x%x - 0x%x\n", __FUNCTION__,
low, high);
- ret = -EINVAL;
+ ret = -ENOENT;
break;
case OCON_DEVICE:
}
printk("%s: ocontext not found: pcidevice 0x%x\n", __FUNCTION__, low);
- ret = -EINVAL;
+ ret = -ENOENT;
break;
default: