diff options
author | Johannes Tenschert <Johannes.Tenschert@informatik.stud.uni-erlangen.de> | 2011-12-09 14:38:05 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-12-12 19:49:23 -0500 |
commit | dd751d2a2bbd619081074d25f3f2ebcb1fb29b9e (patch) | |
tree | 210e9621b25c1f15fb88226c6cc6f12349507898 | |
parent | a6a918274116d8edc25eb20f6097dedf97b108e2 (diff) |
staging: bcm: HandleControlPacket.c: fix whitespaces
Signed-off-by: Johannes Tenschert <Johannes.Tenschert@informatik.stud.uni-erlangen.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/staging/bcm/HandleControlPacket.c | 136 |
1 files changed, 68 insertions, 68 deletions
diff --git a/drivers/staging/bcm/HandleControlPacket.c b/drivers/staging/bcm/HandleControlPacket.c index 2b1e9e17e11c..e764e63c003d 100644 --- a/drivers/staging/bcm/HandleControlPacket.c +++ b/drivers/staging/bcm/HandleControlPacket.c | |||
@@ -13,53 +13,53 @@ Enqueue the control packet for Application. | |||
13 | */ | 13 | */ |
14 | static VOID handle_rx_control_packet(PMINI_ADAPTER Adapter, struct sk_buff *skb) | 14 | static 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; |
17 | BOOLEAN HighPriorityMessage = FALSE; | 17 | BOOLEAN HighPriorityMessage = FALSE; |
18 | struct sk_buff * newPacket = NULL; | 18 | struct sk_buff *newPacket = NULL; |
19 | CHAR cntrl_msg_mask_bit = 0; | 19 | CHAR cntrl_msg_mask_bit = 0; |
20 | BOOLEAN drop_pkt_flag = TRUE ; | 20 | BOOLEAN drop_pkt_flag = TRUE; |
21 | USHORT usStatus = *(PUSHORT)(skb->data); | 21 | USHORT usStatus = *(PUSHORT)(skb->data); |
22 | 22 | ||
23 | if (netif_msg_pktdata(Adapter)) | 23 | if (netif_msg_pktdata(Adapter)) |
24 | print_hex_dump(KERN_DEBUG, PFX "rx control: ", DUMP_PREFIX_NONE, | 24 | print_hex_dump(KERN_DEBUG, PFX "rx control: ", DUMP_PREFIX_NONE, |
25 | 16, 1, skb->data, skb->len, 0); | 25 | 16, 1, skb->data, skb->len, 0); |
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; |
33 | case CM_CONTROL_NEWDSX_MULTICLASSIFIER_RESP: | 33 | case CM_CONTROL_NEWDSX_MULTICLASSIFIER_RESP: |
34 | HighPriorityMessage = TRUE ; | 34 | HighPriorityMessage = TRUE; |
35 | if(Adapter->LinkStatus==LINKUP_DONE) | 35 | if (Adapter->LinkStatus == LINKUP_DONE) |
36 | { | 36 | { |
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))); |
54 | HighPriorityMessage = TRUE ; | 54 | HighPriorityMessage = TRUE; |
55 | break; | 55 | break; |
56 | 56 | ||
57 | case AUTH_SS_HOST_MSG: | 57 | case AUTH_SS_HOST_MSG: |
58 | HighPriorityMessage = TRUE ; | 58 | HighPriorityMessage = TRUE; |
59 | break; | 59 | break; |
60 | 60 | ||
61 | default: | 61 | default: |
62 | BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CP_CTRL_PKT, DBG_LVL_ALL,"Got Default Response"); | 62 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CP_CTRL_PKT, DBG_LVL_ALL, "Got Default Response"); |
63 | /* Let the Application Deal with This Packet */ | 63 | /* Let the Application Deal with This Packet */ |
64 | break; | 64 | break; |
65 | } | 65 | } |
@@ -68,13 +68,13 @@ static VOID handle_rx_control_packet(PMINI_ADAPTER Adapter, struct sk_buff *skb) | |||
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) |
71 | { | 71 | { |
72 | if(Adapter->device_removed) | 72 | if (Adapter->device_removed) |
73 | { | 73 | { |
74 | break; | 74 | break; |
75 | } | 75 | } |
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 C bit in the cntrl mask. |
80 | Also, by default AD to BF has been masked to the rest of the bits... which wil be ON by default. | 80 | 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 | */ | 82 | */ |
83 | cntrl_msg_mask_bit = (usStatus & 0x1F); | 83 | cntrl_msg_mask_bit = (usStatus & 0x1F); |
84 | //printk("\ninew msg mask bit which is disable in mask:%X", cntrl_msg_mask_bit); | 84 | //printk("\ninew msg mask bit which is disable in mask:%X", cntrl_msg_mask_bit); |
85 | if(pTarang->RxCntrlMsgBitMask & (1<<cntrl_msg_mask_bit)) | 85 | if (pTarang->RxCntrlMsgBitMask & (1 << cntrl_msg_mask_bit)) |
86 | drop_pkt_flag = FALSE; | 86 | drop_pkt_flag = FALSE; |
87 | 87 | ||
88 | if ((drop_pkt_flag == TRUE) || (pTarang->AppCtrlQueueLen > MAX_APP_QUEUE_LEN) || | 88 | if ((drop_pkt_flag == TRUE) || (pTarang->AppCtrlQueueLen > MAX_APP_QUEUE_LEN) || |
89 | ((pTarang->AppCtrlQueueLen > MAX_APP_QUEUE_LEN/2) && (HighPriorityMessage == FALSE))) | 89 | ((pTarang->AppCtrlQueueLen > MAX_APP_QUEUE_LEN / 2) && (HighPriorityMessage == FALSE))) |
90 | { | 90 | { |
91 | /* | 91 | /* |
92 | Assumption:- | 92 | Assumption:- |
@@ -95,14 +95,14 @@ static VOID handle_rx_control_packet(PMINI_ADAPTER Adapter, struct sk_buff *skb) | |||
95 | pkt by that tarang only. | 95 | pkt by that tarang only. |
96 | 96 | ||
97 | */ | 97 | */ |
98 | switch(*(PUSHORT)skb->data) | 98 | switch (*(PUSHORT)skb->data) |
99 | { | 99 | { |
100 | case CM_RESPONSES: | 100 | case CM_RESPONSES: |
101 | pTarang->stDroppedAppCntrlMsgs.cm_responses++; | 101 | pTarang->stDroppedAppCntrlMsgs.cm_responses++; |
102 | break; | 102 | break; |
103 | case CM_CONTROL_NEWDSX_MULTICLASSIFIER_RESP: | 103 | case CM_CONTROL_NEWDSX_MULTICLASSIFIER_RESP: |
104 | pTarang->stDroppedAppCntrlMsgs.cm_control_newdsx_multiclassifier_resp++; | 104 | pTarang->stDroppedAppCntrlMsgs.cm_control_newdsx_multiclassifier_resp++; |
105 | break; | 105 | break; |
106 | case LINK_CONTROL_RESP: | 106 | case LINK_CONTROL_RESP: |
107 | pTarang->stDroppedAppCntrlMsgs.link_control_resp++; | 107 | pTarang->stDroppedAppCntrlMsgs.link_control_resp++; |
108 | break; | 108 | break; |
@@ -113,83 +113,83 @@ static VOID handle_rx_control_packet(PMINI_ADAPTER Adapter, struct sk_buff *skb) | |||
113 | pTarang->stDroppedAppCntrlMsgs.stats_pointer_resp++; | 113 | pTarang->stDroppedAppCntrlMsgs.stats_pointer_resp++; |
114 | break; | 114 | break; |
115 | case IDLE_MODE_STATUS: | 115 | case IDLE_MODE_STATUS: |
116 | pTarang->stDroppedAppCntrlMsgs.idle_mode_status++ ; | 116 | pTarang->stDroppedAppCntrlMsgs.idle_mode_status++; |
117 | break; | 117 | break; |
118 | case AUTH_SS_HOST_MSG: | 118 | case AUTH_SS_HOST_MSG: |
119 | pTarang->stDroppedAppCntrlMsgs.auth_ss_host_msg++ ; | 119 | pTarang->stDroppedAppCntrlMsgs.auth_ss_host_msg++; |
120 | break; | 120 | break; |
121 | default: | 121 | default: |
122 | pTarang->stDroppedAppCntrlMsgs.low_priority_message++ ; | 122 | pTarang->stDroppedAppCntrlMsgs.low_priority_message++; |
123 | break; | 123 | break; |
124 | } | 124 | } |
125 | 125 | ||
126 | continue; | 126 | continue; |
127 | } | 127 | } |
128 | 128 | ||
129 | newPacket = skb_clone(skb, GFP_KERNEL); | 129 | newPacket = skb_clone(skb, GFP_KERNEL); |
130 | if (!newPacket) | 130 | if (!newPacket) |
131 | break; | 131 | break; |
132 | ENQUEUEPACKET(pTarang->RxAppControlHead,pTarang->RxAppControlTail, | 132 | ENQUEUEPACKET(pTarang->RxAppControlHead, pTarang->RxAppControlTail, |
133 | newPacket); | 133 | newPacket); |
134 | pTarang->AppCtrlQueueLen++; | 134 | pTarang->AppCtrlQueueLen++; |
135 | } | 135 | } |
136 | up(&Adapter->RxAppControlQueuelock); | 136 | up(&Adapter->RxAppControlQueuelock); |
137 | wake_up(&Adapter->process_read_wait_queue); | 137 | wake_up(&Adapter->process_read_wait_queue); |
138 | dev_kfree_skb(skb); | 138 | dev_kfree_skb(skb); |
139 | BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CP_CTRL_PKT, DBG_LVL_ALL, "After wake_up_interruptible"); | 139 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CP_CTRL_PKT, DBG_LVL_ALL, "After wake_up_interruptible"); |
140 | } | 140 | } |
141 | 141 | ||
142 | /** | 142 | /** |
143 | @ingroup ctrl_pkt_functions | 143 | @ingroup ctrl_pkt_functions |
144 | Thread to handle control pkt reception | 144 | Thread to handle control pkt reception |
145 | */ | 145 | */ |
146 | int control_packet_handler (PMINI_ADAPTER Adapter /**< pointer to adapter object*/ | 146 | int control_packet_handler(PMINI_ADAPTER Adapter /**< pointer to adapter object*/ |
147 | ) | 147 | ) |
148 | { | 148 | { |
149 | struct sk_buff *ctrl_packet= NULL; | 149 | struct sk_buff *ctrl_packet = NULL; |
150 | unsigned long flags = 0; | 150 | unsigned long flags = 0; |
151 | //struct timeval tv ; | 151 | //struct timeval tv; |
152 | //int *puiBuffer = NULL ; | 152 | //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!"); | 153 | 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) | 154 | while (1) |
155 | { | 155 | { |
156 | wait_event_interruptible(Adapter->process_rx_cntrlpkt, | 156 | wait_event_interruptible(Adapter->process_rx_cntrlpkt, |
157 | atomic_read(&Adapter->cntrlpktCnt) || | 157 | atomic_read(&Adapter->cntrlpktCnt) || |
158 | Adapter->bWakeUpDevice || | 158 | Adapter->bWakeUpDevice || |
159 | kthread_should_stop() | 159 | kthread_should_stop() |
160 | ); | 160 | ); |
161 | 161 | ||
162 | 162 | ||
163 | if(kthread_should_stop()) | 163 | if (kthread_should_stop()) |
164 | { | 164 | { |
165 | BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, CP_CTRL_PKT, DBG_LVL_ALL, "Exiting \n"); | 165 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CP_CTRL_PKT, DBG_LVL_ALL, "Exiting\n"); |
166 | return 0; | 166 | return 0; |
167 | } | 167 | } |
168 | if(TRUE == Adapter->bWakeUpDevice) | 168 | if (TRUE == Adapter->bWakeUpDevice) |
169 | { | 169 | { |
170 | Adapter->bWakeUpDevice = FALSE; | 170 | Adapter->bWakeUpDevice = FALSE; |
171 | if((FALSE == Adapter->bTriedToWakeUpFromlowPowerMode) && | 171 | if ((FALSE == Adapter->bTriedToWakeUpFromlowPowerMode) && |
172 | ((TRUE == Adapter->IdleMode)|| (TRUE == Adapter->bShutStatus))) | 172 | ((TRUE == Adapter->IdleMode) || (TRUE == Adapter->bShutStatus))) |
173 | { | 173 | { |
174 | BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, CP_CTRL_PKT, DBG_LVL_ALL, "Calling InterfaceAbortIdlemode\n"); | 174 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CP_CTRL_PKT, DBG_LVL_ALL, "Calling InterfaceAbortIdlemode\n"); |
175 | // Adapter->bTriedToWakeUpFromlowPowerMode = TRUE; | 175 | // Adapter->bTriedToWakeUpFromlowPowerMode = TRUE; |
176 | InterfaceIdleModeWakeup (Adapter); | 176 | InterfaceIdleModeWakeup(Adapter); |
177 | } | 177 | } |
178 | continue; | 178 | continue; |
179 | } | 179 | } |
180 | 180 | ||
181 | while(atomic_read(&Adapter->cntrlpktCnt)) | 181 | while (atomic_read(&Adapter->cntrlpktCnt)) |
182 | { | 182 | { |
183 | spin_lock_irqsave(&Adapter->control_queue_lock, flags); | 183 | spin_lock_irqsave(&Adapter->control_queue_lock, flags); |
184 | ctrl_packet = Adapter->RxControlHead; | 184 | ctrl_packet = Adapter->RxControlHead; |
185 | if(ctrl_packet) | 185 | if (ctrl_packet) |
186 | { | 186 | { |
187 | DEQUEUEPACKET(Adapter->RxControlHead,Adapter->RxControlTail); | 187 | DEQUEUEPACKET(Adapter->RxControlHead, Adapter->RxControlTail); |
188 | // Adapter->RxControlHead=ctrl_packet->next; | 188 | // Adapter->RxControlHead=ctrl_packet->next; |
189 | } | 189 | } |
190 | 190 | ||
191 | spin_unlock_irqrestore (&Adapter->control_queue_lock, flags); | 191 | spin_unlock_irqrestore(&Adapter->control_queue_lock, flags); |
192 | handle_rx_control_packet(Adapter, ctrl_packet); | 192 | handle_rx_control_packet(Adapter, ctrl_packet); |
193 | atomic_dec(&Adapter->cntrlpktCnt); | 193 | atomic_dec(&Adapter->cntrlpktCnt); |
194 | } | 194 | } |
195 | 195 | ||
@@ -201,14 +201,14 @@ int control_packet_handler (PMINI_ADAPTER Adapter /**< pointer to adapter obje | |||
201 | INT flushAllAppQ(void) | 201 | INT flushAllAppQ(void) |
202 | { | 202 | { |
203 | PMINI_ADAPTER Adapter = GET_BCM_ADAPTER(gblpnetdev); | 203 | PMINI_ADAPTER Adapter = GET_BCM_ADAPTER(gblpnetdev); |
204 | PPER_TARANG_DATA pTarang = NULL; | 204 | PPER_TARANG_DATA pTarang = NULL; |
205 | struct sk_buff *PacketToDrop = NULL; | 205 | struct sk_buff *PacketToDrop = NULL; |
206 | for(pTarang = Adapter->pTarangs; pTarang; pTarang = pTarang->next) | 206 | for (pTarang = Adapter->pTarangs; pTarang; pTarang = pTarang->next) |
207 | { | 207 | { |
208 | while(pTarang->RxAppControlHead != NULL) | 208 | while (pTarang->RxAppControlHead != NULL) |
209 | { | 209 | { |
210 | PacketToDrop=pTarang->RxAppControlHead; | 210 | PacketToDrop = pTarang->RxAppControlHead; |
211 | DEQUEUEPACKET(pTarang->RxAppControlHead,pTarang->RxAppControlTail); | 211 | DEQUEUEPACKET(pTarang->RxAppControlHead, pTarang->RxAppControlTail); |
212 | dev_kfree_skb(PacketToDrop); | 212 | dev_kfree_skb(PacketToDrop); |
213 | } | 213 | } |
214 | pTarang->AppCtrlQueueLen = 0; | 214 | pTarang->AppCtrlQueueLen = 0; |
@@ -216,7 +216,7 @@ INT flushAllAppQ(void) | |||
216 | memset((PVOID)&pTarang->stDroppedAppCntrlMsgs, 0, sizeof(S_MIBS_DROPPED_APP_CNTRL_MESSAGES)); | 216 | memset((PVOID)&pTarang->stDroppedAppCntrlMsgs, 0, sizeof(S_MIBS_DROPPED_APP_CNTRL_MESSAGES)); |
217 | 217 | ||
218 | } | 218 | } |
219 | return STATUS_SUCCESS ; | 219 | return STATUS_SUCCESS; |
220 | } | 220 | } |
221 | 221 | ||
222 | 222 | ||