From d23e543a751593a9f14f67f1ec6be36ef258cee4 Mon Sep 17 00:00:00 2001 From: Hans Ulli Kroll Date: Fri, 5 Aug 2016 21:05:22 +0200 Subject: [PATCH] remove Multicard support Signed-off-by: Hans Ulli Kroll --- Makefile | 7 - common/cmm_profile.c | 364 ----------------------------------------- common/rtmp_init.c | 25 --- common/rtmp_init_inf.c | 3 - include/os/rt_drv.h | 3 - include/os/rt_linux.h | 3 - include/rtmp.h | 7 - include/rtmp_def.h | 5 - os/linux/rt_linux.c | 5 - sta/sta_cfg.c | 3 - 10 files changed, 425 deletions(-) diff --git a/Makefile b/Makefile index 443d882..6bb5344 100644 --- a/Makefile +++ b/Makefile @@ -49,9 +49,6 @@ HAS_WEPAUTO_OPEN_FIRST_SUPPORT=n # Support user specific transmit rate of Multicast packet. HAS_MCAST_RATE_SPECIFIC_SUPPORT=n -# Support for Multiple Cards -HAS_MC_SUPPORT=n - #Support for PCI-MSI HAS_MSI_SUPPORT=n @@ -526,10 +523,6 @@ ifeq ($(HAS_DFS_SUPPORT),y) WFLAGS += -DDFS_SUPPORT endif -ifeq ($(HAS_MC_SUPPORT),y) -WFLAGS += -DMULTIPLE_CARD_SUPPORT -endif - ifeq ($(HAS_LLTD),y) WFLAGS += -DLLTD_SUPPORT endif diff --git a/common/cmm_profile.c b/common/cmm_profile.c index 02f4b58..3834856 100644 --- a/common/cmm_profile.c +++ b/common/cmm_profile.c @@ -2318,370 +2318,6 @@ NDIS_STATUS RTMPSetProfileParameters( return NDIS_STATUS_SUCCESS; } - -#ifdef MULTIPLE_CARD_SUPPORT -/* record whether the card in the card list is used in the card file*/ -u8 MC_CardUsed[MAX_NUM_OF_MULTIPLE_CARD]; -/* record used card mac address in the card list*/ -static u8 MC_CardMac[MAX_NUM_OF_MULTIPLE_CARD][6]; - -/* -======================================================================== -Routine Description: - Get card profile path. - -Arguments: - pAd - -Return Value: - TRUE - Find a card profile - FALSE - use default profile - -Note: -======================================================================== -*/ -BOOLEAN RTMP_CardInfoRead( - IN struct rtmp_adapter *pAd) -{ -#define MC_SELECT_CARDID 0 /* use CARD ID (0 ~ 31) to identify different cards */ -#define MC_SELECT_MAC 1 /* use CARD MAC to identify different cards */ -#define MC_SELECT_CARDTYPE 2 /* use CARD type (abgn or bgn) to identify different cards */ - -#define LETTER_CASE_TRANSLATE(txt_p, card_id) \ - { UINT32 _len; char _char; \ - for(_len=0; _len> 8); - mac[2] = (UCHAR)(addr23 & 0xff); - mac[3] = (UCHAR)(addr23 >> 8); - mac[4] = (UCHAR)(addr45 & 0xff); - mac[5] = (UCHAR)(addr45 >> 8); - - DBGPRINT(RT_DEBUG_TRACE, ("mac addr=%02x:%02x:%02x:%02x:%02x:%02x!\n", PRINT_MAC(mac))); - - RtmpOSFSInfoChange(&osFSInfo, TRUE); - /* open card information file*/ - srcf = RtmpOSFileOpen(CARD_INFO_PATH, O_RDONLY, 0); - if (IS_FILE_OPEN_ERR(srcf)) - { - /* card information file does not exist */ - DBGPRINT(RT_DEBUG_TRACE, - ("--> Error opening %s\n", CARD_INFO_PATH)); - goto free_resource; - } - - /* card information file exists so reading the card information */ - memset(buffer, 0x00, MAX_INI_BUFFER_SIZE); - retval = RtmpOSFileRead(srcf, buffer, MAX_INI_BUFFER_SIZE); - if (retval < 0) - { - /* read fail */ - DBGPRINT(RT_DEBUG_TRACE, - ("--> Read %s error %d\n", CARD_INFO_PATH, -retval)); - } - else - { - /* get card selection method */ - memset(tmpbuf, 0x00, MAX_PARAM_BUFFER_SIZE); - card_select_method = MC_SELECT_CARDTYPE; /* default*/ - - if (RTMPGetKeyParameter("SELECT", tmpbuf, 256, buffer, TRUE)) - { - if (strcmp(tmpbuf, "CARDID") == 0) - card_select_method = MC_SELECT_CARDID; - else if (strcmp(tmpbuf, "MAC") == 0) - card_select_method = MC_SELECT_MAC; - else if (strcmp(tmpbuf, "CARDTYPE") == 0) - card_select_method = MC_SELECT_CARDTYPE; - } - - DBGPRINT(RT_DEBUG_TRACE, - ("MC> Card Selection = %d\n", card_select_method)); - - /* init*/ - card_free_id = -1; - card_nouse_id = -1; - card_same_mac_id = -1; - card_match_id = -1; - - /* search current card information records*/ - for(card_index=0; - card_index Free = %d, Same = %d, NOUSE = %d\n", - card_free_id, card_same_mac_id, card_nouse_id)); - - if ((card_same_mac_id >= 0) && - ((card_select_method == MC_SELECT_CARDID) || - (card_select_method == MC_SELECT_CARDTYPE))) - { - /* same MAC entry is found*/ - card_match_id = card_same_mac_id; - - if (card_select_method == MC_SELECT_CARDTYPE) - { - /* for CARDTYPE*/ - snprintf(card_id_buf, sizeof(card_id_buf), "%02dCARDTYPE%s", - card_match_id, RFIC_word); - - if ((start_ptr = (PUCHAR)rtstrstruncasecmp(buffer, card_id_buf)) != NULL) - { - /* we found the card ID*/ - LETTER_CASE_TRANSLATE(start_ptr, card_id_buf); - } - } - } - else - { - /* the card is 1st plug-in, try to find the match card profile*/ - switch(card_select_method) - { - case MC_SELECT_CARDID: /* CARDID*/ - default: - if (card_free_id >= 0) - card_match_id = card_free_id; - else - card_match_id = card_nouse_id; - break; - - case MC_SELECT_MAC: /* MAC*/ - snprintf(card_id_buf, sizeof(card_id_buf), "MAC%02x:%02x:%02x:%02x:%02x:%02x", - mac[0], mac[1], mac[2], - mac[3], mac[4], mac[5]); - - /* try to find the key word in the card file */ - if ((start_ptr = (PUCHAR)rtstrstruncasecmp(buffer, card_id_buf)) != NULL) - { - LETTER_CASE_TRANSLATE(start_ptr, card_id_buf); - - /* get the row ID (2 ASCII characters) */ - start_ptr -= 2; - card_id_buf[0] = *(start_ptr); - card_id_buf[1] = *(start_ptr+1); - card_id_buf[2] = 0x00; - - card_match_id = simple_strtol(card_id_buf, 0, 10); - } - break; - - case MC_SELECT_CARDTYPE: /* CARDTYPE*/ - card_nouse_id = -1; - - for(card_index=0; - card_index= 0) - { - /* make up search keyword*/ - switch(card_select_method) - { - case MC_SELECT_CARDID: /* CARDID*/ - snprintf(card_id_buf, sizeof(card_id_buf), "%02dCARDID", card_match_id); - break; - - case MC_SELECT_MAC: /* MAC*/ - snprintf(card_id_buf, sizeof(card_id_buf), - "%02dmac%02x:%02x:%02x:%02x:%02x:%02x", - card_match_id, - mac[0], mac[1], mac[2], - mac[3], mac[4], mac[5]); - break; - - case MC_SELECT_CARDTYPE: /* CARDTYPE*/ - default: - snprintf(card_id_buf, sizeof(card_id_buf), "%02dcardtype%s", - card_match_id, RFIC_word); - break; - } - - DBGPRINT(RT_DEBUG_TRACE, ("Search Keyword = %s\n", card_id_buf)); - - /* read card file path*/ - if (RTMPGetKeyParameter(card_id_buf, tmpbuf, 256, buffer, TRUE)) - { - if (strlen(tmpbuf) < sizeof(pAd->MC_FileName)) - { - /* backup card information*/ - pAd->MC_RowID = card_match_id; /* base 0 */ - MC_CardUsed[card_match_id] = 1; - memcpy(MC_CardMac[card_match_id], mac, sizeof(mac)); - - /* backup card file path*/ - NdisMoveMemory(pAd->MC_FileName, tmpbuf , strlen(tmpbuf)); - pAd->MC_FileName[strlen(tmpbuf)] = '\0'; - flg_match_ok = TRUE; - - DBGPRINT(RT_DEBUG_TRACE, - ("Card Profile Name = %s\n", pAd->MC_FileName)); - } - else - { - DBGPRINT(RT_DEBUG_ERROR, - ("Card Profile Name length too large!\n")); - } - } - else - { - DBGPRINT(RT_DEBUG_ERROR, - ("Can not find search key word in card.dat!\n")); - } - - if ((flg_match_ok != TRUE) && - (card_match_id < MAX_NUM_OF_MULTIPLE_CARD)) - { - MC_CardUsed[card_match_id] = 0; - memset(MC_CardMac[card_match_id], 0, sizeof(mac)); - } - } /* if (card_match_id >= 0)*/ - } - - -/* close file*/ -retval = RtmpOSFileClose(srcf); - -free_resource: -RtmpOSFSInfoChange(&osFSInfo, FALSE); -/* kfree(buffer);*/ -/* kfree(tmpbuf);*/ -kfree(buffer); -kfree(tmpbuf); - -return flg_match_ok; -} -#endif /* MULTIPLE_CARD_SUPPORT */ - - - #ifdef SINGLE_SKU_V2 NDIS_STATUS RTMPSetSingleSKUParameters( IN struct rtmp_adapter*pAd) diff --git a/common/rtmp_init.c b/common/rtmp_init.c index 2e02884..e62038f 100644 --- a/common/rtmp_init.c +++ b/common/rtmp_init.c @@ -3549,24 +3549,6 @@ INT RtmpRaDevCtrlInit(void *pAdSrc, RTMP_INF_TYPE infType) #endif -#ifdef MULTIPLE_CARD_SUPPORT -{ - extern BOOLEAN RTMP_CardInfoRead(struct rtmp_adapter *pAd); - - /* find its profile path*/ - pAd->MC_RowID = -1; /* use default profile path*/ - RTMP_CardInfoRead(pAd); - - if (pAd->MC_RowID == -1) -#ifdef CONFIG_STA_SUPPORT - strcpy(pAd->MC_FileName, STA_PROFILE_PATH); -#endif /* CONFIG_STA_SUPPORT */ - - DBGPRINT(RT_DEBUG_TRACE, ("MC> ROW = %d, PATH = %s\n", pAd->MC_RowID, pAd->MC_FileName)); -} -#endif /* MULTIPLE_CARD_SUPPORT */ - - #ifdef MCS_LUT_SUPPORT if (pAd->chipCap.asic_caps & fASIC_CAP_MCS_LUT) { if (MAX_LEN_OF_MAC_TABLE < 128) { @@ -3587,13 +3569,6 @@ BOOLEAN RtmpRaDevCtrlExit(IN void *pAdSrc) struct rtmp_adapter *pAd = (struct rtmp_adapter *)pAdSrc; INT index; -#ifdef MULTIPLE_CARD_SUPPORT -extern u8 MC_CardUsed[MAX_NUM_OF_MULTIPLE_CARD]; - - if ((pAd->MC_RowID >= 0) && (pAd->MC_RowID <= MAX_NUM_OF_MULTIPLE_CARD)) - MC_CardUsed[pAd->MC_RowID] = 0; /* not clear MAC address*/ -#endif /* MULTIPLE_CARD_SUPPORT */ - #ifdef CONFIG_STA_SUPPORT #ifdef CREDENTIAL_STORE NdisFreeSpinLock(&pAd->StaCtIf.Lock); diff --git a/common/rtmp_init_inf.c b/common/rtmp_init_inf.c index 49d931e..f3d44bd 100644 --- a/common/rtmp_init_inf.c +++ b/common/rtmp_init_inf.c @@ -953,9 +953,6 @@ PNET_DEV RtmpPhyNetDevMainCreate( pAd = pAd; -#ifdef MULTIPLE_CARD_SUPPORT - MC_RowID = pAd->MC_RowID; -#endif /* MULTIPLE_CARD_SUPPORT */ #ifdef HOSTAPD_SUPPORT IoctlIF = pAd->IoctlIF; #endif /* HOSTAPD_SUPPORT */ diff --git a/include/os/rt_drv.h b/include/os/rt_drv.h index 45438d4..108ea13 100644 --- a/include/os/rt_drv.h +++ b/include/os/rt_drv.h @@ -56,9 +56,6 @@ typedef void pregs; #ifdef CONFIG_STA_SUPPORT #ifdef RTMP_MAC_USB -#ifdef MULTIPLE_CARD_SUPPORT -#define CARD_INFO_PATH "/etc/Wireless/RT2870STA/RT2870STACard.dat" -#endif /* MULTIPLE_CARD_SUPPORT */ #endif /* RTMP_MAC_USB */ #endif /* CONFIG_STA_SUPPORT */ diff --git a/include/os/rt_linux.h b/include/os/rt_linux.h index cc874fe..12e3c48 100644 --- a/include/os/rt_linux.h +++ b/include/os/rt_linux.h @@ -111,9 +111,6 @@ typedef struct usb_ctrlrequest devctrlrequest; #ifdef SINGLE_SKU_V2 #define SINGLE_SKU_TABLE_FILE_NAME "/etc/Wireless/RT2870STA/SingleSKU.dat" #endif /* SINGLE_SKU_V2 */ -#ifdef MULTIPLE_CARD_SUPPORT -#define CARD_INFO_PATH "/etc/Wireless/RT2870STA/RT2870STACard.dat" -#endif /* MULTIPLE_CARD_SUPPORT */ #endif /* RTMP_MAC_USB */ diff --git a/include/rtmp.h b/include/rtmp.h index ded24d3..5e7590e 100644 --- a/include/rtmp.h +++ b/include/rtmp.h @@ -3166,13 +3166,6 @@ struct rtmp_adapter { BLOCK_QUEUE_ENTRY blockQueueTab[NUM_OF_TX_RING]; #endif /* BLOCK_NET_IF */ - - -#ifdef MULTIPLE_CARD_SUPPORT - INT32 MC_RowID; - STRING MC_FileName[256]; -#endif /* MULTIPLE_CARD_SUPPORT */ - ULONG TbttTickCount; /* beacon timestamp work-around */ #ifdef PCI_MSI_SUPPORT BOOLEAN HaveMsi; diff --git a/include/rtmp_def.h b/include/rtmp_def.h index c35e447..34c463c 100644 --- a/include/rtmp_def.h +++ b/include/rtmp_def.h @@ -78,11 +78,6 @@ #define LOCAL_TXBUF_SIZE 2048 #endif /* RTMP_MAC_USB */ -#ifdef MULTIPLE_CARD_SUPPORT -/* MC: Multple Cards */ -#define MAX_NUM_OF_MULTIPLE_CARD 32 -#endif /* MULTIPLE_CARD_SUPPORT */ - #ifdef MEMORY_OPTIMIZATION #define MAX_RX_PROCESS 32 #else diff --git a/os/linux/rt_linux.c b/os/linux/rt_linux.c index ec22219..b9a061d 100644 --- a/os/linux/rt_linux.c +++ b/os/linux/rt_linux.c @@ -1351,11 +1351,6 @@ static int RtmpOSNetDevRequestName( memset(desiredName, 0, IFNAMSIZ); strncpy(&desiredName[0], pPrefixStr, prefixLen); -#ifdef MULTIPLE_CARD_SUPPORT - if (MC_RowID >= 0) - sprintf(suffixName, "%02d_%d", MC_RowID, ifNameIdx); - else -#endif /* MULTIPLE_CARD_SUPPORT */ sprintf(suffixName, "%d", ifNameIdx); slotNameLen = strlen(suffixName); diff --git a/sta/sta_cfg.c b/sta/sta_cfg.c index 79ca2fd..733a1bc 100644 --- a/sta/sta_cfg.c +++ b/sta/sta_cfg.c @@ -4109,9 +4109,6 @@ INT RTMPQueryInformation( case RT_OID_QUERY_MULTIPLE_CARD_SUPPORT: wrq->u.data.length = sizeof(UCHAR); i = 0; -#ifdef MULTIPLE_CARD_SUPPORT - i = 1; -#endif /* MULTIPLE_CARD_SUPPORT */ if (copy_to_user(wrq->u.data.pointer, &i, wrq->u.data.length)) { Status = -EFAULT;