From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fa528,59aa07e1bba779a5,start X-Google-Attributes: gidfa528,public X-Google-ArrivalTime: 2002-07-19 11:18:02 PST Message-ID: <3D385707.E279C6E0@sis-dev.com> Date: Fri, 19 Jul 2002 13:14:31 -0500 From: Bob Irwin Organization: X-Mailer: Mozilla 4.7 [en] (X11; I; SunOS 5.8 sun4u) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.unix.tru64 Subject: mmap of pci card memory Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 216.201.132.153 X-Trace: 19 Jul 2002 13:25:07 -0600, 216.201.132.153 Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!jfk3-feed1.news.algx.net!dfw3-feed1.news.algx.net!allegiance!news.logixcom.net!216.201.132.153 Xref: archiver1.google.com comp.unix.tru64:8175 Running tru64 on a compaq alpha. (tru64 V5.1A Rev 1885). I've written a device driver for a pci card that seems to identify and configure OK. printfs in the configure code shows correct PCI id and unique values in the PCI memory via BAR0. A test program shows that xxopen, xxioctl, xxclose functions are being entered. However mmap() call fails with error 22 (EINVAL). The xxmmap function in the driver is not entered. It appears that the mmap() never makes it to the kernel. The test program runs fine using a disk file instead of /dev/xx, mmap is OK. Here's the mmap call (and card has 32 mbytes of onboard mem) pWindow = mmap( (caddr_t) 0, (size_t)16384, (int)(PROT_READ | PROT_WRITE), (int)MAP_SHARED | MAP_VARIABLE, (int)fd, (off_t) 0 ); Another quirk, when I do the 'sysconfig -v -c', cfgmgr seems happy til the end when it exits with: xx driver V.100 configured sending reply packet waiting for new packet cfgmgr: read failed (errno 2) errno.h shows 2 to be 'no such file or directory. There's no truss command on this system, so don't have a clue what cfgmgr was trying to read. Anyone have any clues to this cfgmgr behavior or why mmap is saying Invalid Argument? The driver is a character driver based on the sample driver generated by the web 'Driver Builder'. any pointers or suggestions will be appreciated. thanks, bob -- Bob Irwin SIS Development 832-448-3200 x13 Houston, TX