staging: hv: Convert camel cased struct fields in ring_buffer.h to lower cases

staging: hv: Convert camel cased struct fields in ring_buffer.h to lower cases

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>
This commit is contained in:
Haiyang Zhang 2010-11-08 14:04:45 -08:00 коммит произвёл Greg Kroah-Hartman
Родитель 203df82d81
Коммит 82f8bd40a0
4 изменённых файлов: 64 добавлений и 57 удалений

Просмотреть файл

@ -213,7 +213,7 @@ int vmbus_open(struct vmbus_channel *newchannel, u32 send_ringbuffer_size,
newchannel->ringbuffer_gpadlhandle = 0; newchannel->ringbuffer_gpadlhandle = 0;
ret = vmbus_establish_gpadl(newchannel, ret = vmbus_establish_gpadl(newchannel,
newchannel->outbound.RingBuffer, newchannel->outbound.ring_buffer,
send_ringbuffer_size + send_ringbuffer_size +
recv_ringbuffer_size, recv_ringbuffer_size,
&newchannel->ringbuffer_gpadlhandle); &newchannel->ringbuffer_gpadlhandle);
@ -227,10 +227,10 @@ int vmbus_open(struct vmbus_channel *newchannel, u32 send_ringbuffer_size,
"size %d recv ring %p size %d, downstreamoffset %d>", "size %d recv ring %p size %d, downstreamoffset %d>",
newchannel, newchannel->offermsg.child_relid, newchannel, newchannel->offermsg.child_relid,
newchannel->ringbuffer_gpadlhandle, newchannel->ringbuffer_gpadlhandle,
newchannel->outbound.RingBuffer, newchannel->outbound.ring_buffer,
newchannel->outbound.RingSize, newchannel->outbound.ring_size,
newchannel->inbound.RingBuffer, newchannel->inbound.ring_buffer,
newchannel->inbound.RingSize, newchannel->inbound.ring_size,
send_ringbuffer_size); send_ringbuffer_size);
/* Create and init the channel open message */ /* Create and init the channel open message */

Просмотреть файл

@ -51,11 +51,11 @@ GetRingBufferAvailBytes(struct hv_ring_buffer_info *rbi, u32 *read, u32 *write)
u32 read_loc, write_loc; u32 read_loc, write_loc;
/* Capture the read/write indices before they changed */ /* Capture the read/write indices before they changed */
read_loc = rbi->RingBuffer->ReadIndex; read_loc = rbi->ring_buffer->read_index;
write_loc = rbi->RingBuffer->WriteIndex; write_loc = rbi->ring_buffer->write_index;
*write = BYTES_AVAIL_TO_WRITE(read_loc, write_loc, rbi->RingDataSize); *write = BYTES_AVAIL_TO_WRITE(read_loc, write_loc, rbi->ring_datasize);
*read = rbi->RingDataSize - *write; *read = rbi->ring_datasize - *write;
} }
/*++ /*++
@ -70,7 +70,7 @@ Description:
static inline u32 static inline u32
GetNextWriteLocation(struct hv_ring_buffer_info *RingInfo) GetNextWriteLocation(struct hv_ring_buffer_info *RingInfo)
{ {
u32 next = RingInfo->RingBuffer->WriteIndex; u32 next = RingInfo->ring_buffer->write_index;
/* ASSERT(next < RingInfo->RingDataSize); */ /* ASSERT(next < RingInfo->RingDataSize); */
@ -90,7 +90,7 @@ static inline void
SetNextWriteLocation(struct hv_ring_buffer_info *RingInfo, SetNextWriteLocation(struct hv_ring_buffer_info *RingInfo,
u32 NextWriteLocation) u32 NextWriteLocation)
{ {
RingInfo->RingBuffer->WriteIndex = NextWriteLocation; RingInfo->ring_buffer->write_index = NextWriteLocation;
} }
/*++ /*++
@ -105,7 +105,7 @@ Description:
static inline u32 static inline u32
GetNextReadLocation(struct hv_ring_buffer_info *RingInfo) GetNextReadLocation(struct hv_ring_buffer_info *RingInfo)
{ {
u32 next = RingInfo->RingBuffer->ReadIndex; u32 next = RingInfo->ring_buffer->read_index;
/* ASSERT(next < RingInfo->RingDataSize); */ /* ASSERT(next < RingInfo->RingDataSize); */
@ -125,11 +125,11 @@ Description:
static inline u32 static inline u32
GetNextReadLocationWithOffset(struct hv_ring_buffer_info *RingInfo, u32 Offset) GetNextReadLocationWithOffset(struct hv_ring_buffer_info *RingInfo, u32 Offset)
{ {
u32 next = RingInfo->RingBuffer->ReadIndex; u32 next = RingInfo->ring_buffer->read_index;
/* ASSERT(next < RingInfo->RingDataSize); */ /* ASSERT(next < RingInfo->RingDataSize); */
next += Offset; next += Offset;
next %= RingInfo->RingDataSize; next %= RingInfo->ring_datasize;
return next; return next;
} }
@ -146,7 +146,7 @@ Description:
static inline void static inline void
SetNextReadLocation(struct hv_ring_buffer_info *RingInfo, u32 NextReadLocation) SetNextReadLocation(struct hv_ring_buffer_info *RingInfo, u32 NextReadLocation)
{ {
RingInfo->RingBuffer->ReadIndex = NextReadLocation; RingInfo->ring_buffer->read_index = NextReadLocation;
} }
@ -162,7 +162,7 @@ Description:
static inline void * static inline void *
GetRingBuffer(struct hv_ring_buffer_info *RingInfo) GetRingBuffer(struct hv_ring_buffer_info *RingInfo)
{ {
return (void *)RingInfo->RingBuffer->Buffer; return (void *)RingInfo->ring_buffer->buffer;
} }
@ -178,7 +178,7 @@ Description:
static inline u32 static inline u32
GetRingBufferSize(struct hv_ring_buffer_info *RingInfo) GetRingBufferSize(struct hv_ring_buffer_info *RingInfo)
{ {
return RingInfo->RingDataSize; return RingInfo->ring_datasize;
} }
/*++ /*++
@ -193,7 +193,7 @@ Description:
static inline u64 static inline u64
GetRingBufferIndices(struct hv_ring_buffer_info *RingInfo) GetRingBufferIndices(struct hv_ring_buffer_info *RingInfo)
{ {
return (u64)RingInfo->RingBuffer->WriteIndex << 32; return (u64)RingInfo->ring_buffer->write_index << 32;
} }
@ -221,11 +221,11 @@ void DumpRingInfo(struct hv_ring_buffer_info *RingInfo, char *Prefix)
"avail read %u read idx %u write idx %u>>", "avail read %u read idx %u write idx %u>>",
Prefix, Prefix,
RingInfo, RingInfo,
RingInfo->RingBuffer->Buffer, RingInfo->ring_buffer->buffer,
bytesAvailToWrite, bytesAvailToWrite,
bytesAvailToRead, bytesAvailToRead,
RingInfo->RingBuffer->ReadIndex, RingInfo->ring_buffer->read_index,
RingInfo->RingBuffer->WriteIndex); RingInfo->ring_buffer->write_index);
} }
@ -262,16 +262,19 @@ void RingBufferGetDebugInfo(struct hv_ring_buffer_info *RingInfo,
u32 bytesAvailToWrite; u32 bytesAvailToWrite;
u32 bytesAvailToRead; u32 bytesAvailToRead;
if (RingInfo->RingBuffer) { if (RingInfo->ring_buffer) {
GetRingBufferAvailBytes(RingInfo, GetRingBufferAvailBytes(RingInfo,
&bytesAvailToRead, &bytesAvailToRead,
&bytesAvailToWrite); &bytesAvailToWrite);
debug_info->BytesAvailToRead = bytesAvailToRead; debug_info->bytes_avail_toread = bytesAvailToRead;
debug_info->BytesAvailToWrite = bytesAvailToWrite; debug_info->bytes_avail_towrite = bytesAvailToWrite;
debug_info->CurrentReadIndex = RingInfo->RingBuffer->ReadIndex; debug_info->current_read_index =
debug_info->CurrentWriteIndex = RingInfo->RingBuffer->WriteIndex; RingInfo->ring_buffer->read_index;
debug_info->CurrentInterruptMask = RingInfo->RingBuffer->InterruptMask; debug_info->current_write_index =
RingInfo->ring_buffer->write_index;
debug_info->current_interrupt_mask =
RingInfo->ring_buffer->interrupt_mask;
} }
} }
@ -287,7 +290,7 @@ Description:
--*/ --*/
u32 GetRingBufferInterruptMask(struct hv_ring_buffer_info *rbi) u32 GetRingBufferInterruptMask(struct hv_ring_buffer_info *rbi)
{ {
return rbi->RingBuffer->InterruptMask; return rbi->ring_buffer->interrupt_mask;
} }
/*++ /*++
@ -306,11 +309,12 @@ int RingBufferInit(struct hv_ring_buffer_info *RingInfo, void *Buffer, u32 Buffe
memset(RingInfo, 0, sizeof(struct hv_ring_buffer_info)); memset(RingInfo, 0, sizeof(struct hv_ring_buffer_info));
RingInfo->RingBuffer = (struct hv_ring_buffer *)Buffer; RingInfo->ring_buffer = (struct hv_ring_buffer *)Buffer;
RingInfo->RingBuffer->ReadIndex = RingInfo->RingBuffer->WriteIndex = 0; RingInfo->ring_buffer->read_index =
RingInfo->ring_buffer->write_index = 0;
RingInfo->RingSize = BufferLen; RingInfo->ring_size = BufferLen;
RingInfo->RingDataSize = BufferLen - sizeof(struct hv_ring_buffer); RingInfo->ring_datasize = BufferLen - sizeof(struct hv_ring_buffer);
spin_lock_init(&RingInfo->ring_lock); spin_lock_init(&RingInfo->ring_lock);

Просмотреть файл

@ -29,18 +29,18 @@
struct hv_ring_buffer { struct hv_ring_buffer {
/* Offset in bytes from the start of ring data below */ /* Offset in bytes from the start of ring data below */
volatile u32 WriteIndex; volatile u32 write_index;
/* Offset in bytes from the start of ring data below */ /* Offset in bytes from the start of ring data below */
volatile u32 ReadIndex; volatile u32 read_index;
volatile u32 InterruptMask; volatile u32 interrupt_mask;
/* Pad it to PAGE_SIZE so that data starts on page boundary */ /* Pad it to PAGE_SIZE so that data starts on page boundary */
u8 Reserved[4084]; u8 reserved[4084];
/* NOTE: /* NOTE:
* The InterruptMask field is used only for channels but since our * The interrupt_mask field is used only for channels but since our
* vmbus connection also uses this data structure and its data starts * vmbus connection also uses this data structure and its data starts
* here, we commented out this field. * here, we commented out this field.
*/ */
@ -50,24 +50,24 @@ struct hv_ring_buffer {
* Ring data starts here + RingDataStartOffset * Ring data starts here + RingDataStartOffset
* !!! DO NOT place any fields below this !!! * !!! DO NOT place any fields below this !!!
*/ */
u8 Buffer[0]; u8 buffer[0];
} __attribute__((packed)); } __attribute__((packed));
struct hv_ring_buffer_info { struct hv_ring_buffer_info {
struct hv_ring_buffer *RingBuffer; struct hv_ring_buffer *ring_buffer;
u32 RingSize; /* Include the shared header */ u32 ring_size; /* Include the shared header */
spinlock_t ring_lock; spinlock_t ring_lock;
u32 RingDataSize; /* < ringSize */ u32 ring_datasize; /* < ring_size */
u32 RingDataStartOffset; u32 ring_data_startoffset;
}; };
struct hv_ring_buffer_debug_info { struct hv_ring_buffer_debug_info {
u32 CurrentInterruptMask; u32 current_interrupt_mask;
u32 CurrentReadIndex; u32 current_read_index;
u32 CurrentWriteIndex; u32 current_write_index;
u32 BytesAvailToRead; u32 bytes_avail_toread;
u32 BytesAvailToWrite; u32 bytes_avail_towrite;
}; };

Просмотреть файл

@ -156,18 +156,21 @@ static void get_channel_info(struct hv_device *device,
info->ClientMonitorLatency = debug_info.clientmonitor_latency; info->ClientMonitorLatency = debug_info.clientmonitor_latency;
info->ClientMonitorConnectionId = debug_info.clientmonitor_connectionid; info->ClientMonitorConnectionId = debug_info.clientmonitor_connectionid;
info->Inbound.InterruptMask = debug_info.inbound.CurrentInterruptMask; info->Inbound.InterruptMask = debug_info.inbound.current_interrupt_mask;
info->Inbound.ReadIndex = debug_info.inbound.CurrentReadIndex; info->Inbound.ReadIndex = debug_info.inbound.current_read_index;
info->Inbound.WriteIndex = debug_info.inbound.CurrentWriteIndex; info->Inbound.WriteIndex = debug_info.inbound.current_write_index;
info->Inbound.BytesAvailToRead = debug_info.inbound.BytesAvailToRead; info->Inbound.BytesAvailToRead = debug_info.inbound.bytes_avail_toread;
info->Inbound.BytesAvailToWrite = debug_info.inbound.BytesAvailToWrite; info->Inbound.BytesAvailToWrite =
debug_info.inbound.bytes_avail_towrite;
info->Outbound.InterruptMask = debug_info.outbound.CurrentInterruptMask; info->Outbound.InterruptMask =
info->Outbound.ReadIndex = debug_info.outbound.CurrentReadIndex; debug_info.outbound.current_interrupt_mask;
info->Outbound.WriteIndex = debug_info.outbound.CurrentWriteIndex; info->Outbound.ReadIndex = debug_info.outbound.current_read_index;
info->Outbound.BytesAvailToRead = debug_info.outbound.BytesAvailToRead; info->Outbound.WriteIndex = debug_info.outbound.current_write_index;
info->Outbound.BytesAvailToRead =
debug_info.outbound.bytes_avail_toread;
info->Outbound.BytesAvailToWrite = info->Outbound.BytesAvailToWrite =
debug_info.outbound.BytesAvailToWrite; debug_info.outbound.bytes_avail_towrite;
} }
/* /*