コード例 #1
0
int
uf_sme_init(unifi_priv_t *priv)
{
    int i;

    priv->smepriv = priv;

    init_waitqueue_head(&priv->sme_request_wq);

#ifdef CSR_SUPPORT_WEXT
    priv->ignore_bssid_join = FALSE;
    priv->mib_data.length = 0;

    priv->filter_tclas_ies = NULL;
    memset(&priv->packet_filters, 0, sizeof(uf_cfg_bcast_packet_filter_t));

    uf_sme_wext_set_defaults(priv);
#endif /* CSR_SUPPORT_WEXT*/

    priv->sta_ip_address = 0xFFFFFFFF;

    memset(&priv->controlled_data_port, 0, sizeof(unifi_port_config_t));
    priv->controlled_data_port.entries_in_use = 1;
    priv->controlled_data_port.overide_action = UF_DATA_PORT_OVERIDE;
    priv->controlled_data_port.port_cfg[0].port_action = unifi_8021xPortClosedDiscard;

    memset(&priv->controlled_data_port, 0, sizeof(unifi_port_config_t));
    priv->uncontrolled_data_port.entries_in_use = 1;
    priv->uncontrolled_data_port.overide_action = UF_DATA_PORT_OVERIDE;
    priv->uncontrolled_data_port.port_cfg[0].port_action = unifi_8021xPortClosedDiscard;

    priv->m4_monitor_state = m4_idle;
    priv->m4_bulk_data.net_buf_length = 0;
    priv->m4_bulk_data.data_length = 0;
    priv->m4_bulk_data.os_data_ptr = priv->m4_bulk_data.os_net_buf_ptr = NULL;

    priv->wifi_on_state = wifi_on_unspecified;

    sema_init(&priv->sme_sem, 1);
    memset(&priv->sme_reply, 0, sizeof(sme_reply_t));

    priv->ta_ind_work.in_use = 0;
    priv->ta_sample_ind_work.in_use = 0;

    for (i = 0; i < MAX_MA_UNIDATA_IND_FILTERS; i++) {
        priv->sme_unidata_ind_filters[i].in_use = 0;
    }

    /* Create a work queue item for Traffic Analysis indications to SME */
    INIT_WORK(&priv->ta_ind_work.task, uf_ta_ind_wq);
    INIT_WORK(&priv->ta_sample_ind_work.task, uf_ta_sample_ind_wq);
#ifdef CSR_SUPPORT_WEXT
    INIT_WORK(&priv->sme_config_task, uf_sme_config_wq);
#endif

    return 0;
} /* uf_sme_init() */
コード例 #2
0
ファイル: sme_userspace.c プロジェクト: wpwrak/ben-wpan-linux
int
uf_sme_init(unifi_priv_t *priv)
{
    int i, j;

    CsrWifiRouterTransportInit(priv);

    priv->smepriv = priv;

    init_waitqueue_head(&priv->sme_request_wq);

    priv->filter_tclas_ies = NULL;
    memset(&priv->packet_filters, 0, sizeof(uf_cfg_bcast_packet_filter_t));

#ifdef CSR_SUPPORT_WEXT
    priv->ignore_bssid_join = FALSE;
    priv->mib_data.length = 0;

    uf_sme_wext_set_defaults(priv);
#endif /* CSR_SUPPORT_WEXT*/

    priv->sta_ip_address = 0xFFFFFFFF;

    priv->wifi_on_state = wifi_on_unspecified;

    sema_init(&priv->sme_sem, 1);
    memset(&priv->sme_reply, 0, sizeof(sme_reply_t));

    priv->ta_ind_work.in_use = 0;
    priv->ta_sample_ind_work.in_use = 0;

    priv->CSR_WIFI_SME_IFACEQUEUE = 0xFFFF;

    for (i = 0; i < MAX_MA_UNIDATA_IND_FILTERS; i++) {
        priv->sme_unidata_ind_filters[i].in_use = 0;
    }

    /* Create a work queue item for Traffic Analysis indications to SME */
    INIT_WORK(&priv->ta_ind_work.task, uf_ta_ind_wq);
    INIT_WORK(&priv->ta_sample_ind_work.task, uf_ta_sample_ind_wq);
#ifdef CSR_SUPPORT_WEXT
    INIT_WORK(&priv->sme_config_task, uf_sme_config_wq);
#endif

    for (i = 0; i < CSR_WIFI_NUM_INTERFACES; i++) {
        netInterface_priv_t *interfacePriv = priv->interfacePriv[i];
        interfacePriv->m4_sent = FALSE;
        interfacePriv->m4_bulk_data.net_buf_length = 0;
        interfacePriv->m4_bulk_data.data_length = 0;
        interfacePriv->m4_bulk_data.os_data_ptr = interfacePriv->m4_bulk_data.os_net_buf_ptr = NULL;

        memset(&interfacePriv->controlled_data_port, 0, sizeof(unifi_port_config_t));
        interfacePriv->controlled_data_port.entries_in_use = 1;
        interfacePriv->controlled_data_port.port_cfg[0].in_use = TRUE;
        interfacePriv->controlled_data_port.port_cfg[0].port_action = CSR_WIFI_ROUTER_CTRL_PORT_ACTION_8021X_PORT_CLOSED_DISCARD;
        interfacePriv->controlled_data_port.overide_action = UF_DATA_PORT_OVERIDE;

        memset(&interfacePriv->uncontrolled_data_port, 0, sizeof(unifi_port_config_t));
        interfacePriv->uncontrolled_data_port.entries_in_use = 1;
        interfacePriv->uncontrolled_data_port.port_cfg[0].in_use = TRUE;
        interfacePriv->uncontrolled_data_port.port_cfg[0].port_action = CSR_WIFI_ROUTER_CTRL_PORT_ACTION_8021X_PORT_CLOSED_DISCARD;
        interfacePriv->uncontrolled_data_port.overide_action = UF_DATA_PORT_OVERIDE;

        /* Mark the remainder of the port config table as unallocated */
        for(j = 1; j < UNIFI_MAX_CONNECTIONS; j++) {
            interfacePriv->controlled_data_port.port_cfg[j].in_use = FALSE;
            interfacePriv->controlled_data_port.port_cfg[j].port_action = CSR_WIFI_ROUTER_CTRL_PORT_ACTION_8021X_PORT_CLOSED_DISCARD;

            interfacePriv->uncontrolled_data_port.port_cfg[j].in_use = FALSE;
            interfacePriv->uncontrolled_data_port.port_cfg[j].port_action = CSR_WIFI_ROUTER_CTRL_PORT_ACTION_8021X_PORT_CLOSED_DISCARD;
        }

        /* intializing the lists */
        INIT_LIST_HEAD(&interfacePriv->genericMgtFrames);
        INIT_LIST_HEAD(&interfacePriv->genericMulticastOrBroadCastMgtFrames);
        INIT_LIST_HEAD(&interfacePriv->genericMulticastOrBroadCastFrames);

        for(j = 0; j < UNIFI_MAX_CONNECTIONS; j++) {
            interfacePriv->staInfo[j] = NULL;
        }

        interfacePriv->num_stations_joined = 0;
        interfacePriv->sta_activity_check_enabled = FALSE;
    }


    return 0;
} /* uf_sme_init() */