Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 300975
b: refs/heads/master
c: 47042ac
h: refs/heads/master
i:
  300973: d608966
  300971: 91c6fd1
  300967: 0eb7e08
  300959: 1abc1bb
v: v3
  • Loading branch information
Meenakshi Venkataraman authored and Wey-Yi Guy committed Apr 12, 2012
1 parent edcaa00 commit 7f88413
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 74 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 50319f74f5ef9e4fe070a17ce2b65f04280504ae
refs/heads/master: 47042ac28569bb40ec10fe75af3f6d9a75a23c80
72 changes: 72 additions & 0 deletions trunk/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,78 @@
#include "iwl-trans.h"
#include "iwl-shared.h"

/*
* initialize rxon structure with default values from eeprom
*/
void iwl_connection_init_rx_config(struct iwl_priv *priv,
struct iwl_rxon_context *ctx)
{
const struct iwl_channel_info *ch_info;

memset(&ctx->staging, 0, sizeof(ctx->staging));

if (!ctx->vif) {
ctx->staging.dev_type = ctx->unused_devtype;
} else
switch (ctx->vif->type) {
case NL80211_IFTYPE_AP:
ctx->staging.dev_type = ctx->ap_devtype;
break;

case NL80211_IFTYPE_STATION:
ctx->staging.dev_type = ctx->station_devtype;
ctx->staging.filter_flags = RXON_FILTER_ACCEPT_GRP_MSK;
break;

case NL80211_IFTYPE_ADHOC:
ctx->staging.dev_type = ctx->ibss_devtype;
ctx->staging.flags = RXON_FLG_SHORT_PREAMBLE_MSK;
ctx->staging.filter_flags = RXON_FILTER_BCON_AWARE_MSK |
RXON_FILTER_ACCEPT_GRP_MSK;
break;

default:
IWL_ERR(priv, "Unsupported interface type %d\n",
ctx->vif->type);
break;
}

#if 0
/* TODO: Figure out when short_preamble would be set and cache from
* that */
if (!hw_to_local(priv->hw)->short_preamble)
ctx->staging.flags &= ~RXON_FLG_SHORT_PREAMBLE_MSK;
else
ctx->staging.flags |= RXON_FLG_SHORT_PREAMBLE_MSK;
#endif

ch_info = iwl_get_channel_info(priv, priv->band,
le16_to_cpu(ctx->active.channel));

if (!ch_info)
ch_info = &priv->channel_info[0];

ctx->staging.channel = cpu_to_le16(ch_info->channel);
priv->band = ch_info->band;

iwl_set_flags_for_band(priv, ctx, priv->band, ctx->vif);

ctx->staging.ofdm_basic_rates =
(IWL_OFDM_RATES_MASK >> IWL_FIRST_OFDM_RATE) & 0xFF;
ctx->staging.cck_basic_rates =
(IWL_CCK_RATES_MASK >> IWL_FIRST_CCK_RATE) & 0xF;

/* clear both MIX and PURE40 mode flag */
ctx->staging.flags &= ~(RXON_FLG_CHANNEL_MODE_MIXED |
RXON_FLG_CHANNEL_MODE_PURE_40);
if (ctx->vif)
memcpy(ctx->staging.node_addr, ctx->vif->addr, ETH_ALEN);

ctx->staging.ofdm_ht_single_stream_basic_rates = 0xff;
ctx->staging.ofdm_ht_dual_stream_basic_rates = 0xff;
ctx->staging.ofdm_ht_triple_stream_basic_rates = 0xff;
}

static int iwlagn_disable_bss(struct iwl_priv *priv,
struct iwl_rxon_context *ctx,
struct iwl_rxon_cmd *send)
Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/net/wireless/iwlwifi/iwl-agn.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ int iwl_dvm_send_cmd_pdu(struct iwl_priv *priv, u8 id,
u32 flags, u16 len, const void *data);

/* RXON */
void iwl_connection_init_rx_config(struct iwl_priv *priv,
struct iwl_rxon_context *ctx);
int iwlagn_set_pan_params(struct iwl_priv *priv);
int iwlagn_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *ctx);
void iwlagn_set_rxon_chain(struct iwl_priv *priv, struct iwl_rxon_context *ctx);
Expand Down
71 changes: 0 additions & 71 deletions trunk/drivers/net/wireless/iwlwifi/iwl-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,77 +43,6 @@

const u8 iwl_bcast_addr[ETH_ALEN] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };

/*
* initialize rxon structure with default values from eeprom
*/
void iwl_connection_init_rx_config(struct iwl_priv *priv,
struct iwl_rxon_context *ctx)
{
const struct iwl_channel_info *ch_info;

memset(&ctx->staging, 0, sizeof(ctx->staging));

if (!ctx->vif) {
ctx->staging.dev_type = ctx->unused_devtype;
} else switch (ctx->vif->type) {
case NL80211_IFTYPE_AP:
ctx->staging.dev_type = ctx->ap_devtype;
break;

case NL80211_IFTYPE_STATION:
ctx->staging.dev_type = ctx->station_devtype;
ctx->staging.filter_flags = RXON_FILTER_ACCEPT_GRP_MSK;
break;

case NL80211_IFTYPE_ADHOC:
ctx->staging.dev_type = ctx->ibss_devtype;
ctx->staging.flags = RXON_FLG_SHORT_PREAMBLE_MSK;
ctx->staging.filter_flags = RXON_FILTER_BCON_AWARE_MSK |
RXON_FILTER_ACCEPT_GRP_MSK;
break;

default:
IWL_ERR(priv, "Unsupported interface type %d\n",
ctx->vif->type);
break;
}

#if 0
/* TODO: Figure out when short_preamble would be set and cache from
* that */
if (!hw_to_local(priv->hw)->short_preamble)
ctx->staging.flags &= ~RXON_FLG_SHORT_PREAMBLE_MSK;
else
ctx->staging.flags |= RXON_FLG_SHORT_PREAMBLE_MSK;
#endif

ch_info = iwl_get_channel_info(priv, priv->band,
le16_to_cpu(ctx->active.channel));

if (!ch_info)
ch_info = &priv->channel_info[0];

ctx->staging.channel = cpu_to_le16(ch_info->channel);
priv->band = ch_info->band;

iwl_set_flags_for_band(priv, ctx, priv->band, ctx->vif);

ctx->staging.ofdm_basic_rates =
(IWL_OFDM_RATES_MASK >> IWL_FIRST_OFDM_RATE) & 0xFF;
ctx->staging.cck_basic_rates =
(IWL_CCK_RATES_MASK >> IWL_FIRST_CCK_RATE) & 0xF;

/* clear both MIX and PURE40 mode flag */
ctx->staging.flags &= ~(RXON_FLG_CHANNEL_MODE_MIXED |
RXON_FLG_CHANNEL_MODE_PURE_40);
if (ctx->vif)
memcpy(ctx->staging.node_addr, ctx->vif->addr, ETH_ALEN);

ctx->staging.ofdm_ht_single_stream_basic_rates = 0xff;
ctx->staging.ofdm_ht_dual_stream_basic_rates = 0xff;
ctx->staging.ofdm_ht_triple_stream_basic_rates = 0xff;
}

void iwl_set_rate(struct iwl_priv *priv)
{
struct iwl_rxon_context *ctx;
Expand Down
2 changes: 0 additions & 2 deletions trunk/drivers/net/wireless/iwlwifi/iwl-core.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@ struct iwl_cmd;
* L i b *
***************************/

void iwl_connection_init_rx_config(struct iwl_priv *priv,
struct iwl_rxon_context *ctx);
void iwl_set_rate(struct iwl_priv *priv);
int iwl_cmd_echo_test(struct iwl_priv *priv);
#ifdef CONFIG_IWLWIFI_DEBUGFS
Expand Down

0 comments on commit 7f88413

Please sign in to comment.