summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* net: Introduce for_each_netdev_rcu() iteratorEric Dumazet2009-11-0411-77/+68
| | | | | | | | | | | | | | | | | | | | | | | | Adds RCU management to the list of netdevices. Convert some for_each_netdev() users to RCU version, if it can avoid read_lock-ing dev_base_lock Ie: read_lock(&dev_base_loack); for_each_netdev(net, dev) some_action(); read_unlock(&dev_base_lock); becomes : rcu_read_lock(); for_each_netdev_rcu(net, dev) some_action(); rcu_read_unlock(); Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* em_meta: avoid one dev_put()Eric Dumazet2009-11-041-6/+6
| | | | | | | Another rcu conversion to avoid one dev_hold()/dev_put() pair Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* bnx2: avoid compiler warningsEric Dumazet2009-11-041-0/+4
| | | | | | | | | | | | | drivers/net/bnx2.c: In function ‘bnx2_enable_forced_2g5’: drivers/net/bnx2.c:1447: warning: ‘bmcr’ may be used uninitialized in this function drivers/net/bnx2.c: In function ‘bnx2_disable_forced_2g5’: drivers/net/bnx2.c:1482: warning: ‘bmcr’ may be used uninitialized in this function One fix would be to have an initial value, but a plain return might be better. Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Acked-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: cleanup include/netEric Dumazet2009-11-0437-240/+120
| | | | | | | | | | | | | | | This cleanup patch puts struct/union/enum opening braces, in first line to ease grep games. struct something { becomes : struct something { Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* Phonet: remove tautologiesRémi Denis-Courmont2009-11-041-4/+2
| | | | | | | These checks don't make sense anymore since rtnl_notify() cannot fail. Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* trivial: remove duplicated MIN macro from tehuti.Thiago Farina2009-11-042-3/+1
| | | | | | | | Since the kernel api already has the macro "min", just use it instead of declaring another one. Signed-off-by: Thiago Farina <tfransosi@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* cnic: ensure ulp_type is not negativeroel kluin2009-11-041-4/+4
| | | | | | | | | `ulp_type' is signed, make sure it is not negative when we read the array element. Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Acked-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* qlge: Clean up netdev->stats usage.Ron Mercer2009-11-042-5/+49
| | | | | | | | Don't access netdev->stats in IO path. Save them in tx_ring/rx_rings and add them up when get_stats API is called. Signed-off-by: Ron Mercer <ron.mercer@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* qlge: Add firmware/driver sub-command support.Ron Mercer2009-11-042-7/+61
| | | | | | | | These sub-commands are issued by another (FCoE) function requesting an operation on a shared resource. Signed-off-by: Ron Mercer <ron.mercer@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* qlge: Fix indentations.Ron Mercer2009-11-041-4/+4
| | | | | Signed-off-by: Ron Mercer <ron.mercer@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* tc35815: Kill unused codeAtsushi Nemoto2009-11-021-221/+3
| | | | | | | | | | | - TC35815_DMA_SYNC_ONDEMAND is always enabled. - WORKAROUND_LOSTCAR is always enabled. - WORKAROUND_100HALF_PROMISC is always enabled. - GATHER_TXINT is always enabled. - TC35815_USE_PACKEDBUFFER is always disabled. - NO_CHECK_CARRIER is always disabled. Signed-off-by: David S. Miller <davem@davemloft.net>
* tc35815: Kill non-napi codeAtsushi Nemoto2009-11-021-67/+1
| | | | | Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp> Signed-off-by: David S. Miller <davem@davemloft.net>
* gianfar: Basic Support for programming hash rulesSandeep Gopalpet2009-11-024-0/+404
| | | | | | | | This patch provides basic hash rules programming via the ethtool interface. Signed-off-by: Sandeep Gopalpet <Sandeep.Kumar@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* gianfar: Add Multiple group SupportSandeep Gopalpet2009-11-024-209/+422
| | | | | | | | | | | | | | | This patch introduces multiple group support for etsec2.0 devices. Multiple group support is provided by mapping the set of enabled queues to different groups and then programming the per group regsiters imask, ievent, rstat, tstat. The queues corresponding to a group are indicated by programming isrg (interrupt steering) registers. Signed-off-by: Sandeep Gopalpet <Sandeep.Kumar@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* gianfar: Add support etsec2.0 registers.Sandeep Gopalpet2009-11-021-11/+44
| | | | | | | This patch adds support for etsec2.0 regsiters Signed-off-by: Sandeep Gopalpet <Sandeep.Kumar@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* fsl_pq_mdio: Add Suport for etsec2.0 devices.Sandeep Gopalpet2009-11-022-13/+57
| | | | | | | | | | This patch adds mdio support for etsec2.0 devices. Modified the fsl_pq_mdio structure to include the new mdio members. Signed-off-by: Sandeep Gopalpet <Sandeep.Kumar@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* gianfar: Add Multiple Queue SupportSandeep Gopalpet2009-11-024-290/+621
| | | | | | | | | | | | | | | This patch introduces multiple Tx and Rx queues. The incoming packets can be classified into different queues based on filer rules (out of scope of this patch). The number of queues enabled will be based on a DTS entries fsl,num_tx_queues and fsl,num_rx_queues. Although we are enabling multiple queues, the interrupt coalescing is on per device level (etsec-1.7 doesn't support multiple rxics and txics). Signed-off-by: Sandeep Gopalpet <Sandeep.Kumar@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* gianfar: Introduce logical group support.Sandeep Gopalpet2009-11-024-200/+250
| | | | | | | | | | | | | | | This patch introduces the group structure. The elements of this structure are the interrupt lines, their corresponding names, the register memory map. The elements for this group are factored out from the gfar_private structure. The introduction of group structure will help in providing support for newer versions of etsec. Currently, the support is present only for single group and single tx/rx queues. Signed-off-by: Sandeep Gopalpet <Sandeep.Kumar@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* gianfar: Add per queue structure supportSandeep Gopalpet2009-11-024-245/+398
| | | | | | | | | | | | | This patch introduces per tx and per rx queue structures. Earlier the members of these structures were inside the gfar_private structure. Moving forward if we want to support multiple queues, we need to refactor the gfar_private structure so that introduction of multiple queues is easier. Signed-off-by: Sandeep Gopalpet <Sandeep.Kumar@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* tg3: Update version to 3.103Matt Carlson2009-11-021-2/+2
| | | | | | | | This patch updates the tg3 version to 3.103. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* tg3 / broadcom: Optionally disable TXC if no linkMatt Carlson2009-11-023-0/+7
| | | | | | | | | This patch adds code to disable the TXC and RXC reference clocks if link is not available. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* tg3 / broadcom: Add APD support for GPHYsMatt Carlson2009-11-022-10/+45
| | | | | | | | | This patch adds an RXC auto power-down feature to the code that supports the gphys. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* tg3 / broadcom: Add code to disable rxc refclkMatt Carlson2009-11-023-2/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | The 5785 does not use the RXC reference clock. Turning it off is desirable as it saves power. By default, the 50610 enables the RXC reference clock and the 50610M disables it. Presumably this is one of the reasons why the hardware architect chose one over the other. Adding a "rx reference clock disable" flag is not the ideal way to describe the option, as it would force the MAC using a 50610M to set the flag. Ideally we want the flags to represent opt-in behavior that deviates from hardware defaults. Furthermore, the lack of a "disable" flag implies that the requester wants the rx reference clock enabled, which doesn't necessarily follow. By presenting the option as a passive statement (rx reference clock unused) rather than a command, I hope to convey an opt-in option to disable the rx reference clock that falls back to hardware defaults if not set. A secondary benefit of this is that it keeps the intelligence about phy defaults in the broadcom module where it belongs and allows the broadcom module more latitude should a bug arise. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* tg3 / broadcom: Refine AC131 APD supportMatt Carlson2009-11-022-3/+6
| | | | | | | | | | | Auto power-down (APD) support is a power-saving feature. It should be selectively enabled since it might expose MAC bugs. This patch changes the code to enable APD only if the PHY_BRCM_AUTO_PWRDWN_ENABLE flag is set. The tg3 driver was changed to set this bit. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* tg3 / broadcom: Add PHY_BRCM_CLEAR_RGMII_MODE flagMatt Carlson2009-11-023-0/+8
| | | | | | | | | | | | | | | Broadcom 50610M parts changed the default definitions of the RGMII mode shadow register. The 5785 needs the RGMII mode selection bits [4:3] cleared. The default value of the remaining bits in this register are zero. Rather than unnecessarily burn an extra bit in the dev_flags member in an attempt to enumerate all possible combinations, this patch take a more course grained approach and labels the option as "clear all bits". Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* broadcom: Consolidate dev_flags definitionsMatt Carlson2009-11-022-16/+12
| | | | | | | | | | This patch moves all the dev_flags enumerations outside the broadcom.c file to include/linux/brcmphy.h. The existing flags were not used yet and have been re-enumerated to avoid conflicts. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* tg3: Add 50610M phy ID for 5785Matt Carlson2009-11-022-0/+3
| | | | | | | | This patch adds the 50610M phy ID for 5785. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* broadcom: Fix slow link problemMatt Carlson2009-11-021-8/+14
| | | | | | | | | When a 50610 or 50610M is paired against particular remote partners, link is slow to come up. This patch works around the problem. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* broadcom: Isolate phy dsp accessesMatt Carlson2009-11-021-48/+42
| | | | | | | | | | This patch consolidates the code that requires the SMDSP clock to be enabled into a single function that (hopefully) makes the dependency obvious. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* tg3: Extend loopback test timeoutMatt Carlson2009-11-021-2/+2
| | | | | | | | | | This patch extends the loopback test timeout from 250 usec to 350 usec. When the 5785 is paired against an AC131 phy, the older timeout is just a little too close to the expected performance based on timings. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* tg3: 5785: Set port mode to MII when link downMatt Carlson2009-11-021-1/+4
| | | | | | | | | This patch sets the port mode to MII when the link is down for the 5785. Setting the port mode to MII instead of GMII saves power. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* tg3: Add AC131 power down supportMatt Carlson2009-11-022-0/+23
| | | | | | | | | | | The AC131 does not respect the power down bit (bit 11) of the MII Control Register (reg 0x0). Instead, software is required to put the phy into standby power down mode through the shadow register set. This patch implements support for the AC131 standby power down mode. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* tg3: Improve 5785 PCIe performanceMatt Carlson2009-11-022-1/+5
| | | | | | | | | This patch improves 5785 performance by allowing the write DMA engine to request larger DMA burst sizes than it otherwise would. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* tg3: Add more PCI DMA map error checkingMatt Carlson2009-11-021-3/+11
| | | | | | | | | | | This patch adds code to check the status of pci_map_single() before allowing rx buffers to be used. It also converts the pci_map_single() call in tg3_run_loopback() to use skb_dma_map() instead. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: Benjamin Li <benli@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* tg3: Prevent a PCIe tx glitchMatt Carlson2009-11-022-1/+49
| | | | | | | | | This patch prevents a PCIe tx glitch by allowing the transmitter to go to a low power state. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* tg3: Convert PHY_ADDR => TG3_PHY_MII_ADDRMatt Carlson2009-11-022-23/+30
| | | | | | | | | | This patch renames the PHY_ADDR preprocessor definition. The following patch will identify a new member on the MDIO bus, so we want this preprocessor definition to be a little more descriptive. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* tg3: Fix disappearing 57780 devicesMatt Carlson2009-11-022-23/+2
| | | | | | | | | | Under certain power saving conditions, 57780 asic rev devices might disappear from the system. The fix is to disallow the PCIe PLL from powering down. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* tg3: Fix 5906 transmit hangsMatt Carlson2009-11-022-7/+20
| | | | | | | | | | | The 5906 has trouble with fragments that are less than 8 bytes in size. This patch works around the problem by pivoting the 5906's transmit routine to tg3_start_xmit_dma_bug() and introducing a new SHORT_DMA_BUG flag that enables code to detect and react to the problematic condition. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* tg3: Assign flags to fixes in start_xmit_dma_bugMatt Carlson2009-11-022-7/+21
| | | | | | | | | This patch adds a flag for each bug workaround in tg3_start_xmit_dma_bug(). This is prep work for the following patch. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* qlge: Change naming on vlan API.Ron Mercer2009-11-021-6/+6
| | | | | | | Change name on vlan_rx_add, kill, register to match other driver API. Signed-off-by: Ron Mercer <ron.mercer@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* qlge: Add ethtool self-test.Ron Mercer2009-11-023-1/+137
| | | | | Signed-off-by: Ron Mercer <ron.mercer@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* ipv6: no more dev_put() in datagram_send_ctl()Eric Dumazet2009-11-021-5/+9
| | | | | | | Avoids touching device refcount in datagram_send_ctl(), thanks to RCU Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* ipv6: no more dev_put() in inet6_bind()Eric Dumazet2009-11-021-8/+9
| | | | | | | Avoids touching device refcount in inet6_bind(), thanks to RCU Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* ip6tnl: less dev_put() callsEric Dumazet2009-11-021-6/+5
| | | | | | | | Using dev_get_by_index_rcu() in ip6_tnl_rcv_ctl() & ip6_tnl_xmit_ctl() avoids touching device refcount. Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* packet: less dev_put() callsEric Dumazet2009-11-021-10/+12
| | | | | | | | | | | | | - packet_sendmsg_spkt() can use dev_get_by_name_rcu() to avoid touching device refcount. - packet_getname_spkt() & packet_getname() can use dev_get_by_index_rcu() to avoid touching device refcount too. tpacket_snd() & packet_snd() can not use RCU yet because they can sleep when allocating skb. Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* pppoe: RCU locking in get_item_by_addr()Eric Dumazet2009-11-011-10/+9
| | | | | | | | Use dev_get_by_name_rcu() instead of dev_get_by_name(), to avoid touching device refcount in hotpath. Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* ifb: RCU locking avoids touching dev refcountEric Dumazet2009-11-011-2/+4
| | | | | | | Avoids touching dev refcount in hotpath Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: RCU locking for simple ioctl()Eric Dumazet2009-11-011-4/+4
| | | | | | | | | | All ioctls() implemented by dev_ifsioc_locked() : SIOCGIFFLAGS, SIOCGIFMETRIC, SIOCGIFMTU, SIOCGIFHWADDR, SIOCGIFSLAVE, SIOCGIFMAP, SIOCGIFINDEX & SIOCGIFTXQLEN can use RCU lock instead of dev_base_lock rwlock Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* icmp: icmp_send() can avoid a dev_put()Eric Dumazet2009-11-011-4/+5
| | | | | | | | We can avoid touching device refcount in icmp_send(), using dev_get_by_index_rcu() Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* ipv4: inetdev_by_index() switch to RCUEric Dumazet2009-11-011-3/+4
| | | | | | | | Use dev_get_by_index_rcu() instead of __dev_get_by_index() and dev_base_lock rwlock Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>