]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
authorDavid S. Miller <davem@davemloft.net>
Wed, 13 Jan 2010 05:33:49 +0000 (21:33 -0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 13 Jan 2010 05:33:49 +0000 (21:33 -0800)
1  2 
drivers/net/wireless/ath/ath5k/eeprom.c
drivers/net/wireless/zd1211rw/zd_mac.c

index 5d1c8677f180f2723aa0e986ce6774a353a80477,9a96550006ad97aba6bbc43a3fa5691302ab9cd8..6a3f4da7fb489a57963c342d31c110a971fed179
@@@ -97,7 -97,7 +97,7 @@@ ath5k_eeprom_init_header(struct ath5k_h
        struct ath5k_eeprom_info *ee = &ah->ah_capabilities.cap_eeprom;
        int ret;
        u16 val;
-       u32 cksum, offset;
+       u32 cksum, offset, eep_max = AR5K_EEPROM_INFO_MAX;
  
        /*
         * Read values from EEPROM and store them in the capability structure
         * Validate the checksum of the EEPROM date. There are some
         * devices with invalid EEPROMs.
         */
-       for (cksum = 0, offset = 0; offset < AR5K_EEPROM_INFO_MAX; offset++) {
+       AR5K_EEPROM_READ(AR5K_EEPROM_SIZE_UPPER, val);
+       if (val) {
+               eep_max = (val & AR5K_EEPROM_SIZE_UPPER_MASK) <<
+                          AR5K_EEPROM_SIZE_ENDLOC_SHIFT;
+               AR5K_EEPROM_READ(AR5K_EEPROM_SIZE_LOWER, val);
+               eep_max = (eep_max | val) - AR5K_EEPROM_INFO_BASE;
+               /*
+                * Fail safe check to prevent stupid loops due
+                * to busted EEPROMs. XXX: This value is likely too
+                * big still, waiting on a better value.
+                */
+               if (eep_max > (3 * AR5K_EEPROM_INFO_MAX)) {
+                       ATH5K_ERR(ah->ah_sc, "Invalid max custom EEPROM size: "
+                                 "%d (0x%04x) max expected: %d (0x%04x)\n",
+                                 eep_max, eep_max,
+                                 3 * AR5K_EEPROM_INFO_MAX,
+                                 3 * AR5K_EEPROM_INFO_MAX);
+                       return -EIO;
+               }
+       }
+       for (cksum = 0, offset = 0; offset < eep_max; offset++) {
                AR5K_EEPROM_READ(AR5K_EEPROM_INFO(offset), val);
                cksum ^= val;
        }
        if (cksum != AR5K_EEPROM_INFO_CKSUM) {
-               ATH5K_ERR(ah->ah_sc, "Invalid EEPROM checksum 0x%04x\n", cksum);
+               ATH5K_ERR(ah->ah_sc, "Invalid EEPROM "
+                         "checksum: 0x%04x eep_max: 0x%04x (%s)\n",
+                         cksum, eep_max,
+                         eep_max == AR5K_EEPROM_INFO_MAX ?
+                               "default size" : "custom size");
                return -EIO;
        }
  
@@@ -1491,7 -1517,7 +1517,7 @@@ ath5k_eeprom_read_target_rate_pwr_info(
   * This info is used to calibrate the baseband power table. Imagine
   * that for each channel there is a power curve that's hw specific
   * (depends on amplifier etc) and we try to "correct" this curve using
 - * offests we pass on to phy chip (baseband -> before amplifier) so that
 + * offsets we pass on to phy chip (baseband -> before amplifier) so that
   * it can use accurate power values when setting tx power (takes amplifier's
   * performance on each channel into account).
   *
index 8ebf5c33955d791551dd20ac107fca41f75c2b97,9d9b263733e65efdfbdb259fb016b511614ffcd0..f14deb0c8514171809b877fdb167e95cd623c23d
@@@ -374,7 -374,7 +374,7 @@@ static void zd_mac_tx_status(struct iee
   * zd_mac_tx_failed - callback for failed frames
   * @dev: the mac80211 wireless device
   *
 - * This function is called if a frame couldn't be succesfully be
 + * This function is called if a frame couldn't be successfully be
   * transferred. The first frame from the tx queue, will be selected and
   * reported as error to the upper layers.
   */
@@@ -987,12 -987,13 +987,13 @@@ static void zd_op_configure_filter(stru
        changed_flags &= SUPPORTED_FIF_FLAGS;
        *new_flags &= SUPPORTED_FIF_FLAGS;
  
-       /* changed_flags is always populated but this driver
-        * doesn't support all FIF flags so its possible we don't
-        * need to do anything */
-       if (!changed_flags)
-               return;
+       /*
+        * If multicast parameter (as returned by zd_op_prepare_multicast)
+        * has changed, no bit in changed_flags is set. To handle this
+        * situation, we do not return if changed_flags is 0. If we do so,
+        * we will have some issue with IPv6 which uses multicast for link
+        * layer address resolution.
+        */
        if (*new_flags & (FIF_PROMISC_IN_BSS | FIF_ALLMULTI))
                zd_mc_add_all(&hash);