1. 02 6月, 2011 2 次提交
    • M
      ath9k: Add a debug entry to start/stop ANI · 05c0be2f
      Mohammed Shafi Shajakhan 提交于
      this helps the user to start/stop ANI dynamically.
      Signed-off-by: NMohammed Shafi Shajakhan <mshajakhan@atheros.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      05c0be2f
    • F
      ath9k: unify edma and non-edma tx code, improve tx fifo handling · fce041be
      Felix Fietkau 提交于
      EDMA based chips (AR9380+) have 8 Tx FIFO slots, which are used to fix the
      tx queue start/stop race conditions which have to be worked around for
      earlier chips by keeping the last descriptor in the queue. The current code
      stores all frames that do not fit onto the 8 FIFO slots in a separate
      list. Whenever a FIFO slot is freed up, the next frame (or A-MPDU) from the
      pending queue gets moved to that slot.
      
      This process is not only inefficient, but also unnecessary. The code can
      be improved visibly by keeping the pending queue fully linked, and moving
      the contents of the entire queue to a FIFO slot as it becomes available.
      
      This patch makes the necessary changes for that and also merges some code
      that was duplicated for EDMA vs non-EDMA. It changes txq->axq_link to point
      to the last descriptor instead of the link pointer, so that
      ath9k_hw_set_desc_link can be used, which works on all chips.
      
      With this patch, a small performance increase for non-aggregated traffic
      was observed on AR9380 based embedded hardware.
      Signed-off-by: NFelix Fietkau <nbd@openwrt.org>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      fce041be
  2. 20 5月, 2011 2 次提交
  3. 19 5月, 2011 1 次提交
  4. 26 4月, 2011 1 次提交
  5. 13 4月, 2011 1 次提交
  6. 31 3月, 2011 2 次提交
  7. 05 3月, 2011 2 次提交
  8. 04 2月, 2011 1 次提交
  9. 29 1月, 2011 2 次提交
    • F
      ath9k: fix tx queue index confusion in debugfs code · 5bec3e5a
      Felix Fietkau 提交于
      Various places printing tx queue information used various different ways to
      get a tx queue index for printing statistics. Most of these ways were wrong.
      
      ATH_TXQ_AC_* cannot be used as an index for sc->tx.txq, because it is only
      used internally for queue assignment.
      
      One place used WME_AC_* as a queue index for sc->debug.stats.txstats, however
      this array uses the ath9k_hw queue number as well.
      
      Fix all of this by always using the ath9k_hw queue number as an index, and
      always looking it up by going through sc->tx.txq_map.
      Signed-off-by: NFelix Fietkau <nbd@openwrt.org>
      Cc: Ben Greear <greearb@candelatech.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      5bec3e5a
    • F
      ath9k: remove the virtual wiphy debugfs interface · 34302397
      Felix Fietkau 提交于
      It does not make much sense to keep the current virtual wiphy implementation
      any longer - it adds significant complexity, has very few users and is still
      very experimental. At some point in time, it will be replaced by a proper
      implementation in mac80211.
      
      By making the code easier to read and maintain, removing virtual wiphy support
      helps with fixing the remaining driver issues and adding further improvements.
      Signed-off-by: NFelix Fietkau <nbd@openwrt.org>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      34302397
  10. 22 1月, 2011 7 次提交
  11. 03 12月, 2010 1 次提交
  12. 16 11月, 2010 1 次提交
    • F
      ath9k: rework tx queue selection and fix queue stopping/waking · 066dae93
      Felix Fietkau 提交于
      The current ath9k tx queue handling code showed a few issues that could
      lead to locking issues, tx stalls due to stopped queues, and maybe even
      DMA issues.
      
      The main source of these issues is that in some places the queue is
      selected via skb queue mapping in places where this mapping may no
      longer be valid. One such place is when data frames are transmitted via
      the CAB queue (for powersave buffered frames). This is made even worse
      by a lookup WMM AC values from the assigned tx queue (which is
      undefined for the CAB queue).
      
      This messed up the pending frame counting, which in turn caused issues
      with queues getting stopped, but not woken again.
      
      To fix these issues, this patch removes an unnecessary abstraction
      separating a driver internal queue number from the skb queue number
      (not to be confused with the hardware queue number).
      
      It seems that this abstraction may have been necessary because of tx
      queue preinitialization from the initvals. This patch avoids breakage
      here by pushing the software <-> hardware queue mapping to the function
      that assigns the tx queues and redefining the WMM AC definitions to
      match the numbers used by mac80211 (also affects ath9k_htc).
      
      To ensure consistency wrt. pending frame count tracking, these counters
      are moved to the ath_txq struct, updated with the txq lock held, but
      only where the tx queue selected by the skb queue map actually matches
      the tx queue used by the driver for the frame.
      Signed-off-by: NFelix Fietkau <nbd@openwrt.org>
      Reported-by: NBjörn Smedman <bjorn.smedman@venatech.se>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      066dae93
  13. 10 11月, 2010 1 次提交
  14. 16 10月, 2010 1 次提交
  15. 15 10月, 2010 1 次提交
    • A
      llseek: automatically add .llseek fop · 6038f373
      Arnd Bergmann 提交于
      All file_operations should get a .llseek operation so we can make
      nonseekable_open the default for future file operations without a
      .llseek pointer.
      
      The three cases that we can automatically detect are no_llseek, seq_lseek
      and default_llseek. For cases where we can we can automatically prove that
      the file offset is always ignored, we use noop_llseek, which maintains
      the current behavior of not returning an error from a seek.
      
      New drivers should normally not use noop_llseek but instead use no_llseek
      and call nonseekable_open at open time.  Existing drivers can be converted
      to do the same when the maintainer knows for certain that no user code
      relies on calling seek on the device file.
      
      The generated code is often incorrectly indented and right now contains
      comments that clarify for each added line why a specific variant was
      chosen. In the version that gets submitted upstream, the comments will
      be gone and I will manually fix the indentation, because there does not
      seem to be a way to do that using coccinelle.
      
      Some amount of new code is currently sitting in linux-next that should get
      the same modifications, which I will do at the end of the merge window.
      
      Many thanks to Julia Lawall for helping me learn to write a semantic
      patch that does all this.
      
      ===== begin semantic patch =====
      // This adds an llseek= method to all file operations,
      // as a preparation for making no_llseek the default.
      //
      // The rules are
      // - use no_llseek explicitly if we do nonseekable_open
      // - use seq_lseek for sequential files
      // - use default_llseek if we know we access f_pos
      // - use noop_llseek if we know we don't access f_pos,
      //   but we still want to allow users to call lseek
      //
      @ open1 exists @
      identifier nested_open;
      @@
      nested_open(...)
      {
      <+...
      nonseekable_open(...)
      ...+>
      }
      
      @ open exists@
      identifier open_f;
      identifier i, f;
      identifier open1.nested_open;
      @@
      int open_f(struct inode *i, struct file *f)
      {
      <+...
      (
      nonseekable_open(...)
      |
      nested_open(...)
      )
      ...+>
      }
      
      @ read disable optional_qualifier exists @
      identifier read_f;
      identifier f, p, s, off;
      type ssize_t, size_t, loff_t;
      expression E;
      identifier func;
      @@
      ssize_t read_f(struct file *f, char *p, size_t s, loff_t *off)
      {
      <+...
      (
         *off = E
      |
         *off += E
      |
         func(..., off, ...)
      |
         E = *off
      )
      ...+>
      }
      
      @ read_no_fpos disable optional_qualifier exists @
      identifier read_f;
      identifier f, p, s, off;
      type ssize_t, size_t, loff_t;
      @@
      ssize_t read_f(struct file *f, char *p, size_t s, loff_t *off)
      {
      ... when != off
      }
      
      @ write @
      identifier write_f;
      identifier f, p, s, off;
      type ssize_t, size_t, loff_t;
      expression E;
      identifier func;
      @@
      ssize_t write_f(struct file *f, const char *p, size_t s, loff_t *off)
      {
      <+...
      (
        *off = E
      |
        *off += E
      |
        func(..., off, ...)
      |
        E = *off
      )
      ...+>
      }
      
      @ write_no_fpos @
      identifier write_f;
      identifier f, p, s, off;
      type ssize_t, size_t, loff_t;
      @@
      ssize_t write_f(struct file *f, const char *p, size_t s, loff_t *off)
      {
      ... when != off
      }
      
      @ fops0 @
      identifier fops;
      @@
      struct file_operations fops = {
       ...
      };
      
      @ has_llseek depends on fops0 @
      identifier fops0.fops;
      identifier llseek_f;
      @@
      struct file_operations fops = {
      ...
       .llseek = llseek_f,
      ...
      };
      
      @ has_read depends on fops0 @
      identifier fops0.fops;
      identifier read_f;
      @@
      struct file_operations fops = {
      ...
       .read = read_f,
      ...
      };
      
      @ has_write depends on fops0 @
      identifier fops0.fops;
      identifier write_f;
      @@
      struct file_operations fops = {
      ...
       .write = write_f,
      ...
      };
      
      @ has_open depends on fops0 @
      identifier fops0.fops;
      identifier open_f;
      @@
      struct file_operations fops = {
      ...
       .open = open_f,
      ...
      };
      
      // use no_llseek if we call nonseekable_open
      ////////////////////////////////////////////
      @ nonseekable1 depends on !has_llseek && has_open @
      identifier fops0.fops;
      identifier nso ~= "nonseekable_open";
      @@
      struct file_operations fops = {
      ...  .open = nso, ...
      +.llseek = no_llseek, /* nonseekable */
      };
      
      @ nonseekable2 depends on !has_llseek @
      identifier fops0.fops;
      identifier open.open_f;
      @@
      struct file_operations fops = {
      ...  .open = open_f, ...
      +.llseek = no_llseek, /* open uses nonseekable */
      };
      
      // use seq_lseek for sequential files
      /////////////////////////////////////
      @ seq depends on !has_llseek @
      identifier fops0.fops;
      identifier sr ~= "seq_read";
      @@
      struct file_operations fops = {
      ...  .read = sr, ...
      +.llseek = seq_lseek, /* we have seq_read */
      };
      
      // use default_llseek if there is a readdir
      ///////////////////////////////////////////
      @ fops1 depends on !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
      identifier fops0.fops;
      identifier readdir_e;
      @@
      // any other fop is used that changes pos
      struct file_operations fops = {
      ... .readdir = readdir_e, ...
      +.llseek = default_llseek, /* readdir is present */
      };
      
      // use default_llseek if at least one of read/write touches f_pos
      /////////////////////////////////////////////////////////////////
      @ fops2 depends on !fops1 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
      identifier fops0.fops;
      identifier read.read_f;
      @@
      // read fops use offset
      struct file_operations fops = {
      ... .read = read_f, ...
      +.llseek = default_llseek, /* read accesses f_pos */
      };
      
      @ fops3 depends on !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
      identifier fops0.fops;
      identifier write.write_f;
      @@
      // write fops use offset
      struct file_operations fops = {
      ... .write = write_f, ...
      +	.llseek = default_llseek, /* write accesses f_pos */
      };
      
      // Use noop_llseek if neither read nor write accesses f_pos
      ///////////////////////////////////////////////////////////
      
      @ fops4 depends on !fops1 && !fops2 && !fops3 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
      identifier fops0.fops;
      identifier read_no_fpos.read_f;
      identifier write_no_fpos.write_f;
      @@
      // write fops use offset
      struct file_operations fops = {
      ...
       .write = write_f,
       .read = read_f,
      ...
      +.llseek = noop_llseek, /* read and write both use no f_pos */
      };
      
      @ depends on has_write && !has_read && !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
      identifier fops0.fops;
      identifier write_no_fpos.write_f;
      @@
      struct file_operations fops = {
      ... .write = write_f, ...
      +.llseek = noop_llseek, /* write uses no f_pos */
      };
      
      @ depends on has_read && !has_write && !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
      identifier fops0.fops;
      identifier read_no_fpos.read_f;
      @@
      struct file_operations fops = {
      ... .read = read_f, ...
      +.llseek = noop_llseek, /* read uses no f_pos */
      };
      
      @ depends on !has_read && !has_write && !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
      identifier fops0.fops;
      @@
      struct file_operations fops = {
      ...
      +.llseek = noop_llseek, /* no read or write fn */
      };
      ===== End semantic patch =====
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Cc: Julia Lawall <julia@diku.dk>
      Cc: Christoph Hellwig <hch@infradead.org>
      6038f373
  16. 06 10月, 2010 2 次提交
  17. 17 9月, 2010 1 次提交
  18. 15 6月, 2010 2 次提交
  19. 03 6月, 2010 3 次提交
    • D
      ath9k/debug: fixup the return codes · 04236066
      Dan Carpenter 提交于
      Changed -EINVAL to -EFAULT if copy_to_user() failed.
      Changed 0 to -ENOMEM if allocations failed.
      Signed-off-by: NDan Carpenter <error27@gmail.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      04236066
    • D
      ath9k/debug: improve the snprintf() handling · 2b87f3aa
      Dan Carpenter 提交于
      The snprintf() function returns the number of bytes that *would* have
      been written (not counting the NULL terminator) and that can potentally
      be more than the size of the buffer.
      
      In this patch if there were one liners where string clearly fits into
      the buffer, then I changed snprintf to sprintf().  It's confusing to use
      the return value of snprintf() as a limitter without verifying that it's
      smaller than size.  This is what initially caught my attention here.
      If we use the return value of sprintf() instead future code auditors will
      assume we've verified that it fits already.
      
      Also I did find some places where it made sense to use the return value
      after we've verified that it is smaller than the buffer size.
      
      Finally the read_file_rcstat() function added an explicit NULL terminator
      before calling snprintf().  That's unnecessary because snprintf() will
      add the null terminator automatically.
      Signed-off-by: NDan Carpenter <error27@gmail.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      2b87f3aa
    • L
      ath9k: enable the baseband watchdog events for AR9003 · 08578b8f
      Luis R. Rodriguez 提交于
      This enables the baseband watchdog events for the AR9003
      family on ath9k. Upon an a baseband watchdog interrupt we reset
      the hardware, this should address corner case conditions where
      normal operation can stall. Enable ATH_DBG_RESET to be able
      to review details of the bb watchdog interrupt once it happens.
      If you're curious how often this happens just grep the debugfs
      interrupt file.
      
      Cc: Sam Ng <sam.ng@atheros.com>
      Cc: Paul Shaw <paul.shaw@atheros.com>
      Cc: Don Breslin <don.breslin@atheros.com>
      Cc: Cliff Holden <cliff.holden@atheros.com
      Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      08578b8f
  20. 13 5月, 2010 3 次提交
  21. 17 4月, 2010 1 次提交
  22. 09 4月, 2010 1 次提交
  23. 01 4月, 2010 1 次提交