aboutsummaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)Author
2009-06-14Bluetooth: Fix issue with uninitialized nsh.type in DTL-1 driverMarcel Holtmann
The current build shows a warning with the DTL-1 driver: CC [M] drivers/bluetooth/dtl1_cs.o drivers/bluetooth/dtl1_cs.c: In function ‘dtl1_hci_send_frame’: drivers/bluetooth/dtl1_cs.c:396: warning: ‘nsh.type’ may be used uninitialized in this function Fix this by adding a proper error for unknown packet types. Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2009-06-13ieee802154: fix kconfig bool/tristate muckupRandy Dunlap
menuconfig IEEE802154_DRIVERS is a bool that depends on tristate IEEE802154. If the IEEE802154 symbol is 'm', the bool becomes 'y'. This allows tristate symbols under IEEE802154_DRIVERS to be configured as 'y' and cause build problems. Changing the menuconfig bool to a tristate fixes this. drivers/built-in.o: In function `fake_scan_req': fakehard.c:(.text+0x46d625): undefined reference to `ieee802154_nl_scan_confirm' drivers/built-in.o: In function `fake_disassoc_req': fakehard.c:(.text+0x46d66f): undefined reference to `ieee802154_nl_disassoc_confirm' drivers/built-in.o: In function `fake_assoc_req': fakehard.c:(.text+0x46d6be): undefined reference to `ieee802154_nl_assoc_confirm' Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Acked-by: Sergey Lapin <slapin@ossfans.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-06-13bonding: initialization reworkStephen Hemminger
Need to rework how bonding devices are initialized to make it more amenable to creating bonding devices via netlink. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-06-13bonding: use is_zero_ether_addrStephen Hemminger
Remove bogus non-portable possibly unaligned way of testing for zero addres.. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-06-13bonding: network device names are case sensativeStephen Hemminger
The bonding device acts unlike all other Linux network device functions in that it ignores case of device names. The developer must have come from windows! Cleanup the management of names and use standard routines where possible. Flag places where bonding device still doesn't work right with network namespaces. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-06-13bonding: elminate bad refcount codeStephen Hemminger
The "expected_refcount" stuff in bonding sysfs module is a mistake. Sysfs does proper refcounting, and it is okay to remove a bond device that has some user process holding the file open. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-06-13bonding: fix style issuesStephen Hemminger
Resolve some of the complaints from checkpatch, and remove "magic emacs format" comments, and useless MODULE_SUPPORTED_DEVICE(). But should not change actual code. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-06-13bonding: fix destructorStephen Hemminger
It is not safe to use a network device destructor that is a function in the module, since it can be called after module is unloaded if sysfs handle is open. When eventually using netlink, the device cleanup code needs to be done via uninit function. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-06-13bonding: remove bonding read/write semaphoreStephen Hemminger
The whole read/write semaphore locking can be removed. It doesn't add any protection that isn't already done by using the RTNL mutex properly. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-06-13bonding: initialize before registrationStephen Hemminger
Avoid a unnecessary carrier state transistion that happens when device is registered. Lockdep works better if initialization is done before registration as well. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-06-13bonding: bond_create always called with default parametersStephen Hemminger
bond_create() is always called with same parameters so move the argument down. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-06-13Merge branch 'for-next' of ↵David S. Miller
git://git.kernel.org/pub/scm/linux/kernel/git/sameo/irda-2.6
2009-06-13net: use symbolic values for ndo_start_xmit() return codesPatrick McHardy
Convert magic values 1 and -1 to NETDEV_TX_BUSY and NETDEV_TX_LOCKED respectively. 0 (NETDEV_TX_OK) is not changed to keep the noise down, except in very few cases where its in direct proximity to one of the other values. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-06-13net: fix network drivers ndo_start_xmit() return values (part 8)Patrick McHardy
Fix up USB drivers that return an errno value (result of usb_submit_urb()) to qdisc_restart(), causing qdisc_restart() to print a warning and requeue/ retransmit the skb. - hso: skb is freed: use after free - at76_usb: skb is freed: use after free Compile tested only. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-06-13net: fix network drivers ndo_start_xmit() return values (part 6)Patrick McHardy
Fix up hamradio drivers that return an errno value to dev_queue_xmit(), causing it to print a warning an free the skb. - bpqether: skb is freed: use after free Compile tested only. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-06-13net: fix network drivers ndo_start_xmit() return values (part 5)Patrick McHardy
Fix up s390 drivers that return an errno value to qdisc_restart(), causing qdisc_restart() to print a warning an requeue/retransmit the skb. - claw: impossible condition, simply remove it Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-06-13net: fix network drivers ndo_start_xmit() return values (part 4)Patrick McHardy
Fix up WAN drivers that return an errno value to qdisc_restart(), causing qdisc_restart() to print a warning an requeue/retransmit the skb. - cycx_x25: intention appears to be to requeue the skb Does not compile cleanly for me even without this patch, so untested. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-06-13net: fix network drivers ndo_start_xmit() return values (part 3)Patrick McHardy
net: fix network drivers ndo_start_xmit() return values (part 3) Fix up wireless drivers that return an errno value to qdisc_restart(), causing qdisc_restart() to print a warning an requeue/retransmit the skb. - airo: transmission not implemented for chip, intention is to free and abort - ipw2200: transmission not implemented for promiscous mode, intention is to drop - prism54: intention is to drop - wl3501_cs: intention appears to be to drop - zd1201: error counter indicates intention is to drop All drivers compile tested. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-06-13net: fix network drivers ndo_start_xmit() return values (part 2)Patrick McHardy
Fix up IRDA drivers that return an errno value to qdisc_restart(), causing qdisc_restart() to print a warning an requeue/retransmit the skb. - donauboe: intention appears to be to have the skb retransmitted without error message - irda-usb: intention is to drop silently according to comment - kingsub-sir: skb is freed: use after free - ks959-sir: skb is freed: use after free - ksdazzle-sir: skb is freed: use after free - mcs7880: skb is freed: use after free All but donauboe compile tested. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-06-13net: fix network driver ndo_start_xmit() return values (part 1)Patrick McHardy
Fix up drivers that return an errno value to qdisc_restart(), causing qdisc_restart() to print a warning and requeue/retransmit the skb. - xpnet: memory allocation error, intention is to drop - ethoc: oversized packet, packet must be dropped - ibmlana: skb freed: use after free - rrunner: skb freed: use after free Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-06-13irda: smsc wait count reaches -1Roel Kluin
The sir retries count reaches -1 rather than 0. Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: Samuel Ortiz <samuel@sortiz.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2009-06-13irda: new Blackfin on-chip SIR IrDA driverGraff Yang
Signed-off-by: Graff Yang <graff.yang@gmail.com> Cc: Mike Frysinger <vapier@gentoo.org> Cc: Bryan Wu <bryan.wu@analog.com> Signed-off-by: Samuel Ortiz <samuel@sortiz.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2009-06-11virtio_net: Fix IP alignment on non-mergeable RX pathHerbert Xu
We need to enforce the IP alignment on the non-mergeable RX path just like the other RX path. Not doing so results in misaligned IP headers. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-06-11net: ntohs() misuseEric Dumazet
Some drivers incorrectly use ntohs() instead of htons() A cleanup as htons() returns same result than ntohs(), but better to use the proper one. Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-06-11Merge branch 'linux-2.6.31.y' of ↵David S. Miller
git://git.kernel.org/pub/scm/linux/kernel/git/inaky/wimax
2009-06-11wimax: fix gcc warnings in sh4 when calling BUG()Inaky Perez-Gonzalez
SH4's BUG() seems to confuse the compiler as it is considered to return; thus, some functions would trigger usage of uninitialized variables or non-void functions returning void. Work around by initializing/returning. Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
2009-06-11mISDN: Do not disable IRQ in ph_data_ind()Karsten Keil
This fix triggering the WARN_ON_ONCE(in_irq() || irqs_disabled()); in local_bh_enable(). Here is no need to grab this lock, this was wrong at all and may cause a deadlock and access to freed memory, since on a TEI remove the current listelement can be deleted under us. So this is clearly a case for list_for_each_entry_safe. Signed-off-by: Karsten Keil <keil@b1-systems.de>
2009-06-11drivers/isdn/i4l/isdn_tty.c: fix check for array overindexingRoel Kluin
The check for overindexing of dev->mdm.info[] has an off-by-one. Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Acked-by: Karsten Keil <keil@b1-systems.de>
2009-06-11mISDN: Free hfcpci IRQ if init was not successfulAndreas Mohr
If we get no interrupts for after 3 resets we need to unregister the interrupt function, which is already done outside the loop. Signed-off-by: Andreas Mohr <andi@lisas.de> Signed-off-by: Karsten Keil <keil@b1-systems.de>
2009-06-11mISDN: Fix overlapping data accessKarsten Keil
Remove code rewriting a buffer by itself. This fix bug 12970 on bugzilla.kernel.org. Signed-off-by: Karsten Keil <keil@b1-systems.de>
2009-06-11ISDN:Fix DMA alloc for hfcpciKarsten Keil
Replace wrong code with correct DMA API functions. Signed-off-by: Karsten Keil <keil@b1-systems.de>
2009-06-11Merge branch 'master' of ↵David S. Miller
git://git.kernel.org/pub/scm/linux/kernel/git/holtmann/bluetooth-next-2.6
2009-06-11bonding: fix multiple module load problemStephen Hemminger
Some users still load bond module multiple times to create bonding devices. This accidentally was broken by a later patch about the time sysfs was fixed. According to Jay, it was broken by: commit b8a9787eddb0e4665f31dd1d64584732b2b5d051 Author: Jay Vosburgh <fubar@us.ibm.com> Date: Fri Jun 13 18:12:04 2008 -0700 bonding: Allow setting max_bonds to zero Note: sysfs and procfs still produce WARN() messages when this is done so the sysfs method is the recommended API. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: Jay Vosburgh <fubar@us.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-06-11wimax/i2400m: use -EL3RST to indicate device reset instead of -ERESTARTSYSCindy H Kao
When the i2400m device resets, the driver code will force some functions to return a -ERESTARTSYS error code, which can is used by the caller to determine which recovery actions to take. However, in certain situations the only thing that can be done is to bubble up said error code to user space, for handling. However, -ERESTARSYS was a poor choice, as it is supposed to be used by the kernel only. As such, replace -ERESTARTSYS with -EL3RST; as well, in i2400m_msg_to_dev(), when the device is in boot mode (following a recent reset), return -EL3RST instead of -ENODEV (meaning the device is in bootrom mode after a reset, not that the device was disconnected, and thus, normal commands cannot be executed). Signed-off-by: Cindy H Kao <cindy.h.kao@intel.com>
2009-06-11wimax/i2400m: when bootstrap fails, reinitialize the bootromCindy H Kao
When a device reset happens during firmware load [in i2400m_dev_bootstrap()], __i2400m_dev_start() will retry a number of times. However, for those retries to be able to accomplish anything, the device's bootrom has to be reinitialized. Thus, on the retry path, pass the I2400M_MAC_REINIT to the firmware load code. Signed-off-by: Cindy H Kao <cindy.h.kao@intel.com>
2009-06-11wimax/i2400m/sdio: Move all the RX code to a unified, IRQ based receive routineInaky Perez-Gonzalez
The current SDIO code was working in polling mode for boot-mode (firmware load) mode. This was causing issues on some hardware. Moved all the RX code to use a unified IRQ handler that based on the type of data the device is sending can discriminate and decide which is the right destination. As well, all the reads from the device are made to be at least the block size (256); the driver will ignore the rest when not needed. Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com> Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
2009-06-11wimax/i2400m: don't reset device when bootrom init retries are exceededInaky Perez-Gonzalez
When i2400m_bootrom_init() fails to put the device into a state of being ready to accept firmware, the driver was currently trying to reset it if it failed to do so. This is not too useful; as part of trying to put the device in the right state a few resets have already been tried. At this point, things are probably fried out and an extra reset might do more harm than good (for example causing reseting of other functions in the same composite device). So it is left up to the callers to determine the error path to take (at the end this is always i2400m_setup(), who depending on how many retries are left, might give up on the device). From a fix by Cindy H. Kao. Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
2009-06-11wimax/i2400m/sdio: Add device specific poke table.Dirk Brandewie
Add a poke table for the SDIO device (as it is different than USB). Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
2009-06-11wimax/i2400m: move boot time poke table out of common driverDirk Brandewie
This change moves the table of "pokes" performed on the device at boot time to the bus specific portion of the driver. Different models of the i2400m device supported by this driver require different poke tables, thus having a single table that works for all is impossible. For that, the table is moved to the bus-specific driver, who can decide which table to use based on the specifics of the device and point the generic driver to it. Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
2009-06-11wimax/i2400m: Allow bus-specific driver to specify retry countInaky Perez-Gonzalez
The code that sets up the i2400m (firmware load and general driver setup after it) includes a couple of retry loops. The SDIO device sometimes can get in more complicated corners than the USB one (due to its interaction with other SDIO functions), that require trying a few more times. To solve that, without having a failing USB device taking longer to be considered dead, allow the retry counts to be specified by the bus-specific driver, which the general driver takes as a parameter. Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
2009-06-11wimax/i2400m: if a device reboot happens during probe, handle itInaky Perez-Gonzalez
When a device reboot happens when we are under probe, with init_mutex taken, make sure we can recover. Have dev_reset_handle set boot mode and i2400m_msg_to_dev() will see it and fail gracefully instead of timing out. Found and diagnosed by Cindy H. Kao. Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
2009-06-11wimax/i2400m: fix oops when the TX FIFO fills up due to a missing checkInaky Perez-Gonzalez
When the TX FIFO filled up and i2400m_tx_new() failed to allocate a new TX message header, a missing check for said condition was causing a kernel oops when trying to dereference a NULL i2400m->tx_msg pointer. Found and diagnosed by Cindy H. Kao. Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
2009-06-11wimax/i2400m: don't reset device on i2400m_dev_shutdown()Inaky Perez-Gonzalez
i2400m_dev_shutdown() tried to reset the device to put it in a known state before shutting down. But that turned out to be pointless. We reach this case in two paths: 1 - when the device resets, to clean up state 2 - when the driver is unloaded, for the same however, in both cases it is pointless; in (1) the device is already reset, why do it again? in (2) we can't -- the USB stack, for example, doesn't allow communicating with the device when the driver is being unbound and if the device is disconnected, the device is gone already. So just remove it. Leave the function as a placeholder for future cleanups that will be done from data allocated by the driver during device operation. Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
2009-06-11wimax/i2400m: fix panic due to missed corner cases on tail_room calculationInaky Perez-Gonzalez
i2400m_tx_skip_tail() needs to handle the special case of being called when the tail room that is left over in the FIFO is zero. This happens when a TX message header was opened at the very end of the FIFO (without payloads). The i2400m_tx_close() code already marked said TX message (header) to be skipped and this function should be doing nothing. It is called anyway because it is part of a common "corner case" path handling which takes care of more cases than only this one. The tail room computation was also improved to take care of the case when tx_in is at the end of the buffer boundary; tail_room has to be modded (%) to the buffer size. To do that in a single well-documented place, __i2400m_tx_tail_room() is introduced and used. Treat i2400m->tx_in == 0 as a corner case and handle it accordingly. Found and diagnosed by Cindy H. Kao. Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
2009-06-11wimax/i2400m: fix panic/warnings caused by missed check on empty TX messageInaky Perez-Gonzalez
In some situations, when a new TX message header is started, there might be no space for data payloads. In this case the message is left with zero payloads and the i2400m_tx_close() function has just to mark it as "to skip". If it tries to go ahead it will overwrite things because there is no space to add padding as defined by the bus-specific layer. This can cause buffer overruns and in some stress cases, panics. Found and diagnosed by Cindy H. Kao. Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
2009-06-11wimax/i2400m: rename misleading I2400M_PL_PAD to I2400M_PL_ALIGNInaky Perez-Gonzalez
The constant is being use as an alignment factor, not as a padding factor; made reading/reviewing the code quite confusing. Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
2009-06-11wimax/i2400m/sdio: Implement I2400M_RT_BUS reset typeDirk Brandewie
This reset type causes the WiMAX function to be disabled and re-enabled, which will force the WiMAX device to reset and enter boot mode. Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com> Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
2009-06-11wimax/i2400m: Change d_printf() level for secure boot messagesDirk Brandewie
Changing debug level of print out to support validation engineers getting the messages they need. Signed-off-by: <dirk.j.brandewie@intel.com>
2009-06-11wimax/i2400m: i2400m_schedule_work() doesn't need i2400m->work_queueInaky Perez-Gonzalez
By mistake, the BUG_ON() check was left in there and it will fail when called if i2400m->work_queue is still not setup. Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
2009-06-11wimax/i2400m: i2400m's work queue should be initialized before RX supportInaky Perez-Gonzalez
RX support is the only user of the work-queue, to process reports/notifications from the device. Thus, it needs the work queue to be initialized first. Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>