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

Collapse All | Expand All

(-)sys/dev/wpi/if_wpi.c (-24 / +18 lines)
Lines 2540-2545 Link Here
2540
}
2545
}
2541
2546
2542
/*
2547
/*
2548
 * Add an ssid element to a frame.
2549
 */
2550
static uint8_t *
2551
ieee80211_add_ssid(uint8_t *frm, const uint8_t *ssid, u_int len)
2552
{
2553
        *frm++ = IEEE80211_ELEMID_SSID;
2554
        *frm++ = len;
2555
        memcpy(frm, ssid, len);
2556
        return frm + len;
2557
}
2558
2559
/*
2543
 * Send a scan request to the firmware.  Since this command is huge, we map it
2560
 * Send a scan request to the firmware.  Since this command is huge, we map it
2544
 * into a mbufcluster instead of using the pre-allocated set of commands. Note,
2561
 * into a mbufcluster instead of using the pre-allocated set of commands. Note,
2545
 * much of this code is similar to that in wpi_cmd but because we must manually
2562
 * much of this code is similar to that in wpi_cmd but because we must manually
Lines 2564-2570 Link Here
2564
	struct ieee80211_channel *c;
2581
	struct ieee80211_channel *c;
2565
	enum ieee80211_phymode mode;
2582
	enum ieee80211_phymode mode;
2566
	uint8_t *frm;
2583
	uint8_t *frm;
2567
	int nrates, pktlen, error, i, nssid;
2584
	int pktlen, error, i, nssid;
2568
	bus_addr_t physaddr;
2585
	bus_addr_t physaddr;
2569
2586
2570
	desc = &ring->desc[ring->cur];
2587
	desc = &ring->desc[ring->cur];
Lines 2613-2619 Link Here
2613
	nssid = MIN(ss->ss_nssid, WPI_SCAN_MAX_ESSIDS);
2630
	nssid = MIN(ss->ss_nssid, WPI_SCAN_MAX_ESSIDS);
2614
	for (i = 0; i < nssid; i++) {
2631
	for (i = 0; i < nssid; i++) {
2615
		hdr->scan_essids[i].id = IEEE80211_ELEMID_SSID;
2632
		hdr->scan_essids[i].id = IEEE80211_ELEMID_SSID;
2616
		hdr->scan_essids[i].esslen = MIN(ss->ss_ssid[i].len, 32);
2633
		hdr->scan_essids[i].esslen = MIN(ss->ss_ssid[i].len, IEEE80211_NWID_LEN);
2617
		memcpy(hdr->scan_essids[i].essid, ss->ss_ssid[i].ssid,
2634
		memcpy(hdr->scan_essids[i].essid, ss->ss_ssid[i].ssid,
2618
		    hdr->scan_essids[i].esslen);
2635
		    hdr->scan_essids[i].esslen);
2619
#ifdef WPI_DEBUG
2636
#ifdef WPI_DEBUG
Lines 2630-2636 Link Here
2630
	 * Build a probe request frame.  Most of the following code is a
2647
	 * Build a probe request frame.  Most of the following code is a
2631
	 * copy & paste of what is done in net80211.
2648
	 * copy & paste of what is done in net80211.
2632
	 */
2649
	 */
2633
	wh = (struct ieee80211_frame *)&hdr->scan_essids[4];
2650
	wh = (struct ieee80211_frame *)&hdr->scan_essids[WPI_SCAN_MAX_ESSIDS];
2634
	wh->i_fc[0] = IEEE80211_FC0_VERSION_0 | IEEE80211_FC0_TYPE_MGT |
2651
	wh->i_fc[0] = IEEE80211_FC0_VERSION_0 | IEEE80211_FC0_TYPE_MGT |
2635
		IEEE80211_FC0_SUBTYPE_PROBE_REQ;
2652
		IEEE80211_FC0_SUBTYPE_PROBE_REQ;
2636
	wh->i_fc[1] = IEEE80211_FC1_DIR_NODS;
2653
	wh->i_fc[1] = IEEE80211_FC1_DIR_NODS;
Lines 2642-2672 Link Here
2642
2659
2643
	frm = (uint8_t *)(wh + 1);
2660
	frm = (uint8_t *)(wh + 1);
2644
2661
2645
	/* add essid IE, the hardware will fill this in for us */
2646
	*frm++ = IEEE80211_ELEMID_SSID;
2647
	*frm++ = 0;
2648
2649
	mode = ieee80211_chan2mode(ic->ic_curchan);
2662
	mode = ieee80211_chan2mode(ic->ic_curchan);
2650
	rs = &ic->ic_sup_rates[mode];
2663
	rs = &ic->ic_sup_rates[mode];
2651
2664
2652
	/* add supported rates IE */
2665
	frm = ieee80211_add_ssid(frm, NULL, 0);
2653
	*frm++ = IEEE80211_ELEMID_RATES;
2666
	frm = ieee80211_add_rates(frm, rs);
2654
	nrates = rs->rs_nrates;
2667
	frm = ieee80211_add_xrates(frm, rs);
2655
	if (nrates > IEEE80211_RATE_SIZE)
2656
		nrates = IEEE80211_RATE_SIZE;
2657
	*frm++ = nrates;
2658
	memcpy(frm, rs->rs_rates, nrates);
2659
	frm += nrates;
2660
2668
2661
	/* add supported xrates IE */
2662
	if (rs->rs_nrates > IEEE80211_RATE_SIZE) {
2663
		nrates = rs->rs_nrates - IEEE80211_RATE_SIZE;
2664
		*frm++ = IEEE80211_ELEMID_XRATES;
2665
		*frm++ = nrates;
2666
		memcpy(frm, rs->rs_rates + IEEE80211_RATE_SIZE, nrates);
2667
		frm += nrates;
2668
	}
2669
2670
	/* setup length of probe request */
2669
	/* setup length of probe request */
2671
	hdr->tx.len = htole16(frm - (uint8_t *)wh);
2670
	hdr->tx.len = htole16(frm - (uint8_t *)wh);
2672
2671
(-)sys/dev/wpi/if_wpireg.h (-1 / +1 lines)
Lines 511-517 Link Here
511
	struct {
511
	struct {
512
	    uint8_t		id;
512
	    uint8_t		id;
513
	    uint8_t		esslen;
513
	    uint8_t		esslen;
514
	    uint8_t		essid[32];
514
	    uint8_t		essid[IEEE80211_NWID_LEN];
515
	}scan_essids[WPI_SCAN_MAX_ESSIDS];
515
	}scan_essids[WPI_SCAN_MAX_ESSIDS];
516
	/* followed by probe request body */
516
	/* followed by probe request body */
517
	/* followed by nchan x wpi_scan_chan */
517
	/* followed by nchan x wpi_scan_chan */

Return to bug 196069