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

staging: bcm: HandleControlPacket.c: fix whitespaces

Signed-off-by: default avatarJohannes Tenschert <Johannes.Tenschert@informatik.stud.uni-erlangen.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent a6a91827
...@@ -13,53 +13,53 @@ Enqueue the control packet for Application. ...@@ -13,53 +13,53 @@ Enqueue the control packet for Application.
*/ */
static VOID handle_rx_control_packet(PMINI_ADAPTER Adapter, struct sk_buff *skb) static VOID handle_rx_control_packet(PMINI_ADAPTER Adapter, struct sk_buff *skb)
{ {
PPER_TARANG_DATA pTarang = NULL; PPER_TARANG_DATA pTarang = NULL;
BOOLEAN HighPriorityMessage = FALSE; BOOLEAN HighPriorityMessage = FALSE;
struct sk_buff * newPacket = NULL; struct sk_buff *newPacket = NULL;
CHAR cntrl_msg_mask_bit = 0; CHAR cntrl_msg_mask_bit = 0;
BOOLEAN drop_pkt_flag = TRUE ; BOOLEAN drop_pkt_flag = TRUE;
USHORT usStatus = *(PUSHORT)(skb->data); USHORT usStatus = *(PUSHORT)(skb->data);
if (netif_msg_pktdata(Adapter)) if (netif_msg_pktdata(Adapter))
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;
break; break;
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
BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CP_CTRL_PKT, DBG_LVL_ALL,"LINK_CONTROL_RESP"); BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CP_CTRL_PKT, DBG_LVL_ALL, "LINK_CONTROL_RESP");
HighPriorityMessage = TRUE ; HighPriorityMessage = TRUE;
LinkControlResponseMessage(Adapter,(skb->data + sizeof(USHORT))); LinkControlResponseMessage(Adapter, (skb->data + sizeof(USHORT)));
break; break;
case STATS_POINTER_RESP: //0xA6 case STATS_POINTER_RESP: //0xA6
HighPriorityMessage = TRUE ; HighPriorityMessage = TRUE;
StatisticsResponse(Adapter, (skb->data + sizeof(USHORT))); StatisticsResponse(Adapter, (skb->data + sizeof(USHORT)));
break; break;
case IDLE_MODE_STATUS: //0xA3 case IDLE_MODE_STATUS: //0xA3
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, CP_CTRL_PKT, DBG_LVL_ALL,"IDLE_MODE_STATUS Type Message Got from F/W"); BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CP_CTRL_PKT, DBG_LVL_ALL, "IDLE_MODE_STATUS Type Message Got from F/W");
InterfaceIdleModeRespond(Adapter, (PUINT)(skb->data + InterfaceIdleModeRespond(Adapter, (PUINT)(skb->data +
sizeof(USHORT))); sizeof(USHORT)));
HighPriorityMessage = TRUE ; HighPriorityMessage = TRUE;
break; break;
case AUTH_SS_HOST_MSG: case AUTH_SS_HOST_MSG:
HighPriorityMessage = TRUE ; HighPriorityMessage = TRUE;
break; break;
default: default:
BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CP_CTRL_PKT, DBG_LVL_ALL,"Got Default Response"); BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CP_CTRL_PKT, DBG_LVL_ALL, "Got Default Response");
/* Let the Application Deal with This Packet */ /* Let the Application Deal with This Packet */
break; break;
} }
...@@ -68,13 +68,13 @@ static VOID handle_rx_control_packet(PMINI_ADAPTER Adapter, struct sk_buff *skb) ...@@ -68,13 +68,13 @@ static VOID handle_rx_control_packet(PMINI_ADAPTER Adapter, struct sk_buff *skb)
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;
/* /*
There are cntrl msg from A0 to AC. It has been mapped to 0 to C bit in the cntrl mask. There are cntrl msg from A0 to AC. It has been mapped to 0 to C bit in the cntrl mask.
Also, by default AD to BF has been masked to the rest of the bits... which wil be ON by default. Also, by default AD to BF has been masked to the rest of the bits... which wil be ON by default.
...@@ -82,11 +82,11 @@ static VOID handle_rx_control_packet(PMINI_ADAPTER Adapter, struct sk_buff *skb) ...@@ -82,11 +82,11 @@ static VOID handle_rx_control_packet(PMINI_ADAPTER Adapter, struct sk_buff *skb)
*/ */
cntrl_msg_mask_bit = (usStatus & 0x1F); cntrl_msg_mask_bit = (usStatus & 0x1F);
//printk("\ninew msg mask bit which is disable in mask:%X", cntrl_msg_mask_bit); //printk("\ninew msg mask bit which is disable in mask:%X", cntrl_msg_mask_bit);
if(pTarang->RxCntrlMsgBitMask & (1<<cntrl_msg_mask_bit)) if (pTarang->RxCntrlMsgBitMask & (1 << cntrl_msg_mask_bit))
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:-
...@@ -95,14 +95,14 @@ static VOID handle_rx_control_packet(PMINI_ADAPTER Adapter, struct sk_buff *skb) ...@@ -95,14 +95,14 @@ static VOID handle_rx_control_packet(PMINI_ADAPTER Adapter, struct sk_buff *skb)
pkt by that tarang only. pkt by that 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;
case CM_CONTROL_NEWDSX_MULTICLASSIFIER_RESP: case CM_CONTROL_NEWDSX_MULTICLASSIFIER_RESP:
pTarang->stDroppedAppCntrlMsgs.cm_control_newdsx_multiclassifier_resp++; pTarang->stDroppedAppCntrlMsgs.cm_control_newdsx_multiclassifier_resp++;
break; break;
case LINK_CONTROL_RESP: case LINK_CONTROL_RESP:
pTarang->stDroppedAppCntrlMsgs.link_control_resp++; pTarang->stDroppedAppCntrlMsgs.link_control_resp++;
break; break;
...@@ -113,83 +113,83 @@ static VOID handle_rx_control_packet(PMINI_ADAPTER Adapter, struct sk_buff *skb) ...@@ -113,83 +113,83 @@ static VOID handle_rx_control_packet(PMINI_ADAPTER Adapter, struct sk_buff *skb)
pTarang->stDroppedAppCntrlMsgs.stats_pointer_resp++; pTarang->stDroppedAppCntrlMsgs.stats_pointer_resp++;
break; break;
case IDLE_MODE_STATUS: case IDLE_MODE_STATUS:
pTarang->stDroppedAppCntrlMsgs.idle_mode_status++ ; pTarang->stDroppedAppCntrlMsgs.idle_mode_status++;
break; break;
case AUTH_SS_HOST_MSG: case AUTH_SS_HOST_MSG:
pTarang->stDroppedAppCntrlMsgs.auth_ss_host_msg++ ; pTarang->stDroppedAppCntrlMsgs.auth_ss_host_msg++;
break; break;
default: default:
pTarang->stDroppedAppCntrlMsgs.low_priority_message++ ; pTarang->stDroppedAppCntrlMsgs.low_priority_message++;
break; break;
} }
continue; continue;
} }
newPacket = skb_clone(skb, GFP_KERNEL); newPacket = skb_clone(skb, GFP_KERNEL);
if (!newPacket) if (!newPacket)
break; break;
ENQUEUEPACKET(pTarang->RxAppControlHead,pTarang->RxAppControlTail, ENQUEUEPACKET(pTarang->RxAppControlHead, pTarang->RxAppControlTail,
newPacket); newPacket);
pTarang->AppCtrlQueueLen++; pTarang->AppCtrlQueueLen++;
} }
up(&Adapter->RxAppControlQueuelock); up(&Adapter->RxAppControlQueuelock);
wake_up(&Adapter->process_read_wait_queue); wake_up(&Adapter->process_read_wait_queue);
dev_kfree_skb(skb); dev_kfree_skb(skb);
BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CP_CTRL_PKT, DBG_LVL_ALL, "After wake_up_interruptible"); BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CP_CTRL_PKT, DBG_LVL_ALL, "After wake_up_interruptible");
} }
/** /**
@ingroup ctrl_pkt_functions @ingroup ctrl_pkt_functions
Thread to handle control pkt reception Thread to handle control pkt reception
*/ */
int control_packet_handler (PMINI_ADAPTER Adapter /**< pointer to adapter object*/ int control_packet_handler(PMINI_ADAPTER Adapter /**< pointer to adapter object*/
) )
{ {
struct sk_buff *ctrl_packet= NULL; struct sk_buff *ctrl_packet = NULL;
unsigned long flags = 0; unsigned long flags = 0;
//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 = TRUE; // Adapter->bTriedToWakeUpFromlowPowerMode = TRUE;
InterfaceIdleModeWakeup (Adapter); InterfaceIdleModeWakeup(Adapter);
} }
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;
} }
spin_unlock_irqrestore (&Adapter->control_queue_lock, flags); spin_unlock_irqrestore(&Adapter->control_queue_lock, flags);
handle_rx_control_packet(Adapter, ctrl_packet); handle_rx_control_packet(Adapter, ctrl_packet);
atomic_dec(&Adapter->cntrlpktCnt); atomic_dec(&Adapter->cntrlpktCnt);
} }
...@@ -201,14 +201,14 @@ int control_packet_handler (PMINI_ADAPTER Adapter /**< pointer to adapter obje ...@@ -201,14 +201,14 @@ int control_packet_handler (PMINI_ADAPTER Adapter /**< pointer to adapter obje
INT flushAllAppQ(void) 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);
} }
pTarang->AppCtrlQueueLen = 0; pTarang->AppCtrlQueueLen = 0;
...@@ -216,7 +216,7 @@ INT flushAllAppQ(void) ...@@ -216,7 +216,7 @@ INT flushAllAppQ(void)
memset((PVOID)&pTarang->stDroppedAppCntrlMsgs, 0, sizeof(S_MIBS_DROPPED_APP_CNTRL_MESSAGES)); memset((PVOID)&pTarang->stDroppedAppCntrlMsgs, 0, sizeof(S_MIBS_DROPPED_APP_CNTRL_MESSAGES));
} }
return STATUS_SUCCESS ; return STATUS_SUCCESS;
} }
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