Commit 8b34a1fb authored by Johannes Tenschert's avatar Johannes Tenschert Committed by Greg Kroah-Hartman

staging: bcm: HandleControlPacket.c: fix parens/braces

Signed-off-by: default avatarJohannes Tenschert <Johannes.Tenschert@informatik.stud.uni-erlangen.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 77eb7585
...@@ -24,8 +24,7 @@ static VOID handle_rx_control_packet(PMINI_ADAPTER Adapter, struct sk_buff *skb) ...@@ -24,8 +24,7 @@ static VOID handle_rx_control_packet(PMINI_ADAPTER Adapter, struct sk_buff *skb)
print_hex_dump(KERN_DEBUG, PFX "rx control: ", DUMP_PREFIX_NONE, print_hex_dump(KERN_DEBUG, PFX "rx control: ", DUMP_PREFIX_NONE,
16, 1, skb->data, skb->len, 0); 16, 1, skb->data, skb->len, 0);
switch (usStatus) switch (usStatus) {
{
case CM_RESPONSES: /* 0xA0 */ case CM_RESPONSES: /* 0xA0 */
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CP_CTRL_PKT, DBG_LVL_ALL, "MAC Version Seems to be Non Multi-Classifier, rejected by Driver"); BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CP_CTRL_PKT, DBG_LVL_ALL, "MAC Version Seems to be Non Multi-Classifier, rejected by Driver");
HighPriorityMessage = TRUE; HighPriorityMessage = TRUE;
...@@ -33,9 +32,7 @@ static VOID handle_rx_control_packet(PMINI_ADAPTER Adapter, struct sk_buff *skb) ...@@ -33,9 +32,7 @@ static VOID handle_rx_control_packet(PMINI_ADAPTER Adapter, struct sk_buff *skb)
case CM_CONTROL_NEWDSX_MULTICLASSIFIER_RESP: case CM_CONTROL_NEWDSX_MULTICLASSIFIER_RESP:
HighPriorityMessage = TRUE; HighPriorityMessage = TRUE;
if (Adapter->LinkStatus == LINKUP_DONE) if (Adapter->LinkStatus == LINKUP_DONE)
{
CmControlResponseMessage(Adapter, (skb->data + sizeof(USHORT))); CmControlResponseMessage(Adapter, (skb->data + sizeof(USHORT)));
}
break; break;
case LINK_CONTROL_RESP: /* 0xA2 */ case LINK_CONTROL_RESP: /* 0xA2 */
case STATUS_RSP: /* 0xA1 */ case STATUS_RSP: /* 0xA1 */
...@@ -67,12 +64,9 @@ static VOID handle_rx_control_packet(PMINI_ADAPTER Adapter, struct sk_buff *skb) ...@@ -67,12 +64,9 @@ static VOID handle_rx_control_packet(PMINI_ADAPTER Adapter, struct sk_buff *skb)
/* Queue The Control Packet to The Application Queues */ /* Queue The Control Packet to The Application Queues */
down(&Adapter->RxAppControlQueuelock); down(&Adapter->RxAppControlQueuelock);
for (pTarang = Adapter->pTarangs; pTarang; pTarang = pTarang->next) for (pTarang = Adapter->pTarangs; pTarang; pTarang = pTarang->next) {
{
if (Adapter->device_removed) if (Adapter->device_removed)
{
break; break;
}
drop_pkt_flag = TRUE; drop_pkt_flag = TRUE;
/* /*
...@@ -92,8 +86,7 @@ static VOID handle_rx_control_packet(PMINI_ADAPTER Adapter, struct sk_buff *skb) ...@@ -92,8 +86,7 @@ static VOID handle_rx_control_packet(PMINI_ADAPTER Adapter, struct sk_buff *skb)
drop_pkt_flag = FALSE; drop_pkt_flag = FALSE;
if ((drop_pkt_flag == TRUE) || (pTarang->AppCtrlQueueLen > MAX_APP_QUEUE_LEN) || if ((drop_pkt_flag == TRUE) || (pTarang->AppCtrlQueueLen > MAX_APP_QUEUE_LEN) ||
((pTarang->AppCtrlQueueLen > MAX_APP_QUEUE_LEN / 2) && (HighPriorityMessage == FALSE))) ((pTarang->AppCtrlQueueLen > MAX_APP_QUEUE_LEN / 2) && (HighPriorityMessage == FALSE))) {
{
/* /*
* Assumption:- * Assumption:-
* 1. every tarang manages it own dropped pkt * 1. every tarang manages it own dropped pkt
...@@ -102,8 +95,7 @@ static VOID handle_rx_control_packet(PMINI_ADAPTER Adapter, struct sk_buff *skb) ...@@ -102,8 +95,7 @@ static VOID handle_rx_control_packet(PMINI_ADAPTER Adapter, struct sk_buff *skb)
* the sum of all types of dropped pkt by that * the sum of all types of dropped pkt by that
* tarang only. * tarang only.
*/ */
switch (*(PUSHORT)skb->data) switch (*(PUSHORT)skb->data) {
{
case CM_RESPONSES: case CM_RESPONSES:
pTarang->stDroppedAppCntrlMsgs.cm_responses++; pTarang->stDroppedAppCntrlMsgs.cm_responses++;
break; break;
...@@ -157,25 +149,21 @@ int control_packet_handler(PMINI_ADAPTER Adapter /* pointer to adapter object*/) ...@@ -157,25 +149,21 @@ int control_packet_handler(PMINI_ADAPTER Adapter /* pointer to adapter object*/)
/* struct timeval tv; */ /* struct timeval tv; */
/* int *puiBuffer = NULL; */ /* int *puiBuffer = NULL; */
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CP_CTRL_PKT, DBG_LVL_ALL, "Entering to make thread wait on control packet event!"); BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CP_CTRL_PKT, DBG_LVL_ALL, "Entering to make thread wait on control packet event!");
while (1) while (1) {
{
wait_event_interruptible(Adapter->process_rx_cntrlpkt, wait_event_interruptible(Adapter->process_rx_cntrlpkt,
atomic_read(&Adapter->cntrlpktCnt) || atomic_read(&Adapter->cntrlpktCnt) ||
Adapter->bWakeUpDevice || Adapter->bWakeUpDevice ||
kthread_should_stop()); kthread_should_stop());
if (kthread_should_stop()) if (kthread_should_stop()) {
{
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CP_CTRL_PKT, DBG_LVL_ALL, "Exiting\n"); BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CP_CTRL_PKT, DBG_LVL_ALL, "Exiting\n");
return 0; return 0;
} }
if (TRUE == Adapter->bWakeUpDevice) if (TRUE == Adapter->bWakeUpDevice) {
{
Adapter->bWakeUpDevice = FALSE; Adapter->bWakeUpDevice = FALSE;
if ((FALSE == Adapter->bTriedToWakeUpFromlowPowerMode) && if ((FALSE == Adapter->bTriedToWakeUpFromlowPowerMode) &&
((TRUE == Adapter->IdleMode) || (TRUE == Adapter->bShutStatus))) ((TRUE == Adapter->IdleMode) || (TRUE == Adapter->bShutStatus))) {
{
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CP_CTRL_PKT, DBG_LVL_ALL, "Calling InterfaceAbortIdlemode\n"); BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CP_CTRL_PKT, DBG_LVL_ALL, "Calling InterfaceAbortIdlemode\n");
/* /*
* Adapter->bTriedToWakeUpFromlowPowerMode * Adapter->bTriedToWakeUpFromlowPowerMode
...@@ -186,12 +174,10 @@ int control_packet_handler(PMINI_ADAPTER Adapter /* pointer to adapter object*/) ...@@ -186,12 +174,10 @@ int control_packet_handler(PMINI_ADAPTER Adapter /* pointer to adapter object*/)
continue; continue;
} }
while (atomic_read(&Adapter->cntrlpktCnt)) while (atomic_read(&Adapter->cntrlpktCnt)) {
{
spin_lock_irqsave(&Adapter->control_queue_lock, flags); spin_lock_irqsave(&Adapter->control_queue_lock, flags);
ctrl_packet = Adapter->RxControlHead; ctrl_packet = Adapter->RxControlHead;
if (ctrl_packet) if (ctrl_packet) {
{
DEQUEUEPACKET(Adapter->RxControlHead, Adapter->RxControlTail); DEQUEUEPACKET(Adapter->RxControlHead, Adapter->RxControlTail);
/* Adapter->RxControlHead=ctrl_packet->next; */ /* Adapter->RxControlHead=ctrl_packet->next; */
} }
...@@ -211,10 +197,8 @@ INT flushAllAppQ(void) ...@@ -211,10 +197,8 @@ INT flushAllAppQ(void)
PMINI_ADAPTER Adapter = GET_BCM_ADAPTER(gblpnetdev); PMINI_ADAPTER Adapter = GET_BCM_ADAPTER(gblpnetdev);
PPER_TARANG_DATA pTarang = NULL; PPER_TARANG_DATA pTarang = NULL;
struct sk_buff *PacketToDrop = NULL; struct sk_buff *PacketToDrop = NULL;
for (pTarang = Adapter->pTarangs; pTarang; pTarang = pTarang->next) for (pTarang = Adapter->pTarangs; pTarang; pTarang = pTarang->next) {
{ while (pTarang->RxAppControlHead != NULL) {
while (pTarang->RxAppControlHead != NULL)
{
PacketToDrop = pTarang->RxAppControlHead; PacketToDrop = pTarang->RxAppControlHead;
DEQUEUEPACKET(pTarang->RxAppControlHead, pTarang->RxAppControlTail); DEQUEUEPACKET(pTarang->RxAppControlHead, pTarang->RxAppControlTail);
dev_kfree_skb(PacketToDrop); dev_kfree_skb(PacketToDrop);
......
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