2009-10-08 18:59:06

by mankan srinivas

[permalink] [raw]
Subject: Sample PCI Linux Device Driver


<[email protected]>


<[email protected]>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0


Hello=2C
=20
I am working on developing PCI based Linux Device Driver. Could you please =
send me few sample code. I am looking for the code which has more informati=
on about low-level driver code talks to the hardware. Any real example code=
is greatly appreciated.
=20
Thanks for your time.
-Srini =0A=
_________________________________________________________________=0A=
Take a peek at other people's pay and perks Check out The Great Australian =
Pay Check=0A=
http://clk.atdmt.com/NMN/go/157639755/direct/01/=


2009-10-08 21:40:15

by Bryan Donlan

[permalink] [raw]
Subject: Re: Sample PCI Linux Device Driver

On Thu, Oct 8, 2009 at 2:58 PM, mankan srinivas <[email protected]> wrote:
>
> ?<[email protected]>
>
>
> ?<[email protected]>
> Content-Type: text/plain; charset="iso-8859-1"
> Content-Transfer-Encoding: quoted-printable
> MIME-Version: 1.0

First, please fix your mail client - it's munging your mails rather
badly, as you can see.

> Hello=2C
> =20
> I am working on developing PCI based Linux Device Driver. Could you please =
> send me few sample code. I am looking for the code which has more informati=
> on about low-level driver code talks to the hardware. Any real example code=
> ?is greatly appreciated.

The entire linux kernel is open source - just look under drivers/ for
plenty of example code. If you're stuck, a 'grep linux/pci.h -R
drivers' should find you PCI drivers. (Note that drivers/pci contains
pci core code, which is probably not what you want)

2009-10-09 17:48:40

by Grant Grundler

[permalink] [raw]
Subject: Re: Sample PCI Linux Device Driver

On Thu, Oct 08, 2009 at 06:58:01PM +0000, mankan srinivas wrote:
> I am working on developing PCI based Linux Device Driver. Could you
> please send me few sample code. I am looking for the code which has more
> information about low-level driver code talks to the hardware. Any real
> example code is greatly appreciated.

Please start by reading Documentation/PCI/pci.txt and MSI-HOWTO.txt
Lots more useful info in Documentation/ that should help you out
(e.g. suspend/resume, hotplug, DMA API, etc)

Here are some specific driver examples:
drivers/net/forcedeth.c
drivers/net/e1000e/
drivers/scsi/mpt2sas/
drivers/ata/sata_sil24.c
drivers/ata/sata_mv.c

hth,
grant

2009-10-12 21:50:11

by Heiko J Schick

[permalink] [raw]
Subject: Re: Sample PCI Linux Device Driver

On Oct 8, 2009, at 8:58 PM, mankan srinivas wrote:

> I am working on developing PCI based Linux Device Driver. Could you
> please =
> send me few sample code. I am looking for the code which has more
> informati=
> on about low-level driver code talks to the hardware. Any real
> example code=
> is greatly appreciated.

Chapter 12 from the Linux Device Driver book might be useful, too.

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

Regards, Heiko