* [PATCH v2] ath9k : Fix for displaying the channel number
@ 2010-09-17 16:09 Mohammed Shafi Shajakhan
2010-09-28 19:47 ` John W. Linville
0 siblings, 1 reply; 3+ messages in thread
From: Mohammed Shafi Shajakhan @ 2010-09-17 16:09 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, johannes, Mohammed Shafi Shajakhan
From: Mohammed Shafi Shajakhan <mshajakhan@atheros.com>
In the ath9k debugging feature 'wiphy' the current channel used by the
station is incorrectly displayed.This is because the channels available
are sequentially mapped from numbers 0 to 37.This mapping cannot be
changed as the channel number is also used as an index for an array of
structures in struct ath9k_channel channels[38] .
This fix solves the above problem by calculating the channel
number from center frequency.
Signed-off-by: Mohammed Shafi Shajakhan <mshajakhan@atheros.com>
---
drivers/net/wireless/ath/ath9k/debug.c | 15 ++++++++++-----
1 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/debug.c b/drivers/net/wireless/ath/ath9k/debug.c
index 54aae93..13eb725 100644
--- a/drivers/net/wireless/ath/ath9k/debug.c
+++ b/drivers/net/wireless/ath/ath9k/debug.c
@@ -488,6 +488,8 @@ static ssize_t read_file_wiphy(struct file *file, char __user *user_buf,
size_t count, loff_t *ppos)
{
struct ath_softc *sc = file->private_data;
+ struct ath_wiphy *aphy = sc->pri_wiphy;
+ struct ieee80211_channel *chan = aphy->hw->conf.channel;
char buf[512];
unsigned int len = 0;
int i;
@@ -497,16 +499,19 @@ static ssize_t read_file_wiphy(struct file *file, char __user *user_buf,
"primary: %s (%s chan=%d ht=%d)\n",
wiphy_name(sc->pri_wiphy->hw->wiphy),
ath_wiphy_state_str(sc->pri_wiphy->state),
- sc->pri_wiphy->chan_idx, sc->pri_wiphy->chan_is_ht);
+ ieee80211_frequency_to_channel(chan->center_freq),
+ sc->pri_wiphy->chan_is_ht);
for (i = 0; i < sc->num_sec_wiphy; i++) {
struct ath_wiphy *aphy = sc->sec_wiphy[i];
if (aphy == NULL)
continue;
+ chan = aphy->hw->conf.channel;
len += snprintf(buf + len, sizeof(buf) - len,
- "secondary: %s (%s chan=%d ht=%d)\n",
- wiphy_name(aphy->hw->wiphy),
- ath_wiphy_state_str(aphy->state),
- aphy->chan_idx, aphy->chan_is_ht);
+ "secondary: %s (%s chan=%d ht=%d)\n",
+ wiphy_name(aphy->hw->wiphy),
+ ath_wiphy_state_str(aphy->state),
+ ieee80211_frequency_to_channel(chan->center_freq),
+ aphy->chan_is_ht);
}
put_unaligned_le32(REG_READ_D(sc->sc_ah, AR_STA_ID0), addr);
--
1.7.0.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] ath9k : Fix for displaying the channel number
2010-09-17 16:09 [PATCH v2] ath9k : Fix for displaying the channel number Mohammed Shafi Shajakhan
@ 2010-09-28 19:47 ` John W. Linville
2010-09-30 13:23 ` Mohammed Shafi
0 siblings, 1 reply; 3+ messages in thread
From: John W. Linville @ 2010-09-28 19:47 UTC (permalink / raw)
To: Mohammed Shafi Shajakhan; +Cc: linux-wireless, johannes
On Fri, Sep 17, 2010 at 09:39:26PM +0530, Mohammed Shafi Shajakhan wrote:
> From: Mohammed Shafi Shajakhan <mshajakhan@atheros.com>
>
> In the ath9k debugging feature 'wiphy' the current channel used by the
> station is incorrectly displayed.This is because the channels available
> are sequentially mapped from numbers 0 to 37.This mapping cannot be
> changed as the channel number is also used as an index for an array of
> structures in struct ath9k_channel channels[38] .
> This fix solves the above problem by calculating the channel
> number from center frequency.
>
> Signed-off-by: Mohammed Shafi Shajakhan <mshajakhan@atheros.com>
What was this patch based against? It doesn't seem to apply anymore...
John
--
John W. Linville Someday the world will need a hero, and you
linville@tuxdriver.com might be all we have. Be ready.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] ath9k : Fix for displaying the channel number
2010-09-28 19:47 ` John W. Linville
@ 2010-09-30 13:23 ` Mohammed Shafi
0 siblings, 0 replies; 3+ messages in thread
From: Mohammed Shafi @ 2010-09-30 13:23 UTC (permalink / raw)
To: John W. Linville; +Cc: linux-wireless
Sorry John ,had sent the patch which was created with the old tree
,will soon a send a proper patch.
sorry for the inconvenience.
shafi
On Wed, Sep 29, 2010 at 1:17 AM, John W. Linville
<linville@tuxdriver.com> wrote:
> On Fri, Sep 17, 2010 at 09:39:26PM +0530, Mohammed Shafi Shajakhan wrote:
>> From: Mohammed Shafi Shajakhan <mshajakhan@atheros.com>
>>
>> In the ath9k debugging feature 'wiphy' the current channel used by the
>> station is incorrectly displayed.This is because the channels available
>> are sequentially mapped from numbers 0 to 37.This mapping cannot be
>> changed as the channel number is also used as an index for an array of
>> structures in struct ath9k_channel channels[38] .
>> This fix solves the above problem by calculating the channel
>> number from center frequency.
>>
>> Signed-off-by: Mohammed Shafi Shajakhan <mshajakhan@atheros.com>
>
> What was this patch based against? It doesn't seem to apply anymore...
>
> John
> --
> John W. Linville Someday the world will need a hero, and you
> linville@tuxdriver.com might be all we have. Be ready.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-09-30 13:23 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-17 16:09 [PATCH v2] ath9k : Fix for displaying the channel number Mohammed Shafi Shajakhan
2010-09-28 19:47 ` John W. Linville
2010-09-30 13:23 ` Mohammed Shafi
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.