mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Stroupe <dstroupe@keyed-upsoftware.com>
To: linux-kernel@vger.kernel.org
Subject: Q: PCI Driver ioremap
Date: Wed, 20 Feb 2002 15:57:03 -0600	[thread overview]
Message-ID: <3C741BAF.9090300@keyed-upsoftware.com> (raw)

I am creating a PCI driver for a custom card and want to write 0xffff to 
a location offset from the base by 0x48 and
have the following code:

<snip>
unsigned int io_addr;
unsigned int io_size;
void* base;
pci_enable_device (pdev)
io_addr = pci_resource_start(pdev, 0);
io_size = pci_resource_len(pdev, 0);
if ((pci_resource_flags(pdev, 0) & IORESOURCE_MEM)){
       if(check_mem_region(io_addr, io_size))
            DBG("Already In Use");//this is never reached
        request_mem_region(io_addr, io_size , "Card Driver");
        base=ioremap(io_addr, io_size);
        if(base==0)
           DBG("memory mapped wrong\n");//this is never reached
        writew(0xffff, base + 0x48);
<snip>


The card is found, io_addr = 0xe9011000 and io_size = 0x200.

The write is unsuccessful or at least the data never reaches the card. 
 What am I doing incorrectly?

Thanks and best regards,
David


             reply	other threads:[~2002-02-20 21:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-20 21:57 David Stroupe [this message]
2002-02-20 22:03 ` Jeff Garzik
2002-02-20 23:15 ` Alan Cox

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=3C741BAF.9090300@keyed-upsoftware.com \
    --to=dstroupe@keyed-upsoftware.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®