Commit d0f5527d authored by Roland Vossen's avatar Roland Vossen Committed by Greg Kroah-Hartman

staging: brcm80211: smac: fix for 64 bit systems

A bug was introduced by the following commit (Sep 13):

    staging: brcm80211: use endian annotated structures in brcmsmac

Result was that 64 bits systems will not be able to acquire an IP address.
Also the rmmod crashed. This has been fixed and retested on a Sparc64.
Reviewed-by: default avatarPieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: default avatarAlwin Beukers <alwin@broadcom.com>
Reviewed-by: default avatarArend van Spriel <arend@broadcom.com>
Signed-off-by: default avatarArend van Spriel <arend@broadcom.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 8be00d98
...@@ -1606,7 +1606,7 @@ int brcms_ucode_init_buf(struct brcms_info *wl, void **pbuf, u32 idx) ...@@ -1606,7 +1606,7 @@ int brcms_ucode_init_buf(struct brcms_info *wl, void **pbuf, u32 idx)
* Precondition: Since this function is called in brcms_pci_probe() context, * Precondition: Since this function is called in brcms_pci_probe() context,
* no locking is required. * no locking is required.
*/ */
int brcms_ucode_init_uint(struct brcms_info *wl, u32 *data, u32 idx) int brcms_ucode_init_uint(struct brcms_info *wl, size_t *n_bytes, u32 idx)
{ {
int i, entry; int i, entry;
const u8 *pdata; const u8 *pdata;
...@@ -1623,7 +1623,7 @@ int brcms_ucode_init_uint(struct brcms_info *wl, u32 *data, u32 idx) ...@@ -1623,7 +1623,7 @@ int brcms_ucode_init_uint(struct brcms_info *wl, u32 *data, u32 idx)
"ERROR: fw hdr len\n"); "ERROR: fw hdr len\n");
return -ENOMSG; return -ENOMSG;
} }
*data = le32_to_cpu(*((__le32 *) pdata)); *n_bytes = le32_to_cpu(*((__le32 *) pdata));
return 0; return 0;
} }
} }
......
...@@ -50,8 +50,8 @@ extern void brcms_ucode_data_free(struct brcms_ucode *ucode); ...@@ -50,8 +50,8 @@ extern void brcms_ucode_data_free(struct brcms_ucode *ucode);
extern int brcms_ucode_init_buf(struct brcms_info *wl, void **pbuf, extern int brcms_ucode_init_buf(struct brcms_info *wl, void **pbuf,
unsigned int idx); unsigned int idx);
extern int brcms_ucode_init_uint(struct brcms_info *wl, unsigned *data, extern int brcms_ucode_init_uint(struct brcms_info *wl, size_t *n_bytes,
unsigned int idx); unsigned int idx);
extern void brcms_ucode_free_buf(void *); extern void brcms_ucode_free_buf(void *);
extern int brcms_check_firmwares(struct brcms_info *wl); extern int brcms_check_firmwares(struct brcms_info *wl);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment