src/netvsc_drv.c
/* Alloc struct netvsc_device_info, and initialize it from either existing
 * struct netvsc_device, or from default values.
 */
Alloc struct netvsc_device_info, and initialize it from either existing
struct netvsc_device, or from default values.
Alloc struct netvsc_device_info and initialize it from either existing struct netvsc_device or from default values .
static struct netvsc_device_info *netvsc_devinfo_get
			(struct netvsc_device *nvdev)
{
	struct netvsc_device_info *dev_info;
	dev_info = kzalloc(sizeof(*dev_info), GFP_ATOMIC);
	if (!dev_info)
		return NULL;
	if (nvdev) {
		dev_info->num_chn = nvdev->num_chn;
		dev_info->send_sections = nvdev->send_section_cnt;
		dev_info->send_section_size = nvdev->send_section_size;
		dev_info->recv_sections = nvdev->recv_section_cnt;
		dev_info->recv_section_size = nvdev->recv_section_size;
		memcpy(dev_info->rss_key, nvdev->extension->rss_key,
		       NETVSC_HASH_KEYLEN);
	} else {
		dev_info->num_chn = VRSS_CHANNEL_DEFAULT;
		dev_info->send_sections = NETVSC_DEFAULT_TX;
		dev_info->send_section_size = NETVSC_SEND_SECTION_SIZE;
		dev_info->recv_sections = NETVSC_DEFAULT_RX;
		dev_info->recv_section_size = NETVSC_RECV_SECTION_SIZE;
	}
	return dev_info;
}
static struct netvsc_device_info * netvsc_devinfo_get ( struct netvsc_device * nvdev ) { struct netvsc_device_info * dev_info ; dev_info = kzalloc ( sizeof ( * dev_info ) , GFP_ATOMIC ) ; if ( ! dev_info ) return NULL ; if ( nvdev ) { dev_info -> num_chn = nvdev -> num_chn ; dev_info -> send_sections = nvdev -> send_section_cnt ; dev_info -> send_section_size = nvdev -> send_section_size ; dev_info -> recv_sections = nvdev -> recv_section_cnt ; dev_info -> recv_section_size = nvdev -> recv_section_size ; memcpy ( dev_info -> rss_key , nvdev -> extension -> rss_key , NETVSC_HASH_KEYLEN ) ; } else { dev_info -> num_chn = VRSS_CHANNEL_DEFAULT ; dev_info -> send_sections = NETVSC_DEFAULT_TX ; dev_info -> send_section_size = NETVSC_SEND_SECTION_SIZE ; dev_info -> recv_sections = NETVSC_DEFAULT_RX ; dev_info -> recv_section_size = NETVSC_RECV_SECTION_SIZE ; } return dev_info ; }
Alloc struct netvsc_device_info, and initialize it from either existing
 struct netvsc_device, or from default values.
Alloc struct netvsc_device_info and initialize it from either existing struct netvsc_device or from default values .