* [PATCH 06/11] rtlwifi: rtl8192de: Convert driver to use common DM table initialization
From: Larry Finger @ 2015-01-02 16:58 UTC (permalink / raw)
To: kvalo; +Cc: linux-wireless, Larry Finger, netdev
In-Reply-To: <1420217908-1382-1-git-send-email-Larry.Finger@lwfinger.net>
This patch converts driver rtl8192de to use the common routine to
initialize dm_digtable.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
---
drivers/net/wireless/rtlwifi/rtl8192de/dm.c | 32 +++--------------------------
1 file changed, 3 insertions(+), 29 deletions(-)
diff --git a/drivers/net/wireless/rtlwifi/rtl8192de/dm.c b/drivers/net/wireless/rtlwifi/rtl8192de/dm.c
index 75643ab..a1be5a6 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192de/dm.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192de/dm.c
@@ -156,34 +156,6 @@ static const u8 cckswing_table_ch14[CCK_TABLE_SIZE][8] = {
{0x09, 0x08, 0x07, 0x04, 0x00, 0x00, 0x00, 0x00} /* 32, -16.0dB */
};
-static void rtl92d_dm_diginit(struct ieee80211_hw *hw)
-{
- struct rtl_priv *rtlpriv = rtl_priv(hw);
- struct dig_t *de_digtable = &rtlpriv->dm_digtable;
-
- de_digtable->dig_enable_flag = true;
- de_digtable->dig_ext_port_stage = DIG_EXT_PORT_STAGE_MAX;
- de_digtable->cur_igvalue = 0x20;
- de_digtable->pre_igvalue = 0x0;
- de_digtable->cursta_cstate = DIG_STA_DISCONNECT;
- de_digtable->presta_cstate = DIG_STA_DISCONNECT;
- de_digtable->curmultista_cstate = DIG_MULTISTA_DISCONNECT;
- de_digtable->rssi_lowthresh = DM_DIG_THRESH_LOW;
- de_digtable->rssi_highthresh = DM_DIG_THRESH_HIGH;
- de_digtable->fa_lowthresh = DM_FALSEALARM_THRESH_LOW;
- de_digtable->fa_highthresh = DM_FALSEALARM_THRESH_HIGH;
- de_digtable->rx_gain_max = DM_DIG_FA_UPPER;
- de_digtable->rx_gain_min = DM_DIG_FA_LOWER;
- de_digtable->back_val = DM_DIG_BACKOFF_DEFAULT;
- de_digtable->back_range_max = DM_DIG_BACKOFF_MAX;
- de_digtable->back_range_min = DM_DIG_BACKOFF_MIN;
- de_digtable->pre_cck_pd_state = CCK_PD_STAGE_LOWRSSI;
- de_digtable->cur_cck_pd_state = CCK_PD_STAGE_MAX;
- de_digtable->large_fa_hit = 0;
- de_digtable->recover_cnt = 0;
- de_digtable->forbidden_igi = DM_DIG_FA_LOWER;
-}
-
static void rtl92d_dm_false_alarm_counter_statistics(struct ieee80211_hw *hw)
{
u32 ret_value;
@@ -1306,7 +1278,9 @@ void rtl92d_dm_init(struct ieee80211_hw *hw)
struct rtl_priv *rtlpriv = rtl_priv(hw);
rtlpriv->dm.dm_type = DM_TYPE_BYDRIVER;
- rtl92d_dm_diginit(hw);
+ rtl_dm_diginit(hw, 0x20);
+ rtlpriv->dm_digtable.rx_gain_max = DM_DIG_FA_UPPER;
+ rtlpriv->dm_digtable.rx_gain_min = DM_DIG_FA_LOWER;
rtl92d_dm_init_dynamic_txpower(hw);
rtl92d_dm_init_edca_turbo(hw);
rtl92d_dm_init_rate_adaptive_mask(hw);
--
2.1.2
^ permalink raw reply related
* [PATCH 05/11] rtlwifi: rtl8192c-common: Convert driver to use common DM table initialization
From: Larry Finger @ 2015-01-02 16:58 UTC (permalink / raw)
To: kvalo; +Cc: linux-wireless, Larry Finger, netdev
In-Reply-To: <1420217908-1382-1-git-send-email-Larry.Finger@lwfinger.net>
These changes convert both rtl8192ce and rtl8192cu to use the new routine.
Some additional definitions are needed in the core, thus several of the
headers for other drivers are affected, but no other executable code is
changed.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
---
drivers/net/wireless/rtlwifi/core.c | 3 ++
drivers/net/wireless/rtlwifi/core.h | 16 +++++++++
drivers/net/wireless/rtlwifi/rtl8188ee/dm.h | 16 ---------
drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c | 44 ++++-------------------
drivers/net/wireless/rtlwifi/rtl8192c/dm_common.h | 16 ---------
drivers/net/wireless/rtlwifi/rtl8192de/dm.h | 16 ---------
drivers/net/wireless/rtlwifi/rtl8192se/dm.h | 8 -----
drivers/net/wireless/rtlwifi/rtl8723ae/dm.c | 14 ++++----
drivers/net/wireless/rtlwifi/rtl8723ae/dm.h | 16 ---------
drivers/net/wireless/rtlwifi/rtl8723be/dm.h | 8 -----
drivers/net/wireless/rtlwifi/rtl8821ae/dm.h | 16 ---------
11 files changed, 33 insertions(+), 140 deletions(-)
diff --git a/drivers/net/wireless/rtlwifi/core.c b/drivers/net/wireless/rtlwifi/core.c
index 5aa3ab3..eb20316 100644
--- a/drivers/net/wireless/rtlwifi/core.c
+++ b/drivers/net/wireless/rtlwifi/core.c
@@ -1878,6 +1878,7 @@ void rtl_dm_diginit(struct ieee80211_hw *hw, u32 cur_igvalue)
struct dig_t *dm_digtable = &rtlpriv->dm_digtable;
dm_digtable->dig_enable_flag = true;
+ dm_digtable->dig_ext_port_stage = DIG_EXT_PORT_STAGE_MAX;
dm_digtable->cur_igvalue = cur_igvalue;
dm_digtable->pre_igvalue = 0;
dm_digtable->cur_sta_cstate = DIG_STA_DISCONNECT;
@@ -1903,5 +1904,7 @@ void rtl_dm_diginit(struct ieee80211_hw *hw, u32 cur_igvalue)
dm_digtable->media_connect_1 = false;
rtlpriv->dm.dm_initialgain_enable = true;
dm_digtable->bt30_cur_igi = 0x32;
+ dm_digtable->pre_cck_pd_state = CCK_PD_STAGE_MAX;
+ dm_digtable->cur_cck_pd_state = CCK_PD_STAGE_LOWRSSI;
}
EXPORT_SYMBOL(rtl_dm_diginit);
diff --git a/drivers/net/wireless/rtlwifi/core.h b/drivers/net/wireless/rtlwifi/core.h
index c0a0317..1cde356 100644
--- a/drivers/net/wireless/rtlwifi/core.h
+++ b/drivers/net/wireless/rtlwifi/core.h
@@ -46,6 +46,22 @@
#define DM_DIG_BACKOFF_MIN -4
#define DM_DIG_BACKOFF_DEFAULT 10
+enum cck_packet_detection_threshold {
+ CCK_PD_STAGE_LOWRSSI = 0,
+ CCK_PD_STAGE_HIGHRSSI = 1,
+ CCK_FA_STAGE_LOW = 2,
+ CCK_FA_STAGE_HIGH = 3,
+ CCK_PD_STAGE_MAX = 4,
+};
+
+enum dm_dig_ext_port_alg_e {
+ DIG_EXT_PORT_STAGE_0 = 0,
+ DIG_EXT_PORT_STAGE_1 = 1,
+ DIG_EXT_PORT_STAGE_2 = 2,
+ DIG_EXT_PORT_STAGE_3 = 3,
+ DIG_EXT_PORT_STAGE_MAX = 4,
+};
+
enum dm_dig_connect_e {
DIG_STA_DISCONNECT,
DIG_STA_CONNECT,
diff --git a/drivers/net/wireless/rtlwifi/rtl8188ee/dm.h b/drivers/net/wireless/rtlwifi/rtl8188ee/dm.h
index 6217b7c..51ad3f9 100644
--- a/drivers/net/wireless/rtlwifi/rtl8188ee/dm.h
+++ b/drivers/net/wireless/rtlwifi/rtl8188ee/dm.h
@@ -249,14 +249,6 @@ enum tag_dynamic_init_gain_operation_type_definition {
DIG_OP_TYPE_MAX
};
-enum tag_cck_packet_detection_threshold_type_definition {
- CCK_PD_STAGE_LOWRSSI = 0,
- CCK_PD_STAGE_HIGHRSSI = 1,
- CCK_FA_STAGE_LOW = 2,
- CCK_FA_STAGE_HIGH = 3,
- CCK_PD_STAGE_MAX = 4,
-};
-
enum dm_1r_cca_e {
CCA_1R = 0,
CCA_2R = 1,
@@ -275,14 +267,6 @@ enum dm_sw_ant_switch_e {
ANS_ANTENNA_MAX = 3,
};
-enum dm_dig_ext_port_alg_e {
- DIG_EXT_PORT_STAGE_0 = 0,
- DIG_EXT_PORT_STAGE_1 = 1,
- DIG_EXT_PORT_STAGE_2 = 2,
- DIG_EXT_PORT_STAGE_3 = 3,
- DIG_EXT_PORT_STAGE_MAX = 4,
-};
-
enum pwr_track_control_method {
BBSWING,
TXAGC
diff --git a/drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c b/drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c
index dabe18f..f5ee67c 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c
@@ -195,36 +195,6 @@ void dm_savepowerindex(struct ieee80211_hw *hw)
}
EXPORT_SYMBOL_GPL(dm_savepowerindex);
-static void rtl92c_dm_diginit(struct ieee80211_hw *hw)
-{
- struct rtl_priv *rtlpriv = rtl_priv(hw);
- struct dig_t *dm_digtable = &rtlpriv->dm_digtable;
-
- dm_digtable->dig_enable_flag = true;
- dm_digtable->dig_ext_port_stage = DIG_EXT_PORT_STAGE_MAX;
- dm_digtable->cur_igvalue = 0x20;
- dm_digtable->pre_igvalue = 0x0;
- dm_digtable->cursta_cstate = DIG_STA_DISCONNECT;
- dm_digtable->presta_cstate = DIG_STA_DISCONNECT;
- dm_digtable->curmultista_cstate = DIG_MULTISTA_DISCONNECT;
- dm_digtable->rssi_lowthresh = DM_DIG_THRESH_LOW;
- dm_digtable->rssi_highthresh = DM_DIG_THRESH_HIGH;
- dm_digtable->fa_lowthresh = DM_FALSEALARM_THRESH_LOW;
- dm_digtable->fa_highthresh = DM_FALSEALARM_THRESH_HIGH;
- dm_digtable->rx_gain_max = DM_DIG_MAX;
- dm_digtable->rx_gain_min = DM_DIG_MIN;
- dm_digtable->back_val = DM_DIG_BACKOFF_DEFAULT;
- dm_digtable->back_range_max = DM_DIG_BACKOFF_MAX;
- dm_digtable->back_range_min = DM_DIG_BACKOFF_MIN;
- dm_digtable->pre_cck_pd_state = CCK_PD_STAGE_MAX;
- dm_digtable->cur_cck_pd_state = CCK_PD_STAGE_LowRssi;
-
- dm_digtable->forbidden_igi = DM_DIG_MIN;
- dm_digtable->large_fa_hit = 0;
- dm_digtable->recover_cnt = 0;
- dm_digtable->dig_min_0 = 0x25;
-}
-
static u8 rtl92c_dm_initial_gain_min_pwdb(struct ieee80211_hw *hw)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
@@ -508,27 +478,27 @@ static void rtl92c_dm_cck_packet_detection_thresh(struct ieee80211_hw *hw)
if (dm_digtable->rssi_val_min > 100)
dm_digtable->rssi_val_min = 100;
- if (dm_digtable->pre_cck_pd_state == CCK_PD_STAGE_LowRssi) {
+ if (dm_digtable->pre_cck_pd_state == CCK_PD_STAGE_LOWRSSI) {
if (dm_digtable->rssi_val_min <= 25)
dm_digtable->cur_cck_pd_state =
- CCK_PD_STAGE_LowRssi;
+ CCK_PD_STAGE_LOWRSSI;
else
dm_digtable->cur_cck_pd_state =
- CCK_PD_STAGE_HighRssi;
+ CCK_PD_STAGE_HIGHRSSI;
} else {
if (dm_digtable->rssi_val_min <= 20)
dm_digtable->cur_cck_pd_state =
- CCK_PD_STAGE_LowRssi;
+ CCK_PD_STAGE_LOWRSSI;
else
dm_digtable->cur_cck_pd_state =
- CCK_PD_STAGE_HighRssi;
+ CCK_PD_STAGE_HIGHRSSI;
}
} else {
dm_digtable->cur_cck_pd_state = CCK_PD_STAGE_MAX;
}
if (dm_digtable->pre_cck_pd_state != dm_digtable->cur_cck_pd_state) {
- if ((dm_digtable->cur_cck_pd_state == CCK_PD_STAGE_LowRssi) ||
+ if ((dm_digtable->cur_cck_pd_state == CCK_PD_STAGE_LOWRSSI) ||
(dm_digtable->cur_cck_pd_state == CCK_PD_STAGE_MAX))
rtl_set_bbreg(hw, RCCK0_CCA, MASKBYTE2, 0x83);
else
@@ -1375,7 +1345,7 @@ void rtl92c_dm_init(struct ieee80211_hw *hw)
rtlpriv->dm.undec_sm_pwdb = -1;
rtlpriv->dm.undec_sm_cck = -1;
rtlpriv->dm.dm_initialgain_enable = true;
- rtl92c_dm_diginit(hw);
+ rtl_dm_diginit(hw, 0x20);
rtlpriv->dm.dm_flag |= HAL_DM_HIPWR_DISABLE;
rtl92c_dm_init_dynamic_txpower(hw);
diff --git a/drivers/net/wireless/rtlwifi/rtl8192c/dm_common.h b/drivers/net/wireless/rtlwifi/rtl8192c/dm_common.h
index 55ebffd..4422e31 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192c/dm_common.h
+++ b/drivers/net/wireless/rtlwifi/rtl8192c/dm_common.h
@@ -110,14 +110,6 @@ enum tag_dynamic_init_gain_operation_type_definition {
DIG_OP_TYPE_MAX
};
-enum tag_cck_packet_detection_threshold_type_definition {
- CCK_PD_STAGE_LowRssi = 0,
- CCK_PD_STAGE_HighRssi = 1,
- CCK_FA_STAGE_Low = 2,
- CCK_FA_STAGE_High = 3,
- CCK_PD_STAGE_MAX = 4,
-};
-
enum dm_1r_cca_e {
CCA_1R = 0,
CCA_2R = 1,
@@ -136,14 +128,6 @@ enum dm_sw_ant_switch_e {
ANS_ANTENNA_MAX = 3,
};
-enum dm_dig_ext_port_alg_e {
- DIG_EXT_PORT_STAGE_0 = 0,
- DIG_EXT_PORT_STAGE_1 = 1,
- DIG_EXT_PORT_STAGE_2 = 2,
- DIG_EXT_PORT_STAGE_3 = 3,
- DIG_EXT_PORT_STAGE_MAX = 4,
-};
-
void rtl92c_dm_init(struct ieee80211_hw *hw);
void rtl92c_dm_watchdog(struct ieee80211_hw *hw);
void rtl92c_dm_write_dig(struct ieee80211_hw *hw);
diff --git a/drivers/net/wireless/rtlwifi/rtl8192de/dm.h b/drivers/net/wireless/rtlwifi/rtl8192de/dm.h
index d21b3bc..f2d318c 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192de/dm.h
+++ b/drivers/net/wireless/rtlwifi/rtl8192de/dm.h
@@ -95,14 +95,6 @@ enum tag_dynamic_init_gain_operation_type_definition {
DIG_OP_TYPE_MAX
};
-enum tag_cck_packet_detection_threshold_type_definition {
- CCK_PD_STAGE_LOWRSSI = 0,
- CCK_PD_STAGE_HIGHRSSI = 1,
- CCK_FA_STAGE_LOW = 2,
- CCK_FA_STAGE_HIGH = 3,
- CCK_PD_STAGE_MAX = 4,
-};
-
enum dm_1r_cca {
CCA_1R = 0,
CCA_2R = 1,
@@ -121,14 +113,6 @@ enum dm_sw_ant_switch {
ANS_ANTENNA_MAX = 3,
};
-enum dm_dig_ext_port_alg {
- DIG_EXT_PORT_STAGE_0 = 0,
- DIG_EXT_PORT_STAGE_1 = 1,
- DIG_EXT_PORT_STAGE_2 = 2,
- DIG_EXT_PORT_STAGE_3 = 3,
- DIG_EXT_PORT_STAGE_MAX = 4,
-};
-
void rtl92d_dm_init(struct ieee80211_hw *hw);
void rtl92d_dm_watchdog(struct ieee80211_hw *hw);
void rtl92d_dm_init_edca_turbo(struct ieee80211_hw *hw);
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/dm.h b/drivers/net/wireless/rtlwifi/rtl8192se/dm.h
index 7d778d3..be07d81 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192se/dm.h
+++ b/drivers/net/wireless/rtlwifi/rtl8192se/dm.h
@@ -54,14 +54,6 @@ enum dm_dig_sta {
DM_STA_DIG_MAX
};
-enum dm_dig_ext_port_alg {
- DIG_EXT_PORT_STAGE_0 = 0,
- DIG_EXT_PORT_STAGE_1 = 1,
- DIG_EXT_PORT_STAGE_2 = 2,
- DIG_EXT_PORT_STAGE_3 = 3,
- DIG_EXT_PORT_STAGE_MAX = 4,
-};
-
enum dm_ratr_sta {
DM_RATR_STA_HIGH = 0,
DM_RATR_STA_MIDDLEHIGH = 1,
diff --git a/drivers/net/wireless/rtlwifi/rtl8723ae/dm.c b/drivers/net/wireless/rtlwifi/rtl8723ae/dm.c
index 80f4c54..8bd124c 100644
--- a/drivers/net/wireless/rtlwifi/rtl8723ae/dm.c
+++ b/drivers/net/wireless/rtlwifi/rtl8723ae/dm.c
@@ -396,30 +396,30 @@ static void rtl8723e_dm_cck_packet_detection_thresh(struct ieee80211_hw *hw)
if (dm_digtable->cursta_cstate == DIG_STA_CONNECT) {
dm_digtable->rssi_val_min = rtl8723e_dm_initial_gain_min_pwdb(hw);
- if (dm_digtable->pre_cck_pd_state == CCK_PD_STAGE_LowRssi) {
+ if (dm_digtable->pre_cck_pd_state == CCK_PD_STAGE_LOWRSSI) {
if (dm_digtable->rssi_val_min <= 25)
dm_digtable->cur_cck_pd_state =
- CCK_PD_STAGE_LowRssi;
+ CCK_PD_STAGE_LOWRSSI;
else
dm_digtable->cur_cck_pd_state =
- CCK_PD_STAGE_HighRssi;
+ CCK_PD_STAGE_HIGHRSSI;
} else {
if (dm_digtable->rssi_val_min <= 20)
dm_digtable->cur_cck_pd_state =
- CCK_PD_STAGE_LowRssi;
+ CCK_PD_STAGE_LOWRSSI;
else
dm_digtable->cur_cck_pd_state =
- CCK_PD_STAGE_HighRssi;
+ CCK_PD_STAGE_HIGHRSSI;
}
} else {
dm_digtable->cur_cck_pd_state = CCK_PD_STAGE_MAX;
}
if (dm_digtable->pre_cck_pd_state != dm_digtable->cur_cck_pd_state) {
- if (dm_digtable->cur_cck_pd_state == CCK_PD_STAGE_LowRssi) {
+ if (dm_digtable->cur_cck_pd_state == CCK_PD_STAGE_LOWRSSI) {
if (rtlpriv->falsealm_cnt.cnt_cck_fail > 800)
dm_digtable->cur_cck_fa_state =
- CCK_FA_STAGE_High;
+ CCK_FA_STAGE_HIGH;
else
dm_digtable->cur_cck_fa_state =
CCK_FA_STAGE_LOW;
diff --git a/drivers/net/wireless/rtlwifi/rtl8723ae/dm.h b/drivers/net/wireless/rtlwifi/rtl8723ae/dm.h
index c54024e..5711105 100644
--- a/drivers/net/wireless/rtlwifi/rtl8723ae/dm.h
+++ b/drivers/net/wireless/rtlwifi/rtl8723ae/dm.h
@@ -95,14 +95,6 @@ enum tag_dynamic_init_gain_operation_type_definition {
DIG_OP_TYPE_MAX
};
-enum tag_cck_packet_detection_threshold_type_definition {
- CCK_PD_STAGE_LowRssi = 0,
- CCK_PD_STAGE_HighRssi = 1,
- CCK_FA_STAGE_LOW = 2,
- CCK_FA_STAGE_High = 3,
- CCK_PD_STAGE_MAX = 4,
-};
-
enum dm_1r_cca_e {
CCA_1R = 0,
CCA_2R = 1,
@@ -121,14 +113,6 @@ enum dm_sw_ant_switch_e {
ANS_ANTENNA_MAX = 3,
};
-enum dm_dig_ext_port_alg_e {
- DIG_EXT_PORT_STAGE_0 = 0,
- DIG_EXT_PORT_STAGE_1 = 1,
- DIG_EXT_PORT_STAGE_2 = 2,
- DIG_EXT_PORT_STAGE_3 = 3,
- DIG_EXT_PORT_STAGE_MAX = 4,
-};
-
#define BT_RSSI_STATE_NORMAL_POWER BIT_OFFSET_LEN_MASK_32(0, 1)
#define BT_RSSI_STATE_AMDPU_OFF BIT_OFFSET_LEN_MASK_32(1, 1)
#define BT_RSSI_STATE_SPECIAL_LOW BIT_OFFSET_LEN_MASK_32(2, 1)
diff --git a/drivers/net/wireless/rtlwifi/rtl8723be/dm.h b/drivers/net/wireless/rtlwifi/rtl8723be/dm.h
index f3e47ab..533b4f2 100644
--- a/drivers/net/wireless/rtlwifi/rtl8723be/dm.h
+++ b/drivers/net/wireless/rtlwifi/rtl8723be/dm.h
@@ -239,14 +239,6 @@ enum dm_sw_ant_switch_e {
ANS_ANTENNA_MAX = 3,
};
-enum dm_dig_ext_port_alg_e {
- DIG_EXT_PORT_STAGE_0 = 0,
- DIG_EXT_PORT_STAGE_1 = 1,
- DIG_EXT_PORT_STAGE_2 = 2,
- DIG_EXT_PORT_STAGE_3 = 3,
- DIG_EXT_PORT_STAGE_MAX = 4,
-};
-
enum pwr_track_control_method {
BBSWING,
TXAGC
diff --git a/drivers/net/wireless/rtlwifi/rtl8821ae/dm.h b/drivers/net/wireless/rtlwifi/rtl8821ae/dm.h
index f311887..5516557 100644
--- a/drivers/net/wireless/rtlwifi/rtl8821ae/dm.h
+++ b/drivers/net/wireless/rtlwifi/rtl8821ae/dm.h
@@ -255,14 +255,6 @@ enum tag_dynamic_init_gain_operation_type_definition {
DIG_OP_TYPE_MAX
};
-enum tag_cck_packet_detection_threshold_type_definition {
- CCK_PD_STAGE_LOWRSSI = 0,
- CCK_PD_STAGE_HIGHRSSI = 1,
- CCK_FA_STAGE_LOW = 2,
- CCK_FA_STAGE_HIGH = 3,
- CCK_PD_STAGE_MAX = 4,
-};
-
enum dm_1r_cca_e {
CCA_1R = 0,
CCA_2R = 1,
@@ -281,14 +273,6 @@ enum dm_sw_ant_switch_e {
ANS_ANTENNA_MAX = 3,
};
-enum dm_dig_ext_port_alg_e {
- DIG_EXT_PORT_STAGE_0 = 0,
- DIG_EXT_PORT_STAGE_1 = 1,
- DIG_EXT_PORT_STAGE_2 = 2,
- DIG_EXT_PORT_STAGE_3 = 3,
- DIG_EXT_PORT_STAGE_MAX = 4,
-};
-
enum pwr_track_control_method {
BBSWING,
TXAGC,
--
2.1.2
^ permalink raw reply related
* [PATCH 03/11] rtlwifi: Create new routine to initialize the DM tables
From: Larry Finger @ 2015-01-02 16:58 UTC (permalink / raw)
To: kvalo; +Cc: linux-wireless, Larry Finger, netdev
In-Reply-To: <1420217908-1382-1-git-send-email-Larry.Finger@lwfinger.net>
Each of the drivers contains a routine that initializes the dm_digtable
member of the driver's private area. As a first step toward reducing the
size of the drivers, a copy of this driver is created in rtlwifi, and the
definitions of the parameters are moved there.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
---
drivers/net/wireless/rtlwifi/core.c | 34 +++++++++++++++++++++++
drivers/net/wireless/rtlwifi/core.h | 24 ++++++++++++++++
drivers/net/wireless/rtlwifi/rtl8188ee/dm.c | 1 +
drivers/net/wireless/rtlwifi/rtl8188ee/dm.h | 22 ---------------
drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c | 1 +
drivers/net/wireless/rtlwifi/rtl8192c/dm_common.h | 22 ---------------
drivers/net/wireless/rtlwifi/rtl8192ce/dm.c | 1 +
drivers/net/wireless/rtlwifi/rtl8192ce/dm.h | 13 ---------
drivers/net/wireless/rtlwifi/rtl8192de/dm.c | 1 +
drivers/net/wireless/rtlwifi/rtl8192de/dm.h | 22 ---------------
drivers/net/wireless/rtlwifi/rtl8192ee/dm.c | 1 +
drivers/net/wireless/rtlwifi/rtl8192ee/dm.h | 13 ---------
drivers/net/wireless/rtlwifi/rtl8192se/dm.c | 1 +
drivers/net/wireless/rtlwifi/rtl8192se/dm.h | 19 -------------
drivers/net/wireless/rtlwifi/rtl8723ae/dm.c | 1 +
drivers/net/wireless/rtlwifi/rtl8723ae/dm.h | 22 ---------------
drivers/net/wireless/rtlwifi/rtl8723be/dm.c | 1 +
drivers/net/wireless/rtlwifi/rtl8723be/dm.h | 22 ---------------
drivers/net/wireless/rtlwifi/rtl8821ae/dm.c | 1 +
drivers/net/wireless/rtlwifi/rtl8821ae/dm.h | 16 -----------
20 files changed, 67 insertions(+), 171 deletions(-)
diff --git a/drivers/net/wireless/rtlwifi/core.c b/drivers/net/wireless/rtlwifi/core.c
index deab852..5aa3ab3 100644
--- a/drivers/net/wireless/rtlwifi/core.c
+++ b/drivers/net/wireless/rtlwifi/core.c
@@ -1871,3 +1871,37 @@ bool rtl_btc_status_false(void)
return false;
}
EXPORT_SYMBOL_GPL(rtl_btc_status_false);
+
+void rtl_dm_diginit(struct ieee80211_hw *hw, u32 cur_igvalue)
+{
+ struct rtl_priv *rtlpriv = rtl_priv(hw);
+ struct dig_t *dm_digtable = &rtlpriv->dm_digtable;
+
+ dm_digtable->dig_enable_flag = true;
+ dm_digtable->cur_igvalue = cur_igvalue;
+ dm_digtable->pre_igvalue = 0;
+ dm_digtable->cur_sta_cstate = DIG_STA_DISCONNECT;
+ dm_digtable->presta_cstate = DIG_STA_DISCONNECT;
+ dm_digtable->curmultista_cstate = DIG_MULTISTA_DISCONNECT;
+ dm_digtable->rssi_lowthresh = DM_DIG_THRESH_LOW;
+ dm_digtable->rssi_highthresh = DM_DIG_THRESH_HIGH;
+ dm_digtable->fa_lowthresh = DM_FALSEALARM_THRESH_LOW;
+ dm_digtable->fa_highthresh = DM_FALSEALARM_THRESH_HIGH;
+ dm_digtable->rx_gain_max = DM_DIG_MAX;
+ dm_digtable->rx_gain_min = DM_DIG_MIN;
+ dm_digtable->back_val = DM_DIG_BACKOFF_DEFAULT;
+ dm_digtable->back_range_max = DM_DIG_BACKOFF_MAX;
+ dm_digtable->back_range_min = DM_DIG_BACKOFF_MIN;
+ dm_digtable->pre_cck_cca_thres = 0xff;
+ dm_digtable->cur_cck_cca_thres = 0x83;
+ dm_digtable->forbidden_igi = DM_DIG_MIN;
+ dm_digtable->large_fa_hit = 0;
+ dm_digtable->recover_cnt = 0;
+ dm_digtable->dig_min_0 = 0x25;
+ dm_digtable->dig_min_1 = 0x25;
+ dm_digtable->media_connect_0 = false;
+ dm_digtable->media_connect_1 = false;
+ rtlpriv->dm.dm_initialgain_enable = true;
+ dm_digtable->bt30_cur_igi = 0x32;
+}
+EXPORT_SYMBOL(rtl_dm_diginit);
diff --git a/drivers/net/wireless/rtlwifi/core.h b/drivers/net/wireless/rtlwifi/core.h
index 8c87eb5..c0a0317 100644
--- a/drivers/net/wireless/rtlwifi/core.h
+++ b/drivers/net/wireless/rtlwifi/core.h
@@ -35,6 +35,29 @@
#define RTL_SUPPORTED_CTRL_FILTER 0xFF
+#define DM_DIG_THRESH_HIGH 40
+#define DM_DIG_THRESH_LOW 35
+#define DM_FALSEALARM_THRESH_LOW 400
+#define DM_FALSEALARM_THRESH_HIGH 1000
+
+#define DM_DIG_MAX 0x3e
+#define DM_DIG_MIN 0x1e
+#define DM_DIG_BACKOFF_MAX 12
+#define DM_DIG_BACKOFF_MIN -4
+#define DM_DIG_BACKOFF_DEFAULT 10
+
+enum dm_dig_connect_e {
+ DIG_STA_DISCONNECT,
+ DIG_STA_CONNECT,
+ DIG_STA_BEFORE_CONNECT,
+ DIG_MULTISTA_DISCONNECT,
+ DIG_MULTISTA_CONNECT,
+ DIG_AP_DISCONNECT,
+ DIG_AP_CONNECT,
+ DIG_AP_ADD_STATION,
+ DIG_CONNECT_MAX
+};
+
extern const struct ieee80211_ops rtl_ops;
void rtl_fw_cb(const struct firmware *firmware, void *context);
void rtl_wowlan_fw_cb(const struct firmware *firmware, void *context);
@@ -44,5 +67,6 @@ void rtl_rfreg_delay(struct ieee80211_hw *hw, enum radio_path rfpath, u32 addr,
void rtl_bb_delay(struct ieee80211_hw *hw, u32 addr, u32 data);
bool rtl_cmd_send_packet(struct ieee80211_hw *hw, struct sk_buff *skb);
bool rtl_btc_status_false(void);
+void rtl_dm_diginit(struct ieee80211_hw *hw, u32 cur_igval);
#endif
diff --git a/drivers/net/wireless/rtlwifi/rtl8188ee/dm.c b/drivers/net/wireless/rtlwifi/rtl8188ee/dm.c
index 2aa34d9..7ebf6e0 100644
--- a/drivers/net/wireless/rtlwifi/rtl8188ee/dm.c
+++ b/drivers/net/wireless/rtlwifi/rtl8188ee/dm.c
@@ -26,6 +26,7 @@
#include "../wifi.h"
#include "../base.h"
#include "../pci.h"
+#include "../core.h"
#include "reg.h"
#include "def.h"
#include "phy.h"
diff --git a/drivers/net/wireless/rtlwifi/rtl8188ee/dm.h b/drivers/net/wireless/rtlwifi/rtl8188ee/dm.h
index 64f1f3ea..6217b7c 100644
--- a/drivers/net/wireless/rtlwifi/rtl8188ee/dm.h
+++ b/drivers/net/wireless/rtlwifi/rtl8188ee/dm.h
@@ -186,15 +186,6 @@
#define BW_AUTO_SWITCH_HIGH_LOW 25
#define BW_AUTO_SWITCH_LOW_HIGH 30
-#define DM_DIG_THRESH_HIGH 40
-#define DM_DIG_THRESH_LOW 35
-
-#define DM_FALSEALARM_THRESH_LOW 400
-#define DM_FALSEALARM_THRESH_HIGH 1000
-
-#define DM_DIG_MAX 0x3e
-#define DM_DIG_MIN 0x1e
-
#define DM_DIG_MAX_AP 0x32
#define DM_DIG_MIN_AP 0x20
@@ -204,10 +195,6 @@
#define DM_DIG_FA_TH1 0x300
#define DM_DIG_FA_TH2 0x400
-#define DM_DIG_BACKOFF_MAX 12
-#define DM_DIG_BACKOFF_MIN -4
-#define DM_DIG_BACKOFF_DEFAULT 10
-
#define RXPATHSELECTION_SS_TH_W 30
#define RXPATHSELECTION_DIFF_TH 18
@@ -296,15 +283,6 @@ enum dm_dig_ext_port_alg_e {
DIG_EXT_PORT_STAGE_MAX = 4,
};
-enum dm_dig_connect_e {
- DIG_STA_DISCONNECT = 0,
- DIG_STA_CONNECT = 1,
- DIG_STA_BEFORE_CONNECT = 2,
- DIG_MULTISTA_DISCONNECT = 3,
- DIG_MULTISTA_CONNECT = 4,
- DIG_CONNECT_MAX
-};
-
enum pwr_track_control_method {
BBSWING,
TXAGC
diff --git a/drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c b/drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c
index c3aad76..dabe18f 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c
@@ -32,6 +32,7 @@
#include "phy_common.h"
#include "../pci.h"
#include "../base.h"
+#include "../core.h"
#define BT_RSSI_STATE_NORMAL_POWER BIT_OFFSET_LEN_MASK_32(0, 1)
#define BT_RSSI_STATE_AMDPU_OFF BIT_OFFSET_LEN_MASK_32(1, 1)
diff --git a/drivers/net/wireless/rtlwifi/rtl8192c/dm_common.h b/drivers/net/wireless/rtlwifi/rtl8192c/dm_common.h
index 4f232a0..55ebffd 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192c/dm_common.h
+++ b/drivers/net/wireless/rtlwifi/rtl8192c/dm_common.h
@@ -47,25 +47,12 @@
#define BW_AUTO_SWITCH_HIGH_LOW 25
#define BW_AUTO_SWITCH_LOW_HIGH 30
-#define DM_DIG_THRESH_HIGH 40
-#define DM_DIG_THRESH_LOW 35
-
-#define DM_FALSEALARM_THRESH_LOW 400
-#define DM_FALSEALARM_THRESH_HIGH 1000
-
-#define DM_DIG_MAX 0x3e
-#define DM_DIG_MIN 0x1e
-
#define DM_DIG_FA_UPPER 0x32
#define DM_DIG_FA_LOWER 0x20
#define DM_DIG_FA_TH0 0x20
#define DM_DIG_FA_TH1 0x100
#define DM_DIG_FA_TH2 0x200
-#define DM_DIG_BACKOFF_MAX 12
-#define DM_DIG_BACKOFF_MIN -4
-#define DM_DIG_BACKOFF_DEFAULT 10
-
#define RXPATHSELECTION_SS_TH_lOW 30
#define RXPATHSELECTION_DIFF_TH 18
@@ -157,15 +144,6 @@ enum dm_dig_ext_port_alg_e {
DIG_EXT_PORT_STAGE_MAX = 4,
};
-enum dm_dig_connect_e {
- DIG_STA_DISCONNECT = 0,
- DIG_STA_CONNECT = 1,
- DIG_STA_BEFORE_CONNECT = 2,
- DIG_MULTISTA_DISCONNECT = 3,
- DIG_MULTISTA_CONNECT = 4,
- DIG_CONNECT_MAX
-};
-
void rtl92c_dm_init(struct ieee80211_hw *hw);
void rtl92c_dm_watchdog(struct ieee80211_hw *hw);
void rtl92c_dm_write_dig(struct ieee80211_hw *hw);
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/dm.c b/drivers/net/wireless/rtlwifi/rtl8192ce/dm.c
index 74f9c08..09898cf 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192ce/dm.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192ce/dm.c
@@ -30,6 +30,7 @@
#include "../wifi.h"
#include "../base.h"
#include "../pci.h"
+#include "../core.h"
#include "reg.h"
#include "def.h"
#include "phy.h"
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/dm.h b/drivers/net/wireless/rtlwifi/rtl8192ce/dm.h
index 9c5311c..38ba707 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192ce/dm.h
+++ b/drivers/net/wireless/rtlwifi/rtl8192ce/dm.h
@@ -42,25 +42,12 @@
#define BW_AUTO_SWITCH_HIGH_LOW 25
#define BW_AUTO_SWITCH_LOW_HIGH 30
-#define DM_DIG_THRESH_HIGH 40
-#define DM_DIG_THRESH_LOW 35
-
-#define DM_FALSEALARM_THRESH_LOW 400
-#define DM_FALSEALARM_THRESH_HIGH 1000
-
-#define DM_DIG_MAX 0x3e
-#define DM_DIG_MIN 0x1e
-
#define DM_DIG_FA_UPPER 0x32
#define DM_DIG_FA_LOWER 0x20
#define DM_DIG_FA_TH0 0x20
#define DM_DIG_FA_TH1 0x100
#define DM_DIG_FA_TH2 0x200
-#define DM_DIG_BACKOFF_MAX 12
-#define DM_DIG_BACKOFF_MIN -4
-#define DM_DIG_BACKOFF_DEFAULT 10
-
#define RXPATHSELECTION_SS_TH_lOW 30
#define RXPATHSELECTION_DIFF_TH 18
diff --git a/drivers/net/wireless/rtlwifi/rtl8192de/dm.c b/drivers/net/wireless/rtlwifi/rtl8192de/dm.c
index 304c443..75643ab 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192de/dm.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192de/dm.c
@@ -29,6 +29,7 @@
#include "../wifi.h"
#include "../base.h"
+#include "../core.h"
#include "reg.h"
#include "def.h"
#include "phy.h"
diff --git a/drivers/net/wireless/rtlwifi/rtl8192de/dm.h b/drivers/net/wireless/rtlwifi/rtl8192de/dm.h
index 3fea0c1..d21b3bc 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192de/dm.h
+++ b/drivers/net/wireless/rtlwifi/rtl8192de/dm.h
@@ -42,25 +42,12 @@
#define BW_AUTO_SWITCH_HIGH_LOW 25
#define BW_AUTO_SWITCH_LOW_HIGH 30
-#define DM_DIG_THRESH_HIGH 40
-#define DM_DIG_THRESH_LOW 35
-
-#define DM_FALSEALARM_THRESH_LOW 400
-#define DM_FALSEALARM_THRESH_HIGH 1000
-
-#define DM_DIG_MAX 0x3e
-#define DM_DIG_MIN 0x1c
-
#define DM_DIG_FA_UPPER 0x32
#define DM_DIG_FA_LOWER 0x20
#define DM_DIG_FA_TH0 0x100
#define DM_DIG_FA_TH1 0x400
#define DM_DIG_FA_TH2 0x600
-#define DM_DIG_BACKOFF_MAX 12
-#define DM_DIG_BACKOFF_MIN -4
-#define DM_DIG_BACKOFF_DEFAULT 10
-
#define RXPATHSELECTION_SS_TH_lOW 30
#define RXPATHSELECTION_DIFF_TH 18
@@ -142,15 +129,6 @@ enum dm_dig_ext_port_alg {
DIG_EXT_PORT_STAGE_MAX = 4,
};
-enum dm_dig_connect {
- DIG_STA_DISCONNECT = 0,
- DIG_STA_CONNECT = 1,
- DIG_STA_BEFORE_CONNECT = 2,
- DIG_MULTISTA_DISCONNECT = 3,
- DIG_MULTISTA_CONNECT = 4,
- DIG_CONNECT_MAX
-};
-
void rtl92d_dm_init(struct ieee80211_hw *hw);
void rtl92d_dm_watchdog(struct ieee80211_hw *hw);
void rtl92d_dm_init_edca_turbo(struct ieee80211_hw *hw);
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ee/dm.c b/drivers/net/wireless/rtlwifi/rtl8192ee/dm.c
index 2fa4c45..70e58d1 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192ee/dm.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192ee/dm.c
@@ -26,6 +26,7 @@
#include "../wifi.h"
#include "../base.h"
#include "../pci.h"
+#include "../core.h"
#include "reg.h"
#include "def.h"
#include "phy.h"
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ee/dm.h b/drivers/net/wireless/rtlwifi/rtl8192ee/dm.h
index 881db7d..4880e19 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192ee/dm.h
+++ b/drivers/net/wireless/rtlwifi/rtl8192ee/dm.h
@@ -189,15 +189,6 @@
#define BW_AUTO_SWITCH_HIGH_LOW 25
#define BW_AUTO_SWITCH_LOW_HIGH 30
-#define DM_DIG_THRESH_HIGH 40
-#define DM_DIG_THRESH_LOW 35
-
-#define DM_FALSEALARM_THRESH_LOW 400
-#define DM_FALSEALARM_THRESH_HIGH 1000
-
-#define DM_DIG_MAX 0x3e
-#define DM_DIG_MIN 0x1e
-
#define DM_DIG_MAX_AP 0x32
#define DM_DIG_MIN_AP 0x20
@@ -207,10 +198,6 @@
#define DM_DIG_FA_TH1 0x300
#define DM_DIG_FA_TH2 0x400
-#define DM_DIG_BACKOFF_MAX 12
-#define DM_DIG_BACKOFF_MIN -4
-#define DM_DIG_BACKOFF_DEFAULT 10
-
#define RXPATHSELECTION_SS_TH_LOW 30
#define RXPATHSELECTION_DIFF_TH 18
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/dm.c b/drivers/net/wireless/rtlwifi/rtl8192se/dm.c
index b3a2d5e..6cac70b 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192se/dm.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192se/dm.c
@@ -29,6 +29,7 @@
#include "../wifi.h"
#include "../base.h"
+#include "../core.h"
#include "reg.h"
#include "def.h"
#include "phy.h"
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/dm.h b/drivers/net/wireless/rtlwifi/rtl8192se/dm.h
index 2e9052c..7d778d3 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192se/dm.h
+++ b/drivers/net/wireless/rtlwifi/rtl8192se/dm.h
@@ -54,16 +54,6 @@ enum dm_dig_sta {
DM_STA_DIG_MAX
};
-enum dm_dig_connect {
- DIG_STA_DISCONNECT = 0,
- DIG_STA_CONNECT = 1,
- DIG_STA_BEFORE_CONNECT = 2,
- DIG_AP_DISCONNECT = 3,
- DIG_AP_CONNECT = 4,
- DIG_AP_ADD_STATION = 5,
- DIG_CONNECT_MAX
-};
-
enum dm_dig_ext_port_alg {
DIG_EXT_PORT_STAGE_0 = 0,
DIG_EXT_PORT_STAGE_1 = 1,
@@ -99,22 +89,13 @@ enum dm_ratr_sta {
#define TX_POWER_NEAR_FIELD_THRESH_LVL2 74
#define TX_POWER_NEAR_FIELD_THRESH_LVL1 67
-#define DM_DIG_THRESH_HIGH 40
-#define DM_DIG_THRESH_LOW 35
-#define DM_FALSEALARM_THRESH_LOW 40
-#define DM_FALSEALARM_THRESH_HIGH 1000
#define DM_DIG_HIGH_PWR_THRESH_HIGH 75
#define DM_DIG_HIGH_PWR_THRESH_LOW 70
#define DM_DIG_BACKOFF 12
-#define DM_DIG_MAX 0x3e
-#define DM_DIG_MIN 0x1c
#define DM_DIG_MIN_Netcore 0x12
-#define DM_DIG_BACKOFF_MAX 12
-#define DM_DIG_BACKOFF_MIN -4
void rtl92s_dm_watchdog(struct ieee80211_hw *hw);
void rtl92s_dm_init(struct ieee80211_hw *hw);
void rtl92s_dm_init_edca_turbo(struct ieee80211_hw *hw);
#endif
-
diff --git a/drivers/net/wireless/rtlwifi/rtl8723ae/dm.c b/drivers/net/wireless/rtlwifi/rtl8723ae/dm.c
index a0e8692..80f4c54 100644
--- a/drivers/net/wireless/rtlwifi/rtl8723ae/dm.c
+++ b/drivers/net/wireless/rtlwifi/rtl8723ae/dm.c
@@ -26,6 +26,7 @@
#include "../wifi.h"
#include "../base.h"
#include "../pci.h"
+#include "../core.h"
#include "reg.h"
#include "def.h"
#include "phy.h"
diff --git a/drivers/net/wireless/rtlwifi/rtl8723ae/dm.h b/drivers/net/wireless/rtlwifi/rtl8723ae/dm.h
index 6fa0feb..c54024e 100644
--- a/drivers/net/wireless/rtlwifi/rtl8723ae/dm.h
+++ b/drivers/net/wireless/rtlwifi/rtl8723ae/dm.h
@@ -42,25 +42,12 @@
#define BW_AUTO_SWITCH_HIGH_LOW 25
#define BW_AUTO_SWITCH_LOW_HIGH 30
-#define DM_DIG_THRESH_HIGH 40
-#define DM_DIG_THRESH_LOW 35
-
-#define DM_FALSEALARM_THRESH_LOW 400
-#define DM_FALSEALARM_THRESH_HIGH 1000
-
-#define DM_DIG_MAX 0x3e
-#define DM_DIG_MIN 0x1e
-
#define DM_DIG_FA_UPPER 0x32
#define DM_DIG_FA_LOWER 0x20
#define DM_DIG_FA_TH0 0x20
#define DM_DIG_FA_TH1 0x100
#define DM_DIG_FA_TH2 0x200
-#define DM_DIG_BACKOFF_MAX 12
-#define DM_DIG_BACKOFF_MIN -4
-#define DM_DIG_BACKOFF_DEFAULT 10
-
#define RXPATHSELECTION_SS_TH_LOW 30
#define RXPATHSELECTION_DIFF_TH 18
@@ -142,15 +129,6 @@ enum dm_dig_ext_port_alg_e {
DIG_EXT_PORT_STAGE_MAX = 4,
};
-enum dm_dig_connect_e {
- DIG_STA_DISCONNECT = 0,
- DIG_STA_CONNECT = 1,
- DIG_STA_BEFORE_CONNECT = 2,
- DIG_MULTISTA_DISCONNECT = 3,
- DIG_MULTISTA_CONNECT = 4,
- DIG_CONNECT_MAX
-};
-
#define BT_RSSI_STATE_NORMAL_POWER BIT_OFFSET_LEN_MASK_32(0, 1)
#define BT_RSSI_STATE_AMDPU_OFF BIT_OFFSET_LEN_MASK_32(1, 1)
#define BT_RSSI_STATE_SPECIAL_LOW BIT_OFFSET_LEN_MASK_32(2, 1)
diff --git a/drivers/net/wireless/rtlwifi/rtl8723be/dm.c b/drivers/net/wireless/rtlwifi/rtl8723be/dm.c
index b92c521e..ddf45d9 100644
--- a/drivers/net/wireless/rtlwifi/rtl8723be/dm.c
+++ b/drivers/net/wireless/rtlwifi/rtl8723be/dm.c
@@ -26,6 +26,7 @@
#include "../wifi.h"
#include "../base.h"
#include "../pci.h"
+#include "../core.h"
#include "reg.h"
#include "def.h"
#include "phy.h"
diff --git a/drivers/net/wireless/rtlwifi/rtl8723be/dm.h b/drivers/net/wireless/rtlwifi/rtl8723be/dm.h
index e4c0e8a..f3e47ab 100644
--- a/drivers/net/wireless/rtlwifi/rtl8723be/dm.h
+++ b/drivers/net/wireless/rtlwifi/rtl8723be/dm.h
@@ -180,15 +180,6 @@
#define BW_AUTO_SWITCH_HIGH_LOW 25
#define BW_AUTO_SWITCH_LOW_HIGH 30
-#define DM_DIG_THRESH_HIGH 40
-#define DM_DIG_THRESH_LOW 35
-
-#define DM_FALSEALARM_THRESH_LOW 400
-#define DM_FALSEALARM_THRESH_HIGH 1000
-
-#define DM_DIG_MAX 0x3e
-#define DM_DIG_MIN 0x1e
-
#define DM_DIG_MAX_AP 0x32
#define DM_DIG_MIN_AP 0x20
@@ -198,10 +189,6 @@
#define DM_DIG_FA_TH1 0x300
#define DM_DIG_FA_TH2 0x400
-#define DM_DIG_BACKOFF_MAX 12
-#define DM_DIG_BACKOFF_MIN -4
-#define DM_DIG_BACKOFF_DEFAULT 10
-
#define RXPATHSELECTION_SS_TH_LOW 30
#define RXPATHSELECTION_DIFF_TH 18
@@ -260,15 +247,6 @@ enum dm_dig_ext_port_alg_e {
DIG_EXT_PORT_STAGE_MAX = 4,
};
-enum dm_dig_connect_e {
- DIG_STA_DISCONNECT = 0,
- DIG_STA_CONNECT = 1,
- DIG_STA_BEFORE_CONNECT = 2,
- DIG_MULTISTA_DISCONNECT = 3,
- DIG_MULTISTA_CONNECT = 4,
- DIG_CONNECT_MAX
-};
-
enum pwr_track_control_method {
BBSWING,
TXAGC
diff --git a/drivers/net/wireless/rtlwifi/rtl8821ae/dm.c b/drivers/net/wireless/rtlwifi/rtl8821ae/dm.c
index 8b0bfb2..4af4613 100644
--- a/drivers/net/wireless/rtlwifi/rtl8821ae/dm.c
+++ b/drivers/net/wireless/rtlwifi/rtl8821ae/dm.c
@@ -26,6 +26,7 @@
#include "../wifi.h"
#include "../base.h"
#include "../pci.h"
+#include "../core.h"
#include "reg.h"
#include "def.h"
#include "phy.h"
diff --git a/drivers/net/wireless/rtlwifi/rtl8821ae/dm.h b/drivers/net/wireless/rtlwifi/rtl8821ae/dm.h
index 9dd40dd..f311887 100644
--- a/drivers/net/wireless/rtlwifi/rtl8821ae/dm.h
+++ b/drivers/net/wireless/rtlwifi/rtl8821ae/dm.h
@@ -187,9 +187,6 @@
#define BW_AUTO_SWITCH_HIGH_LOW 25
#define BW_AUTO_SWITCH_LOW_HIGH 30
-#define DM_DIG_THRESH_HIGH 40
-#define DM_DIG_THRESH_LOW 35
-
#define DM_FALSEALARM_THRESH_LOW 400
#define DM_FALSEALARM_THRESH_HIGH 1000
@@ -205,10 +202,6 @@
#define DM_DIG_FA_TH1 0x300
#define DM_DIG_FA_TH2 0x400
-#define DM_DIG_BACKOFF_MAX 12
-#define DM_DIG_BACKOFF_MIN -4
-#define DM_DIG_BACKOFF_DEFAULT 10
-
#define RXPATHSELECTION_SS_TH_LOW 30
#define RXPATHSELECTION_DIFF_TH 18
@@ -296,15 +289,6 @@ enum dm_dig_ext_port_alg_e {
DIG_EXT_PORT_STAGE_MAX = 4,
};
-enum dm_dig_connect_e {
- DIG_STA_DISCONNECT = 0,
- DIG_STA_CONNECT = 1,
- DIG_STA_BEFORE_CONNECT = 2,
- DIG_MULTISTA_DISCONNECT = 3,
- DIG_MULTISTA_CONNECT = 4,
- DIG_CONNECT_MAX
-};
-
enum pwr_track_control_method {
BBSWING,
TXAGC,
--
2.1.2
^ permalink raw reply related
* [PATCH 02/11] rtlwifi: rtl8723be: Improve modinfo output
From: Larry Finger @ 2015-01-02 16:58 UTC (permalink / raw)
To: kvalo; +Cc: linux-wireless, Larry Finger, netdev
In-Reply-To: <1420217908-1382-1-git-send-email-Larry.Finger@lwfinger.net>
The description of the power-save variables for this driver is not as
clear as for the others. The wording is changed to match the others.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
---
drivers/net/wireless/rtlwifi/rtl8723be/sw.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/net/wireless/rtlwifi/rtl8723be/sw.c b/drivers/net/wireless/rtlwifi/rtl8723be/sw.c
index 223eb42..52a6d90 100644
--- a/drivers/net/wireless/rtlwifi/rtl8723be/sw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8723be/sw.c
@@ -387,12 +387,13 @@ module_param_named(swlps, rtl8723be_mod_params.swctrl_lps, bool, 0444);
module_param_named(fwlps, rtl8723be_mod_params.fwctrl_lps, bool, 0444);
module_param_named(disable_watchdog, rtl8723be_mod_params.disable_watchdog,
bool, 0444);
-MODULE_PARM_DESC(swenc, "using hardware crypto (default 0 [hardware])\n");
-MODULE_PARM_DESC(ips, "using no link power save (default 1 is open)\n");
-MODULE_PARM_DESC(fwlps, "using linked fw control power save (default 1 is open)\n");
-MODULE_PARM_DESC(msi, "Set to 1 to use MSI interrupts mode (default 0)\n");
+MODULE_PARM_DESC(swenc, "Set to 1 for software crypto (default 0)\n");
+MODULE_PARM_DESC(ips, "Set to 0 to not use link power save (default 1)\n");
+MODULE_PARM_DESC(swlps, "Set to 1 to use SW control power save (default 0)\n");
+MODULE_PARM_DESC(fwlps, "Set to 1 to use FW control power save (default 1)\n");
MODULE_PARM_DESC(debug, "Set debug level (0-5) (default 0)");
-MODULE_PARM_DESC(disable_watchdog, "Set to 1 to disable the watchdog (default 0)\n");
+MODULE_PARM_DESC(disable_watchdog,
+ "Set to 1 to disable the watchdog (default 0)\n");
static SIMPLE_DEV_PM_OPS(rtlwifi_pm_ops, rtl_pci_suspend, rtl_pci_resume);
--
2.1.2
^ permalink raw reply related
* [PATCH 01/11] rtlwifi: Unify variable naming for all drivers
From: Larry Finger @ 2015-01-02 16:58 UTC (permalink / raw)
To: kvalo; +Cc: linux-wireless, Larry Finger, netdev
In-Reply-To: <1420217908-1382-1-git-send-email-Larry.Finger@lwfinger.net>
Some drivers refer to a particular quantity in the driver's private
are by one name, while others use a different name. These differences
are removed.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
---
drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c | 2 +-
drivers/net/wireless/rtlwifi/rtl8192ee/dm.c | 26 ++++++++++----------
drivers/net/wireless/rtlwifi/rtl8723be/dm.c | 26 ++++++++++----------
drivers/net/wireless/rtlwifi/rtl8821ae/dm.c | 30 +++++++++++------------
drivers/net/wireless/rtlwifi/wifi.h | 2 --
5 files changed, 42 insertions(+), 44 deletions(-)
diff --git a/drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c b/drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c
index f6cb5ae..c3aad76 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c
@@ -221,7 +221,7 @@ static void rtl92c_dm_diginit(struct ieee80211_hw *hw)
dm_digtable->forbidden_igi = DM_DIG_MIN;
dm_digtable->large_fa_hit = 0;
dm_digtable->recover_cnt = 0;
- dm_digtable->dig_dynamic_min = 0x25;
+ dm_digtable->dig_min_0 = 0x25;
}
static u8 rtl92c_dm_initial_gain_min_pwdb(struct ieee80211_hw *hw)
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ee/dm.c b/drivers/net/wireless/rtlwifi/rtl8192ee/dm.c
index 77deedf..2fa4c45 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192ee/dm.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192ee/dm.c
@@ -172,8 +172,8 @@ static void rtl92ee_dm_diginit(struct ieee80211_hw *hw)
dm_dig->forbidden_igi = DM_DIG_MIN;
dm_dig->large_fa_hit = 0;
dm_dig->recover_cnt = 0;
- dm_dig->dig_dynamic_min = DM_DIG_MIN;
- dm_dig->dig_dynamic_min_1 = DM_DIG_MIN;
+ dm_dig->dig_min_0 = DM_DIG_MIN;
+ dm_dig->dig_min_1 = DM_DIG_MIN;
dm_dig->media_connect_0 = false;
dm_dig->media_connect_1 = false;
rtlpriv->dm.dm_initialgain_enable = true;
@@ -298,7 +298,7 @@ static void rtl92ee_dm_dig(struct ieee80211_hw *hw)
struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
struct dig_t *dm_dig = &rtlpriv->dm_digtable;
- u8 dig_dynamic_min , dig_maxofmin;
+ u8 dig_min_0, dig_maxofmin;
bool bfirstconnect , bfirstdisconnect;
u8 dm_dig_max, dm_dig_min;
u8 current_igi = dm_dig->cur_igvalue;
@@ -308,7 +308,7 @@ static void rtl92ee_dm_dig(struct ieee80211_hw *hw)
if (mac->act_scanning)
return;
- dig_dynamic_min = dm_dig->dig_dynamic_min;
+ dig_min_0 = dm_dig->dig_min_0;
bfirstconnect = (mac->link_state >= MAC80211_LINKED) &&
!dm_dig->media_connect_0;
bfirstdisconnect = (mac->link_state < MAC80211_LINKED) &&
@@ -329,19 +329,19 @@ static void rtl92ee_dm_dig(struct ieee80211_hw *hw)
if (rtlpriv->dm.one_entry_only) {
offset = 0;
if (dm_dig->rssi_val_min - offset < dm_dig_min)
- dig_dynamic_min = dm_dig_min;
+ dig_min_0 = dm_dig_min;
else if (dm_dig->rssi_val_min - offset >
dig_maxofmin)
- dig_dynamic_min = dig_maxofmin;
+ dig_min_0 = dig_maxofmin;
else
- dig_dynamic_min = dm_dig->rssi_val_min - offset;
+ dig_min_0 = dm_dig->rssi_val_min - offset;
} else {
- dig_dynamic_min = dm_dig_min;
+ dig_min_0 = dm_dig_min;
}
} else {
dm_dig->rx_gain_max = dm_dig_max;
- dig_dynamic_min = dm_dig_min;
+ dig_min_0 = dm_dig_min;
RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD, "no link\n");
}
@@ -368,10 +368,10 @@ static void rtl92ee_dm_dig(struct ieee80211_hw *hw)
} else {
if (dm_dig->large_fa_hit < 3) {
if ((dm_dig->forbidden_igi - 1) <
- dig_dynamic_min) {
- dm_dig->forbidden_igi = dig_dynamic_min;
+ dig_min_0) {
+ dm_dig->forbidden_igi = dig_min_0;
dm_dig->rx_gain_min =
- dig_dynamic_min;
+ dig_min_0;
} else {
dm_dig->forbidden_igi--;
dm_dig->rx_gain_min =
@@ -430,7 +430,7 @@ static void rtl92ee_dm_dig(struct ieee80211_hw *hw)
rtl92ee_dm_write_dig(hw , current_igi);
dm_dig->media_connect_0 = ((mac->link_state >= MAC80211_LINKED) ?
true : false);
- dm_dig->dig_dynamic_min = dig_dynamic_min;
+ dm_dig->dig_min_0 = dig_min_0;
}
void rtl92ee_dm_write_cck_cca_thres(struct ieee80211_hw *hw, u8 cur_thres)
diff --git a/drivers/net/wireless/rtlwifi/rtl8723be/dm.c b/drivers/net/wireless/rtlwifi/rtl8723be/dm.c
index dd7eb43..b92c521e 100644
--- a/drivers/net/wireless/rtlwifi/rtl8723be/dm.c
+++ b/drivers/net/wireless/rtlwifi/rtl8723be/dm.c
@@ -232,8 +232,8 @@ static void rtl8723be_dm_diginit(struct ieee80211_hw *hw)
dm_digtable->forbidden_igi = DM_DIG_MIN;
dm_digtable->large_fa_hit = 0;
dm_digtable->recover_cnt = 0;
- dm_digtable->dig_dynamic_min = DM_DIG_MIN;
- dm_digtable->dig_dynamic_min_1 = DM_DIG_MIN;
+ dm_digtable->dig_min_0 = DM_DIG_MIN;
+ dm_digtable->dig_min_1 = DM_DIG_MIN;
dm_digtable->media_connect_0 = false;
dm_digtable->media_connect_1 = false;
rtlpriv->dm.dm_initialgain_enable = true;
@@ -424,7 +424,7 @@ static void rtl8723be_dm_dig(struct ieee80211_hw *hw)
struct rtl_priv *rtlpriv = rtl_priv(hw);
struct dig_t *dm_digtable = &rtlpriv->dm_digtable;
struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
- u8 dig_dynamic_min, dig_maxofmin;
+ u8 dig_min_0, dig_maxofmin;
bool bfirstconnect, bfirstdisconnect;
u8 dm_dig_max, dm_dig_min;
u8 current_igi = dm_digtable->cur_igvalue;
@@ -434,7 +434,7 @@ static void rtl8723be_dm_dig(struct ieee80211_hw *hw)
if (mac->act_scanning)
return;
- dig_dynamic_min = dm_digtable->dig_dynamic_min;
+ dig_min_0 = dm_digtable->dig_min_0;
bfirstconnect = (mac->link_state >= MAC80211_LINKED) &&
!dm_digtable->media_connect_0;
bfirstdisconnect = (mac->link_state < MAC80211_LINKED) &&
@@ -456,20 +456,20 @@ static void rtl8723be_dm_dig(struct ieee80211_hw *hw)
if (rtlpriv->dm.one_entry_only) {
offset = 12;
if (dm_digtable->rssi_val_min - offset < dm_dig_min)
- dig_dynamic_min = dm_dig_min;
+ dig_min_0 = dm_dig_min;
else if (dm_digtable->rssi_val_min - offset >
dig_maxofmin)
- dig_dynamic_min = dig_maxofmin;
+ dig_min_0 = dig_maxofmin;
else
- dig_dynamic_min =
+ dig_min_0 =
dm_digtable->rssi_val_min - offset;
} else {
- dig_dynamic_min = dm_dig_min;
+ dig_min_0 = dm_dig_min;
}
} else {
dm_digtable->rx_gain_max = dm_dig_max;
- dig_dynamic_min = dm_dig_min;
+ dig_min_0 = dm_dig_min;
RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD, "no link\n");
}
@@ -497,11 +497,11 @@ static void rtl8723be_dm_dig(struct ieee80211_hw *hw)
} else {
if (dm_digtable->large_fa_hit < 3) {
if ((dm_digtable->forbidden_igi - 1) <
- dig_dynamic_min) {
+ dig_min_0) {
dm_digtable->forbidden_igi =
- dig_dynamic_min;
+ dig_min_0;
dm_digtable->rx_gain_min =
- dig_dynamic_min;
+ dig_min_0;
} else {
dm_digtable->forbidden_igi--;
dm_digtable->rx_gain_min =
@@ -552,7 +552,7 @@ static void rtl8723be_dm_dig(struct ieee80211_hw *hw)
rtl8723be_dm_write_dig(hw, current_igi);
dm_digtable->media_connect_0 =
((mac->link_state >= MAC80211_LINKED) ? true : false);
- dm_digtable->dig_dynamic_min = dig_dynamic_min;
+ dm_digtable->dig_min_0 = dig_min_0;
}
static void rtl8723be_dm_false_alarm_counter_statistics(
diff --git a/drivers/net/wireless/rtlwifi/rtl8821ae/dm.c b/drivers/net/wireless/rtlwifi/rtl8821ae/dm.c
index ba30b0d..8b0bfb2 100644
--- a/drivers/net/wireless/rtlwifi/rtl8821ae/dm.c
+++ b/drivers/net/wireless/rtlwifi/rtl8821ae/dm.c
@@ -539,8 +539,8 @@ static void rtl8821ae_dm_diginit(struct ieee80211_hw *hw)
dm_digtable->forbidden_igi = DM_DIG_MIN;
dm_digtable->large_fa_hit = 0;
dm_digtable->recover_cnt = 0;
- dm_digtable->dig_dynamic_min = DM_DIG_MIN;
- dm_digtable->dig_dynamic_min_1 = DM_DIG_MIN;
+ dm_digtable->dig_min_0 = DM_DIG_MIN;
+ dm_digtable->dig_min_1 = DM_DIG_MIN;
dm_digtable->media_connect_0 = false;
dm_digtable->media_connect_1 = false;
rtlpriv->dm.dm_initialgain_enable = true;
@@ -822,7 +822,7 @@ static void rtl8821ae_dm_dig(struct ieee80211_hw *hw)
struct dig_t *dm_digtable = &rtlpriv->dm_digtable;
struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
- u8 dig_dynamic_min;
+ u8 dig_min_0;
u8 dig_max_of_min;
bool first_connect, first_disconnect;
u8 dm_dig_max, dm_dig_min, offset;
@@ -837,7 +837,7 @@ static void rtl8821ae_dm_dig(struct ieee80211_hw *hw)
}
/*add by Neil Chen to avoid PSD is processing*/
- dig_dynamic_min = dm_digtable->dig_dynamic_min;
+ dig_min_0 = dm_digtable->dig_min_0;
first_connect = (mac->link_state >= MAC80211_LINKED) &&
(!dm_digtable->media_connect_0);
first_disconnect = (mac->link_state < MAC80211_LINKED) &&
@@ -876,23 +876,23 @@ static void rtl8821ae_dm_dig(struct ieee80211_hw *hw)
offset = 0;
if (dm_digtable->rssi_val_min - offset < dm_dig_min)
- dig_dynamic_min = dm_dig_min;
+ dig_min_0 = dm_dig_min;
else if (dm_digtable->rssi_val_min -
offset > dig_max_of_min)
- dig_dynamic_min = dig_max_of_min;
+ dig_min_0 = dig_max_of_min;
else
- dig_dynamic_min =
+ dig_min_0 =
dm_digtable->rssi_val_min - offset;
RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD,
- "bOneEntryOnly=TRUE, dig_dynamic_min=0x%x\n",
- dig_dynamic_min);
+ "bOneEntryOnly=TRUE, dig_min_0=0x%x\n",
+ dig_min_0);
} else {
- dig_dynamic_min = dm_dig_min;
+ dig_min_0 = dm_dig_min;
}
} else {
dm_digtable->rx_gain_max = dm_dig_max;
- dig_dynamic_min = dm_dig_min;
+ dig_min_0 = dm_dig_min;
RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD,
"No Link\n");
}
@@ -925,11 +925,11 @@ static void rtl8821ae_dm_dig(struct ieee80211_hw *hw)
} else {
if (dm_digtable->large_fa_hit < 3) {
if ((dm_digtable->forbidden_igi - 1) <
- dig_dynamic_min) {
+ dig_min_0) {
dm_digtable->forbidden_igi =
- dig_dynamic_min;
+ dig_min_0;
dm_digtable->rx_gain_min =
- dig_dynamic_min;
+ dig_min_0;
RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD,
"Normal Case: At Lower Bound\n");
} else {
@@ -1024,7 +1024,7 @@ static void rtl8821ae_dm_dig(struct ieee80211_hw *hw)
rtl8821ae_dm_write_dig(hw, current_igi);
dm_digtable->media_connect_0 =
((mac->link_state >= MAC80211_LINKED) ? true : false);
- dm_digtable->dig_dynamic_min = dig_dynamic_min;
+ dm_digtable->dig_min_0 = dig_min_0;
}
static void rtl8821ae_dm_common_info_self_update(struct ieee80211_hw *hw)
diff --git a/drivers/net/wireless/rtlwifi/wifi.h b/drivers/net/wireless/rtlwifi/wifi.h
index 7a718fd..b53d9dd 100644
--- a/drivers/net/wireless/rtlwifi/wifi.h
+++ b/drivers/net/wireless/rtlwifi/wifi.h
@@ -2412,8 +2412,6 @@ struct dig_t {
u8 pre_ccastate;
u8 cur_ccasate;
u8 large_fa_hit;
- u8 dig_dynamic_min;
- u8 dig_dynamic_min_1;
u8 forbidden_igi;
u8 dig_state;
u8 dig_highpwrstate;
--
2.1.2
^ permalink raw reply related
* [PATCH 00/11] rtlwifi: A set of patches that simplify the drivers
From: Larry Finger @ 2015-01-02 16:58 UTC (permalink / raw)
To: kvalo; +Cc: linux-wireless, Larry Finger, netdev
Happy New Year.
This set of patches, which are intended for the 3.20 stream, are intended to
simplify the drivers. In particular, each of them has a separate routine that
initilizes the dynamic power manipulation variables. Ten of these patches convert
the drivers to use a common copy of this code. The other patch updates the
parameter descriptions of rtl8723be to clarify usage.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
---
Larry Finger (11):
rtlwifi: Unify variable naming for all drivers
rtlwifi: rtl8723be: Improve modinfo output
rtlwifi: Create new routine to initialize the DM tables
rtlwifi: rtl8188ee: Convert driver to use the common DM table init
routine
rtlwifi: rtl8192c-common: Convert driver to use common DM table
initialization
rtlwifi: rtl8192de: Convert driver to use common DM table
initialization
rtlwifi: rtl8192ee: Convert driver to use common DM table
initialization
rtlwifi: rtl8723ae: Convert driver to use common DM table
initialization
rtlwifi: rtl8723be: Convert driver to use common DM table
initialization
rtlwifi: rtl8821ae: Convert driver to use common DM table
initialization
rtlwifi: Move macro definitions to core
drivers/net/wireless/rtlwifi/core.c | 37 +++++++++++++++
drivers/net/wireless/rtlwifi/core.h | 41 ++++++++++++++++
drivers/net/wireless/rtlwifi/rtl8188ee/dm.c | 36 ++------------
drivers/net/wireless/rtlwifi/rtl8188ee/dm.h | 41 ----------------
drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c | 45 ++++--------------
drivers/net/wireless/rtlwifi/rtl8192c/dm_common.h | 38 ---------------
drivers/net/wireless/rtlwifi/rtl8192ce/dm.c | 1 +
drivers/net/wireless/rtlwifi/rtl8192ce/dm.h | 13 -----
drivers/net/wireless/rtlwifi/rtl8192de/dm.c | 33 ++-----------
drivers/net/wireless/rtlwifi/rtl8192de/dm.h | 38 ---------------
drivers/net/wireless/rtlwifi/rtl8192ee/dm.c | 55 ++++++---------------
drivers/net/wireless/rtlwifi/rtl8192ee/dm.h | 16 -------
drivers/net/wireless/rtlwifi/rtl8192se/dm.c | 7 +--
drivers/net/wireless/rtlwifi/rtl8192se/dm.h | 28 -----------
drivers/net/wireless/rtlwifi/rtl8723ae/dm.c | 42 ++++------------
drivers/net/wireless/rtlwifi/rtl8723ae/dm.h | 38 ---------------
drivers/net/wireless/rtlwifi/rtl8723be/dm.c | 55 ++++++---------------
drivers/net/wireless/rtlwifi/rtl8723be/dm.h | 33 -------------
drivers/net/wireless/rtlwifi/rtl8723be/sw.c | 11 +++--
drivers/net/wireless/rtlwifi/rtl8821ae/dm.c | 58 +++++++----------------
drivers/net/wireless/rtlwifi/rtl8821ae/dm.h | 41 ----------------
drivers/net/wireless/rtlwifi/wifi.h | 2 -
22 files changed, 157 insertions(+), 552 deletions(-)
--
2.1.2
^ permalink raw reply
* [PATCH 10/11] rtlwifi: rtl8821ae: Convert driver to use common DM table initialization
From: Larry Finger @ 2015-01-02 16:58 UTC (permalink / raw)
To: kvalo-sgV2jX0FEOL9JmXXK+q4OQ
Cc: linux-wireless-u79uwXL29TY76Z2rM5mHXA, Larry Finger,
netdev-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1420217908-1382-1-git-send-email-Larry.Finger-tQ5ms3gMjBLk1uMJSBkQmQ@public.gmane.org>
Convert driver to use routine rtl_dm_diginit().
Signed-off-by: Larry Finger <Larry.Finger-tQ5ms3gMjBLk1uMJSBkQmQ@public.gmane.org>
---
drivers/net/wireless/rtlwifi/rtl8821ae/dm.c | 31 ++---------------------------
1 file changed, 2 insertions(+), 29 deletions(-)
diff --git a/drivers/net/wireless/rtlwifi/rtl8821ae/dm.c b/drivers/net/wireless/rtlwifi/rtl8821ae/dm.c
index 4af4613..0b2082d 100644
--- a/drivers/net/wireless/rtlwifi/rtl8821ae/dm.c
+++ b/drivers/net/wireless/rtlwifi/rtl8821ae/dm.c
@@ -520,34 +520,6 @@ void rtl8821ae_dm_initialize_txpower_tracking_thermalmeter(
}
}
-static void rtl8821ae_dm_diginit(struct ieee80211_hw *hw)
-{
- struct rtl_priv *rtlpriv = rtl_priv(hw);
- struct dig_t *dm_digtable = &rtlpriv->dm_digtable;
-
- dm_digtable->cur_igvalue = rtl_get_bbreg(hw, ROFDM0_XAAGCCORE1, 0x7f);
- dm_digtable->rssi_lowthresh = DM_DIG_THRESH_LOW;
- dm_digtable->rssi_highthresh = DM_DIG_THRESH_HIGH;
- dm_digtable->fa_lowthresh = DM_FALSEALARM_THRESH_LOW;
- dm_digtable->fa_highthresh = DM_FALSEALARM_THRESH_HIGH;
- dm_digtable->rx_gain_max = DM_DIG_MAX;
- dm_digtable->rx_gain_min = DM_DIG_MIN;
- dm_digtable->back_val = DM_DIG_BACKOFF_DEFAULT;
- dm_digtable->back_range_max = DM_DIG_BACKOFF_MAX;
- dm_digtable->back_range_min = DM_DIG_BACKOFF_MIN;
- dm_digtable->pre_cck_cca_thres = 0xff;
- dm_digtable->cur_cck_cca_thres = 0x83;
- dm_digtable->forbidden_igi = DM_DIG_MIN;
- dm_digtable->large_fa_hit = 0;
- dm_digtable->recover_cnt = 0;
- dm_digtable->dig_min_0 = DM_DIG_MIN;
- dm_digtable->dig_min_1 = DM_DIG_MIN;
- dm_digtable->media_connect_0 = false;
- dm_digtable->media_connect_1 = false;
- rtlpriv->dm.dm_initialgain_enable = true;
- dm_digtable->bt30_cur_igi = 0x32;
-}
^ permalink raw reply related
* [PATCH 04/11] rtlwifi: rtl8188ee: Convert driver to use the common DM table init routine
From: Larry Finger @ 2015-01-02 16:58 UTC (permalink / raw)
To: kvalo-sgV2jX0FEOL9JmXXK+q4OQ
Cc: linux-wireless-u79uwXL29TY76Z2rM5mHXA, Larry Finger,
netdev-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1420217908-1382-1-git-send-email-Larry.Finger-tQ5ms3gMjBLk1uMJSBkQmQ@public.gmane.org>
The previous patch created a routine in rtlwifi to initialize dm_digtable.
Driver rtl8188ee is converted to use that routine.
Signed-off-by: Larry Finger <Larry.Finger-tQ5ms3gMjBLk1uMJSBkQmQ@public.gmane.org>
---
drivers/net/wireless/rtlwifi/rtl8188ee/dm.c | 35 ++---------------------------
1 file changed, 2 insertions(+), 33 deletions(-)
diff --git a/drivers/net/wireless/rtlwifi/rtl8188ee/dm.c b/drivers/net/wireless/rtlwifi/rtl8188ee/dm.c
index 7ebf6e0..d930c1f 100644
--- a/drivers/net/wireless/rtlwifi/rtl8188ee/dm.c
+++ b/drivers/net/wireless/rtlwifi/rtl8188ee/dm.c
@@ -342,38 +342,6 @@ static void dm_tx_pwr_track_set_pwr(struct ieee80211_hw *hw,
}
}
-static void rtl88e_dm_diginit(struct ieee80211_hw *hw)
-{
- struct rtl_priv *rtlpriv = rtl_priv(hw);
- struct dig_t *dm_dig = &rtlpriv->dm_digtable;
-
- dm_dig->dig_enable_flag = true;
- dm_dig->cur_igvalue = rtl_get_bbreg(hw, ROFDM0_XAAGCCORE1, 0x7f);
- dm_dig->pre_igvalue = 0;
- dm_dig->cur_sta_cstate = DIG_STA_DISCONNECT;
- dm_dig->presta_cstate = DIG_STA_DISCONNECT;
- dm_dig->curmultista_cstate = DIG_MULTISTA_DISCONNECT;
- dm_dig->rssi_lowthresh = DM_DIG_THRESH_LOW;
- dm_dig->rssi_highthresh = DM_DIG_THRESH_HIGH;
- dm_dig->fa_lowthresh = DM_FALSEALARM_THRESH_LOW;
- dm_dig->fa_highthresh = DM_FALSEALARM_THRESH_HIGH;
- dm_dig->rx_gain_max = DM_DIG_MAX;
- dm_dig->rx_gain_min = DM_DIG_MIN;
- dm_dig->back_val = DM_DIG_BACKOFF_DEFAULT;
- dm_dig->back_range_max = DM_DIG_BACKOFF_MAX;
- dm_dig->back_range_min = DM_DIG_BACKOFF_MIN;
- dm_dig->pre_cck_cca_thres = 0xff;
- dm_dig->cur_cck_cca_thres = 0x83;
- dm_dig->forbidden_igi = DM_DIG_MIN;
- dm_dig->large_fa_hit = 0;
- dm_dig->recover_cnt = 0;
- dm_dig->dig_min_0 = 0x25;
- dm_dig->dig_min_1 = 0x25;
- dm_dig->media_connect_0 = false;
- dm_dig->media_connect_1 = false;
- rtlpriv->dm.dm_initialgain_enable = true;
-}
^ permalink raw reply related
* Re: [PATCH] drivers:net:wireless: Add proper locking for the function, b43_op_beacon_set_tim in main.c
From: Larry Finger @ 2015-01-02 16:40 UTC (permalink / raw)
To: Nicholas Krause, stefano.brivio
Cc: netdev, linux-wireless, b43-dev, kvalo, linux-kernel
In-Reply-To: <1420184041-6788-1-git-send-email-xerofoify@gmail.com>
On 01/02/2015 01:34 AM, Nicholas Krause wrote:
> This adds proper locking for the function, b43_op_beacon_set_tim in main.c by using the mutex lock
> in the structure pointer wl, as embedded into this pointer as a mutex in order to protect against
> multiple access to the pointer wl when updating the templates for this pointer in the function,
> b43_update_templates internally in the function, b43_op_beacon_set_tim.
>
> Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
Although this patch has already been rejected, I want to comment on the subject
you have chosen. As you are submitting it to the maintainer of
drivers/net/wireless/, there is no need to place those entities in the subject.
A better subject would have been "b43: Add proper locking for
b43_op_beacon_set_tim()".
Larry
^ permalink raw reply
* Re: [net-next PATCH 00/17] fib_trie: Reduce time spent in fib_table_lookup by 35 to 75%
From: Alexander Duyck @ 2015-01-02 16:28 UTC (permalink / raw)
To: David Miller; +Cc: alexander.h.duyck, netdev
In-Reply-To: <20150101.210841.1269406605009943743.davem@davemloft.net>
On 01/01/2015 06:08 PM, David Miller wrote:
> From: Alexander Duyck <alexander.duyck@gmail.com>
> Date: Wed, 31 Dec 2014 18:32:52 -0800
>
>> On 12/31/2014 03:46 PM, David Miller wrote:
>>> This knocks about 35 cpu cycles off of a lookup that ends up using the
>>> default route on sparc64. From about ~438 cycles to ~403.
>> Did that 438 value include both fib_table_lookup and check_leaf? Just
>> curious as the overall gain seems smaller than what I have been seeing
>> on the x86 system I was testing with, but then again it could just be a
>> sparc64 thing.
> This is just a default run of my kbench_mod.ko from the net_test_tools
> repo. You can try it as well on x86-86 or similar.
Okay. I was hoping to find some good benchmarks for this work so that
will be useful.
>> I've started work on a second round of patches. With any luck they
>> should be ready by the time the next net-next opens. My hope is to cut
>> the look-up time by another 30 to 50%, though it will take some time as
>> I have to go though and drop the leaf_info structure, and look at
>> splitting the tnode in half to break the key/pos/bits and child pointer
>> dependency chain which will hopefully allow for a significant reduction
>> in memory read stalls.
> I'm very much looking forward to this.
>
>> I am also planning to take a look at addressing the memory waste that
>> occurs on nodes larger than 256 bytes due to the way kmalloc allocates
>> memory as powers of 2. I'm thinking I might try encouraging the growth
>> of smaller nodes, and discouraging anything over 256 by implementing a
>> "truesize" type logic that can be used in the inflate/halve functions so
>> that the memory usage is more accurately reflected.
> Wouldn't this result in a deeper tree? The whole point is to keep the
> tree as shallow as possible to minimize the memory refs on a lookup
> right?
I'm hoping that growing smaller nodes will help offset the fact that we
have to restrict the larger nodes. For backtracing these large nodes
come at a significant price as each bit value beyond what can be fit in
a cache-line means one additional cache line being read when
backtracking. So for example two 3 bit nodes on 64b require 4
cache-lines when backtracking an all 1s value, but one 6 bit node will
require reading 5 cache-lines.
Also I hope to reduce the memory accesses/dependencies to half of what
they currently are so hopefully the two will offset each other in the
case where there were performance gains from having nodes larger than
256B that cannot reach the necessary value to inflate after the change.
If nothing else I figure I can tune the utilization values based on the
truesize so that we get the best memory utilization/performance ratio.
If necessary I might relax the value from the 50% it is now as we pretty
much have to be all full nodes in order to inflate based on the truesize
beyond 256B.
- Alex
^ permalink raw reply
* Re: [PATCH v3 05/20] selftests/ftrace: add install target to enable test install
From: Steven Rostedt @ 2015-01-02 15:45 UTC (permalink / raw)
To: Shuah Khan
Cc: mmarek, gregkh, akpm, mingo, davem, keescook, tranmanphong, mpe,
cov, dh.herrmann, hughd, bobby.prani, serge.hallyn, ebiederm,
tim.bird, josh, koct9i, linux-kbuild, linux-kernel, linux-api,
netdev
In-Reply-To: <e84eeeecde70ecb3ab82c5f825fec359f9e967ff.1419387513.git.shuahkh@osg.samsung.com>
On Wed, 24 Dec 2014 09:27:41 -0700
Shuah Khan <shuahkh@osg.samsung.com> wrote:
> Add a new make target to enable installing test. This target
> installs test in the kselftest install location and add to the
> kselftest script to run the test. Install target can be run
> only from top level kernel source directory.
>
> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
> ---
> tools/testing/selftests/ftrace/Makefile | 11 ++++++++++-
> 1 file changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/ftrace/Makefile b/tools/testing/selftests/ftrace/Makefile
> index 76cc9f1..7c7cf42 100644
> --- a/tools/testing/selftests/ftrace/Makefile
> +++ b/tools/testing/selftests/ftrace/Makefile
> @@ -1,7 +1,16 @@
> +TEST_STR = /bin/sh ./ftracetest || echo ftrace selftests: [FAIL]
Is it ok that this removes the quotes around the echo string? I don't
see anything wrong about it, but I don't know if there's a shell out
there that will fail due to it.
Other than than,
Acked-by: Steven Rostedt <rostedt@goodmis.org>
-- Steve
> +
> all:
>
> +install:
> +ifdef INSTALL_KSFT_PATH
> + install ./ftracetest $(INSTALL_KSFT_PATH)
> + @cp -r test.d $(INSTALL_KSFT_PATH)
> + echo "$(TEST_STR)" >> $(KSELFTEST)
> +endif
> +
> run_tests:
> - @/bin/sh ./ftracetest || echo "ftrace selftests: [FAIL]"
> + @$(TEST_STR)
>
> clean:
> rm -rf logs/*
^ permalink raw reply
* [PATCH net] enic: free all rq buffs when allocation fails
From: Govindarajulu Varadarajan @ 2015-01-02 15:23 UTC (permalink / raw)
To: davem, netdev; +Cc: ssujith, benve, Govindarajulu Varadarajan
When allocation of all RQs fail, we do not free previously allocated buffers,
before returning error. This causes memory leak.
This patch fixes this by calling vnic_rq_clean(), which frees all the rq
buffers.
Signed-off-by: Govindarajulu Varadarajan <_govind@gmx.com>
---
drivers/net/ethernet/cisco/enic/enic_main.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/cisco/enic/enic_main.c b/drivers/net/ethernet/cisco/enic/enic_main.c
index 705f334..b29e027 100644
--- a/drivers/net/ethernet/cisco/enic/enic_main.c
+++ b/drivers/net/ethernet/cisco/enic/enic_main.c
@@ -1616,7 +1616,7 @@ static int enic_open(struct net_device *netdev)
if (vnic_rq_desc_used(&enic->rq[i]) == 0) {
netdev_err(netdev, "Unable to alloc receive buffers\n");
err = -ENOMEM;
- goto err_out_notify_unset;
+ goto err_out_free_rq;
}
}
@@ -1649,7 +1649,9 @@ static int enic_open(struct net_device *netdev)
return 0;
-err_out_notify_unset:
+err_out_free_rq:
+ for (i = 0; i < enic->rq_count; i++)
+ vnic_rq_clean(&enic->rq[i], enic_free_rq_buf);
enic_dev_notify_unset(enic);
err_out_free_intr:
enic_free_intr(enic);
--
2.2.1
^ permalink raw reply related
* [PATCH] qmi_wwan: Set random MAC on devices with buggy fw
From: Kristian Evensen @ 2015-01-02 15:21 UTC (permalink / raw)
To: netdev, linux-usb, bjorn; +Cc: Kristian Evensen
From: Kristian Evensen <kristian.evensen@gmail.com>
Some buggy firmwares export an incorrect MAC address (00:a0:c6:00:00:00). This
makes for example checking devices for random MAC addresses tricky, and you
might end up with multiple network interfaces with the same address.
This patch tries to fix, or at least improve, the situation by setting the MAC
address of devices with this firmware bug to a random address. I tested the
patch with two devices that has this firmware bug (Huawei E398 and E392), and
network traffic worked fine after changing the address.
Signed-off-by: Kristian Evensen <kristian.evensen@gmail.com>
---
drivers/net/usb/qmi_wwan.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c
index db21af8..30a716f 100644
--- a/drivers/net/usb/qmi_wwan.c
+++ b/drivers/net/usb/qmi_wwan.c
@@ -56,6 +56,8 @@ struct qmi_wwan_state {
/* default ethernet address used by the modem */
static const u8 default_modem_addr[ETH_ALEN] = {0x02, 0x50, 0xf3};
+static const u8 buggy_fw_addr[ETH_ALEN] = {0x00, 0xa0, 0xc6, 0x00, 0x00, 0x00};
+
/* Make up an ethernet header if the packet doesn't have one.
*
* A firmware bug common among several devices cause them to send raw
@@ -332,10 +334,12 @@ next_desc:
usb_driver_release_interface(driver, info->data);
}
- /* Never use the same address on both ends of the link, even
- * if the buggy firmware told us to.
+ /* Never use the same address on both ends of the link, even if the
+ * buggy firmware told us to. Or, if device is assigned the well-known
+ * buggy firmware MAC address, replace it with a random address,
*/
- if (ether_addr_equal(dev->net->dev_addr, default_modem_addr))
+ if (ether_addr_equal(dev->net->dev_addr, default_modem_addr) ||
+ ether_addr_equal(dev->net->dev_addr, buggy_fw_addr))
eth_hw_addr_random(dev->net);
/* make MAC addr easily distinguishable from an IP header */
--
1.9.1
^ permalink raw reply related
* Re: [PATCH] drivers:isdn: Remove uneeded fix me comment in capi.c for the function,decode_ie
From: Tilman Schmidt @ 2015-01-02 15:21 UTC (permalink / raw)
To: nick; +Cc: hjlipp, isdn, gigaset307x-common, netdev, linux-kernel
In-Reply-To: <54A5FAF9.1090907@gmail.com>
Am 02.01.2015 um 02:57 schrieb nick:
> In that case has anyone tested this on actual hardware supported to see if
> removing these two lines breaks anything. If not I feel it's best to just
> leave the comment for now.
I haven't tested it. The comment was intended as a reminder to myself to
do so eventually but obviously didn't succeed. :-)
So let's leave it for now.
Thanks,
Tilman
--
Tilman Schmidt E-Mail: tilman@imap.cc
Bonn, Germany
Diese Nachricht besteht zu 100% aus wiederverwerteten Bits.
Ungeöffnet mindestens haltbar bis: (siehe Rückseite)
^ permalink raw reply
* Re: How to fix CHECK warning: testing a 'safe expression'
From: Murali Karicheri @ 2015-01-02 14:51 UTC (permalink / raw)
To: netdev, josh, linux-kernel@vger.kernel.org
In-Reply-To: <54907884.2040502@ti.com>
+ Josh
On 12/16/2014 01:23 PM, Murali Karicheri wrote:
> netdev maintainers,
>
> I got a comment to address CHECK warning and wondering how to address
> 'warning: testing a 'safe expression' which appears when using
> IS_ERR_OR_NULL(foo)
>
> where foo is defined as
>
> struct foo_type *foo;
>
> The foo get assigned only NULL or ERR_PTR(error code). So I believe the
> usage is correct. But then how do I make the CHECK happy of its usage?
>
> I have tried doing a grep on the current usage of IS_ERR_OR_NULL() and
> found 276 of them causes this warning in the v3.18 version of the kernel
> that I am using
>
> $ grep -r "warning: testing a 'safe expression" * | wc -l
> 276
>
> 1) Can someone explain what this warning means?
>
> 2) Is it acceptable to post patches to netdev list with this warning?
>
> 3) if not, how this is expected to be fixed? Any example usage to fix
> this warning will be helpful.
>
> Thanks in advance for
--
Murali Karicheri
Linux Kernel, Texas Instruments
^ permalink raw reply
* Re: [PATCH] TCP: Add support for TCP Stealth
From: Christian Grothoff @ 2015-01-02 14:06 UTC (permalink / raw)
To: Daniel Borkmann; +Cc: Julian Kirsch, netdev, Jacob Appelbaum, Pavel Emelyanov
In-Reply-To: <54A69430.2060800@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 3534 bytes --]
On 01/02/2015 01:50 PM, Daniel Borkmann wrote:
> On 01/01/2015 04:32 PM, Christian Grothoff wrote:
> ...
>> That approach is highly vulnerable to timing attacks, and doesn't answer
>> how TCP clients without special capabilities could set the ISN correctly
>> either. Playing with raw sockets is the kind of geeky hack that is
>
> Right, for client/server side you'd need to have the capabilities and
> then drop them later, which would make that approach less convenient
> for user space applications (despite not having to have a port knocking
> uapi in the TCP core itself). For the server, you might get away with a
> central daemon spawning sockets via IPC, but for the unprivileged
> client to e.g., let it set it's own ISN via setsockopt(2) would be a
> bad idea.
>
>> unlikely to give us the combination of usability and security required
>> to significantly reduce the ongoing large-scale compromise of network
>> equipment by spy agencies.
>
> Out of curiosity, when you say you want to significantly reduce the
> large-scale compromise of services by hiding ports, how do you solve
> i) the pre-shared key distribution issue you need for your approach
> (are you mostly targeting administrators for accessing their companies
> router/firewall management interfaces?),
Our assumption is that this solution will work if SSH access to the
system is limited to a small set of users that can easily agree on an
additional passphrase. We do not claim to solve the key distribution
issue in general (the GNU Name System can solve it for some application
scenarios, but that's out of scope for Knock). Like most security
solutions, this works for some scenarios, but not all.
> and ii) the broad adoption of
> this setsockopt(2) in applications? I think for ii) it would be great
> not having to change and recompile every possible client _and_ server
> application if they don't have the change upstreamed in their project.
Correct, for that we have libknockify, a library you can LD_PRELOAD,
setting the passphrase via an environment variable. Now, this doesn't
work for applications that don't permit LD_PRELOAD (like openssh) or use
some TCP sockets where TCP Stealth should be active, and others where it
should not be. But for tools like 'netcat', 'telnet', 'wget' and many
other small tools, libknockify will work.
> It feels like a property that goes beyond the scope of a specific,
> individual application, put differently, what about an additional
> central configuration interface?
With our patch for systemd support, we kind of have a 'central'
configuration interface for "next-generation" servers that support
systemd-style listening. For clients, using libknockify works usually
pretty well as clients usually don't have many different types of TCP
sockets open.
> Other than that, is there a plan for
> key rotations in other words, to have a grace period for a key
> transition as peers might not have synced clocks?
I have no such plans, as it would complicate the system quite a bit and
thus also reduces usability. It would way complicate the key
distribution issue you mentioned, and also the libknockify-style
integration where currently the PSK can simply be passed via an
environment variable would also have to be done differently (i.e.
contacting some kind of PSK-oracle service via IPC). The result would be
a huge increase in complexity for IMO a rather small gain in security
for possibly only a small set of users.
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply
* wireless-drivers-next 2015-01-02
From: Kalle Valo @ 2015-01-02 13:59 UTC (permalink / raw)
To: David Miller; +Cc: linux-wireless, netdev
Hi Dave,
here's the first pull request for net-next. This time a slow start with
just few patches so it's easier to iron out any issues. I have a lot
more pending in patchwork and will send them later.
Please let me know if there are any issues.
Kalle
The following changes since commit b8fb4e0648a2ab3734140342002f68fb0c7d1602:
net: Reset secmark when scrubbing packet (2014-12-24 00:21:43 -0500)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git tags/wireless-drivers-next-for-davem-2015-01-02
for you to fetch changes up to 354f473ee2c5d01c1cf90f747f95218ee3e73e95:
ath9k: fix typo (2014-12-24 19:14:44 +0200)
----------------------------------------------------------------
Changes:
* ath9k: enable Transmit Power Control (TPC) for ar9003 chips
* rtlwifi: cleanup and updates from the vendor driver
* rsi: fix memory leak related to firmware image
* ath: parameter fix for FCC DFS pattern
----------------------------------------------------------------
Alexey Khoroshilov (1):
rsi: fix memory leak in rsi_load_ta_instructions()
Larry Finger (15):
rtlwifi: rtl8821ae: Fix typos in power-sequence macro
rtlwifi: rtl8192ce: Add code to set the keep-alive operation
rtlwifi: rtl8192ce: Update setting of the media status
rtlwifi: rtl8192ce: Update rate setting routines
rtlwifi: rtl8192ce: Improve RF sleep routine
rtlwifi: Remove extraneous argument for rate mapping
rtlwifi: rtl8723be: Switch to use common rate-mapping routine
rtlwifi: rtl8188ee: Switch to use common rate-mapping routine
rtlwifi: rtl8723ae: Modify driver to use rate-mapping routine in core
rtlwifi: rtl8192ee: Convert driver to use common rate-mapping code
rtlwifi: Convert all drivers to use a common set of rate descriptors
rtlwifi: rtl8821ae: Add VHT rate descriptors
rtlwifi: rtl8192cu: Rework calls to rate-control routine
rtlwifi: rtl8192de: Rework calls to rate-control routine
rtlwifi: rtl8821ae: Switch to use common rate control routine
Lorenzo Bianconi (3):
ath9k: enable TPC by default
ath9k: add debugfs support for hw TPC
ath9k: fix typo
Peter Oh (1):
ath: fix incorrect PPB on FCC radar type 5
Rickard Strandqvist (3):
rtlwifi: rtl8192de: fw.c: Remove unused function
rtlwifi: rtl8192ee: trx.c: Remove unused function
rtlwifi: rtl8723be: phy.c: Remove unused function
Troy Tan (1):
rtlwifi: rtl8821ae: Simplify loading of WOWLAN firmware
drivers/net/wireless/ath/ath9k/debug.c | 71 +++++++
drivers/net/wireless/ath/ath9k/hw.c | 3 +
drivers/net/wireless/ath/ath9k/xmit.c | 2 +-
drivers/net/wireless/ath/dfs_pattern_detector.c | 2 +-
drivers/net/wireless/rsi/rsi_91x_sdio_ops.c | 4 +-
drivers/net/wireless/rtlwifi/base.c | 156 ++++++++++----
drivers/net/wireless/rtlwifi/base.h | 4 +-
drivers/net/wireless/rtlwifi/core.c | 24 ++-
drivers/net/wireless/rtlwifi/core.h | 1 +
drivers/net/wireless/rtlwifi/rtl8188ee/trx.c | 162 +-------------
drivers/net/wireless/rtlwifi/rtl8192c/fw_common.h | 1 +
drivers/net/wireless/rtlwifi/rtl8192ce/hw.c | 165 +++++++--------
drivers/net/wireless/rtlwifi/rtl8192ce/phy.c | 5 +-
drivers/net/wireless/rtlwifi/rtl8192ce/sw.c | 30 +--
drivers/net/wireless/rtlwifi/rtl8192ce/trx.c | 13 +-
drivers/net/wireless/rtlwifi/rtl8192cu/mac.c | 4 +-
drivers/net/wireless/rtlwifi/rtl8192cu/sw.c | 28 +--
drivers/net/wireless/rtlwifi/rtl8192cu/trx.c | 20 +-
drivers/net/wireless/rtlwifi/rtl8192de/fw.c | 17 --
drivers/net/wireless/rtlwifi/rtl8192de/fw.h | 1 -
drivers/net/wireless/rtlwifi/rtl8192de/sw.c | 30 +--
drivers/net/wireless/rtlwifi/rtl8192de/trx.c | 27 ++-
drivers/net/wireless/rtlwifi/rtl8192ee/trx.c | 196 +----------------
drivers/net/wireless/rtlwifi/rtl8192ee/trx.h | 9 +-
drivers/net/wireless/rtlwifi/rtl8192se/def.h | 8 +-
drivers/net/wireless/rtlwifi/rtl8192se/sw.c | 30 +--
drivers/net/wireless/rtlwifi/rtl8192se/trx.c | 23 +-
drivers/net/wireless/rtlwifi/rtl8723ae/trx.c | 162 +-------------
drivers/net/wireless/rtlwifi/rtl8723be/phy.c | 25 ---
drivers/net/wireless/rtlwifi/rtl8723be/phy.h | 2 -
drivers/net/wireless/rtlwifi/rtl8723be/trx.c | 162 +-------------
drivers/net/wireless/rtlwifi/rtl8821ae/def.h | 54 -----
drivers/net/wireless/rtlwifi/rtl8821ae/pwrseq.h | 4 +-
drivers/net/wireless/rtlwifi/rtl8821ae/sw.c | 74 +++----
drivers/net/wireless/rtlwifi/rtl8821ae/trx.c | 232 +--------------------
drivers/net/wireless/rtlwifi/wifi.h | 96 +++++----
36 files changed, 510 insertions(+), 1337 deletions(-)
--
Kalle Valo
^ permalink raw reply
* Re: [PATCH] TCP: Add support for TCP Stealth
From: Daniel Borkmann @ 2015-01-02 12:50 UTC (permalink / raw)
To: Christian Grothoff
Cc: Julian Kirsch, netdev, Jacob Appelbaum, Pavel Emelyanov
In-Reply-To: <54A56880.6040802@grothoff.org>
On 01/01/2015 04:32 PM, Christian Grothoff wrote:
...
> That approach is highly vulnerable to timing attacks, and doesn't answer
> how TCP clients without special capabilities could set the ISN correctly
> either. Playing with raw sockets is the kind of geeky hack that is
Right, for client/server side you'd need to have the capabilities and
then drop them later, which would make that approach less convenient
for user space applications (despite not having to have a port knocking
uapi in the TCP core itself). For the server, you might get away with a
central daemon spawning sockets via IPC, but for the unprivileged
client to e.g., let it set it's own ISN via setsockopt(2) would be a
bad idea.
> unlikely to give us the combination of usability and security required
> to significantly reduce the ongoing large-scale compromise of network
> equipment by spy agencies.
Out of curiosity, when you say you want to significantly reduce the
large-scale compromise of services by hiding ports, how do you solve
i) the pre-shared key distribution issue you need for your approach
(are you mostly targeting administrators for accessing their companies
router/firewall management interfaces?), and ii) the broad adoption of
this setsockopt(2) in applications? I think for ii) it would be great
not having to change and recompile every possible client _and_ server
application if they don't have the change upstreamed in their project.
It feels like a property that goes beyond the scope of a specific,
individual application, put differently, what about an additional
central configuration interface? Other than that, is there a plan for
key rotations in other words, to have a grace period for a key
transition as peers might not have synced clocks?
^ permalink raw reply
* Re: [PATCH] net: wireless: b43legacy: radio.c: Remove unused function
From: Sedat Dilek @ 2015-01-02 12:14 UTC (permalink / raw)
To: Rafał Miłecki
Cc: Rickard Strandqvist, Larry Finger, Stefano Brivio,
Network Development, linux-wireless@vger.kernel.org,
Linux Kernel Mailing List, b43-dev
In-Reply-To: <CACna6rxbGRdw7XSYvHAJGxJvMVwjVbAL4ynBM3m9rNggh7gCVQ@mail.gmail.com>
On Fri, Jan 2, 2015 at 1:06 PM, Rafał Miłecki <zajec5@gmail.com> wrote:
> On 2 January 2015 at 13:05, Rafał Miłecki <zajec5@gmail.com> wrote:
>> On 1 January 2015 at 16:46, Rickard Strandqvist
>> <rickard_strandqvist@spectrumdigital.se> wrote:
>>> Remove the function b43legacy_radio_set_tx_iq() that is not used anywhere.
>>>
>>> This was partially found by using a static code analysis program called cppcheck.
>>
>> It seems to be for A-PHY based hardware (with 0x2060 radio id) which
>> is not handled by b43legacy. Should be safe to drop this code (we
>> won't likely need it).
>>
>> Ack
>
> For future, we prefix patches with just a driver name. So this could
> be simply called
> b43legacy: radio.c: Remove unused function
>
Alternatively...
"b43legacy: Remove unused function in radio.c"
BTW, as Arnd Bergmann pointed out [1] how did you test with cppcheck
to get such stuff?
- Sedat -
[1] https://lkml.org/lkml/2015/1/2/51
^ permalink raw reply
* Re: [PATCH] net: wireless: b43legacy: radio.c: Remove unused function
From: Rafał Miłecki @ 2015-01-02 12:06 UTC (permalink / raw)
To: Rickard Strandqvist
Cc: Larry Finger, Stefano Brivio, Network Development,
linux-wireless@vger.kernel.org, Linux Kernel Mailing List,
b43-dev
In-Reply-To: <CACna6rznUcqGTK0t1k=kjn0NVLycq865780ozyB+VYu78d_BSg@mail.gmail.com>
On 2 January 2015 at 13:05, Rafał Miłecki <zajec5@gmail.com> wrote:
> On 1 January 2015 at 16:46, Rickard Strandqvist
> <rickard_strandqvist@spectrumdigital.se> wrote:
>> Remove the function b43legacy_radio_set_tx_iq() that is not used anywhere.
>>
>> This was partially found by using a static code analysis program called cppcheck.
>
> It seems to be for A-PHY based hardware (with 0x2060 radio id) which
> is not handled by b43legacy. Should be safe to drop this code (we
> won't likely need it).
>
> Ack
For future, we prefix patches with just a driver name. So this could
be simply called
b43legacy: radio.c: Remove unused function
--
Rafał
^ permalink raw reply
* Re: [PATCH] net: wireless: b43legacy: radio.c: Remove unused function
From: Rafał Miłecki @ 2015-01-02 12:05 UTC (permalink / raw)
To: Rickard Strandqvist
Cc: Larry Finger, Stefano Brivio, Network Development,
linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Linux Kernel Mailing List, b43-dev
In-Reply-To: <1420127170-28421-1-git-send-email-rickard_strandqvist-IW2WV5XWFqGZkjO+N0TKoMugMpMbD5Xr@public.gmane.org>
On 1 January 2015 at 16:46, Rickard Strandqvist
<rickard_strandqvist-IW2WV5XWFqGZkjO+N0TKoMugMpMbD5Xr@public.gmane.org> wrote:
> Remove the function b43legacy_radio_set_tx_iq() that is not used anywhere.
>
> This was partially found by using a static code analysis program called cppcheck.
It seems to be for A-PHY based hardware (with 0x2060 radio id) which
is not handled by b43legacy. Should be safe to drop this code (we
won't likely need it).
Ack
--
Rafał
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH] drivers:net:wireless: Add proper locking for the function, b43_op_beacon_set_tim in main.c
From: Michael Büsch @ 2015-01-02 11:42 UTC (permalink / raw)
To: Rafał Miłecki
Cc: Nicholas Krause, Stefano Brivio, Network Development,
linux-wireless@vger.kernel.org, Linux Kernel Mailing List,
b43-dev, Kalle Valo
In-Reply-To: <CACna6rxP5dB7ng5pf1jeJL7TTOq4xPC9B=wmrX+yeYK-hfF5uw@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1703 bytes --]
On Fri, 2 Jan 2015 12:19:12 +0100
Rafał Miłecki <zajec5@gmail.com> wrote:
> On 2 January 2015 at 10:27, Michael Büsch <m@bues.ch> wrote:
> > On Fri, 2 Jan 2015 02:34:01 -0500
> > Nicholas Krause <xerofoify@gmail.com> wrote:
> >
> >> This adds proper locking for the function, b43_op_beacon_set_tim in main.c by using the mutex lock
> >> in the structure pointer wl, as embedded into this pointer as a mutex in order to protect against
> >> multiple access to the pointer wl when updating the templates for this pointer in the function,
> >> b43_update_templates internally in the function, b43_op_beacon_set_tim.
> >>
> >> Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
> >> ---
> >> drivers/net/wireless/b43/main.c | 3 ++-
> >> 1 file changed, 2 insertions(+), 1 deletion(-)
> >>
> >> diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
> >> index 47731cb..d568fc8 100644
> >> --- a/drivers/net/wireless/b43/main.c
> >> +++ b/drivers/net/wireless/b43/main.c
> >> @@ -5094,8 +5094,9 @@ static int b43_op_beacon_set_tim(struct ieee80211_hw *hw,
> >> {
> >> struct b43_wl *wl = hw_to_b43_wl(hw);
> >>
> >> - /* FIXME: add locking */
> >> + mutex_lock(&wl->mutex);
> >> b43_update_templates(wl);
> >> + mutex_unlock(&wl->mutex);
> >>
> >> return 0;
> >> }
> >
> > Thanks for the patch.
> >
> > However, this does not work. We are in atomic context here.
> > Please see the b43-dev mailing list archives for a recent thread about that.
>
> Michael: guess who it was who sent the patch doing the same back in November.
>
> Yes, the same troll.
D'oh.
Thanks for the notice.
--
Michael
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply
* RE: [PATCH net-next 1/3] net: add IPv4 routing FIB support for swdev
From: Arad, Ronen @ 2015-01-02 11:39 UTC (permalink / raw)
To: Scott Feldman, roopa, Netdev
Cc: Jirí Pírko, john fastabend, Thomas Graf,
Jamal Hadi Salim, Andy Gospodarek
In-Reply-To: <CAE4R7bBJa8LiDHw8PhL6ARfK5nOfUXg36tfnggwWs=tynBw6Jw@mail.gmail.com>
>-----Original Message-----
>From: netdev-owner@vger.kernel.org [mailto:netdev-owner@vger.kernel.org] On
>Behalf Of Scott Feldman
>Sent: Friday, January 02, 2015 10:01 AM
>To: roopa
>Cc: Netdev; Jiří Pírko; john fastabend; Thomas Graf; Jamal Hadi Salim; Andy
>Gospodarek
>Subject: Re: [PATCH net-next 1/3] net: add IPv4 routing FIB support for swdev
>
>On Thu, Jan 1, 2015 at 9:49 PM, roopa <roopa@cumulusnetworks.com> wrote:
>> On 1/1/15, 7:29 PM, sfeldma@gmail.com wrote:
>>>
>>> From: Scott Feldman <sfeldma@gmail.com>
>>>
>>> To offload IPv4 L3 routing functions to swdev device, the swdev device
>>> driver
>>> implements two new ndo ops (ndo_switch_fib_ipv4_add/del). The ops are
>>> called
>>> by the core IPv4 FIB code when installing/removing FIB entries to/from the
>>> kernel FIB. On install, the driver should return 0 if FIB entry (route)
>>> can be
>>> installed to device for offloading, -EOPNOTSUPP if route cannot be
>>> installed
>>> due to device limitations, and other negative error code on failure to
>>> install
>>> route to device. On failure error code, the route is not installed to
>>> device,
>>> and not installed in kernel FIB, and the return code is propagated back to
>>> the
>>> user-space caller (via netlink). An -EOPNOTSUPP error code is skipped for
>>> the
>>> device but installed in the kernel FIB.
>>>
>>> The FIB entry (route) nexthop list is used to find the swdev device port
>>> to
>>> anchor the ndo op call. The route's fib_dev (the first nexthop's dev) is
>>> used
>>> find the swdev port by recursively traversing the fib_dev's lower_dev list
>>> until a swdev port is found. The ndo op is called on this swdev port.
>>
>>
>> scott, I posted a similar api for bridge attribute sets. But, nobody
>> supported it.
>> http://marc.info/?l=linux-netdev&m=141820234410602&w=2
>>
>> If this is acceptable, I will be resubmitting my api as well.
>>
>
>This may get shot down as well, who knows?
>
>For routes, the nexthop dev may be a bridge or a bond for an IP on the
>router, so we have no choice but to walk down from the bridge or the
>bond to find a swport dev to call the ndo op to install the route.
>
Another case is when VLAN-aware bridge with VLAN filtering is used. In that
case IP interfaces are VLAN interfaces created on top of the bridge.
>For bridge settings, I remember someone raised the issue that settings
>should be propagated down the dev hierarchy, with parent calling
>child's op and so on. I'll go back and look at your post.
>
This was my comment. I'm not sure it was correct. My concern was the VLAN
interface on top of a VLAN-aware bridge use-case. I now believe that such
interfaces are upper devices of the bridge (not master). Therefore, it seems
that traversal starting at a VLAN interface on top of a bridge will follow a
path: VLAN interface => bridge => [team/bond] => switchdev port.
One complication here is that the VLAN context is important. A "naked" nexthop
shall only be resolved within the VLAN associated with the VLAN interface. When
ARP resolution is performed by Linux stack, it goes via the VLAN interface
which imposes a tag on the packet before handing it to the bridge. The VLAN-
aware bridge floods such packet only to member ports of the VLAN. This behavior
of the software bridge has to be preserved with offloaded L3 forwarding and
offloaded L2 switching.
>>
>>
>>>
>>> Since the FIB entry is "naked" when push from the kernel, the
>>> driver/device
>>> is responsible for resolving the route's nexthops to neighbor MAC
>>> addresses.
>>> This can be done by the driver by monitoring NETEVENT_NEIGH_UPDATE
>>> netevent notifier to watch for ARP activity. Once a nexthop is resolved
>>> to
>>> neighbor MAC address, it can be installed to the device and the device
>>> will
>>> do the L3 routing offload in HW, for that nexthop.
>>>
>>> Signed-off-by: Scott Feldman <sfeldma@gmail.com>
>>> Signed-off-by: Jiri Pirko <jiri@resnulli.us>
>>> ---
>>> include/linux/netdevice.h | 22 +++++++++++
>>> include/net/switchdev.h | 18 +++++++++
>>> net/ipv4/fib_trie.c | 17 ++++++++-
>>> net/switchdev/switchdev.c | 89
>>> +++++++++++++++++++++++++++++++++++++++++++++
>>> 4 files changed, 145 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
>>> index 679e6e9..b66d22b 100644
>>> --- a/include/linux/netdevice.h
>>> +++ b/include/linux/netdevice.h
>>> @@ -767,6 +767,8 @@ struct netdev_phys_item_id {
>>> typedef u16 (*select_queue_fallback_t)(struct net_device *dev,
>>> struct sk_buff *skb);
>>> +struct fib_info;
>>> +
>>> /*
>>> * This structure defines the management hooks for network devices.
>>> * The following hooks can be defined; unless noted otherwise, they are
>>> @@ -1030,6 +1032,14 @@ typedef u16 (*select_queue_fallback_t)(struct
>>> net_device *dev,
>>> * int (*ndo_switch_port_stp_update)(struct net_device *dev, u8 state);
>>> * Called to notify switch device port of bridge port STP
>>> * state change.
>>> + * int (*ndo_sw_parent_fib_ipv4_add)(struct net_device *dev, __be32 dst,
>>> + * int dst_len, struct fib_info *fi,
>>> + * u8 tos, u8 type, u32 tb_id);
>>> + * Called to add IPv4 route to switch device.
>>> + * int (*ndo_sw_parent_fib_ipv4_del)(struct net_device *dev, __be32 dst,
>>> + * int dst_len, struct fib_info *fi,
>>> + * u8 tos, u8 type, u32 tb_id);
>>> + * Called to delete IPv4 route from switch device.
>>> */
>>> struct net_device_ops {
>>> int (*ndo_init)(struct net_device *dev);
>>> @@ -1189,6 +1199,18 @@ struct net_device_ops {
>>> struct
>>> netdev_phys_item_id *psid);
>>> int (*ndo_switch_port_stp_update)(struct
>>> net_device *dev,
>>> u8 state);
>>> + int (*ndo_switch_fib_ipv4_add)(struct
>>> net_device *dev,
>>> + __be32 dst,
>>> + int dst_len,
>>> + struct fib_info
>>> *fi,
>>> + u8 tos, u8
>>> type,
>>> + u32 tb_id);
>>> + int (*ndo_switch_fib_ipv4_del)(struct
>>> net_device *dev,
>>> + __be32 dst,
>>> + int dst_len,
>>> + struct fib_info
>>> *fi,
>>> + u8 tos, u8
>>> type,
>>> + u32 tb_id);
>>> #endif
>>> };
>>> diff --git a/include/net/switchdev.h b/include/net/switchdev.h
>>> index 8a6d164..caebc2a 100644
>>> --- a/include/net/switchdev.h
>>> +++ b/include/net/switchdev.h
>>> @@ -17,6 +17,10 @@
>>> int netdev_switch_parent_id_get(struct net_device *dev,
>>> struct netdev_phys_item_id *psid);
>>> int netdev_switch_port_stp_update(struct net_device *dev, u8 state);
>>> +int netdev_switch_fib_ipv4_add(u32 dst, int dst_len, struct fib_info *fi,
>>> + u8 tos, u8 type, u32 tb_id);
>>> +int netdev_switch_fib_ipv4_del(u32 dst, int dst_len, struct fib_info *fi,
>>> + u8 tos, u8 type, u32 tb_id);
>>> #else
>>> @@ -32,6 +36,20 @@ static inline int
>>> netdev_switch_port_stp_update(struct net_device *dev,
>>> return -EOPNOTSUPP;
>>> }
>>> +static inline int netdev_switch_fib_ipv4_add(u32 dst, int dst_len,
>>> + struct fib_info *fi,
>>> + u8 tos, u8 type, u32 tb_id)
>>> +{
>>> + return -EOPNOTSUPP;
>>> +}
>>> +
>>> +static inline int netdev_switch_fib_ipv4_del(u32 dst, int dst_len,
>>> + struct fib_info *fi,
>>> + u8 tos, u8 type, u32 tb_id)
>>> +{
>>> + return -EOPNOTSUPP;
>>> +}
>>> +
>>> #endif
>>> #endif /* _LINUX_SWITCHDEV_H_ */
>>> diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c
>>> index 281e5e0..ea2dc17 100644
>>> --- a/net/ipv4/fib_trie.c
>>> +++ b/net/ipv4/fib_trie.c
>>> @@ -79,6 +79,7 @@
>>> #include <net/tcp.h>
>>> #include <net/sock.h>
>>> #include <net/ip_fib.h>
>>> +#include <net/switchdev.h>
>>> #include "fib_lookup.h"
>>> #define MAX_STAT_DEPTH 32
>>> @@ -1201,6 +1202,8 @@ int fib_table_insert(struct fib_table *tb, struct
>>> fib_config *cfg)
>>> fib_release_info(fi_drop);
>>> if (state & FA_S_ACCESSED)
>>> rt_cache_flush(cfg->fc_nlinfo.nl_net);
>>> + netdev_switch_fib_ipv4_add(key, plen, fi,
>>> fa->fa_tos,
>>> + cfg->fc_type,
>>> tb->tb_id);
>>> rtmsg_fib(RTM_NEWROUTE, htonl(key), new_fa, plen,
>>> tb->tb_id, &cfg->fc_nlinfo,
>>> NLM_F_REPLACE);
>>> @@ -1229,6 +1232,13 @@ int fib_table_insert(struct fib_table *tb, struct
>>> fib_config *cfg)
>>> new_fa->fa_tos = tos;
>>> new_fa->fa_type = cfg->fc_type;
>>> new_fa->fa_state = 0;
>>> +
>>> + /* (Optionally) offload fib info to switch hardware. */
>>> + err = netdev_switch_fib_ipv4_add(key, plen, fi, tos,
>>> + cfg->fc_type, tb->tb_id);
>>> + if (err && err != -EOPNOTSUPP)
>>> + goto out_free_new_fa;
>>> +
>>> /*
>>> * Insert new entry to the list.
>>> */
>>> @@ -1237,7 +1247,7 @@ int fib_table_insert(struct fib_table *tb, struct
>>> fib_config *cfg)
>>> fa_head = fib_insert_node(t, key, plen);
>>> if (unlikely(!fa_head)) {
>>> err = -ENOMEM;
>>> - goto out_free_new_fa;
>>> + goto out_sw_fib_del;
>>> }
>>> }
>>> @@ -1253,6 +1263,8 @@ int fib_table_insert(struct fib_table *tb, struct
>>> fib_config *cfg)
>>> succeeded:
>>> return 0;
>>> +out_sw_fib_del:
>>> + netdev_switch_fib_ipv4_del(key, plen, fi, tos, cfg->fc_type,
>>> tb->tb_id);
>>> out_free_new_fa:
>>> kmem_cache_free(fn_alias_kmem, new_fa);
>>> out:
>>> @@ -1529,6 +1541,9 @@ int fib_table_delete(struct fib_table *tb, struct
>>> fib_config *cfg)
>>> rtmsg_fib(RTM_DELROUTE, htonl(key), fa, plen, tb->tb_id,
>>> &cfg->fc_nlinfo, 0);
>>> + netdev_switch_fib_ipv4_del(key, plen, fa->fa_info, tos,
>>> + cfg->fc_type, tb->tb_id);
>>> +
>>> list_del_rcu(&fa->fa_list);
>>> if (!plen)
>>> diff --git a/net/switchdev/switchdev.c b/net/switchdev/switchdev.c
>>> index d162b21..211a8a0 100644
>>> --- a/net/switchdev/switchdev.c
>>> +++ b/net/switchdev/switchdev.c
>>> @@ -12,6 +12,7 @@
>>> #include <linux/types.h>
>>> #include <linux/init.h>
>>> #include <linux/netdevice.h>
>>> +#include <net/ip_fib.h>
>>> #include <net/switchdev.h>
>>> /**
>>> @@ -50,3 +51,91 @@ int netdev_switch_port_stp_update(struct net_device
>>> *dev, u8 state)
>>> return ops->ndo_switch_port_stp_update(dev, state);
>>> }
>>> EXPORT_SYMBOL(netdev_switch_port_stp_update);
>>> +
>>> +static struct net_device *netdev_switch_get_by_fib_dev(struct net_device
>>> *dev)
>>> +{
>>> + const struct net_device_ops *ops = dev->netdev_ops;
>>> + struct net_device *lower_dev;
>>> + struct net_device *port_dev;
>>> + struct list_head *iter;
>>> +
>>> + /* Recusively search from fib_dev down until we find
>>> + * a sw port dev. (A sw port dev supports
>>> + * ndo_switch_parent_id_get).
>>> + */
>>> +
>>> + if (ops->ndo_switch_parent_id_get)
>>> + return dev;
>>> +
>>> + netdev_for_each_lower_dev(dev, lower_dev, iter) {
>>> + port_dev = netdev_switch_get_by_fib_dev(lower_dev);
>>> + if (port_dev)
>>> + return port_dev;
>>> + }
>>> +
>>> + return NULL;
>>> +}
>>> +
>>> +/**
>>> + * netdev_switch_fib_ipv4_add - Add IPv4 route entry to switch
>>> + *
>>> + * @dst: route's IPv4 destination address
>>> + * @dst_len: destination address length (prefix length)
>>> + * @fi: route FIB info structure
>>> + * @tos: route TOS
>>> + * @type: route type
>>> + * @tb_id: route table ID
>>> + *
>>> + * Add IPv4 route entry to switch device.
>>> + */
>>> +int netdev_switch_fib_ipv4_add(u32 dst, int dst_len, struct fib_info *fi,
>>> + u8 tos, u8 type, u32 tb_id)
>>> +{
>>> + struct net_device *dev;
>>> + const struct net_device_ops *ops;
>>> + int err = -EOPNOTSUPP;
>>> +
>>> + dev = netdev_switch_get_by_fib_dev(fi->fib_dev);
>>> + if (!dev)
>>> + return -EOPNOTSUPP;
>>> + ops = dev->netdev_ops;
>>> +
>>> + if (ops->ndo_switch_fib_ipv4_add)
>>> + err = ops->ndo_switch_fib_ipv4_add(dev, htonl(dst),
>>> dst_len,
>>> + fi, tos, type, tb_id);
>>> +
>>> + return err;
>>> +}
>>> +EXPORT_SYMBOL(netdev_switch_fib_ipv4_add);
>>> +
>>> +/**
>>> + * netdev_switch_fib_ipv4_del - Delete IPv4 route entry from switch
>>> + *
>>> + * @dst: route's IPv4 destination address
>>> + * @dst_len: destination address length (prefix length)
>>> + * @fi: route FIB info structure
>>> + * @tos: route TOS
>>> + * @type: route type
>>> + * @tb_id: route table ID
>>> + *
>>> + * Delete IPv4 route entry from switch device.
>>> + */
>>> +int netdev_switch_fib_ipv4_del(u32 dst, int dst_len, struct fib_info *fi,
>>> + u8 tos, u8 type, u32 tb_id)
>>> +{
>>> + struct net_device *dev;
>>> + const struct net_device_ops *ops;
>>> + int err = -EOPNOTSUPP;
>>> +
>>> + dev = netdev_switch_get_by_fib_dev(fi->fib_dev);
>>> + if (!dev)
>>> + return -EOPNOTSUPP;
>>> + ops = dev->netdev_ops;
>>> +
>>> + if (ops->ndo_switch_fib_ipv4_del)
>>> + err = ops->ndo_switch_fib_ipv4_del(dev, htonl(dst),
>>> dst_len,
>>> + fi, tos, type, tb_id);
>>> +
>>> + return err;
>>> +}
>>> +EXPORT_SYMBOL(netdev_switch_fib_ipv4_del);
>>
>>
>--
>To unsubscribe from this list: send the line "unsubscribe netdev" in
>the body of a message to majordomo@vger.kernel.org
>More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* RE: [PATCH net-next 1/3] net: add IPv4 routing FIB support for swdev
From: Arad, Ronen @ 2015-01-02 11:21 UTC (permalink / raw)
To: roopa, sfeldma@gmail.com, netdev@vger.kernel.org
Cc: jiri@resnulli.us, john.fastabend@gmail.com, tgraf@suug.ch,
jhs@mojatatu.com, andy@greyhouse.net
In-Reply-To: <54A63186.1090807@cumulusnetworks.com>
>-----Original Message-----
>From: netdev-owner@vger.kernel.org [mailto:netdev-owner@vger.kernel.org] On
>Behalf Of roopa
>Sent: Friday, January 02, 2015 7:50 AM
>To: sfeldma@gmail.com
>Cc: netdev@vger.kernel.org; jiri@resnulli.us; john.fastabend@gmail.com;
>tgraf@suug.ch; jhs@mojatatu.com; andy@greyhouse.net
>Subject: Re: [PATCH net-next 1/3] net: add IPv4 routing FIB support for swdev
>
>On 1/1/15, 7:29 PM, sfeldma@gmail.com wrote:
>> From: Scott Feldman <sfeldma@gmail.com>
>>
>> To offload IPv4 L3 routing functions to swdev device, the swdev device
>driver
>> implements two new ndo ops (ndo_switch_fib_ipv4_add/del). The ops are
>called
>> by the core IPv4 FIB code when installing/removing FIB entries to/from the
>> kernel FIB. On install, the driver should return 0 if FIB entry (route) can
>be
>> installed to device for offloading, -EOPNOTSUPP if route cannot be installed
>> due to device limitations, and other negative error code on failure to
>install
>> route to device. On failure error code, the route is not installed to
>device,
>> and not installed in kernel FIB, and the return code is propagated back to
>the
>> user-space caller (via netlink). An -EOPNOTSUPP error code is skipped for
>the
>> device but installed in the kernel FIB.
>>
>> The FIB entry (route) nexthop list is used to find the swdev device port to
>> anchor the ndo op call. The route's fib_dev (the first nexthop's dev) is
>used
>> find the swdev port by recursively traversing the fib_dev's lower_dev list
>> until a swdev port is found. The ndo op is called on this swdev port.
>
>scott, I posted a similar api for bridge attribute sets. But, nobody
>supported it.
>http://marc.info/?l=linux-netdev&m=141820234410602&w=2
>
>If this is acceptable, I will be resubmitting my api as well.
>
There is certainly a need to propagate bridge and brport attributes to
switchdev driver. I believe the objections to your patch were not about that
need but about the mechanism of doing that. My understanding of the objections
on the list is that the propagation has to be delegated to intermediate master
devices (such as bond/team) in a stacked architecture instead of blindly
traverse through them to leaf switchdev ports.
An ideal traversal would allow intermediate master (or just upper) devices to
intervene or block the traversal while defaulting to the suggested transparent
traversal. This could address the objections to your patch. Maybe the traversal
requires an introduction of a new ndo.
>
>
>>
>> Since the FIB entry is "naked" when push from the kernel, the driver/device
>> is responsible for resolving the route's nexthops to neighbor MAC addresses.
>> This can be done by the driver by monitoring NETEVENT_NEIGH_UPDATE
>> netevent notifier to watch for ARP activity. Once a nexthop is resolved to
>> neighbor MAC address, it can be installed to the device and the device will
>> do the L3 routing offload in HW, for that nexthop.
>>
>> Signed-off-by: Scott Feldman <sfeldma@gmail.com>
>> Signed-off-by: Jiri Pirko <jiri@resnulli.us>
>> ---
>> include/linux/netdevice.h | 22 +++++++++++
>> include/net/switchdev.h | 18 +++++++++
>> net/ipv4/fib_trie.c | 17 ++++++++-
>> net/switchdev/switchdev.c | 89
>+++++++++++++++++++++++++++++++++++++++++++++
>> 4 files changed, 145 insertions(+), 1 deletion(-)
>>
>> diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
>> index 679e6e9..b66d22b 100644
>> --- a/include/linux/netdevice.h
>> +++ b/include/linux/netdevice.h
>> @@ -767,6 +767,8 @@ struct netdev_phys_item_id {
>> typedef u16 (*select_queue_fallback_t)(struct net_device *dev,
>> struct sk_buff *skb);
>>
>> +struct fib_info;
>> +
>> /*
>> * This structure defines the management hooks for network devices.
>> * The following hooks can be defined; unless noted otherwise, they are
>> @@ -1030,6 +1032,14 @@ typedef u16 (*select_queue_fallback_t)(struct
>net_device *dev,
>> * int (*ndo_switch_port_stp_update)(struct net_device *dev, u8 state);
>> * Called to notify switch device port of bridge port STP
>> * state change.
>> + * int (*ndo_sw_parent_fib_ipv4_add)(struct net_device *dev, __be32 dst,
>> + * int dst_len, struct fib_info *fi,
>> + * u8 tos, u8 type, u32 tb_id);
>> + * Called to add IPv4 route to switch device.
>> + * int (*ndo_sw_parent_fib_ipv4_del)(struct net_device *dev, __be32 dst,
>> + * int dst_len, struct fib_info *fi,
>> + * u8 tos, u8 type, u32 tb_id);
>> + * Called to delete IPv4 route from switch device.
>> */
>> struct net_device_ops {
>> int (*ndo_init)(struct net_device *dev);
>> @@ -1189,6 +1199,18 @@ struct net_device_ops {
>> struct netdev_phys_item_id
>*psid);
>> int (*ndo_switch_port_stp_update)(struct net_device
>*dev,
>> u8 state);
>> + int (*ndo_switch_fib_ipv4_add)(struct net_device *dev,
>> + __be32 dst,
>> + int dst_len,
>> + struct fib_info *fi,
>> + u8 tos, u8 type,
>> + u32 tb_id);
>> + int (*ndo_switch_fib_ipv4_del)(struct net_device *dev,
>> + __be32 dst,
>> + int dst_len,
>> + struct fib_info *fi,
>> + u8 tos, u8 type,
>> + u32 tb_id);
>> #endif
>> };
>>
>> diff --git a/include/net/switchdev.h b/include/net/switchdev.h
>> index 8a6d164..caebc2a 100644
>> --- a/include/net/switchdev.h
>> +++ b/include/net/switchdev.h
>> @@ -17,6 +17,10 @@
>> int netdev_switch_parent_id_get(struct net_device *dev,
>> struct netdev_phys_item_id *psid);
>> int netdev_switch_port_stp_update(struct net_device *dev, u8 state);
>> +int netdev_switch_fib_ipv4_add(u32 dst, int dst_len, struct fib_info *fi,
>> + u8 tos, u8 type, u32 tb_id);
>> +int netdev_switch_fib_ipv4_del(u32 dst, int dst_len, struct fib_info *fi,
>> + u8 tos, u8 type, u32 tb_id);
>>
>> #else
>>
>> @@ -32,6 +36,20 @@ static inline int netdev_switch_port_stp_update(struct
>net_device *dev,
>> return -EOPNOTSUPP;
>> }
>>
>> +static inline int netdev_switch_fib_ipv4_add(u32 dst, int dst_len,
>> + struct fib_info *fi,
>> + u8 tos, u8 type, u32 tb_id)
>> +{
>> + return -EOPNOTSUPP;
>> +}
>> +
>> +static inline int netdev_switch_fib_ipv4_del(u32 dst, int dst_len,
>> + struct fib_info *fi,
>> + u8 tos, u8 type, u32 tb_id)
>> +{
>> + return -EOPNOTSUPP;
>> +}
>> +
>> #endif
>>
>> #endif /* _LINUX_SWITCHDEV_H_ */
>> diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c
>> index 281e5e0..ea2dc17 100644
>> --- a/net/ipv4/fib_trie.c
>> +++ b/net/ipv4/fib_trie.c
>> @@ -79,6 +79,7 @@
>> #include <net/tcp.h>
>> #include <net/sock.h>
>> #include <net/ip_fib.h>
>> +#include <net/switchdev.h>
>> #include "fib_lookup.h"
>>
>> #define MAX_STAT_DEPTH 32
>> @@ -1201,6 +1202,8 @@ int fib_table_insert(struct fib_table *tb, struct
>fib_config *cfg)
>> fib_release_info(fi_drop);
>> if (state & FA_S_ACCESSED)
>> rt_cache_flush(cfg->fc_nlinfo.nl_net);
>> + netdev_switch_fib_ipv4_add(key, plen, fi, fa->fa_tos,
>> + cfg->fc_type, tb->tb_id);
>> rtmsg_fib(RTM_NEWROUTE, htonl(key), new_fa, plen,
>> tb->tb_id, &cfg->fc_nlinfo, NLM_F_REPLACE);
>>
>> @@ -1229,6 +1232,13 @@ int fib_table_insert(struct fib_table *tb, struct
>fib_config *cfg)
>> new_fa->fa_tos = tos;
>> new_fa->fa_type = cfg->fc_type;
>> new_fa->fa_state = 0;
>> +
>> + /* (Optionally) offload fib info to switch hardware. */
>> + err = netdev_switch_fib_ipv4_add(key, plen, fi, tos,
>> + cfg->fc_type, tb->tb_id);
>> + if (err && err != -EOPNOTSUPP)
>> + goto out_free_new_fa;
>> +
>> /*
>> * Insert new entry to the list.
>> */
>> @@ -1237,7 +1247,7 @@ int fib_table_insert(struct fib_table *tb, struct
>fib_config *cfg)
>> fa_head = fib_insert_node(t, key, plen);
>> if (unlikely(!fa_head)) {
>> err = -ENOMEM;
>> - goto out_free_new_fa;
>> + goto out_sw_fib_del;
>> }
>> }
>>
>> @@ -1253,6 +1263,8 @@ int fib_table_insert(struct fib_table *tb, struct
>fib_config *cfg)
>> succeeded:
>> return 0;
>>
>> +out_sw_fib_del:
>> + netdev_switch_fib_ipv4_del(key, plen, fi, tos, cfg->fc_type, tb-
>>tb_id);
>> out_free_new_fa:
>> kmem_cache_free(fn_alias_kmem, new_fa);
>> out:
>> @@ -1529,6 +1541,9 @@ int fib_table_delete(struct fib_table *tb, struct
>fib_config *cfg)
>> rtmsg_fib(RTM_DELROUTE, htonl(key), fa, plen, tb->tb_id,
>> &cfg->fc_nlinfo, 0);
>>
>> + netdev_switch_fib_ipv4_del(key, plen, fa->fa_info, tos,
>> + cfg->fc_type, tb->tb_id);
>> +
>> list_del_rcu(&fa->fa_list);
>>
>> if (!plen)
>> diff --git a/net/switchdev/switchdev.c b/net/switchdev/switchdev.c
>> index d162b21..211a8a0 100644
>> --- a/net/switchdev/switchdev.c
>> +++ b/net/switchdev/switchdev.c
>> @@ -12,6 +12,7 @@
>> #include <linux/types.h>
>> #include <linux/init.h>
>> #include <linux/netdevice.h>
>> +#include <net/ip_fib.h>
>> #include <net/switchdev.h>
>>
>> /**
>> @@ -50,3 +51,91 @@ int netdev_switch_port_stp_update(struct net_device *dev,
>u8 state)
>> return ops->ndo_switch_port_stp_update(dev, state);
>> }
>> EXPORT_SYMBOL(netdev_switch_port_stp_update);
>> +
>> +static struct net_device *netdev_switch_get_by_fib_dev(struct net_device
>*dev)
>> +{
>> + const struct net_device_ops *ops = dev->netdev_ops;
>> + struct net_device *lower_dev;
>> + struct net_device *port_dev;
>> + struct list_head *iter;
>> +
>> + /* Recusively search from fib_dev down until we find
>> + * a sw port dev. (A sw port dev supports
>> + * ndo_switch_parent_id_get).
>> + */
>> +
>> + if (ops->ndo_switch_parent_id_get)
>> + return dev;
>> +
>> + netdev_for_each_lower_dev(dev, lower_dev, iter) {
>> + port_dev = netdev_switch_get_by_fib_dev(lower_dev);
>> + if (port_dev)
>> + return port_dev;
>> + }
>> +
>> + return NULL;
>> +}
>> +
>> +/**
>> + * netdev_switch_fib_ipv4_add - Add IPv4 route entry to switch
>> + *
>> + * @dst: route's IPv4 destination address
>> + * @dst_len: destination address length (prefix length)
>> + * @fi: route FIB info structure
>> + * @tos: route TOS
>> + * @type: route type
>> + * @tb_id: route table ID
>> + *
>> + * Add IPv4 route entry to switch device.
>> + */
>> +int netdev_switch_fib_ipv4_add(u32 dst, int dst_len, struct fib_info *fi,
>> + u8 tos, u8 type, u32 tb_id)
>> +{
>> + struct net_device *dev;
>> + const struct net_device_ops *ops;
>> + int err = -EOPNOTSUPP;
>> +
>> + dev = netdev_switch_get_by_fib_dev(fi->fib_dev);
>> + if (!dev)
>> + return -EOPNOTSUPP;
>> + ops = dev->netdev_ops;
>> +
>> + if (ops->ndo_switch_fib_ipv4_add)
>> + err = ops->ndo_switch_fib_ipv4_add(dev, htonl(dst), dst_len,
>> + fi, tos, type, tb_id);
>> +
>> + return err;
>> +}
>> +EXPORT_SYMBOL(netdev_switch_fib_ipv4_add);
>> +
>> +/**
>> + * netdev_switch_fib_ipv4_del - Delete IPv4 route entry from switch
>> + *
>> + * @dst: route's IPv4 destination address
>> + * @dst_len: destination address length (prefix length)
>> + * @fi: route FIB info structure
>> + * @tos: route TOS
>> + * @type: route type
>> + * @tb_id: route table ID
>> + *
>> + * Delete IPv4 route entry from switch device.
>> + */
>> +int netdev_switch_fib_ipv4_del(u32 dst, int dst_len, struct fib_info *fi,
>> + u8 tos, u8 type, u32 tb_id)
>> +{
>> + struct net_device *dev;
>> + const struct net_device_ops *ops;
>> + int err = -EOPNOTSUPP;
>> +
>> + dev = netdev_switch_get_by_fib_dev(fi->fib_dev);
>> + if (!dev)
>> + return -EOPNOTSUPP;
>> + ops = dev->netdev_ops;
>> +
>> + if (ops->ndo_switch_fib_ipv4_del)
>> + err = ops->ndo_switch_fib_ipv4_del(dev, htonl(dst), dst_len,
>> + fi, tos, type, tb_id);
>> +
>> + return err;
>> +}
>> +EXPORT_SYMBOL(netdev_switch_fib_ipv4_del);
>
>--
>To unsubscribe from this list: send the line "unsubscribe netdev" in
>the body of a message to majordomo@vger.kernel.org
>More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH] drivers:net:wireless: Add proper locking for the function, b43_op_beacon_set_tim in main.c
From: Rafał Miłecki @ 2015-01-02 11:19 UTC (permalink / raw)
To: Michael Büsch
Cc: Nicholas Krause, Stefano Brivio, Network Development,
linux-wireless@vger.kernel.org, Linux Kernel Mailing List,
b43-dev, Kalle Valo
In-Reply-To: <20150102102727.3918a684@wiggum>
On 2 January 2015 at 10:27, Michael Büsch <m@bues.ch> wrote:
> On Fri, 2 Jan 2015 02:34:01 -0500
> Nicholas Krause <xerofoify@gmail.com> wrote:
>
>> This adds proper locking for the function, b43_op_beacon_set_tim in main.c by using the mutex lock
>> in the structure pointer wl, as embedded into this pointer as a mutex in order to protect against
>> multiple access to the pointer wl when updating the templates for this pointer in the function,
>> b43_update_templates internally in the function, b43_op_beacon_set_tim.
>>
>> Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
>> ---
>> drivers/net/wireless/b43/main.c | 3 ++-
>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
>> index 47731cb..d568fc8 100644
>> --- a/drivers/net/wireless/b43/main.c
>> +++ b/drivers/net/wireless/b43/main.c
>> @@ -5094,8 +5094,9 @@ static int b43_op_beacon_set_tim(struct ieee80211_hw *hw,
>> {
>> struct b43_wl *wl = hw_to_b43_wl(hw);
>>
>> - /* FIXME: add locking */
>> + mutex_lock(&wl->mutex);
>> b43_update_templates(wl);
>> + mutex_unlock(&wl->mutex);
>>
>> return 0;
>> }
>
> Thanks for the patch.
>
> However, this does not work. We are in atomic context here.
> Please see the b43-dev mailing list archives for a recent thread about that.
Michael: guess who it was who sent the patch doing the same back in November.
Yes, the same troll.
--
Rafał
^ permalink raw reply
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