win-pvdrivers

changeset 1085:896402519f15 1.0.1085

check for errors in xennet when getting backend feature support. Fix a stop/start problem in xennet.
author James Harper <james.harper@bendigoit.com.au>
date Thu Dec 12 19:55:52 2013 +1100 (2013-12-12)
parents c94174bbf195
children 3d4d85c41fc6
files xennet/xennet_common.c
line diff
     1.1 --- a/xennet/xennet_common.c	Thu Dec 12 19:54:33 2013 +1100
     1.2 +++ b/xennet/xennet_common.c	Thu Dec 12 19:55:52 2013 +1100
     1.3 @@ -366,7 +366,8 @@ XenNet_Connect(PVOID context, BOOLEAN su
     1.4      xi->device_state = DEVICE_STATE_INACTIVE;
     1.5      /* continue with setup so all the flags and capabilities are correct */
     1.6    }
     1.7 -
     1.8 +  /* explicitly set the frontend state as it will still be 'closed' if we are restarting the adapter */
     1.9 +  status = XnWriteInt32(xi->handle, XN_BASE_FRONTEND, "state", XenbusStateInitialising);
    1.10    if (xi->device_state != DEVICE_STATE_INACTIVE) {
    1.11      for (i = 0; i <= 5 && xi->backend_state != XenbusStateInitialising && xi->backend_state != XenbusStateInitWait && xi->backend_state != XenbusStateInitialised; i++) {
    1.12        FUNCTION_MSG("Waiting for XenbusStateInitXxx\n");
    1.13 @@ -417,13 +418,21 @@ XenNet_Connect(PVOID context, BOOLEAN su
    1.14      status = XnWriteInt32(xi->handle, XN_BASE_FRONTEND, "feature-sg", (int)xi->frontend_sg_supported);
    1.15      status = XnWriteInt32(xi->handle, XN_BASE_FRONTEND, "feature-gso-tcpv4", !!xi->frontend_gso_value);
    1.16    }
    1.17 +  
    1.18 +  /* backend always supports checksum offload */
    1.19 +  xi->backend_csum_supported = TRUE;
    1.20 +  
    1.21    status = XnReadInt32(xi->handle, XN_BASE_BACKEND, "feature-sg", &tmp_ulong);
    1.22 -  if (tmp_ulong) {
    1.23 +  if (NT_SUCCESS(status) && tmp_ulong) {
    1.24      xi->backend_sg_supported = TRUE;
    1.25 +  } else {
    1.26 +    xi->backend_sg_supported = FALSE;
    1.27    }
    1.28    status = XnReadInt32(xi->handle, XN_BASE_BACKEND, "feature-gso-tcpv4", &tmp_ulong);
    1.29 -  if (tmp_ulong) {
    1.30 +  if (NT_SUCCESS(status) && tmp_ulong) {
    1.31      xi->backend_gso_value = xi->frontend_gso_value;
    1.32 +  } else {
    1.33 +    xi->backend_gso_value = FALSE;
    1.34    }
    1.35  
    1.36    status = XnReadString(xi->handle, XN_BASE_BACKEND, "mac", &tmp_string);