mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: <Hell.Surfers@cwctv.net>
To: alan@lxorguk.ukuu.org.uk, jennings@red-river.com,
	linux-kernel@vger.kernel.org
Subject: RE:Re: New PCI Device Driver
Date: Mon, 7 Oct 2002 21:13:51 +0100	[thread overview]
Message-ID: <016c823122007a2DTVMAIL9@smtp.cwctv.net> (raw)

[-- Attachment #1: Type: text/plain, Size: 111 bytes --]

Is your driver GPL?

Cheers, Dean.

On 	07 Oct 2002 20:58:26 +0100 	Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:

[-- Attachment #2: Type: message/rfc822, Size: 3501 bytes --]

From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Patrick Jennings <jennings@red-river.com>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: Re: New PCI Device Driver
Date: 07 Oct 2002 20:58:26 +0100
Message-ID: <1034020706.26549.7.camel@irongate.swansea.linux.org.uk>

On Mon, 2002-10-07 at 18:24, Patrick Jennings wrote:
> I have been tasked with writing a driver for my companies digital radio.
> The card has 16K of PCI space at BAR0.  I need to memory map this into user
> space, and provide DMA and isr handling.  First things first i want to get
> the mapping working.   When i run the code below after inserting the module
> i seg. fault.  I know this is what happens when engineers have to write
> code, but can someone point me in the right direction?

First things I'd pick on are the obvious ones - we have headers defining
KERN_ERR etc as <1> so use them 8)

Second you probably want to use the pci_module_init api then multiple
cards will basically just work, cardbus will just work and even hotplug
should come for free.

Beyond that you get the pci resources correctly, you enable the device
first as you should. You then ruin it all by poking around directly into
I/O space you have not mapped.

The kernel isn't running in physical space, and on other platforms it
gets even more exciting as to what goes on. Its all abstracted do

	addr = ioremap(io_base_start, len);
        databuf = read(addr + 0x590);


Finally note that we have a radio interface layer as part of
video4linux. Other than some basic tuning ioctls it probably has little
in common with digital radio (assuming you mean something like
Eureka-147 (aka DAB) rather than digital tuner/mixer for analogue
radio.It would nice to make use of that API and extend it logically if
you want to get a driver into the base kernel eventually.

Alan

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

                 reply	other threads:[~2002-10-07 20:09 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=016c823122007a2DTVMAIL9@smtp.cwctv.net \
    --to=hell.surfers@cwctv.net \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=jennings@red-river.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®