Skip to content

Commit 427907e

Browse files
Malcolm Priestleygregkh
authored andcommitted
staging: rtl8192e: fix 2 byte alignment of register BSSIDR.
commit 867510bde14e7b7fc6dd0f50b48f6753cfbd227a upstream. BSSIDR has two byte alignment on PCI ioremap correct the write by swapping to 16 bits first. This fixes a problem that the device associates fail because the filter is not set correctly. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 8b26f53 commit 427907e

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,9 @@ void rtl92e_set_reg(struct net_device *dev, u8 variable, u8 *val)
9797

9898
switch (variable) {
9999
case HW_VAR_BSSID:
100-
rtl92e_writel(dev, BSSIDR, ((u32 *)(val))[0]);
101-
rtl92e_writew(dev, BSSIDR+2, ((u16 *)(val+2))[0]);
100+
/* BSSIDR 2 byte alignment */
101+
rtl92e_writew(dev, BSSIDR, *(u16 *)val);
102+
rtl92e_writel(dev, BSSIDR + 2, *(u32 *)(val + 2));
102103
break;
103104

104105
case HW_VAR_MEDIA_STATUS:
@@ -963,8 +964,8 @@ static void _rtl92e_net_update(struct net_device *dev)
963964
rtl92e_config_rate(dev, &rate_config);
964965
priv->dot11CurrentPreambleMode = PREAMBLE_AUTO;
965966
priv->basic_rate = rate_config &= 0x15f;
966-
rtl92e_writel(dev, BSSIDR, ((u32 *)net->bssid)[0]);
967-
rtl92e_writew(dev, BSSIDR+4, ((u16 *)net->bssid)[2]);
967+
rtl92e_writew(dev, BSSIDR, *(u16 *)net->bssid);
968+
rtl92e_writel(dev, BSSIDR + 2, *(u32 *)(net->bssid + 2));
968969

969970
if (priv->rtllib->iw_mode == IW_MODE_ADHOC) {
970971
rtl92e_writew(dev, ATIMWND, 2);

0 commit comments

Comments
 (0)