cvs commit: src/sys/compat/ndis kern_ndis.c ndis_var.h ntoskrnl_var.h subr_hal.c subr_ndis.c subr_ntoskrnl.c subr_usbd.c src/sys/dev/if_ndis if_ndis.c if_ndisvar.h

Bill Paul wpaul at FreeBSD.org
Wed May 4 21:27:45 PDT 2005


wpaul       2005-05-05 03:56:09 UTC

  FreeBSD src repository

  Modified files:
    sys/compat/ndis      kern_ndis.c ndis_var.h ntoskrnl_var.h 
                         subr_hal.c subr_ndis.c subr_ntoskrnl.c 
                         subr_usbd.c 
    sys/dev/if_ndis      if_ndis.c if_ndisvar.h 
  Log:
  This commit makes a bunch of changes, some big, some not so big.
  
  - Remove the old task threads from kern_ndis.c and reimplement them in
    subr_ntoskrnl.c, in order to more properly emulate the Windows DPC
    API. Each CPU gets its own DPC queue/thread, and each queue can
    have low, medium and high importance DPCs. New APIs implemented:
    KeSetTargetProcessorDpc(), KeSetImportanceDpc() and KeFlushQueuedDpcs().
    (This is the biggest change.)
  
  - Fix a bug in NdisMInitializeTimer(): the k_dpc pointer in the
    nmt_timer embedded in the ndis_miniport_timer struct must be set
    to point to the DPC, also embedded in the struct. Failing to do
    this breaks dequeueing of DPCs submitted via timers, and in turn
    breaks cancelling timers.
  
  - Fix a bug in KeCancelTimer(): if the timer is interted in the timer
    queue (i.e. the timeout callback is still pending), we have to both
    untimeout() the timer _and_ call KeRemoveQueueDpc() to nuke the DPC
    that might be pending. Failing to do this breaks cancellation of
    periodic timers, which always appear to be inserted in the timer queue.
  
  - Make use of the nmt_nexttimer field in ndis_miniport_timer: keep a
    queue of pending timers and cancel them all in ndis_halt_nic(), prior
    to calling MiniportHalt(). Also call KeFlushQueuedDpcs() to make sure
    any DPCs queued by the timers have expired.
  
  - Modify NdisMAllocateSharedMemory() and NdisMFreeSharedMemory() to keep
    track of both the virtual and physical addresses of the shared memory
    buffers that get handed out. The AirGo MIMO driver appears to have a bug
    in it: for one of the segments is allocates, it returns the wrong
    virtual address. This would confuse NdisMFreeSharedMemory() and cause
    a crash. Why it doesn't crash Windows too I have no idea (from reading
    the documentation for NdisMFreeSharedMemory(), it appears to be a violation
    of the API).
  
  - Implement strstr(), strchr() and MmIsAddressValid().
  
  - Implement IoAllocateWorkItem(), IoFreeWorkItem(), IoQueueWorkItem() and
    ExQueueWorkItem(). (This is the second biggest change.)
  
  - Make NdisScheduleWorkItem() call ExQueueWorkItem(). (Note that the
    ExQueueWorkItem() API is deprecated by Microsoft, but NDIS still uses
    it, since NdisScheduleWorkItem() is incompatible with the IoXXXWorkItem()
    API.)
  
  - Change if_ndis.c to use the NdisScheduleWorkItem() interface for scheduling
    tasks.
  
  With all these changes and fixes, the AirGo MIMO driver for the Belkin
  F5D8010 Pre-N card now works. Special thanks to Paul Robinson
  (paul dawt robinson at pwermedia dawt net) for the loan of a card
  for testing.
  
  Revision  Changes    Path
  1.79      +78 -369   src/sys/compat/ndis/kern_ndis.c
  1.38      +33 -15    src/sys/compat/ndis/ndis_var.h
  1.34      +67 -5     src/sys/compat/ndis/ntoskrnl_var.h
  1.22      +1 -1      src/sys/compat/ndis/subr_hal.c
  1.86      +144 -48   src/sys/compat/ndis/subr_ndis.c
  1.66      +572 -8    src/sys/compat/ndis/subr_ntoskrnl.c
  1.3       +1 -1      src/sys/compat/ndis/subr_usbd.c
  1.90      +50 -16    src/sys/dev/if_ndis/if_ndis.c
  1.21      +4 -1      src/sys/dev/if_ndis/if_ndisvar.h


More information about the cvs-src mailing list