* [PATCH 12/20] iwlwifi: mvm: Add basic uAPSD client support
From: Johannes Berg @ 2013-08-16 11:07 UTC (permalink / raw)
To: linux-wireless; +Cc: Alexander Bondar
In-Reply-To: <1376651230-1060-1-git-send-email-johannes@sipsolutions.net>
From: Alexander Bondar <alexander.bondar@intel.com>
Implement basic uAPSD client support adding the following:
- Advertise uAPSD support in HW capabilities
- Set all ACs trigger- and delivery-enabled
- Set max SP length to 2 buffered frames
- Assign QNDP with the highest TID with no mandatory admission
control required
- Set uAPSD related parameters in Power Table command
Signed-off-by: Alexander Bondar <alexander.bondar@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
drivers/net/wireless/iwlwifi/mvm/constants.h | 6 ++
drivers/net/wireless/iwlwifi/mvm/debugfs.c | 2 +-
drivers/net/wireless/iwlwifi/mvm/fw-api-power.h | 16 +--
drivers/net/wireless/iwlwifi/mvm/mac80211.c | 7 +-
drivers/net/wireless/iwlwifi/mvm/mvm.h | 5 +
drivers/net/wireless/iwlwifi/mvm/power.c | 127 ++++++++++++++++++++----
6 files changed, 135 insertions(+), 28 deletions(-)
diff --git a/drivers/net/wireless/iwlwifi/mvm/constants.h b/drivers/net/wireless/iwlwifi/mvm/constants.h
index 64656e0c..33f98fc 100644
--- a/drivers/net/wireless/iwlwifi/mvm/constants.h
+++ b/drivers/net/wireless/iwlwifi/mvm/constants.h
@@ -67,5 +67,11 @@
#define IWL_MVM_DEFAULT_PS_RX_DATA_TIMEOUT (100 * USEC_PER_MSEC)
#define IWL_MVM_WOWLAN_PS_TX_DATA_TIMEOUT (10 * USEC_PER_MSEC)
#define IWL_MVM_WOWLAN_PS_RX_DATA_TIMEOUT (10 * USEC_PER_MSEC)
+#define IWL_MVM_UAPSD_RX_DATA_TIMEOUT (50 * USEC_PER_MSEC)
+#define IWL_MVM_UAPSD_TX_DATA_TIMEOUT (50 * USEC_PER_MSEC)
+#define IWL_MVM_PS_HEAVY_TX_THLD_PACKETS 20
+#define IWL_MVM_PS_HEAVY_RX_THLD_PACKETS 20
+#define IWL_MVM_PS_HEAVY_TX_THLD_PERCENT 50
+#define IWL_MVM_PS_HEAVY_RX_THLD_PERCENT 50
#endif /* __MVM_CONSTANTS_H */
diff --git a/drivers/net/wireless/iwlwifi/mvm/debugfs.c b/drivers/net/wireless/iwlwifi/mvm/debugfs.c
index 3cdc005..14811a5 100644
--- a/drivers/net/wireless/iwlwifi/mvm/debugfs.c
+++ b/drivers/net/wireless/iwlwifi/mvm/debugfs.c
@@ -424,7 +424,7 @@ static ssize_t iwl_dbgfs_pm_params_read(struct file *file,
struct ieee80211_vif *vif = file->private_data;
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
struct iwl_mvm *mvm = mvmvif->dbgfs_data;
- char buf[256];
+ char buf[512];
int bufsz = sizeof(buf);
int pos;
diff --git a/drivers/net/wireless/iwlwifi/mvm/fw-api-power.h b/drivers/net/wireless/iwlwifi/mvm/fw-api-power.h
index 060e630..bb010b3 100644
--- a/drivers/net/wireless/iwlwifi/mvm/fw-api-power.h
+++ b/drivers/net/wireless/iwlwifi/mvm/fw-api-power.h
@@ -164,10 +164,10 @@ struct iwl_powertable_cmd {
* Use IEEE80211_WMM_IE_STA_QOSINFO_AC* for correct values.
* @uapsd_max_sp: Use IEEE80211_WMM_IE_STA_QOSINFO_SP_* for correct
* values.
- * @heavy_traffic_thr_tx_pkts: TX threshold measured in number of packets
- * @heavy_traffic_thr_rx_pkts: RX threshold measured in number of packets
- * @heavy_traffic_thr_tx_load: TX threshold measured in load's percentage
- * @heavy_traffic_thr_rx_load: RX threshold measured in load's percentage
+ * @heavy_tx_thld_packets: TX threshold measured in number of packets
+ * @heavy_rx_thld_packets: RX threshold measured in number of packets
+ * @heavy_tx_thld_percentage: TX threshold measured in load's percentage
+ * @heavy_rx_thld_percentage: RX threshold measured in load's percentage
* @limited_ps_threshold:
*/
struct iwl_mac_power_cmd {
@@ -189,10 +189,10 @@ struct iwl_mac_power_cmd {
u8 qndp_tid;
u8 uapsd_ac_flags;
u8 uapsd_max_sp;
- u8 heavy_traffic_threshold_tx_packets;
- u8 heavy_traffic_threshold_rx_packets;
- u8 heavy_traffic_threshold_tx_percentage;
- u8 heavy_traffic_threshold_rx_percentage;
+ u8 heavy_tx_thld_packets;
+ u8 heavy_rx_thld_packets;
+ u8 heavy_tx_thld_percentage;
+ u8 heavy_rx_thld_percentage;
u8 limited_ps_threshold;
u8 reserved;
} __packed;
diff --git a/drivers/net/wireless/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/iwlwifi/mvm/mac80211.c
index 05daa90..66803b9 100644
--- a/drivers/net/wireless/iwlwifi/mvm/mac80211.c
+++ b/drivers/net/wireless/iwlwifi/mvm/mac80211.c
@@ -155,7 +155,8 @@ int iwl_mvm_mac_setup_register(struct iwl_mvm *mvm)
IEEE80211_HW_TIMING_BEACON_ONLY |
IEEE80211_HW_CONNECTION_MONITOR |
IEEE80211_HW_SUPPORTS_DYNAMIC_SMPS |
- IEEE80211_HW_SUPPORTS_STATIC_SMPS;
+ IEEE80211_HW_SUPPORTS_STATIC_SMPS |
+ IEEE80211_HW_SUPPORTS_UAPSD;
hw->queues = IWL_MVM_FIRST_AGG_QUEUE;
hw->offchannel_tx_hw_queue = IWL_MVM_OFFCHANNEL_QUEUE;
@@ -190,6 +191,8 @@ int iwl_mvm_mac_setup_register(struct iwl_mvm *mvm)
hw->wiphy->max_remain_on_channel_duration = 10000;
hw->max_listen_interval = IWL_CONN_MAX_LISTEN_INTERVAL;
+ hw->uapsd_queues = IWL_UAPSD_AC_INFO;
+ hw->uapsd_max_sp_len = IWL_UAPSD_MAX_SP;
/* Extract MAC address */
memcpy(mvm->addresses[0].addr, mvm->nvm_data->hw_addr, ETH_ALEN);
@@ -812,7 +815,7 @@ static void iwl_mvm_bss_info_changed_station(struct iwl_mvm *mvm,
*/
iwl_mvm_remove_time_event(mvm, mvmvif,
&mvmvif->time_event_data);
- } else if (changes & BSS_CHANGED_PS) {
+ } else if (changes & (BSS_CHANGED_PS | BSS_CHANGED_QOS)) {
ret = iwl_mvm_power_update_mode(mvm, vif);
if (ret)
IWL_ERR(mvm, "failed to update power mode\n");
diff --git a/drivers/net/wireless/iwlwifi/mvm/mvm.h b/drivers/net/wireless/iwlwifi/mvm/mvm.h
index 76f6a1f..014d779 100644
--- a/drivers/net/wireless/iwlwifi/mvm/mvm.h
+++ b/drivers/net/wireless/iwlwifi/mvm/mvm.h
@@ -153,6 +153,11 @@ enum iwl_power_scheme {
};
#define IWL_CONN_MAX_LISTEN_INTERVAL 70
+#define IWL_UAPSD_AC_INFO (IEEE80211_WMM_IE_STA_QOSINFO_AC_VO |\
+ IEEE80211_WMM_IE_STA_QOSINFO_AC_VI |\
+ IEEE80211_WMM_IE_STA_QOSINFO_AC_BK |\
+ IEEE80211_WMM_IE_STA_QOSINFO_AC_BE)
+#define IWL_UAPSD_MAX_SP IEEE80211_WMM_IE_STA_QOSINFO_SP_2
struct iwl_mvm_power_ops {
int (*power_update_mode)(struct iwl_mvm *mvm,
diff --git a/drivers/net/wireless/iwlwifi/mvm/power.c b/drivers/net/wireless/iwlwifi/mvm/power.c
index 4e7c9f2..9c9b5ba 100644
--- a/drivers/net/wireless/iwlwifi/mvm/power.c
+++ b/drivers/net/wireless/iwlwifi/mvm/power.c
@@ -140,17 +140,30 @@ static void iwl_mvm_power_log(struct iwl_mvm *mvm,
IWL_DEBUG_POWER(mvm, "Keep alive = %u sec\n",
le16_to_cpu(cmd->keep_alive_seconds));
- if (cmd->flags & cpu_to_le16(POWER_FLAGS_POWER_MANAGEMENT_ENA_MSK)) {
- IWL_DEBUG_POWER(mvm, "Rx timeout = %u usec\n",
- le32_to_cpu(cmd->rx_data_timeout));
- IWL_DEBUG_POWER(mvm, "Tx timeout = %u usec\n",
- le32_to_cpu(cmd->tx_data_timeout));
- if (cmd->flags & cpu_to_le16(POWER_FLAGS_SKIP_OVER_DTIM_MSK))
- IWL_DEBUG_POWER(mvm, "DTIM periods to skip = %u\n",
- cmd->skip_dtim_periods);
- if (cmd->flags & cpu_to_le16(POWER_FLAGS_LPRX_ENA_MSK))
- IWL_DEBUG_POWER(mvm, "LP RX RSSI threshold = %u\n",
- cmd->lprx_rssi_threshold);
+ if (!(cmd->flags & cpu_to_le16(POWER_FLAGS_POWER_MANAGEMENT_ENA_MSK))) {
+ IWL_DEBUG_POWER(mvm, "Disable power management\n");
+ return;
+ }
+
+ IWL_DEBUG_POWER(mvm, "Rx timeout = %u usec\n",
+ le32_to_cpu(cmd->rx_data_timeout));
+ IWL_DEBUG_POWER(mvm, "Tx timeout = %u usec\n",
+ le32_to_cpu(cmd->tx_data_timeout));
+ if (cmd->flags & cpu_to_le16(POWER_FLAGS_SKIP_OVER_DTIM_MSK))
+ IWL_DEBUG_POWER(mvm, "DTIM periods to skip = %u\n",
+ cmd->skip_dtim_periods);
+ if (cmd->flags & cpu_to_le16(POWER_FLAGS_LPRX_ENA_MSK))
+ IWL_DEBUG_POWER(mvm, "LP RX RSSI threshold = %u\n",
+ cmd->lprx_rssi_threshold);
+ if (cmd->flags & cpu_to_le16(POWER_FLAGS_ADVANCE_PM_ENA_MSK)) {
+ IWL_DEBUG_POWER(mvm, "uAPSD enabled\n");
+ IWL_DEBUG_POWER(mvm, "Rx timeout (uAPSD) = %u usec\n",
+ le32_to_cpu(cmd->rx_data_timeout_uapsd));
+ IWL_DEBUG_POWER(mvm, "Tx timeout (uAPSD) = %u usec\n",
+ le32_to_cpu(cmd->tx_data_timeout_uapsd));
+ IWL_DEBUG_POWER(mvm, "QNDP TID = %d\n", cmd->qndp_tid);
+ IWL_DEBUG_POWER(mvm, "ACs flags = 0x%x\n", cmd->uapsd_ac_flags);
+ IWL_DEBUG_POWER(mvm, "Max SP = %d\n", cmd->uapsd_max_sp);
}
}
@@ -166,6 +179,8 @@ static void iwl_mvm_power_build_cmd(struct iwl_mvm *mvm,
bool radar_detect = false;
struct iwl_mvm_vif *mvmvif __maybe_unused =
iwl_mvm_vif_from_mac80211(vif);
+ enum ieee80211_ac_numbers ac;
+ bool tid_found = false;
cmd->id_and_color = cpu_to_le32(FW_CMD_ID_AND_COLOR(mvmvif->id,
mvmvif->color));
@@ -235,6 +250,49 @@ static void iwl_mvm_power_build_cmd(struct iwl_mvm *mvm,
cpu_to_le32(IWL_MVM_WOWLAN_PS_TX_DATA_TIMEOUT);
}
+ for (ac = IEEE80211_AC_VO; ac <= IEEE80211_AC_BK; ac++) {
+ if (!mvmvif->queue_params[ac].uapsd)
+ continue;
+
+ cmd->flags |= cpu_to_le16(POWER_FLAGS_ADVANCE_PM_ENA_MSK);
+ cmd->uapsd_ac_flags |= BIT(ac);
+
+ /* QNDP TID - the highest TID with no admission control */
+ if (!tid_found && !mvmvif->queue_params[ac].acm) {
+ tid_found = true;
+ switch (ac) {
+ case IEEE80211_AC_VO:
+ cmd->qndp_tid = 6;
+ break;
+ case IEEE80211_AC_VI:
+ cmd->qndp_tid = 5;
+ break;
+ case IEEE80211_AC_BE:
+ cmd->qndp_tid = 0;
+ break;
+ case IEEE80211_AC_BK:
+ cmd->qndp_tid = 1;
+ break;
+ }
+ }
+ }
+
+ if (cmd->flags & cpu_to_le16(POWER_FLAGS_ADVANCE_PM_ENA_MSK)) {
+ cmd->rx_data_timeout_uapsd =
+ cpu_to_le32(IWL_MVM_UAPSD_RX_DATA_TIMEOUT);
+ cmd->tx_data_timeout_uapsd =
+ cpu_to_le32(IWL_MVM_UAPSD_TX_DATA_TIMEOUT);
+ cmd->uapsd_max_sp = IWL_UAPSD_MAX_SP;
+ cmd->heavy_tx_thld_packets =
+ IWL_MVM_PS_HEAVY_TX_THLD_PACKETS;
+ cmd->heavy_rx_thld_packets =
+ IWL_MVM_PS_HEAVY_RX_THLD_PACKETS;
+ cmd->heavy_tx_thld_percentage =
+ IWL_MVM_PS_HEAVY_TX_THLD_PERCENT;
+ cmd->heavy_rx_thld_percentage =
+ IWL_MVM_PS_HEAVY_RX_THLD_PERCENT;
+ }
+
#ifdef CONFIG_IWLWIFI_DEBUGFS
if (mvmvif->dbgfs_pm.mask & MVM_DEBUGFS_PM_KEEP_ALIVE)
cmd->keep_alive_seconds =
@@ -342,8 +400,6 @@ static int iwl_mvm_power_mac_dbgfs_read(struct iwl_mvm *mvm,
(cmd.flags &
cpu_to_le16(POWER_FLAGS_POWER_SAVE_ENA_MSK)) ?
0 : 1);
- pos += scnprintf(buf+pos, bufsz-pos, "skip_dtim_periods = %d\n",
- cmd.skip_dtim_periods);
pos += scnprintf(buf+pos, bufsz-pos, "power_scheme = %d\n",
iwlmvm_mod_params.power_scheme);
pos += scnprintf(buf+pos, bufsz-pos, "flags = 0x%x\n",
@@ -356,14 +412,51 @@ static int iwl_mvm_power_mac_dbgfs_read(struct iwl_mvm *mvm,
(cmd.flags &
cpu_to_le16(POWER_FLAGS_SKIP_OVER_DTIM_MSK)) ?
1 : 0);
- pos += scnprintf(buf+pos, bufsz-pos, "rx_data_timeout = %d\n",
- le32_to_cpu(cmd.rx_data_timeout));
- pos += scnprintf(buf+pos, bufsz-pos, "tx_data_timeout = %d\n",
- le32_to_cpu(cmd.tx_data_timeout));
+ pos += scnprintf(buf+pos, bufsz-pos, "skip_dtim_periods = %d\n",
+ cmd.skip_dtim_periods);
+ if (!(cmd.flags &
+ cpu_to_le16(POWER_FLAGS_ADVANCE_PM_ENA_MSK))) {
+ pos += scnprintf(buf+pos, bufsz-pos,
+ "rx_data_timeout = %d\n",
+ le32_to_cpu(cmd.rx_data_timeout));
+ pos += scnprintf(buf+pos, bufsz-pos,
+ "tx_data_timeout = %d\n",
+ le32_to_cpu(cmd.tx_data_timeout));
+ }
if (cmd.flags & cpu_to_le16(POWER_FLAGS_LPRX_ENA_MSK))
pos += scnprintf(buf+pos, bufsz-pos,
"lprx_rssi_threshold = %d\n",
cmd.lprx_rssi_threshold);
+ if (cmd.flags & cpu_to_le16(POWER_FLAGS_ADVANCE_PM_ENA_MSK)) {
+ pos +=
+ scnprintf(buf+pos, bufsz-pos,
+ "rx_data_timeout_uapsd = %d\n",
+ le32_to_cpu(cmd.rx_data_timeout_uapsd));
+ pos +=
+ scnprintf(buf+pos, bufsz-pos,
+ "tx_data_timeout_uapsd = %d\n",
+ le32_to_cpu(cmd.tx_data_timeout_uapsd));
+ pos += scnprintf(buf+pos, bufsz-pos, "qndp_tid = %d\n",
+ cmd.qndp_tid);
+ pos += scnprintf(buf+pos, bufsz-pos,
+ "uapsd_ac_flags = 0x%x\n",
+ cmd.uapsd_ac_flags);
+ pos += scnprintf(buf+pos, bufsz-pos,
+ "uapsd_max_sp = %d\n",
+ cmd.uapsd_max_sp);
+ pos += scnprintf(buf+pos, bufsz-pos,
+ "heavy_tx_thld_packets = %d\n",
+ cmd.heavy_tx_thld_packets);
+ pos += scnprintf(buf+pos, bufsz-pos,
+ "heavy_rx_thld_packets = %d\n",
+ cmd.heavy_rx_thld_packets);
+ pos += scnprintf(buf+pos, bufsz-pos,
+ "heavy_tx_thld_percentage = %d\n",
+ cmd.heavy_tx_thld_percentage);
+ pos += scnprintf(buf+pos, bufsz-pos,
+ "heavy_rx_thld_percentage = %d\n",
+ cmd.heavy_rx_thld_percentage);
+ }
}
return pos;
}
--
1.8.4.rc2
^ permalink raw reply related
* [PATCH 19/20] iwlwifi: mvm: Implement CQM offloading
From: Johannes Berg @ 2013-08-16 11:07 UTC (permalink / raw)
To: linux-wireless; +Cc: Andrei Otcheretianski
In-Reply-To: <1376651230-1060-1-git-send-email-johannes@sipsolutions.net>
From: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
Use beacon statistics notification to track RSSI.
Notify mac80211 when the tresholds are crossed.
The roaming treshold is configured to be
equal to cqm_thold. If the beacon filtering command
is not supported by fw fall back and use mac80211
mechanism.
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
drivers/net/wireless/iwlwifi/mvm/debugfs.c | 2 +-
drivers/net/wireless/iwlwifi/mvm/fw-api.h | 2 +-
drivers/net/wireless/iwlwifi/mvm/mac80211.c | 22 +++++++++--
drivers/net/wireless/iwlwifi/mvm/mvm.h | 20 +++++++++-
drivers/net/wireless/iwlwifi/mvm/power.c | 37 +++++++++++++++--
drivers/net/wireless/iwlwifi/mvm/rx.c | 61 ++++++++++++++++++++++++++++-
6 files changed, 133 insertions(+), 11 deletions(-)
diff --git a/drivers/net/wireless/iwlwifi/mvm/debugfs.c b/drivers/net/wireless/iwlwifi/mvm/debugfs.c
index 14811a5..c67b17a 100644
--- a/drivers/net/wireless/iwlwifi/mvm/debugfs.c
+++ b/drivers/net/wireless/iwlwifi/mvm/debugfs.c
@@ -920,7 +920,7 @@ static ssize_t iwl_dbgfs_bf_params_read(struct file *file,
};
iwl_mvm_beacon_filter_debugfs_parameters(vif, &cmd);
- if (mvmvif->bf_enabled)
+ if (mvmvif->bf_data.bf_enabled)
cmd.bf_enable_beacon_filter = cpu_to_le32(1);
else
cmd.bf_enable_beacon_filter = 0;
diff --git a/drivers/net/wireless/iwlwifi/mvm/fw-api.h b/drivers/net/wireless/iwlwifi/mvm/fw-api.h
index b104710..66264cc 100644
--- a/drivers/net/wireless/iwlwifi/mvm/fw-api.h
+++ b/drivers/net/wireless/iwlwifi/mvm/fw-api.h
@@ -1321,7 +1321,7 @@ struct mvm_statistics_general {
struct mvm_statistics_general_common common;
__le32 beacon_filtered;
__le32 missed_beacons;
- __s8 beacon_filter_everage_energy;
+ __s8 beacon_filter_average_energy;
__s8 beacon_filter_reason;
__s8 beacon_filter_current_energy;
__s8 beacon_filter_reserved;
diff --git a/drivers/net/wireless/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/iwlwifi/mvm/mac80211.c
index 66803b9..692d2ea 100644
--- a/drivers/net/wireless/iwlwifi/mvm/mac80211.c
+++ b/drivers/net/wireless/iwlwifi/mvm/mac80211.c
@@ -575,7 +575,8 @@ static int iwl_mvm_mac_add_interface(struct ieee80211_hw *hw,
vif->type == NL80211_IFTYPE_STATION && !vif->p2p &&
mvm->fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_BF_UPDATED){
mvm->bf_allowed_vif = mvmvif;
- vif->driver_flags |= IEEE80211_VIF_BEACON_FILTER;
+ vif->driver_flags |= IEEE80211_VIF_BEACON_FILTER |
+ IEEE80211_VIF_SUPPORTS_CQM_RSSI;
}
/*
@@ -615,7 +616,8 @@ static int iwl_mvm_mac_add_interface(struct ieee80211_hw *hw,
out_free_bf:
if (mvm->bf_allowed_vif == mvmvif) {
mvm->bf_allowed_vif = NULL;
- vif->driver_flags &= ~IEEE80211_VIF_BEACON_FILTER;
+ vif->driver_flags &= ~(IEEE80211_VIF_BEACON_FILTER |
+ IEEE80211_VIF_SUPPORTS_CQM_RSSI);
}
out_remove_mac:
mvmvif->phy_ctxt = NULL;
@@ -681,7 +683,8 @@ static void iwl_mvm_mac_remove_interface(struct ieee80211_hw *hw,
if (mvm->bf_allowed_vif == mvmvif) {
mvm->bf_allowed_vif = NULL;
- vif->driver_flags &= ~IEEE80211_VIF_BEACON_FILTER;
+ vif->driver_flags &= ~(IEEE80211_VIF_BEACON_FILTER |
+ IEEE80211_VIF_SUPPORTS_CQM_RSSI);
}
iwl_mvm_vif_dbgfs_clean(mvm, vif);
@@ -799,6 +802,10 @@ static void iwl_mvm_bss_info_changed_station(struct iwl_mvm *mvm,
if (ret)
IWL_ERR(mvm, "failed to update quotas\n");
}
+
+ /* reset rssi values */
+ mvmvif->bf_data.ave_beacon_signal = 0;
+
if (!(mvm->fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_UAPSD)) {
/* Workaround for FW bug, otherwise FW disables device
* power save upon disassociation
@@ -825,6 +832,15 @@ static void iwl_mvm_bss_info_changed_station(struct iwl_mvm *mvm,
bss_conf->txpower);
iwl_mvm_set_tx_power(mvm, vif, bss_conf->txpower);
}
+
+ if (changes & BSS_CHANGED_CQM) {
+ IWL_DEBUG_MAC80211(mvm, "cqm info_changed");
+ /* reset cqm events tracking */
+ mvmvif->bf_data.last_cqm_event = 0;
+ ret = iwl_mvm_update_beacon_filter(mvm, vif);
+ if (ret)
+ IWL_ERR(mvm, "failed to update CQM thresholds\n");
+ }
}
static int iwl_mvm_start_ap(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
diff --git a/drivers/net/wireless/iwlwifi/mvm/mvm.h b/drivers/net/wireless/iwlwifi/mvm/mvm.h
index 014d779..ee46dea 100644
--- a/drivers/net/wireless/iwlwifi/mvm/mvm.h
+++ b/drivers/net/wireless/iwlwifi/mvm/mvm.h
@@ -233,6 +233,21 @@ enum iwl_mvm_smps_type_request {
};
/**
+* struct iwl_mvm_vif_bf_data - beacon filtering related data
+* @bf_enabled: indicates if beacon filtering is enabled
+* @ba_enabled: indicated if beacon abort is enabled
+* @last_beacon_signal: last beacon rssi signal in dbm
+* @ave_beacon_signal: average beacon signal
+* @last_cqm_event: rssi of the last cqm event
+*/
+struct iwl_mvm_vif_bf_data {
+ bool bf_enabled;
+ bool ba_enabled;
+ s8 ave_beacon_signal;
+ s8 last_cqm_event;
+};
+
+/**
* struct iwl_mvm_vif - data per Virtual Interface, it is a MAC context
* @id: between 0 and 3
* @color: to solve races upon MAC addition and removal
@@ -257,8 +272,7 @@ struct iwl_mvm_vif {
bool uploaded;
bool ap_active;
bool monitor_active;
- /* indicate whether beacon filtering is enabled */
- bool bf_enabled;
+ struct iwl_mvm_vif_bf_data bf_data;
u32 ap_beacon_time;
@@ -758,6 +772,8 @@ int iwl_mvm_beacon_filter_send_cmd(struct iwl_mvm *mvm,
struct iwl_beacon_filter_cmd *cmd);
int iwl_mvm_update_beacon_abort(struct iwl_mvm *mvm,
struct ieee80211_vif *vif, bool enable);
+int iwl_mvm_update_beacon_filter(struct iwl_mvm *mvm,
+ struct ieee80211_vif *vif);
/* SMPS */
void iwl_mvm_update_smps(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
diff --git a/drivers/net/wireless/iwlwifi/mvm/power.c b/drivers/net/wireless/iwlwifi/mvm/power.c
index 9c9b5ba..a5529b8 100644
--- a/drivers/net/wireless/iwlwifi/mvm/power.c
+++ b/drivers/net/wireless/iwlwifi/mvm/power.c
@@ -110,6 +110,23 @@ int iwl_mvm_beacon_filter_send_cmd(struct iwl_mvm *mvm,
return ret;
}
+static
+void iwl_mvm_beacon_filter_set_cqm_params(struct iwl_mvm *mvm,
+ struct ieee80211_vif *vif,
+ struct iwl_beacon_filter_cmd *cmd)
+{
+ struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
+
+ if (vif->bss_conf.cqm_rssi_thold) {
+ cmd->bf_energy_delta =
+ cpu_to_le32(vif->bss_conf.cqm_rssi_hyst);
+ /* fw uses an absolute value for this */
+ cmd->bf_roaming_state =
+ cpu_to_le32(-vif->bss_conf.cqm_rssi_thold);
+ }
+ cmd->ba_enable_beacon_abort = cpu_to_le32(mvmvif->bf_data.ba_enabled);
+}
+
int iwl_mvm_update_beacon_abort(struct iwl_mvm *mvm,
struct ieee80211_vif *vif, bool enable)
{
@@ -120,12 +137,14 @@ int iwl_mvm_update_beacon_abort(struct iwl_mvm *mvm,
.ba_enable_beacon_abort = cpu_to_le32(enable),
};
- if (!mvmvif->bf_enabled)
+ if (!mvmvif->bf_data.bf_enabled)
return 0;
if (mvm->cur_ucode == IWL_UCODE_WOWLAN)
cmd.ba_escape_timer = cpu_to_le32(IWL_BA_ESCAPE_TIMER_D3);
+ mvmvif->bf_data.ba_enabled = enable;
+ iwl_mvm_beacon_filter_set_cqm_params(mvm, vif, &cmd);
iwl_mvm_beacon_filter_debugfs_parameters(vif, &cmd);
return iwl_mvm_beacon_filter_send_cmd(mvm, &cmd);
}
@@ -510,11 +529,12 @@ int iwl_mvm_enable_beacon_filter(struct iwl_mvm *mvm,
vif->type != NL80211_IFTYPE_STATION || vif->p2p)
return 0;
+ iwl_mvm_beacon_filter_set_cqm_params(mvm, vif, &cmd);
iwl_mvm_beacon_filter_debugfs_parameters(vif, &cmd);
ret = iwl_mvm_beacon_filter_send_cmd(mvm, &cmd);
if (!ret)
- mvmvif->bf_enabled = true;
+ mvmvif->bf_data.bf_enabled = true;
return ret;
}
@@ -533,11 +553,22 @@ int iwl_mvm_disable_beacon_filter(struct iwl_mvm *mvm,
ret = iwl_mvm_beacon_filter_send_cmd(mvm, &cmd);
if (!ret)
- mvmvif->bf_enabled = false;
+ mvmvif->bf_data.bf_enabled = false;
return ret;
}
+int iwl_mvm_update_beacon_filter(struct iwl_mvm *mvm,
+ struct ieee80211_vif *vif)
+{
+ struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
+
+ if (!mvmvif->bf_data.bf_enabled)
+ return 0;
+
+ return iwl_mvm_enable_beacon_filter(mvm, vif);
+}
+
const struct iwl_mvm_power_ops pm_mac_ops = {
.power_update_mode = iwl_mvm_power_mac_update_mode,
.power_disable = iwl_mvm_power_mac_disable,
diff --git a/drivers/net/wireless/iwlwifi/mvm/rx.c b/drivers/net/wireless/iwlwifi/mvm/rx.c
index ee6547d..2a8cb5a 100644
--- a/drivers/net/wireless/iwlwifi/mvm/rx.c
+++ b/drivers/net/wireless/iwlwifi/mvm/rx.c
@@ -396,11 +396,62 @@ static void iwl_mvm_update_rx_statistics(struct iwl_mvm *mvm,
memcpy(&mvm->rx_stats, &stats->rx, sizeof(struct mvm_statistics_rx));
}
+struct iwl_mvm_stat_data {
+ struct iwl_notif_statistics *stats;
+ struct iwl_mvm *mvm;
+};
+
+static void iwl_mvm_stat_iterator(void *_data, u8 *mac,
+ struct ieee80211_vif *vif)
+{
+ struct iwl_mvm_stat_data *data = _data;
+ struct iwl_notif_statistics *stats = data->stats;
+ struct iwl_mvm *mvm = data->mvm;
+ int sig = -stats->general.beacon_filter_average_energy;
+ int last_event;
+ int thold = vif->bss_conf.cqm_rssi_thold;
+ int hyst = vif->bss_conf.cqm_rssi_hyst;
+ u16 id = le32_to_cpu(stats->rx.general.mac_id);
+ struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
+
+ if (mvmvif->id != id)
+ return;
+
+ if (vif->type != NL80211_IFTYPE_STATION)
+ return;
+
+ mvmvif->bf_data.ave_beacon_signal = sig;
+
+ if (!(vif->driver_flags & IEEE80211_VIF_SUPPORTS_CQM_RSSI))
+ return;
+
+ /* CQM Notification */
+ last_event = mvmvif->bf_data.last_cqm_event;
+ if (thold && sig < thold && (last_event == 0 ||
+ sig < last_event - hyst)) {
+ mvmvif->bf_data.last_cqm_event = sig;
+ IWL_DEBUG_RX(mvm, "cqm_iterator cqm low %d\n",
+ sig);
+ ieee80211_cqm_rssi_notify(
+ vif,
+ NL80211_CQM_RSSI_THRESHOLD_EVENT_LOW,
+ GFP_KERNEL);
+ } else if (sig > thold &&
+ (last_event == 0 || sig > last_event + hyst)) {
+ mvmvif->bf_data.last_cqm_event = sig;
+ IWL_DEBUG_RX(mvm, "cqm_iterator cqm high %d\n",
+ sig);
+ ieee80211_cqm_rssi_notify(
+ vif,
+ NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH,
+ GFP_KERNEL);
+ }
+}
+
/*
* iwl_mvm_rx_statistics - STATISTICS_NOTIFICATION handler
*
* TODO: This handler is implemented partially.
- * It only gets the NIC's temperature.
*/
int iwl_mvm_rx_statistics(struct iwl_mvm *mvm,
struct iwl_rx_cmd_buffer *rxb,
@@ -409,6 +460,10 @@ int iwl_mvm_rx_statistics(struct iwl_mvm *mvm,
struct iwl_rx_packet *pkt = rxb_addr(rxb);
struct iwl_notif_statistics *stats = (void *)&pkt->data;
struct mvm_statistics_general_common *common = &stats->general.common;
+ struct iwl_mvm_stat_data data = {
+ .stats = stats,
+ .mvm = mvm,
+ };
if (mvm->temperature != le32_to_cpu(common->temperature)) {
mvm->temperature = le32_to_cpu(common->temperature);
@@ -416,5 +471,9 @@ int iwl_mvm_rx_statistics(struct iwl_mvm *mvm,
}
iwl_mvm_update_rx_statistics(mvm, stats);
+ ieee80211_iterate_active_interfaces(mvm->hw,
+ IEEE80211_IFACE_ITER_NORMAL,
+ iwl_mvm_stat_iterator,
+ &data);
return 0;
}
--
1.8.4.rc2
^ permalink raw reply related
* [PATCH 15/20] iwlwifi: mvm: refactor resume from WoWLAN code
From: Johannes Berg @ 2013-08-16 11:07 UTC (permalink / raw)
To: linux-wireless; +Cc: Johannes Berg
In-Reply-To: <1376651230-1060-1-git-send-email-johannes@sipsolutions.net>
From: Johannes Berg <johannes.berg@intel.com>
To be able to add more logic to the resume code, refactor it a bit,
moving some status checking/reporting logic into a new function.
The locking becomes a bit odd (one of the new functions now unlocks
the mutex) but this will be required to call new mac80211 APIs in
there later.
Reviewed-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
drivers/net/wireless/iwlwifi/mvm/d3.c | 151 ++++++++++++++++++++--------------
1 file changed, 88 insertions(+), 63 deletions(-)
diff --git a/drivers/net/wireless/iwlwifi/mvm/d3.c b/drivers/net/wireless/iwlwifi/mvm/d3.c
index ebf7f94..ec07f0a 100644
--- a/drivers/net/wireless/iwlwifi/mvm/d3.c
+++ b/drivers/net/wireless/iwlwifi/mvm/d3.c
@@ -1104,73 +1104,16 @@ int iwl_mvm_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan)
return __iwl_mvm_suspend(hw, wowlan, false);
}
-static void iwl_mvm_query_wakeup_reasons(struct iwl_mvm *mvm,
- struct ieee80211_vif *vif)
+static void iwl_mvm_report_wakeup_reasons(struct iwl_mvm *mvm,
+ struct ieee80211_vif *vif,
+ struct iwl_wowlan_status *status)
{
- u32 base = mvm->error_event_table;
- struct error_table_start {
- /* cf. struct iwl_error_event_table */
- u32 valid;
- u32 error_id;
- } err_info;
+ struct sk_buff *pkt = NULL;
struct cfg80211_wowlan_wakeup wakeup = {
.pattern_idx = -1,
};
struct cfg80211_wowlan_wakeup *wakeup_report = &wakeup;
- struct iwl_host_cmd cmd = {
- .id = WOWLAN_GET_STATUSES,
- .flags = CMD_SYNC | CMD_WANT_SKB,
- };
- struct iwl_wowlan_status *status;
- u32 reasons;
- int ret, len;
- struct sk_buff *pkt = NULL;
-
- iwl_trans_read_mem_bytes(mvm->trans, base,
- &err_info, sizeof(err_info));
-
- if (err_info.valid) {
- IWL_INFO(mvm, "error table is valid (%d)\n",
- err_info.valid);
- if (err_info.error_id == RF_KILL_INDICATOR_FOR_WOWLAN) {
- wakeup.rfkill_release = true;
- ieee80211_report_wowlan_wakeup(vif, &wakeup,
- GFP_KERNEL);
- }
- return;
- }
-
- /* only for tracing for now */
- ret = iwl_mvm_send_cmd_pdu(mvm, OFFLOADS_QUERY_CMD, CMD_SYNC, 0, NULL);
- if (ret)
- IWL_ERR(mvm, "failed to query offload statistics (%d)\n", ret);
-
- ret = iwl_mvm_send_cmd(mvm, &cmd);
- if (ret) {
- IWL_ERR(mvm, "failed to query status (%d)\n", ret);
- return;
- }
-
- /* RF-kill already asserted again... */
- if (!cmd.resp_pkt)
- return;
-
- len = le32_to_cpu(cmd.resp_pkt->len_n_flags) & FH_RSCSR_FRAME_SIZE_MSK;
- if (len - sizeof(struct iwl_cmd_header) < sizeof(*status)) {
- IWL_ERR(mvm, "Invalid WoWLAN status response!\n");
- goto out;
- }
-
- status = (void *)cmd.resp_pkt->data;
-
- if (len - sizeof(struct iwl_cmd_header) !=
- sizeof(*status) +
- ALIGN(le32_to_cpu(status->wake_packet_bufsize), 4)) {
- IWL_ERR(mvm, "Invalid WoWLAN status response!\n");
- goto out;
- }
-
- reasons = le32_to_cpu(status->wakeup_reasons);
+ u32 reasons = le32_to_cpu(status->wakeup_reasons);
if (reasons == IWL_WOWLAN_WAKEUP_BY_NON_WIRELESS) {
wakeup_report = NULL;
@@ -1233,6 +1176,12 @@ static void iwl_mvm_query_wakeup_reasons(struct iwl_mvm *mvm,
pktsize -= hdrlen;
if (ieee80211_has_protected(hdr->frame_control)) {
+ /*
+ * This is unlocked and using gtk_i(c)vlen,
+ * but since everything is under RTNL still
+ * that's not really a problem - changing
+ * it would be difficult.
+ */
if (is_multicast_ether_addr(hdr->addr1)) {
ivlen = mvm->gtk_ivlen;
icvlen += mvm->gtk_icvlen;
@@ -1283,9 +1232,82 @@ static void iwl_mvm_query_wakeup_reasons(struct iwl_mvm *mvm,
report:
ieee80211_report_wowlan_wakeup(vif, wakeup_report, GFP_KERNEL);
kfree_skb(pkt);
+}
- out:
+/* releases the MVM mutex */
+static void iwl_mvm_query_wakeup_reasons(struct iwl_mvm *mvm,
+ struct ieee80211_vif *vif)
+{
+ u32 base = mvm->error_event_table;
+ struct error_table_start {
+ /* cf. struct iwl_error_event_table */
+ u32 valid;
+ u32 error_id;
+ } err_info;
+ struct iwl_host_cmd cmd = {
+ .id = WOWLAN_GET_STATUSES,
+ .flags = CMD_SYNC | CMD_WANT_SKB,
+ };
+ struct iwl_wowlan_status *status;
+ int ret, len;
+
+ iwl_trans_read_mem_bytes(mvm->trans, base,
+ &err_info, sizeof(err_info));
+
+ if (err_info.valid) {
+ IWL_INFO(mvm, "error table is valid (%d)\n",
+ err_info.valid);
+ if (err_info.error_id == RF_KILL_INDICATOR_FOR_WOWLAN) {
+ struct cfg80211_wowlan_wakeup wakeup = {
+ .rfkill_release = true,
+ };
+ ieee80211_report_wowlan_wakeup(vif, &wakeup,
+ GFP_KERNEL);
+ }
+ goto out_unlock;
+ }
+
+ /* only for tracing for now */
+ ret = iwl_mvm_send_cmd_pdu(mvm, OFFLOADS_QUERY_CMD, CMD_SYNC, 0, NULL);
+ if (ret)
+ IWL_ERR(mvm, "failed to query offload statistics (%d)\n", ret);
+
+ ret = iwl_mvm_send_cmd(mvm, &cmd);
+ if (ret) {
+ IWL_ERR(mvm, "failed to query status (%d)\n", ret);
+ goto out_unlock;
+ }
+
+ /* RF-kill already asserted again... */
+ if (!cmd.resp_pkt)
+ goto out_unlock;
+
+ len = le32_to_cpu(cmd.resp_pkt->len_n_flags) & FH_RSCSR_FRAME_SIZE_MSK;
+ if (len - sizeof(struct iwl_cmd_header) < sizeof(*status)) {
+ IWL_ERR(mvm, "Invalid WoWLAN status response!\n");
+ goto out_free_resp;
+ }
+
+ status = (void *)cmd.resp_pkt->data;
+
+ if (len - sizeof(struct iwl_cmd_header) !=
+ sizeof(*status) +
+ ALIGN(le32_to_cpu(status->wake_packet_bufsize), 4)) {
+ IWL_ERR(mvm, "Invalid WoWLAN status response!\n");
+ goto out_free_resp;
+ }
+
+ /* now we have all the data we need, unlock to avoid mac80211 issues */
+ mutex_unlock(&mvm->mutex);
+
+ iwl_mvm_report_wakeup_reasons(mvm, vif, status);
+ iwl_free_resp(&cmd);
+ return;
+
+ out_free_resp:
iwl_free_resp(&cmd);
+ out_unlock:
+ mutex_unlock(&mvm->mutex);
}
static void iwl_mvm_read_d3_sram(struct iwl_mvm *mvm)
@@ -1342,10 +1364,13 @@ static int __iwl_mvm_resume(struct iwl_mvm *mvm, bool test)
iwl_mvm_read_d3_sram(mvm);
iwl_mvm_query_wakeup_reasons(mvm, vif);
+ /* has unlocked the mutex, so skip that */
+ goto out;
out_unlock:
mutex_unlock(&mvm->mutex);
+ out:
if (!test && vif)
ieee80211_resume_disconnect(vif);
--
1.8.4.rc2
^ permalink raw reply related
* Kernel panic with skbuff and rtl8180 on Linux 3.10.5
From: Vedant Lath @ 2013-08-16 12:01 UTC (permalink / raw)
To: linux-wireless; +Cc: John W. Linville
Hi all,
I am getting kernel panics related to the rtl8180 driver. I have a
RTL8185 card in my desktop and am using debian testing with kernel
version 3.10.5.
[112535.772055] skbuff: skb_over_panic: text:ffffffffa0470850 len:2475
put:2475 head:ffff8802c72f2cc0 data:ffff8802c72f2d00 tail:0x9eb
end:0x980 dev:<NULL>
[112535.772123] ------------[ cut here ]------------
[112535.772239] kernel BUG at
/build/linux-4aFT2B/linux-3.10.5/net/core/skbuff.c:126!
[112535.772391] invalid opcode: 0000 [#1] SMP
[112535.772494] Modules linked in: snd_usb_audio snd_usbmidi_lib
usb_storage xt_TCPMSS xt_tcpmss iptable_mangle pppoe pppox parport_pc
parport nfnetlink_queue nfnetlink_log nfnetlink pci_stub vboxpci(O)
vboxnetadp(O) vboxnetflt(O) vboxdrv(O) binfmt_misc xt_nat xt_tcpudp
ipt_MASQUERADE iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4
nf_nat_ipv4 nf_nat nf_conntrack ip_tables x_tables ppp_generic slhc
netconsole configfs loop fuse snd_hda_codec_hdmi snd_hda_codec_realtek
arc4 snd_hda_intel acpi_cpufreq snd_hda_codec snd_hwdep mperf
processor rtl8180 kvm_amd kvm snd_seq_midi snd_pcm_oss
snd_seq_midi_event snd_mixer_oss snd_rawmidi snd_pcm sp5100_tco
mac80211 radeon cfg80211 snd_seq ttm drm_kms_helper drm asus_atk0110
edac_mce_amd thermal_sys eeprom_93cx6 snd_page_alloc snd_seq_device
edac_core rfkill i2c_algo_bit
[112535.774487] i2c_piix4 evdev shpchp cdc_acm i2c_core k10temp
snd_timer snd wmi soundcore microcode button hid_generic usbhid hid
ext4 crc16 jbd2 mbcache sg sd_mod crc_t10dif dm_mod ahci libahci
firewire_ohci dmfe r8169 mii firewire_core crc_itu_t ehci_pci ohci_hcd
ehci_hcd libata scsi_mod usbcore usb_common [last unloaded: pcspkr]
[112535.775371] CPU: 3 PID: 0 Comm: swapper/3 Tainted: G O
3.10-2-amd64 #1 Debian 3.10.5-1
[112535.775545] Hardware name: System manufacturer System Product
Name/M4A89GTD-PRO, BIOS 2101 04/08/2011
[112535.775733] task: ffff88040f4fc7c0 ti: ffff88040f520000 task.ti:
ffff88040f520000
[112535.775882] RIP: 0010:[<ffffffff8138615d>] [<ffffffff8138615d>]
skb_panic+0x5a/0x5c
[112535.776054] RSP: 0018:ffff88041fcc3e60 EFLAGS: 00010092
[112535.776163] RAX: 000000000000008b RBX: ffff88040eade660 RCX:
0000000000000000
[112535.776305] RDX: 00000000000400f6 RSI: ffff88041fccdfb8 RDI:
0000000000000046
[112535.776446] RBP: ffff88040eadf800 R08: 0000000000000004 R09:
00000000001c9674
[112535.776589] R10: ffff88040e3c5ac0 R11: 00000000c6526802 R12:
ffff88040a492cc0
[112535.776733] R13: ffff88040cdbe2c0 R14: ffff8800cf84a160 R15:
ffff88040eadf800
[112535.776878] FS: 00007fd1719db700(0000) GS:ffff88041fcc0000(0000)
knlGS:00000000f73beb40
[112535.777039] CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
[112535.777156] CR2: 00007f1cab7f0000 CR3: 000000040e405000 CR4:
00000000000007e0
[112535.777299] DR0: 0000000000000000 DR1: 0000000000000000 DR2:
0000000000000000
[112535.777444] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7:
0000000000000400
[112535.777584] Stack:
[112535.777631] ffff8802c72f2d00 00000000000009eb 0000000000000980
ffffffff8150b3d2
[112535.777818] ffffffff812bb64a ffffffffa0470850 0000000000000000
ffff88041fcc3eb0
[112535.777998] 100509ab1fcc3f20 0088a9140000001f 0000000000000000
0000000000000000
[112535.778179] Call Trace:
[112535.778237] <IRQ>
[112535.778286]
[112535.778335] [<ffffffff812bb64a>] ? skb_put+0x3a/0x3b
[112535.778428] [<ffffffffa0470850>] ? rtl8180_interrupt+0x14a/0x29d [rtl8180]
[112535.778581] [<ffffffff810996fd>] ? handle_irq_event_percpu+0x49/0x1a4
[112535.778717] [<ffffffff8109988a>] ? handle_irq_event+0x32/0x4b
[112535.778842] [<ffffffff8109bd76>] ? handle_fasteoi_irq+0x80/0xb6
[112535.778969] [<ffffffff8100e93e>] ? handle_irq+0x18/0x20
[112535.779082] [<ffffffff8100e657>] ? do_IRQ+0x40/0x95
[112535.779188] [<ffffffff813883ed>] ? common_interrupt+0x6d/0x6d
[112535.779304] <EOI>
[112535.779354]
[112535.779403] [<ffffffff8102e385>] ? native_safe_halt+0x2/0x3
[112535.779497] [<ffffffff810133f6>] ? default_idle+0x17/0x3f
[112535.779612] [<ffffffff810134cd>] ? amd_e400_idle+0xaf/0xd1
[112535.779731] [<ffffffff81072571>] ? cpu_startup_entry+0x10d/0x187
[112535.779859] [<ffffffff81378f4c>] ? start_secondary+0x1df/0x1e3
[112535.779979] Code: 00 00 48 89 44 24 10 8b 87 d8 00 00 00 48 89 44
24 08 48 8b 87 e8 00 00 00 48 c7 c7 e6 5d 53 81 48 89 04 24 31 c0 e8
c5 c5 ff ff <0f> 0b 0f 0b 41 55 41 54 55 53 48 89 fb 48 83 ec 28 48 8b
6f 20
[112535.780930] RIP [<ffffffff8138615d>] skb_panic+0x5a/0x5c
[112535.781054] RSP <ffff88041fcc3e60>
This seems weird because rtl8180 is associated with wlan0 on my system
yet the skbuff message says dev:<NULL>.
I've got kernel panics about 20 times in the last month but had not
been able to find the first oops message until now. Most of the time
the panic happened when the monitor was in sleep mode so I wasn't able
to see the oops. Other times, a useless
drm_fb_helper_restore_fbdev_mode oops hid the first oops. I then set
up kdump to get the oops. I suspect the rest of the panics have also
been due to this.
I don't have any steps to reproduce; it seems entirely random.
Sometimes it happens after weeks, sometimes within 10 minutes. There's
also zero traffic on the wlan0 interface as it is in managed mode and
not associated to any access point.
I have the full memory dump taken after the crash and an associated
vmlinux file in case we need it to troubleshoot this further.
Thanks and regards
Vedant Lath
^ permalink raw reply
* iwlwifi (Centrino Ultimate-N 6300) broken for kernels > 3.7
From: Frank van Maarseveen @ 2013-08-16 12:30 UTC (permalink / raw)
To: linux-wireless
Hi,
On 3.7.9 iwlwifi for the Intel Centrino Ultimate-N 6300 works. On
3.8.latest, 3.9.latest and 3.10.latest it doesn't. Symptom: NetworkManager
keeps on asking for a password.
/var/log/messages:
Aug 16 11:48:33 pcfvm kernel: [ 110.025291] wlan1: authenticate with 00:23:4e:33:8b:7d
Aug 16 11:48:33 pcfvm NetworkManager[1196]: <info> (wlan1): supplicant connection state: disconnected -> associating
Aug 16 11:48:33 pcfvm kernel: [ 110.036263] wlan1: send auth to 00:23:4e:33:8b:7d (try 1/3)
Aug 16 11:48:33 pcfvm gnome-keyring-daemon[2053]: couldn't allocate secure memory to keep passwords and or keys from being written
Aug 16 11:48:33 pcfvm kernel: [ 110.061782] wlan1: send auth to 00:23:4e:33:8b:7d (try 2/3)
Aug 16 11:48:33 pcfvm kernel: [ 110.087120] wlan1: send auth to 00:23:4e:33:8b:7d (try 3/3)
Aug 16 11:48:33 pcfvm kernel: [ 110.106771] wlan1: authentication with 00:23:4e:33:8b:7d timed out
Aug 16 11:48:53 pcfvm NetworkManager[1196]: <info> (wlan1): supplicant connection state: associating -> disconnected
Aug 16 11:48:53 pcfvm NetworkManager[1196]: <info> (wlan1): supplicant connection state: disconnected -> scanning
Aug 16 11:48:56 pcfvm NetworkManager[1196]: <info> (wlan1): supplicant connection state: scanning -> associating
Aug 16 11:48:56 pcfvm kernel: [ 132.643461] wlan1: authenticate with 00:23:4e:33:8b:7d
Aug 16 11:48:56 pcfvm kernel: [ 132.658207] wlan1: send auth to 00:23:4e:33:8b:7d (try 1/3)
Aug 16 11:48:56 pcfvm kernel: [ 132.685211] wlan1: send auth to 00:23:4e:33:8b:7d (try 2/3)
Aug 16 11:48:56 pcfvm kernel: [ 132.709573] wlan1: send auth to 00:23:4e:33:8b:7d (try 3/3)
Aug 16 11:48:56 pcfvm kernel: [ 132.733577] wlan1: authentication with 00:23:4e:33:8b:7d timed out
An ath9k card in the same laptop works with kernel 3.10.7.
kernel startup messages differ slightly:
kernel: [...] Linux version 3.7.9 (works)
kernel: [...] cfg80211: Calling CRDA to update world regulatory domain
kernel: [...] Intel(R) Wireless WiFi driver for Linux, in-tree:
kernel: [...] Copyright(c) 2003-2012 Intel Corporation
kernel: [...] iwlwifi 0000:04:00.0: pci_resource_len = 0x00002000
kernel: [...] iwlwifi 0000:04:00.0: pci_resource_base = faab0000
kernel: [...] iwlwifi 0000:04:00.0: HW Revision ID = 0x35
kernel: [...] cfg80211: World regulatory domain updated:
kernel: [...] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
kernel: [...] cfg80211: (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
kernel: [...] cfg80211: (2457000 KHz - 2482000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
kernel: [...] cfg80211: (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
kernel: [...] cfg80211: (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
kernel: [...] cfg80211: (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
kernel: [...] iwlwifi 0000:04:00.0: loaded firmware version 9.221.4.1 build 25532
kernel: [...] iwldvm: Intel(R) Wireless WiFi Link AGN driver for Linux, in-tree:
kernel: [...] iwldvm: Copyright(c) 2003-2012 Intel Corporation
kernel: [...] iwlwifi 0000:04:00.0: CONFIG_IWLWIFI_DEBUG disabled
kernel: [...] iwlwifi 0000:04:00.0: CONFIG_IWLWIFI_DEBUGFS enabled
kernel: [...] iwlwifi 0000:04:00.0: CONFIG_IWLWIFI_DEVICE_TRACING disabled
kernel: [...] iwlwifi 0000:04:00.0: CONFIG_IWLWIFI_DEVICE_TESTMODE enabled
kernel: [...] iwlwifi 0000:04:00.0: CONFIG_IWLWIFI_P2P disabled
kernel: [...] iwlwifi 0000:04:00.0: Detected Intel(R) Centrino(R) Ultimate-N 6300 AGN, REV=0x74
kernel: [...] iwlwifi 0000:04:00.0: L1 Enabled; Disabling L0S
kernel: [...] iwlwifi 0000:04:00.0: device EEPROM VER=0x436, CALIB=0x6
kernel: [...] iwlwifi 0000:04:00.0: Device SKU: 0x1F0
kernel: [...] iwlwifi 0000:04:00.0: Valid Tx ant: 0x7, Valid Rx ant: 0x7
kernel: [...] cfg80211: Calling CRDA for country: NL
kernel: [...] cfg80211: Regulatory domain changed to country: NL
kernel: [...] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
kernel: [...] cfg80211: (2402000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm)
kernel: [...] cfg80211: (5170000 KHz - 5250000 KHz @ 40000 KHz), (N/A, 2000 mBm)
kernel: [...] cfg80211: (5250000 KHz - 5330000 KHz @ 40000 KHz), (N/A, 2000 mBm)
kernel: [...] cfg80211: (5490000 KHz - 5710000 KHz @ 40000 KHz), (N/A, 2700 mBm)
kernel: [...] Linux version 3.8.13 (iwlwifi doesn't work)
kernel: [...] cfg80211: Calling CRDA to update world regulatory domain
kernel: [...] Intel(R) Wireless WiFi driver for Linux, in-tree:
kernel: [...] Copyright(c) 2003-2012 Intel Corporation
kernel: [...] cfg80211: World regulatory domain updated:
kernel: [...] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
kernel: [...] cfg80211: (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
kernel: [...] cfg80211: (2457000 KHz - 2482000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
kernel: [...] cfg80211: (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
kernel: [...] cfg80211: (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
kernel: [...] cfg80211: (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
kernel: [...] iwlwifi 0000:04:00.0: loaded firmware version 9.221.4.1 build 25532
kernel: [...] iwlwifi 0000:04:00.0: CONFIG_IWLWIFI_DEBUG disabled
kernel: [...] iwlwifi 0000:04:00.0: CONFIG_IWLWIFI_DEBUGFS enabled
kernel: [...] iwlwifi 0000:04:00.0: CONFIG_IWLWIFI_DEVICE_TRACING disabled
kernel: [...] iwlwifi 0000:04:00.0: CONFIG_IWLWIFI_DEVICE_TESTMODE enabled
kernel: [...] iwlwifi 0000:04:00.0: CONFIG_IWLWIFI_P2P disabled
kernel: [...] iwlwifi 0000:04:00.0: Detected Intel(R) Centrino(R) Ultimate-N 6300 AGN, REV=0x74
kernel: [...] iwlwifi 0000:04:00.0: L1 Enabled; Disabling L0S
kernel: [...] cfg80211: Calling CRDA for country: NL
kernel: [...] cfg80211: Regulatory domain changed to country: NL
kernel: [...] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
kernel: [...] cfg80211: (2402000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm)
kernel: [...] cfg80211: (5170000 KHz - 5250000 KHz @ 40000 KHz), (N/A, 2000 mBm)
kernel: [...] cfg80211: (5250000 KHz - 5330000 KHz @ 40000 KHz), (N/A, 2000 mBm)
kernel: [...] cfg80211: (5490000 KHz - 5710000 KHz @ 40000 KHz), (N/A, 2700 mBm)
I don't see any EEPROM/antenna messages. "rfkill list" confirms there are no blocks.
--
Frank
^ permalink raw reply
* Re: [PATCHv2 4/6] mac80211: add support for CSA in IBSS mode
From: Simon Wunderlich @ 2013-08-16 13:36 UTC (permalink / raw)
To: Johannes Berg
Cc: Simon Wunderlich, linux-wireless, Mathias Kretschmer,
Simon Wunderlich
In-Reply-To: <1376649188.15299.11.camel@jlt4.sipsolutions.net>
[-- Attachment #1: Type: text/plain, Size: 3393 bytes --]
Hey Johannes,
thanks for the comments!
On Fri, Aug 16, 2013 at 12:33:08PM +0200, Johannes Berg wrote:
> On Fri, 2013-08-09 at 16:35 +0200, Simon Wunderlich wrote:
> > Ths
>
> This ;-)
>
yeah ... ;)
>
> > + case NL80211_IFTYPE_ADHOC:
> > + if (!sdata->vif.bss_conf.ibss_joined)
> > + return -EINVAL;
> > +
> > + if (params->chandef.width != sdata->u.ibss.chandef.width)
> > + return -EINVAL;
> > +
> > + switch (params->chandef.width) {
> > + case NL80211_CHAN_WIDTH_40:
> > + if (cfg80211_get_chandef_type(¶ms->chandef) !=
> > + cfg80211_get_chandef_type(&sdata->u.ibss.chandef))
> > + return -EINVAL;
>
> Is that really correct? It seems that you should be able to switch from
> HT40- to HT40+ and vice versa when switching the channel?
Hmm ... changing HT40+/- can only be represented by using either ECSA (which i did not
implement) or secondary channel offsets in action frames (which comes in a later
patch, but could be merged ...). Secondary channel offsets are not allowed in
beacon/presp, and therefore the client would keep the current mode (HT40+ or HT40-)
as announced in the HT IEs of the beacon/presp. If I add support for secondary channel
offsets in the action frames, the beacons and action frames would contradict, and that
would not be good either.
So I thought it is easier to forbid this case and avoid this mess. :)
>
> And why disallow switching bandwidth (was above this code)? That doesn't
> seem right either?
IEEE 802.11-2012 10.9.8.3 says:
"A 20/40 MHz IBSS cannot be changed to a 20 MHz IBSS, and a 20 MHz IBSS cannot be changed to a 20/40 MHz IBSS."
Also I don't want to allow to switch to a 5 MHz/10 MHz channel or other funky stuff.
> > +/* must hold sdata lock */
>
> pretty useless comment if you have the assert in the function :)
>
Right, I'll remove it. :)
> > + rcu_read_lock();
> > + ies = rcu_dereference(cbss->ies);
> > + tsf = ies->tsf;
> > + rcu_read_unlock();
> > + cfg80211_put_bss(sdata->local->hw.wiphy, cbss);
> > +
> > + old_presp = rcu_dereference_protected(ifibss->presp,
> > + lockdep_is_held(&sdata->wdev.mtx));
> > +
> > + presp = ieee80211_ibss_build_presp(sdata,
> > + sdata->vif.bss_conf.beacon_int,
> > + sdata->vif.bss_conf.basic_rates,
> > + capability, tsf, &ifibss->chandef,
> > + NULL, csa_settings);
>
> This is pretty odd - why does the TSF have to go here? It needs to be
> set by the device when transmitting anyway, no?
>
TBH I don't understand the TSF magic completely, but as far as I know it is
used for IBSS cell merging. What we don't want is to change the tsf when
generating the new beacon and therefore (accidently) kick of some merging process.
Therefore I'm keeping the TSF just as in ieee80211_sta_join_ibss().
ieee80211_ibss_build_presp() needs to put in the beacon, so I need to supply some
valid TSF, don't I?
> > +static void ieee80211_ibss_disconnect(struct ieee80211_sub_if_data *sdata)
> > +{
>
> Is this some refactoring that should be separate? I don't see how it's
> really related to CSA? Maybe I'm missing something?
The only relation is that I need it refactored for IBSS/CSA. Disconnecting for
some reason and going back to search mode wasn't required so far.
I can put that in a separate patchset.
Thanks,
Simon
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply
* Re: Signal loss rtl8723ae wifi driver
From: poma @ 2013-08-16 14:27 UTC (permalink / raw)
To: Larry Finger; +Cc: Phillip Moss, linux-wireless
In-Reply-To: <520AF842.8030403@lwfinger.net>
On 14.08.2013 05:23, Larry Finger wrote:
…
>
> Why is your device name "wlp3s0", rather than the usual "wlanX"? What is
> controlling your connection. If it is wicd, note that I do not support
> that piece of software. I use NetworkManager.
>
…
Probably systemd-udevd, not quite to control, but renames it.
http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/
http://cgit.freedesktop.org/systemd/systemd/tree/src/udev/udev-builtin-net_id.c#n72
Literally a textbook example, at least on Fedora. ;)
You really did not know about this?
poma
^ permalink raw reply
* Re: Signal loss rtl8723ae wifi driver
From: Larry Finger @ 2013-08-16 14:40 UTC (permalink / raw)
To: poma; +Cc: Phillip Moss, linux-wireless
In-Reply-To: <520E36E1.1030704@gmail.com>
On 08/16/2013 09:27 AM, poma wrote:
> On 14.08.2013 05:23, Larry Finger wrote:
> …
>>
>> Why is your device name "wlp3s0", rather than the usual "wlanX"? What is
>> controlling your connection. If it is wicd, note that I do not support
>> that piece of software. I use NetworkManager.
>>
> …
> Probably systemd-udevd, not quite to control, but renames it.
> http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/
> http://cgit.freedesktop.org/systemd/systemd/tree/src/udev/udev-builtin-net_id.c#n72
> Literally a textbook example, at least on Fedora. ;)
> You really did not know about this?
Nope. I am not a Fedora user, and openSUSE only renames to wlanX.
Larry
^ permalink raw reply
* Re: [GIT] [3.12] NFC updates
From: Samuel Ortiz @ 2013-08-16 15:20 UTC (permalink / raw)
To: Joe Perches; +Cc: John W. Linville, Linux NFC, Linux Wireless
In-Reply-To: <1376536069.1949.124.camel@joe-AO722>
Hi Joe,
On Wed, Aug 14, 2013 at 08:07:49PM -0700, Joe Perches wrote:
> On Thu, 2013-08-15 at 01:04 +0200, Samuel Ortiz wrote:
> > Hi John,
> >
> > This is the first NFC pull request for the 3.12 release.
>
> Any reason why these reformatting patches were
> not applied?
For some reasons they got lost in my inbox, sorry about that.
I'll review and queue them as soon as I get back to my linux-nfc backlog
(I just got back from vacation today).
Cheers,
Samuel.
--
Intel Open Source Technology Centre
http://oss.intel.com/
^ permalink raw reply
* Re: Kernel Panic with Linux 3.10-6
From: Alexander Mezin @ 2013-08-16 17:11 UTC (permalink / raw)
To: linux-wireless
In-Reply-To: <520C9FE5.6000203@broadcom.com>
Arend van Spriel <arend@...> writes:
>
> On 08/15/2013 03:28 AM, Pedram Navid wrote:
> > With the latest 3.10-6 kernel I am receiving frequent and consistent
> > kernel panics. Downgrading to 3.9.5 resolves the issue.
>
> Thanks, Pedram
>
> I have had a couple of other report about this particular panic and did
> some investigation. It is a divide-by-zero causing the panic. I do have
> a patch to avoid that, but the root cause is something else. Is 3.10.6
> you see this on the unmodified stable release?
>
> The attached patch avoids the panic, but you will probably have crappy
> connectivity.
>
> Regards,
> Arend
>
I've temporarily solved the problem by reverting patch "mac80211/minstrel_ht:
fix cck rate sampling" [1]. After that - no error messages, no panic,
connection works at normal speed.
[1] https://git.kernel.org/cgit/linux/kernel/git/stable/linux-
stable.git/commit/?id=ef47a5e4f1aaf1d0e2e6875e34b2c9595897bef6
^ permalink raw reply
* Re: pull-request: mac80211-next 2013-08-16
From: John W. Linville @ 2013-08-16 18:26 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless
In-Reply-To: <1376650872.15299.20.camel@jlt4.sipsolutions.net>
On Fri, Aug 16, 2013 at 01:01:12PM +0200, Johannes Berg wrote:
> John,
>
> And another set of patches for -next :-)
>
> This time I have various improvements all over the place: IBSS, mesh,
> testmode, AP client powersave handling, one of the rare rfkill patches
> and some code cleanup.
>
> Let me know if there's any problem.
>
> johannes
>
>
>
> The following changes since commit 73da7d5bab79ad7e16ff44d67c3fe8b9c0b33e5b:
>
> mac80211: add channel switch command and beacon callbacks (2013-08-01 18:30:33 +0200)
>
> are available in the git repository at:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next.git for-john
>
> for you to fetch changes up to 27b3eb9c06a7193bdc9800cd00764a130343bc8a:
>
> mac80211: add APIs to allow keeping connections after WoWLAN (2013-08-16 12:58:43 +0200)
Pulling now...
--
John W. Linville Someday the world will need a hero, and you
linville@tuxdriver.com might be all we have. Be ready.
^ permalink raw reply
* [PATCH 1/2] rt2x00: rt2800: rename HW_BEACON_OFFSET macro
From: Gabor Juhos @ 2013-08-16 22:15 UTC (permalink / raw)
To: John W. Linville; +Cc: linux-wireless, users, Gabor Juhos
The name of the HW_BEACON_OFFSET macro is a
bit confusing. It returns with one of the
HW_BEACON_BASE* values, so rename the macro
to HW_BEACON_BASE to reflect that.
The patch contains no functional changes.
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
---
drivers/net/wireless/rt2x00/rt2800.h | 2 +-
drivers/net/wireless/rt2x00/rt2800lib.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/rt2x00/rt2800.h b/drivers/net/wireless/rt2x00/rt2800.h
index a313241..6e69b96 100644
--- a/drivers/net/wireless/rt2x00/rt2800.h
+++ b/drivers/net/wireless/rt2x00/rt2800.h
@@ -2019,7 +2019,7 @@ struct mac_iveiv_entry {
#define HW_BEACON_BASE6 0x5dc0
#define HW_BEACON_BASE7 0x5bc0
-#define HW_BEACON_OFFSET(__index) \
+#define HW_BEACON_BASE(__index) \
(((__index) < 4) ? (HW_BEACON_BASE0 + (__index * 0x0200)) : \
(((__index) < 6) ? (HW_BEACON_BASE4 + ((__index - 4) * 0x0200)) : \
(HW_BEACON_BASE6 - ((__index - 6) * 0x0200))))
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
index fb71ed6..a25862a 100644
--- a/drivers/net/wireless/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
@@ -992,7 +992,7 @@ void rt2800_write_beacon(struct queue_entry *entry, struct txentry_desc *txdesc)
return;
}
- beacon_base = HW_BEACON_OFFSET(entry->entry_idx);
+ beacon_base = HW_BEACON_BASE(entry->entry_idx);
rt2800_register_multiwrite(rt2x00dev, beacon_base, entry->skb->data,
entry->skb->len + padding_len);
@@ -1042,7 +1042,7 @@ void rt2800_clear_beacon(struct queue_entry *entry)
* Clear beacon.
*/
rt2800_clear_beacon_register(rt2x00dev,
- HW_BEACON_OFFSET(entry->entry_idx));
+ HW_BEACON_BASE(entry->entry_idx));
/*
* Enabled beaconing again.
--
1.7.10
^ permalink raw reply related
* [PATCH 2/2] rt2x00: rt2800lib: pass beacon index to rt2800_clear_beacon_register
From: Gabor Juhos @ 2013-08-16 22:15 UTC (permalink / raw)
To: John W. Linville; +Cc: linux-wireless, users, Gabor Juhos
In-Reply-To: <1376691350-19851-1-git-send-email-juhosg@openwrt.org>
Instead of precomputing the beacon base in
each caller, pass the beacon index to the
'rt2800_clear_beacon_register' function
and compute the beacon base in there.
This allows to simplify the caller functions
a bit.
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
---
drivers/net/wireless/rt2x00/rt2800lib.c | 18 +++++++-----------
1 file changed, 7 insertions(+), 11 deletions(-)
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
index a25862a..ea97ac6 100644
--- a/drivers/net/wireless/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
@@ -1011,10 +1011,13 @@ void rt2800_write_beacon(struct queue_entry *entry, struct txentry_desc *txdesc)
EXPORT_SYMBOL_GPL(rt2800_write_beacon);
static inline void rt2800_clear_beacon_register(struct rt2x00_dev *rt2x00dev,
- unsigned int beacon_base)
+ unsigned int index)
{
int i;
const int txwi_desc_size = rt2x00dev->bcn->winfo_size;
+ unsigned int beacon_base;
+
+ beacon_base = HW_BEACON_BASE(index);
/*
* For the Beacon base registers we only need to clear
@@ -1041,8 +1044,7 @@ void rt2800_clear_beacon(struct queue_entry *entry)
/*
* Clear beacon.
*/
- rt2800_clear_beacon_register(rt2x00dev,
- HW_BEACON_BASE(entry->entry_idx));
+ rt2800_clear_beacon_register(rt2x00dev, entry->entry_idx);
/*
* Enabled beaconing again.
@@ -4813,14 +4815,8 @@ static int rt2800_init_registers(struct rt2x00_dev *rt2x00dev)
/*
* Clear all beacons
*/
- rt2800_clear_beacon_register(rt2x00dev, HW_BEACON_BASE0);
- rt2800_clear_beacon_register(rt2x00dev, HW_BEACON_BASE1);
- rt2800_clear_beacon_register(rt2x00dev, HW_BEACON_BASE2);
- rt2800_clear_beacon_register(rt2x00dev, HW_BEACON_BASE3);
- rt2800_clear_beacon_register(rt2x00dev, HW_BEACON_BASE4);
- rt2800_clear_beacon_register(rt2x00dev, HW_BEACON_BASE5);
- rt2800_clear_beacon_register(rt2x00dev, HW_BEACON_BASE6);
- rt2800_clear_beacon_register(rt2x00dev, HW_BEACON_BASE7);
+ for (i = 0; i < 8; i++)
+ rt2800_clear_beacon_register(rt2x00dev, i);
if (rt2x00_is_usb(rt2x00dev)) {
rt2800_register_read(rt2x00dev, US_CYC_CNT, ®);
--
1.7.10
^ permalink raw reply related
* [PATCH 1/8] staging: vt6656: desc.h: Move typedef tagSRrvTime_gRTS to new structure in rxtx.h
From: Malcolm Priestley @ 2013-08-16 20:26 UTC (permalink / raw)
To: gregkh; +Cc: linux-wireless
To new structure.
typedef struct tagSRrvTime_gRTS -> struct vnt_rrv_time_rts
This is only needed by rxtc.c so moved to rxtx.h and
will eventually form part of the structure of
struct vnt_tx_buffer.
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
---
drivers/staging/vt6656/desc.h | 12 ------------
drivers/staging/vt6656/rxtx.c | 30 ++++++++++++++++++------------
drivers/staging/vt6656/rxtx.h | 10 ++++++++++
3 files changed, 28 insertions(+), 24 deletions(-)
diff --git a/drivers/staging/vt6656/desc.h b/drivers/staging/vt6656/desc.h
index d770a78..89b580d 100644
--- a/drivers/staging/vt6656/desc.h
+++ b/drivers/staging/vt6656/desc.h
@@ -146,18 +146,6 @@
/*
* RsvTime buffer header
*/
-typedef struct tagSRrvTime_gRTS {
- u16 wRTSTxRrvTime_ba;
- u16 wRTSTxRrvTime_aa;
- u16 wRTSTxRrvTime_bb;
- u16 wReserved;
- u16 wTxRrvTime_b;
- u16 wTxRrvTime_a;
-} __attribute__ ((__packed__))
-SRrvTime_gRTS, *PSRrvTime_gRTS;
-
-typedef const SRrvTime_gRTS *PCSRrvTime_gRTS;
-
typedef struct tagSRrvTime_gCTS {
u16 wCTSTxRrvTime_ba;
u16 wReserved;
diff --git a/drivers/staging/vt6656/rxtx.c b/drivers/staging/vt6656/rxtx.c
index d9827b3..c9dceae 100644
--- a/drivers/staging/vt6656/rxtx.c
+++ b/drivers/staging/vt6656/rxtx.c
@@ -919,7 +919,8 @@ static void s_vGenerateTxParameter(struct vnt_private *pDevice,
if (pvRTS != NULL) { //RTS_need
//Fill RsvTime
if (pvRrvTime) {
- PSRrvTime_gRTS pBuf = (PSRrvTime_gRTS)pvRrvTime;
+ struct vnt_rrv_time_rts *pBuf =
+ (struct vnt_rrv_time_rts *)pvRrvTime;
pBuf->wRTSTxRrvTime_aa = cpu_to_le16((u16)s_uGetRTSCTSRsvTime(pDevice, 2, byPktType, cbFrameSize, wCurrentRate));//2:RTSTxRrvTime_aa, 1:2.4GHz
pBuf->wRTSTxRrvTime_ba = cpu_to_le16((u16)s_uGetRTSCTSRsvTime(pDevice, 1, byPktType, cbFrameSize, wCurrentRate));//1:RTSTxRrvTime_ba, 1:2.4GHz
pBuf->wRTSTxRrvTime_bb = cpu_to_le16((u16)s_uGetRTSCTSRsvTime(pDevice, 0, byPktType, cbFrameSize, wCurrentRate));//0:RTSTxRrvTime_bb, 1:2.4GHz
@@ -1149,15 +1150,17 @@ static int s_bPacketToWirelessUsb(struct vnt_private *pDevice, u8 byPktType,
if (byPktType == PK_TYPE_11GB || byPktType == PK_TYPE_11GA) {//802.11g packet
if (byFBOption == AUTO_FB_NONE) {
if (bRTS == true) {//RTS_need
- pvRrvTime = (PSRrvTime_gRTS) (pbyTxBufferAddr + wTxBufSize);
- pMICHDR = (PSMICHDRHead) (pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_gRTS));
+ pvRrvTime = (struct vnt_rrv_time_rts *)
+ (pbyTxBufferAddr + wTxBufSize);
+ pMICHDR = (PSMICHDRHead)(pbyTxBufferAddr + wTxBufSize +
+ sizeof(struct vnt_rrv_time_rts));
pvRTS = (struct vnt_rts_g *) (pbyTxBufferAddr + wTxBufSize +
- sizeof(SRrvTime_gRTS) + cbMICHDR);
+ sizeof(struct vnt_rrv_time_rts) + cbMICHDR);
pvCTS = NULL;
pvTxDataHd = (PSTxDataHead_g) (pbyTxBufferAddr + wTxBufSize +
- sizeof(SRrvTime_gRTS) + cbMICHDR +
+ sizeof(struct vnt_rrv_time_rts) + cbMICHDR +
sizeof(struct vnt_rts_g));
- cbHeaderLength = wTxBufSize + sizeof(SRrvTime_gRTS) +
+ cbHeaderLength = wTxBufSize + sizeof(struct vnt_rrv_time_rts) +
cbMICHDR + sizeof(struct vnt_rts_g) +
sizeof(STxDataHead_g);
}
@@ -1176,16 +1179,19 @@ static int s_bPacketToWirelessUsb(struct vnt_private *pDevice, u8 byPktType,
} else {
// Auto Fall Back
if (bRTS == true) {//RTS_need
- pvRrvTime = (PSRrvTime_gRTS) (pbyTxBufferAddr + wTxBufSize);
- pMICHDR = (PSMICHDRHead) (pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_gRTS));
+ pvRrvTime = (struct vnt_rrv_time_rts *)(pbyTxBufferAddr +
+ wTxBufSize);
+ pMICHDR = (PSMICHDRHead) (pbyTxBufferAddr + wTxBufSize +
+ sizeof(struct vnt_rrv_time_rts));
pvRTS = (struct vnt_rts_g_fb *) (pbyTxBufferAddr + wTxBufSize +
- sizeof(SRrvTime_gRTS) + cbMICHDR);
+ sizeof(struct vnt_rrv_time_rts) + cbMICHDR);
pvCTS = NULL;
pvTxDataHd = (PSTxDataHead_g_FB) (pbyTxBufferAddr + wTxBufSize +
- sizeof(SRrvTime_gRTS) + cbMICHDR +
+ sizeof(struct vnt_rrv_time_rts) + cbMICHDR +
sizeof(struct vnt_rts_g_fb));
- cbHeaderLength = wTxBufSize + sizeof(SRrvTime_gRTS) + cbMICHDR +
- sizeof(struct vnt_rts_g_fb) + sizeof(STxDataHead_g_FB);
+ cbHeaderLength = wTxBufSize + sizeof(struct vnt_rrv_time_rts) +
+ cbMICHDR + sizeof(struct vnt_rts_g_fb) +
+ sizeof(STxDataHead_g_FB);
}
else if (bRTS == false) { //RTS_needless
pvRrvTime = (PSRrvTime_gCTS) (pbyTxBufferAddr + wTxBufSize);
diff --git a/drivers/staging/vt6656/rxtx.h b/drivers/staging/vt6656/rxtx.h
index 8fd5be1..8afade2 100644
--- a/drivers/staging/vt6656/rxtx.h
+++ b/drivers/staging/vt6656/rxtx.h
@@ -32,6 +32,16 @@
#include "device.h"
#include "wcmd.h"
+/* RsvTime buffer header */
+struct vnt_rrv_time_rts {
+ u16 wRTSTxRrvTime_ba;
+ u16 wRTSTxRrvTime_aa;
+ u16 wRTSTxRrvTime_bb;
+ u16 wReserved;
+ u16 wTxRrvTime_b;
+ u16 wTxRrvTime_a;
+} __packed;
+
/* RTS buffer header */
struct vnt_rts_g {
u8 bySignalField_b;
--
1.8.1.2
^ permalink raw reply related
* Re: [PATCH] ath9k_htc: fix skb_under_panic error
From: Marc Kleine-Budde @ 2013-08-16 19:32 UTC (permalink / raw)
To: Helmut Schaa; +Cc: Oleksij Rempel, linux-wireless, ath9k-devel
In-Reply-To: <CAGXE3d9p7zkwfNJBJvPMc8XaKnb009pHpCXYweDjK4tv6PCkuA@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 533 bytes --]
Hello,
On 06/05/2013 04:24 PM, Helmut Schaa wrote:
> On Tue, Jun 4, 2013 at 8:37 PM, Oleksij Rempel <linux@rempel-privat.de> wrote:
>> This error seems to be really rare, and we do not know real couse of it.
>> But, in any case, we should check size of head before reducing it.
>
> Mind to try the (completely untested) patch against wireless-testing instead?
> Helmut
I'm running a kernel with a slightly modified version of that patch for
4 weeks without problems so far. I'll send a mail with that patch.
Marc
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 897 bytes --]
^ permalink raw reply
* Re: Fwd: [Bug 989269] Connecting to WLAN causes kernel panic
From: Arend van Spriel @ 2013-08-16 20:47 UTC (permalink / raw)
To: Felix Fietkau; +Cc: linux-wireless, John W. Linville, John Greene
In-Reply-To: <51F8D438.7020304@openwrt.org>
On 07/31/2013 11:09 AM, Felix Fietkau wrote:
> On 2013-07-31 10:39 AM, Arend van Spriel wrote:
>> Hi Felix,
>>
>> How are things in OpenWRT. I wanted to ask you something regarding a
>> defect I am looking at. Since kernel 3.9 several reports have been made
>> about a kernel panic in brcmsmac, ie. a divide-by-zero error.
> 3.9 was the first kernel to support CCK rates in minstrel_ht as
> fallback (in case the link gets very bad). Not sure if that triggers
> anything weird in brcmsmac.
>
>> Debugging the issue shows we end up with a rate with MCS index 110,
>> which is, well, impossible.
> Did you verify that it comes directly from minstrel_ht, or does it show
> up somewhere further down the chain in brcmsmac?
>
>> As brcmsmac gets the rate info from
>> minstrel_ht I was wondering if we have an intergration issue here. I saw
>> around April patches about new API which may have been in the 3.9 time
>> frame and something subtly changed things for brcmsmac.
> The new rate API was added in 3.10, not 3.9. It did add bug that caused
> bogus MCS rates. I've sent a patch for this a while back (shortly
> before 3.10 was released), but it was too late to make it into the
> release. I guess we have to wait for it to be applied through stable -
> no idea why that hasn't happened yet.
Reportedly the problem still exists in 3.10.6 and 3.11-rc4. So I started
digging some more. So can you have a look at the rate table below that
we setup in the wiphy structure:
static struct ieee80211_rate legacy_ratetable[] = {
RATE(10, 0),
RATE(20, IEEE80211_RATE_SHORT_PREAMBLE),
RATE(55, IEEE80211_RATE_SHORT_PREAMBLE),
RATE(110, IEEE80211_RATE_SHORT_PREAMBLE),
RATE(60, 0),
RATE(90, 0),
RATE(120, 0),
RATE(180, 0),
RATE(240, 0),
RATE(360, 0),
RATE(480, 0),
RATE(540, 0),
};
where RATE() is defined as:
#define RATE(rate100m, _flags) { \
.bitrate = (rate100m), \
.flags = (_flags), \
.hw_value = (rate100m / 5), \
}
Do you see anything obviously wrong here from minstrel_ht perspective?
Regards,
Arend
> Here is the fix:
>
> commit 1cd158573951f737fbc878a35cb5eb47bf9af3d5
> Author: Felix Fietkau <nbd@openwrt.org>
> Date: Fri Jun 28 21:04:35 2013 +0200
>
> mac80211/minstrel_ht: fix cck rate sampling
>
> The CCK group needs special treatment to set the right flags and rate
> index. Add this missing check to prevent setting broken rates for tx
> packets.
>
> Cc: stable@vger.kernel.org # 3.10
> Signed-off-by: Felix Fietkau <nbd@openwrt.org>
> Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
>
> diff --git a/net/mac80211/rc80211_minstrel_ht.c b/net/mac80211/rc80211_minstrel_ht.c
> index 5b2d301..f5aed96 100644
> --- a/net/mac80211/rc80211_minstrel_ht.c
> +++ b/net/mac80211/rc80211_minstrel_ht.c
> @@ -804,10 +804,18 @@ minstrel_ht_get_rate(void *priv, struct ieee80211_sta *sta, void *priv_sta,
>
> sample_group = &minstrel_mcs_groups[sample_idx / MCS_GROUP_RATES];
> info->flags |= IEEE80211_TX_CTL_RATE_CTRL_PROBE;
> + rate->count = 1;
> +
> + if (sample_idx / MCS_GROUP_RATES == MINSTREL_CCK_GROUP) {
> + int idx = sample_idx % ARRAY_SIZE(mp->cck_rates);
> + rate->idx = mp->cck_rates[idx];
> + rate->flags = 0;
> + return;
> + }
> +
> rate->idx = sample_idx % MCS_GROUP_RATES +
> (sample_group->streams - 1) * MCS_GROUP_RATES;
> rate->flags = IEEE80211_TX_RC_MCS | sample_group->flags;
> - rate->count = 1;
> }
>
> static void
>
>
^ permalink raw reply
* Re: pull-request: iwlwifi-next 2013-08-16
From: John W. Linville @ 2013-08-16 18:49 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless
In-Reply-To: <1376651161.15299.24.camel@jlt4.sipsolutions.net>
On Fri, Aug 16, 2013 at 01:06:01PM +0200, Johannes Berg wrote:
> John,
>
> For iwlwifi-next I also have some new code...
>
> This time I have some powersave work (notably uAPSD support), CQM
> offloads, support for a new firmware API and various code cleanups.
>
> Let me know if there's any problem.
>
> johannes
>
>
> The following changes since commit ef4394b9477f9078d78ae3e8359eae094c9b19d8:
>
> iwlwifi: mvm: use designated initialization for some arrays (2013-08-06 10:35:04 +0200)
>
> are available in the git repository at:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next.git for-john
>
> for you to fetch changes up to 89716344806bd49d213ad5960661e8c2d38c4982:
>
> iwlwifi: mvm: Add PBW snoozing enablement (2013-08-16 12:13:28 +0200)
Pulling now...
--
John W. Linville Someday the world will need a hero, and you
linville@tuxdriver.com might be all we have. Be ready.
^ permalink raw reply
* [PATCH 3/5] rt2x00: rt2800lib: use a MCU command for frequency adjustment on USB devices
From: Gabor Juhos @ 2013-08-16 20:38 UTC (permalink / raw)
To: John W. Linville; +Cc: linux-wireless, users, Gabor Juhos
In-Reply-To: <1376685498-5167-1-git-send-email-juhosg@openwrt.org>
According to the Ralink driver, there is an MCU
command which can be used to send the frequency
offset value directly to the USB device without
going through the RFCSR writing sequence.
Based on the DPO_RT5572_LinuxSTA_2.6.0.1_20120629
driver.
Reference:
RTMPAdjustFrequencyOffset function in common/rt_rf.c
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
---
drivers/net/wireless/rt2x00/rt2800lib.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
index c990a27..60b4bfe 100644
--- a/drivers/net/wireless/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
@@ -2506,7 +2506,11 @@ static void rt2800_adjust_freq_offset(struct rt2x00_dev *rt2x00dev)
if (rfcsr == prev_rfcsr)
return;
- rt2800_rfcsr_write(rt2x00dev, 17, rfcsr);
+ if (rt2x00_is_usb(rt2x00dev))
+ rt2800_mcu_request(rt2x00dev, 0x74, 0xff, freq_offset,
+ prev_rfcsr);
+ else
+ rt2800_rfcsr_write(rt2x00dev, 17, rfcsr);
}
static void rt2800_config_channel_rf3290(struct rt2x00_dev *rt2x00dev,
--
1.7.10
^ permalink raw reply related
* [PATCH 0/5] rt2x00: rt2800lib: frequency offset adjustment fixes
From: Gabor Juhos @ 2013-08-16 20:38 UTC (permalink / raw)
To: John W. Linville; +Cc: linux-wireless, users, Gabor Juhos
The patch-set contain small fixes for the frequency adjustment
code of the rt2800 driver.
Gabor Juhos (5):
rt2x00: rt2800lib: fix frequency offset boundary calculation
rt2x00: rt2800lib: optimize frequency offset adjustment
rt2x00: rt2800lib: use a MCU command for frequency adjustment on USB
devices
rt2x00: rt2800lib: move rt2800_adjust_freq_offset function
rt2x00: rt2800lib: adjust frequency offset for RF3053
drivers/net/wireless/rt2x00/rt2800lib.c | 38 +++++++++++++++++++------------
1 file changed, 24 insertions(+), 14 deletions(-)
--
1.7.10
^ permalink raw reply
* [PATCH 4/5] rt2x00: rt2800lib: move rt2800_adjust_freq_offset function
From: Gabor Juhos @ 2013-08-16 20:38 UTC (permalink / raw)
To: John W. Linville; +Cc: linux-wireless, users, Gabor Juhos
In-Reply-To: <1376685498-5167-1-git-send-email-juhosg@openwrt.org>
Move the rt2800_adjust_freq_offset function before
the channel configuration functions to make it usable
from those without a forward declaration.
The patch contains no functional changes.
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
---
drivers/net/wireless/rt2x00/rt2800lib.c | 45 ++++++++++++++++---------------
1 file changed, 23 insertions(+), 22 deletions(-)
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
index 60b4bfe..9b4d836 100644
--- a/drivers/net/wireless/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
@@ -1873,6 +1873,29 @@ static void rt2800_config_lna_gain(struct rt2x00_dev *rt2x00dev,
rt2x00dev->lna_gain = lna_gain;
}
+#define FREQ_OFFSET_BOUND 0x5f
+
+static void rt2800_adjust_freq_offset(struct rt2x00_dev *rt2x00dev)
+{
+ u8 freq_offset;
+ u8 rfcsr, prev_rfcsr;
+
+ freq_offset = rt2x00_get_field8(rt2x00dev->freq_offset, RFCSR17_CODE);
+ freq_offset = min_t(u8, freq_offset, FREQ_OFFSET_BOUND);
+
+ rt2800_rfcsr_read(rt2x00dev, 17, &rfcsr);
+ prev_rfcsr = rfcsr;
+ rt2x00_set_field8(&rfcsr, RFCSR17_CODE, freq_offset);
+ if (rfcsr == prev_rfcsr)
+ return;
+
+ if (rt2x00_is_usb(rt2x00dev))
+ rt2800_mcu_request(rt2x00dev, 0x74, 0xff, freq_offset,
+ prev_rfcsr);
+ else
+ rt2800_rfcsr_write(rt2x00dev, 17, rfcsr);
+}
+
static void rt2800_config_channel_rf2xxx(struct rt2x00_dev *rt2x00dev,
struct ieee80211_conf *conf,
struct rf_channel *rf,
@@ -2490,28 +2513,6 @@ static void rt2800_config_channel_rf3053(struct rt2x00_dev *rt2x00dev,
#define POWER_BOUND 0x27
#define POWER_BOUND_5G 0x2b
-#define FREQ_OFFSET_BOUND 0x5f
-
-static void rt2800_adjust_freq_offset(struct rt2x00_dev *rt2x00dev)
-{
- u8 freq_offset;
- u8 rfcsr, prev_rfcsr;
-
- freq_offset = rt2x00_get_field8(rt2x00dev->freq_offset, RFCSR17_CODE);
- freq_offset = min_t(u8, freq_offset, FREQ_OFFSET_BOUND);
-
- rt2800_rfcsr_read(rt2x00dev, 17, &rfcsr);
- prev_rfcsr = rfcsr;
- rt2x00_set_field8(&rfcsr, RFCSR17_CODE, freq_offset);
- if (rfcsr == prev_rfcsr)
- return;
-
- if (rt2x00_is_usb(rt2x00dev))
- rt2800_mcu_request(rt2x00dev, 0x74, 0xff, freq_offset,
- prev_rfcsr);
- else
- rt2800_rfcsr_write(rt2x00dev, 17, rfcsr);
-}
static void rt2800_config_channel_rf3290(struct rt2x00_dev *rt2x00dev,
struct ieee80211_conf *conf,
--
1.7.10
^ permalink raw reply related
* [PATCH 1/5] rt2x00: rt2800lib: fix frequency offset boundary calculation
From: Gabor Juhos @ 2013-08-16 20:38 UTC (permalink / raw)
To: John W. Linville; +Cc: linux-wireless, users, Gabor Juhos
In-Reply-To: <1376685498-5167-1-git-send-email-juhosg@openwrt.org>
The current code in the 'rt2800_adjust_freq_offset'
function limits the device specific frequency offset
value to FREQ_BOUND but ignores the fact that the
uppermost bit is not part of the frequency offset
value. As the result, the driver always uses the
FREQ_BOUND value if the uppermost bit is set.
Update the code to use the correct source value
for calculating the boundary.
Based on the DPO_RT5572_LinuxSTA_2.6.0.1_20120629
driver.
Reference:
RTMPAdjustFrequencyOffset function in common/rt_rf.c
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
---
drivers/net/wireless/rt2x00/rt2800lib.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
index 313da6a..d4e6dea 100644
--- a/drivers/net/wireless/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
@@ -2494,13 +2494,14 @@ static void rt2800_config_channel_rf3053(struct rt2x00_dev *rt2x00dev,
static void rt2800_adjust_freq_offset(struct rt2x00_dev *rt2x00dev)
{
+ u8 freq_offset;
u8 rfcsr;
+ freq_offset = rt2x00_get_field8(rt2x00dev->freq_offset, RFCSR17_CODE);
+ freq_offset = min_t(u8, freq_offset, FREQ_OFFSET_BOUND);
+
rt2800_rfcsr_read(rt2x00dev, 17, &rfcsr);
- if (rt2x00dev->freq_offset > FREQ_OFFSET_BOUND)
- rt2x00_set_field8(&rfcsr, RFCSR17_CODE, FREQ_OFFSET_BOUND);
- else
- rt2x00_set_field8(&rfcsr, RFCSR17_CODE, rt2x00dev->freq_offset);
+ rt2x00_set_field8(&rfcsr, RFCSR17_CODE, freq_offset);
rt2800_rfcsr_write(rt2x00dev, 17, rfcsr);
}
--
1.7.10
^ permalink raw reply related
* [PATCH 2/5] rt2x00: rt2800lib: optimize frequency offset adjustment
From: Gabor Juhos @ 2013-08-16 20:38 UTC (permalink / raw)
To: John W. Linville; +Cc: linux-wireless, users, Gabor Juhos
In-Reply-To: <1376685498-5167-1-git-send-email-juhosg@openwrt.org>
Don't write the new value into the register if it is
the same as the old value to avoid unncessary USB bus
traffic with USB devices. The change also saves a few
cycle on MMIO based devices.
Based on the DPO_RT5572_LinuxSTA_2.6.0.1_20120629
driver.
Reference:
RTMPAdjustFrequencyOffset function in common/rt_rf.c
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
---
drivers/net/wireless/rt2x00/rt2800lib.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
index d4e6dea..c990a27 100644
--- a/drivers/net/wireless/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
@@ -2495,13 +2495,17 @@ static void rt2800_config_channel_rf3053(struct rt2x00_dev *rt2x00dev,
static void rt2800_adjust_freq_offset(struct rt2x00_dev *rt2x00dev)
{
u8 freq_offset;
- u8 rfcsr;
+ u8 rfcsr, prev_rfcsr;
freq_offset = rt2x00_get_field8(rt2x00dev->freq_offset, RFCSR17_CODE);
freq_offset = min_t(u8, freq_offset, FREQ_OFFSET_BOUND);
rt2800_rfcsr_read(rt2x00dev, 17, &rfcsr);
+ prev_rfcsr = rfcsr;
rt2x00_set_field8(&rfcsr, RFCSR17_CODE, freq_offset);
+ if (rfcsr == prev_rfcsr)
+ return;
+
rt2800_rfcsr_write(rt2x00dev, 17, rfcsr);
}
--
1.7.10
^ permalink raw reply related
* [PATCH 5/5] rt2x00: rt2800lib: adjust frequency offset for RF3053
From: Gabor Juhos @ 2013-08-16 20:38 UTC (permalink / raw)
To: John W. Linville; +Cc: linux-wireless, users, Gabor Juhos
In-Reply-To: <1376685498-5167-1-git-send-email-juhosg@openwrt.org>
Along with other chipsets, the Ralink driver uses the
frequency adjustment code for RF3053 as well. Remove
the bogus place-holder comment from the RF3053 specific
channel configuration function and call the frequency
adjustment function instead
Based on the DPO_RT5572_LinuxSTA_2.6.0.1_20120629
driver.
Reference:
RT3593_ChipSwitchChannel function in chips/rt3593.c
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
---
drivers/net/wireless/rt2x00/rt2800lib.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
index 9b4d836..fb71ed6 100644
--- a/drivers/net/wireless/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
@@ -2344,7 +2344,7 @@ static void rt2800_config_channel_rf3053(struct rt2x00_dev *rt2x00dev,
}
rt2800_rfcsr_write(rt2x00dev, 1, rfcsr);
- /* TODO: frequency calibration? */
+ rt2800_adjust_freq_offset(rt2x00dev);
if (conf_is_ht40(conf)) {
txrx_agc_fc = rt2x00_get_field8(drv_data->calibration_bw40,
--
1.7.10
^ permalink raw reply related
* [PATCH 2/8] staging: vt6656: desc.h: Move typedef struct tagSRrvTime_gCTS to new structure in rxtx.h
From: Malcolm Priestley @ 2013-08-16 22:38 UTC (permalink / raw)
To: gregkh; +Cc: linux-wireless
To new structure.
typedef struct tagSRrvTime_gCTS -> struct vnt_rrv_time_cts
This is only needed by rxtc.c so moved to rxtx.h and
will eventually form part of the structure of
struct vnt_tx_buffer.
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
---
drivers/staging/vt6656/desc.h | 10 --------
drivers/staging/vt6656/rxtx.c | 53 ++++++++++++++++++++++++-------------------
drivers/staging/vt6656/rxtx.h | 7 ++++++
3 files changed, 37 insertions(+), 33 deletions(-)
diff --git a/drivers/staging/vt6656/desc.h b/drivers/staging/vt6656/desc.h
index 89b580d..ae0ce51 100644
--- a/drivers/staging/vt6656/desc.h
+++ b/drivers/staging/vt6656/desc.h
@@ -146,16 +146,6 @@
/*
* RsvTime buffer header
*/
-typedef struct tagSRrvTime_gCTS {
- u16 wCTSTxRrvTime_ba;
- u16 wReserved;
- u16 wTxRrvTime_b;
- u16 wTxRrvTime_a;
-} __attribute__ ((__packed__))
-SRrvTime_gCTS, *PSRrvTime_gCTS;
-
-typedef const SRrvTime_gCTS *PCSRrvTime_gCTS;
-
typedef struct tagSRrvTime_ab {
u16 wRTSTxRrvTime;
u16 wTxRrvTime;
diff --git a/drivers/staging/vt6656/rxtx.c b/drivers/staging/vt6656/rxtx.c
index c9dceae..9c52c31 100644
--- a/drivers/staging/vt6656/rxtx.c
+++ b/drivers/staging/vt6656/rxtx.c
@@ -934,7 +934,8 @@ static void s_vGenerateTxParameter(struct vnt_private *pDevice,
//Fill RsvTime
if (pvRrvTime) {
- PSRrvTime_gCTS pBuf = (PSRrvTime_gCTS)pvRrvTime;
+ struct vnt_rrv_time_cts *pBuf =
+ (struct vnt_rrv_time_cts *)pvRrvTime;
pBuf->wTxRrvTime_a = cpu_to_le16((u16)s_uGetTxRsvTime(pDevice, byPktType, cbFrameSize, wCurrentRate, bNeedACK));//2.4G OFDM
pBuf->wTxRrvTime_b = cpu_to_le16((u16)s_uGetTxRsvTime(pDevice, PK_TYPE_11B, cbFrameSize, pDevice->byTopCCKBasicRate, bNeedACK));//1:CCK
pBuf->wCTSTxRrvTime_ba = cpu_to_le16((u16)s_uGetRTSCTSRsvTime(pDevice, 3, byPktType, cbFrameSize, wCurrentRate));//3:CTSTxRrvTime_Ba, 1:2.4GHz
@@ -1165,16 +1166,19 @@ static int s_bPacketToWirelessUsb(struct vnt_private *pDevice, u8 byPktType,
sizeof(STxDataHead_g);
}
else { //RTS_needless
- pvRrvTime = (PSRrvTime_gCTS) (pbyTxBufferAddr + wTxBufSize);
- pMICHDR = (PSMICHDRHead) (pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_gCTS));
+ pvRrvTime = (struct vnt_rrv_time_cts *)
+ (pbyTxBufferAddr + wTxBufSize);
+ pMICHDR = (PSMICHDRHead) (pbyTxBufferAddr + wTxBufSize +
+ sizeof(struct vnt_rrv_time_cts));
pvRTS = NULL;
pvCTS = (struct vnt_cts *) (pbyTxBufferAddr + wTxBufSize +
- sizeof(SRrvTime_gCTS) + cbMICHDR);
+ sizeof(struct vnt_rrv_time_cts) + cbMICHDR);
pvTxDataHd = (PSTxDataHead_g) (pbyTxBufferAddr + wTxBufSize +
- sizeof(SRrvTime_gCTS) + cbMICHDR +
+ sizeof(struct vnt_rrv_time_cts) + cbMICHDR +
sizeof(struct vnt_cts));
- cbHeaderLength = wTxBufSize + sizeof(SRrvTime_gCTS) + cbMICHDR +
- sizeof(struct vnt_cts) + sizeof(STxDataHead_g);
+ cbHeaderLength = wTxBufSize + sizeof(struct vnt_rrv_time_cts) +
+ cbMICHDR + sizeof(struct vnt_cts) +
+ sizeof(STxDataHead_g);
}
} else {
// Auto Fall Back
@@ -1194,15 +1198,17 @@ static int s_bPacketToWirelessUsb(struct vnt_private *pDevice, u8 byPktType,
sizeof(STxDataHead_g_FB);
}
else if (bRTS == false) { //RTS_needless
- pvRrvTime = (PSRrvTime_gCTS) (pbyTxBufferAddr + wTxBufSize);
- pMICHDR = (PSMICHDRHead) (pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_gCTS));
+ pvRrvTime = (struct vnt_rrv_time_cts *)
+ (pbyTxBufferAddr + wTxBufSize);
+ pMICHDR = (PSMICHDRHead) (pbyTxBufferAddr + wTxBufSize +
+ sizeof(struct vnt_rrv_time_cts));
pvRTS = NULL;
pvCTS = (struct vnt_cts_fb *) (pbyTxBufferAddr + wTxBufSize +
- sizeof(SRrvTime_gCTS) + cbMICHDR);
+ sizeof(struct vnt_rrv_time_cts) + cbMICHDR);
pvTxDataHd = (PSTxDataHead_g_FB) (pbyTxBufferAddr +
- wTxBufSize + sizeof(SRrvTime_gCTS) + cbMICHDR +
- sizeof(struct vnt_cts_fb));
- cbHeaderLength = wTxBufSize + sizeof(SRrvTime_gCTS) +
+ wTxBufSize + sizeof(struct vnt_rrv_time_cts) +
+ cbMICHDR + sizeof(struct vnt_cts_fb));
+ cbHeaderLength = wTxBufSize + sizeof(struct vnt_rrv_time_cts) +
cbMICHDR + sizeof(struct vnt_cts_fb) +
sizeof(STxDataHead_g_FB);
}
@@ -1659,14 +1665,14 @@ CMD_STATUS csMgmt_xmit(struct vnt_private *pDevice,
//Set RrvTime/RTS/CTS Buffer
if (byPktType == PK_TYPE_11GB || byPktType == PK_TYPE_11GA) {//802.11g packet
- pvRrvTime = (PSRrvTime_gCTS) (pbyTxBufferAddr + wTxBufSize);
+ pvRrvTime = (struct vnt_rrv_time_cts *) (pbyTxBufferAddr + wTxBufSize);
pMICHDR = NULL;
pvRTS = NULL;
pCTS = (struct vnt_cts *) (pbyTxBufferAddr + wTxBufSize +
- sizeof(SRrvTime_gCTS));
+ sizeof(struct vnt_rrv_time_cts));
pvTxDataHd = (PSTxDataHead_g) (pbyTxBufferAddr + wTxBufSize +
- sizeof(SRrvTime_gCTS) + sizeof(struct vnt_cts));
- cbHeaderSize = wTxBufSize + sizeof(SRrvTime_gCTS) +
+ sizeof(struct vnt_rrv_time_cts) + sizeof(struct vnt_cts));
+ cbHeaderSize = wTxBufSize + sizeof(struct vnt_rrv_time_cts) +
sizeof(struct vnt_cts) + sizeof(STxDataHead_g);
}
else { // 802.11a/b packet
@@ -2061,15 +2067,16 @@ void vDMA0_tx_80211(struct vnt_private *pDevice, struct sk_buff *skb)
//the rest of pTxBufHead->wFragCtl:FragTyp will be set later in s_vFillFragParameter()
if (byPktType == PK_TYPE_11GB || byPktType == PK_TYPE_11GA) {//802.11g packet
-
- pvRrvTime = (PSRrvTime_gCTS) (pbyTxBufferAddr + wTxBufSize);
- pMICHDR = (PSMICHDRHead) (pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_gCTS));
+ pvRrvTime = (struct vnt_rrv_time_cts *) (pbyTxBufferAddr + wTxBufSize);
+ pMICHDR = (PSMICHDRHead) (pbyTxBufferAddr + wTxBufSize +
+ sizeof(struct vnt_rrv_time_cts));
pvRTS = NULL;
pvCTS = (struct vnt_cts *) (pbyTxBufferAddr + wTxBufSize +
- sizeof(SRrvTime_gCTS) + cbMICHDR);
+ sizeof(struct vnt_rrv_time_cts) + cbMICHDR);
pvTxDataHd = (PSTxDataHead_g) (pbyTxBufferAddr + wTxBufSize +
- sizeof(SRrvTime_gCTS) + cbMICHDR + sizeof(struct vnt_cts));
- cbHeaderSize = wTxBufSize + sizeof(SRrvTime_gCTS) + cbMICHDR +
+ sizeof(struct vnt_rrv_time_cts) + cbMICHDR +
+ sizeof(struct vnt_cts));
+ cbHeaderSize = wTxBufSize + sizeof(struct vnt_rrv_time_cts) + cbMICHDR +
sizeof(struct vnt_cts) + sizeof(STxDataHead_g);
}
diff --git a/drivers/staging/vt6656/rxtx.h b/drivers/staging/vt6656/rxtx.h
index 8afade2..35a6b47 100644
--- a/drivers/staging/vt6656/rxtx.h
+++ b/drivers/staging/vt6656/rxtx.h
@@ -42,6 +42,13 @@ struct vnt_rrv_time_rts {
u16 wTxRrvTime_a;
} __packed;
+struct vnt_rrv_time_cts {
+ u16 wCTSTxRrvTime_ba;
+ u16 wReserved;
+ u16 wTxRrvTime_b;
+ u16 wTxRrvTime_a;
+} __packed;
+
/* RTS buffer header */
struct vnt_rts_g {
u8 bySignalField_b;
--
1.8.1.2
^ permalink raw reply related
* [PATCH 3/8] staging: vt6656: desc.h remove typedef SRrvTime_ab to new structure.
From: Malcolm Priestley @ 2013-08-16 22:44 UTC (permalink / raw)
To: gregkh; +Cc: linux-wireless
To new structure.
typedef struct tagSRrvTime_ab -> struct vnt_rrv_time_ab
This is only needed by rxtc.c so moved to rxtx.h and
will eventually form part of the structure of
struct vnt_tx_buffer.
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
---
drivers/staging/vt6656/desc.h | 8 ----
drivers/staging/vt6656/rxtx.c | 85 +++++++++++++++++++++++++++----------------
drivers/staging/vt6656/rxtx.h | 5 +++
3 files changed, 59 insertions(+), 39 deletions(-)
diff --git a/drivers/staging/vt6656/desc.h b/drivers/staging/vt6656/desc.h
index ae0ce51..c2dec3b 100644
--- a/drivers/staging/vt6656/desc.h
+++ b/drivers/staging/vt6656/desc.h
@@ -146,14 +146,6 @@
/*
* RsvTime buffer header
*/
-typedef struct tagSRrvTime_ab {
- u16 wRTSTxRrvTime;
- u16 wTxRrvTime;
-} __attribute__ ((__packed__))
-SRrvTime_ab, *PSRrvTime_ab;
-
-typedef const SRrvTime_ab *PCSRrvTime_ab;
-
typedef struct tagSRrvTime_atim {
u16 wCTSTxRrvTime_ba;
u16 wTxRrvTime_a;
diff --git a/drivers/staging/vt6656/rxtx.c b/drivers/staging/vt6656/rxtx.c
index 9c52c31..b21a496 100644
--- a/drivers/staging/vt6656/rxtx.c
+++ b/drivers/staging/vt6656/rxtx.c
@@ -949,7 +949,8 @@ static void s_vGenerateTxParameter(struct vnt_private *pDevice,
if (pvRTS != NULL) {//RTS_need, non PCF mode
//Fill RsvTime
if (pvRrvTime) {
- PSRrvTime_ab pBuf = (PSRrvTime_ab)pvRrvTime;
+ struct vnt_rrv_time_ab *pBuf =
+ (struct vnt_rrv_time_ab *)pvRrvTime;
pBuf->wRTSTxRrvTime = cpu_to_le16((u16)s_uGetRTSCTSRsvTime(pDevice, 2, byPktType, cbFrameSize, wCurrentRate));//2:RTSTxRrvTime_aa, 0:5GHz
pBuf->wTxRrvTime = cpu_to_le16((u16)s_uGetTxRsvTime(pDevice, byPktType, cbFrameSize, wCurrentRate, bNeedACK));//0:OFDM
}
@@ -959,7 +960,8 @@ static void s_vGenerateTxParameter(struct vnt_private *pDevice,
else if (pvRTS == NULL) {//RTS_needless, non PCF mode
//Fill RsvTime
if (pvRrvTime) {
- PSRrvTime_ab pBuf = (PSRrvTime_ab)pvRrvTime;
+ struct vnt_rrv_time_ab *pBuf =
+ (struct vnt_rrv_time_ab *)pvRrvTime;
pBuf->wTxRrvTime = cpu_to_le16((u16)s_uGetTxRsvTime(pDevice, PK_TYPE_11A, cbFrameSize, wCurrentRate, bNeedACK)); //0:OFDM
}
}
@@ -969,7 +971,8 @@ static void s_vGenerateTxParameter(struct vnt_private *pDevice,
if ((pvRTS != NULL)) {//RTS_need, non PCF mode
//Fill RsvTime
if (pvRrvTime) {
- PSRrvTime_ab pBuf = (PSRrvTime_ab)pvRrvTime;
+ struct vnt_rrv_time_ab *pBuf =
+ (struct vnt_rrv_time_ab *)pvRrvTime;
pBuf->wRTSTxRrvTime = cpu_to_le16((u16)s_uGetRTSCTSRsvTime(pDevice, 0, byPktType, cbFrameSize, wCurrentRate));//0:RTSTxRrvTime_bb, 1:2.4GHz
pBuf->wTxRrvTime = cpu_to_le16((u16)s_uGetTxRsvTime(pDevice, PK_TYPE_11B, cbFrameSize, wCurrentRate, bNeedACK));//1:CCK
}
@@ -979,7 +982,8 @@ static void s_vGenerateTxParameter(struct vnt_private *pDevice,
else { //RTS_needless, non PCF mode
//Fill RsvTime
if (pvRrvTime) {
- PSRrvTime_ab pBuf = (PSRrvTime_ab)pvRrvTime;
+ struct vnt_rrv_time_ab *pBuf =
+ (struct vnt_rrv_time_ab *)pvRrvTime;
pBuf->wTxRrvTime = cpu_to_le16((u16)s_uGetTxRsvTime(pDevice, PK_TYPE_11B, cbFrameSize, wCurrentRate, bNeedACK)); //1:CCK
}
}
@@ -1217,46 +1221,60 @@ static int s_bPacketToWirelessUsb(struct vnt_private *pDevice, u8 byPktType,
else {//802.11a/b packet
if (byFBOption == AUTO_FB_NONE) {
if (bRTS == true) {//RTS_need
- pvRrvTime = (PSRrvTime_ab) (pbyTxBufferAddr + wTxBufSize);
- pMICHDR = (PSMICHDRHead) (pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_ab));
+ pvRrvTime = (struct vnt_rrv_time_ab *) (pbyTxBufferAddr +
+ wTxBufSize);
+ pMICHDR = (PSMICHDRHead)(pbyTxBufferAddr + wTxBufSize +
+ sizeof(struct vnt_rrv_time_ab));
pvRTS = (struct vnt_rts_ab *) (pbyTxBufferAddr + wTxBufSize +
- sizeof(SRrvTime_ab) + cbMICHDR);
+ sizeof(struct vnt_rrv_time_ab) + cbMICHDR);
pvCTS = NULL;
pvTxDataHd = (PSTxDataHead_ab) (pbyTxBufferAddr + wTxBufSize +
- sizeof(SRrvTime_ab) + cbMICHDR +
+ sizeof(struct vnt_rrv_time_ab) + cbMICHDR +
sizeof(struct vnt_rts_ab));
- cbHeaderLength = wTxBufSize + sizeof(PSRrvTime_ab) + cbMICHDR +
- sizeof(struct vnt_rts_ab) + sizeof(STxDataHead_ab);
+ cbHeaderLength = wTxBufSize + sizeof(struct vnt_rrv_time_ab) +
+ cbMICHDR + sizeof(struct vnt_rts_ab) +
+ sizeof(STxDataHead_ab);
}
else if (bRTS == false) { //RTS_needless, no MICHDR
- pvRrvTime = (PSRrvTime_ab) (pbyTxBufferAddr + wTxBufSize);
- pMICHDR = (PSMICHDRHead) (pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_ab));
+ pvRrvTime = (struct vnt_rrv_time_ab *)(pbyTxBufferAddr +
+ wTxBufSize);
+ pMICHDR = (PSMICHDRHead) (pbyTxBufferAddr + wTxBufSize +
+ sizeof(struct vnt_rrv_time_ab));
pvRTS = NULL;
pvCTS = NULL;
- pvTxDataHd = (PSTxDataHead_ab) (pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_ab) + cbMICHDR);
- cbHeaderLength = wTxBufSize + sizeof(SRrvTime_ab) + cbMICHDR + sizeof(STxDataHead_ab);
+ pvTxDataHd = (PSTxDataHead_ab) (pbyTxBufferAddr + wTxBufSize +
+ sizeof(struct vnt_rrv_time_ab) + cbMICHDR);
+ cbHeaderLength = wTxBufSize + sizeof(struct vnt_rrv_time_ab) +
+ cbMICHDR + sizeof(STxDataHead_ab);
}
} else {
// Auto Fall Back
if (bRTS == true) {//RTS_need
- pvRrvTime = (PSRrvTime_ab) (pbyTxBufferAddr + wTxBufSize);
- pMICHDR = (PSMICHDRHead) (pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_ab));
+ pvRrvTime = (struct vnt_rrv_time_ab *)(pbyTxBufferAddr +
+ wTxBufSize);
+ pMICHDR = (PSMICHDRHead) (pbyTxBufferAddr + wTxBufSize +
+ sizeof(struct vnt_rrv_time_ab));
pvRTS = (struct vnt_rts_a_fb *) (pbyTxBufferAddr + wTxBufSize +
- sizeof(SRrvTime_ab) + cbMICHDR);
+ sizeof(struct vnt_rrv_time_ab) + cbMICHDR);
pvCTS = NULL;
pvTxDataHd = (PSTxDataHead_a_FB) (pbyTxBufferAddr + wTxBufSize +
- sizeof(SRrvTime_ab) + cbMICHDR +
+ sizeof(struct vnt_rrv_time_ab) + cbMICHDR +
sizeof(struct vnt_rts_a_fb));
- cbHeaderLength = wTxBufSize + sizeof(PSRrvTime_ab) + cbMICHDR +
- sizeof(struct vnt_rts_a_fb) + sizeof(STxDataHead_a_FB);
+ cbHeaderLength = wTxBufSize + sizeof(struct vnt_rrv_time_ab) +
+ cbMICHDR + sizeof(struct vnt_rts_a_fb) +
+ sizeof(STxDataHead_a_FB);
}
else if (bRTS == false) { //RTS_needless
- pvRrvTime = (PSRrvTime_ab) (pbyTxBufferAddr + wTxBufSize);
- pMICHDR = (PSMICHDRHead) (pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_ab));
+ pvRrvTime = (struct vnt_rrv_time_ab *)(pbyTxBufferAddr +
+ wTxBufSize);
+ pMICHDR = (PSMICHDRHead)(pbyTxBufferAddr + wTxBufSize +
+ sizeof(struct vnt_rrv_time_ab));
pvRTS = NULL;
pvCTS = NULL;
- pvTxDataHd = (PSTxDataHead_a_FB) (pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_ab) + cbMICHDR);
- cbHeaderLength = wTxBufSize + sizeof(SRrvTime_ab) + cbMICHDR + sizeof(STxDataHead_a_FB);
+ pvTxDataHd = (PSTxDataHead_a_FB) (pbyTxBufferAddr + wTxBufSize +
+ sizeof(struct vnt_rrv_time_ab) + cbMICHDR);
+ cbHeaderLength = wTxBufSize + sizeof(struct vnt_rrv_time_ab) +
+ cbMICHDR + sizeof(STxDataHead_a_FB);
}
} // Auto Fall Back
}
@@ -1676,12 +1694,14 @@ CMD_STATUS csMgmt_xmit(struct vnt_private *pDevice,
sizeof(struct vnt_cts) + sizeof(STxDataHead_g);
}
else { // 802.11a/b packet
- pvRrvTime = (PSRrvTime_ab) (pbyTxBufferAddr + wTxBufSize);
+ pvRrvTime = (struct vnt_rrv_time_ab *) (pbyTxBufferAddr + wTxBufSize);
pMICHDR = NULL;
pvRTS = NULL;
pCTS = NULL;
- pvTxDataHd = (PSTxDataHead_ab) (pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_ab));
- cbHeaderSize = wTxBufSize + sizeof(SRrvTime_ab) + sizeof(STxDataHead_ab);
+ pvTxDataHd = (PSTxDataHead_ab) (pbyTxBufferAddr + wTxBufSize +
+ sizeof(struct vnt_rrv_time_ab));
+ cbHeaderSize = wTxBufSize + sizeof(struct vnt_rrv_time_ab) +
+ sizeof(STxDataHead_ab);
}
memcpy(&(sEthHeader.h_dest[0]),
@@ -2082,12 +2102,15 @@ void vDMA0_tx_80211(struct vnt_private *pDevice, struct sk_buff *skb)
}
else {//802.11a/b packet
- pvRrvTime = (PSRrvTime_ab) (pbyTxBufferAddr + wTxBufSize);
- pMICHDR = (PSMICHDRHead) (pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_ab));
+ pvRrvTime = (struct vnt_rrv_time_ab *) (pbyTxBufferAddr + wTxBufSize);
+ pMICHDR = (PSMICHDRHead) (pbyTxBufferAddr + wTxBufSize +
+ sizeof(struct vnt_rrv_time_ab));
pvRTS = NULL;
pvCTS = NULL;
- pvTxDataHd = (PSTxDataHead_ab) (pbyTxBufferAddr + wTxBufSize + sizeof(SRrvTime_ab) + cbMICHDR);
- cbHeaderSize = wTxBufSize + sizeof(SRrvTime_ab) + cbMICHDR + sizeof(STxDataHead_ab);
+ pvTxDataHd = (PSTxDataHead_ab) (pbyTxBufferAddr + wTxBufSize +
+ sizeof(struct vnt_rrv_time_ab) + cbMICHDR);
+ cbHeaderSize = wTxBufSize + sizeof(struct vnt_rrv_time_ab) + cbMICHDR +
+ sizeof(STxDataHead_ab);
}
memcpy(&(sEthHeader.h_dest[0]),
&(p80211Header->sA3.abyAddr1[0]),
diff --git a/drivers/staging/vt6656/rxtx.h b/drivers/staging/vt6656/rxtx.h
index 35a6b47..7573760 100644
--- a/drivers/staging/vt6656/rxtx.h
+++ b/drivers/staging/vt6656/rxtx.h
@@ -49,6 +49,11 @@ struct vnt_rrv_time_cts {
u16 wTxRrvTime_a;
} __packed;
+struct vnt_rrv_time_ab {
+ u16 wRTSTxRrvTime;
+ u16 wTxRrvTime;
+} __packed;
+
/* RTS buffer header */
struct vnt_rts_g {
u8 bySignalField_b;
--
1.8.1.2
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox