Skip to content

Commit

Permalink
native monitor mode: invoke necessary ioctls on start + change interf…
Browse files Browse the repository at this point in the history
…ace type
  • Loading branch information
DanielAW committed Aug 15, 2016
1 parent 7c692eb commit ed11c18
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 5 additions & 0 deletions firmware_patching/native_monitor_mode/bcmdhd/dhd_cfg80211.c
Expand Up @@ -112,8 +112,13 @@ s32 dhd_cfg80211_clean_p2p_info(struct wl_priv *wl)
static s32 wl_dongle_up(struct net_device *ndev, u32 up)
{
s32 err = 0;
u32 mon1 = 1;

This comment has been minimized.

Copy link
@pfalcon

pfalcon Jan 1, 2018

Cute indentation ;-/


err = wldev_ioctl(ndev, WLC_UP, &up, sizeof(up), true);
//NEXMON
err = wldev_ioctl(ndev, WLC_SET_MONITOR, &mon1, sizeof(mon1), true);
err = wldev_ioctl(ndev, WLC_SET_PROMISC, &mon1, sizeof(mon1), true);
WL_ERR(("<<< SET MON MODE!!! >>>\n"));
if (unlikely(err)) {
WL_ERR(("WLC_UP error (%d)\n", err));
}
Expand Down
7 changes: 5 additions & 2 deletions firmware_patching/native_monitor_mode/bcmdhd/dhd_linux.c
Expand Up @@ -43,6 +43,8 @@
#include <linux/fcntl.h>
#include <linux/fs.h>
#include <linux/ip.h>
/* NexMon: if_arp. include to change interface type */
#include <linux/if_arp.h>
#include <net/addrconf.h>

#include <asm/uaccess.h>
Expand Down Expand Up @@ -4357,8 +4359,6 @@ dhd_preinit_ioctls(dhd_pub_t *dhd)
#endif
#endif /* DISABLE_11N */



/* query for 'ver' to get version info from firmware */
memset(buf, 0, sizeof(buf));
ptr = buf;
Expand Down Expand Up @@ -4738,6 +4738,9 @@ dhd_net_attach(dhd_pub_t *dhdp, int ifidx)

dhd->pub.rxsz = DBUS_RX_BUFFER_SIZE_DHD(net);

/* NexMon: Change interface type to radiotap */
net->type = ARPHRD_IEEE80211;

memcpy(net->dev_addr, temp_addr, ETHER_ADDR_LEN);

net->ifindex = 0;
Expand Down

0 comments on commit ed11c18

Please sign in to comment.