From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Mon, 7 Oct 2002 16:09:26 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Mon, 7 Oct 2002 16:08:45 -0400 Received: from smtp-outbound.cwctv.net ([213.104.18.10]:13088 "EHLO smtp.cwctv.net") by vger.kernel.org with ESMTP id ; Mon, 7 Oct 2002 16:08:19 -0400 From: To: alan@lxorguk.ukuu.org.uk, jennings@red-river.com, linux-kernel@vger.kernel.org Date: Mon, 7 Oct 2002 21:13:51 +0100 Subject: RE:Re: New PCI Device Driver MIME-Version: 1.0 X-Mailer: Liberate TVMail 2.6 Content-Type: multipart/mixed; boundary="1034021631383" Message-ID: <016c823122007a2DTVMAIL9@smtp.cwctv.net> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org --1034021631383 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Is your driver GPL? Cheers, Dean. On 07 Oct 2002 20:58:26 +0100 Alan Cox wrote: --1034021631383 Content-Type: message/rfc822 Content-Transfer-Encoding: 7bit Content-Disposition: inline Received: from vger.kernel.org ([209.116.70.75]) by smtp.cwctv.net with Microsoft SMTPSVC(5.5.1877.447.44); Mon, 7 Oct 2002 21:06:11 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Mon, 7 Oct 2002 15:43:01 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Mon, 7 Oct 2002 15:43:01 -0400 Received: from pc1-cwma1-5-cust51.swa.cable.ntl.com ([80.5.120.51]:42995 "EHLO irongate.swansea.linux.org.uk") by vger.kernel.org with ESMTP id ; Mon, 7 Oct 2002 15:43:00 -0400 Received: from irongate.swansea.linux.org.uk (localhost [127.0.0.1]) by irongate.swansea.linux.org.uk (8.12.5/8.12.5) with ESMTP id g97JwSbg026635; Mon, 7 Oct 2002 20:58:29 +0100 Received: (from alan@localhost) by irongate.swansea.linux.org.uk (8.12.5/8.12.5/Submit) id g97JwRFw026633; Mon, 7 Oct 2002 20:58:27 +0100 X-Authentication-Warning: irongate.swansea.linux.org.uk: alan set sender to alan@lxorguk.ukuu.org.uk using -f Subject: Re: New PCI Device Driver From: Alan Cox To: Patrick Jennings Cc: LKML In-Reply-To: References: Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Mailer: Ximian Evolution 1.0.8 (1.0.8-10) Date: 07 Oct 2002 20:58:26 +0100 Message-Id: <1034020706.26549.7.camel@irongate.swansea.linux.org.uk> Mime-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: linux-kernel-owner+Hell.Surfers=40cwctv.net@vger.kernel.org On Mon, 2002-10-07 at 18:24, Patrick Jennings wrote: > I have been tasked with writing a driver for my companies digital radio. > The card has 16K of PCI space at BAR0. I need to memory map this into user > space, and provide DMA and isr handling. First things first i want to get > the mapping working. When i run the code below after inserting the module > i seg. fault. I know this is what happens when engineers have to write > code, but can someone point me in the right direction? First things I'd pick on are the obvious ones - we have headers defining KERN_ERR etc as <1> so use them 8) Second you probably want to use the pci_module_init api then multiple cards will basically just work, cardbus will just work and even hotplug should come for free. Beyond that you get the pci resources correctly, you enable the device first as you should. You then ruin it all by poking around directly into I/O space you have not mapped. The kernel isn't running in physical space, and on other platforms it gets even more exciting as to what goes on. Its all abstracted do addr = ioremap(io_base_start, len); databuf = read(addr + 0x590); Finally note that we have a radio interface layer as part of video4linux. Other than some basic tuning ioctls it probably has little in common with digital radio (assuming you mean something like Eureka-147 (aka DAB) rather than digital tuner/mixer for analogue radio.It would nice to make use of that API and extend it logically if you want to get a driver into the base kernel eventually. Alan - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ --1034021631383--