Commit 41d8532b authored by Dragoslav Zaric's avatar Dragoslav Zaric Committed by Greg Kroah-Hartman

Staging: otus: 80211core/amsdu.c: Fix Coding Style

Signed-off-by: default avatarDragoslav Zaric <dragoslav.zaric.kd@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent aef911a5
......@@ -34,45 +34,45 @@
/* Stephen Chen Atheros Communications, INC. 2007.2 */
/* */
/************************************************************************/
zbuf_t* zfGetAmsduSubFrame(zdev_t* dev, zbuf_t* buf, u16_t* offset)
zbuf_t *zfGetAmsduSubFrame(zdev_t *dev, zbuf_t *buf, u16_t *offset)
{
u16_t subframeLen;
u16_t amsduLen = zfwBufGetSize(dev, buf);
zbuf_t* newBuf;
zbuf_t *newBuf;
ZM_PERFORMANCE_RX_AMSDU(dev, buf, amsduLen);
/* Verify A-MSDU length */
if (amsduLen < (*offset + 14))
{
return NULL;
}
/* Locate A-MSDU subframe by offset and verify subframe length */
subframeLen = (zmw_buf_readb(dev, buf, *offset + 12) << 8) +
zmw_buf_readb(dev, buf, *offset + 13);
if (subframeLen == 0)
{
return NULL;
}
/* Verify A-MSDU subframe length */
if ((*offset+14+subframeLen) <= amsduLen)
{
if ((*offset+14+subframeLen) <= amsduLen) {
/* Allocate a new buffer */
if ((newBuf = zfwBufAllocate(dev, 24+2+subframeLen)) != NULL)
{
#ifdef ZM_ENABLE_NATIVE_WIFI
/* Copy and convert subframe to wlan frame format */
/* SHALL NOT INCLUDE QOS and AMSDU header. Ray 20070807 For Vista */
newBuf = zfwBufAllocate(dev, 24+2+subframeLen);
if (newBuf != NULL) {
#ifdef ZM_ENABLE_NATIVE_WIFI
/* Copy and convert subframe to wlan frame format
* SHALL NOT INCLUDE QOS and AMSDU header.
* Ray 20070807 For Vista
*/
zfRxBufferCopy(dev, newBuf, buf, 0, 0, 24);
zfRxBufferCopy(dev, newBuf, buf, 24, *offset+14, subframeLen);
zfRxBufferCopy(dev, newBuf, buf, 24, *offset+14,
subframeLen);
zfwBufSetSize(dev, newBuf, 24+subframeLen);
#else
#else
/* Copy subframe to new buffer */
zfRxBufferCopy(dev, newBuf, buf, 0, *offset, 14+subframeLen);
zfRxBufferCopy(dev, newBuf, buf, 0, *offset,
14+subframeLen);
zfwBufSetSize(dev, newBuf, 14+subframeLen);
#endif
#endif
/* Update offset */
*offset += (((14+subframeLen)+3) & 0xfffc);
......@@ -101,29 +101,24 @@ zbuf_t* zfGetAmsduSubFrame(zdev_t* dev, zbuf_t* buf, u16_t* offset)
/* Stephen Chen Atheros Communications, INC. 2007.2 */
/* */
/************************************************************************/
void zfDeAmsdu(zdev_t* dev, zbuf_t* buf, u16_t vap, u8_t encryMode)
void zfDeAmsdu(zdev_t *dev, zbuf_t *buf, u16_t vap, u8_t encryMode)
{
u16_t offset = ZM_SIZE_OF_WLAN_DATA_HEADER+ZM_SIZE_OF_QOS_CTRL;
zbuf_t* subframeBuf;
zbuf_t *subframeBuf;
zmw_get_wlan_dev(dev);
ZM_BUFFER_TRACE(dev, buf)
if (encryMode == ZM_AES || encryMode == ZM_TKIP)
{
offset += (ZM_SIZE_OF_IV + ZM_SIZE_OF_EXT_IV);
}
else if (encryMode == ZM_WEP64 || encryMode == ZM_WEP128)
{
offset += ZM_SIZE_OF_IV;
}
/* Repeatly calling zfGetAmsduSubFrame() until NULL returned */
while ((subframeBuf = zfGetAmsduSubFrame(dev, buf, &offset)) != NULL)
{
while ((subframeBuf = zfGetAmsduSubFrame(dev, buf, &offset)) != NULL) {
wd->commTally.NotifyNDISRxFrmCnt++;
if (wd->zfcbRecvEth != NULL)
{
if (wd->zfcbRecvEth != NULL) {
wd->zfcbRecvEth(dev, subframeBuf, (u8_t)vap);
ZM_PERFORMANCE_RX_MSDU(dev, wd->tick);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment