* Re: skb_under_panic in ath9k
From: Marc Kleine-Budde @ 2013-06-04 10:09 UTC (permalink / raw)
To: linux-wireless@vger.kernel.org, ath9k-devel
In-Reply-To: <519D405B.2080806@blackshift.org>
[-- Attachment #1: Type: text/plain, Size: 12261 bytes --]
On 05/23/2013 12:02 AM, Marc Kleine-Budde wrote:
> The system crashes repeatedly after about one week with the following
> oops:
>
> [633625.401875] skbuff: skb_under_panic: text:bf501028 len:128 put:8 head:d2788800 data:d27887fe tail:0xd278887e end:0xd2788f40 dev:wlan1
> [633625.414180] ------------[ cut here ]------------
> [633625.418909] kernel BUG at /build/buildd-linux_3.8.12-1-armel-7F6kBx/linux-3.8.12/net/core/skbuff.c:145!
> [633625.428430] Internal error: Oops - BUG: 0 [#1] ARM
> [633625.433322] Modules linked in:
> [...]
> [633625.583170] CPU: 0 Not tainted (3.8-1-kirkwood #1 Debian 3.8.12-1)
> [633625.589821] PC is at skb_push+0x6c/0x84
> [633625.593763] LR is at skb_push+0x6c/0x84
> [633625.597707] pc : [<c0282990>] lr : [<c0282990>] psr: 20000013
> [633625.597707] sp : c04c1d50 ip : 000008f8 fp : df04ea54
> [633625.609404] r10: 00000002 r9 : 00000008 r8 : df00dca8
> [633625.614734] r7 : 00000006 r6 : c04410a0 r5 : d278887e r4 : d2788800
> [633625.621378] r3 : c04d328c r2 : 20000093 r1 : 00000001 r0 : 00000079
> [633625.628015] Flags: nzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment kernel
> [633625.635443] Control: 0005317f Table: 1f224000 DAC: 00000017
> [633625.641295] Process swapper (pid: 0, stack limit = 0xc04c01b8)
> [633625.647241] Stack: (0xc04c1d50 to 0xc04c2000)
> [633625.657414] 1d40: 00000008 d2788800 d27887fe d278887e
> [633625.666101] 1d60: d2788f40 df04e000 df00dc00 df2e0c00 00000078 bf501028 df2e0c00 dfba3120
> [633625.675025] 1d80: d278882a df04e9a0 00000000 bf504110 dfb3ce20 00000201 00000000 00084502
> [633625.683954] 1da0: 00000001 df2e0c00 dfba3120 00000008 00000002 c04c1df4 00000000 00000001
> [633625.693553] 1dc0: 0000006a bf5058b0 00000000 c04c1df4 c04c1e30 dfba2300 c151ff18 df04e9a0
> [633625.702041] 1de0: c04c1e30 bf37560c 0000000c 00004288 c04c1e2c c151ff18 0000006a df2e0c00
> [633625.710540] 1e00: dfba2300 00000000 0000006a df04e462 00000000 00000001 60000013 bf375760
> [633625.718904] 1e20: 00000001 c14c19a0 c14c0460 00000000 c04c1e30 c04c1e30 00000000 dfba2300
> [633625.727374] 1e40: df04e460 c151fc00 de5af200 00000002 00000002 dfba2300 dfba2308 dfba28a8
> [633625.787263] 1e60: c04c1e7c dfba28ac df2e0c00 bf376d58 c0508ae0 00000000 0000012c 00000080
> [633625.798914] 1e80: 03c66eab c0508ae8 c04d4c68 c04d3494 00000000 00000000 00000006 00000100
> [633625.810249] 1ea0: c052b3a0 00000009 c052b3c0 c0026e2c 00000001 00000018 c04c0000 c0026644
> [633625.818620] 1ec0: c04d8f74 c1484260 1144b25a c04d8f74 00000000 00200000 c04c1f4c 00000013
> [633625.831230] 1ee0: 00000000 fed20200 c04c1f4c 00000000 56251311 c04d0420 00000000 c0026a2c
> [633625.842695] 1f00: 00002000 c000f28c c004e27c c0271318 20000013 c000df94 c04c1f60 60000013
> [633625.853824] 1f20: 000e32dc 0002404f b5def004 0002404f c04d0698 00000000 00000000 56251311
> [633625.864745] 1f40: c04d0420 00000000 00000003 c04c1f60 c004e27c c0271318 20000013 ffffffff
> [633625.875714] 1f60: b5ed22e0 0002404f 0084d405 00000000 00000000 c04d0698 00000000 c04d0698
> [633625.886646] 1f80: 00000000 c04d0420 004b8074 c0270e88 c04d0698 00000000 c050918c c0271014
> [633625.898317] 1fa0: c04c0000 c0509b28 c04cc1cc c096f0e0 00004000 c000f484 c04c8c20 00000000
> [633625.909787] 1fc0: c04b9650 c0498764 ffffffff ffffffff c0498284 00000000 00000000 c04b9650
> [633625.918159] 1fe0: 00000000 00053175 c04c8048 c04b964c c04cc1c4 00008040 00000000 00000000
> [633625.926557] [<c0282990>] (skb_push+0x6c/0x84) from [<bf501028>] (htc_issue_send.constprop.0+0x28/0x68 [ath9k_htc])
> [633625.937158] [<bf501028>] (htc_issue_send.constprop.0+0x28/0x68 [ath9k_htc]) from [<bf504110>] (ath9k_htc_tx_start+0x290/0x2a4 [ath9k_htc])
> [633625.949877] [<bf504110>] (ath9k_htc_tx_start+0x290/0x2a4 [ath9k_htc]) from [<bf5058b0>] (ath9k_htc_tx+0x98/0xcc [ath9k_htc])
> [633625.961458] [<bf5058b0>] (ath9k_htc_tx+0x98/0xcc [ath9k_htc]) from [<bf37560c>] (__ieee80211_tx+0x210/0x2a8 [mac80211])
> [633625.972695] [<bf37560c>] (__ieee80211_tx+0x210/0x2a8 [mac80211]) from [<bf375760>] (ieee80211_tx+0xbc/0xc4 [mac80211])
> [633625.983816] [<bf375760>] (ieee80211_tx+0xbc/0xc4 [mac80211]) from [<bf376d58>] (ieee80211_tx_pending+0xf0/0x194 [mac80211])
> [633625.995326] [<bf376d58>] (ieee80211_tx_pending+0xf0/0x194 [mac80211]) from [<c0026e2c>] (tasklet_action+0x84/0xcc)
> [633626.005905] [<c0026e2c>] (tasklet_action+0x84/0xcc) from [<c0026644>] (__do_softirq+0xdc/0x204)
> [633626.014750] [<c0026644>] (__do_softirq+0xdc/0x204) from [<c0026a2c>] (irq_exit+0x40/0x8c)
> [633626.023103] [<c0026a2c>] (irq_exit+0x40/0x8c) from [<c000f28c>] (handle_IRQ+0x64/0x84)
> [633626.031193] [<c000f28c>] (handle_IRQ+0x64/0x84) from [<c000df94>] (__irq_svc+0x34/0x78)
> [633626.039412] [<c000df94>] (__irq_svc+0x34/0x78) from [<c0271318>] (cpuidle_wrap_enter+0x54/0x9c)
> [633626.048331] [<c0271318>] (cpuidle_wrap_enter+0x54/0x9c) from [<c0270e88>] (cpuidle_enter_state+0x14/0x68)
> [633626.058162] [<c0270e88>] (cpuidle_enter_state+0x14/0x68) from [<c0271014>] (cpuidle_idle_call+0x138/0x25c)
> [633626.067998] [<c0271014>] (cpuidle_idle_call+0x138/0x25c) from [<c000f484>] (cpu_idle+0x68/0xc8)
> [633626.076852] [<c000f484>] (cpu_idle+0x68/0xc8) from [<c0498764>] (start_kernel+0x2b4/0x30c)
> [633626.146230] Code: e58dc014 e59f1014 e59f0014 eb0308b0 (e7f001f2)
> [633626.152520] ---[ end trace ee5dbceea3381e46 ]---
> [633626.157249] Kernel panic - not syncing: Fatal exception in interrupt
I got another crash with the same backtrace:
> [928701.926691] skbuff: skb_under_panic: text:bf3f0028 len:96 put:8 head:def9a600 data:def9a5fe tail:0xdef9a65e end:0xdef9a740 dev:wlan1
> [928701.938845] ------------[ cut here ]------------
> [928701.943572] kernel BUG at /build/buildd-linux_3.8.13-1-armel-0oa5Oc/linux-3.8.13/net/core/skbuff.c:145!
> [928701.953093] Internal error: Oops - BUG: 0 [#1] ARM
> [928701.957985] Modules linked in: sch_cbq rt2800usb rt2x00usb rt2800lib rt2x00lib crc_ccitt sit tunnel4 act_police cls_basic cls_flow cls_fw cls_u32 sch_fq
> _codel sch_tbf sch_prio sch_htb sch_hfsc sch_ingress sch_sfq nf_conntrack_sip xt_CHECKSUM ipt_rpfilter xt_statistic xt_CT xt_LOG xt_connlimit xt_realm xt_ad
> drtype xt_comment xt_recent xt_nat ipt_ULOG ipt_REJECT ipt_MASQUERADE ipt_ECN ipt_CLUSTERIP ipt_ah xt_set ip_set nf_nat_tftp nf_nat_snmp_basic nf_conntrack_
> snmp nf_nat_pptp nf_nat_proto_gre nf_nat_irc nf_nat_h323 nf_nat_ftp nf_nat_amanda ts_kmp nf_conntrack_amanda nf_conntrack_sane nf_conntrack_tftp nf_conntrac
> k_proto_sctp nf_conntrack_pptp nf_conntrack_proto_gre nf_conntrack_netlink nf_conntrack_netbios_ns nf_conntrack_broadcast nf_conntrack_irc nf_conntrack_h323
> nf_conntrack_ftp xt_TPROXY nf_defrag_ipv6 nf_tproxy_core xt_time xt_TCPMSS xt_tcpmss xt_sctp xt_policy xt_pkttype xt_physdev xt_owner xt_NFQUEUE xt_NFLOG n
> fnetlink_log xt_multiport xt_mark xt_mac xt_limit xt_length xt_iprange xt_helper xt_hashlimit xt_DSCP xt_dscp xt_dccp xt_conntrack xt_connmark xt_CLASSIFY x
> t_AUDIT xt_tcpudp xt_state iptable_raw iptable_nat nf_nat_ipv4 nf_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_conntrack iptable_mangle nfnetlink pppoe pppox ipt
> able_filter ip_tables x_tables fuse nfsd auth_rpcgss nfs_acl nfs lockd dns_resolver fscache sunrpc ppp_generic slhc 8021q garp tun bridge stp llc ext2 dm_cr
> ypt sg arc4 ath9k_htc ath9k_common ath9k_hw ath cp210x mac80211 mct_u232 hmac cfg80211 rfkill usbserial sha1_generic sd_mod crc_t10dif mv_cesa usb_storage u
> sbhid hid ext4 jbd2 mbcache dm_mod mmc_block ehci_hcd sata_mv libata mvsdio usbcore scsi_mod usb_common mmc_core mv643xx_eth inet_lro libphy
> [928702.107833] CPU: 0 Not tainted (3.8-2-kirkwood #1 Debian 3.8.13-1)
> [928702.114484] PC is at skb_push+0x6c/0x84
> [928702.118426] LR is at skb_push+0x6c/0x84
> [928702.122370] pc : [<c0282a7c>] lr : [<c0282a7c>] psr: 20000013
> [928702.122370] sp : c04c1da0 ip : 000008f8 fp : df057a54
> [928702.134068] r10: 00000002 r9 : 00000030 r8 : dfb7b0a8
> [928702.139397] r7 : 00000006 r6 : c04410a0 r5 : def9a65e r4 : def9a600
> [928702.146041] r3 : c04d328c r2 : 20000093 r1 : 00000001 r0 : 00000078
> [928702.152687] Flags: nzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment kernel
> [928702.160116] Control: 0005317f Table: 1e324000 DAC: 00000017
> [928702.165975] Process swapper (pid: 0, stack limit = 0xc04c01b8)
> [928702.171923] Stack: (0xc04c1da0 to 0xc04c2000)
> [928702.185802] 1da0: 00000008 def9a600 def9a5fe def9a65e def9a740 df057000 dfb7b000 dfa63800
> [928702.194801] 1dc0: 00000058 bf3f0028 dfa63800 dedf7120 def9a62a df0579a0 00000000 bf3f3110
> [928702.204372] 1de0: 1f904720 00000201 00000000 00300602 c0508880 dfa63800 dedf7120 00000030
> [928702.213017] 1e00: 00000002 c04c1e44 00000000 00000001 0000004a bf3f48b0 00000000 c04c1e44
> [928702.221498] 1e20: c04c1e7c dedf6300 de9d6b18 df0579a0 c04c1e7c bf31160c 0000000c 00004288
> [928702.229985] 1e40: 00000007 de9d6b18 00000003 00000002 dedf6300 dedf6308 dedf68a8 c04c1e7c
> [928702.238815] 1e60: dedf68ac dfa63800 20000013 bf312d9c 00000001 00000000 00000040 c04c1e7c
> [928702.247802] 1e80: c04c1e7c 00000000 ddeaa000 c04d3494 00000000 00000000 00000006 00000100
> [928702.257007] 1ea0: c052b140 00000009 c052b160 c0026e2c 00000001 00000018 c04c0000 c0026644
> [928702.266932] 1ec0: c04d8e74 c14a2360 1128d4b5 c04d8e74 00000000 00200000 c04c1f4c 00000013
> [928702.275727] 1ee0: 00000000 fed20200 c04c1f4c 00000000 56251311 c04d0420 00000000 c0026a2c
> [928702.285474] 1f00: 00002000 c000f28c c004e27c c0271404 20000013 c000df94 c04c1f60 60000013
> [928702.333352] 1f20: 000459bb 00034cb4 57c485a3 00034cb4 c04d0698 00000000 00000000 56251311
> [928702.345256] 1f40: c04d0420 00000000 00000003 c04c1f60 c004e27c c0271404 20000013 ffffffff
> [928702.357459] 1f60: 57c8df5e 00034cb4 0091cbfe 00000000 00000000 c04d0698 00000000 c04d0698
> [928702.365856] 1f80: 00000000 c04d0420 004b8074 c0270f74 c04d0698 00000000 c0508f2c c0271100
> [928702.378646] 1fa0: c04c0000 c05098c8 c04cc1cc c096f0e0 00004000 c000f484 c04c8c20 00000000
> [928702.390861] 1fc0: c04b9650 c0498764 ffffffff ffffffff c0498284 00000000 00000000 c04b9650
> [928702.402617] 1fe0: 00000000 00053175 c04c8048 c04b964c c04cc1c4 00008040 00000000 00000000
> [928702.411182] [<c0282a7c>] (skb_push+0x6c/0x84) from [<bf3f0028>] (htc_issue_send.constprop.0+0x28/0x68 [ath9k_htc])
> [928702.421866] [<bf3f0028>] (htc_issue_send.constprop.0+0x28/0x68 [ath9k_htc]) from [<bf3f3110>] (ath9k_htc_tx_start+0x290/0x2a4 [ath9k_htc])
> [928702.434567] [<bf3f3110>] (ath9k_htc_tx_start+0x290/0x2a4 [ath9k_htc]) from [<bf3f48b0>] (ath9k_htc_tx+0x98/0xcc [ath9k_htc])
> [928702.446402] [<bf3f48b0>] (ath9k_htc_tx+0x98/0xcc [ath9k_htc]) from [<bf31160c>] (__ieee80211_tx+0x210/0x2a8 [mac80211])
> [928702.457691] [<bf31160c>] (__ieee80211_tx+0x210/0x2a8 [mac80211]) from [<bf312d9c>] (ieee80211_tx_pending+0x134/0x194 [mac80211])
> [928702.469633] [<bf312d9c>] (ieee80211_tx_pending+0x134/0x194 [mac80211]) from [<c0026e2c>] (tasklet_action+0x84/0xcc)
> [928702.480285] [<c0026e2c>] (tasklet_action+0x84/0xcc) from [<c0026644>] (__do_softirq+0xdc/0x204)
> [928702.489167] [<c0026644>] (__do_softirq+0xdc/0x204) from [<c0026a2c>] (irq_exit+0x40/0x8c)
> [928702.497533] [<c0026a2c>] (irq_exit+0x40/0x8c) from [<c000f28c>] (handle_IRQ+0x64/0x84)
> [928702.505610] [<c000f28c>] (handle_IRQ+0x64/0x84) from [<c000df94>] (__irq_svc+0x34/0x78)
> [928702.513766] [<c000df94>] (__irq_svc+0x34/0x78) from [<c0271404>] (cpuidle_wrap_enter+0x54/0x9c)
> [928702.522664] [<c0271404>] (cpuidle_wrap_enter+0x54/0x9c) from [<c0270f74>] (cpuidle_enter_state+0x14/0x68)
> [928702.532408] [<c0270f74>] (cpuidle_enter_state+0x14/0x68) from [<c0271100>] (cpuidle_idle_call+0x138/0x25c)
> [928702.542214] [<c0271100>] (cpuidle_idle_call+0x138/0x25c) from [<c000f484>] (cpu_idle+0x68/0xc8)
> [928702.551090] [<c000f484>] (cpu_idle+0x68/0xc8) from [<c0498764>] (start_kernel+0x2b4/0x30c)
> [928702.580308] Code: e58dc014 e59f1014 e59f0014 eb0308b0 (e7f001f2)
> [928702.586611] ---[ end trace 908fdc07dd882304 ]---
> [928702.591337] Kernel panic - not syncing: Fatal exception in interrupt
regards,
Marc
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 901 bytes --]
^ permalink raw reply
* RE: [PATCH v8] cfg80211: P2P find phase offload
From: Peer, Ilan @ 2013-06-04 10:07 UTC (permalink / raw)
To: Vladimir Kondratiev, Johannes Berg
Cc: linux-wireless@vger.kernel.org, Luis R . Rodriguez,
John W . Linville, Jouni Malinen
In-Reply-To: <1370328271-9523-2-git-send-email-qca_vkondrat@qca.qualcomm.com>
Hi Vladimir,
> /**
> + * struct cfg80211_p2p_find_params - parameters for P2P find
> + * @probe_ie: extra IE's for probe frames
> + * @probe_ie_len: length, bytes, of @probe_ie
> + * @probe_resp_ie: extra IE's for probe response frames
> + * @probe_resp_ie_len: length, bytes, of @probe_resp_ie
> + * Driver/firmware may add additional IE's as well as modify
> + * provided ones; typical IE's to be added are
> + * WLAN_EID_EXT_SUPP_RATES, WLAN_EID_DS_PARAMS,
> + * WLAN_EID_HT_CAPABILITY.
> + * @min_discoverable_interval: and
> + * @max_discoverable_interval: min/max for random multiplier of 100TU's
> + * for the listen state duration
> + * @n_channels: number of channels to operate on
> + * @channels: channels to operate on
> + */
> +struct cfg80211_p2p_find_params {
The parameters are missing the listen channel (which is needed to the listen phase).
> + const u8 *probe_ie;
> + size_t probe_ie_len;
> + const u8 *probe_resp_ie;
> + size_t probe_resp_ie_len;
> + u32 min_discoverable_interval;
> + u32 max_discoverable_interval;
I do not see a real value for the max/min_discoverable_interval. Is there a use case of specifying these limits and not using the default ones?
> +
> + int n_channels;
> + struct ieee80211_channel **channels;
> +};
> +
> +/**
> * struct cfg80211_ops - backend description for wireless configuration
> *
> * This struct is registered by fullmac card drivers and/or wireless stacks @@ -
> 2037,6 +2065,17 @@ struct cfg80211_update_ft_ies_params {
> * driver can take the most appropriate actions.
> * @crit_proto_stop: Indicates critical protocol no longer needs increased link
> * reliability. This operation can not fail.
> + *
> + * @start_p2p_find: start P2P find phase
> + * Parameters include IEs for probe/probe-resp frames;
> + * and channels to operate on.
> + * Parameters are not retained after call, driver need to copy data if
> + * it need it later.
> + * P2P find can't run concurrently with ROC or scan, and driver should
> + * check this.
It might be good to define the exact semantics of p2p_find with regards to ROC/Scan, i.e., when p2p_find is requested during ROC/scan, should the driver save the request and handle it when the other operation is done, or should it return EBUSY or something similar (and also what are the semantics when requesting ROC/scan while p2p_find is in progress).
>
> +static int nl80211_start_p2p_find(struct sk_buff *skb, struct genl_info
> +*info) {
> + struct cfg80211_registered_device *rdev = info->user_ptr[0];
> + struct wireless_dev *wdev = info->user_ptr[1];
> + struct wiphy *wiphy = &rdev->wiphy;
> + /*
> + * Defaults, as defined in the spec
> + * Ref: Wi-Fi Peer-to-Peer (P2P) Technical Specification v1.1
> + * Clause: 3.1.2.1.3 Find Phase
> + */
> + struct cfg80211_p2p_find_params params = {
> + .min_discoverable_interval = 1,
> + .max_discoverable_interval = 3,
> + };
> + struct nlattr *attr_freq = info-
> >attrs[NL80211_ATTR_SCAN_FREQUENCIES];
> + struct nlattr *attr;
> + int err, tmp, n_channels, i = 0;
> + struct ieee80211_channel **channels = NULL;
> +
> + if (wdev->iftype != NL80211_IFTYPE_P2P_DEVICE)
> + return -EOPNOTSUPP;
> +
> + if (!is_valid_ie_attr(info->attrs[NL80211_ATTR_IE]))
> + return -EINVAL;
> +
> + if (!is_valid_ie_attr(info->attrs[NL80211_ATTR_IE_PROBE_RESP]))
> + return -EINVAL;
> +
> + if (!rdev->ops->start_p2p_find || !rdev->ops->stop_p2p_find)
> + return -EOPNOTSUPP;
> +
> + if (rdev->scan_req)
> + return -EBUSY;
> +
> + if (attr_freq) {
> + n_channels = validate_scan_freqs(attr_freq);
> + if (!n_channels)
> + return -EINVAL;
> +
> + channels = kzalloc(n_channels * sizeof(*channels),
> GFP_KERNEL);
> + if (!channels)
> + return -ENOMEM;
> +
> + /* user specified, bail out if channel not found */
> + nla_for_each_nested(attr, attr_freq, tmp) {
> + struct ieee80211_channel *chan;
> +
> + chan = ieee80211_get_channel(wiphy,
> nla_get_u32(attr));
> +
> + if (!chan) {
> + err = -EINVAL;
> + goto out_free;
> + }
> +
> + /* ignore disabled channels */
> + if (chan->flags & IEEE80211_CHAN_DISABLED)
> + continue;
> +
> + params.channels[i] = chan;
> + i++;
> + }
> + if (!i) {
> + err = -EINVAL;
> + goto out_free;
> + }
> +
> + params.n_channels = i;
> + params.channels = channels;
> + }
> +
Do we need to set the default channels if the attribute is not set (or require that this attribute will be part of the command).
> + attr = info->attrs[NL80211_ATTR_IE];
> + if (attr) {
> + params.probe_ie_len = nla_len(attr);
> + params.probe_ie = nla_data(attr);
> + }
> +
> + attr = info->attrs[NL80211_ATTR_IE_PROBE_RESP];
> + if (attr) {
> + params.probe_resp_ie_len = nla_len(attr);
> + params.probe_resp_ie = nla_data(attr);
> + }
Is it valid to get Probe response IEs even if the driver did not report support for it?
Regards,
Ilan.
^ permalink raw reply
* Re: [PATCH RFC] Re: skb_under_panic in ath9k
From: Marc Kleine-Budde @ 2013-06-04 10:05 UTC (permalink / raw)
To: Oleksij Rempel; +Cc: linux-wireless@vger.kernel.org, ath9k-devel
In-Reply-To: <51A1C19F.6050604@rempel-privat.de>
[-- Attachment #1: Type: text/plain, Size: 7325 bytes --]
On 05/26/2013 10:02 AM, Oleksij Rempel wrote:
> Am 26.05.2013 08:20, schrieb Oleksij Rempel:
>> Am 24.05.2013 10:47, schrieb Marc Kleine-Budde:
>>> added ath9k-devel to Cc
>>>
>>> On 05/23/2013 12:02 AM, Marc Kleine-Budde wrote:
>>>> Hello,
>>>>
>>>> I'm on a kirkwood based armv5 system with an USB attached TP-Link
>>>> TL-WN821N - Atheros AR7010+AR9287, [1]. the wlan is running in AP mode
>>>> with hostapd-1.0. The kernel is v3.8.12 from debian (3.8-1-kirkwood #1
>>>> Debian 3.8.12-1).
>>>>
>>>> The system crashes repeatedly after about one week with the following
>>>> oops:
>>>>
>>>> [633625.401875] skbuff: skb_under_panic: text:bf501028 len:128 put:8
>>>> head:d2788800 data:d27887fe tail:0xd278887e end:0xd2788f40 dev:wlan1
>>>> [633625.414180] ------------[ cut here ]------------
>>>> [633625.418909] kernel BUG at
>>>> /build/buildd-linux_3.8.12-1-armel-7F6kBx/linux-3.8.12/net/core/skbuff.c:145!
>>>>
>>>>
>>>> [633625.428430] Internal error: Oops - BUG: 0 [#1] ARM
>>>> [633625.433322] Modules linked in:
>>>> [...]
>>>> [633625.583170] CPU: 0 Not tainted (3.8-1-kirkwood #1 Debian
>>>> 3.8.12-1)
>>>> [633625.589821] PC is at skb_push+0x6c/0x84
>>>> [633625.593763] LR is at skb_push+0x6c/0x84
>>>> [633625.597707] pc : [<c0282990>] lr : [<c0282990>] psr: 20000013
>>>> [633625.597707] sp : c04c1d50 ip : 000008f8 fp : df04ea54
>>>> [633625.609404] r10: 00000002 r9 : 00000008 r8 : df00dca8
>>>> [633625.614734] r7 : 00000006 r6 : c04410a0 r5 : d278887e r4 :
>>>> d2788800
>>>> [633625.621378] r3 : c04d328c r2 : 20000093 r1 : 00000001 r0 :
>>>> 00000079
>>>> [633625.628015] Flags: nzCv IRQs on FIQs on Mode SVC_32 ISA ARM
>>>> Segment kernel
>>>> [633625.635443] Control: 0005317f Table: 1f224000 DAC: 00000017
>>>> [633625.641295] Process swapper (pid: 0, stack limit = 0xc04c01b8)
>>>> [633625.647241] Stack: (0xc04c1d50 to 0xc04c2000)
>>>> [633625.657414] 1d40: 00000008
>>>> d2788800 d27887fe d278887e
>>>> [633625.666101] 1d60: d2788f40 df04e000 df00dc00 df2e0c00 00000078
>>>> bf501028 df2e0c00 dfba3120
>>>> [633625.675025] 1d80: d278882a df04e9a0 00000000 bf504110 dfb3ce20
>>>> 00000201 00000000 00084502
>>>> [633625.683954] 1da0: 00000001 df2e0c00 dfba3120 00000008 00000002
>>>> c04c1df4 00000000 00000001
>>>> [633625.693553] 1dc0: 0000006a bf5058b0 00000000 c04c1df4 c04c1e30
>>>> dfba2300 c151ff18 df04e9a0
>>>> [633625.702041] 1de0: c04c1e30 bf37560c 0000000c 00004288 c04c1e2c
>>>> c151ff18 0000006a df2e0c00
>>>> [633625.710540] 1e00: dfba2300 00000000 0000006a df04e462 00000000
>>>> 00000001 60000013 bf375760
>>>> [633625.718904] 1e20: 00000001 c14c19a0 c14c0460 00000000 c04c1e30
>>>> c04c1e30 00000000 dfba2300
>>>> [633625.727374] 1e40: df04e460 c151fc00 de5af200 00000002 00000002
>>>> dfba2300 dfba2308 dfba28a8
>>>> [633625.787263] 1e60: c04c1e7c dfba28ac df2e0c00 bf376d58 c0508ae0
>>>> 00000000 0000012c 00000080
>>>> [633625.798914] 1e80: 03c66eab c0508ae8 c04d4c68 c04d3494 00000000
>>>> 00000000 00000006 00000100
>>>> [633625.810249] 1ea0: c052b3a0 00000009 c052b3c0 c0026e2c 00000001
>>>> 00000018 c04c0000 c0026644
>>>> [633625.818620] 1ec0: c04d8f74 c1484260 1144b25a c04d8f74 00000000
>>>> 00200000 c04c1f4c 00000013
>>>> [633625.831230] 1ee0: 00000000 fed20200 c04c1f4c 00000000 56251311
>>>> c04d0420 00000000 c0026a2c
>>>> [633625.842695] 1f00: 00002000 c000f28c c004e27c c0271318 20000013
>>>> c000df94 c04c1f60 60000013
>>>> [633625.853824] 1f20: 000e32dc 0002404f b5def004 0002404f c04d0698
>>>> 00000000 00000000 56251311
>>>> [633625.864745] 1f40: c04d0420 00000000 00000003 c04c1f60 c004e27c
>>>> c0271318 20000013 ffffffff
>>>> [633625.875714] 1f60: b5ed22e0 0002404f 0084d405 00000000 00000000
>>>> c04d0698 00000000 c04d0698
>>>> [633625.886646] 1f80: 00000000 c04d0420 004b8074 c0270e88 c04d0698
>>>> 00000000 c050918c c0271014
>>>> [633625.898317] 1fa0: c04c0000 c0509b28 c04cc1cc c096f0e0 00004000
>>>> c000f484 c04c8c20 00000000
>>>> [633625.909787] 1fc0: c04b9650 c0498764 ffffffff ffffffff c0498284
>>>> 00000000 00000000 c04b9650
>>>> [633625.918159] 1fe0: 00000000 00053175 c04c8048 c04b964c c04cc1c4
>>>> 00008040 00000000 00000000
>>>> [633625.926557] [<c0282990>] (skb_push+0x6c/0x84) from [<bf501028>]
>>>> (htc_issue_send.constprop.0+0x28/0x68 [ath9k_htc])
>>>> [633625.937158] [<bf501028>] (htc_issue_send.constprop.0+0x28/0x68
>>>> [ath9k_htc]) from [<bf504110>] (ath9k_htc_tx_start+0x290/0x2a4
>>>> [ath9k_htc])
>>>> [633625.949877] [<bf504110>] (ath9k_htc_tx_start+0x290/0x2a4
>>>> [ath9k_htc]) from [<bf5058b0>] (ath9k_htc_tx+0x98/0xcc [ath9k_htc])
>>>> [633625.961458] [<bf5058b0>] (ath9k_htc_tx+0x98/0xcc [ath9k_htc])
>>>> from [<bf37560c>] (__ieee80211_tx+0x210/0x2a8 [mac80211])
>>>> [633625.972695] [<bf37560c>] (__ieee80211_tx+0x210/0x2a8 [mac80211])
>>>> from [<bf375760>] (ieee80211_tx+0xbc/0xc4 [mac80211])
>>>> [633625.983816] [<bf375760>] (ieee80211_tx+0xbc/0xc4 [mac80211]) from
>>>> [<bf376d58>] (ieee80211_tx_pending+0xf0/0x194 [mac80211])
>>>> [633625.995326] [<bf376d58>] (ieee80211_tx_pending+0xf0/0x194
>>>> [mac80211]) from [<c0026e2c>] (tasklet_action+0x84/0xcc)
>>>> [633626.005905] [<c0026e2c>] (tasklet_action+0x84/0xcc) from
>>>> [<c0026644>] (__do_softirq+0xdc/0x204)
>>>> [633626.014750] [<c0026644>] (__do_softirq+0xdc/0x204) from
>>>> [<c0026a2c>] (irq_exit+0x40/0x8c)
>>>> [633626.023103] [<c0026a2c>] (irq_exit+0x40/0x8c) from [<c000f28c>]
>>>> (handle_IRQ+0x64/0x84)
>>>> [633626.031193] [<c000f28c>] (handle_IRQ+0x64/0x84) from [<c000df94>]
>>>> (__irq_svc+0x34/0x78)
>>>> [633626.039412] [<c000df94>] (__irq_svc+0x34/0x78) from [<c0271318>]
>>>> (cpuidle_wrap_enter+0x54/0x9c)
>>>> [633626.048331] [<c0271318>] (cpuidle_wrap_enter+0x54/0x9c) from
>>>> [<c0270e88>] (cpuidle_enter_state+0x14/0x68)
>>>> [633626.058162] [<c0270e88>] (cpuidle_enter_state+0x14/0x68) from
>>>> [<c0271014>] (cpuidle_idle_call+0x138/0x25c)
>>>> [633626.067998] [<c0271014>] (cpuidle_idle_call+0x138/0x25c) from
>>>> [<c000f484>] (cpu_idle+0x68/0xc8)
>>>> [633626.076852] [<c000f484>] (cpu_idle+0x68/0xc8) from [<c0498764>]
>>>> (start_kernel+0x2b4/0x30c)
>>>> [633626.146230] Code: e58dc014 e59f1014 e59f0014 eb0308b0 (e7f001f2)
>>>> [633626.152520] ---[ end trace ee5dbceea3381e46 ]---
>>>> [633626.157249] Kernel panic - not syncing: Fatal exception in
>>>> interrupt
>>>>
>>>> Has the problem been fixed already? I can update the kernel to a recent
>>>> version if needed.
>>
>> this oops was generated by skb_push:
>> " skb_push() will decrement the 'skb->data' pointer by the specified
>> number of bytes. It will also increment 'skb->len' by that number of
>> bytes as well. The caller must make sure there is enough head room for
>> the push being performed. This condition is checked for by skb_push()
>> and an assertion failure will trigger if this rule is violated."
>>
>> hmm... theoretically driver should check the size of date before
>> skb_push, but i do not see that other driver do this check. Interesting
>> where this buffer was allocated.
>>
>
> In attachment is a patch. I hope it is proper fix. "Elders of the
> Internet" your comments :)
Ping, anyone interested to review this patch?
Marc
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 901 bytes --]
^ permalink raw reply
* Re: [PATCH v2 2/2] ath9k: implement support for .release_buffered_frames()
From: Felix Fietkau @ 2013-06-04 10:01 UTC (permalink / raw)
To: linux-wireless; +Cc: linville
In-Reply-To: <1370293129-24331-2-git-send-email-nbd@openwrt.org>
On 2013-06-03 10:58 PM, Felix Fietkau wrote:
> This adds support for PS-Poll and U-APSD driver-buffered frames (part of
> an aggregation session).
>
> Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Don't merge this just yet, found some issues that I need to fix first.
- Felix
^ permalink raw reply
* Re: I can't download "Intel(R) PRO/Wireless 2200BG Driver for Linux"
From: Julian Calaby @ 2013-06-04 9:55 UTC (permalink / raw)
To: Hyun-Su Lim; +Cc: linux-wireless
In-Reply-To: <CADaB71PpUQar24AN4PtpVwACFVq-=VsbOsqUahPW=eh4wdpjLA@mail.gmail.com>
Hi Hyunsu,
On Tue, Jun 4, 2013 at 4:56 PM, Hyun-Su Lim <hyunsu.lim2@gmail.com> wrote:
> Dear..
>
> I'm trying to find a driver of Intel(R) PRO/Wireless 2915ABG Network
> Connection to use wireless network in my old laptop with Fedora18.
> Very pleased to find Intel® PRO/Wireless 2200BG Driver for Linux and
> followed your webpage but failed to get download files.
> Because the download page didn't open at
> http://ipw2200.sourceforge.net/firmware.php?i_agree_to_the_license=yes&f=ipw2200-fw-3.1.tgz.
> I hope you can receive this e-mail and hope to get the driver which
> can only solve this network connection problem.
I believe that Fedora provides a package with this firmware in it, you
should install that.
Thanks,
--
Julian Calaby
Email: julian.calaby@gmail.com
Profile: http://www.google.com/profiles/julian.calaby/
.Plan: http://sites.google.com/site/juliancalaby/
^ permalink raw reply
* Re: [RESEND][PATCH 3/7] net, ipw2x00: remove redundant D0 power state set
From: Stanislav Yakovlev @ 2013-06-04 9:16 UTC (permalink / raw)
To: Yijing Wang
Cc: David S. Miller, linux-kernel, netdev, John W. Linville,
linux-wireless
In-Reply-To: <1370329674-8360-1-git-send-email-wangyijing@huawei.com>
Hi Yijing,
On 4 June 2013 00:07, Yijing Wang <wangyijing@huawei.com> wrote:
> Pci_enable_device() will set device power state to D0,
> so it's no need to do it again in ipw2100_pci_init_one().
>
> Signed-off-by: Yijing Wang <wangyijing@huawei.com>
> Cc: Stanislav Yakovlev <stas.yakovlev@gmail.com>
> Cc: "John W. Linville" <linville@tuxdriver.com>
> Cc: netdev@vger.kernel.org
> Cc: linux-wireless@vger.kernel.org
Looks fine, thanks.
Stanislav.
^ permalink raw reply
* [RESEND][PATCH 3/7] net, ipw2x00: remove redundant D0 power state set
From: Yijing Wang @ 2013-06-04 7:07 UTC (permalink / raw)
To: David S. Miller
Cc: linux-kernel, netdev, Yijing Wang, Stanislav Yakovlev,
John W. Linville, linux-wireless
Pci_enable_device() will set device power state to D0,
so it's no need to do it again in ipw2100_pci_init_one().
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Cc: Stanislav Yakovlev <stas.yakovlev@gmail.com>
Cc: "John W. Linville" <linville@tuxdriver.com>
Cc: netdev@vger.kernel.org
Cc: linux-wireless@vger.kernel.org
---
drivers/net/wireless/ipw2x00/ipw2100.c | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/ipw2x00/ipw2100.c b/drivers/net/wireless/ipw2x00/ipw2100.c
index 15920aa..f8ab193 100644
--- a/drivers/net/wireless/ipw2x00/ipw2100.c
+++ b/drivers/net/wireless/ipw2x00/ipw2100.c
@@ -6242,8 +6242,6 @@ static int ipw2100_pci_init_one(struct pci_dev *pci_dev,
if ((val & 0x0000ff00) != 0)
pci_write_config_dword(pci_dev, 0x40, val & 0xffff00ff);
- pci_set_power_state(pci_dev, PCI_D0);
-
if (!ipw2100_hw_is_adapter_in_system(dev)) {
printk(KERN_WARNING DRV_NAME
"Device not found via register read.\n");
--
1.7.1
^ permalink raw reply related
* [RESEND][PATCH] net: wireless: iwlegacy: fix build error for il_pm_ops
From: Yijing Wang @ 2013-06-04 7:07 UTC (permalink / raw)
To: David S. Miller
Cc: linux-kernel, netdev, Yijing Wang, Stanislaw Gruszka,
John W. Linville, linux-wireless, Jingoo Han
Fix build error for il_pm_ops if CONFIG_PM is set
but CONFIG_PM_SLEEP is not set.
ERROR: "il_pm_ops" [drivers/net/wireless/iwlegacy/iwl4965.ko] undefined!
ERROR: "il_pm_ops" [drivers/net/wireless/iwlegacy/iwl3945.ko] undefined!
make[1]: *** [__modpost] Error 1
make: *** [modules] Error 2
Acked-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Cc: Stanislaw Gruszka <sgruszka@redhat.com>
Cc: "John W. Linville" <linville@tuxdriver.com>
Cc: netdev@vger.kernel.org
Cc: linux-wireless@vger.kernel.org
Cc: Jingoo Han <jg1.han@samsung.com>
---
drivers/net/wireless/iwlegacy/common.h | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/iwlegacy/common.h b/drivers/net/wireless/iwlegacy/common.h
index f8246f2..4caaf52 100644
--- a/drivers/net/wireless/iwlegacy/common.h
+++ b/drivers/net/wireless/iwlegacy/common.h
@@ -1832,16 +1832,16 @@ u32 il_usecs_to_beacons(struct il_priv *il, u32 usec, u32 beacon_interval);
__le32 il_add_beacon_time(struct il_priv *il, u32 base, u32 addon,
u32 beacon_interval);
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
extern const struct dev_pm_ops il_pm_ops;
#define IL_LEGACY_PM_OPS (&il_pm_ops)
-#else /* !CONFIG_PM */
+#else /* !CONFIG_PM_SLEEP */
#define IL_LEGACY_PM_OPS NULL
-#endif /* !CONFIG_PM */
+#endif /* !CONFIG_PM_SLEEP */
/*****************************************************
* Error Handling Debugging
--
1.7.1
^ permalink raw reply related
* I can't download "Intel(R) PRO/Wireless 2200BG Driver for Linux"
From: Hyun-Su Lim @ 2013-06-04 6:56 UTC (permalink / raw)
To: linux-wireless
Dear..
I'm trying to find a driver of Intel(R) PRO/Wireless 2915ABG Network
Connection to use wireless network in my old laptop with Fedora18.
Very pleased to find Intel® PRO/Wireless 2200BG Driver for Linux and
followed your webpage but failed to get download files.
Because the download page didn't open at
http://ipw2200.sourceforge.net/firmware.php?i_agree_to_the_license=yes&f=ipw2200-fw-3.1.tgz.
I hope you can receive this e-mail and hope to get the driver which
can only solve this network connection problem.
Best Regards,
Hyunsu Lim
^ permalink raw reply
* Re: [PATCH v8] P2P find phase offload
From: Johannes Berg @ 2013-06-04 6:51 UTC (permalink / raw)
To: Vladimir Kondratiev
Cc: linux-wireless, Luis R . Rodriguez, John W . Linville,
Jouni Malinen
In-Reply-To: <1370328271-9523-1-git-send-email-qca_vkondrat@qca.qualcomm.com>
On Tue, 2013-06-04 at 09:44 +0300, Vladimir Kondratiev wrote:
> - Fix kerneldoc for start_p2p_find/stop_p2p_find (forgotten '@')
> - rebase
So you just took it from my wip branch? ;-)
I also fixed another small issue -- genlmsg_end() can't return <0. I'm
waiting for a colleague to take a quick look but then I'll put it onto
the master branch.
johannes
^ permalink raw reply
* [PATCH v8] cfg80211: P2P find phase offload
From: Vladimir Kondratiev @ 2013-06-04 6:44 UTC (permalink / raw)
To: Johannes Berg
Cc: Vladimir Kondratiev, linux-wireless, Luis R . Rodriguez,
John W . Linville, Jouni Malinen
In-Reply-To: <1370328271-9523-1-git-send-email-qca_vkondrat@qca.qualcomm.com>
Allow to implement P2P find phase in the driver/firmware.
Offload scheme designed as follows:
- Driver provide methods start_p2p_find and stop_p2p_find in the cfg80211_ops;
- Driver indicate firmware or driver responds to the probe requests by setting
feature NL80211_FEATURE_P2P_PROBE_RESP_OFFLOAD
- wpa_supplicant analyses methods supported to discover p2p offload support;
- wpa_supplicant analyses feature flags to discover p2p probe response
offload support;
to perform p2p scan, wpa_supplicant:
- perform legacy scan, through driver's cfg80211_ops 'scan' method
- configure rx management filter to get probe-request and probe-response frames
- start p2p find via driver's cfg80211_ops start_p2p_find method
- driver start p2p find with hardware and notify wpa_supplicant with
cfg80211_p2p_find_notify_start()
- driver/firmware toggle search/listen states. Received probe-request and
probe-response frames passed to the wpa_supplicant via cfg80211_rx_mgmt
- when wpa_supplicant wants to stop p2p find, it calls driver's
cfg80211_ops stop_p2p_find method. Alternatively, driver/firmware may decide
to stop p2p find. In all cases, driver notifies wpa_supplicant using
cfg80211_p2p_find_notify_end()
All driver to user space communication done through nl80211 layer.
Offloaded P2P find does not support variations like progressive scan.
Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
---
include/net/cfg80211.h | 65 ++++++++++++++++
include/uapi/linux/nl80211.h | 13 ++++
net/wireless/nl80211.c | 175 +++++++++++++++++++++++++++++++++++++++++++
net/wireless/rdev-ops.h | 19 +++++
net/wireless/trace.h | 42 +++++++++++
5 files changed, 314 insertions(+)
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 6dd1959..ae6f433 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -1799,6 +1799,34 @@ struct cfg80211_update_ft_ies_params {
};
/**
+ * struct cfg80211_p2p_find_params - parameters for P2P find
+ * @probe_ie: extra IE's for probe frames
+ * @probe_ie_len: length, bytes, of @probe_ie
+ * @probe_resp_ie: extra IE's for probe response frames
+ * @probe_resp_ie_len: length, bytes, of @probe_resp_ie
+ * Driver/firmware may add additional IE's as well as modify
+ * provided ones; typical IE's to be added are
+ * WLAN_EID_EXT_SUPP_RATES, WLAN_EID_DS_PARAMS,
+ * WLAN_EID_HT_CAPABILITY.
+ * @min_discoverable_interval: and
+ * @max_discoverable_interval: min/max for random multiplier of 100TU's
+ * for the listen state duration
+ * @n_channels: number of channels to operate on
+ * @channels: channels to operate on
+ */
+struct cfg80211_p2p_find_params {
+ const u8 *probe_ie;
+ size_t probe_ie_len;
+ const u8 *probe_resp_ie;
+ size_t probe_resp_ie_len;
+ u32 min_discoverable_interval;
+ u32 max_discoverable_interval;
+
+ int n_channels;
+ struct ieee80211_channel **channels;
+};
+
+/**
* struct cfg80211_ops - backend description for wireless configuration
*
* This struct is registered by fullmac card drivers and/or wireless stacks
@@ -2037,6 +2065,17 @@ struct cfg80211_update_ft_ies_params {
* driver can take the most appropriate actions.
* @crit_proto_stop: Indicates critical protocol no longer needs increased link
* reliability. This operation can not fail.
+ *
+ * @start_p2p_find: start P2P find phase
+ * Parameters include IEs for probe/probe-resp frames;
+ * and channels to operate on.
+ * Parameters are not retained after call, driver need to copy data if
+ * it need it later.
+ * P2P find can't run concurrently with ROC or scan, and driver should
+ * check this.
+ * @stop_p2p_find: stop P2P find phase
+ * After stopping p2p find, driver should call
+ * cfg80211_p2p_find_notify_end() to inform upper layers
*/
struct cfg80211_ops {
int (*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow);
@@ -2272,6 +2311,12 @@ struct cfg80211_ops {
u16 duration);
void (*crit_proto_stop)(struct wiphy *wiphy,
struct wireless_dev *wdev);
+
+ int (*start_p2p_find)(struct wiphy *wiphy,
+ struct wireless_dev *wdev,
+ struct cfg80211_p2p_find_params *params);
+ void (*stop_p2p_find)(struct wiphy *wiphy,
+ struct wireless_dev *wdev);
};
/*
@@ -4185,6 +4230,26 @@ void cfg80211_report_wowlan_wakeup(struct wireless_dev *wdev,
*/
void cfg80211_crit_proto_stopped(struct wireless_dev *wdev, gfp_t gfp);
+/**
+ * cfg80211_p2p_find_notify_start - report p2p find phase started
+ * @wdev: the wireless device reporting the event
+ * @gfp: allocation flags
+ */
+void cfg80211_p2p_find_notify_start(struct wireless_dev *wdev, gfp_t gfp);
+
+/**
+ * cfg80211_p2p_find_notify_end - report p2p find phase ended
+ * @wdev: the wireless device reporting the event
+ * @gfp: allocation flags
+ *
+ * p2p find phase may be ended either unsolicited or in response to
+ * ops->stop_p2p_find
+ *
+ * In any case, if @start_p2p_find from driver's struct cfg80211_ops called,
+ * @cfg80211_p2p_find_notify_end should be eventually called
+ */
+void cfg80211_p2p_find_notify_end(struct wireless_dev *wdev, gfp_t gfp);
+
/* Logging, debugging and troubleshooting/diagnostic helpers. */
/* wiphy_printk helpers, similar to dev_printk */
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index 5920715..57a22a2 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -810,6 +810,9 @@ enum nl80211_commands {
NL80211_CMD_CRIT_PROTOCOL_START,
NL80211_CMD_CRIT_PROTOCOL_STOP,
+ NL80211_CMD_START_P2P_FIND,
+ NL80211_CMD_STOP_P2P_FIND,
+
/* add new commands above here */
/* used to define NL80211_CMD_MAX below */
@@ -1436,6 +1439,10 @@ enum nl80211_commands {
* allowed to be used with the first @NL80211_CMD_SET_STATION command to
* update a TDLS peer STA entry.
*
+ * @NL80211_ATTR_MIN_DISCOVERABLE_INTERVAL:
+ * @NL80211_ATTR_MAX_DISCOVERABLE_INTERVAL: min/max discoverable interval
+ * for the p2p find, multiple of 100 TUs, represented as u32
+ *
* @NL80211_ATTR_MAX: highest attribute number currently defined
* @__NL80211_ATTR_AFTER_LAST: internal use
*/
@@ -1736,6 +1743,9 @@ enum nl80211_attrs {
NL80211_ATTR_PEER_AID,
+ NL80211_ATTR_MIN_DISCOVERABLE_INTERVAL,
+ NL80211_ATTR_MAX_DISCOVERABLE_INTERVAL,
+
/* add attributes here, update the policy in nl80211.c */
__NL80211_ATTR_AFTER_LAST,
@@ -3579,6 +3589,8 @@ enum nl80211_ap_sme_features {
* Peering Management entity which may be implemented by registering for
* beacons or NL80211_CMD_NEW_PEER_CANDIDATE events. The mesh beacon is
* still generated by the driver.
+ * @NL80211_FEATURE_P2P_PROBE_RESP_OFFLOAD: When in P2P find phase,
+ * the device responds to probe-requests in hardware.
*/
enum nl80211_feature_flags {
NL80211_FEATURE_SK_TX_STATUS = 1 << 0,
@@ -3599,6 +3611,7 @@ enum nl80211_feature_flags {
NL80211_FEATURE_FULL_AP_CLIENT_STATE = 1 << 15,
NL80211_FEATURE_USERSPACE_MPM = 1 << 16,
NL80211_FEATURE_ACTIVE_MONITOR = 1 << 17,
+ NL80211_FEATURE_P2P_PROBE_RESP_OFFLOAD = 1 << 18,
};
/**
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 31d265f..d68dfdd 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -349,6 +349,8 @@ static const struct nla_policy nl80211_policy[NL80211_ATTR_MAX+1] = {
[NL80211_ATTR_IE_RIC] = { .type = NLA_BINARY,
.len = IEEE80211_MAX_DATA_LEN },
[NL80211_ATTR_PEER_AID] = { .type = NLA_U16 },
+ [NL80211_ATTR_MIN_DISCOVERABLE_INTERVAL] = { .type = NLA_U32 },
+ [NL80211_ATTR_MAX_DISCOVERABLE_INTERVAL] = { .type = NLA_U32 },
};
/* policy for the key attributes */
@@ -1390,6 +1392,8 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *dev,
if (split) {
CMD(crit_proto_start, CRIT_PROTOCOL_START);
CMD(crit_proto_stop, CRIT_PROTOCOL_STOP);
+ CMD(start_p2p_find, START_P2P_FIND);
+ CMD(stop_p2p_find, STOP_P2P_FIND);
}
#ifdef CONFIG_NL80211_TESTMODE
@@ -8265,6 +8269,121 @@ static int nl80211_crit_protocol_stop(struct sk_buff *skb,
return 0;
}
+static int nl80211_start_p2p_find(struct sk_buff *skb, struct genl_info *info)
+{
+ struct cfg80211_registered_device *rdev = info->user_ptr[0];
+ struct wireless_dev *wdev = info->user_ptr[1];
+ struct wiphy *wiphy = &rdev->wiphy;
+ /*
+ * Defaults, as defined in the spec
+ * Ref: Wi-Fi Peer-to-Peer (P2P) Technical Specification v1.1
+ * Clause: 3.1.2.1.3 Find Phase
+ */
+ struct cfg80211_p2p_find_params params = {
+ .min_discoverable_interval = 1,
+ .max_discoverable_interval = 3,
+ };
+ struct nlattr *attr_freq = info->attrs[NL80211_ATTR_SCAN_FREQUENCIES];
+ struct nlattr *attr;
+ int err, tmp, n_channels, i = 0;
+ struct ieee80211_channel **channels = NULL;
+
+ if (wdev->iftype != NL80211_IFTYPE_P2P_DEVICE)
+ return -EOPNOTSUPP;
+
+ if (!is_valid_ie_attr(info->attrs[NL80211_ATTR_IE]))
+ return -EINVAL;
+
+ if (!is_valid_ie_attr(info->attrs[NL80211_ATTR_IE_PROBE_RESP]))
+ return -EINVAL;
+
+ if (!rdev->ops->start_p2p_find || !rdev->ops->stop_p2p_find)
+ return -EOPNOTSUPP;
+
+ if (rdev->scan_req)
+ return -EBUSY;
+
+ if (attr_freq) {
+ n_channels = validate_scan_freqs(attr_freq);
+ if (!n_channels)
+ return -EINVAL;
+
+ channels = kzalloc(n_channels * sizeof(*channels), GFP_KERNEL);
+ if (!channels)
+ return -ENOMEM;
+
+ /* user specified, bail out if channel not found */
+ nla_for_each_nested(attr, attr_freq, tmp) {
+ struct ieee80211_channel *chan;
+
+ chan = ieee80211_get_channel(wiphy, nla_get_u32(attr));
+
+ if (!chan) {
+ err = -EINVAL;
+ goto out_free;
+ }
+
+ /* ignore disabled channels */
+ if (chan->flags & IEEE80211_CHAN_DISABLED)
+ continue;
+
+ params.channels[i] = chan;
+ i++;
+ }
+ if (!i) {
+ err = -EINVAL;
+ goto out_free;
+ }
+
+ params.n_channels = i;
+ params.channels = channels;
+ }
+
+
+ attr = info->attrs[NL80211_ATTR_IE];
+ if (attr) {
+ params.probe_ie_len = nla_len(attr);
+ params.probe_ie = nla_data(attr);
+ }
+
+ attr = info->attrs[NL80211_ATTR_IE_PROBE_RESP];
+ if (attr) {
+ params.probe_resp_ie_len = nla_len(attr);
+ params.probe_resp_ie = nla_data(attr);
+ }
+
+ attr = info->attrs[NL80211_ATTR_MIN_DISCOVERABLE_INTERVAL];
+ if (attr)
+ params.min_discoverable_interval = nla_get_u32(attr);
+
+ attr = info->attrs[NL80211_ATTR_MAX_DISCOVERABLE_INTERVAL];
+ if (attr)
+ params.max_discoverable_interval = nla_get_u32(attr);
+
+ err = rdev_start_p2p_find(rdev, wdev, ¶ms);
+
+out_free:
+ kfree(channels);
+
+ return err;
+}
+
+static int nl80211_stop_p2p_find(struct sk_buff *skb, struct genl_info *info)
+{
+ struct cfg80211_registered_device *rdev = info->user_ptr[0];
+ struct wireless_dev *wdev = info->user_ptr[1];
+
+ if (wdev->iftype != NL80211_IFTYPE_P2P_DEVICE)
+ return -EOPNOTSUPP;
+
+ if (!rdev->ops->start_p2p_find || !rdev->ops->stop_p2p_find)
+ return -EOPNOTSUPP;
+
+ rdev_stop_p2p_find(rdev, wdev);
+
+ return 0;
+}
+
#define NL80211_FLAG_NEED_WIPHY 0x01
#define NL80211_FLAG_NEED_NETDEV 0x02
#define NL80211_FLAG_NEED_RTNL 0x04
@@ -8937,6 +9056,22 @@ static struct genl_ops nl80211_ops[] = {
NL80211_FLAG_NEED_RTNL,
},
{
+ .cmd = NL80211_CMD_START_P2P_FIND,
+ .doit = nl80211_start_p2p_find,
+ .policy = nl80211_policy,
+ .flags = GENL_ADMIN_PERM,
+ .internal_flags = NL80211_FLAG_NEED_WDEV_UP |
+ NL80211_FLAG_NEED_RTNL,
+ },
+ {
+ .cmd = NL80211_CMD_STOP_P2P_FIND,
+ .doit = nl80211_stop_p2p_find,
+ .policy = nl80211_policy,
+ .flags = GENL_ADMIN_PERM,
+ .internal_flags = NL80211_FLAG_NEED_WDEV_UP |
+ NL80211_FLAG_NEED_RTNL,
+ },
+ {
.cmd = NL80211_CMD_GET_PROTOCOL_FEATURES,
.doit = nl80211_get_protocol_features,
.policy = nl80211_policy,
@@ -10627,6 +10762,46 @@ void cfg80211_tdls_oper_request(struct net_device *dev, const u8 *peer,
}
EXPORT_SYMBOL(cfg80211_tdls_oper_request);
+static
+void cfg80211_p2p_find_notify(struct wireless_dev *wdev, int cmd, gfp_t gfp)
+{
+ struct wiphy *wiphy = wdev->wiphy;
+ struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
+ struct sk_buff *msg;
+ void *hdr;
+
+ trace_cfg80211_p2p_find_notify(wdev, cmd);
+ msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
+ if (!msg)
+ return;
+
+ hdr = nl80211hdr_put(msg, 0, 0, 0, cmd);
+ if (!hdr) {
+ nlmsg_free(msg);
+ return;
+ }
+
+ if (genlmsg_end(msg, hdr) < 0) {
+ nlmsg_free(msg);
+ return;
+ }
+
+ genlmsg_multicast_netns(wiphy_net(&rdev->wiphy), msg, 0,
+ nl80211_scan_mcgrp.id, GFP_KERNEL);
+}
+
+void cfg80211_p2p_find_notify_start(struct wireless_dev *wdev, gfp_t gfp)
+{
+ cfg80211_p2p_find_notify(wdev, NL80211_CMD_START_P2P_FIND, gfp);
+}
+EXPORT_SYMBOL(cfg80211_p2p_find_notify_start);
+
+void cfg80211_p2p_find_notify_end(struct wireless_dev *wdev, gfp_t gfp)
+{
+ cfg80211_p2p_find_notify(wdev, NL80211_CMD_STOP_P2P_FIND, gfp);
+}
+EXPORT_SYMBOL(cfg80211_p2p_find_notify_end);
+
static int nl80211_netlink_notify(struct notifier_block * nb,
unsigned long state,
void *_notify)
diff --git a/net/wireless/rdev-ops.h b/net/wireless/rdev-ops.h
index 9f15f0a..94ff98a 100644
--- a/net/wireless/rdev-ops.h
+++ b/net/wireless/rdev-ops.h
@@ -923,4 +923,23 @@ static inline void rdev_crit_proto_stop(struct cfg80211_registered_device *rdev,
trace_rdev_return_void(&rdev->wiphy);
}
+static inline int rdev_start_p2p_find(struct cfg80211_registered_device *rdev,
+ struct wireless_dev *wdev,
+ struct cfg80211_p2p_find_params *params)
+{
+ int ret;
+ trace_rdev_start_p2p_find(&rdev->wiphy, wdev, params);
+ ret = rdev->ops->start_p2p_find(&rdev->wiphy, wdev, params);
+ trace_rdev_return_int(&rdev->wiphy, ret);
+ return ret;
+}
+
+static inline void rdev_stop_p2p_find(struct cfg80211_registered_device *rdev,
+ struct wireless_dev *wdev)
+{
+ trace_rdev_stop_p2p_find(&rdev->wiphy, wdev);
+ rdev->ops->stop_p2p_find(&rdev->wiphy, wdev);
+ trace_rdev_return_void(&rdev->wiphy);
+}
+
#endif /* __CFG80211_RDEV_OPS */
diff --git a/net/wireless/trace.h b/net/wireless/trace.h
index 23fafea..9eb3dd7 100644
--- a/net/wireless/trace.h
+++ b/net/wireless/trace.h
@@ -1841,6 +1841,34 @@ TRACE_EVENT(rdev_crit_proto_stop,
WIPHY_PR_ARG, WDEV_PR_ARG)
);
+TRACE_EVENT(rdev_start_p2p_find,
+ TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev,
+ struct cfg80211_p2p_find_params *params),
+ TP_ARGS(wiphy, wdev, params),
+ TP_STRUCT__entry(
+ WIPHY_ENTRY
+ WDEV_ENTRY
+ __field(u32, min_di)
+ __field(u32, max_di)
+ __field(int, n_channels)
+ ),
+ TP_fast_assign(
+ WIPHY_ASSIGN;
+ WDEV_ASSIGN;
+ __entry->min_di = params->min_discoverable_interval;
+ __entry->max_di = params->max_discoverable_interval;
+ __entry->n_channels = params->n_channels;
+ ),
+ TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT ", disc. int. [%d..%d], n_channels %d",
+ WIPHY_PR_ARG, WDEV_PR_ARG, __entry->min_di, __entry->max_di,
+ __entry->n_channels)
+);
+
+DEFINE_EVENT(wiphy_wdev_evt, rdev_stop_p2p_find,
+ TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev),
+ TP_ARGS(wiphy, wdev)
+);
+
/*************************************************************
* cfg80211 exported functions traces *
*************************************************************/
@@ -2498,6 +2526,20 @@ TRACE_EVENT(cfg80211_ft_event,
WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(target_ap))
);
+TRACE_EVENT(cfg80211_p2p_find_notify,
+ TP_PROTO(struct wireless_dev *wdev, int cmd),
+ TP_ARGS(wdev, cmd),
+ TP_STRUCT__entry(
+ WDEV_ENTRY
+ __field(int, cmd)
+ ),
+ TP_fast_assign(
+ WDEV_ASSIGN;
+ __entry->cmd = cmd;
+ ),
+ TP_printk(WDEV_PR_FMT ", cmd: %d", WDEV_PR_ARG, __entry->cmd)
+);
+
#endif /* !__RDEV_OPS_TRACE || TRACE_HEADER_MULTI_READ */
#undef TRACE_INCLUDE_PATH
--
1.8.1.2
^ permalink raw reply related
* [PATCH v8] P2P find phase offload
From: Vladimir Kondratiev @ 2013-06-04 6:44 UTC (permalink / raw)
To: Johannes Berg
Cc: Vladimir Kondratiev, linux-wireless, Luis R . Rodriguez,
John W . Linville, Jouni Malinen
- Fix kerneldoc for start_p2p_find/stop_p2p_find (forgotten '@')
- rebase
Vladimir Kondratiev (1):
cfg80211: P2P find phase offload
include/net/cfg80211.h | 65 ++++++++++++++++
include/uapi/linux/nl80211.h | 13 ++++
net/wireless/nl80211.c | 175 +++++++++++++++++++++++++++++++++++++++++++
net/wireless/rdev-ops.h | 19 +++++
net/wireless/trace.h | 42 +++++++++++
5 files changed, 314 insertions(+)
--
1.8.1.2
^ permalink raw reply
* missing break statement when searching for section cmd
From: Peizhao Hu @ 2013-06-04 0:58 UTC (permalink / raw)
To: linux-wireless
[-- Attachment #1: Type: text/plain, Size: 24 bytes --]
--
regards;
Peizhao
[-- Attachment #2: iw.patch --]
[-- Type: text/x-patch, Size: 441 bytes --]
diff --git a/iw.c b/iw.c
index dc99566..4051a18 100644
--- a/iw.c
+++ b/iw.c
@@ -359,8 +359,10 @@ static int __handle_cmd(struct nl80211_state *state, enum id_input idby,
/* ok ... bit of a hack for the dupe 'info' section */
if (match && sectcmd->idby != command_idby)
continue;
- if (strcmp(sectcmd->name, section) == 0)
+ if (strcmp(sectcmd->name, section) == 0){
match = sectcmd;
+ break;
+ }
}
sectcmd = match;
^ permalink raw reply related
* [PATCH 2/2] mac80211: update mesh beacon on workqueue
From: Thomas Pedersen @ 2013-06-03 23:25 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless, open80211s, Thomas Pedersen
In-Reply-To: <1370301943-13867-1-git-send-email-thomas@cozybit.com>
Fixes yet another deadlock on calling sta_info_flush()
with the sdata_lock() held. Should make it easier to
reason about locking in the future, since the sdata_lock()
is now held on all mesh work.
Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
---
net/mac80211/ieee80211_i.h | 1 +
net/mac80211/mesh.c | 43 +++++++++++++++++++++++++++++++------------
net/mac80211/mesh.h | 2 ++
3 files changed, 34 insertions(+), 12 deletions(-)
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 9eed6f1..b4937fc 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -542,6 +542,7 @@ struct ieee80211_if_mesh {
struct timer_list mesh_path_root_timer;
unsigned long wrkq_flags;
+ unsigned long mbss_changed;
u8 mesh_id[IEEE80211_MAX_MESH_ID_LEN];
size_t mesh_id_len;
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c
index d5faf91..288aad2 100644
--- a/net/mac80211/mesh.c
+++ b/net/mac80211/mesh.c
@@ -161,11 +161,8 @@ void mesh_sta_cleanup(struct sta_info *sta)
del_timer_sync(&sta->plink_timer);
}
- if (changed) {
- sdata_lock(sdata);
+ if (changed)
ieee80211_mbss_info_change_notify(sdata, changed);
- sdata_unlock(sdata);
- }
}
int mesh_rmc_init(struct ieee80211_sub_if_data *sdata)
@@ -719,14 +716,15 @@ ieee80211_mesh_rebuild_beacon(struct ieee80211_sub_if_data *sdata)
void ieee80211_mbss_info_change_notify(struct ieee80211_sub_if_data *sdata,
u32 changed)
{
- if (sdata->vif.bss_conf.enable_beacon &&
- (changed & (BSS_CHANGED_BEACON |
- BSS_CHANGED_HT |
- BSS_CHANGED_BASIC_RATES |
- BSS_CHANGED_BEACON_INT)))
- if (ieee80211_mesh_rebuild_beacon(sdata))
- return;
- ieee80211_bss_info_change_notify(sdata, changed);
+ struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
+ u32 bit;
+
+ /* if we race with running work, worst case this work becomes a noop */
+ for_each_set_bit(bit, (unsigned long *)&changed,
+ sizeof(changed) * BITS_PER_BYTE)
+ set_bit(BIT(bit), &ifmsh->mbss_changed);
+ set_bit(MESH_WORK_MBSS_CHANGED, &ifmsh->wrkq_flags);
+ ieee80211_queue_work(&sdata->local->hw, &sdata->work);
}
int ieee80211_start_mesh(struct ieee80211_sub_if_data *sdata)
@@ -969,6 +967,25 @@ out:
sdata_unlock(sdata);
}
+static void mesh_bss_info_changed(struct ieee80211_sub_if_data *sdata)
+{
+ struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
+#define TEST_CHANGED_BIT(bit) \
+ test_and_clear_bit(bit, &ifmsh->mbss_changed)
+
+ u32 changed = TEST_CHANGED_BIT(BSS_CHANGED_BEACON) |
+ TEST_CHANGED_BIT(BSS_CHANGED_HT) |
+ TEST_CHANGED_BIT(BSS_CHANGED_BASIC_RATES) |
+ TEST_CHANGED_BIT(BSS_CHANGED_BEACON_INT);
+#undef TEST_CHANGED_BIT
+
+ if (sdata->vif.bss_conf.enable_beacon && changed)
+ if (ieee80211_mesh_rebuild_beacon(sdata))
+ return;
+
+ ieee80211_bss_info_change_notify(sdata, changed);
+}
+
void ieee80211_mesh_work(struct ieee80211_sub_if_data *sdata)
{
struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
@@ -999,6 +1016,8 @@ void ieee80211_mesh_work(struct ieee80211_sub_if_data *sdata)
if (test_and_clear_bit(MESH_WORK_DRIFT_ADJUST, &ifmsh->wrkq_flags))
mesh_sync_adjust_tbtt(sdata);
+ if (test_and_clear_bit(MESH_WORK_MBSS_CHANGED, &ifmsh->wrkq_flags))
+ mesh_bss_info_changed(sdata);
out:
sdata_unlock(sdata);
}
diff --git a/net/mac80211/mesh.h b/net/mac80211/mesh.h
index 8b4d9a3..be28f9b 100644
--- a/net/mac80211/mesh.h
+++ b/net/mac80211/mesh.h
@@ -57,6 +57,7 @@ enum mesh_path_flags {
* grow
* @MESH_WORK_ROOT: the mesh root station needs to send a frame
* @MESH_WORK_DRIFT_ADJUST: time to compensate for clock drift relative to other
+ * @MESH_WORK_MBSS_CHANGED: rebuild beacon and notify driver of BSS changes
* mesh nodes
*/
enum mesh_deferred_task_flags {
@@ -65,6 +66,7 @@ enum mesh_deferred_task_flags {
MESH_WORK_GROW_MPP_TABLE,
MESH_WORK_ROOT,
MESH_WORK_DRIFT_ADJUST,
+ MESH_WORK_MBSS_CHANGED,
};
/**
--
1.7.10.4
^ permalink raw reply related
* [PATCH 1/2] mac80211: fix mesh deadlock
From: Thomas Pedersen @ 2013-06-03 23:25 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless, open80211s, Thomas Pedersen
The patch "cfg80211/mac80211: use cfg80211 wdev mutex in
mac80211" introduced several deadlocks by converting the
ifmsh->mtx to wdev->mtx. Solve these by:
1. drop the cancel_work_sync() in ieee80211_stop_mesh().
Instead make the mesh work conditional on whether the mesh
is running or not.
2. lock the mesh work with sdata_lock() to protect beacon
updates and prevent races with wdev->mesh_id_len or
cfg80211.
Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
---
net/mac80211/mesh.c | 29 +++++++++++++++++------------
net/mac80211/mesh_plink.c | 7 +------
2 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c
index 73a597b..d5faf91 100644
--- a/net/mac80211/mesh.c
+++ b/net/mac80211/mesh.c
@@ -579,9 +579,7 @@ static void ieee80211_mesh_housekeeping(struct ieee80211_sub_if_data *sdata)
mesh_path_expire(sdata);
changed = mesh_accept_plinks_update(sdata);
- sdata_lock(sdata);
ieee80211_mbss_info_change_notify(sdata, changed);
- sdata_unlock(sdata);
mod_timer(&ifmsh->housekeeping_timer,
round_jiffies(jiffies +
@@ -788,12 +786,10 @@ void ieee80211_stop_mesh(struct ieee80211_sub_if_data *sdata)
sdata->vif.bss_conf.enable_beacon = false;
clear_bit(SDATA_STATE_OFFCHANNEL_BEACON_STOPPED, &sdata->state);
ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BEACON_ENABLED);
- sdata_lock(sdata);
bcn = rcu_dereference_protected(ifmsh->beacon,
lockdep_is_held(&sdata->wdev.mtx));
rcu_assign_pointer(ifmsh->beacon, NULL);
kfree_rcu(bcn, rcu_head);
- sdata_unlock(sdata);
/* flush STAs and mpaths on this iface */
sta_info_flush(sdata);
@@ -806,14 +802,6 @@ void ieee80211_stop_mesh(struct ieee80211_sub_if_data *sdata)
del_timer_sync(&sdata->u.mesh.housekeeping_timer);
del_timer_sync(&sdata->u.mesh.mesh_path_root_timer);
del_timer_sync(&sdata->u.mesh.mesh_path_timer);
- /*
- * If the timer fired while we waited for it, it will have
- * requeued the work. Now the work will be running again
- * but will not rearm the timer again because it checks
- * whether the interface is running, which, at this point,
- * it no longer is.
- */
- cancel_work_sync(&sdata->work);
local->fif_other_bss--;
atomic_dec(&local->iff_allmultis);
@@ -954,6 +942,12 @@ void ieee80211_mesh_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata,
struct ieee80211_mgmt *mgmt;
u16 stype;
+ sdata_lock(sdata);
+
+ /* mesh already went down */
+ if (!sdata->wdev.mesh_id_len)
+ goto out;
+
rx_status = IEEE80211_SKB_RXCB(skb);
mgmt = (struct ieee80211_mgmt *) skb->data;
stype = le16_to_cpu(mgmt->frame_control) & IEEE80211_FCTL_STYPE;
@@ -971,12 +965,20 @@ void ieee80211_mesh_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata,
ieee80211_mesh_rx_mgmt_action(sdata, mgmt, skb->len, rx_status);
break;
}
+out:
+ sdata_unlock(sdata);
}
void ieee80211_mesh_work(struct ieee80211_sub_if_data *sdata)
{
struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
+ sdata_lock(sdata);
+
+ /* mesh already went down */
+ if (!sdata->wdev.mesh_id_len)
+ goto out;
+
if (ifmsh->preq_queue_len &&
time_after(jiffies,
ifmsh->last_preq + msecs_to_jiffies(ifmsh->mshcfg.dot11MeshHWMPpreqMinInterval)))
@@ -996,6 +998,9 @@ void ieee80211_mesh_work(struct ieee80211_sub_if_data *sdata)
if (test_and_clear_bit(MESH_WORK_DRIFT_ADJUST, &ifmsh->wrkq_flags))
mesh_sync_adjust_tbtt(sdata);
+
+out:
+ sdata_unlock(sdata);
}
void ieee80211_mesh_notify_scan_completed(struct ieee80211_local *local)
diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c
index 6c4da99..09bebed 100644
--- a/net/mac80211/mesh_plink.c
+++ b/net/mac80211/mesh_plink.c
@@ -517,9 +517,7 @@ void mesh_neighbour_update(struct ieee80211_sub_if_data *sdata,
ieee80211_mps_frame_release(sta, elems);
out:
rcu_read_unlock();
- sdata_lock(sdata);
ieee80211_mbss_info_change_notify(sdata, changed);
- sdata_unlock(sdata);
}
static void mesh_plink_timer(unsigned long data)
@@ -1070,9 +1068,6 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata,
rcu_read_unlock();
- if (changed) {
- sdata_lock(sdata);
+ if (changed)
ieee80211_mbss_info_change_notify(sdata, changed);
- sdata_unlock(sdata);
- }
}
--
1.7.10.4
^ permalink raw reply related
* Re: [PATCH] Fix channel index in WMI PCP start
From: Kalle Valo @ 2013-06-03 23:02 UTC (permalink / raw)
To: Kirshenbaum Erez; +Cc: qca_vkondrat, linux-wireless
In-Reply-To: <1370251153-13791-1-git-send-email-erezk@wilocity.com>
Kirshenbaum Erez <erezk@wilocity.com> writes:
> Signed-off-by: Kirshenbaum Erez <erezk@wilocity.com>
Please add "wil6210: " prefix to the title.
--
Kalle Valo
^ permalink raw reply
* Regression in 9390ace brcmfmac: free net device when registration fails
From: Stephen Warren @ 2013-06-03 22:56 UTC (permalink / raw)
To: Arend van Spriel, John W. Linville
Cc: Hante Meuleman, 'linux-wireless@vger.kernel.org',
linux-next@vger.kernel.org
(John, note that this commit is part of the pull request you sent to
Dave today)
Arend,
Commit 9390ace "brcmfmac: free net device when registration fails"
causes a regression.
I had the BCM4330 firmware present in my root fs, whereas my HW is a
BCM4329. With this patch applied, I get a kernel panic on boot. With it
reverted, I see that no issues of that nature. This is true in
next-20130531 (and also 5/30 and 6/1 but not earlier). A bisect of
Linus's tree followed by a merge of John's wireless pull request from
today pointed at this same commit.
Related: Since the two hardware require different firmware, I wonder why
the driver doesn't use a firmware filename that encodes the HW device ID
instead of using the same name for all HW. This means that when I move
my SD card between development systems, I have to copy different
firmware over the top. That's a little painful...
^ permalink raw reply
* [PATCH 8/8] staging: vt6656: rf.c: replace where priv->byCurPwr == power.
From: Malcolm Priestley @ 2013-06-03 21:56 UTC (permalink / raw)
To: gregkh; +Cc: linux-wireless
priv->byCurPwr always equals power in vnt_rf_set_txpower
at switch (priv->byRFType)
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
---
drivers/staging/vt6656/rf.c | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/drivers/staging/vt6656/rf.c b/drivers/staging/vt6656/rf.c
index 2152b44..2e8a964 100644
--- a/drivers/staging/vt6656/rf.c
+++ b/drivers/staging/vt6656/rf.c
@@ -798,11 +798,11 @@ int vnt_rf_set_txpower(struct vnt_private *priv, u8 power, u32 rate)
switch (priv->byRFType) {
case RF_AL2230:
- if (priv->byCurPwr >= AL2230_PWR_IDX_LEN)
+ if (power >= AL2230_PWR_IDX_LEN)
return false;
ret &= vnt_rf_write_embedded(priv,
- al2230_power_table[priv->byCurPwr]);
+ al2230_power_table[power]);
if (rate <= RATE_11M)
ret &= vnt_rf_write_embedded(priv, 0x0001b400 +
@@ -812,11 +812,11 @@ int vnt_rf_set_txpower(struct vnt_private *priv, u8 power, u32 rate)
(BY_AL2230_REG_LEN << 3) + IFREGCTL_REGW);
break;
case RF_AL2230S:
- if (priv->byCurPwr >= AL2230_PWR_IDX_LEN)
+ if (power >= AL2230_PWR_IDX_LEN)
return false;
ret &= vnt_rf_write_embedded(priv,
- al2230_power_table[priv->byCurPwr]);
+ al2230_power_table[power]);
if (rate <= RATE_11M) {
ret &= vnt_rf_write_embedded(priv, 0x040c1400 +
@@ -839,14 +839,14 @@ int vnt_rf_set_txpower(struct vnt_private *priv, u8 power, u32 rate)
ret &= vnt_rf_write_embedded(priv, 0x221bb900 +
(BY_AL7230_REG_LEN << 3)+IFREGCTL_REGW);
- if (priv->byCurPwr > AL7230_PWR_IDX_LEN)
+ if (power > AL7230_PWR_IDX_LEN)
return false;
/*
* 0x080F1B00 for 3 wire control TxGain(D10)
* and 0x31 as TX Gain value
*/
- power_setting = 0x080c0b00 | ((priv->byCurPwr) << 12) |
+ power_setting = 0x080c0b00 | ((power) << 12) |
(BY_AL7230_REG_LEN << 3) | IFREGCTL_REGW;
ret &= vnt_rf_write_embedded(priv, power_setting);
@@ -854,20 +854,20 @@ int vnt_rf_set_txpower(struct vnt_private *priv, u8 power, u32 rate)
break;
case RF_VT3226:
- if (priv->byCurPwr >= VT3226_PWR_IDX_LEN)
+ if (power >= VT3226_PWR_IDX_LEN)
return false;
- power_setting = ((0x3f - priv->byCurPwr) << 20) | (0x17 << 8) |
+ power_setting = ((0x3f - power) << 20) | (0x17 << 8) |
(BY_VT3226_REG_LEN << 3) | IFREGCTL_REGW;
ret &= vnt_rf_write_embedded(priv, power_setting);
break;
case RF_VT3226D0:
- if (priv->byCurPwr >= VT3226_PWR_IDX_LEN)
+ if (power >= VT3226_PWR_IDX_LEN)
return false;
if (rate <= RATE_11M) {
- power_setting = ((0x3f-priv->byCurPwr) << 20) |
+ power_setting = ((0x3f-power) << 20) |
(0xe07 << 8) | (BY_VT3226_REG_LEN << 3) |
IFREGCTL_REGW;
@@ -897,7 +897,7 @@ int vnt_rf_set_txpower(struct vnt_private *priv, u8 power, u32 rate)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
"@@@@ vnt_rf_set_txpower> 11G mode\n");
- power_setting = ((0x3f-priv->byCurPwr) << 20) |
+ power_setting = ((0x3f-power) << 20) |
(0x7 << 8) | (BY_VT3226_REG_LEN << 3) |
IFREGCTL_REGW;
@@ -912,10 +912,10 @@ int vnt_rf_set_txpower(struct vnt_private *priv, u8 power, u32 rate)
break;
case RF_VT3342A0:
- if (priv->byCurPwr >= VT3342_PWR_IDX_LEN)
+ if (power >= VT3342_PWR_IDX_LEN)
return false;
- power_setting = ((0x3F-priv->byCurPwr) << 20) |
+ power_setting = ((0x3F-power) << 20) |
(0x27 << 8) | (BY_VT3342_REG_LEN << 3) |
IFREGCTL_REGW;
--
1.8.1.2
^ permalink raw reply related
* [PATCH 7/8] staging: vt6656: rf.c correct typo error of vt3226
From: Malcolm Priestley @ 2013-06-03 21:54 UTC (permalink / raw)
To: gregkh; +Cc: linux-wireless
Correct typo error of at3226_init_table/at3226d0_init_table
The device is vt3226
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
---
drivers/staging/vt6656/rf.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/vt6656/rf.c b/drivers/staging/vt6656/rf.c
index 051e790..2152b44 100644
--- a/drivers/staging/vt6656/rf.c
+++ b/drivers/staging/vt6656/rf.c
@@ -355,7 +355,7 @@ static u8 al7230_channel_table2[CB_MAX_CHANNEL][3] = {
};
///{{RobertYu:20051111
-static u8 at3226_init_table[CB_VT3226_INIT_SEQ][3] = {
+static u8 vt3226_init_table[CB_VT3226_INIT_SEQ][3] = {
{0x03, 0xFF, 0x80},
{0x02, 0x82, 0xA1},
{0x03, 0xC6, 0xA2},
@@ -369,7 +369,7 @@ static u8 at3226_init_table[CB_VT3226_INIT_SEQ][3] = {
{0x02, 0x00, 0x2A}
};
-static u8 at3226d0_init_table[CB_VT3226_INIT_SEQ][3] = {
+static u8 vt3226d0_init_table[CB_VT3226_INIT_SEQ][3] = {
{0x03, 0xFF, 0x80},
{0x03, 0x02, 0x21}, //RobertYu:20060327
{0x03, 0xC6, 0xA2},
@@ -995,7 +995,7 @@ void vnt_rf_table_download(struct vnt_private *priv)
length1 = CB_VT3226_INIT_SEQ * 3;
length2 = CB_MAX_CHANNEL_24G * 3;
length3 = CB_MAX_CHANNEL_24G * 3;
- addr1 = &at3226_init_table[0][0];
+ addr1 = &vt3226_init_table[0][0];
addr2 = &vt3226_channel_table0[0][0];
addr3 = &vt3226_channel_table1[0][0];
break;
@@ -1003,7 +1003,7 @@ void vnt_rf_table_download(struct vnt_private *priv)
length1 = CB_VT3226_INIT_SEQ * 3;
length2 = CB_MAX_CHANNEL_24G * 3;
length3 = CB_MAX_CHANNEL_24G * 3;
- addr1 = &at3226d0_init_table[0][0];
+ addr1 = &vt3226d0_init_table[0][0];
addr2 = &vt3226_channel_table0[0][0];
addr3 = &vt3226_channel_table1[0][0];
break;
--
1.8.1.2
^ permalink raw reply related
* [PATCH 6/8] staging: vt6656: rf.c/h rename RFbRFTableDownload
From: Malcolm Priestley @ 2013-06-03 21:53 UTC (permalink / raw)
To: gregkh; +Cc: linux-wireless
rename RFbRFTableDownload to vnt_rf_table_download.
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
---
drivers/staging/vt6656/baseband.c | 5 +++--
drivers/staging/vt6656/rf.c | 2 +-
drivers/staging/vt6656/rf.h | 2 +-
3 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/vt6656/baseband.c b/drivers/staging/vt6656/baseband.c
index 33fa767..c0f8b77 100644
--- a/drivers/staging/vt6656/baseband.c
+++ b/drivers/staging/vt6656/baseband.c
@@ -1105,8 +1105,9 @@ else {
ControlvWriteByte(pDevice,MESSAGE_REQUEST_BBREG,0x04,0x7F);
ControlvWriteByte(pDevice,MESSAGE_REQUEST_BBREG,0x0D,0x01);
- RFbRFTableDownload(pDevice);
- return true;//ntStatus;
+ vnt_rf_table_download(pDevice);
+
+ return true;
}
/*
diff --git a/drivers/staging/vt6656/rf.c b/drivers/staging/vt6656/rf.c
index bcc9632..051e790 100644
--- a/drivers/staging/vt6656/rf.c
+++ b/drivers/staging/vt6656/rf.c
@@ -966,7 +966,7 @@ void vnt_rf_rssi_to_dbm(struct vnt_private *priv, u8 rssi, long *dbm)
*dbm = -1 * (a + b * 2);
}
-void RFbRFTableDownload(struct vnt_private *priv)
+void vnt_rf_table_download(struct vnt_private *priv)
{
u16 length1 = 0, length2 = 0, length3 = 0;
u8 *addr1 = NULL, *addr2 = NULL, *addr3 = NULL;
diff --git a/drivers/staging/vt6656/rf.h b/drivers/staging/vt6656/rf.h
index 73abc5a..5d83017 100644
--- a/drivers/staging/vt6656/rf.h
+++ b/drivers/staging/vt6656/rf.h
@@ -59,6 +59,6 @@ int vnt_rf_write_embedded(struct vnt_private *, u32);
int vnt_rf_setpower(struct vnt_private *, u32, u32);
int vnt_rf_set_txpower(struct vnt_private *, u8, u32);
void vnt_rf_rssi_to_dbm(struct vnt_private *, u8, long *);
-void RFbRFTableDownload(struct vnt_private *pDevice);
+void vnt_rf_table_download(struct vnt_private *);
#endif /* __RF_H__ */
--
1.8.1.2
^ permalink raw reply related
* [PATCH 5/8] staging: vt6656: rf.c/h rename RFvRSSITodBm
From: Malcolm Priestley @ 2013-06-03 21:49 UTC (permalink / raw)
To: gregkh; +Cc: linux-wireless
Remove camel case rename RFvRSSITodBm to vnt_rf_rssi_to_dbm
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
---
drivers/staging/vt6656/bssdb.c | 6 +++---
drivers/staging/vt6656/iwctl.c | 6 +++---
drivers/staging/vt6656/rf.c | 2 +-
drivers/staging/vt6656/rf.h | 2 +-
4 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/staging/vt6656/bssdb.c b/drivers/staging/vt6656/bssdb.c
index ee79bbd..078d751 100644
--- a/drivers/staging/vt6656/bssdb.c
+++ b/drivers/staging/vt6656/bssdb.c
@@ -451,7 +451,7 @@ int BSSbInsertToBSSList(struct vnt_private *pDevice,
if (pDevice->bUpdateBBVGA) {
// Monitor if RSSI is too strong.
pBSSList->byRSSIStatCnt = 0;
- RFvRSSITodBm(pDevice, (u8)(pRxPacket->uRSSI), &pBSSList->ldBmMAX);
+ vnt_rf_rssi_to_dbm(pDevice, (u8)(pRxPacket->uRSSI), &pBSSList->ldBmMAX);
pBSSList->ldBmAverage[0] = pBSSList->ldBmMAX;
pBSSList->ldBmAverRange = pBSSList->ldBmMAX;
for (ii = 1; ii < RSSI_STAT_COUNT; ii++)
@@ -578,7 +578,7 @@ int BSSbUpdateToBSSList(struct vnt_private *pDevice,
}
if (pRxPacket->uRSSI != 0) {
- RFvRSSITodBm(pDevice, (u8)(pRxPacket->uRSSI), &ldBm);
+ vnt_rf_rssi_to_dbm(pDevice, (u8)(pRxPacket->uRSSI), &ldBm);
// Monitor if RSSI is too strong.
pBSSList->byRSSIStatCnt++;
pBSSList->byRSSIStatCnt %= RSSI_STAT_COUNT;
@@ -1387,7 +1387,7 @@ if(pDevice->bLinkPass !=true)
}
else
{
- RFvRSSITodBm(pDevice, (u8)(pDevice->uCurrRSSI), &ldBm);
+ vnt_rf_rssi_to_dbm(pDevice, (u8)(pDevice->uCurrRSSI), &ldBm);
if(-ldBm < 50) {
RssiRatio = 4000;
}
diff --git a/drivers/staging/vt6656/iwctl.c b/drivers/staging/vt6656/iwctl.c
index d0cf7d8..af355d2 100644
--- a/drivers/staging/vt6656/iwctl.c
+++ b/drivers/staging/vt6656/iwctl.c
@@ -61,7 +61,7 @@ struct iw_statistics *iwctl_get_wireless_stats(struct net_device *dev)
if (pDevice->scStatistic.LinkQuality > 100)
pDevice->scStatistic.LinkQuality = 100;
pDevice->wstats.qual.qual =(u8)pDevice->scStatistic.LinkQuality;
- RFvRSSITodBm(pDevice, (u8)(pDevice->uCurrRSSI), &ldBm);
+ vnt_rf_rssi_to_dbm(pDevice, (u8)(pDevice->uCurrRSSI), &ldBm);
pDevice->wstats.qual.level = ldBm;
pDevice->wstats.qual.noise = 0;
pDevice->wstats.qual.updated = 1;
@@ -237,7 +237,7 @@ int iwctl_giwscan(struct net_device *dev, struct iw_request_info *info,
// ADD quality
memset(&iwe, 0, sizeof(iwe));
iwe.cmd = IWEVQUAL;
- RFvRSSITodBm(pDevice, (u8)(pBSS->uRSSI), &ldBm);
+ vnt_rf_rssi_to_dbm(pDevice, (u8)(pBSS->uRSSI), &ldBm);
iwe.u.qual.level = ldBm;
iwe.u.qual.noise = 0;
@@ -1427,7 +1427,7 @@ int iwctl_giwsens(struct net_device *dev, struct iw_request_info *info,
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " SIOCGIWSENS\n");
if (pDevice->bLinkPass == true) {
- RFvRSSITodBm(pDevice, (u8)(pDevice->uCurrRSSI), &ldBm);
+ vnt_rf_rssi_to_dbm(pDevice, (u8)(pDevice->uCurrRSSI), &ldBm);
wrq->value = ldBm;
} else {
wrq->value = 0;
diff --git a/drivers/staging/vt6656/rf.c b/drivers/staging/vt6656/rf.c
index 1706d8d..bcc9632 100644
--- a/drivers/staging/vt6656/rf.c
+++ b/drivers/staging/vt6656/rf.c
@@ -943,7 +943,7 @@ int vnt_rf_set_txpower(struct vnt_private *priv, u8 power, u32 rate)
* Return Value: none
*
-*/
-void RFvRSSITodBm(struct vnt_private *priv, u8 rssi, long *dbm)
+void vnt_rf_rssi_to_dbm(struct vnt_private *priv, u8 rssi, long *dbm)
{
u8 idx = (((rssi & 0xc0) >> 6) & 0x03);
long b = (rssi & 0x3f);
diff --git a/drivers/staging/vt6656/rf.h b/drivers/staging/vt6656/rf.h
index 1c0dd25..73abc5a 100644
--- a/drivers/staging/vt6656/rf.h
+++ b/drivers/staging/vt6656/rf.h
@@ -58,7 +58,7 @@ extern const u8 RFaby11aChannelIndex[200];
int vnt_rf_write_embedded(struct vnt_private *, u32);
int vnt_rf_setpower(struct vnt_private *, u32, u32);
int vnt_rf_set_txpower(struct vnt_private *, u8, u32);
-void RFvRSSITodBm(struct vnt_private *, u8 byCurrRSSI, long *pldBm);
+void vnt_rf_rssi_to_dbm(struct vnt_private *, u8, long *);
void RFbRFTableDownload(struct vnt_private *pDevice);
#endif /* __RF_H__ */
--
1.8.1.2
^ permalink raw reply related
* [PATCH 4/8] staging: vt6656: rf.c/h rename RFbRawSetPower
From: Malcolm Priestley @ 2013-06-03 21:48 UTC (permalink / raw)
To: gregkh; +Cc: linux-wireless
Since we are actually setting the tx power rename vnt_rf_set_txpower.
Remove camel case rename RFbRawSetPower to vnt_rf_set_txpower
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
---
drivers/staging/vt6656/card.c | 9 ++++++---
drivers/staging/vt6656/rf.c | 10 +++++-----
drivers/staging/vt6656/rf.h | 2 +-
3 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/drivers/staging/vt6656/card.c b/drivers/staging/vt6656/card.c
index 24291ae..56a6a57 100644
--- a/drivers/staging/vt6656/card.c
+++ b/drivers/staging/vt6656/card.c
@@ -112,13 +112,16 @@ void CARDbSetMediaChannel(struct vnt_private *pDevice, u32 uConnectionChannel)
if (pDevice->byBBType == BB_TYPE_11A) {
pDevice->byCurPwr = 0xFF;
- RFbRawSetPower(pDevice, pDevice->abyOFDMAPwrTbl[uConnectionChannel-15], RATE_54M);
+ vnt_rf_set_txpower(pDevice,
+ pDevice->abyOFDMAPwrTbl[uConnectionChannel-15], RATE_54M);
} else if (pDevice->byBBType == BB_TYPE_11G) {
pDevice->byCurPwr = 0xFF;
- RFbRawSetPower(pDevice, pDevice->abyOFDMPwrTbl[uConnectionChannel-1], RATE_54M);
+ vnt_rf_set_txpower(pDevice,
+ pDevice->abyOFDMPwrTbl[uConnectionChannel-1], RATE_54M);
} else {
pDevice->byCurPwr = 0xFF;
- RFbRawSetPower(pDevice, pDevice->abyCCKPwrTbl[uConnectionChannel-1], RATE_1M);
+ vnt_rf_set_txpower(pDevice,
+ pDevice->abyCCKPwrTbl[uConnectionChannel-1], RATE_1M);
}
ControlvWriteByte(pDevice,MESSAGE_REQUEST_MACREG,MAC_REG_CHANNEL,(u8)(uConnectionChannel|0x80));
}
diff --git a/drivers/staging/vt6656/rf.c b/drivers/staging/vt6656/rf.c
index 7e6e386..1706d8d 100644
--- a/drivers/staging/vt6656/rf.c
+++ b/drivers/staging/vt6656/rf.c
@@ -767,7 +767,7 @@ int vnt_rf_setpower(struct vnt_private *priv, u32 rate, u32 channel)
break;
}
- ret = RFbRawSetPower(priv, power, rate);
+ ret = vnt_rf_set_txpower(priv, power, rate);
return ret;
}
@@ -786,7 +786,7 @@ int vnt_rf_setpower(struct vnt_private *priv, u32 rate, u32 channel)
*
*/
-int RFbRawSetPower(struct vnt_private *priv, u8 power, u32 rate)
+int vnt_rf_set_txpower(struct vnt_private *priv, u8 power, u32 rate)
{
u32 power_setting = 0;
int ret = true;
@@ -877,14 +877,14 @@ int RFbRawSetPower(struct vnt_private *priv, u8 power, u32 rate)
if (priv->vnt_mgmt.eScanState != WMAC_NO_SCANNING) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
- "RFbRawSetPower> 11B mode uCurrChannel[%d]\n",
+ "vnt_rf_set_txpower> 11B mode uCurrChannel[%d]\n",
priv->vnt_mgmt.uScanChannel);
ret &= vnt_rf_write_embedded(priv,
vt3226d0_lo_current_table[priv->
vnt_mgmt.uScanChannel - 1]);
} else {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
- "RFbRawSetPower> 11B mode uCurrChannel[%d]\n",
+ "vnt_rf_set_txpower> 11B mode uCurrChannel[%d]\n",
priv->vnt_mgmt.uCurrChannel);
ret &= vnt_rf_write_embedded(priv,
vt3226d0_lo_current_table[priv->
@@ -895,7 +895,7 @@ int RFbRawSetPower(struct vnt_private *priv, u8 power, u32 rate)
(BY_VT3226_REG_LEN<<3)+IFREGCTL_REGW);
} else {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
- "@@@@ RFbRawSetPower> 11G mode\n");
+ "@@@@ vnt_rf_set_txpower> 11G mode\n");
power_setting = ((0x3f-priv->byCurPwr) << 20) |
(0x7 << 8) | (BY_VT3226_REG_LEN << 3) |
diff --git a/drivers/staging/vt6656/rf.h b/drivers/staging/vt6656/rf.h
index 62fcfc6..1c0dd25 100644
--- a/drivers/staging/vt6656/rf.h
+++ b/drivers/staging/vt6656/rf.h
@@ -57,7 +57,7 @@ extern const u8 RFaby11aChannelIndex[200];
int vnt_rf_write_embedded(struct vnt_private *, u32);
int vnt_rf_setpower(struct vnt_private *, u32, u32);
-int RFbRawSetPower(struct vnt_private *, u8 byPwr, u32 uRATE);
+int vnt_rf_set_txpower(struct vnt_private *, u8, u32);
void RFvRSSITodBm(struct vnt_private *, u8 byCurrRSSI, long *pldBm);
void RFbRFTableDownload(struct vnt_private *pDevice);
--
1.8.1.2
^ permalink raw reply related
* [PATCH 3/8] staging: vt6656: rf.c/h rename RFbSetPower
From: Malcolm Priestley @ 2013-06-03 21:47 UTC (permalink / raw)
To: gregkh; +Cc: linux-wireless
Remove camel case rename RFbSetPower to vnt_rf_setpower
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
---
drivers/staging/vt6656/rf.c | 2 +-
drivers/staging/vt6656/rf.h | 2 +-
drivers/staging/vt6656/rxtx.c | 19 +++++++++----------
drivers/staging/vt6656/wcmd.c | 8 ++++----
4 files changed, 15 insertions(+), 16 deletions(-)
diff --git a/drivers/staging/vt6656/rf.c b/drivers/staging/vt6656/rf.c
index 8c10886..7e6e386 100644
--- a/drivers/staging/vt6656/rf.c
+++ b/drivers/staging/vt6656/rf.c
@@ -735,7 +735,7 @@ int vnt_rf_write_embedded(struct vnt_private *priv, u32 data)
* Return Value: true if succeeded; false if failed.
*
*/
-int RFbSetPower(struct vnt_private *priv, u32 rate, u32 channel)
+int vnt_rf_setpower(struct vnt_private *priv, u32 rate, u32 channel)
{
int ret = true;
u8 power = priv->byCCKPwr;
diff --git a/drivers/staging/vt6656/rf.h b/drivers/staging/vt6656/rf.h
index 9de28c0..62fcfc6 100644
--- a/drivers/staging/vt6656/rf.h
+++ b/drivers/staging/vt6656/rf.h
@@ -56,7 +56,7 @@
extern const u8 RFaby11aChannelIndex[200];
int vnt_rf_write_embedded(struct vnt_private *, u32);
-int RFbSetPower(struct vnt_private *, u32 uRATE, u32 uCH);
+int vnt_rf_setpower(struct vnt_private *, u32, u32);
int RFbRawSetPower(struct vnt_private *, u8 byPwr, u32 uRATE);
void RFvRSSITodBm(struct vnt_private *, u8 byCurrRSSI, long *pldBm);
void RFbRFTableDownload(struct vnt_private *pDevice);
diff --git a/drivers/staging/vt6656/rxtx.c b/drivers/staging/vt6656/rxtx.c
index 9bf2f8d..d29d4b2 100644
--- a/drivers/staging/vt6656/rxtx.c
+++ b/drivers/staging/vt6656/rxtx.c
@@ -1720,11 +1720,11 @@ CMD_STATUS csMgmt_xmit(struct vnt_private *pDevice,
// 2004.11.11 Kyle -- Using OFDM power to tx MngPkt will decrease the connection capability.
// And cmd timer will wait data pkt TX finish before scanning so it's OK
// to set power here.
- if (pMgmt->eScanState != WMAC_NO_SCANNING) {
- RFbSetPower(pDevice, wCurrentRate, pDevice->byCurrentCh);
- } else {
- RFbSetPower(pDevice, wCurrentRate, pMgmt->uCurrChannel);
- }
+ if (pMgmt->eScanState != WMAC_NO_SCANNING)
+ vnt_rf_setpower(pDevice, wCurrentRate, pDevice->byCurrentCh);
+ else
+ vnt_rf_setpower(pDevice, wCurrentRate, pMgmt->uCurrChannel);
+
pDevice->wCurrentRate = wCurrentRate;
//Set packet type
@@ -2098,11 +2098,10 @@ void vDMA0_tx_80211(struct vnt_private *pDevice, struct sk_buff *skb)
// 2004.11.11 Kyle -- Using OFDM power to tx MngPkt will decrease the connection capability.
// And cmd timer will wait data pkt TX finish before scanning so it's OK
// to set power here.
- if (pMgmt->eScanState != WMAC_NO_SCANNING) {
- RFbSetPower(pDevice, wCurrentRate, pDevice->byCurrentCh);
- } else {
- RFbSetPower(pDevice, wCurrentRate, pMgmt->uCurrChannel);
- }
+ if (pMgmt->eScanState != WMAC_NO_SCANNING)
+ vnt_rf_setpower(pDevice, wCurrentRate, pDevice->byCurrentCh);
+ else
+ vnt_rf_setpower(pDevice, wCurrentRate, pMgmt->uCurrChannel);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"vDMA0_tx_80211: p80211Header->sA3.wFrameCtl = %x \n", p80211Header->sA3.wFrameCtl);
diff --git a/drivers/staging/vt6656/wcmd.c b/drivers/staging/vt6656/wcmd.c
index 0013cb7..8cd45e3 100644
--- a/drivers/staging/vt6656/wcmd.c
+++ b/drivers/staging/vt6656/wcmd.c
@@ -905,11 +905,11 @@ void vRunCommand(struct vnt_private *pDevice)
break;
case WLAN_CMD_SETPOWER_START:
+ vnt_rf_setpower(pDevice, pDevice->wCurrentRate,
+ pMgmt->uCurrChannel);
- RFbSetPower(pDevice, pDevice->wCurrentRate, pMgmt->uCurrChannel);
-
- s_bCommandComplete(pDevice);
- break;
+ s_bCommandComplete(pDevice);
+ break;
case WLAN_CMD_CHANGE_ANTENNA_START:
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Change from Antenna%d to", (int)pDevice->dwRxAntennaSel);
--
1.8.1.2
^ permalink raw reply related
* [PATCH 2/8] staging: vt6656: rf.c: rename IFRFbWriteEmbedded
From: Malcolm Priestley @ 2013-06-03 21:46 UTC (permalink / raw)
To: gregkh; +Cc: linux-wireless
Remove camel case rename IFRFbWriteEmbedded to vnt_rf_write_embedded
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
---
drivers/staging/vt6656/rf.c | 48 ++++++++++++++++++++++-----------------------
drivers/staging/vt6656/rf.h | 2 +-
2 files changed, 25 insertions(+), 25 deletions(-)
diff --git a/drivers/staging/vt6656/rf.c b/drivers/staging/vt6656/rf.c
index 9fbef8c..8c10886 100644
--- a/drivers/staging/vt6656/rf.c
+++ b/drivers/staging/vt6656/rf.c
@@ -26,7 +26,7 @@
* Date: Feb. 19, 2004
*
* Functions:
- * IFRFbWriteEmbedded - Embedded write RF register via MAC
+ * vnt_rf_write_embedded - Embedded write RF register via MAC
*
* Revision History:
* RF_VT3226: RobertYu:20051111, VT3226C0 and before
@@ -707,7 +707,7 @@ const u8 RFaby11aChannelIndex[200] = {
* Return Value: true if succeeded; false if failed.
*
*/
-int IFRFbWriteEmbedded(struct vnt_private *priv, u32 data)
+int vnt_rf_write_embedded(struct vnt_private *priv, u32 data)
{
u8 reg_data[4];
@@ -801,42 +801,42 @@ int RFbRawSetPower(struct vnt_private *priv, u8 power, u32 rate)
if (priv->byCurPwr >= AL2230_PWR_IDX_LEN)
return false;
- ret &= IFRFbWriteEmbedded(priv,
+ ret &= vnt_rf_write_embedded(priv,
al2230_power_table[priv->byCurPwr]);
if (rate <= RATE_11M)
- ret &= IFRFbWriteEmbedded(priv, 0x0001b400 +
+ ret &= vnt_rf_write_embedded(priv, 0x0001b400 +
(BY_AL2230_REG_LEN << 3) + IFREGCTL_REGW);
else
- ret &= IFRFbWriteEmbedded(priv, 0x0005a400 +
+ ret &= vnt_rf_write_embedded(priv, 0x0005a400 +
(BY_AL2230_REG_LEN << 3) + IFREGCTL_REGW);
break;
case RF_AL2230S:
if (priv->byCurPwr >= AL2230_PWR_IDX_LEN)
return false;
- ret &= IFRFbWriteEmbedded(priv,
+ ret &= vnt_rf_write_embedded(priv,
al2230_power_table[priv->byCurPwr]);
if (rate <= RATE_11M) {
- ret &= IFRFbWriteEmbedded(priv, 0x040c1400 +
+ ret &= vnt_rf_write_embedded(priv, 0x040c1400 +
(BY_AL2230_REG_LEN << 3) + IFREGCTL_REGW);
- ret &= IFRFbWriteEmbedded(priv, 0x00299b00 +
+ ret &= vnt_rf_write_embedded(priv, 0x00299b00 +
(BY_AL2230_REG_LEN << 3) + IFREGCTL_REGW);
} else {
- ret &= IFRFbWriteEmbedded(priv, 0x0005a400 +
+ ret &= vnt_rf_write_embedded(priv, 0x0005a400 +
(BY_AL2230_REG_LEN << 3) + IFREGCTL_REGW);
- ret &= IFRFbWriteEmbedded(priv, 0x00099b00 +
+ ret &= vnt_rf_write_embedded(priv, 0x00099b00 +
(BY_AL2230_REG_LEN << 3) + IFREGCTL_REGW);
}
break;
case RF_AIROHA7230:
if (rate <= RATE_11M)
- ret &= IFRFbWriteEmbedded(priv, 0x111bb900 +
+ ret &= vnt_rf_write_embedded(priv, 0x111bb900 +
(BY_AL7230_REG_LEN << 3)+IFREGCTL_REGW);
else
- ret &= IFRFbWriteEmbedded(priv, 0x221bb900 +
+ ret &= vnt_rf_write_embedded(priv, 0x221bb900 +
(BY_AL7230_REG_LEN << 3)+IFREGCTL_REGW);
if (priv->byCurPwr > AL7230_PWR_IDX_LEN)
@@ -849,7 +849,7 @@ int RFbRawSetPower(struct vnt_private *priv, u8 power, u32 rate)
power_setting = 0x080c0b00 | ((priv->byCurPwr) << 12) |
(BY_AL7230_REG_LEN << 3) | IFREGCTL_REGW;
- ret &= IFRFbWriteEmbedded(priv, power_setting);
+ ret &= vnt_rf_write_embedded(priv, power_setting);
break;
@@ -859,7 +859,7 @@ int RFbRawSetPower(struct vnt_private *priv, u8 power, u32 rate)
power_setting = ((0x3f - priv->byCurPwr) << 20) | (0x17 << 8) |
(BY_VT3226_REG_LEN << 3) | IFREGCTL_REGW;
- ret &= IFRFbWriteEmbedded(priv, power_setting);
+ ret &= vnt_rf_write_embedded(priv, power_setting);
break;
case RF_VT3226D0:
@@ -871,27 +871,27 @@ int RFbRawSetPower(struct vnt_private *priv, u8 power, u32 rate)
(0xe07 << 8) | (BY_VT3226_REG_LEN << 3) |
IFREGCTL_REGW;
- ret &= IFRFbWriteEmbedded(priv, power_setting);
- ret &= IFRFbWriteEmbedded(priv, 0x03c6a200 +
+ ret &= vnt_rf_write_embedded(priv, power_setting);
+ ret &= vnt_rf_write_embedded(priv, 0x03c6a200 +
(BY_VT3226_REG_LEN<<3)+IFREGCTL_REGW);
if (priv->vnt_mgmt.eScanState != WMAC_NO_SCANNING) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
"RFbRawSetPower> 11B mode uCurrChannel[%d]\n",
priv->vnt_mgmt.uScanChannel);
- ret &= IFRFbWriteEmbedded(priv,
+ ret &= vnt_rf_write_embedded(priv,
vt3226d0_lo_current_table[priv->
vnt_mgmt.uScanChannel - 1]);
} else {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
"RFbRawSetPower> 11B mode uCurrChannel[%d]\n",
priv->vnt_mgmt.uCurrChannel);
- ret &= IFRFbWriteEmbedded(priv,
+ ret &= vnt_rf_write_embedded(priv,
vt3226d0_lo_current_table[priv->
vnt_mgmt.uCurrChannel - 1]);
}
- ret &= IFRFbWriteEmbedded(priv, 0x015C0800 +
+ ret &= vnt_rf_write_embedded(priv, 0x015C0800 +
(BY_VT3226_REG_LEN<<3)+IFREGCTL_REGW);
} else {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
@@ -901,12 +901,12 @@ int RFbRawSetPower(struct vnt_private *priv, u8 power, u32 rate)
(0x7 << 8) | (BY_VT3226_REG_LEN << 3) |
IFREGCTL_REGW;
- ret &= IFRFbWriteEmbedded(priv, power_setting);
- ret &= IFRFbWriteEmbedded(priv, 0x00C6A200 +
+ ret &= vnt_rf_write_embedded(priv, power_setting);
+ ret &= vnt_rf_write_embedded(priv, 0x00C6A200 +
(BY_VT3226_REG_LEN << 3) + IFREGCTL_REGW);
- ret &= IFRFbWriteEmbedded(priv, 0x016BC600 +
+ ret &= vnt_rf_write_embedded(priv, 0x016BC600 +
(BY_VT3226_REG_LEN<<3)+IFREGCTL_REGW);
- ret &= IFRFbWriteEmbedded(priv, 0x00900800 +
+ ret &= vnt_rf_write_embedded(priv, 0x00900800 +
(BY_VT3226_REG_LEN<<3)+IFREGCTL_REGW);
}
break;
@@ -919,7 +919,7 @@ int RFbRawSetPower(struct vnt_private *priv, u8 power, u32 rate)
(0x27 << 8) | (BY_VT3342_REG_LEN << 3) |
IFREGCTL_REGW;
- ret &= IFRFbWriteEmbedded(priv, power_setting);
+ ret &= vnt_rf_write_embedded(priv, power_setting);
break;
default:
diff --git a/drivers/staging/vt6656/rf.h b/drivers/staging/vt6656/rf.h
index de5c613..9de28c0 100644
--- a/drivers/staging/vt6656/rf.h
+++ b/drivers/staging/vt6656/rf.h
@@ -55,7 +55,7 @@
extern const u8 RFaby11aChannelIndex[200];
-int IFRFbWriteEmbedded(struct vnt_private *, u32 dwData);
+int vnt_rf_write_embedded(struct vnt_private *, u32);
int RFbSetPower(struct vnt_private *, u32 uRATE, u32 uCH);
int RFbRawSetPower(struct vnt_private *, u8 byPwr, u32 uRATE);
void RFvRSSITodBm(struct vnt_private *, u8 byCurrRSSI, long *pldBm);
--
1.8.1.2
^ permalink raw reply related
* [PATCH 1/8] staging: vt6656: rf.c: IFRFbWriteEmbedded cleanup and remove camel case
From: Malcolm Priestley @ 2013-06-03 21:42 UTC (permalink / raw)
To: gregkh; +Cc: linux-wireless
White space clean up.
Camel case changes;
pDevice -> priv
dwData -> data
pbyData -> reg_data
Functional change
CONTROLnsRequestOut Length = ARRAY_SIZE(reg_data)
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
---
drivers/staging/vt6656/rf.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/staging/vt6656/rf.c b/drivers/staging/vt6656/rf.c
index d27fa43..9fbef8c 100644
--- a/drivers/staging/vt6656/rf.c
+++ b/drivers/staging/vt6656/rf.c
@@ -707,17 +707,17 @@ const u8 RFaby11aChannelIndex[200] = {
* Return Value: true if succeeded; false if failed.
*
*/
-int IFRFbWriteEmbedded(struct vnt_private *pDevice, u32 dwData)
+int IFRFbWriteEmbedded(struct vnt_private *priv, u32 data)
{
- u8 pbyData[4];
+ u8 reg_data[4];
- pbyData[0] = (u8)dwData;
- pbyData[1] = (u8)(dwData >> 8);
- pbyData[2] = (u8)(dwData >> 16);
- pbyData[3] = (u8)(dwData >> 24);
+ reg_data[0] = (u8)data;
+ reg_data[1] = (u8)(data >> 8);
+ reg_data[2] = (u8)(data >> 16);
+ reg_data[3] = (u8)(data >> 24);
- CONTROLnsRequestOut(pDevice,
- MESSAGE_TYPE_WRITE_IFRF, 0, 0, 4, pbyData);
+ CONTROLnsRequestOut(priv, MESSAGE_TYPE_WRITE_IFRF,
+ 0, 0, ARRAY_SIZE(reg_data), reg_data);
return true;
}
--
1.8.1.2
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox