Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 6 Jan 2003 10:22:03 +0100
From:      Mark Santcroos <marks@ripe.net>
To:        shubha mr <shubha_mr@yahoo.com>
Cc:        freebsd-questions@FreeBSD.ORG, freebsd-net@FreeBSD.ORG
Subject:   Re: help-urgent
Message-ID:  <20030106092203.GA620@laptop.6bone.nl>
In-Reply-To: <20030106062513.51746.qmail@web41203.mail.yahoo.com>
References:  <20030106062513.51746.qmail@web41203.mail.yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Don't think these lists are the best place for this question but alas...

On Mon, Jan 06, 2003 at 06:25:13AM +0000, shubha mr wrote:
> If I have to  write to a register at offset say x,in
> the pci configuration space,how do I do it? If it is
> using pci_read_config and pci_write_config,how does
> the system know where the pci reg base address of my
> device is?

val = pci_read_config(dev, OFFSET, len);

dev: the PCI device your driver is working on
OFFSET: the position you want to read from
len: the number of bytes you want to read

Because you specify the pci dev the system knows where to read from.

Look at any random pci driver in sys/ and it will all become clear.

Mark

-- 
Mark Santcroos                    RIPE Network Coordination Centre
http://www.ripe.net/home/mark/    New Projects Group/TTM

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030106092203.GA620>