Re: Looking for testers with these NICs

From: Denis Vlasenko (vda@port.imtp.ilyichevsk.odessa.ua)
Date: Thu Oct 10 2002 - 06:33:12 EST


On 9 October 2002 17:05, Derek Fawcus wrote:
> On Wed, Oct 09, 2002 at 07:31:17PM -0200, Denis Vlasenko wrote:
> > ni65.c
>
> I've got some of these knocking about, but rather than use that
> driver, I have a (quite old) patch, that allows the normal lance
> driver to be used. The patch dates back from 1.3.x, but I think I
> may have a more recent version around.

Well, if you want, give this a spin. Can you test it on
SMP or preempt kernel?

diff -u --recursive linux-2.5.40org/drivers/net/ni65.c linux-2.5.40/drivers/net/ni65.c
--- linux-2.5.40org/drivers/net/ni65.c Thu Oct 3 12:08:00 2002
+++ linux-2.5.40/drivers/net/ni65.c Wed Oct 9 10:35:18 2002
@@ -176,6 +176,9 @@
 #define writedatareg(val) { writereg(val,CSR0); }
 #endif

+/* Not to be confused with priv->lock */
+static spinlock_t irq_lock = SPIN_LOCK_UNLOCKED;
+
 static unsigned char ni_vendor[] = { 0x02,0x07,0x01 };

 static struct card {
@@ -409,7 +412,7 @@
                 p->features = 0x0;
         }

- if(test_bit(0,&cards[i].config)) {
+ if(test_bit(0,(unsigned long*)(&cards[i].config))) {
                 dev->irq = irqtab[(inw(ioaddr+L_CONFIG)>>2)&3];
                 dev->dma = dmatab[inw(ioaddr+L_CONFIG)&3];
                 printk("IRQ %d (from card), DMA %d (from card).\n",dev->irq,dev->dma);
@@ -420,7 +423,7 @@
                         int dma_channels = ((inb(DMA1_STAT_REG) >> 4) & 0x0f) | (inb(DMA2_STAT_REG) & 0xf0);
                         for(i=1;i<5;i++) {
                                 int dma = dmatab[i];
- if(test_bit(dma,&dma_channels) || request_dma(dma,"ni6510"))
+ if(test_bit(dma,(unsigned long*)&dma_channels) || request_dma(dma,"ni6510"))
                                         continue;

                                 flags=claim_dma_lock();
@@ -1118,8 +1121,7 @@
                                                          (skb->len > T_BUF_SIZE) ? T_BUF_SIZE : skb->len);
                         dev_kfree_skb (skb);

- save_flags(flags);
- cli();
+ spin_lock_irqsave(&irq_lock, flags);

                         tmdp = p->tmdhead + p->tmdnum;
                         tmdp->u.buffer = (u32) isa_virt_to_bus(p->tmdbounce[p->tmdbouncenum]);
@@ -1128,8 +1130,7 @@
 #ifdef XMT_VIA_SKB
                 }
                 else {
- save_flags(flags);
- cli();
+ spin_lock_irqsave(&irq_lock, flags);

                         tmdp = p->tmdhead + p->tmdnum;
                         tmdp->u.buffer = (u32) isa_virt_to_bus(skb->data);
@@ -1150,7 +1151,7 @@
                 p->lock = 0;
                 dev->trans_start = jiffies;

- restore_flags(flags);
+ spin_unlock_irqrestore(&irq_lock, flags);
         }
 
         return 0;
-
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/



This archive was generated by hypermail 2b29 : Tue Oct 15 2002 - 22:00:36 EST