Commit graph

329 commits

Author SHA1 Message Date
Mark Einon 6617c36987 staging: et131x: Fix et131x sparse warnings
This fixes the following warnings:

et1310_mac.c:375:44: warning: incorrect type in initializer (different address spaces)
et1310_mac.c:382:28: warning: incorrect type in argument 2 (different address spaces)
et1310_mac.c:384:31: warning: incorrect type in argument 2 (different address spaces)
et131x_initpci.c:555:5: warning: symbol 'et131x_mii_probe' was not declared. Should it be static?
et131x_netdev.c:267:5: warning: symbol 'et131x_ioctl' was not declared. Should it be static?
et131x_netdev.c:285:5: warning: symbol 'et131x_set_packet_filter' was not declared. Should it be static?
et131x_netdev.c:347:6: warning: symbol 'et131x_multicast' was not declared. Should it be static?
et131x_netdev.c:420:5: warning: symbol 'et131x_tx' was not declared. Should it be static?
et131x_netdev.c:453:6: warning: symbol 'et131x_tx_timeout' was not declared. Should it be static?
et131x_netdev.c:511:5: warning: symbol 'et131x_change_mtu' was not declared. Should it be static?
et131x_netdev.c:564:5: warning: symbol 'et131x_set_mac_addr' was not declared. Should it be static?

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-11 10:10:29 -06:00
Mark Einon b6f4160c4e staging: et131x: Remove file et131x_version.h
Removed defines in et131x_version.h and replaced them by actual
strings where convinient, or moved them to et131x.h

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-11 10:08:23 -06:00
Mark Einon f247be5d6b staging: et131x: Move pm calls from pci device to driver device
Move the pci driver suspend/resume calls up to the driver.pm ops
structure, as they are not pci device specific.

Thanks to Francois Romieu <romieu@fr.zoreil.com> for pointing this out.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-11 10:08:23 -06:00
Mark Einon a75fc17aaa staging: et131x: Remove error path from suspend/resume code
Removing an error path from et131x suspend/resume functions.

Also added a call to phy_stop() to complement the phy_start() call
during device start/stop routine.

Thanks to Francois Romieu <romieu@fr.zoreil.com> for pointing this out.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-11 10:08:22 -06:00
Mark Einon a9bd8ddad6 staging: et131x: Removing Olaf Hartmann's email as it bounces
On 3 October 2011 18:51, Uwe Ranft <uwe.ranft@telozo.com> wrote:
> Hello,
> olaf is not more longer owner of this e-mailadress. he has left our
> company.
> Please remove olaf fron the mailing list!
> Best Regards
> Uwe

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-11 10:08:22 -06:00
Ian Campbell 5d6bcdfe38 net: use DMA_x_DEVICE and dma_mapping_error with skb_frag_dma_map
When I converted some drivers from pci_map_page to skb_frag_dma_map I
neglected to convert PCI_DMA_xDEVICE into DMA_x_DEVICE and
pci_dma_mapping_error into dma_mapping_error.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2011-10-06 16:17:20 -04:00
Ian Campbell bf3f1a6081 et131x: convert to SKB paged frag API.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Cc: Mark Einon <mark.einon@gmail.com>
Cc: devel@driverdev.osuosl.org
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
2011-10-05 17:36:00 -04:00
Mark Einon 8481085a83 staging: et131x: Fix indefinite low power sleep
The mechanism by which the device is put into low power sleep is broken
in that the device can never come back out of low power mode afterwards.
Temorary fix to bring the device back out of sleep almost immediately,
until a suitable wake trigger can be found.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-04 10:43:15 -07:00
Mark Einon 86d734fd1e staging: et131x: Updating copyright statements and module authors
Adding copyright notices and adding myself as a module author.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-04 10:43:14 -07:00
Mark Einon 92c31a43e1 staging: et131x: Update TODO file for kernel parameters
set_mac is implemented, and there have been lots of new ethtool_ops added, so
removing the TODO to add more kernel parameters.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-04 10:43:14 -07:00
Mark Einon d84b7e29d8 staging: et131x: Fix add_timer() from et131x_open
The error_timer was only getting initialised and an initial jiffies value set following a probe.
This could result in the timer needlessly expiring immediately after et131x_open is called.
Now this is all done from the open call instead.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-04 10:43:14 -07:00
Mark Einon 25e1c2780c staging: et131x: Add pci suspend & resume functions
Added basic suspend & resume functionality.
Tested on an et1310 device, and putting Fedora15 host in and out of
hibernation successfully.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-04 10:43:13 -07:00
Mark Einon 1ce664dc01 staging: et131x: Remove adapter->bmsr, replace with phydev equivalents
adapter->bmsr is no longer being updated, but is also used to check the link state in places.

Remove bmsr from adapter, and replace link state checks with phydev->link check.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-04 10:43:13 -07:00
Mark Einon a3bf5fa772 staging: et131x: Introduce et1310_in_phy_coma() call
In several places in the code, the pm_csr register is read and the PHY_SW_COMA bit checked.

Move this check into its own small function to make the code more readable.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-04 10:43:12 -07:00
Mark Einon 53c3ee0db3 staging: et131x: Remove TODO entry 'alloc_etherdev initilising memory with zero'
Removing this as I'm pretty sure its not true, and alloc_etherdev isn't provided by this driver anyway. Alternatively, its a badly written comment and I don't understand it.

This drivers use of alloc_etherdev() is within keeping with other net devices, so I'm happy.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-04 10:43:12 -07:00
Mark Einon c28a613316 staging: et131x: Bugfix - driver doesn't autoreneg after cable unplug/plug events
This driver has a long standing bug where removing and inserting the ethernet cable results in no packets being
trnasmitted / received and hence no autonegotiation occurring.

Fixed by resetting the rx/tx engines and queue on detecting a cable being removed.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-26 17:39:17 -07:00
Mark Einon 2c2815aee7 staging: et131x: Remove header declaration of et131x_check_mii()
et131x_check_mii no longer exists, remove its declaration from the header file

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-26 17:39:16 -07:00
Mark Einon 7fabca4d91 staging: et131x: Create et131x_[dis|en]able_txrx() calls
In et131x_netdev.c, a series of calls to enable and diasble the rx/tx engine and queue are being used in several different places.
Create two functions to encapsulate these calls, and replace many calls with just the one.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-26 17:39:16 -07:00
Mark Einon 268420aa84 staging: et131x: Remove et131x_check_mii() and move functionality into et131x_adjust_link()
et131x_check_mii() is now only being called from et131x_adjust_link.
Removed this call and associated subroutines, putting the functionality directly into et131x_adjust_link(), in preparation for further simplification.
Changed register checks from bare BMSR checks to use phydev/netif versions, also now uses adapter->link to track link state changes.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-26 17:39:15 -07:00
Mark Einon 66a0cc1a02 staging: et131x: Add link status to adapter struct
This will be used to determine if the link state has changed when the phydev
informs the et131x that a change has occurred (in et131x_adjust_link)

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-26 17:39:15 -07:00
Mark Einon 8e0ae3d55a staging: et131x: support register dump in ethtool ops
Not an exhaustive dump of the et131x registers, used while debugging a specific problem - seems a shame not to keep it around.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-26 17:39:15 -07:00
Mark Einon a1c821ae6c staging: et131x: Update README file
I believe that the driver is up to date with the latest network driver changes, so removing this line from the TODO to see if anyone else disagrees.

Also all useless typecasts are now dead.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-06 16:54:59 -07:00
Mark Einon cd9bb52bfa staging: et131x: Remove ai_force_[duplex|speed] from et131x_adapter
The ai_force settings were used to set the ethernet speed and duplex manually.
This is now being done by the phy_device, so remove.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-06 16:54:58 -07:00
Mark Einon b84981c808 staging: et131x: Remove struct mi_regs from et1310_phy.h
This structure is no longer used, and references registers defined in mii.h and other parts of et1310_phy.h

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-06 16:54:58 -07:00
Mark Einon 46df22bd12 staging: et131x: Replace magic numbers in et1310_phy.c with defines
Replaced et131x_phy.c magic numbers specifying registers and their values with defines, defined in et131x_phy.h

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-06 16:54:57 -07:00
Mark Einon 88982cb1b1 staging: et131x: Remove duplicated register defines from et1310_phy.h
The VMI_* set of register defines are not used, and duplicate the set of PHY_* registers from the same file, which are used - hence removing.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-06 16:54:57 -07:00
Mark Einon 9c898c7ad5 staging: et131x: Remove cached_mask_value from et131x_adapter
cached_mask_value is only ever assigned, never read. Remove it.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-06 16:54:56 -07:00
Mark Einon ddf488baf6 staging: et131x: Remove registry_rx_mem_end from struct et131x_adapter
registry_rx_mem_end is not referenced anywhere in the driver.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-06 16:54:56 -07:00
Mark Einon 5ee574e0c4 staging: et131x: remove calls to netif_carrier_[on|off] from et131x_mii_check
As et131x_adjust_link is called from the phydev in response to a netif_carrier_[on|off], and is the only caller of et131x_mii_check, we don't need to call netif_carrier_[on|off] again.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-06 16:54:55 -07:00
Mark Einon 3e3b5f3915 staging: et131x: Remove PHY interrupt handling code from driver isr handler
The PHY interrupt is now handled by the phy_device, and the equivalent code is present in et131x_adjust_link, called from the phy_device when needed.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-06 16:54:54 -07:00
Mark Einon e2963962ae staging: et131x: Remove redundant struct adapter members
adapter->speed_duplex was never referenced.
adapter->registry_phy_coma was always set to zero, even in the vendor driver.

Removing all member references and associated dead code.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-06 16:54:54 -07:00
Mark Einon 06530d81d6 staging: et131x: Remove private adapter->duplex_mode and use phydev->duplex instead
The phy device keeps a note of the duplex mode, so use that value instead of duplex mode.

Also use the phydev defines for duplex modes, and remove the driver private ones.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-06 16:54:54 -07:00
Mark Einon 412f8e0c52 staging: et131x: Remove private adapter->linkspeed and use phydev->speed instead
The phy device keeps a note of the link speed, so use that value instead of the driver private one.

Also use the phydev defines for link speeds, and remove the driver private ones.

adapter->hw_errs was never used, even in the vendor driver, so remove that too.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-06 16:54:53 -07:00
Mark Einon 740b7a2cb1 staging: et131x: Amend README file
I think the kernel style cleanups are done now.
Adding myself as a recipient of patches.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-06 16:53:39 -07:00
Mark Einon 64df17c6fc staging: et131x: Fix checkpatch whitespace warnings
Some of my previous hacking attempts have not been following the rules.
All fixes either lines > 80 chars or whitespace corrections (spaces->tabs etc).

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-06 16:53:38 -07:00
Mark Einon e451d7b220 staging: et131x: Use MII register defines from mii.h
Use defines from include/linux/mii.h instead of et131x_phy.h and delete the latter defines.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-06 16:53:37 -07:00
Mark Einon 3cecd9203c staging: et131x: Remove redundant phy code
Now we are using a phy_device, remove driver functionality that is now handled by the phydev.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-06 16:49:28 -07:00
Mark Einon f660732fdc staging: et131x: Remove xcvr_addr and et131x_xcvr_find
Use the phy_device equivalents instead.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-06 16:49:28 -07:00
Mark Einon f680751491 staging: et131x: converting et131x_ioctl to use phy_mii_ioctl
Handing over ioctls handled by the driver to the phydev.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-06 16:49:27 -07:00
Mark Einon 0f18f767e5 staging: et131x: Use phy-device, mii_bus and ethtool_ops
Adding some basic ethtool ops and supporting functionality using a phy device.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-29 11:20:11 -07:00
Mark Einon fca7737f5c staging: et131x: Remove module_param et131x_speed_set
Manual setting of speed/duplex will be achieved using ethtool.
Remove the driver specific module_param that also does this.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-29 11:20:10 -07:00
Mark Einon 694bd60383 staging: et131x: Remove redundant replica loopback code
A mechanism used to set the phy in loopback mode is not present in the driver, making associated checks and variables redundant. Removing them.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-29 11:20:10 -07:00
Mark Einon 4a334d898a staging: et131x: Remove unused xcvr_id in struct ce_stats
xcvr_id holds the phy ID which is stored but never used in the driver.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-29 11:20:10 -07:00
Mark Einon 6d15059fd0 staging: et131x: Further tidy up of 131x_pci_setup()
* Removed unused bool variable.
* Eliminated mid-function returns, used gotos instead

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-29 11:20:08 -07:00
Mark Einon ac657d5884 staging: et131x: Update tx trans_start on device close to prevent tx_timeout
Updating the tx trans_start before closing the device prevents a possible tx_timeout occuring during the closing process.
Tested on an ET1310 device.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-23 16:25:29 -07:00
Mark Einon c8b7de7fce staging: et131x: Fix free IRQ from IRQ context warning after tx_timeout
When a tx timeout occured, et131x_tx_timeout closed and re-opened the device to fix.
As et131x_close called free_irq(), bad things ensued (see warning trace below), namely a
storm of errors and warnings.
Fixed by replacing the close() and open() calls with just the relevant functions previously
called from these.
Verified on an ET-1310 device.

Signed-off-by: Mark Einon <mark.einon@gmail.com>

----------
Aug  2 21:26:08 msilap kernel: [ 6484.816024] ------------[ cut here ]------------
Aug  2 21:26:08 msilap kernel: [ 6484.816039] WARNING: at /home/mark/Source/staging-2.6/net/sched/sch_generic.c:255 dev_watchdog+0xf0/0x150()
Aug  2 21:26:08 msilap kernel: [ 6484.816045] Hardware name: MS-1727
Aug  2 21:26:08 msilap kernel: [ 6484.816050] NETDEV WATCHDOG: eth1 (et131x): transmit queue 0 timed out
Aug  2 21:26:08 msilap kernel: [ 6484.816054] Modules linked in: et131x(C) aes_generic tcp_lp fuse nouveau ttm drm_kms_helper drm i2c_algo_bit sunrpc ipv6 cpufreq_ondemand acpi_cpufreq freq_table mperf uinput arc4 iwlagn snd_hda_codec_hdmi mac80211 sdhci_pci sdhci snd_hda_codec_realtek cfg80211 snd_hda_intel snd_hda_codec mmc_core snd_hwdep firewire_ohci firewire_core jmb38x_ms snd_seq snd_seq_device snd_pcm mxm_wmi ir_lirc_codec lirc_dev ir_sony_decoder i2c_i801 ir_jvc_decoder ir_rc6_decoder rc_rc6_mce i7core_edac edac_core snd_timer pcspkr rfkill r8169 mii i2c_core video ir_rc5_decoder memstick iTCO_wdt iTCO_vendor_support ir_nec_decoder ene_ir rc_core joydev microcode wmi snd crc_itu_t soundcore snd_page_alloc [last unloaded: et131x]
Aug  2 21:26:08 msilap kernel: [ 6484.816163] Pid: 0, comm: kworker/0:1 Tainted: G         C  3.0.0-rc6+ #21
Aug  2 21:26:08 msilap kernel: [ 6484.816167] Call Trace:
Aug  2 21:26:08 msilap kernel: [ 6484.816171]  <IRQ>  [<ffffffff8103caf4>] warn_slowpath_common+0x85/0x9d
Aug  2 21:26:08 msilap kernel: [ 6484.816189]  [<ffffffff8103cbaf>] warn_slowpath_fmt+0x46/0x48
Aug  2 21:26:08 msilap kernel: [ 6484.816196]  [<ffffffff813aa6fb>] ? netif_tx_lock+0x4a/0x7b
Aug  2 21:26:08 msilap kernel: [ 6484.816203]  [<ffffffff813aa86f>] dev_watchdog+0xf0/0x150
Aug  2 21:26:08 msilap kernel: [ 6484.816211]  [<ffffffff810497b6>] run_timer_softirq+0x1a9/0x279
Aug  2 21:26:08 msilap kernel: [ 6484.816218]  [<ffffffff813aa77f>] ? netif_tx_unlock+0x53/0x53
Aug  2 21:26:08 msilap kernel: [ 6484.816226]  [<ffffffff810429d7>] __do_softirq+0xd5/0x1a4
Aug  2 21:26:08 msilap kernel: [ 6484.816234]  [<ffffffff810079ed>] ? paravirt_read_tsc+0x9/0xd
Aug  2 21:26:08 msilap kernel: [ 6484.816245]  [<ffffffff8144561c>] call_softirq+0x1c/0x26
Aug  2 21:26:08 msilap kernel: [ 6484.816251]  [<ffffffff81003b9f>] do_softirq+0x46/0x83
Aug  2 21:26:08 msilap kernel: [ 6484.816257]  [<ffffffff81042ca2>] irq_exit+0x52/0x9b
Aug  2 21:26:08 msilap kernel: [ 6484.816265]  [<ffffffff81445749>] smp_apic_timer_interrupt+0x7c/0x8a
Aug  2 21:26:08 msilap kernel: [ 6484.816273]  [<ffffffff814450d3>] apic_timer_interrupt+0x13/0x20
Aug  2 21:26:08 msilap kernel: [ 6484.816278]  <EOI>  [<ffffffff810079ed>] ? paravirt_read_tsc+0x9/0xd
Aug  2 21:26:08 msilap kernel: [ 6484.816291]  [<ffffffff8124ad87>] ? intel_idle+0xd1/0xf8
Aug  2 21:26:08 msilap kernel: [ 6484.816297]  [<ffffffff8124ad69>] ? intel_idle+0xb3/0xf8
Aug  2 21:26:08 msilap kernel: [ 6484.816306]  [<ffffffff8136a767>] cpuidle_idle_call+0xe2/0x160
Aug  2 21:26:08 msilap kernel: [ 6484.816315]  [<ffffffff81001293>] cpu_idle+0xaa/0xcc
Aug  2 21:26:08 msilap kernel: [ 6484.816323]  [<ffffffff81436b4e>] start_secondary+0x248/0x24f
Aug  2 21:26:08 msilap kernel: [ 6484.816329] ---[ end trace 10ae1b2c6bae932f ]---
Aug  2 21:26:08 msilap kernel: [ 6484.816337] et131x 0000:02:00.0: Send stuck - reset.  tcb->WrIndex 0, flags 0x00000000
Aug  2 21:26:08 msilap kernel: [ 6484.816344] ------------[ cut here ]------------
Aug  2 21:26:08 msilap kernel: [ 6484.816353] WARNING: at /home/mark/Source/staging-2.6/kernel/irq/manage.c:1131 __free_irq+0x58/0x192()
Aug  2 21:26:08 msilap kernel: [ 6484.816358] Hardware name: MS-1727
Aug  2 21:26:08 msilap kernel: [ 6484.816362] Trying to free IRQ 16 from IRQ context!
Aug  2 21:26:08 msilap kernel: [ 6484.816365] Modules linked in: et131x(C) aes_generic tcp_lp fuse nouveau ttm drm_kms_helper drm i2c_algo_bit sunrpc ipv6 cpufreq_ondemand acpi_cpufreq freq_table mperf uinput arc4 iwlagn snd_hda_codec_hdmi mac80211 sdhci_pci sdhci snd_hda_codec_realtek cfg80211 snd_hda_intel snd_hda_codec mmc_core snd_hwdep firewire_ohci firewire_core jmb38x_ms snd_seq snd_seq_device snd_pcm mxm_wmi ir_lirc_codec lirc_dev ir_sony_decoder i2c_i801 ir_jvc_decoder ir_rc6_decoder rc_rc6_mce i7core_edac edac_core snd_timer pcspkr rfkill r8169 mii i2c_core video ir_rc5_decoder memstick iTCO_wdt iTCO_vendor_support ir_nec_decoder ene_ir rc_core joydev microcode wmi snd crc_itu_t soundcore snd_page_alloc [last unloaded: et131x]
Aug  2 21:26:08 msilap kernel: [ 6484.816459] Pid: 0, comm: kworker/0:1 Tainted: G        WC  3.0.0-rc6+ #21
Aug  2 21:26:08 msilap kernel: [ 6484.816464] Call Trace:
Aug  2 21:26:08 msilap kernel: [ 6484.816467]  <IRQ>  [<ffffffff8103caf4>] warn_slowpath_common+0x85/0x9d
Aug  2 21:26:08 msilap kernel: [ 6484.816480]  [<ffffffff8103cbaf>] warn_slowpath_fmt+0x46/0x48
Aug  2 21:26:08 msilap kernel: [ 6484.816488]  [<ffffffff81092276>] __free_irq+0x58/0x192
Aug  2 21:26:08 msilap kernel: [ 6484.816496]  [<ffffffff8109240e>] free_irq+0x5e/0x77
Aug  2 21:26:08 msilap kernel: [ 6484.816506]  [<ffffffffa00bf58e>] et131x_close+0x4b/0x5e [et131x]
Aug  2 21:26:08 msilap kernel: [ 6484.816516]  [<ffffffffa00bf64d>] et131x_tx_timeout+0xac/0xc7 [et131x]
Aug  2 21:26:08 msilap kernel: [ 6484.816523]  [<ffffffff813aa883>] dev_watchdog+0x104/0x150
Aug  2 21:26:08 msilap kernel: [ 6484.816530]  [<ffffffff810497b6>] run_timer_softirq+0x1a9/0x279
Aug  2 21:26:08 msilap kernel: [ 6484.816537]  [<ffffffff813aa77f>] ? netif_tx_unlock+0x53/0x53
Aug  2 21:26:08 msilap kernel: [ 6484.816544]  [<ffffffff810429d7>] __do_softirq+0xd5/0x1a4
Aug  2 21:26:08 msilap kernel: [ 6484.816552]  [<ffffffff810079ed>] ? paravirt_read_tsc+0x9/0xd
Aug  2 21:26:08 msilap kernel: [ 6484.816560]  [<ffffffff8144561c>] call_softirq+0x1c/0x26
Aug  2 21:26:08 msilap kernel: [ 6484.816566]  [<ffffffff81003b9f>] do_softirq+0x46/0x83
Aug  2 21:26:08 msilap kernel: [ 6484.816572]  [<ffffffff81042ca2>] irq_exit+0x52/0x9b
Aug  2 21:26:08 msilap kernel: [ 6484.816580]  [<ffffffff81445749>] smp_apic_timer_interrupt+0x7c/0x8a
Aug  2 21:26:08 msilap kernel: [ 6484.816588]  [<ffffffff814450d3>] apic_timer_interrupt+0x13/0x20
Aug  2 21:26:08 msilap kernel: [ 6484.816592]  <EOI>  [<ffffffff810079ed>] ? paravirt_read_tsc+0x9/0xd
Aug  2 21:26:08 msilap kernel: [ 6484.816604]  [<ffffffff8124ad87>] ? intel_idle+0xd1/0xf8
Aug  2 21:26:08 msilap kernel: [ 6484.816610]  [<ffffffff8124ad69>] ? intel_idle+0xb3/0xf8
Aug  2 21:26:08 msilap kernel: [ 6484.816617]  [<ffffffff8136a767>] cpuidle_idle_call+0xe2/0x160
Aug  2 21:26:08 msilap kernel: [ 6484.816625]  [<ffffffff81001293>] cpu_idle+0xaa/0xcc
Aug  2 21:26:08 msilap kernel: [ 6484.816632]  [<ffffffff81436b4e>] start_secondary+0x248/0x24f
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-23 16:25:29 -07:00
Mark Einon c922d1241f staging: et131x: Fix link detection signalling
Remove redundant code around netif_carrier_XXX calls, and associated adapter->media_state, which prevented the link from being reported as off.
Tested on an ET-1310 device.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-23 16:25:28 -07:00
Mark Einon 10f00a49b0 staging: et131x: Rename var name 'etdev' to 'adapter' throughout module
Used regex (from vim) :%s/\<etdev\>/adapter/g

Changed because:
* 'etdev' is easily confused as a misspelling of 'netdev'
* 'adapter' is more widely used for this struct type in net drivers. This
change made comparing code with other drivers much easier.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-23 16:25:28 -07:00
Mark Einon bc8585fc06 staging: et131x: Removing commented out code implemented elsewhere
Function et131x_set_mac_addr() contains commented out code that has been moved to
et131x_change_mtu() in the same file.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-23 16:25:27 -07:00
Mark Einon bf04415e63 staging: et131x: Converting et1310_adapter.h variable names from CamelCase
Tested on an ET-131x device.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-23 16:25:27 -07:00
Mark Einon 567486ac76 staging: et131x: Converting et1310_tx.c function and local names from CamelCase
Also some minor code clean-ups.
Tested on an ET-131x device.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-23 16:25:27 -07:00
Mark Einon 1c863c8bcb staging: et131x: Remove unecessary *etdev NULL check in et1310_phy_init()
It is impossible to get to this function with the pointer being NULL.
Tested on an ET-131x device.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-23 16:25:27 -07:00
Mark Einon 5cf51e8aad staging: et131x: Rename et131x_config_global_regs > et131x_configure_global_regs
Typo in header file. Also renaming a few adapter references to fit in with the rest of the file.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-23 11:48:46 -07:00
Mark Einon 3e85436187 staging: et131x: Remove redundant commented out code
Removed commented out calls that no longer exist in the net_device struct.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-23 11:47:57 -07:00
Mark Einon 6a34265798 staging: et131x: Fix variable typo carry_reg1 -> carry_reg2
This mistake was introduced in the patch 'staging: et131x: Convert et1310_address_map.h names from camel case'

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-23 11:46:49 -07:00
Mark Einon fc78050f67 staging: et131x: Convert et1310_tx.c function name from CamelCase
Tested on an ET-131x device.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-23 11:46:45 -07:00
Mark Einon e6cbda294a staging: et131x: add et1310_ prefix to et1310_mac.c functions
Making finger pointing that bit easier.
Tested on an ET-131x device.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-23 11:45:28 -07:00
Mark Einon 22592afa20 staging: et131x: Converting et1310_rx.h variable names from CamelCase
Tested on an ET-131x device.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-23 11:44:54 -07:00
Mark Einon 42e26f343b staging: et131x: Make static some local functions in et1310_rx.c
Tested on an ET-131x device.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-23 11:44:50 -07:00
Mark Einon 9590e93c79 staging: et131x: Converting et1310_rx.c function and local names from CamelCase
Also renamed some items to improve readability, and other minor tidy-ups.
Tested on an ET-131x device.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-23 11:44:19 -07:00
Mark Einon c2329af4b9 staging: et131x: Converting et1310_pm.c function and local names from CamelCase
Tested on an ET-131x device.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-23 11:44:15 -07:00
Mark Einon 99fa7e1492 staging: et131x: Converting et1310_phy.c function and local names from CamelCase
Tested on an ET-131x device.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-23 11:44:11 -07:00
Mark Einon 1de137839b staging: et131x: Converting et1310_mac.c function and local names from CamelCase
Tested on an ET-131x device.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-23 11:44:08 -07:00
Jiri Pirko afc4b13df1 net: remove use of ndo_set_multicast_list in drivers
replace it by ndo_set_rx_mode

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2011-08-17 20:22:03 -07:00
Mark Einon e19d8ba145 staging: et131x: et1310_mac.c: ConfigMacStatRegs() add missing regs to be zeroed
The comment at the top of the function states 'we need to initialize all the macstat registers to zero', but not all macstat registers are zeroed. Zero the missing registers.
Tested on an ET-131x device.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-08 14:06:37 -07:00
Mark Einon 9c4715939a staging: et131x: Remove spaces between tabs inserted in patch 7b7fb34d3ffa
I must remember to run checkpatch on 'trivial' patches too...

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-08 14:06:37 -07:00
Mark Einon 4af1c77fa6 staging: et131x: Convert et1310_address_map.h names from camel case
Trivial name changes.
Tested on an ET-131x device.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-08 14:06:37 -07:00
Mark Einon 12d4f96448 staging: et131x: rename adapter->Flags to adapter->flags
Trivial rename of the adapter flags struct member to remove camel case.
Tested on a ET-131x device.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-08 14:06:36 -07:00
Mark Einon b7ac48fa1f staging: et131x: Remove typedefs from et1310_phy.h
Fixes the associated checkpatch warnings.
Tested with ifconfig/general use of a device (Agere Systems ET-131x PCI-E
Ethernet Controller (rev 02)).

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05 19:54:58 -07:00
Mark Einon 13425aa1ce staging: et131x: Remove some unecessary packet accounting code
The ce_stats ipackets and opackets members are only used to update
the net_device_stats->[r,t]x_packets counters, so get rid of them.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05 19:54:58 -07:00
Mark Einon a7aa8a028d staging: et131x: Fix stats->rx_packets accounting
The net_device_stats->rx_packets counter is not getting updated.
This is due to checking a fMP_ADAPTER_LINK_DETECTION flag prior to
updating which is never set.

Solved by using netif_carrier_ok() to test for a link, and removing
the fMP_ADAPTER_LINK_DETECTION flag, which looks to be a broken
mechanism.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05 19:54:58 -07:00
Joe Perches d5a76f3351 staging: transciever/transceiver spelling fixes
Just tyops.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05 10:19:40 -07:00
Mark Einon f4b70529be staging: et131x: Removing '_t' from ce_stats_t struct
Removing '_t' from ce_stats_t struct name and renaming et131x_adapter ce_stats member from
 'Stats' to 'stats'

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-28 14:34:38 -07:00
Mark Einon 57ecdfa727 staging: et131x: Fixes multiple 'WARNING: do not add new typedefs'.
Removes unions, and uses definitions for bit manipulations.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-28 14:34:38 -07:00
Mark Einon 2e861534ca staging: et131x: et131x_netdev.c checkpatch fixes
Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-28 14:34:37 -07:00
Mark Einon 76fb419e03 staging: et131x: et131x_initpci.c checkpatch fixes
Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-28 14:34:37 -07:00
Mark Einon 47883130a0 staging: et131x: et131x_adapter.h checkpatch fixes
Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-28 14:34:37 -07:00
Mark Einon 29667f30b2 staging: et131x: et1310_rx.c checkpatch fixes
Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-28 14:34:36 -07:00
Mark Einon 4ce6cc500c staging: et131x: checkpatch fixes for et1310_address_map.h (All 'do not add new typedefs')
Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-28 14:34:36 -07:00
Lucas De Marchi 25985edced Fix common misspellings
Fixes generated by 'codespell' and manually reviewed.

Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
2011-03-31 11:26:23 -03:00
Marcin Slusarz 1af4791552 staging/et131x: fix et131x_rx_dma_disable halt_status usage
Commit 1bd751c1ab
("Staging: et131x: Clean up rxdma_csr") changed csr from bitfield to
u32, but failed to convert 2 uses of halt_status bit. It did:

- if (csr.bits.halt_status != 1)
+ if ((csr & 0x00020000) != 1)

which is wrong, because second version is always true.
Fix it.

This bug was found by coccinelle (http://coccinelle.lip6.fr/).

Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Acked-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-02-23 14:39:09 -08:00
Alan Cox 404dc5f3f4 staging: et131x: Begin cleaning up the MI registers
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-02-04 13:01:01 -08:00
Alan Cox ae3e5f0e9a staging: et131x: Clean up the RFD struct/types
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-02-04 13:01:01 -08:00
Alan Cox 64b728319b staging: et131x: Clean up the phy coma stuff
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-02-04 13:01:01 -08:00
Alan Cox ae3a08aab5 staging: et131x: Kill of the eFLOW_CONTROL enum
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-02-04 13:01:00 -08:00
Alan Cox 072e9f609c staging: et131x: Turn a few more LongCapitalisedThings into Linuxish names
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-02-04 13:01:00 -08:00
Joe Perches 345594d6ef drivers/staging: Remove unnecessary casts of pci_get_drvdata
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-16 12:06:47 -08:00
Tracey Dent 735f48f57d Staging: et131x: Makefile: replace the use of <module>-objs with <module>-y
Changed <module>-objs to <module>-y in Makefile.

Signed-off-by: Tracey Dent <tdent48227@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-08 07:23:49 -07:00
Uwe Kleine-König 9b0131cb24 staging/trivial: fix typos concerning "initiali[zs]e"
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-04 21:23:26 -07:00
Lars Lindley ba22a15ae8 Staging: et131x: Small format/style tidyups
I fixed indentation in one place and two long lines, a space and a brace
found by checkpatch.pl and fixed some long lines and whitespace around an =.

Signed-off-by: Lars Lindley <lindley@coyote.org>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-17 16:08:45 -07:00
Greg Kroah-Hartman c8d1a12692 Merge staging-next tree into Linus's latest version
Conflicts:
	drivers/staging/arlan/arlan-main.c
	drivers/staging/comedi/drivers/cb_das16_cs.c
	drivers/staging/cx25821/cx25821-alsa.c
	drivers/staging/dt3155/dt3155_drv.c
	drivers/staging/hv/hv.c
	drivers/staging/netwave/netwave_cs.c
	drivers/staging/wavelan/wavelan.c
	drivers/staging/wavelan/wavelan_cs.c
	drivers/staging/wlags49_h2/wl_cs.c

This required a bit of hand merging due to the conflicts
that happened in the later .34-rc releases, as well as
some staging driver changing coming in through other trees
(v4l and pcmcia).

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-21 12:48:55 -07:00
Julia Lawall 324148788b Staging: Drop memory allocation cast
Drop cast on the result of kmalloc and similar functions.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
type T;
@@

- (T *)
  (\(kmalloc\|kzalloc\|kcalloc\|kmem_cache_alloc\|kmem_cache_zalloc\|
   kmem_cache_alloc_node\|kmalloc_node\|kzalloc_node\)(...))
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-11 16:06:48 -07:00
Michael Sprecher f3fd4cd591 Staging: et131x: fix most coding style issues in et131x
This is a patch to the et131x driver that fixes up almost all coding
style issues

Signed-off-by: Michael Sprecher <sprecher.m@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-11 11:35:35 -07:00
Michael Tate b4c84c298b staging: et131x: Fix brace coding style issues.
This revised patch fixes 2 brace coding style issues reported by checkpatch.pl
One warning line > 80 chars not resolved on maintainers advice.

Signed-off-by: Michael Tate <michael.tate@wanadoo.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-11 11:35:32 -07:00
David S. Miller 871039f02f Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
	drivers/net/stmmac/stmmac_main.c
	drivers/net/wireless/wl12xx/wl1271_cmd.c
	drivers/net/wireless/wl12xx/wl1271_main.c
	drivers/net/wireless/wl12xx/wl1271_spi.c
	net/core/ethtool.c
	net/mac80211/scan.c
2010-04-11 14:53:53 -07:00
Jiri Pirko 22bedad3ce net: convert multicast list to list_head
Converts the list and the core manipulating with it to be the same as uc_list.

+uses two functions for adding/removing mc address (normal and "global"
 variant) instead of a function parameter.
+removes dev_mcast.c completely.
+exposes netdev_hw_addr_list_* macros along with __hw_addr_* functions for
 manipulation with lists on a sandbox (used in bonding and 80211 drivers)

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-04-03 14:22:15 -07:00
Tejun Heo 5a0e3ad6af include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files.  percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.

percpu.h -> slab.h dependency is about to be removed.  Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability.  As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.

  http://userweb.kernel.org/~tj/misc/slabh-sweep.py

The script does the followings.

* Scan files for gfp and slab usages and update includes such that
  only the necessary includes are there.  ie. if only gfp is used,
  gfp.h, if slab is used, slab.h.

* When the script inserts a new include, it looks at the include
  blocks and try to put the new include such that its order conforms
  to its surrounding.  It's put in the include block which contains
  core kernel includes, in the same order that the rest are ordered -
  alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
  doesn't seem to be any matching order.

* If the script can't find a place to put a new include (mostly
  because the file doesn't have fitting include block), it prints out
  an error message indicating which .h file needs to be added to the
  file.

The conversion was done in the following steps.

1. The initial automatic conversion of all .c files updated slightly
   over 4000 files, deleting around 700 includes and adding ~480 gfp.h
   and ~3000 slab.h inclusions.  The script emitted errors for ~400
   files.

2. Each error was manually checked.  Some didn't need the inclusion,
   some needed manual addition while adding it to implementation .h or
   embedding .c file was more appropriate for others.  This step added
   inclusions to around 150 files.

3. The script was run again and the output was compared to the edits
   from #2 to make sure no file was left behind.

4. Several build tests were done and a couple of problems were fixed.
   e.g. lib/decompress_*.c used malloc/free() wrappers around slab
   APIs requiring slab.h to be added manually.

5. The script was run on all .h files but without automatically
   editing them as sprinkling gfp.h and slab.h inclusions around .h
   files could easily lead to inclusion dependency hell.  Most gfp.h
   inclusion directives were ignored as stuff from gfp.h was usually
   wildly available and often used in preprocessor macros.  Each
   slab.h inclusion directive was examined and added manually as
   necessary.

6. percpu.h was updated not to include slab.h.

7. Build test were done on the following configurations and failures
   were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
   distributed build env didn't work with gcov compiles) and a few
   more options had to be turned off depending on archs to make things
   build (like ipr on powerpc/64 which failed due to missing writeq).

   * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
   * powerpc and powerpc64 SMP allmodconfig
   * sparc and sparc64 SMP allmodconfig
   * ia64 SMP allmodconfig
   * s390 SMP allmodconfig
   * alpha SMP allmodconfig
   * um on x86_64 SMP allmodconfig

8. percpu.h modifications were reverted so that it could be applied as
   a separate patch and serve as bisection point.

Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.

Signed-off-by: Tejun Heo <tj@kernel.org>
Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
2010-03-30 22:02:32 +09:00
Nick Bowler 05ad62a5ee Staging: et131x: Properly disable FC in txmac.
FC disable is bit 3 of the txmac ctl register, but commit 6720949d55
("Staging: et131x: Kil the txmac type") accidentally changed the code to
set bit 2 instead.

Signed-off-by: Nick Bowler <nbowler@draconx.ca>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-03-29 08:51:36 -07:00
Greg Kroah-Hartman f341dddf1d Staging: merge staging patches into Linus's main branch
There were a number of patches that went into Linus's
tree already that conflicted with other changes in the
staging branch.  This merge resolves those merge conflicts.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-04 08:39:02 -08:00
Alan Cox 22e0967f72 Staging: et131x_kill MAC_STAT_t
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-03 16:42:52 -08:00
Alan Cox bd03d0d5bc Staging: et131x: kill off the rxmac ctrl type
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-03 16:42:52 -08:00
Alan Cox fef5ba3ae9 Staging: et131x: kill the rxmac ERROR_REG_t
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-03 16:42:52 -08:00
Alan Cox dcb0789bb3 Staging: et131x: Kill MIF_CTL_t
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-03 16:42:52 -08:00
Alan Cox 370d52acf7 Staging: et131x: Kill the SPACE_AVAIL type
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-03 16:42:52 -08:00
Alan Cox f7ae1957ca Staging: et131x: Kill off the rxq_diag types
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-03 16:42:51 -08:00
Alan Cox 287acb63a5 Staging: et131x: Kill of the MCIF types
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-03 16:42:51 -08:00
Alan Cox b186f33137 Staging: et131x: kill off RXMAC_PF_CTRL_t
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-03 16:42:51 -08:00
Alan Cox 70a29a2408 Staging: et131x: Kill rxmac crc fields
More we don't need

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-03 16:42:51 -08:00
Alan Cox afa7e5ec93 Staging: et13x: kill off TXMAC_ERR_INT_t
This completes the structures within the txmac block so we can now
propogate a name change and type removal up a layer and clean up TXMAC as
well

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-03 16:42:51 -08:00
Alan Cox 003e52e85b Staging: et131x: Kill off the TXMAC_ERR_t type
This is another one we don't really need to do much to get rid of

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-03 16:42:51 -08:00
Alan Cox 1cb180dc9d Staging: et131x: kill txmac err count typedef
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-03 16:42:51 -08:00
Alan Cox 6720949d55 Staging: et131x: Kil the txmac type
Only used for one trivial thing so turn that into something trivial instead

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-03 16:42:51 -08:00
Alan Cox 69ea5fcb5e Staging: et131x: Collapse all the function definitions into one place
We have lots of tiny files right now that could be one

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-03 16:42:51 -08:00
Alan Cox ec7d9f6101 Staging: et131x: Kill unused error defines
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-03 16:42:50 -08:00
Alan Cox f1471660df Staging: et131x: kill MP_ERR_COUNTERS which is unused
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-03 16:42:50 -08:00
Alan Cox 8f12785dd0 Staging: et131x: Kill off RX_RING_t
This completes the typedef clean up of the rx specific structures, although
there is plenty do on field names and the like

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-03 16:42:50 -08:00
Alan Cox 4ba64c1ba5 Staging: et131x: clean up the pkt_desc_stat_t types
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-03 16:42:50 -08:00
Alan Cox 8a66278cf9 Staging: et131x: Clean up the fbr lookup table
All the subtypes are sane so just turn it into something struct and linux
like

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-03 16:42:50 -08:00
Alan Cox 07563ac691 Staging: et131x: Fix rx_status typing
Use the proper pointer types for the higher level pointers to the rx_status
object and kill casts

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-03 16:42:50 -08:00
Alan Cox f926d21650 Staging: et131x: rx_status_block_t is now clean
So kill off the top level type and turn it into a struct

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-03 16:42:50 -08:00
Alan Cox c9a8ad187a Staging: et131x: kill off the rx interrupt state enum
Another verbose enum we don't need

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-03 16:42:50 -08:00
Alan Cox 61aa21f208 Staging: et131x: Clean up the rx status word types
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-03 16:42:50 -08:00
Alan Cox dc26ffc772 Staging: et131x: Kill MAC_STAT_t
All the contents of this type are now clean, so kill the top level type
as well

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-03 16:42:50 -08:00
Alan Cox 461e0e8b15 Staging: et131x: Kill off MMC_t
The contents of MMC_t are clean so kill off the MMC_t typedef

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-03 16:42:49 -08:00
Alan Cox 060a78a07a Staging: et131x: Kill off TXDMA_t
All the contents are clean so kill off the top level typedefs

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-03 16:42:49 -08:00
Alan Cox 2b903327d3 Staging: et131x: GLOBAL_t is now sane so kill the GLOBAL_t itself
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-03 16:42:49 -08:00
Alan Cox 254472ac59 Staging: et131x: kill EXP_ROM
This is another unused type for the bin

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-03 16:42:49 -08:00
Alan Cox 61d5ed8c62 Staging: et131x: Kill off the rxdma type
We have a clean struct of this now so turn the top level typedefs into a
struct

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-03 16:42:49 -08:00
Alan Cox 1bd751c1ab Staging: et131x: Clean up rxdma_csr
This is another set of flags as typedef that can be cleaned up.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-03 16:42:49 -08:00
Alan Cox 13a79c697f Staging: et131x: fbr_desc is now only sane types
Clean up the typdef for fbr_desc itself so we know it is done

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-03 16:42:49 -08:00
Alan Cox 7d9e15eb31 Staging: et131x: kill of FBR_WORD2
This is only used meaningfully as a definition, we never mask and fetch the
bits apart

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-03 16:42:49 -08:00
Alan Cox 09b25c6fa3 Staging: et131x: kill off the FBR_NUM_DES type
This is another 10 bit value with the high bits clear, and where the
type doesn't get used anywhere properly anyway

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-03 16:42:49 -08:00
H Hartley Sweeten 28a2333413 Staging: et131x_netdev.c: use %pM to shown MAC address
Trivial, use the %pM kernel extension to display the MAC address.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Olaf Hartmann <o.hartmann@telovital.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-03 16:42:39 -08:00
Jiri Pirko d59079425f staging: convert to use netdev_for_each_mc_addr
removed needless checks in arlan-main.c and slicoss.c
fixed bug in et131x_netdev.c to actually fill addresses in.

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-02-18 14:47:51 -08:00
Jiri Pirko 4cd24eaf0c net: use netdev_mc_count and netdev_mc_empty when appropriate
This patch replaces dev->mc_count in all drivers (hopefully I didn't miss
anything). Used spatch and did small tweaks and conding style changes when
it was suitable.

Jirka

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-02-12 11:38:58 -08:00
Alan Cox d31a2ff03f Staging: et131x: Fix 2.6.33rc1 regression in et131x
et131x: Fix 12bit wrapping

From: Alan Cox <alan@linux.intel.com>

The 12bit wrap logic conversion is wrong and this shows up for some
memory sizes and layouts of card. Patch it up for now, once the kernel
view of status is cleaned up it'll become two variables and a lot saner.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-01-20 15:05:26 -08:00
Alan Cox 99fd99f618 Staging: et131x: clean up the avail fields in the rx registers
These have a wrap bit but again need little work to clean out. There are a
couple of uglies left that want addressing in later clean up. Notably we should
probably keep the local psr copy and wrap as two values.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-12-11 12:23:21 -08:00
Alan Cox 2e5e0b890d Staging: et131x: Clean up number fields
Lots of RX typedefs are just low bits of a u32, so clean them all up in one
go and just work them directly.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-12-11 12:23:21 -08:00
Alan Cox 6794712519 Staging: et131x: kill RX_DMA_MAX_PKT_TIME
Another one bits the dust ...

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-12-11 12:23:21 -08:00
Alan Cox 02cdb0b427 Staging: et131x: kill TX_SHADOW
Guess what - we don't use this one either

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-12-11 12:23:21 -08:00
Alan Cox cfc52eb676 Staging: et131x: Another typedef solely used to write 0 to a register
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-12-11 12:23:21 -08:00
Alan Cox 42a03e98d1 Staging: et131x: kill TX_PR_NUM_DES_t
Yes folks it another unused typedef.. This completes the clean up of the
TX DMA typedefs

Signed-off-by: Alan Cox <alan@linux.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-12-11 12:23:21 -08:00
Alan Cox d97aabcd0e Staging: et131x: kill TxMacTest field
It's really a local in the interrupt handler

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-12-11 12:23:20 -08:00
Alan Cox f838cabdb2 Staging: et131x: kill TXTEST and TXFILL, clean up CF_PARAM
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-12-11 12:23:20 -08:00
Alan Cox 74f38633f2 Staging: et131x: clean up mac stat names
Might as well use something short and obvious

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-12-11 12:23:20 -08:00
Alan Cox ae8d9d845a Staging: et131x: clean up MAC_STAT register
One by one...

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-12-11 12:23:20 -08:00
Alan Cox b491f147a1 Staging: et131x: Kill MAC_IF_CTRL typedefs
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-12-11 12:23:20 -08:00
André Goddard Rosa bbc9a9916b Staging: fix assorted typos all over the place
Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-12-11 12:23:20 -08:00
Alan Cox e1bc58459a Staging: et131x: Clean up the phy code, especially dup stuff
Fold in the TPAL stuff and remove the duplication
Clean up other stuff where we do un-needed work or have verbose implementations
Comment some of the functions as we go


Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-12-11 12:23:08 -08:00
Alan Cox 1210db957a Staging: et131x: phy clean up
Clean up the phy code a bit so we can see what needs doing. This involves
moving blocks around and making stuff static

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-12-11 12:23:08 -08:00