ipw2200 and pci dma sync then unmap in ipw_rx()

Alex Murray <[email protected]> Fri, 07 Mar 2008 14:35:50 +1030
Newsgroups gmane.linux.drivers.ipw2100.devel
Message-ID <[email protected]>
Hi

After trying to recently integrate ipw2200 with some custom h/w, we came 
across a bug in our pci implementation which when being utilised by 
ipw2200 in ipw_rx, caused us to receive what looked like garbled 
packets. What was actually happening was that after calling 
pci_dma_sync_single_for_cpu and then processing the packet 
(decrypt/convert to ethernet frame), the call to pci_unmap_single() 
would (in our custom hardware implementation) cause the original packet 
data to be written back to the skb memory space, and so would overwrite 
the previously processed packet with the original unprocessed form. This 
would then appear as an invalid IP (ethernet) packet to the rest of the 
network stack and would be thrown away.

We have been able to work around the bug in our hardware by simply 
replacing the original call to pci_dma_sync_single_for_cpu() with the 
call to pci_unmap_single(), since no matter what, pci_unmap_single() is 
always called anyway for each skb once it has been processed.

Would you agree that this is perhaps more correct than the current sync 
then unmap implementation, since in general sync should only be used if 
the dma mapped memory might be re-used, but since it is always unmapped 
regardless, the sync seems unnecessary.

Thanks,
Alex Murray


IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914.  If you have received this email in error, you are requested to contact the sender and delete the email.



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/