Search Linux Wireless

Re: Receive all data packets in Managed mode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Saturday 13 October 2012 07:51:59 Krishnan Manivannan wrote:
> The VIF is in 'Managed mode' we want to receive data packets
> of other stations destined to a DS, and get it in the MAC
> reveive path.
Just to be clear, do you want to get these frames on the same
interface? And do you want the converted 802.3 or are "real"
802.11 frames that go over the air good enough (if so, please
read on!)?

> For example, In monitor mode, the VIF receives all packets, by
> sniffing in the medium & allows all packets of other stations
> being sent to AP, and deliver it to the upper layers. We want
> to receive all packets(of other Destination address) in
> managed mode.
You can do that with carl9170 (and in fact it should work with
all other mac80211 drivers too). What you want is an additional
monitor interface:
<http://wireless.kernel.org/en/users/Documentation/iw#Adding_interfaces_with_iw>

With it, you can receive and inject 802.11 frames without
worrying too much about filters and carl9170/mac80211
internals.

# iw dev wlanX interface add moni0 type monitor flags none
# ifconfig moni0 up
And then start your favorite sniffer (wireshark, or whatever
you want to use).

> Is it possible to sniff packets in Managed mode. where in data
> packets sent by other stations are also received?
If the solution above suits your needs, then the answer is YES.
You don't need to modify the firmware. However, please be
advised, that the hardware sniffer mode is more some sort
of debug operation. And that with the current kernel code
you might experience some interference trouble if you
use carl9170 as a pure monitor. In this case you want
to apply the following patch. 
https://patchwork.kernel.org/patch/1439881/

But you don't need it, if you are going with the
station/managed interface + monitor interface stuff
(the solution above).

> Although I tried couple of things in Firmware & Carl9170, I coudn't  achieve the result.
> 1.In ::carlfw/usb/main.c,
>    void handle_usb(void)
> ++   set(AR9170_MAC_REG_SNIFFER, 1);   //added this line to enable sniffing in Managed mode
> 
> 2. In ::carlfw/src/wlanrx.c
>     void handle_wlan_rx(void)
>   -- if (!(wlan_rx_filter(desc) & fw.wlan.rx_filter))   //changed this line to
>   ++ if( 1 )
> 
> 
> In carl9170 module, source code,
>   In fine mac.c
>   int carl9170_set_operating_mode(struct ar9170 *ar)
>   -- carl9170_regwrite(AR9170_MAC_REG_SNIFFER, sniffer);
>   ++ carl9170_regwrite(AR9170_MAC_REG_SNIFFER, sniffer | AR9170_MAC_SNIFFER_ENABLE_PROMISC );
> 
> 
> In order to achieve this, what changes in firmware/ Carl9170 module needs to be done?
the AR9170 is a pretty simple 802.11 chip, it only does some
filtering (frames with bad FCS/checksums, bad length, ...).
Most of the complex filtering happens in net/mac80211/rx.c
(linux kernel).

Regards,
	Chr
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux