예제 #1
0
A_STATUS _qcom_p2p_ps_clean_go_schedules(int dev_id)
{
    P2P_DEV_CTX *p2p_dev_ctx = NULL;

    if (dev_id >= gNumDev) {
        return A_ERROR;
    }

    if (A_OK != _qcom_p2p_get_dev_ctx_point(dev_id, &p2p_dev_ctx)) {
        return A_ERROR;
    }

    if (NULL == p2p_dev_ctx)
    {
        return A_ERROR;
    }
    
     if (p2p_dev_ctx->noa_initialized) {
        A_UNTIMEOUT(&p2p_dev_ctx->go_schedules->h_tsftimer);
        p2p_go_schedule_setup(devArray[dev_id], NULL, 0, NULL);
        p2p_dev_ctx->noa.ctwindow = 0;
        p2p_dev_ctx->noa.num_descriptors = 0;
        p2p_dev_ctx->noa_initialized = FALSE;
        p2p_dev_ctx->go_schedules->tsftimer_started = FALSE;
        p2p_dev_ctx->go_schedules->go_present = FALSE;
        p2p_dev_ctx->go_schedules->callback_active = FALSE;
        p2p_dev_ctx->go_schedules->paused = FALSE;
        p2p_dev_ctx->go_schedules->num_schedules = 0;
    }

    return A_OK;
}
예제 #2
0
파일: console.c 프로젝트: dengcj0/QCA4010
static int console_suspend_rx(int argc, A_CHAR *argv[])
{
    Console_info->flags |= CONSOLE_FLAGS_RX_SUSPENDED;
    
    A_UNTIMEOUT(&Console_info->recv_idle_timer);
     
    if (Console_info->flags & CONSOLE_FLAGS_USE_HW_RX_SUSP) {
            /* use hardware based wake mechanism */
        if (!(Console_info->flags & CONSOLE_FLAGS_RX_WAKE_ENABLED)) {   
            Console_info->flags |= CONSOLE_FLAGS_RX_WAKE_ENABLED;
            SERP_Ioctl(Console_info->port,
                       SER_PORT_HW_IOCTL_CONFIG_RX_WAKEUP,
                       NULL,
                       1);
        }
    } else { 
            /* use slow polling mechanism to simulate the rx suspending */
        SERP_Ioctl(Console_info->port,
                   SER_PORT_HW_IOCTL_SET_POLL_INTERVAL,
                   NULL,
                   3); //3 ms is default PollTimeoutMS, better than 10ms
                   //CONSOLE_SLOW_POLL_INTERVAL_MS);
    }
                   
    return 0;    
}
예제 #3
0
void
wlan_node_table_cleanup(struct ieee80211_node_table *nt)
{
    A_UNTIMEOUT(&nt->nt_inact_timer);
    wlan_free_allnodes(nt);
    IEEE80211_NODE_LOCK_DESTROY(nt);
}
예제 #4
0
파일: uartserp.c 프로젝트: dengcj0/QCA4010
USAPI void _StartStopInterruptPolling(UART_DEVICE *pUartDevice, A_BOOL Start)
{
    if (Start) {
        if (!pUartDevice->TimerQueued) {
            pUartDevice->TimerQueued = TRUE;
            A_TIMEOUT_MS(&pUartDevice->PollingTimer,pUartDevice->PollTimeoutMS,0);        
        }   
    } else {
        if (pUartDevice->TimerQueued) {
            pUartDevice->TimerQueued = FALSE;
            A_UNTIMEOUT(&pUartDevice->PollingTimer);    
        } 
    }
}
예제 #5
0
void
CAR6KMini::WMIMicErrEvent(
    A_UINT8 keyid,
    A_BOOL isMcast)
{
   if (m_networkType == AP_NETWORK)
   {
        car6k_ap_mic_event (keyid, isMcast);
        return;
   }
    struct ar6kAuthIndication {
        NDIS_802_11_STATUS_INDICATION         ind;
        NDIS_802_11_AUTHENTICATION_REQUEST    req;
    } ar6kAuthEvent;

    ar6kAuthEvent.ind.StatusType = Ndis802_11StatusType_Authentication;
    if (isMcast) {
        ar6kAuthEvent.req.Flags = NDIS_802_11_AUTH_REQUEST_GROUP_ERROR;
    } else {
        ar6kAuthEvent.req.Flags = NDIS_802_11_AUTH_REQUEST_PAIRWISE_ERROR;
    }

    memcpy(&ar6kAuthEvent.req.Bssid[0], m_PeerBSSID, ETHERNET_MAC_ADDRESS_LENGTH);
    ar6kAuthEvent.req.Length = sizeof(NDIS_802_11_AUTHENTICATION_REQUEST);

    m_MicErrorCount++;

    if(m_MicErrorCount >= MAX_MIC_ERRORS)
    {
        m_CounterMeasureOn = TRUE;
        A_UNTIMEOUT (&m_CounterMeasureEnterTimer);
    }
    else
    {
        A_TIMEOUT_MS(&m_CounterMeasureEnterTimer, MIC_ERROR_TIMEOUT_MSEC, 0);
    }

    NdisMIndicateStatus(m_MiniportAdapterHandle,
                        NDIS_STATUS_MEDIA_SPECIFIC_INDICATION,
                        &ar6kAuthEvent, sizeof(ar6kAuthEvent));
    NdisMIndicateStatusComplete(m_MiniportAdapterHandle);

    return;
}
예제 #6
0
파일: console.c 프로젝트: dengcj0/QCA4010
LOCAL void schedule_console_idle_recv_timer(void)
{
    A_UNTIMEOUT(&Console_info->recv_idle_timer);
    A_TIMEOUT_MS(&Console_info->recv_idle_timer,Console_info->config.idle_timeout_ms,FALSE);
}
예제 #7
0
void
CAR6KMini::WMIDisconnectIndication(A_UINT8 reason)
{
#ifdef NO_BCAST_PROBE_IN_CONNECT
    wmi_probedSsid_cmd((struct wmi_t *)m_pWMI, 0, ANY_SSID_FLAG, 0,NULL);
#endif
    do
    {
        //
        // Ignore pyxis specific reason during IEEE Mode
        //
        if (m_Connected)
        {
            if (reason == NO_NETWORK_AVAIL)
            {
                // remove the current associated bssid node
                wmi_free_node ((wmi_t *)m_pWMI, m_PeerBSSID);

                //
                // In case any other same SSID nodes are present
                // remove it, since those nodes also not available now
                //
                IterateNodeAndRemoveSSID (&m_SSID);

                SendWMIDisconnectCommand ();
            }

            // Flush any pending NDIS packets
            FlushNdisPacketTransmitQueue();

#ifdef OS_ROAM_MANAGEMENT
        if (FALSE == m_osRoamControl)
        {
#endif
        m_RSSIlevel = 0;
        if (m_Config.hostAssistedRoaming)
        {
            A_UNTIMEOUT(&m_rssiScanTimer);
        }
            NdisMIndicateStatus(m_MiniportAdapterHandle, NDIS_STATUS_MEDIA_DISCONNECT, 0, 0);
        NdisMIndicateStatusComplete(m_MiniportAdapterHandle);
#ifdef OS_ROAM_MANAGEMENT
        }
        else
        {
            A_UNTIMEOUT(&m_disconnectIndicationTimer);
            A_TIMEOUT_MS(&m_disconnectIndicationTimer, m_Config.discTimeout*1000, 0);
        }
#endif
        //
        // Reset Chanel and BSSID info
        //
        m_Connected         = FALSE;
        m_ChannelHint       = 0;
        m_ConnectedChannel  = 0;
        memset (m_PeerBSSID, 0, ETHERNET_MAC_ADDRESS_LENGTH);
    }

    if (m_bIsSwitchAPtoSTA)
    {
        m_bIsSwitchAPtoSTA = FALSE;
        NdisMIndicateStatus(m_MiniportAdapterHandle, NDIS_STATUS_MEDIA_DISCONNECT, 0, 0);
        NdisMIndicateStatusComplete(m_MiniportAdapterHandle);
       //     configTargetParams();
        m_WantToBeConnected = TRUE;
    }


        {
            //
            // no need to send WMIConnect when target reply disconnect
            // reason other than DISCONNECT_CMD
            //
            if (DISCONNECT_CMD == reason)
            {
                m_ConnectInProgress = FALSE;
                if (m_WantToBeConnected)
                {
                    SendWMIConnectCommand (&m_SSID);
                }
            }
        }

    } while (FALSE);

    NdisSetEvent (&m_SuspendEvent);
}
예제 #8
0
void
CAR6KMini::WMIConnectIndication(
    IN USHORT Channel,
    IN PBYTE  PeerBSSID,
    IN USHORT listenInterval,
    IN BYTE   assocReqLen,
    IN BYTE   assocRespLen,
    IN PBYTE  assocInfo,
    IN BYTE   beaconIeLen,
    IN USHORT beaconInterval,
    NETWORK_TYPE networkType)
{
    BYTE        len = 0;
    int         i = 0;
    PBYTE       pAssocReq;
    PBYTE       pAssocReqEnd;
    PBYTE       pBeaconIE;
    BYTE        byKeyType = 0;
#ifdef OS_ROAM_MANAGEMENT
    A_UNTIMEOUT(&m_disconnectIndicationTimer);
#endif
#ifdef NO_BCAST_PROBE_IN_CONNECT
    wmi_probedSsid_cmd((struct wmi_t *)m_pWMI, 0, ANY_SSID_FLAG, 0,NULL);
#endif


    memcpy(m_PeerBSSID, PeerBSSID, ETHERNET_MAC_ADDRESS_LENGTH);
    m_ConnectedChannel      = Channel;
    m_ConnectInProgress     = FALSE;
    m_AssocReqLen           = assocReqLen;
    m_AssocRespLen          = assocRespLen;
    m_BeaconIeLen           = beaconIeLen;
    m_BeaconInterval        = beaconInterval;
    m_WantToBeConnected     = FALSE;

    if (m_pAssocInfo != NULL) {
        A_FREE(m_pAssocInfo);
    }

    m_pAssocInfo = (PBYTE)A_MALLOC(m_AssocReqLen + m_AssocRespLen + m_BeaconIeLen);

    if (m_pAssocInfo)
    {
        memcpy(m_pAssocInfo, assocInfo, m_AssocReqLen + m_AssocRespLen + m_BeaconIeLen);

        //Get network type in use
        if (m_ConnectedChannel >= 2412 && m_ConnectedChannel <= 2484) {
            PBYTE pAssocRsp = m_pAssocInfo + m_BeaconIeLen + m_AssocReqLen;
            PBYTE pAssocRspEnd = pAssocRsp + m_AssocRespLen;

            m_NetworkTypeInUse = Ndis802_11DS;

            //Skip capability, status code and assoc. ID
            pAssocRsp += 6;
            if ((pAssocRsp + 2) < pAssocRspEnd && IEEE80211_ELEMID_RATES == pAssocRsp[0]) {
                pAssocRsp += (pAssocRsp[1] + 2);
                if ((pAssocRsp + 2) < pAssocRspEnd && IEEE80211_ELEMID_XRATES == pAssocRsp[0]) {
                    m_NetworkTypeInUse = Ndis802_11OFDM24;
                }
            }
        }
        else {
            m_NetworkTypeInUse = Ndis802_11OFDM5;
        }

        // Update the group wise crypto type from the ie info
    #define RSN_MULTICAST_CIPHER_OFFSET 7
    #define WPA_MULTICAST_CIPHER_OFFSET 11
        pBeaconIE = m_pAssocInfo;
        if (m_BeaconIeLen) {
            if ((m_AuthenticationMode == Ndis802_11AuthModeWPA2) ||
                (m_AuthenticationMode == Ndis802_11AuthModeWPA2PSK))
            {
                if (m_BeaconIeLen <= RSN_MULTICAST_CIPHER_OFFSET) {
                    // Default to AES if cipher suite not present
                    m_GrpwiseCryptoType = AES_CRYPT;
                } else {
                    byKeyType = *(pBeaconIE + RSN_MULTICAST_CIPHER_OFFSET);
                    switch (byKeyType)
                    {
                        case RSN_CSE_WEP40:
                        case RSN_CSE_WEP104:
                            m_GrpwiseCryptoType = WEP_CRYPT;
                            break;
                        case RSN_CSE_TKIP:
                            m_GrpwiseCryptoType = TKIP_CRYPT;
                            break;
                        case RSN_CSE_CCMP:
                            m_GrpwiseCryptoType = AES_CRYPT;
                            break;
                    }
                }
            } else
                if ((m_AuthenticationMode == Ndis802_11AuthModeWPA) ||
                    (m_AuthenticationMode == Ndis802_11AuthModeWPAPSK))
            {
                if (m_BeaconIeLen <= WPA_MULTICAST_CIPHER_OFFSET) {
                    // Default to TKIP if cipher suite not present
                    m_GrpwiseCryptoType = TKIP_CRYPT;
                } else {
                    byKeyType = *(pBeaconIE + WPA_MULTICAST_CIPHER_OFFSET);
                    switch (byKeyType)
                    {
                        case WPA_CSE_WEP40:
                        case WPA_CSE_WEP104:
                            m_GrpwiseCryptoType = WEP_CRYPT;
                            break;
                        case WPA_CSE_TKIP:
                            m_GrpwiseCryptoType = TKIP_CRYPT;
                            break;
                        case WPA_CSE_CCMP:
                            m_GrpwiseCryptoType = AES_CRYPT;
                            break;
                    }
                }
            }
        }

        // Get supported basic rates
        pAssocReq = m_pAssocInfo + m_BeaconIeLen;
        pAssocReqEnd = pAssocReq + m_AssocReqLen;

        // skip capability and listen interval
        pAssocReq += 4;

        if (((pAssocReq + 2) < pAssocReqEnd) &&
            (IEEE80211_ELEMID_SSID == pAssocReq[0]))
        {
            // Skip SSID
            pAssocReq += (pAssocReq[1] + 2);
            if ((pAssocReq + 2) < pAssocReqEnd &&
                IEEE80211_ELEMID_RATES == pAssocReq[0] &&
                (pAssocReq + pAssocReq[1] + 2) <= pAssocReqEnd)
            {
                // Get rates
                memset (m_pSupportedRates, 0, sizeof(NDIS_802_11_RATES));
                memcpy(m_pSupportedRates, &pAssocReq[2],
                      (pAssocReq[1] < sizeof(NDIS_802_11_RATES)) ? pAssocReq[1] : sizeof(NDIS_802_11_RATES));
            }
        }

    }

#ifdef OS_ROAM_MANAGEMENT
    m_RateInfo.TxDataFrames = 0;
    m_RateInfo.RxDataFrames = 0;
#endif

    // Indicate MEDIA_CONNECT to Ndis

    ConnectIndicationPostProc ();
    if (networkType == INFRA_NETWORK){
        m_Connected         = TRUE;
        m_ConnectInProgress = FALSE;
        NdisMIndicateStatus (m_MiniportAdapterHandle, NDIS_STATUS_MEDIA_CONNECT, 0, 0);
        NdisMIndicateStatusComplete (m_MiniportAdapterHandle);
    }else{
        m_Connected = FALSE;
    }
    m_RSSIlevel = 0;
    if (m_Config.hostAssistedRoaming)
    {
        A_UNTIMEOUT(&m_rssiScanTimer);
        A_TIMEOUT_MS(&m_rssiScanTimer, 1000, 0);
    }

    return;
}