Package: r6040-source
Version: 0.17-2
Severity: important
Tags: patch

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

This code in r6040.c is hilariously broken if cpu_to_le32() actually
does byte-swap:

        /* TX and RX descriptor start Register */
        tmp_addr = cpu_to_le32(lp->tx_insert_ptr);
        tmp_addr = virt_to_bus((volatile void *)tmp_addr);
        outw((u16) tmp_addr, ioaddr+0x2c);
        outw(tmp_addr >> 16, ioaddr+0x30);
        tmp_addr = cpu_to_le32(lp->rx_insert_ptr);
        tmp_addr = virt_to_bus((volatile void *)tmp_addr);
        outw((u16) tmp_addr, ioaddr+0x34);
        outw(tmp_addr >> 16, ioaddr+0x38);

The byte-swapping should be the last thing done before writing to
little-endian registers.  The following might work:

        /* TX and RX descriptor start Register */
        tmp_addr = virt_to_bus(lp->tx_insert_ptr);
        outw(cpu_to_le16(tmp_addr), ioaddr+0x2c);
        outw(cpu_to_le16(tmp_addr >> 16), ioaddr+0x30);
        tmp_addr = virt_to_bus(lp->rx_insert_ptr);
        outw(cpu_to_le16(tmp_addr), ioaddr+0x34);
        outw(cpu_to_le16(tmp_addr >> 16), ioaddr+0x38);

Ben.

- -- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'stable'), (100, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.24-1-686 (SMP w/1 CPU core)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFIMNnq79ZNCRIGYgcRAilcAJ94ewuRJjT6eh8D6HIQ2rafskCYdgCfW/Hh
iqH56v4EQpxk+ug02ISE4nQ=
=OWWy
-----END PGP SIGNATURE-----



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to