aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2011-04-03 20:21:00 -0400
committerDavid S. Miller <davem@davemloft.net>2011-04-03 20:21:00 -0400
commit8f7b01a178b8e6a7b663a1bbaa1710756d67b69b (patch)
tree8f176cbd29c543af3a11cf613f5b87755e8d0353 /drivers
parent8a0427bb688eae86a8bb939b6a74e5aa00aa035a (diff)
xen: netfront: fix declaration order
Must declare xennet_fix_features() and xennet_set_features() before using them. Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/xen-netfront.c72
1 files changed, 36 insertions, 36 deletions
diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index f6e7e2726f6b..0cfe4ccf92d2 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -1140,6 +1140,42 @@ static void xennet_uninit(struct net_device *dev)
1140 gnttab_free_grant_references(np->gref_rx_head); 1140 gnttab_free_grant_references(np->gref_rx_head);
1141} 1141}
1142 1142
1143static u32 xennet_fix_features(struct net_device *dev, u32 features)
1144{
1145 struct netfront_info *np = netdev_priv(dev);
1146 int val;
1147
1148 if (features & NETIF_F_SG) {
1149 if (xenbus_scanf(XBT_NIL, np->xbdev->otherend, "feature-sg",
1150 "%d", &val) < 0)
1151 val = 0;
1152
1153 if (!val)
1154 features &= ~NETIF_F_SG;
1155 }
1156
1157 if (features & NETIF_F_TSO) {
1158 if (xenbus_scanf(XBT_NIL, np->xbdev->otherend,
1159 "feature-gso-tcpv4", "%d", &val) < 0)
1160 val = 0;
1161
1162 if (!val)
1163 features &= ~NETIF_F_TSO;
1164 }
1165
1166 return features;
1167}
1168
1169static int xennet_set_features(struct net_device *dev, u32 features)
1170{
1171 if (!(features & NETIF_F_SG) && dev->mtu > ETH_DATA_LEN) {
1172 netdev_info(dev, "Reducing MTU because no SG offload");
1173 dev->mtu = ETH_DATA_LEN;
1174 }
1175
1176 return 0;
1177}
1178
1143static const struct net_device_ops xennet_netdev_ops = { 1179static const struct net_device_ops xennet_netdev_ops = {
1144 .ndo_open = xennet_open, 1180 .ndo_open = xennet_open,
1145 .ndo_uninit = xennet_uninit, 1181 .ndo_uninit = xennet_uninit,
@@ -1513,42 +1549,6 @@ again:
1513 return err; 1549 return err;
1514} 1550}
1515 1551
1516static u32 xennet_fix_features(struct net_device *dev, u32 features)
1517{
1518 struct netfront_info *np = netdev_priv(dev);
1519 int val;
1520
1521 if (features & NETIF_F_SG) {
1522 if (xenbus_scanf(XBT_NIL, np->xbdev->otherend, "feature-sg",
1523 "%d", &val) < 0)
1524 val = 0;
1525
1526 if (!val)
1527 features &= ~NETIF_F_SG;
1528 }
1529
1530 if (features & NETIF_F_TSO) {
1531 if (xenbus_scanf(XBT_NIL, np->xbdev->otherend,
1532 "feature-gso-tcpv4", "%d", &val) < 0)
1533 val = 0;
1534
1535 if (!val)
1536 features &= ~NETIF_F_TSO;
1537 }
1538
1539 return features;
1540}
1541
1542static int xennet_set_features(struct net_device *dev, u32 features)
1543{
1544 if (!(features & NETIF_F_SG) && dev->mtu > ETH_DATA_LEN) {
1545 netdev_info(dev, "Reducing MTU because no SG offload");
1546 dev->mtu = ETH_DATA_LEN;
1547 }
1548
1549 return 0;
1550}
1551
1552static int xennet_connect(struct net_device *dev) 1552static int xennet_connect(struct net_device *dev)
1553{ 1553{
1554 struct netfront_info *np = netdev_priv(dev); 1554 struct netfront_info *np = netdev_priv(dev);