pci_map_irq()

Hi,

I am going to use pci_map_irq() and change IRQ.
However, interrupt of the changed device does not start.
The function was successful. But IRQ seems not to change it in fact.

Please help me!
Thanks


#include <stdio.h>
#include <hw/pci.h>
#include <stdlib.h>
#include <stddef.h>
#include <sys/neutrino.h>

int chgirq();

int main()
{
ThreadCtl(_NTO_TCTL_IO, 0);
chgirq( );
return(0);
}
int chgirq(void)
{

struct pci_dev_info info;
int usb_pci_index = 0, new_irq = 12, status;
void *handle;

memset(&info, 0, sizeof(info));
info.DeviceId = 0x0070;
info.VendorId = 0x8d82;

if (pci_attach(0) == -1)
{
fprintf(stderr, “Unable to open the pci server.\n”);
exit(EXIT_FAILURE);
}

handle = pci_attach_device (NULL, PCI_SEARCH_VENDEV, usb_pci_index,
&info);

if(handle == NULL ){
printf(" pci_attach_device() error \n");
}else{
printf(“BusNumber %x DevFunc %x \n\n”,info.BusNumber,info.DevFunc);
status = pci_map_irq(info.BusNumber, info.DevFunc, new_irq, 0x0A);
if(status != PCI_SUCCESS){
switch (status)
{
case PCI_UNSUPPORTED_FUNCT:
{
printf(“PCI_UNSUPPORTED_FUNCT\n”);
break;
}
case PCI_SET_FAILED:
{
printf( “PCI_SET_FAILED \n”);
break;
}
default:
{
printf(“default error \n”);
}
}
}else{

}
pci_detach_device(handle);
}
pci_write_config (handle, offsetof(struct _pci_config_regs,
Interrupt_Line), 1, sizeof(new_irq), &new_irq);
pci_detach_device(handle);
return(0);

}