1. 11 10月, 2007 3 次提交
    • J
      [NET] drivers/net: statistics cleanup #1 -- save memory and shrink code · 09f75cd7
      Jeff Garzik 提交于
      We now have struct net_device_stats embedded in struct net_device,
      and the default ->get_stats() hook does the obvious thing for us.
      
      Run through drivers/net/* and remove the driver-local storage of
      statistics, and driver-local ->get_stats() hook where applicable.
      
      This was just the low-hanging fruit in drivers/net; plenty more drivers
      remain to be updated.
      
      [ Resolved conflicts with napi_struct changes and fix sunqe build
        regression... -DaveM ]
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      09f75cd7
    • R
      [NET]: Nuke SET_MODULE_OWNER macro. · 10d024c1
      Ralf Baechle 提交于
      It's been a useless no-op for long enough in 2.6 so I figured it's time to
      remove it.  The number of people that could object because they're
      maintaining unified 2.4 and 2.6 drivers is probably rather small.
      
      [ Handled drivers added by netdev tree and some missed IRDA cases... -DaveM ]
      Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      10d024c1
    • S
      [NET]: Make NAPI polling independent of struct net_device objects. · bea3348e
      Stephen Hemminger 提交于
      Several devices have multiple independant RX queues per net
      device, and some have a single interrupt doorbell for several
      queues.
      
      In either case, it's easier to support layouts like that if the
      structure representing the poll is independant from the net
      device itself.
      
      The signature of the ->poll() call back goes from:
      
      	int foo_poll(struct net_device *dev, int *budget)
      
      to
      
      	int foo_poll(struct napi_struct *napi, int budget)
      
      The caller is returned the number of RX packets processed (or
      the number of "NAPI credits" consumed if you want to get
      abstract).  The callee no longer messes around bumping
      dev->quota, *budget, etc. because that is all handled in the
      caller upon return.
      
      The napi_struct is to be embedded in the device driver private data
      structures.
      
      Furthermore, it is the driver's responsibility to disable all NAPI
      instances in it's ->stop() device close handler.  Since the
      napi_struct is privatized into the driver's private data structures,
      only the driver knows how to get at all of the napi_struct instances
      it may have per-device.
      
      With lots of help and suggestions from Rusty Russell, Roland Dreier,
      Michael Chan, Jeff Garzik, and Jamal Hadi Salim.
      
      Bug fixes from Thomas Graf, Roland Dreier, Peter Zijlstra,
      Joseph Fannin, Scott Wood, Hans J. Koch, and Michael Chan.
      
      [ Ported to current tree and all drivers converted.  Integrated
        Stephen's follow-on kerneldoc additions, and restored poll_list
        handling to the old style to fix mutual exclusion issues.  -DaveM ]
      Signed-off-by: NStephen Hemminger <shemminger@linux-foundation.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      bea3348e
  2. 08 10月, 2007 1 次提交
    • T
      [POWERPC] qe: miscellaneous code improvements and fixes to the QE library · 6b0b594b
      Timur Tabi 提交于
      This patch makes numerous miscellaneous code improvements to the QE library.
      
      1. Remove struct ucc_common and merge ucc_init_guemr() into ucc_set_type()
         (every caller of ucc_init_guemr() also calls ucc_set_type()).  Modify all
         callers of ucc_set_type() accordingly.
      
      2. Remove the unused enum ucc_pram_initial_offset.
      
      3. Refactor qe_setbrg(), also implement work-around for errata QE_General4.
      
      4. Several printk() calls were missing the terminating \n.
      
      5. Add __iomem where needed, and change u16 to __be16 and u32 to __be32 where
         appropriate.
      
      6. In ucc_slow_init() the RBASE and TBASE registers in the PRAM were programmed
         with the wrong value.
      
      7. Add the protocol type to struct us_info and updated ucc_slow_init() to
         use it, instead of always programming QE_CR_PROTOCOL_UNSPECIFIED.
      
      8. Rename ucc_slow_restart_x() to ucc_slow_restart_tx()
      
      9. Add several macros in qe.h (mostly for slow UCC support, but also to
         standardize some naming convention) and remove several unused macros.
      
      10. Update ucc_geth.c to use the new macros.
      
      11. Add ucc_slow_info.protocol to specify which QE_CR_PROTOCOL_xxx protcol
          to use when initializing the UCC in ucc_slow_init().
      
      12. Rename ucc_slow_pram.rfcr to rbmr and ucc_slow_pram.tfcr to tbmr, since
          these are the real names of the registers.
      
      13. Use the setbits, clrbits, and clrsetbits where appropriate.
      
      14. Refactor ucc_set_qe_mux_rxtx().
      
      15. Remove all instances of 'volatile'.
      
      16. Simplify get_cmxucr_reg();
      
      17. Replace qe_mux.cmxucrX with qe_mux.cmxucr[].
      
      18. Updated struct ucc_geth because struct ucc_fast is not padded any more.
      Signed-off-by: NTimur Tabi <timur@freescale.com>
      Signed-off-by: NKumar Gala <galak@kernel.crashing.org>
      6b0b594b
  3. 16 9月, 2007 1 次提交
  4. 25 7月, 2007 2 次提交
  5. 11 7月, 2007 1 次提交
  6. 25 5月, 2007 1 次提交
  7. 16 5月, 2007 1 次提交
  8. 10 5月, 2007 1 次提交
    • T
      [POWERPC] Change rheap functions to use ulongs instead of pointers · 4c35630c
      Timur Tabi 提交于
      The rheap allocation functions return a pointer, but the actual value is based
      on how the heap was initialized, and so it can be anything, e.g. an offset
      into a buffer.  A ulong is a better representation of the value returned by
      the allocation functions.
      
      This patch changes all of the relevant rheap functions to use a unsigned long
      integers instead of a pointer.  In case of an error, the value returned is
      a negative error code that has been cast to an unsigned long.  The caller can
      use the IS_ERR_VALUE() macro to check for this.
      
      All code which calls the rheap functions is updated accordingly.  Macros
      IS_MURAM_ERR() and IS_DPERR(), have been deleted in favor of IS_ERR_VALUE().
      
      Also added error checking to rh_attach_region().
      Signed-off-by: NTimur Tabi <timur@freescale.com>
      Signed-off-by: NKumar Gala <galak@kernel.crashing.org>
      4c35630c
  9. 02 5月, 2007 1 次提交
  10. 28 4月, 2007 6 次提交
  11. 26 4月, 2007 1 次提交
  12. 13 4月, 2007 1 次提交
  13. 23 3月, 2007 1 次提交
  14. 06 3月, 2007 2 次提交
  15. 27 2月, 2007 1 次提交
  16. 15 2月, 2007 1 次提交
  17. 09 2月, 2007 2 次提交
  18. 06 2月, 2007 1 次提交
  19. 19 1月, 2007 1 次提交
  20. 11 12月, 2006 2 次提交
  21. 02 12月, 2006 1 次提交
  22. 22 10月, 2006 1 次提交
    • L
      [PATCH] ucc_geth: changes to ucc_geth driver as a result of qe_lib changes and bugfixes · 18a8e864
      Li Yang 提交于
      changes due to qe_lib changes include:
      
      o removed inclusion of platform header file
      o removed platform_device code, replaced with of_device
      o removed typedefs
      o uint -> u32 conversions
      o removed following defines:
        QE_SIZEOF_BD, BD_BUFFER_ARG, BD_BUFFER_CLEAR, BD_BUFFER,
        BD_STATUS_AND_LENGTH_SET, BD_STATUS_AND_LENGTH, and BD_BUFFER_SET
        because they hid sizeof/in_be32/out_be32 operations from the reader.
      o removed irrelevant comments, added others to resemble removed BD_ defines
      o const'd and uncasted all get_property() assignments
      
      bugfixes, courtesy of Scott Wood, include:
      
      - Read phy_address as a u32, not u8.
      - Match on type == "network" as well as compatible == "ucc_geth", as
        device_is_compatible() will only compare up to the length of the
        test string, allowing "ucc_geth_phy" to match as well.
      - fixes the MAC setting code in ucc_geth.c.  The old code was overwriting and dereferencing random stack contents.
      Signed-off-by: NLi Yang <leoli@freescale.com>
      Signed-off-by: NKim Phillips <kim.phillips@freescale.com>
      Signed-off-by: NScott Wood <scottwood@freescale.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      18a8e864
  23. 05 10月, 2006 1 次提交
    • D
      IRQ: Maintain regs pointer globally rather than passing to IRQ handlers · 7d12e780
      David Howells 提交于
      Maintain a per-CPU global "struct pt_regs *" variable which can be used instead
      of passing regs around manually through all ~1800 interrupt handlers in the
      Linux kernel.
      
      The regs pointer is used in few places, but it potentially costs both stack
      space and code to pass it around.  On the FRV arch, removing the regs parameter
      from all the genirq function results in a 20% speed up of the IRQ exit path
      (ie: from leaving timer_interrupt() to leaving do_IRQ()).
      
      Where appropriate, an arch may override the generic storage facility and do
      something different with the variable.  On FRV, for instance, the address is
      maintained in GR28 at all times inside the kernel as part of general exception
      handling.
      
      Having looked over the code, it appears that the parameter may be handed down
      through up to twenty or so layers of functions.  Consider a USB character
      device attached to a USB hub, attached to a USB controller that posts its
      interrupts through a cascaded auxiliary interrupt controller.  A character
      device driver may want to pass regs to the sysrq handler through the input
      layer which adds another few layers of parameter passing.
      
      I've build this code with allyesconfig for x86_64 and i386.  I've runtested the
      main part of the code on FRV and i386, though I can't test most of the drivers.
      I've also done partial conversion for powerpc and MIPS - these at least compile
      with minimal configurations.
      
      This will affect all archs.  Mostly the changes should be relatively easy.
      Take do_IRQ(), store the regs pointer at the beginning, saving the old one:
      
      	struct pt_regs *old_regs = set_irq_regs(regs);
      
      And put the old one back at the end:
      
      	set_irq_regs(old_regs);
      
      Don't pass regs through to generic_handle_irq() or __do_IRQ().
      
      In timer_interrupt(), this sort of change will be necessary:
      
      	-	update_process_times(user_mode(regs));
      	-	profile_tick(CPU_PROFILING, regs);
      	+	update_process_times(user_mode(get_irq_regs()));
      	+	profile_tick(CPU_PROFILING);
      
      I'd like to move update_process_times()'s use of get_irq_regs() into itself,
      except that i386, alone of the archs, uses something other than user_mode().
      
      Some notes on the interrupt handling in the drivers:
      
       (*) input_dev() is now gone entirely.  The regs pointer is no longer stored in
           the input_dev struct.
      
       (*) finish_unlinks() in drivers/usb/host/ohci-q.c needs checking.  It does
           something different depending on whether it's been supplied with a regs
           pointer or not.
      
       (*) Various IRQ handler function pointers have been moved to type
           irq_handler_t.
      Signed-Off-By: NDavid Howells <dhowells@redhat.com>
      (cherry picked from 1b16e7ac850969f38b375e511e3fa2f474a33867 commit)
      7d12e780
  24. 14 9月, 2006 1 次提交
  25. 12 9月, 2006 1 次提交
    • A
      [PATCH] Remove more unnecessary driver printk's · d5b20697
      Andy Gospodarek 提交于
      As I promised last week, here is the first pass at removing all
      unnecessary printk's that exist in network device drivers currently in
      promiscuous mode.  The duplicate messages are not needed so they have
      been removed.  Some of these drivers are quite old and might not need an
      update, but I did them all anyway.
      
      I am currently auditing the remaining conditional printk's and will send
      out a patch for those soon.
      Signed-off-by: NAndy Gospodarek <andy@greyhouse.net>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      d5b20697
  26. 20 8月, 2006 1 次提交