Commit 61500fbd authored by Chaehyun Lim's avatar Chaehyun Lim Committed by Greg Kroah-Hartman

staging: wilc1000: remove commented code

Remove the commented codes using #if 0.
Signed-off-by: default avatarChaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 8efba0e0
......@@ -210,9 +210,6 @@ static tstrWID gastrWIDs[] = {
{WID_REKEY_POLICY, WID_CHAR},
{WID_REKEY_PERIOD, WID_INT},
{WID_REKEY_PACKET_COUNT, WID_INT},
#if 0
{WID_WEP_KEY_VALUE0, WID_STR},
#endif
{WID_11I_PSK, WID_STR},
{WID_1X_KEY, WID_STR},
{WID_1X_SERV_ADDR, WID_IP},
......@@ -1619,26 +1616,6 @@ s32 further_process_response(u8 *resp,
break;
case WID_BIN_DATA:
#if 0
/* FILE *fp_bin = NULL; */
u8 first_bin_wid = 1;
if (first_bin_wid) {
/* fp_bin = fopen("wid_response.bin","wb"); */
first_bin_wid = 0;
} else {
/* fp_bin = fopen("wid_response.bin","ab"); */
}
if (/*fp_bin == NULL*/ 0) {
PRINT_ER("Error: Could not open wid_response.bin for write\n");
return -2;
}
/* fwrite(resp + idx, cfg_len, 1, fp_bin); */
/* fclose(fp_bin); */
#endif
if (pstrWIDresult->s32ValueSize >= cfg_len) {
WILC_memcpy(pstrWIDresult->ps8WidVal, resp + idx, cfg_len);
pstrWIDresult->s32ValueSize = cfg_len;
......@@ -1884,13 +1861,6 @@ s32 CreateConfigPacket(s8 *ps8packet, s32 *ps32PacketLength,
pstrWIDs[u32idx].ps8WidVal, pstrWIDs[u32idx].s32ValueSize);
break;
#if 0
case WID_ADR:
ProcessAdrWid(ps8packet, ps32PacketLength, &pstrWIDs[u32idx],
pstrWIDs[u32idx].ps8WidVal);
break;
#endif
case WID_IP:
ProcessIPwid(ps8packet, ps32PacketLength, &pstrWIDs[u32idx],
pstrWIDs[u32idx].ps8WidVal);
......
This diff is collapsed.
......@@ -1261,13 +1261,6 @@ static s32 Handle_Scan(void *drvHandler, tstrHostIFscanAttr *pstrHostIFscanAttr)
pstrWFIDrv->strWILC_UsrScanReq.u32UserScanPvoid = pstrHostIFscanAttr->pvUserArg;
#ifdef WILC_P2P
#if 0
if (pstrWFIDrv->enuHostIFstate == HOST_IF_P2P_LISTEN || (pstrWFIDrv->enuHostIFstate == HOST_IF_CONNECTED && pstrWFIDrv->u8P2PConnect)) {
PRINT_INFO(GENERIC_DBG, "Busy: State: %d\n", pstrWFIDrv->enuHostIFstate);
PRINT_INFO(GENERIC_DBG, "Current Jiffies: %lu Timeout:%llu\n", jiffies, pstrWFIDrv->u64P2p_MgmtTimeout);
WILC_ERRORREPORT(s32Error, WILC_BUSY);
}
#endif
#endif
if ((pstrWFIDrv->enuHostIFstate >= HOST_IF_SCANNING) && (pstrWFIDrv->enuHostIFstate < HOST_IF_CONNECTED)) {
......@@ -1682,17 +1675,6 @@ static s32 Handle_Connect(void *drvHandler, tstrHostIFconnectAttr *pstrHostIFcon
}
#endif /*WILC_PARSE_SCAN_IN_HOST*/
#if 0
/* if we try to connect to an already connected AP then discard the request */
PRINT_D(GENERIC_DBG, "Bssid = %x:%x:%x:%x:%x:%x\n", (pstrHostIFconnectAttr->pu8bssid[0]), (pstrHostIFconnectAttr->pu8bssid[1]), (pstrHostIFconnectAttr->pu8bssid[2]), (pstrHostIFconnectAttr->pu8bssid[3]), (pstrHostIFconnectAttr->pu8bssid[4]), (pstrHostIFconnectAttr->pu8bssid[5]));
PRINT_D(GENERIC_DBG, "bssid = %x:%x:%x:%x:%x:%x\n", (u8ConnectedSSID[0]), (u8ConnectedSSID[1]), (u8ConnectedSSID[2]), (u8ConnectedSSID[3]), (u8ConnectedSSID[4]), (u8ConnectedSSID[5]));
if (WILC_memcmp(pstrHostIFconnectAttr->pu8bssid, u8ConnectedSSID, ETH_ALEN) == 0) {
PRINT_ER("Discard connect request\n");
s32Error = WILC_FAIL;
return s32Error;
}
#endif
if (pstrHostIFconnectAttr->pu8bssid != NULL) {
pstrWFIDrv->strWILC_UsrConnReq.pu8bssid = (u8 *)WILC_MALLOC(6);
WILC_memcpy(pstrWFIDrv->strWILC_UsrConnReq.pu8bssid, pstrHostIFconnectAttr->pu8bssid, 6);
......@@ -5101,65 +5083,7 @@ s32 host_int_add_rx_gtk(WILC_WFIDrvHandle hWFIDrv, const u8 *pu8RxGtk, u8 u8GtkK
}
return s32Error;
}
#if 0
/**
* @brief host_int_add_tx_gtk
* @details adds Tx GTk Key
* @param[in,out] handle to the wifi driver
* @param[in] message containing Tx GTK Key in the following format
*|----------------------------------------------------|
| KeyID | Key Length | Temporal Key | Tx Michael Key |
||-------|------------|--------------|----------------|
||1 byte | 1 byte | 16 bytes | 8 bytes |
||----------------------------------------------------|
* @return Error code indicating success/failure
* @note
* @author zsalah
* @date 8 March 2012
* @version 1.0
*/
s32 host_int_add_tx_gtk(WILC_WFIDrvHandle hWFIDrv, u8 u8KeyLen, u8 *pu8TxGtk, u8 u8KeyIdx)
{
s32 s32Error = WILC_SUCCESS;
tstrWILC_WFIDrv *pstrWFIDrv = (tstrWILC_WFIDrv *)hWFIDrv;
tstrHostIFmsg strHostIFmsg;
if (pstrWFIDrv == NULL) {
WILC_ERRORREPORT(s32Error, WILC_INVALID_ARGUMENT);
}
/* prepare the Key Message */
WILC_memset(&strHostIFmsg, 0, sizeof(tstrHostIFmsg));
strHostIFmsg.u16MsgId = HOST_IF_MSG_KEY;
strHostIFmsg.uniHostIFmsgBody.strHostIFkeyAttr.enuKeyType = WPATxGtk;
strHostIFmsg.uniHostIFmsgBody.strHostIFkeyAttr.u8KeyAction = ADDKEY;
strHostIFmsg.uniHostIFmsgBody.strHostIFkeyAttr.
uniHostIFkeyAttr.strHostIFwpaAttr.pu8key = (u8 *)WILC_MALLOC(u8KeyLen);
WILC_memcpy(strHostIFmsg.uniHostIFmsgBody.strHostIFkeyAttr.uniHostIFkeyAttr.strHostIFwpaAttr.pu8key,
pu8TxGtk, u8KeyLen);
strHostIFmsg.uniHostIFmsgBody.strHostIFkeyAttr.uniHostIFkeyAttr.strHostIFwpaAttr.u8Keylen = u8KeyLen;
/* send the message */
s32Error = WILC_MsgQueueSend(&gMsgQHostIF, &strHostIFmsg, sizeof(tstrHostIFmsg), NULL);
if (s32Error)
PRINT_ER("Error in sending message queue: TX GTK\n");
/* ////////////// */
down(&hSemTestKeyBlock);
WILC_Sleep(100);
/* /////// */
WILC_CATCH(s32Error)
{
}
return s32Error;
}
#endif
/**
* @brief host_int_set_pmkid_info
* @details caches the pmkid valid only in BSS STA mode if External Supplicant
......
......@@ -15,48 +15,6 @@
/*****************************************************************************/
/* Macros */
/*****************************************************************************/
#if 0
#define WID_BSS_TYPE 0x0000
#define WID_CURRENT_TX_RATE 0x0001
#define WID_CURRENT_CHANNEL 0x0002
#define WID_PREAMBLE 0x0003
#define WID_STATUS 0x0005
#define WID_SCAN_TYPE 0x0007
#define WID_KEY_ID 0x0009
#define WID_DTIM_PERIOD 0x0010
#define WID_POWER_MANAGEMENT 0x000B
#define WID_AUTH_TYPE 0x000D
#define WID_SITE_SURVEY 0x000E
#define WID_DTIM_PERIOD 0x0010
#define WID_DISCONNECT 0x0016
#define WID_SHORT_SLOT_ALLOWED 0x001A
#define WID_START_SCAN_REQ 0x001E
#define WID_RSSI 0x001F
#define WID_JOIN_REQ 0x0020
#define WID_11N_TXOP_PROT_DISABLE 0x00B0
#define WID_RTS_THRESHOLD 0x1000
#define WID_FRAG_THRESHOLD 0x1001
#define WID_SHORT_RETRY_LIMIT 0x1002
#define WID_LONG_RETRY_LIMIT 0x1003
#define WID_BEACON_INTERVAL 0x1006
#define WID_ACTIVE_SCAN_TIME 0x100C
#define WID_PASSIVE_SCAN_TIME 0x100D
#define WID_SITE_SURVEY_SCAN_TIME 0x100E
#define WID_AUTH_TIMEOUT 0x1010
#define WID_11I_PSK 0x3008
#define WID_SITE_SURVEY_RESULTS 0x3012
#define WID_ADD_PTK 0x301B
#define WID_ADD_RX_GTK 0x301C
#define WID_ADD_TX_GTK 0x301D
#define WID_ADD_WEP_KEY 0x3019
#define WID_REMOVE_WEP_KEY 0x301A
#define WID_REMOVE_KEY 0x301E
#define WID_ASSOC_REQ_INFO 0x301F
#define WID_ASSOC_RES_INFO 0x3020
#define WID_PMKID_INFO 0x3082
#define WID_SCAN_CHANNEL_LIST 0x4084
#define WID_11I_MODE 0x000C
#endif
#define FAIL 0x0000
#define SUCCESS 0x0001
......@@ -115,16 +73,6 @@
/* typedef unsigned long uint32; */
/* typedef uint32 Bool; */
#if 0
typedef enum {WID_CHAR = 0,
WID_SHORT = 1,
WID_INT = 2,
WID_STR = 3,
WID_ADR = 4,
WID_BIN = 5,
WID_IP = 6,
WID_UNDEF = 7} WID_TYPE_T;
#endif
typedef struct {
u16 cfg_wid;
WID_TYPE_T cfg_type;
......@@ -160,18 +108,7 @@ typedef struct _tstrHostIFpmkidAttr {
u8 numpmkid;
tstrHostIFpmkid pmkidlist[WILC_MAX_NUM_PMKIDS];
} tstrHostIFpmkidAttr;
#if 0
/* Scan type parameter for scan request */
typedef enum {
PASSIVE_SCAN = 0,
ACTIVE_SCAN = 1,
NUM_SCANTYPE
} tenuScanType;
typedef enum {SITE_SURVEY_1CH = 0,
SITE_SURVEY_ALL_CH = 1,
SITE_SURVEY_OFF = 2} SITE_SURVEY_T;
#endif
typedef enum {
AUTORATE = 0,
MBPS_1 = 1,
......
......@@ -533,51 +533,6 @@ struct net_device *WILC_WFI_init_mon_interface(const char *name, struct net_devi
if (wilc_wfi_mon) {
return wilc_wfi_mon;
}
#if 0
wilc_wfi_mon = alloc_netdev(sizeof(struct WILC_WFI_mon_priv), name, WILC_WFI_mon_setup);
if (wilc_wfi_mon == NULL) {
PRINT_ER("Failed to allocate netdevice\n");
goto failed;
}
/* rtnl_lock(); */
PRINT_INFO(HOSTAPD_DBG, "Monitor interface name %s\n", wilc_wfi_mon->name);
ret = dev_alloc_name(wilc_wfi_mon, wilc_wfi_mon->name);
if (ret < 0)
goto failed_mon;
priv = netdev_priv(wilc_wfi_mon);
if (priv == NULL) {
PRINT_ER("private structure is NULL\n");
return WILC_FAIL;
}
priv->real_ndev = real_dev;
ret = register_netdevice(wilc_wfi_mon);
if (ret < 0) {
PRINT_ER("Failed to register netdevice\n");
goto failed_mon;
}
return WILC_SUCCESS;
/* rtnl_unlock(); */
failed:
return ret;
failed_mon:
/* rtnl_unlock(); */
free_netdev(wilc_wfi_mon);
return ret;
#endif
wilc_wfi_mon = alloc_etherdev(sizeof(struct WILC_WFI_mon_priv));
if (!wilc_wfi_mon) {
......
......@@ -756,28 +756,6 @@ static void linux_wlan_mac_indicate(int flag)
}
if (pd->mac_status == WILC_MAC_STATUS_CONNECT) { /* Connect */
#if 0
/**
* get the mac and bssid address
**/
PRINT_D(RX_DBG, "Calling cfg_get to get MAC_ADDR\n");
pd->oup.wlan_cfg_get(1, WID_MAC_ADDR, 0);
PRINT_D(RX_DBG, "Calling cfg_get to get BSSID\n");
pd->oup.wlan_cfg_get(0, WID_BSSID, 1);
/**
* get the value
**/
pd->oup.wlan_cfg_get_value(WID_MAC_ADDR, pd->eth_src_address, 6);
pd->oup.wlan_cfg_get_value(WID_BSSID, pd->eth_dst_address, 6);
PRINT_D(GENERIC_DBG, "Source Address = %s", pd->eth_src_address);
PRINT_D(GENERIC_DBG, "Destiation Address = %s", pd->eth_dst_address);
/**
* launch ndis
**/
#endif
}
} else if (flag == WILC_MAC_INDICATE_SCAN) {
......
......@@ -294,13 +294,6 @@ static int sdio_write_reg(uint32_t addr, uint32_t data)
g_sdio.dPrint(N_ERR, "[wilc sdio]: Failed cmd53, write reg (%08x)...\n", addr);
goto _fail_;
}
#if 0
if (!sdio_check_bs())
goto _fail_;
#else
/* g_sdio.os_func.os_sleep(1); */
#endif
}
return 1;
......@@ -463,14 +456,6 @@ static int sdio_write(uint32_t addr, uint8_t *buf, uint32_t size)
buf += nblk * block_size;
#endif /* platform */
#if 0
if (!sdio_check_bs())
goto _fail_;
#else
/* g_sdio.os_func.os_sleep(1); */
#endif
}
......@@ -490,13 +475,6 @@ static int sdio_write(uint32_t addr, uint8_t *buf, uint32_t size)
g_sdio.dPrint(N_ERR, "[wilc sdio]: Failed cmd53 [%x], bytes send...\n", addr);
goto _fail_;
}
#if 0
if (!sdio_check_bs())
goto _fail_;
#else
/* g_sdio.os_func.os_sleep(1); */
#endif
}
return 1;
......@@ -539,13 +517,6 @@ static int sdio_read_reg(uint32_t addr, uint32_t *data)
g_sdio.dPrint(N_ERR, "[wilc sdio]: Failed cmd53, read reg (%08x)...\n", addr);
goto _fail_;
}
#if 0
if (!sdio_check_bs())
goto _fail_;
#else
/* g_sdio.os_func.os_sleep(1); */
#endif
}
#ifdef BIG_ENDIAN
......@@ -712,14 +683,6 @@ static int sdio_read(uint32_t addr, uint8_t *buf, uint32_t size)
buf += nblk * block_size;
#endif /* platform */
#if 0
if (!sdio_check_bs())
goto _fail_;
#else
/* g_sdio.os_func.os_sleep(1); */
#endif
} /* if (nblk > 0) */
if (nleft > 0) {
......@@ -738,13 +701,6 @@ static int sdio_read(uint32_t addr, uint8_t *buf, uint32_t size)
g_sdio.dPrint(N_ERR, "[wilc sdio]: Failed cmd53 [%x], bytes read...\n", addr);
goto _fail_;
}
#if 0
if (!sdio_check_bs())
goto _fail_;
#else
/* g_sdio.os_func.os_sleep(1); */
#endif
}
return 1;
......
......@@ -421,42 +421,6 @@ static int spi_cmd_complete(uint8_t cmd, uint32_t adr, uint8_t *b, uint32_t sz,
return result;
}
#if 0
{
int jj;
PRINT_D(BUS_DBG, "--- cnd = %x, len=%d, len2=%d\n", cmd, len, len2);
for (jj = 0; jj < sizeof(wb) / sizeof(wb[0]); jj++) {
if (jj >= len2)
break;
if (((jj + 1) % 16) != 0) {
if ((jj % 16) == 0) {
PRINT_D(BUS_DBG, "wb[%02x]: %02x ", jj, wb[jj]);
} else {
PRINT_D(BUS_DBG, "%02x ", wb[jj]);
}
} else {
PRINT_D(BUS_DBG, "%02x\n", wb[jj]);
}
}
for (jj = 0; jj < sizeof(rb) / sizeof(rb[0]); jj++) {
if (jj >= len2)
break;
if (((jj + 1) % 16) != 0) {
if ((jj % 16) == 0) {
PRINT_D(BUS_DBG, "rb[%02x]: %02x ", jj, rb[jj]);
} else {
PRINT_D(BUS_DBG, "%02x ", rb[jj]);
}
} else {
PRINT_D(BUS_DBG, "%02x\n", rb[jj]);
}
}
}
#endif
/**
* Command/Control response
**/
......@@ -552,10 +516,7 @@ static int spi_cmd_complete(uint8_t cmd, uint32_t adr, uint8_t *b, uint32_t sz,
for (ix = 0; (rix < len2) && (ix < sz); ) {
b[ix++] = rb[rix++];
}
#if 0
if (ix)
PRINT_D(BUS_DBG, "ttt %d %d\n", sz, ix);
#endif
sz -= ix;
if (sz > 0) {
......@@ -596,9 +557,6 @@ static int spi_cmd_complete(uint8_t cmd, uint32_t adr, uint8_t *b, uint32_t sz,
while (sz > 0) {
int nbytes;
#if 0
PRINT_INFO(BUS_DBG, "rrr %d %d\n", sz, ix);
#endif
if (sz <= DATA_PKT_SZ) {
nbytes = sz;
} else {
......@@ -788,32 +746,6 @@ static int spi_data_write(uint8_t *b, uint32_t sz)
/**
* No need to wait for response
**/
#if 0
/**
* Respnose
**/
if (!g_spi.spi_rx(&rsp, 1)) {
PRINT_ER("[wilc spi]: Failed data block write, response read, bus error...\n");
result = N_FAIL;
break;
}
if (((rsp >> 4) & 0xf) != 0xc) {
result = N_FAIL;
PRINT_ER("[wilc spi]: Failed data block write response...(%02x)\n", rsp);
break;
}
/**
* State
**/
if (!g_spi.spi_rx(&rsp, 1)) {
PRINT_ER("[wilc spi]: Failed data block write, read state, bus error...\n");
result = N_FAIL;
break;
}
#endif
ix += nbytes;
sz -= nbytes;
} while (sz);
......
......@@ -332,15 +332,6 @@ void WILC_WFI_Rx(struct net_device *dev, struct WILC_WFI_packet *pkt)
WILC_WFI_monitor_rx(dev, skb);
return;
}
#if 0
PRINT_D(RX_DBG, "In RX NORMAl Device name %s\n", dev->name);
/* Write metadata, and then pass to the receive level */
skb->dev = dev;
skb->protocol = eth_type_trans(skb, dev);
skb->ip_summed = CHECKSUM_UNNECESSARY; /* don't check it */
WILC_WFI_update_stats(priv->dev->ieee80211_ptr->wiphy, pkt->datalen, WILC_WFI_RX_PKT);
netif_rx(skb);
#endif
out:
return;
}
......
......@@ -2044,37 +2044,6 @@ uint32_t init_chip(void)
}
}
#if 0
if ((chipid & 0xfff) < 0xf0) {
/* Setting MUX to probe sleep signal on pin 6 of J216*/
g_wlan.hif_func.hif_write_reg(0x1060, 0x1);
g_wlan.hif_func.hif_write_reg(0x1180, 0x33333333);
g_wlan.hif_func.hif_write_reg(0x1184, 0x33333333);
g_wlan.hif_func.hif_read_reg(0x1408, &reg);
/* set MUX for GPIO_4 (pin 4) to cortus GPIO*/
reg &= ~((0x7 << 16));
g_wlan.hif_func.hif_write_reg(0x1408, (reg | (0x7 << 12)));
} else {
/* Enable test bus*/
g_wlan.hif_func.hif_write_reg(0x1060, 0x1);
/* Rotate bus signals to get sleep signal on pin 6 like it was on previous chips*/
g_wlan.hif_func.hif_write_reg(0x1188, 0x70);
/* Set output of pin 6 to test bus 0x1*/
/* Set output of pin 9 to test bus 0x2*/
g_wlan.hif_func.hif_write_reg(0x1180, 0x200100);
g_wlan.hif_func.hif_read_reg(0x1408, &reg);
/* set MUX for GPIO_4 (pin 4) to cortus GPIO*/
reg &= ~((0x7 << 16));
/* set MUX for GPIO_3 (pin 6) to test bus*/
reg |= (0x7 << 12) | (0x7 << 24);
g_wlan.hif_func.hif_write_reg(0x1408, reg);
}
#endif
release_bus(RELEASE_ONLY);
return ret;
......
......@@ -374,11 +374,6 @@ static int wilc_wlan_parse_info_frame(uint8_t *info, int size)
int type = WILC_CFG_RSP_STATUS;
wid = info[0] | (info[1] << 8);
#if 0
#ifdef BIG_ENDIAN
wid = BYTE_SWAP(wid);
#endif
#endif
len = info[2];
PRINT_INFO(GENERIC_DBG, "Status Len = %d Id= %d\n", len, wid);
......@@ -390,27 +385,6 @@ static int wilc_wlan_parse_info_frame(uint8_t *info, int size)
return type;
}
#if 0
static int wilc_wlan_parse_network_frame(uint8_t *info, int size)
{
wilc_mac_cfg_t *priv = (wilc_mac_cfg_t *)&g_mac;
uint32_t wid, len;
wid = info[0] | (info[1] << 8);
len = info[2] | (info[3] << 8);
/**
* Review: this message is only for AP mode.
* TBD
**/
if (wid == WID_NETWORK_INFO) { /* not send by the firmware */
}
return;
}
#endif
/********************************************
*
* Configuration Exported Functions
......
......@@ -169,28 +169,6 @@ typedef struct {
wilc_wlan_indicate_func_t indicate_func;
} wilc_wlan_inp_t;
#if 0
typedef struct {
int start;
uint32_t id;
void *buffer;
uint32_t buffer_size;
int commit;
} wilc_wlan_cfg_set_t;
typedef struct {
int start;
uint32_t id;
int commit;
} wilc_wlan_cfg_get_t;
typedef struct {
uint32_t id;
void *buffer;
uint32_t buffer_size;
} wilc_wlan_cfg_val_t;
#endif
struct tx_complete_data {
#ifdef WILC_FULLY_HOSTING_AP
struct tx_complete_data *next;
......
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