summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* sfc: Remove remnants of on-load self-testBen Hutchings2012-01-274-36/+20
| | | | | | | | | The out-of-tree version of the sfc driver used to run a self-test on each device before registering it. Although this was never included in-tree, some functions have checks for this special case which is not really possible. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
* sfc: Remove obsolete function efx_dev_name()Ben Hutchings2012-01-271-9/+0
| | | | Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
* sfc: Update the description of SFC_MTDBen Hutchings2012-01-271-3/+3
| | | | | | | SFC4000 boards also have an EEPROM exposed as MTD. The boot configuration is accessed through MTD. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
* sfc: Add hwmon driver for boards using SFC9000-family controllersBen Hutchings2012-01-277-44/+471
| | | | | | | | | | | | | | The SFC9000-family controllers have firmware to manage all board peripherals including temperature, heat sink continuity and voltage sensors. The firmware reports sensor alarms, which we log, and will shut down the board if necessary. Some users may want to monitor their boards more closely, so add an hwmon driver that exposes all sensors reported by the firmware. Move efx_mcdi_sensor_event() into the new file so it can share the array of sensor labels with the hwmon driver. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
* sfc: Clean up test interrupt handlingBen Hutchings2012-01-275-28/+36
| | | | | | | | | | | | | | | | | | | Interrupts are normally generated by the event queues, moderated by timers. However, they may also be triggered by detection of a 'fatal' error condition (e.g. memory parity error) or by the host writing to certain CSR fields as part of a self-test. The IRQ level/index used for these on Falcon rev B0 and Siena is set by the KER_INT_LEVE_SEL field and cached by the driver in efx_nic::fatal_irq_level. Since this value is also relevant to self-tests rename the field to just 'irq_level'. Avoid unnecessary cache traffic by using a per-channel 'last_irq_cpu' field and only writing to the per-controller field when the interrupt matches efx_nic::irq_level. Remove the volatile qualifier and use ACCESS_ONCE in the places we read these fields. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
* Partly revert "sfc: Handle serious errors in exactly one interrupt handler"Ben Hutchings2012-01-271-8/+5
| | | | | | | | | | | | | | | This reverts commit 6369545945b90daa1a73fca174da9194c398417c in drivers/net/ethernet/sfc/falcon.c. Unlike the INT_ISR0 register on later controller revisions, the NET_IVEC_INT_Q bits written to memory are only ever set for interrupting event queues, not for any other interrupt sources. By definition there can only be one legacy interrupt handler per function, so there is no need to worry about detecting a fatal interrupt more than once. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
* sfc: Remove dependence on NAPI polling in efx_test_eventq_irq()Ben Hutchings2012-01-273-44/+40
| | | | | | | | | | | | | | | | | We cannot safely assume that the NAPI handler will complete within the 20 ms that we allow for the event self-test. The handler may be deferred for longer than this, particularly on realtime kernels. Instead, check whether either an event has been handled or (as in the old failure path) whether an interrupt has been received and an event has been delivered but not yet handled. Use napi_disable() to synchronize with the NAPI handler before checking, since it will clear events before updating eventq_read_ptr. Remove the test result chan.N.eventq.poll, since it is not an error if the NAPI handler does not run during the test. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
* sfc: Correct interrupt timer quantum for Siena (normal and turbo mode)Ben Hutchings2012-01-275-17/+40
| | | | | | | | | | | | | | | | We currently assume that the timer quantum for Siena is 5 us, the same as for Falcon. This is not correct; timer ticks are generated on a rota which takes a minimum of 768 cycles (each event delivery or other timer change will delay it by 3 cycles). The timer quantum should be 6.144 or 3.072 us depending on whether turbo mode is active. Replace EFX_IRQ_MOD_RESOLUTION with a timer_quantum_ns field in struct efx_nic, initialised by the efx_nic_type::probe function. While we're at it, replace EFX_IRQ_MOD_MAX with a timer_period_max field in struct efx_nic_type. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
* sfc: Support extraction of CAPABILITIES from GET_BOARD_CFG response.Matthew Slattery2012-01-274-4/+12
| | | | Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
* sfc: Consistently test DEBUG macro, not EFX_ENABLE_DEBUGBen Hutchings2012-01-274-7/+4
| | | | | | | | | | | | | | | | | | The netif_dbg() macro is defined in <linux/netdevice.h>. If the DEBUG macro is defined, it logs a message at 'debug' level, otherwise it does nothing. In net_driver.h we define DEBUG if EFX_ENABLE_DEBUG is defined, but this is too late for those source files that already got a definition of netif_dbg() by including <linux/netdevice.h> Get rid of EFX_ENABLE_DEBUG, and only define and test DEBUG. In mtd.c, we do not use DEBUG as a condition flag but are forced to use the DEBUG macro-function from <linux/mtd/mtd.h>. Undefine DEBUG before including it. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
* sfc: Remove efx_nic_type::push_multicast_hash operationBen Hutchings2012-01-275-23/+9
| | | | | | | | | | | | Both implementations of efx_nic_type::reconfigure_mac operation push the multicast hash filter to the hardware. It is therefore redundant to call efx_nic_type::push_multicast_hash as well. efx_mcdi_mac_reconfigure() also uses this operation, but the implementation for Siena just uses MCDI anyway. Merge that into efx_mcdi_mac_reconfigure(). Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
* sfc: Merge efx_mcdi_mac_check_fault() and efx_mcdi_get_mac_faults()Ben Hutchings2012-01-271-18/+7
| | | | | | | | The latter is only called by the former, which is a very short wrapper. Further, gcc 4.5 may currently wrongly warn that the 'faults' variable may be used uninitialised. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
* sfc: Merge efx_mac_operations into efx_nic_typeBen Hutchings2012-01-2711-81/+35
| | | | | | | | | | | | | | | | | | | No NICs need to switch efx_mac_operations at run-time, and the MAC operations are fairly closely bound to NIC types. Move efx_mac_operations::reconfigure to efx_nic_type::reconfigure_mac and efx_mac_operations::check_fault fo efx_nic_type::check_mac_fault. Change callers to call through efx->type or directly if the NIC type is known. Remove efx_mac_operations::update_stats. The implementations for Falcon used to fetch MAC statistics synchronously and this was used by efx_register_netdev() to clear statistics after running self-tests. However, it now only converts statistics that have already been fetched (and that only for Falcon), and the call from efx_register_netdev() has no effect. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
* sfc: Hold efx_nic::stats_lock while reading efx_nic::mac_statsBen Hutchings2012-01-273-3/+9
| | | | | | | | | | | | efx_nic::stats_lock is used to serialise stats updates, but each reader was dropping it before it finished reading efx_nic::mac_stats. If there were concurrent stats reads using procfs, or one using procfs and one using ethtool, an update could race with a read. On a 32-bit system, the reader could see word-tearing of 64-bit stats (32 bits of the old value and 32 bits of the new). Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
* sfc: Use new names for MC shared memory layout constantsBen Hutchings2012-01-271-10/+4
| | | | | | These are defined alongside the firmware protocol in mcdi_pcol.h. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
* sfc: Make handling of MC reboot more reliableBen Hutchings2012-01-271-6/+27
| | | | | | | | | | | | | | | | | | | | When the MC reboots, either as part of a firmware upgrade or due to a bug, it attempts to complete (with an error) any requests that were outstanding before the reboot. Since there is an inherent race condition in checking this, it will also write to a status word in shared memory. If we look at each of these separately, we may detect each reboot twice, resulting in a spurious command failure after a firmware upgrade or frustrating recovery from a firmware bug. Instead, if a request completion indicates a reboot, we must poll and clear the status word. This bug was previously masked by use of an incorrect address for the status word. Fix that, using the definition now included in mcdi_pcol.h. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
* sfc: Remove fallback for invalid permanent MAC addressBen Hutchings2012-01-271-30/+2
| | | | | | | | | | By the time we look at the MAC address in efx_probe_port(), either the driver or the firmware has already validated the board configuration. The possibility of having an invalid MAC address just isn't worth considering. It certainly isn't worth having a compile-time option for this. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
* sfc: Set default parallelism to per-core by defaultBen Hutchings2012-01-091-7/+7
| | | | | | | | | The previous default of per-package can be more CPU-efficient, but users generally seem to prefer per-core. It should also allow accelerated RFS to direct packets more precisely, if IRQ affinity is properly spread out. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
* sfc: Rename efx_wanted_channels() to efx_wanted_parallelism()Ben Hutchings2012-01-091-4/+2
| | | | | | | This function returns the degree of parallelism wanted, which is not necessarily the total number of channels we want to create. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
* sfc: Update MCDI (firmware interface) definitionsBen Hutchings2012-01-095-1491/+2119
| | | | | | | Some commands and constants have been renamed; adjust the code accordingly. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
* sfc: Remove unnecessary inclusion of <asm/io.h>, prompted by checkpatchBen Hutchings2012-01-091-1/+0
| | | | | | | | | | Fix the warning: WARNING: Use #include <linux/io.h> instead of <asm/io.h> There is no need for selftest.c to include the file at all. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
* sfc: Const-qualify static data as appropriate, partly prompted by checkpatchBen Hutchings2012-01-099-22/+22
| | | | | | | | | | | | Fix the following warnings: WARNING: struct dev_pm_ops should normally be const WARNING: static const char * array should probably be static const char * const Similarly const-qualify struct i2c_board_info, struct i2c_algo_bit_data, struct efx_ethtool_stat, struct efx_mtd_ops and struct siena_nvram_type_info. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
* sfc: Remove parentheses around return expressions, reported by checkpatchBen Hutchings2012-01-051-8/+7
| | | | | | | | Fix the following error: ERROR: return is not a function, parentheses are not required Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
* sfc: Avoid assignment in an if-statement, reported by checkpatchBen Hutchings2012-01-051-3/+5
| | | | | | | | Fix the following error: ERROR: do not use assignment in if condition Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
* sfc: Fix some formatting errors reported by checkpatchBen Hutchings2012-01-0512-30/+30
| | | | | | | | | | Fix the following errors and warnings: ERROR: trailing whitespace ERROR: spaces required around that '=' (ctx:VxV) WARNING: please, no space before tabs Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
* ipv6/addrconf: speedup /proc/net/if_inet6 fillingMihai Maruseac2012-01-041-15/+28
| | | | | | | | | | | | | | | | | | | | | | | | | This ensures a linear behaviour when filling /proc/net/if_inet6 thus making ifconfig run really fast on IPv6 only addresses. In fact, with this patch and the IPv4 one sent a while ago, ifconfig will run in linear time regardless of address type. IPv4 related patch: f04565ddf52e401880f8ba51de0dff8ba51c99fd dev: use name hash for dev_seq_ops ... Some statistics (running ifconfig > /dev/null on a different setup): iface count / IPv6 no-patch time / IPv6 patched time / IPv4 time ---------------------------------------------------------------- 6250 | 0.23 s | 0.13 s | 0.11 s 12500 | 0.62 s | 0.28 s | 0.22 s 25000 | 2.91 s | 0.57 s | 0.46 s 50000 | 11.37 s | 1.21 s | 0.94 s 128000 | 86.78 s | 3.05 s | 2.54 s Signed-off-by: Mihai Maruseac <mmaruseac@ixiacom.com> Cc: Daniel Baluta <dbaluta@ixiacom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* r6040: place comments before codeFlorian Fainelli2012-01-041-3/+4
| | | | | | | | checkpatch.pl complained about the line exceding 80 columns, and the comment was actually on the same line as the code, fix that. Signed-off-by: Florian Fainelli <florian@openwrt.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* r6040: use __aligned(size)Florian Fainelli2012-01-041-1/+1
| | | | | | | instead of __attribute__((__aligned(size)__)) Signed-off-by: Florian Fainelli <florian@openwrt.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* r6040: use definitions for MAC_SM register read/writesFlorian Fainelli2012-01-041-2/+3
| | | | | | | | Bit 1 is the reset bit of the MAC status machine register, define and use it. Signed-off-by: Florian Fainelli <florian@openwrt.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* r6040: use MAC_RST bit definition with MCR1 read/writesFlorian Fainelli2012-01-041-3/+3
| | | | | | | MAC_RST bit is already defined, use it instead of 0x1 where applicable. Signed-off-by: Florian Fainelli <florian@openwrt.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* r6040: define more MCR0 register bitsFlorian Fainelli2012-01-041-3/+6
| | | | | | | Define more MCR0-register bits and use them in place of the bits values. Signed-off-by: Florian Fainelli <florian@openwrt.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* r6040: remove unused variables and definitionsFlorian Fainelli2012-01-041-13/+1
| | | | | | | | Since the conversion to phylib (3831861b: r6040: implement phylib) some PHY-related variables and definitions are now useless, remove them. Signed-off-by: Florian Fainelli <florian@openwrt.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* r6040: use an unique MDIO bus nameFlorian Fainelli2012-01-041-1/+2
| | | | | | | | | | We should use an unique MDIO bus name which does not clash with anything else in the system like the Fixed MDIO bus. The bus is now named: r6040-<card number> which is unique in the system. Reported-by: Vladimir Kolpakov <vova.kolpakov@gmail.com> Signed-off-by: Florian Fainelli <florian@openwrt.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* ipv6: Check RA for sllao when configuring optimistic ipv6 address (v2)Neil Horman2012-01-043-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Recently Dave noticed that a test we did in ipv6_add_addr to see if we next hop route for the interface we're adding an addres to was wrong (see commit 7ffbcecbeed91e5874e9a1cfc4c0cbb07dac3069). for one, it never triggers, and two, it was completely wrong to begin with. This test was meant to cover this section of RFC 4429: 3.3 Modifications to RFC 2462 Stateless Address Autoconfiguration * (modifies section 5.5) A host MAY choose to configure a new address as an Optimistic Address. A host that does not know the SLLAO of its router SHOULD NOT configure a new address as Optimistic. A router SHOULD NOT configure an Optimistic Address. This patch should bring us into proper compliance with the above clause. Since we only add a SLAAC address after we've received a RA which may or may not contain a source link layer address option, we can pass a pointer to that option to addrconf_prefix_rcv (which may be null if the option is not present), and only set the optimistic flag if the option was found in the RA. Change notes: (v2) modified the new parameter to addrconf_prefix_rcv to be a bool rather than a pointer to make its use more clear as per request from davem. Signed-off-by: Neil Horman <nhorman@tuxdriver.com> CC: "David S. Miller" <davem@davemloft.net> CC: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* net_sched: sfq: always randomize hash perturbationEric Dumazet2012-01-041-6/+6
| | | | | | | | | | | | | | SFQ q->perturbation is used in sfq_hash() as an input to Jenkins hash. We currently randomize this 32bit value only if a perturbation timer is setup. Its much better to always initialize it to defeat attackers, or else they can predict very well what kind of packets they have to forge to hit a particular flow. Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net_sched: sfq: fix mem alloc error recoveryEric Dumazet2012-01-041-19/+33
| | | | | | | | | | | | | | Since commit 817fb15dfd98 (net_sched: sfq: allow divisor to be a parameter), we can leave perturbation timer armed if a memory allocation error aborts sfq_init(). Memory containing active struct timer_list is freed and kernel can crash. Call sfq_destroy() from sfq_init() to properly dismantle qdisc. Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* ethtool: Remove ethtool_ops::set_rx_ntuple operationBen Hutchings2012-01-042-59/+0
| | | | | | | | All implementations have been converted to implement set_rxnfc instead. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* sfc: Remove now-unused filter functionBen Hutchings2012-01-042-48/+0
| | | | | Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* sfc: Implement ethtool RX NFC rules API instead of n-tuple APIBen Hutchings2012-01-041-39/+149
| | | | | Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* sfc: Add support for retrieving and removing filters by IDBen Hutchings2012-01-043-0/+266
| | | | | | | | These new functions will support an implementation of the ethtool RX NFC rules API. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* sfc: Use consistent types for filter IDs, indices and search depthsBen Hutchings2012-01-042-8/+8
| | | | | | | | | | | Filter IDs are u32 (but never very large) so an ID/error return value should have type s32. Filter indices and search depths are never negative, so should have type unsigned int. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* sfc: Change filter ID generation to satisfy priority semantics of RX NFCBen Hutchings2012-01-042-5/+43
| | | | | | | | Also add note that the efx_filter_spec::priority field has nothing to do with priority between multiple matching filters. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* ethtool: Allow drivers to select RX NFC rule locationsBen Hutchings2012-01-043-4/+35
| | | | | | | | | | | | | | Define special location values for RX NFC that request the driver to select the actual rule location. This allows for implementation on devices that use hash-based filter lookup, whereas currently the API is more suited to devices with TCAM lookup or linear search. In ethtool_set_rxnfc() and the compat wrapper ethtool_ioctl(), copy the structure back to user-space after insertion so that the actual location is returned. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* gianfar: Reject out-of-range RX NFC locationsBen Hutchings2012-01-041-2/+3
| | | | | | | | | | | Currently the driver only uses location values to maintain an ordered list of filters. Make it reject location values >= MAX_FILER_IDX passed to the ETHTOOL_SRXCLSRLINS command, consistent with the range it reports for the ETHTOOL_GRXCLSRLALL command. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Acked-by: Sebastian Pöhn <sebastian.poehn@googlemail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net/smsc911x: Check if PHY is in operational mode before software resetJavier Martinez Canillas2012-01-031-0/+92
| | | | | | | | | | | | | | | | | | | | | SMSC LAN generation 4 chips integrate an IEEE 802.3 ethernet physical layer. The PHY driver for this integrated chip enable an energy detect power-down mode. When the PHY is in a power-down mode, it prevents the MAC portion chip to be software reseted. That means that if we compile the kernel with the configuration option SMSC_PHY enabled and try to bring the network interface up without an cable plug-ed the PHY will be in a low power mode and the software reset will fail returning -EIO to user-space: root@igep00x0:~# ifconfig eth0 up ifconfig: SIOCSIFFLAGS: Input/output error This patch disable the energy detect power-down mode before trying to software reset the LAN chip and re-enables after it was reseted successfully. Signed-off-by: Javier Martinez Canillas <javier@dowhile0.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: phy: smsc: Move SMSC PHY constants to <linux/smscphy.h>Javier Martinez Canillas2012-01-033-20/+30
| | | | | | | | | | | | SMSC generation 4 LAN chips integrate an IEEE 802.3 ethernet physical layer. The ethernet driver for this family of devices needs to access the SMSC PHY registers and bit-fields. So, this patch moves these constants to a place where it can be used for both the PHY and LAN drivers. Signed-off-by: Javier Martinez Canillas <javier@dowhile0.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* Merge branch 'master' of ↵John W. Linville2012-01-03179-6435/+7880
|\ | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem Conflicts: drivers/net/wireless/b43/dma.c drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c
| * Merge branch 'master' of ↵John W. Linville2012-01-0221-459/+496
| |\ | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/padovan/bluetooth-next
| | * Bluetooth: Fix a compile warning in RFCOMMGustavo F. Padovan2011-12-271-3/+0
| | | | | | | | | | | | | | | | | | sock and sk were leftover from another change. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
| | * Bluetooth: Incorrect address while storing LTK.Hemant Gupta2011-12-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes incorrect address storage while storing Long Term Key for LE Devices using SMP (Security Manager Protocol). The address stored should be of remote device and not of source device. Signed-off-by: Hemant Gupta <hemant.gupta@stericsson.com> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
OpenPOWER on IntegriCloud