Re: mac80211_hwsim + iperf + netns
On Thu, 2016-02-04 at 12:32 +0100, Michal Kazior wrote: > > ip netns add ns1 > ip netns exec ns1 bash # get the PID in the session and don't close > it > iw phy phyX set netns $pid_of_that_shell > If you also have a recent enough iw version, you can use iw phy phyX set netns name ns1 johannes -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: mac80211_hwsim + iperf + netns
On Thu, Feb 4, 2016 at 5:57 PM, Krishna Chaitanyawrote: > On Thu, Feb 4, 2016 at 5:23 PM, Michal Kazior wrote: >> On 4 February 2016 at 12:49, Krishna Chaitanya >> wrote: >>> On Thu, Feb 4, 2016 at 5:02 PM, Michal Kazior >>> wrote: On 4 February 2016 at 12:22, Krishna Chaitanya wrote: > Hi All, > > I am trying to run some iperf tests using mac80211_hwsim b/w AP and STA. > Even after tweaking the routing table, the packets are still not going > through > mac80211_hwsim instead they are just looping back. > > After a quick search i found that we should use different network > namespaces. > Can anyone tell me the exact procedure for this? I have found a procedure > in the below link, but i dont have the lxc-unshare for my embedded box. > Is there any alternate way for this. If you have a recent enough iproute2 package you can use: >>> Unfortunately i dont, will try to get the latest. ip netns add ns1 ip netns exec ns1 bash # get the PID in the session and don't close it iw phy phyX set netns $pid_of_that_shell # you can close the bash now; phyX will remain in ns1 Or you could try using ipv6 link-local addresses which will not require you to use namespaces at all. >>> Tried this but still not able to excite mac80211_hwsim TX path. >>> below are commands and config. >>> >>> wlan0 Link encap:Ethernet HWaddr 02:00:00:00:00:00 >>> inet addr:10.0.0.1 Bcast:10.255.255.255 Mask:255.0.0.0 >>> inet6 addr: fe80::ff:fe00:0/64 Scope:Link >>> UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 >>> RX packets:8 errors:0 dropped:1 overruns:0 frame:0 >>> TX packets:38 errors:0 dropped:0 overruns:0 carrier:0 >>> collisions:0 txqueuelen:1000 >>> RX bytes:648 (648.0 B) TX bytes:3680 (3.5 KiB) >>> >>> wlan1 Link encap:Ethernet HWaddr 02:00:00:00:01:00 >>> inet addr:20.0.0.1 Bcast:20.255.255.255 Mask:255.0.0.0 >>> inet6 addr: fe80::ff:fe00:100/64 Scope:Link >>> UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 >>> RX packets:3 errors:0 dropped:0 overruns:0 frame:0 >>> TX packets:8 errors:0 dropped:0 overruns:0 carrier:0 >>> collisions:0 txqueuelen:1000 >>> RX bytes:126 (126.0 B) TX bytes:808 (808.0 B) >>> >>> iperf -s -B fe80::ff:fe00:0 & >>> iperf -c fe80::ff:fe00:0 -B fe80::ff:fe00:100 -t 60 -i 1 >>> >>> Something wrong? >> >> For link-local addresses you must specify interface you want to use them. >> >> Also, there's an iperf switch to understand ipv6 "-V". >> >> iperf -V -i1 -s >> iperf -V -i1 -c fe80::ff:fe00:0%wlan1 >> iperf -V -i1 -c fe80::ff:fe00:100%wlan0 >> > Thanks a lot Michal. It worked like a charm. Whenever i use the iperf -c, it starts a bi-directional stream, How do i limit it to only for single direction? # iperf -V -i1 -c fe80::ff:fe00:0%wlan1 Client connecting to fe80::ff:fe00:0%wlan1, TCP port 5001 TCP window size: 43.8 KByte (default) [ 3] local fe80::ff:fe00:100 port 34808 connected with fe80::ff:fe00:0 port 5001 [ 5] local fe80::ff:fe00:0 port 5001 connected with fe80::ff:fe00:100 port 34808 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: mac80211_hwsim + iperf + netns
On 4 February 2016 at 12:22, Krishna Chaitanyawrote: > Hi All, > > I am trying to run some iperf tests using mac80211_hwsim b/w AP and STA. > Even after tweaking the routing table, the packets are still not going through > mac80211_hwsim instead they are just looping back. > > After a quick search i found that we should use different network namespaces. > Can anyone tell me the exact procedure for this? I have found a procedure > in the below link, but i dont have the lxc-unshare for my embedded box. > Is there any alternate way for this. If you have a recent enough iproute2 package you can use: ip netns add ns1 ip netns exec ns1 bash # get the PID in the session and don't close it iw phy phyX set netns $pid_of_that_shell # you can close the bash now; phyX will remain in ns1 Or you could try using ipv6 link-local addresses which will not require you to use namespaces at all. Michał -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [PATCH 1/2] rtlwifi: Fix improve function 'rtl_addr_delay()' in core.c
From: Larry Finger > Sent: 03 February 2016 19:45 ... > The performance will depend on where you satisfy the condition. All switch > cases > have the same execution time, but in the if .. else if .. else form, the > earlier > tests execute more quickly. I'm not sure that one can make any blanket > statement > about performance. Certainly, the switch version will be larger. For a switch > with 8 cases plus default, the object code if 43 bytes larger than the nested > ifs in a test program that I created. That is a significant penalty. There is also the penalty of the (likely) data cache miss reading the jump table. But given this code is all about generating a variable delay the execution speed is probably irrelevant. It would be much more interesting if the delay could be changed for sleeps. David
Re: mac80211_hwsim + iperf + netns
On Thu, Feb 4, 2016 at 5:02 PM, Michal Kaziorwrote: > On 4 February 2016 at 12:22, Krishna Chaitanya > wrote: >> Hi All, >> >> I am trying to run some iperf tests using mac80211_hwsim b/w AP and STA. >> Even after tweaking the routing table, the packets are still not going >> through >> mac80211_hwsim instead they are just looping back. >> >> After a quick search i found that we should use different network namespaces. >> Can anyone tell me the exact procedure for this? I have found a procedure >> in the below link, but i dont have the lxc-unshare for my embedded box. >> Is there any alternate way for this. > > If you have a recent enough iproute2 package you can use: Unfortunately i dont, will try to get the latest. > ip netns add ns1 > ip netns exec ns1 bash # get the PID in the session and don't close it > iw phy phyX set netns $pid_of_that_shell > # you can close the bash now; phyX will remain in ns1 > > Or you could try using ipv6 link-local addresses which will not > require you to use namespaces at all. Tried this but still not able to excite mac80211_hwsim TX path. below are commands and config. wlan0 Link encap:Ethernet HWaddr 02:00:00:00:00:00 inet addr:10.0.0.1 Bcast:10.255.255.255 Mask:255.0.0.0 inet6 addr: fe80::ff:fe00:0/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:8 errors:0 dropped:1 overruns:0 frame:0 TX packets:38 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:648 (648.0 B) TX bytes:3680 (3.5 KiB) wlan1 Link encap:Ethernet HWaddr 02:00:00:00:01:00 inet addr:20.0.0.1 Bcast:20.255.255.255 Mask:255.0.0.0 inet6 addr: fe80::ff:fe00:100/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:3 errors:0 dropped:0 overruns:0 frame:0 TX packets:8 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:126 (126.0 B) TX bytes:808 (808.0 B) iperf -s -B fe80::ff:fe00:0 & iperf -c fe80::ff:fe00:0 -B fe80::ff:fe00:100 -t 60 -i 1 Something wrong? -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: mac80211_hwsim + iperf + netns
On Thu, Feb 4, 2016 at 5:23 PM, Michal Kaziorwrote: > On 4 February 2016 at 12:49, Krishna Chaitanya > wrote: >> On Thu, Feb 4, 2016 at 5:02 PM, Michal Kazior >> wrote: >>> On 4 February 2016 at 12:22, Krishna Chaitanya >>> wrote: Hi All, I am trying to run some iperf tests using mac80211_hwsim b/w AP and STA. Even after tweaking the routing table, the packets are still not going through mac80211_hwsim instead they are just looping back. After a quick search i found that we should use different network namespaces. Can anyone tell me the exact procedure for this? I have found a procedure in the below link, but i dont have the lxc-unshare for my embedded box. Is there any alternate way for this. >>> >>> If you have a recent enough iproute2 package you can use: >> Unfortunately i dont, will try to get the latest. >>> ip netns add ns1 >>> ip netns exec ns1 bash # get the PID in the session and don't close it >>> iw phy phyX set netns $pid_of_that_shell >>> # you can close the bash now; phyX will remain in ns1 >>> >>> Or you could try using ipv6 link-local addresses which will not >>> require you to use namespaces at all. >> Tried this but still not able to excite mac80211_hwsim TX path. >> below are commands and config. >> >> wlan0 Link encap:Ethernet HWaddr 02:00:00:00:00:00 >> inet addr:10.0.0.1 Bcast:10.255.255.255 Mask:255.0.0.0 >> inet6 addr: fe80::ff:fe00:0/64 Scope:Link >> UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 >> RX packets:8 errors:0 dropped:1 overruns:0 frame:0 >> TX packets:38 errors:0 dropped:0 overruns:0 carrier:0 >> collisions:0 txqueuelen:1000 >> RX bytes:648 (648.0 B) TX bytes:3680 (3.5 KiB) >> >> wlan1 Link encap:Ethernet HWaddr 02:00:00:00:01:00 >> inet addr:20.0.0.1 Bcast:20.255.255.255 Mask:255.0.0.0 >> inet6 addr: fe80::ff:fe00:100/64 Scope:Link >> UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 >> RX packets:3 errors:0 dropped:0 overruns:0 frame:0 >> TX packets:8 errors:0 dropped:0 overruns:0 carrier:0 >> collisions:0 txqueuelen:1000 >> RX bytes:126 (126.0 B) TX bytes:808 (808.0 B) >> >> iperf -s -B fe80::ff:fe00:0 & >> iperf -c fe80::ff:fe00:0 -B fe80::ff:fe00:100 -t 60 -i 1 >> >> Something wrong? > > For link-local addresses you must specify interface you want to use them. > > Also, there's an iperf switch to understand ipv6 "-V". > > iperf -V -i1 -s > iperf -V -i1 -c fe80::ff:fe00:0%wlan1 > iperf -V -i1 -c fe80::ff:fe00:100%wlan0 > Thanks a lot Michal. It worked like a charm. -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: mac80211_hwsim + iperf + netns
On Thu, Feb 4, 2016 at 5:49 PM, Johannes Bergwrote: > On Thu, 2016-02-04 at 12:32 +0100, Michal Kazior wrote: >> >> ip netns add ns1 >> ip netns exec ns1 bash # get the PID in the session and don't close >> it >> iw phy phyX set netns $pid_of_that_shell >> > > If you also have a recent enough iw version, you can use > > iw phy phyX set netns name ns1 > My iw has this option, but it throws an error. Does this command have any prerequisites? # iw phy phy1 set netns name ns1 Invalid parameter: nsname(name) Usage: iw [options] phy set netns { | name } Put this wireless device into a different network namespace: - change network namespace by process id - change network namespace by name from /var/run/netns or by absolute path (man ip-netns) Options: --debug enable netlink debugging # -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: mac80211_hwsim + iperf + netns
On Thu, Feb 4, 2016 at 6:05 PM, Johannes Bergwrote: > On Thu, 2016-02-04 at 17:58 +0530, Krishna Chaitanya wrote: >> On Thu, Feb 4, 2016 at 5:49 PM, Johannes Berg > net> wrote: >> > On Thu, 2016-02-04 at 12:32 +0100, Michal Kazior wrote: >> > > >> > > ip netns add ns1 >> > > ip netns exec ns1 bash # get the PID in the session and don't >> > > close >> > > it >> > > iw phy phyX set netns $pid_of_that_shell >> > > >> > >> > If you also have a recent enough iw version, you can use >> > >> > iw phy phyX set netns name ns1 >> > >> My iw has this option, but it throws an error. >> Does this command have any prerequisites? >> >> # iw phy phy1 set netns name ns1 >> Invalid parameter: nsname(name) >> > > This happens if the ns1 doesn't exist. ok, so we need latest iprotue2 to create the namespace? -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: mac80211_hwsim + iperf + netns
On 4 February 2016 at 12:49, Krishna Chaitanyawrote: > On Thu, Feb 4, 2016 at 5:02 PM, Michal Kazior wrote: >> On 4 February 2016 at 12:22, Krishna Chaitanya >> wrote: >>> Hi All, >>> >>> I am trying to run some iperf tests using mac80211_hwsim b/w AP and STA. >>> Even after tweaking the routing table, the packets are still not going >>> through >>> mac80211_hwsim instead they are just looping back. >>> >>> After a quick search i found that we should use different network >>> namespaces. >>> Can anyone tell me the exact procedure for this? I have found a procedure >>> in the below link, but i dont have the lxc-unshare for my embedded box. >>> Is there any alternate way for this. >> >> If you have a recent enough iproute2 package you can use: > Unfortunately i dont, will try to get the latest. >> ip netns add ns1 >> ip netns exec ns1 bash # get the PID in the session and don't close it >> iw phy phyX set netns $pid_of_that_shell >> # you can close the bash now; phyX will remain in ns1 >> >> Or you could try using ipv6 link-local addresses which will not >> require you to use namespaces at all. > Tried this but still not able to excite mac80211_hwsim TX path. > below are commands and config. > > wlan0 Link encap:Ethernet HWaddr 02:00:00:00:00:00 > inet addr:10.0.0.1 Bcast:10.255.255.255 Mask:255.0.0.0 > inet6 addr: fe80::ff:fe00:0/64 Scope:Link > UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 > RX packets:8 errors:0 dropped:1 overruns:0 frame:0 > TX packets:38 errors:0 dropped:0 overruns:0 carrier:0 > collisions:0 txqueuelen:1000 > RX bytes:648 (648.0 B) TX bytes:3680 (3.5 KiB) > > wlan1 Link encap:Ethernet HWaddr 02:00:00:00:01:00 > inet addr:20.0.0.1 Bcast:20.255.255.255 Mask:255.0.0.0 > inet6 addr: fe80::ff:fe00:100/64 Scope:Link > UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 > RX packets:3 errors:0 dropped:0 overruns:0 frame:0 > TX packets:8 errors:0 dropped:0 overruns:0 carrier:0 > collisions:0 txqueuelen:1000 > RX bytes:126 (126.0 B) TX bytes:808 (808.0 B) > > iperf -s -B fe80::ff:fe00:0 & > iperf -c fe80::ff:fe00:0 -B fe80::ff:fe00:100 -t 60 -i 1 > > Something wrong? For link-local addresses you must specify interface you want to use them. Also, there's an iperf switch to understand ipv6 "-V". iperf -V -i1 -s iperf -V -i1 -c fe80::ff:fe00:0%wlan1 iperf -V -i1 -c fe80::ff:fe00:100%wlan0 Michał -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v3 4/4] ipv6: add option to drop unsolicited neighbor advertisements
From: Johannes BergIn certain 802.11 wireless deployments, there will be NA proxies that use knowledge of the network to correctly answer requests. To prevent unsolicitd advertisements on the shared medium from being a problem, on such deployments wireless needs to drop them. Enable this by providing an option called "drop_unsolicited_na". Signed-off-by: Johannes Berg --- Documentation/networking/ip-sysctl.txt | 7 +++ include/linux/ipv6.h | 1 + include/uapi/linux/ipv6.h | 1 + net/ipv6/addrconf.c| 8 net/ipv6/ndisc.c | 9 + 5 files changed, 26 insertions(+) diff --git a/Documentation/networking/ip-sysctl.txt b/Documentation/networking/ip-sysctl.txt index 428fb48a19fc..77992f1173c3 100644 --- a/Documentation/networking/ip-sysctl.txt +++ b/Documentation/networking/ip-sysctl.txt @@ -1672,6 +1672,13 @@ drop_unicast_in_l2_multicast - BOOLEAN By default this is turned off. +drop_unsolicited_na - BOOLEAN + Drop all unsolicited neighbor advertisements, for example if there's + a known good NA proxy on the network and such frames need not be used + (or in the case of 802.11, must not be used to prevent attacks.) + + By default this is turned off. + icmp/*: ratelimit - INTEGER Limit the maximal rates for sending ICMPv6 packets. diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h index 34317cb6a6fc..9231bfdc7c92 100644 --- a/include/linux/ipv6.h +++ b/include/linux/ipv6.h @@ -56,6 +56,7 @@ struct ipv6_devconf { __s32 ndisc_notify; __s32 suppress_frag_ndisc; __s32 accept_ra_mtu; + __s32 drop_unsolicited_na; struct ipv6_stable_secret { bool initialized; struct in6_addr secret; diff --git a/include/uapi/linux/ipv6.h b/include/uapi/linux/ipv6.h index 4c413570efe8..ec117b65d5a5 100644 --- a/include/uapi/linux/ipv6.h +++ b/include/uapi/linux/ipv6.h @@ -175,6 +175,7 @@ enum { DEVCONF_ACCEPT_RA_MIN_HOP_LIMIT, DEVCONF_IGNORE_ROUTES_WITH_LINKDOWN, DEVCONF_DROP_UNICAST_IN_L2_MULTICAST, + DEVCONF_DROP_UNSOLICITED_NA, DEVCONF_MAX }; diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 35f880bcf626..e7dd0a0c5126 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c @@ -4673,6 +4673,7 @@ static inline void ipv6_store_devconf(struct ipv6_devconf *cnf, /* we omit DEVCONF_STABLE_SECRET for now */ array[DEVCONF_USE_OIF_ADDRS_ONLY] = cnf->use_oif_addrs_only; array[DEVCONF_DROP_UNICAST_IN_L2_MULTICAST] = cnf->drop_unicast_in_l2_multicast; + array[DEVCONF_DROP_UNSOLICITED_NA] = cnf->drop_unsolicited_na; } static inline size_t inet6_ifla6_size(void) @@ -5742,6 +5743,13 @@ static struct addrconf_sysctl_table .proc_handler = proc_dointvec, }, { + .procname = "drop_unsolicited_na", + .data = _devconf.drop_unsolicited_na, + .maxlen = sizeof(int), + .mode = 0644, + .proc_handler = proc_dointvec, + }, + { /* sentinel */ } }, diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c index 3e0f855e1bea..12c84a53df4f 100644 --- a/net/ipv6/ndisc.c +++ b/net/ipv6/ndisc.c @@ -887,6 +887,7 @@ static void ndisc_recv_na(struct sk_buff *skb) offsetof(struct nd_msg, opt)); struct ndisc_options ndopts; struct net_device *dev = skb->dev; + struct inet6_dev *idev = __in6_dev_get(dev); struct inet6_ifaddr *ifp; struct neighbour *neigh; @@ -906,6 +907,14 @@ static void ndisc_recv_na(struct sk_buff *skb) return; } + /* For some 802.11 wireless deployments (and possibly other networks), +* there will be a NA proxy and unsolicitd packets are attacks +* and thus should not be accepted. +*/ + if (!msg->icmph.icmp6_solicited && idev && + idev->cnf.drop_unsolicited_na) + return; + if (!ndisc_parse_options(msg->opt, ndoptlen, )) { ND_PRINTK(2, warn, "NS: invalid ND option\n"); return; -- 2.7.0 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v3 2/4] ipv4: add option to drop gratuitous ARP packets
From: Johannes BergIn certain 802.11 wireless deployments, there will be ARP proxies that use knowledge of the network to correctly answer requests. To prevent gratuitous ARP frames on the shared medium from being a problem, on such deployments wireless needs to drop them. Enable this by providing an option called "drop_gratuitous_arp". Signed-off-by: Johannes Berg --- Documentation/networking/ip-sysctl.txt | 6 ++ include/uapi/linux/ip.h| 1 + net/ipv4/arp.c | 8 net/ipv4/devinet.c | 2 ++ 4 files changed, 17 insertions(+) diff --git a/Documentation/networking/ip-sysctl.txt b/Documentation/networking/ip-sysctl.txt index 35c4c43dd8de..56bb6dd881bd 100644 --- a/Documentation/networking/ip-sysctl.txt +++ b/Documentation/networking/ip-sysctl.txt @@ -1215,6 +1215,12 @@ drop_unicast_in_l2_multicast - BOOLEAN 1122, but is disabled by default for compatibility reasons. Default: off (0) +drop_gratuitous_arp - BOOLEAN + Drop all gratuitous ARP frames, for example if there's a known + good ARP proxy on the network and such frames need not be used + (or in the case of 802.11, must not be used to prevent attacks.) + Default: off (0) + tag - INTEGER Allows you to write a number, which can be used as required. diff --git a/include/uapi/linux/ip.h b/include/uapi/linux/ip.h index 584834f7e95c..f291569768dd 100644 --- a/include/uapi/linux/ip.h +++ b/include/uapi/linux/ip.h @@ -166,6 +166,7 @@ enum IPV4_DEVCONF_IGMPV3_UNSOLICITED_REPORT_INTERVAL, IPV4_DEVCONF_IGNORE_ROUTES_WITH_LINKDOWN, IPV4_DEVCONF_DROP_UNICAST_IN_L2_MULTICAST, + IPV4_DEVCONF_DROP_GRATUITOUS_ARP, __IPV4_DEVCONF_MAX }; diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c index 59b3e0e8fd51..c102eb5ac55c 100644 --- a/net/ipv4/arp.c +++ b/net/ipv4/arp.c @@ -735,6 +735,14 @@ static int arp_process(struct net *net, struct sock *sk, struct sk_buff *skb) (!IN_DEV_ROUTE_LOCALNET(in_dev) && ipv4_is_loopback(tip))) goto out; + /* + *For some 802.11 wireless deployments (and possibly other networks), + *there will be an ARP proxy and gratuitous ARP frames are attacks + *and thus should not be accepted. + */ + if (sip == tip && IN_DEV_ORCONF(in_dev, DROP_GRATUITOUS_ARP)) + goto out; + /* * Special case: We must set Frame Relay source Q.922 address */ diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c index dbbab28a52a4..3d835313575e 100644 --- a/net/ipv4/devinet.c +++ b/net/ipv4/devinet.c @@ -2185,6 +2185,8 @@ static struct devinet_sysctl_table { "igmpv3_unsolicited_report_interval"), DEVINET_SYSCTL_RW_ENTRY(IGNORE_ROUTES_WITH_LINKDOWN, "ignore_routes_with_linkdown"), + DEVINET_SYSCTL_RW_ENTRY(DROP_GRATUITOUS_ARP, + "drop_gratuitous_arp"), DEVINET_SYSCTL_FLUSHING_ENTRY(NOXFRM, "disable_xfrm"), DEVINET_SYSCTL_FLUSHING_ENTRY(NOPOLICY, "disable_policy"), -- 2.7.0 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v3 3/4] ipv6: add option to drop unicast encapsulated in L2 multicast
From: Johannes BergIn order to solve a problem with 802.11, the so-called hole-196 attack, add an option (sysctl) called "drop_unicast_in_l2_multicast" which, if enabled, causes the stack to drop IPv6 unicast packets encapsulated in link-layer multi- or broadcast frames. Such frames can (as an attack) be created by any member of the same wireless network and transmitted as valid encrypted frames since the symmetric key for broadcast frames is shared between all stations. Reviewed-by: Julian Anastasov Signed-off-by: Johannes Berg --- Documentation/networking/ip-sysctl.txt | 6 ++ include/linux/ipv6.h | 1 + include/uapi/linux/ipv6.h | 1 + net/ipv6/addrconf.c| 8 net/ipv6/ip6_input.c | 10 ++ 5 files changed, 26 insertions(+) diff --git a/Documentation/networking/ip-sysctl.txt b/Documentation/networking/ip-sysctl.txt index 56bb6dd881bd..428fb48a19fc 100644 --- a/Documentation/networking/ip-sysctl.txt +++ b/Documentation/networking/ip-sysctl.txt @@ -1666,6 +1666,12 @@ stable_secret - IPv6 address By default the stable secret is unset. +drop_unicast_in_l2_multicast - BOOLEAN + Drop any unicast IPv6 packets that are received in link-layer + multicast (or broadcast) frames. + + By default this is turned off. + icmp/*: ratelimit - INTEGER Limit the maximal rates for sending ICMPv6 packets. diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h index 0ef2a97ccdb5..34317cb6a6fc 100644 --- a/include/linux/ipv6.h +++ b/include/linux/ipv6.h @@ -50,6 +50,7 @@ struct ipv6_devconf { __s32 mc_forwarding; #endif __s32 disable_ipv6; + __s32 drop_unicast_in_l2_multicast; __s32 accept_dad; __s32 force_tllao; __s32 ndisc_notify; diff --git a/include/uapi/linux/ipv6.h b/include/uapi/linux/ipv6.h index 38b4fef20219..4c413570efe8 100644 --- a/include/uapi/linux/ipv6.h +++ b/include/uapi/linux/ipv6.h @@ -174,6 +174,7 @@ enum { DEVCONF_USE_OIF_ADDRS_ONLY, DEVCONF_ACCEPT_RA_MIN_HOP_LIMIT, DEVCONF_IGNORE_ROUTES_WITH_LINKDOWN, + DEVCONF_DROP_UNICAST_IN_L2_MULTICAST, DEVCONF_MAX }; diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index d72fa90d6feb..35f880bcf626 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c @@ -4672,6 +4672,7 @@ static inline void ipv6_store_devconf(struct ipv6_devconf *cnf, array[DEVCONF_IGNORE_ROUTES_WITH_LINKDOWN] = cnf->ignore_routes_with_linkdown; /* we omit DEVCONF_STABLE_SECRET for now */ array[DEVCONF_USE_OIF_ADDRS_ONLY] = cnf->use_oif_addrs_only; + array[DEVCONF_DROP_UNICAST_IN_L2_MULTICAST] = cnf->drop_unicast_in_l2_multicast; } static inline size_t inet6_ifla6_size(void) @@ -5734,6 +5735,13 @@ static struct addrconf_sysctl_table .proc_handler = addrconf_sysctl_ignore_routes_with_linkdown, }, { + .procname = "drop_unicast_in_l2_multicast", + .data = _devconf.drop_unicast_in_l2_multicast, + .maxlen = sizeof(int), + .mode = 0644, + .proc_handler = proc_dointvec, + }, + { /* sentinel */ } }, diff --git a/net/ipv6/ip6_input.c b/net/ipv6/ip6_input.c index 9075acf081dd..31ac3c56da4b 100644 --- a/net/ipv6/ip6_input.c +++ b/net/ipv6/ip6_input.c @@ -134,6 +134,16 @@ int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt IPV6_ADDR_MC_SCOPE(>daddr) == 1) goto err; + /* If enabled, drop unicast packets that were encapsulated in link-layer +* multicast or broadcast to protected against the so-called "hole-196" +* attack in 802.11 wireless. +*/ + if (!ipv6_addr_is_multicast(>daddr) && + (skb->pkt_type == PACKET_BROADCAST || +skb->pkt_type == PACKET_MULTICAST) && + idev->cnf.drop_unicast_in_l2_multicast) + goto err; + /* RFC4291 2.7 * Nodes must not originate a packet to a multicast address whose scope * field contains the reserved value 0; if such a packet is received, it -- 2.7.0 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v3 1/4] ipv4: add option to drop unicast encapsulated in L2 multicast
From: Johannes BergIn order to solve a problem with 802.11, the so-called hole-196 attack, add an option (sysctl) called "drop_unicast_in_l2_multicast" which, if enabled, causes the stack to drop IPv4 unicast packets encapsulated in link-layer multi- or broadcast frames. Such frames can (as an attack) be created by any member of the same wireless network and transmitted as valid encrypted frames since the symmetric key for broadcast frames is shared between all stations. Additionally, enabling this option provides compliance with a SHOULD clause of RFC 1122. Reviewed-by: Julian Anastasov Signed-off-by: Johannes Berg --- Documentation/networking/ip-sysctl.txt | 7 +++ include/uapi/linux/ip.h| 1 + net/ipv4/devinet.c | 2 ++ net/ipv4/ip_input.c| 25 - 4 files changed, 34 insertions(+), 1 deletion(-) diff --git a/Documentation/networking/ip-sysctl.txt b/Documentation/networking/ip-sysctl.txt index 05915be86235..35c4c43dd8de 100644 --- a/Documentation/networking/ip-sysctl.txt +++ b/Documentation/networking/ip-sysctl.txt @@ -1208,6 +1208,13 @@ promote_secondaries - BOOLEAN promote a corresponding secondary IP address instead of removing all the corresponding secondary IP addresses. +drop_unicast_in_l2_multicast - BOOLEAN + Drop any unicast IP packets that are received in link-layer + multicast (or broadcast) frames. + This behavior (for multicast) is actually a SHOULD in RFC + 1122, but is disabled by default for compatibility reasons. + Default: off (0) + tag - INTEGER Allows you to write a number, which can be used as required. diff --git a/include/uapi/linux/ip.h b/include/uapi/linux/ip.h index 08f894d2ddbd..584834f7e95c 100644 --- a/include/uapi/linux/ip.h +++ b/include/uapi/linux/ip.h @@ -165,6 +165,7 @@ enum IPV4_DEVCONF_IGMPV2_UNSOLICITED_REPORT_INTERVAL, IPV4_DEVCONF_IGMPV3_UNSOLICITED_REPORT_INTERVAL, IPV4_DEVCONF_IGNORE_ROUTES_WITH_LINKDOWN, + IPV4_DEVCONF_DROP_UNICAST_IN_L2_MULTICAST, __IPV4_DEVCONF_MAX }; diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c index cebd9d31e65a..dbbab28a52a4 100644 --- a/net/ipv4/devinet.c +++ b/net/ipv4/devinet.c @@ -2192,6 +2192,8 @@ static struct devinet_sysctl_table { "promote_secondaries"), DEVINET_SYSCTL_FLUSHING_ENTRY(ROUTE_LOCALNET, "route_localnet"), + DEVINET_SYSCTL_FLUSHING_ENTRY(DROP_UNICAST_IN_L2_MULTICAST, + "drop_unicast_in_l2_multicast"), }, }; diff --git a/net/ipv4/ip_input.c b/net/ipv4/ip_input.c index b1209b63381f..997ef64a1c0b 100644 --- a/net/ipv4/ip_input.c +++ b/net/ipv4/ip_input.c @@ -359,8 +359,31 @@ static int ip_rcv_finish(struct net *net, struct sock *sk, struct sk_buff *skb) rt = skb_rtable(skb); if (rt->rt_type == RTN_MULTICAST) { IP_UPD_PO_STATS_BH(net, IPSTATS_MIB_INMCAST, skb->len); - } else if (rt->rt_type == RTN_BROADCAST) + } else if (rt->rt_type == RTN_BROADCAST) { IP_UPD_PO_STATS_BH(net, IPSTATS_MIB_INBCAST, skb->len); + } else if (skb->pkt_type == PACKET_BROADCAST || + skb->pkt_type == PACKET_MULTICAST) { + struct in_device *in_dev = __in_dev_get_rcu(skb->dev); + + /* RFC 1122 3.3.6: +* +* When a host sends a datagram to a link-layer broadcast +* address, the IP destination address MUST be a legal IP +* broadcast or IP multicast address. +* +* A host SHOULD silently discard a datagram that is received +* via a link-layer broadcast (see Section 2.4) but does not +* specify an IP multicast or broadcast destination address. +* +* This doesn't explicitly say L2 *broadcast*, but broadcast is +* in a way a form of multicast and the most common use case for +* this is 802.11 protecting against cross-station spoofing (the +* so-called "hole-196" attack) so do it for both. +*/ + if (in_dev && + IN_DEV_ORCONF(in_dev, DROP_UNICAST_IN_L2_MULTICAST)) + goto drop; + } return dst_input(skb); -- 2.7.0 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: mac80211_hwsim + iperf + netns
On Thu, 2016-02-04 at 18:13 +0530, Krishna Chaitanya wrote: > On Thu, Feb 4, 2016 at 6:05 PM, Johannes Bergnet> wrote: > > On Thu, 2016-02-04 at 17:58 +0530, Krishna Chaitanya wrote: > > > On Thu, Feb 4, 2016 at 5:49 PM, Johannes Berg > > ons. > > > net> wrote: > > > > On Thu, 2016-02-04 at 12:32 +0100, Michal Kazior wrote: > > > > > > > > > > ip netns add ns1 > > > > > ip netns exec ns1 bash # get the PID in the session and > > > > > don't > > > > > close > > > > > it > > > > > iw phy phyX set netns $pid_of_that_shell > > > > > > > > > > > > > If you also have a recent enough iw version, you can use > > > > > > > > iw phy phyX set netns name ns1 > > > > > > > My iw has this option, but it throws an error. > > > Does this command have any prerequisites? > > > > > > # iw phy phy1 set netns name ns1 > > > Invalid parameter: nsname(name) > > > > > > > This happens if the ns1 doesn't exist. > ok, so we need latest iprotue2 to create the > namespace? for this way to work, yes. you could hack your own C program to do the required unshare() call and exec bash and then use the PID ... I used to have one but can't find it now. johannes -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
mac80211_hwsim + iperf + netns
Hi All, I am trying to run some iperf tests using mac80211_hwsim b/w AP and STA. Even after tweaking the routing table, the packets are still not going through mac80211_hwsim instead they are just looping back. After a quick search i found that we should use different network namespaces. Can anyone tell me the exact procedure for this? I have found a procedure in the below link, but i dont have the lxc-unshare for my embedded box. Is there any alternate way for this. https://github.com/bcopeland/wmediumd -- Thanks, Regards, Chaitanya T K. -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: mac80211_hwsim + iperf + netns
On Thu, 2016-02-04 at 17:58 +0530, Krishna Chaitanya wrote: > On Thu, Feb 4, 2016 at 5:49 PM, Johannes Bergnet> wrote: > > On Thu, 2016-02-04 at 12:32 +0100, Michal Kazior wrote: > > > > > > ip netns add ns1 > > > ip netns exec ns1 bash # get the PID in the session and don't > > > close > > > it > > > iw phy phyX set netns $pid_of_that_shell > > > > > > > If you also have a recent enough iw version, you can use > > > > iw phy phyX set netns name ns1 > > > My iw has this option, but it throws an error. > Does this command have any prerequisites? > > # iw phy phy1 set netns name ns1 > Invalid parameter: nsname(name) > This happens if the ns1 doesn't exist. johannes -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2 2/4] lib: update single-char callers of strtobool
Some callers of strtobool were passing a pointer to unterminated strings. In preparation of adding multi-character processing to kstrtobool, update the callers to not pass single-character pointers, and switch to using the new kstrtobool_from_user helper where possible. Signed-off-by: Kees CookCc: Amitkumar Karwar Cc: Nishant Sarmukadam Cc: Kalle Valo Cc: Steve French Cc: linux-c...@vger.kernel.org --- drivers/net/wireless/marvell/mwifiex/debugfs.c | 10 ++--- fs/cifs/cifs_debug.c | 58 +++--- fs/cifs/cifs_debug.h | 2 +- fs/cifs/cifsfs.c | 6 +-- fs/cifs/cifsglob.h | 4 +- 5 files changed, 26 insertions(+), 54 deletions(-) diff --git a/drivers/net/wireless/marvell/mwifiex/debugfs.c b/drivers/net/wireless/marvell/mwifiex/debugfs.c index 0b9c580af988..bd061b02bc04 100644 --- a/drivers/net/wireless/marvell/mwifiex/debugfs.c +++ b/drivers/net/wireless/marvell/mwifiex/debugfs.c @@ -880,14 +880,12 @@ mwifiex_reset_write(struct file *file, { struct mwifiex_private *priv = file->private_data; struct mwifiex_adapter *adapter = priv->adapter; - char cmd; bool result; + int rc; - if (copy_from_user(, ubuf, sizeof(cmd))) - return -EFAULT; - - if (strtobool(, )) - return -EINVAL; + rc = kstrtobool_from_user(ubuf, count, 0, ); + if (rc) + return rc; if (!result) return -EINVAL; diff --git a/fs/cifs/cifs_debug.c b/fs/cifs/cifs_debug.c index 50b268483302..6ee59abcb69b 100644 --- a/fs/cifs/cifs_debug.c +++ b/fs/cifs/cifs_debug.c @@ -255,7 +255,6 @@ static const struct file_operations cifs_debug_data_proc_fops = { static ssize_t cifs_stats_proc_write(struct file *file, const char __user *buffer, size_t count, loff_t *ppos) { - char c; bool bv; int rc; struct list_head *tmp1, *tmp2, *tmp3; @@ -263,11 +262,8 @@ static ssize_t cifs_stats_proc_write(struct file *file, struct cifs_ses *ses; struct cifs_tcon *tcon; - rc = get_user(c, buffer); - if (rc) - return rc; - - if (strtobool(, ) == 0) { + rc = kstrtobool_from_user(buffer, count, 0, ); + if (rc == 0) { #ifdef CONFIG_CIFS_STATS2 atomic_set(, 0); atomic_set(, 0); @@ -290,6 +286,8 @@ static ssize_t cifs_stats_proc_write(struct file *file, } } spin_unlock(_tcp_ses_lock); + } else { + return rc; } return count; @@ -433,17 +431,17 @@ static int cifsFYI_proc_open(struct inode *inode, struct file *file) static ssize_t cifsFYI_proc_write(struct file *file, const char __user *buffer, size_t count, loff_t *ppos) { - char c; + char c[2] = { '\0' }; bool bv; int rc; - rc = get_user(c, buffer); + rc = get_user(c[0], buffer); if (rc) return rc; - if (strtobool(, ) == 0) + if (strtobool(c, ) == 0) cifsFYI = bv; - else if ((c > '1') && (c <= '9')) - cifsFYI = (int) (c - '0'); /* see cifs_debug.h for meanings */ + else if ((c[0] > '1') && (c[0] <= '9')) + cifsFYI = (int) (c[0] - '0'); /* see cifs_debug.h for meanings */ return count; } @@ -471,20 +469,12 @@ static int cifs_linux_ext_proc_open(struct inode *inode, struct file *file) static ssize_t cifs_linux_ext_proc_write(struct file *file, const char __user *buffer, size_t count, loff_t *ppos) { - char c; - bool bv; int rc; - rc = get_user(c, buffer); + rc = kstrtobool_from_user(buffer, count, 0, ); if (rc) return rc; - rc = strtobool(, ); - if (rc) - return rc; - - linuxExtEnabled = bv; - return count; } @@ -511,20 +501,12 @@ static int cifs_lookup_cache_proc_open(struct inode *inode, struct file *file) static ssize_t cifs_lookup_cache_proc_write(struct file *file, const char __user *buffer, size_t count, loff_t *ppos) { - char c; - bool bv; int rc; - rc = get_user(c, buffer); + rc = kstrtobool_from_user(buffer, count, 0, ); if (rc) return rc; - rc = strtobool(, ); - if (rc) - return rc; - - lookupCacheEnabled = bv; - return count; } @@ -551,20 +533,12 @@ static int traceSMB_proc_open(struct inode *inode, struct file *file) static ssize_t traceSMB_proc_write(struct file *file, const char __user *buffer, size_t count, loff_t *ppos) { - char c; - bool bv; int rc; - rc = get_user(c,
[PATCH v2 3/4] lib: add "on"/"off" support to kstrtobool
Add support for "on" and "off" when converting to boolean. Signed-off-by: Kees Cook--- lib/kstrtox.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/lib/kstrtox.c b/lib/kstrtox.c index e18f088704d7..09e83a19a96d 100644 --- a/lib/kstrtox.c +++ b/lib/kstrtox.c @@ -347,6 +347,20 @@ int kstrtobool(const char *s, unsigned int base, bool *res) case '0': *res = false; return 0; + case 'o': + case 'O': + switch (s[1]) { + case 'n': + case 'N': + *res = true; + return 0; + case 'f': + case 'F': + *res = false; + return 0; + default: + break; + } default: break; } -- 2.6.3 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2 0/4] lib: add "on" and "off" to strtobool
This consolidates logic for handling "on"/"off" parsing for bools into the strtobool function, by way of moving it into kstrtobool (with helpers), and updating various callers. arch/powerpc/kernel/rtasd.c|9 --- arch/powerpc/platforms/pseries/hotplug-cpu.c | 10 arch/s390/kernel/time.c|8 --- arch/s390/kernel/topology.c|7 --- arch/x86/kernel/aperture_64.c | 12 - drivers/net/wireless/marvell/mwifiex/debugfs.c | 10 +--- fs/cifs/cifs_debug.c | 58 ++--- fs/cifs/cifs_debug.h |2 fs/cifs/cifsfs.c |6 +- fs/cifs/cifsglob.h |4 - include/linux/kernel.h |3 + include/linux/string.h |6 ++ include/linux/tick.h |2 kernel/time/hrtimer.c | 10 kernel/time/tick-sched.c | 10 lib/kstrtox.c | 49 + lib/string.c | 29 17 files changed, 98 insertions(+), 137 deletions(-) -Kees -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2 1/4] lib: move strtobool to kstrtobool
Create the kstrtobool_from_user helper and moves strtobool logic into the new kstrtobool (matching all the other kstrto* functions). Provides an inline wrapper for existing strtobool callers. Signed-off-by: Kees Cook--- include/linux/kernel.h | 3 +++ include/linux/string.h | 6 +- lib/kstrtox.c | 35 +++ lib/string.c | 29 - 4 files changed, 43 insertions(+), 30 deletions(-) diff --git a/include/linux/kernel.h b/include/linux/kernel.h index f31638c6e873..cdc25f47a23f 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -357,6 +357,7 @@ int __must_check kstrtou16(const char *s, unsigned int base, u16 *res); int __must_check kstrtos16(const char *s, unsigned int base, s16 *res); int __must_check kstrtou8(const char *s, unsigned int base, u8 *res); int __must_check kstrtos8(const char *s, unsigned int base, s8 *res); +int __must_check kstrtobool(const char *s, unsigned int base, bool *res); int __must_check kstrtoull_from_user(const char __user *s, size_t count, unsigned int base, unsigned long long *res); int __must_check kstrtoll_from_user(const char __user *s, size_t count, unsigned int base, long long *res); @@ -368,6 +369,8 @@ int __must_check kstrtou16_from_user(const char __user *s, size_t count, unsigne int __must_check kstrtos16_from_user(const char __user *s, size_t count, unsigned int base, s16 *res); int __must_check kstrtou8_from_user(const char __user *s, size_t count, unsigned int base, u8 *res); int __must_check kstrtos8_from_user(const char __user *s, size_t count, unsigned int base, s8 *res); +int __must_check kstrtobool_from_user(const char __user *s, size_t count, + unsigned int base, bool *res); static inline int __must_check kstrtou64_from_user(const char __user *s, size_t count, unsigned int base, u64 *res) { diff --git a/include/linux/string.h b/include/linux/string.h index 9eebc66d957a..d2fb21b1081d 100644 --- a/include/linux/string.h +++ b/include/linux/string.h @@ -128,7 +128,11 @@ extern char **argv_split(gfp_t gfp, const char *str, int *argcp); extern void argv_free(char **argv); extern bool sysfs_streq(const char *s1, const char *s2); -extern int strtobool(const char *s, bool *res); +extern int kstrtobool(const char *s, unsigned int base, bool *res); +static inline int strtobool(const char *s, bool *res) +{ + return kstrtobool(s, 0, res); +} #ifdef CONFIG_BINARY_PRINTF int vbin_printf(u32 *bin_buf, size_t size, const char *fmt, va_list args); diff --git a/lib/kstrtox.c b/lib/kstrtox.c index 94be244e8441..e18f088704d7 100644 --- a/lib/kstrtox.c +++ b/lib/kstrtox.c @@ -321,6 +321,40 @@ int kstrtos8(const char *s, unsigned int base, s8 *res) } EXPORT_SYMBOL(kstrtos8); +/** + * kstrtobool - convert common user inputs into boolean values + * @s: input string + * @base: ignored + * @res: result + * + * This routine returns 0 iff the first character is one of 'Yy1Nn0'. + * Otherwise it will return -EINVAL. Value pointed to by res is + * updated upon finding a match. + */ +int kstrtobool(const char *s, unsigned int base, bool *res) +{ + if (!s) + return -EINVAL; + + switch (s[0]) { + case 'y': + case 'Y': + case '1': + *res = true; + return 0; + case 'n': + case 'N': + case '0': + *res = false; + return 0; + default: + break; + } + + return -EINVAL; +} +EXPORT_SYMBOL(kstrtobool); + #define kstrto_from_user(f, g, type) \ int f(const char __user *s, size_t count, unsigned int base, type *res) \ { \ @@ -345,3 +379,4 @@ kstrto_from_user(kstrtou16_from_user, kstrtou16, u16); kstrto_from_user(kstrtos16_from_user, kstrtos16, s16); kstrto_from_user(kstrtou8_from_user, kstrtou8, u8); kstrto_from_user(kstrtos8_from_user, kstrtos8, s8); +kstrto_from_user(kstrtobool_from_user, kstrtobool, bool); diff --git a/lib/string.c b/lib/string.c index 0323c0d5629a..1a90db9bc6e1 100644 --- a/lib/string.c +++ b/lib/string.c @@ -630,35 +630,6 @@ bool sysfs_streq(const char *s1, const char *s2) } EXPORT_SYMBOL(sysfs_streq); -/** - * strtobool - convert common user inputs into boolean values - * @s: input string - * @res: result - * - * This routine returns 0 iff the first character is one of 'Yy1Nn0'. - * Otherwise it will return -EINVAL. Value pointed to by res is - * updated upon finding a match. - */ -int strtobool(const char *s, bool *res) -{ - switch (s[0]) { - case 'y': - case 'Y': - case '1': - *res = true; - break; - case 'n': - case 'N': - case '0': - *res = false; - break; - default: -
Re: [PATCH v2 1/4] lib: move strtobool to kstrtobool
On Thu, Feb 4, 2016 at 2:43 PM, Andy Shevchenkowrote: > On Thu, Feb 4, 2016 at 11:00 PM, Kees Cook wrote: >> Create the kstrtobool_from_user helper and moves strtobool logic into >> the new kstrtobool (matching all the other kstrto* functions). Provides >> an inline wrapper for existing strtobool callers. >> >> Signed-off-by: Kees Cook > > Reviewed-by: Andy Shevchenko > > One minor below. Thanks! > >> --- >> include/linux/kernel.h | 3 +++ >> include/linux/string.h | 6 +- >> lib/kstrtox.c | 35 +++ >> lib/string.c | 29 - >> 4 files changed, 43 insertions(+), 30 deletions(-) >> >> diff --git a/include/linux/kernel.h b/include/linux/kernel.h >> index f31638c6e873..cdc25f47a23f 100644 >> --- a/include/linux/kernel.h >> +++ b/include/linux/kernel.h >> @@ -357,6 +357,7 @@ int __must_check kstrtou16(const char *s, unsigned int >> base, u16 *res); >> int __must_check kstrtos16(const char *s, unsigned int base, s16 *res); >> int __must_check kstrtou8(const char *s, unsigned int base, u8 *res); >> int __must_check kstrtos8(const char *s, unsigned int base, s8 *res); >> +int __must_check kstrtobool(const char *s, unsigned int base, bool *res); >> >> int __must_check kstrtoull_from_user(const char __user *s, size_t count, >> unsigned int base, unsigned long long *res); >> int __must_check kstrtoll_from_user(const char __user *s, size_t count, >> unsigned int base, long long *res); >> @@ -368,6 +369,8 @@ int __must_check kstrtou16_from_user(const char __user >> *s, size_t count, unsigne >> int __must_check kstrtos16_from_user(const char __user *s, size_t count, >> unsigned int base, s16 *res); >> int __must_check kstrtou8_from_user(const char __user *s, size_t count, >> unsigned int base, u8 *res); >> int __must_check kstrtos8_from_user(const char __user *s, size_t count, >> unsigned int base, s8 *res); > >> +int __must_check kstrtobool_from_user(const char __user *s, size_t count, >> + unsigned int base, bool *res); > > We already are using long lines here, perhaps do the same? I went back and forth on that, and decided that between checkpatch yelling at me, and trying to be an agent of less entropy, I wrapped the definition. I am fine either way, though. -Kees > >> >> static inline int __must_check kstrtou64_from_user(const char __user *s, >> size_t count, unsigned int base, u64 *res) >> { >> diff --git a/include/linux/string.h b/include/linux/string.h >> index 9eebc66d957a..d2fb21b1081d 100644 >> --- a/include/linux/string.h >> +++ b/include/linux/string.h >> @@ -128,7 +128,11 @@ extern char **argv_split(gfp_t gfp, const char *str, >> int *argcp); >> extern void argv_free(char **argv); >> >> extern bool sysfs_streq(const char *s1, const char *s2); >> -extern int strtobool(const char *s, bool *res); >> +extern int kstrtobool(const char *s, unsigned int base, bool *res); >> +static inline int strtobool(const char *s, bool *res) >> +{ >> + return kstrtobool(s, 0, res); >> +} >> >> #ifdef CONFIG_BINARY_PRINTF >> int vbin_printf(u32 *bin_buf, size_t size, const char *fmt, va_list args); >> diff --git a/lib/kstrtox.c b/lib/kstrtox.c >> index 94be244e8441..e18f088704d7 100644 >> --- a/lib/kstrtox.c >> +++ b/lib/kstrtox.c >> @@ -321,6 +321,40 @@ int kstrtos8(const char *s, unsigned int base, s8 *res) >> } >> EXPORT_SYMBOL(kstrtos8); >> >> +/** >> + * kstrtobool - convert common user inputs into boolean values >> + * @s: input string >> + * @base: ignored >> + * @res: result >> + * >> + * This routine returns 0 iff the first character is one of 'Yy1Nn0'. >> + * Otherwise it will return -EINVAL. Value pointed to by res is >> + * updated upon finding a match. >> + */ >> +int kstrtobool(const char *s, unsigned int base, bool *res) >> +{ >> + if (!s) >> + return -EINVAL; >> + >> + switch (s[0]) { >> + case 'y': >> + case 'Y': >> + case '1': >> + *res = true; >> + return 0; >> + case 'n': >> + case 'N': >> + case '0': >> + *res = false; >> + return 0; >> + default: >> + break; >> + } >> + >> + return -EINVAL; >> +} >> +EXPORT_SYMBOL(kstrtobool); >> + >> #define kstrto_from_user(f, g, type) \ >> int f(const char __user *s, size_t count, unsigned int base, type *res) >>\ >> { \ >> @@ -345,3 +379,4 @@ kstrto_from_user(kstrtou16_from_user, kstrtou16, >>u16); >> kstrto_from_user(kstrtos16_from_user, kstrtos16, s16); >> kstrto_from_user(kstrtou8_from_user, kstrtou8, u8); >> kstrto_from_user(kstrtos8_from_user, kstrtos8, s8); >> +kstrto_from_user(kstrtobool_from_user,
Re: [PATCH v2 4/4] param: convert some "on"/"off" users to strtobool
On Thu, Feb 4, 2016 at 11:00 PM, Kees Cookwrote: > This changes several users of manual "on"/"off" parsing to use strtobool. > (Which means they will now parse y/n/1/0 meaningfully too.) > I like this change, but can you carefully check the acceptance of the returned value? Briefly I saw 1 or 0 as okay in different places. > Signed-off-by: Kees Cook > Acked-by: Heiko Carstens > Acked-by: Michael Ellerman > Cc: x...@kernel.org > Cc: linuxppc-...@lists.ozlabs.org > Cc: linux-s...@vger.kernel.org > --- > arch/powerpc/kernel/rtasd.c | 9 ++--- > arch/powerpc/platforms/pseries/hotplug-cpu.c | 10 ++ > arch/s390/kernel/time.c | 8 ++-- > arch/s390/kernel/topology.c | 7 ++- > arch/x86/kernel/aperture_64.c| 12 ++-- > include/linux/tick.h | 2 +- > kernel/time/hrtimer.c| 10 ++ > kernel/time/tick-sched.c | 10 ++ > 8 files changed, 15 insertions(+), 53 deletions(-) > > diff --git a/arch/powerpc/kernel/rtasd.c b/arch/powerpc/kernel/rtasd.c > index 5a2c049c1c61..567ed5a2f43a 100644 > --- a/arch/powerpc/kernel/rtasd.c > +++ b/arch/powerpc/kernel/rtasd.c > @@ -49,7 +49,7 @@ static unsigned int rtas_error_log_buffer_max; > static unsigned int event_scan; > static unsigned int rtas_event_scan_rate; > > -static int full_rtas_msgs = 0; > +static bool full_rtas_msgs; > > /* Stop logging to nvram after first fatal error */ > static int logging_enabled; /* Until we initialize everything, > @@ -592,11 +592,6 @@ __setup("surveillance=", surveillance_setup); > > static int __init rtasmsgs_setup(char *str) > { > - if (strcmp(str, "on") == 0) > - full_rtas_msgs = 1; > - else if (strcmp(str, "off") == 0) > - full_rtas_msgs = 0; > - > - return 1; > + return kstrtobool(str, 0, _rtas_msgs); > } > __setup("rtasmsgs=", rtasmsgs_setup); > diff --git a/arch/powerpc/platforms/pseries/hotplug-cpu.c > b/arch/powerpc/platforms/pseries/hotplug-cpu.c > index 32274f72fe3f..b9787cae4108 100644 > --- a/arch/powerpc/platforms/pseries/hotplug-cpu.c > +++ b/arch/powerpc/platforms/pseries/hotplug-cpu.c > @@ -47,20 +47,14 @@ static DEFINE_PER_CPU(enum cpu_state_vals, current_state) > = CPU_STATE_OFFLINE; > > static enum cpu_state_vals default_offline_state = CPU_STATE_OFFLINE; > > -static int cede_offline_enabled __read_mostly = 1; > +static bool cede_offline_enabled __read_mostly = true; > > /* > * Enable/disable cede_offline when available. > */ > static int __init setup_cede_offline(char *str) > { > - if (!strcmp(str, "off")) > - cede_offline_enabled = 0; > - else if (!strcmp(str, "on")) > - cede_offline_enabled = 1; > - else > - return 0; > - return 1; > + return kstrtobool(str, 0, _offline_enabled); > } > > __setup("cede_offline=", setup_cede_offline); > diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c > index 99f84ac31307..dff6ce1b84b2 100644 > --- a/arch/s390/kernel/time.c > +++ b/arch/s390/kernel/time.c > @@ -1433,7 +1433,7 @@ device_initcall(etr_init_sysfs); > /* > * Server Time Protocol (STP) code. > */ > -static int stp_online; > +static bool stp_online; > static struct stp_sstpi stp_info; > static void *stp_page; > > @@ -1444,11 +1444,7 @@ static struct timer_list stp_timer; > > static int __init early_parse_stp(char *p) > { > - if (strncmp(p, "off", 3) == 0) > - stp_online = 0; > - else if (strncmp(p, "on", 2) == 0) > - stp_online = 1; > - return 0; > + return kstrtobool(p, 0, _online); > } > early_param("stp", early_parse_stp); > > diff --git a/arch/s390/kernel/topology.c b/arch/s390/kernel/topology.c > index 40b8102fdadb..5d8a80651f61 100644 > --- a/arch/s390/kernel/topology.c > +++ b/arch/s390/kernel/topology.c > @@ -37,7 +37,7 @@ static void set_topology_timer(void); > static void topology_work_fn(struct work_struct *work); > static struct sysinfo_15_1_x *tl_info; > > -static int topology_enabled = 1; > +static bool topology_enabled = true; > static DECLARE_WORK(topology_work, topology_work_fn); > > /* > @@ -444,10 +444,7 @@ static const struct cpumask *cpu_book_mask(int cpu) > > static int __init early_parse_topology(char *p) > { > - if (strncmp(p, "off", 3)) > - return 0; > - topology_enabled = 0; > - return 0; > + return kstrtobool(p, 0, _enabled); > } > early_param("topology", early_parse_topology); > > diff --git a/arch/x86/kernel/aperture_64.c b/arch/x86/kernel/aperture_64.c > index 6e85f713641d..6b423754083a 100644 > --- a/arch/x86/kernel/aperture_64.c > +++ b/arch/x86/kernel/aperture_64.c > @@ -227,19 +227,11 @@ static u32 __init search_agp_bridge(u32 *order, int > *valid_agp)
Re: [PATCH v2 1/4] lib: move strtobool to kstrtobool
On Thu, Feb 4, 2016 at 11:00 PM, Kees Cookwrote: > Create the kstrtobool_from_user helper and moves strtobool logic into > the new kstrtobool (matching all the other kstrto* functions). Provides > an inline wrapper for existing strtobool callers. > > Signed-off-by: Kees Cook Reviewed-by: Andy Shevchenko One minor below. > --- > include/linux/kernel.h | 3 +++ > include/linux/string.h | 6 +- > lib/kstrtox.c | 35 +++ > lib/string.c | 29 - > 4 files changed, 43 insertions(+), 30 deletions(-) > > diff --git a/include/linux/kernel.h b/include/linux/kernel.h > index f31638c6e873..cdc25f47a23f 100644 > --- a/include/linux/kernel.h > +++ b/include/linux/kernel.h > @@ -357,6 +357,7 @@ int __must_check kstrtou16(const char *s, unsigned int > base, u16 *res); > int __must_check kstrtos16(const char *s, unsigned int base, s16 *res); > int __must_check kstrtou8(const char *s, unsigned int base, u8 *res); > int __must_check kstrtos8(const char *s, unsigned int base, s8 *res); > +int __must_check kstrtobool(const char *s, unsigned int base, bool *res); > > int __must_check kstrtoull_from_user(const char __user *s, size_t count, > unsigned int base, unsigned long long *res); > int __must_check kstrtoll_from_user(const char __user *s, size_t count, > unsigned int base, long long *res); > @@ -368,6 +369,8 @@ int __must_check kstrtou16_from_user(const char __user > *s, size_t count, unsigne > int __must_check kstrtos16_from_user(const char __user *s, size_t count, > unsigned int base, s16 *res); > int __must_check kstrtou8_from_user(const char __user *s, size_t count, > unsigned int base, u8 *res); > int __must_check kstrtos8_from_user(const char __user *s, size_t count, > unsigned int base, s8 *res); > +int __must_check kstrtobool_from_user(const char __user *s, size_t count, > + unsigned int base, bool *res); We already are using long lines here, perhaps do the same? > > static inline int __must_check kstrtou64_from_user(const char __user *s, > size_t count, unsigned int base, u64 *res) > { > diff --git a/include/linux/string.h b/include/linux/string.h > index 9eebc66d957a..d2fb21b1081d 100644 > --- a/include/linux/string.h > +++ b/include/linux/string.h > @@ -128,7 +128,11 @@ extern char **argv_split(gfp_t gfp, const char *str, int > *argcp); > extern void argv_free(char **argv); > > extern bool sysfs_streq(const char *s1, const char *s2); > -extern int strtobool(const char *s, bool *res); > +extern int kstrtobool(const char *s, unsigned int base, bool *res); > +static inline int strtobool(const char *s, bool *res) > +{ > + return kstrtobool(s, 0, res); > +} > > #ifdef CONFIG_BINARY_PRINTF > int vbin_printf(u32 *bin_buf, size_t size, const char *fmt, va_list args); > diff --git a/lib/kstrtox.c b/lib/kstrtox.c > index 94be244e8441..e18f088704d7 100644 > --- a/lib/kstrtox.c > +++ b/lib/kstrtox.c > @@ -321,6 +321,40 @@ int kstrtos8(const char *s, unsigned int base, s8 *res) > } > EXPORT_SYMBOL(kstrtos8); > > +/** > + * kstrtobool - convert common user inputs into boolean values > + * @s: input string > + * @base: ignored > + * @res: result > + * > + * This routine returns 0 iff the first character is one of 'Yy1Nn0'. > + * Otherwise it will return -EINVAL. Value pointed to by res is > + * updated upon finding a match. > + */ > +int kstrtobool(const char *s, unsigned int base, bool *res) > +{ > + if (!s) > + return -EINVAL; > + > + switch (s[0]) { > + case 'y': > + case 'Y': > + case '1': > + *res = true; > + return 0; > + case 'n': > + case 'N': > + case '0': > + *res = false; > + return 0; > + default: > + break; > + } > + > + return -EINVAL; > +} > +EXPORT_SYMBOL(kstrtobool); > + > #define kstrto_from_user(f, g, type) \ > int f(const char __user *s, size_t count, unsigned int base, type *res) > \ > { \ > @@ -345,3 +379,4 @@ kstrto_from_user(kstrtou16_from_user, kstrtou16, > u16); > kstrto_from_user(kstrtos16_from_user, kstrtos16, s16); > kstrto_from_user(kstrtou8_from_user, kstrtou8, u8); > kstrto_from_user(kstrtos8_from_user, kstrtos8, s8); > +kstrto_from_user(kstrtobool_from_user, kstrtobool, bool); > diff --git a/lib/string.c b/lib/string.c > index 0323c0d5629a..1a90db9bc6e1 100644 > --- a/lib/string.c > +++ b/lib/string.c > @@ -630,35 +630,6 @@ bool sysfs_streq(const char *s1, const char *s2) > } > EXPORT_SYMBOL(sysfs_streq); > > -/** > - * strtobool - convert common user inputs into boolean values > - * @s: input string > - * @res: result > - * > - * This routine returns 0 iff the
Re: [PATCH v2 3/4] lib: add "on"/"off" support to kstrtobool
On Thu, Feb 4, 2016 at 11:00 PM, Kees Cookwrote: > Add support for "on" and "off" when converting to boolean. > > Signed-off-by: Kees Cook > --- > lib/kstrtox.c | 14 ++ > 1 file changed, 14 insertions(+) > > diff --git a/lib/kstrtox.c b/lib/kstrtox.c > index e18f088704d7..09e83a19a96d 100644 > --- a/lib/kstrtox.c > +++ b/lib/kstrtox.c > @@ -347,6 +347,20 @@ int kstrtobool(const char *s, unsigned int base, bool > *res) Forgot update description? > case '0': > *res = false; > return 0; > + case 'o': > + case 'O': > + switch (s[1]) { > + case 'n': > + case 'N': > + *res = true; > + return 0; > + case 'f': > + case 'F': > + *res = false; > + return 0; > + default: > + break; > + } > default: > break; > } > -- > 2.6.3 > -- With Best Regards, Andy Shevchenko -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [RFC v2] iwlwifi: pcie: transmit queue auto-sizing
On 02/04/2016 12:56 PM, Grumbach, Emmanuel wrote: On 02/04/2016 10:46 PM, Ben Greear wrote: On 02/04/2016 12:16 PM, Emmanuel Grumbach wrote: As many (all?) WiFi devices, Intel WiFi devices have transmit queues which have 256 transmit descriptors each and each descriptor corresponds to an MPDU. This means that when it is full, the queue contains 256 * ~1500 bytes to be transmitted (if we don't have A-MSDUs). The purpose of those queues is to have enough packets to be ready for transmission so that when the device gets an opportunity to transmit (TxOP), it can take as many packets as the spec allows and aggregate them into one A-MPDU or even several A-MPDUs if we are using bursts. I guess this is only really usable if you have exactly one peer connected (ie, in station mode)? Otherwise, you could have one slow peer and one fast one, and then I suspect this would not work so well? Yes. I guess this one (big) limitation. I guess that what would happen in this case is that the the latency would constantly jitter. But I also noticed that I could reduce the transmit queue to 130 descriptors (instead of 256) and still reach maximal throughput because we can refill the queues quickly enough. In iwlwifi, we have plans to have one queue for each peer. This is under development. Not sure when it'll be ready. It also requires firmware change obviously. Per-peer queues will probably be nice, especially if we can keep the buffer bloat manageable. For reference, ath10k has around 1400 tx descriptors, though in practice not all are usable, and in stock firmware, I'm guessing the NIC will never be able to actually fill up it's tx descriptors and stop traffic. Instead, it just allows the stack to try to TX, then drops the frame... 1400 descriptors, ok... but they are not organised in queues? (forgive my ignorance of athX drivers) I think all the details are in the firmware, at least for now. The firmware details are probably not something I should go into, but suffice it to say its complex and varies between firmware versions in non-trivial ways. Thanks, Ben -- Ben GreearCandela Technologies Inc http://www.candelatech.com -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2 2/4] lib: update single-char callers of strtobool
On Thu, Feb 4, 2016 at 11:00 PM, Kees Cookwrote: > Some callers of strtobool were passing a pointer to unterminated strings. > In preparation of adding multi-character processing to kstrtobool, update > the callers to not pass single-character pointers, and switch to using the > new kstrtobool_from_user helper where possible. Looks much better now! My comment below. > > Signed-off-by: Kees Cook > Cc: Amitkumar Karwar > Cc: Nishant Sarmukadam > Cc: Kalle Valo > Cc: Steve French > Cc: linux-c...@vger.kernel.org > --- > drivers/net/wireless/marvell/mwifiex/debugfs.c | 10 ++--- > fs/cifs/cifs_debug.c | 58 > +++--- > fs/cifs/cifs_debug.h | 2 +- > fs/cifs/cifsfs.c | 6 +-- > fs/cifs/cifsglob.h | 4 +- > 5 files changed, 26 insertions(+), 54 deletions(-) > > diff --git a/drivers/net/wireless/marvell/mwifiex/debugfs.c > b/drivers/net/wireless/marvell/mwifiex/debugfs.c > index 0b9c580af988..bd061b02bc04 100644 > --- a/drivers/net/wireless/marvell/mwifiex/debugfs.c > +++ b/drivers/net/wireless/marvell/mwifiex/debugfs.c > @@ -880,14 +880,12 @@ mwifiex_reset_write(struct file *file, > { > struct mwifiex_private *priv = file->private_data; > struct mwifiex_adapter *adapter = priv->adapter; > - char cmd; > bool result; > + int rc; > > - if (copy_from_user(, ubuf, sizeof(cmd))) > - return -EFAULT; > - > - if (strtobool(, )) > - return -EINVAL; > + rc = kstrtobool_from_user(ubuf, count, 0, ); > + if (rc) > + return rc; > > if (!result) > return -EINVAL; > diff --git a/fs/cifs/cifs_debug.c b/fs/cifs/cifs_debug.c > index 50b268483302..6ee59abcb69b 100644 > --- a/fs/cifs/cifs_debug.c > +++ b/fs/cifs/cifs_debug.c > @@ -255,7 +255,6 @@ static const struct file_operations > cifs_debug_data_proc_fops = { > static ssize_t cifs_stats_proc_write(struct file *file, > const char __user *buffer, size_t count, loff_t *ppos) > { > - char c; > bool bv; > int rc; > struct list_head *tmp1, *tmp2, *tmp3; > @@ -263,11 +262,8 @@ static ssize_t cifs_stats_proc_write(struct file *file, > struct cifs_ses *ses; > struct cifs_tcon *tcon; > > - rc = get_user(c, buffer); > - if (rc) > - return rc; > - > - if (strtobool(, ) == 0) { > + rc = kstrtobool_from_user(buffer, count, 0, ); > + if (rc == 0) { > #ifdef CONFIG_CIFS_STATS2 > atomic_set(, 0); > atomic_set(, 0); > @@ -290,6 +286,8 @@ static ssize_t cifs_stats_proc_write(struct file *file, > } > } > spin_unlock(_tcp_ses_lock); > + } else { > + return rc; > } > > return count; > @@ -433,17 +431,17 @@ static int cifsFYI_proc_open(struct inode *inode, > struct file *file) > static ssize_t cifsFYI_proc_write(struct file *file, const char __user > *buffer, > size_t count, loff_t *ppos) > { > - char c; > + char c[2] = { '\0' }; > bool bv; > int rc; > > - rc = get_user(c, buffer); > + rc = get_user(c[0], buffer); > if (rc) > return rc; > - if (strtobool(, ) == 0) > + if (strtobool(c, ) == 0) > cifsFYI = bv; > - else if ((c > '1') && (c <= '9')) > - cifsFYI = (int) (c - '0'); /* see cifs_debug.h for meanings */ > + else if ((c[0] > '1') && (c[0] <= '9')) > + cifsFYI = (int) (c[0] - '0'); /* see cifs_debug.h for > meanings */ > > return count; > } > @@ -471,20 +469,12 @@ static int cifs_linux_ext_proc_open(struct inode > *inode, struct file *file) > static ssize_t cifs_linux_ext_proc_write(struct file *file, > const char __user *buffer, size_t count, loff_t *ppos) > { > - char c; > - bool bv; > int rc; > > - rc = get_user(c, buffer); > + rc = kstrtobool_from_user(buffer, count, 0, ); > if (rc) > return rc; > > - rc = strtobool(, ); > - if (rc) > - return rc; > - > - linuxExtEnabled = bv; > - > return count; > } > > @@ -511,20 +501,12 @@ static int cifs_lookup_cache_proc_open(struct inode > *inode, struct file *file) > static ssize_t cifs_lookup_cache_proc_write(struct file *file, > const char __user *buffer, size_t count, loff_t *ppos) > { > - char c; > - bool bv; > int rc; > > - rc = get_user(c, buffer); > + rc = kstrtobool_from_user(buffer, count, 0, ); > if (rc) > return rc; > > - rc = strtobool(, ); > - if (rc) > -
Re: [RFC RESEND] iwlwifi: pcie: transmit queue auto-sizing
I am not on linux-wireless nor netdev presently, but... On Thu, Feb 4, 2016 at 12:16 PM, Emmanuel Grumbachwrote: > As many (all?) WiFi devices, Intel WiFi devices have > transmit queues which have 256 transmit descriptors > each and each descriptor corresponds to an MPDU. > This means that when it is full, the queue contains > 256 * ~1500 bytes to be transmitted (if we don't have > A-MSDUs). The purpose of those queues is to have enough > packets to be ready for transmission so that when the device > gets an opportunity to transmit (TxOP), it can take as many > packets as the spec allows and aggregate them into one > A-MPDU or even several A-MPDUs if we are using bursts. > > The problem is that the packets that are in these queues are > already out of control of the Qdisc and can stay in those > queues for a fairly long time when the link condition is > not good. This leads to the well known bufferbloat problem. > > This patch adds a way to tune the size of the transmit queue > so that it won't cause excessive latency. When the link > condition is good, the packets will flow smoothly and the > transmit queue will grow quickly allowing A-MPDUs and > maximal throughput. When the link is not optimal, we will > have retransmissions, lower transmit rates or signal > detection (CCA) which will cause a delay in the packet > transmission. The driver will sense this higher latency > and will reduce the size of the transmit queue. > This means that the packets that continue to arrive > will pile up in the Qdisc rather than in the device > queues. The major advantage of this approach is that > codel can now do its work. > > The algorithm is really (too?) simple: > every 5 seconds, starts from a short queue again. > If a packet has been in the queue for less than 10ms, > allow 10 more MPDUs in. > If a packet has been in the queue for more than 20ms, > reduce by 10 the size of the transmit queue. > > The implementation is really naive and way too simple: > * reading jiffies for every Tx / Tx status is not a >good idead. > * jiffies are not fine-grained enough on all platforms > * the constants chosen are really arbitrary and can't be >tuned. > * This may be implemented in mac80211 probably and help >other drivers. > * etc... > > But already this gives nice results. I ran a very simple > experiment: I put the device in a controlled environment > and ran traffic while running default sized ping in the > background. In this configuration, our device quickly > raises its transmission rate to the best rate. > Then, I force the device to use the lowest rate (6Mbps). > Of course, the throughput collapses, but the ping RTT > shoots up. > Using codel helps, but the latency is still high. Codel > with this patch gives much better results: > > pfifo_fast: > rtt min/avg/max/mdev = 1932.616/2393.284/2833.407/315.941 ms, pipe 3, > ipg/ewma 2215.707/2446.884 ms > > fq_codel + Tx queue auto-sizing: > rtt min/avg/max/mdev = 13.541/32.396/54.791/9.610 ms, ipg/ewma 200.685/32.202 > ms > > fq_codel without Tx queue auto-sizing: > rtt min/avg/max/mdev = 140.821/257.303/331.889/31.074 ms, pipe 2, ipg/ewma > 258.147/252.847 ms This is a dramatic improvement. But I'm not sure what you are measuring. Is this the 6mbit test? What happens when you send traffic the other way (more pure acks, rather than big packets?) I try to encourage folk to use flent whenever possible, for pretty graphs and long term measurements, so you can simultaneously measure both throughput and latency. flent.org's .14 release just shipped. > Clearly, there is more work to do to be able to merge this, > but it seems that the wireless problems mentioned in > https://lwn.net/Articles/616241/ may have a solution. I gave talks on the problems that wifi had with bufferbloat at the ieee 802.11 wg meeting a while back, and more recently it was filmed at battlemesh. https://www.youtube.com/watch?v=Rb-UnHDw02o I have spent my time since trying to raise sufficient resources (testbeds and test tools), orgs, people and money to tackle these problems at more depth. We made a bit of progress recently which I can talk about offline... In that talk I suggested that overall we move towards timestamping everything, that (at least in the case of the ath9k and mt72) we tie together aggregation with a byte based estimator similar to how BQL works, and I hoped that eventually - we'd be able to basically - at low rates, keep no more than one aggregate in the hardware, one in the driver queue, and one being assembled. The pending aggregate would be sent to the hardware on the completion interrupt for the previous aggregate, which would fire off the size estimator and start aggrefying the one being assembled. A hook to do that is in use on the mt72 chipset that felix is working on... but nowhere else so far as I know (as yet). the iwl does it's own aggregation (I think(?))... but estimates can still be made... There are WAY more
Re: [PATCH v2 2/4] lib: update single-char callers of strtobool
On Thu, Feb 4, 2016 at 2:59 PM, Andy Shevchenkowrote: > On Thu, Feb 4, 2016 at 11:00 PM, Kees Cook wrote: >> Some callers of strtobool were passing a pointer to unterminated strings. >> In preparation of adding multi-character processing to kstrtobool, update >> the callers to not pass single-character pointers, and switch to using the >> new kstrtobool_from_user helper where possible. > > Looks much better now! > My comment below. > >> >> Signed-off-by: Kees Cook >> Cc: Amitkumar Karwar >> Cc: Nishant Sarmukadam >> Cc: Kalle Valo >> Cc: Steve French >> Cc: linux-c...@vger.kernel.org >> --- >> drivers/net/wireless/marvell/mwifiex/debugfs.c | 10 ++--- >> fs/cifs/cifs_debug.c | 58 >> +++--- >> fs/cifs/cifs_debug.h | 2 +- >> fs/cifs/cifsfs.c | 6 +-- >> fs/cifs/cifsglob.h | 4 +- >> 5 files changed, 26 insertions(+), 54 deletions(-) >> >> diff --git a/drivers/net/wireless/marvell/mwifiex/debugfs.c >> b/drivers/net/wireless/marvell/mwifiex/debugfs.c >> index 0b9c580af988..bd061b02bc04 100644 >> --- a/drivers/net/wireless/marvell/mwifiex/debugfs.c >> +++ b/drivers/net/wireless/marvell/mwifiex/debugfs.c >> @@ -880,14 +880,12 @@ mwifiex_reset_write(struct file *file, >> { >> struct mwifiex_private *priv = file->private_data; >> struct mwifiex_adapter *adapter = priv->adapter; >> - char cmd; >> bool result; >> + int rc; >> >> - if (copy_from_user(, ubuf, sizeof(cmd))) >> - return -EFAULT; >> - >> - if (strtobool(, )) >> - return -EINVAL; >> + rc = kstrtobool_from_user(ubuf, count, 0, ); >> + if (rc) >> + return rc; >> >> if (!result) >> return -EINVAL; >> diff --git a/fs/cifs/cifs_debug.c b/fs/cifs/cifs_debug.c >> index 50b268483302..6ee59abcb69b 100644 >> --- a/fs/cifs/cifs_debug.c >> +++ b/fs/cifs/cifs_debug.c >> @@ -255,7 +255,6 @@ static const struct file_operations >> cifs_debug_data_proc_fops = { >> static ssize_t cifs_stats_proc_write(struct file *file, >> const char __user *buffer, size_t count, loff_t *ppos) >> { >> - char c; >> bool bv; >> int rc; >> struct list_head *tmp1, *tmp2, *tmp3; >> @@ -263,11 +262,8 @@ static ssize_t cifs_stats_proc_write(struct file *file, >> struct cifs_ses *ses; >> struct cifs_tcon *tcon; >> >> - rc = get_user(c, buffer); >> - if (rc) >> - return rc; >> - >> - if (strtobool(, ) == 0) { >> + rc = kstrtobool_from_user(buffer, count, 0, ); >> + if (rc == 0) { >> #ifdef CONFIG_CIFS_STATS2 >> atomic_set(, 0); >> atomic_set(, 0); >> @@ -290,6 +286,8 @@ static ssize_t cifs_stats_proc_write(struct file *file, >> } >> } >> spin_unlock(_tcp_ses_lock); >> + } else { >> + return rc; >> } >> >> return count; >> @@ -433,17 +431,17 @@ static int cifsFYI_proc_open(struct inode *inode, >> struct file *file) >> static ssize_t cifsFYI_proc_write(struct file *file, const char __user >> *buffer, >> size_t count, loff_t *ppos) >> { >> - char c; >> + char c[2] = { '\0' }; >> bool bv; >> int rc; >> >> - rc = get_user(c, buffer); >> + rc = get_user(c[0], buffer); > >> if (rc) >> return rc; >> - if (strtobool(, ) == 0) >> + if (strtobool(c, ) == 0) >> cifsFYI = bv; >> - else if ((c > '1') && (c <= '9')) >> - cifsFYI = (int) (c - '0'); /* see cifs_debug.h for meanings >> */ >> + else if ((c[0] > '1') && (c[0] <= '9')) >> + cifsFYI = (int) (c[0] - '0'); /* see cifs_debug.h for >> meanings */ >> >> return count; >> } >> @@ -471,20 +469,12 @@ static int cifs_linux_ext_proc_open(struct inode >> *inode, struct file *file) >> static ssize_t cifs_linux_ext_proc_write(struct file *file, >> const char __user *buffer, size_t count, loff_t *ppos) >> { >> - char c; >> - bool bv; >> int rc; >> >> - rc = get_user(c, buffer); >> + rc = kstrtobool_from_user(buffer, count, 0, ); >> if (rc) >> return rc; >> >> - rc = strtobool(, ); >> - if (rc) >> - return rc; >> - >> - linuxExtEnabled = bv; >> - >> return count; >> } >> >> @@ -511,20 +501,12 @@ static int cifs_lookup_cache_proc_open(struct inode >> *inode, struct file *file) >> static ssize_t cifs_lookup_cache_proc_write(struct file *file, >> const char __user *buffer, size_t count, loff_t *ppos) >> { >> - char c; >>
[PATCH v2 4/4] param: convert some "on"/"off" users to strtobool
This changes several users of manual "on"/"off" parsing to use strtobool. (Which means they will now parse y/n/1/0 meaningfully too.) Signed-off-by: Kees CookAcked-by: Heiko Carstens Acked-by: Michael Ellerman Cc: x...@kernel.org Cc: linuxppc-...@lists.ozlabs.org Cc: linux-s...@vger.kernel.org --- arch/powerpc/kernel/rtasd.c | 9 ++--- arch/powerpc/platforms/pseries/hotplug-cpu.c | 10 ++ arch/s390/kernel/time.c | 8 ++-- arch/s390/kernel/topology.c | 7 ++- arch/x86/kernel/aperture_64.c| 12 ++-- include/linux/tick.h | 2 +- kernel/time/hrtimer.c| 10 ++ kernel/time/tick-sched.c | 10 ++ 8 files changed, 15 insertions(+), 53 deletions(-) diff --git a/arch/powerpc/kernel/rtasd.c b/arch/powerpc/kernel/rtasd.c index 5a2c049c1c61..567ed5a2f43a 100644 --- a/arch/powerpc/kernel/rtasd.c +++ b/arch/powerpc/kernel/rtasd.c @@ -49,7 +49,7 @@ static unsigned int rtas_error_log_buffer_max; static unsigned int event_scan; static unsigned int rtas_event_scan_rate; -static int full_rtas_msgs = 0; +static bool full_rtas_msgs; /* Stop logging to nvram after first fatal error */ static int logging_enabled; /* Until we initialize everything, @@ -592,11 +592,6 @@ __setup("surveillance=", surveillance_setup); static int __init rtasmsgs_setup(char *str) { - if (strcmp(str, "on") == 0) - full_rtas_msgs = 1; - else if (strcmp(str, "off") == 0) - full_rtas_msgs = 0; - - return 1; + return kstrtobool(str, 0, _rtas_msgs); } __setup("rtasmsgs=", rtasmsgs_setup); diff --git a/arch/powerpc/platforms/pseries/hotplug-cpu.c b/arch/powerpc/platforms/pseries/hotplug-cpu.c index 32274f72fe3f..b9787cae4108 100644 --- a/arch/powerpc/platforms/pseries/hotplug-cpu.c +++ b/arch/powerpc/platforms/pseries/hotplug-cpu.c @@ -47,20 +47,14 @@ static DEFINE_PER_CPU(enum cpu_state_vals, current_state) = CPU_STATE_OFFLINE; static enum cpu_state_vals default_offline_state = CPU_STATE_OFFLINE; -static int cede_offline_enabled __read_mostly = 1; +static bool cede_offline_enabled __read_mostly = true; /* * Enable/disable cede_offline when available. */ static int __init setup_cede_offline(char *str) { - if (!strcmp(str, "off")) - cede_offline_enabled = 0; - else if (!strcmp(str, "on")) - cede_offline_enabled = 1; - else - return 0; - return 1; + return kstrtobool(str, 0, _offline_enabled); } __setup("cede_offline=", setup_cede_offline); diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c index 99f84ac31307..dff6ce1b84b2 100644 --- a/arch/s390/kernel/time.c +++ b/arch/s390/kernel/time.c @@ -1433,7 +1433,7 @@ device_initcall(etr_init_sysfs); /* * Server Time Protocol (STP) code. */ -static int stp_online; +static bool stp_online; static struct stp_sstpi stp_info; static void *stp_page; @@ -1444,11 +1444,7 @@ static struct timer_list stp_timer; static int __init early_parse_stp(char *p) { - if (strncmp(p, "off", 3) == 0) - stp_online = 0; - else if (strncmp(p, "on", 2) == 0) - stp_online = 1; - return 0; + return kstrtobool(p, 0, _online); } early_param("stp", early_parse_stp); diff --git a/arch/s390/kernel/topology.c b/arch/s390/kernel/topology.c index 40b8102fdadb..5d8a80651f61 100644 --- a/arch/s390/kernel/topology.c +++ b/arch/s390/kernel/topology.c @@ -37,7 +37,7 @@ static void set_topology_timer(void); static void topology_work_fn(struct work_struct *work); static struct sysinfo_15_1_x *tl_info; -static int topology_enabled = 1; +static bool topology_enabled = true; static DECLARE_WORK(topology_work, topology_work_fn); /* @@ -444,10 +444,7 @@ static const struct cpumask *cpu_book_mask(int cpu) static int __init early_parse_topology(char *p) { - if (strncmp(p, "off", 3)) - return 0; - topology_enabled = 0; - return 0; + return kstrtobool(p, 0, _enabled); } early_param("topology", early_parse_topology); diff --git a/arch/x86/kernel/aperture_64.c b/arch/x86/kernel/aperture_64.c index 6e85f713641d..6b423754083a 100644 --- a/arch/x86/kernel/aperture_64.c +++ b/arch/x86/kernel/aperture_64.c @@ -227,19 +227,11 @@ static u32 __init search_agp_bridge(u32 *order, int *valid_agp) return 0; } -static int gart_fix_e820 __initdata = 1; +static bool gart_fix_e820 __initdata = true; static int __init parse_gart_mem(char *p) { - if (!p) - return -EINVAL; - - if (!strncmp(p, "off", 3)) - gart_fix_e820 = 0; - else if (!strncmp(p, "on", 2)) - gart_fix_e820 = 1; - - return 0; + return kstrtobool(p, 0, _fix_e820); }
Re: [PATCH v2 3/4] lib: add "on"/"off" support to kstrtobool
On Thu, Feb 4, 2016 at 3:00 PM, Andy Shevchenkowrote: > On Thu, Feb 4, 2016 at 11:00 PM, Kees Cook wrote: >> Add support for "on" and "off" when converting to boolean. >> >> Signed-off-by: Kees Cook >> --- >> lib/kstrtox.c | 14 ++ >> 1 file changed, 14 insertions(+) >> >> diff --git a/lib/kstrtox.c b/lib/kstrtox.c >> index e18f088704d7..09e83a19a96d 100644 >> --- a/lib/kstrtox.c >> +++ b/lib/kstrtox.c >> @@ -347,6 +347,20 @@ int kstrtobool(const char *s, unsigned int base, bool >> *res) > > Forgot update description? Argh, thank you. Good eye. Sent another update. -Kees > >> case '0': >> *res = false; >> return 0; >> + case 'o': >> + case 'O': >> + switch (s[1]) { >> + case 'n': >> + case 'N': >> + *res = true; >> + return 0; >> + case 'f': >> + case 'F': >> + *res = false; >> + return 0; >> + default: >> + break; >> + } >> default: >> break; >> } >> -- >> 2.6.3 >> > > > > -- > With Best Regards, > Andy Shevchenko -- Kees Cook Chrome OS & Brillo Security -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2] ath9k: make NF load complete quickly and reliably
From: Miaoqing PanMake NF load complete quickly and reliably. NF load execution is delayed by HW to end of frame if frame Rx or Tx is ongoing. Increasing timeout to max frame duration. If NF cal is ongoing before NF load, stop it before load, and restart it afterwards. Signed-off-by: Miaoqing Pan --- drivers/net/wireless/ath/ath9k/calib.c | 38 -- 1 file changed, 32 insertions(+), 6 deletions(-) diff --git a/drivers/net/wireless/ath/ath9k/calib.c b/drivers/net/wireless/ath/ath9k/calib.c index 3e2e24e..37f6d66 100644 --- a/drivers/net/wireless/ath/ath9k/calib.c +++ b/drivers/net/wireless/ath/ath9k/calib.c @@ -241,6 +241,7 @@ int ath9k_hw_loadnf(struct ath_hw *ah, struct ath9k_channel *chan) u8 chainmask = (ah->rxchainmask << 3) | ah->rxchainmask; struct ath_common *common = ath9k_hw_common(ah); s16 default_nf = ath9k_hw_get_default_nf(ah, chan); + u32 bb_agc_ctl = REG_READ(ah, AR_PHY_AGC_CONTROL); if (ah->caldata) h = ah->caldata->nfCalHist; @@ -264,6 +265,16 @@ int ath9k_hw_loadnf(struct ath_hw *ah, struct ath9k_channel *chan) } /* +* stop NF cal if ongoing to ensure NF load completes immediately +* (or after end rx/tx frame if ongoing) +*/ + if (bb_agc_ctl & AR_PHY_AGC_CONTROL_NF) { + REG_CLR_BIT(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_NF); + REG_RMW_BUFFER_FLUSH(ah); + ENABLE_REG_RMW_BUFFER(ah); + } + + /* * Load software filtered NF value into baseband internal minCCApwr * variable. */ @@ -276,18 +287,33 @@ int ath9k_hw_loadnf(struct ath_hw *ah, struct ath9k_channel *chan) /* * Wait for load to complete, should be fast, a few 10s of us. -* The max delay was changed from an original 250us to 1us -* since 250us often results in NF load timeout and causes deaf -* condition during stress testing 12/12/2009 +* The max delay was changed from an original 250us to 22.2 msec. +* This would increase timeout to the longest possible frame +* (11n max length 22.1 msec) */ - for (j = 0; j < 1; j++) { + for (j = 0; j < 22200; j++) { if ((REG_READ(ah, AR_PHY_AGC_CONTROL) & -AR_PHY_AGC_CONTROL_NF) == 0) + AR_PHY_AGC_CONTROL_NF) == 0) break; udelay(10); } /* +* Restart NF so it can continue. +*/ + if (bb_agc_ctl & AR_PHY_AGC_CONTROL_NF) { + ENABLE_REG_RMW_BUFFER(ah); + if (bb_agc_ctl & AR_PHY_AGC_CONTROL_ENABLE_NF) + REG_SET_BIT(ah, AR_PHY_AGC_CONTROL, + AR_PHY_AGC_CONTROL_ENABLE_NF); + if (bb_agc_ctl & AR_PHY_AGC_CONTROL_NO_UPDATE_NF) + REG_SET_BIT(ah, AR_PHY_AGC_CONTROL, + AR_PHY_AGC_CONTROL_NO_UPDATE_NF); + REG_SET_BIT(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_NF); + REG_RMW_BUFFER_FLUSH(ah); + } + + /* * We timed out waiting for the noisefloor to load, probably due to an * in-progress rx. Simply return here and allow the load plenty of time * to complete before the next calibration interval. We need to avoid @@ -296,7 +322,7 @@ int ath9k_hw_loadnf(struct ath_hw *ah, struct ath9k_channel *chan) * here, the baseband nf cal will just be capped by our present * noisefloor until the next calibration timer. */ - if (j == 1) { + if (j == 22200) { ath_dbg(common, ANY, "Timeout while waiting for nf to load: AR_PHY_AGC_CONTROL=0x%x\n", REG_READ(ah, AR_PHY_AGC_CONTROL)); -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2 1/4] lib: move strtobool to kstrtobool
On Thu, Feb 04 2016, Kees Cookwrote: > Create the kstrtobool_from_user helper and moves strtobool logic into > the new kstrtobool (matching all the other kstrto* functions). Provides > an inline wrapper for existing strtobool callers. > > Signed-off-by: Kees Cook > --- > include/linux/kernel.h | 3 +++ > include/linux/string.h | 6 +- > lib/kstrtox.c | 35 +++ > lib/string.c | 29 - > 4 files changed, 43 insertions(+), 30 deletions(-) > > diff --git a/include/linux/kernel.h b/include/linux/kernel.h > index f31638c6e873..cdc25f47a23f 100644 > --- a/include/linux/kernel.h > +++ b/include/linux/kernel.h > @@ -357,6 +357,7 @@ int __must_check kstrtou16(const char *s, unsigned int > base, u16 *res); > int __must_check kstrtos16(const char *s, unsigned int base, s16 *res); > int __must_check kstrtou8(const char *s, unsigned int base, u8 *res); > int __must_check kstrtos8(const char *s, unsigned int base, s8 *res); > +int __must_check kstrtobool(const char *s, unsigned int base, bool *res); > > int __must_check kstrtoull_from_user(const char __user *s, size_t count, > unsigned int base, unsigned long long *res); > int __must_check kstrtoll_from_user(const char __user *s, size_t count, > unsigned int base, long long *res); > @@ -368,6 +369,8 @@ int __must_check kstrtou16_from_user(const char __user > *s, size_t count, unsigne > int __must_check kstrtos16_from_user(const char __user *s, size_t count, > unsigned int base, s16 *res); > int __must_check kstrtou8_from_user(const char __user *s, size_t count, > unsigned int base, u8 *res); > int __must_check kstrtos8_from_user(const char __user *s, size_t count, > unsigned int base, s8 *res); > +int __must_check kstrtobool_from_user(const char __user *s, size_t count, > + unsigned int base, bool *res); > > static inline int __must_check kstrtou64_from_user(const char __user *s, > size_t count, unsigned int base, u64 *res) > { > diff --git a/include/linux/string.h b/include/linux/string.h > index 9eebc66d957a..d2fb21b1081d 100644 > --- a/include/linux/string.h > +++ b/include/linux/string.h > @@ -128,7 +128,11 @@ extern char **argv_split(gfp_t gfp, const char *str, int > *argcp); > extern void argv_free(char **argv); > > extern bool sysfs_streq(const char *s1, const char *s2); > -extern int strtobool(const char *s, bool *res); > +extern int kstrtobool(const char *s, unsigned int base, bool *res); > +static inline int strtobool(const char *s, bool *res) > +{ > + return kstrtobool(s, 0, res); > +} > > #ifdef CONFIG_BINARY_PRINTF > int vbin_printf(u32 *bin_buf, size_t size, const char *fmt, va_list args); > diff --git a/lib/kstrtox.c b/lib/kstrtox.c > index 94be244e8441..e18f088704d7 100644 > --- a/lib/kstrtox.c > +++ b/lib/kstrtox.c > @@ -321,6 +321,40 @@ int kstrtos8(const char *s, unsigned int base, s8 *res) > } > EXPORT_SYMBOL(kstrtos8); > > +/** > + * kstrtobool - convert common user inputs into boolean values > + * @s: input string > + * @base: ignored > + * @res: result > + * > + * This routine returns 0 iff the first character is one of 'Yy1Nn0'. > + * Otherwise it will return -EINVAL. Value pointed to by res is > + * updated upon finding a match. > + */ > +int kstrtobool(const char *s, unsigned int base, bool *res) > +{ Being able to create the kstrtobool_from_user with a single macro invocation is convenient, but I don't think that justifies the ugliness of having an unused parameter. People reading this code or trying to use the interface will wonder what it's doing there, and it will generate slightly larger code for all the users of strtobool. So I'd just make a separate explicit definition of kstrtobool_from_user (the stack buffer sizing doesn't apply to the strings we want to parse anyway, though 11 is of course plenty). Rasmus -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2 4/4] param: convert some "on"/"off" users to strtobool
On Thu, Feb 4, 2016 at 4:11 PM, Kees Cookwrote: > On Thu, Feb 4, 2016 at 3:04 PM, Andy Shevchenko > wrote: >> On Thu, Feb 4, 2016 at 11:00 PM, Kees Cook wrote: >>> This changes several users of manual "on"/"off" parsing to use strtobool. >>> (Which means they will now parse y/n/1/0 meaningfully too.) >>> >> >> I like this change, but can you carefully check the acceptance of the >> returned value? >> Briefly I saw 1 or 0 as okay in different places. > > Maybe I missed something, but I think this is actually a bug fix. The > two cases are early_param and __setup: > > For early_param, the functions are called when walking the command > line in do_early_param via parse_args in parse_early_options. Any > non-zero return values produce a warning (in do_early_param not > parse_args). So this is a bug fix, since the function I touched would > (almost) always return 0, even with bad values (i.e. fixes unreported > bad arguments): > > early_param early_parse_stp always 0 > early_param early_parse_topology always 0 > early_param parse_gart_mem always 0 unless !p (then -EINVAL) > > For __setup, these are handled by obsolete_checksetup via > unknown_bootoption via parse_args in start_kernel, as a way to merge > __setup calls that should really be in param (i.e. non-early __setup). > Return values are bubbled up into parse_args and hit: > > default: > pr_err("%s: `%s' invalid for parameter `%s'\n", >doing, val ?: "", param); > break; > > So this is also a bug fix, since these __setup functions returned inverted > values or always failed: > > __setup rtasmsgs_setup always 1 > __setup setup_cede_offline 1 on success, otherwise 0 > __setup setup_hrtimer_hres 1 on success, otherwise 0 > __setup setup_tick_nohz 1 on success, otherwise 0 > > So if you specified any of these, they would trigger a bogus "invalid > parameter" report. > > I will double-check... I am wrong! __setup functions (as handled by unknown_bootoption) need to return 1, or they end up in the init environment. I will send a fix... -Kees > > -Kees > >> >> >>> Signed-off-by: Kees Cook >>> Acked-by: Heiko Carstens >>> Acked-by: Michael Ellerman >>> Cc: x...@kernel.org >>> Cc: linuxppc-...@lists.ozlabs.org >>> Cc: linux-s...@vger.kernel.org >>> --- >>> arch/powerpc/kernel/rtasd.c | 9 ++--- >>> arch/powerpc/platforms/pseries/hotplug-cpu.c | 10 ++ >>> arch/s390/kernel/time.c | 8 ++-- >>> arch/s390/kernel/topology.c | 7 ++- >>> arch/x86/kernel/aperture_64.c| 12 ++-- >>> include/linux/tick.h | 2 +- >>> kernel/time/hrtimer.c| 10 ++ >>> kernel/time/tick-sched.c | 10 ++ >>> 8 files changed, 15 insertions(+), 53 deletions(-) >>> >>> diff --git a/arch/powerpc/kernel/rtasd.c b/arch/powerpc/kernel/rtasd.c >>> index 5a2c049c1c61..567ed5a2f43a 100644 >>> --- a/arch/powerpc/kernel/rtasd.c >>> +++ b/arch/powerpc/kernel/rtasd.c >>> @@ -49,7 +49,7 @@ static unsigned int rtas_error_log_buffer_max; >>> static unsigned int event_scan; >>> static unsigned int rtas_event_scan_rate; >>> >>> -static int full_rtas_msgs = 0; >>> +static bool full_rtas_msgs; >>> >>> /* Stop logging to nvram after first fatal error */ >>> static int logging_enabled; /* Until we initialize everything, >>> @@ -592,11 +592,6 @@ __setup("surveillance=", surveillance_setup); >>> >>> static int __init rtasmsgs_setup(char *str) >>> { >>> - if (strcmp(str, "on") == 0) >>> - full_rtas_msgs = 1; >>> - else if (strcmp(str, "off") == 0) >>> - full_rtas_msgs = 0; >>> - >>> - return 1; >>> + return kstrtobool(str, 0, _rtas_msgs); >>> } >>> __setup("rtasmsgs=", rtasmsgs_setup); >>> diff --git a/arch/powerpc/platforms/pseries/hotplug-cpu.c >>> b/arch/powerpc/platforms/pseries/hotplug-cpu.c >>> index 32274f72fe3f..b9787cae4108 100644 >>> --- a/arch/powerpc/platforms/pseries/hotplug-cpu.c >>> +++ b/arch/powerpc/platforms/pseries/hotplug-cpu.c >>> @@ -47,20 +47,14 @@ static DEFINE_PER_CPU(enum cpu_state_vals, >>> current_state) = CPU_STATE_OFFLINE; >>> >>> static enum cpu_state_vals default_offline_state = CPU_STATE_OFFLINE; >>> >>> -static int cede_offline_enabled __read_mostly = 1; >>> +static bool cede_offline_enabled __read_mostly = true; >>> >>> /* >>> * Enable/disable cede_offline when available. >>> */ >>> static int __init setup_cede_offline(char *str) >>> { >>> - if (!strcmp(str, "off")) >>> - cede_offline_enabled = 0; >>> - else if (!strcmp(str, "on")) >>> - cede_offline_enabled = 1; >>> - else >>> - return 0; >>> - return 1; >>> +
Re: [PATCH v2] ath9k: make NF load complete quickly and reliably
Hi Miaoqing, On Fri, Feb 5, 2016 at 12:45 PM,wrote: > From: Miaoqing Pan > > Make NF load complete quickly and reliably. NF load execution > is delayed by HW to end of frame if frame Rx or Tx is ongoing. > Increasing timeout to max frame duration. If NF cal is ongoing > before NF load, stop it before load, and restart it afterwards. > > Signed-off-by: Miaoqing Pan > --- > drivers/net/wireless/ath/ath9k/calib.c | 38 > -- > 1 file changed, 32 insertions(+), 6 deletions(-) You should add a changelog here so people know what's changed in this version of the patch. Thanks, -- Julian Calaby Email: julian.cal...@gmail.com Profile: http://www.google.com/profiles/julian.calaby/ -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[RFC] mac80211: add A-MSDU tx support
Requires software tx queueing support. frag_list support (for zero-copy) is optional. Signed-off-by: Felix Fietkau--- include/net/mac80211.h | 10 net/mac80211/agg-tx.c | 5 ++ net/mac80211/debugfs.c | 2 + net/mac80211/ieee80211_i.h | 1 + net/mac80211/tx.c | 136 + 5 files changed, 154 insertions(+) diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 5714774..c221220 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h @@ -709,6 +709,7 @@ enum mac80211_tx_info_flags { * @IEEE80211_TX_CTRL_PS_RESPONSE: This frame is a response to a poll * frame (PS-Poll or uAPSD). * @IEEE80211_TX_CTRL_RATE_INJECT: This frame is injected with rate information + * @IEEE80211_TX_CTRL_AMSDU: This frame is an A-MSDU frame * * These flags are used in tx_info->control.flags. */ @@ -716,6 +717,7 @@ enum mac80211_tx_control_flags { IEEE80211_TX_CTRL_PORT_CTRL_PROTO = BIT(0), IEEE80211_TX_CTRL_PS_RESPONSE = BIT(1), IEEE80211_TX_CTRL_RATE_INJECT = BIT(2), + IEEE80211_TX_CTRL_AMSDU = BIT(3), }; /* @@ -1964,6 +1966,12 @@ struct ieee80211_txq { * order and does not need to manage its own reorder buffer or BA session * timeout. * + * @IEEE80211_HW_TX_AMSDU: Hardware (or driver) supports software aggregated + * A-MSDU frames. Requires software tx queueing support. + * + * @IEEE80211_HW_TX_FRAG_LIST: Hardware (or driver) supports sending frag_list + * skbs, needed for zero-copy software A-MSDU. + * * @NUM_IEEE80211_HW_FLAGS: number of hardware flags, used for sizing arrays */ enum ieee80211_hw_flags { @@ -2001,6 +2009,8 @@ enum ieee80211_hw_flags { IEEE80211_HW_BEACON_TX_STATUS, IEEE80211_HW_NEEDS_UNIQUE_STA_ADDR, IEEE80211_HW_SUPPORTS_REORDERING_BUFFER, + IEEE80211_HW_TX_AMSDU, + IEEE80211_HW_TX_FRAG_LIST, /* keep last, obviously */ NUM_IEEE80211_HW_FLAGS diff --git a/net/mac80211/agg-tx.c b/net/mac80211/agg-tx.c index 4932e9f..42fa810 100644 --- a/net/mac80211/agg-tx.c +++ b/net/mac80211/agg-tx.c @@ -935,6 +935,7 @@ void ieee80211_process_addba_resp(struct ieee80211_local *local, size_t len) { struct tid_ampdu_tx *tid_tx; + struct ieee80211_txq *txq; u16 capab, tid; u8 buf_size; bool amsdu; @@ -945,6 +946,10 @@ void ieee80211_process_addba_resp(struct ieee80211_local *local, buf_size = (capab & IEEE80211_ADDBA_PARAM_BUF_SIZE_MASK) >> 6; buf_size = min(buf_size, local->hw.max_tx_aggregation_subframes); + txq = sta->sta.txq[tid]; + if (!amsdu && txq) + set_bit(IEEE80211_TXQ_NO_AMSDU, _txq_info(txq)->flags); + mutex_lock(>ampdu_mlme.mtx); tid_tx = rcu_dereference_protected_tid_tx(sta, tid); diff --git a/net/mac80211/debugfs.c b/net/mac80211/debugfs.c index e433d0c..847779d 100644 --- a/net/mac80211/debugfs.c +++ b/net/mac80211/debugfs.c @@ -127,6 +127,8 @@ static const char *hw_flag_names[NUM_IEEE80211_HW_FLAGS + 1] = { FLAG(BEACON_TX_STATUS), FLAG(NEEDS_UNIQUE_STA_ADDR), FLAG(SUPPORTS_REORDERING_BUFFER), + FLAG(TX_AMSDU), + FLAG(TX_FRAG_LIST), /* keep last for the build bug below */ (void *)0x1 diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index a49c103..e68d8db 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h @@ -799,6 +799,7 @@ struct mac80211_qos_map { enum txq_info_flags { IEEE80211_TXQ_STOP, IEEE80211_TXQ_AMPDU, + IEEE80211_TXQ_NO_AMSDU, }; struct txq_info { diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index a5aa275..a4fe5bb 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -1324,6 +1324,10 @@ struct sk_buff *ieee80211_tx_dequeue(struct ieee80211_hw *hw, out: spin_unlock_bh(>queue.lock); + if (skb && skb_has_frag_list(skb) && + !ieee80211_hw_check(>hw, TX_FRAG_LIST)) + skb_linearize(skb); + return skb; } EXPORT_SYMBOL(ieee80211_tx_dequeue); @@ -2763,6 +2767,134 @@ void ieee80211_clear_fast_xmit(struct sta_info *sta) kfree_rcu(fast_tx, rcu_head); } +static int ieee80211_amsdu_pad(struct sk_buff *skb, int subframe_len) +{ + int amsdu_len = subframe_len + sizeof(struct ethhdr); + int padding = (4 - amsdu_len) & 3; + + if (padding) + memset(skb_put(skb, padding), 0, padding); + + return padding; +} + +static bool ieee80211_amsdu_prepare_head(struct ieee80211_sub_if_data *sdata, +struct ieee80211_fast_tx *fast_tx, +struct sk_buff *skb) +{ + struct ieee80211_local *local = sdata->local; + struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); + struct ieee80211_hdr
[PATCH 4/8] staging: wilc1000: fix return error code of wilc_deinit
It should be returned error code as -EFAULT instead of 0 when hif_drv is NULL. Signed-off-by: Chaehyun Lim--- drivers/staging/wilc1000/host_interface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 36eeeb4..6c91071 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -3890,7 +3890,7 @@ int wilc_deinit(struct wilc_vif *vif) if (!hif_drv) { PRINT_ER("hif_drv = NULL\n"); - return 0; + return -EFAULT; } down(_sema_deinit); -- 2.7.0 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 2/8] staging: wilc1000: rename pstrCfgParamVal in wilc_hif_set_cfg
This patch renames pstrCfgParamVal to cfg_param to avoid camelcase. Signed-off-by: Chaehyun Lim--- drivers/staging/wilc1000/host_interface.c | 4 ++-- drivers/staging/wilc1000/host_interface.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index a5b7dd1..0f8175f 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -3730,7 +3730,7 @@ int wilc_scan(struct wilc_vif *vif, u8 scan_source, u8 scan_type, } int wilc_hif_set_cfg(struct wilc_vif *vif, -struct cfg_param_val *pstrCfgParamVal) +struct cfg_param_val *cfg_param) { int result = 0; struct host_if_msg msg; @@ -3743,7 +3743,7 @@ int wilc_hif_set_cfg(struct wilc_vif *vif, memset(, 0, sizeof(struct host_if_msg)); msg.id = HOST_IF_MSG_CFG_PARAMS; - msg.body.cfg_info.cfg_attr_info = *pstrCfgParamVal; + msg.body.cfg_info.cfg_attr_info = *cfg_param; msg.vif = vif; result = wilc_mq_send(_msg_q, , sizeof(struct host_if_msg)); diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h index fe32a9a..4b19bf1 100644 --- a/drivers/staging/wilc1000/host_interface.h +++ b/drivers/staging/wilc1000/host_interface.h @@ -340,7 +340,7 @@ int wilc_scan(struct wilc_vif *vif, u8 scan_source, u8 scan_type, size_t ies_len, wilc_scan_result scan_result, void *user_arg, struct hidden_network *hidden_network); int wilc_hif_set_cfg(struct wilc_vif *vif, -struct cfg_param_val *pstrCfgParamVal); +struct cfg_param_val *cfg_param); int wilc_init(struct net_device *dev, struct host_if_drv **hif_drv_handler); s32 wilc_deinit(struct wilc_vif *vif); int wilc_add_beacon(struct wilc_vif *vif, u32 interval, u32 dtim_period, -- 2.7.0 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 1/8] staging: wilc1000: fix return type of wilc_hif_set_cfg
This patch changes return type of wilc_hif_set_cfg from s32 to int. The result variable gets return value from wilc_mq_send that has data type of int. It should be changed return type of this function as well as data type of result variable. Signed-off-by: Chaehyun Lim--- drivers/staging/wilc1000/host_interface.c | 4 ++-- drivers/staging/wilc1000/host_interface.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index d77e2b2..a5b7dd1 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -3729,10 +3729,10 @@ int wilc_scan(struct wilc_vif *vif, u8 scan_source, u8 scan_type, return result; } -s32 wilc_hif_set_cfg(struct wilc_vif *vif, +int wilc_hif_set_cfg(struct wilc_vif *vif, struct cfg_param_val *pstrCfgParamVal) { - s32 result = 0; + int result = 0; struct host_if_msg msg; struct host_if_drv *hif_drv = vif->hif_drv; diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h index 4c02e6b..fe32a9a 100644 --- a/drivers/staging/wilc1000/host_interface.h +++ b/drivers/staging/wilc1000/host_interface.h @@ -339,7 +339,7 @@ int wilc_scan(struct wilc_vif *vif, u8 scan_source, u8 scan_type, u8 *ch_freq_list, u8 ch_list_len, const u8 *ies, size_t ies_len, wilc_scan_result scan_result, void *user_arg, struct hidden_network *hidden_network); -s32 wilc_hif_set_cfg(struct wilc_vif *vif, +int wilc_hif_set_cfg(struct wilc_vif *vif, struct cfg_param_val *pstrCfgParamVal); int wilc_init(struct net_device *dev, struct host_if_drv **hif_drv_handler); s32 wilc_deinit(struct wilc_vif *vif); -- 2.7.0 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 5/8] staging: wilc1000: fix return type of wilc_send_config_pkt
wilc_send_config_pkt is returned 0 or -ETIMEDOUT according to return value of wilc_wlan_cfg_get or wilc_wlan_cfg_set. It is better to use int type to represent linux standard error code. Signed-off-by: Chaehyun Lim--- drivers/staging/wilc1000/coreconfigurator.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c index 49ae9b1..323a0cd 100644 --- a/drivers/staging/wilc1000/coreconfigurator.c +++ b/drivers/staging/wilc1000/coreconfigurator.c @@ -449,10 +449,11 @@ s32 wilc_dealloc_assoc_resp_info(tstrConnectRespInfo *pstrConnectRespInfo) * @date 1 Mar 2012 * @version 1.0 */ -s32 wilc_send_config_pkt(struct wilc *wilc, u8 mode, struct wid *wids, +int wilc_send_config_pkt(struct wilc *wilc, u8 mode, struct wid *wids, u32 count, u32 drv) { - s32 counter = 0, ret = 0; + s32 counter = 0; + int ret = 0; if (mode == GET_CFG) { for (counter = 0; counter < count; counter++) { -- 2.7.0 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 3/8] staging: wilc1000: fix return type of wilc_deinit
This patch changes return type of wilc_deinit from s32 to int. The result variable gets return value from wilc_mq_send that has return type of int. It should be changed return type of this function as well as data type of result variable. Signed-off-by: Chaehyun Lim--- drivers/staging/wilc1000/host_interface.c | 4 ++-- drivers/staging/wilc1000/host_interface.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 0f8175f..36eeeb4 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -3882,9 +3882,9 @@ _fail_: return result; } -s32 wilc_deinit(struct wilc_vif *vif) +int wilc_deinit(struct wilc_vif *vif) { - s32 result = 0; + int result = 0; struct host_if_msg msg; struct host_if_drv *hif_drv = vif->hif_drv; diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h index 4b19bf1..f4e6839 100644 --- a/drivers/staging/wilc1000/host_interface.h +++ b/drivers/staging/wilc1000/host_interface.h @@ -342,7 +342,7 @@ int wilc_scan(struct wilc_vif *vif, u8 scan_source, u8 scan_type, int wilc_hif_set_cfg(struct wilc_vif *vif, struct cfg_param_val *cfg_param); int wilc_init(struct net_device *dev, struct host_if_drv **hif_drv_handler); -s32 wilc_deinit(struct wilc_vif *vif); +int wilc_deinit(struct wilc_vif *vif); int wilc_add_beacon(struct wilc_vif *vif, u32 interval, u32 dtim_period, u32 head_len, u8 *head, u32 tail_len, u8 *tail); int wilc_del_beacon(struct wilc_vif *vif); -- 2.7.0 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 6/8] staging: wilc1000: use int type for counter variable
counter is used as for-loop control variable and indicating index of struct wid array so that it is better to use int type. There is no need to set to 0 when it is declared at the top of this function. It is initialized as 0 in for-loop statement. Signed-off-by: Chaehyun Lim--- drivers/staging/wilc1000/coreconfigurator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c index 323a0cd..4008872 100644 --- a/drivers/staging/wilc1000/coreconfigurator.c +++ b/drivers/staging/wilc1000/coreconfigurator.c @@ -452,7 +452,7 @@ s32 wilc_dealloc_assoc_resp_info(tstrConnectRespInfo *pstrConnectRespInfo) int wilc_send_config_pkt(struct wilc *wilc, u8 mode, struct wid *wids, u32 count, u32 drv) { - s32 counter = 0; + int counter; int ret = 0; if (mode == GET_CFG) { -- 2.7.0 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 8/8] staging: wilc1000: rename counter in wilc_send_config_pkt
counter is used as for-loop control variable and indicating index of struct wid array. It is to improve readability by changing counter variable name as i because wilc_send_config_pkt has a similar argument name as count. Signed-off-by: Chaehyun Lim--- drivers/staging/wilc1000/coreconfigurator.c | 38 ++--- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c index dda81ee..00081bc 100644 --- a/drivers/staging/wilc1000/coreconfigurator.c +++ b/drivers/staging/wilc1000/coreconfigurator.c @@ -452,36 +452,36 @@ s32 wilc_dealloc_assoc_resp_info(tstrConnectRespInfo *pstrConnectRespInfo) int wilc_send_config_pkt(struct wilc *wilc, u8 mode, struct wid *wids, u32 count, u32 drv) { - int counter; + int i; int ret = 0; if (mode == GET_CFG) { - for (counter = 0; counter < count; counter++) { - PRINT_INFO(CORECONFIG_DBG, "Sending CFG packet [%d][%d]\n", !counter, - (counter == count - 1)); - if (!wilc_wlan_cfg_get(wilc, !counter, - wids[counter].id, - (counter == count - 1), + for (i = 0; i < count; i++) { + PRINT_INFO(CORECONFIG_DBG, "Sending CFG packet [%d][%d]\n", !i, + (i == count - 1)); + if (!wilc_wlan_cfg_get(wilc, !i, + wids[i].id, + (i == count - 1), drv)) { ret = -ETIMEDOUT; printk("[Sendconfigpkt]Get Timed out\n"); break; } } - for (counter = 0; counter < count; counter++) { - wids[counter].size = wilc_wlan_cfg_get_val( - wids[counter].id, - wids[counter].val, - wids[counter].size); + for (i = 0; i < count; i++) { + wids[i].size = wilc_wlan_cfg_get_val( + wids[i].id, + wids[i].val, + wids[i].size); } } else if (mode == SET_CFG) { - for (counter = 0; counter < count; counter++) { - PRINT_D(CORECONFIG_DBG, "Sending config SET PACKET WID:%x\n", wids[counter].id); - if (!wilc_wlan_cfg_set(wilc, !counter, - wids[counter].id, - wids[counter].val, - wids[counter].size, - (counter == count - 1), + for (i = 0; i < count; i++) { + PRINT_D(CORECONFIG_DBG, "Sending config SET PACKET WID:%x\n", wids[i].id); + if (!wilc_wlan_cfg_set(wilc, !i, + wids[i].id, + wids[i].val, + wids[i].size, + (i == count - 1), drv)) { ret = -ETIMEDOUT; printk("[Sendconfigpkt]Set Timed out\n"); -- 2.7.0 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 7/8] staging: wilc1000: remove initialization code of counter variable
There is no need to set to 0 for counter variable before entering next for-loop statement because counter is initialized again in for-loop statement, so just remove it. Signed-off-by: Chaehyun Lim--- drivers/staging/wilc1000/coreconfigurator.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c index 4008872..dda81ee 100644 --- a/drivers/staging/wilc1000/coreconfigurator.c +++ b/drivers/staging/wilc1000/coreconfigurator.c @@ -468,7 +468,6 @@ int wilc_send_config_pkt(struct wilc *wilc, u8 mode, struct wid *wids, break; } } - counter = 0; for (counter = 0; counter < count; counter++) { wids[counter].size = wilc_wlan_cfg_get_val( wids[counter].id, -- 2.7.0 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2 4/4] param: convert some "on"/"off" users to strtobool
On Thu, Feb 4, 2016 at 3:04 PM, Andy Shevchenkowrote: > On Thu, Feb 4, 2016 at 11:00 PM, Kees Cook wrote: >> This changes several users of manual "on"/"off" parsing to use strtobool. >> (Which means they will now parse y/n/1/0 meaningfully too.) >> > > I like this change, but can you carefully check the acceptance of the > returned value? > Briefly I saw 1 or 0 as okay in different places. Maybe I missed something, but I think this is actually a bug fix. The two cases are early_param and __setup: For early_param, the functions are called when walking the command line in do_early_param via parse_args in parse_early_options. Any non-zero return values produce a warning (in do_early_param not parse_args). So this is a bug fix, since the function I touched would (almost) always return 0, even with bad values (i.e. fixes unreported bad arguments): early_param early_parse_stp always 0 early_param early_parse_topology always 0 early_param parse_gart_mem always 0 unless !p (then -EINVAL) For __setup, these are handled by obsolete_checksetup via unknown_bootoption via parse_args in start_kernel, as a way to merge __setup calls that should really be in param (i.e. non-early __setup). Return values are bubbled up into parse_args and hit: default: pr_err("%s: `%s' invalid for parameter `%s'\n", doing, val ?: "", param); break; So this is also a bug fix, since these __setup functions returned inverted values or always failed: __setup rtasmsgs_setup always 1 __setup setup_cede_offline 1 on success, otherwise 0 __setup setup_hrtimer_hres 1 on success, otherwise 0 __setup setup_tick_nohz 1 on success, otherwise 0 So if you specified any of these, they would trigger a bogus "invalid parameter" report. I will double-check... -Kees > > >> Signed-off-by: Kees Cook >> Acked-by: Heiko Carstens >> Acked-by: Michael Ellerman >> Cc: x...@kernel.org >> Cc: linuxppc-...@lists.ozlabs.org >> Cc: linux-s...@vger.kernel.org >> --- >> arch/powerpc/kernel/rtasd.c | 9 ++--- >> arch/powerpc/platforms/pseries/hotplug-cpu.c | 10 ++ >> arch/s390/kernel/time.c | 8 ++-- >> arch/s390/kernel/topology.c | 7 ++- >> arch/x86/kernel/aperture_64.c| 12 ++-- >> include/linux/tick.h | 2 +- >> kernel/time/hrtimer.c| 10 ++ >> kernel/time/tick-sched.c | 10 ++ >> 8 files changed, 15 insertions(+), 53 deletions(-) >> >> diff --git a/arch/powerpc/kernel/rtasd.c b/arch/powerpc/kernel/rtasd.c >> index 5a2c049c1c61..567ed5a2f43a 100644 >> --- a/arch/powerpc/kernel/rtasd.c >> +++ b/arch/powerpc/kernel/rtasd.c >> @@ -49,7 +49,7 @@ static unsigned int rtas_error_log_buffer_max; >> static unsigned int event_scan; >> static unsigned int rtas_event_scan_rate; >> >> -static int full_rtas_msgs = 0; >> +static bool full_rtas_msgs; >> >> /* Stop logging to nvram after first fatal error */ >> static int logging_enabled; /* Until we initialize everything, >> @@ -592,11 +592,6 @@ __setup("surveillance=", surveillance_setup); >> >> static int __init rtasmsgs_setup(char *str) >> { >> - if (strcmp(str, "on") == 0) >> - full_rtas_msgs = 1; >> - else if (strcmp(str, "off") == 0) >> - full_rtas_msgs = 0; >> - >> - return 1; >> + return kstrtobool(str, 0, _rtas_msgs); >> } >> __setup("rtasmsgs=", rtasmsgs_setup); >> diff --git a/arch/powerpc/platforms/pseries/hotplug-cpu.c >> b/arch/powerpc/platforms/pseries/hotplug-cpu.c >> index 32274f72fe3f..b9787cae4108 100644 >> --- a/arch/powerpc/platforms/pseries/hotplug-cpu.c >> +++ b/arch/powerpc/platforms/pseries/hotplug-cpu.c >> @@ -47,20 +47,14 @@ static DEFINE_PER_CPU(enum cpu_state_vals, >> current_state) = CPU_STATE_OFFLINE; >> >> static enum cpu_state_vals default_offline_state = CPU_STATE_OFFLINE; >> >> -static int cede_offline_enabled __read_mostly = 1; >> +static bool cede_offline_enabled __read_mostly = true; >> >> /* >> * Enable/disable cede_offline when available. >> */ >> static int __init setup_cede_offline(char *str) >> { >> - if (!strcmp(str, "off")) >> - cede_offline_enabled = 0; >> - else if (!strcmp(str, "on")) >> - cede_offline_enabled = 1; >> - else >> - return 0; >> - return 1; >> + return kstrtobool(str, 0, _offline_enabled); >> } >> >> __setup("cede_offline=", setup_cede_offline); >> diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c >> index 99f84ac31307..dff6ce1b84b2 100644 >> --- a/arch/s390/kernel/time.c >> +++ b/arch/s390/kernel/time.c >> @@ -1433,7 +1433,7 @@ device_initcall(etr_init_sysfs); >> /* >> * Server Time Protocol (STP)
[PATCH] staging: wilc1000: Fix compilation error when CONFIG_PM disabled
Commit 73584a40d748 ("staging: wilc1000: add ops resuem/suspend/wakeup in cfg80211") causes following compilation error. This patch fixes this by using suspend/resume under CONFIG_PM. drivers/staging/wilc1000/wilc_wfi_cfgoperations.c: In function 'wilc_create_wiphy': >> drivers/staging/wilc1000/wilc_wfi_cfgoperations.c:2833:13: error: 'struct wiphy' has no member named 'wowlan' wdev->wiphy->wowlan = _support; Fixes: 73584a40d748 ("staging: wilc1000: add ops resuem/suspend/wakeup in cfg80211") Reported-by: kbuild test robotSigned-off-by: Glen Lee --- drivers/staging/wilc1000/wilc_sdio.c | 4 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 9 - drivers/staging/wilc1000/wilc_wfi_netdevice.h | 2 ++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/staging/wilc1000/wilc_sdio.c b/drivers/staging/wilc1000/wilc_sdio.c index 7c20c8c..26cc9c3 100644 --- a/drivers/staging/wilc1000/wilc_sdio.c +++ b/drivers/staging/wilc1000/wilc_sdio.c @@ -162,6 +162,7 @@ static int sdio_reset(struct wilc *wilc) return 0; } +#ifdef CONFIG_PM static int wilc_sdio_suspend(struct device *dev) { struct sdio_func *func = dev_to_sdio_func(dev); @@ -210,15 +211,18 @@ static const struct dev_pm_ops wilc_sdio_pm_ops = { .suspend = wilc_sdio_suspend, .resume = wilc_sdio_resume, }; +#endif static struct sdio_driver wilc1000_sdio_driver = { .name = SDIO_MODALIAS, .id_table = wilc_sdio_ids, .probe = linux_sdio_probe, .remove = linux_sdio_remove, +#ifdef CONFIG_PM .drv = { .pm = _sdio_pm_ops, } +#endif }; module_driver(wilc1000_sdio_driver, sdio_register_driver, diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c index a899b37..a4a6bb8 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c @@ -74,9 +74,11 @@ static const struct ieee80211_txrx_stypes } }; +#ifdef CONFIG_PM static const struct wiphy_wowlan_support wowlan_support = { .flags = WIPHY_WOWLAN_ANY }; +#endif #define WILC_WFI_DWELL_PASSIVE 100 #define WILC_WFI_DWELL_ACTIVE 40 @@ -2407,6 +2409,7 @@ static int del_virtual_intf(struct wiphy *wiphy, struct wireless_dev *wdev) return 0; } +#ifdef CONFIG_PM static int wilc_suspend(struct wiphy *wiphy, struct cfg80211_wowlan *wow) { struct wilc_priv *priv = wiphy_priv(wiphy); @@ -2436,6 +2439,7 @@ static void wilc_set_wakeup(struct wiphy *wiphy, bool enabled) netdev_info(vif->ndev, "cfg set wake up = %d\n", enabled); } +#endif static int set_tx_power(struct wiphy *wiphy, struct wireless_dev *wdev, enum nl80211_tx_power_setting type, int mbm) @@ -2504,10 +2508,11 @@ static struct cfg80211_ops wilc_cfg80211_ops = { .mgmt_frame_register = wilc_mgmt_frame_register, .set_power_mgmt = set_power_mgmt, .set_cqm_rssi_config = set_cqm_rssi_config, - +#ifdef CONFIG_PM .suspend = wilc_suspend, .resume = wilc_resume, .set_wakeup = wilc_set_wakeup, +#endif .set_tx_power = set_tx_power, .get_tx_power = get_tx_power, @@ -2591,7 +2596,9 @@ struct wireless_dev *wilc_create_wiphy(struct net_device *net, struct device *de sema_init(&(priv->SemHandleUpdateStats), 1); priv->wdev = wdev; wdev->wiphy->max_scan_ssids = MAX_NUM_PROBED_SSID; +#ifdef CONFIG_PM wdev->wiphy->wowlan = _support; +#endif wdev->wiphy->max_num_pmkids = WILC_MAX_NUM_PMKIDS; PRINT_INFO(CFG80211_DBG, "Max number of PMKIDs = %d\n", wdev->wiphy->max_num_pmkids); diff --git a/drivers/staging/wilc1000/wilc_wfi_netdevice.h b/drivers/staging/wilc1000/wilc_wfi_netdevice.h index 3077f5d4..39b72cd 100644 --- a/drivers/staging/wilc1000/wilc_wfi_netdevice.h +++ b/drivers/staging/wilc1000/wilc_wfi_netdevice.h @@ -215,7 +215,9 @@ struct wilc { const struct firmware *firmware; struct device *dev; +#ifdef CONFIG_PM bool suspend_event; +#endif struct rf_info dummy_statistics; }; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Finer grained control than ap_isolate
Is there a mechanism that can be used to allow some clients/ports on a given SSID and AP to communicate, but to block others from communicating? In other words, can I implement something like firewall rules between clients on the same SSID/AP? Thanks, Brian -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 1/2] rtlwifi: Fix improve function 'rtl_addr_delay()' in core.c
On 02/04/2016 03:48 AM, David Laight wrote: From: Larry Finger Sent: 03 February 2016 19:45 ... The performance will depend on where you satisfy the condition. All switch cases have the same execution time, but in the if .. else if .. else form, the earlier tests execute more quickly. I'm not sure that one can make any blanket statement about performance. Certainly, the switch version will be larger. For a switch with 8 cases plus default, the object code if 43 bytes larger than the nested ifs in a test program that I created. That is a significant penalty. There is also the penalty of the (likely) data cache miss reading the jump table. But given this code is all about generating a variable delay the execution speed is probably irrelevant. It would be much more interesting if the delay could be changed for sleeps. Unfortunately, sleeping is not possible for the routines that call rtl_addr_delay(). Larry -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH RESEND 00/70] staging: wilc1000: rebase and resend
I rebased all the pending patches which are not accepted yet and resend them. Chris Park (13): staging: wilc1000: fix warnings for line over 80 characters staging: wilc1000: remove useless log message staging: wilc1000: remove useless function staging: wilc1000: remove unnecessary braces staging: wilc1000: remove warnings missing a blank line after declarations staging: wilc1000: Optimize code of wilc_get_chipid function staging: wilc1000: remove unused log message using the CORECONFIG_DBG tag staging: wilc1000: remove unused log message using the HOSTINF_DBG tag staging: wilc1000: remove unused log message using the TX_DBG tag staging: wilc1000: remove unnecessary wilc_rx_complete function staging: wilc1000: remove unused log message using the RX_DBG tag staging: wilc1000: remove unused debug tag staging: wilc1000: remove unnecessary log message using GENERIC_DBG tag Glen Lee (14): staging: wilc1000: wilc_set_wfi_drv_handler: add mac index staging: wilc1000: remove unused functions staging: wilc1000: ignore power save staging: wilc1000: handle connecting error staging: wilc1000: tcp_process: fix a build warning staging: wilc1000: remove define TCP_ACK_FILTER staging: wilc1000: increase link speed staging: wilc1000: disable power save when AP mode staging: wilc1000: fix bug on p2p connection staging: wilc1000: add ops tx power in cfg80211 staging: wilc1000: fix WEP security bug staging: wilc1000: get mac address after setting drv handler staging: wilc1000: move wilc_send_config_pkt to wilc_wlan.c staging: wilc1000: pass vif to wilc_send_config_pkt Leo Kim (43): staging: wilc1000: rename hWILCWFIDrv of wilc_priv structure staging: wilc1000: fixes missing a blank line after declarations staging: wilc1000: rename pBssid of tx_complete_data structure staging: wilc1000: remove warnings line over 80 characters staging: wilc1000: removes unnecessary debug logs staging: wilc1000: replaces PRINT_XXX with netdev_xxx staging: wilc1000: removes void function return staging: wilc1000: renames u8IfIdx of wilc_vif structure staging: wilc1000: fixes variable dereferenced before check staging: wilc1000: wilc_parse_network_info(): renames function variables staging: wilc1000: wilc_parse_network_info(): renames local variables staging: wilc1000: wilc_parse_network_info(): renames local inner variables staging: wilc1000: rename variable s32Error staging: wilc1000: wilc_parse_assoc_resp_info(): renames function variables staging: wilc1000: wilc_parse_assoc_resp_info(): renames local variables staging: wilc1000: wilc_dealloc_assoc_resp_info(): renames function variables staging: wilc1000: wilc_dealloc_network_info(): renames function variables staging: wilc1000: wilc_wfi_cfgoperations.c: replaces PRINT_ER with netdev_err staging: wilc1000: wilc_msgqueue.c: removes debug print log staging: wilc1000: wilc_wlan.c: replaces PRINT_ER with netdev_err staging: wilc1000: linux_mon.c: replaces PRINT_ER with netdev_err staging: wilc1000: removes function 'wilc_dealloc_network_info()' staging: wilc1000: removes function 'wilc_dealloc_assoc_resp_info()' staging: wilc1000: remove typedef from tstrConnectRespInfo staging: wilc1000: renames struct connect_resp_info variables staging: wilc1000: remove typedef from pstrNetworkInfo staging: wilc1000: renames s8rssi of connect_resp_info structure staging: wilc1000: renames u16CapInfo of connect_resp_info structure staging: wilc1000: renames au8ssid of connect_resp_info structure staging: wilc1000: renames u8SsidLen of connect_resp_info structure staging: wilc1000: renames au8bssid of connect_resp_info structure staging: wilc1000: renames u16BeaconPeriod of connect_resp_info structure staging: wilc1000: renames u8DtimPeriod of connect_resp_info structure staging: wilc1000: renames u8channel of connect_resp_info structure staging: wilc1000: renames struct connect_resp_info variables staging: wilc1000: renames bNewNetwork of connect_resp_info structure staging: wilc1000: renames u8Found of connect_resp_info structure staging: wilc1000: renames u32Tsf of connect_resp_info structure staging: wilc1000: renames struct connect_resp_info variables staging: wilc1000: renames pJoinParams of connect_resp_info structure staging: wilc1000: renames strRssi of connect_resp_info structure staging: wilc1000: renames u64Tsf of connect_resp_info structure staging: wilc1000: remove warnings line over 80 characters drivers/staging/wilc1000/Makefile | 1 - drivers/staging/wilc1000/coreconfigurator.c | 251 +++-- drivers/staging/wilc1000/coreconfigurator.h | 73 ++- drivers/staging/wilc1000/host_interface.c | 633 +++--- drivers/staging/wilc1000/host_interface.h | 13 +- drivers/staging/wilc1000/linux_mon.c | 30 +- drivers/staging/wilc1000/linux_wlan.c
[PATCH RESEND 03/70] staging: wilc1000: ignore power save
If two interfaces are connected and it is required to enable power save then ignore the request. Signed-off-by: Glen Lee--- drivers/staging/wilc1000/host_interface.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 1dc6af0..7e1b5a0 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -4341,6 +4341,9 @@ int wilc_set_power_mgmt(struct wilc_vif *vif, bool enabled, u32 timeout) return -EFAULT; } + if (wilc_wlan_get_num_conn_ifcs(vif->wilc) == 2 && enabled) + return 0; + PRINT_D(HOSTINF_DBG, "Setting Power management message queue params\n"); memset(, 0, sizeof(struct host_if_msg)); -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH RESEND 10/70] staging: wilc1000: add ops tx power in cfg80211
This patch implements set_tx_power and get_tx_power of cfg80211_ops. In addition, Id of HOST_IF_MSG_DEL_ALL_RX_BA_SESSIONS is changed with 37. Signed-off-by: Glen Lee--- drivers/staging/wilc1000/host_interface.c | 88 ++- drivers/staging/wilc1000/host_interface.h | 2 + drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 35 + drivers/staging/wilc1000/wilc_wlan_if.h | 1 + 4 files changed, 125 insertions(+), 1 deletion(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 4bbf38c..4b1d92c 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -46,7 +46,9 @@ #define HOST_IF_MSG_DEL_BA_SESSION 34 #define HOST_IF_MSG_Q_IDLE 35 #define HOST_IF_MSG_DEL_ALL_STA 36 -#define HOST_IF_MSG_DEL_ALL_RX_BA_SESSIONS 34 +#define HOST_IF_MSG_DEL_ALL_RX_BA_SESSIONS 37 +#define HOST_IF_MSG_SET_TX_POWER 38 +#define HOST_IF_MSG_GET_TX_POWER 39 #define HOST_IF_MSG_EXIT100 #define HOST_IF_SCAN_TIMEOUT4000 @@ -166,6 +168,10 @@ struct sta_inactive_t { u8 mac[6]; }; +struct tx_power { + u8 tx_pwr; +}; + union message_body { struct scan_attr scan_info; struct connect_attr con_info; @@ -191,6 +197,7 @@ union message_body { struct reg_frame reg_frame; char *data; struct del_all_sta del_all_sta_info; + struct tx_power tx_power; }; struct host_if_msg { @@ -2783,6 +2790,40 @@ static s32 Handle_DelAllRxBASessions(struct wilc_vif *vif, return result; } +static void handle_set_tx_pwr(struct wilc_vif *vif, u8 tx_pwr) +{ + int ret; + struct wid wid; + + wid.id = (u16)WID_TX_POWER; + wid.type = WID_CHAR; + wid.val = _pwr; + wid.size = sizeof(char); + + ret = wilc_send_config_pkt(vif->wilc, SET_CFG, , 1, +wilc_get_vif_idx(vif)); + if (ret) + netdev_err(vif->ndev, "Failed to set TX PWR\n"); +} + +static void handle_get_tx_pwr(struct wilc_vif *vif, u8 *tx_pwr) +{ + s32 ret = 0; + struct wid wid; + + wid.id = (u16)WID_TX_POWER; + wid.type = WID_CHAR; + wid.val = (s8 *)tx_pwr; + wid.size = sizeof(char); + + ret = wilc_send_config_pkt(vif->wilc, GET_CFG, , 1, +wilc_get_vif_idx(vif)); + if (ret) + netdev_err(vif->ndev, "Failed to get TX PWR\n"); + + up(_sema_wait_response); +} + static int hostIFthread(void *pvArg) { u32 u32Ret; @@ -2986,6 +3027,13 @@ static int hostIFthread(void *pvArg) Handle_DelAllSta(msg.vif, _all_sta_info); break; + case HOST_IF_MSG_SET_TX_POWER: + handle_set_tx_pwr(msg.vif, msg.body.tx_power.tx_pwr); + break; + + case HOST_IF_MSG_GET_TX_POWER: + handle_get_tx_pwr(msg.vif, _power.tx_pwr); + break; default: PRINT_ER("[Host Interface] undefined Received Msg ID\n"); break; @@ -4596,3 +4644,41 @@ static int host_int_get_ipaddress(struct wilc_vif *vif, u8 *ip_addr, u8 idx) return result; } + +int wilc_set_tx_power(struct wilc_vif *vif, u8 tx_power) +{ + int ret = 0; + struct host_if_msg msg; + + memset(, 0, sizeof(struct host_if_msg)); + + msg.id = HOST_IF_MSG_SET_TX_POWER; + msg.body.tx_power.tx_pwr = tx_power; + msg.vif = vif; + + ret = wilc_mq_send(_msg_q, , sizeof(struct host_if_msg)); + if (ret) + netdev_err(vif->ndev, "wilc_mq_send fail\n"); + + return ret; +} + +int wilc_get_tx_power(struct wilc_vif *vif, u8 *tx_power) +{ + int ret = 0; + struct host_if_msg msg; + + memset(, 0, sizeof(struct host_if_msg)); + + msg.id = HOST_IF_MSG_GET_TX_POWER; + msg.vif = vif; + + ret = wilc_mq_send(_msg_q, , sizeof(struct host_if_msg)); + if (ret) + netdev_err(vif->ndev, "Failed to get TX PWR\n"); + + down(_sema_wait_response); + *tx_power = msg.body.tx_power.tx_pwr; + + return ret; +} diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h index 3302a5b..69c36a7 100644 --- a/drivers/staging/wilc1000/host_interface.h +++ b/drivers/staging/wilc1000/host_interface.h @@ -365,6 +365,8 @@ int wilc_set_operation_mode(struct wilc_vif *vif, u32 mode); int wilc_get_statistics(struct wilc_vif *vif, struct rf_info *stats); void wilc_resolve_disconnect_aberration(struct wilc_vif *vif); int wilc_get_vif_idx(struct wilc_vif *vif); +int wilc_set_tx_power(struct wilc_vif *vif, u8 tx_power); +int wilc_get_tx_power(struct wilc_vif *vif, u8
[PATCH RESEND 09/70] staging: wilc1000: fix bug on p2p connection
In case of action frame, size -7 is correct, but in this case, size should be used as it is. Signed-off-by: Glen Lee--- drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c index adca14c..e178b1b 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c @@ -1728,7 +1728,7 @@ void WILC_WFI_p2p_rx (struct net_device *dev, u8 *buff, u32 size) } } - cfg80211_rx_mgmt(priv->wdev, s32Freq, 0, buff, size - 7, 0); + cfg80211_rx_mgmt(priv->wdev, s32Freq, 0, buff, size, 0); } } -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH RESEND 06/70] staging: wilc1000: remove define TCP_ACK_FILTER
This patch removes define TCP_ACK_FILTER and use it's feature codes. Add argument wilc to wilc_wlan_txq_remove because compile error happens. Signed-off-by: Glen Lee--- drivers/staging/wilc1000/Makefile| 1 - drivers/staging/wilc1000/wilc_wlan.c | 22 ++ 2 files changed, 2 insertions(+), 21 deletions(-) diff --git a/drivers/staging/wilc1000/Makefile b/drivers/staging/wilc1000/Makefile index 90c3760..acc3f3e 100644 --- a/drivers/staging/wilc1000/Makefile +++ b/drivers/staging/wilc1000/Makefile @@ -4,7 +4,6 @@ ccflags-y += -DFIRMWARE_1002=\"atmel/wilc1002_firmware.bin\" \ -DFIRMWARE_1003=\"atmel/wilc1003_firmware.bin\" ccflags-y += -I$(src)/ -DWILC_ASIC_A0 -DWILC_DEBUGFS -#ccflags-y += -DTCP_ACK_FILTER wilc1000-objs := wilc_wfi_cfgoperations.o linux_wlan.o linux_mon.o \ wilc_msgqueue.o \ diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index 25cf325..9442016 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -36,8 +36,7 @@ static inline void release_bus(struct wilc *wilc, BUS_RELEASE_T release) mutex_unlock(>hif_cs); } -#ifdef TCP_ACK_FILTER -static void wilc_wlan_txq_remove(struct txq_entry_t *tqe) +static void wilc_wlan_txq_remove(struct wilc *wilc, struct txq_entry_t *tqe) { if (tqe == wilc->txq_head) { @@ -54,7 +53,6 @@ static void wilc_wlan_txq_remove(struct txq_entry_t *tqe) } wilc->txq_entries -= 1; } -#endif static struct txq_entry_t * wilc_wlan_txq_remove_from_head(struct net_device *dev) @@ -146,7 +144,6 @@ static int wilc_wlan_txq_add_to_head(struct wilc *wilc, struct txq_entry_t *tqe) return 0; } -#ifdef TCP_ACK_FILTER struct ack_session_info; struct ack_session_info { u32 seq_num; @@ -308,7 +305,7 @@ static int wilc_wlan_txq_filter_dup_tcp_ack(struct net_device *dev) pending_acks_info[i].ack_num); tqe = pending_acks_info[i].txqe; if (tqe) { - wilc_wlan_txq_remove(tqe); + wilc_wlan_txq_remove(wilc, tqe); tqe->status = 1; if (tqe->tx_complete_func) tqe->tx_complete_func(tqe->priv, @@ -335,7 +332,6 @@ static int wilc_wlan_txq_filter_dup_tcp_ack(struct net_device *dev) return 1; } -#endif static bool enabled = false; @@ -344,12 +340,10 @@ void wilc_enable_tcp_ack_filter(bool value) enabled = value; } -#ifdef TCP_ACK_FILTER static bool is_tcp_ack_filter_enabled(void) { return enabled; } -#endif static int wilc_wlan_txq_add_cfg_pkt(struct wilc *wilc, u8 *buffer, u32 buffer_size) { @@ -373,9 +367,7 @@ static int wilc_wlan_txq_add_cfg_pkt(struct wilc *wilc, u8 *buffer, u32 buffer_s tqe->buffer_size = buffer_size; tqe->tx_complete_func = NULL; tqe->priv = NULL; -#ifdef TCP_ACK_FILTER tqe->tcp_pending_ack_idx = NOT_TCP_ACK; -#endif PRINT_D(TX_DBG, "Adding the config packet at the Queue tail\n"); if (wilc_wlan_txq_add_to_head(wilc, tqe)) @@ -406,11 +398,9 @@ int wilc_wlan_txq_add_net_pkt(struct net_device *dev, void *priv, u8 *buffer, tqe->priv = priv; PRINT_D(TX_DBG, "Adding mgmt packet at the Queue tail\n"); -#ifdef TCP_ACK_FILTER tqe->tcp_pending_ack_idx = NOT_TCP_ACK; if (is_tcp_ack_filter_enabled()) tcp_process(dev, tqe); -#endif wilc_wlan_txq_add_to_tail(dev, tqe); return wilc->txq_entries; } @@ -436,9 +426,7 @@ int wilc_wlan_txq_add_mgmt_pkt(struct net_device *dev, void *priv, u8 *buffer, tqe->buffer_size = buffer_size; tqe->tx_complete_func = func; tqe->priv = priv; -#ifdef TCP_ACK_FILTER tqe->tcp_pending_ack_idx = NOT_TCP_ACK; -#endif PRINT_D(TX_DBG, "Adding Network packet at the Queue tail\n"); wilc_wlan_txq_add_to_tail(dev, tqe); return 1; @@ -643,9 +631,7 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count) wilc_lock_timeout(wilc, >txq_add_to_head_cs, CFG_PKTS_TIMEOUT); -#ifdef TCP_ACK_FILTER wilc_wlan_txq_filter_dup_tcp_ack(dev); -#endif PRINT_D(TX_DBG, "Getting the head of the TxQ\n"); tqe = wilc_wlan_txq_get_first(wilc); i = 0; @@ -829,10 +815,8 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count) if (tqe->tx_complete_func) tqe->tx_complete_func(tqe->priv, tqe->status); - #ifdef TCP_ACK_FILTER if (tqe->tcp_pending_ack_idx != NOT_TCP_ACK)
[PATCH RESEND 08/70] staging: wilc1000: disable power save when AP mode
This patch disables power save mode in case of AP mode. Signed-off-by: Glen Lee--- drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c index 4d63282..adca14c 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c @@ -2203,6 +2203,7 @@ static int start_ap(struct wiphy *wiphy, struct net_device *dev, PRINT_ER("Error in setting channel\n"); wilc_wlan_set_bssid(dev, wl->vif[vif->u8IfIdx]->src_addr, AP_MODE); + wilc_set_power_mgmt(vif, 0, 0); s32Error = wilc_add_beacon(vif, settings->beacon_interval, settings->dtim_period, beacon->head_len, -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH RESEND 07/70] staging: wilc1000: increase link speed
This patch increases throughput by enabling tcp ack filter base on checking statistics and also handling tcp session. Signed-off-by: Glen Lee--- drivers/staging/wilc1000/host_interface.c | 31 +-- drivers/staging/wilc1000/wilc_wfi_netdevice.h | 2 ++ drivers/staging/wilc1000/wilc_wlan.c | 27 ++- 3 files changed, 34 insertions(+), 26 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 7e1b5a0..4bbf38c 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -57,6 +57,9 @@ #define BLOCK_ACK_REQ_SIZE 0x14 #define FALSE_FRMWR_CHANNEL100 +#define TCP_ACK_FILTER_LINK_SPEED_THRESH 54 +#define DEFAULT_LINK_SPEED 72 + struct cfg_param_attr { struct cfg_param_val cfg_attr_info; }; @@ -2187,7 +2190,14 @@ static s32 Handle_GetStatistics(struct wilc_vif *vif, if (result) PRINT_ER("Failed to send scan paramters config packet\n"); - up(_sema_wait_response); + if (pstrStatistics->link_speed > TCP_ACK_FILTER_LINK_SPEED_THRESH && + pstrStatistics->link_speed != DEFAULT_LINK_SPEED) + wilc_enable_tcp_ack_filter(true); + else if (pstrStatistics->link_speed != DEFAULT_LINK_SPEED) + wilc_enable_tcp_ack_filter(false); + + if (pstrStatistics != >wilc->dummy_statistics) + up(_sema_wait_response); return 0; } @@ -3606,7 +3616,8 @@ int wilc_get_statistics(struct wilc_vif *vif, struct rf_info *stats) return -EFAULT; } - down(_sema_wait_response); + if (stats != >wilc->dummy_statistics) + down(_sema_wait_response); return result; } @@ -3698,21 +3709,9 @@ static void GetPeriodicRSSI(unsigned long arg) return; } - if (vif->hif_drv->hif_state == HOST_IF_CONNECTED) { - s32 result = 0; - struct host_if_msg msg; - - memset(, 0, sizeof(struct host_if_msg)); - - msg.id = HOST_IF_MSG_GET_RSSI; - msg.vif = vif; + if (vif->hif_drv->hif_state == HOST_IF_CONNECTED) + wilc_get_statistics(vif, >wilc->dummy_statistics); - result = wilc_mq_send(_msg_q, , sizeof(struct host_if_msg)); - if (result) { - PRINT_ER("Failed to send get host channel param's message queue "); - return; - } - } periodic_rssi.data = (unsigned long)vif; mod_timer(_rssi, jiffies + msecs_to_jiffies(5000)); } diff --git a/drivers/staging/wilc1000/wilc_wfi_netdevice.h b/drivers/staging/wilc1000/wilc_wfi_netdevice.h index 54e762ec..9f8c79e 100644 --- a/drivers/staging/wilc1000/wilc_wfi_netdevice.h +++ b/drivers/staging/wilc1000/wilc_wfi_netdevice.h @@ -217,6 +217,8 @@ struct wilc { struct device *dev; bool suspend_event; + + struct rf_info dummy_statistics; }; struct WILC_WFI_mon_priv { diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index 9442016..04d4c92 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -178,19 +178,21 @@ static inline int init_tcp_tracking(void) static inline int add_tcp_session(u32 src_prt, u32 dst_prt, u32 seq) { - ack_session_info[tcp_session].seq_num = seq; - ack_session_info[tcp_session].bigger_ack_num = 0; - ack_session_info[tcp_session].src_port = src_prt; - ack_session_info[tcp_session].dst_port = dst_prt; - tcp_session++; - + if (tcp_session < 2 * MAX_TCP_SESSION) { + ack_session_info[tcp_session].seq_num = seq; + ack_session_info[tcp_session].bigger_ack_num = 0; + ack_session_info[tcp_session].src_port = src_prt; + ack_session_info[tcp_session].dst_port = dst_prt; + tcp_session++; + } PRINT_D(TCP_ENH, "TCP Session %d to Ack %d\n", tcp_session, seq); return 0; } static inline int update_tcp_session(u32 index, u32 ack) { - if (ack > ack_session_info[index].bigger_ack_num) + if (index < 2 * MAX_TCP_SESSION && + ack > ack_session_info[index].bigger_ack_num) ack_session_info[index].bigger_ack_num = ack; return 0; } @@ -198,7 +200,7 @@ static inline int update_tcp_session(u32 index, u32 ack) static inline int add_tcp_pending_ack(u32 ack, u32 session_index, struct txq_entry_t *txqe) { - if (pending_acks < MAX_PENDING_ACKS) { + if (pending_base + pending_acks < MAX_PENDING_ACKS) { pending_acks_info[pending_base + pending_acks].ack_num = ack; pending_acks_info[pending_base + pending_acks].txqe = txqe;
[PATCH RESEND 04/70] staging: wilc1000: handle connecting error
If connection fails, wilc1000_connecting needs to be set false also and return immediately because goto lable 'done' doesn't do anything. Remove lable 'done' as well. Signed-off-by: Glen Lee--- drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c index b0350da..4d63282 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c @@ -757,8 +757,8 @@ static int connect(struct wiphy *wiphy, struct net_device *dev, PRINT_D(CFG80211_DBG, "No Scan results yet\n"); else PRINT_D(CFG80211_DBG, "Required bss not in scan results: Error(%d)\n", s32Error); - - goto done; + wilc_connecting = 0; + return s32Error; } priv->WILC_WFI_wep_default = 0; @@ -845,8 +845,8 @@ static int connect(struct wiphy *wiphy, struct net_device *dev, } else { s32Error = -ENOTSUPP; PRINT_ER("Not supported cipher: Error(%d)\n", s32Error); - - goto done; + wilc_connecting = 0; + return s32Error; } } @@ -912,11 +912,10 @@ static int connect(struct wiphy *wiphy, struct net_device *dev, if (s32Error != 0) { PRINT_ER("wilc_set_join_req(): Error(%d)\n", s32Error); s32Error = -ENOENT; - goto done; + wilc_connecting = 0; + return s32Error; } -done: - return s32Error; } -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH RESEND 02/70] staging: wilc1000: remove unused functions
This patch removes unused following functions. wilc_del_all_rx_ba_session wilc_flush_join_req wilc_wait_msg_queue_idle wilc_set_mac_address Signed-off-by: Glen Lee--- drivers/staging/wilc1000/host_interface.c | 92 --- drivers/staging/wilc1000/host_interface.h | 4 -- 2 files changed, 96 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 7c75d0e..1dc6af0 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -3342,25 +3342,6 @@ int wilc_get_mac_address(struct wilc_vif *vif, u8 *mac_addr) return result; } -int wilc_set_mac_address(struct wilc_vif *vif, u8 *mac_addr) -{ - int result = 0; - struct host_if_msg msg; - - PRINT_D(GENERIC_DBG, "mac addr = %x:%x:%x\n", mac_addr[0], mac_addr[1], mac_addr[2]); - - memset(, 0, sizeof(struct host_if_msg)); - msg.id = HOST_IF_MSG_SET_MAC_ADDRESS; - memcpy(msg.body.set_mac_info.mac_addr, mac_addr, ETH_ALEN); - msg.vif = vif; - - result = wilc_mq_send(_msg_q, , sizeof(struct host_if_msg)); - if (result) - PRINT_ER("Failed to send message queue: Set mac address\n"); - - return result; -} - int wilc_set_join_req(struct wilc_vif *vif, u8 *bssid, const u8 *ssid, size_t ssid_len, const u8 *ies, size_t ies_len, wilc_connect_result connect_result, void *user_arg, @@ -3431,32 +3412,6 @@ int wilc_set_join_req(struct wilc_vif *vif, u8 *bssid, const u8 *ssid, return result; } -int wilc_flush_join_req(struct wilc_vif *vif) -{ - int result = 0; - struct host_if_msg msg; - struct host_if_drv *hif_drv = vif->hif_drv; - - if (!join_req) - return -EFAULT; - - if (!hif_drv) { - PRINT_ER("Driver is null\n"); - return -EFAULT; - } - - msg.id = HOST_IF_MSG_FLUSH_CONNECT; - msg.vif = vif; - - result = wilc_mq_send(_msg_q, , sizeof(struct host_if_msg)); - if (result) { - PRINT_ER("Failed to send message queue: Flush join request\n"); - return -EFAULT; - } - - return result; -} - int wilc_disconnect(struct wilc_vif *vif, u16 reason_code) { int result = 0; @@ -3539,24 +3494,6 @@ int wilc_set_mac_chnl_num(struct wilc_vif *vif, u8 channel) return 0; } -int wilc_wait_msg_queue_idle(void) -{ - int result = 0; - struct host_if_msg msg; - - memset(, 0, sizeof(struct host_if_msg)); - msg.id = HOST_IF_MSG_Q_IDLE; - result = wilc_mq_send(_msg_q, , sizeof(struct host_if_msg)); - if (result) { - PRINT_ER("wilc mq send fail\n"); - result = -EINVAL; - } - - down(_sema_wait_response); - - return result; -} - int wilc_set_wfi_drv_handler(struct wilc_vif *vif, int index, u8 mac_idx) { int result = 0; @@ -4606,35 +4543,6 @@ static void *host_int_ParseJoinBssParam(tstrNetworkInfo *ptstrNetworkInfo) return (void *)pNewJoinBssParam; } -int wilc_del_all_rx_ba_session(struct wilc_vif *vif, char *bssid, char tid) -{ - int result = 0; - struct host_if_msg msg; - struct ba_session_info *ba_session_info = _info; - struct host_if_drv *hif_drv = vif->hif_drv; - - if (!hif_drv) { - PRINT_ER("driver is null\n"); - return -EFAULT; - } - - memset(, 0, sizeof(struct host_if_msg)); - - msg.id = HOST_IF_MSG_DEL_ALL_RX_BA_SESSIONS; - - memcpy(ba_session_info->bssid, bssid, ETH_ALEN); - ba_session_info->tid = tid; - msg.vif = vif; - - result = wilc_mq_send(_msg_q, , sizeof(struct host_if_msg)); - if (result) - PRINT_ER("wilc_mq_send fail\n"); - - down(_sema_wait_response); - - return result; -} - int wilc_setup_ipaddress(struct wilc_vif *vif, u8 *ip_addr, u8 idx) { int result = 0; diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h index b828791..3302a5b 100644 --- a/drivers/staging/wilc1000/host_interface.h +++ b/drivers/staging/wilc1000/host_interface.h @@ -325,14 +325,11 @@ int wilc_add_rx_gtk(struct wilc_vif *vif, const u8 *rx_gtk, u8 gtk_key_len, int wilc_set_pmkid_info(struct wilc_vif *vif, struct host_if_pmkid_attr *pmkid); int wilc_get_mac_address(struct wilc_vif *vif, u8 *mac_addr); -int wilc_set_mac_address(struct wilc_vif *vif, u8 *mac_addr); -int wilc_wait_msg_queue_idle(void); int wilc_set_join_req(struct wilc_vif *vif, u8 *bssid, const u8 *ssid, size_t ssid_len, const u8 *ies, size_t ies_len, wilc_connect_result connect_result, void *user_arg, u8 security, enum AUTHTYPE auth_type, u8 channel, void *join_params); -int wilc_flush_join_req(struct
[PATCH RESEND 05/70] staging: wilc1000: tcp_process: fix a build warning
This patch fixes build warning "flags is used uninitialized" when TCP_ACK_FILTER is defined. Fixes: 562ed3f1f78a ("staging/wilc1000: pass struct wilc to most linux_wlan.c functions") Signed-off-by: Glen Lee--- drivers/staging/wilc1000/wilc_wlan.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index 5682581..25cf325 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -234,6 +234,7 @@ static inline int tcp_process(struct net_device *dev, struct txq_entry_t *tqe) vif = netdev_priv(dev); wilc = vif->wilc; + spin_lock_irqsave(>txq_spinlock, flags); eth_hdr_ptr = [0]; h_proto = ntohs(*((unsigned short *)_hdr_ptr[12])); -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH RESEND 11/70] staging: wilc1000: fix WEP security bug
Station cannot connect to soft AP mode wilc when it is configured for WEP security. This patch fixes it by setting the key index within the key value and change the last else condition with DEFAULTKEY action case, and also do not use WILC_WFI_wep_default index to set wep key id. Signed-off-by: Glen Lee--- drivers/staging/wilc1000/host_interface.c | 27 +++ drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 9 +--- drivers/staging/wilc1000/wilc_wfi_netdevice.h | 1 - 3 files changed, 14 insertions(+), 23 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 4b1d92c..67bcf88 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -1737,14 +1737,7 @@ static int Handle_Key(struct wilc_vif *vif, strWIDList[1].size = sizeof(char); strWIDList[1].val = (s8 *)>attr.wep.auth_type; - strWIDList[2].id = (u16)WID_KEY_ID; - strWIDList[2].type = WID_CHAR; - - strWIDList[2].val = (s8 *)>attr.wep.index; - strWIDList[2].size = sizeof(char); - - pu8keybuf = kmemdup(pstrHostIFkeyAttr->attr.wep.key, - pstrHostIFkeyAttr->attr.wep.key_len, + pu8keybuf = kmalloc(pstrHostIFkeyAttr->attr.wep.key_len + 2, GFP_KERNEL); if (pu8keybuf == NULL) { @@ -1752,15 +1745,21 @@ static int Handle_Key(struct wilc_vif *vif, return -ENOMEM; } + pu8keybuf[0] = pstrHostIFkeyAttr->attr.wep.index; + pu8keybuf[1] = pstrHostIFkeyAttr->attr.wep.key_len; + + memcpy([2], pstrHostIFkeyAttr->attr.wep.key, + pstrHostIFkeyAttr->attr.wep.key_len); + kfree(pstrHostIFkeyAttr->attr.wep.key); - strWIDList[3].id = (u16)WID_WEP_KEY_VALUE; - strWIDList[3].type = WID_STR; - strWIDList[3].size = pstrHostIFkeyAttr->attr.wep.key_len; - strWIDList[3].val = (s8 *)pu8keybuf; + strWIDList[2].id = (u16)WID_WEP_KEY_VALUE; + strWIDList[2].type = WID_STR; + strWIDList[2].size = pstrHostIFkeyAttr->attr.wep.key_len + 2; + strWIDList[2].val = (s8 *)pu8keybuf; result = wilc_send_config_pkt(vif->wilc, SET_CFG, - strWIDList, 4, + strWIDList, 3, wilc_get_vif_idx(vif)); kfree(pu8keybuf); } else if (pstrHostIFkeyAttr->action & ADDKEY) { @@ -1797,7 +1796,7 @@ static int Handle_Key(struct wilc_vif *vif, result = wilc_send_config_pkt(vif->wilc, SET_CFG, , 1, wilc_get_vif_idx(vif)); - } else { + } else if (pstrHostIFkeyAttr->action & DEFAULTKEY) { wid.id = (u16)WID_KEY_ID; wid.type = WID_CHAR; wid.val = (s8 *)>attr.wep.index; diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c index e6133fd..1907331 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c @@ -761,7 +761,6 @@ static int connect(struct wiphy *wiphy, struct net_device *dev, return s32Error; } - priv->WILC_WFI_wep_default = 0; memset(priv->WILC_WFI_wep_key, 0, sizeof(priv->WILC_WFI_wep_key)); memset(priv->WILC_WFI_wep_key_len, 0, sizeof(priv->WILC_WFI_wep_key_len)); @@ -788,7 +787,6 @@ static int connect(struct wiphy *wiphy, struct net_device *dev, for (i = 0; i < sme->key_len; i++) PRINT_D(CORECONFIG_DBG, "WEP Key Value[%d] = %d\n", i, sme->key[i]); } - priv->WILC_WFI_wep_default = sme->key_idx; priv->WILC_WFI_wep_key_len[sme->key_idx] = sme->key_len; memcpy(priv->WILC_WFI_wep_key[sme->key_idx], sme->key, sme->key_len); @@ -806,7 +804,6 @@ static int connect(struct wiphy *wiphy, struct net_device *dev, pcgroup_encrypt_val = "WEP104"; pccipher_group = "WLAN_CIPHER_SUITE_WEP104"; - priv->WILC_WFI_wep_default = sme->key_idx;
[PATCH RESEND 15/70] staging: wilc1000: rename hWILCWFIDrv of wilc_priv structure
From: Leo KimThis patch renames hWILCWFIDrv pointer variable of wilc_priv structure to hif_drv to avoid camelcase. Signed-off-by: Leo Kim Signed-off-by: Glen Lee --- drivers/staging/wilc1000/linux_wlan.c | 8 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 22 -- drivers/staging/wilc1000/wilc_wfi_netdevice.h | 2 +- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c index a3b4939..06c79dd 100644 --- a/drivers/staging/wilc1000/linux_wlan.c +++ b/drivers/staging/wilc1000/linux_wlan.c @@ -89,7 +89,7 @@ static int dev_state_ev_handler(struct notifier_block *this, unsigned long event PRINT_D(GENERIC_DBG, "No Wireless Priv\n"); return NOTIFY_DONE; } - hif_drv = (struct host_if_drv *)priv->hWILCWFIDrv; + hif_drv = (struct host_if_drv *)priv->hif_drv; vif = netdev_priv(dev); if (!vif || !hif_drv) { PRINT_D(GENERIC_DBG, "No Wireless Priv\n"); @@ -515,7 +515,7 @@ static int linux_wlan_init_test_config(struct net_device *dev, PRINT_D(TX_DBG, "Start configuring Firmware\n"); priv = wiphy_priv(dev->ieee80211_ptr->wiphy); - hif_drv = (struct host_if_drv *)priv->hWILCWFIDrv; + hif_drv = (struct host_if_drv *)priv->hif_drv; PRINT_D(INIT_DBG, "Host = %p\n", hif_drv); wilc_get_mac_address(vif, mac_add); @@ -1089,7 +1089,7 @@ static void wilc_set_multicast_list(struct net_device *dev) priv = wiphy_priv(dev->ieee80211_ptr->wiphy); vif = netdev_priv(dev); - hif_drv = (struct host_if_drv *)priv->hWILCWFIDrv; + hif_drv = (struct host_if_drv *)priv->hif_drv; if (!dev) return; @@ -1228,7 +1228,7 @@ int wilc_mac_close(struct net_device *ndev) return 0; } - hif_drv = (struct host_if_drv *)priv->hWILCWFIDrv; + hif_drv = (struct host_if_drv *)priv->hif_drv; PRINT_D(GENERIC_DBG, "Mac close\n"); diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c index 1907331..d1cb0b2 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c @@ -512,7 +512,7 @@ static void CfgConnectResult(enum conn_event enuConnDisconnEvent, dev = priv->dev; vif = netdev_priv(dev); wl = vif->wilc; - pstrWFIDrv = (struct host_if_drv *)priv->hWILCWFIDrv; + pstrWFIDrv = (struct host_if_drv *)priv->hif_drv; if (enuConnDisconnEvent == CONN_DISCONN_EVENT_CONN_RESP) { u16 u16ConnectStatus; @@ -711,9 +711,11 @@ static int connect(struct wiphy *wiphy, struct net_device *dev, wilc_connecting = 1; priv = wiphy_priv(wiphy); vif = netdev_priv(priv->dev); - pstrWFIDrv = (struct host_if_drv *)(priv->hWILCWFIDrv); + pstrWFIDrv = (struct host_if_drv *)priv->hif_drv; - PRINT_D(CFG80211_DBG, "Connecting to SSID [%s] on netdev [%p] host if [%p]\n", sme->ssid, dev, priv->hWILCWFIDrv); + PRINT_D(CFG80211_DBG, + "Connecting to SSID [%s] on netdev [%p] host if [%p]\n", + sme->ssid, dev, priv->hif_drv); if (!(strncmp(sme->ssid, "DIRECT-", 7))) { PRINT_D(CFG80211_DBG, "Connected to Direct network,OBSS disabled\n"); pstrWFIDrv->p2p_connect = 1; @@ -928,7 +930,7 @@ static int disconnect(struct wiphy *wiphy, struct net_device *dev, u16 reason_co priv = wiphy_priv(wiphy); vif = netdev_priv(priv->dev); - pstrWFIDrv = (struct host_if_drv *)priv->hWILCWFIDrv; + pstrWFIDrv = (struct host_if_drv *)priv->hif_drv; if (!pstrWFIDrv->p2p_connect) wlan_channel = INVALID_CHANNEL; wilc_wlan_set_bssid(priv->dev, NullBssid, STATION_MODE); @@ -1276,7 +1278,7 @@ static int del_key(struct wiphy *wiphy, struct net_device *netdev, wilc_remove_wep_key(vif, key_index); } else { PRINT_D(CFG80211_DBG, "Removing all installed keys\n"); - wilc_remove_key(priv->hWILCWFIDrv, mac_addr); + wilc_remove_key(priv->hif_drv, mac_addr); } return 0; @@ -1632,7 +1634,7 @@ void WILC_WFI_p2p_rx (struct net_device *dev, u8 *buff, u32 size) s32 s32Freq; priv = wiphy_priv(dev->ieee80211_ptr->wiphy); - pstrWFIDrv = (struct host_if_drv *)priv->hWILCWFIDrv; + pstrWFIDrv = (struct host_if_drv *)priv->hif_drv; memcpy(, (buff - HOST_HDR_OFFSET), HOST_HDR_OFFSET); @@ -1844,7 +1846,7 @@ static int mgmt_tx(struct wiphy *wiphy, vif = netdev_priv(wdev->netdev); priv = wiphy_priv(wiphy); - pstrWFIDrv = (struct host_if_drv *)priv->hWILCWFIDrv; + pstrWFIDrv = (struct host_if_drv
[PATCH RESEND 14/70] staging: wilc1000: pass vif to wilc_send_config_pkt
This patch passes vif instead of wilc to wilc_send_config_pkt and it's related functions as well, because we need vif which is currently being used and vif has wilc as well. Change custom print with netdev_xxx format if there are custom print inside the functions we have changed. Function parameter of following functions are modified to vif. wilc_send_config_pkt wilc_wlan_cfg_set wilc_wlan_cfg_get wilc_wlan_cfg_commit wilc_wlan_txq_add_cfg_pkt wilc_wlan_txq_add_to_head Signed-off-by: Glen Lee--- drivers/staging/wilc1000/host_interface.c | 94 +++ drivers/staging/wilc1000/linux_wlan.c | 88 ++--- drivers/staging/wilc1000/wilc_wlan.c | 57 +++ drivers/staging/wilc1000/wilc_wlan.h | 7 ++- 4 files changed, 128 insertions(+), 118 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 67bcf88..6f583a4 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -312,7 +312,7 @@ static s32 handle_set_channel(struct wilc_vif *vif, PRINT_D(HOSTINF_DBG, "Setting channel\n"); - result = wilc_send_config_pkt(vif->wilc, SET_CFG, , 1, + result = wilc_send_config_pkt(vif, SET_CFG, , 1, wilc_get_vif_idx(vif)); if (result) { @@ -334,7 +334,7 @@ static s32 handle_set_wfi_drv_handler(struct wilc_vif *vif, wid.val = (s8 *)hif_drv_handler; wid.size = sizeof(*hif_drv_handler); - result = wilc_send_config_pkt(vif->wilc, SET_CFG, , 1, + result = wilc_send_config_pkt(vif, SET_CFG, , 1, hif_drv_handler->handler); if (!hif_drv_handler->handler) @@ -359,7 +359,7 @@ static s32 handle_set_operation_mode(struct wilc_vif *vif, wid.val = (s8 *)_op_mode->mode; wid.size = sizeof(u32); - result = wilc_send_config_pkt(vif->wilc, SET_CFG, , 1, + result = wilc_send_config_pkt(vif, SET_CFG, , 1, wilc_get_vif_idx(vif)); if ((hif_op_mode->mode) == IDLE_MODE) @@ -392,7 +392,7 @@ static s32 handle_set_ip_address(struct wilc_vif *vif, u8 *ip_addr, u8 idx) wid.val = (u8 *)ip_addr; wid.size = IP_ALEN; - result = wilc_send_config_pkt(vif->wilc, SET_CFG, , 1, + result = wilc_send_config_pkt(vif, SET_CFG, , 1, wilc_get_vif_idx(vif)); host_int_get_ipaddress(vif, firmware_ip_addr, idx); @@ -417,7 +417,7 @@ static s32 handle_get_ip_address(struct wilc_vif *vif, u8 idx) wid.val = kmalloc(IP_ALEN, GFP_KERNEL); wid.size = IP_ALEN; - result = wilc_send_config_pkt(vif->wilc, GET_CFG, , 1, + result = wilc_send_config_pkt(vif, GET_CFG, , 1, wilc_get_vif_idx(vif)); PRINT_INFO(HOSTINF_DBG, "%pI4\n", wid.val); @@ -460,7 +460,7 @@ static s32 handle_set_mac_address(struct wilc_vif *vif, wid.size = ETH_ALEN; PRINT_D(GENERIC_DBG, "mac addr = :%pM\n", wid.val); - result = wilc_send_config_pkt(vif->wilc, SET_CFG, , 1, + result = wilc_send_config_pkt(vif, SET_CFG, , 1, wilc_get_vif_idx(vif)); if (result) { PRINT_ER("Failed to set mac address\n"); @@ -482,7 +482,7 @@ static s32 handle_get_mac_address(struct wilc_vif *vif, wid.val = get_mac_addr->mac_addr; wid.size = ETH_ALEN; - result = wilc_send_config_pkt(vif->wilc, GET_CFG, , 1, + result = wilc_send_config_pkt(vif, GET_CFG, , 1, wilc_get_vif_idx(vif)); if (result) { @@ -778,7 +778,7 @@ static s32 handle_cfg_param(struct wilc_vif *vif, wid_cnt++; } - result = wilc_send_config_pkt(vif->wilc, SET_CFG, wid_list, + result = wilc_send_config_pkt(vif, SET_CFG, wid_list, wid_cnt, wilc_get_vif_idx(vif)); if (result) @@ -902,7 +902,7 @@ static s32 Handle_Scan(struct wilc_vif *vif, else if (hif_drv->hif_state == HOST_IF_IDLE) scan_while_connected = false; - result = wilc_send_config_pkt(vif->wilc, SET_CFG, strWIDList, + result = wilc_send_config_pkt(vif, SET_CFG, strWIDList, u32WidsCount, wilc_get_vif_idx(vif)); @@ -948,7 +948,7 @@ static s32 Handle_ScanDone(struct wilc_vif *vif, wid.val = (s8 *)_running_scan; wid.size = sizeof(char); - result = wilc_send_config_pkt(vif->wilc, SET_CFG, , 1, + result = wilc_send_config_pkt(vif, SET_CFG, , 1, wilc_get_vif_idx(vif)); if (result) { @@ -1204,7 +1204,7 @@ static s32 Handle_Connect(struct wilc_vif *vif,
[PATCH RESEND 21/70] staging: wilc1000: removes void function return
From: Leo KimThis patch removes the warning reported by checkpatch.pl for void function return statements are not generally useful. Signed-off-by: Leo Kim Signed-off-by: Glen Lee --- drivers/staging/wilc1000/linux_wlan.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c index c16cc40..5c87105 100644 --- a/drivers/staging/wilc1000/linux_wlan.c +++ b/drivers/staging/wilc1000/linux_wlan.c @@ -1047,8 +1047,6 @@ static void wilc_set_multicast_list(struct net_device *dev) } wilc_setup_multicast_filter(vif, true, (dev->mc.count)); - - return; } static void linux_wlan_tx_complete(void *priv, int status) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH RESEND 18/70] staging: wilc1000: remove warnings line over 80 characters
From: Leo KimThis patch removes the warnings reported by checkpatch.pl for line over 80 characters. Signed-off-by: Leo Kim Signed-off-by: Glen Lee --- drivers/staging/wilc1000/linux_wlan.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c index f5f787e..1446b19 100644 --- a/drivers/staging/wilc1000/linux_wlan.c +++ b/drivers/staging/wilc1000/linux_wlan.c @@ -25,7 +25,8 @@ #include -static int dev_state_ev_handler(struct notifier_block *this, unsigned long event, void *ptr); +static int dev_state_ev_handler(struct notifier_block *this, + unsigned long event, void *ptr); static struct notifier_block g_dev_notifier = { .notifier_call = dev_state_ev_handler @@ -57,7 +58,8 @@ static const struct net_device_ops wilc_netdev_ops = { }; -static int dev_state_ev_handler(struct notifier_block *this, unsigned long event, void *ptr) +static int dev_state_ev_handler(struct notifier_block *this, + unsigned long event, void *ptr) { struct in_ifaddr *dev_iface = (struct in_ifaddr *)ptr; struct wilc_priv *priv; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH RESEND 17/70] staging: wilc1000: rename pBssid of tx_complete_data structure
From: Leo KimThis patch renames pBssid variable of tx_complete_data structure to bssid to avoid camelcase. Signed-off-by: Leo Kim Signed-off-by: Glen Lee --- drivers/staging/wilc1000/linux_wlan.c | 2 +- drivers/staging/wilc1000/wilc_wlan.c| 2 +- drivers/staging/wilc1000/wilc_wlan_if.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c index 5992478..f5f787e 100644 --- a/drivers/staging/wilc1000/linux_wlan.c +++ b/drivers/staging/wilc1000/linux_wlan.c @@ -1193,7 +1193,7 @@ int wilc_mac_xmit(struct sk_buff *skb, struct net_device *ndev) PRINT_D(TX_DBG, "Adding tx packet to TX Queue\n"); vif->netstats.tx_packets++; vif->netstats.tx_bytes += tx_data->size; - tx_data->pBssid = wilc->vif[vif->u8IfIdx]->bssid; + tx_data->bssid = wilc->vif[vif->u8IfIdx]->bssid; queue_count = wilc_wlan_txq_add_net_pkt(ndev, (void *)tx_data, tx_data->buff, tx_data->size, linux_wlan_tx_complete); diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index 392ef16..ebf38a5 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -809,7 +809,7 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count) if (tqe->type == WILC_CFG_PKT) { buffer_offset = ETH_CONFIG_PKT_HDR_OFFSET; } else if (tqe->type == WILC_NET_PKT) { - char *bssid = ((struct tx_complete_data *)(tqe->priv))->pBssid; + char *bssid = ((struct tx_complete_data *)(tqe->priv))->bssid; buffer_offset = ETH_ETHERNET_HDR_OFFSET; memcpy([offset + 4], bssid, 6); diff --git a/drivers/staging/wilc1000/wilc_wlan_if.h b/drivers/staging/wilc1000/wilc_wlan_if.h index 455a98f..294552d 100644 --- a/drivers/staging/wilc1000/wilc_wlan_if.h +++ b/drivers/staging/wilc1000/wilc_wlan_if.h @@ -82,7 +82,7 @@ typedef struct { struct tx_complete_data { int size; void *buff; - u8 *pBssid; + u8 *bssid; struct sk_buff *skb; }; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH RESEND 16/70] staging: wilc1000: fixes missing a blank line after declarations
From: Leo KimThis patch fixes the warnings reported by checkpatch.pl for Missing a blank line after declarations. Signed-off-by: Leo Kim Signed-off-by: Glen Lee --- drivers/staging/wilc1000/linux_wlan.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c index 06c79dd..5992478 100644 --- a/drivers/staging/wilc1000/linux_wlan.c +++ b/drivers/staging/wilc1000/linux_wlan.c @@ -853,6 +853,7 @@ static void wlan_deinitialize_threads(struct net_device *dev) { struct wilc_vif *vif; struct wilc *wl; + vif = netdev_priv(dev); wl = vif->wilc; @@ -1472,6 +1473,7 @@ int wilc_netdev_init(struct wilc **wilc, struct device *dev, int io_type, { struct wireless_dev *wdev; + wdev = wilc_create_wiphy(ndev, dev); if (dev) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH RESEND 12/70] staging: wilc1000: get mac address after setting drv handler
This patch moves wilc_get_mac_address and address memcpy function after calling wilc_set_wif_drv_handler to get selected mac address. Signed-off-by: Glen Lee--- drivers/staging/wilc1000/linux_wlan.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c index 2fafcc4..9de57ae 100644 --- a/drivers/staging/wilc1000/linux_wlan.c +++ b/drivers/staging/wilc1000/linux_wlan.c @@ -1018,12 +1018,8 @@ int wilc_mac_open(struct net_device *ndev) return ret; } - wilc_get_mac_address(vif, mac_add); - PRINT_D(INIT_DBG, "Mac address: %pM\n", mac_add); - for (i = 0; i < wl->vif_num; i++) { if (ndev == wl->vif[i]->ndev) { - memcpy(wl->vif[i]->src_addr, mac_add, ETH_ALEN); if (vif->iftype == AP_MODE) { wilc_set_wfi_drv_handler(vif, wilc_get_vif_idx(vif), @@ -1044,6 +1040,11 @@ int wilc_mac_open(struct net_device *ndev) 1); } wilc_set_operation_mode(vif, vif->iftype); + + wilc_get_mac_address(vif, mac_add); + netdev_dbg(ndev, "Mac address: %pM\n", mac_add); + memcpy(wl->vif[i]->src_addr, mac_add, ETH_ALEN); + break; } } -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH RESEND 30/70] staging: wilc1000: wilc_dealloc_assoc_resp_info(): renames function variables
From: Leo KimThis patch renames to avoid camelcase, changes follow are: - pstrConnectRespInfo to connect_resp_info Signed-off-by: Leo Kim --- drivers/staging/wilc1000/coreconfigurator.c | 14 +++--- drivers/staging/wilc1000/coreconfigurator.h | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c index c0be33d..c78da2c 100644 --- a/drivers/staging/wilc1000/coreconfigurator.c +++ b/drivers/staging/wilc1000/coreconfigurator.c @@ -410,20 +410,20 @@ s32 wilc_parse_assoc_resp_info(u8 *buffer, u32 buffer_len, return 0; } -s32 wilc_dealloc_assoc_resp_info(tstrConnectRespInfo *pstrConnectRespInfo) +s32 wilc_dealloc_assoc_resp_info(tstrConnectRespInfo *connect_resp_info) { s32 result = 0; - if (pstrConnectRespInfo) { - if (pstrConnectRespInfo->pu8RespIEs) { - kfree(pstrConnectRespInfo->pu8RespIEs); - pstrConnectRespInfo->pu8RespIEs = NULL; + if (connect_resp_info) { + if (connect_resp_info->pu8RespIEs) { + kfree(connect_resp_info->pu8RespIEs); + connect_resp_info->pu8RespIEs = NULL; } else { result = -EFAULT; } - kfree(pstrConnectRespInfo); - pstrConnectRespInfo = NULL; + kfree(connect_resp_info); + connect_resp_info = NULL; } else { result = -EFAULT; diff --git a/drivers/staging/wilc1000/coreconfigurator.h b/drivers/staging/wilc1000/coreconfigurator.h index 6a2c323..ec810b5 100644 --- a/drivers/staging/wilc1000/coreconfigurator.h +++ b/drivers/staging/wilc1000/coreconfigurator.h @@ -124,7 +124,7 @@ s32 wilc_parse_network_info(u8 *msg_buffer, tstrNetworkInfo **ret_network_info); s32 wilc_dealloc_network_info(tstrNetworkInfo *pstrNetworkInfo); s32 wilc_parse_assoc_resp_info(u8 *buffer, u32 buffer_len, tstrConnectRespInfo **ret_connect_resp_info); -s32 wilc_dealloc_assoc_resp_info(tstrConnectRespInfo *pstrConnectRespInfo); +s32 wilc_dealloc_assoc_resp_info(tstrConnectRespInfo *connect_resp_info); void wilc_scan_complete_received(struct wilc *wilc, u8 *pu8Buffer, u32 u32Length); void wilc_network_info_received(struct wilc *wilc, u8 *pu8Buffer, -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH RESEND 22/70] staging: wilc1000: renames u8IfIdx of wilc_vif structure
From: Leo KimThis patch renames u8IfIdx variable of wilc_vif structure to idx to avoid camelcase. Signed-off-by: Leo Kim Signed-off-by: Glen Lee --- drivers/staging/wilc1000/host_interface.c | 2 +- drivers/staging/wilc1000/linux_wlan.c | 8 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 2 +- drivers/staging/wilc1000/wilc_wfi_netdevice.h | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 6f583a4..2022deb 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -281,7 +281,7 @@ static int host_int_get_ipaddress(struct wilc_vif *vif, u8 *ip_addr, u8 idx); */ int wilc_get_vif_idx(struct wilc_vif *vif) { - return vif->u8IfIdx + 1; + return vif->idx + 1; } /* We need to minus 1 from idx which is from wilc device to get real index diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c index 5c87105..9ca33536 100644 --- a/drivers/staging/wilc1000/linux_wlan.c +++ b/drivers/staging/wilc1000/linux_wlan.c @@ -107,7 +107,7 @@ static int dev_state_ev_handler(struct notifier_block *this, netdev_dbg(dev, "IP add=%d:%d:%d:%d\n", ip_addr_buf[0], ip_addr_buf[1], ip_addr_buf[2], ip_addr_buf[3]); - wilc_setup_ipaddress(vif, ip_addr_buf, vif->u8IfIdx); + wilc_setup_ipaddress(vif, ip_addr_buf, vif->idx); break; @@ -129,7 +129,7 @@ static int dev_state_ev_handler(struct notifier_block *this, ip_addr_buf[0], ip_addr_buf[1], ip_addr_buf[2], ip_addr_buf[3]); - wilc_setup_ipaddress(vif, ip_addr_buf, vif->u8IfIdx); + wilc_setup_ipaddress(vif, ip_addr_buf, vif->idx); break; @@ -1104,7 +1104,7 @@ int wilc_mac_xmit(struct sk_buff *skb, struct net_device *ndev) vif->netstats.tx_packets++; vif->netstats.tx_bytes += tx_data->size; - tx_data->bssid = wilc->vif[vif->u8IfIdx]->bssid; + tx_data->bssid = wilc->vif[vif->idx]->bssid; queue_count = wilc_wlan_txq_add_net_pkt(ndev, (void *)tx_data, tx_data->buff, tx_data->size, linux_wlan_tx_complete); @@ -1360,7 +1360,7 @@ int wilc_netdev_init(struct wilc **wilc, struct device *dev, int io_type, else strcpy(ndev->name, "p2p%d"); - vif->u8IfIdx = wl->vif_num; + vif->idx = wl->vif_num; vif->wilc = *wilc; wl->vif[i] = vif; wl->vif[wl->vif_num]->ndev = ndev; diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c index d1cb0b2..a9181d3 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c @@ -2197,7 +2197,7 @@ static int start_ap(struct wiphy *wiphy, struct net_device *dev, if (s32Error != 0) PRINT_ER("Error in setting channel\n"); - wilc_wlan_set_bssid(dev, wl->vif[vif->u8IfIdx]->src_addr, AP_MODE); + wilc_wlan_set_bssid(dev, wl->vif[vif->idx]->src_addr, AP_MODE); wilc_set_power_mgmt(vif, 0, 0); s32Error = wilc_add_beacon(vif, settings->beacon_interval, diff --git a/drivers/staging/wilc1000/wilc_wfi_netdevice.h b/drivers/staging/wilc1000/wilc_wfi_netdevice.h index 64fcb77..07a4ff1 100644 --- a/drivers/staging/wilc1000/wilc_wfi_netdevice.h +++ b/drivers/staging/wilc1000/wilc_wfi_netdevice.h @@ -148,7 +148,7 @@ typedef struct { } struct_frame_reg; struct wilc_vif { - u8 u8IfIdx; + u8 idx; u8 iftype; int monitor_flag; int mac_opened; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH RESEND 33/70] staging: wilc1000: remove useless log message
From: Chris ParkThis patch remove useless log message in wilc_wlan.c file Signed-off-by: Chris Park Signed-off-by: Leo Kim --- drivers/staging/wilc1000/wilc_wlan.c | 128 ++- 1 file changed, 22 insertions(+), 106 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index a6f4e15..400d311 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -104,12 +104,9 @@ static void wilc_wlan_txq_add_to_tail(struct net_device *dev, wilc->txq_tail = tqe; } wilc->txq_entries += 1; - PRINT_D(TX_DBG, "Number of entries in TxQ = %d\n", wilc->txq_entries); spin_unlock_irqrestore(>txq_spinlock, flags); - PRINT_D(TX_DBG, "Wake the txq_handling\n"); - up(>txq_event); } @@ -137,12 +134,10 @@ static int wilc_wlan_txq_add_to_head(struct wilc_vif *vif, wilc->txq_head = tqe; } wilc->txq_entries += 1; - netdev_dbg(vif->ndev, "Number of entries in TxQ = %d\n", wilc->txq_entries); spin_unlock_irqrestore(>txq_spinlock, flags); up(>txq_add_to_head_cs); up(>txq_event); - netdev_dbg(vif->ndev, "Wake up the txq_handler\n"); return 0; } @@ -188,7 +183,6 @@ static inline int add_tcp_session(u32 src_prt, u32 dst_prt, u32 seq) ack_session_info[tcp_session].dst_port = dst_prt; tcp_session++; } - PRINT_D(TCP_ENH, "TCP Session %d to Ack %d\n", tcp_session, seq); return 0; } @@ -310,8 +304,6 @@ static int wilc_wlan_txq_filter_dup_tcp_ack(struct net_device *dev) if (pending_acks_info[i].ack_num < ack_session_info[pending_acks_info[i].session_index].bigger_ack_num) { struct txq_entry_t *tqe; - PRINT_D(TCP_ENH, "DROP ACK: %u\n", - pending_acks_info[i].ack_num); tqe = pending_acks_info[i].txqe; if (tqe) { wilc_wlan_txq_remove(wilc, tqe); @@ -379,7 +371,6 @@ static int wilc_wlan_txq_add_cfg_pkt(struct wilc_vif *vif, u8 *buffer, tqe->tx_complete_func = NULL; tqe->priv = NULL; tqe->tcp_pending_ack_idx = NOT_TCP_ACK; - netdev_dbg(vif->ndev, "Adding the config packet at the Queue tail\n"); if (wilc_wlan_txq_add_to_head(vif, tqe)) return 0; @@ -408,7 +399,6 @@ int wilc_wlan_txq_add_net_pkt(struct net_device *dev, void *priv, u8 *buffer, tqe->tx_complete_func = func; tqe->priv = priv; - PRINT_D(TX_DBG, "Adding mgmt packet at the Queue tail\n"); tqe->tcp_pending_ack_idx = NOT_TCP_ACK; if (is_tcp_ack_filter_enabled()) tcp_process(dev, tqe); @@ -438,7 +428,6 @@ int wilc_wlan_txq_add_mgmt_pkt(struct net_device *dev, void *priv, u8 *buffer, tqe->tx_complete_func = func; tqe->priv = priv; tqe->tcp_pending_ack_idx = NOT_TCP_ACK; - PRINT_D(TX_DBG, "Adding Network packet at the Queue tail\n"); wilc_wlan_txq_add_to_tail(dev, tqe); return 1; } @@ -478,18 +467,15 @@ static int wilc_wlan_rxq_add(struct wilc *wilc, struct rxq_entry_t *rqe) mutex_lock(>rxq_cs); if (!wilc->rxq_head) { - PRINT_D(RX_DBG, "Add to Queue head\n"); rqe->next = NULL; wilc->rxq_head = rqe; wilc->rxq_tail = rqe; } else { - PRINT_D(RX_DBG, "Add to Queue tail\n"); wilc->rxq_tail->next = rqe; rqe->next = NULL; wilc->rxq_tail = rqe; } wilc->rxq_entries += 1; - PRINT_D(RX_DBG, "Number of queue entries: %d\n", wilc->rxq_entries); mutex_unlock(>rxq_cs); return wilc->rxq_entries; } @@ -497,7 +483,6 @@ static int wilc_wlan_rxq_add(struct wilc *wilc, struct rxq_entry_t *rqe) static struct rxq_entry_t *wilc_wlan_rxq_remove(struct wilc *wilc) { - PRINT_D(RX_DBG, "Getting rxQ element\n"); if (wilc->rxq_head) { struct rxq_entry_t *rqe; @@ -505,11 +490,9 @@ static struct rxq_entry_t *wilc_wlan_rxq_remove(struct wilc *wilc) rqe = wilc->rxq_head; wilc->rxq_head = wilc->rxq_head->next; wilc->rxq_entries -= 1; - PRINT_D(RX_DBG, "RXQ entries decreased\n"); mutex_unlock(>rxq_cs); return rqe; } - PRINT_D(RX_DBG, "Nothing to get from Q\n"); return NULL; } @@ -643,7 +626,6 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count) wilc_lock_timeout(wilc, >txq_add_to_head_cs, CFG_PKTS_TIMEOUT); wilc_wlan_txq_filter_dup_tcp_ack(dev); - PRINT_D(TX_DBG, "Getting the
[PATCH RESEND 31/70] staging: wilc1000: wilc_dealloc_network_info(): renames function variables
From: Leo KimThis patch renames to avoid camelcase, changes follow are: - pstrNetworkInfo to network_info Signed-off-by: Leo Kim --- drivers/staging/wilc1000/coreconfigurator.c | 14 +++--- drivers/staging/wilc1000/coreconfigurator.h | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c index c78da2c..a0b80bf 100644 --- a/drivers/staging/wilc1000/coreconfigurator.c +++ b/drivers/staging/wilc1000/coreconfigurator.c @@ -354,20 +354,20 @@ s32 wilc_parse_network_info(u8 *msg_buffer, tstrNetworkInfo **ret_network_info) return 0; } -s32 wilc_dealloc_network_info(tstrNetworkInfo *pstrNetworkInfo) +s32 wilc_dealloc_network_info(tstrNetworkInfo *network_info) { s32 result = 0; - if (pstrNetworkInfo) { - if (pstrNetworkInfo->pu8IEs) { - kfree(pstrNetworkInfo->pu8IEs); - pstrNetworkInfo->pu8IEs = NULL; + if (network_info) { + if (network_info->pu8IEs) { + kfree(network_info->pu8IEs); + network_info->pu8IEs = NULL; } else { result = -EFAULT; } - kfree(pstrNetworkInfo); - pstrNetworkInfo = NULL; + kfree(network_info); + network_info = NULL; } else { result = -EFAULT; diff --git a/drivers/staging/wilc1000/coreconfigurator.h b/drivers/staging/wilc1000/coreconfigurator.h index ec810b5..d801e58 100644 --- a/drivers/staging/wilc1000/coreconfigurator.h +++ b/drivers/staging/wilc1000/coreconfigurator.h @@ -121,7 +121,7 @@ typedef struct { } tstrDisconnectNotifInfo; s32 wilc_parse_network_info(u8 *msg_buffer, tstrNetworkInfo **ret_network_info); -s32 wilc_dealloc_network_info(tstrNetworkInfo *pstrNetworkInfo); +s32 wilc_dealloc_network_info(tstrNetworkInfo *network_info); s32 wilc_parse_assoc_resp_info(u8 *buffer, u32 buffer_len, tstrConnectRespInfo **ret_connect_resp_info); s32 wilc_dealloc_assoc_resp_info(tstrConnectRespInfo *connect_resp_info); -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH RESEND 32/70] staging: wilc1000: fix warnings for line over 80 characters
From: Chris ParkThis patch fixes warnings reported by checkpatch.pl for line over 80 characters Signed-off-by: Chris Park Signed-off-by: Leo Kim --- drivers/staging/wilc1000/wilc_wlan.c | 33 - drivers/staging/wilc1000/wilc_wlan.h | 3 ++- 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index ebf38a5..a6f4e15 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -113,7 +113,8 @@ static void wilc_wlan_txq_add_to_tail(struct net_device *dev, up(>txq_event); } -static int wilc_wlan_txq_add_to_head(struct wilc_vif *vif, struct txq_entry_t *tqe) +static int wilc_wlan_txq_add_to_head(struct wilc_vif *vif, +struct txq_entry_t *tqe) { unsigned long flags; struct wilc *wilc = vif->wilc; @@ -695,8 +696,9 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count) acquire_bus(wilc, ACQUIRE_AND_WAKEUP); counter = 0; do { - ret = wilc->hif_func->hif_read_reg(wilc, WILC_HOST_TX_CTRL, - ); + ret = wilc->hif_func->hif_read_reg(wilc, + WILC_HOST_TX_CTRL, + ); if (!ret) { wilc_debug(N_ERR, "[wilc txq]: fail can't read reg vmm_tbl_entry..\n"); break; @@ -728,8 +730,9 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count) break; } - ret = wilc->hif_func->hif_write_reg(wilc, WILC_HOST_VMM_CTL, - 0x2); + ret = wilc->hif_func->hif_write_reg(wilc, + WILC_HOST_VMM_CTL, + 0x2); if (!ret) { wilc_debug(N_ERR, "[wilc txq]: fail can't write reg host_vmm_ctl..\n"); break; @@ -1063,7 +1066,8 @@ void wilc_handle_isr(struct wilc *wilc) } EXPORT_SYMBOL_GPL(wilc_handle_isr); -int wilc_wlan_firmware_download(struct wilc *wilc, const u8 *buffer, u32 buffer_size) +int wilc_wlan_firmware_download(struct wilc *wilc, const u8 *buffer, + u32 buffer_size) { u32 offset; u32 addr, size, size2, blksz; @@ -1096,8 +1100,8 @@ int wilc_wlan_firmware_download(struct wilc *wilc, const u8 *buffer, u32 buffer_ size2 = blksz; memcpy(dma_buffer, [offset], size2); - ret = wilc->hif_func->hif_block_tx(wilc, addr, dma_buffer, - size2); + ret = wilc->hif_func->hif_block_tx(wilc, addr, + dma_buffer, size2); if (!ret) break; @@ -1233,7 +1237,8 @@ int wilc_wlan_stop(struct wilc *wilc) } do { - ret = wilc->hif_func->hif_read_reg(wilc, WILC_GLB_RESET_0, ); + ret = wilc->hif_func->hif_read_reg(wilc, + WILC_GLB_RESET_0, ); if (!ret) { PRINT_ER("Error while reading reg\n"); release_bus(wilc, RELEASE_ALLOW_SLEEP); @@ -1246,14 +1251,16 @@ int wilc_wlan_stop(struct wilc *wilc) PRINT_D(GENERIC_DBG, "Bit 10 not reset : Retry %d\n", timeout); reg &= ~BIT(10); - ret = wilc->hif_func->hif_write_reg(wilc, WILC_GLB_RESET_0, - reg); + ret = wilc->hif_func->hif_write_reg(wilc, + WILC_GLB_RESET_0, + reg); timeout--; } else { PRINT_D(GENERIC_DBG, "Bit 10 reset after : Retry %d\n", timeout); - ret = wilc->hif_func->hif_read_reg(wilc, WILC_GLB_RESET_0, - ); + ret = wilc->hif_func->hif_read_reg(wilc, + WILC_GLB_RESET_0, + ); if (!ret) {
[PATCH RESEND 34/70] staging: wilc1000: remove useless function
From: Chris ParkThis patch remove useless function remove_TCP_related in wilc_wlan.c file Signed-off-by: Chris Park Signed-off-by: Leo Kim --- drivers/staging/wilc1000/wilc_wlan.c | 9 - 1 file changed, 9 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index 400d311..8618e27 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -206,15 +206,6 @@ static inline int add_tcp_pending_ack(u32 ack, u32 session_index, } return 0; } -static inline int remove_TCP_related(struct wilc *wilc) -{ - unsigned long flags; - - spin_lock_irqsave(>txq_spinlock, flags); - - spin_unlock_irqrestore(>txq_spinlock, flags); - return 0; -} static inline int tcp_process(struct net_device *dev, struct txq_entry_t *tqe) { -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH RESEND 35/70] staging: wilc1000: remove unnecessary braces
From: Chris ParkThis patch remove warnings reported by checkpatch.pl for unnecessary braces Signed-off-by: Chris Park Signed-off-by: Leo Kim --- drivers/staging/wilc1000/wilc_wlan.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index 8618e27..e2c84db 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -984,15 +984,15 @@ void wilc_handle_isr(struct wilc *wilc) if (int_status & PLL_INT_EXT) wilc_pllupdate_isr_ext(wilc, int_status); - if (int_status & DATA_INT_EXT) { + if (int_status & DATA_INT_EXT) wilc_wlan_handle_isr_ext(wilc, int_status); - } + if (int_status & SLEEP_INT_EXT) wilc_sleeptimer_isr_ext(wilc, int_status); - if (!(int_status & (ALL_INT_EXT))) { + if (!(int_status & (ALL_INT_EXT))) wilc_unknown_isr_ext(wilc); - } + release_bus(wilc, RELEASE_ALLOW_SLEEP); } EXPORT_SYMBOL_GPL(wilc_handle_isr); -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH RESEND 36/70] staging: wilc1000: remove warnings missing a blank line after declarations
From: Chris ParkThis patch remove warnings reported by checkpatch.pl for missing a blank line after declarations Signed-off-by: Chris Park Signed-off-by: Leo Kim --- drivers/staging/wilc1000/wilc_wlan.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index e2c84db..dc26322 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -1143,6 +1143,7 @@ int wilc_wlan_stop(struct wilc *wilc) u32 reg = 0; int ret; u8 timeout = 10; + acquire_bus(wilc, ACQUIRE_AND_WAKEUP); ret = wilc->hif_func->hif_read_reg(wilc, WILC_GLB_RESET_0, ); -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH RESEND 38/70] staging: wilc1000: wilc_wfi_cfgoperations.c: replaces PRINT_ER with netdev_err
From: Leo KimThis patches replaces PRINT_ER with netdev_err. Removes unnecessary debug logs as well. Signed-off-by: Leo Kim --- drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 86 --- 1 file changed, 31 insertions(+), 55 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c index a9181d3..dbbf7bf 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c @@ -405,10 +405,8 @@ static void CfgScanResult(enum scan_event scan_event, if (wiphy->signal_type == CFG80211_SIGNAL_TYPE_UNSPEC && (((s32)network_info->s8rssi * 100) < 0 || - ((s32)network_info->s8rssi * 100) > 100)) { - PRINT_ER("wiphy signal type fial\n"); + ((s32)network_info->s8rssi * 100) > 100)) return; - } if (network_info) { s32Freq = ieee80211_channel_to_frequency((s32)network_info->u8channel, IEEE80211_BAND_2GHZ); @@ -436,10 +434,6 @@ static void CfgScanResult(enum scan_event scan_event, (size_t)network_info->u16IEsLen, (((s32)network_info->s8rssi) * 100), GFP_KERNEL); cfg80211_put_bss(wiphy, bss); } - - - } else { - PRINT_ER("Discovered networks exceeded the max limit\n"); } } else { u32 i; @@ -531,7 +525,7 @@ static void CfgConnectResult(enum conn_event enuConnDisconnEvent, if (!pstrWFIDrv->p2p_connect) wlan_channel = INVALID_CHANNEL; - PRINT_ER("Unspecified failure: Connection status %d : MAC status = %d\n", u16ConnectStatus, u8MacStatus); + netdev_err(dev, "Unspecified failure\n"); } if (u16ConnectStatus == WLAN_STATUS_SUCCESS) { @@ -572,8 +566,6 @@ static void CfgConnectResult(enum conn_event enuConnDisconnEvent, u16ConnectStatus, GFP_KERNEL); } else if (enuConnDisconnEvent == CONN_DISCONN_EVENT_DISCONN_NOTIF){ wilc_optaining_ip = false; - PRINT_ER("Received MAC_DISCONNECTED from firmware with reason %d on dev [%p]\n", -pstrDisconnectNotifInfo->u16reason, priv->dev); p2p_local_random = 0x01; p2p_recv_random = 0x00; wilc_ie = false; @@ -612,7 +604,7 @@ static int set_channel(struct wiphy *wiphy, result = wilc_set_mac_chnl_num(vif, channelnum); if (result != 0) - PRINT_ER("Error in setting channel %d\n", channelnum); + netdev_err(priv->dev, "Error in setting channel\n"); return result; } @@ -680,8 +672,7 @@ static int scan(struct wiphy *wiphy, struct cfg80211_scan_request *request) (void *)priv, NULL); } } else { - PRINT_ER("Requested num of scanned channels is greater than the max, supported" -" channels\n"); + netdev_err(priv->dev, "Requested scanned channels over\n"); } if (s32Error != 0) { @@ -843,7 +834,7 @@ static int connect(struct wiphy *wiphy, struct net_device *dev, } else { s32Error = -ENOTSUPP; - PRINT_ER("Not supported cipher: Error(%d)\n", s32Error); + netdev_err(dev, "Not supported cipher\n"); wilc_connecting = 0; return s32Error; } @@ -909,7 +900,7 @@ static int connect(struct wiphy *wiphy, struct net_device *dev, pstrNetworkInfo->u8channel, pstrNetworkInfo->pJoinParams); if (s32Error != 0) { - PRINT_ER("wilc_set_join_req(): Error(%d)\n", s32Error); + netdev_err(dev, "wilc_set_join_req(): Error\n"); s32Error = -ENOENT; wilc_connecting = 0; return s32Error; @@ -944,7 +935,7 @@ static int disconnect(struct wiphy *wiphy, struct net_device *dev, u16 reason_co s32Error = wilc_disconnect(vif, reason_code); if (s32Error != 0) { - PRINT_ER("Error in disconnecting: Error(%d)\n", s32Error); + netdev_err(priv->dev, "Error in disconnecting\n"); s32Error = -EINVAL;
[PATCH RESEND 29/70] staging: wilc1000: wilc_parse_assoc_resp_info(): renames local variables
From: Leo KimThis patch renames to avoid camelcase, changes follow are: - pstrConnectRespInfo to connect_resp_info - u16AssocRespLen to assoc_resp_len - pu8IEs to ies - u16IEsLen to ies_len Signed-off-by: Leo Kim --- drivers/staging/wilc1000/coreconfigurator.c | 34 ++--- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c index 48c8573..c0be33d 100644 --- a/drivers/staging/wilc1000/coreconfigurator.c +++ b/drivers/staging/wilc1000/coreconfigurator.c @@ -379,33 +379,33 @@ s32 wilc_dealloc_network_info(tstrNetworkInfo *pstrNetworkInfo) s32 wilc_parse_assoc_resp_info(u8 *buffer, u32 buffer_len, tstrConnectRespInfo **ret_connect_resp_info) { - tstrConnectRespInfo *pstrConnectRespInfo = NULL; - u16 u16AssocRespLen = 0; - u8 *pu8IEs = NULL; - u16 u16IEsLen = 0; + tstrConnectRespInfo *connect_resp_info = NULL; + u16 assoc_resp_len = 0; + u8 *ies = NULL; + u16 ies_len = 0; - pstrConnectRespInfo = kzalloc(sizeof(tstrConnectRespInfo), GFP_KERNEL); - if (!pstrConnectRespInfo) + connect_resp_info = kzalloc(sizeof(tstrConnectRespInfo), GFP_KERNEL); + if (!connect_resp_info) return -ENOMEM; - u16AssocRespLen = (u16)buffer_len; + assoc_resp_len = (u16)buffer_len; - pstrConnectRespInfo->u16ConnectStatus = get_asoc_status(buffer); - if (pstrConnectRespInfo->u16ConnectStatus == SUCCESSFUL_STATUSCODE) { - pstrConnectRespInfo->u16capability = get_assoc_resp_cap_info(buffer); - pstrConnectRespInfo->u16AssocID = get_asoc_id(buffer); + connect_resp_info->u16ConnectStatus = get_asoc_status(buffer); + if (connect_resp_info->u16ConnectStatus == SUCCESSFUL_STATUSCODE) { + connect_resp_info->u16capability = get_assoc_resp_cap_info(buffer); + connect_resp_info->u16AssocID = get_asoc_id(buffer); - pu8IEs = [CAP_INFO_LEN + STATUS_CODE_LEN + AID_LEN]; - u16IEsLen = u16AssocRespLen - (CAP_INFO_LEN + STATUS_CODE_LEN + AID_LEN); + ies = [CAP_INFO_LEN + STATUS_CODE_LEN + AID_LEN]; + ies_len = assoc_resp_len - (CAP_INFO_LEN + STATUS_CODE_LEN + AID_LEN); - pstrConnectRespInfo->pu8RespIEs = kmemdup(pu8IEs, u16IEsLen, GFP_KERNEL); - if (!pstrConnectRespInfo->pu8RespIEs) + connect_resp_info->pu8RespIEs = kmemdup(ies, ies_len, GFP_KERNEL); + if (!connect_resp_info->pu8RespIEs) return -ENOMEM; - pstrConnectRespInfo->u16RespIEsLen = u16IEsLen; + connect_resp_info->u16RespIEsLen = ies_len; } - *ret_connect_resp_info = pstrConnectRespInfo; + *ret_connect_resp_info = connect_resp_info; return 0; } -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH RESEND 28/70] staging: wilc1000: wilc_parse_assoc_resp_info(): renames function variables
From: Leo KimThis patch renames to avoid camelcase, changes follow are: - pu8Buffer to buffer - u32BufferLen to buffer_len - ppstrConnectRespInfo to ret_connect_resp_info Signed-off-by: Leo Kim --- drivers/staging/wilc1000/coreconfigurator.c | 16 drivers/staging/wilc1000/coreconfigurator.h | 5 ++--- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c index 88e5661..48c8573 100644 --- a/drivers/staging/wilc1000/coreconfigurator.c +++ b/drivers/staging/wilc1000/coreconfigurator.c @@ -376,8 +376,8 @@ s32 wilc_dealloc_network_info(tstrNetworkInfo *pstrNetworkInfo) return result; } -s32 wilc_parse_assoc_resp_info(u8 *pu8Buffer, u32 u32BufferLen, - tstrConnectRespInfo **ppstrConnectRespInfo) +s32 wilc_parse_assoc_resp_info(u8 *buffer, u32 buffer_len, + tstrConnectRespInfo **ret_connect_resp_info) { tstrConnectRespInfo *pstrConnectRespInfo = NULL; u16 u16AssocRespLen = 0; @@ -388,14 +388,14 @@ s32 wilc_parse_assoc_resp_info(u8 *pu8Buffer, u32 u32BufferLen, if (!pstrConnectRespInfo) return -ENOMEM; - u16AssocRespLen = (u16)u32BufferLen; + u16AssocRespLen = (u16)buffer_len; - pstrConnectRespInfo->u16ConnectStatus = get_asoc_status(pu8Buffer); + pstrConnectRespInfo->u16ConnectStatus = get_asoc_status(buffer); if (pstrConnectRespInfo->u16ConnectStatus == SUCCESSFUL_STATUSCODE) { - pstrConnectRespInfo->u16capability = get_assoc_resp_cap_info(pu8Buffer); - pstrConnectRespInfo->u16AssocID = get_asoc_id(pu8Buffer); + pstrConnectRespInfo->u16capability = get_assoc_resp_cap_info(buffer); + pstrConnectRespInfo->u16AssocID = get_asoc_id(buffer); - pu8IEs = [CAP_INFO_LEN + STATUS_CODE_LEN + AID_LEN]; + pu8IEs = [CAP_INFO_LEN + STATUS_CODE_LEN + AID_LEN]; u16IEsLen = u16AssocRespLen - (CAP_INFO_LEN + STATUS_CODE_LEN + AID_LEN); pstrConnectRespInfo->pu8RespIEs = kmemdup(pu8IEs, u16IEsLen, GFP_KERNEL); @@ -405,7 +405,7 @@ s32 wilc_parse_assoc_resp_info(u8 *pu8Buffer, u32 u32BufferLen, pstrConnectRespInfo->u16RespIEsLen = u16IEsLen; } - *ppstrConnectRespInfo = pstrConnectRespInfo; + *ret_connect_resp_info = pstrConnectRespInfo; return 0; } diff --git a/drivers/staging/wilc1000/coreconfigurator.h b/drivers/staging/wilc1000/coreconfigurator.h index aec0779..6a2c323 100644 --- a/drivers/staging/wilc1000/coreconfigurator.h +++ b/drivers/staging/wilc1000/coreconfigurator.h @@ -122,9 +122,8 @@ typedef struct { s32 wilc_parse_network_info(u8 *msg_buffer, tstrNetworkInfo **ret_network_info); s32 wilc_dealloc_network_info(tstrNetworkInfo *pstrNetworkInfo); - -s32 wilc_parse_assoc_resp_info(u8 *pu8Buffer, u32 u32BufferLen, - tstrConnectRespInfo **ppstrConnectRespInfo); +s32 wilc_parse_assoc_resp_info(u8 *buffer, u32 buffer_len, + tstrConnectRespInfo **ret_connect_resp_info); s32 wilc_dealloc_assoc_resp_info(tstrConnectRespInfo *pstrConnectRespInfo); void wilc_scan_complete_received(struct wilc *wilc, u8 *pu8Buffer, u32 u32Length); -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH RESEND 39/70] staging: wilc1000: wilc_msgqueue.c: removes debug print log
From: Leo KimThis patches removes unnecessary debug print logs. Signed-off-by: Leo Kim --- drivers/staging/wilc1000/wilc_msgqueue.c | 18 -- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c b/drivers/staging/wilc1000/wilc_msgqueue.c index 5fe85eb..780ddd3 100644 --- a/drivers/staging/wilc1000/wilc_msgqueue.c +++ b/drivers/staging/wilc1000/wilc_msgqueue.c @@ -60,15 +60,11 @@ int wilc_mq_send(struct message_queue *mq, unsigned long flags; struct message *new_msg = NULL; - if ((!mq) || (send_buf_size == 0) || (!send_buf)) { - PRINT_ER("mq or send_buf is null\n"); + if (!mq || (send_buf_size == 0) || !send_buf) return -EINVAL; - } - if (mq->exiting) { - PRINT_ER("mq fail\n"); + if (mq->exiting) return -EFAULT; - } /* construct a new message */ new_msg = kmalloc(sizeof(*new_msg), GFP_ATOMIC); @@ -107,15 +103,11 @@ int wilc_mq_recv(struct message_queue *mq, struct message *msg; unsigned long flags; - if ((!mq) || (recv_buf_size == 0) || (!recv_buf) || (!recv_len)) { - PRINT_ER("mq or recv_buf is null\n"); + if (!mq || (recv_buf_size == 0) || !recv_buf || !recv_len) return -EINVAL; - } - if (mq->exiting) { - PRINT_ER("mq fail\n"); + if (mq->exiting) return -EFAULT; - } spin_lock_irqsave(>lock, flags); mq->recv_count++; @@ -127,7 +119,6 @@ int wilc_mq_recv(struct message_queue *mq, if (list_empty(>msg_list)) { spin_unlock_irqrestore(>lock, flags); up(>sem); - PRINT_ER("msg is null\n"); return -EFAULT; } /* check buffer size */ @@ -135,7 +126,6 @@ int wilc_mq_recv(struct message_queue *mq, if (recv_buf_size < msg->len) { spin_unlock_irqrestore(>lock, flags); up(>sem); - PRINT_ER("recv_buf_size overflow\n"); return -EOVERFLOW; } -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH RESEND 26/70] staging: wilc1000: wilc_parse_network_info(): renames local inner variables
From: Leo KimThis patch renames to avoid camelcase, changes follow are: - pu8TimElm to tim_elm - pu8IEs to ies - u16IEsLen to ies_len - u32Tsf_Lo to tsf_lo - u32Tsf_Hi to tsf_hi And, remove the prefix variable defined name, below are: - u8index to index - pu8msa to msa Signed-off-by: Leo Kim --- drivers/staging/wilc1000/coreconfigurator.c | 54 ++--- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c index 24afeb8..2a4e324 100644 --- a/drivers/staging/wilc1000/coreconfigurator.c +++ b/drivers/staging/wilc1000/coreconfigurator.c @@ -295,14 +295,14 @@ s32 wilc_parse_network_info(u8 *msg_buffer, tstrNetworkInfo **ret_network_info) wid_val = _buffer[8]; { - u8 *pu8msa = NULL; + u8 *msa = NULL; u16 rx_len = 0; - u8 *pu8TimElm = NULL; - u8 *pu8IEs = NULL; - u16 u16IEsLen = 0; - u8 u8index = 0; - u32 u32Tsf_Lo; - u32 u32Tsf_Hi; + u8 *tim_elm = NULL; + u8 *ies = NULL; + u16 ies_len = 0; + u8 index = 0; + u32 tsf_lo; + u32 tsf_hi; network_info = kzalloc(sizeof(tstrNetworkInfo), GFP_KERNEL); if (!network_info) @@ -310,43 +310,43 @@ s32 wilc_parse_network_info(u8 *msg_buffer, tstrNetworkInfo **ret_network_info) network_info->s8rssi = wid_val[0]; - pu8msa = _val[1]; + msa = _val[1]; rx_len = wid_len - 1; - network_info->u16CapInfo = get_cap_info(pu8msa); - network_info->u32Tsf = get_beacon_timestamp_lo(pu8msa); + network_info->u16CapInfo = get_cap_info(msa); + network_info->u32Tsf = get_beacon_timestamp_lo(msa); PRINT_D(CORECONFIG_DBG, "TSF :%x\n", network_info->u32Tsf); - u32Tsf_Lo = get_beacon_timestamp_lo(pu8msa); - u32Tsf_Hi = get_beacon_timestamp_hi(pu8msa); + tsf_lo = get_beacon_timestamp_lo(msa); + tsf_hi = get_beacon_timestamp_hi(msa); - network_info->u64Tsf = u32Tsf_Lo | ((u64)u32Tsf_Hi << 32); + network_info->u64Tsf = tsf_lo | ((u64)tsf_hi << 32); - get_ssid(pu8msa, network_info->au8ssid, _info->u8SsidLen); - get_BSSID(pu8msa, network_info->au8bssid); + get_ssid(msa, network_info->au8ssid, _info->u8SsidLen); + get_BSSID(msa, network_info->au8bssid); - network_info->u8channel = get_current_channel_802_11n(pu8msa, + network_info->u8channel = get_current_channel_802_11n(msa, rx_len + FCS_LEN); - u8index = MAC_HDR_LEN + TIME_STAMP_LEN; + index = MAC_HDR_LEN + TIME_STAMP_LEN; - network_info->u16BeaconPeriod = get_beacon_period(pu8msa + u8index); + network_info->u16BeaconPeriod = get_beacon_period(msa + index); - u8index += BEACON_INTERVAL_LEN + CAP_INFO_LEN; + index += BEACON_INTERVAL_LEN + CAP_INFO_LEN; - pu8TimElm = get_tim_elm(pu8msa, rx_len + FCS_LEN, u8index); - if (pu8TimElm) - network_info->u8DtimPeriod = pu8TimElm[3]; - pu8IEs = [MAC_HDR_LEN + TIME_STAMP_LEN + BEACON_INTERVAL_LEN + CAP_INFO_LEN]; - u16IEsLen = rx_len - (MAC_HDR_LEN + TIME_STAMP_LEN + BEACON_INTERVAL_LEN + CAP_INFO_LEN); + tim_elm = get_tim_elm(msa, rx_len + FCS_LEN, index); + if (tim_elm) + network_info->u8DtimPeriod = tim_elm[3]; + ies = [MAC_HDR_LEN + TIME_STAMP_LEN + BEACON_INTERVAL_LEN + CAP_INFO_LEN]; + ies_len = rx_len - (MAC_HDR_LEN + TIME_STAMP_LEN + BEACON_INTERVAL_LEN + CAP_INFO_LEN); - if (u16IEsLen > 0) { - network_info->pu8IEs = kmemdup(pu8IEs, u16IEsLen, + if (ies_len > 0) { + network_info->pu8IEs = kmemdup(ies, ies_len, GFP_KERNEL); if (!network_info->pu8IEs) return -ENOMEM; } - network_info->u16IEsLen = u16IEsLen; + network_info->u16IEsLen = ies_len; } *ret_network_info = network_info; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH RESEND 25/70] staging: wilc1000: wilc_parse_network_info(): renames local variables
From: Leo KimThis patch renames to avoid camelcase, changes follow are: - pstrNetworkInfo to network_info - u8MsgType to msg_type - u8MsgID to msg_id - u16MsgLen to msg_len - u16WidID to wid_id - u16WidLen to wid_len - pu8WidVal to wid_val Signed-off-by: Leo Kim --- drivers/staging/wilc1000/coreconfigurator.c | 67 ++--- 1 file changed, 33 insertions(+), 34 deletions(-) diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c index 43f0a29..24afeb8 100644 --- a/drivers/staging/wilc1000/coreconfigurator.c +++ b/drivers/staging/wilc1000/coreconfigurator.c @@ -272,27 +272,27 @@ static u8 get_current_channel_802_11n(u8 *pu8msa, u16 rx_len) s32 wilc_parse_network_info(u8 *msg_buffer, tstrNetworkInfo **ret_network_info) { - tstrNetworkInfo *pstrNetworkInfo = NULL; - u8 u8MsgType = 0; - u8 u8MsgID = 0; - u16 u16MsgLen = 0; + tstrNetworkInfo *network_info = NULL; + u8 msg_type = 0; + u8 msg_id = 0; + u16 msg_len = 0; - u16 u16WidID = (u16)WID_NIL; - u16 u16WidLen = 0; - u8 *pu8WidVal = NULL; + u16 wid_id = (u16)WID_NIL; + u16 wid_len = 0; + u8 *wid_val = NULL; - u8MsgType = msg_buffer[0]; + msg_type = msg_buffer[0]; - if ('N' != u8MsgType) { + if ('N' != msg_type) { PRINT_ER("Received Message format incorrect.\n"); return -EFAULT; } - u8MsgID = msg_buffer[1]; - u16MsgLen = MAKE_WORD16(msg_buffer[2], msg_buffer[3]); - u16WidID = MAKE_WORD16(msg_buffer[4], msg_buffer[5]); - u16WidLen = MAKE_WORD16(msg_buffer[6], msg_buffer[7]); - pu8WidVal = _buffer[8]; + msg_id = msg_buffer[1]; + msg_len = MAKE_WORD16(msg_buffer[2], msg_buffer[3]); + wid_id = MAKE_WORD16(msg_buffer[4], msg_buffer[5]); + wid_len = MAKE_WORD16(msg_buffer[6], msg_buffer[7]); + wid_val = _buffer[8]; { u8 *pu8msa = NULL; @@ -304,53 +304,52 @@ s32 wilc_parse_network_info(u8 *msg_buffer, tstrNetworkInfo **ret_network_info) u32 u32Tsf_Lo; u32 u32Tsf_Hi; - pstrNetworkInfo = kzalloc(sizeof(tstrNetworkInfo), GFP_KERNEL); - if (!pstrNetworkInfo) + network_info = kzalloc(sizeof(tstrNetworkInfo), GFP_KERNEL); + if (!network_info) return -ENOMEM; - pstrNetworkInfo->s8rssi = pu8WidVal[0]; + network_info->s8rssi = wid_val[0]; - pu8msa = [1]; + pu8msa = _val[1]; - rx_len = u16WidLen - 1; - pstrNetworkInfo->u16CapInfo = get_cap_info(pu8msa); - pstrNetworkInfo->u32Tsf = get_beacon_timestamp_lo(pu8msa); - PRINT_D(CORECONFIG_DBG, "TSF :%x\n", pstrNetworkInfo->u32Tsf); + rx_len = wid_len - 1; + network_info->u16CapInfo = get_cap_info(pu8msa); + network_info->u32Tsf = get_beacon_timestamp_lo(pu8msa); + PRINT_D(CORECONFIG_DBG, "TSF :%x\n", network_info->u32Tsf); u32Tsf_Lo = get_beacon_timestamp_lo(pu8msa); u32Tsf_Hi = get_beacon_timestamp_hi(pu8msa); - pstrNetworkInfo->u64Tsf = u32Tsf_Lo | ((u64)u32Tsf_Hi << 32); + network_info->u64Tsf = u32Tsf_Lo | ((u64)u32Tsf_Hi << 32); - get_ssid(pu8msa, pstrNetworkInfo->au8ssid, >u8SsidLen); - get_BSSID(pu8msa, pstrNetworkInfo->au8bssid); + get_ssid(pu8msa, network_info->au8ssid, _info->u8SsidLen); + get_BSSID(pu8msa, network_info->au8bssid); - pstrNetworkInfo->u8channel = get_current_channel_802_11n(pu8msa, + network_info->u8channel = get_current_channel_802_11n(pu8msa, rx_len + FCS_LEN); u8index = MAC_HDR_LEN + TIME_STAMP_LEN; - pstrNetworkInfo->u16BeaconPeriod = get_beacon_period(pu8msa + u8index); + network_info->u16BeaconPeriod = get_beacon_period(pu8msa + u8index); u8index += BEACON_INTERVAL_LEN + CAP_INFO_LEN; pu8TimElm = get_tim_elm(pu8msa, rx_len + FCS_LEN, u8index); if (pu8TimElm) - pstrNetworkInfo->u8DtimPeriod = pu8TimElm[3]; + network_info->u8DtimPeriod = pu8TimElm[3]; pu8IEs = [MAC_HDR_LEN + TIME_STAMP_LEN + BEACON_INTERVAL_LEN + CAP_INFO_LEN]; u16IEsLen = rx_len - (MAC_HDR_LEN + TIME_STAMP_LEN + BEACON_INTERVAL_LEN + CAP_INFO_LEN); if (u16IEsLen > 0) { - pstrNetworkInfo->pu8IEs = kmemdup(pu8IEs, u16IEsLen, - GFP_KERNEL); - if (!pstrNetworkInfo->pu8IEs) +
[PATCH RESEND 27/70] staging: wilc1000: rename variable s32Error
From: Leo KimThis patch renames variable s32Error to result to avoid CamelCase naming convention. Also, remove the unused variable s32Error and replace with direct return. Signed-off-by: Leo Kim --- drivers/staging/wilc1000/coreconfigurator.c | 19 +-- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c index 2a4e324..88e5661 100644 --- a/drivers/staging/wilc1000/coreconfigurator.c +++ b/drivers/staging/wilc1000/coreconfigurator.c @@ -356,30 +356,29 @@ s32 wilc_parse_network_info(u8 *msg_buffer, tstrNetworkInfo **ret_network_info) s32 wilc_dealloc_network_info(tstrNetworkInfo *pstrNetworkInfo) { - s32 s32Error = 0; + s32 result = 0; if (pstrNetworkInfo) { if (pstrNetworkInfo->pu8IEs) { kfree(pstrNetworkInfo->pu8IEs); pstrNetworkInfo->pu8IEs = NULL; } else { - s32Error = -EFAULT; + result = -EFAULT; } kfree(pstrNetworkInfo); pstrNetworkInfo = NULL; } else { - s32Error = -EFAULT; + result = -EFAULT; } - return s32Error; + return result; } s32 wilc_parse_assoc_resp_info(u8 *pu8Buffer, u32 u32BufferLen, tstrConnectRespInfo **ppstrConnectRespInfo) { - s32 s32Error = 0; tstrConnectRespInfo *pstrConnectRespInfo = NULL; u16 u16AssocRespLen = 0; u8 *pu8IEs = NULL; @@ -408,27 +407,27 @@ s32 wilc_parse_assoc_resp_info(u8 *pu8Buffer, u32 u32BufferLen, *ppstrConnectRespInfo = pstrConnectRespInfo; - return s32Error; + return 0; } s32 wilc_dealloc_assoc_resp_info(tstrConnectRespInfo *pstrConnectRespInfo) { - s32 s32Error = 0; + s32 result = 0; if (pstrConnectRespInfo) { if (pstrConnectRespInfo->pu8RespIEs) { kfree(pstrConnectRespInfo->pu8RespIEs); pstrConnectRespInfo->pu8RespIEs = NULL; } else { - s32Error = -EFAULT; + result = -EFAULT; } kfree(pstrConnectRespInfo); pstrConnectRespInfo = NULL; } else { - s32Error = -EFAULT; + result = -EFAULT; } - return s32Error; + return result; } -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH RESEND 24/70] staging: wilc1000: wilc_parse_network_info(): renames function variables
From: Leo KimThis patch renames to avoid camelcase, changes follow are: - pu8MsgBuffer to msg_buffer - ppstrNetworkInfo to ret_network_info Signed-off-by: Leo Kim --- drivers/staging/wilc1000/coreconfigurator.c | 16 drivers/staging/wilc1000/coreconfigurator.h | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c index 6f17e2b..43f0a29 100644 --- a/drivers/staging/wilc1000/coreconfigurator.c +++ b/drivers/staging/wilc1000/coreconfigurator.c @@ -270,7 +270,7 @@ static u8 get_current_channel_802_11n(u8 *pu8msa, u16 rx_len) return 0; } -s32 wilc_parse_network_info(u8 *pu8MsgBuffer, tstrNetworkInfo **ppstrNetworkInfo) +s32 wilc_parse_network_info(u8 *msg_buffer, tstrNetworkInfo **ret_network_info) { tstrNetworkInfo *pstrNetworkInfo = NULL; u8 u8MsgType = 0; @@ -281,18 +281,18 @@ s32 wilc_parse_network_info(u8 *pu8MsgBuffer, tstrNetworkInfo **ppstrNetworkInfo u16 u16WidLen = 0; u8 *pu8WidVal = NULL; - u8MsgType = pu8MsgBuffer[0]; + u8MsgType = msg_buffer[0]; if ('N' != u8MsgType) { PRINT_ER("Received Message format incorrect.\n"); return -EFAULT; } - u8MsgID = pu8MsgBuffer[1]; - u16MsgLen = MAKE_WORD16(pu8MsgBuffer[2], pu8MsgBuffer[3]); - u16WidID = MAKE_WORD16(pu8MsgBuffer[4], pu8MsgBuffer[5]); - u16WidLen = MAKE_WORD16(pu8MsgBuffer[6], pu8MsgBuffer[7]); - pu8WidVal = [8]; + u8MsgID = msg_buffer[1]; + u16MsgLen = MAKE_WORD16(msg_buffer[2], msg_buffer[3]); + u16WidID = MAKE_WORD16(msg_buffer[4], msg_buffer[5]); + u16WidLen = MAKE_WORD16(msg_buffer[6], msg_buffer[7]); + pu8WidVal = _buffer[8]; { u8 *pu8msa = NULL; @@ -350,7 +350,7 @@ s32 wilc_parse_network_info(u8 *pu8MsgBuffer, tstrNetworkInfo **ppstrNetworkInfo } - *ppstrNetworkInfo = pstrNetworkInfo; + *ret_network_info = pstrNetworkInfo; return 0; } diff --git a/drivers/staging/wilc1000/coreconfigurator.h b/drivers/staging/wilc1000/coreconfigurator.h index ee107ac..aec0779 100644 --- a/drivers/staging/wilc1000/coreconfigurator.h +++ b/drivers/staging/wilc1000/coreconfigurator.h @@ -120,7 +120,7 @@ typedef struct { size_t ie_len; } tstrDisconnectNotifInfo; -s32 wilc_parse_network_info(u8 *pu8MsgBuffer, tstrNetworkInfo **ppstrNetworkInfo); +s32 wilc_parse_network_info(u8 *msg_buffer, tstrNetworkInfo **ret_network_info); s32 wilc_dealloc_network_info(tstrNetworkInfo *pstrNetworkInfo); s32 wilc_parse_assoc_resp_info(u8 *pu8Buffer, u32 u32BufferLen, -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH RESEND 23/70] staging: wilc1000: fixes variable dereferenced before check
From: Leo KimThis patch fixes the warning reported by smatch. - wilc_wlan_get_firmware() warn: variable dereferenced before check 'vif' - wilc_set_multicast_list() warn: variable dereferenced before check 'dev' Just delete them and no need add null check since they are net_device from ndo_set_rx_mode of net_device_ops and vif of netdev_priv. Signed-off-by: Leo Kim Signed-off-by: Glen Lee --- drivers/staging/wilc1000/linux_wlan.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c index 9ca33536..22a2f98 100644 --- a/drivers/staging/wilc1000/linux_wlan.c +++ b/drivers/staging/wilc1000/linux_wlan.c @@ -397,9 +397,6 @@ int wilc_wlan_get_firmware(struct net_device *dev) netdev_info(dev, "loading firmware %s\n", firmware); - if (!vif) - goto _fail_; - if (!(>ndev->dev)) goto _fail_; @@ -1017,9 +1014,6 @@ static void wilc_set_multicast_list(struct net_device *dev) vif = netdev_priv(dev); hif_drv = (struct host_if_drv *)priv->hif_drv; - if (!dev) - return; - if (dev->flags & IFF_PROMISC) return; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH RESEND 43/70] staging: wilc1000: remove unused log message using the HOSTINF_DBG tag
From: Chris ParkThis patch remove unused log message using the HOSTINF_DBG tag Signed-off-by: Chris Park Signed-off-by: Leo Kim --- drivers/staging/wilc1000/host_interface.c | 198 +- drivers/staging/wilc1000/linux_wlan_common.h | 2 - drivers/staging/wilc1000/wilc_debugfs.c | 2 +- drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 2 - 4 files changed, 10 insertions(+), 194 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 2022deb..6e0a426 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -310,8 +310,6 @@ static s32 handle_set_channel(struct wilc_vif *vif, wid.val = (char *)_set_ch->set_ch; wid.size = sizeof(char); - PRINT_D(HOSTINF_DBG, "Setting channel\n"); - result = wilc_send_config_pkt(vif, SET_CFG, , 1, wilc_get_vif_idx(vif)); @@ -382,9 +380,6 @@ static s32 handle_set_ip_address(struct wilc_vif *vif, u8 *ip_addr, u8 idx) if (ip_addr[0] < 192) ip_addr[0] = 0; - PRINT_INFO(HOSTINF_DBG, "Indx = %d, Handling set IP = %pI4\n", - idx, ip_addr); - memcpy(set_ip[idx], ip_addr, IP_ALEN); wid.id = (u16)WID_IP_ADDRESS; @@ -402,8 +397,6 @@ static s32 handle_set_ip_address(struct wilc_vif *vif, u8 *ip_addr, u8 idx) return -EINVAL; } - PRINT_INFO(HOSTINF_DBG, "IP address set\n"); - return result; } @@ -420,8 +413,6 @@ static s32 handle_get_ip_address(struct wilc_vif *vif, u8 idx) result = wilc_send_config_pkt(vif, GET_CFG, , 1, wilc_get_vif_idx(vif)); - PRINT_INFO(HOSTINF_DBG, "%pI4\n", wid.val); - memcpy(get_ip[idx], wid.val, IP_ALEN); kfree(wid.val); @@ -434,10 +425,6 @@ static s32 handle_get_ip_address(struct wilc_vif *vif, u8 idx) return -EINVAL; } - PRINT_INFO(HOSTINF_DBG, "IP address retrieved:: u8IfIdx = %d\n", idx); - PRINT_INFO(HOSTINF_DBG, "%pI4\n", get_ip[idx]); - PRINT_INFO(HOSTINF_DBG, "\n"); - return result; } @@ -504,8 +491,6 @@ static s32 handle_cfg_param(struct wilc_vif *vif, down(_drv->sem_cfg_values); - PRINT_D(HOSTINF_DBG, "Setting CFG params\n"); - if (cfg_param_attr->cfg_attr_info.flag & BSS_TYPE) { if (cfg_param_attr->cfg_attr_info.bss_type < 6) { wid_list[wid_cnt].id = WID_BSS_TYPE; @@ -810,9 +795,6 @@ static s32 Handle_Scan(struct wilc_vif *vif, u8 *pu8HdnNtwrksWidVal = NULL; struct host_if_drv *hif_drv = vif->hif_drv; - PRINT_D(HOSTINF_DBG, "Setting SCAN params\n"); - PRINT_D(HOSTINF_DBG, "Scanning: In [%d] state\n", hif_drv->hif_state); - hif_drv->usr_scan_req.scan_result = pstrHostIFscanAttr->result; hif_drv->usr_scan_req.arg = pstrHostIFscanAttr->arg; @@ -832,8 +814,6 @@ static s32 Handle_Scan(struct wilc_vif *vif, goto ERRORHANDLER; } - PRINT_D(HOSTINF_DBG, "Setting SCAN params\n"); - hif_drv->usr_scan_req.rcvd_ch_cnt = 0; strWIDList[u32WidsCount].id = (u16)WID_SSID_PROBE_REQ; @@ -848,8 +828,6 @@ static s32 Handle_Scan(struct wilc_vif *vif, *pu8Buffer++ = pstrHostIFscanAttr->hidden_network.n_ssids; - PRINT_D(HOSTINF_DBG, "In Handle_ProbeRequest number of ssid %d\n", pstrHostIFscanAttr->hidden_network.n_ssids); - for (i = 0; i < pstrHostIFscanAttr->hidden_network.n_ssids; i++) { *pu8Buffer++ = pstrHostIFscanAttr->hidden_network.net_info[i].ssid_len; memcpy(pu8Buffer, pstrHostIFscanAttr->hidden_network.net_info[i].ssid, pstrHostIFscanAttr->hidden_network.net_info[i].ssid_len); @@ -908,8 +886,6 @@ static s32 Handle_Scan(struct wilc_vif *vif, if (result) PRINT_ER("Failed to send scan paramters config packet\n"); - else - PRINT_D(HOSTINF_DBG, "Successfully sent SCAN params config packet\n"); ERRORHANDLER: if (result) { @@ -938,8 +914,6 @@ static s32 Handle_ScanDone(struct wilc_vif *vif, struct wid wid; struct host_if_drv *hif_drv = vif->hif_drv; - PRINT_D(HOSTINF_DBG, "in Handle_ScanDone()\n"); - if (enuEvent == SCAN_EVENT_ABORTED) { PRINT_D(GENERIC_DBG, "Abort running scan\n"); u8abort_running_scan = 1; @@ -990,8 +964,6 @@ static s32 Handle_Connect(struct wilc_vif *vif, return result; } - PRINT_INFO(HOSTINF_DBG, "Saving connection parameters in global structure\n"); - ptstrJoinBssParam = (struct join_bss_param *)pstrHostIFconnectAttr->params; if (!ptstrJoinBssParam) { PRINT_ER("Required
[PATCH RESEND 40/70] staging: wilc1000: wilc_wlan.c: replaces PRINT_ER with netdev_err
From: Leo KimThis patches replaces PRINT_ER with netdev_err. Removes unnecessary debug logs as well. Signed-off-by: Leo Kim --- drivers/staging/wilc1000/wilc_wlan.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index 46087e2..ec111d8 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -1496,7 +1496,6 @@ int wilc_wlan_init(struct net_device *dev) if (!wilc->tx_buffer) { ret = -ENOBUFS; - PRINT_ER("Can't allocate Tx Buffer"); goto _fail_; } @@ -1505,7 +1504,6 @@ int wilc_wlan_init(struct net_device *dev) if (!wilc->rx_buffer) { ret = -ENOBUFS; - PRINT_ER("Can't allocate Rx Buffer"); goto _fail_; } -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH RESEND 41/70] staging: wilc1000: linux_mon.c: replaces PRINT_ER with netdev_err
From: Leo KimThis patches replaces PRINT_ER with netdev_err. Removes unnecessary debug logs as well. Signed-off-by: Leo Kim --- drivers/staging/wilc1000/linux_mon.c | 30 ++ 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/drivers/staging/wilc1000/linux_mon.c b/drivers/staging/wilc1000/linux_mon.c index e9bb0ec..f0a94e5 100644 --- a/drivers/staging/wilc1000/linux_mon.c +++ b/drivers/staging/wilc1000/linux_mon.c @@ -157,10 +157,8 @@ static int mon_mgmt_tx(struct net_device *dev, const u8 *buf, size_t len) { struct tx_complete_mon_data *mgmt_tx = NULL; - if (!dev) { - PRINT_D(HOSTAPD_DBG, "ERROR: dev == NULL\n"); + if (!dev) return -EFAULT; - } netif_stop_queue(dev); mgmt_tx = kmalloc(sizeof(*mgmt_tx), GFP_ATOMIC); @@ -205,17 +203,12 @@ static netdev_tx_t WILC_WFI_mon_xmit(struct sk_buff *skb, return -EFAULT; mon_priv = netdev_priv(wilc_wfi_mon); - - if (!mon_priv) { - PRINT_ER("Monitor interface private structure is NULL\n"); + if (!mon_priv) return -EFAULT; - } - rtap_len = ieee80211_get_radiotap_len(skb->data); - if (skb->len < rtap_len) { - PRINT_ER("Error in radiotap header\n"); + if (skb->len < rtap_len) return -1; - } + /* skip the radiotap header */ PRINT_INFO(HOSTAPD_DBG, "Radiotap len: %d\n", rtap_len); @@ -273,7 +266,9 @@ static netdev_tx_t WILC_WFI_mon_xmit(struct sk_buff *skb, /* if source address and bssid fields are equal>>Mac header */ /*send it to mgmt frames handler */ if (!(memcmp(srcAdd, bssid, 6))) { - mon_mgmt_tx(mon_priv->real_ndev, skb->data, skb->len); + ret = mon_mgmt_tx(mon_priv->real_ndev, skb->data, skb->len); + if (ret) + netdev_err(dev, "fail to mgmt tx\n"); dev_kfree_skb(skb); } else { ret = wilc_mac_xmit(skb, mon_priv->real_ndev); @@ -307,11 +302,8 @@ struct net_device *WILC_WFI_init_mon_interface(const char *name, struct net_devi } wilc_wfi_mon = alloc_etherdev(sizeof(struct WILC_WFI_mon_priv)); - if (!wilc_wfi_mon) { - PRINT_ER("failed to allocate memory\n"); + if (!wilc_wfi_mon) return NULL; - } - wilc_wfi_mon->type = ARPHRD_IEEE80211_RADIOTAP; strncpy(wilc_wfi_mon->name, name, IFNAMSIZ); wilc_wfi_mon->name[IFNAMSIZ - 1] = 0; @@ -319,14 +311,12 @@ struct net_device *WILC_WFI_init_mon_interface(const char *name, struct net_devi ret = register_netdevice(wilc_wfi_mon); if (ret) { - PRINT_ER(" register_netdevice failed (%d)\n", ret); + netdev_err(real_dev, "register_netdevice failed\n"); return NULL; } priv = netdev_priv(wilc_wfi_mon); - if (!priv) { - PRINT_ER("private structure is NULL\n"); + if (!priv) return NULL; - } priv->real_ndev = real_dev; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH RESEND 42/70] staging: wilc1000: remove unused log message using the CORECONFIG_DBG tag
From: Chris ParkThis patch remove unused log messages using the CORECONFIG_DBG tag Signed-off-by: Chris Park Signed-off-by: Leo Kim --- drivers/staging/wilc1000/coreconfigurator.c | 1 - drivers/staging/wilc1000/linux_wlan_common.h | 2 -- drivers/staging/wilc1000/wilc_debugfs.c | 2 +- drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 20 +--- 4 files changed, 2 insertions(+), 23 deletions(-) diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c index a0b80bf..11e3ce0 100644 --- a/drivers/staging/wilc1000/coreconfigurator.c +++ b/drivers/staging/wilc1000/coreconfigurator.c @@ -315,7 +315,6 @@ s32 wilc_parse_network_info(u8 *msg_buffer, tstrNetworkInfo **ret_network_info) rx_len = wid_len - 1; network_info->u16CapInfo = get_cap_info(msa); network_info->u32Tsf = get_beacon_timestamp_lo(msa); - PRINT_D(CORECONFIG_DBG, "TSF :%x\n", network_info->u32Tsf); tsf_lo = get_beacon_timestamp_lo(msa); tsf_hi = get_beacon_timestamp_hi(msa); diff --git a/drivers/staging/wilc1000/linux_wlan_common.h b/drivers/staging/wilc1000/linux_wlan_common.h index 5d40f05..5e1d3ad 100644 --- a/drivers/staging/wilc1000/linux_wlan_common.h +++ b/drivers/staging/wilc1000/linux_wlan_common.h @@ -6,7 +6,6 @@ enum debug_region { Hostapd_debug, Hostinf_debug, CFG80211_debug, - Coreconfig_debug, Interrupt_debug, TX_debug, RX_debug, @@ -24,7 +23,6 @@ enum debug_region { #define GENERIC_DBG (1 << Generic_debug) #define HOSTAPD_DBG (1 << Hostapd_debug) #define HOSTINF_DBG (1 << Hostinf_debug) -#define CORECONFIG_DBG (1 << Coreconfig_debug) #define CFG80211_DBG(1 << CFG80211_debug) #define INT_DBG (1 << Interrupt_debug) #define TX_DBG (1 << TX_debug) diff --git a/drivers/staging/wilc1000/wilc_debugfs.c b/drivers/staging/wilc1000/wilc_debugfs.c index 291e6fa..c7e0775 100644 --- a/drivers/staging/wilc1000/wilc_debugfs.c +++ b/drivers/staging/wilc1000/wilc_debugfs.c @@ -24,7 +24,7 @@ static struct dentry *wilc_dir; * */ -#define DBG_REGION_ALL (GENERIC_DBG | HOSTAPD_DBG | HOSTINF_DBG | CORECONFIG_DBG | CFG80211_DBG | INT_DBG | TX_DBG | RX_DBG | LOCK_DBG | INIT_DBG | BUS_DBG | MEM_DBG) +#define DBG_REGION_ALL (GENERIC_DBG | HOSTAPD_DBG | HOSTINF_DBG | CFG80211_DBG | INT_DBG | TX_DBG | RX_DBG | LOCK_DBG | INIT_DBG | BUS_DBG | MEM_DBG) #define DBG_LEVEL_ALL (DEBUG | INFO | WRN | ERR) atomic_t WILC_REGION = ATOMIC_INIT(INIT_DBG | GENERIC_DBG | CFG80211_DBG | FIRM_DBG | HOSTAPD_DBG); EXPORT_SYMBOL_GPL(WILC_REGION); diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c index dbbf7bf..809dbb5 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c @@ -192,7 +192,6 @@ static void clear_shadow_scan(void) if (op_ifcs == 0) { del_timer_sync(); - PRINT_INFO(CORECONFIG_DBG, "destroy aging timer\n"); for (i = 0; i < last_scanned_cnt; i++) { if (last_scanned_shadow[last_scanned_cnt].pu8IEs) { @@ -424,8 +423,6 @@ static void CfgScanResult(enum scan_event scan_event, PRINT_D(CFG80211_DBG, "Network %s found\n", network_info->au8ssid); priv->u32RcvdChCount++; - if (!join_params) - PRINT_INFO(CORECONFIG_DBG, ">> Something really bad happened\n"); add_network_to_shadow(network_info, priv, join_params); if (!(memcmp("DIRECT-", network_info->au8ssid, 7))) { @@ -762,24 +759,14 @@ static int connect(struct wiphy *wiphy, struct net_device *dev, PRINT_INFO(CFG80211_DBG, "sme->crypto.n_ciphers_pairwise=%d\n", sme->crypto.n_ciphers_pairwise); - if (INFO) { - for (i = 0; i < sme->crypto.n_ciphers_pairwise; i++) - PRINT_D(CORECONFIG_DBG, "sme->crypto.ciphers_pairwise[%d]=%x\n", i, sme->crypto.ciphers_pairwise[i]); - } - if (sme->crypto.cipher_group != NO_ENCRYPT) { pcwpa_version = "Default"; - PRINT_D(CORECONFIG_DBG, ">> sme->crypto.wpa_versions: %x\n", sme->crypto.wpa_versions); if (sme->crypto.cipher_group == WLAN_CIPHER_SUITE_WEP40) { u8security = ENCRYPT_ENABLED | WEP; pcgroup_encrypt_val = "WEP40";
[PATCH RESEND 49/70] staging: wilc1000: remove typedef from pstrNetworkInfo
From: Leo KimThis patch removes typedef from the struct pstrNetworkInfo and renames it to network_info. Signed-off-by: Leo Kim --- drivers/staging/wilc1000/coreconfigurator.c | 7 --- drivers/staging/wilc1000/coreconfigurator.h | 7 --- drivers/staging/wilc1000/host_interface.c | 6 +++--- drivers/staging/wilc1000/host_interface.h | 4 ++-- drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 14 +++--- 5 files changed, 20 insertions(+), 18 deletions(-) diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c index e9f6262..0d0a4ec 100644 --- a/drivers/staging/wilc1000/coreconfigurator.c +++ b/drivers/staging/wilc1000/coreconfigurator.c @@ -270,9 +270,10 @@ static u8 get_current_channel_802_11n(u8 *pu8msa, u16 rx_len) return 0; } -s32 wilc_parse_network_info(u8 *msg_buffer, tstrNetworkInfo **ret_network_info) +s32 wilc_parse_network_info(u8 *msg_buffer, + struct network_info **ret_network_info) { - tstrNetworkInfo *network_info = NULL; + struct network_info *network_info = NULL; u8 msg_type = 0; u8 msg_id = 0; u16 msg_len = 0; @@ -304,7 +305,7 @@ s32 wilc_parse_network_info(u8 *msg_buffer, tstrNetworkInfo **ret_network_info) u32 tsf_lo; u32 tsf_hi; - network_info = kzalloc(sizeof(tstrNetworkInfo), GFP_KERNEL); + network_info = kzalloc(sizeof(*network_info), GFP_KERNEL); if (!network_info) return -ENOMEM; diff --git a/drivers/staging/wilc1000/coreconfigurator.h b/drivers/staging/wilc1000/coreconfigurator.h index aa9aee6..214b43b 100644 --- a/drivers/staging/wilc1000/coreconfigurator.h +++ b/drivers/staging/wilc1000/coreconfigurator.h @@ -76,7 +76,7 @@ typedef struct { s8 as8RSSI[NUM_RSSI]; } tstrRSSI; -typedef struct { +struct network_info { s8 s8rssi; u16 u16CapInfo; u8 au8ssid[MAX_SSID_LEN]; @@ -95,7 +95,7 @@ typedef struct { void *pJoinParams; tstrRSSI strRssi; u64 u64Tsf; -} tstrNetworkInfo; +}; struct connect_resp_info { u16 capability; @@ -120,7 +120,8 @@ typedef struct { size_t ie_len; } tstrDisconnectNotifInfo; -s32 wilc_parse_network_info(u8 *msg_buffer, tstrNetworkInfo **ret_network_info); +s32 wilc_parse_network_info(u8 *msg_buffer, + struct network_info **ret_network_info); s32 wilc_parse_assoc_resp_info(u8 *buffer, u32 buffer_len, struct connect_resp_info **ret_connect_resp_info); void wilc_scan_complete_received(struct wilc *wilc, u8 *pu8Buffer, diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 992008b..c0b4f7b 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -272,7 +272,7 @@ static struct wilc_vif *join_req_vif; #define FLUSHED_JOIN_REQ 1 #define FLUSHED_BYTE_POS 79 -static void *host_int_ParseJoinBssParam(tstrNetworkInfo *ptstrNetworkInfo); +static void *host_int_ParseJoinBssParam(struct network_info *ptstrNetworkInfo); static int host_int_get_ipaddress(struct wilc_vif *vif, u8 *ip_addr, u8 idx); /* The u8IfIdx starts from 0 to NUM_CONCURRENT_IFC -1, but 0 index used as @@ -1348,7 +1348,7 @@ static s32 Handle_RcvdNtwrkInfo(struct wilc_vif *vif, u32 i; bool bNewNtwrkFound; s32 result = 0; - tstrNetworkInfo *pstrNetworkInfo = NULL; + struct network_info *pstrNetworkInfo = NULL; void *pJoinParams = NULL; struct host_if_drv *hif_drv = vif->hif_drv; @@ -4255,7 +4255,7 @@ int wilc_setup_multicast_filter(struct wilc_vif *vif, bool enabled, return result; } -static void *host_int_ParseJoinBssParam(tstrNetworkInfo *ptstrNetworkInfo) +static void *host_int_ParseJoinBssParam(struct network_info *ptstrNetworkInfo) { struct join_bss_param *pNewJoinBssParam = NULL; u8 *pu8IEs; diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h index 69c36a7..c73a5c3 100644 --- a/drivers/staging/wilc1000/host_interface.h +++ b/drivers/staging/wilc1000/host_interface.h @@ -168,8 +168,8 @@ enum KEY_TYPE { PMKSA, }; -typedef void (*wilc_scan_result)(enum scan_event, tstrNetworkInfo *, - void *, void *); +typedef void (*wilc_scan_result)(enum scan_event, struct network_info *, +void *, void *); typedef void (*wilc_connect_result)(enum conn_event, tstrConnectInfo *, diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c index 8d922e6..b22a48a 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +++
[PATCH RESEND 55/70] staging: wilc1000: renames u16BeaconPeriod of connect_resp_info structure
From: Leo KimThis patch renames u16BeaconPeriod variable to beacon_period. Signed-off-by: Leo Kim --- drivers/staging/wilc1000/coreconfigurator.c | 2 +- drivers/staging/wilc1000/coreconfigurator.h | 2 +- drivers/staging/wilc1000/host_interface.c | 2 +- drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 8 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c index 4a82576..b4f7ec3 100644 --- a/drivers/staging/wilc1000/coreconfigurator.c +++ b/drivers/staging/wilc1000/coreconfigurator.c @@ -330,7 +330,7 @@ s32 wilc_parse_network_info(u8 *msg_buffer, index = MAC_HDR_LEN + TIME_STAMP_LEN; - network_info->u16BeaconPeriod = get_beacon_period(msa + index); + network_info->beacon_period = get_beacon_period(msa + index); index += BEACON_INTERVAL_LEN + CAP_INFO_LEN; diff --git a/drivers/staging/wilc1000/coreconfigurator.h b/drivers/staging/wilc1000/coreconfigurator.h index 5404162..2fbffe8 100644 --- a/drivers/staging/wilc1000/coreconfigurator.h +++ b/drivers/staging/wilc1000/coreconfigurator.h @@ -82,7 +82,7 @@ struct network_info { u8 ssid[MAX_SSID_LEN]; u8 ssid_len; u8 bssid[6]; - u16 u16BeaconPeriod; + u16 beacon_period; u8 u8DtimPeriod; u8 u8channel; unsigned long u32TimeRcvdInScanCached; diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 2534c9a..0ba248b 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -4276,7 +4276,7 @@ static void *host_int_ParseJoinBssParam(struct network_info *ptstrNetworkInfo) pNewJoinBssParam = kzalloc(sizeof(struct join_bss_param), GFP_KERNEL); if (pNewJoinBssParam) { pNewJoinBssParam->dtim_period = ptstrNetworkInfo->u8DtimPeriod; - pNewJoinBssParam->beacon_period = ptstrNetworkInfo->u16BeaconPeriod; + pNewJoinBssParam->beacon_period = ptstrNetworkInfo->beacon_period; pNewJoinBssParam->cap_info = ptstrNetworkInfo->cap_info; memcpy(pNewJoinBssParam->au8bssid, ptstrNetworkInfo->bssid, 6); memcpy((u8 *)pNewJoinBssParam->ssid, ptstrNetworkInfo->ssid, diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c index 80f46d7..9424776 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c @@ -252,7 +252,7 @@ static void refresh_scan(void *user_void, u8 all, bool direct_scan) network_info->bssid, network_info->u64Tsf, network_info->cap_info, - network_info->u16BeaconPeriod, + network_info->beacon_period, (const u8 *)network_info->pu8IEs, (size_t)network_info->u16IEsLen, (s32)rssi * 100, @@ -373,7 +373,7 @@ static void add_network_to_shadow(struct network_info *pstrNetworkInfo, pstrNetworkInfo->ssid, pstrNetworkInfo->ssid_len); memcpy(last_scanned_shadow[ap_index].bssid, pstrNetworkInfo->bssid, ETH_ALEN); - last_scanned_shadow[ap_index].u16BeaconPeriod = pstrNetworkInfo->u16BeaconPeriod; + last_scanned_shadow[ap_index].beacon_period = pstrNetworkInfo->beacon_period; last_scanned_shadow[ap_index].u8DtimPeriod = pstrNetworkInfo->u8DtimPeriod; last_scanned_shadow[ap_index].u8channel = pstrNetworkInfo->u8channel; last_scanned_shadow[ap_index].u16IEsLen = pstrNetworkInfo->u16IEsLen; @@ -431,7 +431,7 @@ static void CfgScanResult(enum scan_event scan_event, channel->center_freq, (s32)network_info->rssi * 100, network_info->cap_info, - network_info->u16BeaconPeriod); + network_info->beacon_period); if (network_info->bNewNetwork) { if (priv->u32RcvdChCount < MAX_NUM_SCANNED_NETWORKS) { @@ -449,7 +449,7 @@ static void CfgScanResult(enum scan_event scan_event, network_info->bssid,
[PATCH RESEND 52/70] staging: wilc1000: renames au8ssid of connect_resp_info structure
From: Leo KimThis patch renames au8ssid variable to ssid. Signed-off-by: Leo Kim --- drivers/staging/wilc1000/coreconfigurator.c | 2 +- drivers/staging/wilc1000/coreconfigurator.h | 2 +- drivers/staging/wilc1000/host_interface.c | 3 ++- drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 19 +++ 4 files changed, 15 insertions(+), 11 deletions(-) diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c index 6c40d36..4dd7c8a 100644 --- a/drivers/staging/wilc1000/coreconfigurator.c +++ b/drivers/staging/wilc1000/coreconfigurator.c @@ -322,7 +322,7 @@ s32 wilc_parse_network_info(u8 *msg_buffer, network_info->u64Tsf = tsf_lo | ((u64)tsf_hi << 32); - get_ssid(msa, network_info->au8ssid, _info->u8SsidLen); + get_ssid(msa, network_info->ssid, _info->u8SsidLen); get_BSSID(msa, network_info->au8bssid); network_info->u8channel = get_current_channel_802_11n(msa, diff --git a/drivers/staging/wilc1000/coreconfigurator.h b/drivers/staging/wilc1000/coreconfigurator.h index ace50d8..781a65f 100644 --- a/drivers/staging/wilc1000/coreconfigurator.h +++ b/drivers/staging/wilc1000/coreconfigurator.h @@ -79,7 +79,7 @@ typedef struct { struct network_info { s8 rssi; u16 cap_info; - u8 au8ssid[MAX_SSID_LEN]; + u8 ssid[MAX_SSID_LEN]; u8 u8SsidLen; u8 au8bssid[6]; u16 u16BeaconPeriod; diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index d56a33c..c31f0b5 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -4279,7 +4279,8 @@ static void *host_int_ParseJoinBssParam(struct network_info *ptstrNetworkInfo) pNewJoinBssParam->beacon_period = ptstrNetworkInfo->u16BeaconPeriod; pNewJoinBssParam->cap_info = ptstrNetworkInfo->cap_info; memcpy(pNewJoinBssParam->au8bssid, ptstrNetworkInfo->au8bssid, 6); - memcpy((u8 *)pNewJoinBssParam->ssid, ptstrNetworkInfo->au8ssid, ptstrNetworkInfo->u8SsidLen + 1); + memcpy((u8 *)pNewJoinBssParam->ssid, ptstrNetworkInfo->ssid, + ptstrNetworkInfo->u8SsidLen + 1); pNewJoinBssParam->ssid_len = ptstrNetworkInfo->u8SsidLen; memset(pNewJoinBssParam->rsn_pcip_policy, 0xFF, 3); memset(pNewJoinBssParam->rsn_auth_policy, 0xFF, 3); diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c index 578a3f2..9aae11e 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c @@ -244,7 +244,7 @@ static void refresh_scan(void *user_void, u8 all, bool direct_scan) channel = ieee80211_get_channel(wiphy, freq); rssi = get_rssi_avg(network_info); - if (memcmp("DIRECT-", network_info->au8ssid, 7) || + if (memcmp("DIRECT-", network_info->ssid, 7) || direct_scan) { bss = cfg80211_inform_bss(wiphy, channel, @@ -288,7 +288,8 @@ static void remove_network_from_shadow(unsigned long arg) for (i = 0; i < last_scanned_cnt; i++) { if (time_after(now, last_scanned_shadow[i].u32TimeRcvdInScan + (unsigned long)(SCAN_RESULT_EXPIRE))) { - PRINT_D(CFG80211_DBG, "Network expired in ScanShadow: %s\n", last_scanned_shadow[i].au8ssid); + PRINT_D(CFG80211_DBG, "Network expired ScanShadow:%s\n", + last_scanned_shadow[i].ssid); kfree(last_scanned_shadow[i].pu8IEs); last_scanned_shadow[i].pu8IEs = NULL; @@ -368,8 +369,8 @@ static void add_network_to_shadow(struct network_info *pstrNetworkInfo, last_scanned_shadow[ap_index].rssi = pstrNetworkInfo->rssi; last_scanned_shadow[ap_index].cap_info = pstrNetworkInfo->cap_info; last_scanned_shadow[ap_index].u8SsidLen = pstrNetworkInfo->u8SsidLen; - memcpy(last_scanned_shadow[ap_index].au8ssid, - pstrNetworkInfo->au8ssid, pstrNetworkInfo->u8SsidLen); + memcpy(last_scanned_shadow[ap_index].ssid, + pstrNetworkInfo->ssid, pstrNetworkInfo->u8SsidLen); memcpy(last_scanned_shadow[ap_index].au8bssid, pstrNetworkInfo->au8bssid, ETH_ALEN); last_scanned_shadow[ap_index].u16BeaconPeriod = pstrNetworkInfo->u16BeaconPeriod; @@ -434,12 +435,14 @@ static void CfgScanResult(enum scan_event scan_event, if (network_info->bNewNetwork) {
[PATCH RESEND 48/70] staging: wilc1000: renames struct connect_resp_info variables
From: Leo KimThis patch renames to avoid camelcase and remove prefix names, changes follow are: - u16capability to capability - u16ConnectStatus to status - u16AssocID to assoc_id - pu8RespIEs to ies - u16RespIEsLen to ies_len Signed-off-by: Leo Kim --- drivers/staging/wilc1000/coreconfigurator.c | 14 +++--- drivers/staging/wilc1000/coreconfigurator.h | 10 +- drivers/staging/wilc1000/host_interface.c | 14 +++--- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c index c456a32..e9f6262 100644 --- a/drivers/staging/wilc1000/coreconfigurator.c +++ b/drivers/staging/wilc1000/coreconfigurator.c @@ -367,19 +367,19 @@ s32 wilc_parse_assoc_resp_info(u8 *buffer, u32 buffer_len, assoc_resp_len = (u16)buffer_len; - connect_resp_info->u16ConnectStatus = get_asoc_status(buffer); - if (connect_resp_info->u16ConnectStatus == SUCCESSFUL_STATUSCODE) { - connect_resp_info->u16capability = get_assoc_resp_cap_info(buffer); - connect_resp_info->u16AssocID = get_asoc_id(buffer); + connect_resp_info->status = get_asoc_status(buffer); + if (connect_resp_info->status == SUCCESSFUL_STATUSCODE) { + connect_resp_info->capability = get_assoc_resp_cap_info(buffer); + connect_resp_info->assoc_id = get_asoc_id(buffer); ies = [CAP_INFO_LEN + STATUS_CODE_LEN + AID_LEN]; ies_len = assoc_resp_len - (CAP_INFO_LEN + STATUS_CODE_LEN + AID_LEN); - connect_resp_info->pu8RespIEs = kmemdup(ies, ies_len, GFP_KERNEL); - if (!connect_resp_info->pu8RespIEs) + connect_resp_info->ies = kmemdup(ies, ies_len, GFP_KERNEL); + if (!connect_resp_info->ies) return -ENOMEM; - connect_resp_info->u16RespIEsLen = ies_len; + connect_resp_info->ies_len = ies_len; } *ret_connect_resp_info = connect_resp_info; diff --git a/drivers/staging/wilc1000/coreconfigurator.h b/drivers/staging/wilc1000/coreconfigurator.h index 611486b..aa9aee6 100644 --- a/drivers/staging/wilc1000/coreconfigurator.h +++ b/drivers/staging/wilc1000/coreconfigurator.h @@ -98,11 +98,11 @@ typedef struct { } tstrNetworkInfo; struct connect_resp_info { - u16 u16capability; - u16 u16ConnectStatus; - u16 u16AssocID; - u8 *pu8RespIEs; - u16 u16RespIEsLen; + u16 capability; + u16 status; + u16 assoc_id; + u8 *ies; + u16 ies_len; }; typedef struct { diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 513b1f0..992008b 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -1489,19 +1489,19 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct wilc_vif *vif, if (s32Err) { PRINT_ER("wilc_parse_assoc_resp_info() returned error %d\n", s32Err); } else { - strConnectInfo.u16ConnectStatus = pstrConnectRespInfo->u16ConnectStatus; + strConnectInfo.u16ConnectStatus = pstrConnectRespInfo->status; if (strConnectInfo.u16ConnectStatus == SUCCESSFUL_STATUSCODE) { - if (pstrConnectRespInfo->pu8RespIEs) { - strConnectInfo.u16RespIEsLen = pstrConnectRespInfo->u16RespIEsLen; - strConnectInfo.pu8RespIEs = kmalloc(pstrConnectRespInfo->u16RespIEsLen, GFP_KERNEL); - memcpy(strConnectInfo.pu8RespIEs, pstrConnectRespInfo->pu8RespIEs, - pstrConnectRespInfo->u16RespIEsLen); + if (pstrConnectRespInfo->ies) { + strConnectInfo.u16RespIEsLen = pstrConnectRespInfo->ies_len; + strConnectInfo.pu8RespIEs = kmalloc(pstrConnectRespInfo->ies_len, GFP_KERNEL); + memcpy(strConnectInfo.pu8RespIEs, pstrConnectRespInfo->ies, + pstrConnectRespInfo->ies_len); } } if (pstrConnectRespInfo) { -
[PATCH RESEND 56/70] staging: wilc1000: renames u8DtimPeriod of connect_resp_info structure
From: Leo KimThis patch renames u8DtimPeriod variable to dtim_period. Signed-off-by: Leo Kim --- drivers/staging/wilc1000/coreconfigurator.c | 2 +- drivers/staging/wilc1000/coreconfigurator.h | 2 +- drivers/staging/wilc1000/host_interface.c | 2 +- drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c index b4f7ec3..ce3bc29 100644 --- a/drivers/staging/wilc1000/coreconfigurator.c +++ b/drivers/staging/wilc1000/coreconfigurator.c @@ -336,7 +336,7 @@ s32 wilc_parse_network_info(u8 *msg_buffer, tim_elm = get_tim_elm(msa, rx_len + FCS_LEN, index); if (tim_elm) - network_info->u8DtimPeriod = tim_elm[3]; + network_info->dtim_period = tim_elm[3]; ies = [MAC_HDR_LEN + TIME_STAMP_LEN + BEACON_INTERVAL_LEN + CAP_INFO_LEN]; ies_len = rx_len - (MAC_HDR_LEN + TIME_STAMP_LEN + BEACON_INTERVAL_LEN + CAP_INFO_LEN); diff --git a/drivers/staging/wilc1000/coreconfigurator.h b/drivers/staging/wilc1000/coreconfigurator.h index 2fbffe8..bbc4b0e 100644 --- a/drivers/staging/wilc1000/coreconfigurator.h +++ b/drivers/staging/wilc1000/coreconfigurator.h @@ -83,7 +83,7 @@ struct network_info { u8 ssid_len; u8 bssid[6]; u16 beacon_period; - u8 u8DtimPeriod; + u8 dtim_period; u8 u8channel; unsigned long u32TimeRcvdInScanCached; unsigned long u32TimeRcvdInScan; diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 0ba248b..df33197 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -4275,7 +4275,7 @@ static void *host_int_ParseJoinBssParam(struct network_info *ptstrNetworkInfo) pNewJoinBssParam = kzalloc(sizeof(struct join_bss_param), GFP_KERNEL); if (pNewJoinBssParam) { - pNewJoinBssParam->dtim_period = ptstrNetworkInfo->u8DtimPeriod; + pNewJoinBssParam->dtim_period = ptstrNetworkInfo->dtim_period; pNewJoinBssParam->beacon_period = ptstrNetworkInfo->beacon_period; pNewJoinBssParam->cap_info = ptstrNetworkInfo->cap_info; memcpy(pNewJoinBssParam->au8bssid, ptstrNetworkInfo->bssid, 6); diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c index 9424776..16b2798 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c @@ -374,7 +374,7 @@ static void add_network_to_shadow(struct network_info *pstrNetworkInfo, memcpy(last_scanned_shadow[ap_index].bssid, pstrNetworkInfo->bssid, ETH_ALEN); last_scanned_shadow[ap_index].beacon_period = pstrNetworkInfo->beacon_period; - last_scanned_shadow[ap_index].u8DtimPeriod = pstrNetworkInfo->u8DtimPeriod; + last_scanned_shadow[ap_index].dtim_period = pstrNetworkInfo->dtim_period; last_scanned_shadow[ap_index].u8channel = pstrNetworkInfo->u8channel; last_scanned_shadow[ap_index].u16IEsLen = pstrNetworkInfo->u16IEsLen; last_scanned_shadow[ap_index].u64Tsf = pstrNetworkInfo->u64Tsf; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH RESEND 51/70] staging: wilc1000: renames u16CapInfo of connect_resp_info structure
From: Leo KimThis patch renames u16CapInfo variable to cap_info. Signed-off-by: Leo Kim --- drivers/staging/wilc1000/coreconfigurator.c | 2 +- drivers/staging/wilc1000/coreconfigurator.h | 2 +- drivers/staging/wilc1000/host_interface.c | 2 +- drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 42 +-- 4 files changed, 35 insertions(+), 13 deletions(-) diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c index 1e8c56b..6c40d36 100644 --- a/drivers/staging/wilc1000/coreconfigurator.c +++ b/drivers/staging/wilc1000/coreconfigurator.c @@ -314,7 +314,7 @@ s32 wilc_parse_network_info(u8 *msg_buffer, msa = _val[1]; rx_len = wid_len - 1; - network_info->u16CapInfo = get_cap_info(msa); + network_info->cap_info = get_cap_info(msa); network_info->u32Tsf = get_beacon_timestamp_lo(msa); tsf_lo = get_beacon_timestamp_lo(msa); diff --git a/drivers/staging/wilc1000/coreconfigurator.h b/drivers/staging/wilc1000/coreconfigurator.h index e386e85..ace50d8 100644 --- a/drivers/staging/wilc1000/coreconfigurator.h +++ b/drivers/staging/wilc1000/coreconfigurator.h @@ -78,7 +78,7 @@ typedef struct { struct network_info { s8 rssi; - u16 u16CapInfo; + u16 cap_info; u8 au8ssid[MAX_SSID_LEN]; u8 u8SsidLen; u8 au8bssid[6]; diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index f40b5a7..d56a33c 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -4277,7 +4277,7 @@ static void *host_int_ParseJoinBssParam(struct network_info *ptstrNetworkInfo) if (pNewJoinBssParam) { pNewJoinBssParam->dtim_period = ptstrNetworkInfo->u8DtimPeriod; pNewJoinBssParam->beacon_period = ptstrNetworkInfo->u16BeaconPeriod; - pNewJoinBssParam->cap_info = ptstrNetworkInfo->u16CapInfo; + pNewJoinBssParam->cap_info = ptstrNetworkInfo->cap_info; memcpy(pNewJoinBssParam->au8bssid, ptstrNetworkInfo->au8bssid, 6); memcpy((u8 *)pNewJoinBssParam->ssid, ptstrNetworkInfo->au8ssid, ptstrNetworkInfo->u8SsidLen + 1); pNewJoinBssParam->ssid_len = ptstrNetworkInfo->u8SsidLen; diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c index f0c6c9f..578a3f2 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c @@ -246,9 +246,17 @@ static void refresh_scan(void *user_void, u8 all, bool direct_scan) rssi = get_rssi_avg(network_info); if (memcmp("DIRECT-", network_info->au8ssid, 7) || direct_scan) { - bss = cfg80211_inform_bss(wiphy, channel, CFG80211_BSS_FTYPE_UNKNOWN, network_info->au8bssid, network_info->u64Tsf, network_info->u16CapInfo, - network_info->u16BeaconPeriod, (const u8 *)network_info->pu8IEs, - (size_t)network_info->u16IEsLen, (((s32)rssi) * 100), GFP_KERNEL); + bss = cfg80211_inform_bss(wiphy, + channel, + CFG80211_BSS_FTYPE_UNKNOWN, + network_info->au8bssid, + network_info->u64Tsf, + network_info->cap_info, + network_info->u16BeaconPeriod, + (const u8 *)network_info->pu8IEs, + (size_t)network_info->u16IEsLen, + (s32)rssi * 100, + GFP_KERNEL); cfg80211_put_bss(wiphy, bss); } } @@ -358,7 +366,7 @@ static void add_network_to_shadow(struct network_info *pstrNetworkInfo, } last_scanned_shadow[ap_index].strRssi.u8Index = rssi_index; last_scanned_shadow[ap_index].rssi = pstrNetworkInfo->rssi; - last_scanned_shadow[ap_index].u16CapInfo = pstrNetworkInfo->u16CapInfo; + last_scanned_shadow[ap_index].cap_info = pstrNetworkInfo->cap_info; last_scanned_shadow[ap_index].u8SsidLen =
[PATCH RESEND 50/70] staging: wilc1000: renames s8rssi of connect_resp_info structure
From: Leo KimThis patch renames s8rssi variable to rssi. Signed-off-by: Leo Kim --- drivers/staging/wilc1000/coreconfigurator.c | 2 +- drivers/staging/wilc1000/coreconfigurator.h | 2 +- drivers/staging/wilc1000/host_interface.c | 6 +++--- drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 14 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c index 0d0a4ec..1e8c56b 100644 --- a/drivers/staging/wilc1000/coreconfigurator.c +++ b/drivers/staging/wilc1000/coreconfigurator.c @@ -309,7 +309,7 @@ s32 wilc_parse_network_info(u8 *msg_buffer, if (!network_info) return -ENOMEM; - network_info->s8rssi = wid_val[0]; + network_info->rssi = wid_val[0]; msa = _val[1]; diff --git a/drivers/staging/wilc1000/coreconfigurator.h b/drivers/staging/wilc1000/coreconfigurator.h index 214b43b..e386e85 100644 --- a/drivers/staging/wilc1000/coreconfigurator.h +++ b/drivers/staging/wilc1000/coreconfigurator.h @@ -77,7 +77,7 @@ typedef struct { } tstrRSSI; struct network_info { - s8 s8rssi; + s8 rssi; u16 u16CapInfo; u8 au8ssid[MAX_SSID_LEN]; u8 u8SsidLen; diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index c0b4f7b..f40b5a7 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -1368,10 +1368,10 @@ static s32 Handle_RcvdNtwrkInfo(struct wilc_vif *vif, (pstrNetworkInfo->au8bssid)) { if (memcmp(hif_drv->usr_scan_req.net_info[i].au8bssid, pstrNetworkInfo->au8bssid, 6) == 0) { - if (pstrNetworkInfo->s8rssi <= hif_drv->usr_scan_req.net_info[i].s8rssi) { + if (pstrNetworkInfo->rssi <= hif_drv->usr_scan_req.net_info[i].s8rssi) { goto done; } else { - hif_drv->usr_scan_req.net_info[i].s8rssi = pstrNetworkInfo->s8rssi; + hif_drv->usr_scan_req.net_info[i].s8rssi = pstrNetworkInfo->rssi; bNewNtwrkFound = false; break; } @@ -1381,7 +1381,7 @@ static s32 Handle_RcvdNtwrkInfo(struct wilc_vif *vif, if (bNewNtwrkFound) { if (hif_drv->usr_scan_req.rcvd_ch_cnt < MAX_NUM_SCANNED_NETWORKS) { - hif_drv->usr_scan_req.net_info[hif_drv->usr_scan_req.rcvd_ch_cnt].s8rssi = pstrNetworkInfo->s8rssi; + hif_drv->usr_scan_req.net_info[hif_drv->usr_scan_req.rcvd_ch_cnt].s8rssi = pstrNetworkInfo->rssi; if (hif_drv->usr_scan_req.net_info[hif_drv->usr_scan_req.rcvd_ch_cnt].au8bssid && pstrNetworkInfo->au8bssid) { diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c index b22a48a..f0c6c9f 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c @@ -351,13 +351,13 @@ static void add_network_to_shadow(struct network_info *pstrNetworkInfo, ap_index = ap_found; } rssi_index = last_scanned_shadow[ap_index].strRssi.u8Index; - last_scanned_shadow[ap_index].strRssi.as8RSSI[rssi_index++] = pstrNetworkInfo->s8rssi; + last_scanned_shadow[ap_index].strRssi.as8RSSI[rssi_index++] = pstrNetworkInfo->rssi; if (rssi_index == NUM_RSSI) { rssi_index = 0; last_scanned_shadow[ap_index].strRssi.u8Full = 1; } last_scanned_shadow[ap_index].strRssi.u8Index = rssi_index; - last_scanned_shadow[ap_index].s8rssi = pstrNetworkInfo->s8rssi; + last_scanned_shadow[ap_index].rssi = pstrNetworkInfo->rssi; last_scanned_shadow[ap_index].u16CapInfo = pstrNetworkInfo->u16CapInfo; last_scanned_shadow[ap_index].u8SsidLen = pstrNetworkInfo->u8SsidLen; memcpy(last_scanned_shadow[ap_index].au8ssid, @@ -403,8 +403,8 @@ static void CfgScanResult(enum scan_event scan_event, return; if (wiphy->signal_type == CFG80211_SIGNAL_TYPE_UNSPEC && - (((s32)network_info->s8rssi * 100) < 0 || - ((s32)network_info->s8rssi * 100) > 100)) + (((s32)network_info->rssi * 100) < 0 || + ((s32)network_info->rssi * 100) > 100))
[PATCH RESEND 53/70] staging: wilc1000: renames u8SsidLen of connect_resp_info structure
From: Leo KimThis patch renames u8SsidLen variable to ssid_len. Signed-off-by: Leo Kim --- drivers/staging/wilc1000/coreconfigurator.c | 2 +- drivers/staging/wilc1000/coreconfigurator.h | 2 +- drivers/staging/wilc1000/host_interface.c | 4 ++-- drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c index 4dd7c8a..273fad9 100644 --- a/drivers/staging/wilc1000/coreconfigurator.c +++ b/drivers/staging/wilc1000/coreconfigurator.c @@ -322,7 +322,7 @@ s32 wilc_parse_network_info(u8 *msg_buffer, network_info->u64Tsf = tsf_lo | ((u64)tsf_hi << 32); - get_ssid(msa, network_info->ssid, _info->u8SsidLen); + get_ssid(msa, network_info->ssid, _info->ssid_len); get_BSSID(msa, network_info->au8bssid); network_info->u8channel = get_current_channel_802_11n(msa, diff --git a/drivers/staging/wilc1000/coreconfigurator.h b/drivers/staging/wilc1000/coreconfigurator.h index 781a65f..39f3691 100644 --- a/drivers/staging/wilc1000/coreconfigurator.h +++ b/drivers/staging/wilc1000/coreconfigurator.h @@ -80,7 +80,7 @@ struct network_info { s8 rssi; u16 cap_info; u8 ssid[MAX_SSID_LEN]; - u8 u8SsidLen; + u8 ssid_len; u8 au8bssid[6]; u16 u16BeaconPeriod; u8 u8DtimPeriod; diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index c31f0b5..f9a8a44 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -4280,8 +4280,8 @@ static void *host_int_ParseJoinBssParam(struct network_info *ptstrNetworkInfo) pNewJoinBssParam->cap_info = ptstrNetworkInfo->cap_info; memcpy(pNewJoinBssParam->au8bssid, ptstrNetworkInfo->au8bssid, 6); memcpy((u8 *)pNewJoinBssParam->ssid, ptstrNetworkInfo->ssid, - ptstrNetworkInfo->u8SsidLen + 1); - pNewJoinBssParam->ssid_len = ptstrNetworkInfo->u8SsidLen; + ptstrNetworkInfo->ssid_len + 1); + pNewJoinBssParam->ssid_len = ptstrNetworkInfo->ssid_len; memset(pNewJoinBssParam->rsn_pcip_policy, 0xFF, 3); memset(pNewJoinBssParam->rsn_auth_policy, 0xFF, 3); diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c index 9aae11e..9819d14 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c @@ -368,9 +368,9 @@ static void add_network_to_shadow(struct network_info *pstrNetworkInfo, last_scanned_shadow[ap_index].strRssi.u8Index = rssi_index; last_scanned_shadow[ap_index].rssi = pstrNetworkInfo->rssi; last_scanned_shadow[ap_index].cap_info = pstrNetworkInfo->cap_info; - last_scanned_shadow[ap_index].u8SsidLen = pstrNetworkInfo->u8SsidLen; + last_scanned_shadow[ap_index].ssid_len = pstrNetworkInfo->ssid_len; memcpy(last_scanned_shadow[ap_index].ssid, - pstrNetworkInfo->ssid, pstrNetworkInfo->u8SsidLen); + pstrNetworkInfo->ssid, pstrNetworkInfo->ssid_len); memcpy(last_scanned_shadow[ap_index].au8bssid, pstrNetworkInfo->au8bssid, ETH_ALEN); last_scanned_shadow[ap_index].u16BeaconPeriod = pstrNetworkInfo->u16BeaconPeriod; @@ -738,7 +738,7 @@ static int connect(struct wiphy *wiphy, struct net_device *dev, PRINT_INFO(CFG80211_DBG, "Required SSID = %s\n , AuthType = %d\n", sme->ssid, sme->auth_type); for (i = 0; i < last_scanned_cnt; i++) { - if ((sme->ssid_len == last_scanned_shadow[i].u8SsidLen) && + if ((sme->ssid_len == last_scanned_shadow[i].ssid_len) && memcmp(last_scanned_shadow[i].ssid, sme->ssid, sme->ssid_len) == 0) { -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH RESEND 54/70] staging: wilc1000: renames au8bssid of connect_resp_info structure
From: Leo KimThis patch renames au8bssid variable to bssid. Signed-off-by: Leo Kim --- drivers/staging/wilc1000/coreconfigurator.c | 2 +- drivers/staging/wilc1000/coreconfigurator.h | 2 +- drivers/staging/wilc1000/host_interface.c | 10 +++ drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 34 --- 4 files changed, 25 insertions(+), 23 deletions(-) diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c index 273fad9..4a82576 100644 --- a/drivers/staging/wilc1000/coreconfigurator.c +++ b/drivers/staging/wilc1000/coreconfigurator.c @@ -323,7 +323,7 @@ s32 wilc_parse_network_info(u8 *msg_buffer, network_info->u64Tsf = tsf_lo | ((u64)tsf_hi << 32); get_ssid(msa, network_info->ssid, _info->ssid_len); - get_BSSID(msa, network_info->au8bssid); + get_BSSID(msa, network_info->bssid); network_info->u8channel = get_current_channel_802_11n(msa, rx_len + FCS_LEN); diff --git a/drivers/staging/wilc1000/coreconfigurator.h b/drivers/staging/wilc1000/coreconfigurator.h index 39f3691..5404162 100644 --- a/drivers/staging/wilc1000/coreconfigurator.h +++ b/drivers/staging/wilc1000/coreconfigurator.h @@ -81,7 +81,7 @@ struct network_info { u16 cap_info; u8 ssid[MAX_SSID_LEN]; u8 ssid_len; - u8 au8bssid[6]; + u8 bssid[6]; u16 u16BeaconPeriod; u8 u8DtimPeriod; u8 u8channel; diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index f9a8a44..2534c9a 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -1365,9 +1365,9 @@ static s32 Handle_RcvdNtwrkInfo(struct wilc_vif *vif, for (i = 0; i < hif_drv->usr_scan_req.rcvd_ch_cnt; i++) { if ((hif_drv->usr_scan_req.net_info[i].au8bssid) && - (pstrNetworkInfo->au8bssid)) { + (pstrNetworkInfo->bssid)) { if (memcmp(hif_drv->usr_scan_req.net_info[i].au8bssid, - pstrNetworkInfo->au8bssid, 6) == 0) { + pstrNetworkInfo->bssid, 6) == 0) { if (pstrNetworkInfo->rssi <= hif_drv->usr_scan_req.net_info[i].s8rssi) { goto done; } else { @@ -1384,9 +1384,9 @@ static s32 Handle_RcvdNtwrkInfo(struct wilc_vif *vif, hif_drv->usr_scan_req.net_info[hif_drv->usr_scan_req.rcvd_ch_cnt].s8rssi = pstrNetworkInfo->rssi; if (hif_drv->usr_scan_req.net_info[hif_drv->usr_scan_req.rcvd_ch_cnt].au8bssid && - pstrNetworkInfo->au8bssid) { + pstrNetworkInfo->bssid) { memcpy(hif_drv->usr_scan_req.net_info[hif_drv->usr_scan_req.rcvd_ch_cnt].au8bssid, - pstrNetworkInfo->au8bssid, 6); + pstrNetworkInfo->bssid, 6); hif_drv->usr_scan_req.rcvd_ch_cnt++; @@ -4278,7 +4278,7 @@ static void *host_int_ParseJoinBssParam(struct network_info *ptstrNetworkInfo) pNewJoinBssParam->dtim_period = ptstrNetworkInfo->u8DtimPeriod; pNewJoinBssParam->beacon_period = ptstrNetworkInfo->u16BeaconPeriod; pNewJoinBssParam->cap_info = ptstrNetworkInfo->cap_info; - memcpy(pNewJoinBssParam->au8bssid, ptstrNetworkInfo->au8bssid, 6); + memcpy(pNewJoinBssParam->au8bssid, ptstrNetworkInfo->bssid, 6); memcpy((u8 *)pNewJoinBssParam->ssid, ptstrNetworkInfo->ssid, ptstrNetworkInfo->ssid_len + 1); pNewJoinBssParam->ssid_len = ptstrNetworkInfo->ssid_len; diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c index 9819d14..80f46d7 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c @@ -249,7 +249,7 @@ static void refresh_scan(void *user_void, u8 all, bool direct_scan) bss = cfg80211_inform_bss(wiphy, channel, CFG80211_BSS_FTYPE_UNKNOWN, - network_info->au8bssid, + network_info->bssid,
[PATCH RESEND 59/70] staging: wilc1000: renames bNewNetwork of connect_resp_info structure
From: Leo KimThis patch renames bNewNetwork variable to new_network. Signed-off-by: Leo Kim --- drivers/staging/wilc1000/coreconfigurator.h | 2 +- drivers/staging/wilc1000/host_interface.c | 4 ++-- drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/wilc1000/coreconfigurator.h b/drivers/staging/wilc1000/coreconfigurator.h index 0e10c75..fd3b5d4 100644 --- a/drivers/staging/wilc1000/coreconfigurator.h +++ b/drivers/staging/wilc1000/coreconfigurator.h @@ -87,7 +87,7 @@ struct network_info { u8 ch; unsigned long time_scan_cached; unsigned long time_scan; - bool bNewNetwork; + bool new_network; u8 u8Found; u32 u32Tsf; u8 *pu8IEs; diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index df33197..c0171f9 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -1390,7 +1390,7 @@ static s32 Handle_RcvdNtwrkInfo(struct wilc_vif *vif, hif_drv->usr_scan_req.rcvd_ch_cnt++; - pstrNetworkInfo->bNewNetwork = true; + pstrNetworkInfo->new_network = true; pJoinParams = host_int_ParseJoinBssParam(pstrNetworkInfo); hif_drv->usr_scan_req.scan_result(SCAN_EVENT_NETWORK_FOUND, pstrNetworkInfo, @@ -1399,7 +1399,7 @@ static s32 Handle_RcvdNtwrkInfo(struct wilc_vif *vif, } } } else { - pstrNetworkInfo->bNewNetwork = false; + pstrNetworkInfo->new_network = false; hif_drv->usr_scan_req.scan_result(SCAN_EVENT_NETWORK_FOUND, pstrNetworkInfo, hif_drv->usr_scan_req.arg, NULL); } diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c index 44d1855..ab3390c 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c @@ -434,7 +434,7 @@ static void CfgScanResult(enum scan_event scan_event, network_info->cap_info, network_info->beacon_period); - if (network_info->bNewNetwork) { + if (network_info->new_network) { if (priv->u32RcvdChCount < MAX_NUM_SCANNED_NETWORKS) { PRINT_D(CFG80211_DBG, "Network %s found\n", -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH RESEND 58/70] staging: wilc1000: renames struct connect_resp_info variables
From: Leo KimThis patch renames to avoid camelcase changes follow are: - u32TimeRcvdInScanCached to time_scan_cached - u32TimeRcvdInScan to time_scan Signed-off-by: Leo Kim --- drivers/staging/wilc1000/coreconfigurator.h | 4 ++-- drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 15 --- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/drivers/staging/wilc1000/coreconfigurator.h b/drivers/staging/wilc1000/coreconfigurator.h index 2f030a9..0e10c75 100644 --- a/drivers/staging/wilc1000/coreconfigurator.h +++ b/drivers/staging/wilc1000/coreconfigurator.h @@ -85,8 +85,8 @@ struct network_info { u16 beacon_period; u8 dtim_period; u8 ch; - unsigned long u32TimeRcvdInScanCached; - unsigned long u32TimeRcvdInScan; + unsigned long time_scan_cached; + unsigned long time_scan; bool bNewNetwork; u8 u8Found; u32 u32Tsf; diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c index 362fe1b..44d1855 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c @@ -277,7 +277,7 @@ static void update_scan_time(void) int i; for (i = 0; i < last_scanned_cnt; i++) - last_scanned_shadow[i].u32TimeRcvdInScan = jiffies; + last_scanned_shadow[i].time_scan = jiffies; } static void remove_network_from_shadow(unsigned long arg) @@ -287,7 +287,8 @@ static void remove_network_from_shadow(unsigned long arg) for (i = 0; i < last_scanned_cnt; i++) { - if (time_after(now, last_scanned_shadow[i].u32TimeRcvdInScan + (unsigned long)(SCAN_RESULT_EXPIRE))) { + if (time_after(now, last_scanned_shadow[i].time_scan + + (unsigned long)(SCAN_RESULT_EXPIRE))) { PRINT_D(CFG80211_DBG, "Network expired ScanShadow:%s\n", last_scanned_shadow[i].ssid); @@ -384,8 +385,8 @@ static void add_network_to_shadow(struct network_info *pstrNetworkInfo, kmalloc(pstrNetworkInfo->u16IEsLen, GFP_KERNEL); memcpy(last_scanned_shadow[ap_index].pu8IEs, pstrNetworkInfo->pu8IEs, pstrNetworkInfo->u16IEsLen); - last_scanned_shadow[ap_index].u32TimeRcvdInScan = jiffies; - last_scanned_shadow[ap_index].u32TimeRcvdInScanCached = jiffies; + last_scanned_shadow[ap_index].time_scan = jiffies; + last_scanned_shadow[ap_index].time_scan_cached = jiffies; last_scanned_shadow[ap_index].u8Found = 1; if (ap_found != -1) kfree(last_scanned_shadow[ap_index].pJoinParams); @@ -465,7 +466,7 @@ static void CfgScanResult(enum scan_event scan_event, PRINT_D(CFG80211_DBG, "Update RSSI of %s\n", last_scanned_shadow[i].ssid); last_scanned_shadow[i].rssi = network_info->rssi; - last_scanned_shadow[i].u32TimeRcvdInScan = jiffies; + last_scanned_shadow[i].time_scan = jiffies; break; } } @@ -566,9 +567,9 @@ static void CfgConnectResult(enum conn_event enuConnDisconnEvent, unsigned long now = jiffies; if (time_after(now, - last_scanned_shadow[i].u32TimeRcvdInScanCached + (unsigned long)(nl80211_SCAN_RESULT_EXPIRE - (1 * HZ { + last_scanned_shadow[i].time_scan_cached + + (unsigned long)(nl80211_SCAN_RESULT_EXPIRE - (1 * HZ bNeedScanRefresh = true; - } break; } -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH RESEND 57/70] staging: wilc1000: renames u8channel of connect_resp_info structure
From: Leo KimThis patch renames u8channel variable to ch. Signed-off-by: Leo Kim --- drivers/staging/wilc1000/coreconfigurator.c | 2 +- drivers/staging/wilc1000/coreconfigurator.h | 2 +- drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 14 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c index ce3bc29..6c748aa 100644 --- a/drivers/staging/wilc1000/coreconfigurator.c +++ b/drivers/staging/wilc1000/coreconfigurator.c @@ -325,7 +325,7 @@ s32 wilc_parse_network_info(u8 *msg_buffer, get_ssid(msa, network_info->ssid, _info->ssid_len); get_BSSID(msa, network_info->bssid); - network_info->u8channel = get_current_channel_802_11n(msa, + network_info->ch = get_current_channel_802_11n(msa, rx_len + FCS_LEN); index = MAC_HDR_LEN + TIME_STAMP_LEN; diff --git a/drivers/staging/wilc1000/coreconfigurator.h b/drivers/staging/wilc1000/coreconfigurator.h index bbc4b0e..2f030a9 100644 --- a/drivers/staging/wilc1000/coreconfigurator.h +++ b/drivers/staging/wilc1000/coreconfigurator.h @@ -84,7 +84,7 @@ struct network_info { u8 bssid[6]; u16 beacon_period; u8 dtim_period; - u8 u8channel; + u8 ch; unsigned long u32TimeRcvdInScanCached; unsigned long u32TimeRcvdInScan; bool bNewNetwork; diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c index 16b2798..362fe1b 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c @@ -240,7 +240,7 @@ static void refresh_scan(void *user_void, u8 all, bool direct_scan) struct ieee80211_channel *channel; if (network_info) { - freq = ieee80211_channel_to_frequency((s32)network_info->u8channel, IEEE80211_BAND_2GHZ); + freq = ieee80211_channel_to_frequency((s32)network_info->ch, IEEE80211_BAND_2GHZ); channel = ieee80211_get_channel(wiphy, freq); rssi = get_rssi_avg(network_info); @@ -375,7 +375,7 @@ static void add_network_to_shadow(struct network_info *pstrNetworkInfo, pstrNetworkInfo->bssid, ETH_ALEN); last_scanned_shadow[ap_index].beacon_period = pstrNetworkInfo->beacon_period; last_scanned_shadow[ap_index].dtim_period = pstrNetworkInfo->dtim_period; - last_scanned_shadow[ap_index].u8channel = pstrNetworkInfo->u8channel; + last_scanned_shadow[ap_index].ch = pstrNetworkInfo->ch; last_scanned_shadow[ap_index].u16IEsLen = pstrNetworkInfo->u16IEsLen; last_scanned_shadow[ap_index].u64Tsf = pstrNetworkInfo->u64Tsf; if (ap_found != -1) @@ -417,7 +417,7 @@ static void CfgScanResult(enum scan_event scan_event, return; if (network_info) { - s32Freq = ieee80211_channel_to_frequency((s32)network_info->u8channel, IEEE80211_BAND_2GHZ); + s32Freq = ieee80211_channel_to_frequency((s32)network_info->ch, IEEE80211_BAND_2GHZ); channel = ieee80211_get_channel(wiphy, s32Freq); if (!channel) @@ -895,15 +895,15 @@ static int connect(struct wiphy *wiphy, struct net_device *dev, } - PRINT_INFO(CFG80211_DBG, "Required Channel = %d\n", pstrNetworkInfo->u8channel); + PRINT_INFO(CFG80211_DBG, "Required Ch = %d\n", pstrNetworkInfo->ch); PRINT_INFO(CFG80211_DBG, "Group encryption value = %s\n Cipher Group = %s\n WPA version = %s\n", pcgroup_encrypt_val, pccipher_group, pcwpa_version); - curr_channel = pstrNetworkInfo->u8channel; + curr_channel = pstrNetworkInfo->ch; if (!pstrWFIDrv->p2p_connect) - wlan_channel = pstrNetworkInfo->u8channel; + wlan_channel = pstrNetworkInfo->ch; wilc_wlan_set_bssid(dev, pstrNetworkInfo->bssid, STATION_MODE); @@ -911,7 +911,7 @@ static int connect(struct wiphy *wiphy, struct net_device *dev, sme->ssid_len, sme->ie, sme->ie_len, CfgConnectResult, (void *)priv, u8security, tenuAuth_type, -pstrNetworkInfo->u8channel, +pstrNetworkInfo->ch, pstrNetworkInfo->pJoinParams); if (s32Error != 0) { netdev_err(dev, "wilc_set_join_req(): Error\n"); -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe
[PATCH RESEND 66/70] staging: wilc1000: remove unnecessary wilc_rx_complete function
From: Chris ParkThis patch remove unnecessary wilc_rx_complete function because this function only print unused log message. remove unused has_packet variable nomore. Signed-off-by: Chris Park Signed-off-by: Leo Kim --- drivers/staging/wilc1000/linux_wlan.c | 5 - drivers/staging/wilc1000/wilc_wfi_netdevice.h | 1 - drivers/staging/wilc1000/wilc_wlan.c | 7 +-- 3 files changed, 1 insertion(+), 12 deletions(-) diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c index 202be15..e702020 100644 --- a/drivers/staging/wilc1000/linux_wlan.c +++ b/drivers/staging/wilc1000/linux_wlan.c @@ -372,11 +372,6 @@ static int linux_wlan_txq_task(void *vp) return 0; } -void wilc_rx_complete(struct wilc *nic) -{ - PRINT_D(RX_DBG, "RX completed\n"); -} - int wilc_wlan_get_firmware(struct net_device *dev) { struct wilc_vif *vif; diff --git a/drivers/staging/wilc1000/wilc_wfi_netdevice.h b/drivers/staging/wilc1000/wilc_wfi_netdevice.h index 07a4ff1..3077f5d4 100644 --- a/drivers/staging/wilc1000/wilc_wfi_netdevice.h +++ b/drivers/staging/wilc1000/wilc_wfi_netdevice.h @@ -228,7 +228,6 @@ int wilc1000_wlan_init(struct net_device *dev, struct wilc_vif *vif); void wilc_frmw_to_linux(struct wilc *wilc, u8 *buff, u32 size, u32 pkt_offset); void wilc_mac_indicate(struct wilc *wilc, int flag); -void wilc_rx_complete(struct wilc *wilc); void wilc_dbg(u8 *buff); int wilc_lock_timeout(struct wilc *wilc, void *, u32 timeout); diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index d7f14a9..8cb1ef6 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -811,7 +811,7 @@ _end_: static void wilc_wlan_handle_rxq(struct wilc *wilc) { - int offset = 0, size, has_packet = 0; + int offset = 0, size; u8 *buffer; struct rxq_entry_t *rqe; @@ -866,7 +866,6 @@ static void wilc_wlan_handle_rxq(struct wilc *wilc) [offset], pkt_len, pkt_offset); - has_packet = 1; } } else { struct wilc_cfg_rsp rsp; @@ -888,10 +887,6 @@ static void wilc_wlan_handle_rxq(struct wilc *wilc) break; } while (1); kfree(rqe); - - if (has_packet) - wilc_rx_complete(wilc); - } while (1); wilc->rxq_exit = 1; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH RESEND 61/70] staging: wilc1000: renames u32Tsf of connect_resp_info structure
From: Leo KimThis patch renames u32Tsf variable to tsf_lo. Signed-off-by: Leo Kim --- drivers/staging/wilc1000/coreconfigurator.c | 2 +- drivers/staging/wilc1000/coreconfigurator.h | 2 +- drivers/staging/wilc1000/host_interface.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c index 6c748aa..3e1e1f5 100644 --- a/drivers/staging/wilc1000/coreconfigurator.c +++ b/drivers/staging/wilc1000/coreconfigurator.c @@ -315,7 +315,7 @@ s32 wilc_parse_network_info(u8 *msg_buffer, rx_len = wid_len - 1; network_info->cap_info = get_cap_info(msa); - network_info->u32Tsf = get_beacon_timestamp_lo(msa); + network_info->tsf_lo = get_beacon_timestamp_lo(msa); tsf_lo = get_beacon_timestamp_lo(msa); tsf_hi = get_beacon_timestamp_hi(msa); diff --git a/drivers/staging/wilc1000/coreconfigurator.h b/drivers/staging/wilc1000/coreconfigurator.h index 27c35d7..07a2ef0 100644 --- a/drivers/staging/wilc1000/coreconfigurator.h +++ b/drivers/staging/wilc1000/coreconfigurator.h @@ -89,7 +89,7 @@ struct network_info { unsigned long time_scan; bool new_network; u8 found; - u32 u32Tsf; + u32 tsf_lo; u8 *pu8IEs; u16 u16IEsLen; void *pJoinParams; diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index c0171f9..fa6ee92 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -4330,7 +4330,7 @@ static void *host_int_ParseJoinBssParam(struct network_info *ptstrNetworkInfo) (pu8IEs[index + 5] == 0x09) && (pu8IEs[index + 6] == 0x0c)) { u16 u16P2P_count; - pNewJoinBssParam->tsf = ptstrNetworkInfo->u32Tsf; + pNewJoinBssParam->tsf = ptstrNetworkInfo->tsf_lo; pNewJoinBssParam->noa_enabled = 1; pNewJoinBssParam->idx = pu8IEs[index + 9]; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html