Re: [ath9k-devel] [RFC] ath9k: advertise p2p dev support when chanctx

2015-06-15 Thread Sujith Manoharan
Janusz Dziedzic wrote:
 Add p2p dev support when ath9k loaded with
 use_chanctx=1. This will fix problem, when first
 interface is an AP and next we would like to run
 p2p_find. Before p2p scan failed.
 
 Signed-off-by: Janusz Dziedzic janusz.dzied...@tieto.com
 ---
 @Felix, Sujith please review. I am not sure if didn't miss some
 case for NL80211_IFTYPE_P2P_DEVICE (special handling required?).

At least the callbacks for adding/removing interfaces need
to be handled ?

But, can you describe the sequence of commands used that
resulted in this issue ?

Sujith
___
ath9k-devel mailing list
ath9k-devel@lists.ath9k.org
https://lists.ath9k.org/mailman/listinfo/ath9k-devel


Re: [ath9k-devel] Connecting multiple times to same base station

2015-06-15 Thread Michal Kazior
On 15 June 2015 at 09:47, Kilian Risse kri...@student.ethz.ch wrote:
 Hi all

 I tried to simulate multiple clients through a single ar93xx card. I
 noticed that even though I connect with the base station multiple times
 through several interfaces, the MAC address with which I send packets
 (and am associated to the access point) remains the same; the one of the
 primary station.

 The interfaces have all different MAC addresses and they have different
 IPs. But whenever I arping any of the IP addresses it returns the MAC of
 the primary station.

I'm guessing you're using the same IP subnet on all of them.

You'll need to either tune IP routing
(https://lwn.net/Articles/364318/) and/or force sockets to bind to
interfaces (e.g. ping with -I parameter).

Personally, I often use ipv6 link-local addresses to test traffic on
such topologies to avoid the problem.


MichaƂ
___
ath9k-devel mailing list
ath9k-devel@lists.ath9k.org
https://lists.ath9k.org/mailman/listinfo/ath9k-devel


Re: [ath9k-devel] Connecting multiple times to same base station

2015-06-15 Thread Kilian Risse
Thanks for the reply! I think I explained my problem poorly - I'll try
again;

I have an access point and 2 computers. One connected to the AP by
ethernet (PC0) and the other by wlan (PC1).

In order to simulate several clients in the wlan I multiplex the card of
PC1. The problem is that all frames sent from PC0 to the different
interfaces have the same MAC address.

I tried to change the MAC addresses in the ARP cache of PC0 such that
each IP has the intended MAC address (the one assigned to the
interface). But then the frames get all lost - I cannot even ping the
different interfaces of PC1 (except the primary interface as it still
has the same MAC).

 I'm guessing you're using the same IP subnet on all of them.

 You'll need to either tune IP routing
 (https://lwn.net/Articles/364318/) and/or force sockets to bind to
 interfaces (e.g. ping with -I parameter).

 Personally, I often use ipv6 link-local addresses to test traffic on
 such topologies to avoid the problem.

Correct me if I am wrong - but what you suggested is only needed if I
want to send data from the different interfaces to each other or send
from the different interfaces - right?

Thanks for the help

Kilian


___
ath9k-devel mailing list
ath9k-devel@lists.ath9k.org
https://lists.ath9k.org/mailman/listinfo/ath9k-devel


Re: [ath9k-devel] [RFC] ath9k: advertise p2p dev support when chanctx

2015-06-15 Thread Janusz Dziedzic
On 15 June 2015 at 12:33, Sujith Manoharan suj...@msujith.org wrote:
 Janusz Dziedzic wrote:
 Add p2p dev support when ath9k loaded with
 use_chanctx=1. This will fix problem, when first
 interface is an AP and next we would like to run
 p2p_find. Before p2p scan failed.

 Signed-off-by: Janusz Dziedzic janusz.dzied...@tieto.com
 ---
 @Felix, Sujith please review. I am not sure if didn't miss some
 case for NL80211_IFTYPE_P2P_DEVICE (special handling required?).

 At least the callbacks for adding/removing interfaces need
 to be handled ?

Strange, but I didn't hit any problem yet with my simple patch.

 But, can you describe the sequence of commands used that
 resulted in this issue ?

1. load ath9k with use_chanctx=1
2. run wpa_supplicant using wlan0
3. connect wlan0 to AP
4. when we are connected, run p2p_find form wpa_cli
5. scan will failed with Operation not supported (even I will
force-ap-scan, while chanctx version using hw_scan callback ...)
6. p2p_find will fail

BR
Janusz
___
ath9k-devel mailing list
ath9k-devel@lists.ath9k.org
https://lists.ath9k.org/mailman/listinfo/ath9k-devel


Re: [ath9k-devel] [RFC] ath9k: advertise p2p dev support when chanctx

2015-06-15 Thread Janusz Dziedzic
On 15 June 2015 at 13:38, Janusz Dziedzic janusz.dzied...@tieto.com wrote:
 On 15 June 2015 at 12:33, Sujith Manoharan suj...@msujith.org wrote:
 Janusz Dziedzic wrote:
 Add p2p dev support when ath9k loaded with
 use_chanctx=1. This will fix problem, when first
 interface is an AP and next we would like to run
 p2p_find. Before p2p scan failed.

 Signed-off-by: Janusz Dziedzic janusz.dzied...@tieto.com
 ---
 @Felix, Sujith please review. I am not sure if didn't miss some
 case for NL80211_IFTYPE_P2P_DEVICE (special handling required?).

 At least the callbacks for adding/removing interfaces need
 to be handled ?

 Strange, but I didn't hit any problem yet with my simple patch.

 But, can you describe the sequence of commands used that
 resulted in this issue ?

 1. load ath9k with use_chanctx=1
 2. run wpa_supplicant using wlan0
 3. connect wlan0 to AP
3. setup AP using wlan0
 4. run p2p_find form wpa_cli
 5. scan will failed with Operation not supported (even I will
 force-ap-scan, while chanctx version using hw_scan callback ...)
 6. p2p_find will fail

 BR
 Janusz
___
ath9k-devel mailing list
ath9k-devel@lists.ath9k.org
https://lists.ath9k.org/mailman/listinfo/ath9k-devel


Re: [ath9k-devel] [RFC] ath9k: allow to receive probe request when offchannel

2015-06-15 Thread Felix Fietkau
On 2015-06-10 07:03, Janusz Dziedzic wrote:
 This fix problem that p2p group negotiation didn't work
 correctly when chanctx used, because we didn't receive
 probe requests when offchannel and use_chanctx=1
 
 Signed-off-by: Janusz Dziedzic janusz.dzied...@tieto.com
 ---
 @Felix, Sujith could you review? I am not sure I put this in correct place.
 
  drivers/net/wireless/ath/ath9k/channel.c | 6 ++
  1 file changed, 6 insertions(+)
 
 diff --git a/drivers/net/wireless/ath/ath9k/channel.c 
 b/drivers/net/wireless/ath/ath9k/channel.c
 index 2066650..6301d44 100644
 --- a/drivers/net/wireless/ath/ath9k/channel.c
 +++ b/drivers/net/wireless/ath/ath9k/channel.c
 @@ -1157,6 +1157,7 @@ static bool ath_chanctx_defer_switch(struct ath_softc 
 *sc)
  static void ath_offchannel_channel_change(struct ath_softc *sc)
  {
   struct ath_common *common = ath9k_hw_common(sc-sc_ah);
 + u32 rfilt;
  
   ath_dbg(common, CHAN_CTX, %s: offchannel state: %s\n,
   __func__, offchannel_state_string(sc-offchannel.state));
 @@ -1179,6 +1180,11 @@ static void ath_offchannel_channel_change(struct 
 ath_softc *sc)
   ath_scan_complete(sc, false);
   break;
   case ATH_OFFCHANNEL_ROC_START:
 + /* Allow to receive probe requests */
 + rfilt = ath_calcrxfilter(sc);
 + rfilt |= ATH9K_RX_FILTER_PROBEREQ;
I think ath_calcrxfilter should set this, otherwise it might be
overwritten, e.g. on BB watchdog reset.

- Felix
___
ath9k-devel mailing list
ath9k-devel@lists.ath9k.org
https://lists.ath9k.org/mailman/listinfo/ath9k-devel


Re: [ath9k-devel] [RFC] ath9k: allow to receive probe request when offchannel

2015-06-15 Thread Janusz Dziedzic
adding Sujith correct mail

On 10 June 2015 at 07:03, Janusz Dziedzic janusz.dzied...@tieto.com wrote:
 This fix problem that p2p group negotiation didn't work
 correctly when chanctx used, because we didn't receive
 probe requests when offchannel and use_chanctx=1

 Signed-off-by: Janusz Dziedzic janusz.dzied...@tieto.com
 ---
 @Felix, Sujith could you review? I am not sure I put this in correct place.

  drivers/net/wireless/ath/ath9k/channel.c | 6 ++
  1 file changed, 6 insertions(+)

 diff --git a/drivers/net/wireless/ath/ath9k/channel.c 
 b/drivers/net/wireless/ath/ath9k/channel.c
 index 2066650..6301d44 100644
 --- a/drivers/net/wireless/ath/ath9k/channel.c
 +++ b/drivers/net/wireless/ath/ath9k/channel.c
 @@ -1157,6 +1157,7 @@ static bool ath_chanctx_defer_switch(struct ath_softc 
 *sc)
  static void ath_offchannel_channel_change(struct ath_softc *sc)
  {
 struct ath_common *common = ath9k_hw_common(sc-sc_ah);
 +   u32 rfilt;

 ath_dbg(common, CHAN_CTX, %s: offchannel state: %s\n,
 __func__, offchannel_state_string(sc-offchannel.state));
 @@ -1179,6 +1180,11 @@ static void ath_offchannel_channel_change(struct 
 ath_softc *sc)
 ath_scan_complete(sc, false);
 break;
 case ATH_OFFCHANNEL_ROC_START:
 +   /* Allow to receive probe requests */
 +   rfilt = ath_calcrxfilter(sc);
 +   rfilt |= ATH9K_RX_FILTER_PROBEREQ;
 +   ath9k_hw_setrxfilter(sc-sc_ah, rfilt);
 +
 if (sc-cur_chan != sc-offchannel.chan)
 break;

 --
 1.9.1

___
ath9k-devel mailing list
ath9k-devel@lists.ath9k.org
https://lists.ath9k.org/mailman/listinfo/ath9k-devel


Re: [ath9k-devel] [RFC] ath9k: allow to receive probe request when offchannel

2015-06-15 Thread Sujith Manoharan
Janusz Dziedzic wrote:
  case ATH_OFFCHANNEL_ROC_START:
  +   /* Allow to receive probe requests */
  +   rfilt = ath_calcrxfilter(sc);
  +   rfilt |= ATH9K_RX_FILTER_PROBEREQ;
  +   ath9k_hw_setrxfilter(sc-sc_ah, rfilt);
  +

ath9k_set_offchannel_state() would be a better place to do this,
since setting up various bits in the HW for offchannel operation
is done there. Also, it would make sure that the HW state is
retained when a chip reset is done for some reason.

Sujith
___
ath9k-devel mailing list
ath9k-devel@lists.ath9k.org
https://lists.ath9k.org/mailman/listinfo/ath9k-devel


Re: [ath9k-devel] [RFC] ath9k: advertise p2p dev support when chanctx

2015-06-15 Thread Sujith Manoharan
Janusz Dziedzic wrote:
  At least the callbacks for adding/removing interfaces need
  to be handled ?
 
 Strange, but I didn't hit any problem yet with my simple patch.

Ok. But I am not very familiar with how p2p-device is supposed
to be used...

Sujith
___
ath9k-devel mailing list
ath9k-devel@lists.ath9k.org
https://lists.ath9k.org/mailman/listinfo/ath9k-devel


Re: [ath9k-devel] [RFC] ath9k: advertise p2p dev support when chanctx

2015-06-15 Thread Sujith Manoharan
Arend van Spriel wrote:
 The p2p-device is designed to be used for p2p discovery and p2p action 
 frame exchange. It make it easier for driver and/or firmware to 
 determine if user-space request is p2p related or not. However, in 
 discussions with Jouni I got the impression that ath (or qca) firmware 
 and/or drivers did not need this design. Not sure if that claim is 
 unaffected by the use_chanctx=1 parameter.

Thanks for the explanation.

I don't think advertising support for p2p-device is required for
ath9k. P2P discovery works properly with the normal station/ap interface
types and the 'use_chanctx' modparam simply enables multiple channel
contexts.

Sujith
___
ath9k-devel mailing list
ath9k-devel@lists.ath9k.org
https://lists.ath9k.org/mailman/listinfo/ath9k-devel


Re: [ath9k-devel] [RFC] ath9k: advertise p2p dev support when chanctx

2015-06-15 Thread Arend van Spriel
+ Jouni

On 06/15/15 17:47, Sujith Manoharan wrote:
 Janusz Dziedzic wrote:
 At least the callbacks for adding/removing interfaces need
 to be handled ?

 Strange, but I didn't hit any problem yet with my simple patch.

 Ok. But I am not very familiar with how p2p-device is supposed
 to be used...

The p2p-device is designed to be used for p2p discovery and p2p action 
frame exchange. It make it easier for driver and/or firmware to 
determine if user-space request is p2p related or not. However, in 
discussions with Jouni I got the impression that ath (or qca) firmware 
and/or drivers did not need this design. Not sure if that claim is 
unaffected by the use_chanctx=1 parameter.

Regards,
Arend

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

___
ath9k-devel mailing list
ath9k-devel@lists.ath9k.org
https://lists.ath9k.org/mailman/listinfo/ath9k-devel


[ath9k-devel] Connecting multiple times to same base station

2015-06-15 Thread Kilian Risse
Hi all

I tried to simulate multiple clients through a single ar93xx card. I
noticed that even though I connect with the base station multiple times
through several interfaces, the MAC address with which I send packets
(and am associated to the access point) remains the same; the one of the
primary station.

The interfaces have all different MAC addresses and they have different
IPs. But whenever I arping any of the IP addresses it returns the MAC of
the primary station.

I wanted to ask whether this is intended behavior (and the use case not
supported) or whether this is a bug.

Thanks for the help

Kilian
___
ath9k-devel mailing list
ath9k-devel@lists.ath9k.org
https://lists.ath9k.org/mailman/listinfo/ath9k-devel