1. 04 11月, 2009 1 次提交
    • I
      wimax/i2400m: introduce i2400m_reset(), stopping TX and carrier · c931ceeb
      Inaky Perez-Gonzalez 提交于
      Currently the i2400m driver was resetting by just calling
      i2400m->bus_reset(). However, this was missing stopping the TX queue
      and downing the carrier. This was causing, for the corner case of the
      driver reseting a device that refuses to go out of idle mode, that a
      few packets would be queued and more than one reset would go through,
      making the recovery a wee bit messy.
      
      To avoid introducing the same cleanup in all the bus-specific driver,
      introduced a i2400m_reset() function that takes care of house cleaning
      and then calling the bus-level reset implementation.
      
      The bulk of the changes in all files are just to rename the call from
      i2400m->bus_reset() to i2400m_reset().
      Signed-off-by: NInaky Perez-Gonzalez <inaky@linux.intel.com>
      c931ceeb
  2. 19 10月, 2009 3 次提交
    • I
      wimax/i2400m: queue device's report until the driver is ready for them · a0beba21
      Inaky Perez-Gonzalez 提交于
      The i2400m might start sending reports to the driver before it is done
      setting up all the infrastructure needed for handling them.
      
      Currently we were just dropping them when the driver wasn't ready and
      that is bad in certain situations, as the sync between the driver's
      idea of the device's state and the device's state dissapears.
      
      This changes that by implementing a queue for handling
      reports. Incoming reports are appended to it and a workstruct is woken
      to process the list of queued reports.
      
      When the device is not yet ready to handle them, the workstruct is not
      woken, but at soon as the device becomes ready again, the queue is
      processed.
      
      As a consequence of this, i2400m_queue_work() is no longer used, and
      thus removed.
      Signed-off-by: NInaky Perez-Gonzalez <inaky@linux.intel.com>
      a0beba21
    • I
      wimax/i2400m: clarify and fix i2400m->{ready,updown} · c2315b4e
      Inaky Perez-Gonzalez 提交于
      The i2400m driver uses two different bits to distinguish how much the
      driver is up. i2400m->ready is used to denote that the infrastructure
      to communicate with the device is up and running. i2400m->updown is
      used to indicate if 'ready' and the device is up and running, ready to
      take control and data traffic.
      
      However, all this was pretty dirty and not clear, with many open spots
      where race conditions were present.
      
      This commit cleans up the situation by:
      
       - documenting the usage of both bits
      
       - setting them only in specific, well controlled places
         (i2400m_dev_start, i2400m_dev_stop)
      
       - ensuring the i2400m workqueue can't get in the middle of the
         setting by flushing it when i2400m->ready is set to zero. This
         allows the report hook not having to check again for the bit to be
         set [rx.c:i2400m_report_hook_work()].
      
       - using i2400m->updown to determine if the device is up and running
         instead of the wimax state in i2400m_dev_reset_handle().
      
       - not loosing missed messages sent by the hardware before
         i2400m->ready is set. In rx.c, whatever the device sends can be
         sent to user space over the message pipes as soon as the wimax
         device is registered, so don't wait for i2400m->ready to be set.
      Signed-off-by: NInaky Perez-Gonzalez <inaky@linux.intel.com>
      c2315b4e
    • I
      wimax/i2400m: rework bootrom initialization to be more flexible · aba3792a
      Inaky Perez-Gonzalez 提交于
      This modifies the bootrom initialization code of the i2400m driver so
      it can more easily support upcoming hardware.
      
      Currently, the code detects two types of barkers (magic numbers) sent
      by the device to indicate the types of firmware it would take (signed
      vs non-signed).
      
      This schema is extended so that multiple reboot barkers are
      recognized; upcoming hw will expose more types barkers which will have
      to match a header in the firmware image before we can load it.
      
      For that, a barker database is introduced; the first time the device
      sends a barker, it is matched in the database. That gives the driver
      the information needed to decide how to upload the firmware and which
      types of firmware to use. The database can be populated from module
      parameters.
      
      The execution flow is not altered; a new function
      (i2400m_is_boot_barker) is introduced to determine in the RX path if
      the device has sent a boot barker. This function is becoming heavier,
      so it is put away from the hot reception path [this is why there is
      some reorganization in sdio-rx.c:i2400ms_rx and
      usb-notifc.c:i2400mu_notification_grok()].
      
      The documentation on the process has also been updated.
      
      All these modifications are heavily based on previous work by Dirk
      Brandewie <dirk.brandewie@intel.com>.
      Signed-off-by: NInaky Perez-Gonzalez <inaky@linux.intel.com>
      aba3792a
  3. 11 6月, 2009 1 次提交
  4. 29 5月, 2009 2 次提交
  5. 15 5月, 2009 1 次提交
    • I
      wimax/i2400m: fix device crash: fix optimization in _roq_queue_update_ws · 4e5b6d00
      Inaky Perez-Gonzalez 提交于
      When the i2400m receives data and the device indicates there has to be
      reordering, we keep an sliding window implementation to sort the
      packets before sending them to the network stack.
      
      One of the "operations" that the device indicates is "queue a packet
      and update the window start". When the queue is empty, this is
      equivalent to "deliver the packet and update the window start".
      
      That case was optimized in i2400m_roq_queue_update_ws() so that we
      would not pointlessly queue and dequeue a packet. However, when the
      optimization was active, it wasn't updating the window start. That
      caused the reorder management code to get confused later on with what
      seemed to be wrong reorder requests from the device.
      
      Thus the fix implemented is to do the right thing and update the
      window start in both cases, when the queue is empty (and the
      optimization is done) and when not.
      Signed-off-by: NInaky Perez-Gonzalez <inaky@linux.intel.com>
      4e5b6d00
  6. 02 3月, 2009 2 次提交
    • I
      wimax/i2400m: implement RX reorder support · c747583d
      Inaky Perez-Gonzalez 提交于
      Allow the device to give the driver RX data with reorder information.
      
      When that is done, the device will indicate the driver if a packet has
      to be held in a (sorted) queue. It will also tell the driver when held
      packets have to be released to the OS.
      
      This is done to improve the WiMAX-protocol level retransmission
      support when missing frames are detected.
      
      The code docs provide details about the implementation.
      
      In general, this just hooks into the RX path in rx.c; if a packet with
      the reorder bit in the RX header is detected, the reorder information
      in the header is extracted and one of the four main reorder operations
      are executed. In one case (queue) no packet will be delivered to the
      networking stack, just queued, whereas in the others (reset, update_ws
      and queue_update_ws), queued packet might be delivered depending on
      the window start for the specific queue.
      
      The modifications to files other than rx.c are:
      
      - control.c: during device initialization, enable reordering support
        if the rx_reorder_disabled module parameter is not enabled
      
      - driver.c: expose a rx_reorder_disable module parameter and call
        i2400m_rx_setup/release() to initialize/shutdown RX reorder
        support.
      
      - i2400m.h: introduce members in 'struct i2400m' needed for
        implementing reorder support.
      
      - linux/i2400m.h: introduce TLVs, commands and constant definitions
        related to RX reorder
      
      Last but not least, the rx reorder code includes an small circular log
      where the last N reorder operations are recorded to be displayed in
      case of inconsistency. Otherwise diagnosing issues would be almost
      impossible.
      Signed-off-by: NInaky Perez-Gonzalez <inaky@linux.intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c747583d
    • I
      wimax/i2400m: support extended data RX protocol (no need to reallocate skbs) · fd5c565c
      Inaky Perez-Gonzalez 提交于
      Newer i2400m firmwares (>= v1.4) extend the data RX protocol so that
      each packet has a 16 byte header. This header is mainly used to
      implement host reordeing (which is addressed in later commits).
      
      However, this header also allows us to overwrite it (once data has
      been extracted) with an Ethernet header and deliver to the networking
      stack without having to reallocate the skb (as it happened in fw <=
      v1.3) to make room for it.
      
      - control.c: indicate the device [dev_initialize()] that the driver
        wants to use the extended data RX protocol. Also involves adding the
        definition of the needed data types in include/linux/wimax/i2400m.h.
      
      - rx.c: handle the new payload type for the extended RX data
        protocol. Prepares the skb for delivery to
        netdev.c:i2400m_net_erx().
      
      - netdev.c: Introduce i2400m_net_erx() that adds the fake ethernet
        address to a prepared skb and delivers it to the networking
        stack.
      
      - cleanup: in most instances in rx.c, the variable 'single' was
        renamed to 'single_last' for it better conveys its meaning.
      Signed-off-by: NInaky Perez-Gonzalez <inaky@linux.intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      fd5c565c
  7. 27 2月, 2009 1 次提交
  8. 08 1月, 2009 1 次提交
    • I
      i2400m: RX and TX data/control paths · aa5a7aca
      Inaky Perez-Gonzalez 提交于
      Handling of TX/RX data to/from the i2400m device (IP packets, control
      and diagnostics). On RX, this parses the received read transaction
      from the device, breaks it in chunks and passes it to the
      corresponding subsystems (network and control).
      
      Transmission to the device is done through a software FIFO, as
      data/control frames can be coalesced (while the device is reading the
      previous tx transaction, others accumulate). A FIFO is used because at
      the end it is resource-cheaper that scatter/gather over USB. As well,
      most traffic is going to be download (vs upload).
      Signed-off-by: NInaky Perez-Gonzalez <inaky@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      aa5a7aca