Commit 495a4e85 authored by Aurelio Colosimo's avatar Aurelio Colosimo

spec: buffers alignment

buf_in and buf_out need to be aligned, in order not to have bug in msg_pack
and msg_unpack functions. This issue should be better fixed than what done
with the present patch.
parent fd4dbce4
......@@ -28,7 +28,9 @@ void spec_main_loop(struct pp_instance *ppi)
*/
delay_ms = pp_state_machine(ppi, NULL, 0);
while (1) {
unsigned char packet[1500];
unsigned char _packet[1500];
/* FIXME Alignment */
unsigned char *packet = _packet + 2;
/* Wait for a packet or for the timeout */
while (delay_ms && !minic_poll_rx()) {
spec_udelay(1000);
......
......@@ -77,8 +77,9 @@ int spec_net_init(struct pp_instance *ppi)
ppi->buf_out = buffer_out;
ppi->buf_out = PROTO_PAYLOAD(ppi->buf_out);
//UDP only for now
pp_printf("spec_net_init UDP\n");
ppi->buf_out+= 4 - (((int)ppi->buf_out) % 4);
/* FIXME Alignment */
pp_printf("spec_net_init ETH %x\n",ppi->buf_out);
spec_open_ch(ppi);
return 0;
......
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