aboutsummaryrefslogtreecommitdiffstats
path: root/extras/mini-os/netfront.c
diff options
context:
space:
mode:
authorkaf24@localhost.localdomain <kaf24@localhost.localdomain>2007-01-26 13:51:00 +0000
committerkaf24@localhost.localdomain <kaf24@localhost.localdomain>2007-01-26 13:51:00 +0000
commit9e73f989682d9ad8d0cd79e26fb522517ba785bf (patch)
tree036d4507f8a155b6f96a15d9eafd848e78549c2f /extras/mini-os/netfront.c
parentf4e65191df764bf01f37eab5b9f54d00dbf217c6 (diff)
downloadxen-9e73f989682d9ad8d0cd79e26fb522517ba785bf.tar.gz
xen-9e73f989682d9ad8d0cd79e26fb522517ba785bf.tar.bz2
xen-9e73f989682d9ad8d0cd79e26fb522517ba785bf.zip
minios : netfront driver fixes.
- Handle returned backend==NULL || mac==NULL, this leads sometimes to a crash. - Remove unnecessary (and bogus) initialisation of np->rx.req_prod_pvt Signed-off-by: Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com> Signed-off-by: Keir Fraser <keir@xensource.com>
Diffstat (limited to 'extras/mini-os/netfront.c')
-rw-r--r--extras/mini-os/netfront.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/extras/mini-os/netfront.c b/extras/mini-os/netfront.c
index 3871160d55..4c10dc8770 100644
--- a/extras/mini-os/netfront.c
+++ b/extras/mini-os/netfront.c
@@ -324,6 +324,14 @@ done:
msg = xenbus_read(XBT_NIL, "device/vif/0/backend", &backend);
msg = xenbus_read(XBT_NIL, "device/vif/0/mac", &mac);
+ if ((backend == NULL) || (mac == NULL)) {
+ struct evtchn_close op = { info->local_port };
+ printk("%s: backend/mac failed\n", __func__);
+ unbind_evtchn(info->local_port);
+ HYPERVISOR_event_channel_op(EVTCHNOP_close, &op);
+ return;
+ }
+
printk("backend at %s\n",backend);
printk("mac is %s\n",mac);
@@ -383,10 +391,7 @@ void init_rx_buffers(void)
netif_rx_request_t *req;
int notify;
- np->rx.req_prod_pvt = requeue_idx;
-
-
- /* Step 2: Rebuild the RX buffer freelist and the RX ring itself. */
+ /* Rebuild the RX buffer freelist and the RX ring itself. */
for (requeue_idx = 0, i = 0; i < NET_RX_RING_SIZE; i++)
{
struct net_buffer* buf = &rx_buffers[requeue_idx];
@@ -402,16 +407,12 @@ void init_rx_buffers(void)
np->rx.req_prod_pvt = requeue_idx;
-
-
RING_PUSH_REQUESTS_AND_CHECK_NOTIFY(&np->rx, notify);
- if(notify)
+ if (notify)
notify_remote_via_evtchn(np->evtchn);
np->rx.sring->rsp_event = np->rx.rsp_cons + 1;
-
-
}