aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorMarek VaĊĦut <marek.vasut@gmail.com>2007-08-20 12:55:41 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:50:36 -0400
commit70500f5443be1b27ea2c9ab71ce9dc2250af7b19 (patch)
treee5cd749a6187800e719e9ce9aa2c4ff2dec40070 /drivers/net/wireless
parent794760f750655d987499d7a5034519afc84af63b (diff)
[PATCH] libertas: region code values specified as 8bit
This patch strips away possible mess in regioncode (eg. on my card - 88W8305 chipset - I get 0x3031 instead of expected 0x0031 and as a result the driver defaults to USA region which is obviously incorrect). Following patch fixes the issue. Signed-off-by: Marek Vasut <marek.vasut@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/libertas/cmdresp.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/net/wireless/libertas/cmdresp.c b/drivers/net/wireless/libertas/cmdresp.c
index 4c36e63ae7b0..d64ad87db459 100644
--- a/drivers/net/wireless/libertas/cmdresp.c
+++ b/drivers/net/wireless/libertas/cmdresp.c
@@ -174,7 +174,11 @@ static int wlan_ret_get_hw_spec(wlan_private * priv,
174 lbs_deb_cmd("GET_HW_SPEC: hardware interface 0x%x, hardware spec 0x%04x\n", 174 lbs_deb_cmd("GET_HW_SPEC: hardware interface 0x%x, hardware spec 0x%04x\n",
175 hwspec->hwifversion, hwspec->version); 175 hwspec->hwifversion, hwspec->version);
176 176
177 adapter->regioncode = le16_to_cpu(hwspec->regioncode); 177 /* Clamp region code to 8-bit since FW spec indicates that it should
178 * only ever be 8-bit, even though the field size is 16-bit. Some firmware
179 * returns non-zero high 8 bits here.
180 */
181 adapter->regioncode = le16_to_cpu(hwspec->regioncode) & 0xFF;
178 182
179 for (i = 0; i < MRVDRV_MAX_REGION_CODE; i++) { 183 for (i = 0; i < MRVDRV_MAX_REGION_CODE; i++) {
180 /* use the region code to search for the index */ 184 /* use the region code to search for the index */