Re: Passing info from the top-half ISR to the bottom-half

Kai Germaschewski (kai-germaschewski@uiowa.edu)
Fri, 25 Oct 2002 17:22:46 -0500 (CDT)


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/