Commit 78b31143 authored by Wei Yongjun's avatar Wei Yongjun Committed by Greg Kroah-Hartman

Staging: vt6655: using is_broadcast_ether_addr() to simplify the code

Using is_broadcast_ether_addr() to simplify the code.
Signed-off-by: default avatarWei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 70a1fb19
...@@ -495,9 +495,7 @@ static int hostap_set_encryption(PSDevice pDevice, ...@@ -495,9 +495,7 @@ static int hostap_set_encryption(PSDevice pDevice,
return -EINVAL; return -EINVAL;
} }
if (param->sta_addr[0] == 0xff && param->sta_addr[1] == 0xff && if (is_broadcast_ether_addr(param->sta_addr)) {
param->sta_addr[2] == 0xff && param->sta_addr[3] == 0xff &&
param->sta_addr[4] == 0xff && param->sta_addr[5] == 0xff) {
if (param->u.crypt.idx >= MAX_GROUP_KEY) if (param->u.crypt.idx >= MAX_GROUP_KEY)
return -EINVAL; return -EINVAL;
iNodeIndex = 0; iNodeIndex = 0;
...@@ -716,9 +714,7 @@ static int hostap_get_encryption(PSDevice pDevice, ...@@ -716,9 +714,7 @@ static int hostap_get_encryption(PSDevice pDevice,
param->u.crypt.err = 0; param->u.crypt.err = 0;
if (param->sta_addr[0] == 0xff && param->sta_addr[1] == 0xff && if (is_broadcast_ether_addr(param->sta_addr)) {
param->sta_addr[2] == 0xff && param->sta_addr[3] == 0xff &&
param->sta_addr[4] == 0xff && param->sta_addr[5] == 0xff) {
iNodeIndex = 0; iNodeIndex = 0;
} else { } else {
if (BSSDBbIsSTAInNodeDB(pMgmt, param->sta_addr, &iNodeIndex) == false) { if (BSSDBbIsSTAInNodeDB(pMgmt, param->sta_addr, &iNodeIndex) == false) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment