Messages in this thread | | | Date | Thu, 28 Oct 1999 23:47:35 +0200 (MET_DST) | From | David Weinehall <> | Subject | Re: [PATCH] four warnings and a patch |
| |
On Thu, 28 Oct 1999, Dennis Hou wrote:
> I must be missing something here. > > static void NS8390_trigger_send(struct net_device *dev, unsigned int > length, int start_page) > { > long e8390_base = dev->base_addr; > struct ei_device *ei_local = (struct ei_device *) dev->priv; > > outb_p(E8390_NODMA+E8390_PAGE0, e8390_base+E8390_CMD); > > if (inb_p(e8390_base) & E8390_TRANS) > { > printk(KERN_WARNING "%s: trigger_send() called with the > transmitter busy.\n", > dev->name); > return; > } > outb_p(length & 0xff, e8390_base + EN0_TCNTLO); > outb_p(length >> 8, e8390_base + EN0_TCNTHI); > outb_p(start_page, e8390_base + EN0_TPSR); > outb_p(E8390_NODMA+E8390_TRANS+E8390_START, e8390_base+E8390_CMD); > } > > How is it that ei_local is used? Not to sound arrogant... I'm just > curious.
Oh, no problem :^) You're not the first one to ask this; I once wondered about this too... It's easy to miss this out. The danger of macros...
From 8390.h:
#define E8390_CMD EI_SHIFT(0x00) /* The command register (for all pages) */
#if defined(CONFIG_MAC) || defined(CONFIG_AMIGA_PCMCIA) || \ defined(CONFIG_ARIADNE2) || defined(CONFIG_ARIADNE2_MODULE) #define EI_SHIFT(x) (ei_local->reg_offset[x]) #else #define EI_SHIFT(x) (x) #endif
From 8390.c:
static void NS8390_trigger_send(struct net_device *dev, unsigned int length, int start_page) { long e8390_base = dev->base_addr; struct ei_device *ei_local = (struct ei_device *) dev->priv;
outb_p(E8390_NODMA+E8390_PAGE0, e8390_base+E8390_CMD); ^^^^^^^^^A
I hope that this explains things.
/David Weinehall _ _ // David Weinehall <tao@acc.umu.se> /> Northern lights wander \\ // Project MCA Linux hacker // Dance across the winter sky // \> http://www.acc.umu.se/~tao/ </ Full colour fire </
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |