*** ../wavelan.orig/if_wireg.h	Thu Jan 17 11:21:23 2002
--- if_wireg.h	Thu Jan 17 13:20:20 2002
***************
*** 54,59 ****
--- 54,93 ----
  	u_int32_t		wi_rx_WEP_cant_decrypt;
  	u_int32_t		wi_rx_msg_in_msg_frags;
  	u_int32_t		wi_rx_msg_in_bad_msg_frags;
+         u_int32_t               wi_rx_discards_wep_icv_error;
+         u_int32_t               wi_rx_discards_wep_excluded;
+ };
+ 
+ /*
+  * this is a prism2 structure, not Lucent/wavelan
+  */
+ struct wi_scan_data_p2 {
+        u_int16_t               wi_noise;
+        u_int16_t               wi_channel1;
+        u_int16_t               wi_channel2;
+        u_int16_t               wi_signal;
+        u_int8_t                wi_bssid[6];	/* AP/mac address */
+        u_int16_t               wi_interval;	/* beacon xmit interval */
+        u_int16_t               wi_capinfo;	/* ? 0-ess, 1-ibss, wep-4 */
+        u_int16_t               wi_namelen;	/* length of essid name */
+        u_int8_t                wi_name[32];     /* essid string */ 
+        u_int16_t	       wi_unknown2[5];   
+ /*
+        u_int16_t               wi_unknown2[24]; 
+ */
+ };
+ 
+ /* lucent/wavelan version.  note 25 shorts in all
+ */
+ struct wi_scan_data {
+        u_int16_t               wi_channel;
+        u_int16_t               wi_noise;
+        u_int16_t               wi_signal;
+        u_int8_t                wi_bssid[6];	/* AP/mac address */
+        u_int16_t               wi_interval;	/* beacon xmit interval */
+        u_int16_t               wi_capinfo;	/* ? 0-ess, 1-ibss, wep-4 */
+        u_int16_t               wi_namelen;	/* length of essid name */
+        u_int8_t                wi_name[32];     /* essid string */ 
  };
  
  /*
***************
*** 129,140 ****
--- 163,181 ----
  	int			wi_use_wep;
  	int			wi_tx_key;
  	struct wi_ltv_keys	wi_keys;
+ 	/* monitor info
+ 	*/
+         struct wi_apinfo        wi_aps[MAXAPINFO];
+         int                     wi_naps;
+         int                     wi_scanning;	/* scan mode */
+         int                     wi_monitor;     /* monitor mode */
  #ifdef WICACHE
  	int			wi_sigitems;
  	struct wi_sigcache	wi_sigcache[MAXWICACHE];
  	int			wi_nextitem;
  #endif
  	struct callout_handle	wi_stat_ch;
+ 	struct callout_handle	wi_scan_ch;
  	int			wi_prism2;	/* set to 1 if it uses a Prism II chip */
  };
  
***************
*** 183,188 ****
--- 224,231 ----
  
  #define WI_DEFAULT_CHAN		3
  
+ #define WI_DEFAULT_MONITOR      0
+ 
  /*
   * register space access macros
   */
***************
*** 277,282 ****
--- 320,326 ----
  #define WI_CMD_INQUIRE		0x0011
  #define WI_CMD_ACCESS		0x0021
  #define WI_CMD_PROGRAM		0x0022
+ #define WI_CMD_TEST	 	0x0038
  
  #define WI_CMD_CODE_MASK	0x003F
  
***************
*** 300,305 ****
--- 344,355 ----
  #define WI_PROGRAM_ENABLE_NVRAM	0x0200
  #define WI_PROGRAM_NVRAM	0x0300
  
+ /*
+  * TEST command qualifier bits.
+  */
+ #define WI_TEST_MONITOR                0x0B00
+ #define WI_TEST_STOP           0x0F00
+ 
  /* Status register values */
  #define WI_STAT_CMD_CODE	0x003F
  #define WI_STAT_DIAG_ERR	0x0100
***************
*** 460,465 ****
--- 510,526 ----
  	u_int16_t		wi_cis[240];
  };
  
+ /*      
+  * station identity (0xFD20)    
+  * len: 32
+  */     
+ #define WI_RID_STAID            0xFD20
+ struct wi_ltv_staid {
+         u_int16_t               wi_len;
+         u_int16_t               wi_type;
+         u_int16_t               wi_data[31];
+ };      
+ 
  /*
   * Communications quality (0xFD43).
   */
***************
*** 577,582 ****
--- 638,656 ----
  };
  
  /*
+  * Request scan for access points. We supply channels
+  * and TX rates for the scan.
+  */
+ #define WI_RID_SCAN_RESULT_STABLE      0xFD88
+ #define WI_RID_SCAN_REQUEST            0xFCE1
+ struct wi_ltv_scanreq {
+        u_int16_t               wi_len;
+        u_int16_t               wi_type;
+        u_int16_t               wi_channels;
+        u_int16_t               wi_txrate;
+ };
+ 
+ /*
   * Create IBSS.
   */
  #define WI_RID_CREATE_IBSS	0xFC81
***************
*** 640,645 ****
--- 714,720 ----
  #define WI_802_3_OFFSET		0x2E
  #define WI_802_11_OFFSET	0x44
  #define WI_802_11_OFFSET_RAW	0x3C
+ #define WI_802_11_OFFSET_HDR    0x0E
  
  #define WI_STAT_BADCRC		0x0001
  #define WI_STAT_UNDECRYPTABLE	0x0002
