On Sun, 15 Oct 2000, C. W. Wright (1698) wrote:

>   I'm trying to access a PCI card from linux 2.2.14 user space via the
> mbuff module. An lspci -vv shows my PCI card at efdffd00 in region 0 of

Don't do it this way.

Just open /dev/mem read-write, and them mmap it at the offset of 0xefdffd00.
No need for mbuff at all. In the kernel use ioremap.

if((fd=open("/dev/mem",O_RDWR)) <0) {
        perror("opening /dev/mem");
        return -1;
}
ptr=mmap(0,SIZE,PROT_WRITE|PROT_READ,MAP_SHARED|MAP_FILE,fd,0xefdffd00);
But I do not like this 0xefdffd00. It should be at 4 KB boundary like
0xefdff000. Also SIZE%4096 should be 0.

> the card. My program is basically a copy of demo.c from the mbuff package
> and modified to use mbuff_alloc_at.  The variable "a" is loaded with the
> address I want to access on the card.  If I set "a' to oxefdffd00 the
> program fails with "mbuff_alloc_at failed".  If I set a to 0xa0000000, it
> will not fail and returns: shm1=0xa0000000 0.  
> 
> Any ideas why this doesn't work?

Sure. Because mbuff ALWAYS allocates memory. The "at" address is the final
address where this memory will be accessed, not the physical(source) address.

> #lspci -vv 
> 03:0f.0 Class ff00: ACQIRIS: Unknown device 0000
>         Subsystem: PLX Technology, Inc.: Unknown device 9080
>         Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV+ VGASnoop-
> ParErr- Stepping- SERR+ FastB2B-
>         Status: Cap- 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort-
> <TAbort- <MAbort- >SERR- <PERR-
>         Latency: 64 set, cache line size 08
>         Interrupt: pin A routed to IRQ 11
>         Region 0: Memory at efdffd00 (32-bit, non-prefetchable)
>         Region 1: I/O ports at 9400
>         Region 2: Memory at efdfc000 (32-bit, non-prefetchable)

A bit strange. What is region2 for?

Best regards,
--
Tomek

-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/

Reply via email to