Commit Graph

272 Commits (1338344a84f5ea60a6689127d2717845e8564b1a)

Author SHA1 Message Date
Ben Hutchings 1338344a84 sfc: Remove unused function efx_flush_queues()
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-26 15:59:23 -08:00
Ben Hutchings 127e6e10ad sfc: Fix bugs in RX queue flushing
Avoid overrunning the hardware limit of 4 concurrent RX queue flushes.
Expand the queue flush state to support this.  Make similar changes to
TX flushing to keep the code symmetric.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-26 15:59:19 -08:00
Ben Hutchings 44838a447d sfc: Clean up struct falcon_board and struct falcon_board_data
Put all static information in struct falcon_board_type and replace it
with a pointer in struct falcon_board.  Simplify probing aocordingly.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-26 15:59:16 -08:00
Ben Hutchings 734a350a6c sfc: Remove unused constant
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-26 15:59:11 -08:00
Ben Hutchings 8986352a32 sfc: Comment corrections
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-26 15:59:07 -08:00
Ben Hutchings 332c1ce9e7 sfc: Strengthen EFX_ASSERT_RESET_SERIALISED
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-26 15:59:04 -08:00
Ben Hutchings 80cb9a0f7f sfc: Treat all MAC registers as 128-bit
Although all the defined fields in these registers are within 32 bits,
they are architecturally defined as 128-bit like most other Falcon
registers.  In particular, we must use efx_reado() to ensure proper
locking when reading MD_STAT_REG.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-26 15:59:00 -08:00
Ben Hutchings 46e1ac0f42 sfc: Fix descriptor cache sizes
These were accidentally undersized by a factor of 2, which limited
performance.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-26 15:58:57 -08:00
Ben Hutchings c459302db6 sfc: Log interrupt and reset type names, not numbers
Define name tables for these enumerations in a similar way as for
loopback.  Move the loopback name table together with them.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-24 10:59:04 -08:00
Ben Hutchings f5e7adc3d4 sfc: Combine high-level header files
All files that include ethtool.h, rx.h or tx.h are also including
efx.h, and there is no good reason to separate out the few
declarations they contain.  Therefore fold them into efx.h.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-24 10:58:59 -08:00
Ben Hutchings 497f5ba323 sfc: Remove redundant efx_xmit() function
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-24 10:58:58 -08:00
Ben Hutchings 9bc183d7f9 sfc: Remove unnecessary casts to struct sk_buff *
At some point these casts were used to remove const qualification, but
they are now unneeded.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-24 10:58:55 -08:00
Ben Hutchings eb50c0d67f sfc: Gather link state fields in struct efx_nic into new struct efx_link_state
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-24 10:58:53 -08:00
Ben Hutchings e775fb93a8 sfc: Move all I2C stuff into struct falcon_board
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-24 10:58:52 -08:00
Ben Hutchings 3759433db2 sfc: Move struct falcon_board into struct falcon_nic_data
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-24 10:58:48 -08:00
Ben Hutchings 5c16a96c4f sfc: Move definition of struct falcon_nic_data into falcon.h
This is preparation for moving Falcon-specific state required by other
Falcon-specific code.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-24 10:58:44 -08:00
Ben Hutchings 278c0621fb sfc: Make board information explicitly Falcon-specific
Rename struct efx_board to struct falcon_board.

Introduce and use inline function to look up board info from struct
efx_nic, in preparation for moving it.

Move board init and fini calls into NIC probe and remove functions.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-24 10:58:42 -08:00
Ben Hutchings 981fc1b4b8 sfc: Rename efx_board::init_leds to init_phy and use for SFN4111T
efx_board::init_leds was introduced as a second stage of
initialisation because of the inter-dependency between the board and
PHY.  We want to move board initialisation into NIC probing, which is
too early to use MDIO, so SFN4111T initialisation also needs to be
split.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-24 10:58:40 -08:00
Ben Hutchings 398468ed1b sfc: Use a single blink implementation
Only some PHYs have firmware support for a LED blink mode, so we
currently blink the others in a timer function.  Since all PHYs have
simple on and off modes, we don't gain anything by using multiple
blink implementations.  Also, since we have a process context there
is no need to use a timer.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-24 10:58:39 -08:00
Ben Hutchings dcf477b2d2 sfc: SFT9001: Reset LED configuration correctly after blinking
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-24 10:58:33 -08:00
Ben Hutchings 3eadb7b0ec sfc: Record RX queue number on GRO path
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-24 10:58:33 -08:00
Ben Hutchings 1241e951af sfc: Move assertions and buffer cleanup earlier in efx_rx_packet_lro()
This removes the need to use a label and goto, and makes the two
branches mirror each other more closely.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-24 10:58:28 -08:00
Ben Hutchings 3139e62827 sfc: Remove ridiculously paranoid assertions
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-24 10:58:24 -08:00
Ben Hutchings d96d7dc9f1 sfc: Remove redundant gotos from __efx_rx_packet()
This function no longer has any common cleanup code.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-24 10:58:23 -08:00
Ben Hutchings 9e0c8a5bab sfc: Remove pointless abstraction of memory BAR number (2)
Finish the job by removing the structure member.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-24 10:58:22 -08:00
David S. Miller 3505d1a9fd Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
	drivers/net/sfc/sfe4001.c
	drivers/net/wireless/libertas/cmd.c
	drivers/staging/Kconfig
	drivers/staging/Makefile
	drivers/staging/rtl8187se/Kconfig
	drivers/staging/rtl8192e/Kconfig
2009-11-18 22:19:03 -08:00
Jean Delvare afa08974fe i2c: Add an interface to lock/unlock an I2C bus segment
Some drivers need to be able to prevent access to an I2C bus segment
for a specific period of time. Add an interface for them to do so
without twiddling with i2c-core internals.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Ben Hutchings <bhutchings@solarflare.com>
2009-11-07 13:10:46 +01:00
Ben Hutchings c3c6336504 sfc: Enable heuristic selection between page and skb RX buffers
Now that we can tell whether GRO is being applied, this heuristic is
effective once more.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-29 21:37:07 -07:00
Ben Hutchings 18e1d2beb6 sfc: Feed GRO result into RX allocation policy and interrupt moderation
When GRO is successfully merging received packets, we should allocate
raw page buffers rather than skbs that will be discarded by GRO.
Otherwise, we should allocate skbs.

GRO also benefits from higher interrupt moderation, so increase the
score for mergeable RX packets.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-29 21:37:06 -07:00
David S. Miller 0519d83d83 Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2009-10-29 21:28:59 -07:00
Ben Hutchings 345056af41 sfc: Set ip_summed correctly for page buffers passed to GRO
Page buffers containing packets with an incorrect checksum or using a
protocol not handled by hardware checksum offload were previously not
passed to LRO.  The conversion to GRO changed this, but did not set
the ip_summed value accordingly.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-28 03:43:49 -07:00
Ben Hutchings 9c1bbbaf3e sfc: Really allow RX checksum offload to be disabled
We have never checked the efx_nic::rx_checksum_enabled flag everywhere
we should, and since the switch to GRO we don't check it anywhere.
It's simplest to check it in the one place where we initialise the
per-packet checksummed flag.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-28 02:50:44 -07:00
Ben Hutchings b37b62fea1 sfc: Rename 'xfp' file and functions to reflect reality
The 'XFP' driver is really a driver for the QT2022C2 and QT2025C PHYs,
covering both more and less than XFP.  Rename its functions and
constants to reflect reality and to reduce namespace pollution when
sfc is a built-in driver.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-24 04:27:28 -07:00
Ben Hutchings fc2b5e673f sfc: Remove unused code for non-autoneg speed/duplex switching
The only multi-speed PHY driver using this is 10Xpress, and it does
not support non-autoneg operation.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-24 04:27:26 -07:00
Ben Hutchings 18ea024fd6 sfc: Merge efx_fc_resolve() into efx_mdio_get_pause()
efx_fc_resolve() is specific to MDIO and is not used by any other
function.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-24 04:27:25 -07:00
Ben Hutchings a5211bb5f7 sfc: Move MTD probe after netdev registration and name allocation
The MTD partition is named based on the netdev name, which is set to
'eth%d' before registration.  Also, the MTD partition will currently
be left registered if netdev registration fails.

Fix both these problems by moving the MTD probe after netdev
registration.  Hold the RTNL to serialise this with the netdev
notifier that calls efx_mtd_rename().

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-24 04:27:24 -07:00
Ben Hutchings 2ed380a59b sfc: Remove unnecessary tests of efx->membase
These cleanup functions will never be called if the MMIO region could
not be mapped.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-24 04:27:23 -07:00
Ben Hutchings be4b163b28 sfc: Remove incorrect assertion from efx_pci_remove_main()
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-24 04:27:22 -07:00
Ben Hutchings 96c45726c7 sfc: Merge falcon_probe_phy() into falcon_probe_port()
MAC and PHY probing are bound up together, as evidenced by the
initialisation of efx_nic::loopback_modes.  Remove the current
arbitrary separation.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-24 04:27:18 -07:00
Ben Hutchings dc803df8dd sfc: Remove pointless abstraction of memory BAR number
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-24 04:27:18 -07:00
Ben Hutchings 8698a6b642 sfc: Removed kernel-doc for nonexistent member of efx_phy_operations
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-24 04:27:17 -07:00
Ben Hutchings 0d86ebd815 sfc: Maintain interrupt moderation values in ticks, not microseconds
This simplifies the implementation a lot.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-24 04:27:15 -07:00
Ben Hutchings 0484e0db7c sfc: Move shared members of struct falcon_nic_data into struct efx_nic
These will also be used with Siena NICs.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-24 04:27:14 -07:00
Ben Hutchings 59cf09cc2f sfc: Move efx_xmit_done() declaration into correct stanza
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-24 04:27:13 -07:00
Ben Hutchings 5c86987e86 sfc: Remove declarations of nonexistent functions
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-24 04:27:13 -07:00
Ben Hutchings f01865f064 sfc: Change order of device removal to reverse of probe order
This makes efx_pci_remove_main() more obviously the inverse of
efx_pci_probe_main(), and matches our out-of-tree driver.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-24 04:27:12 -07:00
Ben Hutchings 7d4cdb5af0 sfc: Merge struct efx_blinker into struct efx_board
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-24 04:27:08 -07:00
Ben Hutchings 63f1988419 sfc: Move all TX DMA length limiting into tx.c
Replace the duplicated logic in efx_enqueue_skb() and
efx_tx_queue_insert() with an inline function, efx_max_tx_len().

Remove the failed attempt at abstracting hardware-specifics and put
all the magic numbers in efx_max_tx_len().

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-24 04:27:07 -07:00
Ben Hutchings 6d51d30750 sfc: Define DMA address mask explicitly in terms of descriptor field width
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-24 04:27:06 -07:00
Ben Hutchings 3ffeabdd2b sfc: Eliminate indirect lookups of queue size constants
Move size and mask definitions into efx.h; calculate page orders in falcon.c.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-24 04:27:05 -07:00