1. 22 12月, 2009 7 次提交
    • J
      iwlwifi: fix EEPROM/OTP reading endian annotations and a bug · af6b8ee3
      Johannes Berg 提交于
      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: NJohannes Berg <johannes@sipsolutions.net>
      Cc: stable@kernel.org
      Signed-off-by: NReinette Chatre <reinette.chatre@intel.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      af6b8ee3
    • G
      rt2x00: Disable powersaving for rt61pci and rt2800pci. · 93b6bd26
      Gertjan van Wingerde 提交于
      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: NGertjan van Wingerde <gwingerde@gmail.com>
      Acked-by: NIvo van Doorn <IvDoorn@gmail.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      93b6bd26
    • J
      drivers/net/wireless: Correct code taking the size of a pointer · 855da5e0
      Julia Lawall 提交于
      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: NJulia Lawall <julia@diku.dk>
      Acked-by: NGertjan van Wingerde <gwingerde@gmail.com>
      Acked-by: NIvo van Doorn <IvDoorn@gmail.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      855da5e0
    • B
      ath9k: Last fix for TX software padding. · 4d91f9f3
      Benoit Papillault 提交于
      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: NBenoit PAPILLAULT <benoit.papillault@free.fr>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      4d91f9f3
    • W
      iwlwifi: fix syslog message for event log dump size · 521d9bce
      Wey-Yi Guy 提交于
      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: NWey-Yi Guy <wey-yi.w.guy@intel.com>
      Signed-off-by: NReinette Chatre <reinette.chatre@intel.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      521d9bce
    • R
      iwlwifi: power up all devices for EEPROM read · f8701fe3
      Reinette Chatre 提交于
      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: NReinette Chatre <reinette.chatre@intel.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      f8701fe3
    • Z
      iwlwifi: allocated rx page accounting cleanup · 64a76b50
      Zhu Yi 提交于
      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: NZhu Yi <yi.zhu@intel.com>
      Signed-off-by: NReinette Chatre <reinette.chatre@intel.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      64a76b50
  2. 15 12月, 2009 2 次提交
  3. 11 12月, 2009 7 次提交
  4. 10 12月, 2009 2 次提交
  5. 09 12月, 2009 22 次提交