Skip to content

Commit

Permalink
another few bugfixes, also eliminated several places where I was dupl…
Browse files Browse the repository at this point in the history
…icating the fix logic. Subjectively so far my connection feels substantially faster, remains to be seen if there are still issues, but so far so good
  • Loading branch information
ashaffer committed Aug 10, 2013
1 parent b820410 commit 7aa0186
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 23 deletions.
10 changes: 6 additions & 4 deletions include/os/rt_linux.h
Expand Up @@ -855,13 +855,15 @@ void linux_pci_unmap_single(void *handle, ra_dma_addr_t dma_addr, size_t size, i
(RTPKT_TO_OSPKT(_pkt)->len)
#define SET_OS_PKT_LEN(_pkt, _len) \
(RTPKT_TO_OSPKT(_pkt)->len) = (_len)

#define GET_OS_PKT_DATATAIL(_pkt) \
(RTPKT_TO_OSPKT(_pkt)->tail)

#ifdef NET_SKBUFF_DATA_USES_OFFSET
#define GET_OS_PKT_DATATAIL(_pkt) \
(RTPKT_TO_OSPKT(_pkt)->head + (ULONG)RTPKT_TO_OSPKT(_pkt)->tail)
#define SET_OS_PKT_DATATAIL(_pkt, _start, _len) \
((RTPKT_TO_OSPKT(_pkt))->tail) = (ULONG)RTPKT_TO_OSPKT(_pkt)->data - (ULONG)(RTPKT_TO_OSPKT(_pkt)->head) + (_len)
((RTPKT_TO_OSPKT(_pkt))->tail) = (ULONG)_start - (ULONG)(RTPKT_TO_OSPKT(_pkt)->head) + (_len)
#else
#define GET_OS_PKT_DATATAIL(_pkt) \
(RTPKT_TO_OSPKT(_pkt)->tail)
#define SET_OS_PKT_DATATAIL(_pkt, _start, _len) \
((RTPKT_TO_OSPKT(_pkt))->tail) = (PUCHAR)((_start) + (_len))
#endif
Expand Down
24 changes: 6 additions & 18 deletions os/linux/rt_linux.c
Expand Up @@ -505,15 +505,11 @@ PNDIS_PACKET duplicate_pkt(
MEM_DBG_PKT_ALLOC_INC(skb);

skb_reserve(skb, 2);
#ifdef NET_SKBUFF_DATA_USES_OFFSET
NdisMoveMemory(skb->data+skb->tail, pHeader802_3, HdrLen);
skb_put(skb, HdrLen);
NdisMoveMemory(skb->data+skb->tail, pData, DataSize);
#else
NdisMoveMemory(skb->tail, pHeader802_3, HdrLen);

NdisMoveMemory(GET_OS_PKT_DATATAIL(skb), pHeader802_3, HdrLen);
skb_put(skb, HdrLen);
NdisMoveMemory(skb->tail, pData, DataSize);
#endif
NdisMoveMemory(GET_OS_PKT_DATATAIL(skb), pData, DataSize);

skb_put(skb, DataSize);
skb->dev = pNetDev; /*get_netdev_from_bssid(pAd, FromWhichBSSID); */
pPacket = OSPKT_TO_RTPKT(skb);
Expand Down Expand Up @@ -665,11 +661,7 @@ PNDIS_PACKET ClonePacket(
pClonedPkt->dev = pRxPkt->dev;
pClonedPkt->data = pData;
pClonedPkt->len = DataSize;
#ifdef NET_SKBUFF_DATA_USES_OFFSET
pClonedPkt->tail = (ULONG)pClonedPkt->data - (ULONG)pClonedPkt->head + pClonedPkt->len;
#else
pClonedPkt->tail = pClonedPkt->data + pClonedPkt->len;
#endif
SET_OS_PKT_DATATAIL(pClonedPkt, pClonedPkt->data, pClonedPkt->len);
ASSERT(DataSize < 1530);
}
return pClonedPkt;
Expand Down Expand Up @@ -715,11 +707,7 @@ void wlan_802_11_to_802_3_packet(
pOSPkt->dev = pNetDev;
pOSPkt->data = pData;
pOSPkt->len = DataSize;
#ifdef NET_SKBUFF_DATA_USES_OFFSET
pOSPkt->tail = (pOSPkt->data-pOSPkt->head)+pOSPkt->len;
#else
pOSPkt->tail = pOSPkt->data + pOSPkt->len;
#endif
SET_OS_PKT_DATATAIL(pOSPkt, pOSPkt->data, pOSPkt->len);

/* */
/* copy 802.3 header */
Expand Down
2 changes: 1 addition & 1 deletion os/linux/rt_profile.c
Expand Up @@ -399,7 +399,7 @@ void STA_MonPktSend(

if (pRxBlk->DataSize + sizeof(wlan_ng_prism2_header) > RX_BUFFER_AGGRESIZE)
{
DBGPRINT(RT_DEBUG_ERROR, ("%s : Size is too large! (%d)\n", __FUNCTION__, pRxBlk->DataSize + sizeof(wlan_ng_prism2_header)));
DBGPRINT(RT_DEBUG_ERROR, ("%s : Size is too large! (%d)\n", __FUNCTION__, pRxBlk->DataSize + (UINT)sizeof(wlan_ng_prism2_header)));
goto err_free_sk_buff;
}

Expand Down

0 comments on commit 7aa0186

Please sign in to comment.