nexmon – Blame information for rev 1

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