summaryrefslogtreecommitdiff
path: root/cleopatre/devkit/plcdrv/arm/src/linux_drv.c
diff options
context:
space:
mode:
authorsave2010-04-21 12:28:23 +0000
committersave2010-04-21 12:28:23 +0000
commitf0deffea7ccd1bc18b0a6ba3e953f8f0058636f7 (patch)
tree38cc91c93b5f68be3ec905b8a15ac39ca3bc1129 /cleopatre/devkit/plcdrv/arm/src/linux_drv.c
parent473a1d0cf9b53b4a2299cd39f2917b9eb0375fe7 (diff)
cleo/devkit/plcdrv: add a window of sent buffers, closes #1418
git-svn-id: svn+ssh://pessac/svn/cesar/trunk@6945 017c9cb6-072f-447c-8318-d5b54f68fe89
Diffstat (limited to 'cleopatre/devkit/plcdrv/arm/src/linux_drv.c')
-rw-r--r--cleopatre/devkit/plcdrv/arm/src/linux_drv.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/cleopatre/devkit/plcdrv/arm/src/linux_drv.c b/cleopatre/devkit/plcdrv/arm/src/linux_drv.c
index 53850ad8ba..9db887f145 100644
--- a/cleopatre/devkit/plcdrv/arm/src/linux_drv.c
+++ b/cleopatre/devkit/plcdrv/arm/src/linux_drv.c
@@ -45,6 +45,7 @@
#include "linux_drv.h"
#include "processing.h"
#include "mailbox.h"
+#include "hal.h"
#include "registers.h"
#else
#include "common.h"
@@ -73,6 +74,9 @@ MODULE_LICENSE("SPiDCOM Technologies 2009");
#define DEFAULT_NB_MME_BUFFERS 1
#define DEFAULT_NB_INTERFACE_BUFFERS 2
+/** Max allowed TX message in the same time */
+#define MBX_TX_POOL (L2A_RING_SIZE / MAX_MSG_SIZE / 2)
+
/** These identify the driver base version */
static char version[] __devinitdata = DRV_NAME " PLC driver v" DRV_VERSION " (" DRV_RELDATE ")\n";
@@ -809,10 +813,15 @@ int free_buffer(void *packet, enum free_reason reason)
case RX_DROP: priv->stats.rx_dropped++;
break;
case TX_DROP: priv->stats.tx_dropped++;
+ priv->plc_stats.tx_pool--;
+ if(netif_queue_stopped(plcdrv_device))
+ netif_wake_queue(plcdrv_device);
break;
case TX_COMPLETE: priv->stats.tx_packets++;
priv->stats.tx_bytes += skb->len;
priv->plc_stats.tx_pool--;
+ if(netif_queue_stopped(plcdrv_device))
+ netif_wake_queue(plcdrv_device);
break;
default:
break;
@@ -970,11 +979,12 @@ int plcdrv_tx(struct sk_buff *skb, struct net_device *dev)
status = processing_send((void *)skb->data, skb->len);
//Tx queue is nearly full we must stop it
- if(status == NEARLY_FULL)
+ if(status == NEARLY_FULL ||
+ priv->plc_stats.tx_pool == MBX_TX_POOL - 1)
{
netif_stop_queue(dev);
priv->plc_stats.tx_pool++; // update plc stats
- printk(KERN_WARNING DRV_NAME ": %s: TX queue nearly Full\n", dev->name);
+ TRACE("TX queue nearly Full\n");
}
//Tx queue is full drop the frame
else if(status == FULL)