]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
ath10k: add provision for Rx descriptor abstraction
authorVasanthakumar Thiagarajan <vthiagar@qti.qualcomm.com>
Fri, 9 Sep 2016 14:25:22 +0000 (17:25 +0300)
committerKalle Valo <kvalo@qca.qualcomm.com>
Tue, 13 Sep 2016 12:30:57 +0000 (15:30 +0300)
There are slight differences in Rx hw descriptor information
among different chips. So far driver does not use those new
information for any functionalities, but there is one important
information which is available from QCA99X0 onwards to indicate
the number of bytes that hw padded at the begining of the rx
payload and this information is needed to undecap the rx
packet. Add an abstraction for Rx desc to make use of the
new desc information available. The callback that this patch
defines to retrieve the padding bytes will be used in follow-up
patch.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qti.qualcomm.com>
[Rename operations to hw_ops for other purposes]
Signed-off-by: Benjamin Berg <benjamin@sipsolutions.net>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
drivers/net/wireless/ath/ath10k/core.c
drivers/net/wireless/ath/ath10k/hw.c
drivers/net/wireless/ath/ath10k/hw.h

index e859ca626ca0eaba4bf14a6f52d2998324790597..2d405a6c33751f375a02c345f4deec6943c7f776 100644 (file)
@@ -68,6 +68,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
                        .board_size = QCA988X_BOARD_DATA_SZ,
                        .board_ext_size = QCA988X_BOARD_EXT_DATA_SZ,
                },
+               .hw_ops = &qca988x_ops,
        },
        {
                .id = QCA9887_HW_1_0_VERSION,
@@ -87,6 +88,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
                        .board_size = QCA9887_BOARD_DATA_SZ,
                        .board_ext_size = QCA9887_BOARD_EXT_DATA_SZ,
                },
+               .hw_ops = &qca988x_ops,
        },
        {
                .id = QCA6174_HW_2_1_VERSION,
@@ -104,6 +106,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
                        .board_size = QCA6174_BOARD_DATA_SZ,
                        .board_ext_size = QCA6174_BOARD_EXT_DATA_SZ,
                },
+               .hw_ops = &qca988x_ops,
        },
        {
                .id = QCA6174_HW_2_1_VERSION,
@@ -122,6 +125,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
                        .board_size = QCA6174_BOARD_DATA_SZ,
                        .board_ext_size = QCA6174_BOARD_EXT_DATA_SZ,
                },
+               .hw_ops = &qca988x_ops,
        },
        {
                .id = QCA6174_HW_3_0_VERSION,
@@ -140,6 +144,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
                        .board_size = QCA6174_BOARD_DATA_SZ,
                        .board_ext_size = QCA6174_BOARD_EXT_DATA_SZ,
                },
+               .hw_ops = &qca988x_ops,
        },
        {
                .id = QCA6174_HW_3_2_VERSION,
@@ -159,6 +164,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
                        .board_size = QCA6174_BOARD_DATA_SZ,
                        .board_ext_size = QCA6174_BOARD_EXT_DATA_SZ,
                },
+               .hw_ops = &qca988x_ops,
        },
        {
                .id = QCA99X0_HW_2_0_DEV_VERSION,
@@ -183,6 +189,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
                        .board_ext_size = QCA99X0_BOARD_EXT_DATA_SZ,
                },
                .sw_decrypt_mcast_mgmt = true,
+               .hw_ops = &qca99x0_ops,
        },
        {
                .id = QCA9984_HW_1_0_DEV_VERSION,
@@ -207,6 +214,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
                        .board_ext_size = QCA99X0_BOARD_EXT_DATA_SZ,
                },
                .sw_decrypt_mcast_mgmt = true,
+               .hw_ops = &qca99x0_ops,
        },
        {
                .id = QCA9888_HW_2_0_DEV_VERSION,
@@ -230,6 +238,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
                        .board_ext_size = QCA99X0_BOARD_EXT_DATA_SZ,
                },
                .sw_decrypt_mcast_mgmt = true,
+               .hw_ops = &qca99x0_ops,
        },
        {
                .id = QCA9377_HW_1_0_DEV_VERSION,
@@ -247,6 +256,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
                        .board_size = QCA9377_BOARD_DATA_SZ,
                        .board_ext_size = QCA9377_BOARD_EXT_DATA_SZ,
                },
+               .hw_ops = &qca988x_ops,
        },
        {
                .id = QCA9377_HW_1_1_DEV_VERSION,
@@ -264,6 +274,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
                        .board_size = QCA9377_BOARD_DATA_SZ,
                        .board_ext_size = QCA9377_BOARD_EXT_DATA_SZ,
                },
+               .hw_ops = &qca988x_ops,
        },
        {
                .id = QCA4019_HW_1_0_DEV_VERSION,
@@ -289,6 +300,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
                        .board_ext_size = QCA4019_BOARD_EXT_DATA_SZ,
                },
                .sw_decrypt_mcast_mgmt = true,
+               .hw_ops = &qca99x0_ops,
        },
 };
 
index f903d468dbe61b89e0cffb6bb45791d0b131dfde..c2ecb9bd824aeed9c9858a6e45835f951415b01e 100644 (file)
@@ -219,3 +219,16 @@ void ath10k_hw_fill_survey_time(struct ath10k *ar, struct survey_info *survey,
        survey->time = CCNT_TO_MSEC(ar, cc);
        survey->time_busy = CCNT_TO_MSEC(ar, rcc);
 }
+
+const struct ath10k_hw_ops qca988x_ops = {
+};
+
+static int ath10k_qca99x0_rx_desc_get_l3_pad_bytes(struct htt_rx_desc *rxd)
+{
+       return MS(__le32_to_cpu(rxd->msdu_end.qca99x0.info1),
+                 RX_MSDU_END_INFO1_L3_HDR_PAD);
+}
+
+const struct ath10k_hw_ops qca99x0_ops = {
+       .rx_desc_get_l3_pad_bytes = ath10k_qca99x0_rx_desc_get_l3_pad_bytes,
+};
index af0d5d1e821391a7aafe473e43c4111fd2572b88..1b5ea3147f3ae8306d439a8dd1d7fc692826e878 100644 (file)
@@ -414,8 +414,20 @@ struct ath10k_hw_params {
         * frames encrypted and expect software do decryption.
         */
        bool sw_decrypt_mcast_mgmt;
+
+       const struct ath10k_hw_ops *hw_ops;
 };
 
+struct htt_rx_desc;
+
+/* Defines needed for Rx descriptor abstraction */
+struct ath10k_hw_ops {
+       int (*rx_desc_get_l3_pad_bytes)(struct htt_rx_desc *rxd);
+};
+
+extern const struct ath10k_hw_ops qca988x_ops;
+extern const struct ath10k_hw_ops qca99x0_ops;
+
 /* Target specific defines for MAIN firmware */
 #define TARGET_NUM_VDEVS                       8
 #define TARGET_NUM_PEER_AST                    2