nexmon – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | diff -ur ../hostap-driver-0.3.9/driver/modules/hostap.c ./driver/modules/hostap.c |
2 | --- ../hostap-driver-0.3.9/driver/modules/hostap.c 2004-08-28 05:26:46.000000000 +0200 |
||
3 | +++ ./driver/modules/hostap.c 2005-07-29 12:13:38.000000000 +0200 |
||
4 | @@ -401,7 +401,7 @@ |
||
5 | if (local->iw_mode == IW_MODE_REPEAT) |
||
6 | return HFA384X_PORTTYPE_WDS; |
||
7 | if (local->iw_mode == IW_MODE_MONITOR) |
||
8 | - return HFA384X_PORTTYPE_PSEUDO_IBSS; |
||
9 | + return 5; /*HFA384X_PORTTYPE_PSEUDO_IBSS;*/ |
||
10 | return HFA384X_PORTTYPE_HOSTAP; |
||
11 | } |
||
12 | |||
13 | diff -ur ../hostap-driver-0.3.9/driver/modules/hostap_80211_tx.c ./driver/modules/hostap_80211_tx.c |
||
14 | --- ../hostap-driver-0.3.9/driver/modules/hostap_80211_tx.c 2004-07-06 01:45:01.000000000 +0200 |
||
15 | +++ ./driver/modules/hostap_80211_tx.c 2005-07-29 12:26:05.000000000 +0200 |
||
16 | @@ -51,6 +51,9 @@ |
||
17 | int to_assoc_ap = 0; |
||
18 | struct hostap_skb_tx_data *meta; |
||
19 | |||
20 | + if (local->iw_mode == IW_MODE_MONITOR) |
||
21 | + goto xmit; |
||
22 | + |
||
23 | if (skb->len < ETH_HLEN) { |
||
24 | printk(KERN_DEBUG "%s: hostap_data_start_xmit: short skb " |
||
25 | "(len=%d)\n", dev->name, skb->len); |
||
26 | @@ -216,6 +219,7 @@ |
||
27 | memcpy(skb_put(skb, ETH_ALEN), &hdr.addr4, ETH_ALEN); |
||
28 | } |
||
29 | |||
30 | +xmit: |
||
31 | iface->stats.tx_packets++; |
||
32 | iface->stats.tx_bytes += skb->len; |
||
33 | |||
34 | @@ -376,8 +380,6 @@ |
||
35 | } |
||
36 | |||
37 | if (skb->len < 24) { |
||
38 | - printk(KERN_DEBUG "%s: hostap_master_start_xmit: short skb " |
||
39 | - "(len=%d)\n", dev->name, skb->len); |
||
40 | ret = 0; |
||
41 | iface->stats.tx_dropped++; |
||
42 | goto fail; |
||
43 | diff -ur ../hostap-driver-0.3.9/driver/modules/hostap_config.h ./driver/modules/hostap_config.h |
||
44 | --- ../hostap-driver-0.3.9/driver/modules/hostap_config.h 2005-06-11 05:03:36.000000000 +0200 |
||
45 | +++ ./driver/modules/hostap_config.h 2005-07-29 12:13:38.000000000 +0200 |
||
46 | @@ -59,7 +59,7 @@ |
||
47 | * In addition, please note that it is possible to kill your card with |
||
48 | * non-volatile download if you are using incorrect image. This feature has not |
||
49 | * been fully tested, so please be careful with it. */ |
||
50 | -/* #define PRISM2_NON_VOLATILE_DOWNLOAD */ |
||
51 | +#define PRISM2_NON_VOLATILE_DOWNLOAD |
||
52 | #endif /* PRISM2_DOWNLOAD_SUPPORT */ |
||
53 | |||
54 | /* Include wireless extensions sub-ioctl support even if wireless extensions |
||
55 | diff -ur ../hostap-driver-0.3.9/driver/modules/hostap_hw.c ./driver/modules/hostap_hw.c |
||
56 | --- ../hostap-driver-0.3.9/driver/modules/hostap_hw.c 2005-05-18 05:31:21.000000000 +0200 |
||
57 | +++ ./driver/modules/hostap_hw.c 2005-07-29 12:13:38.000000000 +0200 |
||
58 | @@ -1005,6 +1005,35 @@ |
||
59 | return fid; |
||
60 | } |
||
61 | |||
62 | +static int prism2_monitor_enable(struct net_device *dev) |
||
63 | +{ |
||
64 | + if (hostap_set_word(dev, HFA384X_RID_CNFPORTTYPE, 5)) { |
||
65 | + printk(KERN_DEBUG "Port type setting for monitor mode " |
||
66 | + "failed\n"); |
||
67 | + return -EOPNOTSUPP; |
||
68 | + } |
||
69 | + |
||
70 | + if (hfa384x_cmd(dev, HFA384X_CMDCODE_TEST | (0x0a << 8), |
||
71 | + 0, NULL, NULL)) { |
||
72 | + printk(KERN_DEBUG "Could not enter testmode 0x0a\n"); |
||
73 | + return -EOPNOTSUPP; |
||
74 | + } |
||
75 | + |
||
76 | + if (hostap_set_word(dev, HFA384X_RID_CNFWEPFLAGS, |
||
77 | + HFA384X_WEPFLAGS_PRIVACYINVOKED | |
||
78 | + HFA384X_WEPFLAGS_HOSTENCRYPT | |
||
79 | + HFA384X_WEPFLAGS_HOSTDECRYPT)) { |
||
80 | + printk(KERN_DEBUG "WEP flags setting failed\n"); |
||
81 | + return -EOPNOTSUPP; |
||
82 | + } |
||
83 | + |
||
84 | + if (hostap_set_word(dev, HFA384X_RID_PROMISCUOUSMODE, 1)) { |
||
85 | + printk(KERN_DEBUG "Could not set promiscuous mode\n"); |
||
86 | + return -EOPNOTSUPP; |
||
87 | + } |
||
88 | + |
||
89 | + return 0; |
||
90 | +} |
||
91 | |||
92 | static int prism2_reset_port(struct net_device *dev) |
||
93 | { |
||
94 | @@ -1028,6 +1057,10 @@ |
||
95 | "port\n", dev->name); |
||
96 | } |
||
97 | |||
98 | + if (local->iw_mode == IW_MODE_MONITOR) |
||
99 | + /* force mode 0x0a after port 0 reset */ |
||
100 | + return prism2_monitor_enable(dev); |
||
101 | + |
||
102 | /* It looks like at least some STA firmware versions reset |
||
103 | * fragmentation threshold back to 2346 after enable command. Restore |
||
104 | * the configured value, if it differs from this default. */ |
||
105 | @@ -1444,6 +1477,10 @@ |
||
106 | return 1; |
||
107 | } |
||
108 | |||
109 | + if (local->iw_mode == IW_MODE_MONITOR) |
||
110 | + /* force mode 0x0a after port 0 reset */ |
||
111 | + prism2_monitor_enable(dev); |
||
112 | + |
||
113 | local->hw_ready = 1; |
||
114 | local->hw_reset_tries = 0; |
||
115 | local->hw_resetting = 0; |
||
116 | @@ -3259,6 +3296,7 @@ |
||
117 | local->func->hw_config = prism2_hw_config; |
||
118 | local->func->hw_reset = prism2_hw_reset; |
||
119 | local->func->hw_shutdown = prism2_hw_shutdown; |
||
120 | + local->func->monitor_enable = prism2_monitor_enable; |
||
121 | local->func->reset_port = prism2_reset_port; |
||
122 | local->func->schedule_reset = prism2_schedule_reset; |
||
123 | #ifdef PRISM2_DOWNLOAD_SUPPORT |
||
124 | diff -ur ../hostap-driver-0.3.9/driver/modules/hostap_ioctl.c ./driver/modules/hostap_ioctl.c |
||
125 | --- ../hostap-driver-0.3.9/driver/modules/hostap_ioctl.c 2005-05-18 05:33:28.000000000 +0200 |
||
126 | +++ ./driver/modules/hostap_ioctl.c 2005-07-29 12:13:38.000000000 +0200 |
||
127 | @@ -1067,33 +1067,7 @@ |
||
128 | |||
129 | printk(KERN_DEBUG "Enabling monitor mode\n"); |
||
130 | hostap_monitor_set_type(local); |
||
131 | - |
||
132 | - if (hostap_set_word(dev, HFA384X_RID_CNFPORTTYPE, |
||
133 | - HFA384X_PORTTYPE_PSEUDO_IBSS)) { |
||
134 | - printk(KERN_DEBUG "Port type setting for monitor mode " |
||
135 | - "failed\n"); |
||
136 | - return -EOPNOTSUPP; |
||
137 | - } |
||
138 | - |
||
139 | - /* Host decrypt is needed to get the IV and ICV fields; |
||
140 | - * however, monitor mode seems to remove WEP flag from frame |
||
141 | - * control field */ |
||
142 | - if (hostap_set_word(dev, HFA384X_RID_CNFWEPFLAGS, |
||
143 | - HFA384X_WEPFLAGS_HOSTENCRYPT | |
||
144 | - HFA384X_WEPFLAGS_HOSTDECRYPT)) { |
||
145 | - printk(KERN_DEBUG "WEP flags setting failed\n"); |
||
146 | - return -EOPNOTSUPP; |
||
147 | - } |
||
148 | - |
||
149 | - if (local->func->reset_port(dev) || |
||
150 | - local->func->cmd(dev, HFA384X_CMDCODE_TEST | |
||
151 | - (HFA384X_TEST_MONITOR << 8), |
||
152 | - 0, NULL, NULL)) { |
||
153 | - printk(KERN_DEBUG "Setting monitor mode failed\n"); |
||
154 | - return -EOPNOTSUPP; |
||
155 | - } |
||
156 | - |
||
157 | - return 0; |
||
158 | + return local->func->reset_port(dev); |
||
159 | } |
||
160 | |||
161 | |||
162 | @@ -1159,7 +1133,7 @@ |
||
163 | local->iw_mode = *mode; |
||
164 | |||
165 | if (local->iw_mode == IW_MODE_MONITOR) |
||
166 | - hostap_monitor_mode_enable(local); |
||
167 | + return hostap_monitor_mode_enable(local); |
||
168 | else if (local->iw_mode == IW_MODE_MASTER && !local->host_encrypt && |
||
169 | !local->fw_encrypt_ok) { |
||
170 | printk(KERN_DEBUG "%s: defaulting to host-based encryption as " |
||
171 | diff -ur ../hostap-driver-0.3.9/driver/modules/hostap_wlan.h ./driver/modules/hostap_wlan.h |
||
172 | --- ../hostap-driver-0.3.9/driver/modules/hostap_wlan.h 2005-05-18 05:31:22.000000000 +0200 |
||
173 | +++ ./driver/modules/hostap_wlan.h 2005-07-29 12:13:38.000000000 +0200 |
||
174 | @@ -591,6 +591,7 @@ |
||
175 | int (*hw_config)(struct net_device *dev, int initial); |
||
176 | void (*hw_reset)(struct net_device *dev); |
||
177 | void (*hw_shutdown)(struct net_device *dev, int no_disable); |
||
178 | + int (*monitor_enable)(struct net_device *dev); |
||
179 | int (*reset_port)(struct net_device *dev); |
||
180 | void (*schedule_reset)(local_info_t *local); |
||
181 | int (*download)(local_info_t *local, |