Commit 9b323ee9 authored by Jes Sorensen's avatar Jes Sorensen Committed by Kalle Valo

rtl8xxxu: Make PBP tuning a fileops parameter

Rather than scattering the code with #ifdefs, use the fileops
structure to hold device specific PBP values.
Signed-off-by: default avatarJes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent a7737206
...@@ -7687,14 +7687,11 @@ static int rtl8xxxu_init_device(struct ieee80211_hw *hw) ...@@ -7687,14 +7687,11 @@ static int rtl8xxxu_init_device(struct ieee80211_hw *hw)
} }
/* /*
* Transfer page size is always 128 * The vendor drivers set PBP for all devices, except 8192e.
* There is no explanation for this in any of the sources.
*/ */
if (priv->rtl_chip == RTL8723B) val8 = (priv->fops->pbp_rx << PBP_PAGE_SIZE_RX_SHIFT) |
val8 = (PBP_PAGE_SIZE_256 << PBP_PAGE_SIZE_RX_SHIFT) | (priv->fops->pbp_tx << PBP_PAGE_SIZE_TX_SHIFT);
(PBP_PAGE_SIZE_256 << PBP_PAGE_SIZE_TX_SHIFT);
else
val8 = (PBP_PAGE_SIZE_128 << PBP_PAGE_SIZE_RX_SHIFT) |
(PBP_PAGE_SIZE_128 << PBP_PAGE_SIZE_TX_SHIFT);
if (priv->rtl_chip != RTL8192E) if (priv->rtl_chip != RTL8192E)
rtl8xxxu_write8(priv, REG_PBP, val8); rtl8xxxu_write8(priv, REG_PBP, val8);
...@@ -9728,6 +9725,8 @@ static struct rtl8xxxu_fileops rtl8723au_fops = { ...@@ -9728,6 +9725,8 @@ static struct rtl8xxxu_fileops rtl8723au_fops = {
.adda_2t_path_on_a = 0x04db25a4, .adda_2t_path_on_a = 0x04db25a4,
.adda_2t_path_on_b = 0x0b1b25a4, .adda_2t_path_on_b = 0x0b1b25a4,
.trxff_boundary = 0x27ff, .trxff_boundary = 0x27ff,
.pbp_rx = PBP_PAGE_SIZE_128,
.pbp_tx = PBP_PAGE_SIZE_128,
.mactable = rtl8723a_mac_init_table, .mactable = rtl8723a_mac_init_table,
}; };
...@@ -9761,6 +9760,8 @@ static struct rtl8xxxu_fileops rtl8723bu_fops = { ...@@ -9761,6 +9760,8 @@ static struct rtl8xxxu_fileops rtl8723bu_fops = {
.adda_2t_path_on_a = 0x01c00014, .adda_2t_path_on_a = 0x01c00014,
.adda_2t_path_on_b = 0x01c00014, .adda_2t_path_on_b = 0x01c00014,
.trxff_boundary = 0x3f7f, .trxff_boundary = 0x3f7f,
.pbp_rx = PBP_PAGE_SIZE_256,
.pbp_tx = PBP_PAGE_SIZE_256,
.mactable = rtl8723b_mac_init_table, .mactable = rtl8723b_mac_init_table,
}; };
...@@ -9792,6 +9793,8 @@ static struct rtl8xxxu_fileops rtl8192cu_fops = { ...@@ -9792,6 +9793,8 @@ static struct rtl8xxxu_fileops rtl8192cu_fops = {
.adda_2t_path_on_a = 0x04db25a4, .adda_2t_path_on_a = 0x04db25a4,
.adda_2t_path_on_b = 0x0b1b25a4, .adda_2t_path_on_b = 0x0b1b25a4,
.trxff_boundary = 0x27ff, .trxff_boundary = 0x27ff,
.pbp_rx = PBP_PAGE_SIZE_128,
.pbp_tx = PBP_PAGE_SIZE_128,
.mactable = rtl8723a_mac_init_table, .mactable = rtl8723a_mac_init_table,
}; };
......
...@@ -1310,6 +1310,8 @@ struct rtl8xxxu_fileops { ...@@ -1310,6 +1310,8 @@ struct rtl8xxxu_fileops {
u32 adda_2t_path_on_a; u32 adda_2t_path_on_a;
u32 adda_2t_path_on_b; u32 adda_2t_path_on_b;
u16 trxff_boundary; u16 trxff_boundary;
u8 pbp_rx;
u8 pbp_tx;
struct rtl8xxxu_reg8val *mactable; struct rtl8xxxu_reg8val *mactable;
u8 total_page_num; u8 total_page_num;
u8 page_num_hi; u8 page_num_hi;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment