1. 26 Mar, 2013 2 commits
    • Giuseppe CAVALLARO's avatar
      stmmac: start adding pcs and rgmii core irq · 0982a0f6
      Giuseppe CAVALLARO authored
      
      
      This patch starts adding in the main ISR the management of the PCS and
      RGMII/SGMII core interrupts. This is to help further development
      on this area. Currently the core irq handler only clears the
      PCS and S-R_MII interrupts and reports the event in the ethtool stats.
      Signed-off-by: default avatarGiuseppe Cavallaro <peppe.cavallaro@st.com>
      Tested-by: default avatarByungho An <bh74.an@samsung.com>
      Cc: Udit Kumar <udit-dlh.kumar@st.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0982a0f6
    • Giuseppe CAVALLARO's avatar
      stmmac: support extend descriptors · c24602ef
      Giuseppe CAVALLARO authored
      
      
      This patch is to support the extend descriptors available
      in the chips newer than the 3.50.
      
      In case of the extend descriptors cannot be supported,
      at runtime, the driver will continue to work using the old style.
      
      In detail, this support extends the main descriptor structure
      adding new descriptors: 4, 5, 6, 7. The desc4 gives us extra
      information about the received ethernet payload when it is
      carrying PTP packets or TCP/UDP/ICMP over IP packets.
      The descriptors 6 and 7 are used for saving HW L/H timestamps (PTP).
      
      V2: this new version removes the Koption added in the first implementation
      because all the checks now to verify if the extended descriptors are
      actually supported happen at probe time.
      Signed-off-by: default avatarGiuseppe Cavallaro <peppe.cavallaro@st.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c24602ef
  2. 07 Jan, 2013 1 commit
  3. 26 Nov, 2012 3 commits
    • Giuseppe CAVALLARO's avatar
      stmmac: get/set coalesce parameters via ethtool · 48f44da4
      Giuseppe CAVALLARO authored
      
      
      This patch is to get/set the tx/rx coalesce parameters
      via ethtool interface.
      
      Tests have been done on several platform with different GMAC chips w/o and w/
      RX watchdog feature.
      
      V2: reject coalesce settings that are not supported.
      Signed-off-by: default avatarGiuseppe Cavallaro <peppe.cavallaro@st.com>
      Reviewed-by: default avatarBen Hutchings <bhutchings@solarflare.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      48f44da4
    • Giuseppe CAVALLARO's avatar
      stmmac: add Rx watchdog support to mitigate the DMA irqs · 62a2ab93
      Giuseppe CAVALLARO authored
      
      
      GMAC devices newer than databook 3.40 has an embedded timer
      that can be used for mitigating the number of interrupts.
      So this patch adds this optimizations.
      
      At any rate, the Rx watchdog can be disable (on bugged HW) by
      passing from the platform the riwt_off field.
      
      In this implementation the rx timer stored in the Reg9 is fixed
      to the max value. This will be tuned by using ethtool.
      
      V2: added a platform parameter to force to disable the rx-watchdog
      for example on new core where it is bugged.
      
      V3: do not disable NAPI when Rx watchdog is used.
      
      V4: a new extra statistic field has been added to show the early
      receive status in the interrupt handler.
      This patch also adds an extra check to avoid to call
      napi_schedule when the DMA_INTR_ENA_RIE bit is disabled in the
      Interrupt Mask register.
      Signed-off-by: default avatarGiuseppe Cavallaro <peppe.cavallaro@st.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      62a2ab93
    • Giuseppe CAVALLARO's avatar
      stmmac: add the initial tx coalesce schema · 9125cdd1
      Giuseppe CAVALLARO authored
      
      
      This patch adds a new schema used for mitigating the
      number of transmit interrupts.
      It is based on a SW timer and a threshold value.
      The timer is used to periodically call the stmmac_tx_clean
      function; the threshold is used for setting the IC (Interrupt
      on Completion bit). The ISR will then invoke the poll method.
      Also the patch improves some ethtool stat fields.
      
      V2: review the logic to manage the IC bit in the TDESC
      that was bugged because it didn't take care about the
      fragments. Also fix the tx_count_frames that has not to be
      limited to TX DMA ring. Thanks to Ben Hutchings.
      
      V3: removed the spin_lock irqsave/restore as D. Miller suggested.
      Signed-off-by: default avatarGiuseppe Cavallaro <peppe.cavallaro@st.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9125cdd1
  4. 01 Jul, 2012 1 commit
    • Giuseppe CAVALLARO's avatar
      stmmac: add the Energy Efficient Ethernet support · d765955d
      Giuseppe CAVALLARO authored
      
      
      This patch adds the Energy Efficient Ethernet support to the stmmac.
      
      Please see the driver's documentation for further details about this support
      in the driver.
      
      Thanks also goes to Rayagond Kokatanur for his first implementation.
      
      Note:
       to clearly manage and expose the lpi interrupt status and eee ethtool
       stats I've had to do some modifications to the driver's design and I
       found really useful to move other parts of the code (e.g. mmc irq stat)
       in the main directly. So this means that some core has been reworked
       to introduce the EEE.
      
      v1: initial patch
      v2: fixed some sparse issues (typos)
      v3: erroneously sent the v2 renamed as v3
      v4:
      	o Fixed the return value of the stmmac_eee_init as suggested by D.Miller
      	o Totally reviewed the ethtool support for EEE
      	o Added a new internal parameter to tune the SW timer for TX LPI.
      v5: do not change any eee setting in case of the stmmac_ethtool_op_set_eee fails
          (it has to return -EOPNOTSUPP in that case).
      Signed-off-by: default avatarGiuseppe Cavallaro <peppe.cavallaro@st.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d765955d
  5. 04 Apr, 2012 1 commit
  6. 15 Feb, 2012 1 commit
  7. 05 Jan, 2012 1 commit
  8. 17 Nov, 2011 1 commit
    • Giuseppe CAVALLARO's avatar
      stmmac: parameters auto-tuning through HW cap reg · 19e30c14
      Giuseppe CAVALLARO authored
      
      
      New GMAC devices (newer than the databook 3.50a) have the
      HW capability register that provides which features are actually
      supported by the hardware.
      
      On old devices many information have to be passed through the
      platform, for example: enhanced descriptor structure,
      TX COE etc. These are mandatory to properly configure the driver.
      This remains still valid because the driver has to support old
      Synopsys devices but now it's also able to override them using the
      values from the HW capability register if supported.
      Signed-off-by: default avatarGiuseppe Cavallaro <peppe.cavallaro@st.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      19e30c14
  9. 16 Nov, 2011 1 commit
  10. 28 Oct, 2011 1 commit
    • Giuseppe CAVALLARO's avatar
      stmmac: update normal descriptor structure (v2) · 3c20f72f
      Giuseppe CAVALLARO authored
      
      
      This patch updates the normal descriptor structure
      to work fine on new GMAC Synopsys chips.
      
      Normal descriptors were designed on the old MAC10/100
      databook 1.91 where some bits were reserved: for example
      the tx checksum insertion and rx checksum offload.
      
      The patch maintains the back-compatibility with old
      MAC devices (tested on STx7109 MAC10/100) and adds new
      fields that actually new GMAC devices can use.
      
      For example, STx7109 (MAC10/100) will pass from the platform
        tx_coe = 0, enh_desc = 0, has_gmac = 0.
      A platform like Loongson1B (GMAC) will pass:
        tx_coe = 1, enh_desc = 0, has_gmac = 1.
      
      Thanks to Kelvin, he enhanced the normal descriptors for
      GMAC (on MIPS Loongson1B platform).
      Signed-off-by: default avatarKelvin Cheung <keguang.zhang@gmail.com>
      Signed-off-by: default avatarGiuseppe Cavallaro <peppe.cavallaro@st.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3c20f72f
  11. 19 Oct, 2011 1 commit
  12. 15 Sep, 2011 2 commits
  13. 11 Aug, 2011 1 commit
  14. 22 Jun, 2011 1 commit
    • Alexey Dobriyan's avatar
      net: remove mm.h inclusion from netdevice.h · b7f080cf
      Alexey Dobriyan authored
      
      
      Remove linux/mm.h inclusion from netdevice.h -- it's unused (I've checked manually).
      
      To prevent mm.h inclusion via other channels also extract "enum dma_data_direction"
      definition into separate header. This tiny piece is what gluing netdevice.h with mm.h
      via "netdevice.h => dmaengine.h => dma-mapping.h => scatterlist.h => mm.h".
      Removal of mm.h from scatterlist.h was tried and was found not feasible
      on most archs, so the link was cutoff earlier.
      
      Hope people are OK with tiny include file.
      
      Note, that mm_types.h is still dragged in, but it is a separate story.
      Signed-off-by: default avatarAlexey Dobriyan <adobriyan@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b7f080cf
  15. 07 Jun, 2011 1 commit
  16. 13 May, 2011 2 commits
  17. 29 Apr, 2011 1 commit
    • David Decotigny's avatar
      ethtool: Call ethtool's get/set_settings callbacks with cleaned data · 8ae6daca
      David Decotigny authored
      
      
      This makes sure that when a driver calls the ethtool's
      get/set_settings() callback of another driver, the data passed to it
      is clean. This guarantees that speed_hi will be zeroed correctly if
      the called callback doesn't explicitely set it: we are sure we don't
      get a corrupted speed from the underlying driver. We also take care of
      setting the cmd field appropriately (ETHTOOL_GSET/SSET).
      
      This applies to dev_ethtool_get_settings(), which now makes sure it
      sets up that ethtool command parameter correctly before passing it to
      drivers. This also means that whoever calls dev_ethtool_get_settings()
      does not have to clean the ethtool command parameter. This function
      also becomes an exported symbol instead of an inline.
      
      All drivers visible to make allyesconfig under x86_64 have been
      updated.
      Signed-off-by: default avatarDavid Decotigny <decot@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8ae6daca
  18. 13 Apr, 2011 1 commit
  19. 11 Apr, 2011 1 commit
  20. 06 Dec, 2010 1 commit
  21. 24 Nov, 2010 1 commit
  22. 17 Oct, 2010 1 commit
  23. 16 Oct, 2010 1 commit
  24. 25 Sep, 2010 1 commit
  25. 17 Sep, 2010 1 commit
    • Giuseppe CAVALLARO's avatar
      stmmac: consolidate and tidy-up the COE support · ebbb293f
      Giuseppe CAVALLARO authored
      
      
      The first version of the driver had hard-coded the logic
      for handling the checksum offloading.
      This was designed according to the chips included in
      the STM platforms where:
      o MAC10/100 supports no COE at all.
      o GMAC fully supports RX/TX COE.
      
      This is not good for other chip configurations where,
      for example, the mac10/100 supports the tx csum in HW
      or when the GMAC has no IPC.
      
      Thanks to Johannes Stezenbach; he provided me a first
      draft of this patch that only reviewed the IPC for the
      GMAC devices.
      
      This patch also helps on SPEAr platforms where the
      MAC10/100 can perform the TX csum in HW.
      Thanks to Deepak SIKRI for his support on this.
      
      In the end, GMAC devices for STM platforms have
      a bugged Jumbo frame support that needs to have
      the Tx COE disabled for oversized frames (due to
      limited buffer sizes). This information is also
      passed through the driver's platform structure.
      Signed-off-by: default avatarGiuseppe Cavallaro <peppe.cavallaro@st.com>
      Signed-off-by: default avatarJohannes Stezenbach <js@sig21.net>
      Signed-off-by: default avatarDeepak SIKRI <deepak.sikri@st.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ebbb293f
  26. 25 Aug, 2010 1 commit
  27. 14 May, 2010 1 commit
    • Joe Perches's avatar
      drivers/net: Remove unnecessary returns from void function()s · a4b77097
      Joe Perches authored
      
      
      This patch removes from drivers/net/ all the unnecessary
      return; statements that precede the last closing brace of
      void functions.
      
      It does not remove the returns that are immediately
      preceded by a label as gcc doesn't like that.
      
      It also does not remove null void functions with return.
      
      Done via:
      $ grep -rP --include=*.[ch] -l "return;\n}" net/ | \
        xargs perl -i -e 'local $/ ; while (<>) { s/\n[ \t\n]+return;\n}/\n}/g; print; }'
      
      with some cleanups by hand.
      
      Compile tested x86 allmodconfig only.
      Signed-off-by: default avatarJoe Perches <joe@perches.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a4b77097
  28. 04 Feb, 2010 1 commit
  29. 08 Jan, 2010 2 commits
  30. 14 Oct, 2009 1 commit