Commit 53d21fdb authored by Haiyang Zhang's avatar Haiyang Zhang Committed by Greg Kroah-Hartman

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

Signed-off-by: default avatarHaiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: default avatarHank Janssen <hjanssen@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 72a2f5bd
This diff is collapsed.
...@@ -38,48 +38,48 @@ ...@@ -38,48 +38,48 @@
#define NVSP_MAX_PROTOCOL_VERSION NVSP_PROTOCOL_VERSION_1 #define NVSP_MAX_PROTOCOL_VERSION NVSP_PROTOCOL_VERSION_1
enum { enum {
NvspMessageTypeNone = 0, NVSP_MSG_TYPE_NONE = 0,
/* Init Messages */ /* Init Messages */
NvspMessageTypeInit = 1, NVSP_MSG_TYPE_INIT = 1,
NvspMessageTypeInitComplete = 2, NVSP_MSG_TYPE_INIT_COMPLETE = 2,
NvspVersionMessageStart = 100, NVSP_VERSION_MSG_START = 100,
/* Version 1 Messages */ /* Version 1 Messages */
NvspMessage1TypeSendNdisVersion = NvspVersionMessageStart, NVSP_MSG1_TYPE_SEND_NDIS_VER = NVSP_VERSION_MSG_START,
NvspMessage1TypeSendReceiveBuffer, NVSP_MSG1_TYPE_SEND_RECV_BUF,
NvspMessage1TypeSendReceiveBufferComplete, NVSP_MSG1_TYPE_SEND_RECV_BUF_COMPLETE,
NvspMessage1TypeRevokeReceiveBuffer, NVSP_MSG1_TYPE_REVOKE_RECV_BUF,
NvspMessage1TypeSendSendBuffer, NVSP_MSG1_TYPE_SEND_SEND_BUF,
NvspMessage1TypeSendSendBufferComplete, NVSP_MSG1_TYPE_SEND_SEND_BUF_COMPLETE,
NvspMessage1TypeRevokeSendBuffer, NVSP_MSG1_TYPE_REVOKE_SEND_BUF,
NvspMessage1TypeSendRNDISPacket, NVSP_MSG1_TYPE_SEND_RNDIS_PKT,
NvspMessage1TypeSendRNDISPacketComplete, NVSP_MSG1_TYPE_SEND_RNDIS_PKT_COMPLETE,
/* /*
* This should be set to the number of messages for the version with * This should be set to the number of messages for the version with
* the maximum number of messages. * the maximum number of messages.
*/ */
NvspNumMessagePerVersion = 9, NVSP_NUM_MSG_PER_VERSION = 9,
}; };
enum { enum {
NvspStatusNone = 0, NVSP_STAT_NONE = 0,
NvspStatusSuccess, NVSP_STAT_SUCCESS,
NvspStatusFailure, NVSP_STAT_FAIL,
NvspStatusProtocolVersionRangeTooNew, NVSP_STAT_PROTOCOL_TOO_NEW,
NvspStatusProtocolVersionRangeTooOld, NVSP_STAT_PROTOCOL_TOO_OLD,
NvspStatusInvalidRndisPacket, NVSP_STAT_INVALID_RNDIS_PKT,
NvspStatusBusy, NVSP_STAT_BUSY,
NvspStatusMax, NVSP_STAT_MAX,
}; };
struct nvsp_message_header { struct nvsp_message_header {
u32 MessageType; u32 msg_type;
}; };
/* Init Messages */ /* Init Messages */
...@@ -90,8 +90,8 @@ struct nvsp_message_header { ...@@ -90,8 +90,8 @@ struct nvsp_message_header {
* versioning (i.e. this message will be the same for ever). * versioning (i.e. this message will be the same for ever).
*/ */
struct nvsp_message_init { struct nvsp_message_init {
u32 MinProtocolVersion; u32 min_protocol_ver;
u32 MaxProtocolVersion; u32 max_protocol_ver;
} __attribute__((packed)); } __attribute__((packed));
/* /*
...@@ -100,14 +100,14 @@ struct nvsp_message_init { ...@@ -100,14 +100,14 @@ struct nvsp_message_init {
* (i.e. this message will be the same for ever). * (i.e. this message will be the same for ever).
*/ */
struct nvsp_message_init_complete { struct nvsp_message_init_complete {
u32 NegotiatedProtocolVersion; u32 negotiated_protocol_ver;
u32 MaximumMdlChainLength; u32 max_mdl_chain_len;
u32 Status; u32 status;
} __attribute__((packed)); } __attribute__((packed));
union nvsp_message_init_uber { union nvsp_message_init_uber {
struct nvsp_message_init Init; struct nvsp_message_init init;
struct nvsp_message_init_complete InitComplete; struct nvsp_message_init_complete init_complete;
} __attribute__((packed)); } __attribute__((packed));
/* Version 1 Messages */ /* Version 1 Messages */
...@@ -117,8 +117,8 @@ union nvsp_message_init_uber { ...@@ -117,8 +117,8 @@ union nvsp_message_init_uber {
* can use this information when handling OIDs sent by the VSC. * can use this information when handling OIDs sent by the VSC.
*/ */
struct nvsp_1_message_send_ndis_version { struct nvsp_1_message_send_ndis_version {
u32 NdisMajorVersion; u32 ndis_major_ver;
u32 NdisMinorVersion; u32 ndis_minor_ver;
} __attribute__((packed)); } __attribute__((packed));
/* /*
...@@ -126,15 +126,15 @@ struct nvsp_1_message_send_ndis_version { ...@@ -126,15 +126,15 @@ struct nvsp_1_message_send_ndis_version {
* can then use the receive buffer to send data to the VSC. * can then use the receive buffer to send data to the VSC.
*/ */
struct nvsp_1_message_send_receive_buffer { struct nvsp_1_message_send_receive_buffer {
u32 GpadlHandle; u32 gpadl_handle;
u16 Id; u16 id;
} __attribute__((packed)); } __attribute__((packed));
struct nvsp_1_receive_buffer_section { struct nvsp_1_receive_buffer_section {
u32 Offset; u32 offset;
u32 SubAllocationSize; u32 sub_alloc_size;
u32 NumSubAllocations; u32 num_sub_allocs;
u32 EndOffset; u32 end_offset;
} __attribute__((packed)); } __attribute__((packed));
/* /*
...@@ -143,8 +143,8 @@ struct nvsp_1_receive_buffer_section { ...@@ -143,8 +143,8 @@ struct nvsp_1_receive_buffer_section {
* buffer. * buffer.
*/ */
struct nvsp_1_message_send_receive_buffer_complete { struct nvsp_1_message_send_receive_buffer_complete {
u32 Status; u32 status;
u32 NumSections; u32 num_sections;
/* /*
* The receive buffer is split into two parts, a large suballocation * The receive buffer is split into two parts, a large suballocation
...@@ -165,7 +165,7 @@ struct nvsp_1_message_send_receive_buffer_complete { ...@@ -165,7 +165,7 @@ struct nvsp_1_message_send_receive_buffer_complete {
* LargeOffset SmallOffset * LargeOffset SmallOffset
*/ */
struct nvsp_1_receive_buffer_section Sections[1]; struct nvsp_1_receive_buffer_section sections[1];
} __attribute__((packed)); } __attribute__((packed));
/* /*
...@@ -174,7 +174,7 @@ struct nvsp_1_message_send_receive_buffer_complete { ...@@ -174,7 +174,7 @@ struct nvsp_1_message_send_receive_buffer_complete {
* again. * again.
*/ */
struct nvsp_1_message_revoke_receive_buffer { struct nvsp_1_message_revoke_receive_buffer {
u16 Id; u16 id;
}; };
/* /*
...@@ -182,8 +182,8 @@ struct nvsp_1_message_revoke_receive_buffer { ...@@ -182,8 +182,8 @@ struct nvsp_1_message_revoke_receive_buffer {
* can then use the send buffer to send data to the VSP. * can then use the send buffer to send data to the VSP.
*/ */
struct nvsp_1_message_send_send_buffer { struct nvsp_1_message_send_send_buffer {
u32 GpadlHandle; u32 gpadl_handle;
u16 Id; u16 id;
} __attribute__((packed)); } __attribute__((packed));
/* /*
...@@ -192,7 +192,7 @@ struct nvsp_1_message_send_send_buffer { ...@@ -192,7 +192,7 @@ struct nvsp_1_message_send_send_buffer {
* buffer. * buffer.
*/ */
struct nvsp_1_message_send_send_buffer_complete { struct nvsp_1_message_send_send_buffer_complete {
u32 Status; u32 status;
/* /*
* The VSC gets to choose the size of the send buffer and the VSP gets * The VSC gets to choose the size of the send buffer and the VSP gets
...@@ -200,7 +200,7 @@ struct nvsp_1_message_send_send_buffer_complete { ...@@ -200,7 +200,7 @@ struct nvsp_1_message_send_send_buffer_complete {
* dynamic reconfigurations when the cost of GPA-direct buffers * dynamic reconfigurations when the cost of GPA-direct buffers
* decreases. * decreases.
*/ */
u32 SectionSize; u32 section_size;
} __attribute__((packed)); } __attribute__((packed));
/* /*
...@@ -208,7 +208,7 @@ struct nvsp_1_message_send_send_buffer_complete { ...@@ -208,7 +208,7 @@ struct nvsp_1_message_send_send_buffer_complete {
* completes this transaction, the vsp should never use the send buffer again. * completes this transaction, the vsp should never use the send buffer again.
*/ */
struct nvsp_1_message_revoke_send_buffer { struct nvsp_1_message_revoke_send_buffer {
u16 Id; u16 id;
}; };
/* /*
...@@ -221,7 +221,7 @@ struct nvsp_1_message_send_rndis_packet { ...@@ -221,7 +221,7 @@ struct nvsp_1_message_send_rndis_packet {
* channels of communication. However, the Network VSP only has one. * channels of communication. However, the Network VSP only has one.
* Therefore, the channel travels with the RNDIS packet. * Therefore, the channel travels with the RNDIS packet.
*/ */
u32 ChannelType; u32 channel_type;
/* /*
* This field is used to send part or all of the data through a send * This field is used to send part or all of the data through a send
...@@ -229,8 +229,8 @@ struct nvsp_1_message_send_rndis_packet { ...@@ -229,8 +229,8 @@ struct nvsp_1_message_send_rndis_packet {
* index is 0xFFFFFFFF, then the send buffer is not being used and all * index is 0xFFFFFFFF, then the send buffer is not being used and all
* of the data was sent through other VMBus mechanisms. * of the data was sent through other VMBus mechanisms.
*/ */
u32 SendBufferSectionIndex; u32 send_buf_section_index;
u32 SendBufferSectionSize; u32 send_buf_section_size;
} __attribute__((packed)); } __attribute__((packed));
/* /*
...@@ -239,35 +239,35 @@ struct nvsp_1_message_send_rndis_packet { ...@@ -239,35 +239,35 @@ struct nvsp_1_message_send_rndis_packet {
* message cannot use any resources associated with the original RNDIS packet. * message cannot use any resources associated with the original RNDIS packet.
*/ */
struct nvsp_1_message_send_rndis_packet_complete { struct nvsp_1_message_send_rndis_packet_complete {
u32 Status; u32 status;
}; };
union nvsp_1_message_uber { union nvsp_1_message_uber {
struct nvsp_1_message_send_ndis_version SendNdisVersion; struct nvsp_1_message_send_ndis_version send_ndis_ver;
struct nvsp_1_message_send_receive_buffer SendReceiveBuffer; struct nvsp_1_message_send_receive_buffer send_recv_buf;
struct nvsp_1_message_send_receive_buffer_complete struct nvsp_1_message_send_receive_buffer_complete
SendReceiveBufferComplete; send_recv_buf_complete;
struct nvsp_1_message_revoke_receive_buffer RevokeReceiveBuffer; struct nvsp_1_message_revoke_receive_buffer revoke_recv_buf;
struct nvsp_1_message_send_send_buffer SendSendBuffer; struct nvsp_1_message_send_send_buffer send_send_buf;
struct nvsp_1_message_send_send_buffer_complete SendSendBufferComplete; struct nvsp_1_message_send_send_buffer_complete send_send_buf_complete;
struct nvsp_1_message_revoke_send_buffer RevokeSendBuffer; struct nvsp_1_message_revoke_send_buffer revoke_send_buf;
struct nvsp_1_message_send_rndis_packet SendRNDISPacket; struct nvsp_1_message_send_rndis_packet send_rndis_pkt;
struct nvsp_1_message_send_rndis_packet_complete struct nvsp_1_message_send_rndis_packet_complete
SendRNDISPacketComplete; send_rndis_pkt_complete;
} __attribute__((packed)); } __attribute__((packed));
union nvsp_all_messages { union nvsp_all_messages {
union nvsp_message_init_uber InitMessages; union nvsp_message_init_uber init_msg;
union nvsp_1_message_uber Version1Messages; union nvsp_1_message_uber v1_msg;
} __attribute__((packed)); } __attribute__((packed));
/* ALL Messages */ /* ALL Messages */
struct nvsp_message { struct nvsp_message {
struct nvsp_message_header Header; struct nvsp_message_header hdr;
union nvsp_all_messages Messages; union nvsp_all_messages msg;
} __attribute__((packed)); } __attribute__((packed));
...@@ -293,39 +293,39 @@ struct nvsp_message { ...@@ -293,39 +293,39 @@ struct nvsp_message {
/* Per netvsc channel-specific */ /* Per netvsc channel-specific */
struct netvsc_device { struct netvsc_device {
struct hv_device *Device; struct hv_device *dev;
atomic_t RefCount; atomic_t refcnt;
atomic_t NumOutstandingSends; atomic_t num_outstanding_sends;
/* /*
* List of free preallocated hv_netvsc_packet to represent receive * List of free preallocated hv_netvsc_packet to represent receive
* packet * packet
*/ */
struct list_head ReceivePacketList; struct list_head recv_pkt_list;
spinlock_t receive_packet_list_lock; spinlock_t recv_pkt_list_lock;
/* Send buffer allocated by us but manages by NetVSP */ /* Send buffer allocated by us but manages by NetVSP */
void *SendBuffer; void *send_buf;
u32 SendBufferSize; u32 send_buf_size;
u32 SendBufferGpadlHandle; u32 send_buf_gpadl_handle;
u32 SendSectionSize; u32 send_section_size;
/* Receive buffer allocated by us but manages by NetVSP */ /* Receive buffer allocated by us but manages by NetVSP */
void *ReceiveBuffer; void *recv_buf;
u32 ReceiveBufferSize; u32 recv_buf_size;
u32 ReceiveBufferGpadlHandle; u32 recv_buf_gpadl_handle;
u32 ReceiveSectionCount; u32 recv_section_cnt;
struct nvsp_1_receive_buffer_section *ReceiveSections; struct nvsp_1_receive_buffer_section *recv_section;
/* Used for NetVSP initialization protocol */ /* Used for NetVSP initialization protocol */
struct osd_waitevent *ChannelInitEvent; struct osd_waitevent *channel_init_event;
struct nvsp_message ChannelInitPacket; struct nvsp_message channel_init_pkt;
struct nvsp_message RevokePacket; struct nvsp_message revoke_packet;
/* unsigned char HwMacAddr[HW_MACADDR_LEN]; */ /* unsigned char HwMacAddr[HW_MACADDR_LEN]; */
/* Holds rndis device info */ /* Holds rndis device info */
void *Extension; void *extension;
}; };
#endif /* _NETVSC_H_ */ #endif /* _NETVSC_H_ */
...@@ -95,7 +95,7 @@ struct netvsc_driver { ...@@ -95,7 +95,7 @@ struct netvsc_driver {
*/ */
int (*recv_cb)(struct hv_device *dev, int (*recv_cb)(struct hv_device *dev,
struct hv_netvsc_packet *packet); struct hv_netvsc_packet *packet);
void (*link_status_change)(struct hv_device *dev, u32 Status); void (*link_status_change)(struct hv_device *dev, u32 status);
/* Specific to this driver */ /* Specific to this driver */
int (*send)(struct hv_device *dev, struct hv_netvsc_packet *packet); int (*send)(struct hv_device *dev, struct hv_netvsc_packet *packet);
......
...@@ -266,7 +266,7 @@ static int rndis_filter_send_request(struct rndis_device *dev, ...@@ -266,7 +266,7 @@ static int rndis_filter_send_request(struct rndis_device *dev,
rndis_filter_send_request_completion; rndis_filter_send_request_completion;
packet->completion.send.send_completion_tid = (unsigned long)dev; packet->completion.send.send_completion_tid = (unsigned long)dev;
ret = rndis_filter.inner_drv.send(dev->net_dev->Device, packet); ret = rndis_filter.inner_drv.send(dev->net_dev->dev, packet);
return ret; return ret;
} }
...@@ -338,10 +338,10 @@ static void rndis_filter_receive_indicate_status(struct rndis_device *dev, ...@@ -338,10 +338,10 @@ static void rndis_filter_receive_indicate_status(struct rndis_device *dev,
if (indicate->Status == RNDIS_STATUS_MEDIA_CONNECT) { if (indicate->Status == RNDIS_STATUS_MEDIA_CONNECT) {
rndis_filter.inner_drv.link_status_change( rndis_filter.inner_drv.link_status_change(
dev->net_dev->Device, 1); dev->net_dev->dev, 1);
} else if (indicate->Status == RNDIS_STATUS_MEDIA_DISCONNECT) { } else if (indicate->Status == RNDIS_STATUS_MEDIA_DISCONNECT) {
rndis_filter.inner_drv.link_status_change( rndis_filter.inner_drv.link_status_change(
dev->net_dev->Device, 0); dev->net_dev->dev, 0);
} else { } else {
/* /*
* TODO: * TODO:
...@@ -376,7 +376,7 @@ static void rndis_filter_receive_data(struct rndis_device *dev, ...@@ -376,7 +376,7 @@ static void rndis_filter_receive_data(struct rndis_device *dev,
pkt->is_data_pkt = true; pkt->is_data_pkt = true;
rndis_filter.inner_drv.recv_cb(dev->net_dev->Device, rndis_filter.inner_drv.recv_cb(dev->net_dev->dev,
pkt); pkt);
} }
...@@ -392,13 +392,13 @@ static int rndis_filter_receive(struct hv_device *dev, ...@@ -392,13 +392,13 @@ static int rndis_filter_receive(struct hv_device *dev,
return -EINVAL; return -EINVAL;
/* Make sure the rndis device state is initialized */ /* Make sure the rndis device state is initialized */
if (!net_dev->Extension) { if (!net_dev->extension) {
DPRINT_ERR(NETVSC, "got rndis message but no rndis device..." DPRINT_ERR(NETVSC, "got rndis message but no rndis device..."
"dropping this message!"); "dropping this message!");
return -1; return -1;
} }
rndis_dev = (struct rndis_device *)net_dev->Extension; rndis_dev = (struct rndis_device *)net_dev->extension;
if (rndis_dev->state == RNDIS_DEV_UNINITIALIZED) { if (rndis_dev->state == RNDIS_DEV_UNINITIALIZED) {
DPRINT_ERR(NETVSC, "got rndis message but rndis device " DPRINT_ERR(NETVSC, "got rndis message but rndis device "
"uninitialized...dropping this message!"); "uninitialized...dropping this message!");
...@@ -782,7 +782,7 @@ static int rndis_filte_device_add(struct hv_device *dev, ...@@ -782,7 +782,7 @@ static int rndis_filte_device_add(struct hv_device *dev,
/* ASSERT(netDevice); */ /* ASSERT(netDevice); */
/* ASSERT(netDevice->Device); */ /* ASSERT(netDevice->Device); */
netDevice->Extension = rndisDevice; netDevice->extension = rndisDevice;
rndisDevice->net_dev = netDevice; rndisDevice->net_dev = netDevice;
/* Send the rndis initialization message */ /* Send the rndis initialization message */
...@@ -819,13 +819,13 @@ static int rndis_filte_device_add(struct hv_device *dev, ...@@ -819,13 +819,13 @@ static int rndis_filte_device_add(struct hv_device *dev,
static int rndis_filter_device_remove(struct hv_device *dev) static int rndis_filter_device_remove(struct hv_device *dev)
{ {
struct netvsc_device *net_dev = dev->Extension; struct netvsc_device *net_dev = dev->Extension;
struct rndis_device *rndis_dev = net_dev->Extension; struct rndis_device *rndis_dev = net_dev->extension;
/* Halt and release the rndis device */ /* Halt and release the rndis device */
rndis_filter_halt_device(rndis_dev); rndis_filter_halt_device(rndis_dev);
kfree(rndis_dev); kfree(rndis_dev);
net_dev->Extension = NULL; net_dev->extension = NULL;
/* Pass control to inner driver to remove the device */ /* Pass control to inner driver to remove the device */
rndis_filter.inner_drv.base.OnDeviceRemove(dev); rndis_filter.inner_drv.base.OnDeviceRemove(dev);
...@@ -844,7 +844,7 @@ int rndis_filter_open(struct hv_device *dev) ...@@ -844,7 +844,7 @@ int rndis_filter_open(struct hv_device *dev)
if (!netDevice) if (!netDevice)
return -EINVAL; return -EINVAL;
return rndis_filter_open_device(netDevice->Extension); return rndis_filter_open_device(netDevice->extension);
} }
int rndis_filter_close(struct hv_device *dev) int rndis_filter_close(struct hv_device *dev)
...@@ -854,7 +854,7 @@ int rndis_filter_close(struct hv_device *dev) ...@@ -854,7 +854,7 @@ int rndis_filter_close(struct hv_device *dev)
if (!netDevice) if (!netDevice)
return -EINVAL; return -EINVAL;
return rndis_filter_close_device(netDevice->Extension); return rndis_filter_close_device(netDevice->extension);
} }
static int rndis_filter_send(struct hv_device *dev, static int rndis_filter_send(struct hv_device *dev,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment