Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Fri, 25 Oct 2002 18:21:00 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Fri, 25 Oct 2002 18:20:53 -0400 Received: from chaos.physics.uiowa.edu ([128.255.34.189]:59839 "EHLO chaos.physics.uiowa.edu") by vger.kernel.org with ESMTP id ; Fri, 25 Oct 2002 18:16:33 -0400 Date: Fri, 25 Oct 2002 17:22:46 -0500 (CDT) From: Kai Germaschewski X-X-Sender: kai@chaos.physics.uiowa.edu To: kernelnewbie@gate.debonne.net cc: linux-kernel@vger.kernel.org Subject: Re: Passing info from the top-half ISR to the bottom-half In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1487 Lines: 33 On Thu, 24 Oct 2002 kernelnewbie@gate.debonne.net wrote: > My ISR is split into top-half and bottom-half processing. The bottom-half > is implemented as a tasklet (I'm using Kernel 2.4). The top-half knows > which physical device (minor number) caused the interrupt and that info > has to be passed to the tasklet somehow. > > The DECLARE_TASKLET macro provides an unsigned long data argument, but it > appears that that argument must be constant. Rubini's book says it's fine > to pass a pointer via this data argument, and I'd like to pass the pointer > to my device control block, but since the argument must be a constant, the > best I can do is pass a pointer to a global which points to my DCB. But > this won't work because another device's interrupt will overwrite it. > > Do I have to make a separate DECLARE_TASKLET for each physical device like > the following: I think the answer is yes, you want to have a tasklet per device, but not like what was following ;) You should just add the struct tasklet_struct into your per-device private data (DCB - driver control block? sounds like Windows to me...), and have it point back to it. Should work just fine, much cleaner than a number of global tasklet declarations. --Kai - 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/