if (ic->ic_opmode == IEEE80211_M_HOSTAP) sc->sc_imask |= HAL_INT_MIB;
ath_init1(struct ath_softc *sc){	struct ieee80211com *ic = &sc->sc_ic;	struct ifnet *ifp = &ic->ic_if;	struct ieee80211_node *ni;	enum ieee80211_phymode mode;	struct ath_hal *ah = sc->sc_ah;	HAL_STATUS status;	HAL_CHANNEL hchan;	int error = 0, s;	DPRINTF(ATH_DEBUG_ANY, ("%s: if_flags 0x%x\n",	    __func__, ifp->if_flags));	if ((error = ath_enable(sc)) != 0)		return error;	s = splnet();	/*	 * Stop anything previously setup.  This is safe	 * whether this is the first time through or not.	 */	ath_stop(ifp);	/*	 * The basic interface to setting the hardware in a good	 * state is ``reset''.  On return the hardware is known to	 * be powered up and with interrupts disabled.  This must	 * be followed by initialization of the appropriate bits	 * and then setup of the interrupt mask.	 */	hchan.channel = ic->ic_ibss_chan->ic_freq;	hchan.channelFlags = ath_chan2flags(ic, ic->ic_ibss_chan);	if (!ath_hal_reset(ah, ic->ic_opmode, &hchan, AH_FALSE, &status)) {		if_printf(ifp, "unable to reset hardware; hal status %u\n",			status);		error = EIO;		goto done;	}	/*	 * Setup the hardware after reset: the key cache	 * is filled as needed and the receive engine is	 * set going.  Frame transmit is handled entirely	 * in the frame output path; there's nothing to do	 * here except setup the interrupt mask.	 */	if (ic->ic_flags & IEEE80211_F_WEPON) {		if ((error = ath_initkeytable(sc)) != 0) {			if_printf(ifp, "unable to initialize the key cache\n");			goto done;		}	}	if ((error = ath_startrecv(sc)) != 0) {		if_printf(ifp, "unable to start recv logic\n");		goto done;	}	/*	 * Enable interrupts.	 */	sc->sc_imask = HAL_INT_RX | HAL_INT_TX	    | HAL_INT_RXEOL | HAL_INT_RXORN	    | HAL_INT_FATAL | HAL_INT_GLOBAL;	ath_hal_set_intr(ah, sc->sc_imask);	ifp->if_flags |= IFF_RUNNING;	ic->ic_state = IEEE80211_S_INIT;	/*	 * The hardware should be ready to go now so it's safe	 * to kick the 802.11 state machine as it's likely to	 * immediately call back to us to send mgmt frames.	 */	ni = ic->ic_bss;	ni->ni_chan = ic->ic_ibss_chan;	mode = ieee80211_chan2mode(ic, ni->ni_chan);	if (mode != sc->sc_curmode)		ath_setcurmode(sc, mode);	if (ic->ic_opmode != IEEE80211_M_MONITOR) {		ieee80211_new_state(ic, IEEE80211_S_SCAN, -1);	} else {		ieee80211_new_state(ic, IEEE80211_S_RUN, -1);	}done:	splx(s);	return error;}