Skip to contentSkip to conversation

PCI config space

DISCUSSION Jon Smirl 2 participants 6 messages Jan 2, 2004 – Jan 3, 2004

lore
Share & tools
lore

Jon Smirl

author
#0 lore raw

Is there a standard API for read/write of PCI config space using sysfs?

==Jon Smirl
[email protected]

__________________________________
Do you Yahoo!?
Find out what made the Top Yahoo! Searches of 2003
http://search.yahoo.com/top2003

-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#1 lore raw
Quoted 1 line · Jon Smirl

Is there a standard API for read/write of PCI config space using sysfs?

Open the "config" file and read and write the offset that you want to read/write.

Does that not work for you?

greg k-h

-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

author
#2 lore raw
In reply to Jon Smirl

That's real simple. I was trying to find a more complicated, harder solution. I need the PCI space for the VM86 emulation of the VBIOS calls.

Is libsysfs going to be part of klibc? I can link it in statically for now.

And I should use something like execl (seems to be in klibc) to call udev to query for it's directory and my path?

Quoted 9 lines · --- Greg KH
Quoted 1 line · Jon Smirl

Is there a standard API for read/write of PCI config space using sysfs?

Open the "config" file and read and write the offset that you want to read/write.

Does that not work for you?

greg k-h

==Jon Smirl
[email protected]

__________________________________
Do you Yahoo!?
Find out what made the Top Yahoo! Searches of 2003
http://search.yahoo.com/top2003

-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#3 lore raw
In reply to Jon Smirl
Quoted 4 lines · Jon Smirl

That's real simple. I was trying to find a more complicated, harder solution. I need the PCI space for the VM86 emulation of the VBIOS calls.

Is libsysfs going to be part of klibc? I can link it in statically for now.

They are two different, separate things, and will stay that way.

Quoted 2 lines

And I should use something like execl (seems to be in klibc) to call udev to query for it's directory and my path?

"my path"? What does that mean?

thanks,

greg k-h

-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

author
#4 lore raw
In reply to Jon Smirl
Quoted 5 lines · --- Greg KH
Quoted 2 lines · Jon Smirl

And I should use something like execl (seems to be in klibc) to call udev to query for it's directory and my path?

"my path"? What does that mean?

My DEVPATH, /class/dri/card0 so that I can do:
udev -q /class/dri/card0
and get the path to my device:
dri/card0
and combine it with:
udev -r
which returns
/udev/

So that I can build the path to my device:
/udev/dri/card0

==Jon Smirl
[email protected]

__________________________________
Do you Yahoo!?
Find out what made the Top Yahoo! Searches of 2003
http://search.yahoo.com/top2003

-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#5 lore raw
In reply to Jon Smirl
Quoted 11 lines · Jon Smirl
Quoted 5 lines · --- Greg KH
Quoted 2 lines · Jon Smirl

And I should use something like execl (seems to be in klibc) to call udev to query for it's directory and my path?

"my path"? What does that mean?

My DEVPATH, /class/dri/card0 so that I can do:
udev -q /class/dri/card0
and get the path to my device:
dri/card0

That is your device node that udev created, right?

Quoted 7 lines

and combine it with:
udev -r
which returns
/udev/

So that I can build the path to my device:
/udev/dri/card0

Yes, then you can do whatever operations on that device node you want to.

But if you want to touch the PCI config stuff for your device, just go off of the DEVPATH. There should be a "device" symlink in your /class/dri/card0/ directory that points to the pci device directory, right?

Anyway, it sounds like you are on the right path...

thanks,

greg k-h

-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel