Commit in reactos/drivers/net/ndis/ndis on ndis_wip_22102004
hardware.c+17-141.12.2.3 -> 1.12.2.4
miniport.c+11.38.2.5 -> 1.38.2.6
+18-14
2 modified files
Add bus number to NDIS_WRAPPER_CONTEXT and use it in Ndis*PciSlotInformation functions.

reactos/drivers/net/ndis/ndis
hardware.c 1.12.2.3 -> 1.12.2.4
diff -u -r1.12.2.3 -r1.12.2.4
--- hardware.c	17 Nov 2004 20:37:21 -0000	1.12.2.3
+++ hardware.c	17 Nov 2004 21:51:37 -0000	1.12.2.4
@@ -10,8 +10,6 @@
  *   25 Aug 2003 Vizzini - NDIS4/5 and PnP additions
  *   3  Oct 2003 Vizzini - formatting and minor bugfixes
  *
- * TODO:
- *    - Fix HalGetBusDataByOffset() param 2 in most calls below
  */
 
 #include <roscfg.h>
@@ -30,7 +28,9 @@
     IN  PVOID       Buffer,
     IN  ULONG       Length)
 {
-  return HalGetBusDataByOffset (PCIConfiguration, 0, SlotNumber, Buffer, Offset, Length);
+  PNDIS_WRAPPER_CONTEXT WrapperContext = (PNDIS_WRAPPER_CONTEXT)WrapperConfigurationContext;
+  return HalGetBusDataByOffset(PCIConfiguration, WrapperContext->BusNumber,
+                               SlotNumber, Buffer, Offset, Length);
 }
 
 
@@ -46,7 +46,9 @@
     IN  PVOID       Buffer,
     IN  ULONG       Length)
 {
-  return HalSetBusDataByOffset (PCIConfiguration, 0, SlotNumber, Buffer, Offset, Length);
+  PNDIS_WRAPPER_CONTEXT WrapperContext = (PNDIS_WRAPPER_CONTEXT)WrapperConfigurationContext;
+  return HalSetBusDataByOffset(PCIConfiguration, WrapperContext->BusNumber,
+                               SlotNumber, Buffer, Offset, Length);
 }
 
 
@@ -123,8 +125,8 @@
   /* FIXME: We can't do anything in this case. It shouldn't really happen. */
   if (MiniportBlock->AllocatedResources == NULL)
     {
-      NDIS_DbgPrint(MIN_TRACE, ("Unimplemented!\n"));
-      *Status = STATUS_NOT_SUPPORTED;
+      NDIS_DbgPrint(MIN_TRACE, ("No allocated resources!\n"));
+      *Status = NDIS_STATUS_FAILURE;
       return;
     }
 
@@ -136,7 +138,7 @@
   if (*BufferSize >= ResourceListSize)
     {
       RtlCopyMemory(ResourceList,
-                    &MiniportBlock->AllocatedResources->List[0].PartialResourceList, 
+                    &MiniportBlock->AllocatedResources->List[0].PartialResourceList,
                     ResourceListSize);
       *BufferSize = ResourceListSize;
       *Status = STATUS_SUCCESS;
@@ -211,9 +213,10 @@
 {
   PLOGICAL_ADAPTER Adapter = (PLOGICAL_ADAPTER)NdisAdapterHandle;
   /* Slot number is ignored since W2K for all NDIS drivers. */
-  return HalGetBusDataByOffset (PCIConfiguration, 0,
-                                Adapter->NdisMiniportBlock.SlotNumber,
-                                Buffer, Offset, Length);
+  return HalGetBusDataByOffset(PCIConfiguration,
+                               Adapter->NdisMiniportBlock.BusNumber,
+                               Adapter->NdisMiniportBlock.SlotNumber,
+                               Buffer, Offset, Length);
 }
 
 
@@ -231,10 +234,10 @@
 {
   PLOGICAL_ADAPTER Adapter = (PLOGICAL_ADAPTER)NdisAdapterHandle;
   /* Slot number is ignored since W2K for all NDIS drivers. */
-  return HalSetBusDataByOffset (PCIConfiguration, 0, 
-                                Adapter->NdisMiniportBlock.SlotNumber,
-                                Buffer, Offset, Length);
+  return HalSetBusDataByOffset(PCIConfiguration,
+                               Adapter->NdisMiniportBlock.BusNumber,
+                               Adapter->NdisMiniportBlock.SlotNumber,
+                               Buffer, Offset, Length);
 }
 
 /* EOF */
-

reactos/drivers/net/ndis/ndis
miniport.c 1.38.2.5 -> 1.38.2.6
diff -u -r1.38.2.5 -r1.38.2.6
--- miniport.c	17 Nov 2004 20:37:21 -0000	1.38.2.5
+++ miniport.c	17 Nov 2004 21:51:37 -0000	1.38.2.6
@@ -1375,6 +1375,7 @@
       else
         Adapter->NdisMiniportBlock.BusNumber = 0;
     }
+  WrapperContext.BusNumber = Adapter->NdisMiniportBlock.BusNumber;
 
   Status = IoGetDeviceProperty(Adapter->NdisMiniportBlock.PhysicalDeviceObject,
                                DevicePropertyAddress, Size,
CVSspam 0.2.8