Skip to content

Commit

Permalink
ar9170: make use of common macaddr and curbssid
Browse files Browse the repository at this point in the history
These are provided by ath_common.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Luis R. Rodriguez authored and John W. Linville committed Oct 7, 2009
1 parent 1510718 commit 8c727e7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 0 additions & 2 deletions drivers/net/wireless/ath/ar9170/ar9170.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,6 @@ struct ar9170 {

/* interface mode settings */
struct ieee80211_vif *vif;
u8 mac_addr[ETH_ALEN];
u8 bssid[ETH_ALEN];

/* beaconing */
struct sk_buff *beacon;
Expand Down
5 changes: 3 additions & 2 deletions drivers/net/wireless/ath/ar9170/mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -311,13 +311,14 @@ static int ar9170_set_promiscouous(struct ar9170 *ar)

int ar9170_set_operating_mode(struct ar9170 *ar)
{
struct ath_common *common = &ar->common;
u32 pm_mode = AR9170_MAC_REG_POWERMGT_DEFAULTS;
u8 *mac_addr, *bssid;
int err;

if (ar->vif) {
mac_addr = ar->mac_addr;
bssid = ar->bssid;
mac_addr = common->macaddr;
bssid = common->curbssid;

switch (ar->vif->type) {
case NL80211_IFTYPE_MESH_POINT:
Expand Down
6 changes: 4 additions & 2 deletions drivers/net/wireless/ath/ar9170/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1952,6 +1952,7 @@ static int ar9170_op_add_interface(struct ieee80211_hw *hw,
struct ieee80211_if_init_conf *conf)
{
struct ar9170 *ar = hw->priv;
struct ath_common *common = &ar->common;
int err = 0;

mutex_lock(&ar->mutex);
Expand All @@ -1962,7 +1963,7 @@ static int ar9170_op_add_interface(struct ieee80211_hw *hw,
}

ar->vif = conf->vif;
memcpy(ar->mac_addr, conf->mac_addr, ETH_ALEN);
memcpy(common->macaddr, conf->mac_addr, ETH_ALEN);

if (modparam_nohwcrypt || (ar->vif->type != NL80211_IFTYPE_STATION)) {
ar->rx_software_decryption = true;
Expand Down Expand Up @@ -2131,12 +2132,13 @@ static void ar9170_op_bss_info_changed(struct ieee80211_hw *hw,
u32 changed)
{
struct ar9170 *ar = hw->priv;
struct ath_common *common = &ar->common;
int err = 0;

mutex_lock(&ar->mutex);

if (changed & BSS_CHANGED_BSSID) {
memcpy(ar->bssid, bss_conf->bssid, ETH_ALEN);
memcpy(common->curbssid, bss_conf->bssid, ETH_ALEN);
err = ar9170_set_operating_mode(ar);
if (err)
goto out;
Expand Down

0 comments on commit 8c727e7

Please sign in to comment.