1. 13 5月, 2011 3 次提交
  2. 02 5月, 2011 2 次提交
  3. 29 4月, 2011 1 次提交
    • A
      wl12xx: support FW TX inactivity triggers · 47684808
      Arik Nemtsov 提交于
      In AP mode we register for the MAX_TX_RETRY and INACTIVE_STA events.
      Both are reported to the upper layers as a TX failure in the offending
      stations.
      
      In STA mode we register only for the MAX_TX_RETRY event. A TX failure is
      interpreted as a loss of connection.
      
      Support for IEEE80211_HW_REPORTS_TX_ACK_STATUS has been removed to avoid
      the inherent race condition of a mac80211 TX failure counter in addition
      to the FW counter.
      
      This patch depends on "mac80211: allow low level driver to report packet
      loss"
      Signed-off-by: NArik Nemtsov <arik@wizery.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      47684808
  4. 19 4月, 2011 13 次提交
    • I
      wl12xx: Handle platforms without level trigger interrupts · 341b7cde
      Ido Yariv 提交于
      Some platforms are incapable of triggering on level interrupts. Add a
      platform quirks member in the platform data structure, as well as an
      edge interrupt quirk which can be set on such platforms.
      
      When the interrupt is requested with IRQF_TRIGGER_RISING, IRQF_ONESHOT
      cannot be used, as we might miss interrupts that occur after the FW
      status is cleared and before the threaded interrupt handler exits.
      
      Moreover, when IRQF_ONESHOT is not set, iterating more than once in the
      threaded interrupt handler introduces a few race conditions between this
      handler and the hardirq handler. Currently this is worked around by
      limiting the loop to one iteration only. This workaround has an impact
      on performance. To remove to this restriction, the race conditions will
      need to be addressed.
      Signed-off-by: NIdo Yariv <ido@wizery.com>
      Signed-off-by: NLuciano Coelho <coelho@ti.com>
      341b7cde
    • I
      wl12xx: Simplify TX blocks accounting · d2f4d47d
      Ido Yariv 提交于
      The total number of TX memory blocks may change when the dynamic memory
      option is enabled. The current implementation only tracks the available
      memory blocks, which over-complicates TX blocks accounting.
      
      By tracking the number of allocated blocks, calculation of the number of
      available blocks becomes simpler and cleaner. It simply equals the total
      number of TX memory blocks minus the allocated ones.
      
      Also, remove some unnecessary castings and use union member accesses
      instead.
      Signed-off-by: NIdo Yariv <ido@wizery.com>
      Signed-off-by: NArik Nemtsov <arik@wizery.com>
      Signed-off-by: NLuciano Coelho <coelho@ti.com>
      d2f4d47d
    • I
      wl12xx: Clean up the dummy packet mechanism · 990f5de7
      Ido Yariv 提交于
      The current implementation allocates a skb each time one is requested by
      the firmware. Since dummy packets are handled differently than regular
      packets, the skb needs to be marked. Currently, this is done by
      setting the pkt_type member to 5. This might not be safe, as we cannot
      be sure that there won't be any other packets with this pkt_type value.
      
      Since the packet does not change from one request to another, we can
      simply allocate a dummy packet template and always send it. All changes
      to the skb done during packet preparation must be reverted, so the same
      skb can be reused.
      
      The dummy packets are not transmitted, therefore there's no need to set
      the BSSID or our own MAC address.
      
      In addition, the header portion of the packet was zeroed by mistake, so
      fix that as well.
      Signed-off-by: NIdo Yariv <ido@wizery.com>
      Signed-off-by: NLuciano Coelho <coelho@ti.com>
      990f5de7
    • I
      wl12xx: Clean up the block size alignment code · 0da13da7
      Ido Yariv 提交于
      Simplify and clean up the block size alignment code:
      1. Set the block size according to the padding field type, as it cannot
         exceed the maximum value this field can hold.
      2. Move the alignment code into a function instead of duplicating it in
         multiple places.
      3. In the current implementation, the block_size member can be
         misleading because a zero value actually means that there's no need to
         align. Declare a block size alignment quirk instead.
      Signed-off-by: NIdo Yariv <ido@wizery.com>
      Signed-off-by: NLuciano Coelho <coelho@ti.com>
      0da13da7
    • J
      wl12xx: Handle duplicate calling of remove interface · 13026dec
      Juuso Oikarinen 提交于
      Because of the hardware recovery mechanism, its possible the
      __wl1271_op_remove_interface is called twice. Currently, this leads to a
      kernel crash even before a kernel WARNing can be issued.
      
      Fix this.
      Signed-off-by: NJuuso Oikarinen <juuso.oikarinen@nokia.com>
      Signed-off-by: NLuciano Coelho <coelho@ti.com>
      13026dec
    • L
      wl12xx: use a bitmask instead of list of booleans in scanned_ch · 4a31c11c
      Luciano Coelho 提交于
      We were using an array of booleans to mark the channels we had already
      scanned.  This was causing a sparse error, because bool is not a type
      with defined size.  To fix this, use bitmasks instead, which is much
      cleaner anyway.
      
      Thanks Johannes Berg for the idea.
      Signed-off-by: NLuciano Coelho <coelho@ti.com>
      4a31c11c
    • L
      wl12xx: use 1 spare TX block instead of two · e7ddf549
      Luciano Coelho 提交于
      All the new firmware versions (>=6.1.3.50.58 for STA and >=6.2.0.0.47
      for AP) use 1 spare TX block.  We still want to support older
      firmwares that require 2 spare blocks, so added a quirk to handle the
      difference.
      
      Also implemented a generic way of setting quirks that depend on the
      firmware revision.
      Signed-off-by: NLuciano Coelho <coelho@ti.com>
      e7ddf549
    • A
      wl12xx: 1281/1283 support - Use different FW file for AP mode wl127x/wl128x chips · 1aed55fd
      Arik Nemtsov 提交于
      Choose a different FW for AP-mode wl127x and wl128x chips, base on chip
      ID at boot time.
      Signed-off-by: NArik Nemtsov <arik@wizery.com>
      Reviewed-by: NLuciano Coelho <coelho@ti.com>
      Signed-off-by: NLuciano Coelho <coelho@ti.com>
      1aed55fd
    • S
      wl12xx: 1281/1283 support - use dynamic memory for the RX/TX pools · 13b107dd
      Shahar Levi 提交于
      Separate the memory configuration to chip-specific structures and
      implement dynamic memory for wl128x.
      
      This feature allows us to move TX memory blocks to the RX pool when
      the RX path is overloaded.
      
      Thanks for Arik Nemtsov <arik@wizery.com> for helping simplify the
      wl1271_fw_status() code.
      
      [Rewrote the commit subject and message for clarity; improved some
      comments and changed "spare" to "padding" for consistency; added a
      FIXME for the AP memory configuration -- Luca]
      Signed-off-by: NShahar Levi <shahar_levi@ti.com>
      Reviewed-by: NLuciano Coelho <coelho@ti.com>
      Signed-off-by: NLuciano Coelho <coelho@ti.com>
      13b107dd
    • S
      wl12xx: 1281/1283 support - New boot sequence · 5ea417ae
      Shahar Levi 提交于
      Boot sequence support FREF clock and TCXO clock.
      WL128x has two clocks input - TCXO and FREF.
      TCXO is the main clock of the device, while FREF is used to sync
      between the GPS and the cellular modem.
      Auto-detection checks where TCXO is 32.736MHz or 16.368MHz, in that
      case the FREF will be used as the WLAN/BT main clock.
      
      [Use clock enumeration as defined in linux/wl12xx.h; remove
      unnecessary else block in wl128x_switch_fref; remove unnecessary
      change in main.c; remove some unnecessary debug prints and comments;
      fix potential use of uninitialized value (pll_config) -- Luca]
      Signed-off-by: NShahar Levi <shahar_levi@ti.com>
      Reviewed-by: NLuciano Coelho <coelho@ti.com>
      Signed-off-by: NLuciano Coelho <coelho@ti.com>
      5ea417ae
    • S
      wl12xx: 1281/1283 support - Loading FW & NVS · bc765bf3
      Shahar Levi 提交于
      Take care of FW & NVS with the auto-detection between wl127x and
      wl128x.
      
      [Moved some common code outside if statements and added notes about
      NVS structure assumptions; Fixed a bug when checking the nvs size: if
      the size was incorrect, the local nvs variable was set to NULL, it
      should be wl->nvs instead. -- Luca]
      
      [Merged with potential buffer overflow fix -- Luca]
      Signed-off-by: NShahar Levi <shahar_levi@ti.com>
      Reviewed-by: NLuciano Coelho <coelho@ti.com>
      Signed-off-by: NLuciano Coelho <coelho@ti.com>
      bc765bf3
    • S
      wl12xx: 1281/1283 support - Add acx commands · 48a61477
      Shahar Levi 提交于
      New acx command that sets: Rx fifo enable reduced bus transactions
      in RX path. Tx bus transactions padding to SDIO block size that
      improve preference in Tx and essential for working with SDIO HS (48Mhz).
      The max SDIO block size is 256 when working with Tx bus transactions
      padding to SDIO block.
      
      Add new ops to SDIO & SPI that handles the win size change in case of
      transactions padding (relevant only for SDIO).
      
      [Fix endianess issues; simplify sdio-specific block_size handling;
      minor changes in comments; use "aligned_len" in one calculation
      instead of "pad" to avoid confusion -- Luca]
      Signed-off-by: NShahar Levi <shahar_levi@ti.com>
      Reviewed-by: NLuciano Coelho <coelho@ti.com>
      Signed-off-by: NLuciano Coelho <coelho@ti.com>
      48a61477
    • S
      wl12xx: 1281/1283 support - Add Definitions · 5aa42346
      Shahar Levi 提交于
      Definitions to support wl128x:
        - New FW file name
        - Chip ID
        - New PLL Configuration Algorithm macros that will be used at wl128x
          boot stage
        - Rename NVS macro name: wl127x and wl128x are using the same NVS
          file name. However, the ini parameters between them are
          different. The driver will validate the correct NVS size in
          wl1271_boot_upload_nvs().
      
      [Cleaned up some of the definitions. -- Luca]
      Signed-off-by: NShahar Levi <shahar_levi@ti.com>
      Reviewed-by: NLuciano Coelho <coelho@ti.com>
      Signed-off-by: NLuciano Coelho <coelho@ti.com>
      5aa42346
  5. 03 3月, 2011 4 次提交
    • I
      wl12xx: Avoid redundant TX work · b07d4037
      Ido Yariv 提交于
      TX might be handled in the threaded IRQ handler, in which case, TX work
      might be scheduled just to discover it has nothing to do.
      
      Save a few context switches by cancelling redundant TX work in case TX
      is about to be handled in the threaded IRQ handler. Also, avoid
      scheduling TX work from wl1271_op_tx if not needed.
      Signed-off-by: NIdo Yariv <ido@wizery.com>
      Reviewed-by: NLuciano Coelho <coelho@ti.com>
      Signed-off-by: NLuciano Coelho <coelho@ti.com>
      b07d4037
    • I
      wl12xx: Switch to a threaded interrupt handler · a620865e
      Ido Yariv 提交于
      To achieve maximal throughput, it is very important to react to
      interrupts as soon as possible. Currently the interrupt handler wakes up
      a worker for handling interrupts in process context. A cleaner and more
      efficient design would be to request a threaded interrupt handler.  This
      handler's priority is very high, and can do blocking operations such as
      SDIO/SPI transactions.
      
      Some work can be deferred, mostly calls to mac80211 APIs
      (ieee80211_rx_ni and ieee80211_tx_status). By deferring such work to a
      different worker, we can keep the irq handler thread more I/O
      responsive. In addition, on multi-core systems the two threads can be
      scheduled on different cores, which will improve overall performance.
      
      The use of WL1271_FLAG_IRQ_PENDING & WL1271_FLAG_IRQ_RUNNING was
      changed. For simplicity, always query the FW for more pending
      interrupts. Since there are relatively long bursts of interrupts, the
      extra FW status read overhead is negligible. In addition, this enables
      registering the IRQ handler with the ONESHOT option.
      Signed-off-by: NIdo Yariv <ido@wizery.com>
      Reviewed-by: NLuciano Coelho <coelho@ti.com>
      Signed-off-by: NLuciano Coelho <coelho@ti.com>
      a620865e
    • I
      wl12xx: Do end-of-transactions transfers only if needed · 606ea9fa
      Ido Yariv 提交于
      On newer hardware revisions, there is no need to write the host's
      counter at the end of a RX transaction. The same applies to writing the
      number of packets at the end of a TX transaction.
      
      It is generally a good idea to avoid unnecessary SDIO/SPI transfers.
      Throughput and CPU usage are improved when avoiding these.
      
      Send the host's RX counter and the TX packet count only if needed, based
      on the hardware revision.
      
      [Changed WL12XX_QUIRK_END_OF_TRANSACTION to use BIT(0) -- Luca]
      Signed-off-by: NIdo Yariv <ido@wizery.com>
      Signed-off-by: NOhad Ben-Cohen <ohad@wizery.com>
      Reviewed-by: NLuciano Coelho <coelho@ti.com>
      Signed-off-by: NLuciano Coelho <coelho@ti.com>
      606ea9fa
    • S
      wl12xx: fix the path to the wl12xx firmwares · f62c317c
      Sebastien Jan 提交于
      In the linux-firmware git tree, the firmwares and the NVS are inside
      the ti-connectivity directory.  Fix the filenames that the driver
      looks for accordingly.
      
      [Fixed commit message and merged with the latest changes. -- Luca]
      Signed-off-by: NSebastien Jan <s-jan@ti.com>
      Signed-off-by: NLuciano Coelho <coelho@ti.com>
      f62c317c
  6. 23 2月, 2011 3 次提交
    • A
      wl12xx: AP-mode - management of links in PS-mode · b622d992
      Arik Nemtsov 提交于
      Update the PS mode of each link according to a bitmap polled from
      fw_status. Manually notify mac80211 about PS mode changes in connected
      stations.
      
      mac80211 will only be notified about PS start when the station is in PS
      and there is a small number of TX blocks from this link ready in HW.
      This is required for waking up the remote station since the TIM is
      updated entirely by FW.
      
      When a station enters mac80211-PS-mode, we drop all the skbs in the
      low-level TX queues belonging to this sta with STAT_TX_FILTERED
      to keep our queues clean.
      Signed-off-by: NArik Nemtsov <arik@wizery.com>
      Signed-off-by: NLuciano Coelho <coelho@ti.com>
      b622d992
    • A
      wl12xx: AP-mode - count free FW TX blocks per link · 09039f42
      Arik Nemtsov 提交于
      Count the number of FW TX blocks allocated per link. We add blocks to a
      link counter when allocated for a TX descriptor. We remove blocks
      according to counters in fw_status indicating the number of freed blocks
      in FW. These counters are polled after each IRQ.
      Signed-off-by: NArik Nemtsov <arik@wizery.com>
      Signed-off-by: NLuciano Coelho <coelho@ti.com>
      09039f42
    • A
      wl12xx: AP-mode - TX queue per link in AC · a8c0ddb5
      Arik Nemtsov 提交于
      When operating in AP-mode we require a per link tx-queue.
      This allows us to implement HW assisted PS mode for links,
      as well as regulate per-link FW TX blocks consumption.
      Split each link into ACs to support future QoS for AP-mode.
      
      AC queues are emptied in priority and per-link queues are
      scheduled in a simple round-robin fashion.
      Signed-off-by: NArik Nemtsov <arik@wizery.com>
      Signed-off-by: NLuciano Coelho <coelho@ti.com>
      a8c0ddb5
  7. 09 2月, 2011 2 次提交
  8. 25 1月, 2011 11 次提交
  9. 15 12月, 2010 1 次提交
    • J
      wl12xx: Change TX queue to be per AC · 6742f554
      Juuso Oikarinen 提交于
      With the current single-queue implementation traffic priorization is not
      working correctly - when using multiple BE streams and one, say VI stream,
      the VI stream will share bandwidth almost equally with the BE streams.
      
      To fix the issue, implement per AC queues, which are emptied in priority
      order to the firmware. To keep it relatively simple, maintain a global
      buffer count and global queue stop/wake instead of per-AC.
      
      With these changes, priorization appears to work just fine.
      Signed-off-by: NJuuso Oikarinen <juuso.oikarinen@nokia.com>
      Signed-off-by: NLuciano Coelho <luciano.coelho@nokia.com>
      6742f554