Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6

This commit is contained in:
David S. Miller 2009-05-05 11:56:07 -07:00
commit 86b698b8cb
7 changed files with 78 additions and 59 deletions

View File

@ -719,6 +719,14 @@ static int iwl_set_tkip_dynamic_key_info(struct iwl_priv *priv,
{ {
unsigned long flags; unsigned long flags;
int ret = 0; int ret = 0;
__le16 key_flags = 0;
key_flags |= (STA_KEY_FLG_TKIP | STA_KEY_FLG_MAP_KEY_MSK);
key_flags |= cpu_to_le16(keyconf->keyidx << STA_KEY_FLG_KEYID_POS);
key_flags &= ~STA_KEY_FLG_INVALID;
if (sta_id == priv->hw_params.bcast_sta_id)
key_flags |= STA_KEY_MULTICAST_MSK;
keyconf->flags |= IEEE80211_KEY_FLAG_GENERATE_IV; keyconf->flags |= IEEE80211_KEY_FLAG_GENERATE_IV;
keyconf->flags |= IEEE80211_KEY_FLAG_GENERATE_MMIC; keyconf->flags |= IEEE80211_KEY_FLAG_GENERATE_MMIC;
@ -738,6 +746,9 @@ static int iwl_set_tkip_dynamic_key_info(struct iwl_priv *priv,
WARN(priv->stations[sta_id].sta.key.key_offset == WEP_INVALID_OFFSET, WARN(priv->stations[sta_id].sta.key.key_offset == WEP_INVALID_OFFSET,
"no space for a new key"); "no space for a new key");
priv->stations[sta_id].sta.key.key_flags = key_flags;
/* This copy is acutally not needed: we get the key with each TX */ /* This copy is acutally not needed: we get the key with each TX */
memcpy(priv->stations[sta_id].keyinfo.key, keyconf->key, 16); memcpy(priv->stations[sta_id].keyinfo.key, keyconf->key, 16);
@ -754,9 +765,7 @@ void iwl_update_tkip_key(struct iwl_priv *priv,
{ {
u8 sta_id = IWL_INVALID_STATION; u8 sta_id = IWL_INVALID_STATION;
unsigned long flags; unsigned long flags;
__le16 key_flags = 0;
int i; int i;
DECLARE_MAC_BUF(mac);
sta_id = iwl_find_station(priv, addr); sta_id = iwl_find_station(priv, addr);
if (sta_id == IWL_INVALID_STATION) { if (sta_id == IWL_INVALID_STATION) {
@ -771,16 +780,8 @@ void iwl_update_tkip_key(struct iwl_priv *priv,
return; return;
} }
key_flags |= (STA_KEY_FLG_TKIP | STA_KEY_FLG_MAP_KEY_MSK);
key_flags |= cpu_to_le16(keyconf->keyidx << STA_KEY_FLG_KEYID_POS);
key_flags &= ~STA_KEY_FLG_INVALID;
if (sta_id == priv->hw_params.bcast_sta_id)
key_flags |= STA_KEY_MULTICAST_MSK;
spin_lock_irqsave(&priv->sta_lock, flags); spin_lock_irqsave(&priv->sta_lock, flags);
priv->stations[sta_id].sta.key.key_flags = key_flags;
priv->stations[sta_id].sta.key.tkip_rx_tsc_byte2 = (u8) iv32; priv->stations[sta_id].sta.key.tkip_rx_tsc_byte2 = (u8) iv32;
for (i = 0; i < 5; i++) for (i = 0; i < 5; i++)

View File

@ -1744,7 +1744,6 @@ static void iwl3945_rx_queue_free(struct iwl_priv *priv, struct iwl_rx_queue *rx
rxq->bd = NULL; rxq->bd = NULL;
rxq->rb_stts = NULL; rxq->rb_stts = NULL;
} }
EXPORT_SYMBOL(iwl3945_rx_queue_free);
/* Convert linear signal-to-noise ratio into dB */ /* Convert linear signal-to-noise ratio into dB */

View File

@ -476,7 +476,7 @@ minstrel_alloc_sta(void *priv, struct ieee80211_sta *sta, gfp_t gfp)
return NULL; return NULL;
for (i = 0; i < IEEE80211_NUM_BANDS; i++) { for (i = 0; i < IEEE80211_NUM_BANDS; i++) {
sband = hw->wiphy->bands[hw->conf.channel->band]; sband = hw->wiphy->bands[i];
if (sband->n_bitrates > max_rates) if (sband->n_bitrates > max_rates)
max_rates = sband->n_bitrates; max_rates = sband->n_bitrates;
} }

View File

@ -317,57 +317,17 @@ rate_control_pid_rate_init(void *priv, struct ieee80211_supported_band *sband,
struct ieee80211_sta *sta, void *priv_sta) struct ieee80211_sta *sta, void *priv_sta)
{ {
struct rc_pid_sta_info *spinfo = priv_sta; struct rc_pid_sta_info *spinfo = priv_sta;
struct rc_pid_info *pinfo = priv;
struct rc_pid_rateinfo *rinfo = pinfo->rinfo;
struct sta_info *si; struct sta_info *si;
int i, j, tmp;
bool s;
/* TODO: This routine should consider using RSSI from previous packets /* TODO: This routine should consider using RSSI from previous packets
* as we need to have IEEE 802.1X auth succeed immediately after assoc.. * as we need to have IEEE 802.1X auth succeed immediately after assoc..
* Until that method is implemented, we will use the lowest supported * Until that method is implemented, we will use the lowest supported
* rate as a workaround. */ * rate as a workaround. */
spinfo->txrate_idx = rate_lowest_index(sband, sta);
/* HACK */
si = container_of(sta, struct sta_info, sta);
si->fail_avg = 0;
}
static void *rate_control_pid_alloc(struct ieee80211_hw *hw,
struct dentry *debugfsdir)
{
struct rc_pid_info *pinfo;
struct rc_pid_rateinfo *rinfo;
struct ieee80211_supported_band *sband;
int i, j, tmp;
bool s;
#ifdef CONFIG_MAC80211_DEBUGFS
struct rc_pid_debugfs_entries *de;
#endif
sband = hw->wiphy->bands[hw->conf.channel->band];
pinfo = kmalloc(sizeof(*pinfo), GFP_ATOMIC);
if (!pinfo)
return NULL;
/* We can safely assume that sband won't change unless we get
* reinitialized. */
rinfo = kmalloc(sizeof(*rinfo) * sband->n_bitrates, GFP_ATOMIC);
if (!rinfo) {
kfree(pinfo);
return NULL;
}
pinfo->target = RC_PID_TARGET_PF;
pinfo->sampling_period = RC_PID_INTERVAL;
pinfo->coeff_p = RC_PID_COEFF_P;
pinfo->coeff_i = RC_PID_COEFF_I;
pinfo->coeff_d = RC_PID_COEFF_D;
pinfo->smoothing_shift = RC_PID_SMOOTHING_SHIFT;
pinfo->sharpen_factor = RC_PID_SHARPENING_FACTOR;
pinfo->sharpen_duration = RC_PID_SHARPENING_DURATION;
pinfo->norm_offset = RC_PID_NORM_OFFSET;
pinfo->rinfo = rinfo;
pinfo->oldrate = 0;
/* Sort the rates. This is optimized for the most common case (i.e. /* Sort the rates. This is optimized for the most common case (i.e.
* almost-sorted CCK+OFDM rates). Kind of bubble-sort with reversed * almost-sorted CCK+OFDM rates). Kind of bubble-sort with reversed
* mapping too. */ * mapping too. */
@ -395,6 +355,51 @@ static void *rate_control_pid_alloc(struct ieee80211_hw *hw,
break; break;
} }
spinfo->txrate_idx = rate_lowest_index(sband, sta);
/* HACK */
si = container_of(sta, struct sta_info, sta);
si->fail_avg = 0;
}
static void *rate_control_pid_alloc(struct ieee80211_hw *hw,
struct dentry *debugfsdir)
{
struct rc_pid_info *pinfo;
struct rc_pid_rateinfo *rinfo;
struct ieee80211_supported_band *sband;
int i, max_rates = 0;
#ifdef CONFIG_MAC80211_DEBUGFS
struct rc_pid_debugfs_entries *de;
#endif
pinfo = kmalloc(sizeof(*pinfo), GFP_ATOMIC);
if (!pinfo)
return NULL;
for (i = 0; i < IEEE80211_NUM_BANDS; i++) {
sband = hw->wiphy->bands[i];
if (sband->n_bitrates > max_rates)
max_rates = sband->n_bitrates;
}
rinfo = kmalloc(sizeof(*rinfo) * max_rates, GFP_ATOMIC);
if (!rinfo) {
kfree(pinfo);
return NULL;
}
pinfo->target = RC_PID_TARGET_PF;
pinfo->sampling_period = RC_PID_INTERVAL;
pinfo->coeff_p = RC_PID_COEFF_P;
pinfo->coeff_i = RC_PID_COEFF_I;
pinfo->coeff_d = RC_PID_COEFF_D;
pinfo->smoothing_shift = RC_PID_SMOOTHING_SHIFT;
pinfo->sharpen_factor = RC_PID_SHARPENING_FACTOR;
pinfo->sharpen_duration = RC_PID_SHARPENING_DURATION;
pinfo->norm_offset = RC_PID_NORM_OFFSET;
pinfo->rinfo = rinfo;
pinfo->oldrate = 0;
#ifdef CONFIG_MAC80211_DEBUGFS #ifdef CONFIG_MAC80211_DEBUGFS
de = &pinfo->dentries; de = &pinfo->dentries;
de->target = debugfs_create_u32("target_pf", S_IRUSR | S_IWUSR, de->target = debugfs_create_u32("target_pf", S_IRUSR | S_IWUSR,

View File

@ -772,7 +772,7 @@ ieee80211_tx_h_fragment(struct ieee80211_tx_data *tx)
hdrlen = ieee80211_hdrlen(hdr->frame_control); hdrlen = ieee80211_hdrlen(hdr->frame_control);
/* internal error, why is TX_FRAGMENTED set? */ /* internal error, why is TX_FRAGMENTED set? */
if (WARN_ON(skb->len <= frag_threshold)) if (WARN_ON(skb->len + FCS_LEN <= frag_threshold))
return TX_DROP; return TX_DROP;
/* /*

View File

@ -907,6 +907,7 @@ EXPORT_SYMBOL(freq_reg_info);
int freq_reg_info(struct wiphy *wiphy, u32 center_freq, u32 *bandwidth, int freq_reg_info(struct wiphy *wiphy, u32 center_freq, u32 *bandwidth,
const struct ieee80211_reg_rule **reg_rule) const struct ieee80211_reg_rule **reg_rule)
{ {
assert_cfg80211_lock();
return freq_reg_info_regd(wiphy, center_freq, return freq_reg_info_regd(wiphy, center_freq,
bandwidth, reg_rule, NULL); bandwidth, reg_rule, NULL);
} }
@ -1133,7 +1134,8 @@ static bool reg_is_world_roaming(struct wiphy *wiphy)
if (is_world_regdom(cfg80211_regdomain->alpha2) || if (is_world_regdom(cfg80211_regdomain->alpha2) ||
(wiphy->regd && is_world_regdom(wiphy->regd->alpha2))) (wiphy->regd && is_world_regdom(wiphy->regd->alpha2)))
return true; return true;
if (last_request->initiator != NL80211_REGDOM_SET_BY_COUNTRY_IE && if (last_request &&
last_request->initiator != NL80211_REGDOM_SET_BY_COUNTRY_IE &&
wiphy->custom_regulatory) wiphy->custom_regulatory)
return true; return true;
return false; return false;
@ -1142,6 +1144,12 @@ static bool reg_is_world_roaming(struct wiphy *wiphy)
/* Reap the advantages of previously found beacons */ /* Reap the advantages of previously found beacons */
static void reg_process_beacons(struct wiphy *wiphy) static void reg_process_beacons(struct wiphy *wiphy)
{ {
/*
* Means we are just firing up cfg80211, so no beacons would
* have been processed yet.
*/
if (!last_request)
return;
if (!reg_is_world_roaming(wiphy)) if (!reg_is_world_roaming(wiphy))
return; return;
wiphy_update_beacon_reg(wiphy); wiphy_update_beacon_reg(wiphy);
@ -1176,6 +1184,8 @@ static void handle_channel_custom(struct wiphy *wiphy,
struct ieee80211_supported_band *sband; struct ieee80211_supported_band *sband;
struct ieee80211_channel *chan; struct ieee80211_channel *chan;
assert_cfg80211_lock();
sband = wiphy->bands[band]; sband = wiphy->bands[band];
BUG_ON(chan_idx >= sband->n_channels); BUG_ON(chan_idx >= sband->n_channels);
chan = &sband->channels[chan_idx]; chan = &sband->channels[chan_idx];
@ -1214,10 +1224,13 @@ void wiphy_apply_custom_regulatory(struct wiphy *wiphy,
const struct ieee80211_regdomain *regd) const struct ieee80211_regdomain *regd)
{ {
enum ieee80211_band band; enum ieee80211_band band;
mutex_lock(&cfg80211_mutex);
for (band = 0; band < IEEE80211_NUM_BANDS; band++) { for (band = 0; band < IEEE80211_NUM_BANDS; band++) {
if (wiphy->bands[band]) if (wiphy->bands[band])
handle_band_custom(wiphy, band, regd); handle_band_custom(wiphy, band, regd);
} }
mutex_unlock(&cfg80211_mutex);
} }
EXPORT_SYMBOL(wiphy_apply_custom_regulatory); EXPORT_SYMBOL(wiphy_apply_custom_regulatory);
@ -1423,7 +1436,7 @@ new_request:
return call_crda(last_request->alpha2); return call_crda(last_request->alpha2);
} }
/* This currently only processes user and driver regulatory hints */ /* This processes *all* regulatory hints */
static void reg_process_hint(struct regulatory_request *reg_request) static void reg_process_hint(struct regulatory_request *reg_request)
{ {
int r = 0; int r = 0;

View File

@ -395,6 +395,7 @@ cfg80211_bss_update(struct cfg80211_registered_device *dev,
memcpy(ies, res->pub.information_elements, ielen); memcpy(ies, res->pub.information_elements, ielen);
found->ies_allocated = true; found->ies_allocated = true;
found->pub.information_elements = ies; found->pub.information_elements = ies;
found->pub.len_information_elements = ielen;
} }
} }
} }