From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25899 invoked by alias); 10 Nov 2009 12:16:18 -0000 Received: (qmail 25890 invoked by uid 22791); 10 Nov 2009 12:16:17 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00,SARE_PROLOSTOCK_SYM3,SPF_PASS X-Spam-Check-By: sourceware.org Received: from nicola.2020media.com (HELO nicola.2020mail.com) (212.124.192.216) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 10 Nov 2009 12:16:13 +0000 Received: from [212.124.199.38] (helo=hercules.zynaptic.com) by nicola.2020mail.com with esmtp (Exim 4.22) id 1N7pdd-0009do-Qz; Tue, 10 Nov 2009 12:15:57 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) by hercules.zynaptic.com (Postfix) with ESMTPA id 227FD440B9; Tue, 10 Nov 2009 12:16:06 +0000 (GMT) Message-ID: <4AF95985.4000905@zynaptic.com> Date: Tue, 10 Nov 2009 12:16:00 -0000 From: Chris Holgate User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Ilija Stanislevik CC: eCos developers Subject: Re: Ethernet over SPI driver for ENC424J600 References: <4ACB4B58.2040804@ecoscentric.com> <4ACC61F0.3020303@televic.com> <4AD3E92E.5020301@jifvik.org> <4AD47ADE.9010606@cs.vu.nl> <4AD6A7EC.8080703@jifvik.org> <4ADC452B.5040706@ecoscentric.com> <4ADD14E1.3050702@jifvik.org> <4ADD8E47.1080305@ecoscentric.com> <4ADE6C92.9060300@jifvik.org> <4AE02E54.7000508@ecoscentric.com> <4AF8F6D7.1000709@jifvik.org> <4AF94296.7040104@ecoscentric.com> <4AF94E59.6040500@siva.com.mk> In-Reply-To: <4AF94E59.6040500@siva.com.mk> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact ecos-devel-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: ecos-devel-owner@ecos.sourceware.org X-SW-Source: 2009-11/txt/msg00007.txt.bz2 Hi Ilija, Ilija Stanislevik wrote: > The driver makes use of external interrupt (from one of the general > purpose I/O pins in case of STM32) to get interrupt request from > Ethernet chip. I've found that, in eCos 3.0 implementation for STM32, > the cyg_drv_interrupt_... functions don't set up the AFIO_EXTICRx > register, which is necessary in order to connect particular I/O pin with > the EXTI logic. The driver can always arrange for this outside the > standard functions, but such an approach produces a driver which is tied > not only to Ethernet chip, but to platform too. I think that it's the general case that when using external interrupts there will be some form of platform specific setup, so it's good idea to isolate this anyway. > Another solution is external function provided from application within > the private data structure, to be called from drivers init function. The > driver is still platform-independent and the application programmer > should take care for marshaling of interrupt. Rather than adding a callback in the private data structure, you can add the external interrupt setup to your platform specific initialisation code and then just include the interrupt vector ID in the private area of your SPI device data structure. Once the generic driver knows the vector ID it can then take care of managing the interrupt itself. Chris. -- Christopher J. Holgate Thinking Of The Future @ Zynaptic Limited (www.zynaptic.com)