From: Dan Williams <dcbw@redhat.com>
To: Holger Schurig <hs4233@mail.mn-solutions.de>
Cc: linux-wireless@vger.kernel.org,
"John W. Linville" <linville@tuxdriver.com>,
libertas-dev@lists.infradead.org
Subject: Re: [PATCH, take 2] libertas: store rssi as an u32
Date: Wed, 19 Mar 2008 18:17:58 -0400 [thread overview]
Message-ID: <1205965078.18683.4.camel@localhost.localdomain> (raw)
In-Reply-To: <200803191708.32595.hs4233@mail.mn-solutions.de>
On Wed, 2008-03-19 at 17:08 +0100, Holger Schurig wrote:
> [PATCH] store rssi as an int
>
> Don't store an (hardware base) u8 value in bss_descriptor, but just an
> unsigned int (RSSI is really unsigned). Compilers generate more efficent
> code for ints than for bytes.
>
> Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Acked-by: Dan Williams <dcbw@redhat.com>
> Index: wireless-testing/drivers/net/wireless/libertas/scan.h
> ===================================================================
> --- wireless-testing.orig/drivers/net/wireless/libertas/scan.h 2008-03-19 09:04:43.000000000 +0100
> +++ wireless-testing/drivers/net/wireless/libertas/scan.h 2008-03-19 09:05:53.000000000 +0100
> @@ -34,14 +34,9 @@ struct bss_descriptor {
> u8 ssid_len;
>
> u16 capability;
> -
> - /* receive signal strength in dBm */
> - long rssi;
> -
> + u32 rssi;
> u32 channel;
> -
> u16 beaconperiod;
> -
> u32 atimwindow;
>
> /* IW_MODE_AUTO, IW_MODE_ADHOC, IW_MODE_INFRA */
> Index: wireless-testing/drivers/net/wireless/libertas/scan.c
> ===================================================================
> --- wireless-testing.orig/drivers/net/wireless/libertas/scan.c 2008-03-19 09:05:48.000000000 +0100
> +++ wireless-testing/drivers/net/wireless/libertas/scan.c 2008-03-19 09:27:55.000000000 +0100
> @@ -602,7 +602,7 @@ static int lbs_scan_networks(struct lbs_
> lbs_deb_scan("scan table:\n");
> list_for_each_entry(iter, &priv->network_list, list)
> lbs_deb_scan("%02d: BSSID %s, RSSI %d, SSID '%s'\n",
> - i++, print_mac(mac, iter->bssid), (int)iter->rssi,
> + i++, print_mac(mac, iter->bssid), iter->rssi,
> escape_essid(iter->ssid, iter->ssid_len));
> mutex_unlock(&priv->lock);
> #endif
> @@ -948,7 +948,7 @@ struct bss_descriptor *lbs_find_ssid_in_
> uint8_t *bssid, uint8_t mode,
> int channel)
> {
> - uint8_t bestrssi = 0;
> + u32 bestrssi = 0;
> struct bss_descriptor * iter_bss = NULL;
> struct bss_descriptor * found_bss = NULL;
> struct bss_descriptor * tmp_oldest = NULL;
> Index: wireless-testing/drivers/net/wireless/libertas/debugfs.c
> ===================================================================
> --- wireless-testing.orig/drivers/net/wireless/libertas/debugfs.c 2008-03-19 09:04:43.000000000 +0100
> +++ wireless-testing/drivers/net/wireless/libertas/debugfs.c 2008-03-19 09:05:53.000000000 +0100
> @@ -78,7 +78,7 @@ static ssize_t lbs_getscantable(struct f
> u16 spectrum_mgmt = (iter_bss->capability & WLAN_CAPABILITY_SPECTRUM_MGMT);
>
> pos += snprintf(buf+pos, len-pos,
> - "%02u| %03d | %04ld | %s |",
> + "%02u| %03d | %04d | %s |",
> numscansdone, iter_bss->channel, iter_bss->rssi,
> print_mac(mac, iter_bss->bssid));
> pos += snprintf(buf+pos, len-pos, " %04x-", iter_bss->capability);
prev parent reply other threads:[~2008-03-19 22:19 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-18 14:15 [PATCH] libertas: store rssi as an int Holger Schurig
2008-03-19 14:51 ` Dan Williams
2008-03-19 15:20 ` Holger Schurig
2008-03-19 15:39 ` Dan Williams
2008-03-19 16:07 ` Holger Schurig
2008-03-19 16:08 ` [PATCH, take 2] libertas: store rssi as an u32 Holger Schurig
2008-03-19 22:17 ` Dan Williams [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1205965078.18683.4.camel@localhost.localdomain \
--to=dcbw@redhat.com \
--cc=hs4233@mail.mn-solutions.de \
--cc=libertas-dev@lists.infradead.org \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).