summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/sm-plc-drv/src/linux_drv.c2
-rwxr-xr-xapp/sm-plc-drv/src/mac_frame.c11
-rw-r--r--app/sm-plc-drv/src/plc_sysctl.c7
-rwxr-xr-xapp/sm-plc-drv/src/plcp_fmode.c8
-rw-r--r--include/platform.h39
5 files changed, 52 insertions, 15 deletions
diff --git a/app/sm-plc-drv/src/linux_drv.c b/app/sm-plc-drv/src/linux_drv.c
index 44366163c1..0a413e2085 100644
--- a/app/sm-plc-drv/src/linux_drv.c
+++ b/app/sm-plc-drv/src/linux_drv.c
@@ -118,7 +118,9 @@ LIST_HEAD (skb_free_queue);
* GLOBAL VAR
*/
spinlock_t lock_SIOCGHOST = SPIN_LOCK_UNLOCKED;
+#ifndef CONFIG_VERSION_16M
static struct user_host global_user_host;
+#endif
static struct net_device plc_dev = {.name = "plc%d" };
struct net_device *p_dev = &plc_dev;
diff --git a/app/sm-plc-drv/src/mac_frame.c b/app/sm-plc-drv/src/mac_frame.c
index 287b8c5220..9611e04ca9 100755
--- a/app/sm-plc-drv/src/mac_frame.c
+++ b/app/sm-plc-drv/src/mac_frame.c
@@ -14,10 +14,19 @@
// max_xmit_skb=3072 is a good value for troughput with 32 slaves, but that take too many memory...
// For the moment, i decrease the value for dodge the no memory crash. And i change the BUFFER_ISOLATION in mac_tx.c
// The crash memory is easy to do : send broadcast flow on the master with 10 mbit/s, and this fifo will be full.
-int max_xmit_skb = 2048;
+#if defined(CONFIG_VERSION_16M)
+int max_xmit_skb = 512; //512
+#else
+int max_xmit_skb = 2048; //512
+#endif
+
module_param(max_xmit_skb, int, 0644);
+#if defined(CONFIG_VERSION_16M)
+int max_recv_skb = 256;
+#else
int max_recv_skb = 512;
+#endif
module_param(max_recv_skb, int, 0644);
struct mac_frame *mac_tx_frames;
diff --git a/app/sm-plc-drv/src/plc_sysctl.c b/app/sm-plc-drv/src/plc_sysctl.c
index 23eb728e7f..53b2317788 100644
--- a/app/sm-plc-drv/src/plc_sysctl.c
+++ b/app/sm-plc-drv/src/plc_sysctl.c
@@ -2577,7 +2577,7 @@ static int sysctl_tx_more_slots(ctl_table *table,
return 0;
}
-
+#ifndef CONFIG_VERSION_16M
static int sysctl_bands(ctl_table *table,
int __user *name, int nlen,
void __user *oldval, size_t __user *oldlenp,
@@ -2659,6 +2659,7 @@ static int sysctl_bands(ctl_table *table,
return 0;
}
+#endif
static int sysctl_bands_together (ctl_table *table,
int __user *name, int nlen,
@@ -7817,7 +7818,8 @@ static ctl_table plc_table[] =
.proc_handler = &std_proc_handler,
.strategy = &sysctl_shaker,
},
- {
+#ifndef CONFIG_VERSION_16M
+ {
.ctl_name = PLC_BANDS,
.procname = "bands",
.data = NULL,
@@ -7826,6 +7828,7 @@ static ctl_table plc_table[] =
.proc_handler = &std_proc_handler,
.strategy = &sysctl_bands
},
+#endif
{
.ctl_name = PLC_FCS,
.procname = "fcs",
diff --git a/app/sm-plc-drv/src/plcp_fmode.c b/app/sm-plc-drv/src/plcp_fmode.c
index a56f14d348..54189c9654 100755
--- a/app/sm-plc-drv/src/plcp_fmode.c
+++ b/app/sm-plc-drv/src/plcp_fmode.c
@@ -2123,7 +2123,9 @@ static void __fake_tx_end(struct plc_drv_unit *unit, struct plcp_frame *pframe)
pmd_set_dsp_pilots(dsp_pilots);
// restore power on pilots
+#ifndef CONFIG_VERSION_16M
plcp_restore_pilots();
+#endif
if (plcp_callbacks_fn->tx_status) {
plcp_callbacks_fn->tx_status(unit, pframe);
}
@@ -2494,8 +2496,10 @@ static void __idle(struct plc_drv_unit *unit) {
pmd_set_dsp_pilots(dsp_pilots);
// restore power on pilots and all bands
+#ifndef CONFIG_VERSION_16M
plcp_restore_pilots();
- plcp_data_power(0);
+#endif
+ plcp_data_power(0);
// CHRIS: eog is controlled on drop, and on phy_cca_request
unit->PMD->eof_irq_mask=0;
@@ -2947,7 +2951,9 @@ static int __tx_more(struct plc_drv_unit *unit, uint16_t date) {
// switch off pilots for none bands to avoid false start detection on it.
// special behaviour for PLCP_CID_NONE, let the pilots.
if(pframe->uchannel->index > 0){
+#ifndef CONFIG_VERSION_16M
plcp_update_pilots(unit, pframe->uchannel);
+#endif
}
PLCP_VERBOSE(0, "data gain", pframe->data_gain);
diff --git a/include/platform.h b/include/platform.h
index 72ecfe83cf..42136de201 100644
--- a/include/platform.h
+++ b/include/platform.h
@@ -47,7 +47,31 @@
/* TOP-LEVEL include to set/change the defines related to memory cunsomption/usage */
+#if defined(CONFIG_VERSION_16M)
+
+#define PB_POOL_RING_SIZE (1024)
+
+#define DMA_RX_POOL2_NB_BUFFER 8
+#define DMA_RX_POOL1_NB_BUFFER 16
+#define DMA_RX_POOL0_NB_BUFFER 128
+
+#define DMA_TX_POOL2_NB_BUFFER 8
+#define DMA_TX_POOL1_NB_BUFFER 16
+#define DMA_TX_POOL0_NB_BUFFER 128
+
+#else
+
#define PB_POOL_RING_SIZE (2048)
+
+#define DMA_RX_POOL2_NB_BUFFER 64
+#define DMA_RX_POOL1_NB_BUFFER 64
+#define DMA_RX_POOL0_NB_BUFFER 128
+
+#define DMA_TX_POOL2_NB_BUFFER 64
+#define DMA_TX_POOL1_NB_BUFFER 64
+#define DMA_TX_POOL0_NB_BUFFER 128
+#endif
+
#define PB_DMA_POOL_SIZE (PB_POOL_RING_SIZE*224)
//#define DMA_ZONE_SIZE (0x00300000)
@@ -58,14 +82,6 @@
#define DMA_POOL1_BUFFER_SIZE (4096)
#define DMA_POOL0_BUFFER_SIZE (256)
-#define DMA_RX_POOL2_NB_BUFFER 32
-#define DMA_RX_POOL1_NB_BUFFER 32
-#define DMA_RX_POOL0_NB_BUFFER 128
-
-#define DMA_TX_POOL2_NB_BUFFER 32
-#define DMA_TX_POOL1_NB_BUFFER 32
-#define DMA_TX_POOL0_NB_BUFFER 128
-
#define DMA_RX_POOL2_SIZE (DMA_RX_POOL2_NB_BUFFER * DMA_POOL2_BUFFER_SIZE)
#define DMA_RX_POOL1_SIZE (DMA_RX_POOL1_NB_BUFFER * DMA_POOL1_BUFFER_SIZE)
#define DMA_RX_POOL0_SIZE (DMA_RX_POOL0_NB_BUFFER * DMA_POOL0_BUFFER_SIZE)
@@ -84,9 +100,10 @@
#define DMA_ZONE_USED_SIZE (PLC_DMA_ZONE_SIZE + ETH_DMA_ZONE_SIZE)
#define DMA_ZONE_SIZE (((DMA_ZONE_USED_SIZE + 0x100000 - 1) / 0x100000) * 0x100000)
-#if DMA_ZONE_SIZE != 0x300000
-#error "rrah"
-#endif
+
+//#if DMA_ZONE_SIZE < 0x300000
+//#error "rrah"
+//#endif
#define PLC_DMA_RX_BASE (DMA_zone_base+ETH_DMA_ZONE_SIZE)
#define PLC_DMA_TX_BASE (PLC_DMA_RX_BASE+DMA_RX_POOL_SIZE)