lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4EBAB0EA.1050102@teksavvy.com>
Date:	Wed, 09 Nov 2011 11:57:14 -0500
From:	Mark Lord <kernel@...savvy.com>
To:	Ben Hutchings <bhutchings@...arflare.com>
CC:	David Miller <davem@...emloft.net>, netdev@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] drivers/net/usb/asix:  resync from vendor's copy

On 11-11-09 11:47 AM, Mark Lord wrote:
..
> Note:  I'm looking at smsc95xx.c and smsc75xx.c for examples,
> and they both have the same problem I'll have here:
> 
> How to update the csum settings atomically.
> A spinlock is no good, because config register access is over USB.

Nevermind.. a slight change in the logic and all is well again.

static int ax88772b_set_features(struct net_device *netdev, u32 features)
{
        struct usbnet *dev = netdev_priv(netdev);
        struct ax88772b_data *priv = (struct ax88772b_data *)dev->driver_priv;
        unsigned long flags;
        u16 tx_csum = 0, rx_csum = 0;

        spin_lock_irqsave(&priv->features_lock, flags);
        if (features & NETIF_F_HW_CSUM) {
                priv->checksum |= AX_TX_CHECKSUM;
                tx_csum = AX_TXCOE_DEF_CSUM;
        } else
                priv->checksum &= ~AX_TX_CHECKSUM;
        if (features & NETIF_F_RXCSUM) {
                priv->checksum |= AX_RX_CHECKSUM;
                rx_csum = AX_RXCOE_DEF_CSUM;
        } else
                priv->checksum &= ~AX_RX_CHECKSUM;
        spin_unlock_irqrestore(&priv->features_lock, flags);

        ax8817x_write_cmd(dev, AX_CMD_WRITE_RXCOE_CTL,
                                 rx_csum, 0, 0, NULL);
        ax8817x_write_cmd(dev, AX_CMD_WRITE_TXCOE_CTL,
                                 tx_csum, 0, 0, NULL);
        return 0;
}
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ