Skip to content

Commit

Permalink
Removed code related to MFG.
Browse files Browse the repository at this point in the history
Signed-off-by: David Lin <dlin@marvell.com>
  • Loading branch information
yuhhaurlin committed Jun 1, 2016
1 parent 6bacc5a commit af93c39
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 87 deletions.
2 changes: 0 additions & 2 deletions debugfs.c
Expand Up @@ -122,8 +122,6 @@ static ssize_t mwl_debugfs_info_read(struct file *file, char __user *ubuf,
"macid used: %08x\n", priv->macids_used);
len += scnprintf(p + len, size - len,
"qe trigger number: %d\n", priv->qe_trigger_num);
len += scnprintf(p + len, size - len,
"mfg mode: %s\n", priv->mfg_mode ? "true" : "false");
len += scnprintf(p + len, size - len, "\n");

ret = simple_read_from_buffer(ubuf, count, ppos, p, len);
Expand Down
2 changes: 0 additions & 2 deletions dev.h
Expand Up @@ -382,8 +382,6 @@ struct mwl_priv {
u32 quiet_period;
int temperature;

bool mfg_mode;

#ifdef CONFIG_DEBUG_FS
struct dentry *debugfs_phy;
u32 reg_type;
Expand Down
27 changes: 1 addition & 26 deletions fwcmd.c
Expand Up @@ -48,16 +48,6 @@ static bool mwl_fwcmd_chk_adapter(struct mwl_priv *priv)

static void mwl_fwcmd_send_cmd(struct mwl_priv *priv)
{
if (priv->mfg_mode) {
struct cmd_header *cmd_hdr =
(struct cmd_header *)&priv->pcmd_buf[2];
u16 len = le16_to_cpu(cmd_hdr->len);

writel(priv->pphys_cmd_buf, priv->iobase1 + 0xcd0);
writel(0x00, priv->iobase1 + 0xcd4);
writel(0x00, priv->iobase1 + MACREG_REG_INT_CODE);
writel(len + 4, priv->iobase1 + 0xc40);
}
writel(priv->pphys_cmd_buf, priv->iobase1 + MACREG_REG_GEN_PTR);
writel(MACREG_H2ARIC_BIT_DOOR_BELL,
priv->iobase1 + MACREG_REG_H2A_INTERRUPT_EVENTS);
Expand Down Expand Up @@ -129,10 +119,7 @@ static int mwl_fwcmd_wait_complete(struct mwl_priv *priv, unsigned short cmd)
unsigned short int_code = 0;

do {
if (priv->mfg_mode)
int_code = le16_to_cpu(*((__le16 *)&priv->pcmd_buf[2]));
else
int_code = le16_to_cpu(*((__le16 *)&priv->pcmd_buf[0]));
int_code = le16_to_cpu(*((__le16 *)&priv->pcmd_buf[0]));
mdelay(1);
} while ((int_code != cmd) && (--curr_iteration));

Expand Down Expand Up @@ -847,9 +834,6 @@ int mwl_fwcmd_get_hw_specs(struct ieee80211_hw *hw)
int retry;
int i;

if (priv->mfg_mode)
return 0;

pcmd = (struct hostcmd_cmd_get_hw_spec *)&priv->pcmd_buf[0];

mutex_lock(&priv->fwcmd_mutex);
Expand Down Expand Up @@ -903,9 +887,6 @@ int mwl_fwcmd_set_hw_specs(struct ieee80211_hw *hw)
struct hostcmd_cmd_set_hw_spec *pcmd;
int i;

if (priv->mfg_mode)
return 0;

pcmd = (struct hostcmd_cmd_set_hw_spec *)&priv->pcmd_buf[0];

mutex_lock(&priv->fwcmd_mutex);
Expand Down Expand Up @@ -983,9 +964,6 @@ int mwl_fwcmd_set_radio_preamble(struct ieee80211_hw *hw, bool short_preamble)
struct mwl_priv *priv = hw->priv;
int rc;

if (priv->mfg_mode)
return 0;

priv->radio_short_preamble = short_preamble;
rc = mwl_fwcmd_802_11_radio_control(priv, true, true);

Expand Down Expand Up @@ -1246,9 +1224,6 @@ int mwl_fwcmd_rf_antenna(struct ieee80211_hw *hw, int dir, int antenna)
struct mwl_priv *priv = hw->priv;
struct hostcmd_cmd_802_11_rf_antenna *pcmd;

if (priv->mfg_mode)
return 0;

pcmd = (struct hostcmd_cmd_802_11_rf_antenna *)&priv->pcmd_buf[0];

mutex_lock(&priv->fwcmd_mutex);
Expand Down
23 changes: 4 additions & 19 deletions fwdl.c
Expand Up @@ -22,9 +22,6 @@
#include "sysadpt.h"
#include "dev.h"
#include "fwcmd.h"
#ifdef SUPPORT_MFG
#include "mfg.h"
#endif
#include "fwdl.h"

#define FW_DOWNLOAD_BLOCK_SIZE 256
Expand Down Expand Up @@ -60,12 +57,7 @@ int mwl_fwdl_download_firmware(struct ieee80211_hw *hw)
u32 size_fw_downloaded = 0;
u32 int_code = 0;
u32 len = 0;
#ifdef SUPPORT_MFG
u32 fwreadysignature = (priv->mfg_mode && priv->chip_type == MWL8897) ?
MFG_FW_READY_SIGNATURE : HOSTCMD_SOFTAP_FWRDY_SIGNATURE;
#else
u32 fwreadysignature = HOSTCMD_SOFTAP_FWRDY_SIGNATURE;
#endif

fw = priv->fw_ucode;

Expand Down Expand Up @@ -162,19 +154,12 @@ int mwl_fwdl_download_firmware(struct ieee80211_hw *hw)
*((u32 *)&priv->pcmd_buf[1]) = 0;
mwl_fwdl_trig_pcicmd(priv);
curr_iteration = FW_MAX_NUM_CHECKS;
if (priv->mfg_mode && priv->chip_type == MWL8897)
writel(fwreadysignature, priv->iobase1 + 0xcf0);
do {
curr_iteration--;
if (priv->mfg_mode && priv->chip_type == MWL8897) {
mdelay(FW_CHECK_MSECS);
int_code = readl(priv->iobase1 + 0xc44);
} else {
writel(HOSTCMD_SOFTAP_MODE,
priv->iobase1 + MACREG_REG_GEN_PTR);
mdelay(FW_CHECK_MSECS);
int_code = readl(priv->iobase1 + MACREG_REG_INT_CODE);
}
writel(HOSTCMD_SOFTAP_MODE,
priv->iobase1 + MACREG_REG_GEN_PTR);
mdelay(FW_CHECK_MSECS);
int_code = readl(priv->iobase1 + MACREG_REG_INT_CODE);
if (!(curr_iteration % 0xff) && (int_code != 0))
wiphy_err(hw->wiphy, "%x;", int_code);
} while ((curr_iteration) &&
Expand Down
47 changes: 9 additions & 38 deletions main.c
Expand Up @@ -31,9 +31,6 @@
#ifdef CONFIG_DEBUG_FS
#include "debugfs.h"
#endif
#ifdef SUPPORT_MFG
#include "mfg.h"
#endif

#define MWL_DESC "Marvell 802.11ac Wireless Network Driver"
#define MWL_DEV_NAME "Marvell 802.11ac Adapter"
Expand Down Expand Up @@ -208,45 +205,29 @@ static int mwl_init_firmware(struct mwl_priv *priv, const char *fw_name)
{
int rc = 0;

#ifdef SUPPORT_MFG
if (priv->mfg_mode)
rc = mwl_mfg_request_firmware(priv);
else
#endif
rc = request_firmware((const struct firmware **)&priv->fw_ucode,
fw_name, priv->dev);
rc = request_firmware((const struct firmware **)&priv->fw_ucode,
fw_name, priv->dev);

if (rc) {
if (priv->mfg_mode)
wiphy_err(priv->hw->wiphy, "cannot find firmware\n");
else
wiphy_err(priv->hw->wiphy,
"%s: cannot find firmware image <%s>\n",
wiphy_err(priv->hw->wiphy,
"%s: cannot find firmware image <%s>\n",
MWL_DRV_NAME, fw_name);
goto err_load_fw;
}

rc = mwl_fwdl_download_firmware(priv->hw);
if (rc) {
if (priv->mfg_mode)
wiphy_err(priv->hw->wiphy, "download firmware fail\n");
else
wiphy_err(priv->hw->wiphy,
"%s: cannot download firmware image <%s>\n",
MWL_DRV_NAME, fw_name);
wiphy_err(priv->hw->wiphy,
"%s: cannot download firmware image <%s>\n",
MWL_DRV_NAME, fw_name);
goto err_download_fw;
}

return rc;

err_download_fw:

#ifdef SUPPORT_MFG
if (priv->mfg_mode)
mwl_mfg_release_firmware(priv);
else
#endif
release_firmware(priv->fw_ucode);
release_firmware(priv->fw_ucode);

err_load_fw:

Expand Down Expand Up @@ -813,11 +794,6 @@ static int mwl_probe(struct pci_dev *pdev, const struct pci_device_id *id)

fw_name = mwl_chip_tbl[priv->chip_type].fw_image;

#ifdef SUPPORT_MFG
if (mfg_mode)
mwl_mfg_handler_init(priv);
#endif

rc = mwl_init_firmware(priv, fw_name);

if (rc) {
Expand All @@ -827,12 +803,7 @@ static int mwl_probe(struct pci_dev *pdev, const struct pci_device_id *id)
}

/* firmware is loaded to H/W, it can be released now */
#ifdef SUPPORT_MFG
if (priv->mfg_mode)
mwl_mfg_release_firmware(priv);
else
#endif
release_firmware(priv->fw_ucode);
release_firmware(priv->fw_ucode);

mwl_process_of_dts(priv);

Expand Down

0 comments on commit af93c39

Please sign in to comment.