All of lore.kernel.org
 help / color / mirror / Atom feed
* [ath9k-devel] regarding ATH9K_RXERR_PHY flag
@ 2012-03-14 21:27 abhinav narain
  2012-03-14 22:07 ` Adrian Chadd
  0 siblings, 1 reply; 15+ messages in thread
From: abhinav narain @ 2012-03-14 21:27 UTC (permalink / raw)
  To: ath9k-devel

hi,
 I have noticed that the flag ATH9K_RXERR_PHY is never set ( I am printing
it after checking )
 Is the PHY flag of any significance/set anytime ?

 I noticed ATH9K_RXERR_FIFO error is dummy and never set.
ATH9K_RXERR_CRC is set.

Abhinav
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ath9k.org/pipermail/ath9k-devel/attachments/20120314/3a0ed8ac/attachment.htm 

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [ath9k-devel] regarding ATH9K_RXERR_PHY flag
  2012-03-14 21:27 [ath9k-devel] regarding ATH9K_RXERR_PHY flag abhinav narain
@ 2012-03-14 22:07 ` Adrian Chadd
  2012-03-14 22:33   ` abhinav narain
  0 siblings, 1 reply; 15+ messages in thread
From: Adrian Chadd @ 2012-03-14 22:07 UTC (permalink / raw)
  To: ath9k-devel

RXERR_PHY is only set if you've enabled PHY errors  in AR_RX_FILTER /
AR_PCU_PHYERR_MASK.


ADrian

On 14 March 2012 14:27, abhinav narain <abhinavnarain10@gmail.com> wrote:
> hi,
> ?I have noticed that the flag ATH9K_RXERR_PHY is never set ( I am printing
> it after checking )
> ?Is the PHY flag of any significance/set anytime ?
>
> ?I noticed ATH9K_RXERR_FIFO error is dummy and never set.
> ATH9K_RXERR_CRC is set.
>
> Abhinav
>
> _______________________________________________
> ath9k-devel mailing list
> ath9k-devel at lists.ath9k.org
> https://lists.ath9k.org/mailman/listinfo/ath9k-devel
>

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [ath9k-devel] regarding ATH9K_RXERR_PHY flag
  2012-03-14 22:07 ` Adrian Chadd
@ 2012-03-14 22:33   ` abhinav narain
  2012-03-14 22:44     ` Adrian Chadd
  0 siblings, 1 reply; 15+ messages in thread
From: abhinav narain @ 2012-03-14 22:33 UTC (permalink / raw)
  To: ath9k-devel

Ok.
The following two functions  have two lines :
1. ath9k_hw_setrxfilter() :

       if (bits & ATH9K_RX_FILTER_PHYERR)
                phybits |= AR_PHY_ERR_OFDM_TIMING | AR_PHY_ERR_CCK_TIMING;

2. ath9k_hw_getrxfilter()
 if (phybits & (AR_PHY_ERR_OFDM_TIMING | AR_PHY_ERR_CCK_TIMING))
                bits |= ATH9K_RX_FILTER_PHYERR;

Does it suggest that they are set ?
As I can't find anywhere else, this being set (ath9k driver)
I can't find AR_PCU_PHYERR_MASK in the codebase.

Abhinav

On Wed, Mar 14, 2012 at 6:07 PM, Adrian Chadd <adrian@freebsd.org> wrote:

> RXERR_PHY is only set if you've enabled PHY errors  in AR_RX_FILTER /
> AR_PCU_PHYERR_MASK.
>
>
> ADrian
>
> On 14 March 2012 14:27, abhinav narain <abhinavnarain10@gmail.com> wrote:
> > hi,
> >  I have noticed that the flag ATH9K_RXERR_PHY is never set ( I am
> printing
> > it after checking )
> >  Is the PHY flag of any significance/set anytime ?
> >
> >  I noticed ATH9K_RXERR_FIFO error is dummy and never set.
> > ATH9K_RXERR_CRC is set.
> >
> > Abhinav
> >
> > _______________________________________________
> > ath9k-devel mailing list
> > ath9k-devel at lists.ath9k.org
> > https://lists.ath9k.org/mailman/listinfo/ath9k-devel
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ath9k.org/pipermail/ath9k-devel/attachments/20120314/9d0490c1/attachment.htm 

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [ath9k-devel] regarding ATH9K_RXERR_PHY flag
  2012-03-14 22:33   ` abhinav narain
@ 2012-03-14 22:44     ` Adrian Chadd
  2012-03-14 23:09       ` abhinav narain
  0 siblings, 1 reply; 15+ messages in thread
From: Adrian Chadd @ 2012-03-14 22:44 UTC (permalink / raw)
  To: ath9k-devel

Hi,

That's the right function. ATH9K_RX_FILTER_PHYERR is likely not being
set, so setrxfilter() isn't enabling the relevant bits.

The phy error and RX filter mask registers are in that function. I
just got the names wrong. -)


adrian

On 14 March 2012 15:33, abhinav narain <abhinavnarain10@gmail.com> wrote:
> Ok.
> The following two functions ?have two lines :
> 1. ath9k_hw_setrxfilter() :
>
> ? ? ? ?if (bits & ATH9K_RX_FILTER_PHYERR)
> ? ? ? ? ? ? ? ? phybits |= AR_PHY_ERR_OFDM_TIMING | AR_PHY_ERR_CCK_TIMING;
>
> 2. ath9k_hw_getrxfilter()
> ?if (phybits & (AR_PHY_ERR_OFDM_TIMING | AR_PHY_ERR_CCK_TIMING))
> ? ? ? ? ? ? ? ? bits |= ATH9K_RX_FILTER_PHYERR;
>
> Does it suggest that they are set ?
> As I can't find anywhere else, this being set (ath9k driver)
> I can't find?AR_PCU_PHYERR_MASK in the codebase.
>
> Abhinav
>
> On Wed, Mar 14, 2012 at 6:07 PM, Adrian Chadd <adrian@freebsd.org> wrote:
>>
>> RXERR_PHY is only set if you've enabled PHY errors ?in AR_RX_FILTER /
>> AR_PCU_PHYERR_MASK.
>>
>>
>> ADrian
>>
>> On 14 March 2012 14:27, abhinav narain <abhinavnarain10@gmail.com> wrote:
>> > hi,
>> > ?I have noticed that the flag ATH9K_RXERR_PHY is never set ( I am
>> > printing
>> > it after checking )
>> > ?Is the PHY flag of any significance/set anytime ?
>> >
>> > ?I noticed ATH9K_RXERR_FIFO error is dummy and never set.
>> > ATH9K_RXERR_CRC is set.
>> >
>> > Abhinav
>> >
>> > _______________________________________________
>> > ath9k-devel mailing list
>> > ath9k-devel at lists.ath9k.org
>> > https://lists.ath9k.org/mailman/listinfo/ath9k-devel
>> >
>
>

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [ath9k-devel] regarding ATH9K_RXERR_PHY flag
  2012-03-14 22:44     ` Adrian Chadd
@ 2012-03-14 23:09       ` abhinav narain
  2012-03-14 23:43         ` Adrian Chadd
  0 siblings, 1 reply; 15+ messages in thread
From: abhinav narain @ 2012-03-14 23:09 UTC (permalink / raw)
  To: ath9k-devel

On Wed, Mar 14, 2012 at 6:44 PM, Adrian Chadd <adrian@freebsd.org> wrote:

> Hi,
>
> That's the right function. ATH9K_RX_FILTER_PHYERR is likely not being
> set, so setrxfilter() isn't enabling the relevant bits.
>
> So, is there anything I can do to fix it ?
or the hardware is not setting the bits and I can't do much about it ?


> The phy error and RX filter mask registers are in that function. I
> just got the names wrong. -)
>
> :)


Abhinav

>
>
> On 14 March 2012 15:33, abhinav narain <abhinavnarain10@gmail.com> wrote:
> > Ok.
> > The following two functions  have two lines :
> > 1. ath9k_hw_setrxfilter() :
> >
> >        if (bits & ATH9K_RX_FILTER_PHYERR)
> >                 phybits |= AR_PHY_ERR_OFDM_TIMING |
> AR_PHY_ERR_CCK_TIMING;
> >
> > 2. ath9k_hw_getrxfilter()
> >  if (phybits & (AR_PHY_ERR_OFDM_TIMING | AR_PHY_ERR_CCK_TIMING))
> >                 bits |= ATH9K_RX_FILTER_PHYERR;
> >
> > Does it suggest that they are set ?
> > As I can't find anywhere else, this being set (ath9k driver)
> > I can't find AR_PCU_PHYERR_MASK in the codebase.
> >
> > Abhinav
> >
> > On Wed, Mar 14, 2012 at 6:07 PM, Adrian Chadd <adrian@freebsd.org>
> wrote:
> >>
> >> RXERR_PHY is only set if you've enabled PHY errors  in AR_RX_FILTER /
> >> AR_PCU_PHYERR_MASK.
> >>
> >>
> >> ADrian
> >>
> >> On 14 March 2012 14:27, abhinav narain <abhinavnarain10@gmail.com>
> wrote:
> >> > hi,
> >> >  I have noticed that the flag ATH9K_RXERR_PHY is never set ( I am
> >> > printing
> >> > it after checking )
> >> >  Is the PHY flag of any significance/set anytime ?
> >> >
> >> >  I noticed ATH9K_RXERR_FIFO error is dummy and never set.
> >> > ATH9K_RXERR_CRC is set.
> >> >
> >> > Abhinav
> >> >
> >> > _______________________________________________
> >> > ath9k-devel mailing list
> >> > ath9k-devel at lists.ath9k.org
> >> > https://lists.ath9k.org/mailman/listinfo/ath9k-devel
> >> >
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ath9k.org/pipermail/ath9k-devel/attachments/20120314/a4e3c232/attachment.htm 

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [ath9k-devel] regarding ATH9K_RXERR_PHY flag
  2012-03-14 23:09       ` abhinav narain
@ 2012-03-14 23:43         ` Adrian Chadd
  2012-03-15 10:10           ` abhinav narain
  0 siblings, 1 reply; 15+ messages in thread
From: Adrian Chadd @ 2012-03-14 23:43 UTC (permalink / raw)
  To: ath9k-devel

You can set the bits. That's the point.

Something else sets ATH9K_RX_FILTER_PHYERR when it calls calcrxfilter().

The hardware will report PHY errors if it's programmed to.  Since
nothing in the driver or stack is requesting PHY errors be reported,
ath9k isn't programming the relevant bits into the hardware.



Adrian

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [ath9k-devel] regarding ATH9K_RXERR_PHY flag
  2012-03-14 23:43         ` Adrian Chadd
@ 2012-03-15 10:10           ` abhinav narain
  2012-03-15 10:17             ` abhinav narain
  0 siblings, 1 reply; 15+ messages in thread
From: abhinav narain @ 2012-03-15 10:10 UTC (permalink / raw)
  To: ath9k-devel

On Wed, Mar 14, 2012 at 7:43 PM, Adrian Chadd <adrian@freebsd.org> wrote:

> You can set the bits. That's the point.
>
> Something else sets ATH9K_RX_FILTER_PHYERR when it calls calcrxfilter().
>
> ok. There are two functions from where calcrxfilter() is called :
1) ath9k_htc_opmode_init() recv.c
2)  ath9k_configure_filter()  main.c


I tried the following in (2) :
        sc->rx.rxfilter = *total_flags | ;
        ath9k_ps_wakeup(sc);
        rfilt = ath_calcrxfilter(sc);
        rfilt |= ATH9K_RX_FILTER_PHYERR ;
        ath9k_hw_setrxfilter(sc->sc_ah, rfilt);

if(rfilt & ATH9K_RX_FILTER_PHYERR)




The hardware will report PHY errors if it's programmed to.  Since
> nothing in the driver or stack is requesting PHY errors be reported,
> ath9k isn't programming the relevant bits into the hardware.
>
>
>
> Adrian
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ath9k.org/pipermail/ath9k-devel/attachments/20120315/989309f6/attachment.htm 

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [ath9k-devel] regarding ATH9K_RXERR_PHY flag
  2012-03-15 10:10           ` abhinav narain
@ 2012-03-15 10:17             ` abhinav narain
  2012-03-15 18:50               ` Adrian Chadd
  0 siblings, 1 reply; 15+ messages in thread
From: abhinav narain @ 2012-03-15 10:17 UTC (permalink / raw)
  To: ath9k-devel

On Thu, Mar 15, 2012 at 6:10 AM, abhinav narain
<abhinavnarain10@gmail.com>wrote:

>
>
> On Wed, Mar 14, 2012 at 7:43 PM, Adrian Chadd <adrian@freebsd.org> wrote:
>
>> You can set the bits. That's the point.
>>
>> Something else sets ATH9K_RX_FILTER_PHYERR when it calls calcrxfilter().
>>
>> ok. There are two functions from where calcrxfilter() is called :
> 1) ath9k_htc_opmode_init() recv.c
> 2)  ath9k_configure_filter()  main.c
>
>
> I tried the following in (2) :
>         sc->rx.rxfilter = *total_flags | ;
>         ath9k_ps_wakeup(sc);
>         rfilt = ath_calcrxfilter(sc);
>         rfilt |= ATH9K_RX_FILTER_PHYERR ;
>         ath9k_hw_setrxfilter(sc->sc_ah, rfilt);
>
> if(rfilt & ATH9K_RX_FILTER_PHYERR)
>
        printk("something") ;
    else
        printk("sec thing");

printk("third thing");


in the dmesg log, i get multiple prints of "third thing" but none of the
other two printk()s.

In (1)  I do the following :

        /* configure rx filter */
        rfilt = ath_calcrxfilter(sc);
         rfilt |= ATH9K_RX_FILTER_PHYERR;
        ath9k_hw_setrxfilter(ah, rfilt);
but I don't see the check printing true in ath9k_rx_accept (in recv.c) :
                if (rx_stats->rs_status & ATH9K_RXERR_PHY)

Do I have to take anything else into account to set the ATH9K_RX filter ?
Please give any hints.

Abhinav
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ath9k.org/pipermail/ath9k-devel/attachments/20120315/056303a8/attachment.htm 

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [ath9k-devel] regarding ATH9K_RXERR_PHY flag
  2012-03-15 10:17             ` abhinav narain
@ 2012-03-15 18:50               ` Adrian Chadd
  2012-03-16  0:30                 ` abhinav narain
  0 siblings, 1 reply; 15+ messages in thread
From: Adrian Chadd @ 2012-03-15 18:50 UTC (permalink / raw)
  To: ath9k-devel

Hi,

Here's what you need to know:

* something needs to set ATH9K_RX_FILTER_PHYERR;
* you then have to set some PHY errors in the PHY error mask register.
That's in calcrxfilter() too, just look at what other bits you can set
in the relevant mask register;
* calcrxfilter() should be enabling "zero-length DMA" so frames with
zero length are still DMAed. All PHY error frames (save radar/spectral
scan) have 0 payload, so by default they're not DMAed to the host;
* you need to have an environment that generates PHY errors. :-)


Adrian

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [ath9k-devel] regarding ATH9K_RXERR_PHY flag
  2012-03-15 18:50               ` Adrian Chadd
@ 2012-03-16  0:30                 ` abhinav narain
  2012-03-16  4:00                   ` abhinav narain
  0 siblings, 1 reply; 15+ messages in thread
From: abhinav narain @ 2012-03-16  0:30 UTC (permalink / raw)
  To: ath9k-devel

Hi,
I have figured out the following.

In ath_pci_probe() [pci.c], ieee80211_alloc_hw() is called with ath9k_ops
to set the configured options for the driver.
ieee80211_alloc_hw() initialized the ieee80211_reconfig_filter, which calls
ieee80211_configure_filter(), which ultimately sets the flags by calling
the handler drv_configure_filter() which calls ath9k_configure_filter()
function with the set of flafs in iee802_configure_filter().

The flags : pspoll,fcs_fail,plcpfail are all set by checking the state of
local (structure representing the hardware state).

The point is to find out where the hardware state is set so that the
drivers captures the frames ? so that PHY_ERR flag can also be set there.

ieee80211_do_open() does set flags such as local->iff_promisc flags which
are checked in ieee80211_configure_filter()

Now I don't get which member in struct local has to be set for enabling hw
to capture PHY_ERROR capture in the mac80211 subsystem ? and hence making
the if condition in ath_hw_setrxfilter() comes true for
ATH9K_RX_FILTER_PHYERR check.

Thanks,
Abhinav

On Thu, Mar 15, 2012 at 2:50 PM, Adrian Chadd <adrian@freebsd.org> wrote:

> Hi,
>
> Here's what you need to know:
>
> * something needs to set ATH9K_RX_FILTER_PHYERR;
> * you then have to set some PHY errors in the PHY error mask register.
> That's in calcrxfilter() too, just look at what other bits you can set
> in the relevant mask register;
> * calcrxfilter() should be enabling "zero-length DMA" so frames with
> zero length are still DMAed. All PHY error frames (save radar/spectral
> scan) have 0 payload, so by default they're not DMAed to the host;
> * you need to have an environment that generates PHY errors. :-)
>
>
> Adrian
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ath9k.org/pipermail/ath9k-devel/attachments/20120315/c3a07af9/attachment.htm 

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [ath9k-devel] regarding ATH9K_RXERR_PHY flag
  2012-03-16  0:30                 ` abhinav narain
@ 2012-03-16  4:00                   ` abhinav narain
  2012-03-16  6:05                     ` abhinav narain
  0 siblings, 1 reply; 15+ messages in thread
From: abhinav narain @ 2012-03-16  4:00 UTC (permalink / raw)
  To: ath9k-devel

Hi,
I am adding the two more flags to phybits , namely AR_PHY_ERR_DCHIRP |
AR_PHY_ERR_RADAR .

I am not sure if I can add the following too ?
defined in enum ath9k_phyerr .
Can they be used ?

        ATH9K_PHYERR_UNDERRUN |ATH9K_PHYERR_TIMING  |
        ATH9K_PHYERR_PARITY  | ATH9K_PHYERR_RATE |
        ATH9K_PHYERR_LENGTH  | ATH9K_PHYERR_RADAR |
        ATH9K_PHYERR_SERVICE | ATH9K_PHYERR_TOR |
        ATH9K_PHYERR_OFDM_TIMING |ATH9K_PHYERR_OFDM_SIGNAL_PARITY |
        ATH9K_PHYERR_OFDM_RATE_ILLEGAL | ATH9K_PHYERR_OFDM_LENGTH_ILLEGAL  |
        ATH9K_PHYERR_OFDM_POWER_DROP | ATH9K_PHYERR_OFDM_SERVICE  |
        ATH9K_PHYERR_OFDM_RESTART | ATH9K_PHYERR_FALSE_RADAR_EXT  |
        ATH9K_PHYERR_CCK_TIMING   | ATH9K_PHYERR_CCK_HEADER_CRC |
        ATH9K_PHYERR_CCK_RATE_ILLEGAL| ATH9K_PHYERR_CCK_SERVICE |
        ATH9K_PHYERR_CCK_RESTART | ATH9K_PHYERR_CCK_LENGTH_ILLEGAL |
        ATH9K_PHYERR_CCK_POWER_DROP | ATH9K_PHYERR_HT_CRC_ERROR |
        ATH9K_PHYERR_HT_LENGTH_ILLEGAL| ATH9K_PHYERR_HT_RATE_ILLEGAL
|ATH9K_PHYERR_MAX  ;

Abhinav


On Thu, Mar 15, 2012 at 8:30 PM, abhinav narain
<abhinavnarain10@gmail.com>wrote:

> Hi,
> I have figured out the following.
>
> In ath_pci_probe() [pci.c], ieee80211_alloc_hw() is called with ath9k_ops
> to set the configured options for the driver.
> ieee80211_alloc_hw() initialized the ieee80211_reconfig_filter, which
> calls ieee80211_configure_filter(), which ultimately sets the flags by
> calling the handler drv_configure_filter() which calls
> ath9k_configure_filter() function with the set of flafs in
> iee802_configure_filter().
>
> The flags : pspoll,fcs_fail,plcpfail are all set by checking the state of
> local (structure representing the hardware state).
>
> The point is to find out where the hardware state is set so that the
> drivers captures the frames ? so that PHY_ERR flag can also be set there.
>
> ieee80211_do_open() does set flags such as local->iff_promisc flags which
> are checked in ieee80211_configure_filter()
>
> Now I don't get which member in struct local has to be set for enabling hw
> to capture PHY_ERROR capture in the mac80211 subsystem ? and hence making
> the if condition in ath_hw_setrxfilter() comes true for
> ATH9K_RX_FILTER_PHYERR check.
>
> Thanks,
> Abhinav
>
> On Thu, Mar 15, 2012 at 2:50 PM, Adrian Chadd <adrian@freebsd.org> wrote:
>
>> Hi,
>>
>> Here's what you need to know:
>>
>> * something needs to set ATH9K_RX_FILTER_PHYERR;
>> * you then have to set some PHY errors in the PHY error mask register.
>> That's in calcrxfilter() too, just look at what other bits you can set
>> in the relevant mask register;
>> * calcrxfilter() should be enabling "zero-length DMA" so frames with
>> zero length are still DMAed. All PHY error frames (save radar/spectral
>> scan) have 0 payload, so by default they're not DMAed to the host;
>> * you need to have an environment that generates PHY errors. :-)
>>
>>
>> Adrian
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ath9k.org/pipermail/ath9k-devel/attachments/20120316/1fc21fc1/attachment-0001.htm 

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [ath9k-devel] regarding ATH9K_RXERR_PHY flag
  2012-03-16  4:00                   ` abhinav narain
@ 2012-03-16  6:05                     ` abhinav narain
  2012-03-16 15:33                       ` Adrian Chadd
  0 siblings, 1 reply; 15+ messages in thread
From: abhinav narain @ 2012-03-16  6:05 UTC (permalink / raw)
  To: ath9k-devel

Hi Chadd,
will the PHY_ERR frames be dropped in should_drop_frame() in rx.c in mac
subsystem as you said there payload is 0.
What will skb be having then ? in monitor mode .. just the radiotap header
?

static inline int should_drop_frame(struct sk_buff *skb,
                                    int present_fcs_len)
{
        struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb);
        struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;

        if (status->flag & (RX_FLAG_FAILED_FCS_CRC |
RX_FLAG_FAILED_PLCP_CRC))
                return 1;
        if (unlikely(skb->len < 16 + present_fcs_len))
<<<----------------- This condition will be true for PHY_ERR frames ?
                return 1;
        if (ieee80211_is_ctl(hdr->frame_control) &&
            !ieee80211_is_pspoll(hdr->frame_control) &&
            !ieee80211_is_back_req(hdr->frame_control))
                return 1;
        return 0;
}

Abhinav




On Fri, Mar 16, 2012 at 12:00 AM, abhinav narain
<abhinavnarain10@gmail.com>wrote:

> Hi,
> I am adding the two more flags to phybits , namely AR_PHY_ERR_DCHIRP |
> AR_PHY_ERR_RADAR .
>
> I am not sure if I can add the following too ?
> defined in enum ath9k_phyerr .
> Can they be used ?
>
>         ATH9K_PHYERR_UNDERRUN |ATH9K_PHYERR_TIMING  |
>         ATH9K_PHYERR_PARITY  | ATH9K_PHYERR_RATE |
>         ATH9K_PHYERR_LENGTH  | ATH9K_PHYERR_RADAR |
>         ATH9K_PHYERR_SERVICE | ATH9K_PHYERR_TOR |
>         ATH9K_PHYERR_OFDM_TIMING |ATH9K_PHYERR_OFDM_SIGNAL_PARITY |
>         ATH9K_PHYERR_OFDM_RATE_ILLEGAL | ATH9K_PHYERR_OFDM_LENGTH_ILLEGAL
>  |
>         ATH9K_PHYERR_OFDM_POWER_DROP | ATH9K_PHYERR_OFDM_SERVICE  |
>         ATH9K_PHYERR_OFDM_RESTART | ATH9K_PHYERR_FALSE_RADAR_EXT  |
>         ATH9K_PHYERR_CCK_TIMING   | ATH9K_PHYERR_CCK_HEADER_CRC |
>         ATH9K_PHYERR_CCK_RATE_ILLEGAL| ATH9K_PHYERR_CCK_SERVICE |
>         ATH9K_PHYERR_CCK_RESTART | ATH9K_PHYERR_CCK_LENGTH_ILLEGAL |
>         ATH9K_PHYERR_CCK_POWER_DROP | ATH9K_PHYERR_HT_CRC_ERROR |
>         ATH9K_PHYERR_HT_LENGTH_ILLEGAL| ATH9K_PHYERR_HT_RATE_ILLEGAL
> |ATH9K_PHYERR_MAX  ;
>
> Abhinav
>
>
> On Thu, Mar 15, 2012 at 8:30 PM, abhinav narain <abhinavnarain10@gmail.com
> > wrote:
>
>> Hi,
>> I have figured out the following.
>>
>> In ath_pci_probe() [pci.c], ieee80211_alloc_hw() is called with ath9k_ops
>> to set the configured options for the driver.
>> ieee80211_alloc_hw() initialized the ieee80211_reconfig_filter, which
>> calls ieee80211_configure_filter(), which ultimately sets the flags by
>> calling the handler drv_configure_filter() which calls
>> ath9k_configure_filter() function with the set of flafs in
>> iee802_configure_filter().
>>
>> The flags : pspoll,fcs_fail,plcpfail are all set by checking the state of
>> local (structure representing the hardware state).
>>
>> The point is to find out where the hardware state is set so that the
>> drivers captures the frames ? so that PHY_ERR flag can also be set there.
>>
>> ieee80211_do_open() does set flags such as local->iff_promisc flags which
>> are checked in ieee80211_configure_filter()
>>
>> Now I don't get which member in struct local has to be set for enabling
>> hw to capture PHY_ERROR capture in the mac80211 subsystem ? and hence
>> making the if condition in ath_hw_setrxfilter() comes true for
>> ATH9K_RX_FILTER_PHYERR check.
>>
>> Thanks,
>> Abhinav
>>
>> On Thu, Mar 15, 2012 at 2:50 PM, Adrian Chadd <adrian@freebsd.org> wrote:
>>
>>> Hi,
>>>
>>> Here's what you need to know:
>>>
>>> * something needs to set ATH9K_RX_FILTER_PHYERR;
>>> * you then have to set some PHY errors in the PHY error mask register.
>>> That's in calcrxfilter() too, just look at what other bits you can set
>>> in the relevant mask register;
>>> * calcrxfilter() should be enabling "zero-length DMA" so frames with
>>> zero length are still DMAed. All PHY error frames (save radar/spectral
>>> scan) have 0 payload, so by default they're not DMAed to the host;
>>> * you need to have an environment that generates PHY errors. :-)
>>>
>>>
>>> Adrian
>>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ath9k.org/pipermail/ath9k-devel/attachments/20120316/e7885e9f/attachment.htm 

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [ath9k-devel] regarding ATH9K_RXERR_PHY flag
  2012-03-16  6:05                     ` abhinav narain
@ 2012-03-16 15:33                       ` Adrian Chadd
  2012-03-19 16:20                         ` abhinav narain
  0 siblings, 1 reply; 15+ messages in thread
From: Adrian Chadd @ 2012-03-16 15:33 UTC (permalink / raw)
  To: ath9k-devel

Hi!

I'm not sure. It's quite possible that the frames will be dropped
before they're passed up the stack, as they tend not to be anything
mac80211 cares about for data. Felix would know better than I.

I suggest doing it the adrian way and add some printk()s to the ath9k
RX path to print out whether phy error frames are being received,
before they're punted to mac80211.

hw.c:ath9k_hw_setrxfilter() sets he relevant hardware registers:

* AR_PHY_ERR has the phy error mask set. For debugging, just set this
to 0xffffffff to get _all_ the phy errors.
* AR_RXCFG, has AR_RXCFG_ZLFDMA set if phybits is set.
* AR_RX_FILTER, make sure the ATH9K_RX_FILTER_PHYERR bit is set.



Adrian

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [ath9k-devel] regarding ATH9K_RXERR_PHY flag
  2012-03-16 15:33                       ` Adrian Chadd
@ 2012-03-19 16:20                         ` abhinav narain
  2012-03-19 19:17                           ` abhinav narain
  0 siblings, 1 reply; 15+ messages in thread
From: abhinav narain @ 2012-03-19 16:20 UTC (permalink / raw)
  To: ath9k-devel

On Fri, Mar 16, 2012 at 11:33 AM, Adrian Chadd <adrian@freebsd.org> wrote:

> Hi!
>
> I'm not sure. It's quite possible that the frames will be dropped
> before they're passed up the stack, as they tend not to be anything
> mac80211 cares about for data. Felix would know better than I.
>
> Yes I am checking for them in the driver itself.
In ath9k_rx_accept(), where they were dropped


> I suggest doing it the adrian way and add some printk()s to the ath9k
> RX path to print out whether phy error frames are being received,
> before they're punted to mac80211.
>
> hw.c:ath9k_hw_setrxfilter() sets he relevant hardware registers:
>
> * AR_PHY_ERR has the phy error mask set. For debugging, just set this
> to 0xffffffff to get _all_ the phy errors.
> * AR_RXCFG, has AR_RXCFG_ZLFDMA set if phybits is set.
> * AR_RX_FILTER, make sure the ATH9K_RX_FILTER_PHYERR bit is set.


These flags are set.

I have made following modifications in the code.

in ath_calcrxfilter [recv.c] ,  I added PHYERR in the filter flags

  rfilt = (ath9k_hw_getrxfilter(sc->sc_ah) & RX_FILTER_PRESERVE)
        | ATH9K_RX_FILTER_UCAST | ATH9K_RX_FILTER_BCAST
        | ATH9K_RX_FILTER_MCAST |  ATH9K_RX_FILTER_PHYERR   ;
instead of
  rfilt = (ath9k_hw_getrxfilter(sc->sc_ah) & RX_FILTER_PRESERVE)
        | ATH9K_RX_FILTER_UCAST | ATH9K_RX_FILTER_BCAST
        | ATH9K_RX_FILTER_MCAST  ;



in ath9k_ani_reset_old() [ani.c], I modified the calling of
ath_setrxfilter() :
 ath9k_hw_setrxfilter(ah, ath9k_hw_getrxfilter(ah) |
ATH9K_RX_FILTER_PHYERR);
instead of
ath9k_hw_setrxfilter(ah, ath9k_hw_getrxfilter(ah) &
~ATH9K_RX_FILTER_PHYERR);

The registers are set in this function

The printk()s in ath_setrxfilter sometime print messages on dmesg, but
sometimes they don't.


Apart from this, the ATH9K_RXERR_PHY flag is set in ath_rx_status structure
in two functions,
 the ath9k_hw_rxprocdesc() [mac.c], ath9k_hw_process_rxdesc_edma()
[ar9003_mac.c] .
 I don't see the printk() printing a message, showing that the control does
not reach there.

Is there anything else I should be doing ?

I added the flag in the ath_calcrxfilter, because when its called from
ath_opmode_init(),
the returned filter flags do not have ATH9K_PHYERR filter.
This path is triggered with  ieee80211_configure_filter() setting the
filters for driver,
but it does not any flag that I can set particularly for the getting the
PHY error frames. or Can I ?

Abhinav
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ath9k.org/pipermail/ath9k-devel/attachments/20120319/711ba695/attachment.htm 

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [ath9k-devel] regarding ATH9K_RXERR_PHY flag
  2012-03-19 16:20                         ` abhinav narain
@ 2012-03-19 19:17                           ` abhinav narain
  0 siblings, 0 replies; 15+ messages in thread
From: abhinav narain @ 2012-03-19 19:17 UTC (permalink / raw)
  To: ath9k-devel

will this be true in ath_rx_accept() as you said, the payload of the frame
is zero ..
        if (!rx_stats->rs_datalen)
                return false;


On Mon, Mar 19, 2012 at 12:20 PM, abhinav narain
<abhinavnarain10@gmail.com>wrote:

>
>
> On Fri, Mar 16, 2012 at 11:33 AM, Adrian Chadd <adrian@freebsd.org> wrote:
>
>> Hi!
>>
>> I'm not sure. It's quite possible that the frames will be dropped
>> before they're passed up the stack, as they tend not to be anything
>> mac80211 cares about for data. Felix would know better than I.
>>
>> Yes I am checking for them in the driver itself.
> In ath9k_rx_accept(), where they were dropped
>
>
>> I suggest doing it the adrian way and add some printk()s to the ath9k
>> RX path to print out whether phy error frames are being received,
>> before they're punted to mac80211.
>>
>> hw.c:ath9k_hw_setrxfilter() sets he relevant hardware registers:
>>
>> * AR_PHY_ERR has the phy error mask set. For debugging, just set this
>> to 0xffffffff to get _all_ the phy errors.
>> * AR_RXCFG, has AR_RXCFG_ZLFDMA set if phybits is set.
>> * AR_RX_FILTER, make sure the ATH9K_RX_FILTER_PHYERR bit is set.
>
>
> These flags are set.
>
> I have made following modifications in the code.
>
> in ath_calcrxfilter [recv.c] ,  I added PHYERR in the filter flags
>
>   rfilt = (ath9k_hw_getrxfilter(sc->sc_ah) & RX_FILTER_PRESERVE)
>         | ATH9K_RX_FILTER_UCAST | ATH9K_RX_FILTER_BCAST
>         | ATH9K_RX_FILTER_MCAST |  ATH9K_RX_FILTER_PHYERR   ;
> instead of
>   rfilt = (ath9k_hw_getrxfilter(sc->sc_ah) & RX_FILTER_PRESERVE)
>         | ATH9K_RX_FILTER_UCAST | ATH9K_RX_FILTER_BCAST
>         | ATH9K_RX_FILTER_MCAST  ;
>
>
>
> in ath9k_ani_reset_old() [ani.c], I modified the calling of
> ath_setrxfilter() :
>  ath9k_hw_setrxfilter(ah, ath9k_hw_getrxfilter(ah) |
> ATH9K_RX_FILTER_PHYERR);
> instead of
> ath9k_hw_setrxfilter(ah, ath9k_hw_getrxfilter(ah) &
> ~ATH9K_RX_FILTER_PHYERR);
>
> The registers are set in this function
>
> The printk()s in ath_setrxfilter sometime print messages on dmesg, but
> sometimes they don't.
>
>
> Apart from this, the ATH9K_RXERR_PHY flag is set in ath_rx_status
> structure in two functions,
>  the ath9k_hw_rxprocdesc() [mac.c], ath9k_hw_process_rxdesc_edma()
> [ar9003_mac.c] .
>  I don't see the printk() printing a message, showing that the control
> does not reach there.
>
> Is there anything else I should be doing ?
>
> I added the flag in the ath_calcrxfilter, because when its called from
> ath_opmode_init(),
> the returned filter flags do not have ATH9K_PHYERR filter.
> This path is triggered with  ieee80211_configure_filter() setting the
> filters for driver,
> but it does not any flag that I can set particularly for the getting the
> PHY error frames. or Can I ?
>
> Abhinav
>
>
>
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ath9k.org/pipermail/ath9k-devel/attachments/20120319/5f30f598/attachment.htm 

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2012-03-19 19:17 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-14 21:27 [ath9k-devel] regarding ATH9K_RXERR_PHY flag abhinav narain
2012-03-14 22:07 ` Adrian Chadd
2012-03-14 22:33   ` abhinav narain
2012-03-14 22:44     ` Adrian Chadd
2012-03-14 23:09       ` abhinav narain
2012-03-14 23:43         ` Adrian Chadd
2012-03-15 10:10           ` abhinav narain
2012-03-15 10:17             ` abhinav narain
2012-03-15 18:50               ` Adrian Chadd
2012-03-16  0:30                 ` abhinav narain
2012-03-16  4:00                   ` abhinav narain
2012-03-16  6:05                     ` abhinav narain
2012-03-16 15:33                       ` Adrian Chadd
2012-03-19 16:20                         ` abhinav narain
2012-03-19 19:17                           ` abhinav narain

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.