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

staging: hv: Convert camel case struct fields in vstorage.h to lowercase

Convert camel case struct fields in vstorage.h to lowercase

Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by

Hank Janssen and committed by
Greg Kroah-Hartman
d2aaba45 37db5264

+120 -119
+67 -66
drivers/staging/hv/storvsc.c
··· 204 204 goto nomem; 205 205 } 206 206 207 - vstorPacket->Operation = VStorOperationBeginInitialization; 208 - vstorPacket->Flags = REQUEST_COMPLETION_FLAG; 207 + vstorPacket->operation = VSTOR_OPERATION_BEGIN_INITIALIZATION; 208 + vstorPacket->flags = REQUEST_COMPLETION_FLAG; 209 209 210 210 /*SpinlockAcquire(gDriverExt.packetListLock); 211 211 INSERT_TAIL_LIST(&gDriverExt.packetList, &packet->listEntry.entry); ··· 226 226 227 227 osd_waitevent_wait(request->WaitEvent); 228 228 229 - if (vstorPacket->Operation != VStorOperationCompleteIo || 230 - vstorPacket->Status != 0) { 229 + if (vstorPacket->operation != VSTOR_OPERATION_COMPLETE_IO || 230 + vstorPacket->status != 0) { 231 231 DPRINT_ERR(STORVSC, "BEGIN_INITIALIZATION_OPERATION failed " 232 232 "(op %d status 0x%x)", 233 - vstorPacket->Operation, vstorPacket->Status); 233 + vstorPacket->operation, vstorPacket->status); 234 234 goto Cleanup; 235 235 } 236 236 ··· 238 238 239 239 /* reuse the packet for version range supported */ 240 240 memset(vstorPacket, 0, sizeof(struct vstor_packet)); 241 - vstorPacket->Operation = VStorOperationQueryProtocolVersion; 242 - vstorPacket->Flags = REQUEST_COMPLETION_FLAG; 241 + vstorPacket->operation = VSTOR_OPERATION_QUERY_PROTOCOL_VERSION; 242 + vstorPacket->flags = REQUEST_COMPLETION_FLAG; 243 243 244 - vstorPacket->Version.MajorMinor = VMSTOR_PROTOCOL_VERSION_CURRENT; 245 - FILL_VMSTOR_REVISION(vstorPacket->Version.Revision); 244 + vstorPacket->version.major_minor = VMSTOR_PROTOCOL_VERSION_CURRENT; 245 + FILL_VMSTOR_REVISION(vstorPacket->version.revision); 246 246 247 247 ret = vmbus_sendpacket(Device->channel, vstorPacket, 248 248 sizeof(struct vstor_packet), ··· 258 258 osd_waitevent_wait(request->WaitEvent); 259 259 260 260 /* TODO: Check returned version */ 261 - if (vstorPacket->Operation != VStorOperationCompleteIo || 262 - vstorPacket->Status != 0) { 261 + if (vstorPacket->operation != VSTOR_OPERATION_COMPLETE_IO || 262 + vstorPacket->status != 0) { 263 263 DPRINT_ERR(STORVSC, "QUERY_PROTOCOL_VERSION_OPERATION failed " 264 264 "(op %d status 0x%x)", 265 - vstorPacket->Operation, vstorPacket->Status); 265 + vstorPacket->operation, vstorPacket->status); 266 266 goto Cleanup; 267 267 } 268 268 ··· 270 270 DPRINT_INFO(STORVSC, "QUERY_PROPERTIES_OPERATION..."); 271 271 272 272 memset(vstorPacket, 0, sizeof(struct vstor_packet)); 273 - vstorPacket->Operation = VStorOperationQueryProperties; 274 - vstorPacket->Flags = REQUEST_COMPLETION_FLAG; 275 - vstorPacket->StorageChannelProperties.PortNumber = 273 + vstorPacket->operation = VSTOR_OPERATION_QUERY_PROPERTIES; 274 + vstorPacket->flags = REQUEST_COMPLETION_FLAG; 275 + vstorPacket->storage_channel_properties.port_number = 276 276 storDevice->PortNumber; 277 277 278 278 ret = vmbus_sendpacket(Device->channel, vstorPacket, ··· 290 290 osd_waitevent_wait(request->WaitEvent); 291 291 292 292 /* TODO: Check returned version */ 293 - if (vstorPacket->Operation != VStorOperationCompleteIo || 294 - vstorPacket->Status != 0) { 293 + if (vstorPacket->operation != VSTOR_OPERATION_COMPLETE_IO || 294 + vstorPacket->status != 0) { 295 295 DPRINT_ERR(STORVSC, "QUERY_PROPERTIES_OPERATION failed " 296 296 "(op %d status 0x%x)", 297 - vstorPacket->Operation, vstorPacket->Status); 297 + vstorPacket->operation, vstorPacket->status); 298 298 goto Cleanup; 299 299 } 300 300 301 - storDevice->PathId = vstorPacket->StorageChannelProperties.PathId; 302 - storDevice->TargetId = vstorPacket->StorageChannelProperties.TargetId; 301 + storDevice->PathId = vstorPacket->storage_channel_properties.path_id; 302 + storDevice->TargetId 303 + = vstorPacket->storage_channel_properties.target_id; 303 304 304 305 DPRINT_DBG(STORVSC, "channel flag 0x%x, max xfer len 0x%x", 305 - vstorPacket->StorageChannelProperties.Flags, 306 - vstorPacket->StorageChannelProperties.MaxTransferBytes); 306 + vstorPacket->storage_channel_properties.flags, 307 + vstorPacket->storage_channel_properties.max_transfer_bytes); 307 308 308 309 DPRINT_INFO(STORVSC, "END_INITIALIZATION_OPERATION..."); 309 310 310 311 memset(vstorPacket, 0, sizeof(struct vstor_packet)); 311 - vstorPacket->Operation = VStorOperationEndInitialization; 312 - vstorPacket->Flags = REQUEST_COMPLETION_FLAG; 312 + vstorPacket->operation = VSTOR_OPERATION_END_INITIALIZATION; 313 + vstorPacket->flags = REQUEST_COMPLETION_FLAG; 313 314 314 315 ret = vmbus_sendpacket(Device->channel, vstorPacket, 315 316 sizeof(struct vstor_packet), ··· 326 325 327 326 osd_waitevent_wait(request->WaitEvent); 328 327 329 - if (vstorPacket->Operation != VStorOperationCompleteIo || 330 - vstorPacket->Status != 0) { 328 + if (vstorPacket->operation != VSTOR_OPERATION_COMPLETE_IO || 329 + vstorPacket->status != 0) { 331 330 DPRINT_ERR(STORVSC, "END_INITIALIZATION_OPERATION failed " 332 331 "(op %d status 0x%x)", 333 - vstorPacket->Operation, vstorPacket->Status); 332 + vstorPacket->operation, vstorPacket->status); 334 333 goto Cleanup; 335 334 } 336 335 ··· 360 359 361 360 DPRINT_DBG(STORVSC, "IO_COMPLETE_OPERATION - request extension %p " 362 361 "completed bytes xfer %u", RequestExt, 363 - VStorPacket->VmSrb.DataTransferLength); 362 + VStorPacket->vm_srb.data_transfer_length); 364 363 365 364 /* ASSERT(RequestExt != NULL); */ 366 365 /* ASSERT(RequestExt->Request != NULL); */ ··· 370 369 /* ASSERT(request->OnIOCompletion != NULL); */ 371 370 372 371 /* Copy over the status...etc */ 373 - request->Status = VStorPacket->VmSrb.ScsiStatus; 372 + request->Status = VStorPacket->vm_srb.scsi_status; 374 373 375 - if (request->Status != 0 || VStorPacket->VmSrb.SrbStatus != 1) { 374 + if (request->Status != 0 || VStorPacket->vm_srb.srb_status != 1) { 376 375 DPRINT_WARN(STORVSC, 377 376 "cmd 0x%x scsi status 0x%x srb status 0x%x\n", 378 - request->Cdb[0], VStorPacket->VmSrb.ScsiStatus, 379 - VStorPacket->VmSrb.SrbStatus); 377 + request->Cdb[0], VStorPacket->vm_srb.scsi_status, 378 + VStorPacket->vm_srb.srb_status); 380 379 } 381 380 382 381 if ((request->Status & 0xFF) == 0x02) { 383 382 /* CHECK_CONDITION */ 384 - if (VStorPacket->VmSrb.SrbStatus & 0x80) { 383 + if (VStorPacket->vm_srb.srb_status & 0x80) { 385 384 /* autosense data available */ 386 385 DPRINT_WARN(STORVSC, "storvsc pkt %p autosense data " 387 386 "valid - len %d\n", RequestExt, 388 - VStorPacket->VmSrb.SenseInfoLength); 387 + VStorPacket->vm_srb.sense_info_length); 389 388 390 - /* ASSERT(VStorPacket->VmSrb.SenseInfoLength <= */ 389 + /* ASSERT(VStorPacket->vm_srb.sense_info_length <= */ 391 390 /* request->SenseBufferSize); */ 392 391 memcpy(request->SenseBuffer, 393 - VStorPacket->VmSrb.SenseData, 394 - VStorPacket->VmSrb.SenseInfoLength); 392 + VStorPacket->vm_srb.sense_data, 393 + VStorPacket->vm_srb.sense_info_length); 395 394 396 395 request->SenseBufferSize = 397 - VStorPacket->VmSrb.SenseInfoLength; 396 + VStorPacket->vm_srb.sense_info_length; 398 397 } 399 398 } 400 399 401 400 /* TODO: */ 402 - request->BytesXfer = VStorPacket->VmSrb.DataTransferLength; 401 + request->BytesXfer = VStorPacket->vm_srb.data_transfer_length; 403 402 404 403 request->OnIOCompletion(request); 405 404 ··· 412 411 struct vstor_packet *VStorPacket, 413 412 struct storvsc_request_extension *RequestExt) 414 413 { 415 - switch (VStorPacket->Operation) { 416 - case VStorOperationCompleteIo: 414 + switch (VStorPacket->operation) { 415 + case VSTOR_OPERATION_COMPLETE_IO: 417 416 DPRINT_DBG(STORVSC, "IO_COMPLETE_OPERATION"); 418 417 StorVscOnIOCompletion(Device, VStorPacket, RequestExt); 419 418 break; 420 - case VStorOperationRemoveDevice: 419 + case VSTOR_OPERATION_REMOVE_DEVICE: 421 420 DPRINT_INFO(STORVSC, "REMOVE_DEVICE_OPERATION"); 422 421 /* TODO: */ 423 422 break; 424 423 425 424 default: 426 425 DPRINT_INFO(STORVSC, "Unknown operation received - %d", 427 - VStorPacket->Operation); 426 + VStorPacket->operation); 428 427 break; 429 428 } 430 429 } ··· 507 506 StorVscOnChannelCallback, Device); 508 507 509 508 DPRINT_DBG(STORVSC, "storage props: path id %d, tgt id %d, max xfer %d", 510 - props.PathId, props.TargetId, props.MaxTransferBytes); 509 + props.path_id, props.target_id, props.max_transfer_bytes); 511 510 512 511 if (ret != 0) { 513 512 DPRINT_ERR(STORVSC, "unable to open channel: %d", ret); ··· 629 628 goto Cleanup; 630 629 } 631 630 632 - vstorPacket->Operation = VStorOperationResetBus; 633 - vstorPacket->Flags = REQUEST_COMPLETION_FLAG; 634 - vstorPacket->VmSrb.PathId = storDevice->PathId; 631 + vstorPacket->operation = VSTOR_OPERATION_RESET_BUS; 632 + vstorPacket->flags = REQUEST_COMPLETION_FLAG; 633 + vstorPacket->vm_srb.path_id = storDevice->PathId; 635 634 636 635 ret = vmbus_sendpacket(Device->channel, vstorPacket, 637 636 sizeof(struct vstor_packet), ··· 698 697 699 698 memset(vstorPacket, 0 , sizeof(struct vstor_packet)); 700 699 701 - vstorPacket->Flags |= REQUEST_COMPLETION_FLAG; 700 + vstorPacket->flags |= REQUEST_COMPLETION_FLAG; 702 701 703 - vstorPacket->VmSrb.Length = sizeof(struct vmscsi_request); 702 + vstorPacket->vm_srb.length = sizeof(struct vmscsi_request); 704 703 705 - vstorPacket->VmSrb.PortNumber = Request->Host; 706 - vstorPacket->VmSrb.PathId = Request->Bus; 707 - vstorPacket->VmSrb.TargetId = Request->TargetId; 708 - vstorPacket->VmSrb.Lun = Request->LunId; 704 + vstorPacket->vm_srb.port_number = Request->Host; 705 + vstorPacket->vm_srb.path_id = Request->Bus; 706 + vstorPacket->vm_srb.target_id = Request->TargetId; 707 + vstorPacket->vm_srb.lun = Request->LunId; 709 708 710 - vstorPacket->VmSrb.SenseInfoLength = SENSE_BUFFER_SIZE; 709 + vstorPacket->vm_srb.sense_info_length = SENSE_BUFFER_SIZE; 711 710 712 711 /* Copy over the scsi command descriptor block */ 713 - vstorPacket->VmSrb.CdbLength = Request->CdbLen; 714 - memcpy(&vstorPacket->VmSrb.Cdb, Request->Cdb, Request->CdbLen); 712 + vstorPacket->vm_srb.cdb_length = Request->CdbLen; 713 + memcpy(&vstorPacket->vm_srb.cdb, Request->Cdb, Request->CdbLen); 715 714 716 - vstorPacket->VmSrb.DataIn = Request->Type; 717 - vstorPacket->VmSrb.DataTransferLength = Request->DataBuffer.Length; 715 + vstorPacket->vm_srb.data_in = Request->Type; 716 + vstorPacket->vm_srb.data_transfer_length = Request->DataBuffer.Length; 718 717 719 - vstorPacket->Operation = VStorOperationExecuteSRB; 718 + vstorPacket->operation = VSTOR_OPERATION_EXECUTE_SRB; 720 719 721 720 DPRINT_DBG(STORVSC, "srb - len %d port %d, path %d, target %d, " 722 721 "lun %d senselen %d cdblen %d", 723 - vstorPacket->VmSrb.Length, 724 - vstorPacket->VmSrb.PortNumber, 725 - vstorPacket->VmSrb.PathId, 726 - vstorPacket->VmSrb.TargetId, 727 - vstorPacket->VmSrb.Lun, 728 - vstorPacket->VmSrb.SenseInfoLength, 729 - vstorPacket->VmSrb.CdbLength); 722 + vstorPacket->vm_srb.length, 723 + vstorPacket->vm_srb.port_number, 724 + vstorPacket->vm_srb.path_id, 725 + vstorPacket->vm_srb.target_id, 726 + vstorPacket->vm_srb.lun, 727 + vstorPacket->vm_srb.sense_info_length, 728 + vstorPacket->vm_srb.cdb_length); 730 729 731 730 if (requestExtension->Request->DataBuffer.Length) { 732 731 ret = vmbus_sendpacket_multipagebuffer(Device->channel,
+53 -53
drivers/staging/hv/vstorage.h
··· 27 27 28 28 #define REVISION_STRING(REVISION_) #REVISION_ 29 29 #define FILL_VMSTOR_REVISION(RESULT_LVALUE_) \ 30 - { \ 31 - char *revisionString = REVISION_STRING($Revision : 6 $) + 11; \ 32 - RESULT_LVALUE_ = 0; \ 33 - while (*revisionString >= '0' && *revisionString <= '9') { \ 34 - RESULT_LVALUE_ *= 10; \ 35 - RESULT_LVALUE_ += *revisionString - '0'; \ 36 - revisionString++; \ 37 - } \ 38 - } 30 + do { \ 31 + char *revision_string \ 32 + = REVISION_STRING($Rev : 6 $) + 6; \ 33 + RESULT_LVALUE_ = 0; \ 34 + while (*revision_string >= '0' \ 35 + && *revision_string <= '9') { \ 36 + RESULT_LVALUE_ *= 10; \ 37 + RESULT_LVALUE_ += *revision_string - '0'; \ 38 + revision_string++; \ 39 + } \ 40 + } while (0) 39 41 40 42 /* Major/minor macros. Minor version is in LSB, meaning that earlier flat */ 41 43 /* version numbers will be interpreted as "0.x" (i.e., 1 becomes 0.1). */ ··· 67 65 68 66 /* Packet structure describing virtual storage requests. */ 69 67 enum vstor_packet_operation { 70 - VStorOperationCompleteIo = 1, 71 - VStorOperationRemoveDevice = 2, 72 - VStorOperationExecuteSRB = 3, 73 - VStorOperationResetLun = 4, 74 - VStorOperationResetAdapter = 5, 75 - VStorOperationResetBus = 6, 76 - VStorOperationBeginInitialization = 7, 77 - VStorOperationEndInitialization = 8, 78 - VStorOperationQueryProtocolVersion = 9, 79 - VStorOperationQueryProperties = 10, 80 - VStorOperationMaximum = 10 68 + VSTOR_OPERATION_COMPLETE_IO = 1, 69 + VSTOR_OPERATION_REMOVE_DEVICE = 2, 70 + VSTOR_OPERATION_EXECUTE_SRB = 3, 71 + VSTOR_OPERATION_RESET_LUN = 4, 72 + VSTOR_OPERATION_RESET_ADAPTER = 5, 73 + VSTOR_OPERATION_RESET_BUS = 6, 74 + VSTOR_OPERATION_BEGIN_INITIALIZATION = 7, 75 + VSTOR_OPERATION_END_INITIALIZATION = 8, 76 + VSTOR_OPERATION_QUERY_PROTOCOL_VERSION = 9, 77 + VSTOR_OPERATION_QUERY_PROPERTIES = 10, 78 + VSTOR_OPERATION_MAXIMUM = 10 81 79 }; 82 80 83 81 /* ··· 91 89 #define SENSE_BUFFER_SIZE 0x12 92 90 #endif 93 91 94 - #define MAX_DATA_BUFFER_LENGTH_WITH_PADDING 0x14 92 + #define MAX_DATA_BUF_LEN_WITH_PADDING 0x14 95 93 96 94 struct vmscsi_request { 97 - unsigned short Length; 98 - unsigned char SrbStatus; 99 - unsigned char ScsiStatus; 95 + unsigned short length; 96 + unsigned char srb_status; 97 + unsigned char scsi_status; 100 98 101 - unsigned char PortNumber; 102 - unsigned char PathId; 103 - unsigned char TargetId; 104 - unsigned char Lun; 99 + unsigned char port_number; 100 + unsigned char path_id; 101 + unsigned char target_id; 102 + unsigned char lun; 105 103 106 - unsigned char CdbLength; 107 - unsigned char SenseInfoLength; 108 - unsigned char DataIn; 109 - unsigned char Reserved; 104 + unsigned char cdb_length; 105 + unsigned char sense_info_length; 106 + unsigned char data_in; 107 + unsigned char reserved; 110 108 111 - unsigned int DataTransferLength; 109 + unsigned int data_transfer_length; 112 110 113 111 union { 114 - unsigned char Cdb[CDB16GENERIC_LENGTH]; 115 - 116 - unsigned char SenseData[SENSE_BUFFER_SIZE]; 117 - 118 - unsigned char ReservedArray[MAX_DATA_BUFFER_LENGTH_WITH_PADDING]; 112 + unsigned char cdb[CDB16GENERIC_LENGTH]; 113 + unsigned char sense_data[SENSE_BUFFER_SIZE]; 114 + unsigned char reserved_array[MAX_DATA_BUF_LEN_WITH_PADDING]; 119 115 }; 120 116 } __attribute((packed)); 121 117 ··· 123 123 * properties of the channel. 124 124 */ 125 125 struct vmstorage_channel_properties { 126 - unsigned short ProtocolVersion; 127 - unsigned char PathId; 128 - unsigned char TargetId; 126 + unsigned short protocol_version; 127 + unsigned char path_id; 128 + unsigned char target_id; 129 129 130 130 /* Note: port number is only really known on the client side */ 131 - unsigned int PortNumber; 132 - unsigned int Flags; 133 - unsigned int MaxTransferBytes; 131 + unsigned int port_number; 132 + unsigned int flags; 133 + unsigned int max_transfer_bytes; 134 134 135 135 /* This id is unique for each channel and will correspond with */ 136 136 /* vendor specific data in the inquirydata */ 137 - unsigned long long UniqueId; 137 + unsigned long long unique_id; 138 138 } __attribute__((packed)); 139 139 140 140 /* This structure is sent during the storage protocol negotiations. */ 141 141 struct vmstorage_protocol_version { 142 142 /* Major (MSW) and minor (LSW) version numbers. */ 143 - unsigned short MajorMinor; 143 + unsigned short major_minor; 144 144 145 145 /* 146 146 * Revision number is auto-incremented whenever this file is changed ··· 148 148 * definitely indicate incompatibility--but it does indicate mismatched 149 149 * builds. 150 150 */ 151 - unsigned short Revision; 151 + unsigned short revision; 152 152 } __attribute__((packed)); 153 153 154 154 /* Channel Property Flags */ ··· 157 157 158 158 struct vstor_packet { 159 159 /* Requested operation type */ 160 - enum vstor_packet_operation Operation; 160 + enum vstor_packet_operation operation; 161 161 162 162 /* Flags - see below for values */ 163 - unsigned int Flags; 163 + unsigned int flags; 164 164 165 165 /* Status of the request returned from the server side. */ 166 - unsigned int Status; 166 + unsigned int status; 167 167 168 168 /* Data payload area */ 169 169 union { ··· 171 171 * Structure used to forward SCSI commands from the 172 172 * client to the server. 173 173 */ 174 - struct vmscsi_request VmSrb; 174 + struct vmscsi_request vm_srb; 175 175 176 176 /* Structure used to query channel properties. */ 177 - struct vmstorage_channel_properties StorageChannelProperties; 177 + struct vmstorage_channel_properties storage_channel_properties; 178 178 179 179 /* Used during version negotiations. */ 180 - struct vmstorage_protocol_version Version; 180 + struct vmstorage_protocol_version version; 181 181 }; 182 182 } __attribute__((packed)); 183 183