Exemple #1
0
/*
 * Terminate continuous transmit operation.
 */
static void
tx99_stop(struct ath_softc *sc, int flag)
{
    struct ath_tx99 *tx99 = sc->sc_tx99;
    struct ieee80211com *ic = (struct ieee80211com *)sc->sc_ieee;
	
#ifdef ATH_SUPPORT_HTC
    struct ath_hal *ah = sc->sc_ah;
#endif
    if (tx99->tx99_state == 0)
        return;
	
    if(tx99->wbuf) {		
        DPRINTF(sc, ATH_DEBUG_TX99, "%s: release wbuf!\n", __func__);
        wbuf_release(sc->sc_osdev, tx99->wbuf);	
        tx99->wbuf = NULL;
	}
	
#ifdef ATH_SUPPORT_HTC
    ah_tx99_stop(ah);
	
    ic->ic_reset_start(ic,0);
    ic->ic_reset(ic);
    ic->ic_reset_end(ic,0);
#else
    ath_tx99_tgt_stop(sc);	
    ic->ic_reset(ic);
#endif
	
    tx99->tx99_state = 0;	
    DPRINTF(sc, ATH_DEBUG_TX99, "%s: continuous transmit stopped!\n", __func__);
}
Exemple #2
0
/*
 * callback hadlers: Action frames TX Complete.
 */
void
ath_action_tx_event(void *Context, int8_t tx_status)
{
    struct ath_softc_net80211 *scn = (struct ath_softc_net80211 *)Context;
    struct ath_usb_p2p_action_queue *p2p_action_wbuf;

    IEEE80211_STATE_P2P_ACTION_LOCK_IRQ(scn);
    if (scn->sc_p2p_action_queue_head) {
        ieee80211_vap_complete_buf_handler handler;
        void *arg;
        wbuf_t wbuf;

        p2p_action_wbuf = scn->sc_p2p_action_queue_head;
        if (scn->sc_p2p_action_queue_head == scn->sc_p2p_action_queue_tail) {
            scn->sc_p2p_action_queue_head = scn->sc_p2p_action_queue_tail = NULL;
        } else {
            scn->sc_p2p_action_queue_head = scn->sc_p2p_action_queue_head->next;
        }

        wbuf = p2p_action_wbuf->wbuf;
        if (!p2p_action_wbuf->deleted) {
            wbuf_get_complete_handler(wbuf,(void **)&handler, &arg);
            if (handler) {
                struct ieee80211_node *ni = wbuf_get_node(wbuf);
                struct ieee80211_frame *wh = (struct ieee80211_frame *)wbuf_header(wbuf);
                wlan_if_t vap = ni->ni_vap;
                struct ieee80211_tx_status ts;

                ts.ts_flags = tx_status;
                ts.ts_retries = 0;
                handler(vap, wbuf, arg, wh->i_addr1, wh->i_addr2, wh->i_addr3, &ts);
            }
        } else {
#ifndef MAGPIE_HIF_GMAC 
            printk("### action frame %p marked as deleted\n", wbuf);
#endif        
        }
        wbuf_release(scn->sc_osdev, p2p_action_wbuf->wbuf);
        OS_FREE(p2p_action_wbuf);

        //printk("### %s (%d) : Action TX EVENT DONE...\n", __FUNCTION__, __LINE__);
    }
    IEEE80211_STATE_P2P_ACTION_UNLOCK_IRQ(scn);
}
Exemple #3
0
static void *perform(void *arg)
{
	char *wb = (char*)arg;
	char bufin[4096];
	char bufout[4096];
	char *op;
	int i;
	long long int me = (long long int)pthread_self();

	for (i = 0; i < sizeof(bufin); i++)
		bufin[i] = i;
	memcpy(bufin, &me, sizeof(long long int));
	memcpy(bufout, bufin, sizeof(bufin));

	for (i = 0; i < 1000000; i++)
	{
		int tries = 0;
		int index = wbuf_put(NPAGES, wb, bufin, &tries);
		op = wbuf_get(NPAGES, wb, index);
		memcpy(bufout, op, sizeof(bufout));
		wbuf_release(wb, index);

		if (memcmp(bufin, bufout, sizeof(bufin)) != 0)
		{
			printf("ERROR! %d\n", i);
			exit(1);
		}
		// if (tries > 10)
			// printf("%lld, i=%d, tries=%d, index=%d\n",me, i, tries, index);

		// if ((i % 10000) == 0)
		// 	printf("%lld, i=%d, tries=%d, index=%d\n",me, i, tries, index);
	}

	return NULL;
}