diff options
author | Mithlesh Thukral <mithlesh@linsyssoft.com> | 2009-01-05 21:18:04 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-04-03 14:53:10 -0700 |
commit | d0128aa9dc8a19a403cb35b5d3a6ded7210eb921 (patch) | |
tree | a95cec1c6f7c391a5a1863e6110891d7bdcc4f66 /drivers/staging/sxg/sxg.h | |
parent | cb636fe382d47e1ba97d9c69f8a1e64b178b8cec (diff) |
Staging: sxg: Receive code and data structure cleanups
* Cleanup in recevive buffer structure
* Drop receive data buffer as its not needed with use of skbs
* Fix error code paths in receive skb failures
Signed-off-by: LinSysSoft Sahara Team <saharaproj@linsyssoft.com>
Signed-off-by: Christopher Harrer <charrer@alacritech.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/sxg/sxg.h')
-rw-r--r-- | drivers/staging/sxg/sxg.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/staging/sxg/sxg.h b/drivers/staging/sxg/sxg.h index 9fa1dac2324..28e7cd7337c 100644 --- a/drivers/staging/sxg/sxg.h +++ b/drivers/staging/sxg/sxg.h @@ -139,12 +139,14 @@ struct sxg_stats { /* Indications array size */ #define SXG_RCV_ARRAYSIZE 64 -#define SXG_ALLOCATE_RCV_PACKET(_pAdapt, _RcvDataBufferHdr) { \ - struct sk_buff * skb; \ - skb = netdev_alloc_skb(_pAdapt->netdev, 2048); \ +#define SXG_ALLOCATE_RCV_PACKET(_pAdapt, _RcvDataBufferHdr, BufferSize) {\ + struct sk_buff * skb; \ + skb = netdev_alloc_skb(_pAdapt->netdev, BufferSize); \ if (skb) { \ (_RcvDataBufferHdr)->skb = skb; \ skb->next = NULL; \ + _RcvDataBufferHdr->PhysicalAddress = pci_map_single(adapter->pcidev,\ + _RcvDataBufferHdr->skb->data, BufferSize, PCI_DMA_FROMDEVICE); \ } else { \ (_RcvDataBufferHdr)->skb = NULL; \ } \ @@ -212,8 +214,8 @@ struct sxg_stats { SXG_TRACE(TRACE_SXG, SxgTraceBuffer, TRACE_NOISY, "DumbRcv", \ (_RcvDataBufferHdr), (_Packet), \ (_Event)->Status, 0); \ - ASSERT((_Event)->Length <= (_RcvDataBufferHdr)->Size); \ - skb_put(Packet, (_Event)->Length); \ + /* ASSERT((_Event)->Length <= (_RcvDataBufferHdr)->Size); */ \ + skb_put(Packet, (_Event)->Length); \ } /* @@ -236,7 +238,7 @@ struct sxg_stats { #define SXG_FREE_RCV_DATA_BUFFER(_pAdapt, _Hdr) { \ SXG_TRACE(TRACE_SXG, SxgTraceBuffer, TRACE_NOISY, "RtnDHdr", \ (_Hdr), (_pAdapt)->FreeRcvBufferCount, \ - (_Hdr)->State, (_Hdr)->VirtualAddress); \ + (_Hdr)->State, 0/*(_Hdr)->VirtualAddress*/); \ /* SXG_RESTORE_MDL_OFFSET(_Hdr); */ \ (_pAdapt)->FreeRcvBufferCount++; \ ASSERT(((_pAdapt)->AllRcvBlockCount * SXG_RCV_DESCRIPTORS_PER_BLOCK) \ |