nexmon – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 office 1 diff -ur linux-wlan-ng-0.2.3/src/p80211/p80211netdev.c linux-wlan-ng-0.2.3-patched/src/p80211/p80211netdev.c
2 --- linux-wlan-ng-0.2.3/src/p80211/p80211netdev.c 2005-10-31 14:54:59.000000000 -0500
3 +++ linux-wlan-ng-0.2.3-patched/src/p80211/p80211netdev.c 2006-03-16 16:33:03.000000000 -0500
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 @@ -950,8 +950,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.3/src/prism2/driver/hfa384x.c linux-wlan-ng-0.2.3-patched/src/prism2/driver/hfa384x.c
35 --- linux-wlan-ng-0.2.3/src/prism2/driver/hfa384x.c 2005-07-20 11:07:16.000000000 -0400
36 +++ linux-wlan-ng-0.2.3-patched/src/prism2/driver/hfa384x.c 2006-03-17 11:03:09.000000000 -0500
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,34 @@
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  
95 txdesc.tx_control = host2hfa384x_16(txdesc.tx_control);
96 /* copy the header over to the txdesc */
97 @@ -3140,7 +3170,9 @@
98 spin_lock(&hw->cmdlock);
99  
100 /* Copy descriptor+payload to FID */
101 - if (p80211_wep->data) {
102 +
103 +// if (p80211_wep->data) {
104 + if (p80211_wep->data && (skb->protocol != htons(ETH_P_80211_RAW))) {
105 result = hfa384x_copy_to_bap4(hw, HFA384x_BAP_PROC, fid, 0,
106 &txdesc, sizeof(txdesc),
107 p80211_wep->iv, sizeof(p80211_wep->iv),
108 @@ -3586,6 +3618,17 @@
109 {
110 case 0:
111  
112 + /* KoreK: this testmode uses macport 0 */
113 + if ((wlandev->netdev->type == ARPHRD_IEEE80211) ||
114 + (wlandev->netdev->type == ARPHRD_IEEE80211_PRISM)) {
115 + if ( ! HFA384x_RXSTATUS_ISFCSERR(rxdesc.status) ) {
116 + hfa384x_int_rxmonitor( wlandev, rxfid, &rxdesc);
117 + } else {
118 + WLAN_LOG_DEBUG(3,"Received monitor frame: FCSerr set\n");
119 + }
120 + goto done;
121 + }
122 +
123 fc = ieee2host16(rxdesc.frame_control);
124  
125 /* If exclude and we receive an unencrypted, drop it */
126 diff -ur linux-wlan-ng-0.2.3/src/prism2/driver/hfa384x_usb.c linux-wlan-ng-0.2.3-patched/src/prism2/driver/hfa384x_usb.c
127 --- linux-wlan-ng-0.2.3/src/prism2/driver/hfa384x_usb.c 2005-10-31 14:52:36.000000000 -0500
128 +++ linux-wlan-ng-0.2.3-patched/src/prism2/driver/hfa384x_usb.c 2006-03-18 15:38:19.000000000 -0500
129 @@ -1398,8 +1398,16 @@
130  
131 DBFENTER;
132  
133 - cmd.cmd = HFA384x_CMD_CMDCODE_SET(HFA384x_CMDCODE_MONITOR) |
134 - HFA384x_CMD_AINFO_SET(enable);
135 +// cmd.cmd = HFA384x_CMD_CMDCODE_SET(HFA384x_CMDCODE_MONITOR) |
136 +// HFA384x_CMD_AINFO_SET(enable);
137 + if (enable == HFA384x_MONITOR_ENABLE) {
138 + // KoreK: get into test mode 0x0a
139 + cmd.cmd = HFA384x_CMD_CMDCODE_SET(HFA384x_CMDCODE_MONITOR) |
140 + HFA384x_CMD_AINFO_SET(0x0a);
141 + } else {
142 + cmd.cmd = HFA384x_CMD_CMDCODE_SET(HFA384x_CMDCODE_MONITOR) |
143 + HFA384x_CMD_AINFO_SET(enable);
144 + }
145 cmd.parm0 = 0;
146 cmd.parm1 = 0;
147 cmd.parm2 = 0;
148 @@ -3412,37 +3420,71 @@
149 HFA384x_TX_MACPORT_SET(0) | HFA384x_TX_STRUCTYPE_SET(1) |
150 HFA384x_TX_TXEX_SET(0) | HFA384x_TX_TXOK_SET(0);
151 #endif
152 - hw->txbuff.txfrm.desc.tx_control =
153 - host2hfa384x_16(hw->txbuff.txfrm.desc.tx_control);
154 -
155 - /* copy the header over to the txdesc */
156 - memcpy(&(hw->txbuff.txfrm.desc.frame_control), p80211_hdr, sizeof(p80211_hdr_t));
157 +// hw->txbuff.txfrm.desc.tx_control =
158 +// host2hfa384x_16(hw->txbuff.txfrm.desc.tx_control);
159  
160 - /* if we're using host WEP, increase size by IV+ICV */
161 - if (p80211_wep->data) {
162 - hw->txbuff.txfrm.desc.data_len = host2hfa384x_16(skb->len+8);
163 - // hw->txbuff.txfrm.desc.tx_control |= HFA384x_TX_NOENCRYPT_SET(1);
164 - usbpktlen+=8;
165 - } else {
166 - hw->txbuff.txfrm.desc.data_len = host2hfa384x_16(skb->len);
167 +// /* copy the header over to the txdesc */
168 +// memcpy(&(hw->txbuff.txfrm.desc.frame_control), p80211_hdr, sizeof(p80211_hdr_t));
169 + if (skb->protocol != htons(ETH_P_80211_RAW)) {
170 + hw->txbuff.txfrm.desc.tx_control =
171 + host2hfa384x_16(hw->txbuff.txfrm.desc.tx_control);
172 +
173 + /* copy the header over to the txdesc */
174 + memcpy(&(hw->txbuff.txfrm.desc.frame_control), p80211_hdr,
175 + sizeof(p80211_hdr_t));
176 +
177 + /* if we're using host WEP, increase size by IV+ICV */
178 + if (p80211_wep->data) {
179 + hw->txbuff.txfrm.desc.data_len = host2hfa384x_16(skb->len+8);
180 + // hw->txbuff.txfrm.desc.tx_control |= HFA384x_TX_NOENCRYPT_SET(1);
181 + usbpktlen+=8;
182 + } else {
183 + hw->txbuff.txfrm.desc.data_len = host2hfa384x_16(skb->len);
184 + }
185 + } else {
186 + /* KoreK: raw injection (monitor mode): pull the rest of
187 + the header and ssanity check on txdesc.data_len */
188 + memcpy(&(hw->txbuff.txfrm.desc.data_len), skb->data, 16);
189 + skb_pull(skb,16);
190 + if (hw->txbuff.txfrm.desc.data_len != host2hfa384x_16(skb->len)) {
191 + printk(KERN_DEBUG "mismatch frame_len, drop frame\n");
192 + return 0;
193 + }
194 +// /* if we're using host WEP, increase size by IV+ICV */
195 +// if (p80211_wep->data) {
196 +// hw->txbuff.txfrm.desc.data_len = host2hfa384x_16(skb->len+8);
197 +// // hw->txbuff.txfrm.desc.tx_control |= HFA384x_TX_NOENCRYPT_SET(1);
198 +// usbpktlen+=8;
199 +// } else {
200 +// hw->txbuff.txfrm.desc.data_len = host2hfa384x_16(skb->len);
201 + hw->txbuff.txfrm.desc.tx_control |= HFA384x_TX_RETRYSTRAT_SET(1);
202 + hw->txbuff.txfrm.desc.tx_control =
203 + host2hfa384x_16(hw->txbuff.txfrm.desc.tx_control);
204 +
205 + /* copy the header over to the txdesc */
206 + memcpy(&(hw->txbuff.txfrm.desc.frame_control), p80211_hdr,
207 + sizeof(p80211_hdr_t));
208 }
209  
210 usbpktlen += skb->len;
211  
212 /* copy over the WEP IV if we are using host WEP */
213 ptr = hw->txbuff.txfrm.data;
214 - if (p80211_wep->data) {
215 +// if (p80211_wep->data) {
216 + if (p80211_wep->data && skb->protocol != htons(ETH_P_80211_RAW)) {
217 memcpy(ptr, p80211_wep->iv, sizeof(p80211_wep->iv));
218 ptr+= sizeof(p80211_wep->iv);
219 memcpy(ptr, p80211_wep->data, skb->len);
220 } else {
221 memcpy(ptr, skb->data, skb->len);
222 }
223 +
224 /* copy over the packet data */
225 ptr+= skb->len;
226  
227 /* copy over the WEP ICV if we are using host WEP */
228 - if (p80211_wep->data) {
229 +// if (p80211_wep->data) {
230 + if (p80211_wep->data && skb->protocol != htons(ETH_P_80211_RAW)) {
231 memcpy(ptr, p80211_wep->icv, sizeof(p80211_wep->icv));
232 }
233  
234 @@ -4203,6 +4245,17 @@
235 switch( HFA384x_RXSTATUS_MACPORT_GET(usbin->rxfrm.desc.status) )
236 {
237 case 0:
238 + /* KoreK: this testmode uses macport 0 */
239 + if ((wlandev->netdev->type == ARPHRD_IEEE80211) ||
240 + (wlandev->netdev->type == ARPHRD_IEEE80211_PRISM)) {
241 + if ( ! HFA384x_RXSTATUS_ISFCSERR(usbin->rxfrm.desc.status) ) {
242 + hfa384x_int_rxmonitor(wlandev, &usbin->rxfrm);
243 + } else {
244 + WLAN_LOG_DEBUG(3,"Received monitor frame: FCSerr set\n");
245 + }
246 + goto done;
247 + }
248 +
249 fc = ieee2host16(usbin->rxfrm.desc.frame_control);
250  
251 /* If exclude and we receive an unencrypted, drop it */
252 diff -ur linux-wlan-ng-0.2.3/src/prism2/driver/prism2mgmt.c linux-wlan-ng-0.2.3-patched/src/prism2/driver/prism2mgmt.c
253 --- linux-wlan-ng-0.2.3/src/prism2/driver/prism2mgmt.c 2005-06-22 10:16:55.000000000 -0400
254 +++ linux-wlan-ng-0.2.3-patched/src/prism2/driver/prism2mgmt.c 2006-03-18 15:21:03.000000000 -0500
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.3/src/prism2/driver/prism2sta.c linux-wlan-ng-0.2.3-patched/src/prism2/driver/prism2sta.c
291 --- linux-wlan-ng-0.2.3/src/prism2/driver/prism2sta.c 2005-10-07 17:32:44.000000000 -0400
292 +++ linux-wlan-ng-0.2.3-patched/src/prism2/driver/prism2sta.c 2006-03-18 15:15:00.000000000 -0500
293 @@ -410,7 +410,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