00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef _WAVELAN_H
00020 #define _WAVELAN_H
00021
00022
00023
00024
00025
00026
00027
00028
00029 const char MAC_ADDRESSES[][3] =
00030 {
00031 { 0x08, 0x00, 0x0E },
00032 { 0x08, 0x00, 0x6A },
00033 { 0x00, 0x00, 0xE1 },
00034 { 0x00, 0x60, 0x1D }
00035
00036 };
00037
00038 #define WAVELAN_ADDR_SIZE 6
00039
00040 #define WAVELAN_MTU 1500
00041
00042 #define MAXDATAZ (WAVELAN_ADDR_SIZE + WAVELAN_ADDR_SIZE + 2 + WAVELAN_MTU)
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052 const short channel_bands[] = { 0x30, 0x58, 0x64, 0x7A, 0x80, 0xA8,
00053 0xD0, 0xF0, 0xF8, 0x150 };
00054
00055
00056
00057
00058
00059 const int fixed_bands[] = { 915e6, 2.425e8, 2.46e8, 2.484e8, 2.4305e8 };
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069 typedef union hacs_u hacs_u;
00070 union hacs_u
00071 {
00072 unsigned short hu_command;
00073 #define HACR_RESET 0x0001
00074 #define HACR_CA 0x0002
00075 #define HACR_16BITS 0x0004
00076 #define HACR_OUT0 0x0008
00077
00078 #define HACR_OUT1 0x0010
00079
00080 #define HACR_82586_INT_ENABLE 0x0020
00081 #define HACR_MMC_INT_ENABLE 0x0040
00082 #define HACR_INTR_CLR_ENABLE 0x0080
00083 unsigned short hu_status;
00084 #define HASR_82586_INTR 0x0001
00085 #define HASR_MMC_INTR 0x0002
00086 #define HASR_MMC_BUSY 0x0004
00087 #define HASR_PSA_BUSY 0x0008
00088 };
00089
00090 typedef struct ha_t ha_t;
00091 struct ha_t
00092 {
00093 hacs_u ha_cs;
00094 #define ha_command ha_cs.hu_command
00095 #define ha_status ha_cs.hu_status
00096 unsigned short ha_mmcr;
00097 unsigned short ha_pior0;
00098 unsigned short ha_piop0;
00099 unsigned short ha_pior1;
00100 unsigned short ha_piop1;
00101 unsigned short ha_pior2;
00102 unsigned short ha_piop2;
00103 };
00104
00105 #define HA_SIZE 16
00106
00107 #define hoff(p,f) (unsigned short)((void *)(&((ha_t *)((void *)0 + (p)))->f) - (void *)0)
00108 #define HACR(p) hoff(p, ha_command)
00109 #define HASR(p) hoff(p, ha_status)
00110 #define MMCR(p) hoff(p, ha_mmcr)
00111 #define PIOR0(p) hoff(p, ha_pior0)
00112 #define PIOP0(p) hoff(p, ha_piop0)
00113 #define PIOR1(p) hoff(p, ha_pior1)
00114 #define PIOP1(p) hoff(p, ha_piop1)
00115 #define PIOR2(p) hoff(p, ha_pior2)
00116 #define PIOP2(p) hoff(p, ha_piop2)
00117
00118
00119
00120
00121 #define STATIC_PIO 0
00122
00123 #define AUTOINCR_PIO 1
00124
00125 #define AUTODECR_PIO 2
00126
00127 #define PARAM_ACCESS_PIO 3
00128
00129 #define PIO_MASK 3
00130 #define PIOM(cmd,piono) ((u_short)cmd << 10 << (piono * 2))
00131
00132 #define HACR_DEFAULT (HACR_OUT0 | HACR_OUT1 | HACR_16BITS | PIOM(STATIC_PIO, 0) | PIOM(AUTOINCR_PIO, 1) | PIOM(PARAM_ACCESS_PIO, 2))
00133 #define HACR_INTRON (HACR_82586_INT_ENABLE | HACR_MMC_INT_ENABLE | HACR_INTR_CLR_ENABLE)
00134
00135
00136
00137
00138
00139
00140
00141 #define OFFSET_RU 0x0000
00142 #define OFFSET_CU 0xC000
00143 #define OFFSET_SCB (OFFSET_ISCP - sizeof(scb_t))
00144 #define OFFSET_ISCP (OFFSET_SCP - sizeof(iscp_t))
00145 #define OFFSET_SCP I82586_SCP_ADDR
00146
00147 #define RXBLOCKZ (sizeof(fd_t) + sizeof(rbd_t) + MAXDATAZ)
00148 #define TXBLOCKZ (sizeof(ac_tx_t) + sizeof(ac_nop_t) + sizeof(tbd_t) + MAXDATAZ)
00149
00150 #define NRXBLOCKS ((OFFSET_CU - OFFSET_RU) / RXBLOCKZ)
00151 #define NTXBLOCKS ((OFFSET_SCB - OFFSET_CU) / TXBLOCKZ)
00152
00153
00154
00155
00156
00157
00158 typedef struct psa_t psa_t;
00159 struct psa_t
00160 {
00161 unsigned char psa_io_base_addr_1;
00162 unsigned char psa_io_base_addr_2;
00163 unsigned char psa_io_base_addr_3;
00164 unsigned char psa_io_base_addr_4;
00165 unsigned char psa_rem_boot_addr_1;
00166 unsigned char psa_rem_boot_addr_2;
00167 unsigned char psa_rem_boot_addr_3;
00168 unsigned char psa_holi_params;
00169 unsigned char psa_int_req_no;
00170 unsigned char psa_unused0[7];
00171
00172 unsigned char psa_univ_mac_addr[WAVELAN_ADDR_SIZE];
00173 unsigned char psa_local_mac_addr[WAVELAN_ADDR_SIZE];
00174 unsigned char psa_univ_local_sel;
00175 #define PSA_UNIVERSAL 0
00176 #define PSA_LOCAL 1
00177 unsigned char psa_comp_number;
00178 #define PSA_COMP_PC_AT_915 0
00179 #define PSA_COMP_PC_MC_915 1
00180 #define PSA_COMP_PC_AT_2400 2
00181 #define PSA_COMP_PC_MC_2400 3
00182 #define PSA_COMP_PCMCIA_915 4
00183 unsigned char psa_thr_pre_set;
00184 unsigned char psa_feature_select;
00185 #define PSA_FEATURE_CALL_CODE 0x01
00186 unsigned char psa_subband;
00187 #define PSA_SUBBAND_915 0
00188 #define PSA_SUBBAND_2425 1
00189 #define PSA_SUBBAND_2460 2
00190 #define PSA_SUBBAND_2484 3
00191 #define PSA_SUBBAND_2430_5 4
00192 unsigned char psa_quality_thr;
00193 unsigned char psa_mod_delay;
00194 unsigned char psa_nwid[2];
00195 unsigned char psa_nwid_select;
00196 unsigned char psa_encryption_select;
00197 unsigned char psa_encryption_key[8];
00198 unsigned char psa_databus_width;
00199 unsigned char psa_call_code[8];
00200 unsigned char psa_nwid_prefix[2];
00201 unsigned char psa_reserved[2];
00202 unsigned char psa_conf_status;
00203 unsigned char psa_crc[2];
00204 unsigned char psa_crc_status;
00205 };
00206
00207 #define PSA_SIZE 64
00208
00209
00210
00211 #define psaoff(p,f) ((unsigned short) ((void *)(&((psa_t *) ((void *) NULL + (p)))->f) - (void *) NULL))
00212
00213
00214
00215
00216
00217
00218 typedef struct mmw_t mmw_t;
00219 struct mmw_t
00220 {
00221 unsigned char mmw_encr_key[8];
00222 unsigned char mmw_encr_enable;
00223 #define MMW_ENCR_ENABLE_MODE 0x02
00224 #define MMW_ENCR_ENABLE_EN 0x01
00225 unsigned char mmw_unused0[1];
00226 unsigned char mmw_des_io_invert;
00227 #define MMW_DES_IO_INVERT_RES 0x0F
00228 #define MMW_DES_IO_INVERT_CTRL 0xF0
00229 unsigned char mmw_unused1[5];
00230 unsigned char mmw_loopt_sel;
00231 #define MMW_LOOPT_SEL_DIS_NWID 0x40
00232 #define MMW_LOOPT_SEL_INT 0x20
00233 #define MMW_LOOPT_SEL_LS 0x10
00234 #define MMW_LOOPT_SEL_LT3A 0x08
00235 #define MMW_LOOPT_SEL_LT3B 0x04
00236 #define MMW_LOOPT_SEL_LT3C 0x02
00237 #define MMW_LOOPT_SEL_LT3D 0x01
00238 unsigned char mmw_jabber_enable;
00239
00240 unsigned char mmw_freeze;
00241
00242 unsigned char mmw_anten_sel;
00243 #define MMW_ANTEN_SEL_SEL 0x01
00244 #define MMW_ANTEN_SEL_ALG_EN 0x02
00245 unsigned char mmw_ifs;
00246
00247 unsigned char mmw_mod_delay;
00248 unsigned char mmw_jam_time;
00249 unsigned char mmw_unused2[1];
00250 unsigned char mmw_thr_pre_set;
00251
00252 unsigned char mmw_decay_prm;
00253 unsigned char mmw_decay_updat_prm;
00254 unsigned char mmw_quality_thr;
00255
00256 unsigned char mmw_netw_id_l;
00257 unsigned char mmw_netw_id_h;
00258
00259
00260
00261 unsigned char mmw_mode_select;
00262 unsigned char mmw_unused3[1];
00263 unsigned char mmw_fee_ctrl;
00264 #define MMW_FEE_CTRL_PRE 0x10
00265 #define MMW_FEE_CTRL_DWLD 0x08
00266 #define MMW_FEE_CTRL_CMD 0x07
00267 #define MMW_FEE_CTRL_READ 0x06
00268 #define MMW_FEE_CTRL_WREN 0x04
00269 #define MMW_FEE_CTRL_WRITE 0x05
00270 #define MMW_FEE_CTRL_WRALL 0x04
00271 #define MMW_FEE_CTRL_WDS 0x04
00272 #define MMW_FEE_CTRL_PRREAD 0x16
00273 #define MMW_FEE_CTRL_PREN 0x14
00274 #define MMW_FEE_CTRL_PRCLEAR 0x17
00275 #define MMW_FEE_CTRL_PRWRITE 0x15
00276 #define MMW_FEE_CTRL_PRDS 0x14
00277
00278
00279 unsigned char mmw_fee_addr;
00280 #define MMW_FEE_ADDR_CHANNEL 0xF0
00281 #define MMW_FEE_ADDR_OFFSET 0x0F
00282 #define MMW_FEE_ADDR_EN 0xC0
00283 #define MMW_FEE_ADDR_DS 0x00
00284 #define MMW_FEE_ADDR_ALL 0x40
00285 #define MMW_FEE_ADDR_CLEAR 0xFF
00286
00287 unsigned char mmw_fee_data_l;
00288 unsigned char mmw_fee_data_h;
00289 unsigned char mmw_ext_ant;
00290 #define MMW_EXT_ANT_EXTANT 0x01
00291 #define MMW_EXT_ANT_POL 0x02
00292 #define MMW_EXT_ANT_INTERNAL 0x00
00293 #define MMW_EXT_ANT_EXTERNAL 0x03
00294 #define MMW_EXT_ANT_IQ_TEST 0x1C
00295 };
00296
00297 #define MMW_SIZE 37
00298
00299 #define mmwoff(p,f) (unsigned short)((void *)(&((mmw_t *)((void *)0 + (p)))->f) - (void *)0)
00300
00301
00302
00303
00304 typedef struct mmr_t mmr_t;
00305 struct mmr_t
00306 {
00307 unsigned char mmr_unused0[8];
00308 unsigned char mmr_des_status;
00309 unsigned char mmr_des_avail;
00310 #define MMR_DES_AVAIL_DES 0x55
00311 #define MMR_DES_AVAIL_AES 0x33
00312 unsigned char mmr_des_io_invert;
00313 unsigned char mmr_unused1[5];
00314 unsigned char mmr_dce_status;
00315 #define MMR_DCE_STATUS_RX_BUSY 0x01
00316 #define MMR_DCE_STATUS_LOOPT_IND 0x02
00317 #define MMR_DCE_STATUS_TX_BUSY 0x04
00318 #define MMR_DCE_STATUS_JBR_EXPIRED 0x08
00319 #define MMR_DCE_STATUS 0x0F
00320 unsigned char mmr_dsp_id;
00321 unsigned char mmr_unused2[2];
00322 unsigned char mmr_correct_nwid_l;
00323 unsigned char mmr_correct_nwid_h;
00324
00325 unsigned char mmr_wrong_nwid_l;
00326 unsigned char mmr_wrong_nwid_h;
00327 unsigned char mmr_thr_pre_set;
00328 #define MMR_THR_PRE_SET 0x3F
00329 #define MMR_THR_PRE_SET_CUR 0x80
00330 unsigned char mmr_signal_lvl;
00331 #define MMR_SIGNAL_LVL 0x3F
00332 #define MMR_SIGNAL_LVL_VALID 0x80
00333 unsigned char mmr_silence_lvl;
00334 #define MMR_SILENCE_LVL 0x3F
00335 #define MMR_SILENCE_LVL_VALID 0x80
00336 unsigned char mmr_sgnl_qual;
00337 #define MMR_SGNL_QUAL 0x0F
00338 #define MMR_SGNL_QUAL_ANT 0x80
00339 unsigned char mmr_netw_id_l;
00340 unsigned char mmr_unused3[3];
00341
00342
00343 unsigned char mmr_fee_status;
00344 #define MMR_FEE_STATUS_ID 0xF0
00345 #define MMR_FEE_STATUS_DWLD 0x08
00346 #define MMR_FEE_STATUS_BUSY 0x04
00347 unsigned char mmr_unused4[1];
00348 unsigned char mmr_fee_data_l;
00349 unsigned char mmr_fee_data_h;
00350 };
00351
00352 #define MMR_SIZE 36
00353
00354 #define mmroff(p,f) (unsigned short)((void *)(&((mmr_t *)((void *)0 + (p)))->f) - (void *)0)
00355
00356
00357 typedef union mm_t
00358 {
00359 struct mmw_t w;
00360 struct mmr_t r;
00361 } mm_t;
00362
00363 #endif
00364
00365
00366
00367
00368
00369
00370