1. 21 Dec, 2009 8 commits
    • Johannes Berg's avatar
      iwlwifi: fix more eeprom endian bugs · b7bb1756
      Johannes Berg authored
      I've also for a long time had a problem with the
      temperature calculation code, which I had fixed
      by byte-swapping the values, and now it turns out
      that was the correct fix after all.
      
      Also, any use of iwl_eeprom_query_addr() that is
      for more than a u8 must be cast to little endian,
      and some structs as well.
      
      Fix all this. Again, no real impact on platforms
      that already are little endian.
      Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
      Cc: stable@kernel.org
      Signed-off-by: default avatarReinette Chatre <reinette.chatre@intel.com>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      b7bb1756
    • Johannes Berg's avatar
      iwlwifi: fix EEPROM/OTP reading endian annotations and a bug · af6b8ee3
      Johannes Berg authored
      The construct "le16_to_cpu((__force __le16)(r >> 16))" has
      always bothered me when looking through the iwlwifi code,
      it shouldn't be necessary to __force anything, and before
      this code, "r" was obtained with an ioread32, which swaps
      each of the two u16 values in it properly when swapping the
      entire u32 value. I've had arguments about this code with
      people before, but always conceded they were right because
      removing it only made things not work at all on big endian
      platforms.
      
      However, analysing a failure of the OTP reading code, I now
      finally figured out what is going on, and why my intuition
      about that code being wrong was right all along.
      
      It turns out that the 'priv->eeprom' u8 array really wants
      to have the data in it in little endian. So the force code
      above and all really converts *to* little endian, not from
      it. Cf., for instance, the function iwl_eeprom_query16() --
      it reads two u8 values and combines them into a u16, in a
      little-endian way. And considering it more, it makes sense
      to have the eeprom array as on the device, after all not
      all values really are 16-bit values, the MAC address for
      instance is not.
      
      Now, what this really means is that all the annotations are
      completely wrong. The eeprom reading code should fill the
      priv->eeprom array as a __le16 array, with __le16 values.
      
      This also means that iwl_read_otp_word() should really have
      a __le16 pointer as the data argument, since it should be
      filling that in a format suitable for priv->eeprom.
      
      Propagating these changes throughout, iwl_find_otp_image()
      is found to be, now obviously visible, defective -- it uses
      the data returned by iwl_read_otp_word() directly as if it
      was CPU endianness. Fixing that, which is this hunk of the
      patch:
      
      -               next_link_addr = link_value * sizeof(u16);
      +               next_link_addr = le16_to_cpu(link_value) * sizeof(u16);
      
      is the only real change of this patch. Everything else is
      just fixing the sparse annotations.
      
      Also, the bug only shows up on big endian platforms with a
      1000 series card. 5000 and previous series do not use OTP,
      and 6000 series has shadow RAM support which means we don't
      ever use the defective code on any cards but 1000.
      Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
      Cc: stable@kernel.org
      Signed-off-by: default avatarReinette Chatre <reinette.chatre@intel.com>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      af6b8ee3
    • Gertjan van Wingerde's avatar
      rt2x00: Disable powersaving for rt61pci and rt2800pci. · 93b6bd26
      Gertjan van Wingerde authored
      We've had many reports of rt61pci failures with powersaving enabled.
      Therefore, as a stop-gap measure, disable powersaving of the rt61pci
      until we have found a proper solution.
      Also disable powersaving on rt2800pci as it most probably will show
      the same problem.
      
      Cc: stable@kernel.org
      Signed-off-by: default avatarGertjan van Wingerde <gwingerde@gmail.com>
      Acked-by: default avatarIvo van Doorn <IvDoorn@gmail.com>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      93b6bd26
    • Julia Lawall's avatar
      drivers/net/wireless: Correct code taking the size of a pointer · 855da5e0
      Julia Lawall authored
      sizeof(iv16) and sizeof(iv32) are the sizes of pointers.  Change them to
      the size of the copied data.
      
      Furthermore, iveiv_entry is a local structure that has just been
      initialized and is not visible outside this function.  Thus, there would
      seem to be no point to copy data into it.  The order of the arguments is
      thus changed to copy the data into the parameters, which are provided as
      pointers, suggesting in this case that they should be used to return values.
      
      A simplified version of the semantic patch that finds the first problem is as
      follows: (http://coccinelle.lip6.fr/)
      
      // <smpl>
      @@
      expression *x;
      expression f;
      type T;
      @@
      
      *f(...,(T)x,...)
      // </smpl>
      Signed-off-by: default avatarJulia Lawall <julia@diku.dk>
      Acked-by: default avatarGertjan van Wingerde <gwingerde@gmail.com>
      Acked-by: default avatarIvo van Doorn <IvDoorn@gmail.com>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      855da5e0
    • Benoit Papillault's avatar
      ath9k: Last fix for TX software padding. · 4d91f9f3
      Benoit Papillault authored
      First, we copy/paste the padding stuff from ath9k_tx to ath_tx_cabq since it
      needs to same kind of padding, but for internally generated beacons.
      Next, software padding done on TX needs to be removed before calling
      ieee80211_tx_status. The code was already there in ath_tx_complete but it
      was wrong. Fix it by using ath9k_cmn_padpos. This later code has been
      tested by sending packets to a monitor interface and reading packets from the
      same interface.
      Signed-off-by: default avatarBenoit PAPILLAULT <benoit.papillault@free.fr>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      4d91f9f3
    • Wey-Yi Guy's avatar
      iwlwifi: fix syslog message for event log dump size · 521d9bce
      Wey-Yi Guy authored
      When trigger event log dumping from debugfs, the entire event log
      should be dumped and the size should match the number of events being
      dump.
      Signed-off-by: default avatarWey-Yi Guy <wey-yi.w.guy@intel.com>
      Signed-off-by: default avatarReinette Chatre <reinette.chatre@intel.com>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      521d9bce
    • Reinette Chatre's avatar
      iwlwifi: power up all devices for EEPROM read · f8701fe3
      Reinette Chatre authored
      Recent commits "iwlwifi: remove power-wasting calls to apm_ops.init()" and
      "iwlagn: power up device before initializing EEPROM" had the goal of
      reducing device power consumption from the time the module is loaded until
      the interface is brought up and the device's power saving mechanisms kick
      in. The idea is that once the module is loaded there is no need for the
      device to consume power until the interface is brought up.
      
      With the current solution the device is only powered up during EEPROM read,
      and then so also only if the EEPROM type is OTP. We have found that on
      certain platforms even non-OTP devices require power to be up during EEPROM
      read. On these platforms the driver never loads and the system log contains
      the following:
      
      iwlagn 0000:03:00.0: MAC is in deep sleep!.  CSR_GP_CNTRL = 0x080403D8
      
      We thus now power up all devices during EEPROM read.
      Signed-off-by: default avatarReinette Chatre <reinette.chatre@intel.com>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      f8701fe3
    • Zhu Yi's avatar
      iwlwifi: allocated rx page accounting cleanup · 64a76b50
      Zhu Yi authored
      In iwlwifi, priv->alloc_rxb_page is used to keep track of the Rx
      pages allocated by the driver. This cleans up the page free routines
      by introducing __iwl_free_pages/iwl_free_pages so that the accounting
      is more accurate and less error prone. This also fixes two instances where
      the counter was not updated.
      Signed-off-by: default avatarZhu Yi <yi.zhu@intel.com>
      Signed-off-by: default avatarReinette Chatre <reinette.chatre@intel.com>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      64a76b50
  2. 14 Dec, 2009 2 commits
  3. 10 Dec, 2009 7 commits
  4. 09 Dec, 2009 23 commits