Commit 931cb9ff authored by Malcolm Priestley's avatar Malcolm Priestley Committed by Greg Kroah-Hartman

staging: vt6656: lock changes: csMgmt_xmit.

csMgmt_xmit is nolonger atomically called but part of must be.

Reorder the function so that RFbSetPower is called first.

Add new lock spinlock for the remainder of the function.
Signed-off-by: default avatarMalcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e03ce839
......@@ -1383,19 +1383,7 @@ CMD_STATUS csMgmt_xmit(struct vnt_private *pDevice,
u16 wTxBufSize;
u32 cbMacHdLen;
u16 wCurrentRate = RATE_1M;
pContext = s_vGetFreeContext(pDevice);
if (NULL == pContext) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"ManagementSend TX...NO CONTEXT!\n");
return CMD_STATUS_RESOURCES;
}
pTX_Buffer = (struct vnt_tx_buffer *)&pContext->data[0];
cbFrameBodySize = pPacket->cbPayloadLen;
pTxBufHead = &pTX_Buffer->fifo_head;
pbyTxBufferAddr = (u8 *)&pTxBufHead->adwTxKey[0];
wTxBufSize = sizeof(struct vnt_tx_fifo_head);
unsigned long flags;
if (pDevice->byBBType == BB_TYPE_11A) {
wCurrentRate = RATE_6M;
......@@ -1405,17 +1393,30 @@ CMD_STATUS csMgmt_xmit(struct vnt_private *pDevice,
byPktType = PK_TYPE_11B;
}
// SetPower will cause error power TX state for OFDM Date packet in TX buffer.
// 2004.11.11 Kyle -- Using OFDM power to tx MngPkt will decrease the connection capability.
// And cmd timer will wait data pkt TX finish before scanning so it's OK
// to set power here.
if (pMgmt->eScanState != WMAC_NO_SCANNING) {
if (pMgmt->eScanState != WMAC_NO_SCANNING)
RFbSetPower(pDevice, wCurrentRate, pDevice->byCurrentCh);
} else {
else
RFbSetPower(pDevice, wCurrentRate, pMgmt->uCurrChannel);
}
pDevice->wCurrentRate = wCurrentRate;
spin_lock_irqsave(&pDevice->lock, flags);
pContext = s_vGetFreeContext(pDevice);
if (!pContext) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
"ManagementSend TX...NO CONTEXT!\n");
spin_unlock_irqrestore(&pDevice->lock, flags);
return CMD_STATUS_RESOURCES;
}
pTX_Buffer = (struct vnt_tx_buffer *)&pContext->data[0];
cbFrameBodySize = pPacket->cbPayloadLen;
pTxBufHead = &pTX_Buffer->fifo_head;
pbyTxBufferAddr = (u8 *)&pTxBufHead->adwTxKey[0];
wTxBufSize = sizeof(struct vnt_tx_fifo_head);
//Set packet type
if (byPktType == PK_TYPE_11A) {//0000 0000 0000 0000
pTxBufHead->wFIFOCtl = 0;
......@@ -1625,6 +1626,9 @@ CMD_STATUS csMgmt_xmit(struct vnt_private *pDevice,
}
PIPEnsSendBulkOut(pDevice,pContext);
spin_unlock_irqrestore(&pDevice->lock, flags);
return CMD_STATUS_PENDING;
}
......
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