Commit 929a686b authored by julien.delange's avatar julien.delange
Browse files

* po-hi-c/src/drivers/po_hi_driver_rasta_spacewire.c

   po-hi-c/src/drivers/po_hi_driver_rasta_common.c
     - Avoid warnings

 * po-hi-c/src/drivers/po_hi_driver_linux_serial.c
     - Ensure that the received size is consistent
       and that the destination port is not out of bounds


git-svn-id: https://tecsw.estec.esa.int/svn/taste/trunk/po-hi-c@1862 129961e7-ef38-4bb5-a8f7-c9a525a55882
parent 48921624
......@@ -80,6 +80,11 @@ void __po_hi_c_driver_serial_linux_poller (void)
return;
}
if (n != __PO_HI_MESSAGES_MAX_SIZE)
{
__PO_HI_DEBUG_CRITICAL ("[LINUX SERIAL] Inconsistent received message size !\n");
return;
}
__PO_HI_DEBUG_DEBUG ("[LINUX SERIAL] read() returns %d\n", n);
......@@ -102,6 +107,12 @@ void __po_hi_c_driver_serial_linux_poller (void)
__po_hi_unmarshall_request (&request, &msg);
if (request.port > __PO_HI_NB_PORTS)
{
__PO_HI_DEBUG_WARNING ("[LINUX SERIAL] Invalid port number !\n");
return;
}
__PO_HI_DEBUG_INFO ("[LINUX SERIAL] Destination port: %d\n", request.port);
__po_hi_main_deliver (&request);
}
......
......@@ -333,7 +333,6 @@ int __po_hi_rasta_register(void)
/* Start AMBA PnP scan at first AHB bus */
amba_scan (&abus,__po_hi_driver_rasta_bar0+(AHB1_IOAREA_BASE_ADDR&~0xf0000000),&amba_maps[0]);
__PO_HI_DEBUG_DEBUG ("abus addr=%x\n", &abus);
/* Find GPIO0 address */
if ( __po_hi_rasta_get_gpio(&abus,0,&gpio0,NULL) ){
......
......@@ -179,6 +179,8 @@ int __po_hi_c_driver_spacewire_rasta_sender (const __po_hi_task_id task_id, cons
for(i=0; i<1; i++)
{
po_hi_c_driver_rasta_spacewire_init_pkt (&po_hi_c_driver_spacewire_txpkts[i], destination_port);
__PO_HI_DEBUG_INFO ("destination note = %d ...", po_hi_c_driver_spacewire_txpkts[i].addr);
}
memcpy (po_hi_c_driver_spacewire_txpkts[0].data, &msg, __PO_HI_MESSAGES_MAX_SIZE);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment