aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/bcm/HandleControlPacket.c
diff options
context:
space:
mode:
authorJohannes Tenschert <Johannes.Tenschert@informatik.stud.uni-erlangen.de>2011-12-09 14:38:07 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2011-12-12 19:49:24 -0500
commit77eb7585db287d2323fe60cfe57f3c6a5cdf8787 (patch)
tree005216bafe370eb6b400ae0c773ec4013db174cc /drivers/staging/bcm/HandleControlPacket.c
parentefa6f862d3d18723d720c8777b2a98e8a3277195 (diff)
staging: bcm: HandleControlPacket.c: fix comments
Signed-off-by: Johannes Tenschert <Johannes.Tenschert@informatik.stud.uni-erlangen.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/bcm/HandleControlPacket.c')
-rw-r--r--drivers/staging/bcm/HandleControlPacket.c81
1 files changed, 45 insertions, 36 deletions
diff --git a/drivers/staging/bcm/HandleControlPacket.c b/drivers/staging/bcm/HandleControlPacket.c
index 531dd1424c6..bc5cca97870 100644
--- a/drivers/staging/bcm/HandleControlPacket.c
+++ b/drivers/staging/bcm/HandleControlPacket.c
@@ -1,16 +1,16 @@
1/** 1/**
2@file HandleControlPacket.c 2 * @file HandleControlPacket.c
3This file contains the routines to deal with 3 * This file contains the routines to deal with
4sending and receiving of control packets. 4 * sending and receiving of control packets.
5*/ 5 */
6#include "headers.h" 6#include "headers.h"
7 7
8/** 8/**
9When a control packet is received, analyze the 9 * When a control packet is received, analyze the
10"status" and call appropriate response function. 10 * "status" and call appropriate response function.
11Enqueue the control packet for Application. 11 * Enqueue the control packet for Application.
12@return None 12 * @return None
13*/ 13 */
14static VOID handle_rx_control_packet(PMINI_ADAPTER Adapter, struct sk_buff *skb) 14static VOID handle_rx_control_packet(PMINI_ADAPTER Adapter, struct sk_buff *skb)
15{ 15{
16 PPER_TARANG_DATA pTarang = NULL; 16 PPER_TARANG_DATA pTarang = NULL;
@@ -26,7 +26,7 @@ static VOID handle_rx_control_packet(PMINI_ADAPTER Adapter, struct sk_buff *skb)
26 26
27 switch (usStatus) 27 switch (usStatus)
28 { 28 {
29 case CM_RESPONSES: // 0xA0 29 case CM_RESPONSES: /* 0xA0 */
30 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CP_CTRL_PKT, DBG_LVL_ALL, "MAC Version Seems to be Non Multi-Classifier, rejected by Driver"); 30 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CP_CTRL_PKT, DBG_LVL_ALL, "MAC Version Seems to be Non Multi-Classifier, rejected by Driver");
31 HighPriorityMessage = TRUE; 31 HighPriorityMessage = TRUE;
32 break; 32 break;
@@ -37,17 +37,17 @@ static VOID handle_rx_control_packet(PMINI_ADAPTER Adapter, struct sk_buff *skb)
37 CmControlResponseMessage(Adapter, (skb->data + sizeof(USHORT))); 37 CmControlResponseMessage(Adapter, (skb->data + sizeof(USHORT)));
38 } 38 }
39 break; 39 break;
40 case LINK_CONTROL_RESP: //0xA2 40 case LINK_CONTROL_RESP: /* 0xA2 */
41 case STATUS_RSP: //0xA1 41 case STATUS_RSP: /* 0xA1 */
42 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CP_CTRL_PKT, DBG_LVL_ALL, "LINK_CONTROL_RESP"); 42 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CP_CTRL_PKT, DBG_LVL_ALL, "LINK_CONTROL_RESP");
43 HighPriorityMessage = TRUE; 43 HighPriorityMessage = TRUE;
44 LinkControlResponseMessage(Adapter, (skb->data + sizeof(USHORT))); 44 LinkControlResponseMessage(Adapter, (skb->data + sizeof(USHORT)));
45 break; 45 break;
46 case STATS_POINTER_RESP: //0xA6 46 case STATS_POINTER_RESP: /* 0xA6 */
47 HighPriorityMessage = TRUE; 47 HighPriorityMessage = TRUE;
48 StatisticsResponse(Adapter, (skb->data + sizeof(USHORT))); 48 StatisticsResponse(Adapter, (skb->data + sizeof(USHORT)));
49 break; 49 break;
50 case IDLE_MODE_STATUS: //0xA3 50 case IDLE_MODE_STATUS: /* 0xA3 */
51 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CP_CTRL_PKT, DBG_LVL_ALL, "IDLE_MODE_STATUS Type Message Got from F/W"); 51 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CP_CTRL_PKT, DBG_LVL_ALL, "IDLE_MODE_STATUS Type Message Got from F/W");
52 InterfaceIdleModeRespond(Adapter, (PUINT)(skb->data + 52 InterfaceIdleModeRespond(Adapter, (PUINT)(skb->data +
53 sizeof(USHORT))); 53 sizeof(USHORT)));
@@ -64,7 +64,7 @@ static VOID handle_rx_control_packet(PMINI_ADAPTER Adapter, struct sk_buff *skb)
64 break; 64 break;
65 } 65 }
66 66
67 //Queue The Control Packet to The Application Queues 67 /* Queue The Control Packet to The Application Queues */
68 down(&Adapter->RxAppControlQueuelock); 68 down(&Adapter->RxAppControlQueuelock);
69 69
70 for (pTarang = Adapter->pTarangs; pTarang; pTarang = pTarang->next) 70 for (pTarang = Adapter->pTarangs; pTarang; pTarang = pTarang->next)
@@ -76,12 +76,18 @@ static VOID handle_rx_control_packet(PMINI_ADAPTER Adapter, struct sk_buff *skb)
76 76
77 drop_pkt_flag = TRUE; 77 drop_pkt_flag = TRUE;
78 /* 78 /*
79 There are cntrl msg from A0 to AC. It has been mapped to 0 to C bit in the cntrl mask. 79 * There are cntrl msg from A0 to AC. It has been mapped to 0 to
80 Also, by default AD to BF has been masked to the rest of the bits... which wil be ON by default. 80 * C bit in the cntrl mask.
81 if mask bit is enable to particular pkt status, send it out to app else stop it. 81 * Also, by default AD to BF has been masked to the rest of the
82 */ 82 * bits... which wil be ON by default.
83 * if mask bit is enable to particular pkt status, send it out
84 * to app else stop it.
85 */
83 cntrl_msg_mask_bit = (usStatus & 0x1F); 86 cntrl_msg_mask_bit = (usStatus & 0x1F);
84 //printk("\ninew msg mask bit which is disable in mask:%X", cntrl_msg_mask_bit); 87 /*
88 * printk("\ninew msg mask bit which is disable in mask:%X",
89 * cntrl_msg_mask_bit);
90 */
85 if (pTarang->RxCntrlMsgBitMask & (1 << cntrl_msg_mask_bit)) 91 if (pTarang->RxCntrlMsgBitMask & (1 << cntrl_msg_mask_bit))
86 drop_pkt_flag = FALSE; 92 drop_pkt_flag = FALSE;
87 93
@@ -89,12 +95,13 @@ static VOID handle_rx_control_packet(PMINI_ADAPTER Adapter, struct sk_buff *skb)
89 ((pTarang->AppCtrlQueueLen > MAX_APP_QUEUE_LEN / 2) && (HighPriorityMessage == FALSE))) 95 ((pTarang->AppCtrlQueueLen > MAX_APP_QUEUE_LEN / 2) && (HighPriorityMessage == FALSE)))
90 { 96 {
91 /* 97 /*
92 Assumption:- 98 * Assumption:-
93 1. every tarang manages it own dropped pkt statitistics 99 * 1. every tarang manages it own dropped pkt
94 2. Total packet dropped per tarang will be equal to the sum of all types of dropped 100 * statitistics
95 pkt by that tarang only. 101 * 2. Total packet dropped per tarang will be equal to
96 102 * the sum of all types of dropped pkt by that
97 */ 103 * tarang only.
104 */
98 switch (*(PUSHORT)skb->data) 105 switch (*(PUSHORT)skb->data)
99 { 106 {
100 case CM_RESPONSES: 107 case CM_RESPONSES:
@@ -140,16 +147,15 @@ static VOID handle_rx_control_packet(PMINI_ADAPTER Adapter, struct sk_buff *skb)
140} 147}
141 148
142/** 149/**
143@ingroup ctrl_pkt_functions 150 * @ingroup ctrl_pkt_functions
144Thread to handle control pkt reception 151 * Thread to handle control pkt reception
145*/ 152 */
146int control_packet_handler(PMINI_ADAPTER Adapter /**< pointer to adapter object*/ 153int control_packet_handler(PMINI_ADAPTER Adapter /* pointer to adapter object*/)
147 )
148{ 154{
149 struct sk_buff *ctrl_packet = NULL; 155 struct sk_buff *ctrl_packet = NULL;
150 unsigned long flags = 0; 156 unsigned long flags = 0;
151 //struct timeval tv; 157 /* struct timeval tv; */
152 //int *puiBuffer = NULL; 158 /* int *puiBuffer = NULL; */
153 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CP_CTRL_PKT, DBG_LVL_ALL, "Entering to make thread wait on control packet event!"); 159 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CP_CTRL_PKT, DBG_LVL_ALL, "Entering to make thread wait on control packet event!");
154 while (1) 160 while (1)
155 { 161 {
@@ -171,7 +177,10 @@ int control_packet_handler(PMINI_ADAPTER Adapter /**< pointer to adapter object
171 ((TRUE == Adapter->IdleMode) || (TRUE == Adapter->bShutStatus))) 177 ((TRUE == Adapter->IdleMode) || (TRUE == Adapter->bShutStatus)))
172 { 178 {
173 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CP_CTRL_PKT, DBG_LVL_ALL, "Calling InterfaceAbortIdlemode\n"); 179 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CP_CTRL_PKT, DBG_LVL_ALL, "Calling InterfaceAbortIdlemode\n");
174 // Adapter->bTriedToWakeUpFromlowPowerMode = TRUE; 180 /*
181 * Adapter->bTriedToWakeUpFromlowPowerMode
182 * = TRUE;
183 */
175 InterfaceIdleModeWakeup(Adapter); 184 InterfaceIdleModeWakeup(Adapter);
176 } 185 }
177 continue; 186 continue;
@@ -184,7 +193,7 @@ int control_packet_handler(PMINI_ADAPTER Adapter /**< pointer to adapter object
184 if (ctrl_packet) 193 if (ctrl_packet)
185 { 194 {
186 DEQUEUEPACKET(Adapter->RxControlHead, Adapter->RxControlTail); 195 DEQUEUEPACKET(Adapter->RxControlHead, Adapter->RxControlTail);
187// Adapter->RxControlHead=ctrl_packet->next; 196 /* Adapter->RxControlHead=ctrl_packet->next; */
188 } 197 }
189 198
190 spin_unlock_irqrestore(&Adapter->control_queue_lock, flags); 199 spin_unlock_irqrestore(&Adapter->control_queue_lock, flags);
@@ -211,7 +220,7 @@ INT flushAllAppQ(void)
211 dev_kfree_skb(PacketToDrop); 220 dev_kfree_skb(PacketToDrop);
212 } 221 }
213 pTarang->AppCtrlQueueLen = 0; 222 pTarang->AppCtrlQueueLen = 0;
214 //dropped contrl packet statistics also should be reset. 223 /* dropped contrl packet statistics also should be reset. */
215 memset((PVOID)&pTarang->stDroppedAppCntrlMsgs, 0, sizeof(S_MIBS_DROPPED_APP_CNTRL_MESSAGES)); 224 memset((PVOID)&pTarang->stDroppedAppCntrlMsgs, 0, sizeof(S_MIBS_DROPPED_APP_CNTRL_MESSAGES));
216 225
217 } 226 }