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