The Coverity checker spotted this dead code (note that (clock_ctrl == 7)
is already handled above).
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
We're leaking an skb in a failure path in this function.
Coverity #632
Signed-off-by: Dave Jones <davej@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
In latest -mm de620 gave following warning:
WARNING: drivers/net/de620.o - Section mismatch: reference to \
.init.text:de620_probe from .text between 'init_module' (at offset \
0x1682) and 'cleanup_module'
init_module() call de620_probe() which is declared __init.
Fix is to declare init_module() __init too.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Improve reference to PCI NE2K support in ISA NE2K documentation.
Original 2.4 patch From: Ged Haywood <ged@jubileegroup.co.uk>
Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
This patch fixes an error in the dl2k driver's DMA mapping/unmapping.
The adapter uses the upper 16bits of the DMA address for the buffer
size. However, this is not masked off when referencing the DMA
address, and can lead to errors by trying to free a DMA address out of
range.
Thanks,
Jon
Signed-off-by: Jon Mason <jdmason@us.ibm.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
For some reason, E1000's ->hard_start_xmit() routine returns -EFAULT
instead of one of the NETDEV_TX_* error codes. In fact, it frees up
the SKB before returning this. This makes the queueing layer think
the packet should be requeued and subsequently we corrupt a freed
object.
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Turn on truncation to prevent getting choked by frames larger than expected.
Without this fix, driver hangs after receiving an oversize packet.
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Avoid premature transmit ring full conditions.
Force a transmit status interrupt if transmit ring gets nearly full
and after a TSO send.
Allow more entries in transmit ring to be used if dma_addr is 32 bits
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Don't use sky2 to seed random pool beacause the network packet arrival time
will not be truly random due to NAPI and interrupt mitigation.
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
de_init_hw enables the irq thus it must be issued after request_irq.
Signed-off-by: Martin Michlmayr <tbm@cyrius.com>
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Add DMA workaround for chips that do not support full 64-bit DMA
addresses.
5714, 5715, and 5780 chips only support DMA addresses less than 40
bits. On 64-bit systems with IOMMU, set the dma_mask to 40-bit so
that pci_map_xxx() calls will map the DMA address below 40 bits if
necessary. On 64-bit systems without IOMMU, set the dma_mask to
64-bit and check for DMA addresses exceeding the limit in
tg3_start_xmit().
5788 only supports 32-bit DMA so need to set the mask appropriately
also.
Thanks to Chris Elmquist at SGI for reporting and helping to debug
the problem on 5714.
Thanks to David Miller for explaining the HIGHMEM and DMA stuff.
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
memset() is called before check.
Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
The mac_addr variable doesn't get reset between
(re)additions of multicast addresses. One byte
of all multicast addresses (except the first)
can be incorrect.
Signed-off-by: Arthur Kepner <akepner@sgi.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
The axnet_cs driver can support the AMB8110 PC Card, so add the id for it.
In the old pcmcia-cs config file, this card is listed with the comment "not
specific enough". The last entry in the axnet_ids has the same comment.
They are disabled, and for good reason as it was originally identified by
the MANFID, and that is shared with several cards that use both the
pcnet_cs driver and axnet_cs driver. I tried my AMB8110 with pcnet_cs, and
found that it works fine, and I cannot find a reason for either, except
that the old config file recommended axnet_cs.
Signed-off-by: Jesse Allen <the3dfxdude@gmail.com>
Cc: Jeff Garzik <jgarzik@pobox.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Don't just use cards with PCMCIA ID 0x0156, 0x0002. Make sure that the
vendor string is "Intersil" or "INTERSIL"
Signed-off-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
A recent patch attempted to enable more efficient memory usage by using
only 2kB descriptors for jumbo frames. The method used to implement this
has since been commented upon as "illegal" and in recent kernels even
causes a BUG when receiving ip fragments while using jumbo frames.
This patch simply goes back to the way things were. We expect some
complaints due to order 3 allocations failing to come back due to this
change.
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Remove Message Signaled Interrupt support (for 2.6.16).
MSI is inherently edge-triggered and that is incompatiable (without more
work) with NAPI.
In future, will replace with smarter lockless-IRQ handling like
tg3.c
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
- check that the device is up before it is enabled again;
- the descriptor ring indexes must be set to zero before
cp_init_hw() is issued. Add a nice comment to remember
that skb allocation failure is still not handled.
Fixes http://bugzilla.kernel.org/show_bug.cgi?id=5681
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
velocity_rx_refill() only replenishes the descriptor entries which
belong to the CPU. It works great in the Rx path but the driver must
ensure that all the descriptors are freed before velocity_rx_refill()
is used in velocity_change_mtu(). The patch resets the Rx descriptors
in velocity_free_rd_ring().
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Some Sun parts don't have PCI_VENDOR_ID_SUN in the subsystem
vendor ID. So add another fallback test, which is the name
of the OBP firmware device tree node. If it's a Sun part we'll
get "network", else it will be named "ethernet".
Signed-off-by: David S. Miller <davem@davemloft.net>
Fix two bugs in the WoL implementation of sis900. The first causes
hangs on some system on driver load, the second causes troubles
when disabling WoL support. Both fixes are one liner and really
simple.
Signed-off-by: Lennert Buytenhek <buytenh@wantstofly.org>
Signed-off-by: Daniele Venzano <venza@brownhat.org>
drivers/net/tlan.c compiles with CONFIG_PCI=n only with a warning and
due to the dead code elimination of gcc.
Additionally, this fixes the only compile error I found with
CONFIG_PCI=n and the gcc -Werror-implicit-function-declaration
flag on i386.
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
The most usable number of ifb devices is 2. Change the default to 2.
Signed-off-by: Richard Lucassen <spamtrap@lucassen.org>
Signed-off-by: Jamal Hadi Salim <hadi@cyberus.ca>
Signed-off-by: David S. Miller <davem@davemloft.net>
There is a race between updating the irq mask and setting it
which can be triggered on SMP with a bad cable.
Similar patch from Ingo Molnar and Thomas Gleixner
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
The SysKonnect Genesis based board would fail on initialization
with phy_read errors caused by not waiting for last phy write.
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Fix a race in the receive NAPI, irq handling. The interrupt clear and the
start need to be separated. Otherwise there is a window between the last
frame received and the NAPI done level handling.
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
rtl8169_hw_start() requires that the descriptor ring indexes be
set to zero. Let a deferred invocation of rtl8169_reset_task()
handle it. Enabling a few power management bits will not hurt
either.
suspend/resume is issued with irq on: the spinlock do not need
to save the irq flag.
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Need to avoid race in updating IRQ mask. This can probably be replaced
smarter use of the interrupt control registers (if/when chipset
docs are available).
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
To avoid problems with PCI config access without ACPI (or busted ACPI tables),
use the device's window into PCI config space.
I know this probably will upset the purists, but I would rather have users
than ACPI testers. It also generates less code.
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Need to force a transmit coalesce timer restart after processing
transmit packets. Otherwise, can get transmit status after last
update and chip doesn't send the next one.
Can go with the chip defaults for coalescing timers, except for
Tx timer which needs to be bigger.
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Need to restart the interrupt coalescing timer after clearing the interrupt,
to avoid races with interrupt timer and processing.
Patch from Carl-Daniel Halfinger
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Don't allow coalescing values to be bigger than the transmit ring.
Since if you set them that big, the interrupt never happens and driver
livelocks.
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Add more complete setup code for Yukon EC_U chipset.
Based on matching code in 8.31 code in SysKonnect vendor driver.
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
The following message will be only printed if DEBUG_NOTIF is on. "Unknown
notification: subtype=40,flags=0xa0,size=40"
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Cc: James Ketrenos <jketreno@linux.intel.com>
Cc: Jeff Garzik <jgarzik@pobox.com>
Cc: "John W. Linville" <linville@tuxdriver.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This patch fixes 2 bugs in the USB-IrDA code.
The first one is a buffer overrun in the RX path. We are now using
IRDA_SKB_MAX_MTU when initializing the Rx URB.
The second one is a potential stack recursion when unplugging the USB
dongle. It seems that first we get the Rx URB with a generic error
code, and after a while the Rx URB comes again with a "disconnect"
error code. Since we are resubmitting the Rx URB immediately after
receiving the first error one, we might enter an endless loop.
When getting an error Rx URB, the patch defers the Rx URB resubmitting
so that it gives us a chance to catch the disconnect one, in case the
dongle has juts been unplugged.
Tested against 2.6.16-rc2.
Patch from Jean Tourrilhes
Signed-off-by: Jean Tourrilhes <jt@hpl.hp.com>
Signed-off-by: Samuel Ortiz <samuel.ortiz@nokia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
bond_release returns EINVAL without releasing the bond lock if the
slave device is not being bonded by the bond. The following patch
ensures that the lock is released in this case.
Signed-off-by: Stephen J. Bevan <stephen@dino.dnsalias.com>
Acked-by: Jay Vosburgh <fubar@us.ibm.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
drivers/net/tokenring/smctr.c: In function `smctr_load_firmware':
drivers/net/tokenring/smctr.c:2981: warning: assignment discards qualifiers from pointer target type
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Users report problems w/ auto-negotiation disabled and the link set
to 100/Half or 10/Half. Problems range from poor performance to no
link at all.
The current sky2 code does not set things properly on link up if
autonegotiation is disabled. Plus it does not contemplate a 10Mbit
setting at all. This patch corrects that.
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
This is a clone of John Linville's fixed for speed setting on sky2 driver.
The skge driver has the same code (and bug). It would not allow manually forcing
100 and 10 mbit.
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Take the experimental dependency of skge driver, it is as stable as the
others.
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
The sk98lin driver was changed a while ago to remove support for the
D-Link 530T card because that hardware has no working VPD data. The help
text for Kconfig was not updated.
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Some bitfields were incorrectly initialised in wavelan_cs,
causing some compiler warning. Also killed a error message that should
not be there...
Signed-off-by: Jean Tourrilhes <jt@hpl.hp.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>