aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/xen-netfront.c
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@secretlab.ca>2010-12-30 00:20:30 -0500
committerGrant Likely <grant.likely@secretlab.ca>2010-12-30 00:21:47 -0500
commitd392da5207352f09030e95d9ea335a4225667ec0 (patch)
tree7d6cd1932afcad0a5619a5c504a6d93ca318187c /drivers/net/xen-netfront.c
parente39d5ef678045d61812c1401f04fe8edb14d6359 (diff)
parent387c31c7e5c9805b0aef8833d1731a5fe7bdea14 (diff)
Merge v2.6.37-rc8 into powerpc/next
Diffstat (limited to 'drivers/net/xen-netfront.c')
-rw-r--r--drivers/net/xen-netfront.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index b50fedcef8ac..cdbeec9f83ea 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -66,8 +66,8 @@ struct netfront_cb {
66 66
67#define GRANT_INVALID_REF 0 67#define GRANT_INVALID_REF 0
68 68
69#define NET_TX_RING_SIZE __RING_SIZE((struct xen_netif_tx_sring *)0, PAGE_SIZE) 69#define NET_TX_RING_SIZE __CONST_RING_SIZE(xen_netif_tx, PAGE_SIZE)
70#define NET_RX_RING_SIZE __RING_SIZE((struct xen_netif_rx_sring *)0, PAGE_SIZE) 70#define NET_RX_RING_SIZE __CONST_RING_SIZE(xen_netif_rx, PAGE_SIZE)
71#define TX_MAX_TARGET min_t(int, NET_RX_RING_SIZE, 256) 71#define TX_MAX_TARGET min_t(int, NET_RX_RING_SIZE, 256)
72 72
73struct netfront_info { 73struct netfront_info {
@@ -135,7 +135,7 @@ static void skb_entry_set_link(union skb_entry *list, unsigned short id)
135static int skb_entry_is_link(const union skb_entry *list) 135static int skb_entry_is_link(const union skb_entry *list)
136{ 136{
137 BUILD_BUG_ON(sizeof(list->skb) != sizeof(list->link)); 137 BUILD_BUG_ON(sizeof(list->skb) != sizeof(list->link));
138 return ((unsigned long)list->skb < PAGE_OFFSET); 138 return (unsigned long)list->skb < PAGE_OFFSET;
139} 139}
140 140
141/* 141/*
@@ -203,8 +203,8 @@ static void rx_refill_timeout(unsigned long data)
203 203
204static int netfront_tx_slot_available(struct netfront_info *np) 204static int netfront_tx_slot_available(struct netfront_info *np)
205{ 205{
206 return ((np->tx.req_prod_pvt - np->tx.rsp_cons) < 206 return (np->tx.req_prod_pvt - np->tx.rsp_cons) <
207 (TX_MAX_TARGET - MAX_SKB_FRAGS - 2)); 207 (TX_MAX_TARGET - MAX_SKB_FRAGS - 2);
208} 208}
209 209
210static void xennet_maybe_wake_tx(struct net_device *dev) 210static void xennet_maybe_wake_tx(struct net_device *dev)
@@ -1395,7 +1395,7 @@ static int setup_netfront(struct xenbus_device *dev, struct netfront_info *info)
1395} 1395}
1396 1396
1397/* Common code used when first setting up, and when resuming. */ 1397/* Common code used when first setting up, and when resuming. */
1398static int talk_to_backend(struct xenbus_device *dev, 1398static int talk_to_netback(struct xenbus_device *dev,
1399 struct netfront_info *info) 1399 struct netfront_info *info)
1400{ 1400{
1401 const char *message; 1401 const char *message;
@@ -1545,7 +1545,7 @@ static int xennet_connect(struct net_device *dev)
1545 return -ENODEV; 1545 return -ENODEV;
1546 } 1546 }
1547 1547
1548 err = talk_to_backend(np->xbdev, np); 1548 err = talk_to_netback(np->xbdev, np);
1549 if (err) 1549 if (err)
1550 return err; 1550 return err;
1551 1551
@@ -1599,7 +1599,7 @@ static int xennet_connect(struct net_device *dev)
1599/** 1599/**
1600 * Callback received when the backend's state changes. 1600 * Callback received when the backend's state changes.
1601 */ 1601 */
1602static void backend_changed(struct xenbus_device *dev, 1602static void netback_changed(struct xenbus_device *dev,
1603 enum xenbus_state backend_state) 1603 enum xenbus_state backend_state)
1604{ 1604{
1605 struct netfront_info *np = dev_get_drvdata(&dev->dev); 1605 struct netfront_info *np = dev_get_drvdata(&dev->dev);
@@ -1610,6 +1610,8 @@ static void backend_changed(struct xenbus_device *dev,
1610 switch (backend_state) { 1610 switch (backend_state) {
1611 case XenbusStateInitialising: 1611 case XenbusStateInitialising:
1612 case XenbusStateInitialised: 1612 case XenbusStateInitialised:
1613 case XenbusStateReconfiguring:
1614 case XenbusStateReconfigured:
1613 case XenbusStateConnected: 1615 case XenbusStateConnected:
1614 case XenbusStateUnknown: 1616 case XenbusStateUnknown:
1615 case XenbusStateClosed: 1617 case XenbusStateClosed:
@@ -1801,7 +1803,7 @@ static struct xenbus_driver netfront_driver = {
1801 .probe = netfront_probe, 1803 .probe = netfront_probe,
1802 .remove = __devexit_p(xennet_remove), 1804 .remove = __devexit_p(xennet_remove),
1803 .resume = netfront_resume, 1805 .resume = netfront_resume,
1804 .otherend_changed = backend_changed, 1806 .otherend_changed = netback_changed,
1805}; 1807};
1806 1808
1807static int __init netif_init(void) 1809static int __init netif_init(void)