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

Collapse All | Expand All

(-)sys/dev/wpi/if_wpi.c (-14 / +22 lines)
Lines 130-135 Link Here
130
static int	wpi_attach(device_t);
130
static int	wpi_attach(device_t);
131
static void	wpi_radiotap_attach(struct wpi_softc *);
131
static void	wpi_radiotap_attach(struct wpi_softc *);
132
static void	wpi_sysctlattach(struct wpi_softc *);
132
static void	wpi_sysctlattach(struct wpi_softc *);
133
static void	wpi_init_beacon(struct wpi_vap *);
133
static struct ieee80211vap *wpi_vap_create(struct ieee80211com *,
134
static struct ieee80211vap *wpi_vap_create(struct ieee80211com *,
134
		    const char [IFNAMSIZ], int, enum ieee80211_opmode, int,
135
		    const char [IFNAMSIZ], int, enum ieee80211_opmode, int,
135
		    const uint8_t [IEEE80211_ADDR_LEN],
136
		    const uint8_t [IEEE80211_ADDR_LEN],
Lines 579-584 Link Here
579
#endif
580
#endif
580
}
581
}
581
582
583
static void
584
wpi_init_beacon(struct wpi_vap *wvp)
585
{
586
	struct wpi_buf *bcn = &wvp->wv_bcbuf;
587
	struct wpi_cmd_beacon *cmd = (struct wpi_cmd_beacon *)&bcn->data;
588
589
	cmd->id = WPI_ID_BROADCAST;
590
	cmd->ofdm_mask = 0xff;
591
	cmd->cck_mask = 0x0f;
592
	cmd->lifetime = htole32(WPI_LIFETIME_INFINITE);
593
	cmd->flags = htole32(WPI_TX_AUTO_SEQ | WPI_TX_INSERT_TSTAMP);
594
595
	bcn->code = WPI_CMD_SET_BEACON;
596
	bcn->ac = WPI_CMD_QUEUE_NUM;
597
	bcn->size = sizeof(struct wpi_cmd_beacon);
598
}
599
582
static struct ieee80211vap *
600
static struct ieee80211vap *
583
wpi_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ], int unit,
601
wpi_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ], int unit,
584
    enum ieee80211_opmode opmode, int flags,
602
    enum ieee80211_opmode opmode, int flags,
Lines 598-603 Link Here
598
	vap = &wvp->vap;
616
	vap = &wvp->vap;
599
	ieee80211_vap_setup(ic, vap, name, unit, opmode, flags, bssid, mac);
617
	ieee80211_vap_setup(ic, vap, name, unit, opmode, flags, bssid, mac);
600
618
619
	if (opmode == IEEE80211_M_IBSS)
620
		wpi_init_beacon(wvp);
621
601
	/* Override with driver methods. */
622
	/* Override with driver methods. */
602
	wvp->newstate = vap->iv_newstate;
623
	wvp->newstate = vap->iv_newstate;
603
	vap->iv_key_alloc = wpi_key_alloc;
624
	vap->iv_key_alloc = wpi_key_alloc;
Lines 3932-3938 Link Here
3932
	struct ieee80211_beacon_offsets bo;
3953
	struct ieee80211_beacon_offsets bo;
3933
	struct wpi_cmd_beacon *cmd = (struct wpi_cmd_beacon *)&bcn->data;
3954
	struct wpi_cmd_beacon *cmd = (struct wpi_cmd_beacon *)&bcn->data;
3934
	struct mbuf *m;
3955
	struct mbuf *m;
3935
	int totlen;
3936
3956
3937
	DPRINTF(sc, WPI_DEBUG_TRACE, TRACE_STR_DOING, __func__);
3957
	DPRINTF(sc, WPI_DEBUG_TRACE, TRACE_STR_DOING, __func__);
3938
3958
Lines 3945-3964 Link Here
3945
		    "%s: could not allocate beacon frame\n", __func__);
3965
		    "%s: could not allocate beacon frame\n", __func__);
3946
		return ENOMEM;
3966
		return ENOMEM;
3947
	}
3967
	}
3948
	totlen = m->m_pkthdr.len;
3949
3968
3950
	cmd->id = WPI_ID_BROADCAST;
3969
	cmd->len = htole16(m->m_pkthdr.len);
3951
	cmd->ofdm_mask = 0xff;
3952
	cmd->cck_mask = 0x0f;
3953
	cmd->lifetime = htole32(WPI_LIFETIME_INFINITE);
3954
	cmd->flags = htole32(WPI_TX_AUTO_SEQ | WPI_TX_INSERT_TSTAMP);
3955
3956
	bcn->ni = NULL;
3957
	bcn->code = WPI_CMD_SET_BEACON;
3958
	bcn->ac = 4;
3959
	bcn->size = sizeof(struct wpi_cmd_beacon);
3960
3961
	cmd->len = htole16(totlen);
3962
	cmd->plcp = (ic->ic_curmode == IEEE80211_MODE_11A) ?
3970
	cmd->plcp = (ic->ic_curmode == IEEE80211_MODE_11A) ?
3963
	    wpi_ridx_to_plcp[WPI_RIDX_OFDM6] : wpi_ridx_to_plcp[WPI_RIDX_CCK1];
3971
	    wpi_ridx_to_plcp[WPI_RIDX_OFDM6] : wpi_ridx_to_plcp[WPI_RIDX_CCK1];
3964
3972

Return to bug 197143