mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-11 16:29:05 +00:00
rt2x00: Don't set unicast/BSSID masks when clearning MAC or BSSID
When configuring the MAC_ADDR or MAC_BSSID with an empty address, the UNICAST_TO_ME_MASK and BSS_ID_MASK must also be reset to prevent invalid interpretation of the addresses. Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Acked-by: Gertjan van Wingerde <gwingerde@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
parent
b9eca24209
commit
c600c826a6
@ -1135,19 +1135,23 @@ void rt2800_config_intf(struct rt2x00_dev *rt2x00dev, struct rt2x00_intf *intf,
|
||||
}
|
||||
|
||||
if (flags & CONFIG_UPDATE_MAC) {
|
||||
reg = le32_to_cpu(conf->mac[1]);
|
||||
rt2x00_set_field32(®, MAC_ADDR_DW1_UNICAST_TO_ME_MASK, 0xff);
|
||||
conf->mac[1] = cpu_to_le32(reg);
|
||||
if (!is_zero_ether_addr((const u8 *)conf->mac)) {
|
||||
reg = le32_to_cpu(conf->mac[1]);
|
||||
rt2x00_set_field32(®, MAC_ADDR_DW1_UNICAST_TO_ME_MASK, 0xff);
|
||||
conf->mac[1] = cpu_to_le32(reg);
|
||||
}
|
||||
|
||||
rt2800_register_multiwrite(rt2x00dev, MAC_ADDR_DW0,
|
||||
conf->mac, sizeof(conf->mac));
|
||||
}
|
||||
|
||||
if (flags & CONFIG_UPDATE_BSSID) {
|
||||
reg = le32_to_cpu(conf->bssid[1]);
|
||||
rt2x00_set_field32(®, MAC_BSSID_DW1_BSS_ID_MASK, 3);
|
||||
rt2x00_set_field32(®, MAC_BSSID_DW1_BSS_BCN_NUM, 7);
|
||||
conf->bssid[1] = cpu_to_le32(reg);
|
||||
if (!is_zero_ether_addr((const u8 *)conf->bssid)) {
|
||||
reg = le32_to_cpu(conf->bssid[1]);
|
||||
rt2x00_set_field32(®, MAC_BSSID_DW1_BSS_ID_MASK, 3);
|
||||
rt2x00_set_field32(®, MAC_BSSID_DW1_BSS_BCN_NUM, 7);
|
||||
conf->bssid[1] = cpu_to_le32(reg);
|
||||
}
|
||||
|
||||
rt2800_register_multiwrite(rt2x00dev, MAC_BSSID_DW0,
|
||||
conf->bssid, sizeof(conf->bssid));
|
||||
|
Loading…
x
Reference in New Issue
Block a user