int mtk_cfg80211_testmode_cmd(IN struct wiphy *wiphy, IN void *data, IN int len) { P_GLUE_INFO_T prGlueInfo = NULL; P_NL80211_DRIVER_TEST_MODE_PARAMS prParams = (P_NL80211_DRIVER_TEST_MODE_PARAMS) NULL; INT_32 i4Status = -EINVAL; ASSERT(wiphy); prGlueInfo = (P_GLUE_INFO_T) wiphy_priv(wiphy); #if 1 printk("--> %s()\n", __func__); #endif if (data && len) { prParams = (P_NL80211_DRIVER_TEST_MODE_PARAMS) data; } else { DBGLOG(REQ, ERROR, ("mtk_cfg80211_testmode_cmd, data is NULL\n")); return i4Status; } /* Clear the version byte */ prParams->index = prParams->index & ~BITS(24, 31); if (prParams) { switch (prParams->index) { case 1: /* SW cmd */ i4Status = mtk_cfg80211_testmode_sw_cmd(wiphy, data, len); break; case 2: /* WAPI */ #if CFG_SUPPORT_WAPI i4Status = mtk_cfg80211_testmode_set_key_ext(wiphy, data, len); #endif break; case 0x10: i4Status = mtk_cfg80211_testmode_get_sta_statistics(wiphy, data, len, prGlueInfo); break; default: i4Status = -EINVAL; break; } } return i4Status; }
int mtk_cfg80211_testmode_cmd( IN struct wiphy *wiphy, IN void *data, IN int len ) { P_GLUE_INFO_T prGlueInfo = NULL; P_NL80211_DRIVER_TEST_MODE_PARAMS prParams = (P_NL80211_DRIVER_TEST_MODE_PARAMS)NULL; BOOLEAN fgIsValid = 0; ASSERT(wiphy); prGlueInfo = (P_GLUE_INFO_T) wiphy_priv(wiphy); #if 1 printk("--> %s()\n", __func__); #endif if(data && len) prParams = (P_NL80211_DRIVER_TEST_MODE_PARAMS)data; /* Clear the version byte */ prParams->index = prParams->index & ~ BITS(24,31); if(prParams){ switch(prParams->index){ case 1: /* SW cmd */ if(mtk_cfg80211_testmode_sw_cmd(wiphy, data, len)) fgIsValid = TRUE; break; case 2: /* WAPI */ #if CFG_SUPPORT_WAPI if(mtk_cfg80211_testmode_set_key_ext(wiphy, data, len)) fgIsValid = TRUE; #endif break; default: fgIsValid = TRUE; break; } } return fgIsValid; }