[PATCH 09/13] staging/hv: use struct page_buffer

Joe Perches joe at perches.com
Thu Jul 30 00:41:02 UTC 2009


Signed-off-by: Joe Perches <joe at perches.com>
---
 drivers/staging/hv/Channel.c           |    4 ++--
 drivers/staging/hv/Channel.h           |    4 ++--
 drivers/staging/hv/ChannelInterface.c  |    2 +-
 drivers/staging/hv/NetVsc.c            |    2 +-
 drivers/staging/hv/RndisFilter.c       |    2 +-
 drivers/staging/hv/include/NetVscApi.h |    2 +-
 drivers/staging/hv/include/VmbusApi.h  |    8 ++++----
 drivers/staging/hv/netvsc_drv.c        |    4 ++--
 8 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/hv/Channel.c b/drivers/staging/hv/Channel.c
index 3a4946c..7ccd361 100644
--- a/drivers/staging/hv/Channel.c
+++ b/drivers/staging/hv/Channel.c
@@ -799,7 +799,7 @@ Description:
 --*/
 int
 VmbusChannelSendPacketPageBuffer(struct vmbus_channel *Channel,
-				 PAGE_BUFFER PageBuffers[],
+				 struct page_buffer PageBuffers[],
 				 u32 PageCount,
 				 void *Buffer, u32 BufferLen, u64 RequestId)
 {
@@ -821,7 +821,7 @@ VmbusChannelSendPacketPageBuffer(struct vmbus_channel *Channel,
 	/* Adjust the size down since VMBUS_CHANNEL_PACKET_PAGE_BUFFER is the largest size we support */
 	descSize =
 	    sizeof(struct VMBUS_CHANNEL_PACKET_PAGE_BUFFER) -
-	    ((MAX_PAGE_BUFFER_COUNT - PageCount) * sizeof(PAGE_BUFFER));
+	    ((MAX_PAGE_BUFFER_COUNT - PageCount) * sizeof(struct page_buffer));
 	packetLen = descSize + BufferLen;
 	packetLenAligned = ALIGN_UP(packetLen, sizeof(u64));
 
diff --git a/drivers/staging/hv/Channel.h b/drivers/staging/hv/Channel.h
index c19e496..4730d53 100644
--- a/drivers/staging/hv/Channel.h
+++ b/drivers/staging/hv/Channel.h
@@ -38,7 +38,7 @@ struct VMBUS_CHANNEL_PACKET_PAGE_BUFFER {
 	u64 TransactionId;
 	u32 Reserved;
 	u32 RangeCount;
-	PAGE_BUFFER Range[MAX_PAGE_BUFFER_COUNT];
+	struct page_buffer Range[MAX_PAGE_BUFFER_COUNT];
 };
 
 /* The format must be the same as VMDATA_GPA_DIRECT */
@@ -75,7 +75,7 @@ static int VmbusChannelSendPacket(struct vmbus_channel *Channel,
 
 static int
 VmbusChannelSendPacketPageBuffer(struct vmbus_channel *Channel,
-				 PAGE_BUFFER PageBuffers[],
+				 struct page_buffer PageBuffers[],
 				 u32 PageCount,
 				 void *Buffer, u32 BufferLen, u64 RequestId);
 
diff --git a/drivers/staging/hv/ChannelInterface.c b/drivers/staging/hv/ChannelInterface.c
index e15d1d7..0a222cf 100644
--- a/drivers/staging/hv/ChannelInterface.c
+++ b/drivers/staging/hv/ChannelInterface.c
@@ -55,7 +55,7 @@ IVmbusChannelSendPacket(struct hv_device *Device,
 
 static int
 IVmbusChannelSendPacketPageBuffer(struct hv_device *Device,
-				  PAGE_BUFFER PageBuffers[],
+				  struct page_buffer PageBuffers[],
 				  u32 PageCount,
 				  void *Buffer, u32 BufferLen, u64 RequestId)
 {
diff --git a/drivers/staging/hv/NetVsc.c b/drivers/staging/hv/NetVsc.c
index 752f5b0..8005239 100644
--- a/drivers/staging/hv/NetVsc.c
+++ b/drivers/staging/hv/NetVsc.c
@@ -790,7 +790,7 @@ int NetVscOnDeviceAdd(struct hv_device *Device, void *AdditionalInfo)
 	for (i = 0; i < NETVSC_RECEIVE_PACKETLIST_COUNT; i++) {
 		packet =
 		    kzalloc(sizeof(NETVSC_PACKET) +
-			    (NETVSC_RECEIVE_SG_COUNT * sizeof(PAGE_BUFFER)),
+			    (NETVSC_RECEIVE_SG_COUNT * sizeof(struct page_buffer)),
 			    GFP_KERNEL);
 		if (!packet) {
 			DPRINT_DBG(NETVSC,
diff --git a/drivers/staging/hv/RndisFilter.c b/drivers/staging/hv/RndisFilter.c
index 8750b43..6e478d0 100644
--- a/drivers/staging/hv/RndisFilter.c
+++ b/drivers/staging/hv/RndisFilter.c
@@ -66,7 +66,7 @@ typedef struct _RNDIS_REQUEST {
 
 	/* Simplify allocation by having a netvsc packet inline */
 	NETVSC_PACKET Packet;
-	PAGE_BUFFER Buffer;
+	struct page_buffer Buffer;
 	/* FIXME: We assumed a fixed size request here. */
 	RNDIS_MESSAGE RequestMessage;
 } RNDIS_REQUEST;
diff --git a/drivers/staging/hv/include/NetVscApi.h b/drivers/staging/hv/include/NetVscApi.h
index 90482d1..f447fd9 100644
--- a/drivers/staging/hv/include/NetVscApi.h
+++ b/drivers/staging/hv/include/NetVscApi.h
@@ -96,7 +96,7 @@ typedef struct _NETVSC_PACKET {
 	u32 TotalDataBufferLength;
 	/* Points to the send/receive buffer where the ethernet frame is */
 	u32 PageBufferCount;
-	PAGE_BUFFER PageBuffers[NETVSC_PACKET_MAXPAGE];
+	struct page_buffer PageBuffers[NETVSC_PACKET_MAXPAGE];
 
 } NETVSC_PACKET;
 
diff --git a/drivers/staging/hv/include/VmbusApi.h b/drivers/staging/hv/include/VmbusApi.h
index 898b44a..03c6e18 100644
--- a/drivers/staging/hv/include/VmbusApi.h
+++ b/drivers/staging/hv/include/VmbusApi.h
@@ -39,11 +39,11 @@
 #pragma pack(push,1)
 
 /* Single-page buffer */
-typedef struct _PAGE_BUFFER {
+struct page_buffer {
 	u32 Length;
 	u32 Offset;
 	u64 Pfn;
-} PAGE_BUFFER;
+};
 
 /* Multiple-page buffer */
 typedef struct _MULTIPAGE_BUFFER {
@@ -54,7 +54,7 @@ typedef struct _MULTIPAGE_BUFFER {
 } MULTIPAGE_BUFFER;
 
 /* 0x18 includes the proprietary packet header */
-#define MAX_PAGE_BUFFER_PACKET			(0x18 + (sizeof(PAGE_BUFFER) * MAX_PAGE_BUFFER_COUNT))
+#define MAX_PAGE_BUFFER_PACKET			(0x18 + (sizeof(struct page_buffer) * MAX_PAGE_BUFFER_COUNT))
 #define MAX_MULTIPAGE_BUFFER_PACKET		(0x18 + sizeof(MULTIPAGE_BUFFER))
 
 #pragma pack(pop)
@@ -103,7 +103,7 @@ typedef int (*VMBUS_CHANNEL_SEND_PACKET) (struct hv_device * Device,
 					  u64 RequestId, u32 Type, u32 Flags);
 
 typedef int (*VMBUS_CHANNEL_SEND_PACKET_PAGEBUFFER) (struct hv_device * Device,
-						     PAGE_BUFFER PageBuffers[],
+						     struct page_buffer PageBuffers[],
 						     u32 PageCount,
 						     void *Buffer,
 						     u32 BufferLen,
diff --git a/drivers/staging/hv/netvsc_drv.c b/drivers/staging/hv/netvsc_drv.c
index fc8175c..633923c 100644
--- a/drivers/staging/hv/netvsc_drv.c
+++ b/drivers/staging/hv/netvsc_drv.c
@@ -428,7 +428,7 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net)
 
 	/* Allocate a netvsc packet based on # of frags. */
 	packet =
-	    kzalloc(sizeof(NETVSC_PACKET) + (num_frags * sizeof(PAGE_BUFFER)) +
+	    kzalloc(sizeof(NETVSC_PACKET) + (num_frags * sizeof(struct page_buffer)) +
 		    net_drv_obj->RequestExtSize, GFP_ATOMIC);
 	if (!packet) {
 		DPRINT_ERR(NETVSC_DRV, "unable to allocate NETVSC_PACKET");
@@ -437,7 +437,7 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net)
 
 	packet->Extension =
 	    (void *)(unsigned long)packet + sizeof(NETVSC_PACKET) +
-	    (num_frags * sizeof(PAGE_BUFFER));
+	    (num_frags * sizeof(struct page_buffer));
 
 	/* Setup the rndis header */
 	packet->PageBufferCount = num_frags;
-- 
1.6.3.1.10.g659a0.dirty




More information about the devel mailing list