From owner-freebsd-questions@FreeBSD.ORG Sat May 3 09:04:57 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 20F1337B401 for ; Sat, 3 May 2003 09:04:56 -0700 (PDT) Received: from mwinf0502.wanadoo.fr (smtp4.wanadoo.fr [193.252.22.26]) by mx1.FreeBSD.org (Postfix) with ESMTP id 72D3743FBD for ; Sat, 3 May 2003 09:04:55 -0700 (PDT) (envelope-from stef-listes@wanadoo.fr) Received: from wanadoo.fr (ca-angers-1-159.abo.wanadoo.fr [80.8.16.159]) by mwinf0502.wanadoo.fr (SMTP Server) with ESMTP id 77780E800388 for ; Sat, 3 May 2003 18:04:53 +0200 (CEST) Message-ID: <3EB405BA.2080407@wanadoo.fr> Date: Sat, 03 May 2003 18:08:58 +0000 From: stef User-Agent: Mozilla/5.0 (X11; U; Linux i586; fr-FR; rv:1.3) Gecko/20030312 X-Accept-Language: fr MIME-Version: 1.0 To: freebsd-questions@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Trouble using EPP mode with /dev/ppi0 (freebsd 5.0) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 May 2003 16:04:57 -0000 Hello, it seems I can't write to the paraller port in EPP mode. All reads (DATA or ADR) return 0xFF. Accesses DATA, CONTROL and STATUS registers are working fine. I have the feeling that the /dev/ppi0 is stuck in COMPAT mode. The ppc device detects correctly the parallel port settings, and uses EPP mode. I have the feeling that the /dev/ppi0 is stuck COMPAT mode. The test program below gives: to be written=0x58 written=0x58 read=0xFF Strangely, when using PPISEPPA to set and read address, 'val' is zeroed: to be written=0x58 written=0x0 read=0xFF #include #include #include #include #include int main(int argc,char **argv) { int fd=-1; int rc; u_int8_t val,control; fd=open("/dev/ppi0",O_RDONLY); if(fd<0) { perror("/dev/ppi0"); return 1; } val=0x58; printf("to be written=0x%0X\n",val); rc = ioctl (fd, PPISEPPD, &val); if(rc) { perror("/dev/ppi0"); return 1; } printf("written=0x%0X\n",val); /* set to data reverse */ rc = ioctl (fd, PPIGCTRL, &control); if(rc) { perror("/dev/ppi0"); return 1; } control = (control & 0x1F) | 0x20; rc = ioctl (fd, PPISCTRL, &control); if(rc) { perror("/dev/ppi0"); return 1; } rc = ioctl (fd, PPIGEPPD, &val); if(rc) { perror("/dev/ppi0"); return 1; } printf("read=0x%0X\n",val); close(fd); return 0; } Any suggestion or idea ? Regards, Stef