virtio_net.c (d24bae32fa9b541eb87edf1b3439f590c3b2dda5) | virtio_net.c (788a8b6dd3a28e02af5581923a14667f550009b5) |
---|---|
1/* A network driver using virtio. 2 * 3 * Copyright 2007 Rusty Russell <rusty@rustcorp.com.au> IBM Corporation 4 * 5 * This program is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation; either version 2 of the License, or 8 * (at your option) any later version. --- 859 unchanged lines hidden (view full) --- 868 } 869 870 return NETDEV_TX_OK; 871} 872 873/* 874 * Send command via the control virtqueue and check status. Commands 875 * supported by the hypervisor, as indicated by feature bits, should | 1/* A network driver using virtio. 2 * 3 * Copyright 2007 Rusty Russell <rusty@rustcorp.com.au> IBM Corporation 4 * 5 * This program is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation; either version 2 of the License, or 8 * (at your option) any later version. --- 859 unchanged lines hidden (view full) --- 868 } 869 870 return NETDEV_TX_OK; 871} 872 873/* 874 * Send command via the control virtqueue and check status. Commands 875 * supported by the hypervisor, as indicated by feature bits, should |
876 * never fail unless improperly formated. | 876 * never fail unless improperly formatted. |
877 */ 878static bool virtnet_send_command(struct virtnet_info *vi, u8 class, u8 cmd, 879 struct scatterlist *out) 880{ 881 struct scatterlist *sgs[4], hdr, stat; 882 struct virtio_net_ctrl_hdr ctrl; 883 virtio_net_ctrl_ack status = ~0; 884 unsigned out_num = 0, tmp; --- 171 unchanged lines hidden (view full) --- 1056 u8 promisc, allmulti; 1057 struct virtio_net_ctrl_mac *mac_data; 1058 struct netdev_hw_addr *ha; 1059 int uc_count; 1060 int mc_count; 1061 void *buf; 1062 int i; 1063 | 877 */ 878static bool virtnet_send_command(struct virtnet_info *vi, u8 class, u8 cmd, 879 struct scatterlist *out) 880{ 881 struct scatterlist *sgs[4], hdr, stat; 882 struct virtio_net_ctrl_hdr ctrl; 883 virtio_net_ctrl_ack status = ~0; 884 unsigned out_num = 0, tmp; --- 171 unchanged lines hidden (view full) --- 1056 u8 promisc, allmulti; 1057 struct virtio_net_ctrl_mac *mac_data; 1058 struct netdev_hw_addr *ha; 1059 int uc_count; 1060 int mc_count; 1061 void *buf; 1062 int i; 1063 |
1064 /* We can't dynamicaly set ndo_set_rx_mode, so return gracefully */ | 1064 /* We can't dynamically set ndo_set_rx_mode, so return gracefully */ |
1065 if (!virtio_has_feature(vi->vdev, VIRTIO_NET_F_CTRL_RX)) 1066 return; 1067 1068 promisc = ((dev->flags & IFF_PROMISC) != 0); 1069 allmulti = ((dev->flags & IFF_ALLMULTI) != 0); 1070 1071 sg_init_one(sg, &promisc, sizeof(promisc)); 1072 --- 782 unchanged lines hidden --- | 1065 if (!virtio_has_feature(vi->vdev, VIRTIO_NET_F_CTRL_RX)) 1066 return; 1067 1068 promisc = ((dev->flags & IFF_PROMISC) != 0); 1069 allmulti = ((dev->flags & IFF_ALLMULTI) != 0); 1070 1071 sg_init_one(sg, &promisc, sizeof(promisc)); 1072 --- 782 unchanged lines hidden --- |