staging: rtl8712: get rid of IS_MCAST
Use is_multicast_ether_addr instead of custom IS_MCAST and remove the now unused IS_MCAST. All buffers are properly aligned. Signed-off-by: Michael Straube <straube.linux@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
91fc28e8e6
commit
5badafb1f0
@ -419,7 +419,7 @@ static void update_txdesc(struct xmit_frame *pxmitframe, uint *pmem, int sz)
|
|||||||
struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
|
struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
|
||||||
#endif
|
#endif
|
||||||
u8 blnSetTxDescOffset;
|
u8 blnSetTxDescOffset;
|
||||||
sint bmcst = IS_MCAST(pattrib->ra);
|
bool bmcst = is_multicast_ether_addr(pattrib->ra);
|
||||||
struct ht_priv *phtpriv = &pmlmepriv->htpriv;
|
struct ht_priv *phtpriv = &pmlmepriv->htpriv;
|
||||||
struct tx_desc txdesc_mp;
|
struct tx_desc txdesc_mp;
|
||||||
|
|
||||||
|
@ -151,7 +151,7 @@ sint r8712_recvframe_chkmic(struct _adapter *adapter,
|
|||||||
if (prxattrib->encrypt == _TKIP_) {
|
if (prxattrib->encrypt == _TKIP_) {
|
||||||
/* calculate mic code */
|
/* calculate mic code */
|
||||||
if (stainfo != NULL) {
|
if (stainfo != NULL) {
|
||||||
if (IS_MCAST(prxattrib->ra)) {
|
if (is_multicast_ether_addr(prxattrib->ra)) {
|
||||||
iv = precvframe->u.hdr.rx_data +
|
iv = precvframe->u.hdr.rx_data +
|
||||||
prxattrib->hdrlen;
|
prxattrib->hdrlen;
|
||||||
idx = iv[3];
|
idx = iv[3];
|
||||||
@ -180,12 +180,12 @@ sint r8712_recvframe_chkmic(struct _adapter *adapter,
|
|||||||
if (bmic_err) {
|
if (bmic_err) {
|
||||||
if (prxattrib->bdecrypted)
|
if (prxattrib->bdecrypted)
|
||||||
r8712_handle_tkip_mic_err(adapter,
|
r8712_handle_tkip_mic_err(adapter,
|
||||||
(u8)IS_MCAST(prxattrib->ra));
|
(u8)is_multicast_ether_addr(prxattrib->ra));
|
||||||
res = _FAIL;
|
res = _FAIL;
|
||||||
} else {
|
} else {
|
||||||
/* mic checked ok */
|
/* mic checked ok */
|
||||||
if (!psecuritypriv->bcheck_grpkey &&
|
if (!psecuritypriv->bcheck_grpkey &&
|
||||||
IS_MCAST(prxattrib->ra))
|
is_multicast_ether_addr(prxattrib->ra))
|
||||||
psecuritypriv->bcheck_grpkey = true;
|
psecuritypriv->bcheck_grpkey = true;
|
||||||
}
|
}
|
||||||
recvframe_pull_tail(precvframe, 8);
|
recvframe_pull_tail(precvframe, 8);
|
||||||
@ -305,7 +305,7 @@ static sint sta2sta_data_frame(struct _adapter *adapter,
|
|||||||
u8 *mybssid = get_bssid(pmlmepriv);
|
u8 *mybssid = get_bssid(pmlmepriv);
|
||||||
u8 *myhwaddr = myid(&adapter->eeprompriv);
|
u8 *myhwaddr = myid(&adapter->eeprompriv);
|
||||||
u8 *sta_addr = NULL;
|
u8 *sta_addr = NULL;
|
||||||
sint bmcast = IS_MCAST(pattrib->dst);
|
bool bmcast = is_multicast_ether_addr(pattrib->dst);
|
||||||
|
|
||||||
if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) ||
|
if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) ||
|
||||||
check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)) {
|
check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)) {
|
||||||
@ -331,7 +331,7 @@ static sint sta2sta_data_frame(struct _adapter *adapter,
|
|||||||
/* For AP mode, if DA == MCAST, then BSSID should
|
/* For AP mode, if DA == MCAST, then BSSID should
|
||||||
* be also MCAST
|
* be also MCAST
|
||||||
*/
|
*/
|
||||||
if (!IS_MCAST(pattrib->bssid))
|
if (!is_multicast_ether_addr(pattrib->bssid))
|
||||||
return _FAIL;
|
return _FAIL;
|
||||||
} else { /* not mc-frame */
|
} else { /* not mc-frame */
|
||||||
/* For AP mode, if DA is non-MCAST, then it must be
|
/* For AP mode, if DA is non-MCAST, then it must be
|
||||||
@ -373,7 +373,7 @@ static sint ap2sta_data_frame(struct _adapter *adapter,
|
|||||||
struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
|
struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
|
||||||
u8 *mybssid = get_bssid(pmlmepriv);
|
u8 *mybssid = get_bssid(pmlmepriv);
|
||||||
u8 *myhwaddr = myid(&adapter->eeprompriv);
|
u8 *myhwaddr = myid(&adapter->eeprompriv);
|
||||||
sint bmcast = IS_MCAST(pattrib->dst);
|
bool bmcast = is_multicast_ether_addr(pattrib->dst);
|
||||||
|
|
||||||
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) &&
|
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) &&
|
||||||
check_fwstate(pmlmepriv, _FW_LINKED)) {
|
check_fwstate(pmlmepriv, _FW_LINKED)) {
|
||||||
@ -532,7 +532,7 @@ static sint validate_recv_data_frame(struct _adapter *adapter,
|
|||||||
|
|
||||||
if (pattrib->privacy) {
|
if (pattrib->privacy) {
|
||||||
GET_ENCRY_ALGO(psecuritypriv, psta, pattrib->encrypt,
|
GET_ENCRY_ALGO(psecuritypriv, psta, pattrib->encrypt,
|
||||||
IS_MCAST(pattrib->ra));
|
is_multicast_ether_addr(pattrib->ra));
|
||||||
SET_ICE_IV_LEN(pattrib->iv_len, pattrib->icv_len,
|
SET_ICE_IV_LEN(pattrib->iv_len, pattrib->icv_len,
|
||||||
pattrib->encrypt);
|
pattrib->encrypt);
|
||||||
} else {
|
} else {
|
||||||
|
@ -665,7 +665,7 @@ u32 r8712_tkip_decrypt(struct _adapter *padapter, u8 *precvframe)
|
|||||||
length = ((union recv_frame *)precvframe)->
|
length = ((union recv_frame *)precvframe)->
|
||||||
u.hdr.len - prxattrib->hdrlen -
|
u.hdr.len - prxattrib->hdrlen -
|
||||||
prxattrib->iv_len;
|
prxattrib->iv_len;
|
||||||
if (IS_MCAST(prxattrib->ra)) {
|
if (is_multicast_ether_addr(prxattrib->ra)) {
|
||||||
idx = iv[3];
|
idx = iv[3];
|
||||||
prwskey = &psecuritypriv->XGrpKey[
|
prwskey = &psecuritypriv->XGrpKey[
|
||||||
((idx >> 6) & 0x3) - 1].skey[0];
|
((idx >> 6) & 0x3) - 1].skey[0];
|
||||||
@ -1368,7 +1368,7 @@ u32 r8712_aes_decrypt(struct _adapter *padapter, u8 *precvframe)
|
|||||||
stainfo = r8712_get_stainfo(&padapter->stapriv,
|
stainfo = r8712_get_stainfo(&padapter->stapriv,
|
||||||
&prxattrib->ta[0]);
|
&prxattrib->ta[0]);
|
||||||
if (stainfo != NULL) {
|
if (stainfo != NULL) {
|
||||||
if (IS_MCAST(prxattrib->ra)) {
|
if (is_multicast_ether_addr(prxattrib->ra)) {
|
||||||
iv = pframe + prxattrib->hdrlen;
|
iv = pframe + prxattrib->hdrlen;
|
||||||
idx = iv[3];
|
idx = iv[3];
|
||||||
prwskey = &psecuritypriv->XGrpKey[
|
prwskey = &psecuritypriv->XGrpKey[
|
||||||
|
@ -181,7 +181,7 @@ sint r8712_update_attrib(struct _adapter *padapter, _pkt *pkt,
|
|||||||
|
|
||||||
struct tx_cmd txdesc;
|
struct tx_cmd txdesc;
|
||||||
|
|
||||||
sint bmcast;
|
bool bmcast;
|
||||||
struct sta_priv *pstapriv = &padapter->stapriv;
|
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||||
struct security_priv *psecuritypriv = &padapter->securitypriv;
|
struct security_priv *psecuritypriv = &padapter->securitypriv;
|
||||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||||
@ -257,7 +257,7 @@ sint r8712_update_attrib(struct _adapter *padapter, _pkt *pkt,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
bmcast = IS_MCAST(pattrib->ra);
|
bmcast = is_multicast_ether_addr(pattrib->ra);
|
||||||
/* get sta_info*/
|
/* get sta_info*/
|
||||||
if (bmcast) {
|
if (bmcast) {
|
||||||
psta = r8712_get_bcmc_stainfo(padapter);
|
psta = r8712_get_bcmc_stainfo(padapter);
|
||||||
@ -353,7 +353,7 @@ static sint xmitframe_addmic(struct _adapter *padapter,
|
|||||||
struct security_priv *psecuritypriv = &padapter->securitypriv;
|
struct security_priv *psecuritypriv = &padapter->securitypriv;
|
||||||
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
|
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
|
||||||
u8 priority[4] = {0x0, 0x0, 0x0, 0x0};
|
u8 priority[4] = {0x0, 0x0, 0x0, 0x0};
|
||||||
sint bmcst = IS_MCAST(pattrib->ra);
|
bool bmcst = is_multicast_ether_addr(pattrib->ra);
|
||||||
|
|
||||||
if (pattrib->psta)
|
if (pattrib->psta)
|
||||||
stainfo = pattrib->psta;
|
stainfo = pattrib->psta;
|
||||||
@ -523,7 +523,7 @@ static sint make_wlanhdr(struct _adapter *padapter, u8 *hdr,
|
|||||||
/* Update Seq Num will be handled by f/w */
|
/* Update Seq Num will be handled by f/w */
|
||||||
{
|
{
|
||||||
struct sta_info *psta;
|
struct sta_info *psta;
|
||||||
sint bmcst = IS_MCAST(pattrib->ra);
|
bool bmcst = is_multicast_ether_addr(pattrib->ra);
|
||||||
|
|
||||||
if (pattrib->psta) {
|
if (pattrib->psta) {
|
||||||
psta = pattrib->psta;
|
psta = pattrib->psta;
|
||||||
@ -594,7 +594,7 @@ sint r8712_xmitframe_coalesce(struct _adapter *padapter, _pkt *pkt,
|
|||||||
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
|
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
|
||||||
struct pkt_attrib *pattrib = &pxmitframe->attrib;
|
struct pkt_attrib *pattrib = &pxmitframe->attrib;
|
||||||
u8 *pbuf_start;
|
u8 *pbuf_start;
|
||||||
sint bmcst = IS_MCAST(pattrib->ra);
|
bool bmcst = is_multicast_ether_addr(pattrib->ra);
|
||||||
|
|
||||||
if (pattrib->psta == NULL)
|
if (pattrib->psta == NULL)
|
||||||
return _FAIL;
|
return _FAIL;
|
||||||
@ -903,7 +903,7 @@ sint r8712_xmit_classifier(struct _adapter *padapter,
|
|||||||
struct pkt_attrib *pattrib = &pxmitframe->attrib;
|
struct pkt_attrib *pattrib = &pxmitframe->attrib;
|
||||||
struct sta_priv *pstapriv = &padapter->stapriv;
|
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||||
sint bmcst = IS_MCAST(pattrib->ra);
|
bool bmcst = is_multicast_ether_addr(pattrib->ra);
|
||||||
|
|
||||||
if (pattrib->psta) {
|
if (pattrib->psta) {
|
||||||
psta = pattrib->psta;
|
psta = pattrib->psta;
|
||||||
|
@ -278,17 +278,6 @@ static inline unsigned char get_tofr_ds(unsigned char *pframe)
|
|||||||
|
|
||||||
#define GetAddr4Ptr(pbuf) ((unsigned char *)((addr_t)(pbuf) + 24))
|
#define GetAddr4Ptr(pbuf) ((unsigned char *)((addr_t)(pbuf) + 24))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static inline int IS_MCAST(unsigned char *da)
|
|
||||||
{
|
|
||||||
if ((*da) & 0x01)
|
|
||||||
return true;
|
|
||||||
else
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static inline unsigned char *get_da(unsigned char *pframe)
|
static inline unsigned char *get_da(unsigned char *pframe)
|
||||||
{
|
{
|
||||||
unsigned char *da;
|
unsigned char *da;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user