mwifiex: selectively choose ext_scan support
authorAvinash Patil <patila@marvell.com>
Fri, 23 Jan 2015 11:39:19 +0000 (17:09 +0530)
committerKalle Valo <kvalo@codeaurora.org>
Tue, 27 Jan 2015 18:18:20 +0000 (20:18 +0200)
Some devices do not support extended scan.
This patch adds support to enble ext_scan selectively.
For SD/PCIe interfaces, deefine ext_scan_support as part of
card structure and use it to initialize ext_scan in adapter
during registering device. For USB interfaces, we initialize
ext_scan during register_dev handler.

Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/mwifiex/init.c
drivers/net/wireless/mwifiex/pcie.c
drivers/net/wireless/mwifiex/pcie.h
drivers/net/wireless/mwifiex/sdio.c
drivers/net/wireless/mwifiex/sdio.h
drivers/net/wireless/mwifiex/usb.c

index b115e0f94dd7850fd6f1d566c687986661941ffc..8004d140ee013bc5e9a483baec3f054dc3a75cd7 100644 (file)
@@ -294,7 +294,7 @@ static void mwifiex_init_adapter(struct mwifiex_adapter *adapter)
        memset(&adapter->arp_filter, 0, sizeof(adapter->arp_filter));
        adapter->arp_filter_size = 0;
        adapter->max_mgmt_ie_index = MAX_MGMT_IE_INDEX;
-       adapter->ext_scan = true;
+       adapter->ext_scan = false;
        adapter->key_api_major_ver = 0;
        adapter->key_api_minor_ver = 0;
 
index a460b0e6a151addaae1f7e265011a562069f72a0..a5828da5936534595825137fd733c7f66dcc0bd6 100644 (file)
@@ -204,6 +204,7 @@ static int mwifiex_pcie_probe(struct pci_dev *pdev,
                card->pcie.blksz_fw_dl = data->blksz_fw_dl;
                card->pcie.tx_buf_size = data->tx_buf_size;
                card->pcie.supports_fw_dump = data->supports_fw_dump;
+               card->pcie.can_ext_scan = data->can_ext_scan;
        }
 
        if (mwifiex_add_card(card, &add_remove_card_sem, &pcie_ops,
@@ -2563,6 +2564,7 @@ static int mwifiex_register_dev(struct mwifiex_adapter *adapter)
        adapter->mem_type_mapping_tbl = mem_type_mapping_tbl;
        adapter->num_mem_types = ARRAY_SIZE(mem_type_mapping_tbl);
        strcpy(adapter->fw_name, card->pcie.firmware);
+       adapter->ext_scan = card->pcie.can_ext_scan;
 
        return 0;
 }
index 200e8b0cb5824e565ee0eda1c21055d7940be755..666d40e9dbc36495238537af92345d37e537c173 100644 (file)
@@ -206,6 +206,7 @@ struct mwifiex_pcie_device {
        u16 blksz_fw_dl;
        u16 tx_buf_size;
        bool supports_fw_dump;
+       bool can_ext_scan;
 };
 
 static const struct mwifiex_pcie_device mwifiex_pcie8766 = {
@@ -214,6 +215,7 @@ static const struct mwifiex_pcie_device mwifiex_pcie8766 = {
        .blksz_fw_dl = MWIFIEX_PCIE_BLOCK_SIZE_FW_DNLD,
        .tx_buf_size = MWIFIEX_TX_DATA_BUF_SIZE_2K,
        .supports_fw_dump = false,
+       .can_ext_scan = true,
 };
 
 static const struct mwifiex_pcie_device mwifiex_pcie8897 = {
@@ -222,6 +224,7 @@ static const struct mwifiex_pcie_device mwifiex_pcie8897 = {
        .blksz_fw_dl = MWIFIEX_PCIE_BLOCK_SIZE_FW_DNLD,
        .tx_buf_size = MWIFIEX_TX_DATA_BUF_SIZE_4K,
        .supports_fw_dump = true,
+       .can_ext_scan = true,
 };
 
 struct mwifiex_evt_buf_desc {
index cee107f36bc951d88540a948242071c19ebd6134..91e36cda9543e4cd20e1755572f8a31a24774b88 100644 (file)
@@ -107,6 +107,7 @@ mwifiex_sdio_probe(struct sdio_func *func, const struct sdio_device_id *id)
                card->mp_rx_agg_buf_size = data->mp_rx_agg_buf_size;
                card->supports_fw_dump = data->supports_fw_dump;
                card->auto_tdls = data->auto_tdls;
+               card->can_ext_scan = data->can_ext_scan;
        }
 
        sdio_claim_host(func);
@@ -1887,6 +1888,7 @@ static int mwifiex_init_sdio(struct mwifiex_adapter *adapter)
        }
 
        adapter->auto_tdls = card->auto_tdls;
+       adapter->ext_scan = card->can_ext_scan;
        return ret;
 }
 
index a4bb0dbbe7b351ebbff6a2c89361cc3e085b1c97..957cca24661828c4574f66bee9ac0ecd0126e5b8 100644 (file)
@@ -256,6 +256,7 @@ struct sdio_mmc_card {
 
        u8 *mp_regs;
        u8 auto_tdls;
+       bool can_ext_scan;
 
        struct mwifiex_sdio_mpa_tx mpa_tx;
        struct mwifiex_sdio_mpa_rx mpa_rx;
@@ -273,6 +274,7 @@ struct mwifiex_sdio_device {
        u32 mp_tx_agg_buf_size;
        u32 mp_rx_agg_buf_size;
        u8 auto_tdls;
+       bool can_ext_scan;
 };
 
 static const struct mwifiex_sdio_card_reg mwifiex_reg_sd87xx = {
@@ -417,6 +419,7 @@ static const struct mwifiex_sdio_device mwifiex_sdio_sd8786 = {
        .mp_rx_agg_buf_size = MWIFIEX_MP_AGGR_BUF_SIZE_16K,
        .supports_fw_dump = false,
        .auto_tdls = false,
+       .can_ext_scan = false,
 };
 
 static const struct mwifiex_sdio_device mwifiex_sdio_sd8787 = {
@@ -431,6 +434,7 @@ static const struct mwifiex_sdio_device mwifiex_sdio_sd8787 = {
        .mp_rx_agg_buf_size = MWIFIEX_MP_AGGR_BUF_SIZE_16K,
        .supports_fw_dump = false,
        .auto_tdls = false,
+       .can_ext_scan = true,
 };
 
 static const struct mwifiex_sdio_device mwifiex_sdio_sd8797 = {
@@ -445,6 +449,7 @@ static const struct mwifiex_sdio_device mwifiex_sdio_sd8797 = {
        .mp_rx_agg_buf_size = MWIFIEX_MP_AGGR_BUF_SIZE_16K,
        .supports_fw_dump = false,
        .auto_tdls = false,
+       .can_ext_scan = true,
 };
 
 static const struct mwifiex_sdio_device mwifiex_sdio_sd8897 = {
@@ -459,6 +464,7 @@ static const struct mwifiex_sdio_device mwifiex_sdio_sd8897 = {
        .mp_rx_agg_buf_size = MWIFIEX_MP_AGGR_BUF_SIZE_32K,
        .supports_fw_dump = true,
        .auto_tdls = false,
+       .can_ext_scan = true,
 };
 
 static const struct mwifiex_sdio_device mwifiex_sdio_sd8887 = {
@@ -473,6 +479,7 @@ static const struct mwifiex_sdio_device mwifiex_sdio_sd8887 = {
        .mp_rx_agg_buf_size = MWIFIEX_MP_AGGR_BUF_SIZE_32K,
        .supports_fw_dump = false,
        .auto_tdls = true,
+       .can_ext_scan = true,
 };
 
 static const struct mwifiex_sdio_device mwifiex_sdio_sd8801 = {
@@ -487,6 +494,7 @@ static const struct mwifiex_sdio_device mwifiex_sdio_sd8801 = {
        .mp_rx_agg_buf_size = MWIFIEX_MP_AGGR_BUF_SIZE_16K,
        .supports_fw_dump = false,
        .auto_tdls = false,
+       .can_ext_scan = true,
 };
 
 /*
index 50517b78d9651120e29dfe0dfae7314a26531cef..223873022ffe24120054cf13c8a8466c78bcdd0d 100644 (file)
@@ -799,16 +799,19 @@ static int mwifiex_register_dev(struct mwifiex_adapter *adapter)
        case USB8897_PID_2:
                adapter->tx_buf_size = MWIFIEX_TX_DATA_BUF_SIZE_4K;
                strcpy(adapter->fw_name, USB8897_DEFAULT_FW_NAME);
+               adapter->ext_scan = true;
                break;
        case USB8766_PID_1:
        case USB8766_PID_2:
                adapter->tx_buf_size = MWIFIEX_TX_DATA_BUF_SIZE_2K;
                strcpy(adapter->fw_name, USB8766_DEFAULT_FW_NAME);
+               adapter->ext_scan = true;
                break;
        case USB8801_PID_1:
        case USB8801_PID_2:
                adapter->tx_buf_size = MWIFIEX_TX_DATA_BUF_SIZE_2K;
                strcpy(adapter->fw_name, USB8801_DEFAULT_FW_NAME);
+               adapter->ext_scan = false;
                break;
        case USB8797_PID_1:
        case USB8797_PID_2: