/*BugID_5137*/
struct add_key_params {
u8 key_idx;
- #if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 36)
bool pairwise;
- #endif
u8 *mac_addr;
};
struct add_key_params g_add_gtk_key_params;
if (pstrNetworkInfo != WILC_NULL) {
- #if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 38)
s32Freq = ieee80211_channel_to_frequency((WILC_Sint32)pstrNetworkInfo->u8channel, IEEE80211_BAND_2GHZ);
- #else
- s32Freq = ieee80211_channel_to_frequency((WILC_Sint32)pstrNetworkInfo->u8channel);
- #endif
-
channel = ieee80211_get_channel(wiphy, s32Freq);
rssi = get_rssi_avg(pstrNetworkInfo);
if (WILC_memcmp("DIRECT-", pstrNetworkInfo->au8ssid, 7) || bDirectScan) {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0)
bss = cfg80211_inform_bss(wiphy, channel, CFG80211_BSS_FTYPE_UNKNOWN, pstrNetworkInfo->au8bssid, pstrNetworkInfo->u64Tsf, pstrNetworkInfo->u16CapInfo,
pstrNetworkInfo->u16BeaconPeriod, (const u8 *)pstrNetworkInfo->pu8IEs,
(size_t)pstrNetworkInfo->u16IEsLen, (((WILC_Sint32)rssi) * 100), GFP_KERNEL);
-#else
- bss = cfg80211_inform_bss(wiphy, channel, pstrNetworkInfo->au8bssid, pstrNetworkInfo->u64Tsf, pstrNetworkInfo->u16CapInfo,
- pstrNetworkInfo->u16BeaconPeriod, (const u8 *)pstrNetworkInfo->pu8IEs,
- (size_t)pstrNetworkInfo->u16IEsLen, (((WILC_Sint32)rssi) * 100), GFP_KERNEL);
-#endif
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0)
cfg80211_put_bss(wiphy, bss);
-#else
- cfg80211_put_bss(bss);
-#endif
}
}
}
if (pstrNetworkInfo != WILC_NULL) {
- #if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 38)
s32Freq = ieee80211_channel_to_frequency((WILC_Sint32)pstrNetworkInfo->u8channel, IEEE80211_BAND_2GHZ);
- #else
- s32Freq = ieee80211_channel_to_frequency((WILC_Sint32)pstrNetworkInfo->u8channel);
- #endif
channel = ieee80211_get_channel(wiphy, s32Freq);
WILC_NULLCHECK(s32Error, channel);
/*P2P peers are sent to WPA supplicant and added to shadow table*/
if (!(WILC_memcmp("DIRECT-", pstrNetworkInfo->au8ssid, 7))) {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0)
bss = cfg80211_inform_bss(wiphy, channel, CFG80211_BSS_FTYPE_UNKNOWN, pstrNetworkInfo->au8bssid, pstrNetworkInfo->u64Tsf, pstrNetworkInfo->u16CapInfo,
pstrNetworkInfo->u16BeaconPeriod, (const u8 *)pstrNetworkInfo->pu8IEs,
(size_t)pstrNetworkInfo->u16IEsLen, (((WILC_Sint32)pstrNetworkInfo->s8rssi) * 100), GFP_KERNEL);
-#else
- bss = cfg80211_inform_bss(wiphy, channel, pstrNetworkInfo->au8bssid, pstrNetworkInfo->u64Tsf, pstrNetworkInfo->u16CapInfo,
- pstrNetworkInfo->u16BeaconPeriod, (const u8 *)pstrNetworkInfo->pu8IEs,
- (size_t)pstrNetworkInfo->u16IEsLen, (((WILC_Sint32)pstrNetworkInfo->s8rssi) * 100), GFP_KERNEL);
-#endif
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0)
cfg80211_put_bss(wiphy, bss);
-#else
- cfg80211_put_bss(bss);
-#endif
}
* @date 01 MAR 2012
* @version 1.0
*/
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)
-/*
- * struct changed from v3.8.0
- * tony, sswd, WILC-KR, 2013-10-29
- * struct cfg80211_chan_def {
- * struct ieee80211_channel *chan;
- * enum nl80211_chan_width width;
- * u32 center_freq1;
- * u32 center_freq2;
- * };
- */
static int WILC_WFI_CfgSetChannel(struct wiphy *wiphy,
struct cfg80211_chan_def *chandef)
-#else
-static int WILC_WFI_CfgSetChannel(struct wiphy *wiphy,
- #if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 32)
- struct net_device *netdev,
- #endif
- struct ieee80211_channel *channel,
- enum nl80211_channel_type channel_type)
-#endif
{
WILC_Uint32 channelnum = 0;
WILC_Sint32 s32Error = WILC_SUCCESS;
priv = wiphy_priv(wiphy);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0) /* tony for v3.8.0 support */
channelnum = ieee80211_frequency_to_channel(chandef->chan->center_freq);
PRINT_D(CFG80211_DBG, "Setting channel %d with frequency %d\n", channelnum, chandef->chan->center_freq);
-#else
- channelnum = ieee80211_frequency_to_channel(channel->center_freq);
-
- PRINT_D(CFG80211_DBG, "Setting channel %d with frequency %d\n", channelnum, channel->center_freq);
-#endif
u8CurrChannel = channelnum;
s32Error = host_int_set_mac_chnl_num(priv->hWILCWFIDrv, channelnum);
* kernel version 3.8.8 supported
* tony, sswd, WILC-KR, 2013-10-29
*/
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)
static int WILC_WFI_CfgScan(struct wiphy *wiphy, struct cfg80211_scan_request *request)
-#else
-static int WILC_WFI_CfgScan(struct wiphy *wiphy, struct net_device *dev, struct cfg80211_scan_request *request)
-#endif
{
struct WILC_WFI_priv *priv;
WILC_Uint32 i;
priv = wiphy_priv(wiphy);
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 6, 0)
- PRINT_D(CORECONFIG_DBG, "Scan on netdev [%p] host if [%x]\n", dev, (WILC_Uint32)priv->hWILCWFIDrv);
-#endif
-
/*if(connecting)
* return -EBUSY; */
/*requests "create group" during a running scan*/
/* host_int_set_wfi_drv_handler(priv->hWILCWFIDrv); */
#if 0
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0) /* tony for v3.8.0 support */
if (priv->dev->ieee80211_ptr->iftype == NL80211_IFTYPE_AP) {
PRINT_D(GENERIC_DBG, "Required scan while in AP mode");
return s32Error;
}
-#else
- if (dev->ieee80211_ptr->iftype == NL80211_IFTYPE_AP) {
- PRINT_D(GENERIC_DBG, "Required scan while in AP mode");
- s32Error = WILC_BUSY;
- return s32Error;
- }
-#endif
#endif /* end of if 0 */
priv->pstrScanReq = request;
* @version 1.0
*/
static int WILC_WFI_add_key(struct wiphy *wiphy, struct net_device *netdev, u8 key_index,
- #if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 36)
bool pairwise,
- #endif
const u8 *mac_addr, struct key_params *params)
{
- #if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 36)
if (!pairwise)
- #else
- if (!mac_addr || is_broadcast_ether_addr(mac_addr))
- #endif
{
if (params->cipher == WLAN_CIPHER_SUITE_TKIP)
u8gmode = ENCRYPT_ENABLED | WPA | TKIP;
{
u8mode = 0;
- #if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 36)
if (!pairwise)
- #else
- if (!mac_addr || is_broadcast_ether_addr(mac_addr))
- #endif
{
if (params->key_len > 16 && params->cipher == WLAN_CIPHER_SUITE_TKIP) {
/* swap the tx mic by rx mic */
/*save keys only on interface 0 (wifi interface)*/
if (!g_gtk_keys_saved && netdev == g_linux_wlan->strInterfaceInfo[0].wilc_netdev) {
g_add_gtk_key_params.key_idx = key_index;
- #if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 36)
g_add_gtk_key_params.pairwise = pairwise;
- #endif
if (!mac_addr) {
g_add_gtk_key_params.mac_addr = NULL;
} else {
/*save keys only on interface 0 (wifi interface)*/
if (!g_ptk_keys_saved && netdev == g_linux_wlan->strInterfaceInfo[0].wilc_netdev) {
g_add_ptk_key_params.key_idx = key_index;
- #if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 36)
g_add_ptk_key_params.pairwise = pairwise;
- #endif
if (!mac_addr) {
g_add_ptk_key_params.mac_addr = NULL;
} else {
*/
static int WILC_WFI_del_key(struct wiphy *wiphy, struct net_device *netdev,
u8 key_index,
- #if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 36)
bool pairwise,
- #endif
const u8 *mac_addr)
{
struct WILC_WFI_priv *priv;
* @version 1.0
*/
static int WILC_WFI_get_key(struct wiphy *wiphy, struct net_device *netdev, u8 key_index,
- #if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 36)
bool pairwise,
- #endif
const u8 *mac_addr, void *cookie, void (*callback)(void *cookie, struct key_params *))
{
priv = wiphy_priv(wiphy);
- #if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 36)
if (!pairwise)
- #else
- if (!mac_addr || is_broadcast_ether_addr(mac_addr))
- #endif
{
PRINT_D(CFG80211_DBG, "Getting group key idx: %x\n", key_index);
* @date 01 MAR 2012
* @version 1.0
*/
-static int WILC_WFI_set_default_key(struct wiphy *wiphy, struct net_device *netdev, u8 key_index
- #if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 37)
- , bool unicast, bool multicast
- #endif
- )
+static int WILC_WFI_set_default_key(struct wiphy *wiphy, struct net_device *netdev, u8 key_index,
+ bool unicast, bool multicast)
{
WILC_Sint32 s32Error = WILC_SUCCESS;
struct WILC_WFI_priv *priv;
return s32Error;
}
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) //0421
sinfo->filled |= BIT(NL80211_STA_INFO_INACTIVE_TIME);
-#else
- sinfo->filled |= STATION_INFO_INACTIVE_TIME;
-#endif
host_int_get_inactive_time(priv->hWILCWFIDrv, mac, &(inactive_time));
sinfo->inactive_time = 1000 * inactive_time;
* tx_failed introduced more than
* kernel version 3.0.0
*/
- #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) //0421
sinfo->filled |= BIT(NL80211_STA_INFO_SIGNAL) |
BIT( NL80211_STA_INFO_RX_PACKETS) |
BIT(NL80211_STA_INFO_TX_PACKETS) |
BIT(NL80211_STA_INFO_TX_FAILED) |
BIT(NL80211_STA_INFO_TX_BITRATE);
- #elif LINUX_VERSION_CODE >= KERNEL_VERSION(3, 0, 0)
- sinfo->filled |= STATION_INFO_SIGNAL | STATION_INFO_RX_PACKETS | STATION_INFO_TX_PACKETS
- | STATION_INFO_TX_FAILED | STATION_INFO_TX_BITRATE;
- #else
- sinfo->filled |= STATION_INFO_SIGNAL | STATION_INFO_RX_PACKETS | STATION_INFO_TX_PACKETS
- | STATION_INFO_TX_BITRATE;
- #endif
sinfo->signal = strStatistics.s8RSSI;
sinfo->rx_packets = strStatistics.u32RxCount;
sinfo->tx_packets = strStatistics.u32TxCount + strStatistics.u32TxFailureCount;
- #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 0, 0)
sinfo->tx_failed = strStatistics.u32TxFailureCount;
- #endif
sinfo->txrate.legacy = strStatistics.u8LinkSpeed * 10;
#ifdef TCP_ENHANCEMENTS
}
#endif
- #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 0, 0)
PRINT_D(CORECONFIG_DBG, "*** stats[%d][%d][%d][%d][%d]\n", sinfo->signal, sinfo->rx_packets, sinfo->tx_packets,
sinfo->tx_failed, sinfo->txrate.legacy);
- #else
- PRINT_D(CORECONFIG_DBG, "*** stats[%d][%d][%d][%d]\n", sinfo->signal, sinfo->rx_packets, sinfo->tx_packets,
- sinfo->txrate.legacy);
- #endif
}
return s32Error;
}
return s32Error;
}
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 32)
+
/**
* @brief WILC_WFI_set_bitrate_mask
* @details set the bitrate mask configuration
return 0;
}
-#endif
#ifdef WILC_P2P
if (pkt_offset & IS_MANAGMEMENT_CALLBACK) {
if (buff[FRAME_TYPE_ID] == IEEE80211_STYPE_PROBE_RESP) {
PRINT_D(GENERIC_DBG, "Probe response ACK\n");
- #if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 6, 0))
- cfg80211_mgmt_tx_status(dev, priv->u64tx_cookie, buff, size, true, GFP_KERNEL);
- #else
cfg80211_mgmt_tx_status(priv->wdev, priv->u64tx_cookie, buff, size, true, GFP_KERNEL);
- #endif
return;
} else {
if (pkt_offset & IS_MGMT_STATUS_SUCCES) {
PRINT_D(GENERIC_DBG, "Success Ack - Action frame category: %x Action Subtype: %d Dialog T: %x OR %x\n", buff[ACTION_CAT_ID], buff[ACTION_SUBTYPE_ID],
buff[ACTION_SUBTYPE_ID + 1], buff[P2P_PUB_ACTION_SUBTYPE + 1]);
- #if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 6, 0))
- cfg80211_mgmt_tx_status(dev, priv->u64tx_cookie, buff, size, true, GFP_KERNEL);
- #else
cfg80211_mgmt_tx_status(priv->wdev, priv->u64tx_cookie, buff, size, true, GFP_KERNEL);
- #endif
} else {
PRINT_D(GENERIC_DBG, "Fail Ack - Action frame category: %x Action Subtype: %d Dialog T: %x OR %x\n", buff[ACTION_CAT_ID], buff[ACTION_SUBTYPE_ID],
buff[ACTION_SUBTYPE_ID + 1], buff[P2P_PUB_ACTION_SUBTYPE + 1]);
- #if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 6, 0))
- cfg80211_mgmt_tx_status(dev, priv->u64tx_cookie, buff, size, false, GFP_KERNEL);
- #else
cfg80211_mgmt_tx_status(priv->wdev, priv->u64tx_cookie, buff, size, false, GFP_KERNEL);
- #endif
}
return;
}
/*BugID_5442*/
/*Upper layer is informed that the frame is received on this freq*/
- #if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 38)
s32Freq = ieee80211_channel_to_frequency(u8CurrChannel, IEEE80211_BAND_2GHZ);
- #else
- s32Freq = ieee80211_channel_to_frequency(u8CurrChannel);
- #endif
if (ieee80211_is_action(buff[FRAME_TYPE_ID])) {
PRINT_D(GENERIC_DBG, "Rx Action Frame Type: %x %x\n", buff[ACTION_SUBTYPE_ID], buff[P2P_PUB_ACTION_SUBTYPE]);
if ((buff[P2P_PUB_ACTION_SUBTYPE] == GO_NEG_REQ || buff[P2P_PUB_ACTION_SUBTYPE] == GO_NEG_RSP) && (bWilc_ie)) {
PRINT_D(GENERIC_DBG, "Sending P2P to host without extra elemnt\n");
/* extra attribute for sig_dbm: signal strength in mBm, or 0 if unknown */
- #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0))
cfg80211_rx_mgmt(priv->wdev, s32Freq, 0, buff, size - 7, 0);
- #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 12, 0))
- cfg80211_rx_mgmt(priv->wdev, s32Freq, 0, buff, size - 7, 0, GFP_ATOMIC);
- #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0))
- cfg80211_rx_mgmt(priv->wdev, s32Freq, 0, buff, size - 7, GFP_ATOMIC);
- #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 4, 0))
- cfg80211_rx_mgmt(dev, s32Freq, 0, buff, size - 7, GFP_ATOMIC); /* rachel */
- #elif (LINUX_VERSION_CODE < KERNEL_VERSION(3, 4, 0))
- cfg80211_rx_mgmt(dev, s32Freq, buff, size - 7, GFP_ATOMIC);
- #endif
-
return;
}
break;
}
}
- #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0))
cfg80211_rx_mgmt(priv->wdev, s32Freq, 0, buff, size - 7, 0);
- #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 12, 0))
- cfg80211_rx_mgmt(priv->wdev, s32Freq, 0, buff, size - 7, 0, GFP_ATOMIC);
- #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0))
- cfg80211_rx_mgmt(priv->wdev, s32Freq, 0, buff, size, GFP_ATOMIC);
- #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 4, 0))
- cfg80211_rx_mgmt(dev, s32Freq, 0, buff, size, GFP_ATOMIC);
- #elif (LINUX_VERSION_CODE < KERNEL_VERSION(3, 4, 0))
- cfg80211_rx_mgmt(dev, s32Freq, buff, size, GFP_ATOMIC);
- #endif
}
}
priv->bInP2PlistenState = WILC_TRUE;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)
cfg80211_ready_on_channel(priv->wdev,
priv->strRemainOnChanParams.u64ListenCookie,
priv->strRemainOnChanParams.pstrListenChan,
priv->strRemainOnChanParams.u32ListenDuration,
GFP_KERNEL);
-#else
- cfg80211_ready_on_channel(priv->dev,
- priv->strRemainOnChanParams.u64ListenCookie,
- priv->strRemainOnChanParams.pstrListenChan,
- priv->strRemainOnChanParams.tenuChannelType,
- priv->strRemainOnChanParams.u32ListenDuration,
- GFP_KERNEL);
-#endif
}
/**
priv->bInP2PlistenState = WILC_FALSE;
/*Inform wpas of remain-on-channel expiration*/
- #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)
cfg80211_remain_on_channel_expired(priv->wdev,
priv->strRemainOnChanParams.u64ListenCookie,
priv->strRemainOnChanParams.pstrListenChan,
GFP_KERNEL);
- #else
- cfg80211_remain_on_channel_expired(priv->dev,
- priv->strRemainOnChanParams.u64ListenCookie,
- priv->strRemainOnChanParams.pstrListenChan,
- priv->strRemainOnChanParams.tenuChannelType,
- GFP_KERNEL);
- #endif
} else {
PRINT_D(GENERIC_DBG, "Received ID 0x%x Expected ID 0x%x (No match)\n", u32SessionID
, priv->strRemainOnChanParams.u32ListenSessionID);
* @version 1.0
*/
static int WILC_WFI_remain_on_channel(struct wiphy *wiphy,
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0))
struct wireless_dev *wdev,
-#else
- struct net_device *dev,
-#endif
struct ieee80211_channel *chan,
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 8, 0))
- enum nl80211_channel_type channel_type,
-#endif
unsigned int duration, u64 *cookie)
{
WILC_Sint32 s32Error = WILC_SUCCESS;
/*This check is to handle the situation when user*/
/*requests "create group" during a running scan*/
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0))
if (wdev->iftype == NL80211_IFTYPE_AP) {
PRINT_D(GENERIC_DBG, "Required remain-on-channel while in AP mode");
return s32Error;
}
-#else
- if (dev->ieee80211_ptr->iftype == NL80211_IFTYPE_AP) {
- PRINT_D(GENERIC_DBG, "Required remain-on-channel while in AP mode");
- return s32Error;
- }
-#endif
u8CurrChannel = chan->hw_value;
/*Setting params needed by WILC_WFI_RemainOnChannelExpired()*/
priv->strRemainOnChanParams.pstrListenChan = chan;
priv->strRemainOnChanParams.u64ListenCookie = *cookie;
- #if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 8, 0))
- priv->strRemainOnChanParams.tenuChannelType = channel_type;
- #endif
priv->strRemainOnChanParams.u32ListenDuration = duration;
priv->strRemainOnChanParams.u32ListenSessionID++;
* @version 1.0
*/
static int WILC_WFI_cancel_remain_on_channel(struct wiphy *wiphy,
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0))
struct wireless_dev *wdev,
-#else
- struct net_device *dev,
-#endif
u64 cookie)
{
WILC_Sint32 s32Error = WILC_SUCCESS;
extern linux_wlan_t *g_linux_wlan;
extern WILC_Bool bEnablePS;
int WILC_WFI_mgmt_tx(struct wiphy *wiphy,
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)
struct wireless_dev *wdev,
struct cfg80211_mgmt_tx_params *params,
u64 *cookie)
-#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0))
- struct wireless_dev *wdev,
- struct ieee80211_channel *chan,
- bool offchan,
- unsigned int wait,
- const u8 *buf,
- size_t len,
- bool no_cck,
- bool dont_wait_for_ack, u64 *cookie)
-#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0))
- struct wireless_dev *wdev,
- struct ieee80211_channel *chan, bool offchan,
- enum nl80211_channel_type channel_type,
- bool channel_type valid,
- unsigned int wait, const u8 *buf,
- size_t len, bool no_cck,
- bool dont_wait_for_ack, u64 *cookie)
-#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 3, 0))
- struct net_device *dev,
- struct ieee80211_channel *chan, bool offchan,
- enum nl80211_channel_type channel_type,
- bool channel_type_valid,
- unsigned int wait, const u8 *buf,
- size_t len, bool no_cck,
- bool dont_wait_for_ack, u64 *cookie)
-#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0))
- struct net_device *dev,
- struct ieee80211_channel *chan, bool offchan,
- enum nl80211_channel_type channel_type,
- bool channel_type_valid,
- unsigned int wait, const u8 *buf,
- size_t len, bool no_cck, u64 *cookie)
-#else
- struct net_device *dev,
- struct ieee80211_channel *chan, bool offchan,
- enum nl80211_channel_type channel_type,
- bool channel_type_valid,
- unsigned int wait, const u8 *buf,
- size_t len, u64 *cookie)
-#endif
{
- #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)
struct ieee80211_channel *chan = params->chan;
unsigned int wait = params->wait;
const u8 *buf = params->buf;
size_t len = params->len;
- #endif
const struct ieee80211_mgmt *mgmt;
struct p2p_mgmt_data *mgmt_tx;
struct WILC_WFI_priv *priv;
perInterface_wlan_t *nic;
WILC_Uint32 buf_len = len + sizeof(u8P2P_vendorspec) + sizeof(u8P2Plocalrandom);
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0))
nic = netdev_priv(wdev->netdev);
-#else
- nic = netdev_priv(dev);
-#endif
priv = wiphy_priv(wiphy);
pstrWFIDrv = (tstrWILC_WFIDrv *)priv->hWILCWFIDrv;
}
int WILC_WFI_mgmt_tx_cancel_wait(struct wiphy *wiphy,
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)
struct wireless_dev *wdev,
-#else
- struct net_device *dev,
-#endif
u64 cookie)
{
struct WILC_WFI_priv *priv;
if (priv->bInP2PlistenState == WILC_FALSE) {
/* Bug 5504: This is just to avoid connection failure when getting stuck when the supplicant
* considers the driver falsely that it is in Listen state */
- #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)
cfg80211_remain_on_channel_expired(priv->wdev,
priv->strRemainOnChanParams.u64ListenCookie,
priv->strRemainOnChanParams.pstrListenChan,
GFP_KERNEL);
- #else
- cfg80211_remain_on_channel_expired(priv->dev,
- priv->strRemainOnChanParams.u64ListenCookie,
- priv->strRemainOnChanParams.pstrListenChan,
- priv->strRemainOnChanParams.tenuChannelType,
- GFP_KERNEL);
- #endif
-
}
return 0;
}
/**
- * @brief WILC_WFI_action
- * @details Transmit an action frame
- * @param[in]
- * @return int : Return 0 on Success.
- * @author mdaftedar
- * @date 01 JUL 2012
- * @version 1.0
- * */
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 37)
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 34)
-int WILC_WFI_action(struct wiphy *wiphy, struct net_device *dev,
- struct ieee80211_channel *chan, enum nl80211_channel_type channel_type,
- const u8 *buf, size_t len, u64 *cookie)
-{
- PRINT_D(HOSTAPD_DBG, "In action function\n");
- return WILC_SUCCESS;
-}
-#endif
-#else
-
-/**
* @brief WILC_WFI_frame_register
* @details Notify driver that a management frame type was
* registered. Note that this callback may not sleep, and cannot run
* @version
*/
void WILC_WFI_frame_register(struct wiphy *wiphy,
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0))
struct wireless_dev *wdev,
-#else
- struct net_device *dev,
-#endif
u16 frame_type, bool reg)
{
}
-#endif
#endif /*WILC_P2P*/
/**
priv = wiphy_priv(wiphy);
/* priv = netdev_priv(priv->wdev->netdev); */
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)) //0421
sinfo->filled |= BIT(NL80211_STA_INFO_SIGNAL);
-#else
- sinfo->filled |= STATION_INFO_SIGNAL;
-#endif
host_int_get_rssi(priv->hWILCWFIDrv, &(sinfo->signal));
WILC_WFI_add_key(g_linux_wlan->strInterfaceInfo[0].wilc_netdev->ieee80211_ptr->wiphy,
g_linux_wlan->strInterfaceInfo[0].wilc_netdev,
g_add_ptk_key_params.key_idx,
- #if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 36)
g_add_ptk_key_params.pairwise,
- #endif
g_add_ptk_key_params.mac_addr,
(struct key_params *)(&g_key_ptk_params));
WILC_WFI_add_key(g_linux_wlan->strInterfaceInfo[0].wilc_netdev->ieee80211_ptr->wiphy,
g_linux_wlan->strInterfaceInfo[0].wilc_netdev,
g_add_gtk_key_params.key_idx,
- #if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 36)
g_add_gtk_key_params.pairwise,
- #endif
g_add_gtk_key_params.mac_addr,
(struct key_params *)(&g_key_gtk_params));
}
WILC_WFI_add_key(g_linux_wlan->strInterfaceInfo[0].wilc_netdev->ieee80211_ptr->wiphy,
g_linux_wlan->strInterfaceInfo[0].wilc_netdev,
g_add_ptk_key_params.key_idx,
- #if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 36)
g_add_ptk_key_params.pairwise,
- #endif
g_add_ptk_key_params.mac_addr,
(struct key_params *)(&g_key_ptk_params));
WILC_WFI_add_key(g_linux_wlan->strInterfaceInfo[0].wilc_netdev->ieee80211_ptr->wiphy,
g_linux_wlan->strInterfaceInfo[0].wilc_netdev,
g_add_gtk_key_params.key_idx,
- #if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 36)
g_add_gtk_key_params.pairwise,
- #endif
g_add_gtk_key_params.mac_addr,
(struct key_params *)(&g_key_gtk_params));
}
WILC_WFI_add_key(g_linux_wlan->strInterfaceInfo[0].wilc_netdev->ieee80211_ptr->wiphy,
g_linux_wlan->strInterfaceInfo[0].wilc_netdev,
g_add_ptk_key_params.key_idx,
- #if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 36)
g_add_ptk_key_params.pairwise,
- #endif
g_add_ptk_key_params.mac_addr,
(struct key_params *)(&g_key_ptk_params));
WILC_WFI_add_key(g_linux_wlan->strInterfaceInfo[0].wilc_netdev->ieee80211_ptr->wiphy,
g_linux_wlan->strInterfaceInfo[0].wilc_netdev,
g_add_gtk_key_params.key_idx,
- #if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 36)
g_add_gtk_key_params.pairwise,
- #endif
g_add_gtk_key_params.mac_addr,
(struct key_params *)(&g_key_gtk_params));
#endif
return s32Error;
}
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 4, 0)
/* (austin.2013-07-23)
*
* To support revised cfg80211_ops
PRINT_D(HOSTAPD_DBG, "Interval = %d \n DTIM period = %d\n Head length = %d Tail length = %d\n",
settings->beacon_interval, settings->dtim_period, beacon->head_len, beacon->tail_len);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)
s32Error = WILC_WFI_CfgSetChannel(wiphy, &settings->chandef);
if (s32Error != WILC_SUCCESS)
PRINT_ER("Error in setting channel\n");
-#endif
linux_wlan_set_bssid(dev, g_linux_wlan->strInterfaceInfo[0].aSrcAddress);
return s32Error;
}
-#else /* here belows are original for < kernel 3.3 (austin.2013-07-23) */
-
-/**
- * @brief WILC_WFI_add_beacon
- * @details Add a beacon with given parameters, @head, @interval
- * and @dtim_period will be valid, @tail is optional.
- * @param[in] wiphy
- * @param[in] dev The net device structure
- * @param[in] info Parameters for the beacon to be added
- * @return int : Return 0 on Success.
- * @author mdaftedar
- * @date 01 MAR 2012
- * @version 1.0
- */
-static int WILC_WFI_add_beacon(struct wiphy *wiphy, struct net_device *dev,
- struct beacon_parameters *info)
-{
- WILC_Sint32 s32Error = WILC_SUCCESS;
- struct WILC_WFI_priv *priv;
-
-
-
- priv = wiphy_priv(wiphy);
- PRINT_D(HOSTAPD_DBG, "Adding Beacon\n");
-
- PRINT_D(HOSTAPD_DBG, "Interval = %d \n DTIM period = %d\n Head length = %d Tail length = %d\n", info->interval, info->dtim_period, info->head_len, info->tail_len);
-
- linux_wlan_set_bssid(dev, g_linux_wlan->strInterfaceInfo[0].aSrcAddress);
-
- #ifndef WILC_FULLY_HOSTING_AP
- s32Error = host_int_add_beacon(priv->hWILCWFIDrv, info->interval,
- info->dtim_period,
- info->head_len, info->head,
- info->tail_len, info->tail);
-
- #else
- s32Error = host_add_beacon(priv->hWILCWFIDrv, info->interval,
- info->dtim_period,
- info->head_len, info->head,
- info->tail_len, info->tail);
- #endif
-
- return s32Error;
-}
-
-/**
- * @brief WILC_WFI_set_beacon
- * @details Change the beacon parameters for an access point mode
- * interface. This should reject the call when no beacon has been
- * configured.
- * @param[in]
- * @return int : Return 0 on Success.
- * @author mdaftedar
- * @date 01 MAR 2012
- * @version 1.0
- */
-static int WILC_WFI_set_beacon(struct wiphy *wiphy, struct net_device *dev,
- struct beacon_parameters *info)
-{
- WILC_Sint32 s32Error = WILC_SUCCESS;
-
-
- PRINT_D(HOSTAPD_DBG, "Setting beacon\n");
-
- s32Error = WILC_WFI_add_beacon(wiphy, dev, info);
-
- return s32Error;
-}
-
-/**
- * @brief WILC_WFI_del_beacon
- * @details Remove beacon configuration and stop sending the beacon.
- * @param[in]
- * @return int : Return 0 on Success.
- * @author mdaftedar
- * @date 01 MAR 2012
- * @version 1.0
- */
-static int WILC_WFI_del_beacon(struct wiphy *wiphy, struct net_device *dev)
-{
- WILC_Sint32 s32Error = WILC_SUCCESS;
- struct WILC_WFI_priv *priv;
- WILC_Uint8 NullBssid[ETH_ALEN] = {0};
-
-
- WILC_NULLCHECK(s32Error, wiphy);
-
- priv = wiphy_priv(wiphy);
-
- PRINT_D(HOSTAPD_DBG, "Deleting beacon\n");
-
- /*BugID_5188*/
- linux_wlan_set_bssid(dev, NullBssid);
-
- #ifndef WILC_FULLY_HOSTING_AP
- s32Error = host_int_del_beacon(priv->hWILCWFIDrv);
- #else
- s32Error = host_del_beacon(priv->hWILCWFIDrv);
- #endif
-
- WILC_ERRORCHECK(s32Error);
-
- WILC_CATCH(s32Error)
- {
- }
- return s32Error;
-}
-
-#endif /* linux kernel 3.4+ (austin.2013-07-23) */
-
/**
* @brief WILC_WFI_add_station
* @details Add a new station.
* @version 1.0
*/
static int WILC_WFI_del_station(struct wiphy *wiphy, struct net_device *dev,
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
struct station_del_parameters *params)
-#else
- u8 *mac)
-#endif
{
- #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
u8 *mac = params->mac;
- #endif
WILC_Sint32 s32Error = WILC_SUCCESS;
struct WILC_WFI_priv *priv;
perInterface_wlan_t *nic;
* @date 01 JUL 2012
* @version 1.0
*/
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 0, 0)
struct wireless_dev *WILC_WFI_add_virt_intf(struct wiphy *wiphy, const char *name,
unsigned char name_assign_type,
enum nl80211_iftype type, u32 *flags,
struct vif_params *params)
-#elif LINUX_VERSION_CODE >= KERNEL_VERSION(3, 7, 0) /* tony for v3.8 support */
-struct wireless_dev *WILC_WFI_add_virt_intf(struct wiphy *wiphy, const char *name,
- enum nl80211_iftype type, u32 *flags,
- struct vif_params *params)
-#elif LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0) /* tony for v3.6 support */
-struct wireless_dev *WILC_WFI_add_virt_intf(struct wiphy *wiphy, char *name,
- enum nl80211_iftype type, u32 *flags,
- struct vif_params *params)
-#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 37)
-int WILC_WFI_add_virt_intf(struct wiphy *wiphy, char *name,
- enum nl80211_iftype type, u32 *flags,
- struct vif_params *params)
-#else
-struct net_device *WILC_WFI_add_virt_intf(struct wiphy *wiphy, char *name,
- enum nl80211_iftype type, u32 *flags,
- struct vif_params *params)
-#endif
{
perInterface_wlan_t *nic;
struct WILC_WFI_priv *priv;
/* struct WILC_WFI_mon_priv* mon_priv; */
- #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 37)
- WILC_Sint32 s32Error = WILC_SUCCESS;
- #endif
struct net_device *new_ifc = NULL;
priv = wiphy_priv(wiphy);
} else
PRINT_ER("Error in initializing monitor interface\n ");
}
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0) /* tony for v3.8 support */
return priv->wdev;
-#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 37)
- return s32Error;
-#else
- /* return priv->wdev->netdev; */
- PRINT_D(HOSTAPD_DBG, "IFC[%p] created\n", new_ifc);
- return new_ifc;
-#endif
-
}
/**
* @date 01 JUL 2012
* @version 1.0
*/
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)
int WILC_WFI_del_virt_intf(struct wiphy *wiphy, struct wireless_dev *wdev) /* tony for v3.8 support */
-#else
-int WILC_WFI_del_virt_intf(struct wiphy *wiphy, struct net_device *dev)
-#endif
{
PRINT_D(HOSTAPD_DBG, "Deleting virtual interface\n");
return WILC_SUCCESS;
#endif /*WILC_AP_EXTERNAL_MLME*/
static struct cfg80211_ops WILC_WFI_cfg80211_ops = {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)
- /*
- * replaced set_channel by set_monitor_channel
- * from v3.6
- * tony, 2013-10-29
- */
.set_monitor_channel = WILC_WFI_CfgSetChannel,
-#else
- .set_channel = WILC_WFI_CfgSetChannel,
-#endif
.scan = WILC_WFI_CfgScan,
.connect = WILC_WFI_CfgConnect,
.disconnect = WILC_WFI_disconnect,
.del_key = WILC_WFI_del_key,
.get_key = WILC_WFI_get_key,
.set_default_key = WILC_WFI_set_default_key,
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 32)
/* .dump_survey = WILC_WFI_dump_survey, */
-#endif
#ifdef WILC_AP_EXTERNAL_MLME
.add_virtual_intf = WILC_WFI_add_virt_intf,
.del_virtual_intf = WILC_WFI_del_virt_intf,
.change_virtual_intf = WILC_WFI_change_virt_intf,
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 4, 0)
- .add_beacon = WILC_WFI_add_beacon,
- .set_beacon = WILC_WFI_set_beacon,
- .del_beacon = WILC_WFI_del_beacon,
-#else
- /* supports kernel 3.4+ change. austin.2013-07-23 */
.start_ap = WILC_WFI_start_ap,
.change_beacon = WILC_WFI_change_beacon,
.stop_ap = WILC_WFI_stop_ap,
-#endif
.add_station = WILC_WFI_add_station,
.del_station = WILC_WFI_del_station,
.change_station = WILC_WFI_change_station,
/* .disassoc = WILC_WFI_disassoc, */
.set_wiphy_params = WILC_WFI_set_wiphy_params,
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 32)
/* .set_bitrate_mask = WILC_WFI_set_bitrate_mask, */
.set_pmksa = WILC_WFI_set_pmksa,
.del_pmksa = WILC_WFI_del_pmksa,
.remain_on_channel = WILC_WFI_remain_on_channel,
.cancel_remain_on_channel = WILC_WFI_cancel_remain_on_channel,
.mgmt_tx_cancel_wait = WILC_WFI_mgmt_tx_cancel_wait,
- #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 37)
- #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 34)
- .action = WILC_WFI_action,
- #endif
- #else
.mgmt_tx = WILC_WFI_mgmt_tx,
.mgmt_frame_register = WILC_WFI_frame_register,
- #endif
-#endif
/* .mgmt_tx_cancel_wait = WILC_WFI_mgmt_tx_cancel_wait, */
.set_power_mgmt = WILC_WFI_set_power_mgmt,
.set_cqm_rssi_config = WILC_WFI_set_cqm_rssi_config,
/*Maximum number of probed ssid to be added by user for the scan request*/
wdev->wiphy->max_scan_ssids = MAX_NUM_PROBED_SSID;
- #if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 32)
/*Maximum number of pmkids to be cashed*/
wdev->wiphy->max_num_pmkids = WILC_MAX_NUM_PMKIDS;
PRINT_INFO(CFG80211_DBG, "Max number of PMKIDs = %d\n", wdev->wiphy->max_num_pmkids);
- #endif
wdev->wiphy->max_scan_ie_len = 1000;
/*Set the availaible cipher suites*/
wdev->wiphy->cipher_suites = cipher_suites;
wdev->wiphy->n_cipher_suites = ARRAY_SIZE(cipher_suites);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)
/*Setting default managment types: for register action frame: */
wdev->wiphy->mgmt_stypes = wilc_wfi_cfg80211_mgmt_types;
-#endif
#ifdef WILC_P2P
wdev->wiphy->max_remain_on_channel_duration = 500;
/*Setting the wiphy interfcae mode and type before registering the wiphy*/
wdev->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) | BIT(NL80211_IFTYPE_AP) | BIT(NL80211_IFTYPE_MONITOR) | BIT(NL80211_IFTYPE_P2P_GO) |
BIT(NL80211_IFTYPE_P2P_CLIENT);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 3, 0)
-
wdev->wiphy->flags |= WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL;
-#endif
#else
wdev->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) | BIT(NL80211_IFTYPE_AP) | BIT(NL80211_IFTYPE_MONITOR);
#endif