Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 224300
b: refs/heads/master
c: fa8b4b2
h: refs/heads/master
v: v3
  • Loading branch information
Helmut Schaa authored and John W. Linville committed Nov 15, 2010
1 parent 5a3f33e commit e811828
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 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: 070192dd2975c0e97bbdeac7623b755235c6db7d
refs/heads/master: fa8b4b22d543b4052602b0c86065150613ed19e8
13 changes: 12 additions & 1 deletion trunk/drivers/net/wireless/rt2x00/rt2800lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -1148,6 +1148,7 @@ void rt2800_config_intf(struct rt2x00_dev *rt2x00dev, struct rt2x00_intf *intf,
struct rt2x00intf_conf *conf, const unsigned int flags)
{
u32 reg;
bool update_bssid = false;

if (flags & CONFIG_UPDATE_TYPE) {
/*
Expand Down Expand Up @@ -1177,6 +1178,16 @@ void rt2800_config_intf(struct rt2x00_dev *rt2x00dev, struct rt2x00_intf *intf,
}

if (flags & CONFIG_UPDATE_MAC) {
if (flags & CONFIG_UPDATE_TYPE &&
conf->sync == TSF_SYNC_AP_NONE) {
/*
* The BSSID register has to be set to our own mac
* address in AP mode.
*/
memcpy(conf->bssid, conf->mac, sizeof(conf->mac));
update_bssid = true;
}

if (!is_zero_ether_addr((const u8 *)conf->mac)) {
reg = le32_to_cpu(conf->mac[1]);
rt2x00_set_field32(&reg, MAC_ADDR_DW1_UNICAST_TO_ME_MASK, 0xff);
Expand All @@ -1187,7 +1198,7 @@ void rt2800_config_intf(struct rt2x00_dev *rt2x00dev, struct rt2x00_intf *intf,
conf->mac, sizeof(conf->mac));
}

if (flags & CONFIG_UPDATE_BSSID) {
if ((flags & CONFIG_UPDATE_BSSID) || update_bssid) {
if (!is_zero_ether_addr((const u8 *)conf->bssid)) {
reg = le32_to_cpu(conf->bssid[1]);
rt2x00_set_field32(&reg, MAC_BSSID_DW1_BSS_ID_MASK, 3);
Expand Down
10 changes: 2 additions & 8 deletions trunk/drivers/net/wireless/rt2x00/rt2x00mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,14 +283,8 @@ int rt2x00mac_add_interface(struct ieee80211_hw *hw,
* invalid behavior in the device.
*/
memcpy(&intf->mac, vif->addr, ETH_ALEN);
if (vif->type == NL80211_IFTYPE_AP) {
memcpy(&intf->bssid, vif->addr, ETH_ALEN);
rt2x00lib_config_intf(rt2x00dev, intf, vif->type,
intf->mac, intf->bssid);
} else {
rt2x00lib_config_intf(rt2x00dev, intf, vif->type,
intf->mac, NULL);
}
rt2x00lib_config_intf(rt2x00dev, intf, vif->type,
intf->mac, NULL);

/*
* Some filters depend on the current working mode. We can force
Expand Down

0 comments on commit e811828

Please sign in to comment.