equal
deleted
inserted
replaced
205 current_size = fsm->slave->configured_tx_mailbox_size |
205 current_size = fsm->slave->configured_tx_mailbox_size |
206 - EC_MBOX_HEADER_SIZE - EC_FOE_HEADER_SIZE; |
206 - EC_MBOX_HEADER_SIZE - EC_FOE_HEADER_SIZE; |
207 } |
207 } |
208 |
208 |
209 data = ec_slave_mbox_prepare_send(fsm->slave, |
209 data = ec_slave_mbox_prepare_send(fsm->slave, |
210 fsm->mbox,EC_MBOX_TYPE_FILEACCESS, |
210 fsm->mbox, EC_MBOX_TYPE_FILEACCESS, |
211 current_size + EC_FOE_HEADER_SIZE); |
211 current_size + EC_FOE_HEADER_SIZE); |
212 if (IS_ERR(data)) |
212 if (IS_ERR(data)) |
213 return -1; |
213 return -1; |
214 |
214 |
215 EC_WRITE_U8 ( data, EC_FOE_OPCODE_DATA ); // OpCode = DataBlock req. |
215 EC_WRITE_U8 ( data, EC_FOE_OPCODE_DATA ); // OpCode = DataBlock req. |
314 |
314 |
315 #ifdef DEBUG_FOE |
315 #ifdef DEBUG_FOE |
316 printk("ec_fsm_foe_ack_check()\n"); |
316 printk("ec_fsm_foe_ack_check()\n"); |
317 #endif |
317 #endif |
318 |
318 |
319 if (!ec_mbox_is_datagram_state(mbox,EC_DATAGRAM_RECEIVED)) { |
319 if (!ec_mbox_is_datagram_state(mbox, EC_DATAGRAM_RECEIVED)) { |
320 ec_foe_set_rx_error(fsm, FOE_RECEIVE_ERROR); |
320 ec_foe_set_rx_error(fsm, FOE_RECEIVE_ERROR); |
321 EC_SLAVE_ERR(slave, "Failed to receive FoE mailbox check datagram: "); |
321 EC_SLAVE_ERR(slave, "Failed to receive FoE mailbox check datagram: "); |
322 ec_datagram_print_state(datagram); |
322 ec_datagram_print_state(datagram); |
323 return; |
323 return; |
324 } |
324 } |
325 |
325 |
326 if (!ec_mbox_is_datagram_wc(mbox,1)) { |
326 if (!ec_mbox_is_datagram_wc(mbox, 1)) { |
327 // slave did not put anything in the mailbox yet |
327 // slave did not put anything in the mailbox yet |
328 ec_foe_set_rx_error(fsm, FOE_WC_ERROR); |
328 ec_foe_set_rx_error(fsm, FOE_WC_ERROR); |
329 EC_SLAVE_ERR(slave, "Reception of FoE mailbox check datagram" |
329 EC_SLAVE_ERR(slave, "Reception of FoE mailbox check datagram" |
330 " failed: "); |
330 " failed: "); |
331 ec_datagram_print_wc_error(datagram); |
331 ec_datagram_print_wc_error(datagram); |
370 |
370 |
371 #ifdef DEBUG_FOE |
371 #ifdef DEBUG_FOE |
372 printk("ec_fsm_foe_ack_read()\n"); |
372 printk("ec_fsm_foe_ack_read()\n"); |
373 #endif |
373 #endif |
374 |
374 |
375 if (!ec_mbox_is_datagram_state(mbox,EC_DATAGRAM_RECEIVED)) { |
375 if (!ec_mbox_is_datagram_state(mbox, EC_DATAGRAM_RECEIVED)) { |
376 ec_foe_set_rx_error(fsm, FOE_RECEIVE_ERROR); |
376 ec_foe_set_rx_error(fsm, FOE_RECEIVE_ERROR); |
377 EC_SLAVE_ERR(slave, "Failed to receive FoE ack response datagram: "); |
377 EC_SLAVE_ERR(slave, "Failed to receive FoE ack response datagram: "); |
378 ec_datagram_print_state(datagram); |
378 ec_datagram_print_state(datagram); |
379 return; |
379 return; |
380 } |
380 } |
381 |
381 |
382 if (!ec_mbox_is_datagram_wc(mbox,1)) { |
382 if (!ec_mbox_is_datagram_wc(mbox, 1)) { |
383 ec_foe_set_rx_error(fsm, FOE_WC_ERROR); |
383 ec_foe_set_rx_error(fsm, FOE_WC_ERROR); |
384 EC_SLAVE_ERR(slave, "Reception of FoE ack response failed: "); |
384 EC_SLAVE_ERR(slave, "Reception of FoE ack response failed: "); |
385 ec_datagram_print_wc_error(datagram); |
385 ec_datagram_print_wc_error(datagram); |
386 return; |
386 return; |
387 } |
387 } |
448 |
448 |
449 #ifdef DEBUG_FOE |
449 #ifdef DEBUG_FOE |
450 printk("ec_foe_state_sent_wrq()\n"); |
450 printk("ec_foe_state_sent_wrq()\n"); |
451 #endif |
451 #endif |
452 |
452 |
453 if (!ec_mbox_is_datagram_state(mbox,EC_DATAGRAM_RECEIVED)) { |
453 if (!ec_mbox_is_datagram_state(mbox, EC_DATAGRAM_RECEIVED)) { |
454 ec_foe_set_rx_error(fsm, FOE_RECEIVE_ERROR); |
454 ec_foe_set_rx_error(fsm, FOE_RECEIVE_ERROR); |
455 EC_SLAVE_ERR(slave, "Failed to send FoE WRQ: "); |
455 EC_SLAVE_ERR(slave, "Failed to send FoE WRQ: "); |
456 ec_datagram_print_state(datagram); |
456 ec_datagram_print_state(datagram); |
457 return; |
457 return; |
458 } |
458 } |
459 |
459 |
460 if (!ec_mbox_is_datagram_wc(mbox,1)) { |
460 if (!ec_mbox_is_datagram_wc(mbox, 1)) { |
461 // slave did not put anything in the mailbox yet |
461 // slave did not put anything in the mailbox yet |
462 ec_foe_set_rx_error(fsm, FOE_WC_ERROR); |
462 ec_foe_set_rx_error(fsm, FOE_WC_ERROR); |
463 EC_SLAVE_ERR(slave, "Reception of FoE WRQ failed: "); |
463 EC_SLAVE_ERR(slave, "Reception of FoE WRQ failed: "); |
464 ec_datagram_print_wc_error(datagram); |
464 ec_datagram_print_wc_error(datagram); |
465 return; |
465 return; |
490 |
490 |
491 #ifdef DEBUG_FOE |
491 #ifdef DEBUG_FOE |
492 printk("ec_fsm_foe_state_data_sent()\n"); |
492 printk("ec_fsm_foe_state_data_sent()\n"); |
493 #endif |
493 #endif |
494 |
494 |
495 if (!ec_mbox_is_datagram_state(mbox,EC_DATAGRAM_RECEIVED)) { |
495 if (!ec_mbox_is_datagram_state(mbox, EC_DATAGRAM_RECEIVED)) { |
496 ec_foe_set_tx_error(fsm, FOE_RECEIVE_ERROR); |
496 ec_foe_set_tx_error(fsm, FOE_RECEIVE_ERROR); |
497 EC_SLAVE_ERR(slave, "Failed to receive FoE ack response datagram: "); |
497 EC_SLAVE_ERR(slave, "Failed to receive FoE ack response datagram: "); |
498 ec_datagram_print_state(datagram); |
498 ec_datagram_print_state(datagram); |
499 return; |
499 return; |
500 } |
500 } |
501 |
501 |
502 if (!ec_mbox_is_datagram_wc(mbox,1)) { |
502 if (!ec_mbox_is_datagram_wc(mbox, 1)) { |
503 ec_foe_set_tx_error(fsm, FOE_WC_ERROR); |
503 ec_foe_set_tx_error(fsm, FOE_WC_ERROR); |
504 EC_SLAVE_ERR(slave, "Reception of FoE data send failed: "); |
504 EC_SLAVE_ERR(slave, "Reception of FoE data send failed: "); |
505 ec_datagram_print_wc_error(datagram); |
505 ec_datagram_print_wc_error(datagram); |
506 return; |
506 return; |
507 } |
507 } |
578 |
578 |
579 #ifdef DEBUG_FOE |
579 #ifdef DEBUG_FOE |
580 printk("ec_foe_state_rrq_sent()\n"); |
580 printk("ec_foe_state_rrq_sent()\n"); |
581 #endif |
581 #endif |
582 |
582 |
583 if (!ec_mbox_is_datagram_state(mbox,EC_DATAGRAM_RECEIVED)) { |
583 if (!ec_mbox_is_datagram_state(mbox, EC_DATAGRAM_RECEIVED)) { |
584 ec_foe_set_rx_error(fsm, FOE_RECEIVE_ERROR); |
584 ec_foe_set_rx_error(fsm, FOE_RECEIVE_ERROR); |
585 EC_SLAVE_ERR(slave, "Failed to send FoE RRQ: "); |
585 EC_SLAVE_ERR(slave, "Failed to send FoE RRQ: "); |
586 ec_datagram_print_state(datagram); |
586 ec_datagram_print_state(datagram); |
587 return; |
587 return; |
588 } |
588 } |
589 |
589 |
590 if (!ec_mbox_is_datagram_wc(mbox,1)) { |
590 if (!ec_mbox_is_datagram_wc(mbox, 1)) { |
591 // slave did not put anything in the mailbox yet |
591 // slave did not put anything in the mailbox yet |
592 ec_foe_set_rx_error(fsm, FOE_WC_ERROR); |
592 ec_foe_set_rx_error(fsm, FOE_WC_ERROR); |
593 EC_SLAVE_ERR(slave, "Reception of FoE RRQ failed: "); |
593 EC_SLAVE_ERR(slave, "Reception of FoE RRQ failed: "); |
594 ec_datagram_print_wc_error(datagram); |
594 ec_datagram_print_wc_error(datagram); |
595 return; |
595 return; |
668 |
668 |
669 #ifdef DEBUG_FOE |
669 #ifdef DEBUG_FOE |
670 printk("ec_fsm_foe_state_data_check()\n"); |
670 printk("ec_fsm_foe_state_data_check()\n"); |
671 #endif |
671 #endif |
672 |
672 |
673 if (!ec_mbox_is_datagram_state(mbox,EC_DATAGRAM_RECEIVED)) { |
673 if (!ec_mbox_is_datagram_state(mbox, EC_DATAGRAM_RECEIVED)) { |
674 ec_foe_set_rx_error(fsm, FOE_RECEIVE_ERROR); |
674 ec_foe_set_rx_error(fsm, FOE_RECEIVE_ERROR); |
675 EC_SLAVE_ERR(slave, "Failed to send FoE DATA READ: "); |
675 EC_SLAVE_ERR(slave, "Failed to send FoE DATA READ: "); |
676 ec_datagram_print_state(datagram); |
676 ec_datagram_print_state(datagram); |
677 return; |
677 return; |
678 } |
678 } |
679 |
679 |
680 if (!ec_mbox_is_datagram_wc(mbox,1)) { |
680 if (!ec_mbox_is_datagram_wc(mbox, 1)) { |
681 ec_foe_set_rx_error(fsm, FOE_WC_ERROR); |
681 ec_foe_set_rx_error(fsm, FOE_WC_ERROR); |
682 EC_SLAVE_ERR(slave, "Reception of FoE DATA READ: "); |
682 EC_SLAVE_ERR(slave, "Reception of FoE DATA READ: "); |
683 ec_datagram_print_wc_error(datagram); |
683 ec_datagram_print_wc_error(datagram); |
684 return; |
684 return; |
685 } |
685 } |
723 |
723 |
724 #ifdef DEBUG_FOE |
724 #ifdef DEBUG_FOE |
725 printk("ec_fsm_foe_state_data_read()\n"); |
725 printk("ec_fsm_foe_state_data_read()\n"); |
726 #endif |
726 #endif |
727 |
727 |
728 if (!ec_mbox_is_datagram_state(mbox,EC_DATAGRAM_RECEIVED)) { |
728 if (!ec_mbox_is_datagram_state(mbox, EC_DATAGRAM_RECEIVED)) { |
729 ec_foe_set_rx_error(fsm, FOE_RECEIVE_ERROR); |
729 ec_foe_set_rx_error(fsm, FOE_RECEIVE_ERROR); |
730 EC_SLAVE_ERR(slave, "Failed to receive FoE DATA READ datagram: "); |
730 EC_SLAVE_ERR(slave, "Failed to receive FoE DATA READ datagram: "); |
731 ec_datagram_print_state(datagram); |
731 ec_datagram_print_state(datagram); |
732 return; |
732 return; |
733 } |
733 } |
734 |
734 |
735 if (!ec_mbox_is_datagram_wc(mbox,1)) { |
735 if (!ec_mbox_is_datagram_wc(mbox, 1)) { |
736 ec_foe_set_rx_error(fsm, FOE_WC_ERROR); |
736 ec_foe_set_rx_error(fsm, FOE_WC_ERROR); |
737 EC_SLAVE_ERR(slave, "Reception of FoE DATA READ failed: "); |
737 EC_SLAVE_ERR(slave, "Reception of FoE DATA READ failed: "); |
738 ec_datagram_print_wc_error(datagram); |
738 ec_datagram_print_wc_error(datagram); |
739 return; |
739 return; |
740 } |
740 } |
844 |
844 |
845 #ifdef DEBUG_FOE |
845 #ifdef DEBUG_FOE |
846 printk("ec_foe_state_sent_ack()\n"); |
846 printk("ec_foe_state_sent_ack()\n"); |
847 #endif |
847 #endif |
848 |
848 |
849 if (!ec_mbox_is_datagram_state(mbox,EC_DATAGRAM_RECEIVED)) { |
849 if (!ec_mbox_is_datagram_state(mbox, EC_DATAGRAM_RECEIVED)) { |
850 ec_foe_set_rx_error(fsm, FOE_RECEIVE_ERROR); |
850 ec_foe_set_rx_error(fsm, FOE_RECEIVE_ERROR); |
851 EC_SLAVE_ERR(slave, "Failed to send FoE ACK: "); |
851 EC_SLAVE_ERR(slave, "Failed to send FoE ACK: "); |
852 ec_datagram_print_state(datagram); |
852 ec_datagram_print_state(datagram); |
853 return; |
853 return; |
854 } |
854 } |
855 |
855 |
856 if (!ec_mbox_is_datagram_wc(mbox,1)) { |
856 if (!ec_mbox_is_datagram_wc(mbox, 1)) { |
857 // slave did not put anything into the mailbox yet |
857 // slave did not put anything into the mailbox yet |
858 ec_foe_set_rx_error(fsm, FOE_WC_ERROR); |
858 ec_foe_set_rx_error(fsm, FOE_WC_ERROR); |
859 EC_SLAVE_ERR(slave, "Reception of FoE ACK failed: "); |
859 EC_SLAVE_ERR(slave, "Reception of FoE ACK failed: "); |
860 ec_datagram_print_wc_error(datagram); |
860 ec_datagram_print_wc_error(datagram); |
861 return; |
861 return; |