IWL3945: Led doesn't blink in monitor mode
After fixing super annoying bug about garbage scan results, I noticed smaller bug:
My wireless leds stop blinking if I enable monitor mode (Note that this time this doesn't happen if I enable promisc mode)
Only module reload or recreation of wlan0 using iw helps.
This is due to the fact that once card is put in monitor mode it stays there always. (I will fix this bug when I have time)
But leds should work even in monitor mode.
Btw, do leds indicate RX activity or TX or both?
Best regards,
Maxim Levitsky
PS:
I will soon buy a standalone wireless card (pci express) Are iwlwifi based cards aviable?
Quoted 10 lines · Maxim Levitsky
After fixing super annoying bug about garbage scan results, I noticed smaller bug:
My wireless leds stop blinking if I enable monitor mode (Note that this time this doesn't happen if I enable promisc mode)
Only module reload or recreation of wlan0 using iw helps. This is due to the fact that once card is put in monitor mode it stays there always.
(I will fix this bug when I have time)
Great.
Quoted 5 lines
But leds should work even in monitor mode.
Btw, do leds indicate RX activity or TX or both?
I've excluded RX for now. Since the filtering of the RX packets was removed for favor or mac80211 filtering there was a lot of false blinking.
<snip>
static int iwl_get_blink_rate(struct iwl_priv *priv)
{
int i;
u64 current_tpt = priv->tx_stats[2].bytes;
/* FIXME: + priv->rx_stats[2].bytes; */</snip>
I'm pretty sure I won't have time to look at now
Quoted 4 lines
PS:
I will soon buy a standalone wireless card (pci express) Are iwlwifi based cards aviable?
Not sure if the cards are available stand alone.
Thanks
Tomas
Quoted 5 lines · Maxim Levitsky
After fixing super annoying bug about garbage scan results, I noticed smaller bug:
My wireless leds stop blinking if I enable monitor mode (Note that this time this doesn't happen if I enable promisc mode)
Ok, now I understand how its leds work.
the STATISTICS_NOTIFICATION reply from microcode drives all the led blinking code. on each such notification the handler decides based on traffic whenever to turn led solid or blink it.
the handler for 3945 actually counts recieved and transmitted packets!:
Quoted 9 lines
static inline u8
get_blink_rate(struct iwl3945_priv *priv){ int index; u64 current_tpt = priv->rxtxpackets; s64 tpt = current_tpt - priv->led_tpt; if (tpt < 0) tpt = -tpt; priv->led_tpt = current_tpt;
in iwl3945-led.c
priv->rxtxpackets is updated each time a packet is recieved/transmitted by iwl3945_pass_packet_to_mac80211:
Quoted 4 lines
#ifdef CONFIG_IWL3945_LEDS if (ieee80211_is_data(hdr->frame_control)) priv->rxtxpackets += len;#endif
and iwl3945_build_tx_cmd_basic:
Quoted 3 lines
#ifdef CONFIG_IWL3945_LEDS priv->rxtxpackets += le16_to_cpu(cmd->cmd.tx.len);#endif
now the problem is that as soon as the firmware enters the monitor mode it stops sending STATISTICS_NOTIFICATION.
So ether I need a way to tell firmware to continue sending this message, or use a timer instead in monitor mode.
How I can tell the firmware to send STATISTICS_NOTIFICATION in monitor mode? Intel developers, can you comment on this?
Btw, the led code really should be shared between 3945/4965.
Best regards,
Maxim Levitsky
Quoted 21 lines · Maxim Levitsky
Quoted 5 lines · Maxim Levitsky
After fixing super annoying bug about garbage scan results, I noticed smaller bug:
My wireless leds stop blinking if I enable monitor mode (Note that this time this doesn't happen if I enable promisc mode)
Ok, now I understand how its leds work.
the
STATISTICS_NOTIFICATIONreply from microcode drives all the led blinking code. on each such notification the handler decides based on traffic whenever to turn led solid or blink it.the handler for 3945 actually counts recieved and transmitted packets!:
Quoted 6 lines
static inline u8
get_blink_rate(struct iwl3945_priv *priv){ int index; u64 current_tpt = priv->rxtxpackets; s64 tpt = current_tpt - priv->led_tpt;
Quoted 6 lines
Quoted 3 lines
if (tpt < 0) tpt = -tpt; priv->led_tpt = current_tpt;in
iwl3945-led.c
Right I forgot I didn't change this in 3945.
Quoted 22 lines
priv->rxtxpacketsis updated each time a packet is recieved/transmitted byiwl3945_pass_packet_to_mac80211:Quoted 4 lines
#ifdef CONFIG_IWL3945_LEDS if (ieee80211_is_data(hdr->frame_control)) priv->rxtxpackets += len;#endif
and
iwl3945_build_tx_cmd_basic:Quoted 3 lines
#ifdef CONFIG_IWL3945_LEDS priv->rxtxpackets += le16_to_cpu(cmd->cmd.tx.len);#endif
now the problem is that as soon as the firmware enters the monitor mode it stops sending
STATISTICS_NOTIFICATION.
Quoted 6 lines
So ether I need a way to tell firmware to continue sending this message, or use a timer instead in monitor mode.
How I can tell the firmware to send
STATISTICS_NOTIFICATIONin monitor mode? Intel developers, can you comment on this?
Statistic notification is just used as a point where NIC is woken up. We don't wan to wake up NIC just for LED command.
But in monitor mode nic have to be run in CAM mode anyway so you can send the command out from the led timer directly.
Quoted 3 lines
Btw, the led code really should be shared between 3945/4965.
Oh, more then LED code :) But that's a lot of infrastructure code that need to be done. I still have hard heard on guys who split the code at the first place but that's already a history..
Tomas