nexmon – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 office 1 diff -ru linux-wlan-ng-0.2.5/src/p80211/p80211netdev.c linux-wlan-ng-0.2.5-patched/src/p80211/p80211netdev.c
2 --- linux-wlan-ng-0.2.5/src/p80211/p80211netdev.c 2006-08-31 15:40:47.000000000 +0200
3 +++ linux-wlan-ng-0.2.5-patched/src/p80211/p80211netdev.c 2007-01-05 09:34:01.000000000 +0100
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 -ru linux-wlan-ng-0.2.5/src/prism2/driver/hfa384x.c linux-wlan-ng-0.2.5-patched/src/prism2/driver/hfa384x.c
35 --- linux-wlan-ng-0.2.5/src/prism2/driver/hfa384x.c 2006-08-03 16:00:04.000000000 +0200
36 +++ linux-wlan-ng-0.2.5-patched/src/prism2/driver/hfa384x.c 2007-01-05 09:38:13.000000000 +0100
37 @@ -1871,8 +1871,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 @@ -3112,12 +3120,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 @@ -3140,7 +3169,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 @@ -3585,6 +3615,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 diff -ru linux-wlan-ng-0.2.5/src/prism2/driver/hfa384x_usb.c linux-wlan-ng-0.2.5-patched/src/prism2/driver/hfa384x_usb.c
125 --- linux-wlan-ng-0.2.5/src/prism2/driver/hfa384x_usb.c 2006-04-03 18:12:03.000000000 +0200
126 +++ linux-wlan-ng-0.2.5-patched/src/prism2/driver/hfa384x_usb.c 2007-01-05 09:46:13.000000000 +0100
127 @@ -1428,8 +1428,16 @@
128  
129 DBFENTER;
130  
131 - cmd.cmd = HFA384x_CMD_CMDCODE_SET(HFA384x_CMDCODE_MONITOR) |
132 - HFA384x_CMD_AINFO_SET(enable);
133 + // cmd.cmd = HFA384x_CMD_CMDCODE_SET(HFA384x_CMDCODE_MONITOR) |
134 + // HFA384x_CMD_AINFO_SET(enable);
135 + if (enable == HFA384x_MONITOR_ENABLE) {
136 + // KoreK: get into test mode 0x0a
137 + cmd.cmd = HFA384x_CMD_CMDCODE_SET(HFA384x_CMDCODE_MONITOR) |
138 + HFA384x_CMD_AINFO_SET(0x0a);
139 + } else {
140 + cmd.cmd = HFA384x_CMD_CMDCODE_SET(HFA384x_CMDCODE_MONITOR) |
141 + HFA384x_CMD_AINFO_SET(enable);
142 + }
143 cmd.parm0 = 0;
144 cmd.parm1 = 0;
145 cmd.parm2 = 0;
146 @@ -3429,37 +3437,71 @@
147 HFA384x_TX_MACPORT_SET(0) | HFA384x_TX_STRUCTYPE_SET(1) |
148 HFA384x_TX_TXEX_SET(0) | HFA384x_TX_TXOK_SET(0);
149 #endif
150 - hw->txbuff.txfrm.desc.tx_control =
151 - host2hfa384x_16(hw->txbuff.txfrm.desc.tx_control);
152 -
153 - /* copy the header over to the txdesc */
154 - memcpy(&(hw->txbuff.txfrm.desc.frame_control), p80211_hdr, sizeof(p80211_hdr_t));
155 + // hw->txbuff.txfrm.desc.tx_control =
156 + // host2hfa384x_16(hw->txbuff.txfrm.desc.tx_control);
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 + // /* copy the header over to the txdesc */
166 + // memcpy(&(hw->txbuff.txfrm.desc.frame_control), p80211_hdr, sizeof(p80211_hdr_t));
167 + if (skb->protocol != htons(ETH_P_80211_RAW)) {
168 + hw->txbuff.txfrm.desc.tx_control =
169 + host2hfa384x_16(hw->txbuff.txfrm.desc.tx_control);
170 +
171 + /* copy the header over to the txdesc */
172 + memcpy(&(hw->txbuff.txfrm.desc.frame_control), p80211_hdr,
173 + sizeof(p80211_hdr_t));
174 +
175 + /* if we're using host WEP, increase size by IV+ICV */
176 + if (p80211_wep->data) {
177 + hw->txbuff.txfrm.desc.data_len = host2hfa384x_16(skb->len+8);
178 + // hw->txbuff.txfrm.desc.tx_control |= HFA384x_TX_NOENCRYPT_SET(1);
179 + usbpktlen+=8;
180 + } else {
181 + hw->txbuff.txfrm.desc.data_len = host2hfa384x_16(skb->len);
182 + }
183 + } else {
184 + /* KoreK: raw injection (monitor mode): pull the rest of
185 + the header and ssanity check on txdesc.data_len */
186 + memcpy(&(hw->txbuff.txfrm.desc.data_len), skb->data, 16);
187 + skb_pull(skb,16);
188 + if (hw->txbuff.txfrm.desc.data_len != host2hfa384x_16(skb->len)) {
189 + printk(KERN_DEBUG "mismatch frame_len, drop frame\n");
190 + return 0;
191 + }
192 + // /* if we're using host WEP, increase size by IV+ICV */
193 + // if (p80211_wep->data) {
194 + // hw->txbuff.txfrm.desc.data_len = host2hfa384x_16(skb->len+8);
195 + // // hw->txbuff.txfrm.desc.tx_control |= HFA384x_TX_NOENCRYPT_SET(1);
196 + // usbpktlen+=8;
197 + // } else {
198 + // hw->txbuff.txfrm.desc.data_len = host2hfa384x_16(skb->len);
199 + hw->txbuff.txfrm.desc.tx_control |= HFA384x_TX_RETRYSTRAT_SET(1);
200 + hw->txbuff.txfrm.desc.tx_control =
201 + host2hfa384x_16(hw->txbuff.txfrm.desc.tx_control);
202 +
203 + /* copy the header over to the txdesc */
204 + memcpy(&(hw->txbuff.txfrm.desc.frame_control), p80211_hdr,
205 + sizeof(p80211_hdr_t));
206 }
207  
208 usbpktlen += skb->len;
209  
210 /* copy over the WEP IV if we are using host WEP */
211 ptr = hw->txbuff.txfrm.data;
212 - if (p80211_wep->data) {
213 + // if (p80211_wep->data) {
214 + if (p80211_wep->data && skb->protocol != htons(ETH_P_80211_RAW)) {
215 memcpy(ptr, p80211_wep->iv, sizeof(p80211_wep->iv));
216 ptr+= sizeof(p80211_wep->iv);
217 memcpy(ptr, p80211_wep->data, skb->len);
218 } else {
219 memcpy(ptr, skb->data, skb->len);
220 }
221 +
222 /* copy over the packet data */
223 ptr+= skb->len;
224  
225 /* copy over the WEP ICV if we are using host WEP */
226 - if (p80211_wep->data) {
227 + // if (p80211_wep->data) {
228 + if (p80211_wep->data && skb->protocol != htons(ETH_P_80211_RAW)) {
229 memcpy(ptr, p80211_wep->icv, sizeof(p80211_wep->icv));
230 }
231  
232 @@ -4221,6 +4263,17 @@
233 switch( HFA384x_RXSTATUS_MACPORT_GET(usbin->rxfrm.desc.status) )
234 {
235 case 0:
236 + /* KoreK: this testmode uses macport 0 */
237 + if ((wlandev->netdev->type == ARPHRD_IEEE80211) ||
238 + (wlandev->netdev->type == ARPHRD_IEEE80211_PRISM)) {
239 + if ( ! HFA384x_RXSTATUS_ISFCSERR(usbin->rxfrm.desc.status) ) {
240 + hfa384x_int_rxmonitor(wlandev, &usbin->rxfrm);
241 + } else {
242 + WLAN_LOG_DEBUG(3,"Received monitor frame: FCSerr set\n");
243 + }
244 + goto done;
245 + }
246 +
247 fc = ieee2host16(usbin->rxfrm.desc.frame_control);
248  
249 /* If exclude and we receive an unencrypted, drop it */
250 diff -ru linux-wlan-ng-0.2.5/src/prism2/driver/prism2mgmt.c linux-wlan-ng-0.2.5-patched/src/prism2/driver/prism2mgmt.c
251 --- linux-wlan-ng-0.2.5/src/prism2/driver/prism2mgmt.c 2005-06-22 16:16:55.000000000 +0200
252 +++ linux-wlan-ng-0.2.5-patched/src/prism2/driver/prism2mgmt.c 2007-01-05 09:49:13.000000000 +0100
253 @@ -2860,9 +2860,12 @@
254 }
255  
256 /* Now if we're already sniffing, we can skip the rest */
257 - if (wlandev->netdev->type != ARPHRD_ETHER) {
258 + // if (wlandev->netdev->type != ARPHRD_ETHER) {
259 + if ((wlandev->netdev->type != ARPHRD_IEEE80211) &&
260 + (wlandev->netdev->type != ARPHRD_IEEE80211_PRISM)) {
261 /* Set the port type to pIbss */
262 - word = HFA384x_PORTTYPE_PSUEDOIBSS;
263 + // word = HFA384x_PORTTYPE_PSUEDOIBSS;
264 + word = 5; // HFA384x_PORTTYPE_PSUEDOIBSS;
265 result = hfa384x_drvr_setconfig16(hw,
266 HFA384x_RID_CNFPORTTYPE, word);
267 if ( result ) {
268 @@ -2874,6 +2877,8 @@
269 }
270 if ((msg->keepwepflags.status == P80211ENUM_msgitem_status_data_ok) && (msg->keepwepflags.data != P80211ENUM_truth_true)) {
271 /* Set the wepflags for no decryption */
272 + /* doesn't work - done from the CLI */
273 + /* Fix? KoreK */
274 word = HFA384x_WEPFLAGS_DISABLE_TXCRYPT |
275 HFA384x_WEPFLAGS_DISABLE_RXCRYPT;
276 result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFWEPFLAGS, word);
277 @@ -2919,7 +2924,9 @@
278 goto failed;
279 }
280  
281 - if (wlandev->netdev->type == ARPHRD_ETHER) {
282 + // if (wlandev->netdev->type == ARPHRD_ETHER) {
283 + if ((wlandev->netdev->type != ARPHRD_IEEE80211) &&
284 + (wlandev->netdev->type != ARPHRD_IEEE80211_PRISM)) {
285 WLAN_LOG_INFO("monitor mode enabled\n");
286 }
287  
288 diff -ru linux-wlan-ng-0.2.5/src/prism2/driver/prism2sta.c linux-wlan-ng-0.2.5-patched/src/prism2/driver/prism2sta.c
289 --- linux-wlan-ng-0.2.5/src/prism2/driver/prism2sta.c 2006-01-19 22:25:50.000000000 +0100
290 +++ linux-wlan-ng-0.2.5-patched/src/prism2/driver/prism2sta.c 2007-01-05 09:49:50.000000000 +0100
291 @@ -410,7 +410,9 @@
292 DBFENTER;
293  
294 /* If necessary, set the 802.11 WEP bit */
295 - if ((wlandev->hostwep & (HOSTWEP_PRIVACYINVOKED | HOSTWEP_ENCRYPT)) == HOSTWEP_PRIVACYINVOKED) {
296 + // if ((wlandev->hostwep & (HOSTWEP_PRIVACYINVOKED | HOSTWEP_ENCRYPT)) == HOSTWEP_PRIVACYINVOKED) {
297 + if (((wlandev->hostwep & (HOSTWEP_PRIVACYINVOKED | HOSTWEP_ENCRYPT)) == HOSTWEP_PRIVACYINVOKED)
298 + && (skb->protocol != htons(ETH_P_80211_RAW))) {
299 p80211_hdr->a3.fc |= host2ieee16(WLAN_SET_FC_ISWEP(1));
300 }
301