Commit 2cf67270 authored by Oliver Neukum's avatar Oliver Neukum Committed by David S. Miller

aqc111: fix double endianness swap on BE

If you are using a function that does a swap in place,
you cannot just reuse the buffer on the assumption that it has
not been changed.
Signed-off-by: default avatarOliver Neukum <oneukum@suse.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 369b46e9
...@@ -1428,7 +1428,7 @@ static int aqc111_resume(struct usb_interface *intf) ...@@ -1428,7 +1428,7 @@ static int aqc111_resume(struct usb_interface *intf)
{ {
struct usbnet *dev = usb_get_intfdata(intf); struct usbnet *dev = usb_get_intfdata(intf);
struct aqc111_data *aqc111_data = dev->driver_priv; struct aqc111_data *aqc111_data = dev->driver_priv;
u16 reg16; u16 reg16, oldreg16;
u8 reg8; u8 reg8;
netif_carrier_off(dev->net); netif_carrier_off(dev->net);
...@@ -1444,9 +1444,11 @@ static int aqc111_resume(struct usb_interface *intf) ...@@ -1444,9 +1444,11 @@ static int aqc111_resume(struct usb_interface *intf)
/* Configure RX control register => start operation */ /* Configure RX control register => start operation */
reg16 = aqc111_data->rxctl; reg16 = aqc111_data->rxctl;
reg16 &= ~SFR_RX_CTL_START; reg16 &= ~SFR_RX_CTL_START;
/* needs to be saved in case endianness is swapped */
oldreg16 = reg16;
aqc111_write16_cmd_nopm(dev, AQ_ACCESS_MAC, SFR_RX_CTL, 2, &reg16); aqc111_write16_cmd_nopm(dev, AQ_ACCESS_MAC, SFR_RX_CTL, 2, &reg16);
reg16 |= SFR_RX_CTL_START; reg16 = oldreg16 | SFR_RX_CTL_START;
aqc111_write16_cmd_nopm(dev, AQ_ACCESS_MAC, SFR_RX_CTL, 2, &reg16); aqc111_write16_cmd_nopm(dev, AQ_ACCESS_MAC, SFR_RX_CTL, 2, &reg16);
aqc111_set_phy_speed(dev, aqc111_data->autoneg, aqc111_set_phy_speed(dev, aqc111_data->autoneg,
......
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