|
@@
-775,58
+775,143
void set_hk_lfr_reset_cause( enum lfr_re
|
|
775
|
|
|
775
|
|
|
776
|
}
|
|
776
|
}
|
|
777
|
|
|
777
|
|
|
778
|
void hk_lfr_le_me_he_update()
|
|
778
|
void increment_hk_counter( unsigned char newValue, unsigned char oldValue, unsigned int *counter )
|
|
|
|
|
779
|
{
|
|
|
|
|
780
|
int delta;
|
|
|
|
|
781
|
|
|
|
|
|
782
|
delta = 0;
|
|
|
|
|
783
|
|
|
|
|
|
784
|
if (newValue >= oldValue)
|
|
779
|
{
|
|
785
|
{
|
|
780
|
unsigned int hk_lfr_le_cnt;
|
|
786
|
delta = newValue - oldValue;
|
|
781
|
unsigned int hk_lfr_me_cnt;
|
|
787
|
}
|
|
782
|
unsigned int hk_lfr_he_cnt;
|
|
788
|
else
|
|
783
|
unsigned int current_hk_lfr_le_cnt;
|
|
789
|
{
|
|
784
|
unsigned int current_hk_lfr_me_cnt;
|
|
790
|
delta = 255 - oldValue + newValue;
|
|
785
|
unsigned int current_hk_lfr_he_cnt;
|
|
791
|
}
|
|
786
|
|
|
792
|
|
|
787
|
hk_lfr_le_cnt = 0;
|
|
793
|
*counter = *counter + delta;
|
|
788
|
hk_lfr_me_cnt = 0;
|
|
794
|
}
|
|
789
|
hk_lfr_he_cnt = 0;
|
|
|
|
|
790
|
current_hk_lfr_le_cnt = ((unsigned int) housekeeping_packet.hk_lfr_le_cnt[0]) * 256 + housekeeping_packet.hk_lfr_le_cnt[1];
|
|
|
|
|
791
|
current_hk_lfr_me_cnt = ((unsigned int) housekeeping_packet.hk_lfr_me_cnt[0]) * 256 + housekeeping_packet.hk_lfr_me_cnt[1];
|
|
|
|
|
792
|
current_hk_lfr_he_cnt = ((unsigned int) housekeeping_packet.hk_lfr_he_cnt[0]) * 256 + housekeeping_packet.hk_lfr_he_cnt[1];
|
|
|
|
|
793
|
|
|
795
|
|
|
794
|
//update the low severity error counter
|
|
796
|
void hk_lfr_le_update( void )
|
|
795
|
hk_lfr_le_cnt =
|
|
797
|
{
|
|
796
|
current_hk_lfr_le_cnt
|
|
798
|
static hk_lfr_le_t old_hk_lfr_le = {0};
|
|
797
|
+ housekeeping_packet.hk_lfr_dpu_spw_parity
|
|
799
|
hk_lfr_le_t new_hk_lfr_le;
|
|
798
|
+ housekeeping_packet.hk_lfr_dpu_spw_disconnect
|
|
800
|
unsigned int counter;
|
|
799
|
+ housekeeping_packet.hk_lfr_dpu_spw_escape
|
|
801
|
|
|
800
|
+ housekeeping_packet.hk_lfr_dpu_spw_credit
|
|
802
|
counter = ((unsigned int) housekeeping_packet.hk_lfr_le_cnt[0]) * 256 + housekeeping_packet.hk_lfr_le_cnt[1];
|
|
801
|
+ housekeeping_packet.hk_lfr_dpu_spw_write_sync
|
|
803
|
|
|
802
|
+ housekeeping_packet.hk_lfr_timecode_erroneous
|
|
804
|
// DPU
|
|
803
|
+ housekeeping_packet.hk_lfr_timecode_missing
|
|
805
|
new_hk_lfr_le.dpu_spw_parity = housekeeping_packet.hk_lfr_dpu_spw_parity;
|
|
804
|
+ housekeeping_packet.hk_lfr_timecode_invalid
|
|
806
|
new_hk_lfr_le.dpu_spw_disconnect= housekeeping_packet.hk_lfr_dpu_spw_disconnect;
|
|
805
|
+ housekeeping_packet.hk_lfr_time_timecode_it
|
|
807
|
new_hk_lfr_le.dpu_spw_escape = housekeeping_packet.hk_lfr_dpu_spw_escape;
|
|
806
|
+ housekeeping_packet.hk_lfr_time_not_synchro
|
|
808
|
new_hk_lfr_le.dpu_spw_credit = housekeeping_packet.hk_lfr_dpu_spw_credit;
|
|
807
|
+ housekeeping_packet.hk_lfr_time_timecode_ctr
|
|
809
|
new_hk_lfr_le.dpu_spw_write_sync= housekeeping_packet.hk_lfr_dpu_spw_write_sync;
|
|
808
|
+ housekeeping_packet.hk_lfr_ahb_correctable;
|
|
810
|
// TIMECODE
|
|
|
|
|
811
|
new_hk_lfr_le.timecode_erroneous= housekeeping_packet.hk_lfr_timecode_erroneous;
|
|
|
|
|
812
|
new_hk_lfr_le.timecode_missing = housekeeping_packet.hk_lfr_timecode_missing;
|
|
|
|
|
813
|
new_hk_lfr_le.timecode_invalid = housekeeping_packet.hk_lfr_timecode_invalid;
|
|
|
|
|
814
|
// TIME
|
|
|
|
|
815
|
new_hk_lfr_le.time_timecode_it = housekeeping_packet.hk_lfr_time_timecode_it;
|
|
|
|
|
816
|
new_hk_lfr_le.time_not_synchro = housekeeping_packet.hk_lfr_time_not_synchro;
|
|
|
|
|
817
|
new_hk_lfr_le.time_timecode_ctr = housekeeping_packet.hk_lfr_time_timecode_ctr;
|
|
|
|
|
818
|
//AHB
|
|
|
|
|
819
|
new_hk_lfr_le.ahb_correctable = housekeeping_packet.hk_lfr_ahb_correctable;
|
|
809
|
// housekeeping_packet.hk_lfr_dpu_spw_rx_ahb => not handled by the grspw driver
|
|
820
|
// housekeeping_packet.hk_lfr_dpu_spw_rx_ahb => not handled by the grspw driver
|
|
810
|
// housekeeping_packet.hk_lfr_dpu_spw_tx_ahb => not handled by the grspw driver
|
|
821
|
// housekeeping_packet.hk_lfr_dpu_spw_tx_ahb => not handled by the grspw driver
|
|
811
|
|
|
822
|
|
|
|
|
|
823
|
// update the le counter
|
|
|
|
|
824
|
// DPU
|
|
|
|
|
825
|
increment_hk_counter( new_hk_lfr_le.dpu_spw_parity, old_hk_lfr_le.dpu_spw_parity, counter );
|
|
|
|
|
826
|
increment_hk_counter( new_hk_lfr_le.dpu_spw_disconnect,old_hk_lfr_le.dpu_spw_disconnect, counter );
|
|
|
|
|
827
|
increment_hk_counter( new_hk_lfr_le.dpu_spw_escape, old_hk_lfr_le.dpu_spw_escape, counter );
|
|
|
|
|
828
|
increment_hk_counter( new_hk_lfr_le.dpu_spw_credit, old_hk_lfr_le.dpu_spw_credit, counter );
|
|
|
|
|
829
|
increment_hk_counter( new_hk_lfr_le.dpu_spw_write_sync,old_hk_lfr_le.dpu_spw_write_sync, counter );
|
|
|
|
|
830
|
// TIMECODE
|
|
|
|
|
831
|
increment_hk_counter( new_hk_lfr_le.timecode_erroneous,old_hk_lfr_le.timecode_erroneous, counter );
|
|
|
|
|
832
|
increment_hk_counter( new_hk_lfr_le.timecode_missing, old_hk_lfr_le.timecode_missing, counter );
|
|
|
|
|
833
|
increment_hk_counter( new_hk_lfr_le.timecode_invalid, old_hk_lfr_le.timecode_invalid, counter );
|
|
|
|
|
834
|
// TIME
|
|
|
|
|
835
|
increment_hk_counter( new_hk_lfr_le.time_timecode_it, old_hk_lfr_le.time_timecode_it, counter );
|
|
|
|
|
836
|
increment_hk_counter( new_hk_lfr_le.time_not_synchro, old_hk_lfr_le.time_not_synchro, counter );
|
|
|
|
|
837
|
increment_hk_counter( new_hk_lfr_le.time_timecode_ctr, old_hk_lfr_le.time_timecode_ctr, counter );
|
|
|
|
|
838
|
// AHB
|
|
|
|
|
839
|
increment_hk_counter( new_hk_lfr_le.ahb_correctable, old_hk_lfr_le.ahb_correctable, counter );
|
|
|
|
|
840
|
|
|
|
|
|
841
|
// DPU
|
|
|
|
|
842
|
old_hk_lfr_le.dpu_spw_parity = new_hk_lfr_le.dpu_spw_parity;
|
|
|
|
|
843
|
old_hk_lfr_le.dpu_spw_disconnect= new_hk_lfr_le.dpu_spw_disconnect;
|
|
|
|
|
844
|
old_hk_lfr_le.dpu_spw_escape = new_hk_lfr_le.dpu_spw_escape;
|
|
|
|
|
845
|
old_hk_lfr_le.dpu_spw_credit = new_hk_lfr_le.dpu_spw_credit;
|
|
|
|
|
846
|
old_hk_lfr_le.dpu_spw_write_sync= new_hk_lfr_le.dpu_spw_write_sync;
|
|
|
|
|
847
|
// TIMECODE
|
|
|
|
|
848
|
old_hk_lfr_le.timecode_erroneous= new_hk_lfr_le.timecode_erroneous;
|
|
|
|
|
849
|
old_hk_lfr_le.timecode_missing = new_hk_lfr_le.timecode_missing;
|
|
|
|
|
850
|
old_hk_lfr_le.timecode_invalid = new_hk_lfr_le.timecode_invalid;
|
|
|
|
|
851
|
// TIME
|
|
|
|
|
852
|
old_hk_lfr_le.time_timecode_it = new_hk_lfr_le.time_timecode_it;
|
|
|
|
|
853
|
old_hk_lfr_le.time_not_synchro = new_hk_lfr_le.time_not_synchro;
|
|
|
|
|
854
|
old_hk_lfr_le.time_timecode_ctr = new_hk_lfr_le.time_timecode_ctr;
|
|
|
|
|
855
|
//AHB
|
|
|
|
|
856
|
old_hk_lfr_le.ahb_correctable = new_hk_lfr_le.ahb_correctable;
|
|
|
|
|
857
|
// housekeeping_packet.hk_lfr_dpu_spw_rx_ahb => not handled by the grspw driver
|
|
|
|
|
858
|
// housekeeping_packet.hk_lfr_dpu_spw_tx_ahb => not handled by the grspw driver
|
|
|
|
|
859
|
|
|
|
|
|
860
|
// update housekeeping packet counters, convert unsigned int numbers in 2 bytes numbers
|
|
|
|
|
861
|
// LE
|
|
|
|
|
862
|
housekeeping_packet.hk_lfr_le_cnt[0] = (unsigned char) ((hk_lfr_le_cnt & 0xff00) >> 8);
|
|
|
|
|
863
|
housekeeping_packet.hk_lfr_le_cnt[1] = (unsigned char) (hk_lfr_le_cnt & 0x00ff);
|
|
|
|
|
864
|
}
|
|
|
|
|
865
|
|
|
|
|
|
866
|
void hk_lfr_me_update( void )
|
|
|
|
|
867
|
{
|
|
|
|
|
868
|
static hk_lfr_me_t old_hk_lfr_me = {0};
|
|
|
|
|
869
|
hk_lfr_me_t new_hk_lfr_me;
|
|
|
|
|
870
|
unsigned int counter;
|
|
|
|
|
871
|
|
|
|
|
|
872
|
counter = ((unsigned int) housekeeping_packet.hk_lfr_me_cnt[0]) * 256 + housekeeping_packet.hk_lfr_me_cnt[1];
|
|
|
|
|
873
|
|
|
|
|
|
874
|
// get the current values
|
|
|
|
|
875
|
new_hk_lfr_me.dpu_spw_early_eop = housekeeping_packet.hk_lfr_dpu_spw_early_eop;
|
|
|
|
|
876
|
new_hk_lfr_me.dpu_spw_invalid_addr = housekeeping_packet.hk_lfr_dpu_spw_invalid_addr;
|
|
|
|
|
877
|
new_hk_lfr_me.dpu_spw_eep = housekeeping_packet.hk_lfr_dpu_spw_eep;
|
|
|
|
|
878
|
new_hk_lfr_me.dpu_spw_rx_too_big = housekeeping_packet.hk_lfr_dpu_spw_rx_too_big;
|
|
|
|
|
879
|
|
|
|
|
|
880
|
// update the me counter
|
|
|
|
|
881
|
increment_hk_counter( new_hk_lfr_me.dpu_spw_early_eop, old_hk_lfr_me.dpu_spw_early_eop, counter );
|
|
|
|
|
882
|
increment_hk_counter( new_hk_lfr_me.dpu_spw_invalid_addr, old_hk_lfr_me.dpu_spw_invalid_addr, counter );
|
|
|
|
|
883
|
increment_hk_counter( new_hk_lfr_me.dpu_spw_eep, old_hk_lfr_me.dpu_spw_eep, counter );
|
|
|
|
|
884
|
increment_hk_counter( new_hk_lfr_me.dpu_spw_rx_too_big, old_hk_lfr_me.dpu_spw_rx_too_big, counter );
|
|
|
|
|
885
|
|
|
|
|
|
886
|
// store the counters for the next time
|
|
|
|
|
887
|
old_hk_lfr_me.dpu_spw_early_eop = new_hk_lfr_me.dpu_spw_early_eop;
|
|
|
|
|
888
|
old_hk_lfr_me.dpu_spw_invalid_addr = new_hk_lfr_me.dpu_spw_invalid_addr;
|
|
|
|
|
889
|
old_hk_lfr_me.dpu_spw_eep = new_hk_lfr_me.dpu_spw_eep;
|
|
|
|
|
890
|
old_hk_lfr_me.dpu_spw_rx_too_big = new_hk_lfr_me.dpu_spw_rx_too_big;
|
|
|
|
|
891
|
|
|
|
|
|
892
|
// update housekeeping packet counters, convert unsigned int numbers in 2 bytes numbers
|
|
|
|
|
893
|
// ME
|
|
|
|
|
894
|
housekeeping_packet.hk_lfr_me_cnt[0] = (unsigned char) ((hk_lfr_me_cnt & 0xff00) >> 8);
|
|
|
|
|
895
|
housekeeping_packet.hk_lfr_me_cnt[1] = (unsigned char) (hk_lfr_me_cnt & 0x00ff);
|
|
|
|
|
896
|
}
|
|
|
|
|
897
|
|
|
|
|
|
898
|
void hk_lfr_le_me_he_update()
|
|
|
|
|
899
|
{
|
|
|
|
|
900
|
|
|
|
|
|
901
|
unsigned int hk_lfr_he_cnt;
|
|
|
|
|
902
|
|
|
|
|
|
903
|
hk_lfr_he_cnt = ((unsigned int) housekeeping_packet.hk_lfr_he_cnt[0]) * 256 + housekeeping_packet.hk_lfr_he_cnt[1];
|
|
|
|
|
904
|
|
|
|
|
|
905
|
//update the low severity error counter
|
|
|
|
|
906
|
hk_lfr_le_update( );
|
|
|
|
|
907
|
|
|
812
|
//update the medium severity error counter
|
|
908
|
//update the medium severity error counter
|
|
813
|
hk_lfr_me_cnt =
|
|
909
|
hk_lfr_me_update();
|
|
814
|
current_hk_lfr_me_cnt
|
|
|
|
|
815
|
+ housekeeping_packet.hk_lfr_dpu_spw_early_eop
|
|
|
|
|
816
|
+ housekeeping_packet.hk_lfr_dpu_spw_invalid_addr
|
|
|
|
|
817
|
+ housekeeping_packet.hk_lfr_dpu_spw_eep
|
|
|
|
|
818
|
+ housekeeping_packet.hk_lfr_dpu_spw_rx_too_big;
|
|
|
|
|
819
|
|
|
910
|
|
|
820
|
//update the high severity error counter
|
|
911
|
//update the high severity error counter
|
|
821
|
hk_lfr_he_cnt = 0;
|
|
912
|
hk_lfr_he_cnt = 0;
|
|
822
|
|
|
913
|
|
|
823
|
// update housekeeping packet counters, convert unsigned int numbers in 2 bytes numbers
|
|
914
|
// update housekeeping packet counters, convert unsigned int numbers in 2 bytes numbers
|
|
824
|
// LE
|
|
|
|
|
825
|
housekeeping_packet.hk_lfr_le_cnt[0] = (unsigned char) ((hk_lfr_le_cnt & 0xff00) >> 8);
|
|
|
|
|
826
|
housekeeping_packet.hk_lfr_le_cnt[1] = (unsigned char) (hk_lfr_le_cnt & 0x00ff);
|
|
|
|
|
827
|
// ME
|
|
|
|
|
828
|
housekeeping_packet.hk_lfr_me_cnt[0] = (unsigned char) ((hk_lfr_me_cnt & 0xff00) >> 8);
|
|
|
|
|
829
|
housekeeping_packet.hk_lfr_me_cnt[1] = (unsigned char) (hk_lfr_me_cnt & 0x00ff);
|
|
|
|
|
830
|
// HE
|
|
915
|
// HE
|
|
831
|
housekeeping_packet.hk_lfr_he_cnt[0] = (unsigned char) ((hk_lfr_he_cnt & 0xff00) >> 8);
|
|
916
|
housekeeping_packet.hk_lfr_he_cnt[0] = (unsigned char) ((hk_lfr_he_cnt & 0xff00) >> 8);
|
|
832
|
housekeeping_packet.hk_lfr_he_cnt[1] = (unsigned char) (hk_lfr_he_cnt & 0x00ff);
|
|
917
|
housekeeping_packet.hk_lfr_he_cnt[1] = (unsigned char) (hk_lfr_he_cnt & 0x00ff);
|