win-pvdrivers

changeset 943:e16e389a3cb5 0.11.0.308

Turn down verbosity in xennet. Remove stale code.
author James Harper <james.harper@bendigoit.com.au>
date Sun Jul 10 15:11:23 2011 +1000 (2011-07-10)
parents 81f132396f9e
children 4de2e9e70971
files xennet/xennet6_oid.c
line diff
     1.1 --- a/xennet/xennet6_oid.c	Sat Jul 09 18:40:28 2011 +1000
     1.2 +++ b/xennet/xennet6_oid.c	Sun Jul 10 15:11:23 2011 +1000
     1.3 @@ -23,19 +23,13 @@ Foundation, Inc., 51 Franklin Street, Fi
     1.4  #define DEF_OID_QUERY(oid, min_length) {oid, #oid, min_length, XenNet_Query##oid, NULL}
     1.5  #define DEF_OID_QUERYSET(oid, min_length) {oid, #oid, min_length, XenNet_Query##oid, XenNet_Set##oid}
     1.6  #define DEF_OID_SET(oid, min_length) {oid, #oid, min_length, NULL, XenNet_Set##oid}
     1.7 +#define DEF_OID_NONE(oid) {oid, #oid, 0, NULL, NULL} /* define this for a silent but unsupported oid */
     1.8  
     1.9  #define DEF_OID_QUERY_STAT(oid) DEF_OID_QUERY(##oid, 0) /* has to be 0 so the 4/8 size works */
    1.10  #define DEF_OID_QUERY_ULONG(oid) DEF_OID_QUERY(##oid, sizeof(ULONG))
    1.11  #define DEF_OID_QUERYSET_ULONG(oid) DEF_OID_QUERYSET(##oid, sizeof(ULONG))
    1.12  #define DEF_OID_SET_ULONG(oid) DEF_OID_SET(##oid, sizeof(ULONG))
    1.13  
    1.14 -/*
    1.15 -#define SET_ULONG(value) \
    1.16 -  do { \
    1.17 -    request->DATA.SET_INFORMATION.InformationBufferLength = sizeof(ULONG); \
    1.18 -    *(ULONG *)request->DATA.SET_INFORMATION.InformationBuffer = value; \
    1.19 -  } while (0);
    1.20 -*/
    1.21  #define DEF_OID_QUERY_ROUTINE(oid, value, length) \
    1.22  NDIS_STATUS \
    1.23  XenNet_Query##oid(NDIS_HANDLE context, PNDIS_OID_REQUEST request) \
    1.24 @@ -370,23 +364,22 @@ struct xennet_oids_t xennet_oids[] = {
    1.25  
    1.26    DEF_OID_QUERYSET_ULONG(OID_GEN_CURRENT_PACKET_FILTER),
    1.27    DEF_OID_QUERYSET_ULONG(OID_GEN_CURRENT_LOOKAHEAD),
    1.28 -  //DEF_OID_QUERY(OID_GEN_DRIVER_VERSION),
    1.29    DEF_OID_QUERY_ULONG(OID_GEN_MAXIMUM_TOTAL_SIZE),
    1.30    DEF_OID_SET(OID_GEN_LINK_PARAMETERS, sizeof(NDIS_LINK_PARAMETERS)),
    1.31    DEF_OID_QUERYSET(OID_GEN_INTERRUPT_MODERATION, sizeof(NDIS_INTERRUPT_MODERATION_PARAMETERS)),
    1.32    
    1.33    DEF_OID_QUERY_ULONG(OID_GEN_MAXIMUM_SEND_PACKETS),
    1.34 +  DEF_OID_QUERY_ULONG(OID_GEN_MEDIA_SUPPORTED),
    1.35 +  DEF_OID_QUERY_ULONG(OID_GEN_MEDIA_IN_USE),
    1.36 +  DEF_OID_QUERY_ULONG(OID_GEN_MAXIMUM_LOOKAHEAD),
    1.37  
    1.38    /* general optional */
    1.39    DEF_OID_SET(OID_GEN_NETWORK_LAYER_ADDRESSES, FIELD_OFFSET(NETWORK_ADDRESS_LIST, Address)),
    1.40    DEF_OID_SET(OID_GEN_MACHINE_NAME, 0),
    1.41    DEF_OID_SET(OID_OFFLOAD_ENCAPSULATION, sizeof(NDIS_OFFLOAD_ENCAPSULATION)),
    1.42 -  //DEF_OID_QUERY(OID_GEN_TRANSPORT_HEADER_OFFSET, sizeof(TRANSPORT_HEADER_OFFSET)),
    1.43  
    1.44    /* power */
    1.45 -  //DEF_OID_QUERY(OID_PNP_CAPABILITIES, sizeof(NDIS_PNP_CAPABILITIES)),
    1.46    DEF_OID_SET_ULONG(OID_PNP_SET_POWER),
    1.47 -  //DEF_OID_QUERY_ULONG(OID_PNP_QUERY_POWER),
    1.48    
    1.49    /* stats */
    1.50    DEF_OID_QUERY_STAT(OID_GEN_XMIT_OK),
    1.51 @@ -397,974 +390,20 @@ struct xennet_oids_t xennet_oids[] = {
    1.52    DEF_OID_QUERY_STAT(OID_802_3_RCV_ERROR_ALIGNMENT),
    1.53    DEF_OID_QUERY_STAT(OID_802_3_XMIT_ONE_COLLISION),
    1.54    DEF_OID_QUERY_STAT(OID_802_3_XMIT_MORE_COLLISIONS),
    1.55 -  DEF_OID_QUERY_ULONG(OID_GEN_MEDIA_SUPPORTED),
    1.56 -  DEF_OID_QUERY_ULONG(OID_GEN_MEDIA_IN_USE),
    1.57 +  DEF_OID_NONE(OID_IP4_OFFLOAD_STATS),
    1.58 +  DEF_OID_NONE(OID_IP6_OFFLOAD_STATS),
    1.59    DEF_OID_QUERY(OID_GEN_STATISTICS, sizeof(NDIS_STATISTICS_INFO)),
    1.60 -  DEF_OID_QUERY_ULONG(OID_GEN_MAXIMUM_LOOKAHEAD),
    1.61 +
    1.62    /* media-specific */
    1.63    DEF_OID_QUERY(OID_802_3_PERMANENT_ADDRESS, 6),
    1.64    DEF_OID_QUERY(OID_802_3_CURRENT_ADDRESS, 6),
    1.65    DEF_OID_QUERYSET(OID_802_3_MULTICAST_LIST, 0),
    1.66    DEF_OID_QUERY_ULONG(OID_802_3_MAXIMUM_LIST_SIZE),
    1.67    
    1.68 -#if 0
    1.69 -  /* tcp offload */
    1.70 -  DEF_OID_QUERY(OID_TCP_TASK_OFFLOAD,
    1.71 -  DEF_OID_QUERY(OID_TCP_OFFLOAD_PARAMETERS,
    1.72 -  DEF_OID_QUERY(OID_OFFLOAD_ENCAPSULATION,
    1.73 -#endif
    1.74 -
    1.75    {0, "", 0, NULL, NULL}
    1.76  };
    1.77  
    1.78 -static NDIS_OID supported_oids[ARRAY_SIZE(xennet_oids)];
    1.79 -
    1.80 -#if 0
    1.81 -/* return 4 or 8 depending on size of buffer */
    1.82 -#define HANDLE_STAT_RETURN \
    1.83 -  {if (InformationBufferLength == 4) { \
    1.84 -    len = 4; *BytesNeeded = 8; \
    1.85 -    } else { \
    1.86 -    len = 8; \
    1.87 -    } }
    1.88 -
    1.89 -#define SET_LEN_AND_BREAK_IF_SHORT(_len) if ((len = _len) > InformationBufferLength) break;
    1.90 -
    1.91 -static NDIS_STATUS
    1.92 -XenNet_QueryInformation(
    1.93 -  IN NDIS_HANDLE MiniportAdapterContext,
    1.94 -  IN NDIS_OID Oid,
    1.95 -  IN PVOID InformationBuffer,
    1.96 -  IN ULONG InformationBufferLength,
    1.97 -  OUT PUINT BytesWritten,
    1.98 -  OUT PUINT BytesNeeded)
    1.99 -{
   1.100 -  NDIS_STATUS status = NDIS_STATUS_SUCCESS;
   1.101 -  struct xennet_info *xi = MiniportAdapterContext;
   1.102 -  BOOLEAN used_temp_buffer = TRUE;
   1.103 -  UINT len = 4;
   1.104 -  ULONG64 temp_data;
   1.105 -  PVOID data = &temp_data;
   1.106 -  PNDIS_INTERRUPT_MODERATION_PARAMETERS nimp;
   1.107 -  UCHAR vendor_desc[] = XN_VENDOR_DESC;
   1.108 -#if 0
   1.109 -  PNDIS_TASK_OFFLOAD_HEADER ntoh;
   1.110 -  PNDIS_TASK_OFFLOAD nto;
   1.111 -  PNDIS_TASK_TCP_IP_CHECKSUM nttic;
   1.112 -  PNDIS_TASK_TCP_LARGE_SEND nttls;
   1.113 -  PNDIS_PNP_CAPABILITIES npc;
   1.114 -#endif
   1.115 -
   1.116 -  *BytesNeeded = 0;
   1.117 -  *BytesWritten = 0;
   1.118 -
   1.119 -// FUNCTION_ENTER()
   1.120 -
   1.121 -  switch(Oid)
   1.122 -  {
   1.123 -#if 0
   1.124 -    case OID_GEN_SUPPORTED_LIST:
   1.125 -      data = supported_oids;
   1.126 -      len = sizeof(supported_oids);
   1.127 -      break;
   1.128 -    case OID_GEN_MEDIA_SUPPORTED:
   1.129 -      temp_data = NdisMedium802_3;
   1.130 -      break;
   1.131 -    case OID_GEN_MEDIA_IN_USE:
   1.132 -      temp_data = NdisMedium802_3;
   1.133 -      break;
   1.134 -    case OID_GEN_MAXIMUM_LOOKAHEAD:
   1.135 -      temp_data = MAX_LOOKAHEAD_LENGTH; //xi->config_mtu_value;
   1.136 -      break;
   1.137 -    case OID_GEN_MAXIMUM_FRAME_SIZE:
   1.138 -      temp_data = xi->config_mtu_value;
   1.139 -      break;
   1.140 -    case OID_GEN_LINK_SPEED:
   1.141 -      temp_data = 10000000; /* 1Gb */
   1.142 -      break;
   1.143 -    case OID_GEN_MAC_OPTIONS:
   1.144 -      temp_data = NDIS_MAC_OPTION_COPY_LOOKAHEAD_DATA | 
   1.145 -        NDIS_MAC_OPTION_TRANSFERS_NOT_PEND |
   1.146 -        NDIS_MAC_OPTION_NO_LOOPBACK;
   1.147 -      break;
   1.148 -    case OID_GEN_MEDIA_CONNECT_STATUS:
   1.149 -      if (xi->connected && !xi->inactive)
   1.150 -        temp_data = NdisMediaStateConnected;
   1.151 -      else
   1.152 -        temp_data = NdisMediaStateDisconnected;
   1.153 -      break;
   1.154 -    case OID_GEN_XMIT_ERROR:
   1.155 -      temp_data = xi->stat_tx_error;
   1.156 -      HANDLE_STAT_RETURN;
   1.157 -      break;
   1.158 -    case OID_GEN_RCV_ERROR:
   1.159 -      temp_data = xi->stat_rx_error;
   1.160 -      HANDLE_STAT_RETURN;
   1.161 -      break;
   1.162 -    case OID_GEN_RCV_NO_BUFFER:
   1.163 -      temp_data = xi->stat_rx_no_buffer;
   1.164 -      HANDLE_STAT_RETURN;
   1.165 -      break;
   1.166 -    case OID_802_3_PERMANENT_ADDRESS:
   1.167 -      data = xi->perm_mac_addr;
   1.168 -      len = ETH_ALEN;
   1.169 -      break;
   1.170 -    case OID_802_3_RCV_ERROR_ALIGNMENT:
   1.171 -    case OID_802_3_XMIT_ONE_COLLISION:
   1.172 -    case OID_802_3_XMIT_MORE_COLLISIONS:
   1.173 -      temp_data = 0;
   1.174 -      HANDLE_STAT_RETURN;
   1.175 -      break;
   1.176 -    case OID_802_3_MAXIMUM_LIST_SIZE:
   1.177 -      temp_data = MULTICAST_LIST_MAX_SIZE;
   1.178 -      break;
   1.179 -    case OID_TCP_TASK_OFFLOAD:
   1.180 -      KdPrint(("Get OID_TCP_TASK_OFFLOAD\n"));
   1.181 -      /* it's times like this that C really sucks */
   1.182 -
   1.183 -      len = sizeof(NDIS_TASK_OFFLOAD_HEADER);
   1.184 -
   1.185 -      if (xi->config_csum)
   1.186 -      {
   1.187 -        len += FIELD_OFFSET(NDIS_TASK_OFFLOAD, TaskBuffer)
   1.188 -          + sizeof(NDIS_TASK_TCP_IP_CHECKSUM);
   1.189 -      }
   1.190 -
   1.191 -      if (xi->config_gso)
   1.192 -      {
   1.193 -        len += FIELD_OFFSET(NDIS_TASK_OFFLOAD, TaskBuffer)
   1.194 -          + sizeof(NDIS_TASK_TCP_LARGE_SEND);
   1.195 -      }
   1.196 -
   1.197 -      //len += 1024;
   1.198 -
   1.199 -      if (len > InformationBufferLength)
   1.200 -      {
   1.201 -          break;
   1.202 -      }
   1.203 -
   1.204 -      ntoh = (PNDIS_TASK_OFFLOAD_HEADER)InformationBuffer;
   1.205 -      if (ntoh->Version != NDIS_TASK_OFFLOAD_VERSION
   1.206 -        || ntoh->Size != sizeof(*ntoh)
   1.207 -        || !(
   1.208 -          ntoh->EncapsulationFormat.Encapsulation == IEEE_802_3_Encapsulation
   1.209 -          || (ntoh->EncapsulationFormat.Encapsulation == UNSPECIFIED_Encapsulation
   1.210 -              && ntoh->EncapsulationFormat.EncapsulationHeaderSize == XN_HDR_SIZE)))
   1.211 -      {
   1.212 -        status = NDIS_STATUS_NOT_SUPPORTED;
   1.213 -        break;
   1.214 -      }
   1.215 -      ntoh->OffsetFirstTask = 0; 
   1.216 -      nto = NULL;
   1.217 -
   1.218 -      if (xi->config_csum)
   1.219 -      {
   1.220 -        if (ntoh->OffsetFirstTask == 0)
   1.221 -        {
   1.222 -          ntoh->OffsetFirstTask = ntoh->Size;
   1.223 -          nto = (PNDIS_TASK_OFFLOAD)((PCHAR)(ntoh) + ntoh->OffsetFirstTask);
   1.224 -        }
   1.225 -        else
   1.226 -        {
   1.227 -          nto->OffsetNextTask = FIELD_OFFSET(NDIS_TASK_OFFLOAD, TaskBuffer)
   1.228 -            + nto->TaskBufferLength;
   1.229 -          nto = (PNDIS_TASK_OFFLOAD)((PCHAR)(nto) + nto->OffsetNextTask);
   1.230 -        }
   1.231 -        /* fill in first nto */
   1.232 -        nto->Version = NDIS_TASK_OFFLOAD_VERSION;
   1.233 -        nto->Size = sizeof(NDIS_TASK_OFFLOAD);
   1.234 -        nto->Task = TcpIpChecksumNdisTask;
   1.235 -        nto->TaskBufferLength = sizeof(NDIS_TASK_TCP_IP_CHECKSUM);
   1.236 -
   1.237 -        KdPrint(("config_csum enabled\n"));
   1.238 -        KdPrint(("nto = %p\n", nto));
   1.239 -        KdPrint(("nto->Size = %d\n", nto->Size));
   1.240 -        KdPrint(("nto->TaskBufferLength = %d\n", nto->TaskBufferLength));
   1.241 -
   1.242 -        /* fill in checksum offload struct */
   1.243 -        nttic = (PNDIS_TASK_TCP_IP_CHECKSUM)nto->TaskBuffer;
   1.244 -        nttic->V4Transmit.IpChecksum = 0;
   1.245 -        nttic->V4Transmit.IpOptionsSupported = 0;
   1.246 -        nttic->V4Transmit.TcpChecksum = 1;
   1.247 -        nttic->V4Transmit.TcpOptionsSupported = 1;
   1.248 -        nttic->V4Transmit.UdpChecksum = 1;
   1.249 -        nttic->V4Receive.IpChecksum = 1;
   1.250 -        nttic->V4Receive.IpOptionsSupported = 1;
   1.251 -        nttic->V4Receive.TcpChecksum = 1;
   1.252 -        nttic->V4Receive.TcpOptionsSupported = 1;
   1.253 -        nttic->V4Receive.UdpChecksum = 1;
   1.254 -        nttic->V6Transmit.IpOptionsSupported = 0;
   1.255 -        nttic->V6Transmit.TcpOptionsSupported = 0;
   1.256 -        nttic->V6Transmit.TcpChecksum = 0;
   1.257 -        nttic->V6Transmit.UdpChecksum = 0;
   1.258 -        nttic->V6Receive.IpOptionsSupported = 0;
   1.259 -        nttic->V6Receive.TcpOptionsSupported = 0;
   1.260 -        nttic->V6Receive.TcpChecksum = 0;
   1.261 -        nttic->V6Receive.UdpChecksum = 0;
   1.262 -      }
   1.263 -      if (xi->config_gso)
   1.264 -      {
   1.265 -        if (ntoh->OffsetFirstTask == 0)
   1.266 -        {
   1.267 -          ntoh->OffsetFirstTask = ntoh->Size;
   1.268 -          nto = (PNDIS_TASK_OFFLOAD)((PCHAR)(ntoh) + ntoh->OffsetFirstTask);
   1.269 -        }
   1.270 -        else
   1.271 -        {
   1.272 -          nto->OffsetNextTask = FIELD_OFFSET(NDIS_TASK_OFFLOAD, TaskBuffer)
   1.273 -            + nto->TaskBufferLength;
   1.274 -          nto = (PNDIS_TASK_OFFLOAD)((PCHAR)(nto) + nto->OffsetNextTask);
   1.275 -        }
   1.276 -  
   1.277 -        /* fill in second nto */
   1.278 -        nto->Version = NDIS_TASK_OFFLOAD_VERSION;
   1.279 -        nto->Size = sizeof(NDIS_TASK_OFFLOAD);
   1.280 -        nto->Task = TcpLargeSendNdisTask;
   1.281 -        nto->TaskBufferLength = sizeof(NDIS_TASK_TCP_LARGE_SEND);
   1.282 -
   1.283 -        KdPrint(("config_gso enabled\n"));
   1.284 -        KdPrint(("nto = %p\n", nto));
   1.285 -        KdPrint(("nto->Size = %d\n", nto->Size));
   1.286 -        KdPrint(("nto->TaskBufferLength = %d\n", nto->TaskBufferLength));
   1.287 -  
   1.288 -        /* fill in large send struct */
   1.289 -        nttls = (PNDIS_TASK_TCP_LARGE_SEND)nto->TaskBuffer;
   1.290 -        nttls->Version = 0;
   1.291 -        nttls->MaxOffLoadSize = xi->config_gso;
   1.292 -        nttls->MinSegmentCount = MIN_LARGE_SEND_SEGMENTS;
   1.293 -        nttls->TcpOptions = FALSE; /* linux can't handle this */
   1.294 -        nttls->IpOptions = FALSE; /* linux can't handle this */
   1.295 -        KdPrint(("&(nttls->IpOptions) = %p\n", &(nttls->IpOptions)));        
   1.296 -      }
   1.297 -
   1.298 -      if (nto)
   1.299 -        nto->OffsetNextTask = 0; /* last one */
   1.300 -
   1.301 -      used_temp_buffer = FALSE;
   1.302 -      break;
   1.303 -    case OID_PNP_CAPABILITIES:
   1.304 -      KdPrint(("Get OID_PNP_CAPABILITIES\n"));
   1.305 -      len = sizeof(NDIS_PNP_CAPABILITIES);
   1.306 -      if (len > InformationBufferLength)
   1.307 -        break;
   1.308 -      npc = (PNDIS_PNP_CAPABILITIES)InformationBuffer;
   1.309 -      npc->Flags = 0;
   1.310 -      npc->WakeUpCapabilities.MinMagicPacketWakeUp = NdisDeviceStateUnspecified;
   1.311 -      npc->WakeUpCapabilities.MinPatternWakeUp = NdisDeviceStateUnspecified;
   1.312 -      npc->WakeUpCapabilities.MinLinkChangeWakeUp = NdisDeviceStateUnspecified;
   1.313 -      used_temp_buffer = FALSE;
   1.314 -      break;
   1.315 -    case OID_PNP_QUERY_POWER:
   1.316 -      KdPrint(("Get OID_PNP_CAPABILITIES\n"));
   1.317 -      used_temp_buffer = FALSE;
   1.318 -      break;
   1.319 -
   1.320 -#endif
   1.321 -    case OID_GEN_MAXIMUM_TOTAL_SIZE:
   1.322 -      temp_data = xi->current_mtu_value + XN_HDR_SIZE;
   1.323 -      break;
   1.324 -    case OID_GEN_INTERRUPT_MODERATION:
   1.325 -      SET_LEN_AND_BREAK_IF_SHORT(sizeof(NDIS_INTERRUPT_MODERATION_PARAMETERS));
   1.326 -      nimp = (PNDIS_INTERRUPT_MODERATION_PARAMETERS)InformationBuffer;
   1.327 -      nimp->Header.Type = NDIS_OBJECT_TYPE_DEFAULT;
   1.328 -      nimp->Header.Revision = NDIS_INTERRUPT_MODERATION_PARAMETERS_REVISION_1;
   1.329 -      nimp->Header.Size = NDIS_SIZEOF_INTERRUPT_MODERATION_PARAMETERS_REVISION_1;
   1.330 -      nimp->Flags = 0;
   1.331 -      nimp->InterruptModeration = NdisInterruptModerationNotSupported;
   1.332 -      break;
   1.333 -    case OID_GEN_CURRENT_PACKET_FILTER:
   1.334 -      temp_data = xi->packet_filter;
   1.335 -      break;
   1.336 -    case OID_GEN_CURRENT_LOOKAHEAD:
   1.337 -      temp_data = xi->current_lookahead;
   1.338 -      break;
   1.339 -    case OID_802_3_CURRENT_ADDRESS:
   1.340 -      data = xi->curr_mac_addr;
   1.341 -      len = ETH_ALEN;
   1.342 -      break;
   1.343 -    case OID_802_3_PERMANENT_ADDRESS:
   1.344 -      data = xi->perm_mac_addr;
   1.345 -      len = ETH_ALEN;
   1.346 -      break;
   1.347 -    case OID_802_3_MULTICAST_LIST:
   1.348 -      data = xi->multicast_list;
   1.349 -      len = xi->multicast_list_size * 6;
   1.350 -      break;
   1.351 -    case OID_GEN_VENDOR_ID:
   1.352 -      FUNCTION_MSG("OID_GEN_VENDOR_ID InformationBufferLength = %d\n", InformationBufferLength);
   1.353 -      temp_data = 0xFFFFFF; // Not guaranteed to be XENSOURCE_MAC_HDR;
   1.354 -      break;
   1.355 -    case OID_GEN_VENDOR_DESCRIPTION:
   1.356 -      data = vendor_desc;
   1.357 -      len = sizeof(vendor_desc);
   1.358 -      break;
   1.359 -    case OID_GEN_DRIVER_VERSION:
   1.360 -      temp_data = (NDIS_MINIPORT_MAJOR_VERSION << 8) | NDIS_MINIPORT_MINOR_VERSION;
   1.361 -      len = 2;
   1.362 -      break;
   1.363 -    case OID_GEN_VENDOR_DRIVER_VERSION:
   1.364 -      temp_data = VENDOR_DRIVER_VERSION;
   1.365 -      len = 4;
   1.366 -      break;
   1.367 -    case OID_TCP_CONNECTION_OFFLOAD_HARDWARE_CAPABILITIES:
   1.368 -      FUNCTION_MSG("Unhandled OID_TCP_CONNECTION_OFFLOAD_HARDWARE_CAPABILITIES\n");
   1.369 -      break;
   1.370 -    case OID_TCP_CONNECTION_OFFLOAD_CURRENT_CONFIG:
   1.371 -      FUNCTION_MSG("Unhandled OID_TCP_CONNECTION_OFFLOAD_HARDWARE_CAPABILITIES\n");
   1.372 -      break;
   1.373 -    case OID_TCP_OFFLOAD_CURRENT_CONFIG:
   1.374 -      FUNCTION_MSG("Unhandled OID_TCP_OFFLOAD_CURRENT_CONFIG\n");
   1.375 -      break;
   1.376 -    case OID_GEN_MAXIMUM_SEND_PACKETS:
   1.377 -      /* this is actually ignored for deserialised drivers like us */
   1.378 -      temp_data = 0;
   1.379 -      break;
   1.380 -    case OID_GEN_HARDWARE_STATUS:
   1.381 -      if (!xi->connected)
   1.382 -      {
   1.383 -        temp_data = NdisHardwareStatusInitializing;
   1.384 -      }
   1.385 -      else
   1.386 -      {
   1.387 -        temp_data = NdisHardwareStatusReady;
   1.388 -      }
   1.389 -      break;
   1.390 -    case OID_GEN_TRANSMIT_BUFFER_SPACE:
   1.391 -      /* multiply this by some small number as we can queue additional packets */
   1.392 -      temp_data = PAGE_SIZE * NET_TX_RING_SIZE * 4;
   1.393 -      break;
   1.394 -    case OID_GEN_RECEIVE_BUFFER_SPACE:
   1.395 -      temp_data = PAGE_SIZE * NET_RX_RING_SIZE * 2;
   1.396 -      break;
   1.397 -    case OID_GEN_TRANSMIT_BLOCK_SIZE:
   1.398 -      temp_data = PAGE_SIZE; //XN_MAX_PKT_SIZE;
   1.399 -      break;
   1.400 -    case OID_GEN_RECEIVE_BLOCK_SIZE:
   1.401 -      temp_data = PAGE_SIZE; //XN_MAX_PKT_SIZE;
   1.402 -      break;
   1.403 -    default:
   1.404 -      FUNCTION_MSG("Unhandled get OID_%08x\n", Oid);
   1.405 -    /* silently fail these */
   1.406 -    case OID_GEN_SUPPORTED_GUIDS:
   1.407 -    case OID_IP4_OFFLOAD_STATS:
   1.408 -    case OID_IP6_OFFLOAD_STATS:
   1.409 -      status = NDIS_STATUS_NOT_SUPPORTED;
   1.410 -      break;
   1.411 -  }
   1.412 -
   1.413 -  if (!NT_SUCCESS(status))
   1.414 -  {
   1.415 -    //FUNCTION_EXIT_STATUS(status);
   1.416 -    return status;
   1.417 -  }
   1.418 -
   1.419 -  if (len > InformationBufferLength)
   1.420 -  {
   1.421 -    *BytesNeeded = len;
   1.422 -    FUNCTION_MSG("(BUFFER_TOO_SHORT OID_%08x len = %d > InformationBufferLength %d)\n", Oid, len, InformationBufferLength);
   1.423 -    return NDIS_STATUS_BUFFER_TOO_SHORT;
   1.424 -  }
   1.425 -
   1.426 -  *BytesWritten = len;
   1.427 -  if (len && used_temp_buffer)
   1.428 -  {
   1.429 -    NdisMoveMemory((PUCHAR)InformationBuffer, data, len);
   1.430 -  }
   1.431 -
   1.432 -  //KdPrint(("Got OID 0x%x\n", Oid));
   1.433 -//  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
   1.434 -
   1.435 -  return status;
   1.436 -}
   1.437 -
   1.438 -static NDIS_STATUS
   1.439 -XenNet_QueryStatistics(
   1.440 -  IN NDIS_HANDLE MiniportAdapterContext,
   1.441 -  IN NDIS_OID Oid,
   1.442 -  IN PVOID InformationBuffer,
   1.443 -  IN ULONG InformationBufferLength,
   1.444 -  OUT PUINT BytesWritten,
   1.445 -  OUT PUINT BytesNeeded)
   1.446 -{
   1.447 -  NDIS_STATUS status = NDIS_STATUS_SUCCESS;
   1.448 -  struct xennet_info *xi = MiniportAdapterContext;
   1.449 -  BOOLEAN used_temp_buffer = TRUE;
   1.450 -  UINT len = 4;
   1.451 -  ULONG64 temp_data;
   1.452 -  PVOID data = &temp_data;
   1.453 -  PNDIS_STATISTICS_INFO nsi;
   1.454 -  //PIP_OFFLOAD_STATS ios;
   1.455 -#if 0
   1.456 -  UCHAR vendor_desc[] = XN_VENDOR_DESC;
   1.457 -  PNDIS_TASK_OFFLOAD_HEADER ntoh;
   1.458 -  PNDIS_TASK_OFFLOAD nto;
   1.459 -  PNDIS_TASK_TCP_IP_CHECKSUM nttic;
   1.460 -  PNDIS_TASK_TCP_LARGE_SEND nttls;
   1.461 -  PNDIS_PNP_CAPABILITIES npc;
   1.462 -#endif
   1.463 -
   1.464 -  *BytesNeeded = 0;
   1.465 -  *BytesWritten = 0;
   1.466 -
   1.467 -// FUNCTION_ENTER()
   1.468 -
   1.469 -  switch(Oid)
   1.470 -  {
   1.471 -#if 0
   1.472 -    case OID_GEN_XMIT_ERROR:
   1.473 -      temp_data = xi->stat_tx_error;
   1.474 -      HANDLE_STAT_RETURN;
   1.475 -      break;
   1.476 -    case OID_GEN_RCV_ERROR:
   1.477 -      temp_data = xi->stat_rx_error;
   1.478 -      HANDLE_STAT_RETURN;
   1.479 -      break;
   1.480 -    case OID_GEN_RCV_NO_BUFFER:
   1.481 -      temp_data = xi->stat_rx_no_buffer;
   1.482 -      HANDLE_STAT_RETURN;
   1.483 -      break;
   1.484 -    case OID_802_3_PERMANENT_ADDRESS:
   1.485 -      data = xi->perm_mac_addr;
   1.486 -      len = ETH_ALEN;
   1.487 -      break;
   1.488 -    case OID_802_3_RCV_ERROR_ALIGNMENT:
   1.489 -    case OID_802_3_XMIT_ONE_COLLISION:
   1.490 -    case OID_802_3_XMIT_MORE_COLLISIONS:
   1.491 -      temp_data = 0;
   1.492 -      HANDLE_STAT_RETURN;
   1.493 -      break;
   1.494 -#endif
   1.495 -    case OID_GEN_STATISTICS:
   1.496 -      SET_LEN_AND_BREAK_IF_SHORT(sizeof(NDIS_STATISTICS_INFO));
   1.497 -      nsi = (PNDIS_STATISTICS_INFO)InformationBuffer;
   1.498 -      nsi->Header.Type = NDIS_OBJECT_TYPE_DEFAULT;
   1.499 -      nsi->Header.Revision = NDIS_STATISTICS_INFO_REVISION_1;
   1.500 -      nsi->Header.Size = NDIS_SIZEOF_STATISTICS_INFO_REVISION_1;
   1.501 -      nsi->SupportedStatistics = 0;
   1.502 -      break;    
   1.503 -    case OID_GEN_XMIT_OK:
   1.504 -      temp_data = xi->stat_tx_ok;
   1.505 -      HANDLE_STAT_RETURN;
   1.506 -      break;
   1.507 -    case OID_GEN_RCV_OK:
   1.508 -      temp_data = xi->stat_rx_ok;
   1.509 -      HANDLE_STAT_RETURN;
   1.510 -      break;
   1.511 -#if 0
   1.512 -    case OID_IP4_OFFLOAD_STATS:
   1.513 -#if 0
   1.514 -      SET_LEN_AND_BREAK_IF_SHORT(sizeof(IP_OFFLOAD_STATS));
   1.515 -      ios = (PIP_OFFLOAD_STATS)InformationBuffer;
   1.516 -      ios->InReceives = 0;
   1.517 -      ios->InOctets = 0;
   1.518 -      ios->InDelivers = 0;
   1.519 -      ios->OutRequests = 0;
   1.520 -      ios->OutOctets = 0;
   1.521 -      ios->InHeaderErrors = 0;
   1.522 -      ios->InTruncatedPackets = 0;
   1.523 -      ios->InDiscards = 0;
   1.524 -      ios->OutDiscards= 0;
   1.525 -      ios->OutNoRoutes = 0;
   1.526 -#endif
   1.527 -      status = NDIS_STATUS_NOT_SUPPORTED;
   1.528 -      break;
   1.529 -    case OID_IP6_OFFLOAD_STATS:
   1.530 -#if 0
   1.531 -      SET_LEN_AND_BREAK_IF_SHORT(sizeof(IP_OFFLOAD_STATS));
   1.532 -      ios = (PIP_OFFLOAD_STATS)InformationBuffer;
   1.533 -      ios->InReceives = 0;
   1.534 -      ios->InOctets = 0;
   1.535 -      ios->InDelivers = 0;
   1.536 -      ios->OutRequests = 0;
   1.537 -      ios->OutOctets = 0;
   1.538 -      ios->InHeaderErrors = 0;
   1.539 -      ios->InTruncatedPackets = 0;
   1.540 -      ios->InDiscards = 0;
   1.541 -      ios->OutDiscards= 0;
   1.542 -      ios->OutNoRoutes = 0;
   1.543 -#endif
   1.544 -      status = NDIS_STATUS_NOT_SUPPORTED;
   1.545 -      break;
   1.546 -#endif
   1.547 -    case OID_TCP_CONNECTION_OFFLOAD_HARDWARE_CAPABILITIES:
   1.548 -      FUNCTION_MSG("Unhandled statistic OID_TCP_CONNECTION_OFFLOAD_HARDWARE_CAPABILITIES\n");
   1.549 -      break;
   1.550 -    case OID_TCP_CONNECTION_OFFLOAD_CURRENT_CONFIG:
   1.551 -      FUNCTION_MSG("Unhandled statistic OID_TCP_CONNECTION_OFFLOAD_HARDWARE_CAPABILITIES\n");
   1.552 -      break;
   1.553 -    case OID_TCP_OFFLOAD_CURRENT_CONFIG:
   1.554 -      FUNCTION_MSG("Unhandled statistic OID_TCP_OFFLOAD_CURRENT_CONFIG\n");
   1.555 -      break;
   1.556 -    default:
   1.557 -      KdPrint(("Unhandled statistics OID_%08x\n", Oid));
   1.558 -      status = NDIS_STATUS_NOT_SUPPORTED;
   1.559 -      break;
   1.560 -  }
   1.561 -
   1.562 -  if (!NT_SUCCESS(status))
   1.563 -  {
   1.564 -    //FUNCTION_EXIT_STATUS(status);
   1.565 -    return status;
   1.566 -  }
   1.567 -
   1.568 -  if (len > InformationBufferLength)
   1.569 -  {
   1.570 -    *BytesNeeded = len;
   1.571 -    FUNCTION_MSG("(BUFFER_TOO_SHORT %d > %d)\n", len, InformationBufferLength);
   1.572 -    return NDIS_STATUS_BUFFER_TOO_SHORT;
   1.573 -  }
   1.574 -
   1.575 -  *BytesWritten = len;
   1.576 -  if (len && used_temp_buffer)
   1.577 -  {
   1.578 -    NdisMoveMemory((PUCHAR)InformationBuffer, data, len);
   1.579 -  }
   1.580 -
   1.581 -  //KdPrint(("Got OID 0x%x\n", Oid));
   1.582 -//  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
   1.583 -
   1.584 -  return status;
   1.585 -}
   1.586 -
   1.587 -static NDIS_STATUS
   1.588 -XenNet_SetInformation(
   1.589 -  IN NDIS_HANDLE adapter_context,
   1.590 -  IN NDIS_OID Oid,
   1.591 -  IN PVOID InformationBuffer,
   1.592 -  IN ULONG InformationBufferLength,
   1.593 -  OUT PUINT BytesRead,
   1.594 -  OUT PUINT BytesNeeded
   1.595 -  )
   1.596 -{
   1.597 -  NTSTATUS status;
   1.598 -  struct xennet_info *xi = adapter_context;
   1.599 -  PULONG64 data = InformationBuffer;
   1.600 -  ULONG i;
   1.601 -  UCHAR *multicast_list;
   1.602 -  PNDIS_OFFLOAD_ENCAPSULATION noe;
   1.603 -#if 0
   1.604 -  PNDIS_TASK_OFFLOAD_HEADER ntoh;
   1.605 -  PNDIS_TASK_OFFLOAD nto;
   1.606 -  PNDIS_TASK_TCP_IP_CHECKSUM nttic = NULL;
   1.607 -  PNDIS_TASK_TCP_LARGE_SEND nttls = NULL;
   1.608 -  int offset;
   1.609 -#endif
   1.610 -  //KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
   1.611 -
   1.612 -  UNREFERENCED_PARAMETER(BytesRead);
   1.613 -  UNREFERENCED_PARAMETER(BytesNeeded);
   1.614 -  switch(Oid)
   1.615 -  {
   1.616 -#if 0
   1.617 -    case OID_GEN_SUPPORTED_LIST:
   1.618 -      status = NDIS_STATUS_NOT_SUPPORTED;
   1.619 -      KdPrint(("Unsupported set OID_GEN_SUPPORTED_LIST\n"));
   1.620 -      break;
   1.621 -    case OID_GEN_HARDWARE_STATUS:
   1.622 -      status = NDIS_STATUS_NOT_SUPPORTED;
   1.623 -      KdPrint(("Unsupported set OID_GEN_HARDWARE_STATUS\n"));
   1.624 -      break;
   1.625 -    case OID_GEN_MEDIA_SUPPORTED:
   1.626 -      status = NDIS_STATUS_NOT_SUPPORTED;
   1.627 -      KdPrint(("Unsupported set OID_GEN_MEDIA_SUPPORTED\n"));
   1.628 -      break;
   1.629 -    case OID_GEN_MEDIA_IN_USE:
   1.630 -      status = NDIS_STATUS_NOT_SUPPORTED;
   1.631 -      KdPrint(("Unsupported set OID_GEN_MEDIA_IN_USE\n"));
   1.632 -      break;
   1.633 -    case OID_GEN_MAXIMUM_LOOKAHEAD:
   1.634 -      status = NDIS_STATUS_NOT_SUPPORTED;
   1.635 -      KdPrint(("Unsupported set OID_GEN_MAXIMUM_LOOKAHEAD\n"));
   1.636 -      break;
   1.637 -    case OID_GEN_MAXIMUM_FRAME_SIZE:
   1.638 -      status = NDIS_STATUS_NOT_SUPPORTED;
   1.639 -      KdPrint(("Unsupported set OID_GEN_MAXIMUM_FRAME_SIZE\n"));
   1.640 -      break;
   1.641 -    case OID_GEN_LINK_SPEED:
   1.642 -      status = NDIS_STATUS_NOT_SUPPORTED;
   1.643 -      KdPrint(("Unsupported set OID_GEN_LINK_SPEED\n"));
   1.644 -      break;
   1.645 -    case OID_GEN_TRANSMIT_BUFFER_SPACE:
   1.646 -      status = NDIS_STATUS_NOT_SUPPORTED;
   1.647 -      KdPrint(("Unsupported set OID_GEN_TRANSMIT_BUFFER_SPACE\n"));
   1.648 -      break;
   1.649 -    case OID_GEN_RECEIVE_BUFFER_SPACE:
   1.650 -      status = NDIS_STATUS_NOT_SUPPORTED;
   1.651 -      KdPrint(("Unsupported set OID_GEN_RECEIVE_BUFFER_SPACE\n"));
   1.652 -      break;
   1.653 -    case OID_GEN_TRANSMIT_BLOCK_SIZE:
   1.654 -      status = NDIS_STATUS_NOT_SUPPORTED;
   1.655 -      KdPrint(("Unsupported set OID_GEN_TRANSMIT_BLOCK_SIZE\n"));
   1.656 -      break;
   1.657 -    case OID_GEN_RECEIVE_BLOCK_SIZE:
   1.658 -      status = NDIS_STATUS_NOT_SUPPORTED;
   1.659 -      KdPrint(("Unsupported set OID_GEN_RECEIVE_BLOCK_SIZE\n"));
   1.660 -      break;
   1.661 -    case OID_GEN_VENDOR_ID:
   1.662 -      status = NDIS_STATUS_NOT_SUPPORTED;
   1.663 -      KdPrint(("Unsupported set OID_GEN_VENDOR_ID\n"));
   1.664 -      break;
   1.665 -    case OID_GEN_VENDOR_DESCRIPTION:
   1.666 -      status = NDIS_STATUS_NOT_SUPPORTED;
   1.667 -      KdPrint(("Unsupported set OID_GEN_VENDOR_DESCRIPTION\n"));
   1.668 -      break;
   1.669 -    case OID_GEN_DRIVER_VERSION:
   1.670 -      status = NDIS_STATUS_NOT_SUPPORTED;
   1.671 -      KdPrint(("Unsupported set OID_GEN_DRIVER_VERSION\n"));
   1.672 -      break;
   1.673 -    case OID_GEN_MAXIMUM_TOTAL_SIZE:
   1.674 -      status = NDIS_STATUS_NOT_SUPPORTED;
   1.675 -      KdPrint(("Unsupported set OID_GEN_MAXIMUM_TOTAL_SIZE\n"));
   1.676 -      break;
   1.677 -    case OID_GEN_PROTOCOL_OPTIONS:
   1.678 -      KdPrint(("Unsupported set OID_GEN_PROTOCOL_OPTIONS\n"));
   1.679 -      // TODO - actually do this...
   1.680 -      status = NDIS_STATUS_SUCCESS;
   1.681 -      break;
   1.682 -    case OID_GEN_MAC_OPTIONS:
   1.683 -      status = NDIS_STATUS_NOT_SUPPORTED;
   1.684 -      KdPrint(("Unsupported set OID_GEN_MAC_OPTIONS\n"));
   1.685 -      break;
   1.686 -    case OID_GEN_MEDIA_CONNECT_STATUS:
   1.687 -      status = NDIS_STATUS_NOT_SUPPORTED;
   1.688 -      KdPrint(("Unsupported set OID_GEN_MEDIA_CONNECT_STATUS\n"));
   1.689 -      break;
   1.690 -    case OID_GEN_MAXIMUM_SEND_PACKETS:
   1.691 -      status = NDIS_STATUS_NOT_SUPPORTED;
   1.692 -      KdPrint(("Unsupported set OID_GEN_MAXIMUM_SEND_PACKETS\n"));
   1.693 -      break;
   1.694 -    case OID_GEN_XMIT_OK:
   1.695 -      status = NDIS_STATUS_NOT_SUPPORTED;
   1.696 -      KdPrint(("Unsupported set OID_GEN_XMIT_OK\n"));
   1.697 -      break;
   1.698 -    case OID_GEN_RCV_OK:
   1.699 -      status = NDIS_STATUS_NOT_SUPPORTED;
   1.700 -      KdPrint(("Unsupported set OID_GEN_RCV_OK\n"));
   1.701 -      break;
   1.702 -    case OID_GEN_XMIT_ERROR:
   1.703 -      status = NDIS_STATUS_NOT_SUPPORTED;
   1.704 -      KdPrint(("Unsupported set OID_GEN_XMIT_ERROR\n"));
   1.705 -      break;
   1.706 -    case OID_GEN_RCV_ERROR:
   1.707 -      status = NDIS_STATUS_NOT_SUPPORTED;
   1.708 -      KdPrint(("Unsupported set OID_GEN_RCV_ERROR\n"));
   1.709 -      break;
   1.710 -    case OID_GEN_RCV_NO_BUFFER:
   1.711 -      status = NDIS_STATUS_NOT_SUPPORTED;
   1.712 -      KdPrint(("Unsupported set OID_GEN_RCV_NO_BUFFER\n"));
   1.713 -      break;
   1.714 -    case OID_802_3_CURRENT_ADDRESS:
   1.715 -      status = NDIS_STATUS_NOT_SUPPORTED;
   1.716 -      KdPrint(("Unsupported set OID_802_3_CURRENT_ADDRESS\n"));
   1.717 -      break;
   1.718 -    case OID_802_3_MULTICAST_LIST:
   1.719 -      KdPrint(("     Set OID_802_3_MULTICAST_LIST\n"));
   1.720 -      KdPrint(("       Length = %d\n", InformationBufferLength));
   1.721 -      KdPrint(("       Entries = %d\n", InformationBufferLength / 6));
   1.722 -      if (InformationBufferLength > MULTICAST_LIST_MAX_SIZE * 6)
   1.723 -      {
   1.724 -        status = NDIS_STATUS_MULTICAST_FULL;
   1.725 -        break;
   1.726 -      }
   1.727 -      
   1.728 -      if (InformationBufferLength % 6 != 0)
   1.729 -      {
   1.730 -        status = NDIS_STATUS_MULTICAST_FULL;
   1.731 -        break;
   1.732 -      }
   1.733 -      multicast_list = InformationBuffer;
   1.734 -      for (i = 0; i < InformationBufferLength / 6; i++)
   1.735 -      {
   1.736 -        if (!(multicast_list[i * 6 + 0] & 0x01))
   1.737 -        {
   1.738 -          KdPrint(("       Address %d (%02x:%02x:%02x:%02x:%02x:%02x) is not a multicast address\n", i,
   1.739 -            (ULONG)multicast_list[i * 6 + 0], (ULONG)multicast_list[i * 6 + 1], 
   1.740 -            (ULONG)multicast_list[i * 6 + 2], (ULONG)multicast_list[i * 6 + 3], 
   1.741 -            (ULONG)multicast_list[i * 6 + 4], (ULONG)multicast_list[i * 6 + 5]));
   1.742 -          /* the docs say that we should return NDIS_STATUS_MULTICAST_FULL if we get an invalid multicast address but I'm not sure if that's the case... */
   1.743 -        }
   1.744 -      }
   1.745 -      memcpy(xi->multicast_list, InformationBuffer, InformationBufferLength);
   1.746 -      xi->multicast_list_size = InformationBufferLength / 6;
   1.747 -      status = NDIS_STATUS_SUCCESS;
   1.748 -      break;
   1.749 -    case OID_802_3_MAXIMUM_LIST_SIZE:
   1.750 -      status = NDIS_STATUS_NOT_SUPPORTED;
   1.751 -      KdPrint(("Unsupported set OID_802_3_MAXIMUM_LIST_SIZE\n"));
   1.752 -      break;
   1.753 -    case OID_TCP_TASK_OFFLOAD:
   1.754 -      status = NDIS_STATUS_SUCCESS;
   1.755 -      KdPrint(("Set OID_TCP_TASK_OFFLOAD\n"));
   1.756 -      // we should disable everything here, then enable what has been set
   1.757 -      ntoh = (PNDIS_TASK_OFFLOAD_HEADER)InformationBuffer;
   1.758 -      if (ntoh->Version != NDIS_TASK_OFFLOAD_VERSION)
   1.759 -      {
   1.760 -        KdPrint(("Invalid version (%d passed but must be %d)\n", ntoh->Version, NDIS_TASK_OFFLOAD_VERSION));
   1.761 -        status = NDIS_STATUS_INVALID_DATA;
   1.762 -        break;
   1.763 -      }
   1.764 -      if (ntoh->Version != NDIS_TASK_OFFLOAD_VERSION || ntoh->Size != sizeof(NDIS_TASK_OFFLOAD_HEADER))
   1.765 -      {
   1.766 -        KdPrint(("Invalid size (%d passed but must be %d)\n", ntoh->Size, sizeof(NDIS_TASK_OFFLOAD_HEADER)));
   1.767 -        status = NDIS_STATUS_INVALID_DATA;
   1.768 -        break;
   1.769 -      }
   1.770 -      *BytesRead = sizeof(NDIS_TASK_OFFLOAD_HEADER);
   1.771 -      offset = ntoh->OffsetFirstTask;
   1.772 -      nto = (PNDIS_TASK_OFFLOAD)ntoh; // not really, just to get the first offset right
   1.773 -      while (offset != 0)
   1.774 -      {
   1.775 -        *BytesRead += FIELD_OFFSET(NDIS_TASK_OFFLOAD, TaskBuffer);
   1.776 -        nto = (PNDIS_TASK_OFFLOAD)(((PUCHAR)nto) + offset);
   1.777 -        switch (nto->Task)
   1.778 -        {
   1.779 -        case TcpIpChecksumNdisTask:
   1.780 -          *BytesRead += sizeof(NDIS_TASK_TCP_IP_CHECKSUM);
   1.781 -          nttic = (PNDIS_TASK_TCP_IP_CHECKSUM)nto->TaskBuffer;
   1.782 -          KdPrint(("TcpIpChecksumNdisTask\n"));
   1.783 -          KdPrint(("  V4Transmit.IpOptionsSupported  = %d\n", nttic->V4Transmit.IpOptionsSupported));
   1.784 -          KdPrint(("  V4Transmit.TcpOptionsSupported = %d\n", nttic->V4Transmit.TcpOptionsSupported));
   1.785 -          KdPrint(("  V4Transmit.TcpChecksum         = %d\n", nttic->V4Transmit.TcpChecksum));
   1.786 -          KdPrint(("  V4Transmit.UdpChecksum         = %d\n", nttic->V4Transmit.UdpChecksum));
   1.787 -          KdPrint(("  V4Transmit.IpChecksum          = %d\n", nttic->V4Transmit.IpChecksum));
   1.788 -          KdPrint(("  V4Receive.IpOptionsSupported   = %d\n", nttic->V4Receive.IpOptionsSupported));
   1.789 -          KdPrint(("  V4Receive.TcpOptionsSupported  = %d\n", nttic->V4Receive.TcpOptionsSupported));
   1.790 -          KdPrint(("  V4Receive.TcpChecksum          = %d\n", nttic->V4Receive.TcpChecksum));
   1.791 -          KdPrint(("  V4Receive.UdpChecksum          = %d\n", nttic->V4Receive.UdpChecksum));
   1.792 -          KdPrint(("  V4Receive.IpChecksum           = %d\n", nttic->V4Receive.IpChecksum));
   1.793 -          KdPrint(("  V6Transmit.IpOptionsSupported  = %d\n", nttic->V6Transmit.IpOptionsSupported));
   1.794 -          KdPrint(("  V6Transmit.TcpOptionsSupported = %d\n", nttic->V6Transmit.TcpOptionsSupported));
   1.795 -          KdPrint(("  V6Transmit.TcpChecksum         = %d\n", nttic->V6Transmit.TcpChecksum));
   1.796 -          KdPrint(("  V6Transmit.UdpChecksum         = %d\n", nttic->V6Transmit.UdpChecksum));
   1.797 -          KdPrint(("  V6Receive.IpOptionsSupported   = %d\n", nttic->V6Receive.IpOptionsSupported));
   1.798 -          KdPrint(("  V6Receive.TcpOptionsSupported  = %d\n", nttic->V6Receive.TcpOptionsSupported));
   1.799 -          KdPrint(("  V6Receive.TcpChecksum          = %d\n", nttic->V6Receive.TcpChecksum));
   1.800 -          KdPrint(("  V6Receive.UdpChecksum          = %d\n", nttic->V6Receive.UdpChecksum));
   1.801 -          /* check for stuff we outright don't support */
   1.802 -          if (nttic->V6Transmit.IpOptionsSupported ||
   1.803 -            nttic->V6Transmit.TcpOptionsSupported ||
   1.804 -            nttic->V6Transmit.TcpChecksum ||
   1.805 -            nttic->V6Transmit.UdpChecksum ||
   1.806 -            nttic->V6Receive.IpOptionsSupported ||
   1.807 -            nttic->V6Receive.TcpOptionsSupported ||
   1.808 -            nttic->V6Receive.TcpChecksum ||
   1.809 -            nttic->V6Receive.UdpChecksum)
   1.810 -          {
   1.811 -            KdPrint(("IPv6 offload not supported\n"));
   1.812 -            status = NDIS_STATUS_INVALID_DATA;
   1.813 -            nttic = NULL;
   1.814 -            break;
   1.815 -          }
   1.816 -          if (nttic->V4Transmit.IpOptionsSupported ||
   1.817 -            nttic->V4Transmit.IpChecksum)
   1.818 -          {
   1.819 -            KdPrint(("IPv4 IP Transmit offload not supported\n"));
   1.820 -            status = NDIS_STATUS_INVALID_DATA;
   1.821 -            nttic = NULL;
   1.822 -            break;
   1.823 -          }
   1.824 -          if (nttic->V4Receive.IpOptionsSupported &&
   1.825 -            !nttic->V4Receive.IpChecksum)
   1.826 -          {
   1.827 -            KdPrint(("Invalid combination\n"));
   1.828 -            status = NDIS_STATUS_INVALID_DATA;
   1.829 -            nttic = NULL;
   1.830 -            break;
   1.831 -          }
   1.832 -          if (nttic->V4Transmit.TcpOptionsSupported &&
   1.833 -            !nttic->V4Transmit.TcpChecksum)
   1.834 -          {
   1.835 -            KdPrint(("Invalid combination\n"));
   1.836 -            status = NDIS_STATUS_INVALID_DATA;
   1.837 -            nttic = NULL;
   1.838 -            break;
   1.839 -          }
   1.840 -          if (nttic->V4Receive.TcpOptionsSupported &&
   1.841 -            !nttic->V4Receive.TcpChecksum)
   1.842 -          {
   1.843 -            KdPrint(("Invalid combination\n"));
   1.844 -            status = NDIS_STATUS_INVALID_DATA;
   1.845 -            nttic = NULL;
   1.846 -            break;
   1.847 -          }
   1.848 -          break;
   1.849 -        case TcpLargeSendNdisTask:
   1.850 -          *BytesRead += sizeof(NDIS_TASK_TCP_LARGE_SEND);
   1.851 -          KdPrint(("TcpLargeSendNdisTask\n"));
   1.852 -          nttls = (PNDIS_TASK_TCP_LARGE_SEND)nto->TaskBuffer;
   1.853 -          KdPrint(("  MaxOffLoadSize                 = %d\n", nttls->MaxOffLoadSize));
   1.854 -          KdPrint(("  MinSegmentCount                = %d\n", nttls->MinSegmentCount));
   1.855 -          KdPrint(("  TcpOptions                     = %d\n", nttls->TcpOptions));
   1.856 -          KdPrint(("  IpOptions                      = %d\n", nttls->IpOptions));
   1.857 -          if (nttls->MinSegmentCount != MIN_LARGE_SEND_SEGMENTS)
   1.858 -          {
   1.859 -            KdPrint(("     MinSegmentCount should be %d\n", MIN_LARGE_SEND_SEGMENTS));
   1.860 -            status = NDIS_STATUS_INVALID_DATA;
   1.861 -            nttls = NULL;
   1.862 -            break;
   1.863 -          }
   1.864 -          if (nttls->IpOptions)
   1.865 -          {
   1.866 -            KdPrint(("     IpOptions not supported\n"));
   1.867 -            status = NDIS_STATUS_INVALID_DATA;
   1.868 -            nttls = NULL;
   1.869 -            break;
   1.870 -          }
   1.871 -          if (nttls->TcpOptions)
   1.872 -          {
   1.873 -            KdPrint(("     TcpOptions not supported\n"));
   1.874 -            status = NDIS_STATUS_INVALID_DATA;
   1.875 -            nttls = NULL;
   1.876 -            break;
   1.877 -          }
   1.878 -          break;
   1.879 -        default:
   1.880 -          KdPrint(("     Unknown Task %d\n", nto->Task));
   1.881 -        }
   1.882 -        offset = nto->OffsetNextTask;
   1.883 -      }
   1.884 -      if (nttic != NULL)
   1.885 -        xi->setting_csum = *nttic;
   1.886 -      else
   1.887 -      {
   1.888 -        RtlZeroMemory(&xi->setting_csum, sizeof(NDIS_TASK_TCP_IP_CHECKSUM));
   1.889 -        KdPrint(("     csum offload disabled\n", nto->Task));
   1.890 -      }        
   1.891 -      if (nttls != NULL)
   1.892 -        xi->setting_max_offload = nttls->MaxOffLoadSize;
   1.893 -      else
   1.894 -      {
   1.895 -        xi->setting_max_offload = 0;
   1.896 -        KdPrint(("     LSO disabled\n", nto->Task));
   1.897 -      }
   1.898 -      break;
   1.899 -    case OID_PNP_SET_POWER:
   1.900 -      KdPrint(("     Set OID_PNP_SET_POWER\n"));
   1.901 -      xi->new_power_state = *(PNDIS_DEVICE_POWER_STATE)InformationBuffer;
   1.902 -      IoQueueWorkItem(xi->power_workitem, XenNet_SetPower, DelayedWorkQueue, xi);
   1.903 -      status = NDIS_STATUS_PENDING;
   1.904 -      break;
   1.905 -#endif
   1.906 -    case OID_GEN_CURRENT_PACKET_FILTER:
   1.907 -      KdPrint(("Set OID_GEN_CURRENT_PACKET_FILTER (xi = %p)\n", xi));
   1.908 -      if (*(ULONG *)data & NDIS_PACKET_TYPE_DIRECTED)
   1.909 -        KdPrint(("  NDIS_PACKET_TYPE_DIRECTED\n"));
   1.910 -      if (*(ULONG *)data & NDIS_PACKET_TYPE_MULTICAST)
   1.911 -        KdPrint(("  NDIS_PACKET_TYPE_MULTICAST\n"));
   1.912 -      if (*(ULONG *)data & NDIS_PACKET_TYPE_ALL_MULTICAST)
   1.913 -        KdPrint(("  NDIS_PACKET_TYPE_ALL_MULTICAST\n"));
   1.914 -      if (*(ULONG *)data & NDIS_PACKET_TYPE_BROADCAST)
   1.915 -        KdPrint(("  NDIS_PACKET_TYPE_BROADCAST\n"));
   1.916 -      if (*(ULONG *)data & NDIS_PACKET_TYPE_PROMISCUOUS)
   1.917 -        KdPrint(("  NDIS_PACKET_TYPE_PROMISCUOUS\n"));
   1.918 -      if (*(ULONG *)data & NDIS_PACKET_TYPE_ALL_FUNCTIONAL)
   1.919 -        KdPrint(("  NDIS_PACKET_TYPE_ALL_FUNCTIONAL (not supported)\n"));
   1.920 -      if (*(ULONG *)data & NDIS_PACKET_TYPE_ALL_LOCAL)
   1.921 -        KdPrint(("  NDIS_PACKET_TYPE_ALL_LOCAL (not supported)\n"));  
   1.922 -      if (*(ULONG *)data & NDIS_PACKET_TYPE_FUNCTIONAL)
   1.923 -        KdPrint(("  NDIS_PACKET_TYPE_FUNCTIONAL (not supported)\n"));
   1.924 -      if (*(ULONG *)data & NDIS_PACKET_TYPE_GROUP)
   1.925 -        KdPrint(("  NDIS_PACKET_TYPE_GROUP (not supported)\n"));
   1.926 -      if (*(ULONG *)data & ~SUPPORTED_PACKET_FILTERS)
   1.927 -      {
   1.928 -        status = NDIS_STATUS_NOT_SUPPORTED;
   1.929 -        KdPrint(("  returning NDIS_STATUS_NOT_SUPPORTED\n"));
   1.930 -        break;
   1.931 -      }
   1.932 -      xi->packet_filter = *(ULONG *)data;
   1.933 -      status = NDIS_STATUS_SUCCESS;
   1.934 -      break;
   1.935 -    case OID_802_3_MULTICAST_LIST:
   1.936 -      KdPrint(("     Set OID_802_3_MULTICAST_LIST\n"));
   1.937 -      KdPrint(("       Length = %d\n", InformationBufferLength));
   1.938 -      KdPrint(("       Entries = %d\n", InformationBufferLength / 6));
   1.939 -      if (InformationBufferLength > MULTICAST_LIST_MAX_SIZE * 6)
   1.940 -      {
   1.941 -        status = NDIS_STATUS_MULTICAST_FULL;
   1.942 -        break;
   1.943 -      }
   1.944 -      
   1.945 -      if (InformationBufferLength % 6 != 0)
   1.946 -      {
   1.947 -        status = NDIS_STATUS_MULTICAST_FULL;
   1.948 -        break;
   1.949 -      }
   1.950 -      multicast_list = InformationBuffer;
   1.951 -      for (i = 0; i < InformationBufferLength / 6; i++)
   1.952 -      {
   1.953 -        if (!(multicast_list[i * 6 + 0] & 0x01))
   1.954 -        {
   1.955 -          KdPrint(("       Address %d (%02x:%02x:%02x:%02x:%02x:%02x) is not a multicast address\n", i,
   1.956 -            (ULONG)multicast_list[i * 6 + 0], (ULONG)multicast_list[i * 6 + 1], 
   1.957 -            (ULONG)multicast_list[i * 6 + 2], (ULONG)multicast_list[i * 6 + 3], 
   1.958 -            (ULONG)multicast_list[i * 6 + 4], (ULONG)multicast_list[i * 6 + 5]));
   1.959 -          /* the docs say that we should return NDIS_STATUS_MULTICAST_FULL if we get an invalid multicast address but I'm not sure if that's the case... */
   1.960 -        }
   1.961 -      }
   1.962 -      memcpy(xi->multicast_list, InformationBuffer, InformationBufferLength);
   1.963 -      xi->multicast_list_size = InformationBufferLength / 6;
   1.964 -      status = NDIS_STATUS_SUCCESS;
   1.965 -      break;
   1.966 -    case OID_GEN_CURRENT_LOOKAHEAD:
   1.967 -      xi->current_lookahead = *(ULONG *)data;
   1.968 -      FUNCTION_MSG("Set OID_GEN_CURRENT_LOOKAHEAD %d (%p)\n", xi->current_lookahead, xi);
   1.969 -      status = NDIS_STATUS_SUCCESS;
   1.970 -      break;
   1.971 -    case OID_OFFLOAD_ENCAPSULATION:
   1.972 -      /* mostly assume that NDIS vets the settings for us */
   1.973 -      noe = (PNDIS_OFFLOAD_ENCAPSULATION)InformationBuffer;
   1.974 -      FUNCTION_MSG("Set OID_OFFLOAD_ENCAPSULATION\n");
   1.975 -      if (noe->IPv4.EncapsulationType != NDIS_ENCAPSULATION_IEEE_802_3)
   1.976 -      {
   1.977 -        status = NDIS_STATUS_NOT_SUPPORTED;
   1.978 -        FUNCTION_MSG("Unknown Encapsulation Type %d\n", noe->IPv4.EncapsulationType);
   1.979 -        break;
   1.980 -      }
   1.981 -        
   1.982 -      switch(noe->IPv4.Enabled)
   1.983 -      {
   1.984 -      case NDIS_OFFLOAD_SET_ON:
   1.985 -        FUNCTION_MSG(" IPv4.Enabled = NDIS_OFFLOAD_SET_ON\n");
   1.986 -        xi->current_csum_supported = xi->backend_csum_supported && xi->frontend_csum_supported;
   1.987 -        xi->current_gso_value = min(xi->backend_csum_supported, xi->frontend_csum_supported);
   1.988 -        break;
   1.989 -      case NDIS_OFFLOAD_SET_OFF:
   1.990 -        FUNCTION_MSG(" IPv4.Enabled = NDIS_OFFLOAD_SET_OFF\n");
   1.991 -        xi->current_csum_supported = FALSE;
   1.992 -        xi->current_gso_value = 0;
   1.993 -        break;
   1.994 -      case NDIS_OFFLOAD_SET_NO_CHANGE:
   1.995 -        FUNCTION_MSG(" IPv4.Enabled = NDIS_OFFLOAD_NO_CHANGE\n");
   1.996 -        break;
   1.997 -      }
   1.998 -      FUNCTION_MSG(" IPv4.HeaderSize = %d\n", noe->IPv4.HeaderSize);
   1.999 -      FUNCTION_MSG(" IPv6.EncapsulationType = %d\n", noe->IPv6.EncapsulationType);
  1.1000 -      switch(noe->IPv6.Enabled)
  1.1001 -      {
  1.1002 -      case NDIS_OFFLOAD_SET_ON:
  1.1003 -        FUNCTION_MSG(" IPv6.Enabled = NDIS_OFFLOAD_SET_ON (this is an error)\n");
  1.1004 -        break;
  1.1005 -      case NDIS_OFFLOAD_SET_OFF:
  1.1006 -        FUNCTION_MSG(" IPv6.Enabled = NDIS_OFFLOAD_SET_OFF\n");
  1.1007 -        break;
  1.1008 -      case NDIS_OFFLOAD_SET_NO_CHANGE:
  1.1009 -        FUNCTION_MSG(" IPv6.Enabled = NDIS_OFFLOAD_NO_CHANGE\n");
  1.1010 -        break;
  1.1011 -      }
  1.1012 -      FUNCTION_MSG(" IPv6.HeaderSize = %d\n", noe->IPv6.HeaderSize);
  1.1013 -      status = NDIS_STATUS_SUCCESS;
  1.1014 -      break;
  1.1015 -    default:
  1.1016 -      FUNCTION_MSG("Unhandled set OID_%08x\n", Oid);
  1.1017 -    case OID_GEN_NETWORK_LAYER_ADDRESSES: /* this could tell us what IP addresses there are for us to send arps after a suspend/resume */
  1.1018 -    case OID_GEN_MACHINE_NAME:
  1.1019 -      status = NDIS_STATUS_NOT_SUPPORTED;
  1.1020 -      break;
  1.1021 -  }
  1.1022 -  //KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
  1.1023 -  return status;
  1.1024 -}
  1.1025 -#endif
  1.1026 +//static NDIS_OID supported_oids[ARRAY_SIZE(xennet_oids)];
  1.1027  
  1.1028  NDIS_STATUS
  1.1029  XenNet_OidRequest(NDIS_HANDLE adapter_context, PNDIS_OID_REQUEST oid_request)
  1.1030 @@ -1378,20 +417,19 @@ XenNet_OidRequest(NDIS_HANDLE adapter_co
  1.1031    switch(oid_request->RequestType)
  1.1032    {
  1.1033    case NdisRequestQueryInformation:
  1.1034 -    FUNCTION_MSG("RequestType = NdisRequestQueryInformation\n");
  1.1035 -    //FUNCTION_MSG("Oid = %08x\n", oid_request->DATA.QUERY_INFORMATION.Oid);
  1.1036 +    //FUNCTION_MSG("RequestType = NdisRequestQueryInformation\n");
  1.1037      oid = oid_request->DATA.QUERY_INFORMATION.Oid;
  1.1038      break;
  1.1039    case NdisRequestSetInformation:
  1.1040 -    FUNCTION_MSG("RequestType = NdisRequestSetInformation\n");
  1.1041 +    //FUNCTION_MSG("RequestType = NdisRequestSetInformation\n");
  1.1042      oid = oid_request->DATA.SET_INFORMATION.Oid;
  1.1043      break;
  1.1044    case NdisRequestQueryStatistics:
  1.1045 -    FUNCTION_MSG("RequestType = NdisRequestQueryStatistics\n");
  1.1046 +    //FUNCTION_MSG("RequestType = NdisRequestQueryStatistics\n");
  1.1047      oid = oid_request->DATA.QUERY_INFORMATION.Oid;
  1.1048      break;
  1.1049    default:
  1.1050 -    FUNCTION_MSG("RequestType = NdisRequestQuery%d\n", oid_request->RequestType);
  1.1051 +    //FUNCTION_MSG("RequestType = NdisRequestQuery%d\n", oid_request->RequestType);
  1.1052      return NDIS_STATUS_NOT_SUPPORTED;
  1.1053    }
  1.1054    for (i = 0; xennet_oids[i].oid && xennet_oids[i].oid != oid; i++);
  1.1055 @@ -1401,7 +439,7 @@ XenNet_OidRequest(NDIS_HANDLE adapter_co
  1.1056      FUNCTION_MSG("Unsupported OID %08x\n", oid);
  1.1057      return NDIS_STATUS_NOT_SUPPORTED;
  1.1058    }
  1.1059 -  FUNCTION_MSG("Oid = %s\n", xennet_oids[i].oid_name);
  1.1060 +  //FUNCTION_MSG("Oid = %s\n", xennet_oids[i].oid_name);
  1.1061    routine = NULL;
  1.1062    switch(oid_request->RequestType)
  1.1063    {
  1.1064 @@ -1427,11 +465,11 @@ XenNet_OidRequest(NDIS_HANDLE adapter_co
  1.1065    }
  1.1066    if (!routine)
  1.1067    {
  1.1068 -    FUNCTION_MSG("Operation not supported\n");
  1.1069 +    //FUNCTION_MSG("Operation not supported\n");
  1.1070      return NDIS_STATUS_NOT_SUPPORTED;
  1.1071    }
  1.1072    status = routine(adapter_context, oid_request);
  1.1073 -  FUNCTION_MSG("status = %08x\n", status);
  1.1074 +  //FUNCTION_MSG("status = %08x\n", status);
  1.1075    
  1.1076    //FUNCTION_EXIT();
  1.1077    return status;