qcacld-3.0: Remove the obsolete LINUX VERSION checks

We already know kernel version is more than equal to 3.10.
So remove static checks for any previous kernel.

Change-Id: I4e17614fae47782a02dd528c7b4adf3d2802ec69
CRs-Fixed: 920681
Tento commit je obsažen v:
Amar Singhal
2015-10-08 11:55:32 -07:00
odevzdal Satish Singh
rodič 5b635014bc
revize 01098f7526
22 změnil soubory, kde provedl 17 přidání a 975 odebrání

Zobrazit soubor

@@ -342,10 +342,6 @@ static int cds_mc_thread(void *Arg)
}
set_user_nice(current, -2);
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 8, 0))
daemonize("MC_Thread");
#endif
/* Ack back to the context from which the main controller thread
* has been created
*/

Zobrazit soubor

@@ -92,31 +92,16 @@ typedef struct p2p_app_setP2pPs {
} p2p_app_setP2pPs_t;
int wlan_hdd_cfg80211_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);
int wlan_hdd_cfg80211_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);
int wlan_hdd_cfg80211_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);
int hdd_set_p2p_ps(struct net_device *dev, void *msgData);
@@ -136,54 +121,22 @@ void wlan_hdd_cancel_existing_remain_on_channel(hdd_adapter_t *pAdapter);
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0))
int wlan_hdd_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
struct cfg80211_mgmt_tx_params *params, u64 *cookie);
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0))
#else
int wlan_hdd_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
struct ieee80211_channel *chan, bool offchan,
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 8, 0))
enum nl80211_channel_type channel_type,
bool channel_type_valid,
#endif
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))
int wlan_hdd_mgmt_tx(struct wiphy *wiphy, 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);
#else
int wlan_hdd_mgmt_tx(struct wiphy *wiphy, 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, 7, 0))
struct wireless_dev *wlan_hdd_add_virtual_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))
struct wireless_dev *wlan_hdd_add_virtual_intf(struct wiphy *wiphy, char *name,
enum nl80211_iftype type,
u32 *flags,
struct vif_params *params);
#else
struct net_device *wlan_hdd_add_virtual_intf(struct wiphy *wiphy, char *name,
enum nl80211_iftype type,
u32 *flags,
struct vif_params *params);
#endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0))
int wlan_hdd_del_virtual_intf(struct wiphy *wiphy, struct wireless_dev *wdev);
#else
int wlan_hdd_del_virtual_intf(struct wiphy *wiphy, struct net_device *dev);
#endif
void wlan_hdd_cleanup_remain_on_channel_ctx(hdd_adapter_t *pAdapter);

Zobrazit soubor

@@ -155,14 +155,10 @@ void hdd_ipv6_notifier_work_queue(struct work_struct *work);
#endif
int wlan_hdd_cfg80211_get_txpower(struct wiphy *wiphy,
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)
struct wireless_dev *wdev,
#endif
int *dbm);
int wlan_hdd_cfg80211_set_txpower(struct wiphy *wiphy,
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)
struct wireless_dev *wdev,
#endif
enum nl80211_tx_power_setting type,
int dbm);
int wlan_hdd_cfg80211_set_power_mgmt(struct wiphy *wiphy,

Zobrazit soubor

@@ -101,9 +101,6 @@ typedef struct {
*/
typedef struct {
struct wiphy *wiphy;
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 6, 0))
struct net_device *dev;
#endif
struct cfg80211_scan_request *scan_request;
int magic;
int attempt;
@@ -486,15 +483,9 @@ hddTdlsPeer_t *wlan_hdd_tdls_is_progress(hdd_context_t *pHddCtx,
int wlan_hdd_tdls_copy_scan_context(hdd_context_t *pHddCtx,
struct wiphy *wiphy,
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 6, 0))
struct net_device *dev,
#endif
struct cfg80211_scan_request *request);
int wlan_hdd_tdls_scan_callback(hdd_adapter_t *pAdapter, struct wiphy *wiphy,
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 6, 0))
struct net_device *dev,
#endif
struct cfg80211_scan_request *request);
void wlan_hdd_tdls_scan_done_callback(hdd_adapter_t *pAdapter);

Zobrazit soubor

@@ -2073,9 +2073,7 @@ defined(FEATURE_WLAN_LFR)
}
if (!hddDisconInProgress) {
cfg80211_put_bss(
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0))
pHddCtx->wiphy,
#endif
bss);
/*
@@ -2426,9 +2424,7 @@ static void hdd_roam_ibss_indication_handler(hdd_adapter_t *pAdapter,
GFP_KERNEL);
#endif
cfg80211_put_bss(
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0))
pHddCtx->wiphy,
#endif
bss);
}
@@ -2589,9 +2585,7 @@ static CDF_STATUS roam_ibss_connect_handler(hdd_adapter_t *pAdapter,
return CDF_STATUS_E_FAILURE;
}
cfg80211_put_bss(
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0))
WLAN_HDD_GET_CTX(pAdapter)->wiphy,
#endif
bss);
return CDF_STATUS_SUCCESS;
@@ -4086,7 +4080,7 @@ defined(FEATURE_WLAN_LFR))
hdd_send_ft_event(pAdapter);
break;
#endif
#if defined(FEATURE_WLAN_LFR) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 4, 0))
#ifdef FEATURE_WLAN_LFR
case eCSR_ROAM_PMK_NOTIFY:
if (eCSR_AUTH_TYPE_RSN == pHddStaCtx->conn_info.authType ||
eCSR_AUTH_TYPE_RSN_8021X_SHA256 ==

Zobrazit soubor

@@ -363,7 +363,6 @@ static const struct ieee80211_txrx_stypes
},
};
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 4, 0))
/* Interface limits and combinations registered by the driver */
/* STA ( + STA ) combination */
@@ -577,7 +576,6 @@ static struct ieee80211_iface_combination
.beacon_int_infra_match = true,
},
};
#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 4, 0)) */
static struct cfg80211_ops wlan_hdd_cfg80211_ops;
@@ -1107,9 +1105,7 @@ static int __is_driver_dfs_capable(struct wiphy *wiphy,
return -EPERM;
}
#if (LINUX_VERSION_CODE > KERNEL_VERSION(3, 4, 0))
dfs_capability = !!(wiphy->flags & WIPHY_FLAG_DFS_OFFLOAD);
#endif
temp_skbuff = cfg80211_vendor_cmd_alloc_reply_skb(wiphy, sizeof(u32) +
NLMSG_HDRLEN);
@@ -5130,15 +5126,14 @@ int wlan_hdd_cfg80211_init(struct device *dev,
wiphy->mgmt_stypes = wlan_hdd_txrx_stypes;
/* This will disable updating of NL channels from passive to
* active if a beacon is received on passive channel. */
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0))
wiphy->regulatory_flags |= REGULATORY_DISABLE_BEACON_HINTS;
wiphy->regulatory_flags |= REGULATORY_COUNTRY_IE_IGNORE;
#else
wiphy->flags |= WIPHY_FLAG_DISABLE_BEACON_HINTS;
wiphy->country_ie_pref |= NL80211_COUNTRY_IE_IGNORE_CORE;
#endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 4, 0))
wiphy->flags |= WIPHY_FLAG_HAVE_AP_SME
| WIPHY_FLAG_AP_PROBE_RESP_OFFLOAD
| WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL
@@ -5147,13 +5142,6 @@ int wlan_hdd_cfg80211_init(struct device *dev,
#endif
| WIPHY_FLAG_OFFCHAN_TX;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0))
wiphy->regulatory_flags = REGULATORY_COUNTRY_IE_IGNORE;
#else
wiphy->country_ie_pref = NL80211_COUNTRY_IE_IGNORE_CORE;
#endif
#endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0))
wiphy->wowlan = &wowlan_support_cfg80211_init;
#else
@@ -5221,7 +5209,6 @@ int wlan_hdd_cfg80211_init(struct device *dev,
| BIT(NL80211_IFTYPE_AP);
if (pCfg->advertiseConcurrentOperation) {
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 4, 0))
if (pCfg->enableMCC) {
int i;
for (i = 0; i < ARRAY_SIZE(wlan_hdd_iface_combination);
@@ -5234,7 +5221,6 @@ int wlan_hdd_cfg80211_init(struct device *dev,
wiphy->n_iface_combinations =
ARRAY_SIZE(wlan_hdd_iface_combination);
wiphy->iface_combinations = wlan_hdd_iface_combination;
#endif
}
/* Before registering we need to update the ht capabilitied based
@@ -5309,11 +5295,9 @@ int wlan_hdd_cfg80211_init(struct device *dev,
ARRAY_SIZE(wlan_hdd_cfg80211_vendor_events);
}
#if (LINUX_VERSION_CODE > KERNEL_VERSION(3, 4, 0))
if (pCfg->enableDFSMasterCap) {
wiphy->flags |= WIPHY_FLAG_DFS_OFFLOAD;
}
#endif
wiphy->max_ap_assoc_sta = pCfg->maxNumberOfPeers;
@@ -7371,9 +7355,7 @@ int wlan_hdd_cfg80211_update_bss(struct wiphy *wiphy,
hdd_info("NULL returned by cfg80211_inform_bss_frame");
} else {
cfg80211_put_bss(
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0))
wiphy,
#endif
bss_status);
}
} else {
@@ -7400,7 +7382,7 @@ int wlan_hdd_cfg80211_update_bss(struct wiphy *wiphy,
return 0;
}
#if defined(FEATURE_WLAN_LFR) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 4, 0))
#ifdef FEATURE_WLAN_LFR
/**
* wlan_hdd_cfg80211_pmksa_candidate_notify() - notify a new PMSKA candidate
* @pAdapter: Pointer to adapter
@@ -9160,11 +9142,7 @@ static int __wlan_hdd_cfg80211_join_ibss(struct wiphy *wiphy,
return status;
if (NULL !=
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0))
params->chandef.chan)
#else
params->channel)
#endif
{
uint32_t numChans = WNI_CFG_VALID_CHANNEL_LIST_LEN;
uint8_t validChan[WNI_CFG_VALID_CHANNEL_LIST_LEN];
@@ -9173,16 +9151,10 @@ static int __wlan_hdd_cfg80211_join_ibss(struct wiphy *wiphy,
/* Get channel number */
channelNum = ieee80211_frequency_to_channel(
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0))
params->
chandef.
chan->
center_freq);
#else
params->
channel->
center_freq);
#endif
if (0 != sme_cfg_get_str(hHal, WNI_CFG_VALID_CHANNEL_LIST,
validChan, &numChans)) {
@@ -9604,7 +9576,6 @@ static int wlan_hdd_set_default_mgmt_key(struct wiphy *wiphy,
return ret;
}
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 4, 0))
/**
* __wlan_hdd_set_txq_params() - dummy implementation of set tx queue params
* @wiphy: Pointer to wiphy
@@ -9620,21 +9591,6 @@ static int __wlan_hdd_set_txq_params(struct wiphy *wiphy,
ENTER();
return 0;
}
#else
/**
* __wlan_hdd_set_txq_params() - dummy implementation of set tx queue params
* @wiphy: Pointer to wiphy
* @params: Pointer to tx queue parameters
*
* Return: 0
*/
static int __wlan_hdd_set_txq_params(struct wiphy *wiphy,
struct ieee80211_txq_params *params)
{
ENTER();
return 0;
}
#endif /* LINUX_VERSION_CODE */
/**
* wlan_hdd_set_txq_params() - SSR wrapper for wlan_hdd_set_txq_params
@@ -9644,7 +9600,6 @@ static int __wlan_hdd_set_txq_params(struct wiphy *wiphy,
*
* Return: 0 on success, error number on failure
*/
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 4, 0)) || defined(WITH_BACKPORTS)
static int wlan_hdd_set_txq_params(struct wiphy *wiphy,
struct net_device *dev,
struct ieee80211_txq_params *params)
@@ -9657,19 +9612,6 @@ static int wlan_hdd_set_txq_params(struct wiphy *wiphy,
return ret;
}
#else
static int wlan_hdd_set_txq_params(struct wiphy *wiphy,
struct ieee80211_txq_params *params)
{
int ret;
cds_ssr_protect(__func__);
ret = __wlan_hdd_set_txq_params(wiphy, params);
cds_ssr_unprotect(__func__);
return ret;
}
#endif /* LINUX_VERSION_CODE */
/**
* __wlan_hdd_cfg80211_del_station() - delete station v2
@@ -11114,15 +11056,9 @@ static struct cfg80211_ops wlan_hdd_cfg80211_ops = {
.del_virtual_intf = wlan_hdd_del_virtual_intf,
.change_virtual_intf = wlan_hdd_cfg80211_change_iface,
.change_station = wlan_hdd_change_station,
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 4, 0))
.add_beacon = wlan_hdd_cfg80211_add_beacon,
.del_beacon = wlan_hdd_cfg80211_del_beacon,
.set_beacon = wlan_hdd_cfg80211_set_beacon,
#else
.start_ap = wlan_hdd_cfg80211_start_ap,
.change_beacon = wlan_hdd_cfg80211_change_beacon,
.stop_ap = wlan_hdd_cfg80211_stop_ap,
#endif
.change_bss = wlan_hdd_cfg80211_change_bss,
.add_key = wlan_hdd_cfg80211_add_key,
.get_key = wlan_hdd_cfg80211_get_key,

Zobrazit soubor

@@ -2250,9 +2250,6 @@ void wlan_hdd_cfg80211_set_key_wapi(hdd_adapter_t *pAdapter, uint8_t key_index,
struct wiphy *wlan_hdd_cfg80211_wiphy_alloc(int priv_size);
int wlan_hdd_cfg80211_scan(struct wiphy *wiphy,
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 6, 0))
struct net_device *dev,
#endif
struct cfg80211_scan_request *request);
int wlan_hdd_cfg80211_init(struct device *dev,
@@ -2265,13 +2262,8 @@ void wlan_hdd_cfg80211_register_frames(hdd_adapter_t *pAdapter);
void wlan_hdd_cfg80211_deregister_frames(hdd_adapter_t *pAdapter);
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0))
void hdd_reg_notifier(struct wiphy *wiphy,
struct regulatory_request *request);
#else
int hdd_reg_notifier(struct wiphy *wiphy,
struct regulatory_request *request);
#endif
extern void hdd_conn_set_connection_state(hdd_adapter_t *pAdapter,
eConnectionState connState);

Zobrazit soubor

@@ -1309,9 +1309,7 @@ CDF_STATUS hdd_hostapd_sap_event_cb(tpSap_Event pSapEvent,
(const u8 *)&pSapEvent->sapevt.
sapStationAssocReassocCompleteEvent.ies[0];
staInfo.assoc_req_ies_len = iesLen;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 0, 31))
staInfo.filled |= STATION_INFO_ASSOC_REQ_IES;
#endif
cfg80211_new_sta(dev,
(const u8 *)&pSapEvent->sapevt.
sapStationAssocReassocCompleteEvent.
@@ -6384,10 +6382,6 @@ static int wlan_hdd_set_channel(struct wiphy *wiphy,
smeConfig.csrConfig.
channelBondingMode5GHz =
eCSR_INI_SINGLE_CHANNEL_CENTERED;
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 8, 0))
sap_config->ch_width_orig =
eHT_CHANNEL_WIDTH_20MHZ;
#endif
sap_config->sec_ch = 0;
break;
@@ -6637,19 +6631,6 @@ static void wlan_hdd_add_extra_ie(hdd_adapter_t *pHostapdAdapter,
return;
}
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 4, 0))
/**
* wlan_hdd_cfg80211_alloc_new_beacon() - alloc beacon in ap mode
* @pAdapter: Pointer to hostapd adapter
* @ppBeacon: Pointer to pointer to beacon data
* @params: Pointer to beacon parameters
*
* Return: 0 for success non-zero for failure
*/
int wlan_hdd_cfg80211_alloc_new_beacon(hdd_adapter_t *pAdapter,
beacon_data_t **ppBeacon,
struct beacon_parameters *params)
#else
/**
* wlan_hdd_cfg80211_alloc_new_beacon() - alloc beacon in ap mode
* @pAdapter: Pointer to hostapd adapter
@@ -6663,7 +6644,6 @@ int wlan_hdd_cfg80211_alloc_new_beacon(hdd_adapter_t *pAdapter,
beacon_data_t **ppBeacon,
struct cfg80211_beacon_data *params,
int dtim_period)
#endif
{
int size;
beacon_data_t *beacon = NULL;
@@ -6727,17 +6707,10 @@ int wlan_hdd_cfg80211_alloc_new_beacon(hdd_adapter_t *pAdapter,
FL("Mem allocation for beacon failed"));
return -ENOMEM;
}
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 4, 0))
if (params->dtim_period)
beacon->dtim_period = params->dtim_period;
else if (old)
beacon->dtim_period = old->dtim_period;
#else
if (dtim_period)
beacon->dtim_period = dtim_period;
else if (old)
beacon->dtim_period = old->dtim_period;
#endif
/* -----------------------------------------------
* | head | tail | proberesp_ies | assocresp_ies |
* -----------------------------------------------
@@ -7223,17 +7196,6 @@ setup_acs_overrides:
return 0;
}
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 4, 0))
/**
* wlan_hdd_cfg80211_start_bss() - start bss
* @pHostapdAdapter: Pointer to hostapd adapter
* @params: Pointer to start bss beacon parameters
*
* Return: 0 for success non-zero for failure
*/
static int wlan_hdd_cfg80211_start_bss(hdd_adapter_t *pHostapdAdapter,
struct beacon_parameters *params)
#else
/**
* wlan_hdd_cfg80211_start_bss() - start bss
* @pHostapdAdapter: Pointer to hostapd adapter
@@ -7248,7 +7210,6 @@ static int wlan_hdd_cfg80211_start_bss(hdd_adapter_t *pHostapdAdapter,
struct cfg80211_beacon_data *params,
const u8 *ssid, size_t ssid_len,
enum nl80211_hidden_ssid hidden_ssid)
#endif
{
tsap_Config_t *pConfig;
beacon_data_t *pBeacon = NULL;
@@ -7507,33 +7468,6 @@ static int wlan_hdd_cfg80211_start_bss(hdd_adapter_t *pHostapdAdapter,
pConfig->SSIDinfo.ssidHidden = false;
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 4, 0))
if (params->ssid != NULL) {
cdf_mem_copy(pConfig->SSIDinfo.ssid.ssId, params->ssid,
params->ssid_len);
pConfig->SSIDinfo.ssid.length = params->ssid_len;
switch (params->hidden_ssid) {
case NL80211_HIDDEN_SSID_NOT_IN_USE:
hddLog(LOG1, "HIDDEN_SSID_NOT_IN_USE");
pConfig->SSIDinfo.ssidHidden = eHIDDEN_SSID_NOT_IN_USE;
break;
case NL80211_HIDDEN_SSID_ZERO_LEN:
hddLog(LOG1, "HIDDEN_SSID_ZERO_LEN");
pConfig->SSIDinfo.ssidHidden = eHIDDEN_SSID_ZERO_LEN;
break;
case NL80211_HIDDEN_SSID_ZERO_CONTENTS:
hddLog(LOG1, "HIDDEN_SSID_ZERO_CONTENTS");
pConfig->SSIDinfo.ssidHidden =
eHIDDEN_SSID_ZERO_CONTENTS;
break;
default:
hddLog(LOGE, "Wrong hidden_ssid param %d",
params->hidden_ssid);
break;
}
}
#else
if (ssid != NULL) {
cdf_mem_copy(pConfig->SSIDinfo.ssid.ssId, ssid, ssid_len);
pConfig->SSIDinfo.ssid.length = ssid_len;
@@ -7557,7 +7491,6 @@ static int wlan_hdd_cfg80211_start_bss(hdd_adapter_t *pHostapdAdapter,
break;
}
}
#endif
cdf_mem_copy(pConfig->self_macaddr.bytes,
pHostapdAdapter->macAddressCurrent.bytes,
@@ -7653,16 +7586,6 @@ static int wlan_hdd_cfg80211_start_bss(hdd_adapter_t *pHostapdAdapter,
sme_config.csrConfig.WMMSupportMode = eCsrRoamWmmNoQos;
sme_update_config(pHddCtx->hHal, &sme_config);
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 8, 0))
/* Linux kernel < 3.8 does not support ch width param. So for
* 11AC get from ch width from ini file only if ht40 is enabled
* VHT80 depends on HT40 config.
*/
if (pConfig->SapHw_mode == eCSR_DOT11_MODE_11ac)
if (pConfig->ch_width_orig == NL80211_CHAN_WIDTH_40)
pConfig->ch_width_orig = iniConfig->vhtChannelWidth;
#endif
if (pConfig->ch_width_orig == NL80211_CHAN_WIDTH_80P80) {
if (pHddCtx->isVHT80Allowed == false)
pConfig->ch_width_orig = CH_WIDTH_40MHZ;
@@ -7827,209 +7750,6 @@ static int wlan_hdd_cfg80211_start_bss(hdd_adapter_t *pHostapdAdapter,
return 0;
}
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 4, 0))
/**
* __wlan_hdd_cfg80211_add_beacon() - add beacon in soft ap mode
* @wiphy: Pointer to wiphy structure
* @dev: Pointer to net_device structure
* @params: Pointer to add beacon parameters
*
* Return: 0 for success non-zero for failure
*/
static int __wlan_hdd_cfg80211_add_beacon(struct wiphy *wiphy,
struct net_device *dev,
struct beacon_parameters *params)
{
hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
hdd_context_t *pHddCtx;
int status;
ENTER();
if (CDF_FTM_MODE == hdd_get_conparam()) {
hddLog(LOGE, FL("Command not allowed in FTM mode"));
return -EINVAL;
}
MTRACE(cdf_trace(CDF_MODULE_ID_HDD,
TRACE_CODE_HDD_CFG80211_ADD_BEACON,
pAdapter->sessionId, params->interval));
hddLog(LOG2, FL("Device mode %s(%d)"),
hdd_device_mode_to_string(pAdapter->device_mode),
pAdapter->device_mode);
pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
status = wlan_hdd_validate_context(pHddCtx);
if (0 != status)
return status;
if (!cds_allow_concurrency(pHddCtx,
cds_convert_device_mode_to_hdd_type(
pAdapter->device_mode), 0, HDD_20_MHZ)) {
hddLog(LOGE,
FL("This concurrency combination is not allowed"));
return -EINVAL;
}
if ((pAdapter->device_mode == WLAN_HDD_SOFTAP) ||
(pAdapter->device_mode == WLAN_HDD_P2P_GO)) {
beacon_data_t *old, *new;
old = pAdapter->sessionCtx.ap.beacon;
if (old) {
hddLog(LOGW,
FL("already beacon info added to session(%d)"),
pAdapter->sessionId);
return -EALREADY;
}
status =
wlan_hdd_cfg80211_alloc_new_beacon(pAdapter,
&new, params);
if (status != CDF_STATUS_SUCCESS) {
hddLog(LOGE,
FL("Error!!! Allocating the new beacon"));
return -EINVAL;
}
pAdapter->sessionCtx.ap.beacon = new;
status = wlan_hdd_cfg80211_start_bss(pAdapter, params);
if (0 != status) {
pAdapter->sessionCtx.ap.beacon = NULL;
kfree(new);
}
}
EXIT();
return status;
}
/**
* wlan_hdd_cfg80211_add_beacon() - add beacon in sap mode
* @wiphy: Pointer to wiphy
* @dev: Pointer to netdev
* @param: Pointer to beacon parameters
*
* Return: zero for success non-zero for failure
*/
int wlan_hdd_cfg80211_add_beacon(struct wiphy *wiphy,
struct net_device *dev,
struct beacon_parameters *params)
{
int ret;
cds_ssr_protect(__func__);
ret = __wlan_hdd_cfg80211_add_beacon(wiphy, dev, params);
cds_ssr_unprotect(__func__);
return ret;
}
/**
* __wlan_hdd_cfg80211_set_beacon() - set beacon in soft ap mode
* @wiphy: Pointer to wiphy structure
* @dev: Pointer to net_device structure
* @params: Pointer to set beacon parameters
*
* Return: 0 for success non-zero for failure
*/
static int __wlan_hdd_cfg80211_set_beacon(struct wiphy *wiphy,
struct net_device *dev,
struct beacon_parameters *params)
{
hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
hdd_context_t *pHddCtx;
int status;
ENTER();
if (CDF_FTM_MODE == hdd_get_conparam()) {
hddLog(LOGE, FL("Command not allowed in FTM mode"));
return -EINVAL;
}
MTRACE(cdf_trace(CDF_MODULE_ID_HDD,
TRACE_CODE_HDD_CFG80211_SET_BEACON,
pAdapter->sessionId, pHddStaCtx->conn_info.authType));
hddLog(LOG1, FL("Device_mode %s(%d)"),
hdd_device_mode_to_string(pAdapter->device_mode),
pAdapter->device_mode);
pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
status = wlan_hdd_validate_context(pHddCtx);
if (0 != status)
return status;
if ((pAdapter->device_mode == WLAN_HDD_SOFTAP) ||
(pAdapter->device_mode == WLAN_HDD_P2P_GO)) {
beacon_data_t *old, *new;
old = pAdapter->sessionCtx.ap.beacon;
if (!old) {
hddLog(LOGE,
FL("session(%d) old and new heads points to NULL"),
pAdapter->sessionId);
return -ENOENT;
}
status =
wlan_hdd_cfg80211_alloc_new_beacon(pAdapter,
&new, params);
if (status != CDF_STATUS_SUCCESS) {
hddLog(LOGE,
FL("Error!!! Allocating the new beacon"));
return -EINVAL;
}
pAdapter->sessionCtx.ap.beacon = new;
status = wlan_hdd_cfg80211_start_bss(pAdapter, params);
}
EXIT();
return status;
}
/**
* wlan_hdd_cfg80211_set_beacon() - set beacon in sap mode
* @wiphy: Pointer to wiphy
* @dev: Pointer to netdev
* @param: Pointer to beacon parameters
*
* Return: zero for success non-zero for failure
*/
int wlan_hdd_cfg80211_set_beacon(struct wiphy *wiphy,
struct net_device *dev,
struct beacon_parameters *params)
{
int ret;
cds_ssr_protect(__func__);
ret = __wlan_hdd_cfg80211_set_beacon(wiphy, dev, params);
cds_ssr_unprotect(__func__);
return ret;
}
#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3, 4, 0)) */
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 4, 0))
/**
* __wlan_hdd_cfg80211_del_beacon() - stop soft ap
* @wiphy: Pointer to wiphy structure
* @dev: Pointer to net_device structure
*
* Return: 0 for success non-zero for failure
*/
static int __wlan_hdd_cfg80211_del_beacon(struct wiphy *wiphy,
struct net_device *dev)
#else
/**
* __wlan_hdd_cfg80211_stop_ap() - stop soft ap
* @wiphy: Pointer to wiphy structure
@@ -8039,7 +7759,6 @@ static int __wlan_hdd_cfg80211_del_beacon(struct wiphy *wiphy,
*/
static int __wlan_hdd_cfg80211_stop_ap(struct wiphy *wiphy,
struct net_device *dev)
#endif
{
hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
hdd_context_t *pHddCtx = NULL;
@@ -8209,7 +7928,6 @@ static int __wlan_hdd_cfg80211_stop_ap(struct wiphy *wiphy,
return ret;
}
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0))
/**
* wlan_hdd_get_channel_bw() - get channel bandwidth
* @width: input channel width in nl80211_chan_width value
@@ -8245,28 +7963,7 @@ static enum hw_mode_bandwidth wlan_hdd_get_channel_bw(
return ch_bw;
}
#endif
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 4, 0)) && !defined(WITH_BACKPORTS)
/**
* wlan_hdd_cfg80211_del_beacon() - delete beacon in sap mode
* @wiphy: Pointer to wiphy
* @dev: Pointer to netdev
*
* Return: zero for success non-zero for failure
*/
int wlan_hdd_cfg80211_del_beacon(struct wiphy *wiphy,
struct net_device *dev)
{
int ret;
cds_ssr_protect(__func__);
ret = __wlan_hdd_cfg80211_del_beacon(wiphy, dev);
cds_ssr_unprotect(__func__);
return ret;
}
#else
/**
* wlan_hdd_cfg80211_stop_ap() - stop sap
* @wiphy: Pointer to wiphy
@@ -8285,9 +7982,7 @@ int wlan_hdd_cfg80211_stop_ap(struct wiphy *wiphy,
return ret;
}
#endif
#if (LINUX_VERSION_CODE > KERNEL_VERSION(3, 3, 0))
/**
* __wlan_hdd_cfg80211_start_ap() - start soft ap mode
* @wiphy: Pointer to wiphy structure
@@ -8331,14 +8026,10 @@ static int __wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy,
hdd_device_mode_to_string(pAdapter->device_mode),
pAdapter->device_mode);
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0))
channel_width = wlan_hdd_get_channel_bw(params->chandef.width);
channel = ieee80211_frequency_to_channel(
params->chandef.chan->center_freq);
#else
channel_width = HW_MODE_20_MHZ;
channel = 0;
#endif
/* check if concurrency is allowed */
if (!cds_allow_concurrency(pHddCtx,
cds_convert_device_mode_to_hdd_type(
@@ -8374,9 +8065,7 @@ static int __wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy,
|| (pAdapter->device_mode == WLAN_HDD_P2P_GO)
) {
beacon_data_t *old, *new;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0))
enum nl80211_channel_type channel_type;
#endif
old = pAdapter->sessionCtx.ap.beacon;
@@ -8419,10 +8108,8 @@ static int __wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy,
pAdapter->sessionCtx.ap.sapConfig.authType =
eSAP_AUTO_SWITCH;
}
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0))
pAdapter->sessionCtx.ap.sapConfig.ch_width_orig =
params->chandef.width;
#endif
status =
wlan_hdd_cfg80211_start_bss(pAdapter,
&params->beacon,
@@ -8539,5 +8226,3 @@ int wlan_hdd_cfg80211_change_beacon(struct wiphy *wiphy,
return ret;
}
#endif /* (LINUX_VERSION_CODE > KERNEL_VERSION(3, 3, 0)) */

Zobrazit soubor

@@ -99,29 +99,13 @@ CDF_STATUS hdd_set_sap_ht2040_mode(hdd_adapter_t *pHostapdAdapter,
uint8_t channel_type);
#endif
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 4, 0))
int wlan_hdd_cfg80211_add_beacon(struct wiphy *wiphy,
struct net_device *dev,
struct beacon_parameters *params);
int wlan_hdd_cfg80211_set_beacon(struct wiphy *wiphy,
struct net_device *dev,
struct beacon_parameters *params);
#endif
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 4, 0))
int wlan_hdd_cfg80211_del_beacon(struct wiphy *wiphy,
struct net_device *dev);
#else
int wlan_hdd_cfg80211_stop_ap(struct wiphy *wiphy,
struct net_device *dev);
#endif
#if (LINUX_VERSION_CODE > KERNEL_VERSION(3, 3, 0))
int wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy,
struct net_device *dev,
struct cfg80211_ap_settings *params);
#endif
int wlan_hdd_cfg80211_change_beacon(struct wiphy *wiphy,
struct net_device *dev,

Zobrazit soubor

@@ -836,15 +836,9 @@ hdd_sendactionframe(hdd_adapter_t *adapter, const uint8_t *bssid,
ret = wlan_hdd_mgmt_tx(NULL, &adapter->wdev, &params, &cookie);
#else
ret = wlan_hdd_mgmt_tx(NULL,
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0))
&(adapter->wdev),
#else
adapter->dev,
#endif
&chan, 0,
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 8, 0))
NL80211_CHAN_HT20, 1,
#endif
dwell_time, frame, frame_len, 1, 1, &cookie);
#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0) */

Zobrazit soubor

@@ -1731,11 +1731,7 @@ static struct net_device_ops wlan_drv_ops = {
.ndo_set_mac_address = hdd_set_mac_address,
.ndo_select_queue = hdd_select_queue,
#ifdef WLAN_FEATURE_PACKET_FILTERING
#if (LINUX_VERSION_CODE > KERNEL_VERSION(3, 1, 0))
.ndo_set_rx_mode = hdd_set_multicast_list,
#else
.ndo_set_multicast_list = hdd_set_multicast_list,
#endif /* LINUX_VERSION_CODE */
#endif
};
@@ -2254,10 +2250,8 @@ hdd_adapter_t *hdd_open_adapter(hdd_context_t *hdd_ctx, uint8_t session_type,
if (WLAN_HDD_P2P_CLIENT == session_type)
adapter->wdev.iftype = NL80211_IFTYPE_P2P_CLIENT;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 7, 0))
else if (WLAN_HDD_P2P_DEVICE == session_type)
adapter->wdev.iftype = NL80211_IFTYPE_P2P_DEVICE;
#endif
else
adapter->wdev.iftype = NL80211_IFTYPE_STATION;

Zobrazit soubor

@@ -368,7 +368,6 @@ static struct proc_dir_entry *proc_file, *proc_dir;
*
* Return: void pointer to hdd_context
*/
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0)) || defined(WITH_BACKPORTS)
static void *memdump_get_file_data(struct file *file)
{
void *hdd_ctx;
@@ -376,15 +375,6 @@ static void *memdump_get_file_data(struct file *file)
hdd_ctx = PDE_DATA(file_inode(file));
return hdd_ctx;
}
#else
static void *memdump_get_file_data(struct file *file)
{
void *hdd_ctx;
hdd_ctx = PDE(file->f_path.dentry->d_inode)->data;
return hdd_ctx;
}
#endif
/**
* memdump_read() - perform read operation in memory dump proc file

Zobrazit soubor

@@ -211,19 +211,11 @@ CDF_STATUS wlan_hdd_remain_on_channel_callback(tHalHandle hHal, void *pCtx,
__func__);
}
cfg80211_remain_on_channel_expired(
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0))
pRemainChanCtx->dev->
ieee80211_ptr,
#else
pRemainChanCtx->dev,
#endif
pRemainChanCtx->
cookie,
&pRemainChanCtx->chan,
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 8, 0))
pRemainChanCtx->
chan_type,
#endif
GFP_KERNEL);
pAdapter->last_roc_ts = cdf_mc_timer_get_system_time();
}
@@ -827,10 +819,6 @@ void wlan_hdd_roc_request_dequeue(struct work_struct *work)
static int wlan_hdd_request_remain_on_channel(struct wiphy *wiphy,
struct net_device *dev,
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,
rem_on_channel_request_type_t
@@ -850,15 +838,9 @@ static int wlan_hdd_request_remain_on_channel(struct wiphy *wiphy,
hddLog(LOG1, FL("Device_mode %s(%d)"),
hdd_device_mode_to_string(pAdapter->device_mode),
pAdapter->device_mode);
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 8, 0))
hddLog(LOG1,
"chan(hw_val)0x%x chan(centerfreq) %d chan type 0x%x, duration %d",
chan->hw_value, chan->center_freq, channel_type, duration);
#else
hddLog(LOG1,
"chan(hw_val)0x%x chan(centerfreq) %d, duration %d",
chan->hw_value, chan->center_freq, duration);
#endif
pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
ret = wlan_hdd_validate_context(pHddCtx);
if (0 != ret)
@@ -879,9 +861,6 @@ static int wlan_hdd_request_remain_on_channel(struct wiphy *wiphy,
cdf_mem_zero(pRemainChanCtx, sizeof(*pRemainChanCtx));
cdf_mem_copy(&pRemainChanCtx->chan, chan,
sizeof(struct ieee80211_channel));
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 8, 0))
pRemainChanCtx->chan_type = channel_type;
#endif
pRemainChanCtx->duration = duration;
pRemainChanCtx->dev = dev;
*cookie = (uintptr_t) pRemainChanCtx;
@@ -955,21 +934,11 @@ static int wlan_hdd_request_remain_on_channel(struct wiphy *wiphy,
}
int __wlan_hdd_cfg80211_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)
{
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0))
struct net_device *dev = wdev->netdev;
#endif
hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
hdd_context_t *hdd_ctx;
int ret;
@@ -989,10 +958,8 @@ int __wlan_hdd_cfg80211_remain_on_channel(struct wiphy *wiphy,
MTRACE(cdf_trace(CDF_MODULE_ID_HDD,
TRACE_CODE_HDD_REMAIN_ON_CHANNEL,
pAdapter->sessionId, REMAIN_ON_CHANNEL_REQUEST));
ret = wlan_hdd_request_remain_on_channel(wiphy, dev, chan,
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 8, 0))
channel_type,
#endif
duration, cookie,
REMAIN_ON_CHANNEL_REQUEST);
EXIT();
@@ -1000,30 +967,16 @@ int __wlan_hdd_cfg80211_remain_on_channel(struct wiphy *wiphy,
}
int wlan_hdd_cfg80211_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)
{
int ret;
cds_ssr_protect(__func__);
ret = __wlan_hdd_cfg80211_remain_on_channel(wiphy,
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0))
wdev,
#else
dev,
#endif
chan,
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 8, 0))
channel_type,
#endif
duration, cookie);
cds_ssr_unprotect(__func__);
@@ -1073,19 +1026,11 @@ void hdd_remain_chan_ready_handler(hdd_adapter_t *pAdapter,
if (REMAIN_ON_CHANNEL_REQUEST ==
pRemainChanCtx->rem_on_chan_request) {
cfg80211_ready_on_channel(
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0))
pAdapter->dev->
ieee80211_ptr,
#else
pAdapter->dev,
#endif
(uintptr_t)
pRemainChanCtx,
&pRemainChanCtx->chan,
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 8, 0))
pRemainChanCtx->
chan_type,
#endif
pRemainChanCtx->
duration, GFP_KERNEL);
} else if (OFF_CHANNEL_ACTION_TX ==
@@ -1109,7 +1054,7 @@ void hdd_remain_chan_ready_handler(hdd_adapter_t *pAdapter,
pRemainChanCtx->action_pkt_buff.frame_ptr,
pRemainChanCtx->action_pkt_buff.frame_length,
NL80211_RXMGMT_FLAG_ANSWERED, GFP_ATOMIC);
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0))
#else
cfg80211_rx_mgmt(pAdapter->dev->ieee80211_ptr,
pRemainChanCtx->action_pkt_buff.freq,
0,
@@ -1117,21 +1062,6 @@ void hdd_remain_chan_ready_handler(hdd_adapter_t *pAdapter,
frame_ptr,
pRemainChanCtx->action_pkt_buff.
frame_length, GFP_ATOMIC);
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 4, 0))
cfg80211_rx_mgmt(pAdapter->dev,
pRemainChanCtx->action_pkt_buff.freq,
0,
pRemainChanCtx->action_pkt_buff.
frame_ptr,
pRemainChanCtx->action_pkt_buff.
frame_length, GFP_ATOMIC);
#else
cfg80211_rx_mgmt(pAdapter->dev,
pRemainChanCtx->action_pkt_buff.freq,
pRemainChanCtx->action_pkt_buff.
frame_ptr,
pRemainChanCtx->action_pkt_buff.
frame_length, GFP_ATOMIC);
#endif /* LINUX_VERSION_CODE */
cdf_mem_free(pRemainChanCtx->action_pkt_buff.frame_ptr);
@@ -1149,16 +1079,10 @@ void hdd_remain_chan_ready_handler(hdd_adapter_t *pAdapter,
}
int __wlan_hdd_cfg80211_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)
{
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0))
struct net_device *dev = wdev->netdev;
#endif
hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
hdd_cfg80211_state_t *cfgState = WLAN_HDD_GET_CFG_STATE_PTR(pAdapter);
hdd_remain_on_chan_ctx_t *pRemainChanCtx;
@@ -1294,56 +1218,27 @@ int __wlan_hdd_cfg80211_cancel_remain_on_channel(struct wiphy *wiphy,
}
int wlan_hdd_cfg80211_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)
{
int ret;
cds_ssr_protect(__func__);
ret = __wlan_hdd_cfg80211_cancel_remain_on_channel(wiphy,
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0))
wdev,
#else
dev,
#endif
cookie);
cds_ssr_unprotect(__func__);
return ret;
}
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0))
int __wlan_hdd_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
struct ieee80211_channel *chan, bool offchan,
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 8, 0))
enum nl80211_channel_type channel_type,
bool channel_type_valid,
#endif
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))
int __wlan_hdd_mgmt_tx(struct wiphy *wiphy, 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)
#else
int __wlan_hdd_mgmt_tx(struct wiphy *wiphy, 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 /* LINUX_VERSION_CODE */
{
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0))
struct net_device *dev = wdev->netdev;
#endif
hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
hdd_cfg80211_state_t *cfgState = WLAN_HDD_GET_CFG_STATE_PTR(pAdapter);
hdd_remain_on_chan_ctx_t *pRemainChanCtx;
@@ -1413,9 +1308,7 @@ int __wlan_hdd_mgmt_tx(struct wiphy *wiphy, struct net_device *dev,
}
#endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 3, 0))
noack = dont_wait_for_ack;
#endif
/* If the wait is coming as 0 with off channel set */
/* then set the wait to 200 ms */
@@ -1582,9 +1475,6 @@ int __wlan_hdd_mgmt_tx(struct wiphy *wiphy, struct net_device *dev,
INIT_COMPLETION(pAdapter->offchannel_tx_event);
status = wlan_hdd_request_remain_on_channel(wiphy, dev, chan,
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 8, 0))
channel_type,
#endif
wait, cookie,
req_type);
if (0 != status) {
@@ -1713,11 +1603,7 @@ err:
err_rem_channel:
*cookie = (uintptr_t) cfgState;
cfg80211_mgmt_tx_status(
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0))
pAdapter->dev->ieee80211_ptr,
#else
pAdapter->dev,
#endif
*cookie, buf, len, false, GFP_KERNEL);
EXIT();
return 0;
@@ -1726,29 +1612,12 @@ err_rem_channel:
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0))
int wlan_hdd_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
struct cfg80211_mgmt_tx_params *params, u64 *cookie)
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0))
#else
int wlan_hdd_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
struct ieee80211_channel *chan, bool offchan,
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 8, 0))
enum nl80211_channel_type channel_type,
bool channel_type_valid,
#endif
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))
int wlan_hdd_mgmt_tx(struct wiphy *wiphy, 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)
#else
int wlan_hdd_mgmt_tx(struct wiphy *wiphy, 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 /* LINUX_VERSION_CODE */
{
int ret;
@@ -1760,43 +1629,23 @@ int wlan_hdd_mgmt_tx(struct wiphy *wiphy, struct net_device *dev,
params->wait, params->buf, params->len,
params->no_cck, params->dont_wait_for_ack,
cookie);
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0))
#else
ret = __wlan_hdd_mgmt_tx(wiphy, wdev, chan, offchan,
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 8, 0))
channel_type, channel_type_valid,
#endif
wait, buf, len, no_cck,
dont_wait_for_ack, cookie);
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 3, 0))
ret = __wlan_hdd_mgmt_tx(wiphy, dev, chan, offchan,
channel_type, channel_type_valid, wait,
buf, len, no_cck, dont_wait_for_ack, cookie);
#else
ret = __wlan_hdd_mgmt_tx(wiphy, dev, chan, offchan,
channel_type, channel_type_valid, wait,
buf, len, cookie);
#endif /* LINUX_VERSION_CODE */
cds_ssr_unprotect(__func__);
return ret;
}
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0))
int __wlan_hdd_cfg80211_mgmt_tx_cancel_wait(struct wiphy *wiphy,
struct wireless_dev *wdev,
u64 cookie)
{
return wlan_hdd_cfg80211_cancel_remain_on_channel(wiphy, wdev, cookie);
}
#else
int __wlan_hdd_cfg80211_mgmt_tx_cancel_wait(struct wiphy *wiphy,
struct net_device *dev, u64 cookie)
{
return wlan_hdd_cfg80211_cancel_remain_on_channel(wiphy, dev, cookie);
}
#endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0))
int wlan_hdd_cfg80211_mgmt_tx_cancel_wait(struct wiphy *wiphy,
struct wireless_dev *wdev, u64 cookie)
{
@@ -1808,19 +1657,6 @@ int wlan_hdd_cfg80211_mgmt_tx_cancel_wait(struct wiphy *wiphy,
return ret;
}
#else
int wlan_hdd_cfg80211_mgmt_tx_cancel_wait(struct wiphy *wiphy,
struct net_device *dev, u64 cookie)
{
int ret;
cds_ssr_protect(__func__);
ret = __wlan_hdd_cfg80211_mgmt_tx_cancel_wait(wiphy, dev, cookie);
cds_ssr_unprotect(__func__);
return ret;
}
#endif
void hdd_send_action_cnf(hdd_adapter_t *pAdapter, bool actionSendSuccess)
{
@@ -1842,11 +1678,7 @@ void hdd_send_action_cnf(hdd_adapter_t *pAdapter, bool actionSendSuccess)
* data while sending tx ack status.
* */
cfg80211_mgmt_tx_status(
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0))
pAdapter->dev->ieee80211_ptr,
#else
pAdapter->dev,
#endif
cfgState->action_cookie,
cfgState->buf, cfgState->len,
actionSendSuccess, GFP_KERNEL);
@@ -2104,24 +1936,11 @@ static uint8_t wlan_hdd_get_session_type(enum nl80211_iftype type)
return sessionType;
}
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 7, 0))
struct wireless_dev *__wlan_hdd_add_virtual_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))
struct wireless_dev *__wlan_hdd_add_virtual_intf(struct wiphy *wiphy,
char *name,
enum nl80211_iftype type,
u32 *flags,
struct vif_params *params)
#else
struct net_device *__wlan_hdd_add_virtual_intf(struct wiphy *wiphy, char *name,
enum nl80211_iftype type,
u32 *flags,
struct vif_params *params)
#endif
{
hdd_context_t *pHddCtx = (hdd_context_t *) wiphy_priv(wiphy);
hdd_adapter_t *pAdapter = NULL;
@@ -2202,14 +2021,9 @@ struct net_device *__wlan_hdd_add_virtual_intf(struct wiphy *wiphy, char *name,
return ERR_PTR(-ENOSPC);
}
EXIT();
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0))
return pAdapter->dev->ieee80211_ptr;
#else
return pAdapter->dev;
#endif
}
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 7, 0))
struct wireless_dev *wlan_hdd_add_virtual_intf(struct wiphy *wiphy,
const char *name,
enum nl80211_iftype type,
@@ -2223,43 +2037,10 @@ struct wireless_dev *wlan_hdd_add_virtual_intf(struct wiphy *wiphy,
cds_ssr_unprotect(__func__);
return wdev;
}
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0))
struct wireless_dev *wlan_hdd_add_virtual_intf(struct wiphy *wiphy, char *name,
enum nl80211_iftype type,
u32 *flags,
struct vif_params *params)
{
struct wireless_dev *wdev;
cds_ssr_protect(__func__);
wdev = __wlan_hdd_add_virtual_intf(wiphy, name, type, flags, params);
cds_ssr_unprotect(__func__);
return wdev;
}
#else
struct net_device *wlan_hdd_add_virtual_intf(struct wiphy *wiphy, char *name,
enum nl80211_iftype type,
u32 *flags,
struct vif_params *params)
{
struct net_device *ndev;
cds_ssr_protect(__func__);
ndev = __wlan_hdd_add_virtual_intf(wiphy, name, type, flags, params);
cds_ssr_unprotect(__func__);
return ndev;
}
#endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0))
int __wlan_hdd_del_virtual_intf(struct wiphy *wiphy, struct wireless_dev *wdev)
#else
int __wlan_hdd_del_virtual_intf(struct wiphy *wiphy, struct net_device *dev)
#endif
{
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0))
struct net_device *dev = wdev->netdev;
#endif
hdd_context_t *pHddCtx = (hdd_context_t *) wiphy_priv(wiphy);
hdd_adapter_t *pVirtAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
int status;
@@ -2291,20 +2072,12 @@ int __wlan_hdd_del_virtual_intf(struct wiphy *wiphy, struct net_device *dev)
return 0;
}
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0))
int wlan_hdd_del_virtual_intf(struct wiphy *wiphy, struct wireless_dev *wdev)
#else
int wlan_hdd_del_virtual_intf(struct wiphy *wiphy, struct net_device *dev)
#endif
{
int ret;
cds_ssr_protect(__func__);
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0))
ret = __wlan_hdd_del_virtual_intf(wiphy, wdev);
#else
ret = __wlan_hdd_del_virtual_intf(wiphy, dev);
#endif
cds_ssr_unprotect(__func__);
return ret;
@@ -2614,14 +2387,8 @@ void hdd_indicate_mgmt_frame(hdd_adapter_t *pAdapter,
cfg80211_rx_mgmt(pAdapter->dev->ieee80211_ptr, freq, 0, pbFrames,
nFrameLength, NL80211_RXMGMT_FLAG_ANSWERED,
GFP_ATOMIC);
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0))
cfg80211_rx_mgmt(pAdapter->dev->ieee80211_ptr, freq, 0,
pbFrames, nFrameLength, GFP_ATOMIC);
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 4, 0))
cfg80211_rx_mgmt(pAdapter->dev, freq, 0,
pbFrames, nFrameLength, GFP_ATOMIC);
#else
cfg80211_rx_mgmt(pAdapter->dev, freq,
cfg80211_rx_mgmt(pAdapter->dev->ieee80211_ptr, freq, 0,
pbFrames, nFrameLength, GFP_ATOMIC);
#endif /* LINUX_VERSION_CODE */
}

Zobrazit soubor

@@ -2176,9 +2176,7 @@ int wlan_hdd_cfg80211_set_power_mgmt(struct wiphy *wiphy,
* Return: 0 for success, non-zero for failure
*/
static int __wlan_hdd_cfg80211_set_txpower(struct wiphy *wiphy,
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)
struct wireless_dev *wdev,
#endif
enum nl80211_tx_power_setting type,
int dbm)
{
@@ -2249,18 +2247,14 @@ static int __wlan_hdd_cfg80211_set_txpower(struct wiphy *wiphy,
* Return: 0 for success, non-zero for failure
*/
int wlan_hdd_cfg80211_set_txpower(struct wiphy *wiphy,
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)
struct wireless_dev *wdev,
#endif
enum nl80211_tx_power_setting type,
int dbm)
{
int ret;
cds_ssr_protect(__func__);
ret = __wlan_hdd_cfg80211_set_txpower(wiphy,
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)
wdev,
#endif
type, dbm);
cds_ssr_unprotect(__func__);
@@ -2276,9 +2270,7 @@ int wlan_hdd_cfg80211_set_txpower(struct wiphy *wiphy,
* Return: 0 for success, non-zero for failure
*/
static int __wlan_hdd_cfg80211_get_txpower(struct wiphy *wiphy,
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)
struct wireless_dev *wdev,
#endif
int *dbm)
{
@@ -2328,18 +2320,14 @@ static int __wlan_hdd_cfg80211_get_txpower(struct wiphy *wiphy,
* Return: 0 for success, error number on failure.
*/
int wlan_hdd_cfg80211_get_txpower(struct wiphy *wiphy,
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0) || defined(WITH_BACKPORTS)
struct wireless_dev *wdev,
#endif
int *dbm)
{
int ret;
cds_ssr_protect(__func__);
ret = __wlan_hdd_cfg80211_get_txpower(wiphy,
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0) || defined(WITH_BACKPORTS)
wdev,
#endif
dbm);
cds_ssr_unprotect(__func__);

Zobrazit soubor

@@ -1223,15 +1223,10 @@ static void wlan_hdd_cfg80211_scan_block_cb(struct work_struct *work)
* Return: 0 for success, non zero for failure
*/
static int __wlan_hdd_cfg80211_scan(struct wiphy *wiphy,
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 6, 0))
struct net_device *dev,
#endif
struct cfg80211_scan_request *request,
uint8_t source)
{
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0))
struct net_device *dev = request->wdev->netdev;
#endif
hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
hdd_wext_state_t *pwextBuf = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter);
@@ -1328,9 +1323,6 @@ static int __wlan_hdd_cfg80211_scan(struct wiphy *wiphy,
* (return -EBUSY)
*/
status = wlan_hdd_tdls_scan_callback(pAdapter, wiphy,
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 6, 0))
dev,
#endif
request);
if (status <= 0) {
if (!status)
@@ -1598,17 +1590,11 @@ free_mem:
* Return: 0 for success, non zero for failure
*/
int wlan_hdd_cfg80211_scan(struct wiphy *wiphy,
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 6, 0))
struct net_device *dev,
#endif
struct cfg80211_scan_request *request)
{
int ret;
cds_ssr_protect(__func__);
ret = __wlan_hdd_cfg80211_scan(wiphy,
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 6, 0))
dev,
#endif
request, NL_SCAN);
cds_ssr_unprotect(__func__);
return ret;
@@ -2199,12 +2185,8 @@ static int __wlan_hdd_cfg80211_sched_scan_start(struct wiphy *wiphy,
/*Copying list of valid channel into request */
memcpy(pPnoRequest->aNetworks[i].aChannels, valid_ch, num_ch);
pPnoRequest->aNetworks[i].ucChannelCount = num_ch;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0)
pPnoRequest->aNetworks[i].rssiThreshold =
request->match_sets[i].rssi_thold;
#else
pPnoRequest->aNetworks[i].rssiThreshold = 0; /* Default value */
#endif
}
for (i = 0; i < request->n_ssids; i++) {

Zobrazit soubor

@@ -51,9 +51,6 @@ int iw_set_scan(struct net_device *dev, struct iw_request_info *info,
union iwreq_data *wrqu, char *extra);
int wlan_hdd_cfg80211_scan(struct wiphy *wiphy,
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 6, 0))
struct net_device *dev,
#endif
struct cfg80211_scan_request *request);
#ifdef FEATURE_WLAN_SCAN_PNO

Zobrazit soubor

@@ -419,9 +419,6 @@ static void wlan_hdd_tdls_schedule_scan(struct work_struct *work)
scan_ctx->attempt++;
wlan_hdd_cfg80211_scan(scan_ctx->wiphy,
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 6, 0))
scan_ctx->dev,
#endif
scan_ctx->scan_request);
}
@@ -2559,9 +2556,6 @@ void wlan_hdd_tdls_pre_setup(struct work_struct *work)
*/
int wlan_hdd_tdls_copy_scan_context(hdd_context_t *pHddCtx,
struct wiphy *wiphy,
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 6, 0))
struct net_device *dev,
#endif
struct cfg80211_scan_request *request)
{
tdls_scan_context_t *scan_ctx;
@@ -2574,9 +2568,6 @@ int wlan_hdd_tdls_copy_scan_context(hdd_context_t *pHddCtx,
scan_ctx = &pHddCtx->tdls_scan_ctxt;
scan_ctx->wiphy = wiphy;
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 6, 0))
scan_ctx->dev = dev;
#endif
scan_ctx->scan_request = request;
EXIT();
@@ -2595,18 +2586,11 @@ int wlan_hdd_tdls_copy_scan_context(hdd_context_t *pHddCtx,
*/
static void wlan_hdd_tdls_scan_init_work(hdd_context_t *pHddCtx,
struct wiphy *wiphy,
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 6, 0))
struct net_device *dev,
#endif
struct cfg80211_scan_request *request,
unsigned long delay)
{
if (TDLS_CTX_MAGIC != pHddCtx->tdls_scan_ctxt.magic) {
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 6, 0))
wlan_hdd_tdls_copy_scan_context(pHddCtx, wiphy, dev, request);
#else
wlan_hdd_tdls_copy_scan_context(pHddCtx, wiphy, request);
#endif
pHddCtx->tdls_scan_ctxt.attempt = 0;
pHddCtx->tdls_scan_ctxt.magic = TDLS_CTX_MAGIC;
}
@@ -2625,9 +2609,6 @@ static void wlan_hdd_tdls_scan_init_work(hdd_context_t *pHddCtx,
* 1 = caller can continue to scan
*/
int wlan_hdd_tdls_scan_callback(hdd_adapter_t *pAdapter, struct wiphy *wiphy,
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 6, 0))
struct net_device *dev,
#endif
struct cfg80211_scan_request *request)
{
hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
@@ -2682,9 +2663,6 @@ int wlan_hdd_tdls_scan_callback(hdd_adapter_t *pAdapter, struct wiphy *wiphy,
pHddCtx->tdls_scan_ctxt.attempt, delay);
wlan_hdd_tdls_scan_init_work(pHddCtx, wiphy,
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 6, 0))
dev,
#endif
request,
msecs_to_jiffies(delay));
/* scan should not continue */
@@ -2784,9 +2762,6 @@ int wlan_hdd_tdls_scan_callback(hdd_adapter_t *pAdapter, struct wiphy *wiphy,
wlan_hdd_tdls_connected_peers(pAdapter), delay);
wlan_hdd_tdls_scan_init_work(pHddCtx, wiphy,
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 6, 0))
dev,
#endif
request,
msecs_to_jiffies(delay));
/* scan should not continue */

Zobrazit soubor

@@ -56,12 +56,7 @@ static void *get_hif_hdl_from_file(struct file *file)
{
struct ol_softc *scn;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0))
scn = (struct ol_softc *)PDE_DATA(file_inode(file));
#else
scn = (struct ol_softc *)(
PDE(file->f_path.dentry->d_inode)->data);
#endif
return (void *)scn;
}

Zobrazit soubor

@@ -928,14 +928,12 @@ int hif_enable_pci(struct hif_pci_softc *sc,
/* FIXME: temp. commenting out assign_resource
* call for dev_attach to work on 2.6.38 kernel
*/
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 0, 0) && \
!defined(__LINUX_ARM_ARCH__)
#if (!defined(__LINUX_ARM_ARCH__))
if (pci_assign_resource(pdev, BAR_NUM)) {
HIF_ERROR("%s: pci_assign_resource error", __func__);
return -EIO;
}
#endif
if (pci_enable_device(pdev)) {
HIF_ERROR("%s: pci_enable_device error",
__func__);

Zobrazit soubor

@@ -528,10 +528,6 @@ static int wlan_logging_thread(void *Arg)
set_user_nice(current, -2);
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 8, 0))
daemonize("wlan_logging_thread");
#endif
while (!gwlan_logging.exit) {
ret_wait_status =
wait_event_interruptible(gwlan_logging.wait_queue,

Zobrazit soubor

@@ -60,24 +60,13 @@ static void nl_srv_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh);
int nl_srv_init(void)
{
int retcode = 0;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0))
struct netlink_kernel_cfg cfg = {
.groups = WLAN_NLINK_MCAST_GRP_ID,
.input = nl_srv_rcv
};
#endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0))
nl_srv_sock = netlink_kernel_create(&init_net, WLAN_NLINK_PROTO_FAMILY,
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 7, 0))
THIS_MODULE,
#endif
&cfg);
#else
nl_srv_sock = netlink_kernel_create(&init_net, WLAN_NLINK_PROTO_FAMILY,
WLAN_NLINK_MCAST_GRP_ID, nl_srv_rcv,
NULL, THIS_MODULE);
#endif
if (nl_srv_sock != NULL) {
memset(nl_srv_msg_handler, 0, sizeof(nl_srv_msg_handler));
@@ -151,11 +140,7 @@ int nl_srv_ucast(struct sk_buff *skb, int dst_pid, int flag)
{
int err = 0;
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 7, 0))
NETLINK_CB(skb).pid = 0; /* sender's pid */
#else
NETLINK_CB(skb).portid = 0; /* sender's pid */
#endif
NETLINK_CB(skb).dst_group = 0; /* not multicast */
if (nl_srv_sock)
@@ -181,11 +166,7 @@ int nl_srv_bcast(struct sk_buff *skb)
if (in_interrupt() || irqs_disabled() || in_atomic())
flags = GFP_ATOMIC;
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 7, 0))
NETLINK_CB(skb).pid = 0; /* sender's pid */
#else
NETLINK_CB(skb).portid = 0; /* sender's pid */
#endif
NETLINK_CB(skb).dst_group = WLAN_NLINK_MCAST_GRP_ID; /* destination group */
if (nl_srv_sock)

Zobrazit soubor

@@ -152,11 +152,7 @@ int pktlog_alloc_buf(struct ol_softc *scn)
for (vaddr = (unsigned long)(pl_info->buf);
vaddr < ((unsigned long)(pl_info->buf) + (page_cnt * PAGE_SIZE));
vaddr += PAGE_SIZE) {
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25))
vpg = vmalloc_to_page((const void *)vaddr);
#else
vpg = virt_to_page(pktlog_virt_to_logical((void *)vaddr));
#endif
SetPageReserved(vpg);
}
@@ -188,11 +184,7 @@ void pktlog_release_buf(struct ol_softc *scn)
for (vaddr = (unsigned long)(pl_info->buf);
vaddr < (unsigned long)(pl_info->buf) + (page_cnt * PAGE_SIZE);
vaddr += PAGE_SIZE) {
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25))
vpg = vmalloc_to_page((const void *)vaddr);
#else
vpg = virt_to_page(pktlog_virt_to_logical((void *)vaddr));
#endif
ClearPageReserved(vpg);
}
@@ -321,12 +313,6 @@ static int pktlog_sysctl_register(struct ol_softc *scn)
proc_name = PKTLOG_PROC_SYSTEM;
}
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 31))
#define set_ctl_name(a, b) /* nothing */
#else
#define set_ctl_name(a, b) pl_info_lnx->sysctls[a].ctl_name = b
#endif
/*
* Setup the sysctl table for creating the following sysctl entries:
* /proc/sys/PKTLOG_PROC_DIR/<adapter>/enable for enabling/disabling
@@ -334,50 +320,44 @@ static int pktlog_sysctl_register(struct ol_softc *scn)
* /proc/sys/PKTLOG_PROC_DIR/<adapter>/size for changing the buffer size
*/
memset(pl_info_lnx->sysctls, 0, sizeof(pl_info_lnx->sysctls));
set_ctl_name(0, CTL_AUTO);
pl_info_lnx->sysctls[0].procname = PKTLOG_PROC_DIR;
pl_info_lnx->sysctls[0].mode = PKTLOG_PROCSYS_DIR_PERM;
pl_info_lnx->sysctls[0].child = &pl_info_lnx->sysctls[2];
/* [1] is NULL terminator */
set_ctl_name(2, CTL_AUTO);
pl_info_lnx->sysctls[2].procname = proc_name;
pl_info_lnx->sysctls[2].mode = PKTLOG_PROCSYS_DIR_PERM;
pl_info_lnx->sysctls[2].child = &pl_info_lnx->sysctls[4];
/* [3] is NULL terminator */
set_ctl_name(4, CTL_AUTO);
pl_info_lnx->sysctls[4].procname = "enable";
pl_info_lnx->sysctls[4].mode = PKTLOG_PROCSYS_PERM;
pl_info_lnx->sysctls[4].proc_handler = ath_sysctl_pktlog_enable;
pl_info_lnx->sysctls[4].extra1 = scn;
set_ctl_name(5, CTL_AUTO);
pl_info_lnx->sysctls[5].procname = "size";
pl_info_lnx->sysctls[5].mode = PKTLOG_PROCSYS_PERM;
pl_info_lnx->sysctls[5].proc_handler = ath_sysctl_pktlog_size;
pl_info_lnx->sysctls[5].extra1 = scn;
set_ctl_name(6, CTL_AUTO);
pl_info_lnx->sysctls[6].procname = "options";
pl_info_lnx->sysctls[6].mode = PKTLOG_PROCSYS_PERM;
pl_info_lnx->sysctls[6].proc_handler = proc_dointvec;
pl_info_lnx->sysctls[6].data = &pl_info_lnx->info.options;
pl_info_lnx->sysctls[6].maxlen = sizeof(pl_info_lnx->info.options);
set_ctl_name(7, CTL_AUTO);
pl_info_lnx->sysctls[7].procname = "sack_thr";
pl_info_lnx->sysctls[7].mode = PKTLOG_PROCSYS_PERM;
pl_info_lnx->sysctls[7].proc_handler = proc_dointvec;
pl_info_lnx->sysctls[7].data = &pl_info_lnx->info.sack_thr;
pl_info_lnx->sysctls[7].maxlen = sizeof(pl_info_lnx->info.sack_thr);
set_ctl_name(8, CTL_AUTO);
pl_info_lnx->sysctls[8].procname = "tail_length";
pl_info_lnx->sysctls[8].mode = PKTLOG_PROCSYS_PERM;
pl_info_lnx->sysctls[8].proc_handler = proc_dointvec;
pl_info_lnx->sysctls[8].data = &pl_info_lnx->info.tail_length;
pl_info_lnx->sysctls[8].maxlen = sizeof(pl_info_lnx->info.tail_length);
set_ctl_name(9, CTL_AUTO);
pl_info_lnx->sysctls[9].procname = "thruput_thresh";
pl_info_lnx->sysctls[9].mode = PKTLOG_PROCSYS_PERM;
pl_info_lnx->sysctls[9].proc_handler = proc_dointvec;
@@ -385,7 +365,6 @@ static int pktlog_sysctl_register(struct ol_softc *scn)
pl_info_lnx->sysctls[9].maxlen =
sizeof(pl_info_lnx->info.thruput_thresh);
set_ctl_name(10, CTL_AUTO);
pl_info_lnx->sysctls[10].procname = "phyerr_thresh";
pl_info_lnx->sysctls[10].mode = PKTLOG_PROCSYS_PERM;
pl_info_lnx->sysctls[10].proc_handler = proc_dointvec;
@@ -393,14 +372,12 @@ static int pktlog_sysctl_register(struct ol_softc *scn)
pl_info_lnx->sysctls[10].maxlen =
sizeof(pl_info_lnx->info.phyerr_thresh);
set_ctl_name(11, CTL_AUTO);
pl_info_lnx->sysctls[11].procname = "per_thresh";
pl_info_lnx->sysctls[11].mode = PKTLOG_PROCSYS_PERM;
pl_info_lnx->sysctls[11].proc_handler = proc_dointvec;
pl_info_lnx->sysctls[11].data = &pl_info_lnx->info.per_thresh;
pl_info_lnx->sysctls[11].maxlen = sizeof(pl_info_lnx->info.per_thresh);
set_ctl_name(12, CTL_AUTO);
pl_info_lnx->sysctls[12].procname = "trigger_interval";
pl_info_lnx->sysctls[12].mode = PKTLOG_PROCSYS_PERM;
pl_info_lnx->sysctls[12].proc_handler = proc_dointvec;
@@ -411,13 +388,9 @@ static int pktlog_sysctl_register(struct ol_softc *scn)
/* and register everything */
/* register_sysctl_table changed from 2.6.21 onwards */
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 20))
pl_info_lnx->sysctl_header =
register_sysctl_table(pl_info_lnx->sysctls);
#else
pl_info_lnx->sysctl_header =
register_sysctl_table(pl_info_lnx->sysctls, 1);
#endif
if (!pl_info_lnx->sysctl_header) {
printk("%s: failed to register sysctls!\n", proc_name);
return -1;
@@ -468,7 +441,6 @@ static int pktlog_attach(struct ol_softc *scn)
pl_info_lnx->proc_entry = NULL;
pl_info_lnx->sysctl_header = NULL;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0)
proc_entry = proc_create_data(proc_name, PKTLOG_PROC_PERM,
g_pktlog_pde, &pktlog_fops,
&pl_info_lnx->info);
@@ -478,22 +450,6 @@ static int pktlog_attach(struct ol_softc *scn)
__func__, proc_name);
goto attach_fail1;
}
#else
proc_entry = create_proc_entry(proc_name, PKTLOG_PROC_PERM,
g_pktlog_pde);
if (proc_entry == NULL) {
printk(PKTLOG_TAG "%s: create_proc_entry failed for %s\n",
__func__, proc_name);
goto attach_fail1;
}
proc_entry->data = &pl_info_lnx->info;
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 31)
proc_entry->owner = THIS_MODULE;
#endif
proc_entry->proc_fops = &pktlog_fops;
#endif
pl_info_lnx->proc_entry = proc_entry;
@@ -867,14 +823,8 @@ pktlog_read(struct file *file, char *buf, size_t nbytes, loff_t *ppos)
int rem_len;
int start_offset, end_offset;
int fold_offset, ppos_data, cur_rd_offset;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0)
struct ath_pktlog_info *pl_info = (struct ath_pktlog_info *)
PDE_DATA(file->f_dentry->d_inode);
#else
struct proc_dir_entry *proc_entry = PDE(file->f_dentry->d_inode);
struct ath_pktlog_info *pl_info = (struct ath_pktlog_info *)
proc_entry->data;
#endif
struct ath_pktlog_buf *log_buf = pl_info->buf;
if (log_buf == NULL)
@@ -985,51 +935,6 @@ rd_done:
#define VMALLOC_VMADDR(x) ((unsigned long)(x))
#endif
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 31))
/* Convert a kernel virtual address to a kernel logical address */
static volatile void *pktlog_virt_to_logical(volatile void *addr)
{
pgd_t *pgd;
pmd_t *pmd;
pte_t *ptep, pte;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 15) || \
(defined(__i386__) && LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 11)))
pud_t *pud;
#endif
unsigned long vaddr, ret = 0UL;
vaddr = VMALLOC_VMADDR((unsigned long)addr);
pgd = pgd_offset_k(vaddr);
if (!pgd_none(*pgd)) {
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 15) || \
(defined(__i386__) && LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 11)))
pud = pud_offset(pgd, vaddr);
pmd = pmd_offset(pud, vaddr);
#else
pmd = pmd_offset(pgd, vaddr);
#endif
if (!pmd_none(*pmd)) {
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 0)
ptep = pte_offset_map(pmd, vaddr);
#else
ptep = pte_offset(pmd, vaddr);
#endif
pte = *ptep;
if (pte_present(pte)) {
ret = (unsigned long)
page_address(pte_page(pte));
ret |= (vaddr & (PAGE_SIZE - 1));
}
}
}
return (volatile void *)ret;
}
#endif
/* vma operations for mapping vmalloced area to user space */
static void pktlog_vopen(struct vm_area_struct *vma)
{
@@ -1041,7 +946,6 @@ static void pktlog_vclose(struct vm_area_struct *vma)
PKTLOG_MOD_DEC_USE_COUNT;
}
#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 25)
int pktlog_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
{
unsigned long address = (unsigned long)vmf->virtual_address;
@@ -1056,62 +960,16 @@ int pktlog_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
vmf->page = virt_to_page((void *)address);
return VM_FAULT_MINOR;
}
#else
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)
struct page *pktlog_vmmap(struct vm_area_struct *vma, unsigned long addr,
int *type)
#else
struct page *pktlog_vmmap(struct vm_area_struct *vma, unsigned long addr,
int write_access)
#endif
{
unsigned long offset, vaddr;
struct proc_dir_entry *proc_entry;
struct ath_pktlog_info *pl_info =
proc_entry = PDE(vma->vm_file->f_dentry->d_inode);
pl_info = (struct ath_pktlog_info *)proc_entry->data;
offset = addr - vma->vm_start + (vma->vm_pgoff << PAGE_SHIFT);
vaddr = (unsigned long)pktlog_virt_to_logical((void *)(pl_info->buf) +
offset);
if (vaddr == 0UL) {
printk(PKTLOG_TAG "%s: page fault out of range\n", __func__);
return ((struct page *)0UL);
}
/* increment the usage count of the page */
get_page(virt_to_page((void *)vaddr));
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)
if (type)
*type = VM_FAULT_MINOR;
#endif
return virt_to_page((void *)vaddr);
}
#endif /* LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 25) */
static struct vm_operations_struct pktlog_vmops = {
open: pktlog_vopen,
close:pktlog_vclose,
#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 25)
fault:pktlog_fault,
#else
nopage:pktlog_vmmap,
#endif
};
static int pktlog_mmap(struct file *file, struct vm_area_struct *vma)
{
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0)
struct ath_pktlog_info *pl_info = (struct ath_pktlog_info *)
PDE_DATA(file->f_dentry->d_inode);
#else
struct proc_dir_entry *proc_entry = PDE(file->f_dentry->d_inode);
struct ath_pktlog_info *pl_info = (struct ath_pktlog_info *)
proc_entry->data;
#endif
if (vma->vm_pgoff != 0) {
/* Entire buffer should be mapped */