Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 149918
b: refs/heads/master
c: cbb6ab9
h: refs/heads/master
v: v3
  • Loading branch information
Abhijeet Kolekar authored and John W. Linville committed Apr 22, 2009
1 parent 35a5260 commit d3aba50
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 73 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: 727882d62477ed45d248e8cd6d53cf794537b073
refs/heads/master: cbb6ab94b66cfb7136e640191a9628c5a71220a3
36 changes: 0 additions & 36 deletions trunk/drivers/net/wireless/iwlwifi/iwl-agn.c
Original file line number Diff line number Diff line change
Expand Up @@ -2036,42 +2036,6 @@ static int iwl_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
return NETDEV_TX_OK;
}

static int iwl_mac_add_interface(struct ieee80211_hw *hw,
struct ieee80211_if_init_conf *conf)
{
struct iwl_priv *priv = hw->priv;
unsigned long flags;

IWL_DEBUG_MAC80211(priv, "enter: type %d\n", conf->type);

if (priv->vif) {
IWL_DEBUG_MAC80211(priv, "leave - vif != NULL\n");
return -EOPNOTSUPP;
}

spin_lock_irqsave(&priv->lock, flags);
priv->vif = conf->vif;
priv->iw_mode = conf->type;

spin_unlock_irqrestore(&priv->lock, flags);

mutex_lock(&priv->mutex);

if (conf->mac_addr) {
IWL_DEBUG_MAC80211(priv, "Set %pM\n", conf->mac_addr);
memcpy(priv->mac_addr, conf->mac_addr, ETH_ALEN);
}

if (iwl_set_mode(priv, conf->type) == -EAGAIN)
/* we are not ready, will run again when ready */
set_bit(STATUS_MODE_PENDING, &priv->status);

mutex_unlock(&priv->mutex);

IWL_DEBUG_MAC80211(priv, "leave\n");
return 0;
}

/**
* iwl_mac_config - mac80211 config callback
*
Expand Down
37 changes: 37 additions & 0 deletions trunk/drivers/net/wireless/iwlwifi/iwl-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2381,6 +2381,43 @@ int iwl_set_mode(struct iwl_priv *priv, int mode)
}
EXPORT_SYMBOL(iwl_set_mode);

int iwl_mac_add_interface(struct ieee80211_hw *hw,
struct ieee80211_if_init_conf *conf)
{
struct iwl_priv *priv = hw->priv;
unsigned long flags;

IWL_DEBUG_MAC80211(priv, "enter: type %d\n", conf->type);

if (priv->vif) {
IWL_DEBUG_MAC80211(priv, "leave - vif != NULL\n");
return -EOPNOTSUPP;
}

spin_lock_irqsave(&priv->lock, flags);
priv->vif = conf->vif;
priv->iw_mode = conf->type;

spin_unlock_irqrestore(&priv->lock, flags);

mutex_lock(&priv->mutex);

if (conf->mac_addr) {
IWL_DEBUG_MAC80211(priv, "Set %pM\n", conf->mac_addr);
memcpy(priv->mac_addr, conf->mac_addr, ETH_ALEN);
}

if (iwl_set_mode(priv, conf->type) == -EAGAIN)
/* we are not ready, will run again when ready */
set_bit(STATUS_MODE_PENDING, &priv->status);

mutex_unlock(&priv->mutex);

IWL_DEBUG_MAC80211(priv, "leave\n");
return 0;
}
EXPORT_SYMBOL(iwl_mac_add_interface);

#ifdef CONFIG_PM

int iwl_pci_suspend(struct pci_dev *pdev, pm_message_t state)
Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/net/wireless/iwlwifi/iwl-core.h
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,8 @@ void iwl_bss_info_changed(struct ieee80211_hw *hw,
int iwl_mac_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb);
int iwl_commit_rxon(struct iwl_priv *priv);
int iwl_set_mode(struct iwl_priv *priv, int mode);
int iwl_mac_add_interface(struct ieee80211_hw *hw,
struct ieee80211_if_init_conf *conf);

/*****************************************************
* RX handlers.
Expand Down
37 changes: 1 addition & 36 deletions trunk/drivers/net/wireless/iwlwifi/iwl3945-base.c
Original file line number Diff line number Diff line change
Expand Up @@ -3380,41 +3380,6 @@ static int iwl3945_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
return NETDEV_TX_OK;
}

static int iwl3945_mac_add_interface(struct ieee80211_hw *hw,
struct ieee80211_if_init_conf *conf)
{
struct iwl_priv *priv = hw->priv;
unsigned long flags;

IWL_DEBUG_MAC80211(priv, "enter: type %d\n", conf->type);

if (priv->vif) {
IWL_DEBUG_MAC80211(priv, "leave - vif != NULL\n");
return -EOPNOTSUPP;
}

spin_lock_irqsave(&priv->lock, flags);
priv->vif = conf->vif;
priv->iw_mode = conf->type;

spin_unlock_irqrestore(&priv->lock, flags);

mutex_lock(&priv->mutex);

if (conf->mac_addr) {
IWL_DEBUG_MAC80211(priv, "Set: %pM\n", conf->mac_addr);
memcpy(priv->mac_addr, conf->mac_addr, ETH_ALEN);
}

if (iwl_set_mode(priv, conf->type) == -EAGAIN)
set_bit(STATUS_MODE_PENDING, &priv->status);

mutex_unlock(&priv->mutex);

IWL_DEBUG_MAC80211(priv, "leave\n");
return 0;
}

/**
* iwl3945_mac_config - mac80211 config callback
*
Expand Down Expand Up @@ -4372,7 +4337,7 @@ static struct ieee80211_ops iwl3945_hw_ops = {
.tx = iwl3945_mac_tx,
.start = iwl3945_mac_start,
.stop = iwl3945_mac_stop,
.add_interface = iwl3945_mac_add_interface,
.add_interface = iwl_mac_add_interface,
.remove_interface = iwl3945_mac_remove_interface,
.config = iwl3945_mac_config,
.config_interface = iwl3945_mac_config_interface,
Expand Down

0 comments on commit d3aba50

Please sign in to comment.