Commit Graph

158152 Commits

Author SHA1 Message Date
Stephen Hemminger 6fef4c0c8e netdev: convert pseudo-devices to netdev_tx_t
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-09-01 01:13:07 -07:00
Stephen Hemminger dc1f8bf68b netdev: change transmit to limited range type
The transmit function should only return one of three possible values,
some drivers got confused and returned errno's or other values.
This changes the definition so that this can be caught at compile time.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-09-01 01:13:03 -07:00
Vasanthakumar Thiagarajan 1c29ce672f ath9k: Do an AHB reset before doing RTC reset
Doing an RTC reset when DMA is active may corrupt memory,
make sure no DMA is active at this moment by doing an
AHB reset.

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-08-31 14:42:15 -04:00
Randy Dunlap 3107edbae8 ipw2200: fix kconfig dependencies
Fix kconfig dependencies for ipw2x00 drivers, fixes build errors:

ERROR: "wiphy_free" [drivers/net/wireless/ipw2x00/libipw.ko] undefined!
ERROR: "wiphy_unregister" [drivers/net/wireless/ipw2x00/libipw.ko] undefined!
ERROR: "wiphy_new" [drivers/net/wireless/ipw2x00/libipw.ko] undefined!
ERROR: "cfg80211_wext_giwname" [drivers/net/wireless/ipw2x00/ipw2200.ko] undefined!
ERROR: "wiphy_register" [drivers/net/wireless/ipw2x00/ipw2200.ko] undefined!

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-08-31 14:42:14 -04:00
Ivo van Doorn daee6c092a rt2x00: Reorganize padding & L2 padding
The old function rt2x00queue_payload_align() handled
both adding and removing L2 padding and some basic
frame alignment. The entire function was being abused
because it had multiple functions and the header length
argument was somtimes used to align the header instead
of the payload.

Additionally there was a bug when inserting L2 padding
that only the payload was aligned but not the header. This
happens when the header wasn't aligned properly by mac80211,
but rt2x00lib only moves the payload.

A secondary problem was that when removing L2 padding during
TXdone or RX the skb wasn't resized to the proper size.

Split the function into seperate functions each handling
its task as it should.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-08-31 14:42:14 -04:00
Ivo van Doorn 2e27cff871 rt2x00: Fix TX status reporting
Not all values of the TX status enumeration were
covered during updating of the TX statistics. This
could lead to wrong bitrate tuning but also wrong
behavior in tools like hostapd.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-08-31 14:42:14 -04:00
Gábor Stefanik 1ee50cd9a2 b43: LP-PHY: Fix TX gain tables
The rev1 2GHz and rev2 5GHz gain tables were incorrectly documented
on the specs originally. Update these gaintables to match the cor-
rected specs.

Signed-off-by: Gábor Stefanik <netroller.3d@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-08-31 14:42:13 -04:00
Gábor Stefanik c71dbd3316 b43: Fix typo in modparam_btcoex description
Signed-off-by: Gábor Stefanik <netrolller.3d@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-08-31 14:42:13 -04:00
Gábor Stefanik 0136e51edb b43: Add myself to module authors & to LP-PHY file copyright notices
Also mark the LP-PHY driver "802.11a/g" instead of "802.11g",
as LP-PHY is capable of both 2GHz and 5GHz operation.

Signed-off-by: Gábor Stefanik <netrolller.3d@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-08-31 14:42:13 -04:00
Gábor Stefanik c206a39d58 b43: Refactor and update antenna diversity for A/G-PHY
-Make use of the b43_phy_set/mask/maskset helpers.
-Fix a few errors in the code.
-Make the code more readable.

Signed-off-by: Gábor Stefanik <netrolller.3d@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-08-31 14:42:12 -04:00
Reinette Chatre af472a953e iwl3945: reduce debug noise when default debug flags used
Significant literature suggests users use debug flags 0x43fff - this causes
the debug flags to be set that causes information to be printed for every
received frame - including beacons. In the best case it fills up the logs,
at worst it slows driver down and causes failures due to timeouts.

In the RX handler, print debugging only if user requested RX debugging.

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-08-31 14:42:11 -04:00
Reinette Chatre b57d46aa0d iwlwifi: fix situation in which debug message is printed
3945 does not have update_chain_flags defined and because if this we always
see the debug message that does not apply to it. Add a check to be specific
about what is actually happening.

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-08-31 14:42:10 -04:00
Johannes Berg 4c561a0229 iwlwifi: use sleep interval succession
Some concerns were raised about the automatic adjustment
of sleep intervals to all the same, potentially high,
value, and I can imagine the hardware behaving better
when we don't ask too much of it.

So let's convert to use a succession of sleep levels
when requesting to go to deeper sleeps (which can only
happen with large DTIM intervals), using the succession
values from power level three, which have the benefit of
also having been tested extensively already.

As a result, the automatic sleep level adjustment will
now be mostly equivalent to power level three, except
for the RX/TX timeouts and possibly using smaller sleep
vectors to account for networking latency.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-08-31 14:42:10 -04:00
Daniel C Halperin 31513be8a0 iwlwifi: use iwl_hwrate_get_mac80211_idx where appropriate
For HT packets, mac80211 expects the rate_idx to be an MCS number, which is the
lower byte of rate_n_flags.  However, iwl_hwrate_to_plcp_idx takes the MCS
number and reduces it down to the range 0-8 (6 to 60 Mbps), removing the bits
that signify multiply streams, HT40 Duplicate mode, or unequal modulation.
This version is used for various internal purposes through the driver.

Add the function iwl_hwrate_get_mac80211_idx, an alternate version which takes
the rate and the band and returns the mac80211 index (MCS, for HT packets, and
PLCP rate, for legacy packets).

Signed-off-by: Daniel C Halperin <daniel.c.halperin@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-08-31 14:42:10 -04:00
Daniel C Halperin b58ef214b7 iwlwifi: remove incorrect uses of ieee80211_get_tx_rate to prevent TX stall
Refactor and correct rate selection for outgoing transmitted
packets.

First, note that HT rates in the mac80211 rate table do not provide valid
indices when ieee80211_get_tx_rate is called; the check to see if we could to
abort a transmission early in iwl_tx_skb() would thus occasionally read invalid
memory and occasionally stall transmission (if the erroneous byte was 0xff).
We remove that code; the check wasn't valid anyway.

Second, iwl_tx_cmd_build_rate() also called ieee80211_get_tx_rate to be used
for sending management packets, which do not use the uCode station table.  This
patch refactors that function and adds comments to enhance legibility, replaces
the call to ieee80211_get_tx_rate() with a direct lookup, and adds error
handling in case the table entry is invalid.

Signed-off-by: Daniel C Halperin <daniel.c.halperin@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-08-31 14:42:09 -04:00
Daniel C Halperin 5027309b55 iwlwifi: remove 60 Mbps from sband bitrates table
ieee80211_supported_band is supposed to only contain legacy rates in the
bitrates table (HT rates go in the ieee80211_sta_ht_cap substruct).  Make
iwlwifi driver obey this restriction by removing the 60 Mbps rate. Also, clean
up a few pieces of other code that formerly relied on 60 Mbps being in
sband->bitrates.

Signed-off-by: Daniel C Halperin <daniel.c.halperin@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-08-31 14:42:09 -04:00
Joe Perches 9e39f7c5b3 s2io: Generate complete messages using single line DBG_PRINTs
Single line log messages should be emitted by a single call
where possible.

Converted multiple calls to DBG_PRINT to single call form.
Removed "s2io:" preface from DBG_PRINTs.

The DBG_PRINT macro now emits a log level and is surrounded by
a do {...} while (0)

All s2io log output is now prefaced with KBUILD_MODNAME ": "
via pr_fmt.

The DBG_PRINT macro should probably be converted to use the
dev_<level> form eventually.

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Sreenivasa Honnur <sreenivasa.honnur@neterion.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-30 22:35:11 -07:00
Joe Perches 82c2d02356 s2io.c: Convert skipped nic->config.tx_cfg[i]. to tx_cfg->
Missed doing the conversion in earlier patch.

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Sreenivasa Honnur <sreenivasa.honnur@neterion.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-30 22:35:08 -07:00
Joe Perches ffb5df6ce7 s2io.c: Standardize statistics accessors
Regularize the declaration and uses of
	struct config_param *config = &sp->config;
	struct mac_info *mac_control = &sp->mac_control;
and use
	struct stat_block *stats = mac_control->stats_info;
	struct swStat *swstats = &stats->sw_stat;
	struct xpakStat *xstats = &stats->xpak_stat;
and convert the longish uses like
	nic->mac_control.stats_info->sw_stat.<foo>
to
	swstats-><foo>
etc.

This also makes the statistics code marginally smaller
and presumably faster.

Old:
$ size s2io.o
   text	   data	    bss	    dec	    hex	filename
 114289	    516	  33360	 148165	  242c5	s2io.o
New:
$ size s2io.o
   text	   data	    bss	    dec	    hex	filename
 114097	    516	  33360	 147973	  24205	s2io.o

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Sreenivasa Honnur <sreenivasa.honnur@neterion.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-30 22:35:06 -07:00
Joe Perches a2a20aef44 s2io.c: fix spelling explaination
Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Sreenivasa Honnur <sreenivasa.honnur@neterion.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-30 22:35:01 -07:00
Joe Perches 6cef2b8eb7 s2io.c: convert printks to pr_<level>
Fixed trivial typo as well

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Sreenivasa Honnur <sreenivasa.honnur@neterion.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-30 22:34:55 -07:00
Joe Perches d44570e406 s2io.c: Make more conforming to normal kernel style
Still has a few long lines.

checkpatch was:
	total: 263 errors, 53 warnings, 8751 lines checked
is:
	total: 4 errors, 35 warnings, 8767 lines checked

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Sreenivasa Honnur <sreenivasa.honnur@neterion.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-30 22:34:51 -07:00
Joe Perches 44364a035a s2io.c: use kzalloc
Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Sreenivasa Honnur <sreenivasa.honnur@neterion.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-30 22:34:46 -07:00
Joe Perches 4f87032021 s2io.c: Use calculated size in kmallocs
Use consistent style.  Don't calculate the kmalloc size multiple times

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Sreenivasa Honnur <sreenivasa.honnur@neterion.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-30 22:34:43 -07:00
Joe Perches 13d866a9c9 s2io.c: Shorten code line length by using intermediate pointers
Repeated variable use and line wrapping is hard to read.
Use temp variables instead of direct references.

struct fifo_info *fifo = &mac_control->fifos[i];
struct ring_info *ring = &mac_control->rings[i];
struct tx_fifo_config *tx_cfg = &config->tx_cfg[i];
struct rx_ring_config *rx_cfg = &config->rx_cfg[i];

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Sreenivasa Honnur <sreenivasa.honnur@neterion.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-30 22:34:39 -07:00
Joe Perches 6fce365df8 s2io.c: Use const for strings
Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Sreenivasa Honnur <sreenivasa.honnur@neterion.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-30 22:34:36 -07:00
Krishna Kumar a453e0689a pkt_sched: Fix resource limiting in pfifo_fast
pfifo_fast_enqueue has this check:
        if (skb_queue_len(list) < qdisc_dev(qdisc)->tx_queue_len) {

which allows each band to enqueue upto tx_queue_len skbs for a
total of 3*tx_queue_len skbs. I am not sure if this was the
intention of limiting in qdisc.

Patch compiled and 32 simultaneous netperf testing ran fine. Also:
# tc -s qdisc show dev eth2
qdisc pfifo_fast 0: root bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
 Sent 16835026752 bytes 373116 pkt (dropped 0, overlimits 0 requeues 25) 
 rate 0bit 0pps backlog 0b 0p requeues 25 

Signed-off-by: Krishna Kumar <krkumar2@in.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-30 22:20:28 -07:00
Krishna Kumar 03a9a447d2 net: convert remaining non-symbolic return values in dev_queue_xmit
Patch compiled and 32 simultaneous netperf testing ran fine.

Signed-off-by: Krishna Kumar <krkumar2@in.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-30 22:16:57 -07:00
Krishna Kumar 7b3d3e4fc6 netdevice: Consolidate to use existing macros where available.
Patch compiled and 32 simultaneous netperf testing ran fine.

Signed-off-by: Krishna Kumar <krkumar2@in.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-30 22:16:20 -07:00
Oliver Hartkopp 6ca8b990e0 can: use correct NET_RX_ return values
Dropped skb's should be documented by an appropriate return value.
Use the correct NET_RX_DROP and NET_RX_SUCCESS values for that reason.

Signed-off-by: Oliver Hartkopp <oliver@hartkopp.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-30 22:13:18 -07:00
Toru UCHIYAMA 38bddf04bc gianfar: gfar_remove needs to call unregister_netdev()
This patch solves the problem that the Oops(BUG_ON) occurs by rmmod.

	# rmmod gianfar_driver
	------------[ cut here ]------------
	Kernel BUG at c01fec48 [verbose debug info unavailable]
	Oops: Exception in kernel mode, sig: 5 [#1]
	MPC837x MDS
	Modules linked in: gianfar_driver(-) usb_storage scsi_wait_scan
	NIP: c01fec48 LR: c01febf4 CTR: c01feba8
	REGS: dec5bd60 TRAP: 0700   Tainted: G        W   (2.6.31-rc2)
	MSR: 00029032 <EE,ME,CE,IR,DR>  CR: 22000424  XER: 20000000
	TASK = dec4cac0[1135] 'rmmod' THREAD: dec5a000
	GPR00: 00000002 dec5be10 dec4cac0 dfba1820 c035d444 c035d478 ffffffff 00000000
	GPR08: 0000002b 00000001 dfba193c 00000001 22000424 10019b34 1ffcb000 00000000
	GPR16: 10012008 00000000 bf82ebe0 100017ec bf82ebec bf82ebe8 bf82ebd0 00000880
	GPR24: 00000000 bf82ebf0 c03532f0 c03532e4 c036b594 dfba183c dfba1800 dfba1820
	NIP [c01fec48] free_netdev+0xa0/0xb8
	LR [c01febf4] free_netdev+0x4c/0xb8
	Call Trace:
	[dec5be10] [c01febf4] free_netdev+0x4c/0xb8 (unreliable)
	[dec5be30] [e105f290] gfar_remove+0x50/0x68 [gianfar_driver]
	[dec5be40] [c01ec534] of_platform_device_remove+0x30/0x44
	[dec5be50] [c0181760] __device_release_driver+0x68/0xc8
	[dec5be60] [c0181868] driver_detach+0xa8/0xac
	[dec5be80] [c0180814] bus_remove_driver+0x9c/0xd8
	[dec5bea0] [c0181efc] driver_unregister+0x60/0x98
	[dec5beb0] [c01ec650] of_unregister_driver+0x14/0x24
	[dec5bec0] [e10631bc] gfar_exit+0x18/0x4bc [gianfar_driver]
	[dec5bed0] [c0047584] sys_delete_module+0x16c/0x228
	[dec5bf40] [c00116bc] ret_from_syscall+0x0/0x38
	--- Exception: c01 at 0xff3669c
	    LR = 0x10000f34
	Instruction dump:
	409e0024 a07e00c0 7c63f050 4be74429 80010024 bba10014 38210020 7c0803a6
	4e800020 68000003 3160ffff 7d2b0110 <0f090000> 38000004 387e01f0 901e01d4
	---[ end trace 8c595bcd37230a0f ]---
	 localhost kernel: ------------[ cut here ]------------

Signed-off-by: Toru UCHIYAMA uchiyama.toru@jp.fujitsu.com
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-30 22:04:07 -07:00
roel kluin 5de3fcab91 WAN: bit and/or confusion
Fix the tests that check whether Frame* bits are not set

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-30 22:02:26 -07:00
Anton Vorontsov 2394905f67 ucc_geth: Implement suspend/resume and Wake-On-LAN support
This patch implements suspend/resume and WOL support for UCC Ethernet
driver.

We support two wake up events: wake on PHY/link changes and wake
on magic packet.

In some CPUs (like MPC8569) QE shuts down during sleep, so magic packet
detection is unusable, and also on resume we should fully reinitialize
UCC structures.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-30 21:51:47 -07:00
Anton Vorontsov bf5aec2e79 ucc_geth: Remove UGETH_MAGIC_PACKET Kconfig symbol and code
This patch removes currently unused UGETH_MAGIC_PACKET Kconfig symbol
and code, i.e. magic_packet_detection_{enable,disable} functions.

The two functions each contain just two steps that we'll place into
suspend/resume code path under CONFIG_PM.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-30 21:51:43 -07:00
Anton Vorontsov 54b1598384 ucc_geth: Factor out MAC initialization steps into a call
This patch factors out MAC initialization into ucc_geth_init_mac()
function that we'll use for suspend/resume.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-30 21:51:37 -07:00
Anton Vorontsov ed24157ede powerpc/qe: Implement qe_alive_during_sleep() helper function
In some CPUs (i.e. MPC8569) QE shuts down completely during sleep,
drivers may want to know that to reinitialize registers and buffer
descriptors.

This patch implements qe_alive_during_sleep() helper function, so far
it just checks if MPC8569-compatible power management controller is
present, which is a sign that QE turns off during sleep.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-30 21:51:33 -07:00
Anton Vorontsov e0ad2cd8ff ucc_geth: Fix NULL pointer dereference in uec_get_ethtool_stats()
In commit 3e73fc9a12 ("ucc_geth: Fix IO
memory (un)mapping code") I fixed ug_regs IO memory leak by properly
freeing the allocated memory. But ethtool_stats() callback doesn't
check for ug_regs being NULL, and that causes following oops if
'ethtool -S' is executed on a closed eth device:

  Unable to handle kernel paging request for data at address 0x00000180
  Faulting instruction address: 0xc0208228
  Oops: Kernel access of bad area, sig: 11 [#1]
  ...
  NIP [c0208228] uec_get_ethtool_stats+0x38/0x140
  LR [c02559a0] ethtool_get_stats+0xf8/0x23c
  Call Trace:
  [ef87bcd0] [c025597c] ethtool_get_stats+0xd4/0x23c (unreliable)
  [ef87bd00] [c025706c] dev_ethtool+0xfe8/0x11bc
  [ef87be00] [c0252b5c] dev_ioctl+0x454/0x6a8
  ...
  ---[ end trace 77fff1162a9586b0 ]---
  Segmentation fault

This patch fixes the issue.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-30 21:51:29 -07:00
David S. Miller b9caaabb99 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/holtmann/bluetooth-next-2.6 2009-08-30 21:30:39 -07:00
Matt Carlson fc57e515a2 tg3: Update version to 3.101
This patch updates the tg3 version to 3.101.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-29 15:43:06 -07:00
Matt Carlson f3f3f27e5b tg3: Move per-int tx members to a per-int struct
This patch moves the tx_prod, tx_cons, tx_pending, tx_ring, and
tx_buffers transmit ring device members to a per-interrupt structure.
It also adds a new transmit producer mailbox member (prodmbox) and
converts the code to use it rather than a preprocessor constant.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-29 15:43:04 -07:00
Matt Carlson 723344820a tg3: Move per-int rx members to per-int struct
This patch moves the rx_rcb, rx_rcb_mapping, and rx_rcb_ptr return ring
device members to a per-interrupt structure.  It also adds a new return
ring consumer mailbox register member (consmbox) and converts the code
to use it rather than a preprocessor constant.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-29 15:43:03 -07:00
Matt Carlson 898a56f8d8 tg3: Move general int members to a per-int struct
This patch moves the last_tag, last_tag_irq, and hw_status device
members to a per-interrupt structure.  It also adds a new interrupt
mailbox member (int_mbox) and converts the code to use it rather than a
direct preprocessor constant.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-29 15:43:01 -07:00
Matt Carlson 17375d25d3 tg3: Convert napi handlers to use tnapi
This patch converts the napi interrupt handler functions to accept and
use tg3_napi structures.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-29 15:42:59 -07:00
Matt Carlson 09943a1819 tg3: Convert ISR parameter to tnapi
This patch migrates the ISR parameter from struct net_device to struct
tg3_napi.  Checkpatch complains about the existence of the preexisting
IRQF_SAMPLE_RANDOM flag.  I've opted to keep this patch conservative and
let it continue to exist until the flag gets officially purged from the
kernel.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-29 15:42:58 -07:00
Matt Carlson 8ef0442f98 tg3: Move napi to per-int struct
This patch creates a per-interrupt data structure, moves the napi
member over, and creates a tg3 pointer back to the device structure.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-29 15:42:56 -07:00
Matt Carlson 07b0173cb5 tg3: Cleanup interrupt setup / teardown
Later patches will be adding MSIX support, which will complicate
interrupt initialization.  This patch prepares for the integration by
breaking out the interrupt setup and teardown code into separate
functions and cleaning up the error return paths.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-29 15:42:54 -07:00
Matt Carlson 79ed5ac7dd tg3: Use ext rx bds
The 5717 only uses extended buffer descriptors for the jumbo producer
ring.  Extended buffer descriptors are available on all devices that
support a separate jumbo producer ring so make the change universal.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-29 15:42:52 -07:00
Matt Carlson 21f581a536 tg3: Create a new prodring_set structure
This patch migrates most of the rx producer ring variables to a new
tg3_rx_prodring_set structure and modifies the code accordingly.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-29 15:42:50 -07:00
Matt Carlson cf7a7298c4 tg3: Create rx producer ring setup routines
Later patches are going to complicate the ring initialization routines.
This patch breaks out the setup and teardown of the rx producer rings
into separate functions to make the code more readable.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-29 15:42:47 -07:00
Matt Carlson 287be12e17 tg3: Clarify rx buffer relationships
This patch attempts to document the various rx buffer sizes used by the
driver and how they relate to each other.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-29 15:42:43 -07:00