From 16c3ea9cc0df9e6608200688be4b24a7958f45d3 Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Sun, 26 Apr 2009 16:04:33 +0200 Subject: Staging: rt2860: remove dead WDS_SUPPORT code Signed-off-by: Bartlomiej Zolnierkiewicz Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rt2860/rt_main_dev.c | 5 ----- 1 file changed, 5 deletions(-) (limited to 'drivers/staging/rt2860/rt_main_dev.c') diff --git a/drivers/staging/rt2860/rt_main_dev.c b/drivers/staging/rt2860/rt_main_dev.c index 6c4396f0903..201ad4a6ada 100644 --- a/drivers/staging/rt2860/rt_main_dev.c +++ b/drivers/staging/rt2860/rt_main_dev.c @@ -214,11 +214,6 @@ int rt28xx_close(IN PNET_DEV dev) if (pAd == NULL) return 0; // close ok - -#ifdef WDS_SUPPORT - WdsDown(pAd); -#endif // WDS_SUPPORT // - #ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { -- cgit v1.2.3 From 87502c14fea5084ab44d1c18dac0834f36a6d987 Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Sun, 26 Apr 2009 16:04:38 +0200 Subject: Staging: rt2860: remove dead CONFIG_APSTA_MIXED_SUPPORT code Signed-off-by: Bartlomiej Zolnierkiewicz Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rt2860/rt_main_dev.c | 38 ------------------------------------ 1 file changed, 38 deletions(-) (limited to 'drivers/staging/rt2860/rt_main_dev.c') diff --git a/drivers/staging/rt2860/rt_main_dev.c b/drivers/staging/rt2860/rt_main_dev.c index 201ad4a6ada..94018664b71 100644 --- a/drivers/staging/rt2860/rt_main_dev.c +++ b/drivers/staging/rt2860/rt_main_dev.c @@ -47,10 +47,6 @@ UINT8 MC_CardUsed[MAX_NUM_OF_MULTIPLE_CARD]; static UINT8 MC_CardMac[MAX_NUM_OF_MULTIPLE_CARD][6]; #endif // MULTIPLE_CARD_SUPPORT // -#ifdef CONFIG_APSTA_MIXED_SUPPORT -UINT32 CW_MAX_IN_BITS; -#endif // CONFIG_APSTA_MIXED_SUPPORT // - /*---------------------------------------------------------------------*/ /* Private Variables Used */ /*---------------------------------------------------------------------*/ @@ -87,10 +83,6 @@ static void CfgInitHook(PRTMP_ADAPTER pAd); extern const struct iw_handler_def rt28xx_iw_handler_def; #endif // CONFIG_STA_SUPPORT // -#ifdef CONFIG_APSTA_MIXED_SUPPORT -extern const struct iw_handler_def rt28xx_ap_iw_handler_def; -#endif // CONFIG_APSTA_MIXED_SUPPORT // - #if WIRELESS_EXT >= 12 // This function will be called when query /proc struct iw_statistics *rt28xx_get_wireless_stats( @@ -620,27 +612,6 @@ int rt28xx_open(IN PNET_DEV dev) return -1; } -#ifdef CONFIG_APSTA_MIXED_SUPPORT - if (pAd->OpMode == OPMODE_AP) - { - CW_MAX_IN_BITS = 6; - } - else if (pAd->OpMode == OPMODE_STA) - { - CW_MAX_IN_BITS = 10; - } - -#if WIRELESS_EXT >= 12 - if (net_dev->priv_flags == INT_MAIN) - { - if (pAd->OpMode == OPMODE_AP) - net_dev->wireless_handlers = (struct iw_handler_def *) &rt28xx_ap_iw_handler_def; - else if (pAd->OpMode == OPMODE_STA) - net_dev->wireless_handlers = (struct iw_handler_def *) &rt28xx_iw_handler_def; - } -#endif // WIRELESS_EXT >= 12 // -#endif // CONFIG_APSTA_MIXED_SUPPORT // - // Init pObj = (POS_COOKIE)pAd->OS_Cookie; @@ -752,15 +723,6 @@ static NDIS_STATUS rt_ieee80211_if_setup(struct net_device *dev, PRTMP_ADAPTER p #endif //WIRELESS_EXT >= 12 #endif // CONFIG_STA_SUPPORT // -#ifdef CONFIG_APSTA_MIXED_SUPPORT -#if WIRELESS_EXT >= 12 - if (pAd->OpMode == OPMODE_AP) - { - dev->wireless_handlers = &rt28xx_ap_iw_handler_def; - } -#endif //WIRELESS_EXT >= 12 -#endif // CONFIG_APSTA_MIXED_SUPPORT // - #if WIRELESS_EXT < 21 dev->get_wireless_stats = rt28xx_get_wireless_stats; #endif -- cgit v1.2.3 From 063f22af9ddd24b571d0e50f76d79c276a955394 Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Sun, 26 Apr 2009 16:04:50 +0200 Subject: Staging: rt2860: remove dead RALINK_ATE code Signed-off-by: Bartlomiej Zolnierkiewicz Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rt2860/rt_main_dev.c | 9 --------- 1 file changed, 9 deletions(-) (limited to 'drivers/staging/rt2860/rt_main_dev.c') diff --git a/drivers/staging/rt2860/rt_main_dev.c b/drivers/staging/rt2860/rt_main_dev.c index 94018664b71..0f1bd4e3709 100644 --- a/drivers/staging/rt2860/rt_main_dev.c +++ b/drivers/staging/rt2860/rt_main_dev.c @@ -1274,15 +1274,6 @@ int rt28xx_packet_xmit(struct sk_buff *skb) int status = 0; PNDIS_PACKET pPacket = (PNDIS_PACKET) skb; - /* RT2870STA does this in RTMPSendPackets() */ -#ifdef RALINK_ATE - if (ATE_ON(pAd)) - { - RELEASE_NDIS_PACKET(pAd, pPacket, NDIS_STATUS_RESOURCES); - return 0; - } -#endif // RALINK_ATE // - #ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { -- cgit v1.2.3 From 186a4ecda3f95d5e2b4ac7817a68ee2f94545485 Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Sun, 26 Apr 2009 16:04:54 +0200 Subject: Staging: rt2860: remove dead BLOCK_NET_IF code Signed-off-by: Bartlomiej Zolnierkiewicz Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rt2860/rt_main_dev.c | 5 ----- 1 file changed, 5 deletions(-) (limited to 'drivers/staging/rt2860/rt_main_dev.c') diff --git a/drivers/staging/rt2860/rt_main_dev.c b/drivers/staging/rt2860/rt_main_dev.c index 0f1bd4e3709..e3b7c4e6025 100644 --- a/drivers/staging/rt2860/rt_main_dev.c +++ b/drivers/staging/rt2860/rt_main_dev.c @@ -442,11 +442,6 @@ static int rt28xx_init(IN struct net_device *net_dev) CfgInitHook(pAd); - -#ifdef BLOCK_NET_IF - initblockQueueTab(pAd); -#endif // BLOCK_NET_IF // - #ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) NdisAllocateSpinLock(&pAd->MacTabLock); -- cgit v1.2.3 From 72888d31af50c4e8c2732ffd557655444bf9c8a2 Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Sun, 26 Apr 2009 16:05:03 +0200 Subject: Staging: rt2860: remove dead MULTIPLE_CARD_SUPPORT code Signed-off-by: Bartlomiej Zolnierkiewicz Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rt2860/rt_main_dev.c | 395 ----------------------------------- 1 file changed, 395 deletions(-) (limited to 'drivers/staging/rt2860/rt_main_dev.c') diff --git a/drivers/staging/rt2860/rt_main_dev.c b/drivers/staging/rt2860/rt_main_dev.c index e3b7c4e6025..95965a2a779 100644 --- a/drivers/staging/rt2860/rt_main_dev.c +++ b/drivers/staging/rt2860/rt_main_dev.c @@ -40,13 +40,6 @@ #define FORTY_MHZ_INTOLERANT_INTERVAL (60*1000) // 1 min -#ifdef MULTIPLE_CARD_SUPPORT -// record whether the card in the card list is used in the card file -UINT8 MC_CardUsed[MAX_NUM_OF_MULTIPLE_CARD]; -// record used card mac address in the card list -static UINT8 MC_CardMac[MAX_NUM_OF_MULTIPLE_CARD][6]; -#endif // MULTIPLE_CARD_SUPPORT // - /*---------------------------------------------------------------------*/ /* Private Variables Used */ /*---------------------------------------------------------------------*/ @@ -726,11 +719,6 @@ static NDIS_STATUS rt_ieee80211_if_setup(struct net_device *dev, PRTMP_ADAPTER p // find available device name for (i = 0; i < 8; i++) { -#ifdef MULTIPLE_CARD_SUPPORT - if (pAd->MC_RowID >= 0) - sprintf(slot_name, "ra%02d_%d", pAd->MC_RowID, i); - else -#endif // MULTIPLE_CARD_SUPPORT // sprintf(slot_name, "ra%d", i); device = dev_get_by_name(dev_net(dev), slot_name); @@ -748,11 +736,6 @@ static NDIS_STATUS rt_ieee80211_if_setup(struct net_device *dev, PRTMP_ADAPTER p } else { -#ifdef MULTIPLE_CARD_SUPPORT - if (pAd->MC_RowID >= 0) - sprintf(dev->name, "ra%02d_%d", pAd->MC_RowID, i); - else -#endif // MULTIPLE_CARD_SUPPORT // sprintf(dev->name, "ra%d", i); Status = NDIS_STATUS_SUCCESS; } @@ -761,369 +744,6 @@ static NDIS_STATUS rt_ieee80211_if_setup(struct net_device *dev, PRTMP_ADAPTER p } - -#ifdef MULTIPLE_CARD_SUPPORT -/* -======================================================================== -Routine Description: - Get card profile path. - -Arguments: - pAd - -Return Value: - TRUE - Find a card profile - FALSE - use default profile - -Note: -======================================================================== -*/ -extern INT RTMPGetKeyParameter( - IN PCHAR key, - OUT PCHAR dest, - IN INT destsize, - IN PCHAR buffer); - -BOOLEAN RTMP_CardInfoRead( - IN PRTMP_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; _lenfsuid; - orgfsgid = current->fsgid; - current->fsuid = current->fsgid = 0; - orgfs = get_fs(); - set_fs(KERNEL_DS); - - // get RF IC type - RTMP_IO_READ32(pAd, E2PROM_CSR, &data); - - if ((data & 0x30) == 0) - pAd->EEPROMAddressNum = 6; // 93C46 - else if ((data & 0x30) == 0x10) - pAd->EEPROMAddressNum = 8; // 93C66 - else - pAd->EEPROMAddressNum = 8; // 93C86 - - RT28xx_EEPROM_READ16(pAd, EEPROM_NIC1_OFFSET, antenna.word); - - if ((antenna.field.RfIcType == RFIC_2850) || - (antenna.field.RfIcType == RFIC_2750)) - { - /* ABGN card */ - strcpy(RFIC_word, "abgn"); - } - else - { - /* BGN card */ - strcpy(RFIC_word, "bgn"); - } - - // get MAC address - RT28xx_EEPROM_READ16(pAd, 0x04, addr01); - RT28xx_EEPROM_READ16(pAd, 0x06, addr23); - RT28xx_EEPROM_READ16(pAd, 0x08, addr45); - - mac[0] = (UCHAR)(addr01 & 0xff); - mac[1] = (UCHAR)(addr01 >> 8); - mac[2] = (UCHAR)(addr23 & 0xff); - mac[3] = (UCHAR)(addr23 >> 8); - mac[4] = (UCHAR)(addr45 & 0xff); - mac[5] = (UCHAR)(addr45 >> 8); - - // open card information file - srcf = filp_open(CARD_INFO_PATH, O_RDONLY, 0); - if (IS_ERR(srcf)) - { - /* card information file does not exist */ - DBGPRINT(RT_DEBUG_TRACE, - ("--> Error %ld opening %s\n", -PTR_ERR(srcf), CARD_INFO_PATH)); - return FALSE; - } - - if (srcf->f_op && srcf->f_op->read) - { - /* card information file exists so reading the card information */ - memset(buffer, 0x00, MAX_INI_BUFFER_SIZE); - retval = srcf->f_op->read(srcf, buffer, MAX_INI_BUFFER_SIZE, &srcf->f_pos); - 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)) - { - 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 - sprintf(card_id_buf, "%02dCARDTYPE%s", - card_match_id, RFIC_word); - - if ((start_ptr=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 - sprintf(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=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 - sprintf(card_id_buf, "%02dCARDID", card_match_id); - break; - - case MC_SELECT_MAC: // MAC - sprintf(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: - sprintf(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)) - { - 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 = filp_close(srcf, NULL); - set_fs(orgfs); - current->fsuid = orgfsuid; - current->fsgid = orgfsgid; - kfree(buffer); - kfree(tmpbuf); - return flg_match_ok; -} -#endif // MULTIPLE_CARD_SUPPORT // - - /* ======================================================================== Routine Description: @@ -1199,21 +819,6 @@ INT __devinit rt28xx_probe( pAd->OpMode = OPMODE_STA; #endif // CONFIG_STA_SUPPORT // - -#ifdef MULTIPLE_CARD_SUPPORT - // 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 // - // sample move if (rt_ieee80211_if_setup(net_dev, pAd) != NDIS_STATUS_SUCCESS) goto err_out_unmap; -- cgit v1.2.3 From 0aa7c8ddc027129e876642102a99ba4b51ace624 Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Sun, 26 Apr 2009 16:05:07 +0200 Subject: Staging: rt2860: remove dead QOS_DLS_SUPPORT code Signed-off-by: Bartlomiej Zolnierkiewicz Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rt2860/rt_main_dev.c | 31 ------------------------------- 1 file changed, 31 deletions(-) (limited to 'drivers/staging/rt2860/rt_main_dev.c') diff --git a/drivers/staging/rt2860/rt_main_dev.c b/drivers/staging/rt2860/rt_main_dev.c index 95965a2a779..241125c4084 100644 --- a/drivers/staging/rt2860/rt_main_dev.c +++ b/drivers/staging/rt2860/rt_main_dev.c @@ -211,37 +211,6 @@ int rt28xx_close(IN PNET_DEV dev) AsicForceWakeup(pAd, RTMP_HALT); } -#ifdef QOS_DLS_SUPPORT - // send DLS-TEAR_DOWN message, - if (pAd->CommonCfg.bDLSCapable) - { - UCHAR i; - - // tear down local dls table entry - for (i=0; iStaCfg.DLSEntry[i].Valid && (pAd->StaCfg.DLSEntry[i].Status == DLS_FINISH)) - { - RTMPSendDLSTearDownFrame(pAd, pAd->StaCfg.DLSEntry[i].MacAddr); - pAd->StaCfg.DLSEntry[i].Status = DLS_NONE; - pAd->StaCfg.DLSEntry[i].Valid = FALSE; - } - } - - // tear down peer dls table entry - for (i=MAX_NUM_OF_INIT_DLS_ENTRY; iStaCfg.DLSEntry[i].Valid && (pAd->StaCfg.DLSEntry[i].Status == DLS_FINISH)) - { - RTMPSendDLSTearDownFrame(pAd, pAd->StaCfg.DLSEntry[i].MacAddr); - pAd->StaCfg.DLSEntry[i].Status = DLS_NONE; - pAd->StaCfg.DLSEntry[i].Valid = FALSE; - } - } - RT28XX_MLME_HANDLER(pAd); - } -#endif // QOS_DLS_SUPPORT // - if (INFRA_ON(pAd) && (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST))) { -- cgit v1.2.3 From 2074a80c8b875baee92b7f040a0afd129cbcac26 Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Sun, 26 Apr 2009 16:05:33 +0200 Subject: Staging: rt2860: remove dead INF_AMAZON_SE code Signed-off-by: Bartlomiej Zolnierkiewicz Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rt2860/rt_main_dev.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'drivers/staging/rt2860/rt_main_dev.c') diff --git a/drivers/staging/rt2860/rt_main_dev.c b/drivers/staging/rt2860/rt_main_dev.c index 241125c4084..e5b246bb5ce 100644 --- a/drivers/staging/rt2860/rt_main_dev.c +++ b/drivers/staging/rt2860/rt_main_dev.c @@ -530,9 +530,7 @@ err1: // shall not set ml_priv to NULL here because the ml_priv didn't been free yet. //net_dev->ml_priv = 0; -#ifdef INF_AMAZON_SE -err0: -#endif // INF_AMAZON_SE // + printk("!!! %s Initialized fail !!!\n", RT28xx_CHIP_NAME); return FALSE; } /* End of rt28xx_init */ -- cgit v1.2.3 From 6a28a69ae8c51069c05f0a479be609fabef11790 Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Sun, 26 Apr 2009 16:05:46 +0200 Subject: Staging: rt2860: remove CONFIG_STA_SUPPORT ifdefs Signed-off-by: Bartlomiej Zolnierkiewicz Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rt2860/rt_main_dev.c | 35 ----------------------------------- 1 file changed, 35 deletions(-) (limited to 'drivers/staging/rt2860/rt_main_dev.c') diff --git a/drivers/staging/rt2860/rt_main_dev.c b/drivers/staging/rt2860/rt_main_dev.c index e5b246bb5ce..f5797f19725 100644 --- a/drivers/staging/rt2860/rt_main_dev.c +++ b/drivers/staging/rt2860/rt_main_dev.c @@ -72,9 +72,7 @@ INT rt28xx_send_packets(IN struct sk_buff *skb_p, IN struct net_device *net_dev) static void CfgInitHook(PRTMP_ADAPTER pAd); -#ifdef CONFIG_STA_SUPPORT extern const struct iw_handler_def rt28xx_iw_handler_def; -#endif // CONFIG_STA_SUPPORT // #if WIRELESS_EXT >= 12 // This function will be called when query /proc @@ -199,7 +197,6 @@ int rt28xx_close(IN PNET_DEV dev) if (pAd == NULL) return 0; // close ok -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { // If dirver doesn't wake up firmware here, @@ -259,7 +256,6 @@ int rt28xx_close(IN PNET_DEV dev) MlmeRadioOff(pAd); pAd->bPCIclkOff = FALSE; } -#endif // CONFIG_STA_SUPPORT // RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS); @@ -278,13 +274,10 @@ int rt28xx_close(IN PNET_DEV dev) // Close kernel threads or tasklets kill_thread_task(pAd); - -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { MacTableReset(pAd); } -#endif // CONFIG_STA_SUPPORT // MeasureReqTabExit(pAd); @@ -404,10 +397,8 @@ static int rt28xx_init(IN struct net_device *net_dev) CfgInitHook(pAd); -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) NdisAllocateSpinLock(&pAd->MacTabLock); -#endif // CONFIG_STA_SUPPORT // MeasureReqTabInit(pAd); TpcReqTabInit(pAd); @@ -585,13 +576,11 @@ int rt28xx_open(IN PNET_DEV dev) if (rt28xx_init(net_dev) == FALSE) goto err; -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { NdisZeroMemory(pAd->StaCfg.dev_name, 16); NdisMoveMemory(pAd->StaCfg.dev_name, net_dev->name, strlen(net_dev->name)); } -#endif // CONFIG_STA_SUPPORT // // Set up the Mac address NdisMoveMemory(net_dev->dev_addr, (void *) pAd->CurrentAddress, 6); @@ -601,7 +590,6 @@ int rt28xx_open(IN PNET_DEV dev) // Various AP function init -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { #ifdef WPA_SUPPLICANT_SUPPORT @@ -617,7 +605,6 @@ int rt28xx_open(IN PNET_DEV dev) #endif // WPA_SUPPLICANT_SUPPORT // } -#endif // CONFIG_STA_SUPPORT // // Enable Interrupt RT28XX_IRQ_ENABLE(pAd); @@ -632,10 +619,8 @@ int rt28xx_open(IN PNET_DEV dev) printk("0x1300 = %08x\n", reg); } -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) RTMPInitPCIeLinkCtrlValue(pAd); -#endif // CONFIG_STA_SUPPORT // return (retval); @@ -669,14 +654,12 @@ static NDIS_STATUS rt_ieee80211_if_setup(struct net_device *dev, PRTMP_ADAPTER p //ether_setup(dev); -#ifdef CONFIG_STA_SUPPORT #if WIRELESS_EXT >= 12 if (pAd->OpMode == OPMODE_STA) { dev->wireless_handlers = &rt28xx_iw_handler_def; } #endif //WIRELESS_EXT >= 12 -#endif // CONFIG_STA_SUPPORT // #if WIRELESS_EXT < 21 dev->get_wireless_stats = rt28xx_get_wireless_stats; @@ -740,9 +723,7 @@ INT __devinit rt28xx_probe( struct pci_dev *dev_p = (struct pci_dev *)_dev_p; -#ifdef CONFIG_STA_SUPPORT DBGPRINT(RT_DEBUG_TRACE, ("STA Driver version-%s\n", STA_DRIVER_VERSION)); -#endif // CONFIG_STA_SUPPORT // net_dev = alloc_etherdev(sizeof(PRTMP_ADAPTER)); if (net_dev == NULL) @@ -774,17 +755,13 @@ INT __devinit rt28xx_probe( RT28XXNetDevInit(_dev_p, net_dev, pAd); -#ifdef CONFIG_STA_SUPPORT pAd->StaCfg.OriDevType = net_dev->type; -#endif // CONFIG_STA_SUPPORT // // Post config if (RT28XXProbePostConfig(_dev_p, pAd, 0) == FALSE) goto err_out_unmap; -#ifdef CONFIG_STA_SUPPORT pAd->OpMode = OPMODE_STA; -#endif // CONFIG_STA_SUPPORT // // sample move if (rt_ieee80211_if_setup(net_dev, pAd) != NDIS_STATUS_SUCCESS) @@ -841,7 +818,6 @@ int rt28xx_packet_xmit(struct sk_buff *skb) int status = 0; PNDIS_PACKET pPacket = (PNDIS_PACKET) skb; -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { // Drop send request since we are in monitor mode @@ -851,7 +827,6 @@ int rt28xx_packet_xmit(struct sk_buff *skb) goto done; } } -#endif // CONFIG_STA_SUPPORT // // EapolStart size is 18 if (skb->len < 14) @@ -869,17 +844,12 @@ int rt28xx_packet_xmit(struct sk_buff *skb) } #endif - - -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { STASendPackets((NDIS_HANDLE)pAd, (PPNDIS_PACKET) &pPacket, 1); } -#endif // CONFIG_STA_SUPPORT // - status = 0; done: @@ -947,10 +917,8 @@ struct iw_statistics *rt28xx_get_wireless_stats( if(pAd->iw_stats.qual.qual > 100) pAd->iw_stats.qual.qual = 100; -#ifdef CONFIG_STA_SUPPORT if (pAd->OpMode == OPMODE_STA) pAd->iw_stats.qual.level = RTMPMaxRssi(pAd, pAd->StaCfg.RssiSample.LastRssi0, pAd->StaCfg.RssiSample.LastRssi1, pAd->StaCfg.RssiSample.LastRssi2); -#endif // CONFIG_STA_SUPPORT // pAd->iw_stats.qual.noise = pAd->BbpWriteLatch[66]; // noise level (dBm) @@ -1002,13 +970,10 @@ INT rt28xx_ioctl( return -ENETDOWN; } - -#ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { ret = rt28xx_sta_ioctl(net_dev, rq, cmd); } -#endif // CONFIG_STA_SUPPORT // return ret; } -- cgit v1.2.3 From 2684d16649c295b4498be5459ebb1e25220e3ee9 Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Sun, 26 Apr 2009 16:05:51 +0200 Subject: Staging: rt2860: remove NATIVE_WPA_SUPPLICANT_SUPPORT ifdefs Signed-off-by: Bartlomiej Zolnierkiewicz Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rt2860/rt_main_dev.c | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) (limited to 'drivers/staging/rt2860/rt_main_dev.c') diff --git a/drivers/staging/rt2860/rt_main_dev.c b/drivers/staging/rt2860/rt_main_dev.c index f5797f19725..677c28507c2 100644 --- a/drivers/staging/rt2860/rt_main_dev.c +++ b/drivers/staging/rt2860/rt_main_dev.c @@ -241,18 +241,6 @@ int rt28xx_close(IN PNET_DEV dev) RTMPCancelTimer(&pAd->StaCfg.StaQuickResponeForRateUpTimer, &Cancelled); RTMPCancelTimer(&pAd->StaCfg.WpaDisassocAndBlockAssocTimer, &Cancelled); -#ifdef WPA_SUPPLICANT_SUPPORT -#ifndef NATIVE_WPA_SUPPLICANT_SUPPORT - { - union iwreq_data wrqu; - // send wireless event to wpa_supplicant for infroming interface down. - memset(&wrqu, 0, sizeof(wrqu)); - wrqu.data.flags = RT_INTERFACE_DOWN; - wireless_send_event(pAd->net_dev, IWEVCUSTOM, &wrqu, NULL); - } -#endif // NATIVE_WPA_SUPPLICANT_SUPPORT // -#endif // WPA_SUPPLICANT_SUPPORT // - MlmeRadioOff(pAd); pAd->bPCIclkOff = FALSE; } @@ -592,18 +580,6 @@ int rt28xx_open(IN PNET_DEV dev) IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { -#ifdef WPA_SUPPLICANT_SUPPORT -#ifndef NATIVE_WPA_SUPPLICANT_SUPPORT - { - union iwreq_data wrqu; - // send wireless event to wpa_supplicant for infroming interface down. - memset(&wrqu, 0, sizeof(wrqu)); - wrqu.data.flags = RT_INTERFACE_UP; - wireless_send_event(pAd->net_dev, IWEVCUSTOM, &wrqu, NULL); - } -#endif // NATIVE_WPA_SUPPLICANT_SUPPORT // -#endif // WPA_SUPPLICANT_SUPPORT // - } // Enable Interrupt @@ -734,13 +710,12 @@ INT __devinit rt28xx_probe( } netif_stop_queue(net_dev); -#ifdef NATIVE_WPA_SUPPLICANT_SUPPORT + /* for supporting Network Manager */ /* Set the sysfs physical device reference for the network logical device * if set prior to registration will cause a symlink during initialization. */ SET_NETDEV_DEV(net_dev, &(dev_p->dev)); -#endif // NATIVE_WPA_SUPPLICANT_SUPPORT // // Allocate RTMP_ADAPTER miniport adapter structure handle = kmalloc(sizeof(struct os_cookie), GFP_KERNEL); -- cgit v1.2.3 From 1623267ab40fb52e33b889cdb5c8b796be454a20 Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Sun, 26 Apr 2009 16:06:00 +0200 Subject: Staging: rt2860: remove DOT11_N_SUPPORT ifdefs Signed-off-by: Bartlomiej Zolnierkiewicz Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rt2860/rt_main_dev.c | 17 ----------------- 1 file changed, 17 deletions(-) (limited to 'drivers/staging/rt2860/rt_main_dev.c') diff --git a/drivers/staging/rt2860/rt_main_dev.c b/drivers/staging/rt2860/rt_main_dev.c index 677c28507c2..7a09b7573b5 100644 --- a/drivers/staging/rt2860/rt_main_dev.c +++ b/drivers/staging/rt2860/rt_main_dev.c @@ -54,10 +54,8 @@ MODULE_PARM_DESC (mac, "rt28xx: wireless mac addr"); /*---------------------------------------------------------------------*/ /* Prototypes of Functions Used */ /*---------------------------------------------------------------------*/ -#ifdef DOT11_N_SUPPORT extern BOOLEAN ba_reordering_resource_init(PRTMP_ADAPTER pAd, int num); extern void ba_reordering_resource_release(PRTMP_ADAPTER pAd); -#endif // DOT11_N_SUPPORT // extern NDIS_STATUS NICLoadRateSwitchingParams(IN PRTMP_ADAPTER pAd); extern void init_thread_task(PRTMP_ADAPTER pAd); @@ -294,11 +292,8 @@ int rt28xx_close(IN PNET_DEV dev) RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS); -#ifdef DOT11_N_SUPPORT // Free BA reorder resource ba_reordering_resource_release(pAd); -#endif // DOT11_N_SUPPORT // - RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_START_UP); @@ -313,11 +308,8 @@ static int rt28xx_init(IN struct net_device *net_dev) NDIS_STATUS Status; UINT32 MacCsr0 = 0; - -#ifdef DOT11_N_SUPPORT // Allocate BA Reordering memory ba_reordering_resource_init(pAd, MAX_REORDERING_MPDU_NUM); -#endif // DOT11_N_SUPPORT // // Make sure MAC gets ready. index = 0; @@ -415,7 +407,6 @@ static int rt28xx_init(IN struct net_device *net_dev) //Init Ba Capability parameters. -#ifdef DOT11_N_SUPPORT pAd->CommonCfg.DesiredHtPhy.MpduDensity = (UCHAR)pAd->CommonCfg.BACapability.field.MpduDensity; pAd->CommonCfg.DesiredHtPhy.AmsduEnable = (USHORT)pAd->CommonCfg.BACapability.field.AmsduEnable; pAd->CommonCfg.DesiredHtPhy.AmsduSize = (USHORT)pAd->CommonCfg.BACapability.field.AmsduSize; @@ -424,7 +415,6 @@ static int rt28xx_init(IN struct net_device *net_dev) pAd->CommonCfg.HtCapability.HtCapInfo.MimoPs = (USHORT)pAd->CommonCfg.BACapability.field.MMPSmode; pAd->CommonCfg.HtCapability.HtCapInfo.AMsduSize = (USHORT)pAd->CommonCfg.BACapability.field.AmsduSize; pAd->CommonCfg.HtCapability.HtCapParm.MpduDensity = (UCHAR)pAd->CommonCfg.BACapability.field.MpduDensity; -#endif // DOT11_N_SUPPORT // printk("2. Phy Mode = %d\n", pAd->CommonCfg.PhyMode); @@ -439,9 +429,7 @@ static int rt28xx_init(IN struct net_device *net_dev) TmpPhy = pAd->CommonCfg.PhyMode; pAd->CommonCfg.PhyMode = 0xff; RTMPSetPhyMode(pAd, TmpPhy); -#ifdef DOT11_N_SUPPORT SetCommonHT(pAd); -#endif // DOT11_N_SUPPORT // // No valid channels. if (pAd->ChannelListNum == 0) @@ -450,11 +438,9 @@ static int rt28xx_init(IN struct net_device *net_dev) goto err4; } -#ifdef DOT11_N_SUPPORT printk("MCS Set = %02x %02x %02x %02x %02x\n", pAd->CommonCfg.HtCapability.MCSSet[0], pAd->CommonCfg.HtCapability.MCSSet[1], pAd->CommonCfg.HtCapability.MCSSet[2], pAd->CommonCfg.HtCapability.MCSSet[3], pAd->CommonCfg.HtCapability.MCSSet[4]); -#endif // DOT11_N_SUPPORT // #ifdef IKANOS_VX_1X0 VR_IKANOS_FP_Init(pAd->ApCfg.BssidNum, pAd->PermanentAddress); @@ -501,10 +487,7 @@ err3: err2: RTMPFreeTxRxRingMemory(pAd); err1: - -#ifdef DOT11_N_SUPPORT os_free_mem(pAd, pAd->mpdu_blk_pool.mem); // free BA pool -#endif // DOT11_N_SUPPORT // RT28XX_IRQ_RELEASE(net_dev); // shall not set ml_priv to NULL here because the ml_priv didn't been free yet. -- cgit v1.2.3 From 5a911fd648c48ba23ffbd729daad0d56c45b2b78 Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Sun, 26 Apr 2009 16:06:04 +0200 Subject: Staging: rt2860: remove dead CONFIG_AP_SUPPORT code Then remove no longer needed IF_DEV_CONFIG_OPMODE_ON_[AP,STA]() macros. Signed-off-by: Bartlomiej Zolnierkiewicz Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rt2860/rt_main_dev.c | 34 ++++++---------------------------- 1 file changed, 6 insertions(+), 28 deletions(-) (limited to 'drivers/staging/rt2860/rt_main_dev.c') diff --git a/drivers/staging/rt2860/rt_main_dev.c b/drivers/staging/rt2860/rt_main_dev.c index 7a09b7573b5..138b136b073 100644 --- a/drivers/staging/rt2860/rt_main_dev.c +++ b/drivers/staging/rt2860/rt_main_dev.c @@ -195,7 +195,6 @@ int rt28xx_close(IN PNET_DEV dev) if (pAd == NULL) return 0; // close ok - IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { // If dirver doesn't wake up firmware here, // NICLoadFirmware will hang forever when interface is up again. @@ -260,11 +259,7 @@ int rt28xx_close(IN PNET_DEV dev) // Close kernel threads or tasklets kill_thread_task(pAd); - IF_DEV_CONFIG_OPMODE_ON_STA(pAd) - { - MacTableReset(pAd); - } - + MacTableReset(pAd); MeasureReqTabExit(pAd); TpcReqTabExit(pAd); @@ -377,8 +372,7 @@ static int rt28xx_init(IN struct net_device *net_dev) CfgInitHook(pAd); - IF_DEV_CONFIG_OPMODE_ON_STA(pAd) - NdisAllocateSpinLock(&pAd->MacTabLock); + NdisAllocateSpinLock(&pAd->MacTabLock); MeasureReqTabInit(pAd); TpcReqTabInit(pAd); @@ -547,11 +541,8 @@ int rt28xx_open(IN PNET_DEV dev) if (rt28xx_init(net_dev) == FALSE) goto err; - IF_DEV_CONFIG_OPMODE_ON_STA(pAd) - { - NdisZeroMemory(pAd->StaCfg.dev_name, 16); - NdisMoveMemory(pAd->StaCfg.dev_name, net_dev->name, strlen(net_dev->name)); - } + NdisZeroMemory(pAd->StaCfg.dev_name, 16); + NdisMoveMemory(pAd->StaCfg.dev_name, net_dev->name, strlen(net_dev->name)); // Set up the Mac address NdisMoveMemory(net_dev->dev_addr, (void *) pAd->CurrentAddress, 6); @@ -561,10 +552,6 @@ int rt28xx_open(IN PNET_DEV dev) // Various AP function init - IF_DEV_CONFIG_OPMODE_ON_STA(pAd) - { - } - // Enable Interrupt RT28XX_IRQ_ENABLE(pAd); @@ -578,7 +565,6 @@ int rt28xx_open(IN PNET_DEV dev) printk("0x1300 = %08x\n", reg); } - IF_DEV_CONFIG_OPMODE_ON_STA(pAd) RTMPInitPCIeLinkCtrlValue(pAd); return (retval); @@ -776,7 +762,6 @@ int rt28xx_packet_xmit(struct sk_buff *skb) int status = 0; PNDIS_PACKET pPacket = (PNDIS_PACKET) skb; - IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { // Drop send request since we are in monitor mode if (MONITOR_ON(pAd)) @@ -802,11 +787,7 @@ int rt28xx_packet_xmit(struct sk_buff *skb) } #endif - IF_DEV_CONFIG_OPMODE_ON_STA(pAd) - { - - STASendPackets((NDIS_HANDLE)pAd, (PPNDIS_PACKET) &pPacket, 1); - } + STASendPackets((NDIS_HANDLE)pAd, (PPNDIS_PACKET) &pPacket, 1); status = 0; done: @@ -928,10 +909,7 @@ INT rt28xx_ioctl( return -ENETDOWN; } - IF_DEV_CONFIG_OPMODE_ON_STA(pAd) - { - ret = rt28xx_sta_ioctl(net_dev, rq, cmd); - } + ret = rt28xx_sta_ioctl(net_dev, rq, cmd); return ret; } -- cgit v1.2.3 From 96f139ee99322060523883d4a665b10780ca3182 Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Sun, 26 Apr 2009 16:06:12 +0200 Subject: Staging: rt2860: remove dead code Signed-off-by: Bartlomiej Zolnierkiewicz Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rt2860/rt_main_dev.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'drivers/staging/rt2860/rt_main_dev.c') diff --git a/drivers/staging/rt2860/rt_main_dev.c b/drivers/staging/rt2860/rt_main_dev.c index 138b136b073..5951567b2cb 100644 --- a/drivers/staging/rt2860/rt_main_dev.c +++ b/drivers/staging/rt2860/rt_main_dev.c @@ -596,9 +596,6 @@ static NDIS_STATUS rt_ieee80211_if_setup(struct net_device *dev, PRTMP_ADAPTER p CHAR slot_name[IFNAMSIZ]; struct net_device *device; - - //ether_setup(dev); - #if WIRELESS_EXT >= 12 if (pAd->OpMode == OPMODE_STA) { -- cgit v1.2.3 From 3a32ed12b69113094f0921dad50f112626cde44d Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Sun, 26 Apr 2009 16:06:25 +0200 Subject: Staging: rt2860: prepare for rt28[67]0/*.[ch] merge Signed-off-by: Bartlomiej Zolnierkiewicz Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rt2860/rt_main_dev.c | 114 +++++++++++++++++++++++++++++++++-- 1 file changed, 110 insertions(+), 4 deletions(-) (limited to 'drivers/staging/rt2860/rt_main_dev.c') diff --git a/drivers/staging/rt2860/rt_main_dev.c b/drivers/staging/rt2860/rt_main_dev.c index 5951567b2cb..f298b9bcec3 100644 --- a/drivers/staging/rt2860/rt_main_dev.c +++ b/drivers/staging/rt2860/rt_main_dev.c @@ -58,7 +58,9 @@ extern BOOLEAN ba_reordering_resource_init(PRTMP_ADAPTER pAd, int num); extern void ba_reordering_resource_release(PRTMP_ADAPTER pAd); extern NDIS_STATUS NICLoadRateSwitchingParams(IN PRTMP_ADAPTER pAd); +#ifdef RT2860 extern void init_thread_task(PRTMP_ADAPTER pAd); +#endif // public function prototype INT __devinit rt28xx_probe(IN void *_dev_p, IN void *_dev_id_p, @@ -187,6 +189,12 @@ int rt28xx_close(IN PNET_DEV dev) RTMP_ADAPTER *pAd = net_dev->ml_priv; BOOLEAN Cancelled = FALSE; UINT32 i = 0; +#ifdef RT2870 + DECLARE_WAIT_QUEUE_HEAD(unlink_wakeup); + DECLARE_WAITQUEUE(wait, current); + + //RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_REMOVE_IN_PROGRESS); +#endif // RT2870 // DBGPRINT(RT_DEBUG_TRACE, ("===> rt28xx_close\n")); @@ -198,11 +206,21 @@ int rt28xx_close(IN PNET_DEV dev) { // If dirver doesn't wake up firmware here, // NICLoadFirmware will hang forever when interface is up again. +#ifdef RT2860 if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE) || RTMP_SET_PSFLAG(pAd, fRTMP_PS_SET_PCI_CLK_OFF_COMMAND) || RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_IDLE_RADIO_OFF)) +#endif +#ifdef RT2870 + if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE)) +#endif { +#ifdef RT2860 AsicForceWakeup(pAd, RTMP_HALT); +#endif +#ifdef RT2870 + AsicForceWakeup(pAd, TRUE); +#endif } if (INFRA_ON(pAd) && @@ -230,6 +248,9 @@ int rt28xx_close(IN PNET_DEV dev) RTMPusecDelay(1000); } +#ifdef RT2870 + RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_REMOVE_IN_PROGRESS); +#endif // RT2870 // #ifdef CCX_SUPPORT RTMPCancelTimer(&pAd->StaCfg.LeapAuthTimer, &Cancelled); @@ -239,7 +260,9 @@ int rt28xx_close(IN PNET_DEV dev) RTMPCancelTimer(&pAd->StaCfg.WpaDisassocAndBlockAssocTimer, &Cancelled); MlmeRadioOff(pAd); +#ifdef RT2860 pAd->bPCIclkOff = FALSE; +#endif } RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS); @@ -253,6 +276,40 @@ int rt28xx_close(IN PNET_DEV dev) } } +#ifdef RT2870 + // ensure there are no more active urbs. + add_wait_queue (&unlink_wakeup, &wait); + pAd->wait = &unlink_wakeup; + + // maybe wait for deletions to finish. + i = 0; + //while((i < 25) && atomic_read(&pAd->PendingRx) > 0) + while(i < 25) + { + unsigned long IrqFlags; + + RTMP_IRQ_LOCK(&pAd->BulkInLock, IrqFlags); + if (pAd->PendingRx == 0) + { + RTMP_IRQ_UNLOCK(&pAd->BulkInLock, IrqFlags); + break; + } + RTMP_IRQ_UNLOCK(&pAd->BulkInLock, IrqFlags); + + msleep(UNLINK_TIMEOUT_MS); //Time in millisecond + i++; + } + pAd->wait = NULL; + remove_wait_queue (&unlink_wakeup, &wait); +#endif // RT2870 // + +#ifdef RT2870 + // We need clear timerQ related structure before exits of the timer thread. + RT2870_TimerQ_Exit(pAd); + // Close kernel threads or tasklets + RT28xxThreadTerminate(pAd); +#endif // RT2870 // + // Stop Mlme state machine MlmeHalt(pAd); @@ -264,7 +321,7 @@ int rt28xx_close(IN PNET_DEV dev) MeasureReqTabExit(pAd); TpcReqTabExit(pAd); - +#ifdef RT2860 if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_INTERRUPT_ACTIVE)) { NICDisableInterrupt(pAd); @@ -280,7 +337,7 @@ int rt28xx_close(IN PNET_DEV dev) RT28XX_IRQ_RELEASE(net_dev) RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_INTERRUPT_IN_USE); } - +#endif // Free Ring or USB buffers RTMPFreeTxRxRingMemory(pAd); @@ -297,7 +354,12 @@ int rt28xx_close(IN PNET_DEV dev) static int rt28xx_init(IN struct net_device *net_dev) { +#ifdef RT2860 PRTMP_ADAPTER pAd = (PRTMP_ADAPTER)net_dev->ml_priv; +#endif +#ifdef RT2870 + PRTMP_ADAPTER pAd = net_dev->ml_priv; +#endif UINT index; UCHAR TmpPhy; NDIS_STATUS Status; @@ -320,11 +382,11 @@ static int rt28xx_init(IN struct net_device *net_dev) } while (index++ < 100); DBGPRINT(RT_DEBUG_TRACE, ("MAC_CSR0 [ Ver:Rev=0x%08x]\n", pAd->MACVersion)); +/*Iverson patch PCIE L1 issue */ // Disable DMA RT28XXDMADisable(pAd); - // Load 8051 firmware Status = NICLoadFirmware(pAd); if (Status != NDIS_STATUS_SUCCESS) @@ -337,10 +399,12 @@ static int rt28xx_init(IN struct net_device *net_dev) // Disable interrupts here which is as soon as possible // This statement should never be true. We might consider to remove it later +#ifdef RT2860 if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_INTERRUPT_ACTIVE)) { NICDisableInterrupt(pAd); } +#endif Status = RTMPAllocTxRxRingMemory(pAd); if (Status != NDIS_STATUS_SUCCESS) @@ -365,6 +429,10 @@ static int rt28xx_init(IN struct net_device *net_dev) // UserCfgInit(pAd); +#ifdef RT2870 + // We need init timerQ related structure before create the timer thread. + RT2870_TimerQ_Init(pAd); +#endif // RT2870 // RT28XX_TASK_THREAD_INIT(pAd, Status); if (Status != NDIS_STATUS_SUCCESS) @@ -398,6 +466,14 @@ static int rt28xx_init(IN struct net_device *net_dev) goto err4; } +#ifdef RT2870 + pAd->CommonCfg.bMultipleIRP = FALSE; + + if (pAd->CommonCfg.bMultipleIRP) + pAd->CommonCfg.NumOfBulkInIRP = RX_RING_SIZE; + else + pAd->CommonCfg.NumOfBulkInIRP = 1; +#endif // RT2870 // //Init Ba Capability parameters. @@ -436,6 +512,11 @@ static int rt28xx_init(IN struct net_device *net_dev) pAd->CommonCfg.HtCapability.MCSSet[1], pAd->CommonCfg.HtCapability.MCSSet[2], pAd->CommonCfg.HtCapability.MCSSet[3], pAd->CommonCfg.HtCapability.MCSSet[4]); +#ifdef RT2870 + //Init RT30xx RFRegisters after read RFIC type from EEPROM + NICInitRT30xxRFRegisters(pAd); +#endif // RT2870 // + #ifdef IKANOS_VX_1X0 VR_IKANOS_FP_Init(pAd->ApCfg.BssidNum, pAd->PermanentAddress); #endif // IKANOS_VX_1X0 // @@ -446,8 +527,10 @@ static int rt28xx_init(IN struct net_device *net_dev) AsicSwitchChannel(pAd, pAd->CommonCfg.Channel, FALSE); AsicLockChannel(pAd, pAd->CommonCfg.Channel); +#ifndef RT30xx // 8051 firmware require the signal during booting time. AsicSendCommandToMcu(pAd, 0x72, 0xFF, 0x00, 0x00); +#endif if (pAd && (Status != NDIS_STATUS_SUCCESS)) { @@ -464,9 +547,24 @@ static int rt28xx_init(IN struct net_device *net_dev) // Microsoft HCT require driver send a disconnect event after driver initialization. OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED); RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_MEDIA_STATE_CHANGE); + DBGPRINT(RT_DEBUG_TRACE, ("NDIS_STATUS_MEDIA_DISCONNECT Event B!\n")); +#ifdef RT2870 + RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_RESET_IN_PROGRESS); + RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_REMOVE_IN_PROGRESS); + + // + // Support multiple BulkIn IRP, + // the value on pAd->CommonCfg.NumOfBulkInIRP may be large than 1. + // + for(index=0; indexCommonCfg.NumOfBulkInIRP; index++) + { + RTUSBBulkReceive(pAd); + DBGPRINT(RT_DEBUG_TRACE, ("RTUSBBulkReceive!\n" )); + } +#endif // RT2870 // }// end of else @@ -565,8 +663,9 @@ int rt28xx_open(IN PNET_DEV dev) printk("0x1300 = %08x\n", reg); } +#ifdef RT2860 RTMPInitPCIeLinkCtrlValue(pAd); - +#endif return (retval); err: @@ -662,8 +761,15 @@ INT __devinit rt28xx_probe( PRTMP_ADAPTER pAd = (PRTMP_ADAPTER) NULL; INT status; PVOID handle; +#ifdef RT2860 struct pci_dev *dev_p = (struct pci_dev *)_dev_p; +#endif +#ifdef RT2870 + struct usb_interface *intf = (struct usb_interface *)_dev_p; + struct usb_device *dev_p = interface_to_usbdev(intf); + dev_p = usb_get_dev(dev_p); +#endif // RT2870 // DBGPRINT(RT_DEBUG_TRACE, ("STA Driver version-%s\n", STA_DRIVER_VERSION)); -- cgit v1.2.3