Commit Graph

332 Commits

Author SHA1 Message Date
Mark Einon 23ebe1e0c6 staging: et131x: Remove frame error TODO item
After prolonged testing for a few days of normal use with new et131x
hardware, I've concluded that this was a hardware issue with the older
hardware I had. Removing this item from the TODO.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-21 10:02:28 -07:00
Devendra Naga ddd4bd3e54 staging: et131x: cancel_work when module gets unloaded
The work item has been added to the queue using INIT_WORK and scheduled
in interrupt handler. when module unloads that work item has not been
removed from the queue. remove and stop its further execution when the
module unloaded

Cc: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-11 13:07:05 -07:00
Devendra Naga 8dd4a96652 staging: et131x: fix invalid fail after the call to eeprom_wait_ready
should be err < 0 instead of if (err) which actually the read register
value can be a positive number

Acked-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-12 09:09:08 -07:00
Linus Torvalds b5c78e04dd Staging tree update for 3.9-rc1
Here's the big staging tree merge for 3.9-rc1
 
 Lots of cleanups and updates for drivers all through the staging tree.
 We are pretty much "code neutral" here, adding just about as many lines
 as we removed.
 
 All of these have been in linux-next for a while.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.19 (GNU/Linux)
 
 iEUEABECAAYFAlEmW7QACgkQMUfUDdst+ymlIACXT5mv8Y5A/KJa+QLTNNsofI8u
 aACgq9hNZxJzX6VQMLXUV8+2SILOqYo=
 =5wIj
 -----END PGP SIGNATURE-----

Merge tag 'staging-3.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging

Pull staging tree update from Greg Kroah-Hartman:
 "Here's the big staging tree merge for 3.9-rc1

  Lots of cleanups and updates for drivers all through the staging tree.
  We are pretty much "code neutral" here, adding just about as many
  lines as we removed.

  All of these have been in linux-next for a while."

* tag 'staging-3.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (804 commits)
  staging: comedi: vmk80xx: wait for URBs to complete
  staging: comedi: drivers: addi-data: hwdrv_apci3200.c: Add a missing semicolon
  staging: et131x: Update TODO list
  staging: et131x: Remove assignment of skb->dev
  staging: wlan-ng: hfa384x.h: fix for error reported by smatch
  staging/zache checkpatch ERROR: spaces prohibited around that
  staging/ozwpan: Mark read only parameters and structs as const
  staging/ozwpan: Remove empty and unused function oz_cdev_heartbeat
  staging/ozwpan: Mark local functions as static (fix sparse warnings)
  staging/ozwpan: Add missing header includes
  staging/usbip: Mark local functions as static (fix sparse warnings)
  staging/xgifb: Remove duplicated code in loops.
  staging/xgifb: Consolidate return paths
  staging/xgifb: Remove code without effect
  staging/xgifb: Remove unnecessary casts
  staging/xgifb: Consolidate if/else if with identical code branches
  staging: vt6656: replaced custom TRUE definition with true
  staging: vt6656: replaced custom FALSE definition with false
  staging: vt6656: replace custom BOOL definition with bool
  staging/rtl8187se: Mark functions as static to silence sparse
  ...
2013-02-21 12:11:44 -08:00
Mark Einon deb95fac28 staging: et131x: Update TODO list
David Miller <davem@davemloft.net> had provided some review
comments for this driver. Update the TODO list with some action
points from his review.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-18 10:51:37 -08:00
Mark Einon bf7edd87f1 staging: et131x: Remove assignment of skb->dev
The call eth_type_trans() sets skb->dev to netdev, so there's
no needto set it before the call.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-18 10:51:36 -08:00
Joe Perches 78110bb8dc staging: Remove unnecessary OOM messages
alloc failures already get standardized OOM
messages and a dump_stack.

For the affected mallocs around these OOM messages:

Converted kzallocs with multiplies to kcalloc.
Converted kmallocs with multiplies to kmalloc_array.
Converted a kmalloc/strlen/strncpy to kstrdup.
Moved a spin_lock below a removed OOM message and
removed a now unnecessary spin_unlock.
Neatened alignment and whitespace.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-11 10:10:33 -08:00
Mark Einon c0594ee9ea staging: et131x: Fix all sparse warnings
Dan Carpenter has pointed out that there are several sparse warnings
from et131x.c, listed below. This patch fixes all these errors.

drivers/staging/et131x/et131x.c:1870:33: warning: incorrect type in assignment (different address spaces)
drivers/staging/et131x/et131x.c:1870:33:    expected unsigned int [usertype] *num_des
drivers/staging/et131x/et131x.c:1870:33:    got unsigned int [noderef] <asn:2>*<noident>
drivers/staging/et131x/et131x.c:1871:37: warning: incorrect type in assignment (different address spaces)
drivers/staging/et131x/et131x.c:1871:37:    expected unsigned int [usertype] *full_offset
drivers/staging/et131x/et131x.c:1871:37:    got unsigned int [noderef] <asn:2>*<noident>
drivers/staging/et131x/et131x.c:1872:33: warning: incorrect type in assignment (different address spaces)
drivers/staging/et131x/et131x.c:1872:33:    expected unsigned int [usertype] *min_des
drivers/staging/et131x/et131x.c:1872:33:    got unsigned int [noderef] <asn:2>*<noident>
drivers/staging/et131x/et131x.c:1873:33: warning: incorrect type in assignment (different address spaces)
drivers/staging/et131x/et131x.c:1873:33:    expected unsigned int [usertype] *base_hi
drivers/staging/et131x/et131x.c:1873:33:    got unsigned int [noderef] <asn:2>*<noident>
drivers/staging/et131x/et131x.c:1874:33: warning: incorrect type in assignment (different address spaces)
drivers/staging/et131x/et131x.c:1874:33:    expected unsigned int [usertype] *base_lo
drivers/staging/et131x/et131x.c:1874:33:    got unsigned int [noderef] <asn:2>*<noident>
drivers/staging/et131x/et131x.c:1876:33: warning: incorrect type in assignment (different address spaces)
drivers/staging/et131x/et131x.c:1876:33:    expected unsigned int [usertype] *num_des
drivers/staging/et131x/et131x.c:1876:33:    got unsigned int [noderef] <asn:2>*<noident>
drivers/staging/et131x/et131x.c:1877:37: warning: incorrect type in assignment (different address spaces)
drivers/staging/et131x/et131x.c:1877:37:    expected unsigned int [usertype] *full_offset
drivers/staging/et131x/et131x.c:1877:37:    got unsigned int [noderef] <asn:2>*<noident>
drivers/staging/et131x/et131x.c:1878:33: warning: incorrect type in assignment (different address spaces)
drivers/staging/et131x/et131x.c:1878:33:    expected unsigned int [usertype] *min_des
drivers/staging/et131x/et131x.c:1878:33:    got unsigned int [noderef] <asn:2>*<noident>
drivers/staging/et131x/et131x.c:1879:33: warning: incorrect type in assignment (different address spaces)
drivers/staging/et131x/et131x.c:1879:33:    expected unsigned int [usertype] *base_hi
drivers/staging/et131x/et131x.c:1879:33:    got unsigned int [noderef] <asn:2>*<noident>
drivers/staging/et131x/et131x.c:1880:33: warning: incorrect type in assignment (different address spaces)
drivers/staging/et131x/et131x.c:1880:33:    expected unsigned int [usertype] *base_lo
drivers/staging/et131x/et131x.c:1880:33:    got unsigned int [noderef] <asn:2>*<noident>
drivers/staging/et131x/et131x.c:1898:24: warning: incorrect type in argument 2 (different address spaces)
drivers/staging/et131x/et131x.c:1898:24:    expected void volatile [noderef] <asn:2>*addr
drivers/staging/et131x/et131x.c:1898:24:    got unsigned int [usertype] *base_hi
drivers/staging/et131x/et131x.c:1900:24: warning: incorrect type in argument 2 (different address spaces)
drivers/staging/et131x/et131x.c:1900:24:    expected void volatile [noderef] <asn:2>*addr
drivers/staging/et131x/et131x.c:1900:24:    got unsigned int [usertype] *base_lo
drivers/staging/et131x/et131x.c:1901:60: warning: incorrect type in argument 2 (different address spaces)
drivers/staging/et131x/et131x.c:1901:60:    expected void volatile [noderef] <asn:2>*addr
drivers/staging/et131x/et131x.c:1901:60:    got unsigned int [usertype] *num_des
drivers/staging/et131x/et131x.c:1902:39: warning: incorrect type in argument 2 (different address spaces)
drivers/staging/et131x/et131x.c:1902:39:    expected void volatile [noderef] <asn:2>*addr
drivers/staging/et131x/et131x.c:1902:39:    got unsigned int [usertype] *full_offset
drivers/staging/et131x/et131x.c:1910:24: warning: incorrect type in argument 2 (different address spaces)
drivers/staging/et131x/et131x.c:1910:24:    expected void volatile [noderef] <asn:2>*addr
drivers/staging/et131x/et131x.c:1910:24:    got unsigned int [usertype] *min_des
drivers/staging/et131x/et131x.c:2583:32: warning: incorrect type in assignment (different address spaces)
drivers/staging/et131x/et131x.c:2583:32:    expected unsigned int [usertype] *offset
drivers/staging/et131x/et131x.c:2583:32:    got unsigned int [noderef] <asn:2>*<noident>
drivers/staging/et131x/et131x.c:2585:32: warning: incorrect type in assignment (different address spaces)
drivers/staging/et131x/et131x.c:2585:32:    expected unsigned int [usertype] *offset
drivers/staging/et131x/et131x.c:2585:32:    got unsigned int [noderef] <asn:2>*<noident>
drivers/staging/et131x/et131x.c:2602:24: warning: incorrect type in argument 2 (different address spaces)
drivers/staging/et131x/et131x.c:2602:24:    expected void volatile [noderef] <asn:2>*addr
drivers/staging/et131x/et131x.c:2602:24:    got unsigned int [usertype] *offset
drivers/staging/et131x/et131x.c:4093:13: warning: symbol 'et131x_isr' was not declared. Should it be static?

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-22 09:15:18 -08:00
Mark Einon 26ef1021c1 staging: et131x: Modify block comments to fit with networking style
In preparation for moving et131x to drivers/net, fixup the block
comments to match the preferred networking style - no /* on separate
line, but */ are on a seperate line.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-22 08:58:44 -08:00
Mark Einon c655dee929 staging: et131x: Trivial camel case fixes
Checkpatch now highlights some camel case flag names. Fix these issues.

Also fix some remaining lines > 80chars issues for completeness.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-22 08:58:44 -08:00
Mark Einon c8b0a484cc staging: et131x: Fix endian bugs in et131x_get_regs()
et131x_get_regs() calls et131x_mii_read(), passing the address of a u32
which is cast to a (u16 *). This works fine for little endian systems,
but not for big endian. Change so that the types are cast, not pointers
to the types.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-22 08:58:44 -08:00
Mark Einon 6903098c16 staging: et131x: Only configure regs if link state changes
Some config regs get set whenever adjust_link() is called. Change this
so that these registers only get set when the link state changes to UP.

Also remove unnecessary second assignment of boot_coma.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-17 13:52:37 -08:00
Florian Fainelli f9a8f83b04 net: phy: remove flags argument from phy_{attach, connect, connect_direct}
The flags argument of the phy_{attach,connect,connect_direct} functions
is then used to assign a struct phy_device dev_flags with its value.
All callers but the tg3 driver pass the flag 0, which results in the
underlying PHY drivers in drivers/net/phy/ not being able to actually
use any of the flags they would set in dev_flags. This patch gets rid of
the flags argument, and passes phydev->dev_flags to the internal PHY
library call phy_attach_direct() such that drivers which actually modify
a phy device dev_flags get the value preserved for use by the underlying
phy driver.

Acked-by: Kosta Zertsekel <konszert@marvell.com>
Signed-off-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-14 15:11:50 -05:00
Mark Einon a129be84ba staging: et131x: Use register defines instead of magic numbers
Use register name defines instead of magic numbers where a bit of
clarity would be useful.

Also a small typo fix and some register prefixes added, for further
clarity.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-07 14:03:32 -08:00
Mark Einon 3040d05685 staging: et131x: Replace rxdma csr register magic numbers with defines
Several magic numbers were used to represent rxdma csr register bitmasks.
Replace them with descriptive defines.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-07 14:03:32 -08:00
Jiri Pirko 7826d43f2d ethtool: fix drvinfo strings set in drivers
Use strlcpy where possible to ensure the string is \0 terminated.
Use always sizeof(string) instead of 32, ETHTOOL_BUSINFO_LEN
and custom defines.
Use snprintf instead of sprint.
Remove unnecessary inits of ->fw_version
Remove unnecessary inits of drvinfo struct.

Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-06 21:06:31 -08:00
Mark Einon 3781683e5c staging: et131x: Removing final checkpatch errors, all line >80 chars
Trivial Whitespace changes only. No checkpatch errors exist in et131x
after this change.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-21 13:57:28 -08:00
Mark Einon d959df0a49 staging: et131x: Replace kmem_cache use with plain kmalloc/kfree
The use of a kmem_cache was noted as being unusual in the TODO. Replace
the kmem_cache with kmalloc/kfree so that the code is less suprising.

Also tidy up the mess that was the et131x_init_recv() out of memory
error path.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-21 13:57:28 -08:00
Mark Einon 9967bd4842 staging: et131x: Remove incorrect comments regarding alignment
A previous change removed code that aligned memory returned from
dma_alloc_coherent() to a 4k boundary, which was not necessary.

Some comments regarding this alignment still exist, so remove them
as they no longer apply.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-21 13:57:28 -08:00
Mark Einon 823bb2e8e1 staging: et131x: Reduce indenting in et131x_rx_dma_memory_free()
This change negates an 'if' statement, allowing a large block of code
to be un-indented, making the code more readable.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-21 13:57:27 -08:00
Mark Einon 1a2bd6b257 staging: et131x: Remove alignment offset padding on DMA buffer allocation/free
This padding was used to align buffers to a 4k boundary when returned
from dma_alloc_coherent(). As the buffers are already 4k aligned, and
the alignment no longer performed, the padding is not needed.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-21 13:57:27 -08:00
Mark Einon 15ffde4d36 staging: et131x: Refactor et131x_isr() to remove indenting
By negating a 'status' variable check in et131x_isr(), we can remove
the indenting of a large block of code, increasing the readability.

This patch does exactly that.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-21 13:57:27 -08:00
Bill Pemberton 0b5e409224 staging: et131x: remove use of __devexit_p
CONFIG_HOTPLUG is going away as an option so __devexit_p is no longer
needed.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Cc: devel@driverdev.osuosl.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-21 13:57:25 -08:00
Bill Pemberton fe5c49b332 staging: et131x: remove use of __devinit
CONFIG_HOTPLUG is going away as an option so __devinit is no longer
needed.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Acked-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-21 13:57:25 -08:00
Bill Pemberton 596c5dd302 staging: et131x: remove use of __devexit
CONFIG_HOTPLUG is going away as an option so __devexit is no
longer needed.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Acked-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-21 13:57:24 -08:00
Mark Einon d3c75e8dc8 staging: et131x: Remove unnecessary DMA address alignment code
"The cpu return address and the DMA bus master address are both
guaranteed to be aligned to the smallest PAGE_SIZE order which
is greater than or equal to the requested size."

There are several places in the et131x.c code where these addresses are
aligned to a 4k boundary after a call to dma_alloc_coherent(),
needlessly.

Remove these alignment offset calculations, and the
et131x_align_allocated_memory() call which is only used for 4k
alignments.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-13 15:06:46 -08:00
Mark Einon 8764893311 staging: et131x: Avoid unnecessary calculations in for loop
In et131x_rx_dma_memory_alloc(), we loop over fbr_entries - the values of
fbr_align and fbr_chunksize calculated in the loop do not depend on the
loop counter and are the same for all loop iterations.

Take the calculations of these values out of the loop, as we only
need to calculate them once per loop, not once per loop iteration.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-13 15:06:46 -08:00
Mark Einon f0ada6784f staging: et131x: Align ring_index and fbr[] indicies
A ring_index value of 0 is being used to reference the free buffer ring
fbr[1] and ring_index=1 is used to reference fbr[0]. Avoid this
confusing referencing by swapping the indicies so that ring_index=0
refers to fbr[0] and vice versa.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-02 11:30:19 -07:00
Mark Einon 4ab07c96d2 staging: et131x: Remove unused buffer[1,2] variables.
The fbr_lookup struct variables buffer1 and buffer2 are only assigned
and never used, so remove them.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-02 11:30:19 -07:00
Mark Einon 01e14a4c58 staging: et131x: Add ethtool printout to match MII regs
In the ethtool call et131x_get_regs(), some MII regs are missing.
Add them to the regs returned.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-31 14:49:09 -07:00
Mark Einon c35eb3ae57 staging: et131x: Remove unnecessary PHY register write
The PHY registers are now being controlled from the connected phydev,
so there shouldn't be any reason for the et131x code to perform any
extra setup. Removing the interrupt setup code, and register defines
that are now unused.

On testing, no changes in behaviour were experienced.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-30 12:30:14 -07:00
Mark Einon 186c426ddf staging: et131x: Remove unnecessary NULL pointer assignments
During a previous refactoring excerise, two NULL pointer assingments
were moved to their respective pointer declarations. Dan Carpenter
correctly points out that these assignments are not needed.
Removing them.

Also two small whitespace changes - rejoining split lines, as they are
now less than 80 chars.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-30 12:30:13 -07:00
Mark Einon 96d3927868 staging: et131x: Update TODO list in README
-Added some extra items to the TODO list.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-30 12:30:13 -07:00
Mark Einon 242187aa7b staging: et131x: Refactor nic_rx_pkts() to remove indenting
In nic_rx_pkts() some large chunks of code are indented in 'if (len)'
sections. Refactor the code to remove these indents and re-join longer
split lines.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-30 12:30:13 -07:00
Mark Einon 788ca84ac7 staging: et131x: Remove duplicate code for fbr[0, 1]
Several places in et131x.c code is duplicated for fbr[0] and fbr[1].
Remove the duplicate lines and use loops to run over both indicies.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-30 12:30:13 -07:00
Mark Einon 983e4b3566 staging: et131x: Fix i386 build warnings from use of dma_addr_t
dma_addr_t can be of size 64 or 32bits, depending on the architecture.

This fixes these build warnings for ARCH=i386, and also tested on x86_64:

drivers/staging/et131x/et131x.c: In function ‘et131x_rx_dma_memory_alloc’:
drivers/staging/et131x/et131x.c:2356:11: warning: passing argument 2 of ‘et131x_align_allocated_memory’ from incompatible pointer type [enabled by default]
drivers/staging/et131x/et131x.c:2260:13: note: expected ‘u64 *’ but argument is of type ‘dma_addr_t *’
drivers/staging/et131x/et131x.c:2378:11: warning: passing argument 2 of ‘et131x_align_allocated_memory’ from incompatible pointer type [enabled by default]
drivers/staging/et131x/et131x.c:2260:13: note: expected ‘u64 *’ but argument is of type ‘dma_addr_t *’
drivers/staging/et131x/et131x.c: In function ‘free_send_packet’:
drivers/staging/et131x/et131x.c:3540:5: warning: left shift count >= width of type [enabled by default]

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-23 19:57:02 -07:00
Mark Einon b5254867f9 staging: et131x: Remove USE_FBR0 define and #ifdefs
USE_FBR0 has always been defined, even in the original driver code.
Remove the define and #ifdef code to leave the code in the same state.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-22 16:02:18 -07:00
Mark Einon 25e8e8ab55 staging: et131x: Use upper_32_bits() instead of '>> 32'
'>> 32 of a 32bit value is undefined in C. The compiler is free
	to do what it likes with this...'

Change all uses of '>> 32' to use upper_32_bits() and use
the corresponding lower_32_bits() to match.

Also remove an incorrect comment about dma alloc always returning 32bit
addresses.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-22 16:02:18 -07:00
Mark Einon 55b45b8ef1 staging: et131x: Remove fbr_lookup.real_physaddr
fbr_lookup.real_physaddr is only being used as a pseudonym for
fbr_lookup.ring_physaddr, so remove it and rename all instances to
ring_physaddr.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-22 16:02:18 -07:00
Mark Einon 998f6dfb61 staging: et131x: Fix 64bit tx dma address handling
The driver checks that the device can handle 64bit DMA addressing in
et131x_pci_setup(), but then assumes that the top dword of a tx dma
address is always zero when creating a dma mapping in nic_send_packet().
Fix the mapping to use the higher dword of the dma_addr_t returned by
dma_map_single() and skb_frag_dma_map().

Also remove incorrect comments stating that dma_map_single() only returns
a 32 bit address.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-22 16:01:32 -07:00
Mark Einon f1b540b92c staging: et131x: Use skb_headlen() where appropriate
(skb->len - skb->data_len) is used in several places in the et131x
driver code. Converted all instances of this to use skb_headlen()
which is more readable.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-22 16:01:32 -07:00
Linus Torvalds def7cb8cd4 Staging tree update for 3.7-rc1
Here is the big staging tree update for the 3.7-rc1 merge window.
 
 There are a few patches in here that are outside of the staging area,
 namely HID and IIO patches, but all of them have been acked by the
 relevant subsystem maintainers.  The IIO stuff is still coming in
 through this tree as it hasn't entirely moved out of the staging tree,
 but is almost there.
 
 Other than that, there wa a ton of work on the comedi drivers to make
 them more readable and the correct style.  Doing that removed a lot of
 code, but we added a new driver to the staging tree, so we didn't end up
 with a net reduction this time around:
  662 files changed, 51649 insertions(+), 26582 deletions(-)
 
 All of these patches have been in the linux-next tree already.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.19 (GNU/Linux)
 
 iEYEABECAAYFAlBp32YACgkQMUfUDdst+ymU5QCgm8KWB+dAO8ZFbmzhhm3C0VFl
 wB0AoKbDj/tCiUHkJ70u/i3OHueKkpet
 =ut2/
 -----END PGP SIGNATURE-----

Merge tag 'staging-3.6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging

Pull staging tree update from Greg Kroah-Hartman:
 "Here is the big staging tree update for the 3.7-rc1 merge window.

  There are a few patches in here that are outside of the staging area,
  namely HID and IIO patches, but all of them have been acked by the
  relevant subsystem maintainers.  The IIO stuff is still coming in
  through this tree as it hasn't entirely moved out of the staging tree,
  but is almost there.

  Other than that, there wa a ton of work on the comedi drivers to make
  them more readable and the correct style.  Doing that removed a lot of
  code, but we added a new driver to the staging tree, so we didn't end
  up with a net reduction this time around:

   662 files changed, 51649 insertions(+), 26582 deletions(-)

  All of these patches have been in the linux-next tree already.

  Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>"

* tag 'staging-3.6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (1094 commits)
  staging: comedi: jr3_pci: fix iomem dereference
  staging: comedi: drivers: use comedi_fc.h cmdtest helpers
  Staging: winbond: usb_free_urb(NULL) is safe
  Staging: winbond: checkpatch cleanup
  Staging: winbond: Removed undesired spaces, lines and tabs
  Staging: winbond: Typo corrections in comments
  Staging: winbond: Changed c99 comments to c89 comments
  staging: r8712u: Do not queue cloned skb
  staging: comedi: ni_mio_common: always lock in ni_ai_poll()
  staging: comedi: s626: add FIXME comment
  staging: comedi: s626: don't dereference insn->data
  staging: comedi: s526: fix if() check in s526_gpct_winsn()
  staging: comedi: s626: cleanup comments in s626_initialize()
  staging: comedi: s626: remove clear of kzalloc'ed data
  staging: comedi: s626: remove 'WDInterval' from private data
  staging: comedi: s626: remove 'ChargeEnabled' from private data
  staging: comedi: s626: remove 'IsBoardRevA' comment
  staging: comedi: s626: #if 0 out the "SAA7146 BUG WORKAROUND"
  staging: comedi: s626: remove 'allocatedBuf' from private data
  staging: comedi: s626: add final attach message
  ...
2012-10-01 12:11:39 -07:00
Wei Yongjun c14d01b8a1 staging: et131x: using is_zero_ether_addr() to simplify the code
Using is_zero_ether_addr() to simplify the code

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-04 14:14:08 -07:00
Jiang Liu 532c5f69e2 et131x: Use PCI Express Capability accessors
Use PCI Express Capability access functions to simplify et131x driver.

Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2012-08-23 10:11:16 -06:00
Toshiaki Yamane e58b89dade staging/et131x: fix checkpatch warnings
The below checkpatch warns was fixed,

drivers/staging/et131x/et131x.c:2556: WARNING: Prefer pr_info(... to printk(KERN_INFO, ...
drivers/staging/et131x/et131x.c:2577: WARNING: Prefer pr_info(... to printk(KERN_INFO, ...
drivers/staging/et131x/et131x.c:5189: WARNING: Prefer pr_info(... to printk(KERN_INFO, ...

And fixed below,
-added pr_fmt
-fixed printk formats for dma_addr_t
-converted printk to netdev_info

Signed-off-by: Toshiaki Yamane <yamanetoshi@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-19 16:01:30 -07:00
Devendra Naga a6e28b3420 staging/et131x: use SET_ETHTOOL_OPS directly
using a wrapper around SET_ETHTOOL_OPS macro is not actually required,

remove and use SET_ETHTOOL_OPS directly.

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-16 18:52:51 -07:00
Devendra Naga 89812b1f5a staging/et131x: use module_pci_driver macro
remove code duplicating module_pci_driver
and also the obvious comments about the _init and _exit points.

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-11 17:26:02 -07:00
Dan Carpenter b5b86a4d99 Staging: et131x: fix | vs & typos
These two places seem like they should be using bitwise OR instead of
bitwise AND.  The first one is a noop which is equivalent to:

	imr |= (0x0100 & 0x0004 & 0x0001);

The second is sets lcr2 to zero instead of just clearing the high bits.

	lcr2 &= (0x00F0 & 0x000F);

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-11 08:47:51 -07:00
Adnan Ali 397d3e6029 Staging: et131x: fix coding style issues
This commit fixes coding style issues including braces
position and line wrapping.

Signed-off-by: Adnan Ali <adnan.ali@codethink.co.uk>
Reviewed-by: Jannis Pohlmann <jannis.pohlmann@codethink.co.uk>
Acked-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-11 08:47:51 -07:00
joseph daniel bf3313a1b6 staging: et131x: Fix coding style issues
Signed-off-by: joseph daniel <josephdanielwalter@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-01 21:48:44 -07:00