Re: Pci Question

2005-05-05 Thread Cole
Err, sorry.

I meant the linux version of this is using outl_p to communicate with the 
device, and write the values.

/Cole


- Original Message -
From: "Cole" <[EMAIL PROTECTED]>
To: 
Sent: Thursday, May 05, 2005 12:04 PM
Subject: Pci Question


> Hi
>
> Im trying to write a userland program that writes to the IOPORT BAR's of a 
> pci card. I can find the card and all that fine. But im
a
> bit lost on exactly what address the IOPORT BAR's would be then? Im using the 
> /dev/pci and pci(4) functions to find the card.
>
> Ive seen in the linux version of those code, that they take the 
> base_address's and then & ~0x03 them, and use that value for
reading
> and writing with inb_l and outb_l. Ive tried using that on FreeBSD, but with 
> outl and inl, as well as writel and readl, but I keep
> getting "Bus error".
>
> Is there perhaps something that I am missing or forgetting, also im running 
> the program as root.
>
> If anyone has any suggestions, they would be most welcome.
>
> Thanks
> /Cole
>
> ___
> freebsd-hackers@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> To unsubscribe, send any mail to "[EMAIL PROTECTED]"

___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Pci Question

2005-05-05 Thread Cole
Nevermind,

I figured it out and got it working.

Thanks


- Original Message -
From: "Cole" <[EMAIL PROTECTED]>
To: 
Sent: Thursday, May 05, 2005 12:39 PM
Subject: Re: Pci Question


> Err, sorry.
>
> I meant the linux version of this is using outl_p to communicate with the 
> device, and write the values.
>
> /Cole
>
>
> - Original Message -
> From: "Cole" <[EMAIL PROTECTED]>
> To: 
> Sent: Thursday, May 05, 2005 12:04 PM
> Subject: Pci Question
>
>
> > Hi
> >
> > Im trying to write a userland program that writes to the IOPORT BAR's of a 
> > pci card. I can find the card and all that fine. But
im
> a
> > bit lost on exactly what address the IOPORT BAR's would be then? Im using 
> > the /dev/pci and pci(4) functions to find the card.
> >
> > Ive seen in the linux version of those code, that they take the 
> > base_address's and then & ~0x03 them, and use that value for
> reading
> > and writing with inb_l and outb_l. Ive tried using that on FreeBSD, but 
> > with outl and inl, as well as writel and readl, but I
keep
> > getting "Bus error".
> >
> > Is there perhaps something that I am missing or forgetting, also im running 
> > the program as root.
> >
> > If anyone has any suggestions, they would be most welcome.
> >
> > Thanks
> > /Cole
> >
> > ___
> > freebsd-hackers@freebsd.org mailing list
> > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> > To unsubscribe, send any mail to "[EMAIL PROTECTED]"
>
> ___
> freebsd-hackers@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> To unsubscribe, send any mail to "[EMAIL PROTECTED]"

___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Pci Question

2005-05-05 Thread M. Warner Losh
Open /dev/io to use out*/in* functions.

Warner
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"