Commit graph

191300 commits

Author SHA1 Message Date
Jingoo Han bbfa6d0aa5 net: mv643xx_eth: use dev_get_platdata()
Use the wrapper function for retrieving the platform data instead of
accessing dev->platform_data directly. This is a cosmetic change
to make the code simpler and enhance the readability.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-08-30 17:43:36 -04:00
Jingoo Han 94660ba090 net: fec: use dev_get_platdata()
Use the wrapper function for retrieving the platform data instead of
accessing dev->platform_data directly. This is a cosmetic change
to make the code simpler and enhance the readability.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Fugang Duan  <B38611@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-08-30 17:43:36 -04:00
Jingoo Han 420fcd8220 net: ethoc: use dev_get_platdata()
Use the wrapper function for retrieving the platform data instead of
accessing dev->platform_data directly. This is a cosmetic change
to make the code simpler and enhance the readability.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-08-30 17:43:35 -04:00
Jingoo Han cd4e2e4b36 net: dm9000: use dev_get_platdata()
Use the wrapper function for retrieving the platform data instead of
accessing dev->platform_data directly. This is a cosmetic change
to make the code simpler and enhance the readability.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-08-30 17:43:35 -04:00
Jingoo Han b96f64dd47 net: ep93xx_eth: use dev_get_platdata()
Use the wrapper function for retrieving the platform data instead of
accessing dev->platform_data directly. This is a cosmetic change
to make the code simpler and enhance the readability.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-08-30 17:43:35 -04:00
Jingoo Han cf0e7794ba net: bcm63xx_enet: use dev_get_platdata()
Use the wrapper function for retrieving the platform data instead of
accessing dev->platform_data directly. This is a cosmetic change
to make the code simpler and enhance the readability.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-08-30 17:43:35 -04:00
Jingoo Han 1fc2c469ae net: au1000_eth: use dev_get_platdata()
Use the wrapper function for retrieving the platform data instead of
accessing dev->platform_data directly. This is a cosmetic change
to make the code simpler and enhance the readability.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-08-30 17:43:35 -04:00
Jingoo Han a63b82c44b net: bfin_mac: use dev_get_platdata()
Use the wrapper function for retrieving the platform data instead of
accessing dev->platform_data directly. This is a cosmetic change
to make the code simpler and enhance the readability.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-08-30 17:43:35 -04:00
Jingoo Han a3ea280004 net: ax88796: use dev_get_platdata()
Use the wrapper function for retrieving the platform data instead of
accessing dev->platform_data directly. This is a cosmetic change
to make the code simpler and enhance the readability.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-08-30 17:43:34 -04:00
Lutz Jaenicke 7174012955 macvlan: fix typo in assignment
commit 3b04ddde02
"[NET]: Move hardware header operations out of netdevice."
moved the handling into macvlan setup adding
  dev->header_ops         = &macvlan_hard_header_ops,
At the end of the line the ',' should have been a ';'

Signed-off-by: Lutz Jaenicke <ljaenicke@innominate.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-08-30 17:30:36 -04:00
Sonic Zhang e2a240c7d3 driver:net:stmmac: Disable DMA store and forward mode if platform data force_thresh_dma_mode is set.
Some synopsys ip implementation doesn't support DMA store and forward mode,
such as BF60x. So, set force_thresh_dma_mode to use DMA thresholds only.
Update document and devicetree as well.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Acked-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-08-30 17:26:09 -04:00
Joe Perches ede23fa816 drivers:net: Convert dma_alloc_coherent(...__GFP_ZERO) to dma_zalloc_coherent
__GFP_ZERO is an uncommon flag and perhaps is better
not used.  static inline dma_zalloc_coherent exists
so convert the uses of dma_alloc_coherent with __GFP_ZERO
to the more common kernel style with zalloc.

Remove memset from the static inline dma_zalloc_coherent
and add just one use of __GFP_ZERO instead.

Trivially reduces the size of the existing uses of
dma_zalloc_coherent.

Realign arguments as appropriate.

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Acked-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-08-29 21:55:23 -04:00
Ben Hutchings f7a6d2c442 sfc: Update copyright banners
Update the dates for files that have been added to in 2012-2013.
Drop the 'Solarstorm' brand name that's still lingering here.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2013-08-29 23:34:51 +01:00
Gerhard Sittig 1149108e2f can: mscan: improve clock API use
the .get_clock() callback is run from probe() and might allocate
resources, introduce a .put_clock() callback that is run from remove()
to undo any allocation activities

prepare and enable the clocks in open(), disable and unprepare the
clocks in close() if clocks were acquired during probe(), to not assume
knowledge about which activities are done in probe() and remove()

use devm_get_clk() to lookup the SYS and REF clocks, to have the clocks
put upon device shutdown

store pointers to data structures upon successful allocation already
instead of deferral until complete setup, such that subroutines in the
setup sequence may access those data structures as well to track their
resource acquisition

since clock allocation remains optional, the release callback as well as
the enable/disable calls in open/close are optional as well

Cc: linux-can@vger.kernel.org
Cc: netdev@vger.kernel.org
Signed-off-by: Gerhard Sittig <gsi@denx.de>
Signed-off-by: Anatolij Gustschin <agust@denx.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2013-08-29 22:49:35 +02:00
Gerhard Sittig 3a09b12e0c can: mscan: add a comment on reg to idx mapping
add a comment about the magic of deriving an MSCAN component index
from the peripheral's physical address / register offset

Cc: linux-can@vger.kernel.org
Cc: netdev@vger.kernel.org
Signed-off-by: Gerhard Sittig <gsi@denx.de>
Signed-off-by: Anatolij Gustschin <agust@denx.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2013-08-29 22:49:35 +02:00
Sergei Shtylyov 488594883e sh_eth: no need to call ether_setup()
There's no need to call ether_setup() in the driver since prior alloc_etherdev()
call already arranges for it.

Suggested-by: Denis Kirjanov <kda@linux-powerpc.org>
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-08-29 16:39:31 -04:00
Veaceslav Falico 3e32582f7d bonding: pr_debug instead of pr_warn in bond_arp_send_all
They're simply annoying and will spam dmesg constantly if we hit them, so
convert to pr_debug so that we still can access them in case of debugging.

CC: Jay Vosburgh <fubar@us.ibm.com>
CC: Andy Gospodarek <andy@greyhouse.net>
Signed-off-by: Veaceslav Falico <vfalico@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-08-29 16:19:43 -04:00
Veaceslav Falico e868b0c938 bonding: remove vlan_list/current_alb_vlan
Currently there are no real users of vlan_list/current_alb_vlan, only the
helpers which maintain them, so remove them.

CC: Jay Vosburgh <fubar@us.ibm.com>
CC: Andy Gospodarek <andy@greyhouse.net>
Signed-off-by: Veaceslav Falico <vfalico@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-08-29 16:19:43 -04:00
Veaceslav Falico 5bf94b839a bonding: make alb_send_learning_packets() use upper dev list
Currently, if there are vlans on top of bond, alb_send_learning_packets()
will never send LPs from the bond itself (i.e. untagged), which might leave
untagged clients unupdated.

Also, the 'circular vlan' logic (i.e. update only MAX_LP_BURST vlans at a
time, and save the last vlan for the next update) is really suboptimal - in
case of lots of vlans it will take a lot of time to update every vlan. It
is also never called in any hot path and sends only a few small packets -
thus the optimization by itself is useless.

So remove the whole current_alb_vlan/MAX_LP_BURST logic from
alb_send_learning_packets(). Instead, we'll first send a packet untagged
and then traverse the upper dev list, sending a tagged packet for each vlan
found. Also, remove the MAX_LP_BURST define - we already don't need it.

CC: Jay Vosburgh <fubar@us.ibm.com>
CC: Andy Gospodarek <andy@greyhouse.net>
Signed-off-by: Veaceslav Falico <vfalico@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-08-29 16:19:43 -04:00
Veaceslav Falico 7aa6498123 bonding: split alb_send_learning_packets()
Create alb_send_lp_vid(), which will handle the skb/lp creation, vlan
tagging and sending, and use it in alb_send_learning_packets().

This way all the logic remains in alb_send_learning_packets(), which
becomes a lot more cleaner and easier to understand.

CC: Jay Vosburgh <fubar@us.ibm.com>
CC: Andy Gospodarek <andy@greyhouse.net>
Signed-off-by: Veaceslav Falico <vfalico@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-08-29 16:19:43 -04:00
Veaceslav Falico a59d3d21ea bonding: use vlan_uses_dev() in __bond_release_one()
We always hold the rtnl_lock() in __bond_release_one(), so use
vlan_uses_dev() instead of bond_vlan_used().

CC: Jay Vosburgh <fubar@us.ibm.com>
CC: Andy Gospodarek <andy@greyhouse.net>
Signed-off-by: Veaceslav Falico <vfalico@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-08-29 16:19:43 -04:00
Veaceslav Falico 50223ce4be bonding: convert bond_has_this_ip() to use upper devices
Currently, bond_has_this_ip() is aware only of vlan upper devices, and thus
will return false if the address is associated with the upper bridge or any
other device, and thus will break the arp logic.

Fix this by using the upper device list. For every upper device we verify
if the address associated with it is our address, and if yes - return true.

CC: Jay Vosburgh <fubar@us.ibm.com>
CC: Andy Gospodarek <andy@greyhouse.net>
Signed-off-by: Veaceslav Falico <vfalico@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-08-29 16:19:42 -04:00
Veaceslav Falico 27bc11e638 bonding: make bond_arp_send_all use upper device list
Currently, bond_arp_send_all() is aware only of vlans, which breaks
configurations like bond <- bridge (or any other 'upper' device) with IP
(which is quite a common scenario for virt setups).

To fix this we convert the bond_arp_send_all() to first verify if the rt
device is the bond itself, and if not - to go through its list of upper
vlans and their respectiv upper devices (if the vlan's upper device matches
- tag the packet), if still not found - go through all of our upper list
devices to see if any of them match the route device for the target. If the
match is a vlan device - we also save its vlan_id and tag it in
bond_arp_send().

Also, clean the function a bit to be more readable.

CC: Vlad Yasevich <vyasevic@redhat.com>
CC: Jay Vosburgh <fubar@us.ibm.com>
CC: Andy Gospodarek <andy@greyhouse.net>
Signed-off-by: Veaceslav Falico <vfalico@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-08-29 16:19:42 -04:00
Veaceslav Falico c752af2c55 bonding: use netdev_upper list in bond_vlan_used
Convert bond_vlan_used() to traverse the upper device list to see if we
have any vlans above us. It's protected by rcu, and in case we are holding
rtnl_lock we should call vlan_uses_dev() instead - it's faster.

CC: Jay Vosburgh <fubar@us.ibm.com>
CC: Andy Gospodarek <andy@greyhouse.net>
Signed-off-by: Veaceslav Falico <vfalico@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-08-29 16:19:42 -04:00
David S. Miller 6d508cce92 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-next
Jeff Kirsher says:

====================
This series contains updates to ixgbe.

Jacob provides a fix for 82599 devices where it can potentially keep link
lights up when the adapter has gone down.

Mark provides a fix to resolve the possible use of uninitialized memory
by checking the return value on EEPROM reads.

Don provides 2 patches, one to fix a issue where we were traversing the
Tx ring with the value of IXGBE_NUM_RX_QUEUES which currently happens
to have the correct value but this is misleading.  A change later, could
easily make this no longer correct so when traversing the Tx ring, use
netdev->num_tx_queues.  His second patch does some minor clean ups of log
messages.

Emil provides the remaining ixgbe patches.  First he fixes the link test
where forcing the laser before the link check can lead to inconsistent
results because it does not guarantee that the link will be negotiated
correctly.  Then he initializes the message buffer array to 0 in order
to avoid using random numbers from the memory as a MAC address for the
VF.  Emil also fixes the read loop for the I2C data to account for the
offset for SFP+ modules.  Lastly, Emil provides several patches to add
support for QSFP modules where 1Gbps support is added as well as support
for older QSFP active direct attach cables which pre-date SFF-8436 v3.6.

v2: Fixed patch 4 description and added blank line based on feedback from
    Sergei Shtylyov
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
2013-08-29 16:13:32 -04:00
Fabio Estevam 322555f52b fec: Use NAPI_POLL_WEIGHT
Instead of using a custom 'FEC_NAPI_WEIGHT', just use the generic
'NAPI_POLL_WEIGHT' definition instead.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-08-29 15:58:34 -04:00
Boris BREZILLON 7daa78e352 net/cadence/macb: fix invalid 0 return if no phy is discovered on mii init
Replace misleading -1 (-EPERM) by a more appropriate return code (-ENXIO)
in macb_mii_probe function.
Save macb_mii_probe return before branching to err_out_unregister to avoid
erronous 0 return.

Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-08-29 15:21:45 -04:00
Jisheng Zhang 03536cc3ad net: mdio-sun4i: Convert to devm_* api
Use devm_ioremap_resource instead of of_iomap() and devm_kzalloc()
instead of kmalloc() to make cleanup paths simpler. This patch also
fixes the resource leak caused by missing corresponding iounamp()
of the of_iomap().

Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-08-29 14:54:49 -04:00
Ben Hutchings 8127d661e7 sfc: Add support for Solarflare SFC9100 family
This adds support for the EF10 network controller architecture and the
SFC9100 family, starting with SFC9120 'Farmingdale', and bumps the
driver version to 4.0.

New features in the SFC9100 family include:

- Flexible allocation of internal resources to PCIe physical and virtual
  functions under firmware control
- RX event merging to reduce DMA writes at high packet rates
- Integrated RX timestamping
- PIO buffers for lower TX latency
- Firmware-driven data path that supports additional offload features
  and filter types
- Delivery of packets between functions and to multiple recipients,
  allowing firmware to implement a vswitch
- Multiple RX flow hash (RSS) contexts with their own hash keys and
  indirection tables
- 40G MAC (single port only)

...not all of which are enabled in this initial driver or the initial
firmware release.

Much of the new code is by Jon Cooper.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2013-08-29 19:19:29 +01:00
John W. Linville 0d8165e9fc Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem
Conflicts:
	drivers/net/wireless/iwlwifi/pcie/trans.c
2013-08-29 14:08:24 -04:00
Ben Hutchings 4c75b43a77 sfc: Make efx_mcdi_{init,fini}() call efx_mcdi_drv_attach()
This should be done during MCDI initialisation for any NIC.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2013-08-29 19:06:34 +01:00
Matthew Slattery bedca866f8 sfc: Allocate NVRAM partition ID range for PHY images
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2013-08-29 18:12:17 +01:00
Ben Hutchings 9c51716512 sfc: Add EF10 register and structure definitions
Also update comments and assertions in io.h:
- EF10 does not have a general BIU collector and does not have the
  bug affecting TIMER_COMMAND_REG[0] on Falcon/Siena
- The WPTR field moved within RX_DESC_UPD_REG and TX_DESC_UPD_REG.
  Adjust efx_writed_page() accordingly

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2013-08-29 18:12:16 +01:00
Ben Hutchings ba8977bdb2 sfc: Extend struct efx_tx_buffer to allow pushing option descriptors
The TX path firmware for EF10 supports 'option descriptors' to control
offloads and various other features.  Add a flag and field for these
in struct efx_tx_buffer, and don't treat them as DMA descriptors on
completion.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2013-08-29 18:12:14 +01:00
Alexandre Rames 3881d8ab06 sfc: Use a global count of active queues instead of pending drains
On EF10, the firmware will initiate a queue flush in certain
error cases.  We need to accept that flush events might appear
at any time after a queue has been initialised, not just when
we try to flush them.

We can handle Falcon-architecture in just the same way.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2013-08-29 18:12:13 +01:00
Jon Cooper e8c68c0a09 sfc: Prepare for RX scatter on EF10
RX DMA scatter is always enabled on EF10.  Adjust the common RX
completion handling to allow for this.

RX completion events on EF10 include the length used from a single
descriptor, not the cumulative length used.  Add a field to struct
efx_rx_queue to hold the cumulative length.

[bwh: Also fix a related comment]
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2013-08-29 18:12:12 +01:00
Ben Hutchings 15acb1cea5 sfc: Initialise IRQ moderation for all NIC types from efx_init_eventq()
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2013-08-29 18:12:11 +01:00
Ben Hutchings c15eed220f sfc: Allow efx_nic_type::dimension_resources to fail
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2013-08-29 18:12:09 +01:00
Jon Cooper 261e4d96b4 sfc: Allow event queue initialisation to fail
On EF10, event queue initialisation requires an MCDI request which
may return failure.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2013-08-29 18:12:08 +01:00
Ben Hutchings b883d0bd4a sfc: Document conditions for multicast replication vs filter replacement
Add the efx_filter_is_mc_recip() function to decide whether a filter
is for a multicast recipient and can coexist with other filters with
the same match values.  Update efx_filter_insert_filter() kernel-doc
to explain the conditions for this.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2013-08-29 18:12:07 +01:00
Ben Hutchings cade715ff1 sfc: Implement asynchronous MCDI requests
This will allow use of MCDI from the data path, in particular for
accelerated RFS.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2013-08-29 18:12:06 +01:00
Ben Hutchings 251111d9a1 sfc: Remove unnecessary use of atomic_t
We can set, get and compare-and-exchange without using atomic_t.
Change efx_mcdi_iface::state to the enum type we really wanted it to
be.

Suggested-by: David Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2013-08-29 18:12:04 +01:00
Ben Hutchings 2f4bcdcca7 sfc: Refactor efx_mcdi_rpc_start() and efx_mcdi_copyin()
Preparation for asynchronous MCDI requests.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2013-08-29 18:12:03 +01:00
Ben Hutchings 38589cdcd0 sfc: Add support for new board sensors
Add support for power and current sensors, which need to be named
differently in sysfs.  Power sensors also require values to be scaled
between MCDI and sysfs, and have no minimum value.

Add definitions of the power, current, fan, and additional temperature
and voltage sensors found on SFA6902F, SFN7022F and SFN7122F.

(Includes a bug fix from Andrew Jackson.)

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2013-08-29 18:11:58 +01:00
Emil Tantilov 9a84fea2ec ixgbe: add support for older QSFP active DA cables
This patch adds support for QSFP active direct attach (DA) cables which
pre-date SFF-8436 v3.6.

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2013-08-29 03:36:55 -07:00
Emil Tantilov 987e1d56b3 ixgbe: include QSFP PHY types in ixgbe_is_sfp()
This patch makes sure that QSFP+ modules use the SFP+ code path for
setting up link.

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2013-08-29 03:30:37 -07:00
Emil Tantilov 61aaf9e807 ixgbe: add 1Gbps support for QSFP+
This patch adds GB speed support for QSFP+ modules.
Autonegotiation is not supported with QSFP+. The user will have to set
the desired speed on both link partners using ethtool advertise setting.

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2013-08-29 03:24:00 -07:00
Emil Tantilov 31c7d2b06b ixgbe: fix SFF data dumps of SFP+ modules from an offset
This patch fixes the read loop for the I2C data to account for the offset.

Also includes a whitespace cleanup and removes ret_val as it is not needed.

CC: Ben Hutchings <bhutchings@solarflare.com>
Reported-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Reviewed-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2013-08-29 03:17:11 -07:00
Don Skidmore 1b1bf31a12 ixgbe: cleanup some log messages
Some minor log messages cleanup, changing the level one message is logged,
adding a bit of detail to another and put all the text on one line.

Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2013-08-29 03:10:37 -07:00
Emil Tantilov b08e1ed9cf ixgbe: zero out mailbox buffer on init
This patch initializes the msgbuf array to 0 in order to avoid using random
numbers from the memory as MAC address for the VF.

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2013-08-29 03:04:18 -07:00
Emil Tantilov 4ec375b1ec ixgbe: fix link test when connected to 1Gbps link partner
This patch is a partial reverse of:
commit dfcc4615f0
Author: Jacob Keller <jacob.e.keller@intel.com>
Date: Thu Nov 8 07:07:08 2012 +0000

  ixgbe: ethtool ixgbe_diag_test cleanup

Specifically forcing the laser before the link check can lead to
inconsistent results because it does not guarantee that the link will be
negotiated correctly. Such is the case when dual speed SFP+ module is
connected to a gigabit link partner.

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2013-08-29 02:58:04 -07:00
Don Skidmore bd8a1b1290 ixgbe: fix incorrect limit value in ring transverse
We were transversing the tx_ring with IXGBE_NUM_RX_QUEUES.  Now this define
happens to have the correct value but this is misleading and a change later
could easily make this no longer true.  I updated it to netdev->num_tx_queues
like we use in ixgbe_get_strings().

Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2013-08-29 02:51:56 -07:00
Mark Rustad be0c27b4ed ixgbe: Check return value on eeprom reads
This patch fixes the possible use of uninitialized memory by checking the
return value on eeprom reads. These issues were identified by static
analysis. In many cases error messages will be produced so that corrupted
eeprom issues will be more visible.

Signed-off-by: Mark Rustad <mark.d.rustad@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2013-08-29 02:45:38 -07:00
Jacob Keller f4f1040ae6 ixgbe: disable link when adapter goes down
This patch fixes an issue with the 82599 adapter where it can potentially keep
link lights up when the adapter has gone down. The patch adds a function which
ensures link is disabled, and calls this function when the adapter transitions
to a down state.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2013-08-29 02:39:26 -07:00
David S. Miller 4c9d546f6c Merge branch 'for-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/bwh/sfc-next
Ben Hutchings says:

====================
1. Further cleanup and refactoring in preparation for EF10.
2. Remove ethtool stats that are always zero on Falcon boards.
3. Add an ethtool stat for merged TX completions.
4. Prepare to support merged RX completions.
5. Prepare to support more hwmon sensors.
6. Add support for new events that are generated by EF10 firmware.
7. Update MC reboot detection for EF10.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
2013-08-29 01:56:01 -04:00
Dan Carpenter 80b17be70b qlcnic: underflow in qlcnic_validate_max_tx_rings()
This function checks the upper bound but it doesn't check for negative
numbers:

	if (txq > QLCNIC_MAX_TX_RINGS) {

I've solved this by making "txq" a u32 type.  I chose that because
->tx_count in the ethtool_channels struct is a __u32.

This bug was added in aa4a1f7df7 ('qlcnic: Enable Tx queue changes using
ethtool for 82xx Series adapter.').

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-08-29 01:24:08 -04:00
Wei Liu 7376419a46 xen-netback: rename functions
As we move to 1:1 model and melt xen_netbk and xenvif together, it would
be better to use single prefix for all functions in xen-netback.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-08-29 01:18:04 -04:00
Wei Liu b3f980bd82 xen-netback: switch to NAPI + kthread 1:1 model
This patch implements 1:1 model netback. NAPI and kthread are utilized
to do the weight-lifting job:

- NAPI is used for guest side TX (host side RX)
- kthread is used for guest side RX (host side TX)

Xenvif and xen_netbk are made into one structure to reduce code size.

This model provides better scheduling fairness among vifs. It is also
prerequisite for implementing multiqueue for Xen netback.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-08-29 01:18:04 -04:00
Wei Liu 43e9d19432 xen-netback: remove page tracking facility
The data flow from DomU to DomU on the same host in current copying
scheme with tracking facility:

       copy
DomU --------> Dom0          DomU
 |                            ^
 |____________________________|
             copy

The page in Dom0 is a page with valid MFN. So we can always copy from
page Dom0, thus removing the need for a tracking facility.

       copy           copy
DomU --------> Dom0 -------> DomU

Simple iperf test shows no performance regression (obviously we copy
twice either way):

  W/  tracking: ~5.3Gb/s
  W/o tracking: ~5.4Gb/s

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Matt Wilson <msw@amazon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-08-29 01:18:04 -04:00
Solomon Peachy 076f0d20b6 cw1200: When debug is enabled, display all wakeup conditions for the wait_event_interruptible_timeout() call.
When trying to debug an interrupt delivery problem I noticed that not
all of the wakeup conditions on the worker thread were included in the
debug message.  This patch rectifies that.

Signed-off-by: Solomon Peachy <pizza@shaftnet.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-08-28 13:58:29 -04:00
Solomon Peachy 7f190230ba cw1200: Display the correct default reference clock.
This is purely a cosmetic bug.

Signed-off-by: Solomon Peachy <pizza@shaftnet.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-08-28 13:58:28 -04:00
Masami Ichikawa 708ff08353 rt2800usb: Add WLI-UC-G300HP's Product ID.
Support Bufallo WLI-UC-G300HP.

Signed-off-by: Masami Ichikawa <masami256@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-08-28 13:58:28 -04:00
Sujith Manoharan 27251e0087 ath9k: Enable D3/L1 ASPM fix for AR9462
AR9462 requires this HW fix for ASPM to work properly.
Also, since WARegVal is used only for the AR8003 family,
use AR_SREV_9300_20_OR_LATER.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-08-28 13:58:27 -04:00
Sujith Manoharan 65c1a4de59 ath9k: Remove unused ANI commands
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-08-28 13:58:27 -04:00
Bing Zhao a16b635f24 mwifiex: break a long line into two lines
It exceeded 80 characters. Split it into two lines.

Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-08-28 13:58:27 -04:00
John W. Linville f3e979a52c Merge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next 2013-08-28 13:51:40 -04:00
John W. Linville 53b2f82848 ath9k: ar9003_eeprom.c:3618 fix variable name typo
drivers/net/wireless/ath/ath9k/ar9003_eeprom.c: In function 'ar9003_hw_ant_ctrl_apply':
>> drivers/net/wireless/ath/ath9k/ar9003_eeprom.c:3618: warning: 'regval' is used uninitialized in this function

It seems obvious that 'regval' should have been 'value'...

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-08-28 11:05:36 -04:00
John W. Linville b35c809708 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless
Conflicts:
	drivers/net/wireless/iwlwifi/pcie/trans.c
	net/mac80211/ibss.c
2013-08-28 10:36:09 -04:00
David S. Miller 45cc3a0c97 Merge branch 'for-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/bwh/sfc-next
Ben Hutchings says:

====================
More refactoring and cleanup, particularly around filter management.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
2013-08-27 21:56:22 -04:00
Ben Hutchings d4fbdcfe93 sfc: Use extended MC_CMD_SENSOR_INFO and MC_CMD_READ_SENSORS
We need to use extended requests to read and get metadata for sensors
numbered > 31.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2013-08-27 22:29:56 +01:00
Alexandre Rames 8c4e720f18 sfc: Return an error code when a sensor is busy.
[bwh: Also name this new state, though we don't expect to see it in an event]
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2013-08-27 22:29:48 +01:00
Ben Hutchings 3dced740c2 sfc: Add support for reading packet length from prefix
Define a flag for struct efx_rx_buffer and efx_rx_packet() that
indicates packet length must be read from the prefix.  If this
is set, read the length in __efx_rx_packet() (when the prefix
should have arrived in cache).

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2013-08-27 22:29:07 +01:00
Ben Hutchings 02e121650b sfc: Add TX merged completion counter
Add a counter for TX merged completion events.

This is implemented in the common TX path, because the NIC event
handlers only know how many descriptors were completed, not how many
packets.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2013-08-27 22:28:47 +01:00
Jon Cooper 43a3739d55 sfc: Generalise packet hash lookup to support EF10 RX prefix
EF10 uses an entirely different RX prefix format from Falcon-arch.
Extend struct efx_nic_type to describe this.

[bwh: Also replace the magic numbers used for the Falcon-arch RX prefix]
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2013-08-27 22:28:24 +01:00
Ben Hutchings 64a27752dc sfc: Rename EFX_PAGE_BLOCK_SIZE to EFX_VI_PAGE_SIZE and adjust comments
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2013-08-27 22:28:14 +01:00
Ben Hutchings ba388fdd08 sfc: Remove early call to efx_nic_type::reconfigure_mac in efx_reset_up()
efx_reset_up() calls efx_nic_type::reconfigure_mac once directly,
then again through efx_start_all() -> efx_start_port() ->
efx->type->reconfigure_mac().

This first call is also made too early to work properly on EF10.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2013-08-27 22:28:02 +01:00
Daniel Pieczko d36a08b4ae sfc: use MCDI epoch flag to improve MC reboot detection in the driver
The Huntington MC will reject all MCDI requests after an MC reboot until it sees
one with the NOT_EPOCH flag clear.  This flag is set by default for all requests,
and then cleared on the first request after we detect that an MC reboot has
occurred.

The old MCDI_STATUS_DELAY_COUNT gave a timeout of 10ms, which was not long enough
for the driver to detect that a reboot had occurred based on the warm boot count
while calling efx_mcdi_poll_reboot() from the loop in efx_mcdi_ev_death().

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2013-08-27 22:27:57 +01:00
Alexandre Rames 3de82b91ea sfc: Add EF10 support for TX/RX DMA error events handling.
Also, since we handle all DMA errors in the same way, merge
RESET_TYPE_(RX|TX)_DESC_FETCH into RESET_TYPE_DMA_ERROR.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2013-08-27 22:27:10 +01:00
Laurence Evans 977a5d5d32 sfc: Add a function pointer to abstract write of host time into NIC shared memory
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2013-08-27 22:27:02 +01:00
Laurence Evans c1d828bdca sfc: PTP MCDI requests need to initialise periph ID field
This field is ignored by Siena firmware but is significant to EF10 firmware.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2013-08-27 22:26:15 +01:00
Ben Hutchings cd0ecc9a6d sfc: Delegate MAC/NIC statistic description to efx_nic_type
Various hardware statistics that are available for Siena are
unavailable or meaningless for Falcon.  Huntington adds further to the
NIC-type-specific statistics, as it has different MAC blocks from
Falcon/Siena.

All NIC types still provide most statistics by DMA, and use
little-endian byte order.

Therefore:
1. Add some general utility functions for reporting hardware statistics,
   efx_nic_describe_stats() and efx_nic_update_stats().
2. Add an efx_nic_type::describe_stats operation to get the number and
   names of statistics, implemented using efx_nic_describe_stats()
3. Change efx_nic_type::update_stats to store the core statistics
   (struct rtnl_link_stats64) or full statistics (array of u64) in a
   caller-provided buffer.  Use efx_nic_update_stats() to aid in the
   implementation.
4. Rename struct efx_ethtool_stat to struct efx_sw_stat_desc and
   EFX_ETHTOOL_NUM_STATS to EFX_ETHTOOL_SW_STAT_COUNT.
5. Remove efx_nic::mac_stats and struct efx_mac_stats.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2013-08-27 22:25:55 +01:00
Ben Hutchings b681e57c38 sfc: Remove driver-local struct ethtool_string
It's not really helpful to pretend ethtool string arrays are
structured.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2013-08-27 22:25:42 +01:00
Ben Hutchings e51361249b sfc: Remove more left-overs from Falcon GMAC support
We only ever used the XMAC (10G link speed) in production.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2013-08-27 22:25:29 +01:00
Ben Hutchings 45a3fd55ac sfc: Move MTD operations into efx_nic_type
Merge the per-NIC-type MTD probe selection and struct efx_mtd_ops into
struct efx_nic_type.  Move the implementations into the appropriate
source files.

Several NVRAM functions are now only called from MTD operations which
are now implemented in the same file (falcon.c or mcdi.c).  There is no
need for them to be extern, or to be defined at all if CONFIG_SFC_MTD
is not enabled, so move them into the #ifdef CONFIG_SFC_MTD sections
in those files.

Most of the SPI-related definitions are also only used in falcon.c,
so move them there.  Put the remainder of spi.h into nic.h (which
previously included it).

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2013-08-27 22:25:21 +01:00
Steven La 35fdb94b45 e1000e: balance semaphore put/get for 82573
Steven (cc-ed) noticed an imbalance in semaphore put/get for
82573-based NICs. Don't we need something like the following
(untested) patch?

Signed-off-by: Steven La <sla@riverbed.com>
Acked-by: Arthur Kepner <akepner@riverbed.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-08-27 16:05:26 -04:00
Rasesh Mody e9d198403b bna: firmware update to 3.2.1.1
This patch updates the firmware to address the thermal notification issue

Signed-off-by: Rasesh Mody <rmody@brocade.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-08-27 16:03:15 -04:00
Andy King b0eb57cb97 VMXNET3: Add support for virtual IOMMU
This patch adds support for virtual IOMMU to the vmxnet3 module.  We
switch to DMA consistent mappings for anything we pass to the device.
There were a few places where we already did this, but using pci_blah();
these have been fixed to use dma_blah(), along with all new occurrences
where we've replaced kmalloc() and friends.

Also fix two small bugs:
1) use after free of rq->buf_info in vmxnet3_rq_destroy()
2) a cpu_to_le32() that should have been a cpu_to_le64()

Acked-by: George Zhang <georgezhang@vmware.com>
Acked-by: Aditya Sarwade <asarwade@vmware.com>
Signed-off-by: Andy King <acking@vmware.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-08-27 16:02:02 -04:00
Sathya Perla 68d7bdcb4c be2net: implement ethtool set/get_channel hooks
Support is provided only for combined channels. When SR-IOV is not
enabled, BE3 supports upto 16 channels and Lancer-R/SH-R support upto
32 channels.

Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-08-27 15:57:05 -04:00
Sathya Perla 7707133ceb be2net: refactor be_setup() to consolidate queue creation routines
1) Move be_cmd_if_create() above queue create routines to allow
   TXQ creation (that requires if_handle) to be clubbed with TX-CQ creation.
2) Consolidate all queue create routines into be_setup_queues()

Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-08-27 15:57:05 -04:00
Sathya Perla bea5098848 be2net: Fix be_cmd_if_create() to use MBOX if MCCQ is not created
Currently the IF_CREATE FW cmd is issued only *after* MCCQ is created as
it was coded to only use MCCQ. By fixing this, cmd_if_create() can be
called before MCCQ is created and the same routine for VF provisioning
can be called after.
This allows for consolidating all the queue create routines by moving
the be_cmd_if_create() call above all queue create calls in be_setup().

Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-08-27 15:57:05 -04:00
Sathya Perla 92bf14abf7 be2net: refactor be_get_resources() code
1) use be_resources{} struct to query/store HW resource limits
2) The HW queue/resource limits for BE2/BE3 chips are mostly called out
   in driver as constants.  Code to handle this is scattered across various
   places in be_setup(). Consolidate this code into BEx_get_resources().
   For Lancer-R, Skyhawk-R, these limits are queried from FW.

Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-08-27 15:57:04 -04:00
Vasundhara Volam 150d58c709 be2net: Fixup profile management routines
1) Parse PCIe descriptor for max-VFs supported by HW
2) Cleanup NIC descriptor parsing in get_func/profile_config() routines
3) Use common struct definitions for v0 and v1 versions of GET_FUNC_CONFIG
Signed-off-by: Vasundhara Volam <vasundhara.volam@emulex.com>

Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-08-27 15:57:04 -04:00
Sathya Perla f2f781a759 be2net: use EQ_CREATEv2 for SH-R
EQ_CREATEv2 explicitly returns the msix-index associated with a EQ.
For SH-R this is needed if EQs need to be deleted and re-created without
resetting a function.

Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-08-27 15:57:04 -04:00
Sucheta Chakraborty abd939d2fd qlcnic: Update version to 5.3.49.
Signed-off-by: Sucheta Chakraborty <sucheta.chakraborty@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-08-27 15:21:14 -04:00
Sucheta Chakraborty 48365e4852 qlcnic: dcb: Add support for CEE Netlink interface.
o Adapter and driver supports only CEE dcbnl ops. Only GET callbacks
  within dcbnl ops are supported currently.

Signed-off-by: Sucheta Chakraborty <sucheta.chakraborty@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-08-27 15:21:14 -04:00
Sucheta Chakraborty 2d8ebcab86 qlcnic: dcb: Register DCB AEN handler.
o Adapter sends Asynchronous Event Notifications to the driver when
  there are changes in the switch or adapter DCBX configuration.
  AEN handler updates the driver DCBX parameters.

Signed-off-by: Sucheta Chakraborty <sucheta.chakraborty@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-08-27 15:21:14 -04:00
Sucheta Chakraborty fb859ed691 qlcnic: dcb: Get DCB parameters from the adapter.
o Populate driver data structures with local, operational, and peer
  DCB parameters.

Signed-off-by: Sucheta Chakraborty <sucheta.chakraborty@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-08-27 15:21:14 -04:00
Sucheta Chakraborty 14d385b990 qlcnic: dcb: Query adapter DCB capabilities.
o Query adapter DCB capabilities and  populate local data structures
  with relevant information.

o Add QLCNIC_DCB to Kconfig for enabling/disabling DCB.

Signed-off-by: Sucheta Chakraborty <sucheta.chakraborty@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-08-27 15:21:13 -04:00
David S. Miller d853f11166 Merge branch 'for-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/bwh/sfc-next
Ben Hutchings says:

====================
1. Refactoring and cleanup in preparation for new hardware support.
2. Some bug fixes for firmware completion handling.  (They're not known
to cause real problems, otherwise I'd be submitting these for net and
stable.)
3. Update to the firmware protocol (MCDI) definitions.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
2013-08-27 12:16:20 -04:00
David S. Miller b05930f5d1 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts:
	drivers/net/wireless/iwlwifi/pcie/trans.c
	include/linux/inetdevice.h

The inetdevice.h conflict involves moving the IPV4_DEVCONF values
into a UAPI header, overlapping additions of some new entries.

The iwlwifi conflict is a context overlap.

Signed-off-by: David S. Miller <davem@davemloft.net>
2013-08-26 16:37:08 -04:00
Boris BREZILLON 148cbb53ac net/cadence/macb: add support for dt phy definition
The macb driver only handle PHY description through platform_data
(macb_platform_data).
Thus, when using dt you cannot define phy properties like phy address or
phy irq pin.

This patch makes use of the of_mdiobus_register to add support for
phy device definition using dt.
A fallback to the autoscan procedure is added in case there is no phy
devices defined in dt.

Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-08-26 16:02:27 -04:00
Stanislaw Gruszka 6e956da202 rt2800: fix wrong TX power compensation
We should not do temperature compensation on devices without
EXTERNAL_TX_ALC bit set (called DynamicTxAgcControl on vendor driver).
Such devices can have totally bogus TSSI parameters on the EEPROM,
but still threaded by us as valid and result doing wrong TX power
calculations.

This fix inability to connect to AP on slightly longer distance on
some Ralink chips/devices.

Reported-and-tested-by: Fabien ADAM <id2ndr@crocobox.org>
Cc: stable@vger.kernel.org
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-08-26 14:10:40 -04:00
Andrea Merello 93ba2a856f Update e-mail address for Andrea Merello (resubmit)
A lot of files contain reference to my old e-mail address.
Now I'm going not to read mail from it anymore, so update it
with my current address everywhere.

Signed-off-by: Andrea Merello <andrea.merello@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-08-26 14:10:40 -04:00
Sujith Manoharan e5614a91be ath9k: Fix DEBUG_FS dependency for ath9k
Reported-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-08-26 14:10:39 -04:00
Wei Yongjun 58fe431342 zd1201: fix error return code
Fix to return -ENOMEM in the memory alloc error handling
case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-08-26 14:10:39 -04:00
Tobias Waldekranz cfcd926ea2 mwifiex: add missing endian conversions
Fixes multiple locations where a little endian host is assumed during
ser/des of messages sent to/received from the chip.

Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-08-26 14:10:38 -04:00
Sujith Manoharan d4c04ba141 ath9k: Fix TX poll work locking
There is no need to call ath_txq_unlock_complete() in the
TX poll routine - frame completion is not done here,
so use ath_txq_unlock().

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-08-26 14:09:07 -04:00
Sujith Manoharan d1ae25a017 ath9k: Fix ASPM workaround usage
The PCIE Workaround register (AR_WA/0x4004) is used to handle
various hardware quirks. For AR9002 chips, AR_WA_D3_L1_DISABLE
is used to prevent the HW from automatically entering L1 state
when D3 is enforced.

AR_WA_D3_L1_DISABLE has to be enabled for a few AR9280 based
cards, mark them based on their PCI subdevice/subvendor IDs
and enforce it in ar9002_hw_configpcipowersave().

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-08-26 14:09:06 -04:00
Djalal Harouni 8aada63cc4 ath5k: debugfs: NULL-terminate strings
Avoid processing garbage data by NULL terminating the strings.

Signed-off-by: Djalal Harouni <tixxdz@opendz.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-08-26 14:09:06 -04:00
Sujith Manoharan b380a43b52 ath9k: Fix ASPM for AR9462
If the L1 entrance latency is not calibrated properly
in the EEPROM in WB222 boards, there could be problems
in connectivity. Check and correct the calibrated value
if it doesn't match the optimal value for WB222, 4us.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-08-26 14:09:05 -04:00
Avinash Patil 587b36d364 mwifiex: drop gratuitous ARP frames
This patch adds support for dropping gratuitous ARP frames which is
requirement for WFA Hotspot2.0.

Hotspot2.0 capability is enabled in driver if extended capabilities
IE from BSS descriptor has 11u interworking enabled.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-08-26 14:09:05 -04:00
Avinash Patil 68f95b09c8 mwifiex: fix ext_capab IE structure definition
EXT_CAPAB_IE format involves IEEE header followed by bytestream of
capabilities. Current structure has incorrect member u8 for data;
fix it by defining it as u8[0].

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-08-26 14:09:05 -04:00
Amitkumar Karwar 027d3307f4 mwifiex: fix driver unload problem for usb chipsets
We have usb_deregister() call in our rmmod routine. deauth,
shutdown etc. commands will be sent to FW later when bus
driver calls disconnect handler.

This mechanism works fine with SDIO and PCIe interfaces, but
there is an issue with USB.

USB bus driver returns all URBs submitted for receiving data
and command response immediately after usb_deregister() with
failure status. Hence we don't send deauth, shutdown etc.
command to firmware.

The problem is fixed by moving code from disconnect handler to
rmmod routine for USB interface.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-08-26 14:09:04 -04:00
Hauke Mehrtens 50023008f6 b43: call PCIe up and down functions
Tell the PCIe host core when the wifi is activated.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-08-26 14:09:04 -04:00
Hauke Mehrtens 521deea640 bcma: add bcma_core_pci_power_save()
This enables or disables power saving on the PCIe bus when the wifi is
in operation or not.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-08-26 14:09:03 -04:00
Hauke Mehrtens 780335acc8 bcma: do not export bcma_core_pci_extend_L1timer()
This is not called any more, do not export it.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-08-26 14:09:03 -04:00
Hauke Mehrtens aa51e598d0 brcmsmac: use bcma PCIe up and down functions
replace the calls to bcma_core_pci_extend_L1timer() by calls to the
newly introduced bcma_core_pci_ip() and bcma_core_pci_down()

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Cc: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-08-26 14:09:03 -04:00
Hauke Mehrtens cfe51ec1ae bcma: add method to power up and down the PCIe core by wifi driver
The wifi driver should tell the PCIe core that it is now in operation
so that some workarounds can be applied and the power state is changed.
This should replace the call to bcma_core_pci_extend_L1timer by the
brcmsmac driver.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-08-26 14:09:02 -04:00
Hauke Mehrtens f4a83e578e bcma: change max PCI read request size to 128
This PCIe controller does not support a max read request size above 128
bytes. The sold card I tested this controller with used 128 as default
value, but some new routers are sold with BCM4331 chips, which have a
default max read request size of 512. This device fails at the first
DMA reqeust whch is bigger than 126 bytes.

This patch changes the max read request size to 128 for every device on
the PCIe link.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-08-26 14:09:02 -04:00
Gabor Juhos 634b80595f rt2x00: rt2800lib: don't hardcode beacon offsets
The values written into the BCN_OFFSET[01] registers are
hardcoded in the rt2800_init_register function.

Add a macro and a helper function to derive these values
directly from the base address of a given beacon, and use
the new function instead of the hardcoded numbers.

The patch contains no functional changes. The programmed
register values are the same before and after the patch.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Acked-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-08-26 14:09:01 -04:00
Gabor Juhos 21c6af6b69 rt2x00: rt2800lib: add rt2800_hw_beacon_base helper
The HW_BEACON_BASE() macro returns the base address
of a given beacon, however the returned values are
not usable on all chipsets. On devices which have
selectable shared memory parts, some beacon may be
located in the high part of the shared memory.

Instead of extending the already complicated macro,
add a new helper function and use that to get the
base address of a given beacon.

The actual patch contains no functional changes, the
helper function will be extended in a further patch
to handle different chipsets' requirements.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Acked-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-08-26 14:09:01 -04:00
Wei Yongjun bcdd822007 mac80211_hwsim: fix error return code in init_mac80211_hwsim()
Fix to return -ENOMEM in the netdev alloc error handling
case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-08-26 09:52:58 +02:00
Wei Yongjun b8e2fde466 bonding: fix error return code in bond_enslave()
Fix to return a negative error code in the add bond vlan ids error
handling case instead of 0, as done elsewhere in this function.

Introduced by commit 1ff412ad77.
(bonding: change the bond's vlan syncing functions with the standard ones)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: Nikolay Aleksandrov <nikolay@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-08-25 18:37:35 -04:00
David S. Miller 2ea567cb0f Merge branch 'for-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/bwh/sfc-next
Merge SFC driver changes from Ben Hutchings.

Signed-off-by: David S. Miller <davem@davemloft.net>
2013-08-25 18:30:27 -04:00
Linus Torvalds 41a00f7950 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Merge networking fixes from David Miller:

 1) Revert Johannes Berg's genetlink locking fix, because it causes
    regressions.

    Johannes and Pravin Shelar are working on fixing things properly.

 2) Do not drop ipv6 ICMP messages without a redirected header option,
    they are legal.  From Duan Jiong.

 3) Missing error return propagation in probing of via-ircc driver.
    From Alexey Khoroshilov.

 4) Do not clear out broadcast/multicast/unicast/WOL bits in r8169 when
    initializing, from Peter Wu.

 5) realtek phy driver programs wrong interrupt status bit, from
    Giuseppe CAVALLARO.

 6) Fix statistics regression in AF_PACKET code, from Willem de Bruijn.

 7) Bridge code uses wrong bitmap length, from Toshiaki Makita.

 8) SFC driver uses wrong indexes to look up MAC filters, from Ben
    Hutchings.

 9) Don't pass stack buffers into usb control operations in hso driver,
    from Daniel Gimpelevich.

10) Multiple ipv6 fragmentation headers in one packet is illegal and
    such packets should be dropped, from Hannes Frederic Sowa.

11) When TCP sockets are "repaired" as part of checkpoint/restart, the
    timestamp field of SKBs need to be refreshed otherwise RTOs can be
    wildly off.  From Andrey Vagin.

12) Fix memcpy args (uses 'address of pointer' instead of 'pointer') in
    hostp driver.  From Dan Carpenter.

13) nl80211hdr_put() doesn't return an ERR_PTR, but some code believes
    it does.  From Dan Carpenter.

14) Fix regression in wireless SME disconnects, from Johannes Berg.

15) Don't use a stack buffer for DMA in zd1201 USB wireless driver, from
    Jussi Kivilinna.

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (33 commits)
  ipv4: expose IPV4_DEVCONF
  ipv6: handle Redirect ICMP Message with no Redirected Header option
  be2net: fix disabling TX in be_close()
  Revert "genetlink: fix family dump race"
  hso: Fix stack corruption on some architectures
  hso: Earlier catch of error condition
  sfc: Fix lookup of default RX MAC filters when steered using ethtool
  bridge: Use the correct bit length for bitmap functions in the VLAN code
  packet: restore packet statistics tp_packets to include drops
  net: phy: rtl8211: fix interrupt on status link change
  r8169: remember WOL preferences on driver load
  via-ircc: don't return zero if via_ircc_open() failed
  macvtap: Ignore tap features when VNET_HDR is off
  macvtap: Correctly set tap features when IFF_VNET_HDR is disabled.
  macvtap: simplify usage of tap_features
  tcp: set timestamps for restored skb-s
  bnx2x: set VF DMAE when first function has 0 supported VFs
  bnx2x: Protect against VFs' ndos when SR-IOV is disabled
  bnx2x: prevent VF benign attentions
  bnx2x: Consider DCBX remote error
  ...
2013-08-23 09:54:21 -07:00
Linus Torvalds 3db0d4defc Merge branch 'akpm' (patches from Andrew Morton)
Merge fixes from Andrew Morton:
 "A few fixes.  One is a licensing change and I don't do licensing, so
  please eyeball that one"

Licensing eye-balled.

* emailed patches from Andrew Morton <akpm@linux-foundation.org>:
  lib/lz4: correct the LZ4 license
  memcg: get rid of swapaccount leftovers
  nilfs2: fix issue with counting number of bio requests for BIO_EOPNOTSUPP error detection
  nilfs2: remove double bio_put() in nilfs_end_bio_write() for BIO_EOPNOTSUPP error
  drivers/platform/olpc/olpc-ec.c: initialise earlier
2013-08-23 09:52:32 -07:00
Daniel Drake 93dbc1b3b5 drivers/platform/olpc/olpc-ec.c: initialise earlier
Being a low-level component, various drivers (e.g.  olpc-battery) assume
that it is ok to communicate with the OLPC Embedded Controller during
probe.  Therefore the OLPC EC driver must be initialised before other
drivers try to use it.  This was the case until it was recently moved
out of arch/x86 and restructured around commits ac2504151f ("Platform:
OLPC: turn EC driver into a platform_driver") and 85f90cf6ca ("x86:
OLPC: switch over to using new EC driver on x86").

Use arch_initcall so that olpc-ec is readied earlier, matching the
previous behaviour.

Fixes a regression introduced in Linux-3.6 where various drivers such as
olpc-battery and olpc-xo1-sci failed to load due to an inability to
communicate with the EC.  The user-visible effect was a lack of battery
monitoring, missing ebook/lid switch input devices, etc.

Signed-off-by: Daniel Drake <dsd@laptop.org>
Cc: Andres Salomon <dilinger@queued.net>
Cc: Paul Fox <pgf@laptop.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-08-23 09:51:22 -07:00
Vladimir Kondratiev 19504cf5f3 cfg80211: add flags to cfg80211_rx_mgmt()
Add flags intended to report various auxiliary information
and introduce the NL80211_RXMGMT_FLAG_ANSWERED flag to report
that the frame was already answered by the device.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
[REPLIED->ANSWERED, reword commit message]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-08-23 16:06:03 +02:00
Johannes Berg 1fb9026000 mac80211: move setting WIPHY_FLAG_SUPPORTS_SCHED_SCAN into drivers
mac80211 currently sets WIPHY_FLAG_SUPPORTS_SCHED_SCAN based on whether
the start_sched_scan operation is supported or not, but that will not
be correct for all drivers, we're adding scheduled scan to the iwlmvm
driver but it depends on firmware support.

Therefore, move setting WIPHY_FLAG_SUPPORTS_SCHED_SCAN into the drivers
so that they can control it regardless of implementing the operation.

This currently only affects the TI drivers since they're the only ones
implementing scheduled scan (in a mac80211 driver.)

Acked-by: Luciano Coelho <luca@coelho.fi>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-08-23 12:02:26 +02:00
Gerhard Sittig 2771399ac9 fs_enet: cleanup clock API use
make the Freescale ethernet driver get, prepare and enable the FEC clock
during probe(); disable and unprepare the clock upon remove(), put is
done by the devm approach; hold a reference to the clock over the period
of use.

clock lookup is non-fatal as not all platforms provide clock specs in
their device tree; failure to enable specified clocks is fatal.

Signed-off-by: Gerhard Sittig <gsi@denx.de>
Signed-off-by: Anatolij Gustschin <agust@denx.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-08-22 22:13:54 -07:00
Gerhard Sittig 35b9eb0eee fs_enet: silence a build warning (unused variable)
Since commit 720a43efd3
(drivers:net: Remove unnecessary OOM messages after netdev_alloc_skb)
there is a build warning:

drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c: In function 'tx_skb_align_workaround':
drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c:586:26: warning: unused variable 'fep'

Fix it.

Signed-off-by: Gerhard Sittig <gsi@denx.de>
Signed-off-by: Anatolij Gustschin <agust@denx.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-08-22 22:13:54 -07:00
David S. Miller 5b5fde7fdd Merge branch 'for-davem' of git://gitorious.org/linux-can/linux-can-next into cpsw
Marc Kleine-Budde says:

====================
another pull-request for net-next. It consists of two patches by Libo
Chen, the at91 and flexcan driver make use of platform_set_drvdata()
rather than open coding it. Chen Gang improves the error checking in
the c_can_platform driver's probe function.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
2013-08-22 20:49:59 -07:00
Daniel Mack 0ca04b6380 net: ethernet: davinci_cpdma: export cpdma_chan_get_stats
This is needed when the cpsw driver is built as module.

Signed-off-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-08-22 20:48:21 -07:00
Sathya Perla 6e1f99757a be2net: fix disabling TX in be_close()
commit fba875591 ("disable TX in be_close()") disabled TX in be_close()
to protect be_xmit() from touching freed up queues in the AER recovery
flow.  But, TX must be disabled *before* cleaning up TX completions in
the close() path, not after. This allows be_tx_compl_clean() to free up
all TX-req skbs that were notified to the HW.

Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-08-22 19:58:23 -07:00
Jingoo Han 3bca8de220 ethernet: broadcom: remove unnecessary platform_set_drvdata()
The driver core clears the driver data to NULL after device_release
or on probe failure. Thus, it is not needed to manually clear the
device driver data to NULL.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-08-22 15:12:21 -07:00
Jingoo Han 092270656d ethernet: moxa: remove unnecessary platform_set_drvdata()
The driver core clears the driver data to NULL after device_release
or on probe failure. Thus, it is not needed to manually clear the
device driver data to NULL.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-08-22 15:12:21 -07:00
David S. Miller 2266c68f36 Merge branch 'sfc-3.11' of git://git.kernel.org/pub/scm/linux/kernel/git/bwh/sfc
Merge in a fix for RX MAC address filter programming bug in the sfc
driver.

Signed-off-by: David S. Miller <davem@davemloft.net>
2013-08-22 14:34:13 -07:00
Peter Wu 15edae91cb r8169: fix invalid register dump
For some reason, my PCIe RTL8111E onboard NIC on a GA-Z68X-UD3H-B3
motherboard reads as FFs when reading from MMIO with a block size
larger than 7. Therefore change to reading blocks of four bytes.

Ben Hutchings noted that the buffer is large enough to hold all
registers, so now all registers are read.

Signed-off-by: Peter Wu <lekensteyn@gmail.com>
Acked-by: Francois Romieu <romieu@fr.zoreil.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-08-22 14:25:58 -07:00
Linus Torvalds 6a7492a4b2 Merge branch 'linux-next' of git://cavan.codon.org.uk/platform-drivers-x86
Pull x86 platform driver fixes from Matthew Garrett:
 "Three trivial fixes - the first reverts a patch that's broken some
  other devices (again - I'm trying to figure out a clean way to
  implement this), the other two fix minor issues in the sony-laptop
  driver"

* 'linux-next' of git://cavan.codon.org.uk/platform-drivers-x86:
  Revert "hp-wmi: Enable hotkeys on some systems"
  sony-laptop: Fix reporting of gfx_switch_status
  sony-laptop: return a negative error code in sonypi_compat_init()
2013-08-22 13:04:11 -07:00
Arend van Spriel 20c7d42a50 brcmsmac: add support for BCM4313 iPA variant
This patch completes the changes needed for supporting the
iPA variant cards of the BCM4313 wireless chipset.

Tested-by: David Herrmann <dh.herrmann@gmail.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-08-22 14:30:35 -04:00
Arend van Spriel d37c8f0826 brcmsmac: reinitialize TSSI power control upon channel switch
When changing channels the TSSI based power control needs to be
reinitialized.

Tested-by: David Herrmann <dh.herrmann@gmail.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-08-22 14:30:35 -04:00
Arend van Spriel 118e545a2c brcmsmac: correct phy registers for TSSI-based power control
A number of additional phy registers needs to be programmed when
using TSSI-based power control.

Tested-by: David Herrmann <dh.herrmann@gmail.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-08-22 14:30:34 -04:00
Arend van Spriel 02fcc7535e brcmsmac: rework switch control table init including iPA BT-combo
Rework the code path in lcnphy tbl_init() for switch control
table programming. This also takes the iPA BT-combo card into
account.

Tested-by: David Herrmann <dh.herrmann@gmail.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-08-22 14:30:34 -04:00
Arend van Spriel 3e72ef73c3 brcmsmac: avoid calling set_txpwr_by_index() twice
For lcnphy revision 1 or when hardware supports i/q calibration the
function wlc_lcnphy_set_txpwr_by_index() was called twice.

Tested-by: David Herrmann <dh.herrmann@gmail.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-08-22 14:30:33 -04:00
Arend van Spriel d50ec00160 brcmsmac: fix TSSI idle estimation
The baseband multiplier must be zero during TSSI idle estimation
and restored afterwards.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Tested-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-08-22 14:30:33 -04:00
Arend van Spriel 7de646854b brcmsmac: change lcnphy receive i/q calibration routine
The gain level control for the test tone has been changed. This
calbration test tone is used to determine the i/q compensation.
The i/q calibration routine has been reworked to accomodate this.

Cc: Jonas Gorski <jogo@openwrt.org>
Tested-by: David Herrmann <dh.herrmann@gmail.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-08-22 14:30:33 -04:00
Arend van Spriel ab9a50e387 brcmsmac: update transmit gain table for lcn phy
Update the transmit gain table for bcm4313 chip family.

Tested-by: David Herrmann <dh.herrmann@gmail.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-08-22 14:30:32 -04:00
Arend van Spriel 67e39c5ae7 brcmsmac: add debug info message providing phy and radio info
For debug purposes it is good to have the phy and radio information
available in the log. Only logged when driver is built when BRCMDBG
or BRCM_TRACING kconfig are set.

Tested-by: David Herrmann <dh.herrmann@gmail.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-08-22 14:30:32 -04:00
Arend van Spriel d6b81daaa2 brcmsmac: use ARRAY_SIZE in phytbl_lcn.c
This patch converts all sizeof(x)/sizeof(x[0]) instances to
ARRAY_SIZE macro in phytbl_lcn.c. The patch was made using
spatch with ARRAY_SIZE.cocci (see [1]).

[1] https://github.com/coccinelle/coccinelle/tree/master/demos/janitorings

Cc: Jonas Gorski <jogo@openwrt.org>
Tested-by: David Herrmann <dh.herrmann@gmail.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-08-22 14:30:31 -04:00
Arend van Spriel acf97e9b5a brcmsmac: change pa_gain for bcm4313 iPA
The function wlc_lcnphy_load_tx_gain_table() has a target PA
gain specified for the iPA variant of the bcm4313. This gain
value is reduced to avoid PA distortion. The if-statement is
removed because it was rather redundant in the first place.
Please note that this patch does not provide full iPA support.

Cc: Jonas Gorski <jogo@openwrt.org>
Tested-by: David Herrmann <dh.herrmann@gmail.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-08-22 14:30:31 -04:00