summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThierry Carre2008-03-27 13:48:29 +0100
committerThierry Carre2008-03-27 13:48:29 +0100
commit4e62b4ce9763f34b476cca6addc4fc25cabe8f8c (patch)
tree6ccb853945ba384800c961dbcb434fb86397ba5c
parent6c3b0fe9c4cf268c748f71b1721875162ed0c196 (diff)
Increase only data buffer
-rwxr-xr-xapp/sm-mib/mib-interface.h7
-rwxr-xr-xapp/sm-plc-drv/inc/test_core.h2
-rw-r--r--app/sm-plc-drv/src/linux_drv.c2
-rw-r--r--app/sm-plc-drv/src/mac_rx.c8
-rw-r--r--app/sm-plc-drv/src/mac_tx.c8
-rw-r--r--app/sm-plc-drv/src/plcp_frame.c2
-rw-r--r--app/sm-plc-drv/src/test_core.c25
-rw-r--r--include/platform.h13
8 files changed, 31 insertions, 36 deletions
diff --git a/app/sm-mib/mib-interface.h b/app/sm-mib/mib-interface.h
index 2e41ba345c..4a1eb29a1f 100755
--- a/app/sm-mib/mib-interface.h
+++ b/app/sm-mib/mib-interface.h
@@ -38,13 +38,6 @@ typedef int BOOL;
#define PMD_CARRIERS_PER_BAND (PMD_CARRIERS_PER_GROUP*PMD_GROUPS_PER_BAND)
#define MAX_AGC_SAMPLES 2000
-
-#define PLCP_MAX_HOST_BROADCAST 1
-#define PLCP_MAX_HOST_UNICAST 64
-#define PLCP_MAX_HOST_MULTICAST 4
-
-#define PLCP_MAX_HOST (PLCP_MAX_HOST_UNICAST + PLCP_MAX_HOST_MULTICAST + PLCP_MAX_HOST_BROADCAST)
-
#define MAX_COMMUNITY_NAME_SIZE 128 //(definition corresponiding to ASN_MAX_NAME_LEN defined in asn1.h)
/***************************************************************************
*
diff --git a/app/sm-plc-drv/inc/test_core.h b/app/sm-plc-drv/inc/test_core.h
index a8f85a80ed..50855d1fec 100755
--- a/app/sm-plc-drv/inc/test_core.h
+++ b/app/sm-plc-drv/inc/test_core.h
@@ -111,11 +111,13 @@ struct testmsg {
/*
* Definition Fonctions Kernel
*/
+#ifdef CONFIG_PLC_MEASURES
int make_test_frame (struct testioctl *test);
void test_raw_handle_tx (struct plc_drv_unit *unit, struct plcp_host *host, struct plcp_frame *pframe, bool failed);
void test_raw_handle_rx (struct plc_drv_unit *unit, struct plcp_host *host, struct plcp_frame *pframe, bool failed);
void test_ber_handle_tx (struct plc_drv_unit *unit, struct plcp_host *host, struct plcp_frame *pframe, bool failed);
void test_ber_handle_rx (struct plc_drv_unit *unit, struct plcp_host *host, struct plcp_frame *pframe, bool failed);
+#endif
#ifdef CONFIG_PLC_PPC
extern int shared_irq_type;
diff --git a/app/sm-plc-drv/src/linux_drv.c b/app/sm-plc-drv/src/linux_drv.c
index 11695ff724..155e5e63d6 100644
--- a/app/sm-plc-drv/src/linux_drv.c
+++ b/app/sm-plc-drv/src/linux_drv.c
@@ -1284,6 +1284,7 @@ int plc_ioctl (struct net_device *dev, struct ifreq *ifr, int cmd)
//PR51 END:
#endif
+#ifdef CONFIG_PLC_MEASURES
case SIOCTEST: //test mode RAW et mode BER
if (copy_from_user (&test.usr, (struct testusr **) ifr->ifr_data, sizeof (struct testusr *)))
{
@@ -1303,6 +1304,7 @@ int plc_ioctl (struct net_device *dev, struct ifreq *ifr, int cmd)
wait_event_interruptible (wq, sleep_flag == 0);
sleep_flag = 1;
break;
+#endif
default:
return -EOPNOTSUPP;
diff --git a/app/sm-plc-drv/src/mac_rx.c b/app/sm-plc-drv/src/mac_rx.c
index 37604f7d73..307a55f98f 100644
--- a/app/sm-plc-drv/src/mac_rx.c
+++ b/app/sm-plc-drv/src/mac_rx.c
@@ -52,23 +52,27 @@ void mng_handle_rx (struct plc_drv_unit *unit, struct plcp_host *host, struct pl
uint8_t subtype = pframe->control->l_frm.subtype;
wd_trigger ();
- wd_trigger ();
- if (subtype == MA_SUBTYPE_TEST_RAW)
+ if (0) {/*nothing*/}
+#ifdef CONFIG_PLC_MEASURES
+ else if (subtype == MA_SUBTYPE_TEST_RAW)
{
TEST_PRINTK ("MA_SUBTYPE_TEST_RAW") test_raw_handle_rx (unit, host, pframe, failed);
unit->stats.drv.handle_rx_test++;
}
+#endif
#ifdef CONFIG_PLC_PPC
else if (subtype == MA_SUBTYPE_PEPSI)
{
pepsi_handle_rx (unit, host, pframe, failed);
}
#endif
+#ifdef CONFIG_PLC_MEASURES
else if (subtype == MA_SUBTYPE_TEST_BER)
{
TEST_PRINTK ("MA_SUBTYPE_TEST_BER") test_ber_handle_rx (unit, host, pframe, failed);
unit->stats.drv.handle_rx_ber++;
}
+#endif
else if (is_channel_estimation (subtype))
{
ce_handle_rx (unit, host, pframe, failed);
diff --git a/app/sm-plc-drv/src/mac_tx.c b/app/sm-plc-drv/src/mac_tx.c
index b10a72babd..5eb7e61175 100644
--- a/app/sm-plc-drv/src/mac_tx.c
+++ b/app/sm-plc-drv/src/mac_tx.c
@@ -352,11 +352,15 @@ void mng_handle_tx (struct plc_drv_unit *unit, struct plcp_frame *pframe)
wd_trigger ();
subtype = pframe->control->l_frm.subtype;
- if (subtype == MA_SUBTYPE_TEST_RAW)
+
+ if (0) {}
+#ifdef CONFIG_PLC_MEASURES
+ else if (subtype == MA_SUBTYPE_TEST_RAW)
{
test_raw_handle_tx (unit, host, pframe, failed);
unit->stats.drv.handle_tx_test++;
}
+#endif
#ifdef CONFIG_PLC_PPC
else if (subtype == MA_SUBTYPE_PEPSI)
{
@@ -364,11 +368,13 @@ void mng_handle_tx (struct plc_drv_unit *unit, struct plcp_frame *pframe)
return;
}
#endif
+#ifdef CONFIG_PLC_MEASURES
else if (subtype == MA_SUBTYPE_TEST_BER)
{
test_ber_handle_tx (unit, host, pframe, failed);
unit->stats.drv.handle_tx_test++;
}
+#endif
else if (is_channel_estimation (subtype))
{
ce_handle_tx (unit, host, pframe, failed);
diff --git a/app/sm-plc-drv/src/plcp_frame.c b/app/sm-plc-drv/src/plcp_frame.c
index 6008066e49..3840a3f535 100644
--- a/app/sm-plc-drv/src/plcp_frame.c
+++ b/app/sm-plc-drv/src/plcp_frame.c
@@ -166,7 +166,6 @@ struct dma_node *dma_tx_alloc_node (int size)
i++;
}
RT_PRINTK ("dma_tx_alloc_node(%d) failed - oversize\n");
- rt_printk ("dma_tx_alloc_node(%d) failed - oversize\n");
ESTAT (dma_tx_alloc_node.invalid++);
return NULL;
}
@@ -188,7 +187,6 @@ struct dma_node *dma_rx_alloc_node (int size)
{
ESTAT (dma_rx_alloc_node.invalid++);
LOCK_RESTORE (flags);
-// RT_PRINTK("dma_rx_alloc_node(%d) failed\n");
return NULL;
}
node = list_entry (pool->queue.next, struct dma_node, link);
diff --git a/app/sm-plc-drv/src/test_core.c b/app/sm-plc-drv/src/test_core.c
index 1bc96dfb9b..92554e5dc2 100644
--- a/app/sm-plc-drv/src/test_core.c
+++ b/app/sm-plc-drv/src/test_core.c
@@ -25,6 +25,8 @@ int shared_irq_type;
/*
* functions definitions
*/
+
+#ifdef CONFIG_PLC_MEASURES
//fabrication de la pframe a emettre (type raw ou ber)
int make_test_frame (struct testioctl *test)
{
@@ -165,28 +167,8 @@ void test_raw_handle_rx (struct plc_drv_unit *unit, struct plcp_host *host, stru
//d_len = longueur reelle de la pframe
if (pframe->control->l_frm.res[1])
pframe->d_len -= (PMD_SLICE_SIZE - pframe->control->l_frm.res[1]);
-#if 0
- printk ("TEST:\nframe =\n");
- printk ("\ttaille before: %d\n", pframe->d_len);
-
- printk ("\ttaille after: %d\n", pframe->d_len);
- printk ("\tData_gain: %d\n", pframe->data_gain);
- printk ("\tCrtl_gain: %d\n", pframe->ctrl_gain);
- printk ("\tcontrol =\n");
- printk ("\t\tSTEI: %d\n", pframe->control->STEI);
- printk ("\t\tDTEI: %d\n", pframe->control->DTEI);
- printk ("\t\tChannel-id: %d\n", pframe->control->channel_id);
- printk ("\t\tSubtype: %d\n", pframe->control->subtype);
- printk ("\t\tBssid: %d\n", pframe->control->bssid);
- printk ("\t\tType: %d\n", pframe->control->type);
- printk ("\t\tRes[0]: %d\n", pframe->control->res[0]);
- printk ("\t\tRes[1]: %d\n", pframe->control->res[1]);
- printk ("\ndatas:");
- for (i = 0; i < pframe->d_len; i++)
- printk (" %02x", pframe->d_buf[i]);
- printk (" fin\n");
-#endif
envoi = (struct testraweth *) rt_malloc (sizeof (struct testraweth)); //ATTENTION le tas sous RTAI doit etre au min de 256
+
if (!envoi)
{
printk ("could not allocate BER frame\n");
@@ -402,3 +384,4 @@ irqreturn_t test_r2l (int irq, void *dev_id, struct pt_regs *regs)
}
return IRQ_HANDLED;
}
+#endif
diff --git a/include/platform.h b/include/platform.h
index 5a3a9c0a36..67ae421a06 100644
--- a/include/platform.h
+++ b/include/platform.h
@@ -47,7 +47,14 @@
/* TOP-LEVEL include to set/change the defines related to memory cunsomption/usage */
-#if defined(CONFIG_VERSION_16M)
+// not really the choice !
+#define PLCP_MAX_HOST_BROADCAST 1
+#define PLCP_MAX_HOST_UNICAST 64
+#define PLCP_MAX_HOST_MULTICAST 4
+
+#define PLCP_MAX_HOST (PLCP_MAX_HOST_UNICAST + PLCP_MAX_HOST_MULTICAST + PLCP_MAX_HOST_BROADCAST)
+
+#ifdef CONFIG_VERSION_16M
#define PB_POOL_RING_SIZE (1024)
@@ -63,11 +70,11 @@
#define PB_POOL_RING_SIZE (2048)
-#define DMA_RX_POOL2_NB_BUFFER 32
+#define DMA_RX_POOL2_NB_BUFFER PLCP_MAX_HOST
#define DMA_RX_POOL1_NB_BUFFER 32
#define DMA_RX_POOL0_NB_BUFFER 128
-#define DMA_TX_POOL2_NB_BUFFER 32
+#define DMA_TX_POOL2_NB_BUFFER PLCP_MAX_HOST
#define DMA_TX_POOL1_NB_BUFFER 32
#define DMA_TX_POOL0_NB_BUFFER 128
#endif