nexmon – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 office 1 diff -Naur linux-2.6.28-pentoo-r4/drivers/staging/wlan-ng/hfa384x.c linux-2.6.28-pentoo-r4-fauxpas/drivers/staging/wlan-ng/hfa384x.c
2 --- linux-2.6.28-pentoo-r4/drivers/staging/wlan-ng/hfa384x.c 2008-12-24 18:26:37.000000000 -0500
3 +++ linux-2.6.28-pentoo-r4-fauxpas/drivers/staging/wlan-ng/hfa384x.c 2009-04-04 22:53:46.000000000 -0400
4 @@ -1873,8 +1873,16 @@
5  
6 DBFENTER;
7  
8 - cmd.cmd = HFA384x_CMD_CMDCODE_SET(HFA384x_CMDCODE_MONITOR) |
9 - HFA384x_CMD_AINFO_SET(enable);
10 +// cmd.cmd = HFA384x_CMD_CMDCODE_SET(HFA384x_CMDCODE_MONITOR) |
11 +// HFA384x_CMD_AINFO_SET(enable);
12 + if (enable == HFA384x_MONITOR_ENABLE) {
13 + // KoreK: get into test mode 0x0a
14 + cmd.cmd = HFA384x_CMD_CMDCODE_SET(HFA384x_CMDCODE_MONITOR) |
15 + HFA384x_CMD_AINFO_SET(0x0a);
16 + } else {
17 + cmd.cmd = HFA384x_CMD_CMDCODE_SET(HFA384x_CMDCODE_MONITOR) |
18 + HFA384x_CMD_AINFO_SET(enable);
19 + }
20 cmd.parm0 = 0;
21 cmd.parm1 = 0;
22 cmd.parm2 = 0;
23 @@ -3114,11 +3122,32 @@
24 #endif
25  
26 /* if we're using host WEP, increase size by IV+ICV */
27 - if (p80211_wep->data) {
28 - txdesc.data_len = host2hfa384x_16(skb->len+8);
29 - // txdesc.tx_control |= HFA384x_TX_NOENCRYPT_SET(1);
30 - } else {
31 - txdesc.data_len = host2hfa384x_16(skb->len);
32 +// if (p80211_wep->data) {
33 +// txdesc.data_len = host2hfa384x_16(skb->len+8);
34 +// // txdesc.tx_control |= HFA384x_TX_NOENCRYPT_SET(1);
35 +// } else {
36 +// txdesc.data_len = host2hfa384x_16(skb->len);
37 +// }
38 +
39 + if (skb->protocol != htons(ETH_P_80211_RAW)) {
40 + /* if we're using host WEP, increase size by IV+ICV */
41 + if (p80211_wep->data) {
42 + txdesc.data_len = host2hfa384x_16(skb->len+8);
43 + // txdesc.tx_control |= HFA384x_TX_NOENCRYPT_SET(1);
44 + } else {
45 + txdesc.data_len = host2hfa384x_16(skb->len);
46 + }
47 + } else {
48 + /* KoreK: raw injection (monitor mode): pull the rest of
49 + the header and ssanity check on txdesc.data_len */
50 + memcpy(&(txdesc.data_len), skb->data, 16);
51 + skb_pull(skb,16);
52 + if (txdesc.data_len != host2hfa384x_16(skb->len)) {
53 + printk(KERN_DEBUG "mismatch frame_len, drop frame\n");
54 + return 0;
55 + }
56 +
57 + txdesc.tx_control |= HFA384x_TX_RETRYSTRAT_SET(1);
58 }
59  
60 txdesc.tx_control = host2hfa384x_16(txdesc.tx_control);
61 @@ -3142,7 +3171,8 @@
62 spin_lock(&hw->cmdlock);
63  
64 /* Copy descriptor+payload to FID */
65 - if (p80211_wep->data) {
66 +// if (p80211_wep->data) {
67 + if (p80211_wep->data && (skb->protocol != htons(ETH_P_80211_RAW))) {
68 result = hfa384x_copy_to_bap4(hw, HFA384x_BAP_PROC, fid, 0,
69 &txdesc, sizeof(txdesc),
70 p80211_wep->iv, sizeof(p80211_wep->iv),
71 @@ -3588,6 +3618,17 @@
72 {
73 case 0:
74  
75 + /* KoreK: this testmode uses macport 0 */
76 + if ((wlandev->netdev->type == ARPHRD_IEEE80211) ||
77 + (wlandev->netdev->type == ARPHRD_IEEE80211_PRISM)) {
78 + if ( ! HFA384x_RXSTATUS_ISFCSERR(rxdesc.status) ) {
79 + hfa384x_int_rxmonitor( wlandev, rxfid, &rxdesc);
80 + } else {
81 + WLAN_LOG_DEBUG(3,"Received monitor frame: FCSerr set\n");
82 + }
83 + goto done;
84 + }
85 +
86 fc = ieee2host16(rxdesc.frame_control);
87  
88 /* If exclude and we receive an unencrypted, drop it */
89 diff -Naur linux-2.6.28-pentoo-r4/drivers/staging/wlan-ng/hfa384x_usb.c linux-2.6.28-pentoo-r4-fauxpas/drivers/staging/wlan-ng/hfa384x_usb.c
90 --- linux-2.6.28-pentoo-r4/drivers/staging/wlan-ng/hfa384x_usb.c 2008-12-24 18:26:37.000000000 -0500
91 +++ linux-2.6.28-pentoo-r4-fauxpas/drivers/staging/wlan-ng/hfa384x_usb.c 2009-04-04 23:13:53.000000000 -0400
92 @@ -1430,8 +1430,17 @@
93  
94 DBFENTER;
95  
96 - cmd.cmd = HFA384x_CMD_CMDCODE_SET(HFA384x_CMDCODE_MONITOR) |
97 - HFA384x_CMD_AINFO_SET(enable);
98 +// cmd.cmd = HFA384x_CMD_CMDCODE_SET(HFA384x_CMDCODE_MONITOR) |
99 +// HFA384x_CMD_AINFO_SET(enable);
100 + if (enable == HFA384x_MONITOR_ENABLE) {
101 + // KoreK: get into test mode 0x0a
102 + cmd.cmd = HFA384x_CMD_CMDCODE_SET(HFA384x_CMDCODE_MONITOR) |
103 + HFA384x_CMD_AINFO_SET(0x0a);
104 + } else {
105 + cmd.cmd = HFA384x_CMD_CMDCODE_SET(HFA384x_CMDCODE_MONITOR) |
106 + HFA384x_CMD_AINFO_SET(enable);
107 + }
108 +
109 cmd.parm0 = 0;
110 cmd.parm1 = 0;
111 cmd.parm2 = 0;
112 @@ -3431,37 +3440,71 @@
113 HFA384x_TX_MACPORT_SET(0) | HFA384x_TX_STRUCTYPE_SET(1) |
114 HFA384x_TX_TXEX_SET(0) | HFA384x_TX_TXOK_SET(0);
115 #endif
116 - hw->txbuff.txfrm.desc.tx_control =
117 - host2hfa384x_16(hw->txbuff.txfrm.desc.tx_control);
118 +// hw->txbuff.txfrm.desc.tx_control =
119 +// host2hfa384x_16(hw->txbuff.txfrm.desc.tx_control);
120  
121 - /* copy the header over to the txdesc */
122 - memcpy(&(hw->txbuff.txfrm.desc.frame_control), p80211_hdr, sizeof(p80211_hdr_t));
123 -
124 - /* if we're using host WEP, increase size by IV+ICV */
125 - if (p80211_wep->data) {
126 - hw->txbuff.txfrm.desc.data_len = host2hfa384x_16(skb->len+8);
127 - // hw->txbuff.txfrm.desc.tx_control |= HFA384x_TX_NOENCRYPT_SET(1);
128 - usbpktlen+=8;
129 - } else {
130 - hw->txbuff.txfrm.desc.data_len = host2hfa384x_16(skb->len);
131 +// /* copy the header over to the txdesc */
132 +// memcpy(&(hw->txbuff.txfrm.desc.frame_control), p80211_hdr, sizeof(p80211_hdr_t));
133 + if (skb->protocol != htons(ETH_P_80211_RAW)) {
134 + hw->txbuff.txfrm.desc.tx_control =
135 + host2hfa384x_16(hw->txbuff.txfrm.desc.tx_control);
136 +
137 + /* copy the header over to the txdesc */
138 + memcpy(&(hw->txbuff.txfrm.desc.frame_control), p80211_hdr,
139 + sizeof(p80211_hdr_t));
140 +
141 + /* if we're using host WEP, increase size by IV+ICV */
142 + if (p80211_wep->data) {
143 + hw->txbuff.txfrm.desc.data_len = host2hfa384x_16(skb->len+8);
144 + // hw->txbuff.txfrm.desc.tx_control |= HFA384x_TX_NOENCRYPT_SET(1);
145 + usbpktlen+=8;
146 + } else {
147 + hw->txbuff.txfrm.desc.data_len = host2hfa384x_16(skb->len);
148 + }
149 + } else {
150 + /* KoreK: raw injection (monitor mode): pull the rest of
151 + the header and ssanity check on txdesc.data_len */
152 + memcpy(&(hw->txbuff.txfrm.desc.data_len), skb->data, 16);
153 + skb_pull(skb,16);
154 + if (hw->txbuff.txfrm.desc.data_len != host2hfa384x_16(skb->len)) {
155 + printk(KERN_DEBUG "mismatch frame_len, drop frame\n");
156 + return 0;
157 + }
158 +// /* if we're using host WEP, increase size by IV+ICV */
159 +// if (p80211_wep->data) {
160 +// hw->txbuff.txfrm.desc.data_len = host2hfa384x_16(skb->len+8);
161 +// // hw->txbuff.txfrm.desc.tx_control |= HFA384x_TX_NOENCRYPT_SET(1);
162 +// usbpktlen+=8;
163 +// } else {
164 +// hw->txbuff.txfrm.desc.data_len = host2hfa384x_16(skb->len);
165 + hw->txbuff.txfrm.desc.tx_control |= HFA384x_TX_RETRYSTRAT_SET(1);
166 + hw->txbuff.txfrm.desc.tx_control =
167 + host2hfa384x_16(hw->txbuff.txfrm.desc.tx_control);
168 +
169 + /* copy the header over to the txdesc */
170 + memcpy(&(hw->txbuff.txfrm.desc.frame_control), p80211_hdr,
171 + sizeof(p80211_hdr_t));
172 }
173  
174 usbpktlen += skb->len;
175  
176 /* copy over the WEP IV if we are using host WEP */
177 ptr = hw->txbuff.txfrm.data;
178 - if (p80211_wep->data) {
179 +// if (p80211_wep->data) {
180 + if (p80211_wep->data && skb->protocol != htons(ETH_P_80211_RAW)) {
181 memcpy(ptr, p80211_wep->iv, sizeof(p80211_wep->iv));
182 ptr+= sizeof(p80211_wep->iv);
183 memcpy(ptr, p80211_wep->data, skb->len);
184 } else {
185 memcpy(ptr, skb->data, skb->len);
186 }
187 +
188 /* copy over the packet data */
189 ptr+= skb->len;
190  
191 /* copy over the WEP ICV if we are using host WEP */
192 - if (p80211_wep->data) {
193 +// if (p80211_wep->data) {
194 + if (p80211_wep->data && skb->protocol != htons(ETH_P_80211_RAW)) {
195 memcpy(ptr, p80211_wep->icv, sizeof(p80211_wep->icv));
196 }
197  
198 @@ -4223,6 +4266,17 @@
199 switch( HFA384x_RXSTATUS_MACPORT_GET(usbin->rxfrm.desc.status) )
200 {
201 case 0:
202 + /* KoreK: this testmode uses macport 0 */
203 + if ((wlandev->netdev->type == ARPHRD_IEEE80211) ||
204 + (wlandev->netdev->type == ARPHRD_IEEE80211_PRISM)) {
205 + if ( ! HFA384x_RXSTATUS_ISFCSERR(usbin->rxfrm.desc.status) ) {
206 + hfa384x_int_rxmonitor(wlandev, &usbin->rxfrm);
207 + } else {
208 + WLAN_LOG_DEBUG(3,"Received monitor frame: FCSerr set\n");
209 + }
210 + goto done;
211 + }
212 +
213 fc = ieee2host16(usbin->rxfrm.desc.frame_control);
214  
215 /* If exclude and we receive an unencrypted, drop it */
216 diff -Naur linux-2.6.28-pentoo-r4/drivers/staging/wlan-ng/p80211netdev.c linux-2.6.28-pentoo-r4-fauxpas/drivers/staging/wlan-ng/p80211netdev.c
217 --- linux-2.6.28-pentoo-r4/drivers/staging/wlan-ng/p80211netdev.c 2008-12-24 18:26:37.000000000 -0500
218 +++ linux-2.6.28-pentoo-r4-fauxpas/drivers/staging/wlan-ng/p80211netdev.c 2009-04-04 22:42:15.000000000 -0400
219 @@ -512,7 +512,7 @@
220 * and return success .
221 * TODO: we need a saner way to handle this
222 */
223 - if(skb->protocol != ETH_P_80211_RAW) {
224 + if(skb->protocol != htons(ETH_P_80211_RAW)) {
225 p80211netdev_start_queue(wlandev);
226 WLAN_LOG_NOTICE(
227 "Tx attempt prior to association, frame dropped.\n");
228 @@ -524,7 +524,7 @@
229 }
230  
231 /* Check for raw transmits */
232 - if(skb->protocol == ETH_P_80211_RAW) {
233 + if(skb->protocol == htons(ETH_P_80211_RAW)) {
234 if (!capable(CAP_NET_ADMIN)) {
235 result = 1;
236 goto failed;
237 @@ -952,8 +952,9 @@
238 dev->set_mac_address = p80211knetdev_set_mac_address;
239 #endif
240 #ifdef HAVE_TX_TIMEOUT
241 - dev->tx_timeout = &p80211knetdev_tx_timeout;
242 - dev->watchdog_timeo = (wlan_watchdog * HZ) / 1000;
243 +// korek: still not implemented (XXX: Why exactly do we remove this???)
244 +// dev->tx_timeout = &p80211knetdev_tx_timeout;
245 +// dev->watchdog_timeo = (wlan_watchdog * HZ) / 1000;
246 #endif
247 netif_carrier_off(dev);
248 }
249 diff -Naur linux-2.6.28-pentoo-r4/drivers/staging/wlan-ng/prism2mgmt.c linux-2.6.28-pentoo-r4-fauxpas/drivers/staging/wlan-ng/prism2mgmt.c
250 --- linux-2.6.28-pentoo-r4/drivers/staging/wlan-ng/prism2mgmt.c 2008-12-24 18:26:37.000000000 -0500
251 +++ linux-2.6.28-pentoo-r4-fauxpas/drivers/staging/wlan-ng/prism2mgmt.c 2009-04-04 23:18:35.000000000 -0400
252 @@ -2860,9 +2860,12 @@
253 }
254  
255 /* Now if we're already sniffing, we can skip the rest */
256 - if (wlandev->netdev->type != ARPHRD_ETHER) {
257 +// if (wlandev->netdev->type != ARPHRD_ETHER) {
258 + if ((wlandev->netdev->type != ARPHRD_IEEE80211) &&
259 + (wlandev->netdev->type != ARPHRD_IEEE80211_PRISM)) {
260 /* Set the port type to pIbss */
261 - word = HFA384x_PORTTYPE_PSUEDOIBSS;
262 +// word = HFA384x_PORTTYPE_PSUEDOIBSS;
263 + word = 5; // HFA384x_PORTTYPE_PSUEDOIBSS;
264 result = hfa384x_drvr_setconfig16(hw,
265 HFA384x_RID_CNFPORTTYPE, word);
266 if ( result ) {
267 @@ -2874,6 +2877,8 @@
268 }
269 if ((msg->keepwepflags.status == P80211ENUM_msgitem_status_data_ok) && (msg->keepwepflags.data != P80211ENUM_truth_true)) {
270 /* Set the wepflags for no decryption */
271 + /* doesn't work - done from the CLI */
272 + /* Fix? KoreK */
273 word = HFA384x_WEPFLAGS_DISABLE_TXCRYPT |
274 HFA384x_WEPFLAGS_DISABLE_RXCRYPT;
275 result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFWEPFLAGS, word);
276 @@ -2919,7 +2924,9 @@
277 goto failed;
278 }
279  
280 - if (wlandev->netdev->type == ARPHRD_ETHER) {
281 +// if (wlandev->netdev->type == ARPHRD_ETHER) {
282 + if ((wlandev->netdev->type != ARPHRD_IEEE80211) &&
283 + (wlandev->netdev->type != ARPHRD_IEEE80211_PRISM)) {
284 WLAN_LOG_INFO("monitor mode enabled\n");
285 }
286  
287 diff -Naur linux-2.6.28-pentoo-r4/drivers/staging/wlan-ng/prism2sta.c linux-2.6.28-pentoo-r4-fauxpas/drivers/staging/wlan-ng/prism2sta.c
288 --- linux-2.6.28-pentoo-r4/drivers/staging/wlan-ng/prism2sta.c 2008-12-24 18:26:37.000000000 -0500
289 +++ linux-2.6.28-pentoo-r4-fauxpas/drivers/staging/wlan-ng/prism2sta.c 2009-04-04 23:20:58.000000000 -0400
290 @@ -411,7 +411,9 @@
291 DBFENTER;
292  
293 /* If necessary, set the 802.11 WEP bit */
294 - if ((wlandev->hostwep & (HOSTWEP_PRIVACYINVOKED | HOSTWEP_ENCRYPT)) == HOSTWEP_PRIVACYINVOKED) {
295 +// if ((wlandev->hostwep & (HOSTWEP_PRIVACYINVOKED | HOSTWEP_ENCRYPT)) == HOSTWEP_PRIVACYINVOKED) {
296 + if (((wlandev->hostwep & (HOSTWEP_PRIVACYINVOKED | HOSTWEP_ENCRYPT)) == HOSTWEP_PRIVACYINVOKED)
297 + && (skb->protocol != htons(ETH_P_80211_RAW))) {
298 p80211_hdr->a3.fc |= host2ieee16(WLAN_SET_FC_ISWEP(1));
299 }