Skip to content

Commit

Permalink
[PATCH] libertas: region code values specified as 8bit
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Marek Vašut authored and David S. Miller committed Oct 10, 2007
1 parent 794760f commit 70500f5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/net/wireless/libertas/cmdresp.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,11 @@ static int wlan_ret_get_hw_spec(wlan_private * priv,
lbs_deb_cmd("GET_HW_SPEC: hardware interface 0x%x, hardware spec 0x%04x\n",
hwspec->hwifversion, hwspec->version);

adapter->regioncode = le16_to_cpu(hwspec->regioncode);
/* Clamp region code to 8-bit since FW spec indicates that it should
* only ever be 8-bit, even though the field size is 16-bit. Some firmware
* returns non-zero high 8 bits here.
*/
adapter->regioncode = le16_to_cpu(hwspec->regioncode) & 0xFF;

for (i = 0; i < MRVDRV_MAX_REGION_CODE; i++) {
/* use the region code to search for the index */
Expand Down

0 comments on commit 70500f5

Please sign in to comment.