Use the new scan command for monitor mode as well.
This commit is contained in:
parent
a658e0cd29
commit
69c3b1813e
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: if_iwi.c,v 1.29 2005/09/29 19:57:36 skrll Exp $ */
|
||||
/* $NetBSD: if_iwi.c,v 1.30 2005/10/08 06:19:46 skrll Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2004, 2005
|
||||
@ -28,7 +28,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_iwi.c,v 1.29 2005/09/29 19:57:36 skrll Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_iwi.c,v 1.30 2005/10/08 06:19:46 skrll Exp $");
|
||||
|
||||
/*-
|
||||
* Intel(R) PRO/Wireless 2200BG/2225BG/2915ABG driver
|
||||
@ -2082,17 +2082,18 @@ static int
|
||||
iwi_set_chan(struct iwi_softc *sc, struct ieee80211_channel *chan)
|
||||
{
|
||||
struct ieee80211com *ic = &sc->sc_ic;
|
||||
struct iwi_scan scan;
|
||||
struct iwi_scan_v2 scan;
|
||||
|
||||
(void)memset(&scan, 0, sizeof scan);
|
||||
scan.type = IWI_SCAN_TYPE_PASSIVE;
|
||||
scan.dwelltime = htole16(2000);
|
||||
scan.channels[0] = 1 | (IEEE80211_IS_CHAN_5GHZ(chan) ? IWI_CHAN_5GHZ :
|
||||
IWI_CHAN_2GHZ);
|
||||
|
||||
scan.dwelltime[IWI_SCAN_TYPE_PASSIVE] = htole16(2000);
|
||||
scan.channels[0] = 1 |
|
||||
(IEEE80211_IS_CHAN_5GHZ(chan) ? IWI_CHAN_5GHZ : IWI_CHAN_2GHZ);
|
||||
scan.channels[1] = ieee80211_chan2ieee(ic, chan);
|
||||
iwi_scan_type_set(scan, 1, IWI_SCAN_TYPE_PASSIVE);
|
||||
|
||||
DPRINTF(("Setting channel to %u\n", ieee80211_chan2ieee(ic, chan)));
|
||||
return iwi_cmd(sc, IWI_CMD_SCAN, &scan, sizeof scan, 1);
|
||||
return iwi_cmd(sc, IWI_CMD_SCAN_V2, &scan, sizeof scan, 1);
|
||||
}
|
||||
|
||||
static int
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: if_iwireg.h,v 1.10 2005/09/29 19:45:57 skrll Exp $ */
|
||||
/* $NetBSD: if_iwireg.h,v 1.11 2005/10/08 06:19:46 skrll Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2004, 2005
|
||||
@ -334,17 +334,6 @@ struct iwi_associate {
|
||||
#define IWI_SCAN_TYPE_ACTIVE_BDIRECT 4
|
||||
#define IWI_SCAN_TYPES 5
|
||||
|
||||
/* structure for command IWI_CMD_SCAN */
|
||||
struct iwi_scan {
|
||||
uint8_t type;
|
||||
uint16_t dwelltime;
|
||||
uint8_t channels[IWI_SCAN_CHANNELS];
|
||||
#define IWI_CHAN_5GHZ (0 << 6)
|
||||
#define IWI_CHAN_2GHZ (1 << 6)
|
||||
|
||||
uint8_t reserved[3];
|
||||
} __attribute__((__packed__));
|
||||
|
||||
#define iwi_scan_type_set(s, i, t) \
|
||||
do { \
|
||||
if ((i) % 2 == 0) \
|
||||
@ -357,6 +346,9 @@ struct iwi_scan {
|
||||
struct iwi_scan_v2 {
|
||||
u_int32_t fsidx;
|
||||
u_int8_t channels[IWI_SCAN_CHANNELS];
|
||||
#define IWI_CHAN_5GHZ (0 << 6)
|
||||
#define IWI_CHAN_2GHZ (1 << 6)
|
||||
|
||||
struct {
|
||||
u_int8_t msn:4;
|
||||
u_int8_t lsn:4;
|
||||
|
Loading…
Reference in New Issue
Block a user