提交 ff829ae0 编写于 作者: H Holger Schurig 提交者: John W. Linville

libertas: store rssi as an u32

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: NHolger Schurig <hs4233@mail.mn-solutions.de>
Acked-by: NDan Williams <dcbw@redhat.com>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 e98a88dd
...@@ -78,7 +78,7 @@ static ssize_t lbs_getscantable(struct file *file, char __user *userbuf, ...@@ -78,7 +78,7 @@ static ssize_t lbs_getscantable(struct file *file, char __user *userbuf,
u16 spectrum_mgmt = (iter_bss->capability & WLAN_CAPABILITY_SPECTRUM_MGMT); u16 spectrum_mgmt = (iter_bss->capability & WLAN_CAPABILITY_SPECTRUM_MGMT);
pos += snprintf(buf+pos, len-pos, pos += snprintf(buf+pos, len-pos,
"%02u| %03d | %04ld | %s |", "%02u| %03d | %04d | %s |",
numscansdone, iter_bss->channel, iter_bss->rssi, numscansdone, iter_bss->channel, iter_bss->rssi,
print_mac(mac, iter_bss->bssid)); print_mac(mac, iter_bss->bssid));
pos += snprintf(buf+pos, len-pos, " %04x-", iter_bss->capability); pos += snprintf(buf+pos, len-pos, " %04x-", iter_bss->capability);
......
...@@ -602,7 +602,7 @@ static int lbs_scan_networks(struct lbs_private *priv, int full_scan) ...@@ -602,7 +602,7 @@ static int lbs_scan_networks(struct lbs_private *priv, int full_scan)
lbs_deb_scan("scan table:\n"); lbs_deb_scan("scan table:\n");
list_for_each_entry(iter, &priv->network_list, list) list_for_each_entry(iter, &priv->network_list, list)
lbs_deb_scan("%02d: BSSID %s, RSSI %d, SSID '%s'\n", 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)); escape_essid(iter->ssid, iter->ssid_len));
mutex_unlock(&priv->lock); mutex_unlock(&priv->lock);
#endif #endif
...@@ -948,7 +948,7 @@ struct bss_descriptor *lbs_find_ssid_in_list(struct lbs_private *priv, ...@@ -948,7 +948,7 @@ struct bss_descriptor *lbs_find_ssid_in_list(struct lbs_private *priv,
uint8_t *bssid, uint8_t mode, uint8_t *bssid, uint8_t mode,
int channel) int channel)
{ {
uint8_t bestrssi = 0; u32 bestrssi = 0;
struct bss_descriptor * iter_bss = NULL; struct bss_descriptor * iter_bss = NULL;
struct bss_descriptor * found_bss = NULL; struct bss_descriptor * found_bss = NULL;
struct bss_descriptor * tmp_oldest = NULL; struct bss_descriptor * tmp_oldest = NULL;
......
...@@ -34,14 +34,9 @@ struct bss_descriptor { ...@@ -34,14 +34,9 @@ struct bss_descriptor {
u8 ssid_len; u8 ssid_len;
u16 capability; u16 capability;
u32 rssi;
/* receive signal strength in dBm */
long rssi;
u32 channel; u32 channel;
u16 beaconperiod; u16 beaconperiod;
u32 atimwindow; u32 atimwindow;
/* IW_MODE_AUTO, IW_MODE_ADHOC, IW_MODE_INFRA */ /* IW_MODE_AUTO, IW_MODE_ADHOC, IW_MODE_INFRA */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册