Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: ft1000: Fix camelcase variable names.

Signed-off-by: Marek Belisko <marek.belisko@open-nandra.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by

Marek Belisko and committed by
Greg Kroah-Hartman
0ce72ea3 c346541f

+102 -102
+102 -102
drivers/staging/ft1000/ft1000-usb/ft1000_download.c
··· 772 772 773 773 u16 scram_dnldr(struct ft1000_device *ft1000dev, void *pFileStart, u32 FileLength) 774 774 { 775 - u16 Status = STATUS_SUCCESS; 776 - u32 uiState; 775 + u16 status = STATUS_SUCCESS; 776 + u32 state; 777 777 u16 handshake; 778 - struct pseudo_hdr *pHdr; 779 - u16 usHdrLength; 778 + struct pseudo_hdr *pseudo_header; 779 + u16 pseudo_header_len; 780 780 long word_length; 781 781 u16 request; 782 782 u16 temp; 783 783 u16 tempword; 784 784 785 - struct dsp_file_hdr *pFileHdr5; 786 - struct dsp_image_info *pDspImageInfoV6 = NULL; 785 + struct dsp_file_hdr *file_hdr; 786 + struct dsp_image_info *dsp_img_info = NULL; 787 787 long requested_version; 788 - bool bGoodVersion; 789 - struct drv_msg *pMailBoxData; 790 - u16 *pUsData = NULL; 791 - u16 *pUsFile = NULL; 792 - u8 *pUcFile = NULL; 793 - u8 *pBootEnd = NULL, *pCodeEnd= NULL; 794 - int imageN; 788 + bool correct_version; 789 + struct drv_msg *mailbox_data; 790 + u16 *data = NULL; 791 + u16 *s_file = NULL; 792 + u8 *c_file = NULL; 793 + u8 *boot_end = NULL, *code_end= NULL; 794 + int image; 795 795 long loader_code_address, loader_code_size = 0; 796 796 long run_address = 0, run_size = 0; 797 797 ··· 814 814 // Get version id of file, at first 4 bytes of file, for newer files. 815 815 // 816 816 817 - uiState = STATE_START_DWNLD; 817 + state = STATE_START_DWNLD; 818 818 819 - pFileHdr5 = (struct dsp_file_hdr *)pFileStart; 819 + file_hdr = (struct dsp_file_hdr *)pFileStart; 820 820 821 821 ft1000_write_register (ft1000dev, 0x800, FT1000_REG_MAG_WATERMARK); 822 822 823 - pUsFile = (u16 *)(pFileStart + pFileHdr5->loader_offset); 824 - pUcFile = (u8 *)(pFileStart + pFileHdr5->loader_offset); 823 + s_file = (u16 *)(pFileStart + file_hdr->loader_offset); 824 + c_file = (u8 *)(pFileStart + file_hdr->loader_offset); 825 825 826 - pBootEnd = (u8 *)(pFileStart + pFileHdr5->loader_code_end); 826 + boot_end = (u8 *)(pFileStart + file_hdr->loader_code_end); 827 827 828 - loader_code_address = pFileHdr5->loader_code_address; 829 - loader_code_size = pFileHdr5->loader_code_size; 830 - bGoodVersion = FALSE; 828 + loader_code_address = file_hdr->loader_code_address; 829 + loader_code_size = file_hdr->loader_code_size; 830 + correct_version = FALSE; 831 831 832 - while ((Status == STATUS_SUCCESS) && (uiState != STATE_DONE_FILE)) 832 + while ((status == STATUS_SUCCESS) && (state != STATE_DONE_FILE)) 833 833 { 834 - switch (uiState) 834 + switch (state) 835 835 { 836 836 case STATE_START_DWNLD: 837 837 DEBUG("FT1000:STATE_START_DWNLD\n"); ··· 848 848 else 849 849 { 850 850 DEBUG("FT1000:download:Download error: Handshake failed\n"); 851 - Status = STATUS_FAILURE; 851 + status = STATUS_FAILURE; 852 852 } 853 853 854 - uiState = STATE_BOOT_DWNLD; 854 + state = STATE_BOOT_DWNLD; 855 855 856 856 break; 857 857 ··· 878 878 case REQUEST_DONE_BL: 879 879 DEBUG("FT1000:REQUEST_DONE_BL\n"); 880 880 /* Reposition ptrs to beginning of code section */ 881 - pUsFile = (u16 *)(pBootEnd); 882 - pUcFile = (u8 *)(pBootEnd); 883 - //DEBUG("FT1000:download:pUsFile = 0x%8x\n", (int)pUsFile); 884 - //DEBUG("FT1000:download:pUcFile = 0x%8x\n", (int)pUcFile); 885 - uiState = STATE_CODE_DWNLD; 881 + s_file = (u16 *)(boot_end); 882 + c_file = (u8 *)(boot_end); 883 + //DEBUG("FT1000:download:s_file = 0x%8x\n", (int)s_file); 884 + //DEBUG("FT1000:download:c_file = 0x%8x\n", (int)c_file); 885 + state = STATE_CODE_DWNLD; 886 886 pft1000info->fcodeldr = 1; 887 887 break; 888 888 case REQUEST_CODE_SEGMENT: ··· 893 893 if (word_length > MAX_LENGTH) 894 894 { 895 895 DEBUG("FT1000:download:Download error: Max length exceeded\n"); 896 - Status = STATUS_FAILURE; 896 + status = STATUS_FAILURE; 897 897 break; 898 898 } 899 - if ( (word_length*2 + pUcFile) > pBootEnd) 899 + if ( (word_length*2 + c_file) > boot_end) 900 900 { 901 901 /* 902 902 * Error, beyond boot code range. 903 903 */ 904 904 DEBUG("FT1000:download:Download error: Requested len=%d exceeds BOOT code boundry.\n", 905 905 (int)word_length); 906 - Status = STATUS_FAILURE; 906 + status = STATUS_FAILURE; 907 907 break; 908 908 } 909 909 /* ··· 914 914 word_length++; 915 915 word_length = word_length / 2; 916 916 917 - Status = write_blk(ft1000dev, &pUsFile, &pUcFile, word_length); 918 - //DEBUG("write_blk returned %d\n", Status); 917 + status = write_blk(ft1000dev, &s_file, &c_file, word_length); 918 + //DEBUG("write_blk returned %d\n", status); 919 919 break; 920 920 default: 921 921 DEBUG("FT1000:download:Download error: Bad request type=%d in BOOT download state.\n",request); 922 - Status = STATUS_FAILURE; 922 + status = STATUS_FAILURE; 923 923 break; 924 924 } 925 925 if (pft1000info->usbboot) ··· 930 930 else 931 931 { 932 932 DEBUG("FT1000:download:Download error: Handshake failed\n"); 933 - Status = STATUS_FAILURE; 933 + status = STATUS_FAILURE; 934 934 } 935 935 936 936 break; ··· 959 959 break; 960 960 case REQUEST_RUN_ADDRESS: 961 961 DEBUG("FT1000:download: REQUEST_RUN_ADDRESS\n"); 962 - if (bGoodVersion) 962 + if (correct_version) 963 963 { 964 964 DEBUG("FT1000:download:run_address = 0x%8x\n", (int)run_address); 965 965 put_request_value(ft1000dev, run_address); ··· 967 967 else 968 968 { 969 969 DEBUG("FT1000:download:Download error: Got Run address request before image offset request.\n"); 970 - Status = STATUS_FAILURE; 970 + status = STATUS_FAILURE; 971 971 break; 972 972 } 973 973 break; 974 974 case REQUEST_CODE_LENGTH: 975 975 DEBUG("FT1000:download:REQUEST_CODE_LENGTH\n"); 976 - if (bGoodVersion) 976 + if (correct_version) 977 977 { 978 978 DEBUG("FT1000:download:run_size = 0x%8x\n", (int)run_size); 979 979 put_request_value(ft1000dev, run_size); ··· 981 981 else 982 982 { 983 983 DEBUG("FT1000:download:Download error: Got Size request before image offset request.\n"); 984 - Status = STATUS_FAILURE; 984 + status = STATUS_FAILURE; 985 985 break; 986 986 } 987 987 break; 988 988 case REQUEST_DONE_CL: 989 989 pft1000info->usbboot = 3; 990 990 /* Reposition ptrs to beginning of provisioning section */ 991 - pUsFile = (u16 *)(pFileStart + pFileHdr5->commands_offset); 992 - pUcFile = (u8 *)(pFileStart + pFileHdr5->commands_offset); 993 - uiState = STATE_DONE_DWNLD; 991 + s_file = (u16 *)(pFileStart + file_hdr->commands_offset); 992 + c_file = (u8 *)(pFileStart + file_hdr->commands_offset); 993 + state = STATE_DONE_DWNLD; 994 994 break; 995 995 case REQUEST_CODE_SEGMENT: 996 996 //DEBUG("FT1000:download: REQUEST_CODE_SEGMENT - CODELOADER\n"); 997 - if (!bGoodVersion) 997 + if (!correct_version) 998 998 { 999 999 DEBUG("FT1000:download:Download error: Got Code Segment request before image offset request.\n"); 1000 - Status = STATUS_FAILURE; 1000 + status = STATUS_FAILURE; 1001 1001 break; 1002 1002 } 1003 1003 #if 0 ··· 1011 1011 #endif 1012 1012 { 1013 1013 DEBUG("FT1000:download:Download error: Max length exceeded\n"); 1014 - Status = STATUS_FAILURE; 1014 + status = STATUS_FAILURE; 1015 1015 break; 1016 1016 } 1017 - if ( (word_length*2 + pUcFile) > pCodeEnd) 1017 + if ( (word_length*2 + c_file) > code_end) 1018 1018 { 1019 1019 /* 1020 1020 * Error, beyond boot code range. 1021 1021 */ 1022 1022 DEBUG("FT1000:download:Download error: Requested len=%d exceeds DSP code boundry.\n", 1023 1023 (int)word_length); 1024 - Status = STATUS_FAILURE; 1024 + status = STATUS_FAILURE; 1025 1025 break; 1026 1026 } 1027 1027 /* ··· 1032 1032 word_length++; 1033 1033 word_length = word_length / 2; 1034 1034 1035 - write_blk_fifo (ft1000dev, &pUsFile, &pUcFile, word_length); 1035 + write_blk_fifo (ft1000dev, &s_file, &c_file, word_length); 1036 1036 if (pft1000info->usbboot == 0) 1037 1037 pft1000info->usbboot++; 1038 1038 if (pft1000info->usbboot == 1) { ··· 1047 1047 // Convert length from byte count to word count. Make sure we round up. 1048 1048 word_length = (long)(pft1000info->DSPInfoBlklen + 1)/2; 1049 1049 put_request_value(ft1000dev, word_length); 1050 - pMailBoxData = (struct drv_msg *)&(pft1000info->DSPInfoBlk[0]); 1050 + mailbox_data = (struct drv_msg *)&(pft1000info->DSPInfoBlk[0]); 1051 1051 /* 1052 1052 * Position ASIC DPRAM auto-increment pointer. 1053 1053 */ 1054 1054 1055 1055 1056 - pUsData = (u16 *)&pMailBoxData->data[0]; 1056 + data = (u16 *)&mailbox_data->data[0]; 1057 1057 dpram = (u16)DWNLD_MAG1_PS_HDR_LOC; 1058 1058 if (word_length & 0x1) 1059 1059 word_length++; ··· 1064 1064 for (; word_length > 0; word_length--) /* In words */ 1065 1065 { 1066 1066 1067 - templong = *pUsData++; 1068 - templong |= (*pUsData++ << 16); 1069 - Status = fix_ft1000_write_dpram32 (ft1000dev, dpram++, (u8 *)&templong); 1067 + templong = *data++; 1068 + templong |= (*data++ << 16); 1069 + status = fix_ft1000_write_dpram32 (ft1000dev, dpram++, (u8 *)&templong); 1070 1070 1071 1071 } 1072 1072 break; 1073 1073 1074 1074 case REQUEST_VERSION_INFO: 1075 1075 DEBUG("FT1000:download:REQUEST_VERSION_INFO\n"); 1076 - word_length = pFileHdr5->version_data_size; 1076 + word_length = file_hdr->version_data_size; 1077 1077 put_request_value(ft1000dev, word_length); 1078 1078 /* 1079 1079 * Position ASIC DPRAM auto-increment pointer. 1080 1080 */ 1081 1081 1082 - pUsFile = (u16 *)(pFileStart + pFileHdr5->version_data_offset); 1082 + s_file = (u16 *)(pFileStart + file_hdr->version_data_offset); 1083 1083 1084 1084 1085 1085 dpram = (u16)DWNLD_MAG1_PS_HDR_LOC; ··· 1092 1092 for (; word_length > 0; word_length--) /* In words */ 1093 1093 { 1094 1094 1095 - templong = ntohs(*pUsFile++); 1096 - temp = ntohs(*pUsFile++); 1095 + templong = ntohs(*s_file++); 1096 + temp = ntohs(*s_file++); 1097 1097 templong |= (temp << 16); 1098 - Status = fix_ft1000_write_dpram32 (ft1000dev, dpram++, (u8 *)&templong); 1098 + status = fix_ft1000_write_dpram32 (ft1000dev, dpram++, (u8 *)&templong); 1099 1099 1100 1100 } 1101 1101 break; 1102 1102 1103 1103 case REQUEST_CODE_BY_VERSION: 1104 1104 DEBUG("FT1000:download:REQUEST_CODE_BY_VERSION\n"); 1105 - bGoodVersion = FALSE; 1105 + correct_version = FALSE; 1106 1106 requested_version = get_request_value(ft1000dev); 1107 1107 1108 - pDspImageInfoV6 = (struct dsp_image_info *)(pFileStart + sizeof(struct dsp_file_hdr )); 1108 + dsp_img_info = (struct dsp_image_info *)(pFileStart + sizeof(struct dsp_file_hdr )); 1109 1109 1110 - for (imageN = 0; imageN < pFileHdr5->nDspImages; imageN++) 1110 + for (image = 0; image < file_hdr->nDspImages; image++) 1111 1111 { 1112 1112 1113 - temp = (u16)(pDspImageInfoV6->version); 1113 + temp = (u16)(dsp_img_info->version); 1114 1114 templong = temp; 1115 - temp = (u16)(pDspImageInfoV6->version >> 16); 1115 + temp = (u16)(dsp_img_info->version >> 16); 1116 1116 templong |= (temp << 16); 1117 1117 if (templong == (u32)requested_version) 1118 1118 { 1119 - bGoodVersion = TRUE; 1120 - DEBUG("FT1000:download: bGoodVersion is TRUE\n"); 1121 - pUsFile = (u16 *)(pFileStart + pDspImageInfoV6->begin_offset); 1122 - pUcFile = (u8 *)(pFileStart + pDspImageInfoV6->begin_offset); 1123 - pCodeEnd = (u8 *)(pFileStart + pDspImageInfoV6->end_offset); 1124 - run_address = pDspImageInfoV6->run_address; 1125 - run_size = pDspImageInfoV6->image_size; 1126 - image_chksum = (u32)pDspImageInfoV6->checksum; 1119 + correct_version = TRUE; 1120 + DEBUG("FT1000:download: correct_version is TRUE\n"); 1121 + s_file = (u16 *)(pFileStart + dsp_img_info->begin_offset); 1122 + c_file = (u8 *)(pFileStart + dsp_img_info->begin_offset); 1123 + code_end = (u8 *)(pFileStart + dsp_img_info->end_offset); 1124 + run_address = dsp_img_info->run_address; 1125 + run_size = dsp_img_info->image_size; 1126 + image_chksum = (u32)dsp_img_info->checksum; 1127 1127 break; 1128 1128 } 1129 - pDspImageInfoV6++; 1129 + dsp_img_info++; 1130 1130 1131 1131 1132 1132 } //end of for 1133 1133 1134 - if (!bGoodVersion) 1134 + if (!correct_version) 1135 1135 { 1136 1136 /* 1137 1137 * Error, beyond boot code range. 1138 1138 */ 1139 1139 DEBUG("FT1000:download:Download error: Bad Version Request = 0x%x.\n",(int)requested_version); 1140 - Status = STATUS_FAILURE; 1140 + status = STATUS_FAILURE; 1141 1141 break; 1142 1142 } 1143 1143 break; 1144 1144 1145 1145 default: 1146 1146 DEBUG("FT1000:download:Download error: Bad request type=%d in CODE download state.\n",request); 1147 - Status = STATUS_FAILURE; 1147 + status = STATUS_FAILURE; 1148 1148 break; 1149 1149 } 1150 1150 if (pft1000info->usbboot) ··· 1155 1155 else 1156 1156 { 1157 1157 DEBUG("FT1000:download:Download error: Handshake failed\n"); 1158 - Status = STATUS_FAILURE; 1158 + status = STATUS_FAILURE; 1159 1159 } 1160 1160 1161 1161 break; 1162 1162 1163 1163 case STATE_DONE_DWNLD: 1164 1164 DEBUG("FT1000:download:Code loader is done...\n"); 1165 - uiState = STATE_SECTION_PROV; 1165 + state = STATE_SECTION_PROV; 1166 1166 break; 1167 1167 1168 1168 case STATE_SECTION_PROV: 1169 1169 DEBUG("FT1000:download:STATE_SECTION_PROV\n"); 1170 - pHdr = (struct pseudo_hdr *)pUcFile; 1170 + pseudo_header = (struct pseudo_hdr *)c_file; 1171 1171 1172 - if (pHdr->checksum == hdr_checksum(pHdr)) 1172 + if (pseudo_header->checksum == hdr_checksum(pseudo_header)) 1173 1173 { 1174 - if (pHdr->portdest != 0x80 /* Dsp OAM */) 1174 + if (pseudo_header->portdest != 0x80 /* Dsp OAM */) 1175 1175 { 1176 - uiState = STATE_DONE_PROV; 1176 + state = STATE_DONE_PROV; 1177 1177 break; 1178 1178 } 1179 - usHdrLength = ntohs(pHdr->length); /* Byte length for PROV records */ 1179 + pseudo_header_len = ntohs(pseudo_header->length); /* Byte length for PROV records */ 1180 1180 1181 1181 // Get buffer for provisioning data 1182 - pbuffer = kmalloc((usHdrLength + sizeof(struct pseudo_hdr)), GFP_ATOMIC); 1182 + pbuffer = kmalloc((pseudo_header_len + sizeof(struct pseudo_hdr)), GFP_ATOMIC); 1183 1183 if (pbuffer) { 1184 - memcpy(pbuffer, (void *)pUcFile, (u32)(usHdrLength + sizeof(struct pseudo_hdr))); 1184 + memcpy(pbuffer, (void *)c_file, (u32)(pseudo_header_len + sizeof(struct pseudo_hdr))); 1185 1185 // link provisioning data 1186 1186 pprov_record = kmalloc(sizeof(struct prov_record), GFP_ATOMIC); 1187 1187 if (pprov_record) { 1188 1188 pprov_record->pprov_data = pbuffer; 1189 1189 list_add_tail (&pprov_record->list, &pft1000info->prov_list); 1190 1190 // Move to next entry if available 1191 - pUcFile = (u8 *)((unsigned long)pUcFile + (u32)((usHdrLength + 1) & 0xFFFFFFFE) + sizeof(struct pseudo_hdr)); 1192 - if ( (unsigned long)(pUcFile) - (unsigned long)(pFileStart) >= (unsigned long)FileLength) { 1193 - uiState = STATE_DONE_FILE; 1191 + c_file = (u8 *)((unsigned long)c_file + (u32)((pseudo_header_len + 1) & 0xFFFFFFFE) + sizeof(struct pseudo_hdr)); 1192 + if ( (unsigned long)(c_file) - (unsigned long)(pFileStart) >= (unsigned long)FileLength) { 1193 + state = STATE_DONE_FILE; 1194 1194 } 1195 1195 } 1196 1196 else { 1197 1197 kfree(pbuffer); 1198 - Status = STATUS_FAILURE; 1198 + status = STATUS_FAILURE; 1199 1199 } 1200 1200 } 1201 1201 else { 1202 - Status = STATUS_FAILURE; 1202 + status = STATUS_FAILURE; 1203 1203 } 1204 1204 } 1205 1205 else 1206 1206 { 1207 1207 /* Checksum did not compute */ 1208 - Status = STATUS_FAILURE; 1208 + status = STATUS_FAILURE; 1209 1209 } 1210 - DEBUG("ft1000:download: after STATE_SECTION_PROV, uiState = %d, Status= %d\n", uiState, Status); 1210 + DEBUG("ft1000:download: after STATE_SECTION_PROV, state = %d, status= %d\n", state, status); 1211 1211 break; 1212 1212 1213 1213 case STATE_DONE_PROV: 1214 1214 DEBUG("FT1000:download:STATE_DONE_PROV\n"); 1215 - uiState = STATE_DONE_FILE; 1215 + state = STATE_DONE_FILE; 1216 1216 break; 1217 1217 1218 1218 1219 1219 default: 1220 - Status = STATUS_FAILURE; 1220 + status = STATUS_FAILURE; 1221 1221 break; 1222 1222 } /* End Switch */ 1223 1223 1224 - if (Status != STATUS_SUCCESS) { 1224 + if (status != STATUS_SUCCESS) { 1225 1225 break; 1226 1226 } 1227 1227 1228 1228 /**** 1229 1229 // Check if Card is present 1230 - Status = Harley_Read_Register(&temp, FT1000_REG_SUP_IMASK); 1231 - if ( (Status != NDIS_STATUS_SUCCESS) || (temp == 0x0000) ) { 1230 + status = Harley_Read_Register(&temp, FT1000_REG_SUP_IMASK); 1231 + if ( (status != NDIS_STATUS_SUCCESS) || (temp == 0x0000) ) { 1232 1232 break; 1233 1233 } 1234 1234 1235 - Status = Harley_Read_Register(&temp, FT1000_REG_ASIC_ID); 1236 - if ( (Status != NDIS_STATUS_SUCCESS) || (temp == 0xffff) ) { 1235 + status = Harley_Read_Register(&temp, FT1000_REG_ASIC_ID); 1236 + if ( (status != NDIS_STATUS_SUCCESS) || (temp == 0xffff) ) { 1237 1237 break; 1238 1238 } 1239 1239 ****/ 1240 1240 1241 1241 } /* End while */ 1242 1242 1243 - DEBUG("Download exiting with status = 0x%8x\n", Status); 1243 + DEBUG("Download exiting with status = 0x%8x\n", status); 1244 1244 ft1000_write_register(ft1000dev, FT1000_DB_DNLD_TX, FT1000_REG_DOORBELL); 1245 1245 1246 - return Status; 1246 + return status; 1247 1247 } 1248 1248