2011-06-20 08:15:37

by Mohammed Shafi

[permalink] [raw]
Subject: Re: [ath9k-devel] Patching ath9k/mac80211 to change MAC layer features

On Fri, Jun 17, 2011 at 2:09 AM, Fred Matthews <[email protected]> wrote:
> Hello all,
>
>
> I have a query regarding patching ath9k/mac80211 to change MAC layer
> features?and I would be most grateful if someone can assist.
>
>
> I need to patch ath9k so that I can be able to?modify/fix the A-MPDU
> aggregation frame length and other parameters such that they can be
> configured at runtime via debugfs. I made a newbie attempt at trying to
> change the aggregate length (attached), but I am unsure of the
> correctness/efficiency??- when applied throughput varies with different
> frame lengths entered but I can't be sure if its actually changing the
> aggregation length (passes the framelen/aggr_limit). Hence I would be very
> grateful if someone can assist in the correct way of doing this (possibly
> directly via mac80211).
>
>
>
> Also if the ampdu aggregate length is changed I believe the number/length of
> the subframes of the aggregate stays constant (at the default which is
> 32).?I try to change this in my patch?as well as the maximum software
> retries by just changing the?default?definition in ath9k.h, thus is there a
> (more) correct/better way of changing these.?Finally, how can I patch the
> driver to be able to disable Block-Acks/aggregation via debugfs or
> otherwise.


to disable aggregation in the driver, please try this
diff --git a/drivers/net/wireless/ath/ath9k/init.c
b/drivers/net/wireless/ath/ath9k/init.c
index d4b166c..e0175d0 100644
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
@@ -524,8 +524,6 @@ static void ath9k_init_misc(struct ath_softc *sc)
sc->config.txpowlimit = ATH_TXPOWER_MAX;

if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_HT) {
- sc->sc_flags |= SC_OP_TXAGGR;
- sc->sc_flags |= SC_OP_RXAGGR;
}

common->tx_chainmask = sc->sc_ah->caps.tx_chainmask;

if you want only tx-aggregation to be disabled , please comment out only that.
also you can completely disable HT by
diff --git a/drivers/net/wireless/ath/ath9k/hw.c
b/drivers/net/wireless/ath/ath9k/hw.c
index 6de2655..696b4cc 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -1915,10 +1915,7 @@ int ath9k_hw_fill_cap_info(struct ath_hw *ah)

common->crypt_caps |= ATH_CRYPT_CAP_CIPHER_AESCCM;

- if (ah->hw_version.devid != AR2427_DEVID_PCIE)
- pCap->hw_caps |= ATH9K_HW_CAP_HT;
- else
- pCap->hw_caps &= ~ATH9K_HW_CAP_HT;
+ pCap->hw_caps &= ~ATH9K_HW_CAP_HT;

if (AR_SREV_9271(ah))
pCap->num_gpio_pins = AR9271_NUM_GPIO;




>
>
>
> I highly appreciate, help in any of the above, as well as other advice,
> Many thanks
>
> _______________________________________________
> ath9k-devel mailing list
> [email protected]
> https://lists.ath9k.org/mailman/listinfo/ath9k-devel
>
>



--
shafi


2011-06-28 07:00:20

by Mohammed Shafi

[permalink] [raw]
Subject: Re: [ath9k-devel] Patching ath9k/mac80211 to change MAC layer features

On Mon, Jun 27, 2011 at 11:07 PM, Fred Matthews <[email protected]> wrote:
> Hi all,
>
> Much appreciated Mohammed Shafi, disabling aggregation works when
> replacing those lines with
> ?sc->sc_flags &= ~SC_OP_TXAGGR;
> ?sc->sc_flags &= ~SC_OP_RXAGGR;
> only issue is I must always recompile compat-wireless to
> re-enable/disable it again. I tried to port it using debugfs to be
> able to enable and disable at runtime but ath9k kept rebooting.

I am not sure we can enable/disable aggregation via debugfs, these
flags seem are set at initialization and based on this lot of things
happen in tx-path, initializing TID structure, ampdu action, rate
control etc.

>
> Also I would be very grateful if someone can help regarding my
> attached patch and previous query:
>
> ------------
> ?need to patch ath9k so that I can be able to modify/fix the A-MPDU
> aggregation frame length and other parameters such that they can be
> configured at runtime via debugfs. I made a newbie attempt at trying
> to change the aggregate length (attached), but I am unsure of the
> correctness/efficiency ?- when applied throughput varies with
> different frame lengths entered but I can't be sure if its actually
> changing the aggregation length (passes the framelen/aggr_limit).
> Hence I would be very grateful if someone can assist in the correct
> way of doing this (possibly directly via mac80211).
>
>
> Also if the ampdu aggregate length is changed I believe the
> number/length of the subframes of the aggregate stays constant (at the
> default which is 32). I try to change this in my patch as well as the
> maximum software retries by just changing the default definition in
> ath9k.h, thus is there a (more) correct/better way of changing these.
> Finally, how can I patch the driver to be able to disable Block-Acks
> via debugfs or otherwise.
> ---------------
>
> Thank you very much
>
>
>
> On Mon, Jun 20, 2011 at 9:15 AM, Mohammed Shafi
> <[email protected]> wrote:
>> On Fri, Jun 17, 2011 at 2:09 AM, Fred Matthews <[email protected]> wrote:
>>> Hello all,
>>>
>>>
>>> I have a query regarding patching ath9k/mac80211 to change MAC layer
>>> features?and I would be most grateful if someone can assist.
>>>
>>>
>>> I need to patch ath9k so that I can be able to?modify/fix the A-MPDU
>>> aggregation frame length and other parameters such that they can be
>>> configured at runtime via debugfs. I made a newbie attempt at trying to
>>> change the aggregate length (attached), but I am unsure of the
>>> correctness/efficiency??- when applied throughput varies with different
>>> frame lengths entered but I can't be sure if its actually changing the
>>> aggregation length (passes the framelen/aggr_limit). Hence I would be very
>>> grateful if someone can assist in the correct way of doing this (possibly
>>> directly via mac80211).
>>>
>>>
>>>
>>> Also if the ampdu aggregate length is changed I believe the number/length of
>>> the subframes of the aggregate stays constant (at the default which is
>>> 32).?I try to change this in my patch?as well as the maximum software
>>> retries by just changing the?default?definition in ath9k.h, thus is there a
>>> (more) correct/better way of changing these.?Finally, how can I patch the
>>> driver to be able to disable Block-Acks/aggregation via debugfs or
>>> otherwise.
>>
>>
>> to disable aggregation in the driver, please try this
>> diff --git a/drivers/net/wireless/ath/ath9k/init.c
>> b/drivers/net/wireless/ath/ath9k/init.c
>> index d4b166c..e0175d0 100644
>> --- a/drivers/net/wireless/ath/ath9k/init.c
>> +++ b/drivers/net/wireless/ath/ath9k/init.c
>> @@ -524,8 +524,6 @@ static void ath9k_init_misc(struct ath_softc *sc)
>> ? ? ? ?sc->config.txpowlimit = ATH_TXPOWER_MAX;
>>
>> ? ? ? ?if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_HT) {
>> - ? ? ? ? ? ? ? sc->sc_flags |= SC_OP_TXAGGR;
>> - ? ? ? ? ? ? ? sc->sc_flags |= SC_OP_RXAGGR;
>> ? ? ? ?}
>>
>> ? ? ? ?common->tx_chainmask = sc->sc_ah->caps.tx_chainmask;
>>
>> if you want only tx-aggregation to be disabled , please comment out only that.
>> also you can completely disable HT by
>> diff --git a/drivers/net/wireless/ath/ath9k/hw.c
>> b/drivers/net/wireless/ath/ath9k/hw.c
>> index 6de2655..696b4cc 100644
>> --- a/drivers/net/wireless/ath/ath9k/hw.c
>> +++ b/drivers/net/wireless/ath/ath9k/hw.c
>> @@ -1915,10 +1915,7 @@ int ath9k_hw_fill_cap_info(struct ath_hw *ah)
>>
>> ? ? ? ?common->crypt_caps |= ATH_CRYPT_CAP_CIPHER_AESCCM;
>>
>> - ? ? ? if (ah->hw_version.devid != AR2427_DEVID_PCIE)
>> - ? ? ? ? ? ? ? pCap->hw_caps |= ATH9K_HW_CAP_HT;
>> - ? ? ? else
>> - ? ? ? ? ? ? ? pCap->hw_caps &= ~ATH9K_HW_CAP_HT;
>> + ? ? ? pCap->hw_caps &= ~ATH9K_HW_CAP_HT;
>>
>> ? ? ? ?if (AR_SREV_9271(ah))
>> ? ? ? ? ? ? ? ?pCap->num_gpio_pins = AR9271_NUM_GPIO;
>>
>>
>>
>>
>>>
>>>
>>>
>>> I highly appreciate, help in any of the above, as well as other advice,
>>> Many thanks
>>>
>>> _______________________________________________
>>> ath9k-devel mailing list
>>> [email protected]
>>> https://lists.ath9k.org/mailman/listinfo/ath9k-devel
>>>
>>>
>>
>>
>>
>> --
>> shafi
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
>> the body of a message to [email protected]
>> More majordomo info at ?http://vger.kernel.org/majordomo-info.html
>>
>



--
shafi

2011-06-27 17:37:37

by Fred Matthews

[permalink] [raw]
Subject: Re: [ath9k-devel] Patching ath9k/mac80211 to change MAC layer features

Hi all,

Much appreciated Mohammed Shafi, disabling aggregation works when
replacing those lines with
sc->sc_flags &= ~SC_OP_TXAGGR;
sc->sc_flags &= ~SC_OP_RXAGGR;
only issue is I must always recompile compat-wireless to
re-enable/disable it again. I tried to port it using debugfs to be
able to enable and disable at runtime but ath9k kept rebooting.

Also I would be very grateful if someone can help regarding my
attached patch and previous query:

------------
need to patch ath9k so that I can be able to modify/fix the A-MPDU
aggregation frame length and other parameters such that they can be
configured at runtime via debugfs. I made a newbie attempt at trying
to change the aggregate length (attached), but I am unsure of the
correctness/efficiency - when applied throughput varies with
different frame lengths entered but I can't be sure if its actually
changing the aggregation length (passes the framelen/aggr_limit).
Hence I would be very grateful if someone can assist in the correct
way of doing this (possibly directly via mac80211).


Also if the ampdu aggregate length is changed I believe the
number/length of the subframes of the aggregate stays constant (at the
default which is 32). I try to change this in my patch as well as the
maximum software retries by just changing the default definition in
ath9k.h, thus is there a (more) correct/better way of changing these.
Finally, how can I patch the driver to be able to disable Block-Acks
via debugfs or otherwise.
---------------

Thank you very much



On Mon, Jun 20, 2011 at 9:15 AM, Mohammed Shafi
<[email protected]> wrote:
> On Fri, Jun 17, 2011 at 2:09 AM, Fred Matthews <[email protected]> wrote:
>> Hello all,
>>
>>
>> I have a query regarding patching ath9k/mac80211 to change MAC layer
>> features?and I would be most grateful if someone can assist.
>>
>>
>> I need to patch ath9k so that I can be able to?modify/fix the A-MPDU
>> aggregation frame length and other parameters such that they can be
>> configured at runtime via debugfs. I made a newbie attempt at trying to
>> change the aggregate length (attached), but I am unsure of the
>> correctness/efficiency??- when applied throughput varies with different
>> frame lengths entered but I can't be sure if its actually changing the
>> aggregation length (passes the framelen/aggr_limit). Hence I would be very
>> grateful if someone can assist in the correct way of doing this (possibly
>> directly via mac80211).
>>
>>
>>
>> Also if the ampdu aggregate length is changed I believe the number/length of
>> the subframes of the aggregate stays constant (at the default which is
>> 32).?I try to change this in my patch?as well as the maximum software
>> retries by just changing the?default?definition in ath9k.h, thus is there a
>> (more) correct/better way of changing these.?Finally, how can I patch the
>> driver to be able to disable Block-Acks/aggregation via debugfs or
>> otherwise.
>
>
> to disable aggregation in the driver, please try this
> diff --git a/drivers/net/wireless/ath/ath9k/init.c
> b/drivers/net/wireless/ath/ath9k/init.c
> index d4b166c..e0175d0 100644
> --- a/drivers/net/wireless/ath/ath9k/init.c
> +++ b/drivers/net/wireless/ath/ath9k/init.c
> @@ -524,8 +524,6 @@ static void ath9k_init_misc(struct ath_softc *sc)
> ? ? ? ?sc->config.txpowlimit = ATH_TXPOWER_MAX;
>
> ? ? ? ?if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_HT) {
> - ? ? ? ? ? ? ? sc->sc_flags |= SC_OP_TXAGGR;
> - ? ? ? ? ? ? ? sc->sc_flags |= SC_OP_RXAGGR;
> ? ? ? ?}
>
> ? ? ? ?common->tx_chainmask = sc->sc_ah->caps.tx_chainmask;
>
> if you want only tx-aggregation to be disabled , please comment out only that.
> also you can completely disable HT by
> diff --git a/drivers/net/wireless/ath/ath9k/hw.c
> b/drivers/net/wireless/ath/ath9k/hw.c
> index 6de2655..696b4cc 100644
> --- a/drivers/net/wireless/ath/ath9k/hw.c
> +++ b/drivers/net/wireless/ath/ath9k/hw.c
> @@ -1915,10 +1915,7 @@ int ath9k_hw_fill_cap_info(struct ath_hw *ah)
>
> ? ? ? ?common->crypt_caps |= ATH_CRYPT_CAP_CIPHER_AESCCM;
>
> - ? ? ? if (ah->hw_version.devid != AR2427_DEVID_PCIE)
> - ? ? ? ? ? ? ? pCap->hw_caps |= ATH9K_HW_CAP_HT;
> - ? ? ? else
> - ? ? ? ? ? ? ? pCap->hw_caps &= ~ATH9K_HW_CAP_HT;
> + ? ? ? pCap->hw_caps &= ~ATH9K_HW_CAP_HT;
>
> ? ? ? ?if (AR_SREV_9271(ah))
> ? ? ? ? ? ? ? ?pCap->num_gpio_pins = AR9271_NUM_GPIO;
>
>
>
>
>>
>>
>>
>> I highly appreciate, help in any of the above, as well as other advice,
>> Many thanks
>>
>> _______________________________________________
>> ath9k-devel mailing list
>> [email protected]
>> https://lists.ath9k.org/mailman/listinfo/ath9k-devel
>>
>>
>
>
>
> --
> shafi
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to [email protected]
> More majordomo info at ?http://vger.kernel.org/majordomo-info.html
>


Attachments:
aggr+subframe+retry_change_attempt.patch (7.80 kB)

2011-06-28 12:14:31

by Daniel Smith

[permalink] [raw]
Subject: Re: [ath9k-devel] Patching ath9k/mac80211 to change MAC layer features

On Tue, Jun 28, 2011 at 3:00 AM, Mohammed Shafi
<[email protected]> wrote:
> On Mon, Jun 27, 2011 at 11:07 PM, Fred Matthews <[email protected]> wrote:
>> Hi all,
>>
>> Much appreciated Mohammed Shafi, disabling aggregation works when
>> replacing those lines with
>> ?sc->sc_flags &= ~SC_OP_TXAGGR;
>> ?sc->sc_flags &= ~SC_OP_RXAGGR;
>> only issue is I must always recompile compat-wireless to
>> re-enable/disable it again. I tried to port it using debugfs to be
>> able to enable and disable at runtime but ath9k kept rebooting.
>
> I am not sure we can enable/disable aggregation via debugfs, these
> flags seem are set at initialization and based on this lot of things
> happen in tx-path, initializing TID structure, ampdu action, rate
> control ?etc.
>

The project I am on we have to deal with a situation where we change
the hardware environment and thus have to change some of the
initialization parameters. Obviously the environment is a little
unique, but I believe this should work for you. Before the changes are
made we do a

if (sc->nvifs > 0) {
printk(KERN_INFO "ath9k:card has an open interface\n");
return -EBUSY;
}

pdev = to_pci_dev(sc->dev);
pdev->driver->remove(pdev);

then we make our hardware change and then do a

pci_id = pci_match_id(pdev->driver->id_table, pdev);
err = pdev->driver->probe(pdev, pci_id);

which gives us a re-initialized instance of ath_hw and ath_softc for the radio

Hope this helps!

V/r,
Daniel P. Smith