diff --git a/core/rtw_xmit.c b/core/rtw_xmit.c index c605786..f9e59b8 100644 --- a/core/rtw_xmit.c +++ b/core/rtw_xmit.c @@ -4411,6 +4411,7 @@ s32 rtw_monitor_xmit_entry(struct sk_buff *skb, struct net_device *ndev) struct xmit_frame *pmgntframe; struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); + struct registry_priv *pregpriv = &(padapter->registrypriv); unsigned char *pframe; u8 dummybuf[32]; int len = skb->len, rtap_len, consume; @@ -4462,20 +4463,30 @@ s32 rtw_monitor_xmit_entry(struct sk_buff *skb, struct net_device *ndev) /* Check DATA/MGNT frames */ pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; - frame_ctl = le16_to_cpu(pwlanhdr->frame_ctl); - if ((frame_ctl & RTW_IEEE80211_FCTL_FTYPE) == RTW_IEEE80211_FTYPE_DATA) { + pattrib = &pmgntframe->attrib; - pattrib = &pmgntframe->attrib; - update_monitor_frame_attrib(padapter, pattrib); + if (pregpriv->monitor_disable_1m) { - if (is_broadcast_mac_addr(pwlanhdr->addr3) || is_broadcast_mac_addr(pwlanhdr->addr1)) - pattrib->rate = MGN_24M; + frame_ctl = le16_to_cpu(pwlanhdr->frame_ctl); + if ((frame_ctl & RTW_IEEE80211_FCTL_FTYPE) == RTW_IEEE80211_FTYPE_DATA) { + + update_monitor_frame_attrib(padapter, pattrib); + + if (is_broadcast_mac_addr(pwlanhdr->addr3) || is_broadcast_mac_addr(pwlanhdr->addr1)) + pattrib->rate = MGN_24M; + } else { + update_mgntframe_attrib(padapter, pattrib); + } } else { - pattrib = &pmgntframe->attrib; update_mgntframe_attrib(padapter, pattrib); + pattrib->rate = MGN_1M; + + pattrib->ldpc = _FALSE; + pattrib->stbc = 0; + } pattrib->retry_ctrl = _FALSE; pattrib->pktlen = len; diff --git a/include/drv_types.h b/include/drv_types.h index 39d1df4..157c0ed 100644 --- a/include/drv_types.h +++ b/include/drv_types.h @@ -457,6 +457,8 @@ struct registry_priv { u8 tdmadig_mode; u8 tdmadig_dynamic; #endif/*CONFIG_TDMADIG*/ + + u8 monitor_disable_1m; }; /* For registry parameters */ diff --git a/os_dep/linux/os_intfs.c b/os_dep/linux/os_intfs.c index f9072b3..293d88c 100644 --- a/os_dep/linux/os_intfs.c +++ b/os_dep/linux/os_intfs.c @@ -72,6 +72,9 @@ int rtw_scan_mode = 1;/* active, passive */ int rtw_lps_chk_by_tp = 0; #endif /* CONFIG_POWER_SAVING */ +int rtw_monitor_disable_1m = 0; +module_param(rtw_monitor_disable_1m, int, 0644); +MODULE_PARM_DESC(rtw_monitor_disable_1m, "Disable default 1Mbps rate for monitor injected frames"); module_param(rtw_ips_mode, int, 0644); MODULE_PARM_DESC(rtw_ips_mode, "The default IPS mode"); @@ -1220,6 +1223,8 @@ uint loadparam(_adapter *padapter) registry_par->fw_tbtt_rpt = rtw_tbtt_rpt; #endif + registry_par->monitor_disable_1m = (u8)rtw_monitor_disable_1m; + return status; }