Skip to content

Commit

Permalink
Restore 1mbps by default
Browse files Browse the repository at this point in the history
  • Loading branch information
kimocoder committed Feb 1, 2020
1 parent 2d29bdd commit 19890f0
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 7 deletions.
25 changes: 18 additions & 7 deletions core/rtw_xmit.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions include/drv_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,8 @@ struct registry_priv {
u8 tdmadig_mode;
u8 tdmadig_dynamic;
#endif/*CONFIG_TDMADIG*/

u8 monitor_disable_1m;
};

/* For registry parameters */
Expand Down
5 changes: 5 additions & 0 deletions os_dep/linux/os_intfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 19890f0

Please sign in to comment.