Eric W. Biederman writes:

>>
>> I started to debug modem's code and here in the ptserial.c program I see:
>
> Ouch no struct pci_device. No pcibios_read_byte no pci_read_conf_byte.
> The driver really is not very linux friendly.

well this ptserial.c is the drivers/char/serial.c from the kernel tree as of
2.4.0 ...... pctel added their stuff the serial.c and called it ptserial.c
All the PCTEL propietary code is loaded as module and this ptserial.c
acceses it to handle modem calls.

>
>> <....... snip .......>
>>                printk(KERN_INFO __FUNCTION__ ": entered detection code\n");
>>                printk(KERN_INFO __FUNCTION__ ": requesting info
>> dwDeviceNum=%#x(%d)\n",dwDeviceNum,dwDeviceNum);
>>                outl(dwDeviceNum + PCI_INTERRUPT_LINE, 0xCF8);
>>                irq = inb(0xCFC);
>>                outl(dwDeviceNum + PCI_BASE_ADDRESS_0, 0xCF8);
>>                iobase_0 = inl(0xCFC);
>>                outl(dwDeviceNum + PCI_BASE_ADDRESS_1, 0xCF8);
>>                iobase_1 = inl(0xCFC);
>>
>>                if (iobase_0 == 0xffffffff) iobase_0 = 0;
>>                if (iobase_1 == 0xffffffff) iobase_1 = 0;
>>                iobase_0 &= PCI_BASE_ADDRESS_IO_MASK;
>>                iobase_1 &= PCI_BASE_ADDRESS_IO_MASK;
>>
>>                printk("AC97 modem device found: devnum = %8X, devid =
>> %4X/%4X\n", dwDeviceNum, dwDeviceID&0xFFFF, dwDeviceID>>16);
>>                printk("irq = %d, iobase_0 = %4X, iobase_1 = %4X\n", irq,
>> iobase_0, iobase_1);
>>
>>                pctel_autodetect_irq = irq;
>>                pctel_autodetect_port_0 = iobase_0;
>>                pctel_autodetect_port_1 = iobase_1;
>> <...... snip .......>
>>
>> Here , the code  is:
>>                outl(dwDeviceNum + PCI_INTERRUPT_LINE, 0xCF8);
>>                irq = inb(0xCFC);
>>
>> the IRQ is requested through the BUS, so this is NOT the driver problem,
>
> Oh yes it is.  That is totally the wrong way to get the irq in linux.
> It needs to read it from struct pci_dev.

but........ The first thing I did when I seen irq=0 I replaced all the
places where irq where asigned and set it to a hardcodede value irq=10
because I knew which whas the IRQ ....... the modem reported irq=10 in the
dmesg but it never worked.......    I think only accessing pci_dev will not
be enough, I will need to initialize it I guess.....

>
>> also the same version of the driver, with the same version
>> of the kernel works ok under original BIOS flash.
>
> Luck.
>
>> From this point, I can
>> discard driver and look why is PCI bus returning irq=0 in other place ....
>> (Due to the drivers for PCTEL modem are directly from PCTEL and do not
>> support higher versions than 2.4.5 , I do all my tests under 2.4.5. I
>> applied pathch-2.4.6-SiS to 2.4.5 but this is not the problem origin I
>> beleive, patches where applied clean)
>
>>
>> As you can see, tables are equal......
>>
>> Now , where is left to look ? If the driver requests IRQ directly from the
>> bus and gets 0 , and the lspci requests IRQ and gets 10 .... where should I
>> look for the problem?
>
> The modem driver.  It isn't using the linux kernel API to get the irq.
> It is a buggy driver.
>

Ok, will work on that then. Thanks!


Nikolai

Reply via email to