From owner-freebsd-hackers Fri Oct 23 09:54:33 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id JAA19251 for freebsd-hackers-outgoing; Fri, 23 Oct 1998 09:54:33 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from rah.star-gate.com (rah.star-gate.com [209.133.7.234]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id JAA19245 for ; Fri, 23 Oct 1998 09:54:31 -0700 (PDT) (envelope-from hasty@rah.star-gate.com) Received: from rah.star-gate.com (localhost.star-gate.com [127.0.0.1]) by rah.star-gate.com (8.9.1/8.8.8) with ESMTP id JAA02207; Fri, 23 Oct 1998 09:53:44 -0700 (PDT) (envelope-from hasty@rah.star-gate.com) Message-Id: <199810231653.JAA02207@rah.star-gate.com> X-Mailer: exmh version 2.0.2 2/24/98 To: Etienne de Bruin , freebsd-hackers@FreeBSD.ORG (Hackers FreeBSD) Subject: Re: BMaster Examples In-reply-to: Your message of "Fri, 23 Oct 1998 09:27:32 PDT." <199810231627.JAA03120@dingo.cdrom.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 23 Oct 1998 09:53:44 -0700 From: Amancio Hasty Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG PCI bus mastering is different than ISA DMA in which there is a standard way of doing dma transfer, for PCI devices bus transfer is device specific. I realize that device specific is vague so let me give you a short example from the Bt848 driver: /* sync vre IRQ bit */ *dma_prog++ = OP_SYNC | 1 << 24 | 1 << 15 | BKTR_VRE; *dma_prog++ = 0; /* NULL WORD */ *dma_prog++ = OP_JUMP ; *dma_prog++ = (u_long ) vtophys(bktr->dma_prog) ; The bt848 reads a dma program from the host memory and then it executes a series of micro instructions. There is a register bit which one sets to start or stop reading the host program and another register to load the starting address of the RISC program. Needless to say that just about every PCI device does dma differently. Cheers, Amancio > > i need code examples of bus mastering being implemented in pci device > > drivers. > > As has already been explained to you, bus mastering for PCI devices is > almost entirely specific to the device in question. You will have to > consult the documentation for this device, and then look at almost any > of the PCI drivers, as most of them use the device's busmaster support. > > -- > \\ Sometimes you're ahead, \\ Mike Smith > \\ sometimes you're behind. \\ mike@smith.net.au > \\ The race is long, and in the \\ msmith@freebsd.org > \\ end it's only with yourself. \\ msmith@cdrom.com > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-hackers" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message