Commit 96372bd9b42e917cb83add7d43bcfbe60307da56

Authored by Malcolm Priestley
Committed by Greg Kroah-Hartman
1 parent 9332025898

staging: vt6655: s_uGetRTSCTSDuration always return __le16

This function should always return __le16, move all endian
correction to here.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Showing 1 changed file with 84 additions and 65 deletions Side-by-side Diff

drivers/staging/vt6655/rxtx.c
... ... @@ -578,7 +578,7 @@
578 578  
579 579 //byFreqType: 0=>5GHZ 1=>2.4GHZ
580 580 static
581   -unsigned int
  581 +__le16
582 582 s_uGetRTSCTSDuration(
583 583 struct vnt_private *pDevice,
584 584 unsigned char byDurType,
... ... @@ -667,7 +667,7 @@
667 667 break;
668 668 }
669 669  
670   - return uDurTime;
  670 + return cpu_to_le16((u16)uDurTime);
671 671 }
672 672  
673 673 static
674 674  
675 675  
... ... @@ -829,17 +829,20 @@
829 829 byPktType, &buf->a);
830 830 /* Get Duration */
831 831 buf->duration_bb =
832   - cpu_to_le16((u16)s_uGetRTSCTSDuration(pDevice, RTSDUR_BB, cbFrameLength,
833   - PK_TYPE_11B, pDevice->byTopCCKBasicRate,
834   - bNeedAck, byFBOption));
  832 + s_uGetRTSCTSDuration(pDevice, RTSDUR_BB,
  833 + cbFrameLength, PK_TYPE_11B,
  834 + pDevice->byTopCCKBasicRate,
  835 + bNeedAck, byFBOption);
835 836 buf->duration_aa =
836   - cpu_to_le16((u16)s_uGetRTSCTSDuration(pDevice, RTSDUR_AA, cbFrameLength,
837   - byPktType, wCurrentRate, bNeedAck,
838   - byFBOption));
  837 + s_uGetRTSCTSDuration(pDevice, RTSDUR_AA,
  838 + cbFrameLength, byPktType,
  839 + wCurrentRate, bNeedAck,
  840 + byFBOption);
839 841 buf->duration_ba =
840   - cpu_to_le16((u16)s_uGetRTSCTSDuration(pDevice, RTSDUR_BA, cbFrameLength,
841   - byPktType, wCurrentRate, bNeedAck,
842   - byFBOption));
  842 + s_uGetRTSCTSDuration(pDevice, RTSDUR_BA,
  843 + cbFrameLength, byPktType,
  844 + wCurrentRate, bNeedAck,
  845 + byFBOption);
843 846  
844 847 buf->data.duration = buf->duration_aa;
845 848 /* Get RTS Frame body */
846 849  
847 850  
848 851  
849 852  
850 853  
851 854  
... ... @@ -871,33 +874,40 @@
871 874 byPktType, &buf->a);
872 875 /* Get Duration */
873 876 buf->duration_bb =
874   - cpu_to_le16((u16)s_uGetRTSCTSDuration(pDevice, RTSDUR_BB, cbFrameLength,
875   - PK_TYPE_11B, pDevice->byTopCCKBasicRate,
876   - bNeedAck, byFBOption));
  877 + s_uGetRTSCTSDuration(pDevice, RTSDUR_BB,
  878 + cbFrameLength, PK_TYPE_11B,
  879 + pDevice->byTopCCKBasicRate,
  880 + bNeedAck, byFBOption);
877 881 buf->duration_aa =
878   - cpu_to_le16((u16)s_uGetRTSCTSDuration(pDevice, RTSDUR_AA, cbFrameLength,
879   - byPktType, wCurrentRate, bNeedAck,
880   - byFBOption));
  882 + s_uGetRTSCTSDuration(pDevice, RTSDUR_AA,
  883 + cbFrameLength, byPktType,
  884 + wCurrentRate, bNeedAck,
  885 + byFBOption);
881 886 buf->duration_ba =
882   - cpu_to_le16((u16)s_uGetRTSCTSDuration(pDevice, RTSDUR_BA, cbFrameLength,
883   - byPktType, wCurrentRate, bNeedAck,
884   - byFBOption));
  887 + s_uGetRTSCTSDuration(pDevice, RTSDUR_BA,
  888 + cbFrameLength, byPktType,
  889 + wCurrentRate, bNeedAck,
  890 + byFBOption);
885 891 buf->rts_duration_ba_f0 =
886   - cpu_to_le16((u16)s_uGetRTSCTSDuration(pDevice, RTSDUR_BA_F0, cbFrameLength,
887   - byPktType, wCurrentRate, bNeedAck,
888   - byFBOption));
  892 + s_uGetRTSCTSDuration(pDevice, RTSDUR_BA_F0,
  893 + cbFrameLength, byPktType,
  894 + wCurrentRate, bNeedAck,
  895 + byFBOption);
889 896 buf->rts_duration_aa_f0 =
890   - cpu_to_le16((u16)s_uGetRTSCTSDuration(pDevice, RTSDUR_AA_F0, cbFrameLength,
891   - byPktType, wCurrentRate, bNeedAck,
892   - byFBOption));
  897 + s_uGetRTSCTSDuration(pDevice, RTSDUR_AA_F0,
  898 + cbFrameLength, byPktType,
  899 + wCurrentRate, bNeedAck,
  900 + byFBOption);
893 901 buf->rts_duration_ba_f1 =
894   - cpu_to_le16((u16)s_uGetRTSCTSDuration(pDevice, RTSDUR_BA_F1, cbFrameLength,
895   - byPktType, wCurrentRate, bNeedAck,
896   - byFBOption));
  902 + s_uGetRTSCTSDuration(pDevice, RTSDUR_BA_F1,
  903 + cbFrameLength, byPktType,
  904 + wCurrentRate, bNeedAck,
  905 + byFBOption);
897 906 buf->rts_duration_aa_f1 =
898   - cpu_to_le16((u16)s_uGetRTSCTSDuration(pDevice, RTSDUR_AA_F1, cbFrameLength,
899   - byPktType, wCurrentRate, bNeedAck,
900   - byFBOption));
  907 + s_uGetRTSCTSDuration(pDevice, RTSDUR_AA_F1,
  908 + cbFrameLength, byPktType,
  909 + wCurrentRate, bNeedAck,
  910 + byFBOption);
901 911 buf->data.duration = buf->duration_aa;
902 912 /* Get RTS Frame body */
903 913 buf->data.frame_control =
... ... @@ -927,9 +937,10 @@
927 937 byPktType, &buf->ab);
928 938 /* Get Duration */
929 939 buf->duration =
930   - cpu_to_le16((u16)s_uGetRTSCTSDuration(pDevice, RTSDUR_AA, cbFrameLength,
931   - byPktType, wCurrentRate, bNeedAck,
932   - byFBOption));
  940 + s_uGetRTSCTSDuration(pDevice, RTSDUR_AA,
  941 + cbFrameLength, byPktType,
  942 + wCurrentRate, bNeedAck,
  943 + byFBOption);
933 944 buf->data.duration = buf->duration;
934 945 /* Get RTS Frame body */
935 946 buf->data.frame_control =
936 947  
937 948  
... ... @@ -957,17 +968,20 @@
957 968 byPktType, &buf->a);
958 969 /* Get Duration */
959 970 buf->duration =
960   - cpu_to_le16((u16)s_uGetRTSCTSDuration(pDevice, RTSDUR_AA, cbFrameLength,
961   - byPktType, wCurrentRate,
962   - bNeedAck, byFBOption));
  971 + s_uGetRTSCTSDuration(pDevice, RTSDUR_AA,
  972 + cbFrameLength, byPktType,
  973 + wCurrentRate, bNeedAck,
  974 + byFBOption);
963 975 buf->rts_duration_f0 =
964   - cpu_to_le16((u16)s_uGetRTSCTSDuration(pDevice, RTSDUR_AA_F0, cbFrameLength,
965   - byPktType, wCurrentRate,
966   - bNeedAck, byFBOption));
  976 + s_uGetRTSCTSDuration(pDevice, RTSDUR_AA_F0,
  977 + cbFrameLength, byPktType,
  978 + wCurrentRate, bNeedAck,
  979 + byFBOption);
967 980 buf->rts_duration_f1 =
968   - cpu_to_le16((u16)s_uGetRTSCTSDuration(pDevice, RTSDUR_AA_F1, cbFrameLength,
969   - byPktType, wCurrentRate,
970   - bNeedAck, byFBOption));
  981 + s_uGetRTSCTSDuration(pDevice, RTSDUR_AA_F1,
  982 + cbFrameLength, byPktType,
  983 + wCurrentRate, bNeedAck,
  984 + byFBOption);
971 985 buf->data.duration = buf->duration;
972 986 /* Get RTS Frame body */
973 987 buf->data.frame_control =
... ... @@ -993,9 +1007,10 @@
993 1007 PK_TYPE_11B, &buf->ab);
994 1008 /* Get Duration */
995 1009 buf->duration =
996   - cpu_to_le16((u16)s_uGetRTSCTSDuration(pDevice, RTSDUR_BB, cbFrameLength,
997   - byPktType, wCurrentRate, bNeedAck,
998   - byFBOption));
  1010 + s_uGetRTSCTSDuration(pDevice, RTSDUR_BB, cbFrameLength,
  1011 + byPktType, wCurrentRate, bNeedAck,
  1012 + byFBOption);
  1013 +
999 1014 buf->data.duration = buf->duration;
1000 1015 /* Get RTS Frame body */
1001 1016 buf->data.frame_control =
1002 1017  
1003 1018  
1004 1019  
... ... @@ -1049,21 +1064,26 @@
1049 1064 pDevice->byTopCCKBasicRate,
1050 1065 PK_TYPE_11B, &buf->b);
1051 1066  
1052   - buf->duration_ba = (u16)s_uGetRTSCTSDuration(pDevice, CTSDUR_BA, cbFrameLength,
1053   - byPktType, wCurrentRate, bNeedAck, byFBOption);
1054   - buf->duration_ba = cpu_to_le16(buf->duration_ba);
  1067 + buf->duration_ba =
  1068 + s_uGetRTSCTSDuration(pDevice, CTSDUR_BA,
  1069 + cbFrameLength, byPktType,
  1070 + wCurrentRate, bNeedAck,
  1071 + byFBOption);
  1072 +
1055 1073 /* Get CTSDuration_ba_f0 */
1056   - buf->cts_duration_ba_f0 = (u16)s_uGetRTSCTSDuration(pDevice, CTSDUR_BA_F0, cbFrameLength,
1057   - byPktType, wCurrentRate,
1058   - bNeedAck, byFBOption);
  1074 + buf->cts_duration_ba_f0 =
  1075 + s_uGetRTSCTSDuration(pDevice, CTSDUR_BA_F0,
  1076 + cbFrameLength, byPktType,
  1077 + wCurrentRate, bNeedAck,
  1078 + byFBOption);
1059 1079  
1060   - buf->cts_duration_ba_f0 = cpu_to_le16(buf->cts_duration_ba_f0);
1061   - //Get CTSDuration_ba_f1
1062   - buf->cts_duration_ba_f1 = (u16)s_uGetRTSCTSDuration(pDevice, CTSDUR_BA_F1, cbFrameLength,
1063   - byPktType, wCurrentRate,
1064   - bNeedAck, byFBOption);
  1080 + /* Get CTSDuration_ba_f1 */
  1081 + buf->cts_duration_ba_f1 =
  1082 + s_uGetRTSCTSDuration(pDevice, CTSDUR_BA_F1,
  1083 + cbFrameLength, byPktType,
  1084 + wCurrentRate, bNeedAck,
  1085 + byFBOption);
1065 1086  
1066   - buf->cts_duration_ba_f1 = cpu_to_le16(buf->cts_duration_ba_f1);
1067 1087 /* Get CTS Frame body */
1068 1088 buf->data.duration = buf->duration_ba;
1069 1089  
... ... @@ -1083,11 +1103,10 @@
1083 1103  
1084 1104 /* Get CTSDuration_ba */
1085 1105 buf->duration_ba =
1086   - cpu_to_le16((u16)s_uGetRTSCTSDuration(pDevice, CTSDUR_BA, cbFrameLength,
1087   - byPktType, wCurrentRate, bNeedAck,
1088   - byFBOption));
1089   -
1090   - buf->duration_ba = cpu_to_le16(buf->duration_ba);
  1106 + s_uGetRTSCTSDuration(pDevice, CTSDUR_BA,
  1107 + cbFrameLength, byPktType,
  1108 + wCurrentRate, bNeedAck,
  1109 + byFBOption);
1091 1110  
1092 1111 /* Get CTS Frame body */
1093 1112 buf->data.duration = buf->duration_ba;