Device driver request_region 0xcf8 fails


 
Thread Tools Search this Thread
Top Forums Programming Device driver request_region 0xcf8 fails
# 1  
Old 10-14-2010
Device driver request_region 0xcf8 fails

Request region to 0xCf8 always fails on 1386 hardware.
What am I doing wrong here?

Code:
int pciport_init(void)
{
    int result;
    /* Registering device */
    result = register_chrdev(pciport_major, "pciport",  &pciport_fops);
    if (result < 0) { printk("<1>pciport: cannot obtain major number %d\n",pciport_major); return result; }

    //<pciport modified init module>
    /* Registering port */
  
    port = request_region(0xCF8, 4, "pciport");
    if (!port) {    printk("<1>pciport: cannot reserve 0xCF8\n");    result = port;    goto fail;    }

    printk("<1>Inserting pciport module\n");
    return 0;

    fail:
    pciport_exit();
    return result;
}


Last edited by Scott; 10-14-2010 at 08:41 PM.. Reason: Code tags
# 2  
Old 10-14-2010
Something tells me that can't be all the code.

0xcf8 is the PCI configuration address space, which Linux is almost certainly using.

What exactly is it doing or not doing?

Why are you attempting to get the parallel port I/O port? That's probably already in use, and there's far less drastic ways than writing a device driver to get to it.

Also, you have 6 posts under your belt, and surely have been told about code tags by now.
# 3  
Old 10-14-2010
I am trying to get to the pci config space through io ports CF8 CFC configuration registers,
not parallel port
# 4  
Old 10-14-2010
0x378 is the parallel port, so doesn't seem relevant to getting access to the PCI configuration space.

The PCI configuration space is almost certainly already claimed by something else. 'cat /proc/ioports' to see what ranges are claimed by what things.
# 5  
Old 10-14-2010
In my code i am referring to 0xCF8 not 0x378. My cat/proc/ioports has this reference

0cf8-0cff : PCI conf1
# 6  
Old 10-14-2010
Yes, it's already claimed by the code that manages your PCI bus.

You may be able to get access via user code by mapping the relevant range of /dev/port into your process and reading from that memory.
# 7  
Old 10-14-2010
I see, Thanks!
How can i then make pci calls in kernel space? I believe I have make pci driver api calls from my driver instead.
Login or Register to Ask a Question

Previous Thread | Next Thread

4 More Discussions You Might Find Interesting

1. Red Hat

Driver fails to recognize monitor type ...

Hello, Please help me if you could to resolve the problem with NVIDIA driver. I have Lenovo T61p. I installed RHAT6 Open Client and then downloaded and installed NVIDIA driver version 270.41.06. The product is Quadro FX 570. My laptop display type is LVDS. After installation everything works... (1 Reply)
Discussion started by: susja
1 Replies

2. Programming

regarding device driver

Hi All, I have a device driver that uses UARTserial port to write/read to-from a device. That device driver is working fine on FC3 machine( kernel version 2.6.12)... Now I am switching to FC9 (kernel version 2.6.25.11-97).I have changed the interrupt flag SA_INTERRUPT to IRQF_DISABLED... (0 Replies)
Discussion started by: rajuprade
0 Replies

3. UNIX for Advanced & Expert Users

help regarding device driver

Hi All, I have a device driver that uses UARTserial port to write/read to-from a device. That device driver is working fine on FC3 machine( kernel version 2.6.12)... Now I am switching to FC9 (kernel version 2.6.25.11-97).I have changed the interrupt flag SA_INTERRUPT to IRQF_DISABLED... (0 Replies)
Discussion started by: rajuprade
0 Replies

4. Solaris

SUNWglmr -- rasctrl environment monitoring driver for i2c or SCSI device driver ?

I've been researching minimizeing Solaris 8 and found that on the web page http://www.sun.com/bigadmin/content/packagelist/s8u7PkgList/p2.html the package SUNWglmr is listed as "rasctrl environment monitoring driver for i2c, (Root) (32-bit)" while in the document "Solaris 8 minimize-updt1.pdf"... (1 Reply)
Discussion started by: roygoodwin
1 Replies
Login or Register to Ask a Question