Beispiel #1
0
static void
tdma_beacon_miss(struct ieee80211vap *vap)
{
	struct ieee80211_tdma_state *ts = vap->iv_tdma;

	IEEE80211_LOCK_ASSERT(vap->iv_ic);

	KASSERT((vap->iv_ic->ic_flags & IEEE80211_F_SCAN) == 0, ("scanning"));
	KASSERT(vap->iv_state == IEEE80211_S_RUN,
	    ("wrong state %d", vap->iv_state));

	IEEE80211_DPRINTF(vap,
		IEEE80211_MSG_STATE | IEEE80211_MSG_TDMA | IEEE80211_MSG_DEBUG,
		"beacon miss, mode %u state %s\n",
		vap->iv_opmode, ieee80211_state_name[vap->iv_state]);

	callout_stop(&vap->iv_swbmiss);

	if (ts->tdma_peer != NULL) {	/* XXX? can this be null? */
		ieee80211_notify_node_leave(vap->iv_bss);
		ts->tdma_peer = NULL;
		/*
		 * Treat beacon miss like an associate failure wrt the
		 * scan policy; this forces the entry in the scan cache
		 * to be ignored after several tries.
		 */
		ieee80211_scan_assoc_fail(vap, vap->iv_bss->ni_macaddr,
		    IEEE80211_STATUS_TIMEOUT);
	}
#if 0
	ts->tdma_inuse = 0;		/* clear slot usage */
#endif
	ieee80211_new_state(vap, IEEE80211_S_SCAN, 0);
}
Beispiel #2
0
static int 
adb_kbd_detach(device_t dev) 
{
	struct adb_kbd_softc *sc;
	keyboard_t *kbd;

	sc = device_get_softc(dev);

	adb_set_autopoll(dev,0);
	callout_stop(&sc->sc_repeater);

	mtx_lock(&sc->sc_mutex);

	kbd = kbd_get_keyboard(kbd_find_keyboard(KBD_DRIVER_NAME,
	          device_get_unit(dev)));

	kbdd_disable(kbd);

#ifdef KBD_INSTALL_CDEV
	kbd_detach(kbd);
#endif

	kbdd_term(kbd);

	mtx_unlock(&sc->sc_mutex);

	mtx_destroy(&sc->sc_mutex);
	cv_destroy(&sc->sc_cv);

	return (0);
}
Beispiel #3
0
void
hpcfb_refresh_screen(struct hpcfb_softc *sc)
{
	struct hpcfb_devconfig *dc = sc->sc_dc;
	int x, y;

	DPRINTF(("hpcfb_refres_screen()\n"));
	if (dc == NULL)
		return;

#ifdef HPCFB_JUMP
	if (dc->dc_state&HPCFB_DC_SCROLLPENDING) {
		dc->dc_state &= ~HPCFB_DC_SCROLLPENDING;
		dc->dc_state &= ~HPCFB_DC_UPDATE;
		callout_stop(&dc->dc_scroll_ch);
	}
#endif /* HPCFB_JUMP */
	/*
	 * refresh screen
	 */
	dc->dc_state &= ~HPCFB_DC_UPDATEALL;
	x = dc->dc_curx;
	y = dc->dc_cury;
	if (0 <= x && 0 <= y)
		hpcfb_cursor_raw(dc, 0,  y, x); /* disable cursor */
	/* redraw all text */
	hpcfb_redraw(dc, 0, dc->dc_rows, 1);
	if (0 <= x && 0 <= y)
		hpcfb_cursor_raw(dc, 1,  y, x); /* enable cursor */
}
Beispiel #4
0
static int
at91_udp_detach(device_t dev)
{
	struct at91_udp_softc *sc = device_get_softc(dev);
	device_t bdev;
	int err;

	if (sc->sc_dci.sc_bus.bdev) {
		bdev = sc->sc_dci.sc_bus.bdev;
		device_detach(bdev);
		device_delete_child(dev, bdev);
	}
	/* during module unload there are lots of children leftover */
	device_delete_children(dev);

	USB_BUS_LOCK(&sc->sc_dci.sc_bus);
	callout_stop(&sc->sc_vbus);
	USB_BUS_UNLOCK(&sc->sc_dci.sc_bus);

	callout_drain(&sc->sc_vbus);

	/* disable Transceiver */
	AT91_UDP_WRITE_4(&sc->sc_dci, AT91_UDP_TXVC, AT91_UDP_TXVC_DIS);

	/* disable and clear all interrupts */
	AT91_UDP_WRITE_4(&sc->sc_dci, AT91_UDP_IDR, 0xFFFFFFFF);
	AT91_UDP_WRITE_4(&sc->sc_dci, AT91_UDP_ICR, 0xFFFFFFFF);

	if (sc->sc_dci.sc_irq_res && sc->sc_dci.sc_intr_hdl) {
		/*
		 * only call at91_udp_uninit() after at91_udp_init()
		 */
		at91dci_uninit(&sc->sc_dci);

		err = bus_teardown_intr(dev, sc->sc_dci.sc_irq_res,
		    sc->sc_dci.sc_intr_hdl);
		sc->sc_dci.sc_intr_hdl = NULL;
	}
	if (sc->sc_dci.sc_irq_res) {
		bus_release_resource(dev, SYS_RES_IRQ, 0,
		    sc->sc_dci.sc_irq_res);
		sc->sc_dci.sc_irq_res = NULL;
	}
	if (sc->sc_dci.sc_io_res) {
		bus_release_resource(dev, SYS_RES_MEMORY, MEM_RID,
		    sc->sc_dci.sc_io_res);
		sc->sc_dci.sc_io_res = NULL;
	}
	usb_bus_mem_free_all(&sc->sc_dci.sc_bus, NULL);

	/* disable clocks */
	at91_pmc_clock_disable(sc->sc_iclk);
	at91_pmc_clock_disable(sc->sc_fclk);
	at91_pmc_clock_disable(sc->sc_mclk);
	at91_pmc_clock_deref(sc->sc_fclk);
	at91_pmc_clock_deref(sc->sc_iclk);
	at91_pmc_clock_deref(sc->sc_mclk);

	return (0);
}
Beispiel #5
0
void
wskbd_input(device_t dev, u_int type, int value)
{
	struct wskbd_softc *sc = device_private(dev);
#if NWSDISPLAY > 0
	int num, i;
#endif

	if (sc->sc_repeating) {
		sc->sc_repeating = 0;
		callout_stop(&sc->sc_repeat_ch);
	}

	device_active(dev, DVA_HARDWARE);

#if NWSDISPLAY > 0
	/*
	 * If /dev/wskbdN is not connected in event mode translate and
	 * send upstream.
	 */
	if (sc->sc_translating) {
		num = wskbd_translate(sc->id, type, value);
		if (num > 0) {
			if (sc->sc_base.me_dispdv != NULL) {
#ifdef WSDISPLAY_SCROLLSUPPORT
				if (sc->id->t_symbols [0] != KS_Print_Screen) {
					wsdisplay_scroll(sc->sc_base.
					me_dispdv, WSDISPLAY_SCROLL_RESET);
				}
#endif
				for (i = 0; i < num; i++)
					wsdisplay_kbdinput(
						sc->sc_base.me_dispdv,
						sc->id->t_symbols[i]);
			}

			if (sc->sc_keyrepeat_data.del1 != 0) {
				sc->sc_repeating = num;
				callout_schedule(&sc->sc_repeat_ch,
				    mstohz(sc->sc_keyrepeat_data.del1));
			}
		}
		return;
	}
#endif

	wskbd_deliver_event(sc, type, value);

#if defined(WSKBD_EVENT_AUTOREPEAT)
	/* Repeat key presses if set. */
	if (type == WSCONS_EVENT_KEY_DOWN && sc->sc_keyrepeat_data.del1 != 0) {
		sc->sc_repeat_type = type;
		sc->sc_repeat_value = value;
		sc->sc_repeating = 1;
		callout_schedule(&sc->sc_repeat_ch,
		    mstohz(sc->sc_keyrepeat_data.del1));
	}
#endif /* defined(WSKBD_EVENT_AUTOREPEAT) */
}
Beispiel #6
0
void
ath_rate_detach(struct ath_ratectrl *arc)
{
	struct onoe_softc *osc = (struct onoe_softc *) arc;

	callout_stop(&osc->timer);
	free(osc, M_DEVBUF);
}
Beispiel #7
0
static void
btn_guard_timeout(void *arg)
{
	struct btn_obio_softc *sc = arg;

	callout_stop(&sc->sc_guard_ch);
	extintr_enable(sc->sc_ih);
}
Beispiel #8
0
static void
bvm_tty_close(struct tty *tp)
{

	tty_lock(tp);
	callout_stop(&bvm_timer);
	tty_unlock(tp);
}
bool
spic_suspend(device_t dev, const pmf_qual_t *qual)
{
	struct spic_softc *sc = device_private(dev);

	callout_stop(&sc->sc_poll);

	return true;
}
Beispiel #10
0
void
hwmp_vdetach(struct ieee80211vap *vap)
{
	struct ieee80211_hwmp_state *hs = vap->iv_hwmp;

	callout_stop(&hs->hs_roottimer);
	kfree(vap->iv_hwmp, M_80211_VAP);
	vap->iv_hwmp = NULL;
} 
Beispiel #11
0
/**
 * @brief This callback method asks the user to stop the supplied timer.
 *
 * @param[in]  controller This parameter specifies the controller with
 *             which this timer is to associated.
 * @param[in]  timer This parameter specifies the timer to be stopped.
 *
 * @return none
 */
void
scif_cb_timer_stop(SCI_CONTROLLER_HANDLE_T controller, void *timer)
{
    struct ISCI_TIMER *isci_timer = (struct ISCI_TIMER *)timer;

    isci_log_message(3, "TIMER", "stop %p\n", timer);
    isci_timer->is_started = FALSE;
    callout_stop(&isci_timer->callout);
}
Beispiel #12
0
static void
pie_EventTimeout(void *arg)
{
	struct pipe *dp = arg;
	struct septum *st = &dp->septum;

	callout_stop(dp->wrk, &st->co);
	PIE_Wakeup(dp);
}
Beispiel #13
0
/*ARGSUSED*/
static	int
logclose(struct dev_close_args *ap)
{
	log_open = 0;
	callout_stop(&logsoftc.sc_callout);
	logsoftc.sc_state = 0;
	funsetown(&logsoftc.sc_sigio);
	return (0);
}
Beispiel #14
0
static bool
aps_suspend(device_t dv PMF_FN_ARGS)
{
	struct aps_softc *sc = device_private(dv);

	callout_stop(&sc->sc_callout);

	return true;
}
Beispiel #15
0
void
tws_cmd_complete(struct tws_request *req)
{
    struct tws_softc *sc = req->sc;

    callout_stop(req->ccb_ptr->ccb_h.timeout_ch);
    tws_unmap_request(sc, req);

}
Beispiel #16
0
static void
pdq_ifstop(pdq_softc_t *sc)
{

    PDQ_IFNET(sc)->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE);
    sc->sc_pdq->pdq_flags &= ~PDQ_RUNNING;
    pdq_stop(sc->sc_pdq);
    callout_stop(&sc->watchdog);
}
Beispiel #17
0
/*
 * sysmon_wdog_setmode:
 *
 *	Set the mode of a watchdog device.
 */
int
sysmon_wdog_setmode(struct sysmon_wdog *smw, int mode, u_int period)
{
	u_int operiod = smw->smw_period;
	int omode = smw->smw_mode;
	int error = 0;

	smw->smw_period = period;
	smw->smw_mode = mode;

	switch (mode & WDOG_MODE_MASK) {
	case WDOG_MODE_DISARMED:
		if (smw != sysmon_armed_wdog) {
			error = EINVAL;
			goto out;
		}
		break;

	case WDOG_MODE_KTICKLE:
	case WDOG_MODE_UTICKLE:
		if (sysmon_armed_wdog != NULL) {
			error = EBUSY;
			goto out;
		}
		break;

	default:
		error = EINVAL;
		goto out;
	}

	error = (*smw->smw_setmode)(smw);

 out:
	if (error) {
		smw->smw_period = operiod;
		smw->smw_mode = omode;
	} else {
		if ((mode & WDOG_MODE_MASK) == WDOG_MODE_DISARMED) {
			sysmon_armed_wdog = NULL;
			smw->smw_tickler = (pid_t) -1;
			smw->smw_refcnt--;
			if ((omode & WDOG_MODE_MASK) == WDOG_MODE_KTICKLE)
				callout_stop(&sysmon_wdog_callout);
		} else {
			sysmon_armed_wdog = smw;
			smw->smw_refcnt++;
			if ((mode & WDOG_MODE_MASK) == WDOG_MODE_KTICKLE) {
				callout_reset(&sysmon_wdog_callout,
				    WDOG_PERIOD_TO_TICKS(smw->smw_period) / 2,
				    sysmon_wdog_ktickle, NULL);
			}
		}
	}
	return (error);
}
/**
 * mrsas_cmd_done:           Perform remaining command completion 
 * input:                    Adapter instance soft state  
 *                           Pointer to command packet 
 *
 * This function calls ummap request and releases the MPT command. 
 */
void mrsas_cmd_done(struct mrsas_softc *sc, struct mrsas_mpt_cmd *cmd)
{
    callout_stop(&cmd->cm_callout);
    mrsas_unmap_request(sc, cmd);
    lockmgr(&sc->sim_lock, LK_EXCLUSIVE);
    xpt_done(cmd->ccb_ptr);
    cmd->ccb_ptr = NULL;
    lockmgr(&sc->sim_lock, LK_RELEASE);
    mrsas_release_mpt_cmd(cmd);
}
Beispiel #19
0
static bool
wskbd_suspend(device_t dv, const pmf_qual_t *qual)
{
	struct wskbd_softc *sc = device_private(dv);

	sc->sc_repeating = 0;
	callout_stop(&sc->sc_repeat_ch);

	return true;
}
Beispiel #20
0
/**
 * mrsas_cmd_done:           Perform remaining command completion 
 * input:                    Adapter instance soft state  
 *                           Pointer to command packet 
 *
 * This function calls ummap request and releases the MPT command. 
 */
void mrsas_cmd_done(struct mrsas_softc *sc, struct mrsas_mpt_cmd *cmd)
{
    callout_stop(&cmd->cm_callout);
    mrsas_unmap_request(sc, cmd);
    mtx_lock(&sc->sim_lock);
    xpt_done(cmd->ccb_ptr);
    cmd->ccb_ptr = NULL;
    mtx_unlock(&sc->sim_lock);
    mrsas_release_mpt_cmd(cmd);
}
Beispiel #21
0
int
del_timer_sync(struct timer_list *t)
{
	spin_lock(&t->mtx);
	callout_stop(&t->callout);
	spin_unlock(&t->mtx);

	spin_lock_destroy(&t->mtx);
	return 0;
}
Beispiel #22
0
static int 
akbd_disable(keyboard_t *kbd) 
{
	struct adb_kbd_softc *sc;
	sc = (struct adb_kbd_softc *)(kbd);

	callout_stop(&sc->sc_repeater);
	KBD_DEACTIVATE(kbd);
	return (0);
}
Beispiel #23
0
int
del_timer_sync(struct timer_list *t)
{
	mtx_lock_spin(&t->mtx);
	callout_stop(&t->callout);
	mtx_unlock_spin(&t->mtx);

	mtx_destroy(&t->mtx);
	return 0;
}
static void
mpt_restart(mpt_softc_t *mpt, request_t *req0)
{
	int i, s, nreq;
	request_t *req;
	struct scsipi_xfer *xs;

	/* first, reset the IOC, leaving stopped so all requests are idle */
	if (mpt_soft_reset(mpt) != MPT_OK) {
		mpt_prt(mpt, "soft reset failed");
		/* 
		* Don't try a hard reset since this mangles the PCI 
		* configuration registers.
		*/
		return;
	}

	/* Freeze the channel so scsipi doesn't queue more commands. */
	scsipi_channel_freeze(&mpt->sc_channel, 1);

	/* Return all pending requests to scsipi and de-allocate them. */
	s = splbio();
	nreq = 0;
	for (i = 0; i < MPT_MAX_REQUESTS(mpt); i++) {
		req = &mpt->request_pool[i];
		xs = req->xfer;
		if (xs != NULL) {
			if (xs->datalen != 0)
				bus_dmamap_unload(mpt->sc_dmat, req->dmap);
			req->xfer = NULL;
			callout_stop(&xs->xs_callout);
			if (req != req0) {
				nreq++;
				xs->error = XS_REQUEUE;
			}
			scsipi_done(xs);
			/*
			* Don't need to mpt_free_request() since mpt_init() 
			* below will free all requests anyway.
			*/
			mpt_free_request(mpt, req);
		}
	}
	splx(s);
	if (nreq > 0)
		mpt_prt(mpt, "re-queued %d requests", nreq);

	/* Re-initialize the IOC (which restarts it). */
	if (mpt_init(mpt, MPT_DB_INIT_HOST) == 0)
		mpt_prt(mpt, "restart succeeded");
	/* else error message already printed */

	/* Thaw the channel, causing scsipi to re-queue the commands. */
	scsipi_channel_thaw(&mpt->sc_channel, 1);
}
Beispiel #25
0
static void
tws_scsi_err_complete(struct tws_request *req, struct tws_command_header *hdr)
{
    u_int8_t *sense_data;
    struct tws_softc *sc = req->sc;
    union ccb *ccb = req->ccb_ptr;

    TWS_TRACE_DEBUG(sc, "sbe, cmd_status", hdr->status_block.error,
                                 req->cmd_pkt->cmd.pkt_a.status);
    if ( hdr->status_block.error == TWS_ERROR_LOGICAL_UNIT_NOT_SUPPORTED ||
         hdr->status_block.error == TWS_ERROR_UNIT_OFFLINE ) {

        if ( ccb->ccb_h.target_lun ) {
            TWS_TRACE_DEBUG(sc, "invalid lun error",0,0);
            ccb->ccb_h.status |= CAM_LUN_INVALID;
        } else {
            TWS_TRACE_DEBUG(sc, "invalid target error",0,0);
            ccb->ccb_h.status |= CAM_TID_INVALID;
        }

    } else {
        TWS_TRACE_DEBUG(sc, "scsi status  error",0,0);
        ccb->ccb_h.status |= CAM_SCSI_STATUS_ERROR;
        if (((ccb->csio.cdb_io.cdb_bytes[0] == 0x1A) &&
              (hdr->status_block.error == TWS_ERROR_NOT_SUPPORTED))) {
            ccb->ccb_h.status |= CAM_SCSI_STATUS_ERROR | CAM_AUTOSNS_VALID;
            TWS_TRACE_DEBUG(sc, "page mode not supported",0,0);
        }
    }

    /* if there were no error simply mark complete error */
    if (ccb->ccb_h.status == 0)
        ccb->ccb_h.status = CAM_REQ_CMP_ERR;

    sense_data = (u_int8_t *)&ccb->csio.sense_data;
    if (sense_data) {
        memcpy(sense_data, hdr->sense_data, TWS_SENSE_DATA_LENGTH );
        ccb->csio.sense_len = TWS_SENSE_DATA_LENGTH;
        ccb->ccb_h.status |= CAM_AUTOSNS_VALID;
    }
    ccb->csio.scsi_status = req->cmd_pkt->cmd.pkt_a.status;

    ccb->ccb_h.status &= ~CAM_SIM_QUEUED;
    lockmgr(&sc->sim_lock, LK_EXCLUSIVE);
    xpt_done(ccb);
    lockmgr(&sc->sim_lock, LK_RELEASE);

    callout_stop(req->ccb_ptr->ccb_h.timeout_ch);
    tws_unmap_request(req->sc, req);
    lockmgr(&sc->q_lock, LK_EXCLUSIVE);
    tws_q_remove_request(sc, req, TWS_BUSY_Q);
    tws_q_insert_tail(sc, req, TWS_FREE_Q);
    lockmgr(&sc->q_lock, LK_RELEASE);

}
Beispiel #26
0
int
parsendch(struct par_softc *sc, u_char ch)
{
	int error = 0;
	int s;
	
	/* if either offline, busy or out of paper, wait for that
	   condition to clear */
	s = spl1();
	while (!error
	       && (parsend_pending
		   || !(intio_get_sicilian_intr() & SICILIAN_STAT_PAR)))
	{
		/* wait a second, and try again */
		callout_reset(&intr_callout, hz, parintr, 0);
		partimeout_pending = 1;
		/* this is essentially a flipflop to have us wait for the
		   first character being transmitted when trying to transmit
		   the second, etc. */
		parsend_pending = 0;
		/* it's quite important that a parallel putc can be
		   interrupted, given the possibility to lock a printer
		   in an offline condition.. */
		if ((error = tsleep(parintr, PCATCH|(PZERO-1), "parsendch", 0))) {
#ifdef DEBUG
			if (pardebug & PDB_INTERRUPT)
				printf("parsendch interrupted, error = %d\n", error);
#endif
			if (partimeout_pending)
				callout_stop(&intr_callout);

			partimeout_pending = 0;
		}
	}

	if (!error) {
#ifdef DEBUG
		if (pardebug & PDB_INTERRUPT)
			printf("#%d", ch);
#endif
		bus_space_write_1(sc->sc_bst, sc->sc_bsh, PAR_DATA, ch);
		DELAY(1);	/* (DELAY(1) == 1us) > 0.5us */
		bus_space_write_1(sc->sc_bst, sc->sc_bsh, PAR_STROBE, 0);
		intio_set_sicilian_intr(intio_get_sicilian_intr() |
					 SICILIAN_INTR_PAR);
		DELAY(1);
		bus_space_write_1(sc->sc_bst, sc->sc_bsh, PAR_STROBE, 1);
		parsend_pending = 1;
	}
	
	splx(s);
	
	return error;
}
int
arcbios_ttyclose(dev_t dev, int flag, int mode, struct lwp *l)
{
	int unit = minor(dev);
	struct tty *tp = arcbios_tty[unit];

	callout_stop(&arcbios_tty_ch);
	(*tp->t_linesw->l_close)(tp, flag);
	ttyclose(tp);
	return (0);
}
Beispiel #28
0
/* detach */
int
url_detach(device_t self, int flags)
{
	struct url_softc *sc = device_private(self);
	struct ifnet *ifp = GET_IFP(sc);
	int s;

	DPRINTF(("%s: %s: enter\n", device_xname(sc->sc_dev), __func__));

	/* Detached before attached finished */
	if (!sc->sc_attached)
		return (0);

	callout_stop(&sc->sc_stat_ch);

	/* Remove any pending tasks */
	usb_rem_task(sc->sc_udev, &sc->sc_tick_task);
	usb_rem_task(sc->sc_udev, &sc->sc_stop_task);

	s = splusb();

	if (--sc->sc_refcnt >= 0) {
		/* Wait for processes to go away */
		usb_detach_waitold(sc->sc_dev);
	}

	if (ifp->if_flags & IFF_RUNNING)
		url_stop(GET_IFP(sc), 1);

	rnd_detach_source(&sc->rnd_source);
	mii_detach(&sc->sc_mii, MII_PHY_ANY, MII_OFFSET_ANY);
	ifmedia_delete_instance(&sc->sc_mii.mii_media, IFM_INST_ANY);
	ether_ifdetach(ifp);
	if_detach(ifp);

#ifdef DIAGNOSTIC
	if (sc->sc_pipe_tx != NULL)
		aprint_debug_dev(self, "detach has active tx endpoint.\n");
	if (sc->sc_pipe_rx != NULL)
		aprint_debug_dev(self, "detach has active rx endpoint.\n");
	if (sc->sc_pipe_intr != NULL)
		aprint_debug_dev(self, "detach has active intr endpoint.\n");
#endif

	sc->sc_attached = 0;

	splx(s);

	rw_destroy(&sc->sc_mii_rwlock);
	usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->sc_udev,
			   sc->sc_dev);

	return (0);
}
Beispiel #29
0
static int
octeon_rnd_detach(device_t dev)
{
	struct octeon_rnd_softc *sc;

	sc = device_get_softc(dev);

	callout_stop(&sc->sc_callout);

	return (0);
}
Beispiel #30
0
static bool
oj6sh_suspend(device_t dv, const pmf_qual_t *qual)
{
	struct oj6sh_softc *sc = device_private(dv);

	DPRINTF(3,("%s: oj6sh_suspend()\n", device_xname(sc->sc_dev)));
	callout_stop(&sc->sc_c);
	sc->sc_enabled = 0;

	return true;
}