From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michal Kazior Date: Wed, 24 Apr 2013 14:18:11 +0200 Subject: [ath9k-devel] [PATCH 2/2] ath10k: don't advertise we want monitor vif In-Reply-To: <20855.50080.778515.188903@gargle.gargle.HOWL> References: <1366798632-20517-1-git-send-email-michal.kazior@tieto.com> <1366798632-20517-3-git-send-email-michal.kazior@tieto.com> <20855.50080.778515.188903@gargle.gargle.HOWL> Message-ID: <5177CD83.4030900@tieto.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: ath9k-devel@lists.ath9k.org On 24/04/13 13:36, Sujith Manoharan wrote: > Michal Kazior wrote: >> We were triggering warnings in our code and >> mac80211. We could fix the monitor state machine >> in ath10k but it doesn't make much sense. We don't >> benefit from having the monitor vif create in the >> first place so just drop it. > > What warnings ? Commands: ; ifconfig wlan1 up ; iw wlan1 connect -w dd-wrt-open wlan1 (phy #20): connected to 68:7f:74:0a:ca:80 ; iw wlan1 interface add mon type monitor ; ifconfig mon up ; ifconfig wlan1 down Dmesg: [ 1989.477975] ath10k: Only one monitor interface allowed [ 1989.478016] ath10k: ath10k_htc_notify_tx_completion: ep 2 skb ffff880220e480c0 [ 1989.481481] ------------[ cut here ]------------ [ 1989.486963] WARNING: at net/mac80211/iface.c:386 ieee80211_add_virtual_monitor+0xe4/0x154 [mac80211]() [ 1989.489749] Hardware name: Latitude E6420 [ 1989.494853] Modules linked in: ath10k_pci(O) ath10k_core(O) ath3k ipt_REJECT nf_conntrack_ipv4 nf_defrag_ipv4 xt_state nf_conntrack xt_comment xt_tcpudp iptable_filter ip_tables x_tables bnep rfcomm ext2 btusb bluetooth snd_hda_codec_hdmi arc4 snd_hda_codec_idt snd_hda_intel snd_hda_codec snd_hwdep acpi_cpufreq iwldvm snd_pcm_oss snd_mixer_oss coretemp mac80211 joydev snd_pcm kvm_intel snd_seq_midi iwlwifi ath snd_rawmidi kvm cfg80211 snd_seq_midi_event snd_seq ppdev ehci_pci dell_wmi snd_timer snd_seq_device snd sparse_keymap ehci_hcd microcode soundcore usbcore psmouse serio_raw rfkill dell_laptop dcdbas usb_common lpc_ich mfd_core snd_page_alloc parport_pc evdev mperf battery ac processor lp parport loop ext4 mbcache jbd2 crc16 sha256_generic dm_crypt dm_mod sr_mod sd_mod crc_t10dif cdrom i915 drm_kms_helper drm i2c_algo_bit crc32c_intel ghash_clmulni_intel aesni_intel ablk_helper cryptd lrw aes_x86_64 xts gf128mul ahci libahci sdhci_pci e1000e wmi libata sdhci ptp button i2c _core mmc_core scsi_mod thermal video pps_core thermal_sys [last unloaded: ath10k_core] [ 1989.529489] Pid: 13722, comm: ifconfig Tainted: G W O 3.9.0-rc6-wl-ath10k+ #27 [ 1989.535284] Call Trace: [ 1989.540865] [] warn_slowpath_common+0x7e/0x98 [ 1989.546691] [] warn_slowpath_null+0x15/0x17 [ 1989.552393] [] ieee80211_add_virtual_monitor+0xe4/0x154 [mac80211] [ 1989.558234] [] ieee80211_do_stop+0x545/0x554 [mac80211] [ 1989.564011] [] ieee80211_stop+0x15/0x19 [mac80211] [ 1989.569579] [] __dev_close_many+0x97/0xbf [ 1989.575240] [] __dev_close+0x43/0x62 [ 1989.580956] [] __dev_change_flags+0xa6/0x129 [ 1989.586554] [] dev_change_flags+0x19/0x4f [ 1989.592177] [] devinet_ioctl+0x28d/0x58b [ 1989.597712] [] inet_ioctl+0x87/0xa2 [ 1989.603262] [] sock_do_ioctl+0x22/0x41 [ 1989.608740] [] sock_ioctl+0x20e/0x21c [ 1989.614138] [] do_vfs_ioctl+0x465/0x4a6 [ 1989.619686] [] ? fcheck_files+0xa9/0xe7 [ 1989.625088] [] sys_ioctl+0x59/0x80 [ 1989.630644] [] ? trace_hardirqs_on_thunk+0x3a/0x3f [ 1989.636089] [] system_call_fastpath+0x16/0x1b [ 1989.641483] ---[ end trace 549c97fd542fd00f ]--- > I think this flag is required, mac80211 uses it to notify > the driver to create an explicit monitor interface. Depending on how we want to make it work. The flag is only useful if we want to know if there are monitor interfaces active only. Right now we can create the monitor vdev in two ways: * config() callback and CONF_CHANGE_MONITOR * add_interface() callback with TYPE_MONITOR Really depends on what we want to support. I just tested the following: ; iw wlan1 interface add mon type monitor ; ifconfig mon up ; tcpdump -ni mon & ; ifconfig wlan1 up ; iw wlan1 connect -w dd-wrt-open wlan1 (phy #20): connected to 68:7f:74:0a:ca:80 Right after association FW dumps. However if I first associate and then start monitor - no dumps. FW dump also happens if I try to do packet injection in real monitor mode. Considering how "stable" monitor mode is perhaps we should start monitor vdev only when there's the monitor vif present? (right now we can start it without the vdev). If so then we drop this patch. And we probably also should forbid packet injection, at least until FW gets this sorted out. -- Pozdrawiam / Best regards, Michal Kazior.