[patch/resend] smc911x: fix compilation breakage

2007-05-13 Thread Vitaly Wool

Looks like the new version of this patch has been overlooked,
so I'm resending it.

It just adapts the driver to the new IRQ API
according to what Russell has pointed out.

drivers/net/smc911x.c |6 ++
1 files changed, 2 insertions(+), 4 deletions(-)

Signed-off-by: Vitaly Wool [EMAIL PROTECTED]

diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c
index c956141..4b9bdad 100644
--- a/drivers/net/smc911x.c
+++ b/drivers/net/smc911x.c
@@ -77,7 +77,6 @@ static const char version[] =
#include linux/skbuff.h

#include asm/io.h
-#include asm/irq.h

#include smc911x.h

@@ -2086,12 +2085,11 @@ static int __init smc911x_probe(struct n
lp-ctl_rspeed = 100;

/* Grab the IRQ */
-   retval = request_irq(dev-irq, smc911x_interrupt, IRQF_SHARED, 
dev-name, dev);
+   retval = request_irq(dev-irq, smc911x_interrupt,
+   IRQF_SHARED | IRQF_TRIGGER_FALLING, dev-name, dev);
if (retval)
goto err_out;

-   set_irq_type(dev-irq, IRQT_FALLING);
-
#ifdef SMC_USE_DMA
lp-rxdma = SMC_DMA_REQUEST(dev, smc911x_rx_dma_irq);
lp-txdma = SMC_DMA_REQUEST(dev, smc911x_tx_dma_irq);


-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch] fix smc911x compilation breakage

2007-04-30 Thread Vitaly Wool

Hello,

this is the updated version of smc911x compilation breakage fix.
Hope it's fine now. It just adapts the driver to the new IRQ API
according to what Russell has pointed out.

drivers/net/smc911x.c |6 ++
1 files changed, 2 insertions(+), 4 deletions(-)

Signed-off-by: Vitaly Wool [EMAIL PROTECTED]

diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c
index c956141..4b9bdad 100644
--- a/drivers/net/smc911x.c
+++ b/drivers/net/smc911x.c
@@ -77,7 +77,6 @@ static const char version[] =
#include linux/skbuff.h

#include asm/io.h
-#include asm/irq.h

#include smc911x.h

@@ -2086,12 +2085,11 @@ static int __init smc911x_probe(struct n
lp-ctl_rspeed = 100;

/* Grab the IRQ */
-   retval = request_irq(dev-irq, smc911x_interrupt, IRQF_SHARED, 
dev-name, dev);
+   retval = request_irq(dev-irq, smc911x_interrupt,
+   IRQF_SHARED | IRQF_TRIGGER_FALLING, dev-name, dev);
if (retval)
goto err_out;

-   set_irq_type(dev-irq, IRQT_FALLING);
-
#ifdef SMC_USE_DMA
lp-rxdma = SMC_DMA_REQUEST(dev, smc911x_rx_dma_irq);
lp-txdma = SMC_DMA_REQUEST(dev, smc911x_tx_dma_irq);



-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] fix smc911x compilation breakage

2007-04-28 Thread Vitaly Wool
Hello Jeff,

 Vitaly Wool wrote:
  Index: linux-2.6/drivers/net/smc911x.c
  ===
  --- linux-2.6.orig/drivers/net/smc911x.c
  +++ linux-2.6/drivers/net/smc911x.c
  @@ -75,9 +75,9 @@ static const char version[] =
   #include linux/netdevice.h
   #include linux/etherdevice.h
   #include linux/skbuff.h
  +#include linux/irq.h
   
   #include asm/io.h
  -#include asm/irq.h
   
   #include smc911x.h
 
 This seems to clash with rmk's comment at the top of linux/irq.h?

In a way, yes, but I just was fixing the compilation problem, and not
changing the logic in any way. The driver currently calls set_irq_type
so it has to include linux/irq.h, just as it had to include asm/irq.h
before.

I'd guess that set_irq_type better be called by generic code and either
just make the driver don't even bother or call a callback set by
platform part. If you're fine with any of these, and think it's better
than the initial patch, please let me know and I'll proceed with that.

Thanks,
   Vitaly

-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] smc911x: fix compilation breakage wjen debug is on

2007-04-27 Thread Vitaly Wool
Hello Jeff,

the patch below fixes compilation breakage of smc911x driver when 
ENABLE_SMC_DEBUG_PKTS equals to 1.

 smc911x.c |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

Signed-off-by: Vitaly Wool [EMAIL PROTECTED]

Index: linux-2.6/drivers/net/smc911x.c
===
--- linux-2.6.orig/drivers/net/smc911x.c
+++ linux-2.6/drivers/net/smc911x.c
@@ -499,7 +499,7 @@ static inline void   smc911x_rcv(struct n
SMC_SET_RX_CFG(RX_CFG_RX_END_ALGN4_ | ((28)  
RX_CFG_RXDOFF_));
SMC_PULL_DATA(data, pkt_len+2+3);
 
-   DBG(SMC_DEBUG_PKTS, %s: Received packet\n, dev-name,);
+   DBG(SMC_DEBUG_PKTS, %s: Received packet\n, dev-name);
PRINT_PKT(data, ((pkt_len - 4) = 64) ? pkt_len - 4 : 64);
dev-last_rx = jiffies;
skb-dev = dev;
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] fix smc911x compilation breakage

2007-04-27 Thread Vitaly Wool
Hi Jeff,

currently (with 2.6.21) compilation of smc911x driver fails in the following 
way:

  CC  drivers/net/smc911x.o
/sandbox/vital/opensource/linux-2.6/drivers/net/smc911x.c: In function 
`smc911x_probe':
/sandbox/vital/opensource/linux-2.6/drivers/net/smc911x.c:2125: warning: 
implicit declaration of function `set_irq_type'
/sandbox/vital/opensource/linux-2.6/drivers/net/smc911x.c:2125: error: 
`IRQ_TYPE_EDGE_FALLING' undeclared (first use in this function)
/sandbox/vital/opensource/linux-2.6/drivers/net/smc911x.c:2125: error: (Each 
undeclared identifier is reported only once
/sandbox/vital/opensource/linux-2.6/drivers/net/smc911x.c:2125: error: for each 
function it appears in.)
make[3]: *** [drivers/net/smc911x.o] Error 1
make[2]: *** [drivers/net] Error 2
make[1]: *** [drivers] Error 2
make: *** [zImage] Error 2

The patch inlined below fixes the problem.

 smc911x.c |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

Signed-off-by: Vitaly Wool [EMAIL PROTECTED]

Index: linux-2.6/drivers/net/smc911x.c
===
--- linux-2.6.orig/drivers/net/smc911x.c
+++ linux-2.6/drivers/net/smc911x.c
@@ -75,9 +75,9 @@ static const char version[] =
 #include linux/netdevice.h
 #include linux/etherdevice.h
 #include linux/skbuff.h
+#include linux/irq.h
 
 #include asm/io.h
-#include asm/irq.h
 
 #include smc911x.h
 
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] smc911x: fix netpoll compilation faliure

2006-12-15 Thread Vitaly Wool
Hello folks,

the trivial patch below fixes the compilation failure for smc911x.c when 
NET_POLL_CONTROLLER is set.

 drivers/net/smc911x.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Signed-off-by: Vitaly Wool [EMAIL PROTECTED]

diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c
index 2c43433..797ab91 100644
--- a/drivers/net/smc911x.c
+++ b/drivers/net/smc911x.c
@@ -1331,7 +1331,7 @@ smc911x_rx_dma_irq(int dma, void *data)
 static void smc911x_poll_controller(struct net_device *dev)
 {
disable_irq(dev-irq);
-   smc911x_interrupt(dev-irq, dev, NULL);
+   smc911x_interrupt(dev-irq, dev);
enable_irq(dev-irq);
 }
 #endif
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH/RFC] add netpoll support for gianfar

2006-11-07 Thread Vitaly Wool
On Mon, 6 Nov 2006 15:26:33 -0600
Andy Fleming [EMAIL PROTECTED] wrote:
 
 You are passing extra arguments, here

Oh yes, thanks. I was out of sync here.

 1) Do we need the disable/enable irq stuff?  It seems like we should  
 be able to either just *mask* the interrupts at the controller, or  
 rely on the locks to disable the interrupts.

I don't see how masking the ints at the controller differs much from 
disable_irq.
Locking all the interrupts is definitely worse than disabling selected ones. 
Also, introducing locks here means that we'll need to handle that specifically 
for -rt kernels.
 
 2) If we are calling gfar_transmit and gfar_receive, shouldn't we  
 call gfar_error?
 
 3) I think it should be possible to just call gfar_interrupt() in  
 every situation, but I'm not very familiar with net poll's  
 requirements (You can add that into your evaluation of #1, too).

Oh yes, that's a nice idea, thanks.

Vitaly
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH/RFC] add netpoll support for gianfar: respin

2006-11-07 Thread Vitaly Wool
The patch inlined below adds NET_POLL_CONTROLLER support for gianfar network 
driver, slightly modified wrt the comments from Andy Fleming.

 drivers/net/gianfar.c |   33 +
 1 file changed, 33 insertions(+)

Signed-off-by: Vitaly Wool [EMAIL PROTECTED]
  
Index: powerpc/drivers/net/gianfar.c
===
--- powerpc.orig/drivers/net/gianfar.c
+++ powerpc/drivers/net/gianfar.c
@@ -133,6 +133,9 @@ static void gfar_set_hash_for_addr(struc
 #ifdef CONFIG_GFAR_NAPI
 static int gfar_poll(struct net_device *dev, int *budget);
 #endif
+#ifdef CONFIG_NET_POLL_CONTROLLER
+static void gfar_netpoll(struct net_device *dev);
+#endif
 int gfar_clean_rx_ring(struct net_device *dev, int rx_work_limit);
 static int gfar_process_frame(struct net_device *dev, struct sk_buff *skb, int 
length);
 static void gfar_vlan_rx_register(struct net_device *netdev,
@@ -260,6 +263,9 @@ static int gfar_probe(struct platform_de
dev-poll = gfar_poll;
dev-weight = GFAR_DEV_WEIGHT;
 #endif
+#ifdef CONFIG_NET_POLL_CONTROLLER
+   dev-poll_controller = gfar_netpoll;
+#endif
dev-stop = gfar_close;
dev-get_stats = gfar_get_stats;
dev-change_mtu = gfar_change_mtu;
@@ -1536,6 +1542,33 @@ static int gfar_poll(struct net_device *
 }
 #endif
 
+#ifdef CONFIG_NET_POLL_CONTROLLER
+/*
+ * Polling 'interrupt' - used by things like netconsole to send skbs
+ * without having to re-enable interrupts. It's not called while
+ * the interrupt routine is executing.
+ */
+static void gfar_netpoll(struct net_device *dev)
+{
+   struct gfar_private *priv = netdev_priv(dev);
+
+   /* If the device has multiple interrupts, run tx/rx */
+   if (priv-einfo-device_flags  FSL_GIANFAR_DEV_HAS_MULTI_INTR) {
+   disable_irq(priv-interruptTransmit);
+   disable_irq(priv-interruptReceive);
+   disable_irq(priv-interruptError);
+   gfar_interrupt(priv-interruptTransmit, dev);
+   enable_irq(priv-interruptError);
+   enable_irq(priv-interruptReceive);
+   enable_irq(priv-interruptTransmit);
+   } else {
+   disable_irq(priv-interruptTransmit);
+   gfar_interrupt(priv-interruptTransmit, dev);
+   enable_irq(priv-interruptTransmit);
+   }
+}
+#endif
+
 /* The interrupt handler for devices with one interrupt */
 static irqreturn_t gfar_interrupt(int irq, void *dev_id)
 {

-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html