win-pvdrivers

changeset 592:d1754b0e1ead

Start of support for PNP OID's
author James Harper <james.harper@bendigoit.com.au>
date Fri Jun 19 22:15:47 2009 +1000 (2009-06-19)
parents caf4329df174
children 682273b8ce5b
files xennet/xennet_oid.c
line diff
     1.1 --- a/xennet/xennet_oid.c	Wed Jun 10 13:46:38 2009 +1000
     1.2 +++ b/xennet/xennet_oid.c	Fri Jun 19 22:15:47 2009 +1000
     1.3 @@ -62,6 +62,10 @@ NDIS_OID supported_oids[] =
     1.4    OID_802_3_XMIT_MORE_COLLISIONS,
     1.5    /* tcp offload */
     1.6    OID_TCP_TASK_OFFLOAD,
     1.7 +  /* power */
     1.8 +  OID_PNP_CAPABILITIES,
     1.9 +  OID_PNP_SET_POWER,
    1.10 +  OID_PNP_QUERY_POWER,
    1.11  };
    1.12  
    1.13  /* return 4 or 8 depending on size of buffer */
    1.14 @@ -92,6 +96,7 @@ XenNet_QueryInformation(
    1.15    PNDIS_TASK_OFFLOAD nto;
    1.16    PNDIS_TASK_TCP_IP_CHECKSUM nttic;
    1.17    PNDIS_TASK_TCP_LARGE_SEND nttls;
    1.18 +  PNDIS_PNP_CAPABILITIES npc;
    1.19  
    1.20    *BytesNeeded = 0;
    1.21    *BytesWritten = 0;
    1.22 @@ -353,6 +358,24 @@ XenNet_QueryInformation(
    1.23        /* these are called often so just ignore then quietly */
    1.24        status = NDIS_STATUS_NOT_SUPPORTED;
    1.25        break;
    1.26 +
    1.27 +    case OID_PNP_CAPABILITIES:
    1.28 +      KdPrint(("Get OID_PNP_CAPABILITIES\n"));
    1.29 +      len = sizeof(NDIS_PNP_CAPABILITIES);
    1.30 +      if (len > InformationBufferLength)
    1.31 +        break;
    1.32 +      npc = (PNDIS_PNP_CAPABILITIES)InformationBuffer;
    1.33 +      npc->Flags = 0;
    1.34 +      npc->WakeUpCapabilities.MinMagicPacketWakeUp = NdisDeviceStateUnspecified;
    1.35 +      npc->WakeUpCapabilities.MinPatternWakeUp = NdisDeviceStateUnspecified;
    1.36 +      npc->WakeUpCapabilities.MinLinkChangeWakeUp = NdisDeviceStateUnspecified;
    1.37 +      used_temp_buffer = FALSE;
    1.38 +      break;
    1.39 +    case OID_PNP_QUERY_POWER:
    1.40 +      KdPrint(("Get OID_PNP_CAPABILITIES\n"));
    1.41 +      used_temp_buffer = FALSE;
    1.42 +      break;
    1.43 +
    1.44      default:
    1.45        KdPrint(("Get Unknown OID 0x%x\n", Oid));
    1.46        status = NDIS_STATUS_NOT_SUPPORTED;
    1.47 @@ -734,6 +757,28 @@ XenNet_SetInformation(
    1.48          KdPrint(("     LSO disabled\n", nto->Task));
    1.49        }
    1.50        break;
    1.51 +    case OID_PNP_SET_POWER:
    1.52 +      KdPrint(("     Set OID_PNP_SET_POWER\n"));
    1.53 +      switch (*(PNDIS_DEVICE_POWER_STATE )InformationBuffer)
    1.54 +      {
    1.55 +      case NdisDeviceStateD0:
    1.56 +        KdPrint(("       NdisDeviceStateD0\n"));
    1.57 +        break;
    1.58 +      case NdisDeviceStateD1:
    1.59 +        KdPrint(("       NdisDeviceStateD1\n"));
    1.60 +        break;
    1.61 +      case NdisDeviceStateD2:
    1.62 +        KdPrint(("       NdisDeviceStateD2\n"));
    1.63 +        break;
    1.64 +      case NdisDeviceStateD3:
    1.65 +        KdPrint(("       NdisDeviceStateD3\n"));
    1.66 +        break;
    1.67 +      default:
    1.68 +        KdPrint(("       NdisDeviceState??\n"));
    1.69 +        break;
    1.70 +      }
    1.71 +      status = NDIS_STATUS_SUCCESS;
    1.72 +      break;
    1.73      default:
    1.74        KdPrint(("Set Unknown OID 0x%x\n", Oid));
    1.75        status = NDIS_STATUS_NOT_SUPPORTED;