Re: how to write info to a pci device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Eric Clément (clement.eric@xxxxxxxxx) wrote:
> I create a pci device which I want to interact with Linux for a user
> application.  This pci device is a FPGA.  I create a kernel module for
> communication kernel - user space and now I want to send settings
> information to this pci device.
> 
> I need to use (I/O memory) to do that.  But I don't how.  I can't get
> the base address with pci_read_config and after that I am confuse.  I
> think I can use both function outb or writeb to send information but I
> don't know which is better.
> 
> outb seem to be Intel specific and writeb need to map I/0 memory with ioremap

outb is used to communicated through IO ports.

My answer was really so quick.
If you really have to use I/O Memory, it is ioread8, ioread16,... and
iowrite8, ...
But I think you must read :

	http://lwn.net/images/pdf/LDD3/ch12.pdf

Perhaps: 

	int pci_write_config_word(struct pci_dev* dev, int where, ui16 val);

is what you search.

Sorry, 

> 
> Which method is more standard for a pci device (portable)?
> 
> On 6/22/05, Christophe Lucas <clucas@xxxxxxxxxxxxx> wrote:
> > Eric Clément (clement.eric@xxxxxxxxx) wrote:
> > > Hi,
> > >
> > > I know the base address (I/O memory) of my device, but I don't know
> > > how to write information to the device.
> > >
> > > Which fonction shoud I use :
> > >
> > > outb, writeb or ... ?
> > 
> > I think you should use outb();
> > You can see how is declared writeb() for x86 :
> > 
> >         http://lxr.linux.no/source/include/asm-i386/io.h#L165
> > 
> > But I think you should give more information to us to be able to help
> > you.
> > 
> >                                                 - Christophe
> >

						- Christophe

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux