* Re: [PATCH V2 00/31] ath6kl Add multiple vif support
From: Vasanthakumar Thiagarajan @ 2011-11-01 5:29 UTC (permalink / raw)
To: Kalle Valo; +Cc: linux-wireless
In-Reply-To: <4EA7B536.70107@qca.qualcomm.com>
On Wed, Oct 26, 2011 at 10:22:30AM +0300, Kalle Valo wrote:
> On 10/25/2011 05:03 PM, Vasanthakumar Thiagarajan wrote:
> > This patch set adds basic infrastructure for multiple
> > virtual interface. As configuring the firmware with more than one
> > vif causes random target assert, the number of supported vifs is
> > restricted to 1 for now. I would like to thank Vivek Natarajan
> > (nataraja@qca.qualcomm.com) for his inital work in this area and
> > Arthi Thiruvengadam (athiruve@qca.qualcomm.com) for finding some
> > critical bugs.
>
> I saw the lockdep warning below after I loaded the module and connected
> to an AP. But the driver still functioned normally.
Sorry, i did not test with lockdep warning enabled, i'll look into
this. Thanks!
Vasanth
^ permalink raw reply
* Re: rt2800usb + rt3070 + AP(n mode)
From: Helmut Schaa @ 2011-11-01 2:48 UTC (permalink / raw)
To: Andrew V. Stepanov; +Cc: linux-wireless
In-Reply-To: <CAN8Fffq1M88zsMnmmcnCoRDm6WOUJ2=g5j4giRnXFHzcxSeQiQ@mail.gmail.com>
Hi Andrew,
On Mon, Oct 31, 2011 at 12:04 PM, Andrew V. Stepanov <stanv@altlinux.org> wrote:
> Hello.
>
> I have USB Wireless Adapter (ID 148f:3070 Ralink Technology, Corp.
> RT2870/RT3070 Wireless Adapter).
> I successfuly set this device to AccessPoint (master) mode with
> vanila kernel driver rt2800usb + hostapd. But only to G mode.
> I sees speed no more 2Mbps.
>
> Did any have success setup this device with ieee80211n=1?
Basically rt2800 should be able to work in 11n mode but AP mode in rt2800usb
lacks some important features like proper multi- and broadcast buffering for
powersaving stations.
Helmut
^ permalink raw reply
* problem clearing bit-rates with 'iw'
From: Ben Greear @ 2011-10-31 22:34 UTC (permalink / raw)
To: linux-wireless@vger.kernel.org
According to the help, it seems I should be able to pass no rates and
have it clear the mask. But, it seems that is not actually working:
[root@lec2010-ath9k-1 lanforge]# ./local/sbin/iw dev sta4 set bitrates legacy-2.4
command failed: Invalid argument (-22)
[root@lec2010-ath9k-1 lanforge]# ./local/sbin/iw dev sta4 set bitrates legacy-2.4 ""
Usage: ./local/sbin/iw [options] dev <devname> set bitrates [legacy-<2.4|5> <legacy rate in Mbps>*]
Sets up the specified rate masks.
Not passing any arguments would clear the existing mask (if any).
Options:
--debug enable netlink debugging
[root@lec2010-ath9k-1 lanforge]# ./local/sbin/iw dev sta4 set bitrates
command failed: Invalid argument (-22)
Thanks,
Ben
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
^ permalink raw reply
* Re: cfg80211 events
From: Franky Lin @ 2011-10-31 21:28 UTC (permalink / raw)
To: Daniel Wolstenholme; +Cc: linux-wireless@vger.kernel.org
In-Reply-To: <CAB1eQC7cXz0GpGrX7d8_nL_8d8ZAgxSzXUxqDhR7PiSSJysOoQ@mail.gmail.com>
On 10/27/2011 03:27 PM, Daniel Wolstenholme wrote:
> Hi all,
>
> I'm working with the Broadcom brcmfmac driver, and I'm attempting to improve
> event reporting, but I'm finding there's not that much documentation on
> wireless events. One big problem I'm having is that I'm using the cfg80211
> interface, but when I run "iw event -t -f", I don't see the events showing
> up. Another question I have is: is there a way to send events with
> arbitrary strings from the driver through to userspace?
>
> Any pointers would be greatly appreciated.
>
> Dan
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
Hi Dan,
Just curious, on what kind of hardware platform are you using brcmfmac?
Thanks,
Franky
^ permalink raw reply
* Any way to disable /a/g rates using 'iw'?
From: Ben Greear @ 2011-10-31 21:23 UTC (permalink / raw)
To: linux-wireless@vger.kernel.org
I notice the iw dev wlan0 set bitrates takes legacy-2.4
and legacy-5 as an argument.
Is there any way to disable all /a/g rates on 5Ghz? Basically,
I want to force the interface to only us /b rates even if the
AP it finds is on 5Ghz. I would expect in this case that it
would just fail to associate.
Thanks,
Ben
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
^ permalink raw reply
* Compat-wireless release for 2011-10-31 is baked
From: Compat-wireless cronjob account @ 2011-10-31 19:02 UTC (permalink / raw)
To: linux-wireless
compat-wireless code metrics
814862 - Total upstream lines of code being pulled
2431 - backport code changes
2113 - backport code additions
318 - backport code deletions
8588 - backport from compat module
11019 - total backport code
1.3523 - % of code consists of backport work
^ permalink raw reply
* Re: 3.1+ iwlwifi lockup
From: Guy, Wey-Yi @ 2011-10-31 15:44 UTC (permalink / raw)
To: Dave Jones
Cc: Linux Kernel, ilw@linux.intel.com, linux-wireless@vger.kernel.org
In-Reply-To: <20111031143408.GA17152@redhat.com>
On Mon, 2011-10-31 at 07:34 -0700, Dave Jones wrote:
> I just got this trace, and a driver lockup that caused me to have to
> unload & reload the iwlwifi module to get networking back.
> hardware is..
> 04:00.0 Network controller: Intel Corporation Ultimate N WiFi Link 5300
>
> This is new as of 3.1+ (This kernel was Linus' tree as of last night)
>
this is cause by an command queue bug and we will looking into it now.
Wey
> Dave
>
> [ 2669.712377] WARNING: at drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c:927 iwl_tx_cmd_complete+0x2ee/0x330 [iwlwifi]()
> [ 2669.712381] Hardware name: Adamo 13
> [ 2669.712384] wrong command queue 0 (should be 4), sequence 0x0 readp=54 writep=54
> [ 2669.712386] Modules linked in: nfs fscache auth_rpcgss nfs_acl ppdev parport_pc lp parport fuse ebtable_nat ebtables ipt_MASQUERADE iptable_nat nf_nat xt_CHECKSUM iptable_mangle tun bridge stp llc lockd bnep bluetooth ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 ip6table_filter ip6_tables arc4 dell_wmi sparse_keymap uvcvideo videodev snd_usb_audio v4l2_compat_ioctl32 snd_usbmidi_lib cdc_ether snd_rawmidi cdc_wdm usbnet cdc_acm mii snd_hda_codec_hdmi snd_hda_codec_idt snd_hda_intel snd_hda_codec snd_hwdep snd_seq snd_seq_device dell_laptop iwlwifi dcdbas microcode snd_pcm mac80211 joydev i2c_i801 pcspkr snd_timer iTCO_wdt iTCO_vendor_support snd soundcore cfg80211 snd_page_alloc tg3 rfkill wmi virtio_net kvm_intel kvm uinput sunrpc ipv6 xts gf128mul dm_crypt i915 drm_kms_helper drm i2c_algo_bit i2c_core video [last unloaded: scsi_wait_scan]
> [ 2669.712493] Pid: 2332, comm: firefox Not tainted 3.1.0+ #9
> [ 2669.712495] Call Trace:
> [ 2669.712497] <IRQ> [<ffffffff8107d16f>] warn_slowpath_common+0x7f/0xc0
> [ 2669.712509] [<ffffffff8107d266>] warn_slowpath_fmt+0x46/0x50
> [ 2669.712519] [<ffffffffa038090e>] iwl_tx_cmd_complete+0x2ee/0x330 [iwlwifi]
> [ 2669.712529] [<ffffffffa037e280>] iwl_irq_tasklet+0x210/0x8e0 [iwlwifi]
> [ 2669.712535] [<ffffffff810851fd>] tasklet_action+0x9d/0x240
> [ 2669.712539] [<ffffffff81085e28>] __do_softirq+0xc8/0x3d0
> [ 2669.712544] [<ffffffff81657f3c>] call_softirq+0x1c/0x30
> [ 2669.712549] [<ffffffff8101c735>] do_softirq+0xa5/0xe0
> [ 2669.712553] [<ffffffff810864a6>] irq_exit+0xa6/0xf0
> [ 2669.712557] [<ffffffff81658813>] do_IRQ+0x63/0xd0
> [ 2669.712561] [<ffffffff8164e5f3>] common_interrupt+0x73/0x73
> [ 2669.712563] <EOI> [<ffffffff81655c7a>] ? sysret_check+0x2e/0x69
> [ 2669.712570] ---[ end trace e86fa0935f9dc7a5 ]---
> [ 2669.712573] iwl data: 00000000: 00 00 55 55 00 00 00 00 08 53 e0 00 00 00 00 00 ..UU.....S......
> [ 2669.712577] iwl data: 00000010: 00 00 00 00 7e 04 19 00 05 00 04 00 94 07 02 00 ....~...........
> [ 2669.712619] ------------[ cut here ]------------
> [ 2669.712628] WARNING: at drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c:927 iwl_tx_cmd_complete+0x2ee/0x330 [iwlwifi]()
> [ 2669.712631] Hardware name: Adamo 13
> [ 2669.712634] wrong command queue 11 (should be 4), sequence 0x6B6B readp=54 writep=54
> [ 2669.712636] Modules linked in: nfs fscache auth_rpcgss nfs_acl ppdev parport_pc lp parport fuse ebtable_nat ebtables ipt_MASQUERADE iptable_nat nf_nat xt_CHECKSUM iptable_mangle tun bridge stp llc lockd bnep bluetooth ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 ip6table_filter ip6_tables arc4 dell_wmi sparse_keymap uvcvideo videodev snd_usb_audio v4l2_compat_ioctl32 snd_usbmidi_lib cdc_ether snd_rawmidi cdc_wdm usbnet cdc_acm mii snd_hda_codec_hdmi snd_hda_codec_idt snd_hda_intel snd_hda_codec snd_hwdep snd_seq snd_seq_device dell_laptop iwlwifi dcdbas microcode snd_pcm mac80211 joydev i2c_i801 pcspkr snd_timer iTCO_wdt iTCO_vendor_support snd soundcore cfg80211 snd_page_alloc tg3 rfkill wmi virtio_net kvm_intel kvm uinput sunrpc ipv6 xts gf128mul dm_crypt i915 drm_kms_helper drm i2c_algo_bit i2c_core video [last unloaded: scsi_wait_scan]
> [ 2669.712729] Pid: 2332, comm: firefox Tainted: G W 3.1.0+ #9
> [ 2669.712731] Call Trace:
> [ 2669.712733] <IRQ> [<ffffffff8107d16f>] warn_slowpath_common+0x7f/0xc0
> [ 2669.712743] [<ffffffff8164de90>] ? _raw_spin_unlock_irqrestore+0x40/0x90
> [ 2669.712747] [<ffffffff8107d266>] warn_slowpath_fmt+0x46/0x50
> [ 2669.712753] [<ffffffff810c189f>] ? trace_hardirqs_on_caller+0x1f/0x1b0
> [ 2669.712762] [<ffffffffa038090e>] iwl_tx_cmd_complete+0x2ee/0x330 [iwlwifi]
> [ 2669.712772] [<ffffffffa037e280>] iwl_irq_tasklet+0x210/0x8e0 [iwlwifi]
> [ 2669.712777] [<ffffffff810851fd>] tasklet_action+0x9d/0x240
> [ 2669.712781] [<ffffffff81085e28>] __do_softirq+0xc8/0x3d0
> [ 2669.712785] [<ffffffff81657f3c>] call_softirq+0x1c/0x30
> [ 2669.712789] [<ffffffff8101c735>] do_softirq+0xa5/0xe0
> [ 2669.712792] [<ffffffff810864a6>] irq_exit+0xa6/0xf0
> [ 2669.712796] [<ffffffff81658813>] do_IRQ+0x63/0xd0
> [ 2669.712800] [<ffffffff8164e5f3>] common_interrupt+0x73/0x73
> [ 2669.712802] <EOI> [<ffffffff81655c7a>] ? sysret_check+0x2e/0x69
> [ 2669.712808] ---[ end trace e86fa0935f9dc7a6 ]---
> [ 2669.712811] iwl data: 00000000: 00 00 55 55 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b ..UUkkkkkkkkkkkk
> [ 2669.712815] iwl data: 00000010: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk
> [ 2669.712818] ------------[ cut here ]------------
> [ 2669.712826] WARNING: at drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c:927 iwl_tx_cmd_complete+0x2ee/0x330 [iwlwifi]()
> [ 2669.712829] Hardware name: Adamo 13
> [ 2669.712832] wrong command queue 11 (should be 4), sequence 0x6B6B readp=54 writep=54
> [ 2669.712834] Modules linked in: nfs fscache auth_rpcgss nfs_acl ppdev parport_pc lp parport fuse ebtable_nat ebtables ipt_MASQUERADE iptable_nat nf_nat xt_CHECKSUM iptable_mangle tun bridge stp llc lockd bnep bluetooth ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 ip6table_filter ip6_tables arc4 dell_wmi sparse_keymap uvcvideo videodev snd_usb_audio v4l2_compat_ioctl32 snd_usbmidi_lib cdc_ether snd_rawmidi cdc_wdm usbnet cdc_acm mii snd_hda_codec_hdmi snd_hda_codec_idt snd_hda_intel snd_hda_codec snd_hwdep snd_seq snd_seq_device dell_laptop iwlwifi dcdbas microcode snd_pcm mac80211 joydev i2c_i801 pcspkr snd_timer iTCO_wdt iTCO_vendor_support snd soundcore cfg80211 snd_page_alloc tg3 rfkill wmi virtio_net kvm_intel kvm uinput sunrpc ipv6 xts gf128mul dm_crypt i915 drm_kms_helper drm i2c_algo_bit i2c_core video [last unloaded: scsi_wait_scan]
> [ 2669.712925] Pid: 2332, comm: firefox Tainted: G W 3.1.0+ #9
> [ 2669.712928] Call Trace:
> [ 2669.712930] <IRQ> [<ffffffff8107d16f>] warn_slowpath_common+0x7f/0xc0
> [ 2669.712938] [<ffffffff8107d266>] warn_slowpath_fmt+0x46/0x50
> [ 2669.712948] [<ffffffffa038090e>] iwl_tx_cmd_complete+0x2ee/0x330 [iwlwifi]
> [ 2669.712958] [<ffffffffa037e280>] iwl_irq_tasklet+0x210/0x8e0 [iwlwifi]
> [ 2669.712963] [<ffffffff810851fd>] tasklet_action+0x9d/0x240
> [ 2669.712967] [<ffffffff81085e28>] __do_softirq+0xc8/0x3d0
> [ 2669.712971] [<ffffffff81657f3c>] call_softirq+0x1c/0x30
> [ 2669.712975] [<ffffffff8101c735>] do_softirq+0xa5/0xe0
> [ 2669.712979] [<ffffffff810864a6>] irq_exit+0xa6/0xf0
> [ 2669.712982] [<ffffffff81658813>] do_IRQ+0x63/0xd0
> [ 2669.712986] [<ffffffff8164e5f3>] common_interrupt+0x73/0x73
> [ 2669.712988] <EOI> [<ffffffff81655c7a>] ? sysret_check+0x2e/0x69
> [ 2669.712994] ---[ end trace e86fa0935f9dc7a7 ]---
> [ 2669.712997] iwl data: 00000000: 00 00 55 55 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b ..UUkkkkkkkkkkkk
> [ 2669.713018] iwl data: 00000010: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk
> [ 2669.713136] ------------[ cut here ]------------
> [ 2669.713146] WARNING: at drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c:927 iwl_tx_cmd_complete+0x2ee/0x330 [iwlwifi]()
> [ 2669.713150] Hardware name: Adamo 13
> [ 2669.713153] wrong command queue 11 (should be 4), sequence 0x6B6B readp=54 writep=54
> [ 2669.713157] Modules linked in: nfs fscache auth_rpcgss nfs_acl ppdev parport_pc lp parport fuse ebtable_nat ebtables ipt_MASQUERADE iptable_nat nf_nat xt_CHECKSUM iptable_mangle tun bridge stp llc lockd bnep bluetooth ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 ip6table_filter ip6_tables arc4 dell_wmi sparse_keymap uvcvideo videodev snd_usb_audio v4l2_compat_ioctl32 snd_usbmidi_lib cdc_ether snd_rawmidi cdc_wdm usbnet cdc_acm mii snd_hda_codec_hdmi snd_hda_codec_idt snd_hda_intel snd_hda_codec snd_hwdep snd_seq snd_seq_device dell_laptop iwlwifi dcdbas microcode snd_pcm mac80211 joydev i2c_i801 pcspkr snd_timer iTCO_wdt iTCO_vendor_support snd soundcore cfg80211 snd_page_alloc tg3 rfkill wmi virtio_net kvm_intel kvm uinput sunrpc ipv6 xts gf128mul dm_crypt i915 drm_kms_helper drm i2c_algo_bit i2c_core video [last unloaded: scsi_wait_scan]
> [ 2669.713292] Pid: 2332, comm: firefox Tainted: G W 3.1.0+ #9
> [ 2669.713295] Call Trace:
> [ 2669.713297] <IRQ> [<ffffffff8107d16f>] warn_slowpath_common+0x7f/0xc0
> [ 2669.713308] [<ffffffff8107d266>] warn_slowpath_fmt+0x46/0x50
> [ 2669.713319] [<ffffffffa038090e>] iwl_tx_cmd_complete+0x2ee/0x330 [iwlwifi]
> [ 2669.713331] [<ffffffffa037e280>] iwl_irq_tasklet+0x210/0x8e0 [iwlwifi]
> [ 2669.713337] [<ffffffff810851fd>] tasklet_action+0x9d/0x240
> [ 2669.713342] [<ffffffff81085e28>] __do_softirq+0xc8/0x3d0
> [ 2669.713347] [<ffffffff81657f3c>] call_softirq+0x1c/0x30
> [ 2669.713353] [<ffffffff8101c735>] do_softirq+0xa5/0xe0
> [ 2669.713357] [<ffffffff810864a6>] irq_exit+0xa6/0xf0
> [ 2669.713362] [<ffffffff81658813>] do_IRQ+0x63/0xd0
> [ 2669.713367] [<ffffffff8164e5f3>] common_interrupt+0x73/0x73
> [ 2669.713369] <EOI> [<ffffffff81655c7a>] ? sysret_check+0x2e/0x69
> [ 2669.713377] ---[ end trace e86fa0935f9dc7a8 ]---
> [ 2669.713380] iwl data: 00000000: 00 00 55 55 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b ..UUkkkkkkkkkkkk
> [ 2669.713385] iwl data: 00000010: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk
> [ 2670.784424] iwlwifi 0000:04:00.0: Microcode SW error detected. Restarting 0x2000000.
> [ 2670.784431] iwlwifi 0000:04:00.0: Loaded firmware version: 8.83.5.1 build 33692
> [ 2670.784556] iwlwifi 0000:04:00.0: Start IWL Error Log Dump:
> [ 2670.784559] iwlwifi 0000:04:00.0: Status: 0x000412E4, count: 5
> [ 2670.784562] iwlwifi 0000:04:00.0: 0x00000005 | SYSASSERT
> [ 2670.784565] iwlwifi 0000:04:00.0: 0x000024EC | uPc
> [ 2670.784568] iwlwifi 0000:04:00.0: 0x000024C8 | branchlink1
> [ 2670.784570] iwlwifi 0000:04:00.0: 0x000024C8 | branchlink2
> [ 2670.784573] iwlwifi 0000:04:00.0: 0x00000916 | interruptlink1
> [ 2670.784576] iwlwifi 0000:04:00.0: 0x00000000 | interruptlink2
> [ 2670.784578] iwlwifi 0000:04:00.0: 0x000000FF | data1
> [ 2670.784580] iwlwifi 0000:04:00.0: 0x00000489 | data2
> [ 2670.784583] iwlwifi 0000:04:00.0: 0x00000489 | line
> [ 2670.784585] iwlwifi 0000:04:00.0: 0x1A41414C | beacon time
> [ 2670.784588] iwlwifi 0000:04:00.0: 0x54956EB4 | tsf low
> [ 2670.784591] iwlwifi 0000:04:00.0: 0x000004FB | tsf hi
> [ 2670.784593] iwlwifi 0000:04:00.0: 0x00000000 | time gp1
> [ 2670.784596] iwlwifi 0000:04:00.0: 0x9D4D53F1 | time gp2
> [ 2670.784598] iwlwifi 0000:04:00.0: 0x00000000 | time gp3
> [ 2670.784601] iwlwifi 0000:04:00.0: 0x00010853 | uCode version
> [ 2670.784603] iwlwifi 0000:04:00.0: 0x00000024 | hw version
> [ 2670.784606] iwlwifi 0000:04:00.0: 0x00480302 | board version
> [ 2670.784609] iwlwifi 0000:04:00.0: 0x0B15001C | hcmd
> [ 2670.784611] iwlwifi 0000:04:00.0: CSR values:
> [ 2670.784614] iwlwifi 0000:04:00.0: (2nd byte of CSR_INT_COALESCING is CSR_INT_PERIODIC_REG)
> [ 2670.784641] iwlwifi 0000:04:00.0: CSR_HW_IF_CONFIG_REG: 0X00480302
> [ 2670.784666] iwlwifi 0000:04:00.0: CSR_INT_COALESCING: 0X00000040
> [ 2670.784691] iwlwifi 0000:04:00.0: CSR_INT: 0X00000000
> [ 2670.784715] iwlwifi 0000:04:00.0: CSR_INT_MASK: 0X00000000
> [ 2670.784740] iwlwifi 0000:04:00.0: CSR_FH_INT_STATUS: 0X00000000
> [ 2670.784765] iwlwifi 0000:04:00.0: CSR_GPIO_IN: 0X00000000
> [ 2670.784790] iwlwifi 0000:04:00.0: CSR_RESET: 0X00000000
> [ 2670.784814] iwlwifi 0000:04:00.0: CSR_GP_CNTRL: 0X080403c5
> [ 2670.784839] iwlwifi 0000:04:00.0: CSR_HW_REV: 0X00000024
> [ 2670.784864] iwlwifi 0000:04:00.0: CSR_EEPROM_REG: 0X00000000
> [ 2670.784889] iwlwifi 0000:04:00.0: CSR_EEPROM_GP: 0X90000004
> [ 2670.784914] iwlwifi 0000:04:00.0: CSR_OTP_GP_REG: 0X00060000
> [ 2670.784938] iwlwifi 0000:04:00.0: CSR_GIO_REG: 0X00080042
> [ 2670.784963] iwlwifi 0000:04:00.0: CSR_GP_UCODE_REG: 0X00007c71
> [ 2670.784988] iwlwifi 0000:04:00.0: CSR_GP_DRIVER_REG: 0X00000000
> [ 2670.785012] iwlwifi 0000:04:00.0: CSR_UCODE_DRV_GP1: 0X00000000
> [ 2670.785037] iwlwifi 0000:04:00.0: CSR_UCODE_DRV_GP2: 0X00000000
> [ 2670.785062] iwlwifi 0000:04:00.0: CSR_LED_REG: 0X00000058
> [ 2670.785086] iwlwifi 0000:04:00.0: CSR_DRAM_INT_TBL_REG: 0X8811a5a0
> [ 2670.785111] iwlwifi 0000:04:00.0: CSR_GIO_CHICKEN_BITS: 0X27800200
> [ 2670.785136] iwlwifi 0000:04:00.0: CSR_ANA_PLL_CFG: 0X00880300
> [ 2670.785161] iwlwifi 0000:04:00.0: CSR_HW_REV_WA_REG: 0X0001001a
> [ 2670.785186] iwlwifi 0000:04:00.0: CSR_DBG_HPET_MEM_REG: 0Xffff0000
> [ 2670.785188] iwlwifi 0000:04:00.0: FH register values:
> [ 2670.785224] iwlwifi 0000:04:00.0: FH_RSCSR_CHNL0_STTS_WPTR_REG: 0X1174de00
> [ 2670.785243] iwlwifi 0000:04:00.0: FH_RSCSR_CHNL0_RBDCB_BASE_REG: 0X012abbb0
> [ 2670.785261] iwlwifi 0000:04:00.0: FH_RSCSR_CHNL0_WPTR: 0X00000048
> [ 2670.785280] iwlwifi 0000:04:00.0: FH_MEM_RCSR_CHNL0_CONFIG_REG: 0X80819104
> [ 2670.785300] iwlwifi 0000:04:00.0: FH_MEM_RSSR_SHARED_CTRL_REG: 0X000000fc
> [ 2670.785343] iwlwifi 0000:04:00.0: FH_MEM_RSSR_RX_STATUS_REG: 0X02630000
> [ 2670.785362] iwlwifi 0000:04:00.0: FH_MEM_RSSR_RX_ENABLE_ERR_IRQ2DRV: 0X00000000
> [ 2670.785380] iwlwifi 0000:04:00.0: FH_TSSR_TX_STATUS_REG: 0X07ff0001
> [ 2670.785389] iwlwifi 0000:04:00.0: FH_TSSR_TX_ERROR_REG: 0X00000000
> [ 2670.785389] iwlwifi 0000:04:00.0: Start IWL Event Log Dump: display last 20 entries
> [ 2670.785389] iwlwifi 0000:04:00.0: EVT_LOGT:2638087993:0x00000000:0355
> [ 2670.785389] iwlwifi 0000:04:00.0: EVT_LOGT:2638088265:0x00000113:0106
> [ 2670.785389] iwlwifi 0000:04:00.0: EVT_LOGT:2638088266:0x00000000:0302
> [ 2670.785389] iwlwifi 0000:04:00.0: EVT_LOGT:2638088289:0x00000000:0355
> [ 2670.785389] iwlwifi 0000:04:00.0: EVT_LOGT:2638088453:0x00000113:0106
> [ 2670.785389] iwlwifi 0000:04:00.0: EVT_LOGT:2638088455:0x00000000:0302
> [ 2670.785389] iwlwifi 0000:04:00.0: EVT_LOGT:2638088478:0x00000000:0355
> [ 2670.785389] iwlwifi 0000:04:00.0: EVT_LOGT:2638088750:0x0b15001c:0206
> [ 2670.785389] iwlwifi 0000:04:00.0: EVT_LOGT:2638088752:0x00000001:0204
> [ 2670.785389] iwlwifi 0000:04:00.0: EVT_LOGT:2638088755:0x00000001:0214
> [ 2670.785389] iwlwifi 0000:04:00.0: EVT_LOGT:2638088756:0x01002111:0209
> [ 2670.785389] iwlwifi 0000:04:00.0: EVT_LOGT:2638089055:0x00000000:0210
> [ 2670.785389] iwlwifi 0000:04:00.0: EVT_LOGT:2638089065:0x00000000:0207
> [ 2670.785389] iwlwifi 0000:04:00.0: EVT_LOGT:2638089067:0x01002111:0211
> [ 2670.785389] iwlwifi 0000:04:00.0: EVT_LOGT:2638089072:0x00000000:0212
> [ 2670.785389] iwlwifi 0000:04:00.0: EVT_LOGT:2638090106:0x00000000:0215
> [ 2670.785389] iwlwifi 0000:04:00.0: EVT_LOGT:2638090108:0x00000008:0220
> [ 2670.785389] iwlwifi 0000:04:00.0: EVT_LOGT:2638090127:0x00000000:0301
> [ 2670.785389] iwlwifi 0000:04:00.0: EVT_LOGT:2638090315:0x00000000:0355
> [ 2670.785389] iwlwifi 0000:04:00.0: EVT_LOGT:2639090696:0x00000000:0125
> [ 2670.795643] ieee80211 phy0: Hardware restart was requested
> [ 2670.795729] iwlwifi 0000:04:00.0: L1 Enabled; Disabling L0S
> [ 2670.798779] iwlwifi 0000:04:00.0: Radio type=0x0-0x2-0x0
>
^ permalink raw reply
* Re: [PATCH v2] NFC: update to NCI spec 1.0 draft 18
From: Gustavo Padovan @ 2011-10-31 15:51 UTC (permalink / raw)
To: ilanelias78
Cc: aloisio.almeida, lauro.venancio, samuel, linville, linux-wireless,
Ilan Elias
In-Reply-To: <1319551485-17963-1-git-send-email-ilane@ti.com>
Hi Ilian,
* ilanelias78@gmail.com <ilanelias78@gmail.com> [2011-10-25 16:04:45 +0200]:
> From: Ilan Elias <ilane@ti.com>
>
> Update supported features according to NCI spec 1.0 draft 18.
> No new features were introduced.
> The changes are related only to the NCI protocol layer.
>
> Summary of the main changes:
> - Addition, deletion, and modification of NCI constants
> - Changes in NCI commands, responses and notifications structures
> - Check if data flow control is used in nci_tx_work
> - No need to create the static rf connection anymore
> - Set available credits to initial value when target is deactivated
>
> Signed-off-by: Ilan Elias <ilane@ti.com>
> ---
> include/net/nfc/nci.h | 208 ++++++++++++++++++++++---------------------
> include/net/nfc/nci_core.h | 13 +--
> net/nfc/nci/core.c | 17 ++--
> net/nfc/nci/data.c | 5 +-
> net/nfc/nci/lib.c | 8 +--
> net/nfc/nci/ntf.c | 152 +++++++++++++++++++-------------
> net/nfc/nci/rsp.c | 149 ++++++++++++++-----------------
> 7 files changed, 281 insertions(+), 271 deletions(-)
>
> diff --git a/include/net/nfc/nci.h b/include/net/nfc/nci.h
> index 39b85bc..e4a2632 100644
> --- a/include/net/nfc/nci.h
> +++ b/include/net/nfc/nci.h
> @@ -33,47 +33,49 @@
> #define NCI_MAX_NUM_RF_CONFIGS 10
> #define NCI_MAX_NUM_CONN 10
>
> -/* NCI Status Codes */
> -#define NCI_STATUS_OK 0x00
> -#define NCI_STATUS_REJECTED 0x01
> -#define NCI_STATUS_MESSAGE_CORRUPTED 0x02
> -#define NCI_STATUS_BUFFER_FULL 0x03
> -#define NCI_STATUS_FAILED 0x04
> -#define NCI_STATUS_NOT_INITIALIZED 0x05
> -#define NCI_STATUS_SYNTAX_ERROR 0x06
> -#define NCI_STATUS_SEMANTIC_ERROR 0x07
> -#define NCI_STATUS_UNKNOWN_GID 0x08
> -#define NCI_STATUS_UNKNOWN_OID 0x09
> -#define NCI_STATUS_INVALID_PARAM 0x0a
> -#define NCI_STATUS_MESSAGE_SIZE_EXCEEDED 0x0b
> -/* Discovery Specific Status Codes */
> -#define NCI_STATUS_DISCOVERY_ALREADY_STARTED 0xa0
> -#define NCI_STATUS_DISCOVERY_TARGET_ACTIVATION_FAILED 0xa1
> +/* Generic Status Codes */
> +#define NCI_STATUS_OK 0x00
> +#define NCI_STATUS_REJECTED 0x01
> +#define NCI_STATUS_RF_FRAME_CORRUPTED 0x02
> +#define NCI_STATUS_FAILED 0x03
> +#define NCI_STATUS_NOT_INITIALIZED 0x04
> +#define NCI_STATUS_SYNTAX_ERROR 0x05
> +#define NCI_STATUS_SEMANTIC_ERROR 0x06
> +#define NCI_STATUS_UNKNOWN_GID 0x07
> +#define NCI_STATUS_UNKNOWN_OID 0x08
> +#define NCI_STATUS_INVALID_PARAM 0x09
> +#define NCI_STATUS_MESSAGE_SIZE_EXCEEDED 0x0a
> +/* RF Discovery Specific Status Codes */
> +#define NCI_STATUS_DISCOVERY_ALREADY_STARTED 0xa0
> +#define NCI_STATUS_DISCOVERY_TARGET_ACTIVATION_FAILED 0xa1
> +#define NCI_STATUS_DISCOVERY_TEAR_DOWN 0xa2
> /* RF Interface Specific Status Codes */
> -#define NCI_STATUS_RF_TRANSMISSION_ERROR 0xb0
> -#define NCI_STATUS_RF_PROTOCOL_ERROR 0xb1
> -#define NCI_STATUS_RF_TIMEOUT_ERROR 0xb2
> -#define NCI_STATUS_RF_LINK_LOSS_ERROR 0xb3
> +#define NCI_STATUS_RF_TRANSMISSION_ERROR 0xb0
> +#define NCI_STATUS_RF_PROTOCOL_ERROR 0xb1
> +#define NCI_STATUS_RF_TIMEOUT_ERROR 0xb2
> /* NFCEE Interface Specific Status Codes */
> -#define NCI_STATUS_MAX_ACTIVE_NFCEE_INTERFACES_REACHED 0xc0
> -#define NCI_STATUS_NFCEE_INTERFACE_ACTIVATION_FAILED 0xc1
> -#define NCI_STATUS_NFCEE_TRANSMISSION_ERROR 0xc2
> -#define NCI_STATUS_NFCEE_PROTOCOL_ERROR 0xc3
> +#define NCI_STATUS_MAX_ACTIVE_NFCEE_INTERFACES_REACHED 0xc0
> +#define NCI_STATUS_NFCEE_INTERFACE_ACTIVATION_FAILED 0xc1
> +#define NCI_STATUS_NFCEE_TRANSMISSION_ERROR 0xc2
> +#define NCI_STATUS_NFCEE_PROTOCOL_ERROR 0xc3
> #define NCI_STATUS_NFCEE_TIMEOUT_ERROR 0xc4
>
> -/* NCI RF Technology and Mode */
> -#define NCI_NFC_A_PASSIVE_POLL_MODE 0x00
> -#define NCI_NFC_B_PASSIVE_POLL_MODE 0x01
> -#define NCI_NFC_F_PASSIVE_POLL_MODE 0x02
> -#define NCI_NFC_A_ACTIVE_POLL_MODE 0x03
> -#define NCI_NFC_F_ACTIVE_POLL_MODE 0x05
> -#define NCI_NFC_A_PASSIVE_LISTEN_MODE 0x80
> -#define NCI_NFC_B_PASSIVE_LISTEN_MODE 0x81
> -#define NCI_NFC_F_PASSIVE_LISTEN_MODE 0x82
> -#define NCI_NFC_A_ACTIVE_LISTEN_MODE 0x83
> -#define NCI_NFC_F_ACTIVE_LISTEN_MODE 0x85
> -
> -/* NCI RF Protocols */
> +/* RF Technologies */
> +#define NCI_NFC_RF_TECHNOLOGY_A 0x00
> +#define NCI_NFC_RF_TECHNOLOGY_B 0x01
> +#define NCI_NFC_RF_TECHNOLOGY_F 0x02
> +#define NCI_NFC_RF_TECHNOLOGY_15693 0x03
> +
> +/* Bit Rates */
> +#define NCI_NFC_BIT_RATE_106 0x00
> +#define NCI_NFC_BIT_RATE_212 0x01
> +#define NCI_NFC_BIT_RATE_424 0x02
> +#define NCI_NFC_BIT_RATE_848 0x03
> +#define NCI_NFC_BIT_RATE_1696 0x04
> +#define NCI_NFC_BIT_RATE_3392 0x05
> +#define NCI_NFC_BIT_RATE_6784 0x06
> +
> +/* RF Protocols */
> #define NCI_RF_PROTOCOL_UNKNOWN 0x00
> #define NCI_RF_PROTOCOL_T1T 0x01
> #define NCI_RF_PROTOCOL_T2T 0x02
> @@ -81,38 +83,54 @@
> #define NCI_RF_PROTOCOL_ISO_DEP 0x04
> #define NCI_RF_PROTOCOL_NFC_DEP 0x05
>
> -/* NCI RF Interfaces */
> -#define NCI_RF_INTERFACE_RFU 0x00
> -#define NCI_RF_INTERFACE_FRAME 0x01
> -#define NCI_RF_INTERFACE_ISO_DEP 0x02
> -#define NCI_RF_INTERFACE_NFC_DEP 0x03
> +/* RF Interfaces */
> +#define NCI_RF_INTERFACE_NFCEE_DIRECT 0x00
> +#define NCI_RF_INTERFACE_FRAME 0x01
> +#define NCI_RF_INTERFACE_ISO_DEP 0x02
> +#define NCI_RF_INTERFACE_NFC_DEP 0x03
>
> -/* NCI RF_DISCOVER_MAP_CMD modes */
> +/* Reset types */
> +#define NCI_RESET_TYPE_KEEP_CONFIG 0x00
> +#define NCI_RESET_TYPE_RESET_CONFIG 0x01
> +
> +/* Static RF connection ID */
> +#define NCI_STATIC_RF_CONN_ID 0x00
> +
> +/* RF_DISCOVER_MAP_CMD modes */
> #define NCI_DISC_MAP_MODE_POLL 0x01
> #define NCI_DISC_MAP_MODE_LISTEN 0x02
> #define NCI_DISC_MAP_MODE_BOTH 0x03
>
> -/* NCI Discovery Types */
> +/* Discovery Types */
> #define NCI_DISCOVERY_TYPE_POLL_A_PASSIVE 0x00
> -#define NCI_DISCOVERY_TYPE_POLL_B_PASSIVE 0x01
> -#define NCI_DISCOVERY_TYPE_POLL_F_PASSIVE 0x02
> -#define NCI_DISCOVERY_TYPE_POLL_A_ACTIVE 0x03
> -#define NCI_DISCOVERY_TYPE_POLL_F_ACTIVE 0x05
> -#define NCI_DISCOVERY_TYPE_WAKEUP_A_PASSIVE 0x06
> -#define NCI_DISCOVERY_TYPE_WAKEUP_B_PASSIVE 0x07
> -#define NCI_DISCOVERY_TYPE_WAKEUP_A_ACTIVE 0x09
> -#define NCI_DISCOVERY_TYPE_LISTEN_A_PASSIVE 0x80
> -#define NCI_DISCOVERY_TYPE_LISTEN_B_PASSIVE 0x81
> -#define NCI_DISCOVERY_TYPE_LISTEN_F_PASSIVE 0x82
> -#define NCI_DISCOVERY_TYPE_LISTEN_A_ACTIVE 0x83
> -#define NCI_DISCOVERY_TYPE_LISTEN_F_ACTIVE 0x85
> -
> -/* NCI Deactivation Type */
> -#define NCI_DEACTIVATE_TYPE_IDLE_MODE 0x00
> -#define NCI_DEACTIVATE_TYPE_SLEEP_MODE 0x01
> -#define NCI_DEACTIVATE_TYPE_SLEEP_AF_MODE 0x02
> -#define NCI_DEACTIVATE_TYPE_RF_LINK_LOSS 0x03
> -#define NCI_DEACTIVATE_TYPE_DISCOVERY_ERROR 0x04
> +#define NCI_DISCOVERY_TYPE_POLL_B_PASSIVE 0x01
> +#define NCI_DISCOVERY_TYPE_POLL_F_PASSIVE 0x02
> +#define NCI_DISCOVERY_TYPE_POLL_A_ACTIVE 0x03
> +#define NCI_DISCOVERY_TYPE_POLL_F_ACTIVE 0x05
> +#define NCI_DISCOVERY_TYPE_WAKEUP_A_ACTIVE 0x09
> +#define NCI_DISCOVERY_TYPE_LISTEN_A_PASSIVE 0x80
> +#define NCI_DISCOVERY_TYPE_LISTEN_B_PASSIVE 0x81
> +#define NCI_DISCOVERY_TYPE_LISTEN_F_PASSIVE 0x82
> +#define NCI_DISCOVERY_TYPE_LISTEN_A_ACTIVE 0x83
> +#define NCI_DISCOVERY_TYPE_LISTEN_F_ACTIVE 0x85
> +
> +/* RF Technology and Mode */
> +#define NCI_NFC_A_PASSIVE_POLL_MODE 0x00
> +#define NCI_NFC_B_PASSIVE_POLL_MODE 0x01
> +#define NCI_NFC_F_PASSIVE_POLL_MODE 0x02
> +#define NCI_NFC_A_ACTIVE_POLL_MODE 0x03
> +#define NCI_NFC_F_ACTIVE_POLL_MODE 0x05
> +#define NCI_NFC_A_PASSIVE_LISTEN_MODE 0x80
> +#define NCI_NFC_B_PASSIVE_LISTEN_MODE 0x81
> +#define NCI_NFC_F_PASSIVE_LISTEN_MODE 0x82
> +#define NCI_NFC_A_ACTIVE_LISTEN_MODE 0x83
> +#define NCI_NFC_F_ACTIVE_LISTEN_MODE 0x85
> +
> +/* Deactivation Type */
> +#define NCI_DEACTIVATE_TYPE_IDLE_MODE 0x00
> +#define NCI_DEACTIVATE_TYPE_SLEEP_MODE 0x01
> +#define NCI_DEACTIVATE_TYPE_SLEEP_AF_MODE 0x02
> +#define NCI_DEACTIVATE_TYPE_DISCOVERY 0x03
>
> /* Message Type (MT) */
> #define NCI_MT_DATA_PKT 0x00
> @@ -144,10 +162,10 @@
> #define nci_conn_id(hdr) (__u8)(((hdr)[0])&0x0f)
>
> /* GID values */
> -#define NCI_GID_CORE 0x0
> -#define NCI_GID_RF_MGMT 0x1
> -#define NCI_GID_NFCEE_MGMT 0x2
> -#define NCI_GID_PROPRIETARY 0xf
> +#define NCI_GID_CORE 0x0
> +#define NCI_GID_RF_MGMT 0x1
> +#define NCI_GID_NFCEE_MGMT 0x2
> +#define NCI_GID_PROPRIETARY 0xf
>
> /* ---- NCI Packet structures ---- */
> #define NCI_CTRL_HDR_SIZE 3
> @@ -169,18 +187,11 @@ struct nci_data_hdr {
> /* ----- NCI Commands ---- */
> /* ------------------------ */
> #define NCI_OP_CORE_RESET_CMD nci_opcode_pack(NCI_GID_CORE, 0x00)
> -
> -#define NCI_OP_CORE_INIT_CMD nci_opcode_pack(NCI_GID_CORE, 0x01)
> -
> -#define NCI_OP_CORE_SET_CONFIG_CMD nci_opcode_pack(NCI_GID_CORE, 0x02)
> -
> -#define NCI_OP_CORE_CONN_CREATE_CMD nci_opcode_pack(NCI_GID_CORE, 0x04)
> -struct nci_core_conn_create_cmd {
> - __u8 target_handle;
> - __u8 num_target_specific_params;
> +struct nci_core_reset_cmd {
> + __u8 reset_type;
> } __packed;
>
> -#define NCI_OP_CORE_CONN_CLOSE_CMD nci_opcode_pack(NCI_GID_CORE, 0x06)
> +#define NCI_OP_CORE_INIT_CMD nci_opcode_pack(NCI_GID_CORE, 0x01)
>
> #define NCI_OP_RF_DISCOVER_MAP_CMD nci_opcode_pack(NCI_GID_RF_MGMT, 0x00)
> struct disc_map_config {
> @@ -218,6 +229,7 @@ struct nci_rf_deactivate_cmd {
> struct nci_core_reset_rsp {
> __u8 status;
> __u8 nci_ver;
> + __u8 config_status;
> } __packed;
>
> #define NCI_OP_CORE_INIT_RSP nci_opcode_pack(NCI_GID_CORE, 0x01)
> @@ -232,24 +244,14 @@ struct nci_core_init_rsp_1 {
> struct nci_core_init_rsp_2 {
> __u8 max_logical_connections;
> __le16 max_routing_table_size;
> - __u8 max_control_packet_payload_length;
> - __le16 rf_sending_buffer_size;
> - __le16 rf_receiving_buffer_size;
> - __le16 manufacturer_id;
> -} __packed;
> -
> -#define NCI_OP_CORE_SET_CONFIG_RSP nci_opcode_pack(NCI_GID_CORE, 0x02)
> -
> -#define NCI_OP_CORE_CONN_CREATE_RSP nci_opcode_pack(NCI_GID_CORE, 0x04)
> -struct nci_core_conn_create_rsp {
> - __u8 status;
> - __u8 max_pkt_payload_size;
> + __u8 max_control_pkt_payload_len;
> + __le16 max_size_for_large_params;
> + __u8 max_data_pkt_payload_size;
> __u8 initial_num_credits;
> - __u8 conn_id;
> + __u8 manufacturer_id;
> + __le32 manufacturer_specific_info;
> } __packed;
>
> -#define NCI_OP_CORE_CONN_CLOSE_RSP nci_opcode_pack(NCI_GID_CORE, 0x06)
> -
> #define NCI_OP_RF_DISCOVER_MAP_RSP nci_opcode_pack(NCI_GID_RF_MGMT, 0x00)
>
> #define NCI_OP_RF_DISCOVER_RSP nci_opcode_pack(NCI_GID_RF_MGMT, 0x03)
> @@ -270,12 +272,7 @@ struct nci_core_conn_credit_ntf {
> struct conn_credit_entry conn_entries[NCI_MAX_NUM_CONN];
> } __packed;
>
> -#define NCI_OP_RF_FIELD_INFO_NTF nci_opcode_pack(NCI_GID_CORE, 0x08)
> -struct nci_rf_field_info_ntf {
> - __u8 rf_field_status;
> -} __packed;
> -
> -#define NCI_OP_RF_ACTIVATE_NTF nci_opcode_pack(NCI_GID_RF_MGMT, 0x05)
> +#define NCI_OP_RF_INTF_ACTIVATED_NTF nci_opcode_pack(NCI_GID_RF_MGMT, 0x05)
> struct rf_tech_specific_params_nfca_poll {
> __u16 sens_res;
> __u8 nfcid1_len; /* 0, 4, 7, or 10 Bytes */
> @@ -289,17 +286,20 @@ struct activation_params_nfca_poll_iso_dep {
> __u8 rats_res[20];
> };
>
> -struct nci_rf_activate_ntf {
> - __u8 target_handle;
> +struct nci_rf_intf_activated_ntf {
> + __u8 rf_discovery_id;
> + __u8 rf_interface_type;
> __u8 rf_protocol;
> - __u8 rf_tech_and_mode;
> + __u8 activation_rf_tech_and_mode;
> __u8 rf_tech_specific_params_len;
>
> union {
> struct rf_tech_specific_params_nfca_poll nfca_poll;
> } rf_tech_specific_params;
>
> - __u8 rf_interface_type;
> + __u8 data_exchange_rf_tech_and_mode;
> + __u8 data_exchange_tx_bit_rate;
> + __u8 data_exchange_rx_bit_rate;
> __u8 activation_params_len;
Aren't these names too big? Do you really need such a big names?
>
> union {
> @@ -309,5 +309,9 @@ struct nci_rf_activate_ntf {
> } __packed;
>
> #define NCI_OP_RF_DEACTIVATE_NTF nci_opcode_pack(NCI_GID_RF_MGMT, 0x06)
> +struct nci_rf_deactivate_ntf {
> + __u8 type;
> + __u8 reason;
> +} __packed;
What about a patch that only change the defines? Could make things easier to
review.
>
> #endif /* __NCI_H */
> diff --git a/include/net/nfc/nci_core.h b/include/net/nfc/nci_core.h
> index b8b4bbd..77b7c9e 100644
> --- a/include/net/nfc/nci_core.h
> +++ b/include/net/nfc/nci_core.h
> @@ -109,15 +109,12 @@ struct nci_dev {
> [NCI_MAX_SUPPORTED_RF_INTERFACES];
> __u8 max_logical_connections;
> __u16 max_routing_table_size;
> - __u8 max_control_packet_payload_length;
> - __u16 rf_sending_buffer_size;
> - __u16 rf_receiving_buffer_size;
> - __u16 manufacturer_id;
> -
> - /* received during NCI_OP_CORE_CONN_CREATE_RSP for static conn 0 */
> - __u8 max_pkt_payload_size;
> + __u8 max_control_pkt_payload_len;
> + __u16 max_size_for_large_params;
> + __u8 max_data_pkt_payload_size;
> __u8 initial_num_credits;
> - __u8 conn_id;
> + __u8 manufacturer_id;
> + __u32 manufacturer_specific_info;
>
> /* stored during nci_data_exchange */
> data_exchange_cb_t data_exchange_cb;
> diff --git a/net/nfc/nci/core.c b/net/nfc/nci/core.c
> index 4047e29..056cd37 100644
> --- a/net/nfc/nci/core.c
> +++ b/net/nfc/nci/core.c
> @@ -125,7 +125,10 @@ static inline int nci_request(struct nci_dev *ndev,
>
> static void nci_reset_req(struct nci_dev *ndev, unsigned long opt)
> {
> - nci_send_cmd(ndev, NCI_OP_CORE_RESET_CMD, 0, NULL);
> + struct nci_core_reset_cmd cmd;
> +
> + cmd.reset_type = NCI_RESET_TYPE_RESET_CONFIG;
> + nci_send_cmd(ndev, NCI_OP_CORE_RESET_CMD, 1, &cmd);
> }
>
> static void nci_init_req(struct nci_dev *ndev, unsigned long opt)
> @@ -135,17 +138,11 @@ static void nci_init_req(struct nci_dev *ndev, unsigned long opt)
>
> static void nci_init_complete_req(struct nci_dev *ndev, unsigned long opt)
> {
> - struct nci_core_conn_create_cmd conn_cmd;
> struct nci_rf_disc_map_cmd cmd;
> struct disc_map_config *cfg = cmd.mapping_configs;
> __u8 *num = &cmd.num_mapping_configs;
> int i;
>
> - /* create static rf connection */
> - conn_cmd.target_handle = 0;
> - conn_cmd.num_target_specific_params = 0;
> - nci_send_cmd(ndev, NCI_OP_CORE_CONN_CREATE_CMD, 2, &conn_cmd);
> -
> /* set rf mapping configurations */
> *num = 0;
>
> @@ -469,7 +466,7 @@ static int nci_data_exchange(struct nfc_dev *nfc_dev, __u32 target_idx,
> ndev->data_exchange_cb = cb;
> ndev->data_exchange_cb_context = cb_context;
>
> - rc = nci_send_data(ndev, ndev->conn_id, skb);
> + rc = nci_send_data(ndev, NCI_STATIC_RF_CONN_ID, skb);
> if (rc)
> clear_bit(NCI_DATA_EXCHANGE, &ndev->flags);
>
> @@ -725,7 +722,9 @@ static void nci_tx_work(struct work_struct *work)
> if (!skb)
> return;
>
> - atomic_dec(&ndev->credits_cnt);
> + /* Check if data flow control is used */
> + if (atomic_read(&ndev->credits_cnt) != 0xff)
> + atomic_dec(&ndev->credits_cnt);
This seems racy to me. Can't the value of credits_cnt change in between of
atomic_read and atomic_dec?
>
> nfc_dbg("NCI TX: MT=data, PBF=%d, conn_id=%d, plen=%d",
> nci_pbf(skb->data),
> diff --git a/net/nfc/nci/data.c b/net/nfc/nci/data.c
> index e5ed90f..511fb96 100644
> --- a/net/nfc/nci/data.c
> +++ b/net/nfc/nci/data.c
> @@ -95,7 +95,8 @@ static int nci_queue_tx_data_frags(struct nci_dev *ndev,
> __skb_queue_head_init(&frags_q);
>
> while (total_len) {
> - frag_len = min_t(int, total_len, ndev->max_pkt_payload_size);
> + frag_len =
> + min_t(int, total_len, ndev->max_data_pkt_payload_size);
>
> skb_frag = nci_skb_alloc(ndev,
> (NCI_DATA_HDR_SIZE + frag_len),
> @@ -151,7 +152,7 @@ int nci_send_data(struct nci_dev *ndev, __u8 conn_id, struct sk_buff *skb)
> nfc_dbg("entry, conn_id 0x%x, plen %d", conn_id, skb->len);
>
> /* check if the packet need to be fragmented */
> - if (skb->len <= ndev->max_pkt_payload_size) {
> + if (skb->len <= ndev->max_data_pkt_payload_size) {
> /* no need to fragment packet */
> nci_push_data_hdr(ndev, conn_id, skb, NCI_PBF_LAST);
>
> diff --git a/net/nfc/nci/lib.c b/net/nfc/nci/lib.c
> index b19dc2f..e99adcf 100644
> --- a/net/nfc/nci/lib.c
> +++ b/net/nfc/nci/lib.c
> @@ -42,12 +42,9 @@ int nci_to_errno(__u8 code)
> case NCI_STATUS_REJECTED:
> return -EBUSY;
>
> - case NCI_STATUS_MESSAGE_CORRUPTED:
> + case NCI_STATUS_RF_FRAME_CORRUPTED:
> return -EBADMSG;
>
> - case NCI_STATUS_BUFFER_FULL:
> - return -ENOBUFS;
> -
> case NCI_STATUS_NOT_INITIALIZED:
> return -EHOSTDOWN;
>
> @@ -80,9 +77,6 @@ int nci_to_errno(__u8 code)
> case NCI_STATUS_NFCEE_TIMEOUT_ERROR:
> return -ETIMEDOUT;
>
> - case NCI_STATUS_RF_LINK_LOSS_ERROR:
> - return -ENOLINK;
> -
> case NCI_STATUS_MAX_ACTIVE_NFCEE_INTERFACES_REACHED:
> return -EDQUOT;
>
> diff --git a/net/nfc/nci/ntf.c b/net/nfc/nci/ntf.c
> index 96633f5..770dfc8 100644
> --- a/net/nfc/nci/ntf.c
> +++ b/net/nfc/nci/ntf.c
> @@ -54,7 +54,7 @@ static void nci_core_conn_credits_ntf_packet(struct nci_dev *ndev,
> ntf->conn_entries[i].conn_id,
> ntf->conn_entries[i].credits);
>
> - if (ntf->conn_entries[i].conn_id == ndev->conn_id) {
> + if (ntf->conn_entries[i].conn_id == NCI_STATIC_RF_CONN_ID) {
> /* found static rf connection */
> atomic_add(ntf->conn_entries[i].credits,
> &ndev->credits_cnt);
> @@ -66,22 +66,12 @@ static void nci_core_conn_credits_ntf_packet(struct nci_dev *ndev,
> queue_work(ndev->tx_wq, &ndev->tx_work);
> }
>
> -static void nci_rf_field_info_ntf_packet(struct nci_dev *ndev,
> - struct sk_buff *skb)
> -{
> - struct nci_rf_field_info_ntf *ntf = (void *) skb->data;
> -
> - nfc_dbg("entry, rf_field_status %d", ntf->rf_field_status);
> -}
> -
> -static int nci_rf_activate_nfca_passive_poll(struct nci_dev *ndev,
> - struct nci_rf_activate_ntf *ntf, __u8 *data)
> +static __u8 *nci_extract_rf_params_nfca_passive_poll(struct nci_dev *ndev,
> + struct nci_rf_intf_activated_ntf *ntf, __u8 *data)
> {
> struct rf_tech_specific_params_nfca_poll *nfca_poll;
> - struct activation_params_nfca_poll_iso_dep *nfca_poll_iso_dep;
>
> nfca_poll = &ntf->rf_tech_specific_params.nfca_poll;
> - nfca_poll_iso_dep = &ntf->activation_params.nfca_poll_iso_dep;
>
> nfca_poll->sens_res = __le16_to_cpu(*((__u16 *)data));
> data += 2;
> @@ -100,32 +90,32 @@ static int nci_rf_activate_nfca_passive_poll(struct nci_dev *ndev,
> if (nfca_poll->sel_res_len != 0)
> nfca_poll->sel_res = *data++;
>
> - ntf->rf_interface_type = *data++;
> - ntf->activation_params_len = *data++;
> -
> - nfc_dbg("sel_res_len %d, sel_res 0x%x, rf_interface_type %d, activation_params_len %d",
> + nfc_dbg("sel_res_len %d, sel_res 0x%x",
> nfca_poll->sel_res_len,
> - nfca_poll->sel_res,
> - ntf->rf_interface_type,
> - ntf->activation_params_len);
> -
> - switch (ntf->rf_interface_type) {
> - case NCI_RF_INTERFACE_ISO_DEP:
> - nfca_poll_iso_dep->rats_res_len = *data++;
> - if (nfca_poll_iso_dep->rats_res_len > 0) {
> - memcpy(nfca_poll_iso_dep->rats_res,
> + nfca_poll->sel_res);
> +
> + return data;
> +}
> +
> +static int nci_extract_activation_params_iso_dep(struct nci_dev *ndev,
> + struct nci_rf_intf_activated_ntf *ntf, __u8 *data)
> +{
> + struct activation_params_nfca_poll_iso_dep *nfca_poll;
> +
> + switch (ntf->activation_rf_tech_and_mode) {
> + case NCI_NFC_A_PASSIVE_POLL_MODE:
> + nfca_poll = &ntf->activation_params.nfca_poll_iso_dep;
> + nfca_poll->rats_res_len = *data++;
> + if (nfca_poll->rats_res_len > 0) {
> + memcpy(nfca_poll->rats_res,
> data,
> - nfca_poll_iso_dep->rats_res_len);
> + nfca_poll->rats_res_len);
> }
> break;
>
> - case NCI_RF_INTERFACE_FRAME:
> - /* no activation params */
> - break;
> -
> default:
> - nfc_err("unsupported rf_interface_type 0x%x",
> - ntf->rf_interface_type);
> + nfc_err("unsupported activation_rf_tech_and_mode 0x%x",
> + ntf->activation_rf_tech_and_mode);
> return -EPROTO;
> }
>
> @@ -133,7 +123,7 @@ static int nci_rf_activate_nfca_passive_poll(struct nci_dev *ndev,
> }
>
> static void nci_target_found(struct nci_dev *ndev,
> - struct nci_rf_activate_ntf *ntf)
> + struct nci_rf_intf_activated_ntf *ntf)
> {
> struct nfc_target nfc_tgt;
>
> @@ -141,6 +131,8 @@ static void nci_target_found(struct nci_dev *ndev,
> nfc_tgt.supported_protocols = NFC_PROTO_MIFARE_MASK;
> else if (ntf->rf_protocol == NCI_RF_PROTOCOL_ISO_DEP) /* 4A */
> nfc_tgt.supported_protocols = NFC_PROTO_ISO14443_MASK;
> + else
> + nfc_tgt.supported_protocols = 0;
>
> nfc_tgt.sens_res = ntf->rf_tech_specific_params.nfca_poll.sens_res;
> nfc_tgt.sel_res = ntf->rf_tech_specific_params.nfca_poll.sel_res;
> @@ -158,49 +150,86 @@ static void nci_target_found(struct nci_dev *ndev,
> nfc_targets_found(ndev->nfc_dev, &nfc_tgt, 1);
> }
>
> -static void nci_rf_activate_ntf_packet(struct nci_dev *ndev,
> - struct sk_buff *skb)
> +static void nci_rf_intf_activated_ntf_packet(struct nci_dev *ndev,
> + struct sk_buff *skb)
> {
> - struct nci_rf_activate_ntf ntf;
> + struct nci_rf_intf_activated_ntf ntf;
> __u8 *data = skb->data;
> - int rc = -1;
> + int err = 0;
>
> clear_bit(NCI_DISCOVERY, &ndev->flags);
> set_bit(NCI_POLL_ACTIVE, &ndev->flags);
>
> - ntf.target_handle = *data++;
> + ntf.rf_discovery_id = *data++;
> + ntf.rf_interface_type = *data++;
> ntf.rf_protocol = *data++;
> - ntf.rf_tech_and_mode = *data++;
> + ntf.activation_rf_tech_and_mode = *data++;
> ntf.rf_tech_specific_params_len = *data++;
>
> - nfc_dbg("target_handle %d, rf_protocol 0x%x, rf_tech_and_mode 0x%x, rf_tech_specific_params_len %d",
> - ntf.target_handle,
> - ntf.rf_protocol,
> - ntf.rf_tech_and_mode,
> + nfc_dbg("rf_discovery_id %d", ntf.rf_discovery_id);
> + nfc_dbg("rf_interface_type 0x%x", ntf.rf_interface_type);
> + nfc_dbg("rf_protocol 0x%x", ntf.rf_protocol);
> + nfc_dbg("activation_rf_tech_and_mode 0x%x",
> + ntf.activation_rf_tech_and_mode);
> + nfc_dbg("rf_tech_specific_params_len %d",
> ntf.rf_tech_specific_params_len);
>
> - switch (ntf.rf_tech_and_mode) {
> - case NCI_NFC_A_PASSIVE_POLL_MODE:
> - rc = nci_rf_activate_nfca_passive_poll(ndev, &ntf,
> - data);
> - break;
> + if (ntf.rf_tech_specific_params_len > 0) {
> + switch (ntf.activation_rf_tech_and_mode) {
> + case NCI_NFC_A_PASSIVE_POLL_MODE:
> + data = nci_extract_rf_params_nfca_passive_poll(ndev,
> + &ntf, data);
> + break;
> +
> + default:
> + nfc_err("unsupported activation_rf_tech_and_mode 0x%x",
> + ntf.activation_rf_tech_and_mode);
> + return;
> + }
> + }
>
> - default:
> - nfc_err("unsupported rf_tech_and_mode 0x%x",
> - ntf.rf_tech_and_mode);
> - return;
> + ntf.data_exchange_rf_tech_and_mode = *data++;
> + ntf.data_exchange_tx_bit_rate = *data++;
> + ntf.data_exchange_rx_bit_rate = *data++;
> + ntf.activation_params_len = *data++;
> +
> + nfc_dbg("data_exchange_rf_tech_and_mode 0x%x",
> + ntf.data_exchange_rf_tech_and_mode);
> + nfc_dbg("data_exchange_tx_bit_rate 0x%x",
> + ntf.data_exchange_tx_bit_rate);
> + nfc_dbg("data_exchange_rx_bit_rate 0x%x",
> + ntf.data_exchange_rx_bit_rate);
> + nfc_dbg("activation_params_len %d",
> + ntf.activation_params_len);
> +
> + if (ntf.activation_params_len > 0) {
Seems to me that ntf.activation_params_len > 0 can be a check in the beginning
of this function.
> + switch (ntf.rf_interface_type) {
> + case NCI_RF_INTERFACE_ISO_DEP:
> + err = nci_extract_activation_params_iso_dep(ndev,
> + &ntf, data);
> + break;
> +
> + case NCI_RF_INTERFACE_FRAME:
> + /* no activation params */
> + break;
> +
> + default:
> + nfc_err("unsupported rf_interface_type 0x%x",
> + ntf.rf_interface_type);
> + return;
> + }
> }
>
> - if (!rc)
> + if (!err)
> nci_target_found(ndev, &ntf);
> }
>
> static void nci_rf_deactivate_ntf_packet(struct nci_dev *ndev,
> struct sk_buff *skb)
> {
> - __u8 type = skb->data[0];
> + struct nci_rf_deactivate_ntf *ntf = (void *) skb->data;
>
> - nfc_dbg("entry, type 0x%x", type);
> + nfc_dbg("entry, type 0x%x, reason 0x%x", ntf->type, ntf->reason);
>
> clear_bit(NCI_POLL_ACTIVE, &ndev->flags);
> ndev->target_active_prot = 0;
> @@ -214,6 +243,9 @@ static void nci_rf_deactivate_ntf_packet(struct nci_dev *ndev,
> ndev->rx_data_reassembly = 0;
> }
>
> + /* set the available credits to initial value */
> + atomic_set(&ndev->credits_cnt, ndev->initial_num_credits);
> +
> /* complete the data exchange transaction, if exists */
> if (test_bit(NCI_DATA_EXCHANGE, &ndev->flags))
> nci_data_exchange_complete(ndev, NULL, -EIO);
> @@ -237,12 +269,8 @@ void nci_ntf_packet(struct nci_dev *ndev, struct sk_buff *skb)
> nci_core_conn_credits_ntf_packet(ndev, skb);
> break;
>
> - case NCI_OP_RF_FIELD_INFO_NTF:
> - nci_rf_field_info_ntf_packet(ndev, skb);
> - break;
> -
> - case NCI_OP_RF_ACTIVATE_NTF:
> - nci_rf_activate_ntf_packet(ndev, skb);
> + case NCI_OP_RF_INTF_ACTIVATED_NTF:
> + nci_rf_intf_activated_ntf_packet(ndev, skb);
> break;
>
> case NCI_OP_RF_DEACTIVATE_NTF:
> diff --git a/net/nfc/nci/rsp.c b/net/nfc/nci/rsp.c
> index 0403d4c..1d2a1ce 100644
> --- a/net/nfc/nci/rsp.c
> +++ b/net/nfc/nci/rsp.c
> @@ -42,10 +42,11 @@ static void nci_core_reset_rsp_packet(struct nci_dev *ndev, struct sk_buff *skb)
>
> nfc_dbg("entry, status 0x%x", rsp->status);
>
> - if (rsp->status == NCI_STATUS_OK)
> + if (rsp->status == NCI_STATUS_OK) {
> ndev->nci_ver = rsp->nci_ver;
> -
> - nfc_dbg("nci_ver 0x%x", ndev->nci_ver);
> + nfc_dbg("nci_ver 0x%x, config_status 0x%x",
> + rsp->nci_ver, rsp->config_status);
> + }
>
> nci_req_complete(ndev, rsp->status);
> }
> @@ -57,86 +58,76 @@ static void nci_core_init_rsp_packet(struct nci_dev *ndev, struct sk_buff *skb)
>
> nfc_dbg("entry, status 0x%x", rsp_1->status);
>
> - if (rsp_1->status != NCI_STATUS_OK)
> - return;
> -
> - ndev->nfcc_features = __le32_to_cpu(rsp_1->nfcc_features);
> - ndev->num_supported_rf_interfaces = rsp_1->num_supported_rf_interfaces;
> -
> - if (ndev->num_supported_rf_interfaces >
> - NCI_MAX_SUPPORTED_RF_INTERFACES) {
> + if (rsp_1->status == NCI_STATUS_OK) {
This works better if you invert the check and add a "goto err", then you save
one indentation level in the code.
> + ndev->nfcc_features = __le32_to_cpu(rsp_1->nfcc_features);
> ndev->num_supported_rf_interfaces =
> - NCI_MAX_SUPPORTED_RF_INTERFACES;
> + rsp_1->num_supported_rf_interfaces;
> +
> + if (ndev->num_supported_rf_interfaces >
> + NCI_MAX_SUPPORTED_RF_INTERFACES) {
Wrong indentation, one more tab here.
> + ndev->num_supported_rf_interfaces =
> + NCI_MAX_SUPPORTED_RF_INTERFACES;
> + }
> +
> + memcpy(ndev->supported_rf_interfaces,
> + rsp_1->supported_rf_interfaces,
> + ndev->num_supported_rf_interfaces);
> +
> + rsp_2 =
> + (void *) (skb->data + 6 + rsp_1->num_supported_rf_interfaces);
> +
> + ndev->max_logical_connections =
> + rsp_2->max_logical_connections;
> + ndev->max_routing_table_size =
> + __le16_to_cpu(rsp_2->max_routing_table_size);
> + ndev->max_control_pkt_payload_len =
> + rsp_2->max_control_pkt_payload_len;
> + ndev->max_size_for_large_params =
> + __le16_to_cpu(rsp_2->max_size_for_large_params);
> + ndev->max_data_pkt_payload_size =
> + rsp_2->max_data_pkt_payload_size;
> + ndev->initial_num_credits =
> + rsp_2->initial_num_credits;
> + ndev->manufacturer_id =
> + rsp_2->manufacturer_id;
> + ndev->manufacturer_specific_info =
> + __le32_to_cpu(rsp_2->manufacturer_specific_info);
> +
> + atomic_set(&ndev->credits_cnt, ndev->initial_num_credits);
> +
> + nfc_dbg("nfcc_features 0x%x",
> + ndev->nfcc_features);
> + nfc_dbg("num_supported_rf_interfaces %d",
> + ndev->num_supported_rf_interfaces);
> + nfc_dbg("supported_rf_interfaces[0] 0x%x",
> + ndev->supported_rf_interfaces[0]);
> + nfc_dbg("supported_rf_interfaces[1] 0x%x",
> + ndev->supported_rf_interfaces[1]);
> + nfc_dbg("supported_rf_interfaces[2] 0x%x",
> + ndev->supported_rf_interfaces[2]);
> + nfc_dbg("supported_rf_interfaces[3] 0x%x",
> + ndev->supported_rf_interfaces[3]);
> + nfc_dbg("max_logical_connections %d",
> + ndev->max_logical_connections);
> + nfc_dbg("max_routing_table_size %d",
> + ndev->max_routing_table_size);
> + nfc_dbg("max_control_pkt_payload_len %d",
> + ndev->max_control_pkt_payload_len);
> + nfc_dbg("max_size_for_large_params %d",
> + ndev->max_size_for_large_params);
> + nfc_dbg("max_data_pkt_payload_size %d",
> + ndev->max_data_pkt_payload_size);
> + nfc_dbg("initial_num_credits %d",
> + ndev->initial_num_credits);
> + nfc_dbg("manufacturer_id 0x%x",
> + ndev->manufacturer_id);
> + nfc_dbg("manufacturer_specific_info 0x%x",
> + ndev->manufacturer_specific_info);
> }
>
> - memcpy(ndev->supported_rf_interfaces,
> - rsp_1->supported_rf_interfaces,
> - ndev->num_supported_rf_interfaces);
> -
> - rsp_2 = (void *) (skb->data + 6 + ndev->num_supported_rf_interfaces);
> -
> - ndev->max_logical_connections =
> - rsp_2->max_logical_connections;
> - ndev->max_routing_table_size =
> - __le16_to_cpu(rsp_2->max_routing_table_size);
> - ndev->max_control_packet_payload_length =
> - rsp_2->max_control_packet_payload_length;
> - ndev->rf_sending_buffer_size =
> - __le16_to_cpu(rsp_2->rf_sending_buffer_size);
> - ndev->rf_receiving_buffer_size =
> - __le16_to_cpu(rsp_2->rf_receiving_buffer_size);
> - ndev->manufacturer_id =
> - __le16_to_cpu(rsp_2->manufacturer_id);
> -
> - nfc_dbg("nfcc_features 0x%x",
> - ndev->nfcc_features);
> - nfc_dbg("num_supported_rf_interfaces %d",
> - ndev->num_supported_rf_interfaces);
> - nfc_dbg("supported_rf_interfaces[0] 0x%x",
> - ndev->supported_rf_interfaces[0]);
> - nfc_dbg("supported_rf_interfaces[1] 0x%x",
> - ndev->supported_rf_interfaces[1]);
> - nfc_dbg("supported_rf_interfaces[2] 0x%x",
> - ndev->supported_rf_interfaces[2]);
> - nfc_dbg("supported_rf_interfaces[3] 0x%x",
> - ndev->supported_rf_interfaces[3]);
> - nfc_dbg("max_logical_connections %d",
> - ndev->max_logical_connections);
> - nfc_dbg("max_routing_table_size %d",
> - ndev->max_routing_table_size);
> - nfc_dbg("max_control_packet_payload_length %d",
> - ndev->max_control_packet_payload_length);
> - nfc_dbg("rf_sending_buffer_size %d",
> - ndev->rf_sending_buffer_size);
> - nfc_dbg("rf_receiving_buffer_size %d",
> - ndev->rf_receiving_buffer_size);
> - nfc_dbg("manufacturer_id 0x%x",
> - ndev->manufacturer_id);
> -
> nci_req_complete(ndev, rsp_1->status);
> }
>
> -static void nci_core_conn_create_rsp_packet(struct nci_dev *ndev,
> - struct sk_buff *skb)
> -{
> - struct nci_core_conn_create_rsp *rsp = (void *) skb->data;
> -
> - nfc_dbg("entry, status 0x%x", rsp->status);
> -
> - if (rsp->status != NCI_STATUS_OK)
> - return;
> -
> - ndev->max_pkt_payload_size = rsp->max_pkt_payload_size;
> - ndev->initial_num_credits = rsp->initial_num_credits;
> - ndev->conn_id = rsp->conn_id;
> -
> - atomic_set(&ndev->credits_cnt, ndev->initial_num_credits);
> -
> - nfc_dbg("max_pkt_payload_size %d", ndev->max_pkt_payload_size);
> - nfc_dbg("initial_num_credits %d", ndev->initial_num_credits);
> - nfc_dbg("conn_id %d", ndev->conn_id);
> -}
> -
> static void nci_rf_disc_map_rsp_packet(struct nci_dev *ndev,
> struct sk_buff *skb)
> {
> @@ -196,10 +187,6 @@ void nci_rsp_packet(struct nci_dev *ndev, struct sk_buff *skb)
> nci_core_init_rsp_packet(ndev, skb);
> break;
>
> - case NCI_OP_CORE_CONN_CREATE_RSP:
> - nci_core_conn_create_rsp_packet(ndev, skb);
> - break;
> -
This removal could also be in another patch.
Gustavo
^ permalink raw reply
* Re: iwlagn: memory corruption with WPA enterprise
From: Stanislaw Gruszka @ 2011-10-31 16:03 UTC (permalink / raw)
To: Tomáš Janoušek; +Cc: linux-kernel, Wey-Yi Guy, linux-wireless
In-Reply-To: <20111029171554.GA16596@nomi.cz>
On Sat, Oct 29, 2011 at 07:15:54PM +0200, Tomáš Janoušek wrote:
> Is there anything I can do to track this down? Perhaps try some experimental
> uCode or something?
You may try debugging patches I posted a while ago:
http://marc.info/?l=linux-mm&m=131914560820378&w=2
http://marc.info/?l=linux-mm&m=131914560820293&w=2
http://marc.info/?l=linux-mm&m=131914560820317&w=2
With a bit of luck, kernel should panic and dump call-trace when
bad code start to write at memory addresses where is not suppose
to.
You have to compile kernel with CONFIG_DEBUG_PAGEALLOC and add
corrupt_dbg=1 to catch memory corruption. However that may not
work if you have small amount of memory.
Also would be good to enable other debug options:
CONFIG_DEBUG_OBJECTS=y
CONFIG_DEBUG_OBJECTS_FREE=y
CONFIG_DEBUG_OBJECTS_TIMERS=y
CONFIG_DEBUG_OBJECTS_WORK=y
CONFIG_DEBUG_OBJECTS_RCU_HEAD=y
CONFIG_DEBUG_OBJECTS_ENABLE_DEFAULT=1
CONFIG_DEBUG_SG=y
CONFIG_DEBUG_LIST=y
Stanislaw
^ permalink raw reply
* 3.1+ iwlwifi lockup
From: Dave Jones @ 2011-10-31 14:34 UTC (permalink / raw)
To: Linux Kernel; +Cc: wey-yi.w.guy, ilw, linux-wireless
I just got this trace, and a driver lockup that caused me to have to
unload & reload the iwlwifi module to get networking back.
hardware is..
04:00.0 Network controller: Intel Corporation Ultimate N WiFi Link 5300
This is new as of 3.1+ (This kernel was Linus' tree as of last night)
Dave
[ 2669.712377] WARNING: at drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c:927 iwl_tx_cmd_complete+0x2ee/0x330 [iwlwifi]()
[ 2669.712381] Hardware name: Adamo 13
[ 2669.712384] wrong command queue 0 (should be 4), sequence 0x0 readp=54 writep=54
[ 2669.712386] Modules linked in: nfs fscache auth_rpcgss nfs_acl ppdev parport_pc lp parport fuse ebtable_nat ebtables ipt_MASQUERADE iptable_nat nf_nat xt_CHECKSUM iptable_mangle tun bridge stp llc lockd bnep bluetooth ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 ip6table_filter ip6_tables arc4 dell_wmi sparse_keymap uvcvideo videodev snd_usb_audio v4l2_compat_ioctl32 snd_usbmidi_lib cdc_ether snd_rawmidi cdc_wdm usbnet cdc_acm mii snd_hda_codec_hdmi snd_hda_codec_idt snd_hda_intel snd_hda_codec snd_hwdep snd_seq snd_seq_device dell_laptop iwlwifi dcdbas microcode snd_pcm mac80211 joydev i2c_i801 pcspkr snd_timer iTCO_wdt iTCO_vendor_support snd soundcore cfg80211 snd_page_alloc tg3 rfkill wmi virtio_net kvm_intel kvm uinput sunrpc ipv6 xts gf128mul dm_crypt i915 drm_kms_helper drm i2c_algo_bit i2c_core video [last unloaded: scsi_wait_scan]
[ 2669.712493] Pid: 2332, comm: firefox Not tainted 3.1.0+ #9
[ 2669.712495] Call Trace:
[ 2669.712497] <IRQ> [<ffffffff8107d16f>] warn_slowpath_common+0x7f/0xc0
[ 2669.712509] [<ffffffff8107d266>] warn_slowpath_fmt+0x46/0x50
[ 2669.712519] [<ffffffffa038090e>] iwl_tx_cmd_complete+0x2ee/0x330 [iwlwifi]
[ 2669.712529] [<ffffffffa037e280>] iwl_irq_tasklet+0x210/0x8e0 [iwlwifi]
[ 2669.712535] [<ffffffff810851fd>] tasklet_action+0x9d/0x240
[ 2669.712539] [<ffffffff81085e28>] __do_softirq+0xc8/0x3d0
[ 2669.712544] [<ffffffff81657f3c>] call_softirq+0x1c/0x30
[ 2669.712549] [<ffffffff8101c735>] do_softirq+0xa5/0xe0
[ 2669.712553] [<ffffffff810864a6>] irq_exit+0xa6/0xf0
[ 2669.712557] [<ffffffff81658813>] do_IRQ+0x63/0xd0
[ 2669.712561] [<ffffffff8164e5f3>] common_interrupt+0x73/0x73
[ 2669.712563] <EOI> [<ffffffff81655c7a>] ? sysret_check+0x2e/0x69
[ 2669.712570] ---[ end trace e86fa0935f9dc7a5 ]---
[ 2669.712573] iwl data: 00000000: 00 00 55 55 00 00 00 00 08 53 e0 00 00 00 00 00 ..UU.....S......
[ 2669.712577] iwl data: 00000010: 00 00 00 00 7e 04 19 00 05 00 04 00 94 07 02 00 ....~...........
[ 2669.712619] ------------[ cut here ]------------
[ 2669.712628] WARNING: at drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c:927 iwl_tx_cmd_complete+0x2ee/0x330 [iwlwifi]()
[ 2669.712631] Hardware name: Adamo 13
[ 2669.712634] wrong command queue 11 (should be 4), sequence 0x6B6B readp=54 writep=54
[ 2669.712636] Modules linked in: nfs fscache auth_rpcgss nfs_acl ppdev parport_pc lp parport fuse ebtable_nat ebtables ipt_MASQUERADE iptable_nat nf_nat xt_CHECKSUM iptable_mangle tun bridge stp llc lockd bnep bluetooth ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 ip6table_filter ip6_tables arc4 dell_wmi sparse_keymap uvcvideo videodev snd_usb_audio v4l2_compat_ioctl32 snd_usbmidi_lib cdc_ether snd_rawmidi cdc_wdm usbnet cdc_acm mii snd_hda_codec_hdmi snd_hda_codec_idt snd_hda_intel snd_hda_codec snd_hwdep snd_seq snd_seq_device dell_laptop iwlwifi dcdbas microcode snd_pcm mac80211 joydev i2c_i801 pcspkr snd_timer iTCO_wdt iTCO_vendor_support snd soundcore cfg80211 snd_page_alloc tg3 rfkill wmi virtio_net kvm_intel kvm uinput sunrpc ipv6 xts gf128mul dm_crypt i915 drm_kms_helper drm i2c_algo_bit i2c_core video [last unloaded: scsi_wait_scan]
[ 2669.712729] Pid: 2332, comm: firefox Tainted: G W 3.1.0+ #9
[ 2669.712731] Call Trace:
[ 2669.712733] <IRQ> [<ffffffff8107d16f>] warn_slowpath_common+0x7f/0xc0
[ 2669.712743] [<ffffffff8164de90>] ? _raw_spin_unlock_irqrestore+0x40/0x90
[ 2669.712747] [<ffffffff8107d266>] warn_slowpath_fmt+0x46/0x50
[ 2669.712753] [<ffffffff810c189f>] ? trace_hardirqs_on_caller+0x1f/0x1b0
[ 2669.712762] [<ffffffffa038090e>] iwl_tx_cmd_complete+0x2ee/0x330 [iwlwifi]
[ 2669.712772] [<ffffffffa037e280>] iwl_irq_tasklet+0x210/0x8e0 [iwlwifi]
[ 2669.712777] [<ffffffff810851fd>] tasklet_action+0x9d/0x240
[ 2669.712781] [<ffffffff81085e28>] __do_softirq+0xc8/0x3d0
[ 2669.712785] [<ffffffff81657f3c>] call_softirq+0x1c/0x30
[ 2669.712789] [<ffffffff8101c735>] do_softirq+0xa5/0xe0
[ 2669.712792] [<ffffffff810864a6>] irq_exit+0xa6/0xf0
[ 2669.712796] [<ffffffff81658813>] do_IRQ+0x63/0xd0
[ 2669.712800] [<ffffffff8164e5f3>] common_interrupt+0x73/0x73
[ 2669.712802] <EOI> [<ffffffff81655c7a>] ? sysret_check+0x2e/0x69
[ 2669.712808] ---[ end trace e86fa0935f9dc7a6 ]---
[ 2669.712811] iwl data: 00000000: 00 00 55 55 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b ..UUkkkkkkkkkkkk
[ 2669.712815] iwl data: 00000010: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk
[ 2669.712818] ------------[ cut here ]------------
[ 2669.712826] WARNING: at drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c:927 iwl_tx_cmd_complete+0x2ee/0x330 [iwlwifi]()
[ 2669.712829] Hardware name: Adamo 13
[ 2669.712832] wrong command queue 11 (should be 4), sequence 0x6B6B readp=54 writep=54
[ 2669.712834] Modules linked in: nfs fscache auth_rpcgss nfs_acl ppdev parport_pc lp parport fuse ebtable_nat ebtables ipt_MASQUERADE iptable_nat nf_nat xt_CHECKSUM iptable_mangle tun bridge stp llc lockd bnep bluetooth ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 ip6table_filter ip6_tables arc4 dell_wmi sparse_keymap uvcvideo videodev snd_usb_audio v4l2_compat_ioctl32 snd_usbmidi_lib cdc_ether snd_rawmidi cdc_wdm usbnet cdc_acm mii snd_hda_codec_hdmi snd_hda_codec_idt snd_hda_intel snd_hda_codec snd_hwdep snd_seq snd_seq_device dell_laptop iwlwifi dcdbas microcode snd_pcm mac80211 joydev i2c_i801 pcspkr snd_timer iTCO_wdt iTCO_vendor_support snd soundcore cfg80211 snd_page_alloc tg3 rfkill wmi virtio_net kvm_intel kvm uinput sunrpc ipv6 xts gf128mul dm_crypt i915 drm_kms_helper drm i2c_algo_bit i2c_core video [last unloaded: scsi_wait_scan]
[ 2669.712925] Pid: 2332, comm: firefox Tainted: G W 3.1.0+ #9
[ 2669.712928] Call Trace:
[ 2669.712930] <IRQ> [<ffffffff8107d16f>] warn_slowpath_common+0x7f/0xc0
[ 2669.712938] [<ffffffff8107d266>] warn_slowpath_fmt+0x46/0x50
[ 2669.712948] [<ffffffffa038090e>] iwl_tx_cmd_complete+0x2ee/0x330 [iwlwifi]
[ 2669.712958] [<ffffffffa037e280>] iwl_irq_tasklet+0x210/0x8e0 [iwlwifi]
[ 2669.712963] [<ffffffff810851fd>] tasklet_action+0x9d/0x240
[ 2669.712967] [<ffffffff81085e28>] __do_softirq+0xc8/0x3d0
[ 2669.712971] [<ffffffff81657f3c>] call_softirq+0x1c/0x30
[ 2669.712975] [<ffffffff8101c735>] do_softirq+0xa5/0xe0
[ 2669.712979] [<ffffffff810864a6>] irq_exit+0xa6/0xf0
[ 2669.712982] [<ffffffff81658813>] do_IRQ+0x63/0xd0
[ 2669.712986] [<ffffffff8164e5f3>] common_interrupt+0x73/0x73
[ 2669.712988] <EOI> [<ffffffff81655c7a>] ? sysret_check+0x2e/0x69
[ 2669.712994] ---[ end trace e86fa0935f9dc7a7 ]---
[ 2669.712997] iwl data: 00000000: 00 00 55 55 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b ..UUkkkkkkkkkkkk
[ 2669.713018] iwl data: 00000010: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk
[ 2669.713136] ------------[ cut here ]------------
[ 2669.713146] WARNING: at drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c:927 iwl_tx_cmd_complete+0x2ee/0x330 [iwlwifi]()
[ 2669.713150] Hardware name: Adamo 13
[ 2669.713153] wrong command queue 11 (should be 4), sequence 0x6B6B readp=54 writep=54
[ 2669.713157] Modules linked in: nfs fscache auth_rpcgss nfs_acl ppdev parport_pc lp parport fuse ebtable_nat ebtables ipt_MASQUERADE iptable_nat nf_nat xt_CHECKSUM iptable_mangle tun bridge stp llc lockd bnep bluetooth ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 ip6table_filter ip6_tables arc4 dell_wmi sparse_keymap uvcvideo videodev snd_usb_audio v4l2_compat_ioctl32 snd_usbmidi_lib cdc_ether snd_rawmidi cdc_wdm usbnet cdc_acm mii snd_hda_codec_hdmi snd_hda_codec_idt snd_hda_intel snd_hda_codec snd_hwdep snd_seq snd_seq_device dell_laptop iwlwifi dcdbas microcode snd_pcm mac80211 joydev i2c_i801 pcspkr snd_timer iTCO_wdt iTCO_vendor_support snd soundcore cfg80211 snd_page_alloc tg3 rfkill wmi virtio_net kvm_intel kvm uinput sunrpc ipv6 xts gf128mul dm_crypt i915 drm_kms_helper drm i2c_algo_bit i2c_core video [last unloaded: scsi_wait_scan]
[ 2669.713292] Pid: 2332, comm: firefox Tainted: G W 3.1.0+ #9
[ 2669.713295] Call Trace:
[ 2669.713297] <IRQ> [<ffffffff8107d16f>] warn_slowpath_common+0x7f/0xc0
[ 2669.713308] [<ffffffff8107d266>] warn_slowpath_fmt+0x46/0x50
[ 2669.713319] [<ffffffffa038090e>] iwl_tx_cmd_complete+0x2ee/0x330 [iwlwifi]
[ 2669.713331] [<ffffffffa037e280>] iwl_irq_tasklet+0x210/0x8e0 [iwlwifi]
[ 2669.713337] [<ffffffff810851fd>] tasklet_action+0x9d/0x240
[ 2669.713342] [<ffffffff81085e28>] __do_softirq+0xc8/0x3d0
[ 2669.713347] [<ffffffff81657f3c>] call_softirq+0x1c/0x30
[ 2669.713353] [<ffffffff8101c735>] do_softirq+0xa5/0xe0
[ 2669.713357] [<ffffffff810864a6>] irq_exit+0xa6/0xf0
[ 2669.713362] [<ffffffff81658813>] do_IRQ+0x63/0xd0
[ 2669.713367] [<ffffffff8164e5f3>] common_interrupt+0x73/0x73
[ 2669.713369] <EOI> [<ffffffff81655c7a>] ? sysret_check+0x2e/0x69
[ 2669.713377] ---[ end trace e86fa0935f9dc7a8 ]---
[ 2669.713380] iwl data: 00000000: 00 00 55 55 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b ..UUkkkkkkkkkkkk
[ 2669.713385] iwl data: 00000010: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk
[ 2670.784424] iwlwifi 0000:04:00.0: Microcode SW error detected. Restarting 0x2000000.
[ 2670.784431] iwlwifi 0000:04:00.0: Loaded firmware version: 8.83.5.1 build 33692
[ 2670.784556] iwlwifi 0000:04:00.0: Start IWL Error Log Dump:
[ 2670.784559] iwlwifi 0000:04:00.0: Status: 0x000412E4, count: 5
[ 2670.784562] iwlwifi 0000:04:00.0: 0x00000005 | SYSASSERT
[ 2670.784565] iwlwifi 0000:04:00.0: 0x000024EC | uPc
[ 2670.784568] iwlwifi 0000:04:00.0: 0x000024C8 | branchlink1
[ 2670.784570] iwlwifi 0000:04:00.0: 0x000024C8 | branchlink2
[ 2670.784573] iwlwifi 0000:04:00.0: 0x00000916 | interruptlink1
[ 2670.784576] iwlwifi 0000:04:00.0: 0x00000000 | interruptlink2
[ 2670.784578] iwlwifi 0000:04:00.0: 0x000000FF | data1
[ 2670.784580] iwlwifi 0000:04:00.0: 0x00000489 | data2
[ 2670.784583] iwlwifi 0000:04:00.0: 0x00000489 | line
[ 2670.784585] iwlwifi 0000:04:00.0: 0x1A41414C | beacon time
[ 2670.784588] iwlwifi 0000:04:00.0: 0x54956EB4 | tsf low
[ 2670.784591] iwlwifi 0000:04:00.0: 0x000004FB | tsf hi
[ 2670.784593] iwlwifi 0000:04:00.0: 0x00000000 | time gp1
[ 2670.784596] iwlwifi 0000:04:00.0: 0x9D4D53F1 | time gp2
[ 2670.784598] iwlwifi 0000:04:00.0: 0x00000000 | time gp3
[ 2670.784601] iwlwifi 0000:04:00.0: 0x00010853 | uCode version
[ 2670.784603] iwlwifi 0000:04:00.0: 0x00000024 | hw version
[ 2670.784606] iwlwifi 0000:04:00.0: 0x00480302 | board version
[ 2670.784609] iwlwifi 0000:04:00.0: 0x0B15001C | hcmd
[ 2670.784611] iwlwifi 0000:04:00.0: CSR values:
[ 2670.784614] iwlwifi 0000:04:00.0: (2nd byte of CSR_INT_COALESCING is CSR_INT_PERIODIC_REG)
[ 2670.784641] iwlwifi 0000:04:00.0: CSR_HW_IF_CONFIG_REG: 0X00480302
[ 2670.784666] iwlwifi 0000:04:00.0: CSR_INT_COALESCING: 0X00000040
[ 2670.784691] iwlwifi 0000:04:00.0: CSR_INT: 0X00000000
[ 2670.784715] iwlwifi 0000:04:00.0: CSR_INT_MASK: 0X00000000
[ 2670.784740] iwlwifi 0000:04:00.0: CSR_FH_INT_STATUS: 0X00000000
[ 2670.784765] iwlwifi 0000:04:00.0: CSR_GPIO_IN: 0X00000000
[ 2670.784790] iwlwifi 0000:04:00.0: CSR_RESET: 0X00000000
[ 2670.784814] iwlwifi 0000:04:00.0: CSR_GP_CNTRL: 0X080403c5
[ 2670.784839] iwlwifi 0000:04:00.0: CSR_HW_REV: 0X00000024
[ 2670.784864] iwlwifi 0000:04:00.0: CSR_EEPROM_REG: 0X00000000
[ 2670.784889] iwlwifi 0000:04:00.0: CSR_EEPROM_GP: 0X90000004
[ 2670.784914] iwlwifi 0000:04:00.0: CSR_OTP_GP_REG: 0X00060000
[ 2670.784938] iwlwifi 0000:04:00.0: CSR_GIO_REG: 0X00080042
[ 2670.784963] iwlwifi 0000:04:00.0: CSR_GP_UCODE_REG: 0X00007c71
[ 2670.784988] iwlwifi 0000:04:00.0: CSR_GP_DRIVER_REG: 0X00000000
[ 2670.785012] iwlwifi 0000:04:00.0: CSR_UCODE_DRV_GP1: 0X00000000
[ 2670.785037] iwlwifi 0000:04:00.0: CSR_UCODE_DRV_GP2: 0X00000000
[ 2670.785062] iwlwifi 0000:04:00.0: CSR_LED_REG: 0X00000058
[ 2670.785086] iwlwifi 0000:04:00.0: CSR_DRAM_INT_TBL_REG: 0X8811a5a0
[ 2670.785111] iwlwifi 0000:04:00.0: CSR_GIO_CHICKEN_BITS: 0X27800200
[ 2670.785136] iwlwifi 0000:04:00.0: CSR_ANA_PLL_CFG: 0X00880300
[ 2670.785161] iwlwifi 0000:04:00.0: CSR_HW_REV_WA_REG: 0X0001001a
[ 2670.785186] iwlwifi 0000:04:00.0: CSR_DBG_HPET_MEM_REG: 0Xffff0000
[ 2670.785188] iwlwifi 0000:04:00.0: FH register values:
[ 2670.785224] iwlwifi 0000:04:00.0: FH_RSCSR_CHNL0_STTS_WPTR_REG: 0X1174de00
[ 2670.785243] iwlwifi 0000:04:00.0: FH_RSCSR_CHNL0_RBDCB_BASE_REG: 0X012abbb0
[ 2670.785261] iwlwifi 0000:04:00.0: FH_RSCSR_CHNL0_WPTR: 0X00000048
[ 2670.785280] iwlwifi 0000:04:00.0: FH_MEM_RCSR_CHNL0_CONFIG_REG: 0X80819104
[ 2670.785300] iwlwifi 0000:04:00.0: FH_MEM_RSSR_SHARED_CTRL_REG: 0X000000fc
[ 2670.785343] iwlwifi 0000:04:00.0: FH_MEM_RSSR_RX_STATUS_REG: 0X02630000
[ 2670.785362] iwlwifi 0000:04:00.0: FH_MEM_RSSR_RX_ENABLE_ERR_IRQ2DRV: 0X00000000
[ 2670.785380] iwlwifi 0000:04:00.0: FH_TSSR_TX_STATUS_REG: 0X07ff0001
[ 2670.785389] iwlwifi 0000:04:00.0: FH_TSSR_TX_ERROR_REG: 0X00000000
[ 2670.785389] iwlwifi 0000:04:00.0: Start IWL Event Log Dump: display last 20 entries
[ 2670.785389] iwlwifi 0000:04:00.0: EVT_LOGT:2638087993:0x00000000:0355
[ 2670.785389] iwlwifi 0000:04:00.0: EVT_LOGT:2638088265:0x00000113:0106
[ 2670.785389] iwlwifi 0000:04:00.0: EVT_LOGT:2638088266:0x00000000:0302
[ 2670.785389] iwlwifi 0000:04:00.0: EVT_LOGT:2638088289:0x00000000:0355
[ 2670.785389] iwlwifi 0000:04:00.0: EVT_LOGT:2638088453:0x00000113:0106
[ 2670.785389] iwlwifi 0000:04:00.0: EVT_LOGT:2638088455:0x00000000:0302
[ 2670.785389] iwlwifi 0000:04:00.0: EVT_LOGT:2638088478:0x00000000:0355
[ 2670.785389] iwlwifi 0000:04:00.0: EVT_LOGT:2638088750:0x0b15001c:0206
[ 2670.785389] iwlwifi 0000:04:00.0: EVT_LOGT:2638088752:0x00000001:0204
[ 2670.785389] iwlwifi 0000:04:00.0: EVT_LOGT:2638088755:0x00000001:0214
[ 2670.785389] iwlwifi 0000:04:00.0: EVT_LOGT:2638088756:0x01002111:0209
[ 2670.785389] iwlwifi 0000:04:00.0: EVT_LOGT:2638089055:0x00000000:0210
[ 2670.785389] iwlwifi 0000:04:00.0: EVT_LOGT:2638089065:0x00000000:0207
[ 2670.785389] iwlwifi 0000:04:00.0: EVT_LOGT:2638089067:0x01002111:0211
[ 2670.785389] iwlwifi 0000:04:00.0: EVT_LOGT:2638089072:0x00000000:0212
[ 2670.785389] iwlwifi 0000:04:00.0: EVT_LOGT:2638090106:0x00000000:0215
[ 2670.785389] iwlwifi 0000:04:00.0: EVT_LOGT:2638090108:0x00000008:0220
[ 2670.785389] iwlwifi 0000:04:00.0: EVT_LOGT:2638090127:0x00000000:0301
[ 2670.785389] iwlwifi 0000:04:00.0: EVT_LOGT:2638090315:0x00000000:0355
[ 2670.785389] iwlwifi 0000:04:00.0: EVT_LOGT:2639090696:0x00000000:0125
[ 2670.795643] ieee80211 phy0: Hardware restart was requested
[ 2670.795729] iwlwifi 0000:04:00.0: L1 Enabled; Disabling L0S
[ 2670.798779] iwlwifi 0000:04:00.0: Radio type=0x0-0x2-0x0
^ permalink raw reply
* Re: [PATCH 5/7] ath6kl: Invoke wow suspend/resume calls during PM operations
From: Kalle Valo @ 2011-10-31 13:29 UTC (permalink / raw)
To: Raja Mani; +Cc: linux-wireless
In-Reply-To: <4EAE705C.3090704@qca.qualcomm.com>
On 10/31/2011 11:54 AM, Raja Mani wrote:
> On Friday 28 October 2011 06:51 PM, Kalle Valo wrote:
>> On 10/25/2011 01:37 PM, rmani@qca.qualcomm.com wrote:
>>
>>> + if (wow&& ath6kl_cfg80211_ready(ar)&&
>>> + test_bit(CONNECTED,&ar->flag)&&
>>> + ath6kl_hif_keep_pwr_caps(ar)) {
>>> +
>>> + /* Flush all non control pkts in Tx path */
>>> + ath6kl_tx_data_cleanup(ar);
>>> +
>>> + ret = ath6kl_pm_wow_suspend(ar, wow);
>>> + if (ret)
>>> + return ret;
>>> + }
>>
>> Forgot to mention: don't you also need to check for MMC_PM_WAKE_SDIO_IRQ
>> and also set it with sdio_set_host_pm_flags()?
>
> I tested it in x86 machine. Wow suspend/resume works even without
> setting MMC_PM_WAKE_SDIO_IRQ. Should i really handle it ?
Yes, you should. Otherwise firmware is not able to wake up the host.
Also you should both check that wake sdio irq supported by the sdio
controller. Otherwise we might enable WoW even in cases when sdio
controller doesn't support it and which would result in broken wow
functionality.
Kalle
^ permalink raw reply
* Re: [PATCH 5/7] ath6kl: Invoke wow suspend/resume calls during PM operations
From: Kalle Valo @ 2011-10-31 13:16 UTC (permalink / raw)
To: Raja Mani; +Cc: linux-wireless
In-Reply-To: <4EAE7038.7010306@qca.qualcomm.com>
On 10/31/2011 11:54 AM, Raja Mani wrote:
> On Friday 28 October 2011 06:45 PM, Kalle Valo wrote:
>> On 10/25/2011 01:37 PM, rmani@qca.qualcomm.com wrote:
>>> From: Raja Mani<rmani@qca.qualcomm.com>
>>>
>>> --- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
>>> +++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
>>> @@ -1606,6 +1606,19 @@ static int ar6k_cfg80211_suspend(struct wiphy *wiphy,
>>> struct cfg80211_wowlan *wow)
>>> {
>>> struct ath6kl *ar = wiphy_priv(wiphy);
>>> + int ret;
>>> +
>>> + if (wow&& ath6kl_cfg80211_ready(ar)&&
>>> + test_bit(CONNECTED,&ar->flag)&&
>>> + ath6kl_hif_keep_pwr_caps(ar)) {
>>> +
>>> + /* Flush all non control pkts in Tx path */
>>> + ath6kl_tx_data_cleanup(ar);
>>> +
>>> + ret = ath6kl_pm_wow_suspend(ar, wow);
>>> + if (ret)
>>> + return ret;
>>> + }
>>
>> This is now confusing. Some of the suspend logic is now in sdio.c and
>> some here. It's better to have everything in one place, that is in
>> sdio.c. We just need to add an interface so that sdio.c can request the
>> correct suspend mode.
>
> Do you want me to keep ath6kl_pm_wow_suspend() implementation in
> cfg80211.c file and move only above code to ath6kl_sdio_suspend() ?
I gave this more thought and in my suspend patches earlier today I added
this function:
int ath6kl_cfg80211_suspend(struct ath6kl *ar,
enum ath6kl_cfg_suspend_mode mode)
{
int ret;
ath6kl_cfg80211_stop(ar);
switch (mode) {
case ATH6KL_CFG_SUSPEND_DEEPSLEEP:
/* save the current power mode before enabling power save */
ar->wmi->saved_pwr_mode = ar->wmi->pwr_mode;
ret = ath6kl_wmi_powermode_cmd(ar->wmi, 0, REC_POWER);
if (ret) {
ath6kl_warn("wmi powermode command failed during suspend: %d\n",
ret);
}
ar->state = ATH6KL_STATE_DEEPSLEEP;
break;
You can add a new mode for WOW and call your wow functions from that
function. And you need to make changes to ath6kl_sdio_suspend() so that
it will enable WOW in correct cases. Also I added a state variable
ar->state and hopefully we don't need a separate wow state anymore.
Kalle
^ permalink raw reply
* Re: [PATCH 2/7] ath6kl: Add wmi functions to configure wow mode and host sleep mode
From: Kalle Valo @ 2011-10-31 13:10 UTC (permalink / raw)
To: Raja Mani; +Cc: linux-wireless
In-Reply-To: <4EAE6FFD.6090403@qca.qualcomm.com>
On 10/31/2011 11:53 AM, Raja Mani wrote:
>>> +static void ath6kl_wmi_relinquish_implicit_pstream_credits(struct wmi *wmi)
>>> >> +{
>>> >> + u16 active_tsids;
>>> >> + u8 stream_exist;
>>> >> + int i;
>>> >> +
>>> >> + /*
>>> >> + * Relinquish credits from all implicitly created pstreams
>>> >> + * since when we go to sleep. If user created explicit
>>> >> + * thinstreams exists with in a fatpipe leave them intact
>>> >> + * for the user to delete.
>>> >> + */
>>> >> + spin_lock_bh(&wmi->lock);
>>> >> + stream_exist = wmi->fat_pipe_exist;
>>> >> + spin_unlock_bh(&wmi->lock);
>>> >> +
>>> >> + for (i = 0; i< WMM_NUM_AC; i++) {
>>> >> + if (stream_exist& (1<< i)) {
>>> >> +
>>> >> + spin_lock_bh(&wmi->lock);
>>> >> + active_tsids = wmi->stream_exist_for_ac[i];
>>> >> + spin_unlock_bh(&wmi->lock);
>>> >> +
>>> >> + /*
>>> >> + * If there are no user created thin streams
>>> >> + * delete the fatpipe
>>> >> + */
>>> >> + if (!active_tsids) {
>>> >> + stream_exist&= ~(1<< i);
>>> >> + /*
>>> >> + * Indicate inactivity to driver layer for
>>> >> + * this fatpipe (pstream)
>>> >> + */
>>> >> + ath6kl_indicate_tx_activity(wmi->parent_dev,
>>> >> + i, false);
>>> >> + }
>>> >> + }
>>> >> + }
>>> >> +
>>> >> + spin_lock_bh(&wmi->lock);
>>> >> + wmi->fat_pipe_exist = stream_exist;
>>> >> + spin_unlock_bh(&wmi->lock);
>> >
>> > The locking here doesn't really make sense. For example, any changes to
>> > wmi->fat_pipe_exist during the for loop will be overwritten. Also lock
>> > handling with wmi->stream_exist_for_ac[i] looks fishy.
>
> Is it fine just removal of both locking (For "active_tsids =
> wmi->stream_exist_for_ac[i]" and "wmi->fat_pipe_exist = stream_exist") ?
>
> I am sure about the impact..Could you please give some point how above
> locking can be improved ?
I haven't reviewed the locking in detail so it's difficult to say. For
example, you could hold the lock the entire duration of for loop. But
that might create deadlocks. Another option is take it into account the
changes happening to fat_pipe_exist while lock is not held.
Kalle
^ permalink raw reply
* Re: wl1251 and NoA protocol
From: Luciano Coelho @ 2011-10-31 13:10 UTC (permalink / raw)
To: Andrés García Saavedra; +Cc: linux-wireless
In-Reply-To: <CADxqDgEvsObWbnPTViPF5g_TOS2WRJoJK4OnEzehbdQwwgzNDQ@mail.gmail.com>
On Tue, 2011-10-18 at 11:13 +0200, Andrés García Saavedra wrote:
> Hi all,
>
> I would like to test Notice of Absence powersaving protocol for
> 802.11abg WLANs on some current android smartphone. My question is
> regarding the wl1251 driver implementation for TI chipsets:
>
> * Does the chipset/current implementation support sleep/awake
> triggers? (or at least quiet elements?) -> This means, can I command
> the NIC to stay quiet (slept) for certain duration of time?
>
> My plan is to implement/test a Notice of Absence protocol where the
> driver would trigger absent (quiet/sleep) periods according to the
> beacon's NoA IE. Ive seen in the code the wl1251_ps_elp_sleep/wakeup
> functions that might be reused for this purpose (?)
>
> * Last (lazy) question. AFAIK only the google dev 1 phone uses this
> chipset. Is there any 1ghz android device that could benefit of this
> driver?
You should look for a device with some newer chip, like the wl1271, for
instance. We are currently developing the wl12xx driver (for wl127x and
wl128x) a lot more actively than wl1251. Besides, I don't think there's
any newer Android phone using wl1251...
--
Cheers,
Luca.
^ permalink raw reply
* Re: [PATCH 6/7] ath6kl: Perform WOW resume in RX path in case of SDIO IRQ wakeup
From: Kalle Valo @ 2011-10-31 13:03 UTC (permalink / raw)
To: Raja Mani; +Cc: linux-wireless
In-Reply-To: <4EAE707D.6070806@qca.qualcomm.com>
On 10/31/2011 11:55 AM, Raja Mani wrote:
> On Friday 28 October 2011 06:48 PM, Kalle Valo wrote:
>> On 10/25/2011 01:37 PM, rmani@qca.qualcomm.com wrote:
>>> --- a/drivers/net/wireless/ath/ath6kl/txrx.c
>>> +++ b/drivers/net/wireless/ath/ath6kl/txrx.c
>>> @@ -1081,6 +1081,8 @@ void ath6kl_rx(struct htc_target *target, struct htc_packet *packet)
>>> return;
>>> }
>>>
>>> + ath6kl_pm_check_wow_status(ar);
>>
>> Now we resume from two places, cfg80211 resume handler and here. Why do
>> we need to do that? Why isn't cfg80211 resume handler enough?
>
> This path hits when the target wants to wake up the host. When given WOW
> pattern matches, the target will pull SDIO data line to wake up the
> host. During that time , the control will reach here (sdio irq handler
> -> ath6kl_rx function), not to cfg80211 resume.
I don't understand this. Are you saying that host resumes but cfg80211
resume handler is not called? It doesn't make sense, every suspend call
should have an equivalent resume call. If that doesn't happen, something
is broken somewhere.
Kalle
^ permalink raw reply
* rt2800usb + rt3070 + AP(n mode)
From: Andrew V. Stepanov @ 2011-10-31 11:04 UTC (permalink / raw)
To: linux-wireless
Hello.
I have USB Wireless Adapter (ID 148f:3070 Ralink Technology, Corp.
RT2870/RT3070 Wireless Adapter).
I successfuly set this device to AccessPoint (master) mode with
vanila kernel driver rt2800usb + hostapd. But only to G mode.
I sees speed no more 2Mbps.
Did any have success setup this device with ieee80211n=1?
Thanks.
Other WIFI USB devices based on ath9k_htc.ko successfully works in AP N mode.
^ permalink raw reply
* Re: [PATCH v2 1/3] nl80211: Add probe response offload attribute
From: Luciano Coelho @ 2011-10-31 10:04 UTC (permalink / raw)
To: Guy Eilam; +Cc: johannes, linux-wireless
In-Reply-To: <1319313081-28722-1-git-send-email-guy@wizery.com>
On Sat, 2011-10-22 at 21:51 +0200, Guy Eilam wrote:
> Notify the userspace of the probe response offloading
> support by the driver.
>
> Signed-off-by: Guy Eilam <guy@wizery.com>
> ---
> v2:
> use struct wiphy instead of a function pointer
> this change made the previous second PATCH:
> "Get the probe response offloading support from the driver" irrelevant
> changed WPS to WSC
>
> include/linux/nl80211.h | 24 ++++++++++++++++++++++++
> include/net/cfg80211.h | 5 +++++
> net/wireless/nl80211.c | 5 +++++
> 3 files changed, 34 insertions(+), 0 deletions(-)
>
> diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h
> index 9d797f2..c1f0a3d 100644
> --- a/include/linux/nl80211.h
> +++ b/include/linux/nl80211.h
> @@ -1109,6 +1109,11 @@ enum nl80211_commands {
> * %NL80211_CMD_TDLS_MGMT. Otherwise %NL80211_CMD_TDLS_OPER should be
> * used for asking the driver to perform a TDLS operation.
> *
> + * @NL80211_ATTR_PROBE_RESP_OFFLOAD_SUPPORT: Indicates the support
> + * of probe response offloading by the driver/firmware.
> + * In addition this attribute holds a bitmap of the supported protocols
> + * for offloading using &enum nl80211_probe_resp_offload_support_attr.
> + *
> * @NL80211_ATTR_MAX: highest attribute number currently defined
> * @__NL80211_ATTR_AFTER_LAST: internal use
> */
> @@ -1337,6 +1342,8 @@ enum nl80211_attrs {
> NL80211_ATTR_TDLS_SUPPORT,
> NL80211_ATTR_TDLS_EXTERNAL_SETUP,
>
> + NL80211_ATTR_PROBE_RESP_OFFLOAD_SUPPORT,
> +
I'm not sure I understand why we need this. Why aren't the flags
themselves enough?
Johannes wrote, on a separate thread:
> Oh, and probably a regular WIPHY flag that indicates whether the
> attribute should be added at all so that it can also be 0 but present
> (presence with 0 value indicates something other than not present).
What would be the meaning when the WIPHY flag is set but the attributes
are all 0? Wouldn't it mean that we don't support probe_resp offload at
all? Or would it mean that we support probe_resp offloading in normal
cases (ie. not WCS nor P2P)? If the latter is the case, why not add a
bit in the attributes to indicate that "normal" probe_resp offloading is
supported? I think this would be cleaner because there wouldn't be any
implicit semantics.
--
Cheers,
Luca.
^ permalink raw reply
* [PATCH] wl12xx: add vifs_state debugfs key
From: Eliad Peller @ 2011-10-31 10:24 UTC (permalink / raw)
To: Luciano Coelho; +Cc: linux-wireless
Add debugfs key to dump information regarding the
active vifs (similar to the driver_state debugfs key)
Signed-off-by: Eliad Peller <eliad@wizery.com>
---
drivers/net/wireless/wl12xx/debugfs.c | 110 +++++++++++++++++++++++++++++++++
1 files changed, 110 insertions(+), 0 deletions(-)
diff --git a/drivers/net/wireless/wl12xx/debugfs.c b/drivers/net/wireless/wl12xx/debugfs.c
index a9e0b73..2e14b43 100644
--- a/drivers/net/wireless/wl12xx/debugfs.c
+++ b/drivers/net/wireless/wl12xx/debugfs.c
@@ -385,6 +385,115 @@ static const struct file_operations driver_state_ops = {
.llseek = default_llseek,
};
+static ssize_t vifs_state_read(struct file *file, char __user *user_buf,
+ size_t count, loff_t *ppos)
+{
+ struct wl1271 *wl = file->private_data;
+ struct wl12xx_vif *wlvif;
+ int ret, res = 0;
+ const int buf_size = 4096;
+ char *buf;
+ char tmp_buf[64];
+
+ buf = kzalloc(buf_size, GFP_KERNEL);
+ if (!buf)
+ return -ENOMEM;
+
+ mutex_lock(&wl->mutex);
+
+#define VIF_STATE_PRINT(x, fmt) \
+ (res += scnprintf(buf + res, buf_size - res, \
+ #x " = " fmt "\n", wlvif->x))
+
+#define VIF_STATE_PRINT_LONG(x) VIF_STATE_PRINT(x, "%ld")
+#define VIF_STATE_PRINT_INT(x) VIF_STATE_PRINT(x, "%d")
+#define VIF_STATE_PRINT_STR(x) VIF_STATE_PRINT(x, "%s")
+#define VIF_STATE_PRINT_LHEX(x) VIF_STATE_PRINT(x, "0x%lx")
+#define VIF_STATE_PRINT_LLHEX(x) VIF_STATE_PRINT(x, "0x%llx")
+#define VIF_STATE_PRINT_HEX(x) VIF_STATE_PRINT(x, "0x%x")
+
+#define VIF_STATE_PRINT_NSTR(x, len) \
+ do { \
+ memset(tmp_buf, 0, sizeof(tmp_buf)); \
+ memcpy(tmp_buf, wlvif->x, \
+ min_t(u8, len, sizeof(tmp_buf) - 1)); \
+ res += scnprintf(buf + res, buf_size - res, \
+ #x " = %s\n", tmp_buf); \
+ } while (0)
+
+ wl12xx_for_each_wlvif(wl, wlvif) {
+ VIF_STATE_PRINT_INT(role_id);
+ VIF_STATE_PRINT_INT(bss_type);
+ VIF_STATE_PRINT_LHEX(flags);
+ VIF_STATE_PRINT_INT(p2p);
+ VIF_STATE_PRINT_INT(dev_role_id);
+ VIF_STATE_PRINT_INT(dev_hlid);
+
+ if (wlvif->bss_type == BSS_TYPE_STA_BSS ||
+ wlvif->bss_type == BSS_TYPE_IBSS) {
+ VIF_STATE_PRINT_INT(sta.hlid);
+ VIF_STATE_PRINT_INT(sta.ba_rx_bitmap);
+ VIF_STATE_PRINT_INT(sta.basic_rate_idx);
+ VIF_STATE_PRINT_INT(sta.ap_rate_idx);
+ VIF_STATE_PRINT_INT(sta.p2p_rate_idx);
+ } else {
+ VIF_STATE_PRINT_INT(ap.global_hlid);
+ VIF_STATE_PRINT_INT(ap.bcast_hlid);
+ VIF_STATE_PRINT_LHEX(ap.sta_hlid_map[0]);
+ VIF_STATE_PRINT_INT(ap.mgmt_rate_idx);
+ VIF_STATE_PRINT_INT(ap.bcast_rate_idx);
+ VIF_STATE_PRINT_INT(ap.ucast_rate_idx[0]);
+ VIF_STATE_PRINT_INT(ap.ucast_rate_idx[1]);
+ VIF_STATE_PRINT_INT(ap.ucast_rate_idx[2]);
+ VIF_STATE_PRINT_INT(ap.ucast_rate_idx[3]);
+ }
+ VIF_STATE_PRINT_INT(last_tx_hlid);
+ VIF_STATE_PRINT_LHEX(links_map[0]);
+ VIF_STATE_PRINT_NSTR(ssid, wlvif->ssid_len);
+ VIF_STATE_PRINT_INT(band);
+ VIF_STATE_PRINT_INT(channel);
+ VIF_STATE_PRINT_HEX(bitrate_masks[0]);
+ VIF_STATE_PRINT_HEX(bitrate_masks[1]);
+ VIF_STATE_PRINT_HEX(basic_rate_set);
+ VIF_STATE_PRINT_HEX(basic_rate);
+ VIF_STATE_PRINT_HEX(rate_set);
+ VIF_STATE_PRINT_INT(beacon_int);
+ VIF_STATE_PRINT_INT(default_key);
+ VIF_STATE_PRINT_INT(aid);
+ VIF_STATE_PRINT_INT(session_counter);
+ VIF_STATE_PRINT_INT(ps_poll_failures);
+ VIF_STATE_PRINT_INT(psm_entry_retry);
+ VIF_STATE_PRINT_INT(power_level);
+ VIF_STATE_PRINT_INT(rssi_thold);
+ VIF_STATE_PRINT_INT(last_rssi_event);
+ VIF_STATE_PRINT_INT(ba_support);
+ VIF_STATE_PRINT_INT(ba_allowed);
+ VIF_STATE_PRINT_LLHEX(tx_security_seq);
+ VIF_STATE_PRINT_INT(tx_security_last_seq_lsb);
+ }
+
+#undef VIF_STATE_PRINT_INT
+#undef VIF_STATE_PRINT_LONG
+#undef VIF_STATE_PRINT_HEX
+#undef VIF_STATE_PRINT_LHEX
+#undef VIF_STATE_PRINT_LLHEX
+#undef VIF_STATE_PRINT_STR
+#undef VIF_STATE_PRINT_NSTR
+#undef VIF_STATE_PRINT
+
+ mutex_unlock(&wl->mutex);
+
+ ret = simple_read_from_buffer(user_buf, count, ppos, buf, res);
+ kfree(buf);
+ return ret;
+}
+
+static const struct file_operations vifs_state_ops = {
+ .read = vifs_state_read,
+ .open = wl1271_open_file_generic,
+ .llseek = default_llseek,
+};
+
static ssize_t dtim_interval_read(struct file *file, char __user *user_buf,
size_t count, loff_t *ppos)
{
@@ -765,6 +874,7 @@ static int wl1271_debugfs_add_files(struct wl1271 *wl,
DEBUGFS_ADD(gpio_power, rootdir);
DEBUGFS_ADD(start_recovery, rootdir);
DEBUGFS_ADD(driver_state, rootdir);
+ DEBUGFS_ADD(vifs_state, rootdir);
DEBUGFS_ADD(dtim_interval, rootdir);
DEBUGFS_ADD(beacon_interval, rootdir);
DEBUGFS_ADD(beacon_filtering, rootdir);
--
1.7.6.401.g6a319
^ permalink raw reply related
* [PATCH 5/5] ath6kl: cut power during suspend
From: Kalle Valo @ 2011-10-31 9:56 UTC (permalink / raw)
To: kvalo; +Cc: linux-wireless
In-Reply-To: <20111031095550.3598.52653.stgit@localhost6.localdomain6>
If sdio controller doesn't support keep power, cut power from hardware
during suspend and restart firmware during resume. If we are connected
during suspend, send a disconnected event to user space.
Earlier suspend failed with an error if sdio didn't support keep power.
Now suspend will happen succesfully even with that case.
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath6kl/cfg80211.c | 31 ++++++++++++++
drivers/net/wireless/ath/ath6kl/cfg80211.h | 1
drivers/net/wireless/ath/ath6kl/core.h | 1
drivers/net/wireless/ath/ath6kl/debug.h | 1
drivers/net/wireless/ath/ath6kl/sdio.c | 64 +++++++++++++++++++++++++---
5 files changed, 90 insertions(+), 8 deletions(-)
diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c
index 53aa3be..ef2f210 100644
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
@@ -1674,6 +1674,28 @@ int ath6kl_cfg80211_suspend(struct ath6kl *ar,
ar->state = ATH6KL_STATE_DEEPSLEEP;
break;
+
+ case ATH6KL_CFG_SUSPEND_CUTPOWER:
+ if (ar->state == ATH6KL_STATE_OFF) {
+ ath6kl_dbg(ATH6KL_DBG_SUSPEND,
+ "suspend hw off, no action for cutpower\n");
+ break;
+ }
+
+ ath6kl_dbg(ATH6KL_DBG_SUSPEND, "suspend cutting power\n");
+
+ ret = ath6kl_init_hw_stop(ar);
+ if (ret) {
+ ath6kl_warn("failed to stop hw during suspend: %d\n",
+ ret);
+ }
+
+ ar->state = ATH6KL_STATE_CUTPOWER;
+
+ break;
+
+ default:
+ break;
}
return 0;
@@ -1698,6 +1720,15 @@ int ath6kl_cfg80211_resume(struct ath6kl *ar)
break;
+ case ATH6KL_STATE_CUTPOWER:
+ ath6kl_dbg(ATH6KL_DBG_SUSPEND, "resume restoring power\n");
+
+ ret = ath6kl_init_hw_start(ar);
+ if (ret) {
+ ath6kl_warn("Failed to boot hw in resume: %d\n", ret);
+ return ret;
+ }
+
default:
break;
}
diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.h b/drivers/net/wireless/ath/ath6kl/cfg80211.h
index 3630c5e..72eadf8 100644
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.h
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.h
@@ -19,6 +19,7 @@
enum ath6kl_cfg_suspend_mode {
ATH6KL_CFG_SUSPEND_DEEPSLEEP,
+ ATH6KL_CFG_SUSPEND_CUTPOWER,
};
struct net_device *ath6kl_interface_add(struct ath6kl *ar, char *name,
diff --git a/drivers/net/wireless/ath/ath6kl/core.h b/drivers/net/wireless/ath/ath6kl/core.h
index 6613248..f301c32 100644
--- a/drivers/net/wireless/ath/ath6kl/core.h
+++ b/drivers/net/wireless/ath/ath6kl/core.h
@@ -454,6 +454,7 @@ enum ath6kl_state {
ATH6KL_STATE_OFF,
ATH6KL_STATE_ON,
ATH6KL_STATE_DEEPSLEEP,
+ ATH6KL_STATE_CUTPOWER,
};
struct ath6kl {
diff --git a/drivers/net/wireless/ath/ath6kl/debug.h b/drivers/net/wireless/ath/ath6kl/debug.h
index 491485e..c24d120 100644
--- a/drivers/net/wireless/ath/ath6kl/debug.h
+++ b/drivers/net/wireless/ath/ath6kl/debug.h
@@ -40,6 +40,7 @@ enum ATH6K_DEBUG_MASK {
ATH6KL_DBG_SDIO_DUMP = BIT(17),
ATH6KL_DBG_BOOT = BIT(18), /* driver init and fw boot */
ATH6KL_DBG_WMI_DUMP = BIT(19),
+ ATH6KL_DBG_SUSPEND = BIT(20),
ATH6KL_DBG_ANY = 0xffffffff /* enable all logs */
};
diff --git a/drivers/net/wireless/ath/ath6kl/sdio.c b/drivers/net/wireless/ath/ath6kl/sdio.c
index d718926..e66d18b 100644
--- a/drivers/net/wireless/ath/ath6kl/sdio.c
+++ b/drivers/net/wireless/ath/ath6kl/sdio.c
@@ -742,12 +742,11 @@ static int ath6kl_sdio_suspend(struct ath6kl *ar)
flags = sdio_get_host_pm_caps(func);
+ ath6kl_dbg(ATH6KL_DBG_SUSPEND, "sdio suspend pm_caps 0x%x\n", flags);
+
if (!(flags & MMC_PM_KEEP_POWER)) {
- /* as host doesn't support keep power we need to bail out */
- ath6kl_dbg(ATH6KL_DBG_SDIO,
- "func %d doesn't support MMC_PM_KEEP_POWER\n",
- func->num);
- return -EINVAL;
+ /* as host doesn't support keep power we need to cut power */
+ return ath6kl_cfg80211_suspend(ar, ATH6KL_CFG_SUSPEND_CUTPOWER);
}
ret = sdio_set_host_pm_flags(func, MMC_PM_KEEP_POWER);
@@ -757,13 +756,30 @@ static int ath6kl_sdio_suspend(struct ath6kl *ar)
return ret;
}
- ath6kl_cfg80211_suspend(ar, ATH6KL_CFG_SUSPEND_DEEPSLEEP);
-
- return 0;
+ return ath6kl_cfg80211_suspend(ar, ATH6KL_CFG_SUSPEND_DEEPSLEEP);
}
static int ath6kl_sdio_resume(struct ath6kl *ar)
{
+ struct ath6kl_sdio *ar_sdio = ath6kl_sdio_priv(ar);
+ struct sdio_func *func = ar_sdio->func;
+ int ret;
+
+ if (ar->state == ATH6KL_STATE_CUTPOWER) {
+ ath6kl_dbg(ATH6KL_DBG_SUSPEND,
+ "sdio resume configuring sdio\n");
+
+ sdio_claim_host(func);
+ func->enable_timeout = 100;
+ ret = sdio_set_block_size(func, HIF_MBOX_BLOCK_SIZE);
+ if (ret) {
+ ath6kl_err("Set sdio block size %d failed: %d)\n",
+ HIF_MBOX_BLOCK_SIZE, ret);
+ }
+
+ sdio_release_host(func);
+ }
+
ath6kl_cfg80211_resume(ar);
return 0;
@@ -818,6 +834,37 @@ static const struct ath6kl_hif_ops ath6kl_sdio_ops = {
.stop = ath6kl_sdio_stop,
};
+#ifdef CONFIG_PM_SLEEP
+
+/*
+ * Empty handlers so that mmc subsystem doesn't remove us entirely during
+ * suspend. We instead follow cfg80211 suspend/resume handlers.
+ */
+static int ath6kl_sdio_pm_suspend(struct device *device)
+{
+ ath6kl_dbg(ATH6KL_DBG_SUSPEND, "sdio pm suspend\n");
+
+ return 0;
+}
+
+static int ath6kl_sdio_pm_resume(struct device *device)
+{
+ ath6kl_dbg(ATH6KL_DBG_SUSPEND, "sdio pm resume\n");
+
+ return 0;
+}
+
+static SIMPLE_DEV_PM_OPS(ath6kl_sdio_pm_ops, ath6kl_sdio_pm_suspend,
+ ath6kl_sdio_pm_resume);
+
+#define ATH6KL_SDIO_PM_OPS (&ath6kl_sdio_pm_ops)
+
+#else
+
+#define ATH6KL_SDIO_PM_OPS NULL
+
+#endif /* CONFIG_PM_SLEEP */
+
static int ath6kl_sdio_probe(struct sdio_func *func,
const struct sdio_device_id *id)
{
@@ -958,6 +1005,7 @@ static struct sdio_driver ath6kl_sdio_driver = {
.id_table = ath6kl_sdio_devices,
.probe = ath6kl_sdio_probe,
.remove = ath6kl_sdio_remove,
+ .drv.pm = ATH6KL_SDIO_PM_OPS,
};
static int __init ath6kl_sdio_init(void)
^ permalink raw reply related
* [PATCH 4/5] ath6kl: add state variable depicting hw/fw state
From: Kalle Valo @ 2011-10-31 9:56 UTC (permalink / raw)
To: kvalo; +Cc: linux-wireless
In-Reply-To: <20111031095550.3598.52653.stgit@localhost6.localdomain6>
This way it's easier to track state changes and in the future add
more warnings about using hardware in wrong states. Currently there
are few random flags for trying to do the same, those will be cleaned
and removed in the future.
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath6kl/cfg80211.c | 28 +++++++++++++++++++++++-----
drivers/net/wireless/ath/ath6kl/core.h | 9 +++++++++
drivers/net/wireless/ath/ath6kl/init.c | 4 ++++
3 files changed, 36 insertions(+), 5 deletions(-)
diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c
index 0691a95..53aa3be 100644
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
@@ -1671,6 +1671,8 @@ int ath6kl_cfg80211_suspend(struct ath6kl *ar,
ret);
}
+ ar->state = ATH6KL_STATE_DEEPSLEEP;
+
break;
}
@@ -1679,11 +1681,25 @@ int ath6kl_cfg80211_suspend(struct ath6kl *ar,
int ath6kl_cfg80211_resume(struct ath6kl *ar)
{
- if (ar->wmi->pwr_mode != ar->wmi->saved_pwr_mode) {
- if (ath6kl_wmi_powermode_cmd(ar->wmi, 0,
- ar->wmi->saved_pwr_mode) != 0)
- ath6kl_warn("ath6kl_sdio_resume: "
- "wmi_powermode_cmd failed\n");
+ int ret;
+
+ switch (ar->state) {
+ case ATH6KL_STATE_DEEPSLEEP:
+ if (ar->wmi->pwr_mode != ar->wmi->saved_pwr_mode) {
+ ret = ath6kl_wmi_powermode_cmd(ar->wmi, 0,
+ ar->wmi->saved_pwr_mode);
+ if (ret) {
+ ath6kl_warn("wmi powermode command failed during resume: %d\n",
+ ret);
+ }
+ }
+
+ ar->state = ATH6KL_STATE_ON;
+
+ break;
+
+ default:
+ break;
}
return 0;
@@ -2251,6 +2267,8 @@ struct ath6kl *ath6kl_core_alloc(struct device *dev)
ar->sc_params.scan_ctrl_flags = DEFAULT_SCAN_CTRL_FLAGS;
ar->lrssi_roam_threshold = DEF_LRSSI_ROAM_THRESHOLD;
+ ar->state = ATH6KL_STATE_OFF;
+
memset((u8 *)ar->sta_list, 0,
AP_MAX_NUM_STA * sizeof(struct ath6kl_sta));
diff --git a/drivers/net/wireless/ath/ath6kl/core.h b/drivers/net/wireless/ath/ath6kl/core.h
index 00cc1db..6613248 100644
--- a/drivers/net/wireless/ath/ath6kl/core.h
+++ b/drivers/net/wireless/ath/ath6kl/core.h
@@ -450,9 +450,18 @@ enum ath6kl_dev_state {
FIRST_BOOT,
};
+enum ath6kl_state {
+ ATH6KL_STATE_OFF,
+ ATH6KL_STATE_ON,
+ ATH6KL_STATE_DEEPSLEEP,
+};
+
struct ath6kl {
struct device *dev;
struct wiphy *wiphy;
+
+ enum ath6kl_state state;
+
struct ath6kl_bmi bmi;
const struct ath6kl_hif_ops *hif_ops;
struct wmi *wmi;
diff --git a/drivers/net/wireless/ath/ath6kl/init.c b/drivers/net/wireless/ath/ath6kl/init.c
index 06e5cea..f7fcd91 100644
--- a/drivers/net/wireless/ath/ath6kl/init.c
+++ b/drivers/net/wireless/ath/ath6kl/init.c
@@ -1452,6 +1452,8 @@ int ath6kl_init_hw_start(struct ath6kl *ar)
goto err_htc_stop;
}
+ ar->state = ATH6KL_STATE_ON;
+
return 0;
err_htc_stop:
@@ -1480,6 +1482,8 @@ int ath6kl_init_hw_stop(struct ath6kl *ar)
if (ret)
ath6kl_warn("failed to power off hif: %d\n", ret);
+ ar->state = ATH6KL_STATE_OFF;
+
return 0;
}
^ permalink raw reply related
* Re: [PATCH 6/7] ath6kl: Perform WOW resume in RX path in case of SDIO IRQ wakeup
From: Raja Mani @ 2011-10-31 9:55 UTC (permalink / raw)
To: Kalle Valo; +Cc: linux-wireless
In-Reply-To: <4EAAABB8.3030309@qca.qualcomm.com>
On Friday 28 October 2011 06:48 PM, Kalle Valo wrote:
> On 10/25/2011 01:37 PM, rmani@qca.qualcomm.com wrote:
>> From: Raja Mani<rmani@qca.qualcomm.com>
>>
>> Signed-off-by: Raja Mani<rmani@qca.qualcomm.com>
>
> Empty commit log.
I'll add commit message here..
>
>> --- a/drivers/net/wireless/ath/ath6kl/txrx.c
>> +++ b/drivers/net/wireless/ath/ath6kl/txrx.c
>> @@ -1081,6 +1081,8 @@ void ath6kl_rx(struct htc_target *target, struct htc_packet *packet)
>> return;
>> }
>>
>> + ath6kl_pm_check_wow_status(ar);
>
> Now we resume from two places, cfg80211 resume handler and here. Why do
> we need to do that? Why isn't cfg80211 resume handler enough?
This path hits when the target wants to wake up the host. When given WOW
pattern matches, the target will pull SDIO data line to wake up the
host. During that time , the control will reach here (sdio irq handler
-> ath6kl_rx function), not to cfg80211 resume.
>
> Kalle
^ permalink raw reply
* [PATCH 3/5] ath6kl: implement ath6kl_cfg80211_suspend()
From: Kalle Valo @ 2011-10-31 9:56 UTC (permalink / raw)
To: kvalo; +Cc: linux-wireless
In-Reply-To: <20111031095550.3598.52653.stgit@localhost6.localdomain6>
This is in preparation for cutpower suspend feature. HIF layer makes
the decision based on information provided by cfg80211 and what hardware
actually supports. Then it calls ath6kl_cfg80211_suspend() to enable
the chosen mode.
Functionality should be the same, this is just preparation for
more suspend modes (cutpower and wow).
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath6kl/cfg80211.c | 46 ++++++++++++++++++++++++++--
drivers/net/wireless/ath/ath6kl/cfg80211.h | 8 +++++
drivers/net/wireless/ath/ath6kl/core.h | 1 -
drivers/net/wireless/ath/ath6kl/main.c | 12 -------
drivers/net/wireless/ath/ath6kl/sdio.c | 9 +----
5 files changed, 52 insertions(+), 24 deletions(-)
diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c
index 94038cb..0691a95 100644
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
@@ -1653,8 +1653,46 @@ static int ath6kl_flush_pmksa(struct wiphy *wiphy, struct net_device *netdev)
return 0;
}
+int ath6kl_cfg80211_suspend(struct ath6kl *ar,
+ enum ath6kl_cfg_suspend_mode mode)
+{
+ int ret;
+
+ ath6kl_cfg80211_stop(ar);
+
+ switch (mode) {
+ case ATH6KL_CFG_SUSPEND_DEEPSLEEP:
+ /* save the current power mode before enabling power save */
+ ar->wmi->saved_pwr_mode = ar->wmi->pwr_mode;
+
+ ret = ath6kl_wmi_powermode_cmd(ar->wmi, 0, REC_POWER);
+ if (ret) {
+ ath6kl_warn("wmi powermode command failed during suspend: %d\n",
+ ret);
+ }
+
+ break;
+ }
+
+ return 0;
+}
+
+int ath6kl_cfg80211_resume(struct ath6kl *ar)
+{
+ if (ar->wmi->pwr_mode != ar->wmi->saved_pwr_mode) {
+ if (ath6kl_wmi_powermode_cmd(ar->wmi, 0,
+ ar->wmi->saved_pwr_mode) != 0)
+ ath6kl_warn("ath6kl_sdio_resume: "
+ "wmi_powermode_cmd failed\n");
+ }
+
+ return 0;
+}
+
#ifdef CONFIG_PM
-static int ar6k_cfg80211_suspend(struct wiphy *wiphy,
+
+/* hif layer decides what suspend mode to use */
+static int __ath6kl_cfg80211_suspend(struct wiphy *wiphy,
struct cfg80211_wowlan *wow)
{
struct ath6kl *ar = wiphy_priv(wiphy);
@@ -1662,7 +1700,7 @@ static int ar6k_cfg80211_suspend(struct wiphy *wiphy,
return ath6kl_hif_suspend(ar);
}
-static int ar6k_cfg80211_resume(struct wiphy *wiphy)
+static int __ath6kl_cfg80211_resume(struct wiphy *wiphy)
{
struct ath6kl *ar = wiphy_priv(wiphy);
@@ -2098,8 +2136,8 @@ static struct cfg80211_ops ath6kl_cfg80211_ops = {
.flush_pmksa = ath6kl_flush_pmksa,
CFG80211_TESTMODE_CMD(ath6kl_tm_cmd)
#ifdef CONFIG_PM
- .suspend = ar6k_cfg80211_suspend,
- .resume = ar6k_cfg80211_resume,
+ .suspend = __ath6kl_cfg80211_suspend,
+ .resume = __ath6kl_cfg80211_resume,
#endif
.set_channel = ath6kl_set_channel,
.add_beacon = ath6kl_add_beacon,
diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.h b/drivers/net/wireless/ath/ath6kl/cfg80211.h
index bb0ac22..3630c5e 100644
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.h
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.h
@@ -17,6 +17,10 @@
#ifndef ATH6KL_CFG80211_H
#define ATH6KL_CFG80211_H
+enum ath6kl_cfg_suspend_mode {
+ ATH6KL_CFG_SUSPEND_DEEPSLEEP,
+};
+
struct net_device *ath6kl_interface_add(struct ath6kl *ar, char *name,
enum nl80211_iftype type,
u8 fw_vif_idx, u8 nw_type);
@@ -40,6 +44,10 @@ void ath6kl_cfg80211_disconnect_event(struct ath6kl_vif *vif, u8 reason,
void ath6kl_cfg80211_tkip_micerr_event(struct ath6kl_vif *vif, u8 keyid,
bool ismcast);
+int ath6kl_cfg80211_suspend(struct ath6kl *ar,
+ enum ath6kl_cfg_suspend_mode mode);
+int ath6kl_cfg80211_resume(struct ath6kl *ar);
+
void ath6kl_cfg80211_stop(struct ath6kl *ar);
#endif /* ATH6KL_CFG80211_H */
diff --git a/drivers/net/wireless/ath/ath6kl/core.h b/drivers/net/wireless/ath/ath6kl/core.h
index 95aed7d..00cc1db 100644
--- a/drivers/net/wireless/ath/ath6kl/core.h
+++ b/drivers/net/wireless/ath/ath6kl/core.h
@@ -649,7 +649,6 @@ void ath6kl_pspoll_event(struct ath6kl_vif *vif, u8 aid);
void ath6kl_dtimexpiry_event(struct ath6kl_vif *vif);
void ath6kl_disconnect(struct ath6kl_vif *vif);
-void ath6kl_deep_sleep_enable(struct ath6kl *ar);
void aggr_recv_delba_req_evt(struct ath6kl_vif *vif, u8 tid);
void aggr_recv_addba_req_evt(struct ath6kl_vif *vif, u8 tid, u16 seq_no,
u8 win_sz);
diff --git a/drivers/net/wireless/ath/ath6kl/main.c b/drivers/net/wireless/ath/ath6kl/main.c
index 378dc8d..23da82e 100644
--- a/drivers/net/wireless/ath/ath6kl/main.c
+++ b/drivers/net/wireless/ath/ath6kl/main.c
@@ -578,18 +578,6 @@ void ath6kl_disconnect(struct ath6kl_vif *vif)
}
}
-void ath6kl_deep_sleep_enable(struct ath6kl *ar)
-{
- ath6kl_cfg80211_stop(ar);
-
- /* save the current power mode before enabling power save */
- ar->wmi->saved_pwr_mode = ar->wmi->pwr_mode;
-
- if (ath6kl_wmi_powermode_cmd(ar->wmi, 0, REC_POWER) != 0)
- ath6kl_warn("ath6kl_deep_sleep_enable: "
- "wmi_powermode_cmd failed\n");
-}
-
/* WMI Event handlers */
static const char *get_hw_id_string(u32 id)
diff --git a/drivers/net/wireless/ath/ath6kl/sdio.c b/drivers/net/wireless/ath/ath6kl/sdio.c
index c61c512..d718926 100644
--- a/drivers/net/wireless/ath/ath6kl/sdio.c
+++ b/drivers/net/wireless/ath/ath6kl/sdio.c
@@ -757,19 +757,14 @@ static int ath6kl_sdio_suspend(struct ath6kl *ar)
return ret;
}
- ath6kl_deep_sleep_enable(ar);
+ ath6kl_cfg80211_suspend(ar, ATH6KL_CFG_SUSPEND_DEEPSLEEP);
return 0;
}
static int ath6kl_sdio_resume(struct ath6kl *ar)
{
- if (ar->wmi->pwr_mode != ar->wmi->saved_pwr_mode) {
- if (ath6kl_wmi_powermode_cmd(ar->wmi, 0,
- ar->wmi->saved_pwr_mode) != 0)
- ath6kl_warn("ath6kl_sdio_resume: "
- "wmi_powermode_cmd failed\n");
- }
+ ath6kl_cfg80211_resume(ar);
return 0;
}
^ permalink raw reply related
* [PATCH 2/5] ath6kl: create ath6kl_cfg80211_stop()
From: Kalle Valo @ 2011-10-31 9:56 UTC (permalink / raw)
To: kvalo; +Cc: linux-wireless
In-Reply-To: <20111031095550.3598.52653.stgit@localhost6.localdomain6>
Just take code from deep sleep for now, will be improved later. No
functional changes.
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath6kl/cfg80211.c | 49 ++++++++++++++++++++++++++++
drivers/net/wireless/ath/ath6kl/cfg80211.h | 2 +
drivers/net/wireless/ath/ath6kl/main.c | 46 +-------------------------
3 files changed, 52 insertions(+), 45 deletions(-)
diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c
index 188fded..94038cb 100644
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
@@ -2112,6 +2112,55 @@ static struct cfg80211_ops ath6kl_cfg80211_ops = {
.mgmt_frame_register = ath6kl_mgmt_frame_register,
};
+void ath6kl_cfg80211_stop(struct ath6kl *ar)
+{
+ struct ath6kl_vif *vif;
+
+ /* FIXME: for multi vif */
+ vif = ath6kl_vif_first(ar);
+ if (!vif) {
+ /* save the current power mode before enabling power save */
+ ar->wmi->saved_pwr_mode = ar->wmi->pwr_mode;
+
+ if (ath6kl_wmi_powermode_cmd(ar->wmi, 0, REC_POWER) != 0)
+ ath6kl_warn("ath6kl_deep_sleep_enable: "
+ "wmi_powermode_cmd failed\n");
+ return;
+ }
+
+ switch (vif->sme_state) {
+ case SME_CONNECTING:
+ cfg80211_connect_result(vif->ndev, vif->bssid, NULL, 0,
+ NULL, 0,
+ WLAN_STATUS_UNSPECIFIED_FAILURE,
+ GFP_KERNEL);
+ break;
+ case SME_CONNECTED:
+ default:
+ /*
+ * FIXME: oddly enough smeState is in DISCONNECTED during
+ * suspend, why? Need to send disconnected event in that
+ * state.
+ */
+ cfg80211_disconnected(vif->ndev, 0, NULL, 0, GFP_KERNEL);
+ break;
+ }
+
+ if (test_bit(CONNECTED, &vif->flags) ||
+ test_bit(CONNECT_PEND, &vif->flags))
+ ath6kl_wmi_disconnect_cmd(ar->wmi, vif->fw_vif_idx);
+
+ vif->sme_state = SME_DISCONNECTED;
+
+ /* disable scanning */
+ if (ath6kl_wmi_scanparams_cmd(ar->wmi, vif->fw_vif_idx, 0xFFFF, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0) != 0)
+ printk(KERN_WARNING "ath6kl: failed to disable scan "
+ "during suspend\n");
+
+ ath6kl_cfg80211_scan_complete_event(vif, true);
+}
+
struct ath6kl *ath6kl_core_alloc(struct device *dev)
{
struct ath6kl *ar;
diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.h b/drivers/net/wireless/ath/ath6kl/cfg80211.h
index f323a49..bb0ac22 100644
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.h
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.h
@@ -40,4 +40,6 @@ void ath6kl_cfg80211_disconnect_event(struct ath6kl_vif *vif, u8 reason,
void ath6kl_cfg80211_tkip_micerr_event(struct ath6kl_vif *vif, u8 keyid,
bool ismcast);
+void ath6kl_cfg80211_stop(struct ath6kl *ar);
+
#endif /* ATH6KL_CFG80211_H */
diff --git a/drivers/net/wireless/ath/ath6kl/main.c b/drivers/net/wireless/ath/ath6kl/main.c
index d2822d0..378dc8d 100644
--- a/drivers/net/wireless/ath/ath6kl/main.c
+++ b/drivers/net/wireless/ath/ath6kl/main.c
@@ -580,51 +580,7 @@ void ath6kl_disconnect(struct ath6kl_vif *vif)
void ath6kl_deep_sleep_enable(struct ath6kl *ar)
{
- struct ath6kl_vif *vif;
-
- /* FIXME: for multi vif */
- vif = ath6kl_vif_first(ar);
- if (!vif) {
- /* save the current power mode before enabling power save */
- ar->wmi->saved_pwr_mode = ar->wmi->pwr_mode;
-
- if (ath6kl_wmi_powermode_cmd(ar->wmi, 0, REC_POWER) != 0)
- ath6kl_warn("ath6kl_deep_sleep_enable: "
- "wmi_powermode_cmd failed\n");
- return;
- }
-
- switch (vif->sme_state) {
- case SME_CONNECTING:
- cfg80211_connect_result(vif->ndev, vif->bssid, NULL, 0,
- NULL, 0,
- WLAN_STATUS_UNSPECIFIED_FAILURE,
- GFP_KERNEL);
- break;
- case SME_CONNECTED:
- default:
- /*
- * FIXME: oddly enough smeState is in DISCONNECTED during
- * suspend, why? Need to send disconnected event in that
- * state.
- */
- cfg80211_disconnected(vif->ndev, 0, NULL, 0, GFP_KERNEL);
- break;
- }
-
- if (test_bit(CONNECTED, &vif->flags) ||
- test_bit(CONNECT_PEND, &vif->flags))
- ath6kl_wmi_disconnect_cmd(ar->wmi, vif->fw_vif_idx);
-
- vif->sme_state = SME_DISCONNECTED;
-
- /* disable scanning */
- if (ath6kl_wmi_scanparams_cmd(ar->wmi, vif->fw_vif_idx, 0xFFFF, 0, 0,
- 0, 0, 0, 0, 0, 0, 0) != 0)
- printk(KERN_WARNING "ath6kl: failed to disable scan "
- "during suspend\n");
-
- ath6kl_cfg80211_scan_complete_event(vif, true);
+ ath6kl_cfg80211_stop(ar);
/* save the current power mode before enabling power save */
ar->wmi->saved_pwr_mode = ar->wmi->pwr_mode;
^ permalink raw reply related
* [PATCH 1/5] ath6kl: add aborted parameter to ath6kl_cfg80211_scan_complete_event()
From: Kalle Valo @ 2011-10-31 9:55 UTC (permalink / raw)
To: kvalo; +Cc: linux-wireless
Currently it takes error code as status, but what we really want to
tell is if the scan was aborted or not.
Also fix a bug where we were comparing firmware scan status values
with kernel error codes, which is naturally wrong. This meant
that ath6kl didn't detect when firmware informed about failed scans. I
doubt that this fix doesn't make any difference in practise but it
still needs to be fixed. This is fixed by adding an enum for the success
status code and checking for that.
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath6kl/cfg80211.c | 12 ++++--------
drivers/net/wireless/ath/ath6kl/cfg80211.h | 2 +-
drivers/net/wireless/ath/ath6kl/main.c | 10 +++++++---
drivers/net/wireless/ath/ath6kl/wmi.h | 4 ++++
4 files changed, 16 insertions(+), 12 deletions(-)
diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c
index 994c646..188fded 100644
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
@@ -871,23 +871,19 @@ static int ath6kl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
return ret;
}
-void ath6kl_cfg80211_scan_complete_event(struct ath6kl_vif *vif, int status)
+void ath6kl_cfg80211_scan_complete_event(struct ath6kl_vif *vif, bool aborted)
{
struct ath6kl *ar = vif->ar;
- bool aborted;
int i;
- ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "%s: status %d\n", __func__, status);
+ ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "%s: status%s\n", __func__,
+ aborted ? " aborted" : "");
if (!vif->scan_req)
return;
- if ((status == -ECANCELED) || (status == -EBUSY)) {
- aborted = true;
+ if (aborted)
goto out;
- }
-
- aborted = false;
if (vif->scan_req->n_ssids && vif->scan_req->ssids[0].ssid_len) {
for (i = 0; i < vif->scan_req->n_ssids; i++) {
diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.h b/drivers/net/wireless/ath/ath6kl/cfg80211.h
index d1a0216..f323a49 100644
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.h
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.h
@@ -24,7 +24,7 @@ int ath6kl_register_ieee80211_hw(struct ath6kl *ar);
struct ath6kl *ath6kl_core_alloc(struct device *dev);
void ath6kl_deinit_ieee80211_hw(struct ath6kl *ar);
-void ath6kl_cfg80211_scan_complete_event(struct ath6kl_vif *vif, int status);
+void ath6kl_cfg80211_scan_complete_event(struct ath6kl_vif *vif, bool aborted);
void ath6kl_cfg80211_connect_event(struct ath6kl_vif *vif, u16 channel,
u8 *bssid, u16 listen_intvl,
diff --git a/drivers/net/wireless/ath/ath6kl/main.c b/drivers/net/wireless/ath/ath6kl/main.c
index def0b7f..d2822d0 100644
--- a/drivers/net/wireless/ath/ath6kl/main.c
+++ b/drivers/net/wireless/ath/ath6kl/main.c
@@ -624,7 +624,7 @@ void ath6kl_deep_sleep_enable(struct ath6kl *ar)
printk(KERN_WARNING "ath6kl: failed to disable scan "
"during suspend\n");
- ath6kl_cfg80211_scan_complete_event(vif, -ECANCELED);
+ ath6kl_cfg80211_scan_complete_event(vif, true);
/* save the current power mode before enabling power save */
ar->wmi->saved_pwr_mode = ar->wmi->pwr_mode;
@@ -684,8 +684,12 @@ void ath6kl_ready_event(void *devt, u8 *datap, u32 sw_ver, u32 abi_ver)
void ath6kl_scan_complete_evt(struct ath6kl_vif *vif, int status)
{
struct ath6kl *ar = vif->ar;
+ bool aborted = false;
- ath6kl_cfg80211_scan_complete_event(vif, status);
+ if (status != WMI_SCAN_STATUS_SUCCESS)
+ aborted = true;
+
+ ath6kl_cfg80211_scan_complete_event(vif, aborted);
if (!ar->usr_bss_filter) {
clear_bit(CLEAR_BSSFILTER_ON_BEACON, &vif->flags);
@@ -1149,7 +1153,7 @@ static int ath6kl_close(struct net_device *dev)
}
- ath6kl_cfg80211_scan_complete_event(vif, -ECANCELED);
+ ath6kl_cfg80211_scan_complete_event(vif, true);
/* FIXME: how to handle multi vif support? */
ret = ath6kl_init_hw_stop(ar);
diff --git a/drivers/net/wireless/ath/ath6kl/wmi.h b/drivers/net/wireless/ath/ath6kl/wmi.h
index ae514cb..cf0462a 100644
--- a/drivers/net/wireless/ath/ath6kl/wmi.h
+++ b/drivers/net/wireless/ath/ath6kl/wmi.h
@@ -1472,6 +1472,10 @@ struct wmi_tkip_micerr_event {
u8 is_mcast;
} __packed;
+enum wmi_scan_status {
+ WMI_SCAN_STATUS_SUCCESS = 0,
+};
+
/* WMI_SCAN_COMPLETE_EVENTID */
struct wmi_scan_complete_event {
a_sle32 status;
^ permalink raw reply related
* Re: [PATCH 4/7] ath6kl: Add new functions to handle wow suspend/resume operations
From: Raja Mani @ 2011-10-31 9:53 UTC (permalink / raw)
To: Kalle Valo; +Cc: linux-wireless
In-Reply-To: <4EAAA08F.5070905@qca.qualcomm.com>
On Friday 28 October 2011 06:01 PM, Kalle Valo wrote:
> On 10/25/2011 01:37 PM, rmani@qca.qualcomm.com wrote:
>> From: Raja Mani<rmani@qca.qualcomm.com>
>>
>> Signed-off-by: Raja Mani<rmani@qca.qualcomm.com>
>
> Empty commit log.
>
>> +int ath6kl_pm_wow_suspend(struct ath6kl *ar, struct cfg80211_wowlan *wow)
>> +{
>> + struct wmi_set_wow_mode_cmd wakeup_filter_cmd;
>> + struct wmi_add_wow_pattern_cmd add_pattern_cmd;
>> + struct wmi_del_wow_pattern_cmd del_pattern_cmd;
>> + struct wmi_set_host_sleep_mode_cmd hsleep_cmd;
>> + int i, ret, pos, left;
>> + u8 mask[WOW_PATTERN_SIZE];
>> +
>> + if (WARN_ON(!wow))
>> + return -EINVAL;
>
> Unnecessary null check, wow is non-zero here.
>
>> + for (pos = 0; pos< wow->patterns[i].pattern_len;
>> + pos++) {
>> + if (wow->patterns[i].mask[pos / 8]& (0x1<< (pos % 8)))
>> + mask[pos] = 0xFF;
>
> This loop needs a comment.
>
>> + if (ar->tx_pending[ar->ctrl_ep]) {
>> + left = wait_event_interruptible_timeout(ar->event_wq,
>> + ar->tx_pending[ar->ctrl_ep] == 0, WMI_TIMEOUT);
>> + if (left == 0) {
>> + ret = -ETIMEDOUT;
>> + goto wow_setup_failed;
>> + } else if (left< 0) {
>> + ret = left;
>> + goto wow_setup_failed;
>
> A warning message for both of these error case would be nice.
>
>> +#define WOW_HOST_REQ_DELAY 500 /* 500 ms */
>
> No point of duplicating the value, "/* ms */" is enough.
>
> Kalle
Will fix all your above comments in V2..
^ permalink raw reply
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