View | Details | Raw Unified | Return to bug 200136 | Differences between
and this patch

Collapse All | Expand All

(-)sys/dev/usb/wlan/if_rum.c (+34 lines)
Lines 163-168 Link Here
163
static void		rum_tx_free(struct rum_tx_data *, int);
163
static void		rum_tx_free(struct rum_tx_data *, int);
164
static void		rum_setup_tx_list(struct rum_softc *);
164
static void		rum_setup_tx_list(struct rum_softc *);
165
static void		rum_unsetup_tx_list(struct rum_softc *);
165
static void		rum_unsetup_tx_list(struct rum_softc *);
166
static void		rum_recv_mgmt(struct ieee80211_node *, struct mbuf *,
167
			    int, int, int);
166
static int		rum_newstate(struct ieee80211vap *,
168
static int		rum_newstate(struct ieee80211vap *,
167
			    enum ieee80211_state, int);
169
			    enum ieee80211_state, int);
168
static void		rum_setup_tx_desc(struct rum_softc *,
170
static void		rum_setup_tx_desc(struct rum_softc *,
Lines 616-621 Link Here
616
	/* override state transition machine */
618
	/* override state transition machine */
617
	rvp->newstate = vap->iv_newstate;
619
	rvp->newstate = vap->iv_newstate;
618
	vap->iv_newstate = rum_newstate;
620
	vap->iv_newstate = rum_newstate;
621
	rvp->recv_mgmt = vap->iv_recv_mgmt;
622
	vap->iv_recv_mgmt = rum_recv_mgmt;
619
623
620
	usb_callout_init_mtx(&rvp->ratectl_ch, &sc->sc_mtx, 0);
624
	usb_callout_init_mtx(&rvp->ratectl_ch, &sc->sc_mtx, 0);
621
	TASK_INIT(&rvp->ratectl_task, 0, rum_ratectl_task, rvp);
625
	TASK_INIT(&rvp->ratectl_task, 0, rum_ratectl_task, rvp);
Lines 702-707 Link Here
702
	}
706
	}
703
}
707
}
704
708
709
static void
710
rum_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m, int subtype, int rssi,
711
    int nf)
712
{
713
	struct ieee80211vap *vap = ni->ni_vap;
714
	struct rum_softc *sc = vap->iv_ic->ic_ifp->if_softc;
715
	struct rum_vap *rvp = RUM_VAP(vap);
716
	uint64_t ni_tstamp, rx_tstamp;
717
718
	rvp->recv_mgmt(ni, m, subtype, rssi, nf);
719
720
	if (vap->iv_opmode == IEEE80211_M_IBSS &&
721
	    vap->iv_state == IEEE80211_S_RUN &&
722
	    (subtype == IEEE80211_FC0_SUBTYPE_BEACON ||
723
	    subtype == IEEE80211_FC0_SUBTYPE_PROBE_RESP)) {
724
		ni_tstamp = le64toh(ni->ni_tstamp.tsf);
725
		RUM_LOCK(sc);
726
		rum_read_multi(sc, RT2573_TXRX_CSR12, &rx_tstamp,
727
		    sizeof(rx_tstamp));
728
		RUM_UNLOCK(sc);
729
		rx_tstamp = le64toh(rx_tstamp);
730
731
		if (ni_tstamp >= rx_tstamp) {
732
			DPRINTF("ibss merge, tsf %ju tstamp %ju\n",
733
			    (uintmax_t)rx_tstamp, (uintmax_t)ni_tstamp);
734
			(void) ieee80211_ibss_merge(ni);
735
		}
736
	}
737
}
738
705
static int
739
static int
706
rum_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg)
740
rum_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg)
707
{
741
{
(-)sys/dev/usb/wlan/if_rumvar.h (+2 lines)
Lines 77-82 Link Here
77
77
78
	int				(*newstate)(struct ieee80211vap *,
78
	int				(*newstate)(struct ieee80211vap *,
79
					    enum ieee80211_state, int);
79
					    enum ieee80211_state, int);
80
	void				(*recv_mgmt)(struct ieee80211_node *,
81
					    struct mbuf *, int, int, int);
80
};
82
};
81
#define	RUM_VAP(vap)	((struct rum_vap *)(vap))
83
#define	RUM_VAP(vap)	((struct rum_vap *)(vap))
82
84

Return to bug 200136