]> git.pld-linux.org Git - packages/kernel.git/blame - kernel-hostap.patch
Up to 5.15.28.
[packages/kernel.git] / kernel-hostap.patch
CommitLineData
e3fad6a6
AM
1diff -urNp -x '*.orig' linux-5.11/drivers/net/wireless/intersil/hostap/hostap_80211_tx.c linux-5.11/drivers/net/wireless/intersil/hostap/hostap_80211_tx.c
2--- linux-5.11/drivers/net/wireless/intersil/hostap/hostap_80211_tx.c 2021-02-14 23:32:24.000000000 +0100
3+++ linux-5.11/drivers/net/wireless/intersil/hostap/hostap_80211_tx.c 2021-02-24 13:30:28.508213152 +0100
4@@ -77,6 +77,9 @@ netdev_tx_t hostap_data_start_xmit(struc
2380c486
JR
5 iface = netdev_priv(dev);
6 local = iface->local;
7
8+ if (local->iw_mode == IW_MODE_MONITOR)
9+ goto xmit;
10+
11 if (skb->len < ETH_HLEN) {
12 printk(KERN_DEBUG "%s: hostap_data_start_xmit: short skb "
13 "(len=%d)\n", dev->name, skb->len);
e3fad6a6
AM
14@@ -246,6 +249,7 @@ netdev_tx_t hostap_data_start_xmit(struc
15 skb_put_data(skb, &hdr.addr4, ETH_ALEN);
2380c486
JR
16 }
17
18+xmit:
19 iface->stats.tx_packets++;
20 iface->stats.tx_bytes += skb->len;
21
e3fad6a6
AM
22diff -urNp -x '*.orig' linux-5.11/drivers/net/wireless/intersil/hostap/hostap_hw.c linux-5.11/drivers/net/wireless/intersil/hostap/hostap_hw.c
23--- linux-5.11/drivers/net/wireless/intersil/hostap/hostap_hw.c 2021-02-14 23:32:24.000000000 +0100
24+++ linux-5.11/drivers/net/wireless/intersil/hostap/hostap_hw.c 2021-02-24 13:30:28.508213152 +0100
25@@ -984,6 +984,35 @@ static u16 hfa384x_allocate_fid(struct n
2380c486
JR
26 return fid;
27 }
28
29+static int prism2_monitor_enable(struct net_device *dev)
30+{
31+ if (hostap_set_word(dev, HFA384X_RID_CNFPORTTYPE, 5)) {
32+ printk(KERN_DEBUG "Port type setting for monitor mode "
33+ "failed\n");
34+ return -EOPNOTSUPP;
35+ }
36+
37+ if (hfa384x_cmd(dev, HFA384X_CMDCODE_TEST | (0x0a << 8),
38+ 0, NULL, NULL)) {
39+ printk(KERN_DEBUG "Could not enter testmode 0x0a\n");
40+ return -EOPNOTSUPP;
41+ }
42+
43+ if (hostap_set_word(dev, HFA384X_RID_CNFWEPFLAGS,
44+ HFA384X_WEPFLAGS_PRIVACYINVOKED |
45+ HFA384X_WEPFLAGS_HOSTENCRYPT |
46+ HFA384X_WEPFLAGS_HOSTDECRYPT)) {
47+ printk(KERN_DEBUG "WEP flags setting failed\n");
48+ return -EOPNOTSUPP;
49+ }
50+
51+ if (hostap_set_word(dev, HFA384X_RID_PROMISCUOUSMODE, 1)) {
52+ printk(KERN_DEBUG "Could not set promiscuous mode\n");
53+ return -EOPNOTSUPP;
54+ }
55+
56+ return 0;
57+}
58
59 static int prism2_reset_port(struct net_device *dev)
60 {
e3fad6a6 61@@ -1010,6 +1039,10 @@ static int prism2_reset_port(struct net_
2380c486
JR
62 "port\n", dev->name);
63 }
64
65+ if (local->iw_mode == IW_MODE_MONITOR)
66+ /* force mode 0x0a after port 0 reset */
67+ return prism2_monitor_enable(dev);
68+
69 /* It looks like at least some STA firmware versions reset
70 * fragmentation threshold back to 2346 after enable command. Restore
71 * the configured value, if it differs from this default. */
e3fad6a6 72@@ -1445,6 +1478,10 @@ static int prism2_hw_enable(struct net_d
2380c486
JR
73 return 1;
74 }
75
76+ if (local->iw_mode == IW_MODE_MONITOR)
77+ /* force mode 0x0a after port 0 reset */
78+ prism2_monitor_enable(dev);
79+
80 local->hw_ready = 1;
81 local->hw_reset_tries = 0;
82 local->hw_resetting = 0;
e3fad6a6 83@@ -3102,6 +3139,7 @@ prism2_init_local_data(struct prism2_hel
2380c486
JR
84 local->func->hw_config = prism2_hw_config;
85 local->func->hw_reset = prism2_hw_reset;
86 local->func->hw_shutdown = prism2_hw_shutdown;
87+ local->func->monitor_enable = prism2_monitor_enable;
88 local->func->reset_port = prism2_reset_port;
89 local->func->schedule_reset = prism2_schedule_reset;
90 #ifdef PRISM2_DOWNLOAD_SUPPORT
e3fad6a6
AM
91diff -urNp -x '*.orig' linux-5.11/drivers/net/wireless/intersil/hostap/hostap_ioctl.c linux-5.11/drivers/net/wireless/intersil/hostap/hostap_ioctl.c
92--- linux-5.11/drivers/net/wireless/intersil/hostap/hostap_ioctl.c 2021-02-14 23:32:24.000000000 +0100
93+++ linux-5.11/drivers/net/wireless/intersil/hostap/hostap_ioctl.c 2021-02-24 13:30:28.508213152 +0100
94@@ -1071,33 +1071,7 @@ static int hostap_monitor_mode_enable(lo
2380c486
JR
95
96 printk(KERN_DEBUG "Enabling monitor mode\n");
97 hostap_monitor_set_type(local);
98-
99- if (hostap_set_word(dev, HFA384X_RID_CNFPORTTYPE,
100- HFA384X_PORTTYPE_PSEUDO_IBSS)) {
101- printk(KERN_DEBUG "Port type setting for monitor mode "
102- "failed\n");
103- return -EOPNOTSUPP;
104- }
105-
106- /* Host decrypt is needed to get the IV and ICV fields;
107- * however, monitor mode seems to remove WEP flag from frame
108- * control field */
109- if (hostap_set_word(dev, HFA384X_RID_CNFWEPFLAGS,
110- HFA384X_WEPFLAGS_HOSTENCRYPT |
111- HFA384X_WEPFLAGS_HOSTDECRYPT)) {
112- printk(KERN_DEBUG "WEP flags setting failed\n");
113- return -EOPNOTSUPP;
114- }
115-
116- if (local->func->reset_port(dev) ||
117- local->func->cmd(dev, HFA384X_CMDCODE_TEST |
118- (HFA384X_TEST_MONITOR << 8),
119- 0, NULL, NULL)) {
120- printk(KERN_DEBUG "Setting monitor mode failed\n");
121- return -EOPNOTSUPP;
122- }
123-
124- return 0;
125+ return local->func->reset_port(dev);
126 }
127
128
e3fad6a6 129@@ -1166,7 +1140,7 @@ static int prism2_ioctl_siwmode(struct n
2380c486
JR
130 local->iw_mode = *mode;
131
132 if (local->iw_mode == IW_MODE_MONITOR)
133- hostap_monitor_mode_enable(local);
134+ return hostap_monitor_mode_enable(local);
135 else if (local->iw_mode == IW_MODE_MASTER && !local->host_encrypt &&
136 !local->fw_encrypt_ok) {
137 printk(KERN_DEBUG "%s: defaulting to host-based encryption as "
e3fad6a6
AM
138diff -urNp -x '*.orig' linux-5.11/drivers/net/wireless/intersil/hostap/hostap_main.c linux-5.11/drivers/net/wireless/intersil/hostap/hostap_main.c
139--- linux-5.11/drivers/net/wireless/intersil/hostap/hostap_main.c 2021-02-14 23:32:24.000000000 +0100
140+++ linux-5.11/drivers/net/wireless/intersil/hostap/hostap_main.c 2021-02-24 13:30:28.508213152 +0100
141@@ -318,7 +318,7 @@ u16 hostap_get_porttype(local_info_t *lo
2380c486
JR
142 if (local->iw_mode == IW_MODE_REPEAT)
143 return HFA384X_PORTTYPE_WDS;
144 if (local->iw_mode == IW_MODE_MONITOR)
145- return HFA384X_PORTTYPE_PSEUDO_IBSS;
146+ return 5; /*HFA384X_PORTTYPE_PSEUDO_IBSS;*/
147 return HFA384X_PORTTYPE_HOSTAP;
148 }
149
e3fad6a6
AM
150diff -urNp -x '*.orig' linux-5.11/drivers/net/wireless/intersil/hostap/hostap_pci.c linux-5.11/drivers/net/wireless/intersil/hostap/hostap_pci.c
151--- linux-5.11/drivers/net/wireless/intersil/hostap/hostap_pci.c 2021-02-14 23:32:24.000000000 +0100
152+++ linux-5.11/drivers/net/wireless/intersil/hostap/hostap_pci.c 2021-02-24 13:30:28.508213152 +0100
153@@ -47,6 +47,8 @@ static const struct pci_device_id prism2
2380c486
JR
154 { 0x1260, 0x3873, PCI_ANY_ID, PCI_ANY_ID },
155 /* Samsung MagicLAN SWL-2210P */
156 { 0x167d, 0xa000, PCI_ANY_ID, PCI_ANY_ID },
157+ /* NETGEAR MA311 */
158+ { 0x1385, 0x3872, PCI_ANY_ID, PCI_ANY_ID },
159 { 0 }
160 };
161
e3fad6a6
AM
162diff -urNp -x '*.orig' linux-5.11/drivers/net/wireless/intersil/hostap/hostap_plx.c linux-5.11/drivers/net/wireless/intersil/hostap/hostap_plx.c
163--- linux-5.11/drivers/net/wireless/intersil/hostap/hostap_plx.c 2021-02-14 23:32:24.000000000 +0100
164+++ linux-5.11/drivers/net/wireless/intersil/hostap/hostap_plx.c 2021-02-24 13:30:28.508213152 +0100
165@@ -100,6 +100,7 @@ static struct prism2_plx_manfid {
2380c486
JR
166 { 0xc250, 0x0002 } /* EMTAC A2424i */,
167 { 0xd601, 0x0002 } /* Z-Com XI300 */,
168 { 0xd601, 0x0005 } /* Zcomax XI-325H 200mW */,
169+ { 0xd601, 0x0010 } /* Zcomax XI-325H 100mW */,
170 { 0, 0}
171 };
172
e3fad6a6
AM
173diff -urNp -x '*.orig' linux-5.11/drivers/net/wireless/intersil/hostap/hostap_wlan.h linux-5.11/drivers/net/wireless/intersil/hostap/hostap_wlan.h
174--- linux-5.11/drivers/net/wireless/intersil/hostap/hostap_wlan.h 2021-02-14 23:32:24.000000000 +0100
175+++ linux-5.11/drivers/net/wireless/intersil/hostap/hostap_wlan.h 2021-02-24 13:30:28.508213152 +0100
176@@ -593,6 +593,7 @@ struct prism2_helper_functions {
2380c486
JR
177 int (*hw_config)(struct net_device *dev, int initial);
178 void (*hw_reset)(struct net_device *dev);
179 void (*hw_shutdown)(struct net_device *dev, int no_disable);
180+ int (*monitor_enable)(struct net_device *dev);
181 int (*reset_port)(struct net_device *dev);
182 void (*schedule_reset)(local_info_t *local);
183 int (*download)(local_info_t *local,
This page took 0.158523 seconds and 4 git commands to generate.