diff options
author | Johannes Tenschert <Johannes.Tenschert@informatik.stud.uni-erlangen.de> | 2011-12-09 14:38:09 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-12-12 19:49:26 -0500 |
commit | 641b4bb5f1c51a68f5aec7d3b47c96b39820b105 (patch) | |
tree | 7dfebbda5abeb8bd5207a80aa5aa714d74853402 | |
parent | 8b34a1fb1e3f35eb4c9efa1d8df90d2b17332547 (diff) |
staging: bcm: HandleControlPacket.c: breaking of long lines
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 | 69 |
1 files changed, 45 insertions, 24 deletions
diff --git a/drivers/staging/bcm/HandleControlPacket.c b/drivers/staging/bcm/HandleControlPacket.c index f17530b3a732..b058e30b2ca6 100644 --- a/drivers/staging/bcm/HandleControlPacket.c +++ b/drivers/staging/bcm/HandleControlPacket.c | |||
@@ -26,26 +26,33 @@ static VOID handle_rx_control_packet(PMINI_ADAPTER Adapter, struct sk_buff *skb) | |||
26 | 26 | ||
27 | switch (usStatus) { | 27 | switch (usStatus) { |
28 | case CM_RESPONSES: /* 0xA0 */ | 28 | case CM_RESPONSES: /* 0xA0 */ |
29 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CP_CTRL_PKT, DBG_LVL_ALL, "MAC Version Seems to be Non Multi-Classifier, rejected by Driver"); | 29 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CP_CTRL_PKT, |
30 | DBG_LVL_ALL, | ||
31 | "MAC Version Seems to be Non Multi-Classifier, rejected by Driver"); | ||
30 | HighPriorityMessage = TRUE; | 32 | HighPriorityMessage = TRUE; |
31 | break; | 33 | break; |
32 | case CM_CONTROL_NEWDSX_MULTICLASSIFIER_RESP: | 34 | case CM_CONTROL_NEWDSX_MULTICLASSIFIER_RESP: |
33 | HighPriorityMessage = TRUE; | 35 | HighPriorityMessage = TRUE; |
34 | if (Adapter->LinkStatus == LINKUP_DONE) | 36 | if (Adapter->LinkStatus == LINKUP_DONE) |
35 | CmControlResponseMessage(Adapter, (skb->data + sizeof(USHORT))); | 37 | CmControlResponseMessage(Adapter, |
38 | (skb->data + sizeof(USHORT))); | ||
36 | break; | 39 | break; |
37 | case LINK_CONTROL_RESP: /* 0xA2 */ | 40 | case LINK_CONTROL_RESP: /* 0xA2 */ |
38 | case STATUS_RSP: /* 0xA1 */ | 41 | case STATUS_RSP: /* 0xA1 */ |
39 | 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, |
43 | DBG_LVL_ALL, "LINK_CONTROL_RESP"); | ||
40 | HighPriorityMessage = TRUE; | 44 | HighPriorityMessage = TRUE; |
41 | LinkControlResponseMessage(Adapter, (skb->data + sizeof(USHORT))); | 45 | LinkControlResponseMessage(Adapter, |
46 | (skb->data + sizeof(USHORT))); | ||
42 | break; | 47 | break; |
43 | case STATS_POINTER_RESP: /* 0xA6 */ | 48 | case STATS_POINTER_RESP: /* 0xA6 */ |
44 | HighPriorityMessage = TRUE; | 49 | HighPriorityMessage = TRUE; |
45 | StatisticsResponse(Adapter, (skb->data + sizeof(USHORT))); | 50 | StatisticsResponse(Adapter, (skb->data + sizeof(USHORT))); |
46 | break; | 51 | break; |
47 | case IDLE_MODE_STATUS: /* 0xA3 */ | 52 | case IDLE_MODE_STATUS: /* 0xA3 */ |
48 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CP_CTRL_PKT, DBG_LVL_ALL, "IDLE_MODE_STATUS Type Message Got from F/W"); | 53 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CP_CTRL_PKT, |
54 | DBG_LVL_ALL, | ||
55 | "IDLE_MODE_STATUS Type Message Got from F/W"); | ||
49 | InterfaceIdleModeRespond(Adapter, (PUINT)(skb->data + | 56 | InterfaceIdleModeRespond(Adapter, (PUINT)(skb->data + |
50 | sizeof(USHORT))); | 57 | sizeof(USHORT))); |
51 | HighPriorityMessage = TRUE; | 58 | HighPriorityMessage = TRUE; |
@@ -56,7 +63,8 @@ static VOID handle_rx_control_packet(PMINI_ADAPTER Adapter, struct sk_buff *skb) | |||
56 | break; | 63 | break; |
57 | 64 | ||
58 | default: | 65 | default: |
59 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CP_CTRL_PKT, DBG_LVL_ALL, "Got Default Response"); | 66 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CP_CTRL_PKT, |
67 | DBG_LVL_ALL, "Got Default Response"); | ||
60 | /* Let the Application Deal with This Packet */ | 68 | /* Let the Application Deal with This Packet */ |
61 | break; | 69 | break; |
62 | } | 70 | } |
@@ -85,8 +93,11 @@ static VOID handle_rx_control_packet(PMINI_ADAPTER Adapter, struct sk_buff *skb) | |||
85 | if (pTarang->RxCntrlMsgBitMask & (1 << cntrl_msg_mask_bit)) | 93 | if (pTarang->RxCntrlMsgBitMask & (1 << cntrl_msg_mask_bit)) |
86 | drop_pkt_flag = FALSE; | 94 | drop_pkt_flag = FALSE; |
87 | 95 | ||
88 | if ((drop_pkt_flag == TRUE) || (pTarang->AppCtrlQueueLen > MAX_APP_QUEUE_LEN) || | 96 | if ((drop_pkt_flag == TRUE) || |
89 | ((pTarang->AppCtrlQueueLen > MAX_APP_QUEUE_LEN / 2) && (HighPriorityMessage == FALSE))) { | 97 | (pTarang->AppCtrlQueueLen > MAX_APP_QUEUE_LEN) |
98 | || ((pTarang->AppCtrlQueueLen > | ||
99 | MAX_APP_QUEUE_LEN / 2) && | ||
100 | (HighPriorityMessage == FALSE))) { | ||
90 | /* | 101 | /* |
91 | * Assumption:- | 102 | * Assumption:- |
92 | * 1. every tarang manages it own dropped pkt | 103 | * 1. every tarang manages it own dropped pkt |
@@ -100,7 +111,7 @@ static VOID handle_rx_control_packet(PMINI_ADAPTER Adapter, struct sk_buff *skb) | |||
100 | pTarang->stDroppedAppCntrlMsgs.cm_responses++; | 111 | pTarang->stDroppedAppCntrlMsgs.cm_responses++; |
101 | break; | 112 | break; |
102 | case CM_CONTROL_NEWDSX_MULTICLASSIFIER_RESP: | 113 | case CM_CONTROL_NEWDSX_MULTICLASSIFIER_RESP: |
103 | pTarang->stDroppedAppCntrlMsgs.cm_control_newdsx_multiclassifier_resp++; | 114 | pTarang->stDroppedAppCntrlMsgs.cm_control_newdsx_multiclassifier_resp++; |
104 | break; | 115 | break; |
105 | case LINK_CONTROL_RESP: | 116 | case LINK_CONTROL_RESP: |
106 | pTarang->stDroppedAppCntrlMsgs.link_control_resp++; | 117 | pTarang->stDroppedAppCntrlMsgs.link_control_resp++; |
@@ -128,14 +139,15 @@ static VOID handle_rx_control_packet(PMINI_ADAPTER Adapter, struct sk_buff *skb) | |||
128 | newPacket = skb_clone(skb, GFP_KERNEL); | 139 | newPacket = skb_clone(skb, GFP_KERNEL); |
129 | if (!newPacket) | 140 | if (!newPacket) |
130 | break; | 141 | break; |
131 | ENQUEUEPACKET(pTarang->RxAppControlHead, pTarang->RxAppControlTail, | 142 | ENQUEUEPACKET(pTarang->RxAppControlHead, |
132 | newPacket); | 143 | pTarang->RxAppControlTail, newPacket); |
133 | pTarang->AppCtrlQueueLen++; | 144 | pTarang->AppCtrlQueueLen++; |
134 | } | 145 | } |
135 | up(&Adapter->RxAppControlQueuelock); | 146 | up(&Adapter->RxAppControlQueuelock); |
136 | wake_up(&Adapter->process_read_wait_queue); | 147 | wake_up(&Adapter->process_read_wait_queue); |
137 | dev_kfree_skb(skb); | 148 | dev_kfree_skb(skb); |
138 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CP_CTRL_PKT, DBG_LVL_ALL, "After wake_up_interruptible"); | 149 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CP_CTRL_PKT, DBG_LVL_ALL, |
150 | "After wake_up_interruptible"); | ||
139 | } | 151 | } |
140 | 152 | ||
141 | /** | 153 | /** |
@@ -148,23 +160,28 @@ int control_packet_handler(PMINI_ADAPTER Adapter /* pointer to adapter object*/) | |||
148 | unsigned long flags = 0; | 160 | unsigned long flags = 0; |
149 | /* struct timeval tv; */ | 161 | /* struct timeval tv; */ |
150 | /* int *puiBuffer = NULL; */ | 162 | /* int *puiBuffer = NULL; */ |
151 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CP_CTRL_PKT, DBG_LVL_ALL, "Entering to make thread wait on control packet event!"); | 163 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CP_CTRL_PKT, DBG_LVL_ALL, |
164 | "Entering to make thread wait on control packet event!"); | ||
152 | while (1) { | 165 | while (1) { |
153 | wait_event_interruptible(Adapter->process_rx_cntrlpkt, | 166 | wait_event_interruptible(Adapter->process_rx_cntrlpkt, |
154 | atomic_read(&Adapter->cntrlpktCnt) || | 167 | atomic_read(&Adapter->cntrlpktCnt) || |
155 | Adapter->bWakeUpDevice || | 168 | Adapter->bWakeUpDevice || |
156 | kthread_should_stop()); | 169 | kthread_should_stop()); |
157 | 170 | ||
158 | 171 | ||
159 | if (kthread_should_stop()) { | 172 | if (kthread_should_stop()) { |
160 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CP_CTRL_PKT, DBG_LVL_ALL, "Exiting\n"); | 173 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CP_CTRL_PKT, |
174 | DBG_LVL_ALL, "Exiting\n"); | ||
161 | return 0; | 175 | return 0; |
162 | } | 176 | } |
163 | if (TRUE == Adapter->bWakeUpDevice) { | 177 | if (TRUE == Adapter->bWakeUpDevice) { |
164 | Adapter->bWakeUpDevice = FALSE; | 178 | Adapter->bWakeUpDevice = FALSE; |
165 | if ((FALSE == Adapter->bTriedToWakeUpFromlowPowerMode) && | 179 | if ((FALSE == Adapter->bTriedToWakeUpFromlowPowerMode) |
166 | ((TRUE == Adapter->IdleMode) || (TRUE == Adapter->bShutStatus))) { | 180 | && ((TRUE == Adapter->IdleMode) || |
167 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, CP_CTRL_PKT, DBG_LVL_ALL, "Calling InterfaceAbortIdlemode\n"); | 181 | (TRUE == Adapter->bShutStatus))) { |
182 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, | ||
183 | CP_CTRL_PKT, DBG_LVL_ALL, | ||
184 | "Calling InterfaceAbortIdlemode\n"); | ||
168 | /* | 185 | /* |
169 | * Adapter->bTriedToWakeUpFromlowPowerMode | 186 | * Adapter->bTriedToWakeUpFromlowPowerMode |
170 | * = TRUE; | 187 | * = TRUE; |
@@ -178,11 +195,13 @@ int control_packet_handler(PMINI_ADAPTER Adapter /* pointer to adapter object*/) | |||
178 | spin_lock_irqsave(&Adapter->control_queue_lock, flags); | 195 | spin_lock_irqsave(&Adapter->control_queue_lock, flags); |
179 | ctrl_packet = Adapter->RxControlHead; | 196 | ctrl_packet = Adapter->RxControlHead; |
180 | if (ctrl_packet) { | 197 | if (ctrl_packet) { |
181 | DEQUEUEPACKET(Adapter->RxControlHead, Adapter->RxControlTail); | 198 | DEQUEUEPACKET(Adapter->RxControlHead, |
199 | Adapter->RxControlTail); | ||
182 | /* Adapter->RxControlHead=ctrl_packet->next; */ | 200 | /* Adapter->RxControlHead=ctrl_packet->next; */ |
183 | } | 201 | } |
184 | 202 | ||
185 | spin_unlock_irqrestore(&Adapter->control_queue_lock, flags); | 203 | spin_unlock_irqrestore(&Adapter->control_queue_lock, |
204 | flags); | ||
186 | handle_rx_control_packet(Adapter, ctrl_packet); | 205 | handle_rx_control_packet(Adapter, ctrl_packet); |
187 | atomic_dec(&Adapter->cntrlpktCnt); | 206 | atomic_dec(&Adapter->cntrlpktCnt); |
188 | } | 207 | } |
@@ -200,12 +219,14 @@ INT flushAllAppQ(void) | |||
200 | for (pTarang = Adapter->pTarangs; pTarang; pTarang = pTarang->next) { | 219 | for (pTarang = Adapter->pTarangs; pTarang; pTarang = pTarang->next) { |
201 | while (pTarang->RxAppControlHead != NULL) { | 220 | while (pTarang->RxAppControlHead != NULL) { |
202 | PacketToDrop = pTarang->RxAppControlHead; | 221 | PacketToDrop = pTarang->RxAppControlHead; |
203 | DEQUEUEPACKET(pTarang->RxAppControlHead, pTarang->RxAppControlTail); | 222 | DEQUEUEPACKET(pTarang->RxAppControlHead, |
223 | pTarang->RxAppControlTail); | ||
204 | dev_kfree_skb(PacketToDrop); | 224 | dev_kfree_skb(PacketToDrop); |
205 | } | 225 | } |
206 | pTarang->AppCtrlQueueLen = 0; | 226 | pTarang->AppCtrlQueueLen = 0; |
207 | /* dropped contrl packet statistics also should be reset. */ | 227 | /* dropped contrl packet statistics also should be reset. */ |
208 | memset((PVOID)&pTarang->stDroppedAppCntrlMsgs, 0, sizeof(S_MIBS_DROPPED_APP_CNTRL_MESSAGES)); | 228 | memset((PVOID)&pTarang->stDroppedAppCntrlMsgs, 0, |
229 | sizeof(S_MIBS_DROPPED_APP_CNTRL_MESSAGES)); | ||
209 | 230 | ||
210 | } | 231 | } |
211 | return STATUS_SUCCESS; | 232 | return STATUS_SUCCESS; |