Skip to content

Commit

Permalink
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/gi…
Browse files Browse the repository at this point in the history
…t/linville/wireless-2.6
  • Loading branch information
David S. Miller committed May 21, 2009
2 parents 1ddbcb0 + a6c6733 commit 86c2fe1
Show file tree
Hide file tree
Showing 10 changed files with 68 additions and 53 deletions.
23 changes: 14 additions & 9 deletions drivers/net/wireless/airo.c
Original file line number Diff line number Diff line change
Expand Up @@ -6467,6 +6467,7 @@ static int airo_get_encode(struct net_device *dev,
{
struct airo_info *local = dev->ml_priv;
int index = (dwrq->flags & IW_ENCODE_INDEX) - 1;
int wep_key_len;
u8 buf[16];

if (!local->wep_capable)
Expand Down Expand Up @@ -6500,11 +6501,13 @@ static int airo_get_encode(struct net_device *dev,
dwrq->flags |= index + 1;

/* Copy the key to the user buffer */
dwrq->length = get_wep_key(local, index, &buf[0], sizeof(buf));
if (dwrq->length != -1)
memcpy(extra, buf, dwrq->length);
else
wep_key_len = get_wep_key(local, index, &buf[0], sizeof(buf));
if (wep_key_len < 0) {
dwrq->length = 0;
} else {
dwrq->length = wep_key_len;
memcpy(extra, buf, dwrq->length);
}

return 0;
}
Expand Down Expand Up @@ -6617,7 +6620,7 @@ static int airo_get_encodeext(struct net_device *dev,
struct airo_info *local = dev->ml_priv;
struct iw_point *encoding = &wrqu->encoding;
struct iw_encode_ext *ext = (struct iw_encode_ext *)extra;
int idx, max_key_len;
int idx, max_key_len, wep_key_len;
u8 buf[16];

if (!local->wep_capable)
Expand Down Expand Up @@ -6661,11 +6664,13 @@ static int airo_get_encodeext(struct net_device *dev,
memset(extra, 0, 16);

/* Copy the key to the user buffer */
ext->key_len = get_wep_key(local, idx, &buf[0], sizeof(buf));
if (ext->key_len != -1)
memcpy(extra, buf, ext->key_len);
else
wep_key_len = get_wep_key(local, idx, &buf[0], sizeof(buf));
if (wep_key_len < 0) {
ext->key_len = 0;
} else {
ext->key_len = wep_key_len;
memcpy(extra, buf, ext->key_len);
}

return 0;
}
Expand Down
49 changes: 28 additions & 21 deletions drivers/net/wireless/ath5k/phy.c
Original file line number Diff line number Diff line change
Expand Up @@ -1487,28 +1487,35 @@ ath5k_get_linear_pcdac_min(const u8 *stepL, const u8 *stepR,
{
s8 tmp;
s16 min_pwrL, min_pwrR;
s16 pwr_i = pwrL[0];

do {
pwr_i--;
tmp = (s8) ath5k_get_interpolated_value(pwr_i,
pwrL[0], pwrL[1],
stepL[0], stepL[1]);

} while (tmp > 1);

min_pwrL = pwr_i;

pwr_i = pwrR[0];
do {
pwr_i--;
tmp = (s8) ath5k_get_interpolated_value(pwr_i,
pwrR[0], pwrR[1],
stepR[0], stepR[1]);

} while (tmp > 1);
s16 pwr_i;

if (pwrL[0] == pwrL[1])
min_pwrL = pwrL[0];
else {
pwr_i = pwrL[0];
do {
pwr_i--;
tmp = (s8) ath5k_get_interpolated_value(pwr_i,
pwrL[0], pwrL[1],
stepL[0], stepL[1]);
} while (tmp > 1);

min_pwrL = pwr_i;
}

min_pwrR = pwr_i;
if (pwrR[0] == pwrR[1])
min_pwrR = pwrR[0];
else {
pwr_i = pwrR[0];
do {
pwr_i--;
tmp = (s8) ath5k_get_interpolated_value(pwr_i,
pwrR[0], pwrR[1],
stepR[0], stepR[1]);
} while (tmp > 1);

min_pwrR = pwr_i;
}

/* Keep the right boundary so that it works for both curves */
return max(min_pwrL, min_pwrR);
Expand Down
8 changes: 4 additions & 4 deletions drivers/net/wireless/ath5k/reset.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
\*****************************/

#include <linux/pci.h> /* To determine if a card is pci-e */
#include <linux/bitops.h> /* For get_bitmask_order */
#include <linux/log2.h>
#include "ath5k.h"
#include "reg.h"
#include "base.h"
Expand Down Expand Up @@ -69,10 +69,10 @@ static inline int ath5k_hw_write_ofdm_timings(struct ath5k_hw *ah,

/* Get exponent
* ALGO: coef_exp = 14 - highest set bit position */
coef_exp = get_bitmask_order(coef_scaled);
coef_exp = ilog2(coef_scaled);

/* Doesn't make sense if it's zero*/
if (!coef_exp)
if (!coef_scaled || !coef_exp)
return -EINVAL;

/* Note: we've shifted coef_scaled by 24 */
Expand Down Expand Up @@ -359,7 +359,7 @@ int ath5k_hw_nic_wakeup(struct ath5k_hw *ah, int flags, bool initial)
mode |= AR5K_PHY_MODE_FREQ_5GHZ;

if (ah->ah_radio == AR5K_RF5413)
clock |= AR5K_PHY_PLL_40MHZ_5413;
clock = AR5K_PHY_PLL_40MHZ_5413;
else
clock |= AR5K_PHY_PLL_40MHZ;

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/iwlwifi/iwl-5000.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
#include "iwl-6000-hw.h"

/* Highest firmware API version supported */
#define IWL5000_UCODE_API_MAX 1
#define IWL5000_UCODE_API_MAX 2
#define IWL5150_UCODE_API_MAX 2

/* Lowest firmware API version supported */
Expand Down
7 changes: 0 additions & 7 deletions drivers/net/wireless/iwlwifi/iwl-agn.c
Original file line number Diff line number Diff line change
Expand Up @@ -669,13 +669,6 @@ static int iwl_set_mode(struct iwl_priv *priv, int mode)
if (!iwl_is_ready_rf(priv))
return -EAGAIN;

cancel_delayed_work(&priv->scan_check);
if (iwl_scan_cancel_timeout(priv, 100)) {
IWL_WARN(priv, "Aborted scan still in progress after 100ms\n");
IWL_DEBUG_MAC80211(priv, "leaving - scan abort failed.\n");
return -EAGAIN;
}

iwl_commit_rxon(priv);

return 0;
Expand Down
7 changes: 4 additions & 3 deletions drivers/net/wireless/iwlwifi/iwl-scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,6 @@ static void iwl_rx_scan_complete_notif(struct iwl_priv *priv,
/* The HW is no longer scanning */
clear_bit(STATUS_SCAN_HW, &priv->status);

/* The scan completion notification came in, so kill that timer... */
cancel_delayed_work(&priv->scan_check);

IWL_DEBUG_INFO(priv, "Scan pass on %sGHz took %dms\n",
(priv->scan_bands & BIT(IEEE80211_BAND_2GHZ)) ?
"2.4" : "5.2",
Expand Down Expand Up @@ -712,6 +709,8 @@ static void iwl_bg_request_scan(struct work_struct *data)

mutex_lock(&priv->mutex);

cancel_delayed_work(&priv->scan_check);

if (!iwl_is_ready(priv)) {
IWL_WARN(priv, "request scan called when driver not ready.\n");
goto done;
Expand Down Expand Up @@ -925,6 +924,8 @@ void iwl_bg_scan_completed(struct work_struct *work)

IWL_DEBUG_SCAN(priv, "SCAN complete scan\n");

cancel_delayed_work(&priv->scan_check);

ieee80211_scan_completed(priv->hw, false);

if (test_bit(STATUS_EXIT_PENDING, &priv->status))
Expand Down
9 changes: 2 additions & 7 deletions drivers/net/wireless/iwlwifi/iwl3945-base.c
Original file line number Diff line number Diff line change
Expand Up @@ -782,13 +782,6 @@ static int iwl3945_set_mode(struct iwl_priv *priv, int mode)
if (!iwl_is_ready_rf(priv))
return -EAGAIN;

cancel_delayed_work(&priv->scan_check);
if (iwl_scan_cancel_timeout(priv, 100)) {
IWL_WARN(priv, "Aborted scan still in progress after 100ms\n");
IWL_DEBUG_MAC80211(priv, "leaving - scan abort failed.\n");
return -EAGAIN;
}

iwl3945_commit_rxon(priv);

return 0;
Expand Down Expand Up @@ -3298,6 +3291,8 @@ static void iwl3945_bg_request_scan(struct work_struct *data)

mutex_lock(&priv->mutex);

cancel_delayed_work(&priv->scan_check);

if (!iwl_is_ready(priv)) {
IWL_WARN(priv, "request scan called when driver not ready.\n");
goto done;
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/rt2x00/rt2x00debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ void rt2x00debug_update_crypto(struct rt2x00_dev *rt2x00dev,

if (cipher == CIPHER_TKIP_NO_MIC)
cipher = CIPHER_TKIP;
if (cipher == CIPHER_NONE || cipher > CIPHER_MAX)
if (cipher == CIPHER_NONE || cipher >= CIPHER_MAX)
return;

/* Remove CIPHER_NONE index */
Expand Down
7 changes: 7 additions & 0 deletions net/wireless/reg.c
Original file line number Diff line number Diff line change
Expand Up @@ -1551,6 +1551,13 @@ static int regulatory_hint_core(const char *alpha2)

queue_regulatory_request(request);

/*
* This ensures last_request is populated once modules
* come swinging in and calling regulatory hints and
* wiphy_apply_custom_regulatory().
*/
flush_scheduled_work();

return 0;
}

Expand Down
7 changes: 7 additions & 0 deletions net/wireless/wext.c
Original file line number Diff line number Diff line change
Expand Up @@ -786,6 +786,13 @@ static int ioctl_standard_iw_point(struct iw_point *iwp, unsigned int cmd,
err = -EFAULT;
goto out;
}

if (cmd == SIOCSIWENCODEEXT) {
struct iw_encode_ext *ee = (void *) extra;

if (iwp->length < sizeof(*ee) + ee->key_len)
return -EFAULT;
}
}

err = handler(dev, info, (union iwreq_data *) iwp, extra);
Expand Down

0 comments on commit 86c2fe1

Please sign in to comment.