Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port to 4.13 #114

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions os/linux/cfg80211/cfg80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,11 @@ Return Value:
For iw utility: set type, set monitor
========================================================================
*/
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32))
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0))
static int CFG80211_OpsVirtualInfChg(struct wiphy *pWiphy,
struct net_device *pNetDevIn, enum nl80211_iftype Type,
struct vif_params *pParams)
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32))
static int CFG80211_OpsVirtualInfChg(struct wiphy *pWiphy,
struct net_device *pNetDevIn, enum nl80211_iftype Type, u32 *pFlags,
struct vif_params *pParams)
Expand All @@ -284,6 +288,9 @@ static int CFG80211_OpsVirtualInfChg(struct wiphy *pWiphy, int IfIndex,
struct net_device *pNetDev;
CMD_RTPRIV_IOCTL_80211_VIF_PARM VifInfo;
UINT oldType = pNetDevIn->ieee80211_ptr->iftype;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0))
u32 *pFlags;
#endif /* LINUX_VERSION_CODE */

CFG80211DBG(RT_DEBUG_TRACE, ("80211> %s ==>\n", __FUNCTION__));
CFG80211DBG(RT_DEBUG_TRACE, ("80211> IfTypeChange %d ==> %d\n", oldType, Type));
Expand Down Expand Up @@ -322,7 +329,12 @@ static int CFG80211_OpsVirtualInfChg(struct wiphy *pWiphy, int IfIndex,
VifInfo.newIfType = Type;
VifInfo.oldIfType = oldType;

#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0))
if (pParams != NULL) {
pFlags = & (pParams->flags);
#else
if (pFlags != NULL) {
#endif /* LINUX_VERSION_CODE */
VifInfo.MonFilterFlag = 0;

if (((*pFlags) & NL80211_MNTR_FLAG_FCSFAIL) == NL80211_MNTR_FLAG_FCSFAIL)
Expand Down Expand Up @@ -2181,7 +2193,11 @@ static int CFG80211_OpsStaChg(struct wiphy *pWiphy, struct net_device *dev,
return 0;
}

#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,1,0))
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0))
static struct wireless_dev* CFG80211_OpsVirtualInfAdd(struct wiphy *pWiphy,
const char *name, unsigned char name_assign_type, enum nl80211_iftype Type,
struct vif_params *pParams)
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,1,0))
static struct wireless_dev* CFG80211_OpsVirtualInfAdd(struct wiphy *pWiphy,
const char *name, unsigned char name_assign_type, enum nl80211_iftype Type,
u32 *pFlags, struct vif_params *pParams)
Expand Down
4 changes: 4 additions & 0 deletions os/linux/cfg80211/cfg80211_inf.c
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,11 @@ void RTMP_CFG80211_VirtualIF_Init(void *pAdSrc, CHAR *pDevName, UINT32 DevType)
RTMP_OS_NETDEV_GET_DEVNAME(new_dev_p)));
}

#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0))
new_dev_p->needs_free_netdev = true;
#else
new_dev_p->destructor = free_netdev;
#endif /* LINUX_VERSION_CODE */
RtmpOsSetNetDevPriv(new_dev_p, pAd);
NdisMoveMemory(&pNetDevOps->devAddr[0], &pAd->CurrentAddress[0], MAC_ADDR_LEN);

Expand Down
2 changes: 1 addition & 1 deletion os/linux/sta_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ static int rt_ioctl_iwaplist(struct net_device *dev, struct iw_request_info *inf
set_quality(pAd, &qual[i], pList); /*&pAd->ScanTab.BssEntry[i]); */
}
data->length = i;
memcpy(extra, &addr, i*sizeof(addr[0]));
memcpy(extra, addr, i*sizeof(addr[0]));
data->flags = 1; /* signal quality present (sort of) */
memcpy(extra + i*sizeof(addr[0]), &qual, i*sizeof(qual[i]));

Expand Down
3 changes: 3 additions & 0 deletions os/linux/usb_main_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,10 @@ static int rt2870_probe(struct usb_interface *intf, struct usb_device *usb_dev,
return 0;

err_out_free_netdev:

#if (LINUX_VERSION_CODE < KERNEL_VERSION(4,12,0))
RtmpOSNetDevFree(net_dev);
#endif

err_out_free_radev:
RTMPFreeAdapter(pAd);
Expand Down