module_param(keep_alive_period, uint, S_IRUGO | S_IWUSR);
MODULE_PARM_DESC(keep_alive_period, "default is 10 seconds");
-
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0))
struct wireless_dev *slsi_add_virtual_intf(struct wiphy *wiphy,
const char *name,
unsigned char name_assign_type,
enum nl80211_iftype type,
struct vif_params *params)
{
-#if 0
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 9))
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 0))
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 0))
struct wireless_dev *slsi_add_virtual_intf(struct wiphy *wiphy,
const char *name,
unsigned char name_assign_type,
u32 *flags,
struct vif_params *params)
{
-#else
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 9))
struct wireless_dev *slsi_add_virtual_intf(struct wiphy *wiphy,
const char *name,
enum nl80211_iftype type,
u32 *flags,
struct vif_params *params)
{
-#endif
#else
struct net_device *slsi_add_ virtual_intf(struct wiphy *wiphy,
char *name,
u32 *flags,
struct vif_params *params)
{
-#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 9)) */
#endif
+
struct net_device *dev = NULL;
struct netdev_vif *ndev_vif = NULL;
- /* SLSI_UNUSED_PARAMETER(flags); */
+#if (LINUX_VERSION_CODE <= KERNEL_VERSION(4, 11, 0))
+ SLSI_UNUSED_PARAMETER(flags);
+#endif
SLSI_NET_DBG1(dev, SLSI_CFG80211, "Intf name:%d, type:%d, macaddr:%pM\n", name, type, params->macaddr);
dev = slsi_new_interface_create(wiphy, name, type, params);
if (!dev)
return 0;
}
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0))
int slsi_change_virtual_intf(struct wiphy *wiphy,
struct net_device *dev,
- enum nl80211_iftype type,
- /* u32 *flags, */
+ enum nl80211_iftype type,
struct vif_params *params)
{
+#else
+int slsi_change_virtual_intf(struct wiphy *wiphy,
+ struct net_device *dev,
+ enum nl80211_iftype type,
+ u32 *flags,
+ struct vif_params *params)
+{
+#endif
+
struct netdev_vif *ndev_vif = netdev_priv(dev);
int r = 0;
- /* SLSI_UNUSED_PARAMETER(flags); */
+#if (LINUX_VERSION_CODE <= KERNEL_VERSION(4, 11, 0))
+ SLSI_UNUSED_PARAMETER(flags);
+#endif
SLSI_MUTEX_LOCK(ndev_vif->vif_mutex);
return r;
}
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0))
int slsi_sched_scan_stop(struct wiphy *wiphy, struct net_device *dev, u64 reqid)
{
+#else
+int slsi_sched_scan_stop(struct wiphy *wiphy, struct net_device *dev)
+{
+#endif
struct netdev_vif *ndev_vif = netdev_priv(dev);
struct slsi_dev *sdev = SDEV_FROM_WIPHY(wiphy);
int r = 0;
wiphy->max_scan_ssids = 10;
wiphy->max_scan_ie_len = 2048;
+#if (LINUX_VERSION_CODE <= KERNEL_VERSION(4, 11, 0))
/* Scheduled scanning support */
- /* wiphy->flags |= WIPHY_FLAG_SUPPORTS_SCHED_SCAN; */
+ wiphy->flags |= WIPHY_FLAG_SUPPORTS_SCHED_SCAN;
+#endif
+
/* Match the maximum number of SSIDs that could be requested from wpa_supplicant */
wiphy->max_sched_scan_ssids = 16;
}
if (scan_id == SLSI_SCAN_SCHED_ID)
- cfg80211_sched_scan_results(sdev->wiphy, 0);
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0))
+ cfg80211_sched_scan_results(sdev->wiphy, SLSI_SCAN_SCHED_ID);
+#else
+ cfg80211_sched_scan_results(sdev->wiphy);
+#endif
SLSI_MUTEX_UNLOCK(ndev_vif->scan_result_mutex);
}
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 0))
enum ieee80211_privacy bss_privacy;
#endif
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0))
struct cfg80211_roam_info roam_info = {};
+#endif
+
SLSI_MUTEX_LOCK(ndev_vif->vif_mutex);
SLSI_NET_DBG1(dev, SLSI_MLME, "mlme_roamed_ind(vif:%d) Roaming to %pM\n",
SLSI_NET_DBG3(dev, SLSI_MLME, "cfg80211_roamed()\n");
- /* TODO: add proper parameters */
- /*roam_info.channel = */
- /*roam_info.bssid = */
- roam_info.req_ie = assoc_ie;
- roam_info.req_ie_len = assoc_ie_len;
- roam_info.resp_ie = assoc_rsp_ie;
- roam_info.resp_ie_len = assoc_rsp_ie_len;
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0))
+ roam_info.channel = ndev_vif->sta.sta_bss->channel;
+ roam_info.bss = ndev_vif->sta.sta_bss;
+ roam_info.bssid = peer->address;
+ roam_info.req_ie = assoc_ie;
+ roam_info.req_ie_len = assoc_ie_len;
+ roam_info.resp_ie = assoc_rsp_ie;
+ roam_info.resp_ie_len = assoc_rsp_ie_len;
cfg80211_roamed(dev, &roam_info, GFP_KERNEL);
-#if 0
+#else
cfg80211_roamed(dev,
ndev_vif->sta.sta_bss->channel,
peer->address,
ndev_vif->stats.rx_packets++;
ndev_vif->stats.rx_bytes += skb->len;
- /* dev->last_rx = jiffies; */
+#if (LINUX_VERSION_CODE <= KERNEL_VERSION(4, 10, 0))
+ dev->last_rx = jiffies;
+#endif
skb->protocol = eth_type_trans(skb, dev);
slsi_dbg_untrack_skb(skb);