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

staging: keucr: fix keucr init coding style

fix keucr init.c init.h coding style.
only fix coding style check by checkpatch.pl.

Signed-off-by: Al Cho <acho@novell.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by

Al Cho and committed by
Greg Kroah-Hartman
e93192ac 280740a9

+217 -201
+214 -201
drivers/staging/keucr/init.c
··· 11 11 #include "transport.h" 12 12 #include "init.h" 13 13 14 - BYTE IsSSFDCCompliance; 15 - BYTE IsXDCompliance; 16 - extern DWORD MediaChange; 17 - extern int Check_D_MediaFmt(struct us_data *); 14 + BYTE IsSSFDCCompliance; 15 + BYTE IsXDCompliance; 18 16 19 - //----- ENE_InitMedia() ---------------------------------------- 17 + /* 18 + * ENE_InitMedia(): 19 + */ 20 20 int ENE_InitMedia(struct us_data *us) 21 21 { 22 22 int result; 23 23 BYTE MiscReg03 = 0; 24 24 25 - printk("--- Init Media ---\n"); 25 + printk(KERN_INFO "--- Init Media ---\n"); 26 26 result = ENE_Read_BYTE(us, REG_CARD_STATUS, &MiscReg03); 27 - if (result != USB_STOR_XFER_GOOD) 28 - { 29 - printk("Read register fail !!\n"); 27 + if (result != USB_STOR_XFER_GOOD) { 28 + printk(KERN_ERR "Read register fail !!\n"); 30 29 return USB_STOR_TRANSPORT_ERROR; 31 30 } 32 - printk("MiscReg03 = %x\n", MiscReg03); 31 + printk(KERN_INFO "MiscReg03 = %x\n", MiscReg03); 33 32 34 - if (MiscReg03 & 0x01) 35 - { 36 - if (!us->SD_Status.Ready) 37 - { 33 + if (MiscReg03 & 0x01) { 34 + if (!us->SD_Status.Ready) { 38 35 result = ENE_SDInit(us); 39 36 if (result != USB_STOR_XFER_GOOD) 40 37 return USB_STOR_TRANSPORT_ERROR; 41 38 } 42 39 } 43 40 44 - if (MiscReg03 & 0x02) 45 - { 46 - if (!us->SM_Status.Ready && !us->MS_Status.Ready) 47 - { 41 + if (MiscReg03 & 0x02) { 42 + if (!us->SM_Status.Ready && !us->MS_Status.Ready) { 48 43 result = ENE_SMInit(us); 49 - if (result != USB_STOR_XFER_GOOD) 50 - { 44 + if (result != USB_STOR_XFER_GOOD) { 51 45 result = ENE_MSInit(us); 52 46 if (result != USB_STOR_XFER_GOOD) 53 47 return USB_STOR_TRANSPORT_ERROR; ··· 52 58 return result; 53 59 } 54 60 55 - //----- ENE_Read_BYTE() ---------------------------------------- 61 + /* 62 + * ENE_Read_BYTE() : 63 + */ 56 64 int ENE_Read_BYTE(struct us_data *us, WORD index, void *buf) 57 65 { 58 66 struct bulk_cb_wrap *bcb = (struct bulk_cb_wrap *) us->iobuf; ··· 72 76 return result; 73 77 } 74 78 75 - //----- ENE_SDInit() --------------------- 79 + /* 80 + * ENE_SDInit(): 81 + */ 76 82 int ENE_SDInit(struct us_data *us) 77 83 { 78 84 struct bulk_cb_wrap *bcb = (struct bulk_cb_wrap *) us->iobuf; 79 85 int result; 80 86 BYTE buf[0x200]; 81 87 82 - printk("transport --- ENE_SDInit\n"); 83 - // SD Init Part-1 88 + printk(KERN_INFO "transport --- ENE_SDInit\n"); 89 + /* SD Init Part-1 */ 84 90 result = ENE_LoadBinCode(us, SD_INIT1_PATTERN); 85 - if (result != USB_STOR_XFER_GOOD) 86 - { 87 - printk("Load SD Init Code Part-1 Fail !!\n"); 91 + if (result != USB_STOR_XFER_GOOD) { 92 + printk(KERN_ERR "Load SD Init Code Part-1 Fail !!\n"); 88 93 return USB_STOR_TRANSPORT_ERROR; 89 94 } 90 95 ··· 95 98 bcb->CDB[0] = 0xF2; 96 99 97 100 result = ENE_SendScsiCmd(us, FDIR_READ, NULL, 0); 98 - if (result != USB_STOR_XFER_GOOD) 99 - { 100 - printk("Exection SD Init Code Fail !!\n"); 101 + if (result != USB_STOR_XFER_GOOD) { 102 + printk(KERN_ERR "Exection SD Init Code Fail !!\n"); 101 103 return USB_STOR_TRANSPORT_ERROR; 102 104 } 103 105 104 - // SD Init Part-2 106 + /* SD Init Part-2 */ 105 107 result = ENE_LoadBinCode(us, SD_INIT2_PATTERN); 106 - if (result != USB_STOR_XFER_GOOD) 107 - { 108 - printk("Load SD Init Code Part-2 Fail !!\n"); 108 + if (result != USB_STOR_XFER_GOOD) { 109 + printk(KERN_ERR "Load SD Init Code Part-2 Fail !!\n"); 109 110 return USB_STOR_TRANSPORT_ERROR; 110 111 } 111 112 ··· 114 119 bcb->CDB[0] = 0xF1; 115 120 116 121 result = ENE_SendScsiCmd(us, FDIR_READ, &buf, 0); 117 - if (result != USB_STOR_XFER_GOOD) 118 - { 119 - printk("Exection SD Init Code Fail !!\n"); 122 + if (result != USB_STOR_XFER_GOOD) { 123 + printk(KERN_ERR "Exection SD Init Code Fail !!\n"); 120 124 return USB_STOR_TRANSPORT_ERROR; 121 125 } 122 126 123 127 us->SD_Status = *(PSD_STATUS)&buf[0]; 124 - if (us->SD_Status.Insert && us->SD_Status.Ready) 125 - { 128 + if (us->SD_Status.Insert && us->SD_Status.Ready) { 126 129 ENE_ReadSDReg(us, (PBYTE)&buf); 127 - printk("Insert = %x\n", us->SD_Status.Insert); 128 - printk("Ready = %x\n", us->SD_Status.Ready); 129 - printk("IsMMC = %x\n", us->SD_Status.IsMMC); 130 - printk("HiCapacity = %x\n", us->SD_Status.HiCapacity); 131 - printk("HiSpeed = %x\n", us->SD_Status.HiSpeed); 132 - printk("WtP = %x\n", us->SD_Status.WtP); 133 - } 134 - else 135 - { 136 - printk("SD Card Not Ready --- %x\n", buf[0]); 130 + printk(KERN_INFO "Insert = %x\n", us->SD_Status.Insert); 131 + printk(KERN_INFO "Ready = %x\n", us->SD_Status.Ready); 132 + printk(KERN_INFO "IsMMC = %x\n", us->SD_Status.IsMMC); 133 + printk(KERN_INFO "HiCapacity = %x\n", us->SD_Status.HiCapacity); 134 + printk(KERN_INFO "HiSpeed = %x\n", us->SD_Status.HiSpeed); 135 + printk(KERN_INFO "WtP = %x\n", us->SD_Status.WtP); 136 + } else { 137 + printk(KERN_ERR "SD Card Not Ready --- %x\n", buf[0]); 137 138 return USB_STOR_TRANSPORT_ERROR; 138 139 } 139 140 return USB_STOR_TRANSPORT_GOOD; 140 141 } 141 142 142 - //----- ENE_MSInit() ---------------------------------------- 143 + /* 144 + * ENE_MSInit(): 145 + */ 143 146 int ENE_MSInit(struct us_data *us) 144 147 { 145 148 struct bulk_cb_wrap *bcb = (struct bulk_cb_wrap *) us->iobuf; 146 149 int result; 147 150 BYTE buf[0x200]; 148 151 WORD MSP_BlockSize, MSP_UserAreaBlocks; 149 - 150 152 151 - printk("transport --- ENE_MSInit\n"); 153 + printk(KERN_INFO "transport --- ENE_MSInit\n"); 152 154 result = ENE_LoadBinCode(us, MS_INIT_PATTERN); 153 - if (result != USB_STOR_XFER_GOOD) 154 - { 155 - printk("Load MS Init Code Fail !!\n"); 155 + if (result != USB_STOR_XFER_GOOD) { 156 + printk(KERN_ERR "Load MS Init Code Fail !!\n"); 156 157 return USB_STOR_TRANSPORT_ERROR; 157 158 } 158 159 ··· 160 169 bcb->CDB[1] = 0x01; 161 170 162 171 result = ENE_SendScsiCmd(us, FDIR_READ, &buf, 0); 163 - if (result != USB_STOR_XFER_GOOD) 164 - { 165 - printk("Exection MS Init Code Fail !!\n"); 172 + if (result != USB_STOR_XFER_GOOD) { 173 + printk(KERN_ERR "Exection MS Init Code Fail !!\n"); 166 174 return USB_STOR_TRANSPORT_ERROR; 167 175 } 168 176 169 177 us->MS_Status = *(PMS_STATUS)&buf[0]; 170 178 171 - if (us->MS_Status.Insert && us->MS_Status.Ready) 172 - { 173 - printk("Insert = %x\n", us->MS_Status.Insert); 174 - printk("Ready = %x\n", us->MS_Status.Ready); 175 - printk("IsMSPro = %x\n", us->MS_Status.IsMSPro); 176 - printk("IsMSPHG = %x\n", us->MS_Status.IsMSPHG); 177 - printk("WtP = %x\n", us->MS_Status.WtP); 178 - if (us->MS_Status.IsMSPro) 179 - { 180 - MSP_BlockSize = (buf[6] <<8) | buf[7]; 181 - MSP_UserAreaBlocks = (buf[10]<<8) | buf[11]; 179 + if (us->MS_Status.Insert && us->MS_Status.Ready) { 180 + printk(KERN_INFO "Insert = %x\n", us->MS_Status.Insert); 181 + printk(KERN_INFO "Ready = %x\n", us->MS_Status.Ready); 182 + printk(KERN_INFO "IsMSPro = %x\n", us->MS_Status.IsMSPro); 183 + printk(KERN_INFO "IsMSPHG = %x\n", us->MS_Status.IsMSPHG); 184 + printk(KERN_INFO "WtP = %x\n", us->MS_Status.WtP); 185 + if (us->MS_Status.IsMSPro) { 186 + MSP_BlockSize = (buf[6] << 8) | buf[7]; 187 + MSP_UserAreaBlocks = (buf[10] << 8) | buf[11]; 182 188 us->MSP_TotalBlock = MSP_BlockSize * MSP_UserAreaBlocks; 183 - } 184 - else 189 + } else { 185 190 MS_CardInit(us); 186 - printk("MS Init Code OK !!\n"); 187 - } 188 - else 189 - { 190 - printk("MS Card Not Ready --- %x\n", buf[0]); 191 + } 192 + printk(KERN_INFO "MS Init Code OK !!\n"); 193 + } else { 194 + printk(KERN_INFO "MS Card Not Ready --- %x\n", buf[0]); 191 195 return USB_STOR_TRANSPORT_ERROR; 192 196 } 193 197 194 198 return USB_STOR_TRANSPORT_GOOD; 195 199 } 196 200 197 - //----- ENE_SMInit() ---------------------------------------- 201 + /* 202 + *ENE_SMInit() 203 + */ 198 204 int ENE_SMInit(struct us_data *us) 199 205 { 200 206 struct bulk_cb_wrap *bcb = (struct bulk_cb_wrap *) us->iobuf; 201 207 int result; 202 208 BYTE buf[0x200]; 203 209 204 - printk("transport --- ENE_SMInit\n"); 210 + printk(KERN_INFO "transport --- ENE_SMInit\n"); 205 211 206 212 result = ENE_LoadBinCode(us, SM_INIT_PATTERN); 207 - if (result != USB_STOR_XFER_GOOD) 208 - { 209 - printk("Load SM Init Code Fail !!\n"); 213 + if (result != USB_STOR_XFER_GOOD) { 214 + printk(KERN_INFO "Load SM Init Code Fail !!\n"); 210 215 return USB_STOR_TRANSPORT_ERROR; 211 216 } 212 217 ··· 214 227 bcb->CDB[1] = 0x01; 215 228 216 229 result = ENE_SendScsiCmd(us, FDIR_READ, &buf, 0); 217 - if (result != USB_STOR_XFER_GOOD) 218 - { 219 - printk("Exection SM Init Code Fail !! result = %x\n", result); 230 + if (result != USB_STOR_XFER_GOOD) { 231 + printk(KERN_ERR 232 + "Exection SM Init Code Fail !! result = %x\n", result); 220 233 return USB_STOR_TRANSPORT_ERROR; 221 234 } 222 235 ··· 225 238 us->SM_DeviceID = buf[1]; 226 239 us->SM_CardID = buf[2]; 227 240 228 - if (us->SM_Status.Insert && us->SM_Status.Ready) 229 - { 230 - printk("Insert = %x\n", us->SM_Status.Insert); 231 - printk("Ready = %x\n", us->SM_Status.Ready); 232 - printk("WtP = %x\n", us->SM_Status.WtP); 233 - printk("DeviceID = %x\n", us->SM_DeviceID); 234 - printk("CardID = %x\n", us->SM_CardID); 241 + if (us->SM_Status.Insert && us->SM_Status.Ready) { 242 + printk(KERN_INFO "Insert = %x\n", us->SM_Status.Insert); 243 + printk(KERN_INFO "Ready = %x\n", us->SM_Status.Ready); 244 + printk(KERN_INFO "WtP = %x\n", us->SM_Status.WtP); 245 + printk(KERN_INFO "DeviceID = %x\n", us->SM_DeviceID); 246 + printk(KERN_INFO "CardID = %x\n", us->SM_CardID); 235 247 MediaChange = 1; 236 248 Check_D_MediaFmt(us); 237 - } 238 - else 239 - { 240 - printk("SM Card Not Ready --- %x\n", buf[0]); 249 + } else { 250 + printk(KERN_ERR "SM Card Not Ready --- %x\n", buf[0]); 241 251 return USB_STOR_TRANSPORT_ERROR; 242 252 } 243 253 244 254 return USB_STOR_TRANSPORT_GOOD; 245 255 } 246 256 247 - //----- ENE_ReadSDReg() ---------------------------------------------- 257 + /* 258 + * ENE_ReadSDReg() 259 + */ 248 260 int ENE_ReadSDReg(struct us_data *us, u8 *RdBuf) 249 261 { 250 262 WORD tmpreg; 251 263 DWORD reg4b; 252 - 253 - //printk("transport --- ENE_ReadSDReg\n"); 264 + 265 + /* printk(KERN_INFO "transport --- ENE_ReadSDReg\n"); */ 254 266 reg4b = *(PDWORD)&RdBuf[0x18]; 255 267 us->SD_READ_BL_LEN = (BYTE)((reg4b >> 8) & 0x0f); 256 268 ··· 263 277 if (us->SD_Status.HiCapacity && us->SD_Status.IsMMC) 264 278 us->HC_C_SIZE = *(PDWORD)(&RdBuf[0x100]); 265 279 266 - if (us->SD_READ_BL_LEN > SD_BLOCK_LEN) 267 - { 268 - us->SD_Block_Mult = 1 << (us->SD_READ_BL_LEN - SD_BLOCK_LEN); us->SD_READ_BL_LEN = SD_BLOCK_LEN; 269 - } 270 - else 271 - { us->SD_Block_Mult = 1; 280 + if (us->SD_READ_BL_LEN > SD_BLOCK_LEN) { 281 + us->SD_Block_Mult = 282 + 1 << (us->SD_READ_BL_LEN - SD_BLOCK_LEN); 283 + us->SD_READ_BL_LEN = SD_BLOCK_LEN; 284 + } else { 285 + us->SD_Block_Mult = 1; 272 286 } 273 287 return USB_STOR_TRANSPORT_GOOD; 274 288 } 275 289 276 - //----- ENE_LoadBinCode() --------------------- 290 + /* 291 + * ENE_LoadBinCode() 292 + */ 277 293 int ENE_LoadBinCode(struct us_data *us, BYTE flag) 278 294 { 279 295 struct bulk_cb_wrap *bcb = (struct bulk_cb_wrap *) us->iobuf; 280 296 int result; 281 - //void *buf; 297 + /* void *buf; */ 282 298 PBYTE buf; 283 299 284 - //printk("transport --- ENE_LoadBinCode\n"); 300 + /* printk(KERN_INFO "transport --- ENE_LoadBinCode\n"); */ 285 301 if (us->BIN_FLAG == flag) 286 302 return USB_STOR_TRANSPORT_GOOD; 287 303 288 304 buf = kmalloc(0x800, GFP_KERNEL); 289 305 if (buf == NULL) 290 306 return USB_STOR_TRANSPORT_ERROR; 291 - switch ( flag ) 292 - { 293 - // For SD 294 - case SD_INIT1_PATTERN: 295 - printk("SD_INIT1_PATTERN\n"); 296 - memcpy(buf, SD_Init1, 0x800); 307 + switch (flag) { 308 + /* For SD */ 309 + case SD_INIT1_PATTERN: 310 + printk(KERN_INFO "SD_INIT1_PATTERN\n"); 311 + memcpy(buf, SD_Init1, 0x800); 297 312 break; 298 - case SD_INIT2_PATTERN: 299 - printk("SD_INIT2_PATTERN\n"); 300 - memcpy(buf, SD_Init2, 0x800); 313 + case SD_INIT2_PATTERN: 314 + printk(KERN_INFO "SD_INIT2_PATTERN\n"); 315 + memcpy(buf, SD_Init2, 0x800); 301 316 break; 302 - case SD_RW_PATTERN: 303 - printk("SD_RW_PATTERN\n"); 304 - memcpy(buf, SD_Rdwr, 0x800); 317 + case SD_RW_PATTERN: 318 + printk(KERN_INFO "SD_RW_PATTERN\n"); 319 + memcpy(buf, SD_Rdwr, 0x800); 305 320 break; 306 - // For MS 307 - case MS_INIT_PATTERN: 308 - printk("MS_INIT_PATTERN\n"); 309 - memcpy(buf, MS_Init, 0x800); 321 + /* For MS */ 322 + case MS_INIT_PATTERN: 323 + printk(KERN_INFO "MS_INIT_PATTERN\n"); 324 + memcpy(buf, MS_Init, 0x800); 310 325 break; 311 - case MSP_RW_PATTERN: 312 - printk("MSP_RW_PATTERN\n"); 313 - memcpy(buf, MSP_Rdwr, 0x800); 326 + case MSP_RW_PATTERN: 327 + printk(KERN_INFO "MSP_RW_PATTERN\n"); 328 + memcpy(buf, MSP_Rdwr, 0x800); 314 329 break; 315 - case MS_RW_PATTERN: 316 - printk("MS_RW_PATTERN\n"); 317 - memcpy(buf, MS_Rdwr, 0x800); 330 + case MS_RW_PATTERN: 331 + printk(KERN_INFO "MS_RW_PATTERN\n"); 332 + memcpy(buf, MS_Rdwr, 0x800); 318 333 break; 319 - // For SS 320 - case SM_INIT_PATTERN: 321 - printk("SM_INIT_PATTERN\n"); 322 - memcpy(buf, SM_Init, 0x800); 334 + /* For SS */ 335 + case SM_INIT_PATTERN: 336 + printk(KERN_INFO "SM_INIT_PATTERN\n"); 337 + memcpy(buf, SM_Init, 0x800); 323 338 break; 324 - case SM_RW_PATTERN: 325 - printk("SM_RW_PATTERN\n"); 326 - memcpy(buf, SM_Rdwr, 0x800); 339 + case SM_RW_PATTERN: 340 + printk(KERN_INFO "SM_RW_PATTERN\n"); 341 + memcpy(buf, SM_Rdwr, 0x800); 327 342 break; 328 343 } 329 344 330 345 memset(bcb, 0, sizeof(struct bulk_cb_wrap)); 331 346 bcb->Signature = cpu_to_le32(US_BULK_CB_SIGN); 332 347 bcb->DataTransferLength = 0x800; 333 - bcb->Flags =0x00; 348 + bcb->Flags = 0x00; 334 349 bcb->CDB[0] = 0xEF; 335 350 336 351 result = ENE_SendScsiCmd(us, FDIR_WRITE, buf, 0); ··· 341 354 return result; 342 355 } 343 356 344 - //----- ENE_SendScsiCmd() --------------------- 357 + /* 358 + * ENE_SendScsiCmd(): 359 + */ 345 360 int ENE_SendScsiCmd(struct us_data *us, BYTE fDir, void *buf, int use_sg) 346 361 { 347 362 struct bulk_cb_wrap *bcb = (struct bulk_cb_wrap *) us->iobuf; 348 363 struct bulk_cs_wrap *bcs = (struct bulk_cs_wrap *) us->iobuf; 349 364 350 365 int result; 351 - unsigned int transfer_length=bcb->DataTransferLength, cswlen=0, partial=0; 366 + unsigned int transfer_length = bcb->DataTransferLength, 367 + cswlen = 0, partial = 0; 352 368 unsigned int residue; 353 369 354 - //printk("transport --- ENE_SendScsiCmd\n"); 355 - // send cmd to out endpoint 356 - result = usb_stor_bulk_transfer_buf(us, us->send_bulk_pipe, bcb, US_BULK_CB_WRAP_LEN, NULL); 357 - if (result != USB_STOR_XFER_GOOD) 358 - { 359 - printk("send cmd to out endpoint fail ---\n"); 370 + /* printk(KERN_INFO "transport --- ENE_SendScsiCmd\n"); */ 371 + /* send cmd to out endpoint */ 372 + result = usb_stor_bulk_transfer_buf(us, us->send_bulk_pipe, 373 + bcb, US_BULK_CB_WRAP_LEN, NULL); 374 + if (result != USB_STOR_XFER_GOOD) { 375 + printk(KERN_ERR "send cmd to out endpoint fail ---\n"); 360 376 return USB_STOR_TRANSPORT_ERROR; 361 377 } 362 378 363 - if (buf) 364 - { 365 - unsigned int pipe = fDir == FDIR_READ ? us->recv_bulk_pipe : us->send_bulk_pipe; 366 - // Bulk 379 + if (buf) { 380 + unsigned int pipe = fDir == 381 + FDIR_READ ? us->recv_bulk_pipe : us->send_bulk_pipe; 382 + /* Bulk */ 367 383 if (use_sg) 368 384 result = usb_stor_bulk_srb(us, pipe, us->srb); 369 385 else 370 - result = usb_stor_bulk_transfer_sg(us, pipe, buf, transfer_length, 0, &partial); 371 - if (result != USB_STOR_XFER_GOOD) 372 - { 373 - printk("data transfer fail ---\n"); 386 + result = usb_stor_bulk_transfer_sg(us, pipe, buf, 387 + transfer_length, 0, &partial); 388 + if (result != USB_STOR_XFER_GOOD) { 389 + printk(KERN_ERR "data transfer fail ---\n"); 374 390 return USB_STOR_TRANSPORT_ERROR; 375 391 } 376 392 } 377 393 378 - // Get CSW for device status 379 - result = usb_stor_bulk_transfer_buf(us, us->recv_bulk_pipe, bcs, US_BULK_CS_WRAP_LEN, &cswlen); 394 + /* Get CSW for device status */ 395 + result = usb_stor_bulk_transfer_buf(us, us->recv_bulk_pipe, bcs, 396 + US_BULK_CS_WRAP_LEN, &cswlen); 380 397 381 - if (result == USB_STOR_XFER_SHORT && cswlen == 0) 382 - { 383 - printk("Received 0-length CSW; retrying...\n"); 384 - result = usb_stor_bulk_transfer_buf(us, us->recv_bulk_pipe, bcs, US_BULK_CS_WRAP_LEN, &cswlen); 398 + if (result == USB_STOR_XFER_SHORT && cswlen == 0) { 399 + printk(KERN_WARNING "Received 0-length CSW; retrying...\n"); 400 + result = usb_stor_bulk_transfer_buf(us, us->recv_bulk_pipe, 401 + bcs, US_BULK_CS_WRAP_LEN, &cswlen); 385 402 } 386 403 387 - if (result == USB_STOR_XFER_STALLED) 388 - { 404 + if (result == USB_STOR_XFER_STALLED) { 389 405 /* get the status again */ 390 - printk("Attempting to get CSW (2nd try)...\n"); 391 - result = usb_stor_bulk_transfer_buf(us, us->recv_bulk_pipe, bcs, US_BULK_CS_WRAP_LEN, NULL); 406 + printk(KERN_WARNING "Attempting to get CSW (2nd try)...\n"); 407 + result = usb_stor_bulk_transfer_buf(us, us->recv_bulk_pipe, 408 + bcs, US_BULK_CS_WRAP_LEN, NULL); 392 409 } 393 410 394 411 if (result != USB_STOR_XFER_GOOD) ··· 401 410 /* check bulk status */ 402 411 residue = le32_to_cpu(bcs->Residue); 403 412 404 - /* try to compute the actual residue, based on how much data 405 - * was really transferred and what the device tells us */ 406 - if (residue && !(us->fflags & US_FL_IGNORE_RESIDUE)) 407 - { 413 + /* 414 + * try to compute the actual residue, based on how much data 415 + * was really transferred and what the device tells us 416 + */ 417 + if (residue && !(us->fflags & US_FL_IGNORE_RESIDUE)) { 408 418 residue = min(residue, transfer_length); 409 - scsi_set_resid(us->srb, max(scsi_get_resid(us->srb), (int) residue)); 419 + scsi_set_resid(us->srb, max(scsi_get_resid(us->srb), 420 + (int) residue)); 410 421 } 411 422 412 423 if (bcs->Status != US_BULK_STAT_OK) ··· 417 424 return USB_STOR_TRANSPORT_GOOD; 418 425 } 419 426 420 - //----- ENE_Read_Data() --------------------- 427 + /* 428 + * ENE_Read_Data() 429 + */ 421 430 int ENE_Read_Data(struct us_data *us, void *buf, unsigned int length) 422 431 { 423 432 struct bulk_cb_wrap *bcb = (struct bulk_cb_wrap *) us->iobuf; 424 433 struct bulk_cs_wrap *bcs = (struct bulk_cs_wrap *) us->iobuf; 425 434 int result; 426 435 427 - //printk("transport --- ENE_Read_Data\n"); 428 - // set up the command wrapper 436 + /* printk(KERN_INFO "transport --- ENE_Read_Data\n"); */ 437 + /* set up the command wrapper */ 429 438 memset(bcb, 0, sizeof(struct bulk_cb_wrap)); 430 439 bcb->Signature = cpu_to_le32(US_BULK_CB_SIGN); 431 440 bcb->DataTransferLength = length; 432 - bcb->Flags =0x80; 441 + bcb->Flags = 0x80; 433 442 bcb->CDB[0] = 0xED; 434 443 bcb->CDB[2] = 0xFF; 435 444 bcb->CDB[3] = 0x81; 436 445 437 - // send cmd to out endpoint 438 - result = usb_stor_bulk_transfer_buf(us, us->send_bulk_pipe, bcb, US_BULK_CB_WRAP_LEN, NULL); 446 + /* send cmd to out endpoint */ 447 + result = usb_stor_bulk_transfer_buf(us, us->send_bulk_pipe, bcb, 448 + US_BULK_CB_WRAP_LEN, NULL); 439 449 if (result != USB_STOR_XFER_GOOD) 440 450 return USB_STOR_TRANSPORT_ERROR; 441 451 442 - // R/W data 443 - result = usb_stor_bulk_transfer_buf(us, us->recv_bulk_pipe, buf, length, NULL); 452 + /* R/W data */ 453 + result = usb_stor_bulk_transfer_buf(us, us->recv_bulk_pipe, 454 + buf, length, NULL); 444 455 if (result != USB_STOR_XFER_GOOD) 445 456 return USB_STOR_TRANSPORT_ERROR; 446 457 447 - // Get CSW for device status 448 - result = usb_stor_bulk_transfer_buf(us, us->recv_bulk_pipe, bcs, US_BULK_CS_WRAP_LEN, NULL); 458 + /* Get CSW for device status */ 459 + result = usb_stor_bulk_transfer_buf(us, us->recv_bulk_pipe, bcs, 460 + US_BULK_CS_WRAP_LEN, NULL); 449 461 if (result != USB_STOR_XFER_GOOD) 450 462 return USB_STOR_TRANSPORT_ERROR; 451 463 if (bcs->Status != US_BULK_STAT_OK) ··· 459 461 return USB_STOR_TRANSPORT_GOOD; 460 462 } 461 463 462 - //----- ENE_Write_Data() --------------------- 464 + /* 465 + * ENE_Write_Data(): 466 + */ 463 467 int ENE_Write_Data(struct us_data *us, void *buf, unsigned int length) 464 468 { 465 469 struct bulk_cb_wrap *bcb = (struct bulk_cb_wrap *) us->iobuf; 466 470 struct bulk_cs_wrap *bcs = (struct bulk_cs_wrap *) us->iobuf; 467 471 int result; 468 472 469 - //printk("transport --- ENE_Write_Data\n"); 470 - // set up the command wrapper 473 + /* printk("transport --- ENE_Write_Data\n"); */ 474 + /* set up the command wrapper */ 471 475 memset(bcb, 0, sizeof(struct bulk_cb_wrap)); 472 476 bcb->Signature = cpu_to_le32(US_BULK_CB_SIGN); 473 477 bcb->DataTransferLength = length; 474 - bcb->Flags =0x00; 478 + bcb->Flags = 0x00; 475 479 bcb->CDB[0] = 0xEE; 476 480 bcb->CDB[2] = 0xFF; 477 481 bcb->CDB[3] = 0x81; 478 482 479 - // send cmd to out endpoint 480 - result = usb_stor_bulk_transfer_buf(us, us->send_bulk_pipe, bcb, US_BULK_CB_WRAP_LEN, NULL); 483 + /* send cmd to out endpoint */ 484 + result = usb_stor_bulk_transfer_buf(us, us->send_bulk_pipe, bcb, 485 + US_BULK_CB_WRAP_LEN, NULL); 481 486 if (result != USB_STOR_XFER_GOOD) 482 487 return USB_STOR_TRANSPORT_ERROR; 483 488 484 - // R/W data 485 - result = usb_stor_bulk_transfer_buf(us, us->send_bulk_pipe, buf, length, NULL); 489 + /* R/W data */ 490 + result = usb_stor_bulk_transfer_buf(us, us->send_bulk_pipe, 491 + buf, length, NULL); 486 492 if (result != USB_STOR_XFER_GOOD) 487 493 return USB_STOR_TRANSPORT_ERROR; 488 494 489 - // Get CSW for device status 490 - result = usb_stor_bulk_transfer_buf(us, us->recv_bulk_pipe, bcs, US_BULK_CS_WRAP_LEN, NULL); 495 + /* Get CSW for device status */ 496 + result = usb_stor_bulk_transfer_buf(us, us->recv_bulk_pipe, bcs, 497 + US_BULK_CS_WRAP_LEN, NULL); 491 498 if (result != USB_STOR_XFER_GOOD) 492 499 return USB_STOR_TRANSPORT_ERROR; 493 500 if (bcs->Status != US_BULK_STAT_OK) ··· 501 498 return USB_STOR_TRANSPORT_GOOD; 502 499 } 503 500 504 - //----- usb_stor_print_cmd() --------------------- 501 + /* 502 + * usb_stor_print_cmd(): 503 + */ 505 504 void usb_stor_print_cmd(struct scsi_cmnd *srb) 506 505 { 507 506 PBYTE Cdb = srb->cmnd; 508 507 DWORD cmd = Cdb[0]; 509 - DWORD bn = ((Cdb[2]<<24) & 0xff000000) | ((Cdb[3]<<16) & 0x00ff0000) | 510 - ((Cdb[4]<< 8) & 0x0000ff00) | ((Cdb[5]<< 0) & 0x000000ff); 511 - WORD blen = ((Cdb[7]<< 8) & 0xff00) | ((Cdb[8]<< 0) & 0x00ff); 508 + DWORD bn = ((Cdb[2] << 24) & 0xff000000) | 509 + ((Cdb[3] << 16) & 0x00ff0000) | 510 + ((Cdb[4] << 8) & 0x0000ff00) | 511 + ((Cdb[5] << 0) & 0x000000ff); 512 + WORD blen = ((Cdb[7] << 8) & 0xff00) | ((Cdb[8] << 0) & 0x00ff); 512 513 513 514 switch (cmd) { 514 515 case TEST_UNIT_READY: 515 - //printk("scsi cmd %X --- SCSIOP_TEST_UNIT_READY\n", cmd); 516 + /* printk(KERN_INFO 517 + "scsi cmd %X --- SCSIOP_TEST_UNIT_READY\n", cmd); */ 516 518 break; 517 519 case INQUIRY: 518 - printk("scsi cmd %X --- SCSIOP_INQUIRY\n", cmd); 520 + printk(KERN_INFO "scsi cmd %X --- SCSIOP_INQUIRY\n", cmd); 519 521 break; 520 522 case MODE_SENSE: 521 - printk("scsi cmd %X --- SCSIOP_MODE_SENSE\n", cmd); 523 + printk(KERN_INFO "scsi cmd %X --- SCSIOP_MODE_SENSE\n", cmd); 522 524 break; 523 525 case START_STOP: 524 - printk("scsi cmd %X --- SCSIOP_START_STOP\n", cmd); 526 + printk(KERN_INFO "scsi cmd %X --- SCSIOP_START_STOP\n", cmd); 525 527 break; 526 528 case READ_CAPACITY: 527 - printk("scsi cmd %X --- SCSIOP_READ_CAPACITY\n", cmd); 529 + printk(KERN_INFO "scsi cmd %X --- SCSIOP_READ_CAPACITY\n", cmd); 528 530 break; 529 531 case READ_10: 530 - //printk("scsi cmd %X --- SCSIOP_READ, bn = %X, blen = %X\n", cmd, bn, blen); 532 + /* printk(KERN_INFO 533 + "scsi cmd %X --- SCSIOP_READ,bn = %X, blen = %X\n" 534 + ,cmd, bn, blen); */ 531 535 break; 532 536 case WRITE_10: 533 - //printk("scsi cmd %X --- SCSIOP_WRITE, bn = %X, blen = %X\n", cmd, bn, blen); 537 + /* printk(KERN_INFO 538 + "scsi cmd %X --- SCSIOP_WRITE, 539 + bn = %X, blen = %X\n" , cmd, bn, blen); */ 534 540 break; 535 541 case ALLOW_MEDIUM_REMOVAL: 536 - printk("scsi cmd %X --- SCSIOP_ALLOW_MEDIUM_REMOVAL\n", cmd); 542 + printk(KERN_INFO 543 + "scsi cmd %X --- SCSIOP_ALLOW_MEDIUM_REMOVAL\n", cmd); 537 544 break; 538 545 default: 539 - printk("scsi cmd %X --- Other cmd\n", cmd); 546 + printk(KERN_INFO "scsi cmd %X --- Other cmd\n", cmd); 540 547 break; 541 548 } 542 549 bn = 0;
+3
drivers/staging/keucr/init.h
··· 1 1 #include "common.h" 2 2 3 + extern DWORD MediaChange; 4 + extern int Check_D_MediaFmt(struct us_data *); 5 + 3 6 BYTE SD_Init1[] = { 4 7 0x90, 0xFF, 0x09, 0xE0, 0x30, 0xE1, 0x06, 0x90, 5 8 0xFF, 0x23, 0x74, 0x80, 0xF0, 0x90, 0xFF, 0x09,