AF:
NF:0
PS:10
SRH:1
SFN:
DSR:
MID:<20080221143620.5560b154@ripper.onstor.net>
CFG:
PT:0
S:andy.sharp@onstor.com
RQ:
SSV:onstor-exch02.onstor.net
NSV:
SSH:
R:<brian.stark@onstor.com>
MAID:1
X-Sylpheed-Privacy-System:
X-Sylpheed-Sign:0
SCF:#mh/Mailbox/sent
X-Sylpheed-End-Special-Headers: 1
Date: Thu, 21 Feb 2008 14:48:44 -0800
From: Andrew Sharp <andy.sharp@onstor.com>
To: Brian Stark <brian.stark@onstor.com>
Subject: card status issues
Message-ID: <20080221144844.3a3fa5f7@ripper.onstor.net>
Organization: Onstor
X-Mailer: Sylpheed-Claws 2.6.0 (GTK+ 2.8.20; x86_64-pc-linux-gnu)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

Brian,

Here is the code from the interrupt handler:

static irqreturn_t yenta_interrupt(int irq, void *dev_id)
       ^^^^^^^^^^^ this is the function the kernel calls upon irq
{
	unsigned int events;
	struct yenta_socket *socket = (struct yenta_socket *) dev_id;
	u8 csc;
	u32 cb_event;

	/* Clear interrupt status for the event */
	cb_event = cb_readl(socket, CB_SOCKET_EVENT);
CB_SOCKET_EVENT is 0x0 - reads the register from the base address for the socket + 0x0
	cb_writel(socket, CB_SOCKET_EVENT, cb_event);
it then writes back to that reg what it read
	csc = exca_readb(socket, I365_CSC);
this one is largely self explanatory - I365_CSC is 0x4, so this routine reads from the socket base address + 0x800 + 0x4

	if (!(cb_event || csc))
		return IRQ_NONE;
if both csc and cb_event are 0, there's nothing to do, just return

	events = (cb_event & (CB_CD1EVENT | CB_CD2EVENT)) ? SS_DETECT : 0 ;
this sets the SS_EVENT bit in events if bit 0x2 or 0x4 is on in cb_event
	events |= (csc & I365_CSC_DETECT) ? SS_DETECT : 0;
this also sets the SS_DETECT bit in events if bit 0x8 is on in csc
	if (exca_readb(socket, I365_INTCTL) & I365_PC_IOCARD) {
		events |= (csc & I365_CSC_STSCHG) ? SS_STSCHG : 0;
sets SS_STSCHG bit in events if exca register 0x3 (I365_INTCTL) has bit 0x20 (I365_PC_IOCARD) on
	} else {
else it goes on to check other bits in csc
then goes off to execute code based on the bits set in 'events'
